@peripheries/core 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +1 -1
  2. package/index.css +1 -1
  3. package/index.js +4 -4211
  4. package/package.json +1 -1
  5. package/types/core/Rail/Rail.d.ts +9 -0
  6. package/types/core/_shared/formatters.d.ts +9 -2
  7. package/types/core/_shared/overlay/focusables.d.ts +2 -0
  8. package/types/core/_shared/overlay/hooks.d.ts +4 -0
  9. package/types/core/_shared/overlay/placement.d.ts +28 -0
  10. package/types/core/_shared/overlay/scroll-lock.d.ts +1 -0
  11. package/types/core/_shared/safe-url.d.ts +2 -0
  12. package/types/core/_shared/viewer.d.ts +15 -0
  13. package/types/core/display/DataTable/DataTable.d.ts +5 -3
  14. package/types/core/display/KpiCardGrid/KpiCardGrid.d.ts +1 -0
  15. package/types/core/display/OptionCard/OptionCard.d.ts +1 -0
  16. package/types/core/display/ProfileCard/ProfileCard.d.ts +1 -0
  17. package/types/core/display/SectionHeader/SectionHeader.d.ts +2 -1
  18. package/types/core/display/Stat/Stat.d.ts +2 -1
  19. package/types/core/display/StatStrip/StatStrip.d.ts +2 -1
  20. package/types/core/display/_shared/ValueBadge.d.ts +3 -2
  21. package/types/core/document/ComparisonBars/ComparisonBars.d.ts +2 -1
  22. package/types/core/document/RowList/RowList.d.ts +5 -3
  23. package/types/core/events/CalendarFilters/CalendarFilters.d.ts +22 -0
  24. package/types/core/events/CalendarView/CalendarView.d.ts +23 -0
  25. package/types/core/events/EventCard/EventCard.d.ts +1 -0
  26. package/types/core/events/EventSchedule/EventSchedule.d.ts +2 -0
  27. package/types/core/events/HandoverCard/HandoverCard.d.ts +19 -0
  28. package/types/core/events/HourGrid/HourGrid.d.ts +24 -0
  29. package/types/core/events/LogCard/LogCard.d.ts +27 -0
  30. package/types/core/events/MiniMonth/MiniMonth.d.ts +18 -0
  31. package/types/core/events/NoteSplitCard/NoteSplitCard.d.ts +22 -0
  32. package/types/core/events/QuickNoteCard/QuickNoteCard.d.ts +21 -0
  33. package/types/core/events/ShareApprovalCard/ShareApprovalCard.d.ts +16 -0
  34. package/types/core/events/StartProcessCard/StartProcessCard.d.ts +22 -0
  35. package/types/core/events/SuggestedActions/SuggestedActions.d.ts +10 -0
  36. package/types/core/events/TaskCard/TaskCard.d.ts +17 -0
  37. package/types/core/events/WeekStrip/WeekStrip.d.ts +16 -0
  38. package/types/core/events/_shared/SeriesGlyph.d.ts +9 -0
  39. package/types/core/events/_shared/calendar.d.ts +36 -0
  40. package/types/core/events/_shared/event.d.ts +7 -1
  41. package/types/core/events/_shared/intent.d.ts +18 -0
  42. package/types/core/events/_shared/path.d.ts +1 -0
  43. package/types/core/forms/CodeField/CodeField.d.ts +15 -0
  44. package/types/core/forms/Combobox/Combobox.d.ts +17 -0
  45. package/types/core/forms/Combobox/useCombobox.d.ts +74 -0
  46. package/types/core/overlay/Dialog/Dialog.d.ts +16 -0
  47. package/types/core/overlay/Menu/Menu.d.ts +26 -0
  48. package/types/core/overlay/Popover/Popover.d.ts +19 -0
  49. package/types/core/overlay/Sheet/Sheet.d.ts +21 -0
  50. package/types/core/overlay/Toast/Toast.d.ts +20 -0
  51. package/types/core/overlay/Toast/toast-store.d.ts +51 -0
  52. package/types/core/overlay/_shared/Modal.d.ts +19 -0
  53. package/types/core/public/ContactForm/ContactForm.d.ts +24 -0
  54. package/types/core/public/CtaBand/CtaBand.d.ts +11 -0
  55. package/types/core/public/FeatureGrid/FeatureGrid.d.ts +15 -0
  56. package/types/core/public/Hero/Hero.d.ts +14 -0
  57. package/types/core/public/Image/Image.d.ts +12 -0
  58. package/types/core/public/LogoMark/LogoMark.d.ts +10 -0
  59. package/types/core/public/PublicFooter/PublicFooter.d.ts +15 -0
  60. package/types/core/public/PublicHeader/PublicHeader.d.ts +16 -0
  61. package/types/core/public/TeamGrid/TeamGrid.d.ts +16 -0
  62. package/types/core/public/Testimonial/Testimonial.d.ts +11 -0
  63. package/types/core/public/_shared/actions.d.ts +15 -0
  64. package/types/core/public/_shared/media.d.ts +9 -0
  65. package/types/index.core.d.ts +40 -2
package/index.js CHANGED
@@ -1,4211 +1,4 @@
1
- import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
2
- import { Children as r, createContext as i, isValidElement as a, useCallback as o, useContext as s, useEffect as c, useId as l, useLayoutEffect as u, useMemo as d, useReducer as f, useRef as p, useState as m } from "react";
3
- //#region src/core/_shared/props.ts
4
- var h = /* @__PURE__ */ new Set([
5
- "baseProps",
6
- "data",
7
- "status",
8
- "actions",
9
- "_traversal",
10
- "isLoading",
11
- "error",
12
- "navigate",
13
- "onNavigate",
14
- "size",
15
- "store"
16
- ]);
17
- function g(e) {
18
- let t = {};
19
- for (let n in e) h.has(n) || (t[n] = e[n]);
20
- return t;
21
- }
22
- var _ = (...e) => e.filter(Boolean).join(" ") || void 0, v = (e) => e === void 0 ? void 0 : typeof e == "number" ? `${e}px` : e;
23
- function y(e, t) {
24
- let n = Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
25
- return Object.keys(n).length || t ? {
26
- ...n,
27
- ...t
28
- } : void 0;
29
- }
30
- //#endregion
31
- //#region src/core/Box/Box.tsx
32
- function b({ as: e, className: n, children: r, ...i }) {
33
- return /* @__PURE__ */ t(e ?? "div", {
34
- className: _("core-box", n),
35
- ...g(i),
36
- children: r
37
- });
38
- }
39
- //#endregion
40
- //#region src/core/Center/Center.tsx
41
- function x({ minHeight: e, className: n, style: r, children: i, ...a }) {
42
- return /* @__PURE__ */ t(b, {
43
- ...a,
44
- className: _("core-center", n),
45
- style: y({ "--core-center-min-height": v(e) }, r),
46
- children: i
47
- });
48
- }
49
- //#endregion
50
- //#region src/core/Container/Container.tsx
51
- function S({ name: e, className: n, style: r, children: i, ...a }) {
52
- return /* @__PURE__ */ t(b, {
53
- ...a,
54
- className: _("core-container", n),
55
- style: y({ "--core-container-name": e }, r),
56
- children: i
57
- });
58
- }
59
- //#endregion
60
- //#region src/core/Divider/Divider.tsx
61
- function C({ orientation: e = "horizontal", weight: n = "subtle", spacing: r, className: i, style: a, ref: o, ...s }) {
62
- let c = {
63
- className: _("core-divider", i),
64
- "data-weight": n,
65
- "data-orientation": e,
66
- style: y({ "--core-divider-spacing": v(r) }, a)
67
- };
68
- return e === "vertical" ? /* @__PURE__ */ t("span", {
69
- role: "separator",
70
- "aria-orientation": "vertical",
71
- ...c
72
- }) : /* @__PURE__ */ t("hr", {
73
- ref: o,
74
- ...g(s),
75
- ...c
76
- });
77
- }
78
- //#endregion
79
- //#region src/core/Hide/Hide.tsx
80
- function w({ when: e, children: n, as: r = "span" }) {
81
- return /* @__PURE__ */ t(r, {
82
- className: "core-hide",
83
- "data-when": e,
84
- children: n
85
- });
86
- }
87
- //#endregion
88
- //#region src/core/Inline/Inline.tsx
89
- function T({ gap: e, align: n = "center", justify: r = "start", wrap: i = !0, stackWhen: a, className: o, style: s, children: c, ...l }) {
90
- return /* @__PURE__ */ t(b, {
91
- ...l,
92
- className: _("core-inline", o),
93
- "data-align": n,
94
- "data-justify": r,
95
- "data-wrap": i ? "true" : "false",
96
- "data-stack-when": a,
97
- style: y({ "--core-inline-gap": v(e) }, s),
98
- children: c
99
- });
100
- }
101
- //#endregion
102
- //#region src/core/Show/Show.tsx
103
- function E({ when: e, children: n, as: r = "span" }) {
104
- return /* @__PURE__ */ t(r, {
105
- className: "core-show",
106
- "data-when": e,
107
- children: n
108
- });
109
- }
110
- //#endregion
111
- //#region src/core/Spacer/Spacer.tsx
112
- function D({ size: e, className: n, style: r }) {
113
- return /* @__PURE__ */ t("span", {
114
- "aria-hidden": !0,
115
- className: _("core-spacer", n),
116
- style: y({ "--core-spacer-size": v(e) }, r)
117
- });
118
- }
119
- //#endregion
120
- //#region src/core/Stack/Stack.tsx
121
- function O({ gap: e, align: n = "stretch", justify: r = "start", className: i, style: a, children: o, ...s }) {
122
- return /* @__PURE__ */ t(b, {
123
- ...s,
124
- className: _("core-stack", i),
125
- "data-align": n,
126
- "data-justify": r,
127
- style: y({ "--core-stack-gap": v(e) }, a),
128
- children: o
129
- });
130
- }
131
- //#endregion
132
- //#region src/core/actions/_shared/press.ts
133
- var k = (e) => e.startsWith("/") && !e.startsWith("//") && !e.includes("\\"), A = (e) => /^#[A-Za-z][\w:.-]*$/.test(e);
134
- function j({ href: e, action: t, input: n, actions: r, navigate: i, onClick: a }) {
135
- let [o, s] = m(!1), c = r && t ? r[t] : void 0;
136
- return {
137
- busy: o,
138
- onClick: (t) => {
139
- if (a) return a(t);
140
- if (c) {
141
- t.preventDefault(), s(!0), c(n).finally(() => s(!1));
142
- return;
143
- }
144
- e && i && k(e) && t.button === 0 && !t.metaKey && !t.ctrlKey && !t.shiftKey && !t.altKey && (t.preventDefault(), i(e));
145
- },
146
- external: !!e && !k(e) && !A(e)
147
- };
148
- }
149
- //#endregion
150
- //#region src/core/page/ListRow/ListRow.tsx
151
- function M({ title: e, meta: r, leading: i, value: a, trailing: o, href: s, navigate: c, onClick: l, as: u = "div", className: d, ...f }) {
152
- let p = j({
153
- href: s,
154
- navigate: c,
155
- onClick: l
156
- }), m = u, h = s ? /* @__PURE__ */ t("a", {
157
- className: "core-list-row__title core-list-row__link",
158
- href: s,
159
- onClick: p.onClick,
160
- ...p.external ? {
161
- target: "_blank",
162
- rel: "noopener noreferrer"
163
- } : {},
164
- children: e
165
- }) : /* @__PURE__ */ t("span", {
166
- className: "core-list-row__title",
167
- children: e
168
- });
169
- return /* @__PURE__ */ n(m, {
170
- ...g(f),
171
- className: _("core-list-row", d),
172
- children: [
173
- i != null && /* @__PURE__ */ t("div", {
174
- className: "core-list-row__leading",
175
- children: i
176
- }),
177
- /* @__PURE__ */ n("div", {
178
- className: "core-list-row__main",
179
- children: [h, r != null && /* @__PURE__ */ t("span", {
180
- className: "core-list-row__meta",
181
- children: r
182
- })]
183
- }),
184
- a != null && /* @__PURE__ */ t("div", {
185
- className: "core-list-row__value",
186
- children: a
187
- }),
188
- o != null && /* @__PURE__ */ t("div", {
189
- className: "core-list-row__trailing",
190
- children: o
191
- })
192
- ]
193
- });
194
- }
195
- //#endregion
196
- //#region src/core/page/PageFrame/PageFrame.tsx
197
- function N({ header: e, children: r, measure: i = "page", className: a, ...o }) {
198
- return /* @__PURE__ */ t("div", {
199
- ...g(o),
200
- className: _("core-page-frame", a),
201
- "data-measure": i,
202
- children: /* @__PURE__ */ n("div", {
203
- className: "core-page-frame__column",
204
- children: [e != null && /* @__PURE__ */ t("header", {
205
- className: "core-page-frame__header",
206
- children: e
207
- }), r]
208
- })
209
- });
210
- }
211
- //#endregion
212
- //#region src/core/_shared/warn-once.ts
213
- var P = /* @__PURE__ */ new Set();
214
- function F(e, t) {
215
- P.has(e) || (P.add(e), typeof console < "u" && console.warn(t));
216
- }
217
- //#endregion
218
- //#region src/core/display/_shared/tone.ts
219
- var I = [
220
- "neutral",
221
- "strong",
222
- "accent",
223
- "info",
224
- "success",
225
- "warning",
226
- "danger"
227
- ], L = () => typeof process > "u" || !1;
228
- function R(e, t = "neutral") {
229
- return typeof e == "string" && I.includes(e) ? e : (typeof e == "string" && e && L() && F(`unknown-tone:${e}`, `[core] "${e}" is not a tone (${I.join(", ")}); using "${t}".`), t);
230
- }
231
- //#endregion
232
- //#region src/core/display/Eyebrow/Eyebrow.tsx
233
- var z = [
234
- "subtle",
235
- "on-dark",
236
- "inherit"
237
- ];
238
- function B(e, t) {
239
- return typeof e == "string" && (z.includes(e) || I.includes(e)) ? e : t;
240
- }
241
- function ee(e) {
242
- return {
243
- "data-tone": e,
244
- toned: !z.includes(e)
245
- };
246
- }
247
- function V({ children: e, as: n = "span", tone: r, tabular: i = !1, className: a, style: o }) {
248
- let { toned: s, ...c } = ee(B(r, "subtle"));
249
- return /* @__PURE__ */ t(n, {
250
- className: _("core-eyebrow", s && "core-toned", a),
251
- ...c,
252
- "data-tabular": i ? "true" : void 0,
253
- style: o,
254
- children: e
255
- });
256
- }
257
- //#endregion
258
- //#region src/core/page/PageHead/PageHead.tsx
259
- function te({ title: e, eyebrow: r, intro: i, actions: a, className: o, ...s }) {
260
- return /* @__PURE__ */ n("header", {
261
- ...g(s),
262
- className: _("core-page-head", o),
263
- children: [
264
- r && /* @__PURE__ */ t(V, {
265
- as: "p",
266
- children: r
267
- }),
268
- /* @__PURE__ */ n("div", {
269
- className: "core-page-head__row",
270
- children: [/* @__PURE__ */ t("h1", {
271
- className: "core-page-head__title",
272
- children: e
273
- }), a != null && /* @__PURE__ */ t("div", {
274
- className: "core-page-head__actions",
275
- children: a
276
- })]
277
- }),
278
- i != null && /* @__PURE__ */ t("p", {
279
- className: "core-page-head__intro",
280
- children: i
281
- })
282
- ]
283
- });
284
- }
285
- //#endregion
286
- //#region src/core/page/RuleSection/RuleSection.tsx
287
- function ne({ label: e, actions: r, children: i, rail: a = !1, anchor: o, className: s, ...c }) {
288
- return /* @__PURE__ */ t("section", {
289
- ...g(c),
290
- id: o,
291
- "aria-label": e,
292
- className: _("core-rule-section", s),
293
- "data-rail": a || void 0,
294
- children: /* @__PURE__ */ n("div", {
295
- className: "core-rule-section__grid",
296
- children: [/* @__PURE__ */ n("div", {
297
- className: "core-rule-section__head",
298
- children: [e && /* @__PURE__ */ t(V, {
299
- as: "p",
300
- children: e
301
- }), r != null && /* @__PURE__ */ t("div", {
302
- className: "core-rule-section__actions",
303
- children: r
304
- })]
305
- }), /* @__PURE__ */ t("div", {
306
- className: "core-rule-section__body",
307
- children: i
308
- })]
309
- })
310
- });
311
- }
312
- //#endregion
313
- //#region src/core/page/UnderlinedAction/UnderlinedAction.tsx
314
- function re({ label: r, children: i, arrow: a = !0, className: o, href: s, action: c, input: l, actions: u, navigate: d, onClick: f, ...p }) {
315
- let m = j({
316
- href: s,
317
- action: c,
318
- input: l,
319
- actions: u,
320
- navigate: d,
321
- onClick: f
322
- }), h = /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
323
- className: "core-underlined-action__label",
324
- children: i ?? r
325
- }), a && /* @__PURE__ */ t("svg", {
326
- className: "core-underlined-action__arrow",
327
- viewBox: "0 0 24 24",
328
- fill: "none",
329
- stroke: "currentColor",
330
- strokeWidth: "1.6",
331
- strokeLinecap: "round",
332
- strokeLinejoin: "round",
333
- "aria-hidden": "true",
334
- focusable: "false",
335
- children: /* @__PURE__ */ t("path", { d: "M5 12h14M13 6l6 6-6 6" })
336
- })] }), v = {
337
- ...g(p),
338
- className: _("core-underlined-action", o)
339
- };
340
- return s ? /* @__PURE__ */ t("a", {
341
- ...v,
342
- href: s,
343
- onClick: m.onClick,
344
- ...m.external ? {
345
- target: "_blank",
346
- rel: "noopener noreferrer"
347
- } : {},
348
- children: h
349
- }) : /* @__PURE__ */ t("button", {
350
- ...v,
351
- type: "button",
352
- onClick: m.onClick,
353
- disabled: m.busy,
354
- children: h
355
- });
356
- }
357
- //#endregion
358
- //#region src/core/text/Avatar/Avatar.tsx
359
- var ie = (e = "") => e.trim().split(/\s+/).filter(Boolean).map((e) => e[0].toUpperCase()).filter((e, t, n) => t === 0 || t === n.length - 1).join("").slice(0, 2);
360
- function ae({ name: e, initials: n, src: r, alt: i, size: a = "md", className: o, ...s }) {
361
- let [c, l] = m(!1), u = i ?? e ?? "";
362
- return /* @__PURE__ */ t("span", {
363
- ...g(s),
364
- className: _("core-avatar", o),
365
- "data-size": a,
366
- role: "img",
367
- "aria-label": u || void 0,
368
- children: r && !c ? /* @__PURE__ */ t("img", {
369
- src: r,
370
- alt: "",
371
- onError: () => l(!0)
372
- }) : /* @__PURE__ */ t("span", {
373
- "aria-hidden": "true",
374
- children: n ?? ie(e)
375
- })
376
- });
377
- }
378
- //#endregion
379
- //#region src/core/text/Code/Code.tsx
380
- function oe({ code: e, children: n, block: r = !1, className: i, ...a }) {
381
- let o = n ?? e;
382
- return r ? /* @__PURE__ */ t("pre", {
383
- ...g(a),
384
- className: _("core-code", i),
385
- "data-block": "",
386
- children: /* @__PURE__ */ t("code", { children: o })
387
- }) : /* @__PURE__ */ t("code", {
388
- ...g(a),
389
- className: _("core-code", i),
390
- children: o
391
- });
392
- }
393
- //#endregion
394
- //#region src/core/text/Heading/Heading.tsx
395
- var se = {
396
- 1: "lg",
397
- 2: "md",
398
- 3: "sm",
399
- 4: "xs",
400
- 5: "xs",
401
- 6: "xs"
402
- };
403
- function ce({ text: e, children: n, level: r = 2, size: i, anchor: a, className: o, ...s }) {
404
- let c = Math.min(6, Math.max(1, Math.round(r))), l = `h${c}`;
405
- return /* @__PURE__ */ t(l, {
406
- ...g(s),
407
- id: a,
408
- className: _("core-heading", o),
409
- "data-size": i ?? se[c],
410
- children: n ?? e
411
- });
412
- }
413
- //#endregion
414
- //#region src/core/text/Text/Text.tsx
415
- var le = {
416
- xs: "eyebrow",
417
- sm: "body-sm",
418
- md: "body",
419
- lg: "title-sm",
420
- xl: "title-md"
421
- };
422
- function ue({ text: e, children: n, as: r = "span", size: i = "md", weight: a = "normal", tone: o = "default", align: s = "start", truncate: c = !1, lines: l, className: u, ...d }) {
423
- let f = r, p = l && l > 0 ? Math.min(6, Math.round(l)) : void 0;
424
- return /* @__PURE__ */ t(f, {
425
- ...g(d),
426
- className: _("core-text", u),
427
- "data-role": le[i] ?? "body",
428
- "data-weight": a,
429
- "data-tone": o,
430
- "data-align": s,
431
- "data-truncate": c || void 0,
432
- "data-lines": p,
433
- children: n ?? e
434
- });
435
- }
436
- //#endregion
437
- //#region src/core/forms/FormField/FormField.tsx
438
- function H({ label: e, hint: r, error: i, required: a, htmlFor: o, hintId: s, errorId: c, as: u = "div", children: d, className: f, style: p }) {
439
- let m = l().replace(/:/g, ""), h = s ?? (r ? `${o ?? m}-hint` : void 0), g = c ?? (i ? `${o ?? m}-error` : void 0), v = u, y = u === "fieldset" ? "legend" : "label";
440
- return /* @__PURE__ */ n(v, {
441
- className: _("core-field", f),
442
- style: p,
443
- "data-invalid": i ? "" : void 0,
444
- children: [
445
- e && /* @__PURE__ */ n(y, {
446
- className: "core-field__label",
447
- ...y === "label" && o ? { htmlFor: o } : {},
448
- children: [e, a && /* @__PURE__ */ n("span", {
449
- className: "core-field__required",
450
- "aria-hidden": "true",
451
- children: [" ", "*"]
452
- })]
453
- }),
454
- r && /* @__PURE__ */ t("p", {
455
- className: "core-field__hint",
456
- id: h,
457
- children: r
458
- }),
459
- d,
460
- i && /* @__PURE__ */ t("p", {
461
- className: "core-field__error",
462
- id: g,
463
- children: i
464
- })
465
- ]
466
- });
467
- }
468
- //#endregion
469
- //#region src/core/forms/_shared/field.tsx
470
- function U(e, t, n) {
471
- let r = l(), i = e ?? `f${r.replace(/:/g, "")}`, a = t ? `${i}-hint` : void 0, o = n ? `${i}-error` : void 0;
472
- return {
473
- control: i,
474
- hintId: a,
475
- errorId: o,
476
- aria: {
477
- "aria-describedby": [a, o].filter(Boolean).join(" ") || void 0,
478
- "aria-invalid": n ? !0 : void 0
479
- }
480
- };
481
- }
482
- function W(e, t) {
483
- return (n) => {
484
- e?.(n), t?.(n);
485
- };
486
- }
487
- //#endregion
488
- //#region src/core/forms/Checkbox/Checkbox.tsx
489
- function de({ value: e, defaultValue: r, onChange: i, setValue: a, id: o, name: s, label: c, children: l, hint: u, error: d, required: f, disabled: p, readOnly: h, className: g, style: v, ref: y }) {
490
- let b = U(o, u, d), [x, S] = m(r ?? !1), C = e ?? x, w = W(i, a);
491
- return /* @__PURE__ */ t(H, {
492
- className: _("core-checkbox", g),
493
- style: v,
494
- hint: u,
495
- error: d,
496
- hintId: b.hintId,
497
- errorId: b.errorId,
498
- children: /* @__PURE__ */ n("label", {
499
- className: "core-choices__option",
500
- "data-disabled": p ? "" : void 0,
501
- children: [/* @__PURE__ */ t("input", {
502
- ref: y,
503
- id: b.control,
504
- type: "checkbox",
505
- name: s,
506
- checked: C,
507
- required: f,
508
- "aria-required": f || void 0,
509
- disabled: p,
510
- "aria-readonly": h || void 0,
511
- onChange: (t) => {
512
- h || (e === void 0 && S(t.target.checked), w(t.target.checked));
513
- },
514
- ...b.aria
515
- }), /* @__PURE__ */ n("span", { children: [l ?? c, f && /* @__PURE__ */ t("span", {
516
- className: "core-field__required",
517
- "aria-hidden": "true",
518
- children: " *"
519
- })] })]
520
- })
521
- });
522
- }
523
- //#endregion
524
- //#region src/core/forms/CheckboxGroup/CheckboxGroup.tsx
525
- function fe({ options: e, value: r, defaultValue: i, onChange: a, setValue: o, id: s, name: c, label: l, hint: u, error: d, required: f, disabled: p, readOnly: h, orientation: g = "vertical", min: v, max: y, className: b, style: x, ref: S }) {
526
- let C = [v === void 0 ? "" : `at least ${v}`, y === void 0 ? "" : `at most ${y}`].filter(Boolean).join(", "), w = [u, C ? `Choose ${C}.` : ""].filter(Boolean).join(" ") || void 0, T = U(s, w, d), [E, D] = m(i ?? []), O = r ?? E, k = W(a, o), A = y !== void 0 && O.length >= y;
527
- return /* @__PURE__ */ t(H, {
528
- as: "fieldset",
529
- className: _("core-choices", b),
530
- style: x,
531
- label: l,
532
- hint: w,
533
- error: d,
534
- required: f,
535
- hintId: T.hintId,
536
- errorId: T.errorId,
537
- children: /* @__PURE__ */ t("div", {
538
- className: "core-choices__list",
539
- "data-orientation": g,
540
- role: "group",
541
- ...T.aria,
542
- children: e.map((i, a) => {
543
- let o = O.includes(i.value);
544
- return /* @__PURE__ */ n("label", {
545
- className: "core-choices__option",
546
- "data-disabled": i.disabled || p ? "" : void 0,
547
- children: [/* @__PURE__ */ t("input", {
548
- ref: a === 0 ? S : void 0,
549
- id: a === 0 ? T.control : void 0,
550
- type: "checkbox",
551
- name: c,
552
- value: i.value,
553
- checked: o,
554
- disabled: i.disabled || p || !o && A || h && !o,
555
- "aria-readonly": h || void 0,
556
- onChange: () => {
557
- if (h) return;
558
- let t = e.map((e) => e.value).filter((e) => e === i.value ? !o : O.includes(e));
559
- r === void 0 && D(t), k(t);
560
- }
561
- }), /* @__PURE__ */ t("span", { children: i.label })]
562
- }, i.value);
563
- })
564
- })
565
- });
566
- }
567
- //#endregion
568
- //#region src/core/forms/DateRange/DateRange.tsx
569
- function pe({ value: e, defaultValue: r, onChange: i, setValue: a, id: o, name: s, label: c, hint: l, error: u, required: d, disabled: f, readOnly: p, min: h, max: g, fromLabel: v = "From", toLabel: y = "To", className: b, style: x, ref: S }) {
570
- let C = U(o, l, u), [w, T] = m(r ?? {
571
- from: null,
572
- to: null
573
- }), E = e ?? w, D = W(i, a), O = (t, n) => {
574
- if (p) return;
575
- let r = {
576
- ...E,
577
- [t]: n === "" ? null : n
578
- };
579
- e === void 0 && T(r), D(r);
580
- }, k = {
581
- disabled: f,
582
- readOnly: p,
583
- required: d,
584
- "aria-required": d || void 0,
585
- className: "core-input",
586
- ...C.aria
587
- };
588
- return /* @__PURE__ */ t(H, {
589
- as: "fieldset",
590
- className: _("core-date-range", b),
591
- style: x,
592
- label: c,
593
- hint: l,
594
- error: u,
595
- required: d,
596
- hintId: C.hintId,
597
- errorId: C.errorId,
598
- children: /* @__PURE__ */ n("div", {
599
- className: "core-date-range__row",
600
- children: [/* @__PURE__ */ n("label", {
601
- className: "core-date-range__part",
602
- children: [/* @__PURE__ */ t("span", {
603
- className: "core-date-range__label",
604
- children: v
605
- }), /* @__PURE__ */ t("input", {
606
- ref: S,
607
- id: C.control,
608
- type: "date",
609
- name: s ? `${s}.from` : void 0,
610
- value: E.from ?? "",
611
- min: h,
612
- max: E.to ?? g,
613
- onChange: (e) => O("from", e.target.value),
614
- ...k
615
- })]
616
- }), /* @__PURE__ */ n("label", {
617
- className: "core-date-range__part",
618
- children: [/* @__PURE__ */ t("span", {
619
- className: "core-date-range__label",
620
- children: y
621
- }), /* @__PURE__ */ t("input", {
622
- type: "date",
623
- name: s ? `${s}.to` : void 0,
624
- value: E.to ?? "",
625
- min: E.from ?? h,
626
- max: g,
627
- onChange: (e) => O("to", e.target.value),
628
- ...k
629
- })]
630
- })]
631
- })
632
- });
633
- }
634
- //#endregion
635
- //#region src/core/forms/FileField/FileField.tsx
636
- function me(e) {
637
- return !Number.isFinite(e) || e < 0 ? "" : e < 1024 ? `${e} B` : e < 1048576 ? `${(e / 1024).toFixed(+(e < 10240))} KB` : `${(e / 1048576).toFixed(1)} MB`;
638
- }
639
- function he({ value: r, defaultValue: i, onChange: a, setValue: o, id: s, name: c, label: l, hint: u, error: d, required: f, disabled: h, readOnly: g, upload: v, accept: y, hash: b = !1, className: x, style: S, ref: C }) {
640
- let w = U(s, u, d), [T, E] = m(i ?? null), D = r === void 0 ? T : r, O = W(a, o), [k, A] = m({
641
- busy: !1,
642
- dragging: !1
643
- }), j = p(null), M = (e) => {
644
- r === void 0 && E(e), O(e);
645
- }, N = async (e) => {
646
- if (e && v && !g && !h) {
647
- A({
648
- busy: !0,
649
- dragging: !1
650
- });
651
- try {
652
- let t = await v(e, { hash: b });
653
- "error" in t ? A({
654
- busy: !1,
655
- failed: t.error,
656
- dragging: !1
657
- }) : (A({
658
- busy: !1,
659
- dragging: !1
660
- }), M(t));
661
- } catch {
662
- A({
663
- busy: !1,
664
- failed: "That file couldn’t be stored. Try again.",
665
- dragging: !1
666
- });
667
- }
668
- }
669
- }, P = (e) => {
670
- e.preventDefault(), N(e.dataTransfer.files?.[0]);
671
- }, F = d ?? k.failed;
672
- return /* @__PURE__ */ t(H, {
673
- className: _("core-file-field", x),
674
- style: S,
675
- label: l,
676
- hint: u,
677
- error: F,
678
- required: f,
679
- htmlFor: w.control,
680
- hintId: w.hintId,
681
- errorId: F ? `${w.control}-error` : void 0,
682
- children: /* @__PURE__ */ n("div", {
683
- className: "core-file-field__box",
684
- "data-dragging": k.dragging ? "" : void 0,
685
- "data-busy": k.busy ? "" : void 0,
686
- onDragOver: (e) => {
687
- g || h || !v || (e.preventDefault(), k.dragging || A((e) => ({
688
- ...e,
689
- dragging: !0
690
- })));
691
- },
692
- onDragLeave: () => A((e) => ({
693
- ...e,
694
- dragging: !1
695
- })),
696
- onDrop: P,
697
- children: [D ? /* @__PURE__ */ n("div", {
698
- className: "core-file-field__file",
699
- children: [
700
- /* @__PURE__ */ t("span", {
701
- className: "core-file-field__name",
702
- children: D.file.name
703
- }),
704
- /* @__PURE__ */ t("span", {
705
- className: "core-file-field__size",
706
- children: me(D.file.size)
707
- }),
708
- !g && !h && /* @__PURE__ */ t("button", {
709
- type: "button",
710
- className: "core-file-field__button",
711
- onClick: () => M(null),
712
- "aria-label": `Remove ${D.file.name}`,
713
- children: "Remove"
714
- })
715
- ]
716
- }) : k.busy ? /* @__PURE__ */ t("span", {
717
- className: "core-file-field__status",
718
- role: "status",
719
- children: "Uploading…"
720
- }) : /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("button", {
721
- ref: C,
722
- id: w.control,
723
- type: "button",
724
- className: "core-file-field__button",
725
- disabled: h || g || !v,
726
- "aria-required": f || void 0,
727
- "aria-describedby": [w.hintId, F ? `${w.control}-error` : void 0].filter(Boolean).join(" ") || void 0,
728
- "aria-invalid": F ? !0 : void 0,
729
- onClick: () => j.current?.click(),
730
- children: "Choose file"
731
- }), /* @__PURE__ */ t("span", {
732
- className: "core-file-field__drop",
733
- children: "or drop it here"
734
- })] }), /* @__PURE__ */ t("input", {
735
- ref: j,
736
- type: "file",
737
- name: c,
738
- accept: y,
739
- hidden: !0,
740
- tabIndex: -1,
741
- onChange: (e) => void N(e.target.files?.[0])
742
- })]
743
- })
744
- });
745
- }
746
- //#endregion
747
- //#region src/core/forms/RadioGroup/RadioGroup.tsx
748
- function ge({ options: e, value: r, defaultValue: i, onChange: a, setValue: o, id: s, name: c, label: l, hint: u, error: d, required: f, disabled: p, readOnly: h, orientation: g = "vertical", className: v, style: y, ref: b }) {
749
- let x = U(s, u, d), [S, C] = m(i ?? null), w = r === void 0 ? S : r, T = W(a, o), E = c ?? x.control;
750
- return /* @__PURE__ */ t(H, {
751
- as: "fieldset",
752
- className: _("core-choices", v),
753
- style: y,
754
- label: l,
755
- hint: u,
756
- error: d,
757
- required: f,
758
- hintId: x.hintId,
759
- errorId: x.errorId,
760
- children: /* @__PURE__ */ t("div", {
761
- className: "core-choices__list",
762
- "data-orientation": g,
763
- role: "radiogroup",
764
- "aria-required": f || void 0,
765
- ...x.aria,
766
- children: e.map((e, i) => /* @__PURE__ */ n("label", {
767
- className: "core-choices__option",
768
- "data-disabled": e.disabled || p ? "" : void 0,
769
- children: [/* @__PURE__ */ t("input", {
770
- ref: i === 0 ? b : void 0,
771
- id: i === 0 ? x.control : void 0,
772
- type: "radio",
773
- name: E,
774
- value: e.value,
775
- checked: w === e.value,
776
- disabled: e.disabled || p || h && w !== e.value,
777
- onChange: () => {
778
- h || (r === void 0 && C(e.value), T(e.value));
779
- }
780
- }), /* @__PURE__ */ t("span", { children: e.label })]
781
- }, e.value))
782
- })
783
- });
784
- }
785
- //#endregion
786
- //#region src/core/forms/TextField/TextField.tsx
787
- var _e = (e) => {
788
- if (e.trim() === "") return null;
789
- let t = Number(e);
790
- return Number.isFinite(t) ? t : null;
791
- };
792
- function ve({ type: e = "text", value: r, defaultValue: i, onChange: a, setValue: o, id: s, name: l, label: u, hint: d, error: f, required: p, disabled: h, readOnly: g, placeholder: v, inputMode: y, autoComplete: b, min: x, max: S, step: C, prefix: w, suffix: T, onEnter: E, onKeyDown: D, onBlur: O, className: k, style: A, ref: j }) {
793
- let M = U(s, d, f), [N, P] = m(i), F = r === void 0 ? N : r, I = W(a, o), L = (e) => e == null ? "" : String(e), [R, z] = m(L(F));
794
- c(() => {
795
- e === "number" && _e(R) !== (F ?? null) && z(L(F));
796
- }, [F]);
797
- let B = /* @__PURE__ */ t("input", {
798
- ref: j,
799
- id: M.control,
800
- name: l,
801
- type: e === "number" ? "text" : e,
802
- className: "core-input core-text-field__input",
803
- value: e === "number" ? R : L(F),
804
- onChange: (t) => {
805
- let n = t.target.value, i = e === "number" ? _e(n) : n;
806
- e === "number" && z(n), r === void 0 && P(i), I(i);
807
- },
808
- onKeyDown: (e) => {
809
- D?.(e), !e.defaultPrevented && E && e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing && e.keyCode !== 229 && E(e);
810
- },
811
- onBlur: O,
812
- placeholder: v,
813
- inputMode: y ?? (e === "number" ? "decimal" : void 0),
814
- autoComplete: b,
815
- min: e === "number" ? void 0 : x,
816
- max: e === "number" ? void 0 : S,
817
- step: e === "number" ? void 0 : C,
818
- required: p,
819
- "aria-required": p || void 0,
820
- disabled: h,
821
- readOnly: g,
822
- ...M.aria
823
- }), ee = w || T ? /* @__PURE__ */ n("div", {
824
- className: "core-text-field__affixed",
825
- children: [
826
- w && /* @__PURE__ */ t("span", {
827
- className: "core-text-field__affix",
828
- "aria-hidden": "true",
829
- children: w
830
- }),
831
- B,
832
- T && /* @__PURE__ */ t("span", {
833
- className: "core-text-field__affix",
834
- "aria-hidden": "true",
835
- children: T
836
- })
837
- ]
838
- }) : B;
839
- return /* @__PURE__ */ t(H, {
840
- className: _("core-text-field", k),
841
- style: A,
842
- label: u,
843
- hint: d,
844
- error: f,
845
- required: p,
846
- htmlFor: M.control,
847
- hintId: M.hintId,
848
- errorId: M.errorId,
849
- children: ee
850
- });
851
- }
852
- //#endregion
853
- //#region src/core/forms/SearchField/SearchField.tsx
854
- function ye({ value: e, defaultValue: r, onChange: i, setValue: a, label: o = "Search", onSearch: s, size: c = "md", className: l, ...u }) {
855
- let [d, f] = m(r ?? ""), p = e ?? d, h = (t) => {
856
- e === void 0 && f(t), i?.(t), a?.(t);
857
- };
858
- return /* @__PURE__ */ n("div", {
859
- className: _("core-search-field", l),
860
- "data-filled": p ? "" : void 0,
861
- "data-size": c,
862
- children: [
863
- /* @__PURE__ */ t(ve, {
864
- ...u,
865
- label: o,
866
- value: p,
867
- onChange: (e) => h(typeof e == "string" ? e : ""),
868
- onEnter: () => s?.(p),
869
- inputMode: "search",
870
- className: "core-search-field__field"
871
- }),
872
- /* @__PURE__ */ n("svg", {
873
- className: "core-search-field__icon",
874
- viewBox: "0 0 24 24",
875
- fill: "none",
876
- stroke: "currentColor",
877
- strokeWidth: "1.6",
878
- strokeLinecap: "round",
879
- "aria-hidden": "true",
880
- focusable: "false",
881
- children: [/* @__PURE__ */ t("circle", {
882
- cx: "11",
883
- cy: "11",
884
- r: "6.5"
885
- }), /* @__PURE__ */ t("path", { d: "M16 16l4 4" })]
886
- }),
887
- p && !u.disabled && !u.readOnly && /* @__PURE__ */ t("button", {
888
- type: "button",
889
- className: "core-search-field__clear",
890
- "aria-label": "Clear search",
891
- onClick: () => h(""),
892
- children: /* @__PURE__ */ t("svg", {
893
- viewBox: "0 0 24 24",
894
- fill: "none",
895
- stroke: "currentColor",
896
- strokeWidth: "1.6",
897
- strokeLinecap: "round",
898
- "aria-hidden": "true",
899
- focusable: "false",
900
- children: /* @__PURE__ */ t("path", { d: "M6 6l12 12M18 6L6 18" })
901
- })
902
- })
903
- ]
904
- });
905
- }
906
- //#endregion
907
- //#region src/core/forms/Select/Select.tsx
908
- function be({ options: e, value: r, defaultValue: i, onChange: a, setValue: o, id: s, name: c, label: l, hint: u, error: d, required: f, disabled: p, readOnly: h, placeholder: g = "Choose…", className: v, style: y, ref: b }) {
909
- let x = U(s, u, d), [S, C] = m(i ?? null), w = r === void 0 ? S : r, T = W(a, o);
910
- return /* @__PURE__ */ t(H, {
911
- className: _("core-select", v),
912
- style: y,
913
- label: l,
914
- hint: u,
915
- error: d,
916
- required: f,
917
- htmlFor: x.control,
918
- hintId: x.hintId,
919
- errorId: x.errorId,
920
- children: /* @__PURE__ */ n("select", {
921
- ref: b,
922
- id: x.control,
923
- name: c,
924
- className: "core-input core-select__input",
925
- value: w ?? "",
926
- onChange: (e) => {
927
- let t = e.target.value === "" ? null : e.target.value;
928
- r === void 0 && C(t), T(t);
929
- },
930
- required: f,
931
- "aria-required": f || void 0,
932
- disabled: p || h,
933
- "aria-readonly": h || void 0,
934
- ...x.aria,
935
- children: [/* @__PURE__ */ t("option", {
936
- value: "",
937
- children: g
938
- }), e.map((e) => /* @__PURE__ */ t("option", {
939
- value: e.value,
940
- disabled: e.disabled,
941
- children: e.label
942
- }, e.value))]
943
- })
944
- });
945
- }
946
- //#endregion
947
- //#region src/core/forms/Slider/Slider.tsx
948
- function xe({ value: e, defaultValue: r, onChange: i, setValue: a, id: o, name: s, label: c, hint: l, error: u, required: d, disabled: f, readOnly: p, min: h = 0, max: g = 100, step: v = 1, format: y = String, className: b, style: x, ref: S }) {
949
- let C = U(o, l, u), [w, T] = m(r ?? h), E = e ?? w, D = W(i, a);
950
- return /* @__PURE__ */ t(H, {
951
- className: _("core-slider", b),
952
- style: x,
953
- label: c,
954
- hint: l,
955
- error: u,
956
- required: d,
957
- htmlFor: C.control,
958
- hintId: C.hintId,
959
- errorId: C.errorId,
960
- children: /* @__PURE__ */ n("div", {
961
- className: "core-slider__row",
962
- children: [/* @__PURE__ */ t("input", {
963
- ref: S,
964
- id: C.control,
965
- name: s,
966
- type: "range",
967
- className: "core-slider__input",
968
- min: h,
969
- max: g,
970
- step: v,
971
- value: E,
972
- disabled: f,
973
- "aria-readonly": p || void 0,
974
- "aria-valuetext": y(E),
975
- onChange: (t) => {
976
- if (p) return;
977
- let n = Number(t.target.value);
978
- e === void 0 && T(n), D(n);
979
- },
980
- ...C.aria
981
- }), /* @__PURE__ */ t("output", {
982
- className: "core-slider__value",
983
- htmlFor: C.control,
984
- children: y(E)
985
- })]
986
- })
987
- });
988
- }
989
- //#endregion
990
- //#region src/core/forms/Switch/Switch.tsx
991
- function Se({ value: e, defaultValue: r, onChange: i, setValue: a, id: o, name: s, label: c, hint: l, error: u, disabled: d, readOnly: f, className: p, style: h, ref: g }) {
992
- let v = U(o, l, u), [y, b] = m(r ?? !1), x = e ?? y, S = W(i, a);
993
- return /* @__PURE__ */ n("div", {
994
- className: _("core-switch", p),
995
- style: h,
996
- children: [
997
- /* @__PURE__ */ n("button", {
998
- ref: g,
999
- id: v.control,
1000
- name: s,
1001
- type: "button",
1002
- role: "switch",
1003
- "aria-checked": x,
1004
- "aria-readonly": f || void 0,
1005
- disabled: d,
1006
- className: "core-switch__control",
1007
- onClick: () => {
1008
- f || (e === void 0 && b(!x), S(!x));
1009
- },
1010
- ...v.aria,
1011
- children: [/* @__PURE__ */ t("span", {
1012
- className: "core-switch__track",
1013
- "aria-hidden": "true",
1014
- children: /* @__PURE__ */ t("span", { className: "core-switch__thumb" })
1015
- }), /* @__PURE__ */ t("span", {
1016
- className: "core-switch__label",
1017
- children: c
1018
- })]
1019
- }),
1020
- l && /* @__PURE__ */ t("p", {
1021
- className: "core-field__hint",
1022
- id: v.hintId,
1023
- children: l
1024
- }),
1025
- u && /* @__PURE__ */ t("p", {
1026
- className: "core-field__error",
1027
- id: v.errorId,
1028
- children: u
1029
- })
1030
- ]
1031
- });
1032
- }
1033
- //#endregion
1034
- //#region src/core/forms/TextArea/TextArea.tsx
1035
- function Ce({ value: e, defaultValue: r, onChange: i, setValue: a, id: o, name: s, label: c, hint: l, error: d, required: f, disabled: h, readOnly: g, placeholder: v, rows: y = 3, autoGrow: b = !0, maxLength: x, onKeyDown: S, onBlur: C, className: w, style: T, ref: E }) {
1036
- let D = U(o, l, d), [O, k] = m(r ?? ""), A = e ?? O, j = W(i, a), M = p(null);
1037
- return u(() => {
1038
- let e = M.current;
1039
- b && e && (e.style.height = "auto", e.style.height = `${e.scrollHeight + 2}px`);
1040
- }, [A, b]), /* @__PURE__ */ n(H, {
1041
- className: _("core-text-area", w),
1042
- style: T,
1043
- label: c,
1044
- hint: l,
1045
- error: d,
1046
- required: f,
1047
- htmlFor: D.control,
1048
- hintId: D.hintId,
1049
- errorId: D.errorId,
1050
- children: [/* @__PURE__ */ t("textarea", {
1051
- ref: (e) => {
1052
- M.current = e, typeof E == "function" ? E(e) : E && (E.current = e);
1053
- },
1054
- id: D.control,
1055
- name: s,
1056
- className: "core-input core-text-area__input",
1057
- rows: y,
1058
- value: A,
1059
- onChange: (t) => {
1060
- e === void 0 && k(t.target.value), j(t.target.value);
1061
- },
1062
- onKeyDown: S,
1063
- onBlur: C,
1064
- placeholder: v,
1065
- maxLength: x,
1066
- required: f,
1067
- "aria-required": f || void 0,
1068
- disabled: h,
1069
- readOnly: g,
1070
- ...D.aria
1071
- }), x !== void 0 && /* @__PURE__ */ n("span", {
1072
- className: "core-field__hint",
1073
- "aria-live": "polite",
1074
- children: [
1075
- A.length,
1076
- " / ",
1077
- x
1078
- ]
1079
- })]
1080
- });
1081
- }
1082
- //#endregion
1083
- //#region src/core/feedback/Badge/Badge.tsx
1084
- function we({ label: e, children: n, tone: r, variant: i = "soft", className: a, ...o }) {
1085
- return /* @__PURE__ */ t("span", {
1086
- ...g(o),
1087
- className: _("core-badge", "core-toned", a),
1088
- "data-tone": R(r),
1089
- "data-variant": i,
1090
- children: n ?? e
1091
- });
1092
- }
1093
- //#endregion
1094
- //#region src/core/feedback/EmptyState/EmptyState.tsx
1095
- function Te({ message: e, title: r, action: i, className: a, ...o }) {
1096
- return /* @__PURE__ */ n("div", {
1097
- ...g(o),
1098
- className: _("core-empty-state", a),
1099
- role: "status",
1100
- children: [
1101
- r && /* @__PURE__ */ t("p", {
1102
- className: "core-empty-state__title",
1103
- children: r
1104
- }),
1105
- /* @__PURE__ */ t("p", {
1106
- className: "core-empty-state__message",
1107
- children: e
1108
- }),
1109
- i != null && /* @__PURE__ */ t("div", {
1110
- className: "core-empty-state__action",
1111
- children: i
1112
- })
1113
- ]
1114
- });
1115
- }
1116
- //#endregion
1117
- //#region src/core/feedback/Notice/Notice.tsx
1118
- var Ee = {
1119
- info: "M12 16v-5M12 8h.01M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z",
1120
- success: "M8 12.5l2.5 2.5L16 9.5M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z",
1121
- warning: "M12 9v4M12 17h.01M10.3 3.9L2.2 18a2 2 0 0 0 1.7 3h16.2a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",
1122
- danger: "M12 8v5M12 16h.01M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z"
1123
- };
1124
- function De({ title: e, message: r, children: i, tone: a, action: o, onDismiss: s, className: c, ...l }) {
1125
- let u = R(a, "info"), d = u === "warning" || u === "danger";
1126
- return /* @__PURE__ */ n("div", {
1127
- ...g(l),
1128
- role: d ? "alert" : "status",
1129
- className: _("core-notice", "core-toned", c),
1130
- "data-tone": u,
1131
- children: [
1132
- /* @__PURE__ */ t("svg", {
1133
- className: "core-notice__icon",
1134
- viewBox: "0 0 24 24",
1135
- fill: "none",
1136
- stroke: "currentColor",
1137
- strokeWidth: "1.6",
1138
- strokeLinecap: "round",
1139
- strokeLinejoin: "round",
1140
- "aria-hidden": "true",
1141
- focusable: "false",
1142
- children: /* @__PURE__ */ t("path", { d: Ee[u] ?? Ee.info })
1143
- }),
1144
- /* @__PURE__ */ n("div", {
1145
- className: "core-notice__body",
1146
- children: [e && /* @__PURE__ */ t("p", {
1147
- className: "core-notice__title",
1148
- children: e
1149
- }), /* @__PURE__ */ t("div", {
1150
- className: "core-notice__message",
1151
- children: i ?? r
1152
- })]
1153
- }),
1154
- o && /* @__PURE__ */ t("div", {
1155
- className: "core-notice__action",
1156
- children: o
1157
- }),
1158
- s && /* @__PURE__ */ t("button", {
1159
- type: "button",
1160
- className: "core-notice__dismiss",
1161
- "aria-label": "Dismiss",
1162
- onClick: s,
1163
- children: /* @__PURE__ */ t("svg", {
1164
- viewBox: "0 0 24 24",
1165
- fill: "none",
1166
- stroke: "currentColor",
1167
- strokeWidth: "1.6",
1168
- strokeLinecap: "round",
1169
- "aria-hidden": "true",
1170
- focusable: "false",
1171
- children: /* @__PURE__ */ t("path", { d: "M6 6l12 12M18 6L6 18" })
1172
- })
1173
- })
1174
- ]
1175
- });
1176
- }
1177
- //#endregion
1178
- //#region src/core/feedback/Progress/Progress.tsx
1179
- function Oe({ value: e, max: r = 100, label: i, showValue: a = !1, tone: o, size: s = "md", className: c, style: l, ...u }) {
1180
- let d = typeof e == "number" && Number.isFinite(e) && r > 0, f = d ? Math.max(0, Math.min(100, e / r * 100)) : 0;
1181
- return /* @__PURE__ */ n("div", {
1182
- ...g(u),
1183
- className: _("core-progress", "core-toned", c),
1184
- "data-tone": R(o, "accent"),
1185
- "data-size": s,
1186
- style: l,
1187
- children: [(i || a && d) && /* @__PURE__ */ n("div", {
1188
- className: "core-progress__head",
1189
- children: [i && /* @__PURE__ */ t("span", {
1190
- className: "core-progress__label",
1191
- children: i
1192
- }), a && d && /* @__PURE__ */ n("span", {
1193
- className: "core-progress__value",
1194
- children: [Math.round(f), "%"]
1195
- })]
1196
- }), /* @__PURE__ */ t("div", {
1197
- className: "core-progress__track",
1198
- role: "progressbar",
1199
- "aria-label": i,
1200
- "aria-valuemin": 0,
1201
- "aria-valuemax": d ? r : void 0,
1202
- "aria-valuenow": d ? e : void 0,
1203
- "data-indeterminate": d ? void 0 : "",
1204
- style: y({ "--core-progress-fill": `${f}%` }),
1205
- children: /* @__PURE__ */ t("div", { className: "core-progress__fill" })
1206
- })]
1207
- });
1208
- }
1209
- //#endregion
1210
- //#region src/core/feedback/Skeleton/Skeleton.tsx
1211
- function ke({ shape: e = "text", lines: n = 3, width: r, height: i, className: a, style: o, ...s }) {
1212
- let c = y({
1213
- "--core-skeleton-w": v(r),
1214
- "--core-skeleton-h": v(i)
1215
- }, o);
1216
- if (e !== "text") return /* @__PURE__ */ t("span", {
1217
- ...g(s),
1218
- "aria-hidden": "true",
1219
- className: _("core-skeleton", a),
1220
- "data-shape": e,
1221
- style: c
1222
- });
1223
- let l = Math.max(1, Math.min(12, Math.round(n)));
1224
- return /* @__PURE__ */ t("span", {
1225
- ...g(s),
1226
- "aria-hidden": "true",
1227
- className: _("core-skeleton-lines", a),
1228
- style: c,
1229
- children: Array.from({ length: l }, (e, n) => /* @__PURE__ */ t("span", {
1230
- className: "core-skeleton",
1231
- "data-shape": "line",
1232
- "data-last": n === l - 1 && l > 1 ? "" : void 0
1233
- }, n))
1234
- });
1235
- }
1236
- //#endregion
1237
- //#region src/core/feedback/Spinner/Spinner.tsx
1238
- function Ae({ label: e = "Loading", size: n = "md", className: r, ...i }) {
1239
- return /* @__PURE__ */ t("span", {
1240
- ...g(i),
1241
- role: "status",
1242
- "aria-label": e,
1243
- className: _("core-spinner", r),
1244
- "data-size": n
1245
- });
1246
- }
1247
- //#endregion
1248
- //#region src/core/feedback/Tooltip/Tooltip.tsx
1249
- function je({ content: e, text: r, children: i, side: a = "top", className: o, ...s }) {
1250
- let [u, d] = m(!1), f = l();
1251
- return c(() => {
1252
- if (!u) return;
1253
- let e = (e) => {
1254
- e.key === "Escape" && d(!1);
1255
- };
1256
- return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
1257
- }, [u]), /* @__PURE__ */ n("span", {
1258
- ...g(s),
1259
- className: _("core-tooltip", o),
1260
- "aria-describedby": f,
1261
- onMouseEnter: () => d(!0),
1262
- onMouseLeave: () => d(!1),
1263
- onFocus: () => d(!0),
1264
- onBlur: () => d(!1),
1265
- children: [i, /* @__PURE__ */ t("span", {
1266
- id: f,
1267
- role: "tooltip",
1268
- className: "core-tooltip__bubble",
1269
- "data-side": a,
1270
- "data-open": u ? "" : void 0,
1271
- children: e ?? r
1272
- })]
1273
- });
1274
- }
1275
- //#endregion
1276
- //#region src/core/actions/Button/Button.tsx
1277
- function Me({ children: r, label: i, variant: a = "primary", size: o = "md", tone: s = "neutral", iconLeft: c, iconRight: l, loading: u = !1, disabled: d = !1, type: f = "button", fullWidth: p = !1, className: m, href: h, action: v, input: y, actions: b, navigate: x, onClick: S, ...C }) {
1278
- let w = j({
1279
- href: h,
1280
- action: v,
1281
- input: y,
1282
- actions: b,
1283
- navigate: x,
1284
- onClick: S
1285
- }), T = u || w.busy, E = {
1286
- ...g(C),
1287
- className: _("core-button", m),
1288
- "data-variant": a,
1289
- "data-size": o,
1290
- "data-tone": s,
1291
- "data-full": p || void 0,
1292
- "data-busy": T || void 0
1293
- }, D = /* @__PURE__ */ n(e, { children: [
1294
- T ? /* @__PURE__ */ t("span", {
1295
- className: "core-button__spinner",
1296
- "aria-hidden": "true"
1297
- }) : c,
1298
- /* @__PURE__ */ t("span", {
1299
- className: "core-button__label",
1300
- children: r ?? i
1301
- }),
1302
- l
1303
- ] });
1304
- return h && !d ? /* @__PURE__ */ t("a", {
1305
- ...E,
1306
- href: h,
1307
- onClick: w.onClick,
1308
- "aria-busy": T || void 0,
1309
- ...w.external ? {
1310
- target: "_blank",
1311
- rel: "noopener noreferrer"
1312
- } : {},
1313
- children: D
1314
- }) : /* @__PURE__ */ t("button", {
1315
- ...E,
1316
- type: f,
1317
- disabled: d || T,
1318
- "aria-busy": T || void 0,
1319
- onClick: w.onClick,
1320
- children: D
1321
- });
1322
- }
1323
- //#endregion
1324
- //#region src/core/actions/Chip/Chip.tsx
1325
- function Ne({ children: e, label: r, variant: i = "prompt", size: a = "md", selected: o, onToggle: s, iconLeft: c, disabled: l = !1, className: u, href: d, action: f, input: p, actions: m, navigate: h, onClick: v, ...y }) {
1326
- let b = o !== void 0 || s !== void 0, x = j({
1327
- href: d,
1328
- action: f,
1329
- input: p,
1330
- actions: m,
1331
- navigate: h,
1332
- onClick: v ?? (s ? () => s(!o) : void 0)
1333
- });
1334
- return /* @__PURE__ */ n("button", {
1335
- ...g(y),
1336
- type: "button",
1337
- className: _("core-chip", u),
1338
- "data-variant": i,
1339
- "data-size": a,
1340
- "aria-pressed": b ? !!o : void 0,
1341
- disabled: l || x.busy,
1342
- onClick: x.onClick,
1343
- children: [c, /* @__PURE__ */ t("span", {
1344
- className: "core-chip__label",
1345
- children: e ?? r
1346
- })]
1347
- });
1348
- }
1349
- //#endregion
1350
- //#region src/core/actions/IconButton/IconButton.tsx
1351
- function Pe({ icon: e, children: n, label: r, size: i = "md", variant: a = "ghost", pressed: o, disabled: s = !1, className: c, href: l, action: u, input: d, actions: f, navigate: p, onClick: m, ...h }) {
1352
- let v = j({
1353
- href: l,
1354
- action: u,
1355
- input: d,
1356
- actions: f,
1357
- navigate: p,
1358
- onClick: m
1359
- }), y = {
1360
- ...g(h),
1361
- className: _("core-icon-button", c),
1362
- "data-size": i,
1363
- "data-variant": a,
1364
- "aria-label": r,
1365
- title: r
1366
- }, b = /* @__PURE__ */ t("span", {
1367
- className: "core-icon-button__glyph",
1368
- "aria-hidden": "true",
1369
- children: e ?? n
1370
- });
1371
- return l && !s ? /* @__PURE__ */ t("a", {
1372
- ...y,
1373
- href: l,
1374
- onClick: v.onClick,
1375
- ...v.external ? {
1376
- target: "_blank",
1377
- rel: "noopener noreferrer"
1378
- } : {},
1379
- children: b
1380
- }) : /* @__PURE__ */ t("button", {
1381
- ...y,
1382
- type: "button",
1383
- "aria-pressed": o,
1384
- disabled: s || v.busy,
1385
- onClick: v.onClick,
1386
- children: b
1387
- });
1388
- }
1389
- //#endregion
1390
- //#region src/core/actions/Link/Link.tsx
1391
- function Fe({ href: r, children: i, label: a, variant: o = "default", className: s, navigate: c, onClick: l, ...u }) {
1392
- let d = j({
1393
- href: r,
1394
- navigate: c,
1395
- onClick: l
1396
- });
1397
- return k(r) || A(r) || /^(https?:|mailto:)/i.test(r) ? /* @__PURE__ */ n("a", {
1398
- ...g(u),
1399
- className: _("core-link", s),
1400
- "data-variant": o,
1401
- href: r,
1402
- onClick: d.onClick,
1403
- ...d.external ? {
1404
- target: "_blank",
1405
- rel: "noopener noreferrer"
1406
- } : {},
1407
- children: [i ?? a, d.external && /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("svg", {
1408
- className: "core-link__away",
1409
- viewBox: "0 0 24 24",
1410
- fill: "none",
1411
- stroke: "currentColor",
1412
- strokeWidth: "1.6",
1413
- strokeLinecap: "round",
1414
- strokeLinejoin: "round",
1415
- "aria-hidden": "true",
1416
- focusable: "false",
1417
- children: /* @__PURE__ */ t("path", { d: "M7 17L17 7M8 7h9v9" })
1418
- }), /* @__PURE__ */ t("span", {
1419
- className: "core-link__note",
1420
- children: " (opens in a new tab)"
1421
- })] })]
1422
- }) : /* @__PURE__ */ t("span", {
1423
- className: _("core-link", s),
1424
- children: i ?? a
1425
- });
1426
- }
1427
- //#endregion
1428
- //#region src/core/actions/SegmentedControl/SegmentedControl.tsx
1429
- function Ie({ options: e, value: n, defaultValue: r, onChange: i, label: a, fullWidth: o = !1, size: s = "md", className: c, setValue: u, ...d }) {
1430
- let [f, h] = m(r ?? e[0]?.value), v = n ?? f, y = l(), b = p([]), x = (e) => {
1431
- n === void 0 && h(e), i?.(e), u?.(e);
1432
- }, S = e.map((e, t) => e.disabled ? -1 : t).filter((e) => e >= 0), C = (t, n) => {
1433
- let r = t.key === "ArrowRight" || t.key === "ArrowDown" ? 1 : t.key === "ArrowLeft" || t.key === "ArrowUp" ? -1 : 0;
1434
- if (!r || !S.length) return;
1435
- t.preventDefault();
1436
- let i = S.indexOf(n), a = S[(i + r + S.length) % S.length];
1437
- b.current[a]?.focus(), x(e[a].value);
1438
- };
1439
- return /* @__PURE__ */ t("div", {
1440
- ...g(d),
1441
- role: "radiogroup",
1442
- "aria-label": a,
1443
- className: _("core-segmented", c),
1444
- "data-full": o || void 0,
1445
- "data-size": s,
1446
- children: e.map((e, n) => {
1447
- let r = e.value === v;
1448
- return /* @__PURE__ */ t("button", {
1449
- ref: (e) => {
1450
- b.current[n] = e;
1451
- },
1452
- type: "button",
1453
- role: "radio",
1454
- name: y,
1455
- "aria-checked": r,
1456
- tabIndex: r || v === void 0 && n === S[0] ? 0 : -1,
1457
- disabled: e.disabled,
1458
- className: "core-segmented__option",
1459
- onClick: () => x(e.value),
1460
- onKeyDown: (e) => C(e, n),
1461
- children: e.label
1462
- }, e.value);
1463
- })
1464
- });
1465
- }
1466
- //#endregion
1467
- //#region src/core/Accordion/Accordion.tsx
1468
- function Le({ items: e = [], children: r, numbered: i = !1, single: a = !1, rules: o = "subtle", className: s, ...c }) {
1469
- let u = l(), d = i ? "ol" : "ul";
1470
- return /* @__PURE__ */ n("div", {
1471
- ...g(c),
1472
- className: _("core-accordion", s),
1473
- "data-rules": o,
1474
- children: [e.length > 0 && /* @__PURE__ */ t(d, {
1475
- className: "core-accordion__list",
1476
- "data-numbered": i || void 0,
1477
- children: e.map((e, r) => /* @__PURE__ */ t("li", {
1478
- className: "core-accordion__item",
1479
- children: /* @__PURE__ */ n("details", {
1480
- className: "core-disclosure",
1481
- name: a ? u : void 0,
1482
- open: e.open || void 0,
1483
- children: [/* @__PURE__ */ n("summary", {
1484
- className: "core-disclosure__summary",
1485
- children: [i && /* @__PURE__ */ t("span", {
1486
- className: "core-accordion__number",
1487
- children: r + 1
1488
- }), e.question]
1489
- }), /* @__PURE__ */ t("div", {
1490
- className: "core-disclosure__content",
1491
- children: e.answer
1492
- })]
1493
- })
1494
- }, e.id ?? r))
1495
- }), r]
1496
- });
1497
- }
1498
- //#endregion
1499
- //#region src/core/Card/Card.tsx
1500
- function Re({ media: e, header: r, body: i, footer: a, children: o, tone: s = "plain", className: c, ...l }) {
1501
- return /* @__PURE__ */ n("article", {
1502
- ...g(l),
1503
- className: _("core-card", c),
1504
- "data-tone": s,
1505
- children: [
1506
- e != null && /* @__PURE__ */ t("div", {
1507
- className: "core-card__media",
1508
- children: e
1509
- }),
1510
- r != null && /* @__PURE__ */ t("header", {
1511
- className: "core-card__header",
1512
- children: r
1513
- }),
1514
- (i != null || o != null) && /* @__PURE__ */ n("div", {
1515
- className: "core-card__body",
1516
- children: [i, o]
1517
- }),
1518
- a != null && /* @__PURE__ */ t("footer", {
1519
- className: "core-card__footer",
1520
- children: a
1521
- })
1522
- ]
1523
- });
1524
- }
1525
- //#endregion
1526
- //#region src/core/Columns/Columns.tsx
1527
- var ze = {
1528
- "1:1": "1fr 1fr",
1529
- "2:1": "2fr 1fr",
1530
- "1:2": "1fr 2fr",
1531
- "3:1": "3fr 1fr",
1532
- "1:3": "1fr 3fr"
1533
- };
1534
- function Be({ start: e, end: r, children: i, ratio: a = "1:1", gap: o, stackBelow: s = "compact", className: c, ...l }) {
1535
- return /* @__PURE__ */ n("div", {
1536
- ...g(l),
1537
- className: _("core-columns", c),
1538
- "data-stack": s,
1539
- children: [/* @__PURE__ */ n("div", {
1540
- className: "core-columns__grid",
1541
- style: y({
1542
- "--core-columns-template": ze[a] ?? ze["1:1"],
1543
- "--core-columns-gap": v(o)
1544
- }),
1545
- children: [/* @__PURE__ */ t("div", {
1546
- className: "core-columns__start",
1547
- children: e
1548
- }), /* @__PURE__ */ t("div", {
1549
- className: "core-columns__end",
1550
- children: r
1551
- })]
1552
- }), i]
1553
- });
1554
- }
1555
- var Ve = Be;
1556
- //#endregion
1557
- //#region src/core/Disclosure/Disclosure.tsx
1558
- function He({ summary: e, content: r, children: i, open: a = !1, onToggle: o, className: s, ...c }) {
1559
- return /* @__PURE__ */ n("details", {
1560
- ...g(c),
1561
- className: _("core-disclosure", s),
1562
- open: a || void 0,
1563
- onToggle: o ? (e) => o(e.currentTarget.open) : void 0,
1564
- children: [/* @__PURE__ */ t("summary", {
1565
- className: "core-disclosure__summary",
1566
- children: e
1567
- }), /* @__PURE__ */ n("div", {
1568
- className: "core-disclosure__content",
1569
- children: [r, i]
1570
- })]
1571
- });
1572
- }
1573
- //#endregion
1574
- //#region src/core/Grid/Grid.tsx
1575
- function Ue({ items: e, children: n, min: i, columns: a, gap: o, className: s, style: c, ...l }) {
1576
- let u = [...r.toArray(e), ...r.toArray(n)];
1577
- return /* @__PURE__ */ t("div", {
1578
- ...g(l),
1579
- className: _("core-grid", s),
1580
- "data-capped": a && a > 0 ? "" : void 0,
1581
- style: y({
1582
- "--core-grid-min": v(i),
1583
- "--core-grid-gap": v(o),
1584
- "--core-grid-cols": a && a > 0 ? String(Math.round(a)) : void 0
1585
- }, c),
1586
- children: u
1587
- });
1588
- }
1589
- //#endregion
1590
- //#region src/core/Repeat/Repeat.tsx
1591
- function We({ item: e, each: n, as: i, layout: a = "stack", gap: o, min: s, empty: c, className: l, style: u, ...d }) {
1592
- let f = r.toArray(e);
1593
- return f.length ? /* @__PURE__ */ t("div", {
1594
- ...g(d),
1595
- className: _("core-repeat", l),
1596
- "data-layout": a,
1597
- style: y({
1598
- "--core-repeat-gap": v(o),
1599
- "--core-repeat-min": v(s)
1600
- }, u),
1601
- children: f
1602
- }) : c ? /* @__PURE__ */ t("p", {
1603
- className: "core-repeat__empty",
1604
- children: c
1605
- }) : null;
1606
- }
1607
- //#endregion
1608
- //#region src/core/document/profiles/profile.ts
1609
- var Ge = [
1610
- "page-x-of-y",
1611
- "page-number",
1612
- "page-count"
1613
- ], Ke = {
1614
- display: {
1615
- size: 46,
1616
- lineHeight: .98,
1617
- weight: 500,
1618
- tracking: "-0.032em"
1619
- },
1620
- heading: {
1621
- size: 28,
1622
- lineHeight: 1.05,
1623
- weight: 500,
1624
- tracking: "-0.03em"
1625
- },
1626
- subhead: {
1627
- size: 20,
1628
- lineHeight: 1.15,
1629
- weight: 500,
1630
- tracking: "-0.02em"
1631
- },
1632
- title: {
1633
- size: 17,
1634
- lineHeight: 1.3,
1635
- weight: 500,
1636
- tracking: "-0.018em"
1637
- },
1638
- body: {
1639
- size: 15,
1640
- lineHeight: 1.65,
1641
- weight: 400,
1642
- tracking: "-0.012em"
1643
- },
1644
- bodySmall: {
1645
- size: 13,
1646
- lineHeight: 1.65,
1647
- weight: 400,
1648
- tracking: "-0.012em"
1649
- },
1650
- label: {
1651
- size: 13,
1652
- lineHeight: 1.4,
1653
- weight: 500,
1654
- tracking: "-0.015em"
1655
- },
1656
- note: {
1657
- size: 12,
1658
- lineHeight: 1.7,
1659
- weight: 400,
1660
- tracking: "-0.012em"
1661
- },
1662
- eyebrow: {
1663
- size: 11,
1664
- lineHeight: 1,
1665
- weight: 600,
1666
- tracking: "0.14em",
1667
- uppercase: !0
1668
- }
1669
- }, qe = {
1670
- full: "var(--color-text)",
1671
- muted: "var(--color-text-muted)",
1672
- subtle: "var(--color-text-subtle)",
1673
- border: "var(--color-border)",
1674
- accent: "var(--color-accent)",
1675
- accentText: "var(--color-link)",
1676
- sunken: "var(--color-surface-sunken)"
1677
- }, Je = [
1678
- "cover",
1679
- "what-this-is",
1680
- "told-us",
1681
- "meaning",
1682
- "next-steps",
1683
- "talk-it-through",
1684
- "notes",
1685
- "footer"
1686
- ], Ye = [
1687
- {
1688
- id: "workbook",
1689
- label: "Workbook",
1690
- sheet: {
1691
- width: "8.5in",
1692
- height: "11in"
1693
- },
1694
- margins: {
1695
- top: "0.60in",
1696
- right: "0.70in",
1697
- bottom: "0.55in",
1698
- left: "0.95in"
1699
- },
1700
- measure: "6.85in",
1701
- bodyMeasureCh: 64,
1702
- rail: { placement: "strip" },
1703
- ink: qe,
1704
- rules: {
1705
- head: "2px",
1706
- structural: "1px",
1707
- row: "1px",
1708
- hairline: "1px"
1709
- },
1710
- type: Ke,
1711
- floorPx: 11,
1712
- depth: {
1713
- max: 1,
1714
- indent: ["0"],
1715
- numbering: "none"
1716
- },
1717
- fills: !0,
1718
- regions: { "page-footer": {
1719
- left: "member-ref",
1720
- centre: "document-id",
1721
- right: "page-x-of-y"
1722
- } },
1723
- sections: {
1724
- known: Je,
1725
- required: ["next-steps", "talk-it-through"]
1726
- }
1727
- },
1728
- {
1729
- id: "report",
1730
- extends: "workbook",
1731
- label: "Report",
1732
- regions: { "page-footer": { right: "page-x-of-y" } },
1733
- requiredBindings: [],
1734
- sections: {
1735
- known: Je,
1736
- required: ["next-steps", "talk-it-through"]
1737
- }
1738
- },
1739
- {
1740
- id: "instrument",
1741
- extends: "workbook",
1742
- label: "Instrument",
1743
- sheet: {
1744
- width: "8.5in",
1745
- height: "11in"
1746
- },
1747
- margins: {
1748
- top: "1.00in",
1749
- right: "1.00in",
1750
- bottom: "1.00in",
1751
- left: "1.25in"
1752
- },
1753
- measure: "4.50in",
1754
- bodyMeasureCh: void 0,
1755
- rail: {
1756
- placement: "column",
1757
- axis: "4.75in",
1758
- width: "1.50in",
1759
- gutter: "0.25in"
1760
- },
1761
- ink: {
1762
- full: "#000000",
1763
- muted: "rgba(0,0,0,0.70)",
1764
- subtle: "rgba(0,0,0,0.45)",
1765
- border: "rgba(0,0,0,0.45)",
1766
- accent: "#000000",
1767
- accentText: "#000000",
1768
- sunken: "transparent"
1769
- },
1770
- rules: {
1771
- structural: "0.75pt",
1772
- hairline: "0.25pt"
1773
- },
1774
- type: {
1775
- ...Ke,
1776
- eyebrow: {
1777
- ...Ke.eyebrow,
1778
- tracking: "0.08em"
1779
- }
1780
- },
1781
- depth: {
1782
- max: 3,
1783
- indent: [
1784
- "0",
1785
- "0.375in",
1786
- "0.75in"
1787
- ],
1788
- numbering: "ladder"
1789
- },
1790
- fills: !1,
1791
- regions: { "page-footer": {
1792
- left: "execution-state",
1793
- right: "page-x-of-y"
1794
- } },
1795
- requiredBindings: ["execution-state"],
1796
- sections: { required: [] }
1797
- }
1798
- ], G = /* @__PURE__ */ new Map();
1799
- function Xe(e) {
1800
- G.set(e.id, e);
1801
- }
1802
- for (let e of Ye) Xe(e);
1803
- function Ze() {
1804
- return [...G.keys()].sort();
1805
- }
1806
- function Qe(e) {
1807
- let t = G.get(e);
1808
- if (!t) throw Error(`[document-profile] unknown profile "${e}". Registered: ${Ze().join(", ")}`);
1809
- if (!t.extends) return t;
1810
- let n = G.get(t.extends);
1811
- if (!n) throw Error(`[document-profile] "${e}" extends unknown profile "${t.extends}"`);
1812
- if (n.extends) throw Error(`[document-profile] "${e}" extends "${n.id}", which extends "${n.extends}": inheritance is one level deep.`);
1813
- return {
1814
- ...n,
1815
- ...t,
1816
- id: t.id,
1817
- extends: t.extends
1818
- };
1819
- }
1820
- function $e() {
1821
- let e = {};
1822
- for (let t of Ze()) try {
1823
- e[t] = Qe(t);
1824
- } catch (e) {
1825
- console.warn(`[document-profile] skipping "${t}": ${e instanceof Error ? e.message : String(e)}`);
1826
- }
1827
- return e;
1828
- }
1829
- var et = Object.freeze($e()), tt = "workbook";
1830
- function nt(e, t) {
1831
- try {
1832
- return Qe(e);
1833
- } catch {
1834
- return F(`unknown-profile:${e}`, `[document-profile] unknown profile "${e}" (first seen in ${t}): rendering with fallback values.`), null;
1835
- }
1836
- }
1837
- function K(e, t) {
1838
- return e === void 0 ? (F("no-profile", `[document-profile] no profileId supplied (first seen in ${t}): falling back to "${tt}". If this document is an instrument, its numbering and depth are being dropped.`), nt(tt, t)) : nt(e, t);
1839
- }
1840
- //#endregion
1841
- //#region src/core/document/profiles/tokens.ts
1842
- var rt = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), it = [
1843
- "full",
1844
- "muted",
1845
- "subtle",
1846
- "border",
1847
- "accent",
1848
- "accentText",
1849
- "sunken"
1850
- ], at = [
1851
- "structural",
1852
- "hairline",
1853
- "head",
1854
- "row"
1855
- ], ot = [
1856
- "display",
1857
- "heading",
1858
- "subhead",
1859
- "title",
1860
- "body",
1861
- "bodySmall",
1862
- "label",
1863
- "note",
1864
- "eyebrow"
1865
- ], st = 3, q = "initial";
1866
- function ct(e) {
1867
- let t = {
1868
- "--doc-sheet-width": e.sheet.width,
1869
- "--doc-sheet-height": e.sheet.height,
1870
- "--doc-margin-top": e.margins.top,
1871
- "--doc-margin-right": e.margins.right,
1872
- "--doc-margin-bottom": e.margins.bottom,
1873
- "--doc-margin-left": e.margins.left,
1874
- "--doc-measure": e.measure,
1875
- "--doc-body-measure": e.bodyMeasureCh ? `${e.bodyMeasureCh}ch` : "none",
1876
- "--doc-rail-axis": e.rail.axis ?? q,
1877
- "--doc-rail-width": e.rail.width ?? q,
1878
- "--doc-rail-gutter": e.rail.gutter ?? q,
1879
- "--doc-floor": `${e.floorPx}px`
1880
- };
1881
- for (let n of it) t[`--doc-ink-${rt(n)}`] = e.ink[n];
1882
- for (let n of at) t[`--doc-rule-${n}`] = e.rules[n] ?? q;
1883
- for (let n of ot) {
1884
- let r = e.type[n], i = `--doc-type-${rt(n)}`;
1885
- t[`${i}-size`] = `${r.size}px`, t[`${i}-leading`] = String(r.lineHeight), t[`${i}-weight`] = String(r.weight), t[`${i}-tracking`] = r.tracking, t[`${i}-case`] = r.uppercase ? "uppercase" : "none";
1886
- }
1887
- for (let n = 1; n <= st; n++) t[`--doc-indent-${n}`] = e.depth.indent[n - 1] ?? q;
1888
- return t;
1889
- }
1890
- var lt = (e, t) => `${e} {\n${Object.entries(t).map(([e, t]) => ` ${e}: ${t};`).join("\n")}\n}`;
1891
- function ut(e, t) {
1892
- return e.map((e) => lt(e.id === t ? `:root,\n[data-profile='${e.id}']` : `[data-profile='${e.id}']`, ct(e))).join("\n\n");
1893
- }
1894
- //#endregion
1895
- //#region src/core/document/_shared/blocks.ts
1896
- var dt = [
1897
- "prose",
1898
- "clause",
1899
- "definitions",
1900
- "table",
1901
- "notice",
1902
- "figure",
1903
- "execution"
1904
- ], ft = /\{\{ref:([^}|]+?)(?:\|(title|full|number))?\}\}/g, J = "[a-z0-9][a-z0-9_-]*", pt = RegExp(`^(?:(${J}):)?(${J}(?:\\.${J})*)(?:#(${J}))?$`);
1905
- RegExp(`^${J}$`);
1906
- function mt(e, t) {
1907
- let n = e.trim(), r = pt.exec(n);
1908
- return r ? {
1909
- key: n,
1910
- ...r[1] ? { doc: r[1] } : {},
1911
- unit: r[2],
1912
- ...r[3] ? { element: r[3] } : {},
1913
- ...t ? { form: t } : {}
1914
- } : null;
1915
- }
1916
- function ht(e) {
1917
- let t = e.lastIndexOf(".");
1918
- return t < 0 ? e : e.slice(t + 1);
1919
- }
1920
- function gt(e) {
1921
- let t = [], n = 0;
1922
- for (let r of e.matchAll(new RegExp(ft.source, "g"))) {
1923
- let i = mt(r[1], r[2]);
1924
- i && (r.index > n && t.push({
1925
- kind: "text",
1926
- text: e.slice(n, r.index)
1927
- }), t.push({
1928
- kind: "ref",
1929
- ...i
1930
- }), n = r.index + r[0].length);
1931
- }
1932
- return n < e.length && t.push({
1933
- kind: "text",
1934
- text: e.slice(n)
1935
- }), t;
1936
- }
1937
- function _t(e) {
1938
- return e.includes("{{ref:");
1939
- }
1940
- //#endregion
1941
- //#region src/core/document/_shared/profile.ts
1942
- var Y = (e) => e ? { "data-profile": e } : {}, vt = (e) => e?.fills === !1 ? { "data-fills": "none" } : {}, yt = {
1943
- note: "ⓘ",
1944
- tip: "💡",
1945
- warning: "⚠️",
1946
- important: "❗"
1947
- };
1948
- function bt({ children: e, tone: r = "note", title: i, profileId: a, profile: o, className: s, style: c }) {
1949
- let l = o ?? K(a, "Aside"), u = l?.fills === !1;
1950
- return /* @__PURE__ */ n("aside", {
1951
- className: _("core-aside", s),
1952
- "data-tone": r,
1953
- ...Y(o?.id ?? a),
1954
- ...vt(l),
1955
- style: c,
1956
- children: [u ? null : /* @__PURE__ */ t("span", {
1957
- className: "core-aside__icon",
1958
- "aria-hidden": !0,
1959
- children: yt[r]
1960
- }), /* @__PURE__ */ n("div", {
1961
- className: "core-aside__body",
1962
- children: [i && /* @__PURE__ */ t("div", {
1963
- className: "core-aside__title",
1964
- children: i
1965
- }), /* @__PURE__ */ t("div", {
1966
- className: "core-aside__text",
1967
- children: e
1968
- })]
1969
- })]
1970
- });
1971
- }
1972
- //#endregion
1973
- //#region src/core/document/Prose/Prose.tsx
1974
- function xt({ children: e, profileId: n, profile: r, full: i = !1, className: a, style: o }) {
1975
- return r || K(n, "Prose"), /* @__PURE__ */ t("div", {
1976
- className: _("core-prose", a),
1977
- "data-full": i ? "" : void 0,
1978
- ...Y(r?.id ?? n),
1979
- style: o,
1980
- children: e
1981
- });
1982
- }
1983
- //#endregion
1984
- //#region src/core/document/Quote/Quote.tsx
1985
- function St({ children: e, citation: r, className: i, style: a }) {
1986
- return /* @__PURE__ */ n("figure", {
1987
- className: _("core-quote", i),
1988
- style: a,
1989
- children: [/* @__PURE__ */ t("blockquote", {
1990
- className: "core-quote__body",
1991
- children: e
1992
- }), r && /* @__PURE__ */ n("figcaption", {
1993
- className: "core-quote__citation",
1994
- children: ["— ", r]
1995
- })]
1996
- });
1997
- }
1998
- //#endregion
1999
- //#region src/core/document/Definition/Definition.tsx
2000
- function Ct({ term: e, description: r, pairs: i, profileId: a, profile: o, className: s, style: c }) {
2001
- o || K(a, "Definition");
2002
- let l = i ?? (e === void 0 ? [] : [{
2003
- term: e,
2004
- description: r
2005
- }]);
2006
- return /* @__PURE__ */ t("dl", {
2007
- className: _("core-definition", s),
2008
- ...Y(o?.id ?? a),
2009
- style: c,
2010
- children: l.map((e, r) => /* @__PURE__ */ n("div", {
2011
- className: "core-definition__item",
2012
- children: [/* @__PURE__ */ t("dt", {
2013
- className: "core-definition__term",
2014
- children: e.term
2015
- }), /* @__PURE__ */ t("dd", {
2016
- className: "core-definition__description",
2017
- children: e.description
2018
- })]
2019
- }, r))
2020
- });
2021
- }
2022
- //#endregion
2023
- //#region src/core/document/Math/Math.tsx
2024
- var wt = "katex";
2025
- function Tt(e) {
2026
- if (typeof document > "u") return !1;
2027
- for (let t of document.querySelectorAll("script[type=\"importmap\"]")) try {
2028
- if (JSON.parse(t.textContent ?? "").imports?.[e]) return !0;
2029
- } catch {}
2030
- return !1;
2031
- }
2032
- var Et = (e) => import(
2033
- /* @vite-ignore */
2034
- e
2035
- ), Dt;
2036
- function Ot() {
2037
- return Dt ??= Tt(wt) ? Et(wt).then((e) => {
2038
- let t = e, n = t.default ?? t;
2039
- return typeof n.render == "function" ? n : null;
2040
- }, () => null) : Promise.resolve(null), Dt;
2041
- }
2042
- function kt({ children: e = "", mode: n = "inline", className: r }) {
2043
- let i = p(null), [a, o] = m(null), [s, l] = m(null), u = `${n}:${e}`;
2044
- return c(() => {
2045
- let e = !0;
2046
- return Ot().then((t) => {
2047
- e && t && o(() => t);
2048
- }), () => {
2049
- e = !1;
2050
- };
2051
- }, []), c(() => {
2052
- if (a && i.current && s !== u) try {
2053
- a.render(e, i.current, {
2054
- displayMode: n === "block",
2055
- throwOnError: !1
2056
- });
2057
- } catch {
2058
- l(u);
2059
- }
2060
- }, [
2061
- a,
2062
- e,
2063
- n,
2064
- u,
2065
- s
2066
- ]), !a || s === u ? /* @__PURE__ */ t("span", {
2067
- className: _("core-math", r),
2068
- "data-mode": n,
2069
- "data-fallback": "",
2070
- title: "KaTeX not available — showing TeX source",
2071
- children: e
2072
- }) : /* @__PURE__ */ t("span", {
2073
- ref: i,
2074
- className: _("core-math", r),
2075
- "data-mode": n
2076
- });
2077
- }
2078
- //#endregion
2079
- //#region src/core/document/_shared/footnote-context.tsx
2080
- function At(e, t) {
2081
- switch (t.type) {
2082
- case "register": return e.footnotes.some((e) => e.id === t.entry.id) ? e : { footnotes: [...e.footnotes, t.entry] };
2083
- case "unregister": return { footnotes: e.footnotes.filter((e) => e.id !== t.id) };
2084
- default: return e;
2085
- }
2086
- }
2087
- var jt = i(null);
2088
- function Mt() {
2089
- return s(jt);
2090
- }
2091
- function Nt({ children: e }) {
2092
- let [n, r] = f(At, { footnotes: [] }), i = p(0), a = o((e) => {
2093
- i.current += 1;
2094
- let t = i.current;
2095
- return r({
2096
- type: "register",
2097
- entry: {
2098
- ...e,
2099
- number: t
2100
- }
2101
- }), t;
2102
- }, []), s = o((e) => r({
2103
- type: "unregister",
2104
- id: e
2105
- }), []), c = d(() => ({
2106
- state: n,
2107
- registerFootnote: a,
2108
- unregisterFootnote: s
2109
- }), [
2110
- n,
2111
- a,
2112
- s
2113
- ]);
2114
- return /* @__PURE__ */ t(jt.Provider, {
2115
- value: c,
2116
- children: e
2117
- });
2118
- }
2119
- //#endregion
2120
- //#region src/core/document/Footnote/Footnote.tsx
2121
- function Pt({ children: e }) {
2122
- let r = l(), i = Mt(), [a, o] = m(null);
2123
- return c(() => {
2124
- if (!i) return;
2125
- let t = i.registerFootnote({
2126
- id: r,
2127
- content: e
2128
- });
2129
- return o(t), () => i.unregisterFootnote(r);
2130
- }, [r]), i ? a === null ? null : /* @__PURE__ */ t("sup", {
2131
- id: `core-footnote-ref-${a}`,
2132
- className: "core-footnote",
2133
- children: /* @__PURE__ */ n("a", {
2134
- href: `#core-footnote-${a}`,
2135
- className: "core-footnote__link",
2136
- children: [
2137
- "[",
2138
- a,
2139
- "]"
2140
- ]
2141
- })
2142
- }) : /* @__PURE__ */ n("span", {
2143
- className: "core-footnote",
2144
- "data-fallback": "",
2145
- children: [
2146
- " ",
2147
- "(",
2148
- e,
2149
- ")"
2150
- ]
2151
- });
2152
- }
2153
- //#endregion
2154
- //#region src/core/document/Figure/Figure.tsx
2155
- function Ft({ children: e, caption: r, profileId: i, profile: a, className: o, style: s }) {
2156
- return a || K(i, "Figure"), /* @__PURE__ */ n("figure", {
2157
- className: _("core-figure", o),
2158
- ...Y(a?.id ?? i),
2159
- style: s,
2160
- children: [/* @__PURE__ */ t("div", {
2161
- className: "core-figure__body",
2162
- children: e
2163
- }), r && /* @__PURE__ */ t("figcaption", {
2164
- className: "core-figure__caption",
2165
- children: r
2166
- })]
2167
- });
2168
- }
2169
- //#endregion
2170
- //#region src/core/document/PageBreak/PageBreak.tsx
2171
- function It({ className: e }) {
2172
- return /* @__PURE__ */ t("div", {
2173
- className: _("core-page-break", e),
2174
- "aria-hidden": !0
2175
- });
2176
- }
2177
- //#endregion
2178
- //#region src/core/document/DocumentLabel/DocumentLabel.tsx
2179
- function Lt({ children: e, as: n = "div", profileId: r, profile: i, tone: a = "subtle", className: o, style: s }) {
2180
- return i || K(r, "DocumentLabel"), /* @__PURE__ */ t(n, {
2181
- className: _("core-document-label", o),
2182
- "data-tone": a,
2183
- ...Y(i?.id ?? r),
2184
- style: s,
2185
- children: e
2186
- });
2187
- }
2188
- //#endregion
2189
- //#region src/core/document/_shared/ordinal-format.ts
2190
- var Rt = [
2191
- "one",
2192
- "two",
2193
- "three",
2194
- "four",
2195
- "five",
2196
- "six",
2197
- "seven",
2198
- "eight",
2199
- "nine",
2200
- "ten"
2201
- ];
2202
- function zt(e) {
2203
- if (e.length !== 1) return null;
2204
- let t = e[0], n = Rt[t - 1];
2205
- return n ? `Article ${n}` : `Article ${t}`;
2206
- }
2207
- function Bt(e) {
2208
- return e.length === 0 ? null : e.length === 1 ? `Article ${e[0]}` : e.join(".");
2209
- }
2210
- function Vt(e, t, n) {
2211
- let r = n === "ladder" && e !== void 0 && e.length > 0, i = [];
2212
- return t.map(({ level: t, marker: n }) => {
2213
- let a = Math.min(Number.isInteger(t) && t >= 1 ? t : 1, i.length + 1);
2214
- return i.length = a, i[a - 1] = (i[a - 1] ?? 0) + 1, n === void 0 ? r ? [...e, ...i].join(".") : void 0 : n;
2215
- });
2216
- }
2217
- //#endregion
2218
- //#region src/core/document/_shared/section-anchors.ts
2219
- function Ht(e, t) {
2220
- return e?.[t] ?? t;
2221
- }
2222
- //#endregion
2223
- //#region src/core/document/Reference/Reference.tsx
2224
- function Ut({ target: e, form: n, sectionReferences: r, sectionNumbers: i, sectionTitles: a, sectionAnchors: o, profileId: s, profile: c, className: l, style: u }) {
2225
- let d = c ?? K(s, "Reference"), f = mt(e), p = r?.[e], m = p?.openable === !1, h = f !== null && f.doc === void 0, g = f ? ht(f.unit) : e, v = p?.number ?? (h && f.element === void 0 ? i?.[g] : void 0), y = p?.title ?? (h && f.element === void 0 ? a?.[g] : void 0), b = null;
2226
- if (f?.element !== void 0) {
2227
- let e = p?.element;
2228
- b = e ? Vt(p.number, e.shape, d?.depth.numbering)[e.index] ?? null : null;
2229
- } else v && (b = Bt(v));
2230
- let x = n === "full" || f?.doc !== void 0 && n !== "title", S;
2231
- S = m ? null : n === "title" ? y ?? b : x && b && y && f?.element === void 0 ? `${b} (${y})` : b ?? y ?? null;
2232
- let C = S !== null, w = C ? p ? p.href : `#${Ht(o, g)}` : void 0, T = {
2233
- className: _("core-reference", l),
2234
- "data-target": e,
2235
- "data-unresolved": C || m ? void 0 : "",
2236
- "data-closed": m ? "" : void 0,
2237
- ...Y(c?.id ?? s),
2238
- style: u
2239
- };
2240
- return w ? /* @__PURE__ */ t("a", {
2241
- href: w,
2242
- ...T,
2243
- children: S
2244
- }) : /* @__PURE__ */ t("span", {
2245
- ...T,
2246
- children: S ?? e
2247
- });
2248
- }
2249
- //#endregion
2250
- //#region src/core/document/DocumentTable/DocumentTable.tsx
2251
- function Wt({ columns: e, rows: r, caption: i, profileId: a, profile: o, className: s, style: c }) {
2252
- return o || K(a, "DocumentTable"), e.length === 0 ? null : /* @__PURE__ */ n("div", {
2253
- className: _("core-document-table", s),
2254
- ...Y(o?.id ?? a),
2255
- style: c,
2256
- children: [i === void 0 ? null : /* @__PURE__ */ t("div", {
2257
- className: "core-document-table__caption",
2258
- children: i
2259
- }), /* @__PURE__ */ n("table", {
2260
- className: "core-document-table__table",
2261
- children: [/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { children: e.map((e, n) => /* @__PURE__ */ t("th", {
2262
- scope: "col",
2263
- className: "core-document-table__head",
2264
- "data-align": e.align ?? "left",
2265
- children: e.header
2266
- }, n)) }) }), /* @__PURE__ */ t("tbody", { children: r.map((n, r) => /* @__PURE__ */ t("tr", { children: e.map((e, r) => /* @__PURE__ */ t("td", {
2267
- className: "core-document-table__cell",
2268
- "data-align": e.align ?? "left",
2269
- children: n[r] ?? null
2270
- }, r)) }, r)) })]
2271
- })]
2272
- });
2273
- }
2274
- //#endregion
2275
- //#region src/core/document/RowList/RowList.tsx
2276
- function Gt({ items: e, profileId: r, profile: i, markerWidth: a = 44, secondaryWidth: o = 190, missingLabel: s = "Not answered yet", className: c, style: l }) {
2277
- return i || K(r, "RowList"), e.length === 0 ? null : /* @__PURE__ */ t("div", {
2278
- className: _("core-row-list", c),
2279
- ...Y(i?.id ?? r),
2280
- style: y({
2281
- "--core-row-list-marker-width": v(a),
2282
- "--core-row-list-secondary-width": v(o)
2283
- }, l),
2284
- children: e.map((e, r) => /* @__PURE__ */ n("div", {
2285
- className: "core-row-list__row",
2286
- children: [
2287
- e.marker !== void 0 && /* @__PURE__ */ t("div", {
2288
- className: "core-row-list__marker",
2289
- children: e.marker
2290
- }),
2291
- /* @__PURE__ */ t("div", {
2292
- className: "core-row-list__primary",
2293
- children: e.primary
2294
- }),
2295
- (e.secondary !== void 0 || e.missing) && /* @__PURE__ */ t("div", {
2296
- className: "core-row-list__secondary",
2297
- "data-missing": e.missing ? "" : void 0,
2298
- children: e.missing ? s : e.secondary
2299
- })
2300
- ]
2301
- }, r))
2302
- });
2303
- }
2304
- //#endregion
2305
- //#region src/core/document/AnswerRows/AnswerRows.tsx
2306
- var Kt = 190;
2307
- function qt({ items: e, profileId: n, profile: r, missingLabel: i = "Not answered yet", answerWidth: a = 190, className: o, style: s }) {
2308
- let c = e.map((e) => {
2309
- let t = typeof e.answer == "string" && e.answer.trim().length > 0;
2310
- return {
2311
- marker: e.reference,
2312
- primary: e.question,
2313
- secondary: t ? e.answer : void 0,
2314
- missing: !t
2315
- };
2316
- });
2317
- return /* @__PURE__ */ t("div", {
2318
- className: _("core-answer-rows", o),
2319
- ...Y(r?.id ?? n),
2320
- style: s,
2321
- children: /* @__PURE__ */ t(Gt, {
2322
- items: c,
2323
- profileId: n,
2324
- profile: r,
2325
- secondaryWidth: a,
2326
- missingLabel: i
2327
- })
2328
- });
2329
- }
2330
- //#endregion
2331
- //#region src/core/_shared/formatters.ts
2332
- function X(e) {
2333
- if (e == null) return "";
2334
- if (typeof e == "string") return e;
2335
- let t = e.precision ?? (e.format === "number" ? Jt(e.value) : void 0), n = Yt(e.format, e.value, {
2336
- precision: t,
2337
- signed: e.signed
2338
- });
2339
- return e.unit && n !== "—" ? `${n}\u00a0${e.unit}` : n;
2340
- }
2341
- function Jt(e) {
2342
- if (typeof e != "number" || !Number.isFinite(e)) return 0;
2343
- let t = String(Number(e.toFixed(3))), n = t.indexOf(".");
2344
- return n === -1 || t.includes("e") ? 0 : t.length - n - 1;
2345
- }
2346
- function Yt(e, t, n = {}) {
2347
- if (!Number.isFinite(t)) return "—";
2348
- let r = n.signed === !0, i = t < 0, a = Math.abs(t), o = i ? "-" : r ? "+" : "";
2349
- switch (e) {
2350
- case "currency": {
2351
- let e = n.precision ?? 0;
2352
- return `${o}$${a.toLocaleString("en-CA", {
2353
- minimumFractionDigits: e,
2354
- maximumFractionDigits: e
2355
- })}`;
2356
- }
2357
- case "currency-k": {
2358
- let e = n.precision ?? 0;
2359
- return a >= 1e3 ? `${o}$${(a / 1e3).toFixed(e)}k` : `${o}$${a.toFixed(0)}`;
2360
- }
2361
- case "currency-m": {
2362
- let e = n.precision ?? 1;
2363
- return a >= 1e6 ? `${o}$${(a / 1e6).toFixed(e)}M` : a >= 1e3 ? `${o}$${(a / 1e3).toFixed(0)}k` : `${o}$${a.toFixed(0)}`;
2364
- }
2365
- case "currency-compact": {
2366
- if (a >= 1e9) {
2367
- let e = n.precision ?? 1;
2368
- return `${o}$${(a / 1e9).toFixed(e)}B`;
2369
- }
2370
- if (a >= 1e6) {
2371
- let e = n.precision ?? 1;
2372
- return `${o}$${(a / 1e6).toFixed(e)}M`;
2373
- }
2374
- if (a >= 1e3) {
2375
- let e = n.precision ?? 1;
2376
- return `${o}$${(a / 1e3).toFixed(e)}k`;
2377
- }
2378
- let e = n.precision ?? 0;
2379
- return `${o}$${a.toFixed(e)}`;
2380
- }
2381
- case "currency-monthly": {
2382
- let e = n.precision ?? 0;
2383
- return `${o}$${a.toLocaleString("en-CA", {
2384
- minimumFractionDigits: e,
2385
- maximumFractionDigits: e
2386
- })}/mo`;
2387
- }
2388
- case "percent": {
2389
- let e = n.precision ?? 1;
2390
- return `${o}${a.toFixed(e)}%`;
2391
- }
2392
- case "age": return `Age ${Math.round(t)}`;
2393
- case "years": {
2394
- let e = n.precision ?? 0;
2395
- return `${o}${a.toFixed(e)} yrs`;
2396
- }
2397
- case "number": {
2398
- let e = n.precision ?? 0;
2399
- return `${o}${a.toLocaleString("en-CA", {
2400
- minimumFractionDigits: e,
2401
- maximumFractionDigits: e
2402
- })}`;
2403
- }
2404
- default: {
2405
- let e = n.precision ?? 0;
2406
- return `${o}$${(a / 1e3).toFixed(e)}k`;
2407
- }
2408
- }
2409
- }
2410
- //#endregion
2411
- //#region src/core/document/ComparisonBars/ComparisonBars.tsx
2412
- var Xt = 40;
2413
- function Zt({ bars: e, target: r, targetLabel: i, max: a, profileId: o, profile: s, className: c, style: l }) {
2414
- let u = s ?? K(o, "ComparisonBars");
2415
- if (e.length === 0) return null;
2416
- let d = e.map((e) => e.value), f = a ?? Math.max(...d, r ?? 0);
2417
- if (!Number.isFinite(f) || f <= 0) return F("ComparisonBars:no-scale", "[ComparisonBars] every value is zero or negative, so there is no scale to draw against. Rendering nothing rather than a full-width or zero-width bar, either of which reads as a chart and is not one."), null;
2418
- let p = r !== void 0 && r > 0 && r <= f ? r / f * 100 : void 0;
2419
- return /* @__PURE__ */ n("figure", {
2420
- className: _("core-comparison-bars", c),
2421
- ...Y(s?.id ?? o),
2422
- ...vt(u),
2423
- style: l,
2424
- children: [e.map((e) => {
2425
- let r = Math.max(0, Math.min(100, e.value / f * 100));
2426
- return /* @__PURE__ */ n("div", {
2427
- className: "core-comparison-bars__bar",
2428
- style: y({ "--core-comparison-bars-value": `${r}%` }),
2429
- children: [/* @__PURE__ */ t("div", {
2430
- className: "core-comparison-bars__label",
2431
- children: e.label
2432
- }), /* @__PURE__ */ n("div", {
2433
- className: "core-comparison-bars__track",
2434
- style: y({ "--core-comparison-bars-target": p === void 0 ? void 0 : `${p}%` }),
2435
- children: [
2436
- /* @__PURE__ */ t("div", { className: "core-comparison-bars__fill" }),
2437
- /* @__PURE__ */ t("span", {
2438
- className: "core-comparison-bars__value",
2439
- "data-placement": r > Xt ? "inside" : "outside",
2440
- children: X(e.display)
2441
- }),
2442
- p !== void 0 && /* @__PURE__ */ t("div", {
2443
- className: "core-comparison-bars__target",
2444
- "aria-hidden": "true"
2445
- })
2446
- ]
2447
- })]
2448
- }, e.label);
2449
- }), r !== void 0 && i && /* @__PURE__ */ t("figcaption", {
2450
- className: "core-comparison-bars__target-label",
2451
- children: i
2452
- })]
2453
- });
2454
- }
2455
- //#endregion
2456
- //#region src/core/document/NextSteps/NextSteps.tsx
2457
- var Qt = 3, $t = 5;
2458
- function en({ items: e, profileId: r, profile: i, checkboxes: a = !0, className: o, style: s }) {
2459
- return i || K(r, "NextSteps"), e.length === 0 ? null : ((e.length < Qt || e.length > $t) && F(`NextSteps:count:${e.length}`, `[NextSteps] ${e.length} step(s). A next-steps list takes three to five: fewer reads as an afterthought, more stops being a list a reader acts on this week. Rendering anyway — a document with six steps is far better than one with none.`), /* @__PURE__ */ t("ol", {
2460
- className: _("core-next-steps", o),
2461
- ...Y(i?.id ?? r),
2462
- style: s,
2463
- children: e.map((e, r) => /* @__PURE__ */ n("li", {
2464
- className: "core-next-steps__step",
2465
- children: [
2466
- /* @__PURE__ */ t("span", {
2467
- className: "core-next-steps__marker",
2468
- children: e.marker ?? String(r + 1).padStart(2, "0")
2469
- }),
2470
- a && /* @__PURE__ */ t("span", {
2471
- className: "core-next-steps__box",
2472
- "aria-hidden": "true"
2473
- }),
2474
- /* @__PURE__ */ t("span", {
2475
- className: "core-next-steps__body",
2476
- children: e.body
2477
- })
2478
- ]
2479
- }, r))
2480
- }));
2481
- }
2482
- //#endregion
2483
- //#region src/core/document/Notes/Notes.tsx
2484
- var tn = 38;
2485
- function nn({ title: e = "Notes", lines: r = 4, profileId: i, profile: a, className: o, style: s }) {
2486
- return a || K(i, "Notes"), r < 1 ? null : /* @__PURE__ */ n("section", {
2487
- className: _("core-notes", o),
2488
- ...Y(a?.id ?? i),
2489
- style: s,
2490
- children: [/* @__PURE__ */ t("div", {
2491
- className: "core-notes__title",
2492
- children: e
2493
- }), /* @__PURE__ */ t("div", {
2494
- className: "core-notes__lines",
2495
- "aria-hidden": "true",
2496
- children: Array.from({ length: r }, (e, n) => /* @__PURE__ */ t("div", { className: "core-notes__line" }, n))
2497
- })]
2498
- });
2499
- }
2500
- //#endregion
2501
- //#region src/core/document/SkippedSection/SkippedSection.tsx
2502
- var rn = "You left this section open, so it is not covered here.";
2503
- function an({ wouldTell: e, openingLine: r = rn, profileId: i, profile: a, className: o, style: s }) {
2504
- return a || K(i, "SkippedSection"), /* @__PURE__ */ n("div", {
2505
- className: _("core-skipped-section", o),
2506
- ...Y(a?.id ?? i),
2507
- style: s,
2508
- children: [
2509
- /* @__PURE__ */ t("span", {
2510
- className: "core-skipped-section__standard",
2511
- children: r
2512
- }),
2513
- " ",
2514
- /* @__PURE__ */ t("span", {
2515
- className: "core-skipped-section__would-tell",
2516
- children: e
2517
- })
2518
- ]
2519
- });
2520
- }
2521
- //#endregion
2522
- //#region src/core/document/TalkItThrough/TalkItThrough.tsx
2523
- var on = "Nothing here is settled. If a number looks wrong, or a step does not fit your situation, say so and we will work through it together.";
2524
- function sn({ advisor: e, title: r = "Talk it through", invitation: i = on, profileId: a, profile: o, className: s, style: c }) {
2525
- if (o || K(a, "TalkItThrough"), !e?.name?.trim()) return F("TalkItThrough:no-advisor", "[TalkItThrough] no advisor name — rendering NOTHING rather than an empty box. This section is mandatory in an approved output because it is the door to a human; a door with nobody behind it passes a structural check and fails the reader."), null;
2526
- let l = [e.phone, e.email].filter((e) => typeof e == "string" && e.trim().length > 0);
2527
- return l.length === 0 && F("TalkItThrough:no-contact", `[TalkItThrough] "${e.name}" has no phone and no email. The section is the advisor's name, HOW TO REACH THEM, and an open invitation — a name alone is not a route. Rendering, because a named advisor is still better than a dropped section.`), /* @__PURE__ */ n("section", {
2528
- className: _("core-talk-it-through", s),
2529
- ...Y(o?.id ?? a),
2530
- style: c,
2531
- children: [
2532
- /* @__PURE__ */ t("h3", {
2533
- className: "core-talk-it-through__title",
2534
- children: r
2535
- }),
2536
- /* @__PURE__ */ t("p", {
2537
- className: "core-talk-it-through__invitation",
2538
- children: i
2539
- }),
2540
- /* @__PURE__ */ n("div", {
2541
- className: "core-talk-it-through__advisor",
2542
- children: [
2543
- /* @__PURE__ */ t("div", {
2544
- className: "core-talk-it-through__name",
2545
- children: e.name
2546
- }),
2547
- e.role && /* @__PURE__ */ t("div", {
2548
- className: "core-talk-it-through__role",
2549
- children: e.role
2550
- }),
2551
- l.length > 0 && /* @__PURE__ */ t("div", {
2552
- className: "core-talk-it-through__contact",
2553
- children: l.map((e) => /* @__PURE__ */ t("span", { children: e }, e))
2554
- })
2555
- ]
2556
- })
2557
- ]
2558
- });
2559
- }
2560
- //#endregion
2561
- //#region src/core/document/WriteInField/WriteInField.tsx
2562
- var cn = 38;
2563
- function ln({ question: e, answer: r, lines: i = 1, profileId: a, profile: o, className: s, style: c }) {
2564
- o || K(a, "WriteInField");
2565
- let l = typeof r == "string" && r.trim().length > 0, u = Math.max(1, i);
2566
- return /* @__PURE__ */ n("div", {
2567
- className: _("core-write-in-field", s),
2568
- "data-answered": l ? "" : void 0,
2569
- ...Y(o?.id ?? a),
2570
- style: c,
2571
- children: [e && /* @__PURE__ */ t("div", {
2572
- className: "core-write-in-field__question",
2573
- children: e
2574
- }), l ? /* @__PURE__ */ t("div", {
2575
- className: "core-write-in-field__answer",
2576
- children: r
2577
- }) : Array.from({ length: u }, (e, n) => /* @__PURE__ */ t("div", {
2578
- className: "core-write-in-field__line",
2579
- "aria-hidden": "true"
2580
- }, n))]
2581
- });
2582
- }
2583
- //#endregion
2584
- //#region src/core/document/Masthead/Masthead.tsx
2585
- function un({ mark: e, identity: r, codes: i, profileId: a, profile: o, className: s, style: c }) {
2586
- return o || K(a, "Masthead"), e === void 0 && r === void 0 && i === void 0 ? null : /* @__PURE__ */ n("header", {
2587
- className: _("core-masthead", s),
2588
- "data-page-region": "page-header",
2589
- ...Y(o?.id ?? a),
2590
- style: c,
2591
- children: [
2592
- e !== void 0 && /* @__PURE__ */ t("div", {
2593
- className: "core-masthead__mark",
2594
- "data-slot": "mark",
2595
- children: e
2596
- }),
2597
- r !== void 0 && /* @__PURE__ */ t("div", {
2598
- className: "core-masthead__identity",
2599
- "data-slot": "identity",
2600
- children: r
2601
- }),
2602
- i !== void 0 && /* @__PURE__ */ t("div", {
2603
- className: "core-masthead__codes",
2604
- "data-slot": "codes",
2605
- children: i
2606
- })
2607
- ]
2608
- });
2609
- }
2610
- //#endregion
2611
- //#region src/core/document/MetaRail/MetaRail.tsx
2612
- var dn = 4;
2613
- function fn({ fields: e, profileId: r, profile: i, className: a, style: o }) {
2614
- let s = (i ?? K(r, "MetaRail"))?.rail.placement ?? "strip";
2615
- return s === "none" || e.length === 0 ? null : (s !== "column" && e.length > dn && typeof console < "u" && console.warn(`[MetaRail] ${e.length} fields in a strip; the spec allows ${dn}. Rendering all of them — check the layout.`), /* @__PURE__ */ t("div", {
2616
- className: _("core-meta-rail", a),
2617
- "data-placement": s,
2618
- ...Y(i?.id ?? r),
2619
- style: o,
2620
- children: e.map((e) => /* @__PURE__ */ n("div", {
2621
- className: "core-meta-rail__field",
2622
- children: [/* @__PURE__ */ t("div", {
2623
- className: "core-meta-rail__label",
2624
- children: e.label
2625
- }), /* @__PURE__ */ t("div", {
2626
- className: "core-meta-rail__value",
2627
- children: e.value
2628
- })]
2629
- }, `${e.label}:${e.value}`))
2630
- }));
2631
- }
2632
- //#endregion
2633
- //#region src/core/document/RunningFooter/RunningFooter.tsx
2634
- var pn = {
2635
- left: "bottom-left",
2636
- centre: "bottom-center",
2637
- right: "bottom-right"
2638
- };
2639
- function mn({ left: e, centre: n, right: r, profileId: i, profile: a, className: o, style: s }) {
2640
- a || K(i, "RunningFooter");
2641
- let c = [
2642
- ["left", e],
2643
- ["centre", n],
2644
- ["right", r]
2645
- ].filter(([, e]) => e != null);
2646
- return c.length === 0 ? null : /* @__PURE__ */ t("footer", {
2647
- className: _("core-running-footer", o),
2648
- "data-page-region": "page-footer",
2649
- ...Y(a?.id ?? i),
2650
- style: s,
2651
- children: c.map(([e, n]) => /* @__PURE__ */ t("span", {
2652
- className: "core-running-footer__slot",
2653
- "data-region-slot": e,
2654
- "data-margin-box": pn[e],
2655
- children: n
2656
- }, e))
2657
- });
2658
- }
2659
- //#endregion
2660
- //#region src/core/document/DocumentShell/DocumentShell.tsx
2661
- function hn({ children: r, rail: i, profileId: a, profile: o, className: s, style: c }) {
2662
- let l = o ?? K(a, "DocumentShell"), u = l?.rail.placement === "column" && i !== void 0;
2663
- return /* @__PURE__ */ t(Nt, { children: /* @__PURE__ */ n("div", {
2664
- className: _("core-document-shell", s),
2665
- ...Y(l?.id ?? a),
2666
- "data-has-rail": u ? "" : void 0,
2667
- style: c,
2668
- children: [/* @__PURE__ */ t("div", {
2669
- className: "core-document-shell__body",
2670
- children: r
2671
- }), u && /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("div", {
2672
- className: "core-document-shell__gutter",
2673
- "aria-hidden": !0
2674
- }), /* @__PURE__ */ t("aside", {
2675
- className: "core-document-shell__rail",
2676
- children: i
2677
- })] })]
2678
- }) });
2679
- }
2680
- //#endregion
2681
- //#region src/core/document/Contents/Contents.tsx
2682
- function gn(e, t) {
2683
- return !e || e.length === 0 ? null : t === 0 ? String(e[0]).padStart(2, "0") : e.join(".");
2684
- }
2685
- function _n({ entries: e, depth: r, title: i, profileId: a, profile: o, className: s, style: c }) {
2686
- let l = o ?? K(a, "Contents"), u = l?.depth.max ?? Infinity, d = e ?? [], f = r === void 0 ? d : d.filter((e) => e.level < r);
2687
- if (f.length === 0) return null;
2688
- let p = l?.depth.numbering ?? "none", m = f.some((e) => e.page !== void 0);
2689
- return /* @__PURE__ */ n("nav", {
2690
- "aria-label": "Table of contents",
2691
- className: _("core-contents", s),
2692
- ...Y(o?.id ?? a),
2693
- style: c,
2694
- children: [i && /* @__PURE__ */ t("div", {
2695
- className: "core-contents__title",
2696
- children: i
2697
- }), /* @__PURE__ */ t("ol", {
2698
- className: "core-contents__list",
2699
- children: f.map((e) => {
2700
- let r = p === "none" ? null : gn(e.ordinal, e.level);
2701
- return /* @__PURE__ */ n("li", {
2702
- className: "core-contents__entry",
2703
- "data-level": e.level,
2704
- "data-overdeep": e.level >= u ? "" : void 0,
2705
- style: y({ "--core-contents-level": String(e.level) }),
2706
- children: [
2707
- r && /* @__PURE__ */ t("span", {
2708
- className: "core-contents__ordinal",
2709
- children: r
2710
- }),
2711
- /* @__PURE__ */ t("a", {
2712
- href: `#${e.id}`,
2713
- className: "core-contents__link",
2714
- children: e.title
2715
- }),
2716
- m && /* @__PURE__ */ t("span", {
2717
- className: "core-contents__page",
2718
- children: e.page ?? ""
2719
- })
2720
- ]
2721
- }, e.id);
2722
- })
2723
- })]
2724
- });
2725
- }
2726
- //#endregion
2727
- //#region src/core/document/ExecutionBlock/ExecutionBlock.tsx
2728
- function vn({ s: e, dated: r }) {
2729
- return /* @__PURE__ */ n("div", {
2730
- className: "core-execution-block__signature",
2731
- children: [/* @__PURE__ */ n("div", {
2732
- className: "core-execution-block__lines",
2733
- children: [/* @__PURE__ */ t("div", {
2734
- className: "core-execution-block__line",
2735
- "data-line": "sign"
2736
- }), r ? /* @__PURE__ */ t("div", {
2737
- className: "core-execution-block__line",
2738
- "data-line": "date"
2739
- }) : null]
2740
- }), /* @__PURE__ */ n("div", {
2741
- className: "core-execution-block__captions",
2742
- children: [/* @__PURE__ */ n("div", {
2743
- className: "core-execution-block__party",
2744
- children: [
2745
- e.role ? /* @__PURE__ */ t("div", {
2746
- className: "core-execution-block__role",
2747
- children: e.role
2748
- }) : null,
2749
- e.name ? /* @__PURE__ */ t("div", {
2750
- className: "core-execution-block__name",
2751
- children: e.name
2752
- }) : null,
2753
- e.detail ? /* @__PURE__ */ t("div", {
2754
- className: "core-execution-block__detail",
2755
- children: e.detail
2756
- }) : null
2757
- ]
2758
- }), r ? /* @__PURE__ */ t("div", {
2759
- className: "core-execution-block__date-label",
2760
- children: "Date"
2761
- }) : null]
2762
- })]
2763
- });
2764
- }
2765
- function yn({ attestation: e, label: r, signatories: i, columns: a = 1, note: o, profileId: s, profile: c, className: l, style: u }) {
2766
- c || K(s, "ExecutionBlock");
2767
- let d = Array.isArray(i) ? i : [];
2768
- return /* @__PURE__ */ n("section", {
2769
- className: _("core-execution-block", l),
2770
- ...Y(c?.id ?? s),
2771
- style: u,
2772
- children: [
2773
- r ? /* @__PURE__ */ t("div", {
2774
- className: "core-execution-block__label",
2775
- children: r
2776
- }) : null,
2777
- e ? /* @__PURE__ */ t("div", {
2778
- className: "core-execution-block__attestation",
2779
- children: e
2780
- }) : null,
2781
- /* @__PURE__ */ t("div", {
2782
- className: "core-execution-block__signatories",
2783
- "data-columns": a,
2784
- children: d.map((e, n) => /* @__PURE__ */ t(vn, {
2785
- s: e,
2786
- dated: e.dated === !0
2787
- }, n))
2788
- }),
2789
- o ? /* @__PURE__ */ t("div", {
2790
- className: "core-execution-block__note",
2791
- children: o
2792
- }) : null
2793
- ]
2794
- });
2795
- }
2796
- //#endregion
2797
- //#region src/core/document/DocumentBlocks/DocumentBlocks.tsx
2798
- function bn({ kind: e }) {
2799
- return /* @__PURE__ */ n("div", {
2800
- className: "core-document-blocks__unrenderable",
2801
- "data-unrenderable-block": e,
2802
- role: "alert",
2803
- children: [
2804
- /* @__PURE__ */ t("strong", { children: "This provision could not be rendered." }),
2805
- " The document contains a block of type “",
2806
- e,
2807
- "”, which this bundle has no renderer for. Nothing has been omitted silently — the content is present in the source document and is missing only from this page. Do not sign or rely on this document until it renders in full."
2808
- ]
2809
- });
2810
- }
2811
- function xn({ blocks: e, profileId: n, sectionNumbers: r, sectionAnchors: i, sectionTitles: a, sectionReferences: o, sectionOrdinal: s, className: c, style: l }) {
2812
- let u = K(n, "DocumentBlocks");
2813
- if (e.length === 0) return null;
2814
- let d = Vt(s, e.flatMap((e) => e.kind === "clause" ? e.items : []), u?.depth.numbering), f = 0, p = (e, s) => _t(e) ? gt(e).map((e, c) => e.kind === "text" ? e.text : /* @__PURE__ */ t(Ut, {
2815
- target: e.key,
2816
- form: e.form,
2817
- sectionReferences: o,
2818
- sectionNumbers: r,
2819
- sectionTitles: a,
2820
- sectionAnchors: i,
2821
- profileId: n
2822
- }, `${s}-ref-${c}`)) : e, m = e.some((e) => e.kind === "execution");
2823
- return /* @__PURE__ */ t("div", {
2824
- className: _("core-document-blocks", c),
2825
- "data-pinned": m ? "execution" : void 0,
2826
- ...Y(n),
2827
- style: l,
2828
- children: e.map((e, r) => {
2829
- let i = `${e.kind}-${r}`;
2830
- switch (e.kind) {
2831
- case "prose": return /* @__PURE__ */ t(xt, {
2832
- profileId: n,
2833
- full: e.full,
2834
- children: p(e.text, i)
2835
- }, i);
2836
- case "clause": return /* @__PURE__ */ t(Gt, {
2837
- profileId: n,
2838
- items: e.items.map((e, t) => ({
2839
- marker: d[f++],
2840
- primary: p(e.text, `${i}-${t}`),
2841
- secondary: e.note ? p(e.note, `${i}-${t}-n`) : void 0,
2842
- missing: e.missing
2843
- }))
2844
- }, i);
2845
- case "definitions": return /* @__PURE__ */ t(Ct, {
2846
- profileId: n,
2847
- pairs: e.pairs.map((e, t) => ({
2848
- term: e.term,
2849
- description: p(e.description, `${i}-${t}`)
2850
- }))
2851
- }, i);
2852
- case "table": return /* @__PURE__ */ t(Wt, {
2853
- profileId: n,
2854
- caption: e.caption ? p(e.caption, `${i}-cap`) : void 0,
2855
- columns: e.columns,
2856
- rows: e.rows.map((e, t) => e.map((e, n) => p(e, `${i}-${t}-${n}`)))
2857
- }, i);
2858
- case "notice": return /* @__PURE__ */ t(bt, {
2859
- profileId: n,
2860
- tone: e.tone,
2861
- title: e.title,
2862
- children: p(e.text, i)
2863
- }, i);
2864
- case "figure": return /* @__PURE__ */ t(Ft, {
2865
- profileId: n,
2866
- caption: p(e.caption, i),
2867
- children: e.placeholder ?? null
2868
- }, i);
2869
- case "execution": return /* @__PURE__ */ t(yn, {
2870
- profileId: n,
2871
- label: e.label,
2872
- attestation: e.attestation,
2873
- signatories: e.signatories,
2874
- columns: e.columns,
2875
- note: e.note
2876
- }, i);
2877
- default: return /* @__PURE__ */ t(bn, { kind: String(e.kind) }, i);
2878
- }
2879
- })
2880
- });
2881
- }
2882
- //#endregion
2883
- //#region src/core/document/DocumentSection/DocumentSection.tsx
2884
- var Sn = [
2885
- "h2",
2886
- "h3",
2887
- "h4",
2888
- "h5",
2889
- "h6"
2890
- ];
2891
- function Cn({ sectionId: e, title: r, level: i = 0, ordinal: a, sectionNumbers: o, sectionAnchors: s, sectionTitles: c, sectionReferences: l, sectionLevels: u, continued: d = !1, continuedCount: f, children: p, blocks: m, profileId: h, profile: g, className: v, style: b }) {
2892
- let x = g ?? K(h, "DocumentSection"), S = o?.[e], C = u?.[e], w = S ?? a, T = C === void 0 ? i : Math.max(0, C - 1), E = T >= (x?.depth.max ?? Infinity), D = Math.min(T, (x?.depth.indent.length ?? 1) - 1) + 1, O = x?.depth.numbering === "ladder" && w !== void 0 && w.length > 0, k = O ? zt(w) : null, A = Sn[Math.min(T, Sn.length - 1)], j = Ht(s, e), M = `${j}-doc-heading`;
2893
- return /* @__PURE__ */ n("section", {
2894
- id: j,
2895
- className: _("core-document-section", v),
2896
- "data-level": T,
2897
- "data-ordinal-source": w ? S ? "derived" : "baked" : void 0,
2898
- "data-overdeep": E ? "" : void 0,
2899
- "aria-labelledby": M,
2900
- ...Y(g?.id ?? h),
2901
- style: y({ "--core-document-section-indent": `var(--doc-indent-${D}, 0)` }, b),
2902
- children: [
2903
- k && /* @__PURE__ */ t("div", {
2904
- className: "core-document-section__article",
2905
- children: k
2906
- }),
2907
- /* @__PURE__ */ n(A, {
2908
- id: M,
2909
- className: "core-document-section__heading",
2910
- children: [
2911
- O && !k && /* @__PURE__ */ t("span", {
2912
- className: "core-document-section__ordinal",
2913
- children: w.join(".")
2914
- }),
2915
- r,
2916
- d && /* @__PURE__ */ t("span", {
2917
- className: "core-document-section__continued",
2918
- children: "continued"
2919
- })
2920
- ]
2921
- }),
2922
- d && f && /* @__PURE__ */ t("div", {
2923
- className: "core-document-section__count",
2924
- children: `Items ${f.from} to ${f.to} of ${f.of}`
2925
- }),
2926
- /* @__PURE__ */ t("div", {
2927
- className: "core-document-section__body",
2928
- children: p ?? (m ? /* @__PURE__ */ t(xn, {
2929
- blocks: m,
2930
- profileId: h,
2931
- sectionNumbers: o,
2932
- sectionAnchors: s,
2933
- sectionTitles: c,
2934
- sectionReferences: l,
2935
- sectionOrdinal: O ? w : void 0
2936
- }) : null)
2937
- })
2938
- ]
2939
- });
2940
- }
2941
- var wn = {
2942
- prose: {
2943
- type: "object",
2944
- required: ["kind", "text"],
2945
- additionalProperties: !1,
2946
- properties: {
2947
- kind: { const: "prose" },
2948
- text: {
2949
- type: "string",
2950
- description: "ONE paragraph. Two paragraphs in one value run together on the page: emit a second prose block instead."
2951
- },
2952
- full: {
2953
- type: "boolean",
2954
- description: "Fill the measure rather than the reading-width cap. For a caption or text beside a table."
2955
- }
2956
- }
2957
- },
2958
- clause: {
2959
- type: "object",
2960
- required: ["kind", "items"],
2961
- additionalProperties: !1,
2962
- properties: {
2963
- kind: { const: "clause" },
2964
- items: {
2965
- type: "array",
2966
- minItems: 1,
2967
- items: {
2968
- type: "object",
2969
- required: ["text"],
2970
- additionalProperties: !1,
2971
- properties: {
2972
- marker: {
2973
- type: "string",
2974
- description: "An explicit number that overrides the derived one, only for numbering fixed by statute or a standard form. Omit it and the renderer numbers the clause from its article (\"6.3\")."
2975
- },
2976
- level: {
2977
- type: "integer",
2978
- minimum: 1,
2979
- description: "Depth within the section: 1 a clause, 2 a sub-clause, 3 a sub-sub-clause. Default 1."
2980
- },
2981
- id: {
2982
- type: "string",
2983
- pattern: "^[a-z0-9][a-z0-9_-]*$",
2984
- description: "A slug, unique in the document, written only when prose cites this clause as {{ref:<section>#<id>}}. Keep it stable across edits."
2985
- },
2986
- text: { type: "string" },
2987
- note: {
2988
- type: "string",
2989
- description: "A parenthetical, cross-reference or jurisdictional note set beside the text."
2990
- },
2991
- missing: {
2992
- type: "boolean",
2993
- description: "The value is not yet known. Use this instead of writing a [REQUIRED: ...] marker into the text."
2994
- }
2995
- }
2996
- }
2997
- }
2998
- }
2999
- },
3000
- definitions: {
3001
- type: "object",
3002
- required: ["kind", "pairs"],
3003
- additionalProperties: !1,
3004
- properties: {
3005
- kind: { const: "definitions" },
3006
- pairs: {
3007
- type: "array",
3008
- minItems: 1,
3009
- items: {
3010
- type: "object",
3011
- required: ["term", "description"],
3012
- additionalProperties: !1,
3013
- properties: {
3014
- term: { type: "string" },
3015
- description: { type: "string" }
3016
- }
3017
- }
3018
- }
3019
- }
3020
- },
3021
- table: {
3022
- type: "object",
3023
- required: [
3024
- "kind",
3025
- "columns",
3026
- "rows"
3027
- ],
3028
- additionalProperties: !1,
3029
- properties: {
3030
- kind: { const: "table" },
3031
- caption: { type: "string" },
3032
- columns: {
3033
- type: "array",
3034
- minItems: 1,
3035
- items: {
3036
- type: "object",
3037
- required: ["header"],
3038
- additionalProperties: !1,
3039
- properties: {
3040
- header: { type: "string" },
3041
- align: {
3042
- enum: [
3043
- "left",
3044
- "right",
3045
- "center"
3046
- ],
3047
- description: "Right-align money and any other figure column."
3048
- }
3049
- }
3050
- }
3051
- },
3052
- rows: {
3053
- type: "array",
3054
- items: {
3055
- type: "array",
3056
- items: { type: "string" }
3057
- },
3058
- description: "One array per row, each EXACTLY as long as columns. A short row is refused: a table that loses its last column loses data."
3059
- }
3060
- }
3061
- },
3062
- notice: {
3063
- type: "object",
3064
- required: [
3065
- "kind",
3066
- "tone",
3067
- "text"
3068
- ],
3069
- additionalProperties: !1,
3070
- properties: {
3071
- kind: { const: "notice" },
3072
- tone: { enum: [
3073
- "note",
3074
- "warning",
3075
- "important"
3076
- ] },
3077
- title: { type: "string" },
3078
- text: { type: "string" }
3079
- }
3080
- },
3081
- figure: {
3082
- type: "object",
3083
- required: ["kind", "caption"],
3084
- additionalProperties: !1,
3085
- properties: {
3086
- kind: { const: "figure" },
3087
- caption: {
3088
- type: "string",
3089
- description: "Required. An uncaptioned exhibit cannot be cited from the text that relies on it."
3090
- },
3091
- src: {
3092
- type: "string",
3093
- description: "Reference the host resolves. Never a data URI."
3094
- },
3095
- placeholder: {
3096
- type: "string",
3097
- description: "Text stand-in when src is absent, so a figure never renders empty."
3098
- }
3099
- }
3100
- },
3101
- execution: {
3102
- type: "object",
3103
- required: ["kind", "signatories"],
3104
- additionalProperties: !1,
3105
- properties: {
3106
- kind: { const: "execution" },
3107
- label: { type: "string" },
3108
- attestation: {
3109
- type: "string",
3110
- description: "The attestation clause, as running text."
3111
- },
3112
- signatories: {
3113
- type: "array",
3114
- minItems: 1,
3115
- items: {
3116
- type: "object",
3117
- required: ["role"],
3118
- additionalProperties: !1,
3119
- properties: {
3120
- role: {
3121
- type: "string",
3122
- description: "Capacity: \"Testator\", \"Witness\", \"Grantor\"."
3123
- },
3124
- name: {
3125
- type: "string",
3126
- description: "Printed BELOW the signing rule, never on it."
3127
- },
3128
- detail: { type: "string" },
3129
- dated: {
3130
- type: "boolean",
3131
- description: "Add a second, shorter rule for the date."
3132
- }
3133
- }
3134
- }
3135
- },
3136
- columns: { enum: [1, 2] },
3137
- note: { type: "string" }
3138
- }
3139
- }
3140
- }, Tn = [
3141
- "md",
3142
- "lg",
3143
- "xl"
3144
- ], En = 5;
3145
- function Dn(e) {
3146
- let t = Tn.indexOf(e);
3147
- return t > 0 ? Tn[t - 1] : e;
3148
- }
3149
- var On = (e) => typeof e == "object" && !!e && "format" in e && "value" in e;
3150
- function kn(e) {
3151
- let t = Number(e);
3152
- return Number.isFinite(t) ? Math.max(0, Math.min(100, t)) : 0;
3153
- }
3154
- function An({ value: e, label: r, size: i = "lg", tone: a, progress: o, progressLabel: s, autoStepDown: c = !0, className: l, style: u }) {
3155
- let d = On(e) ? X(e) : e, f = typeof d == "string" || typeof d == "number" ? String(d).length : 0, p = c && f > En ? Dn(i) : i, m = B(a, "strong"), { toned: h, ...g } = ee(m), v = o == null ? null : kn(o);
3156
- return /* @__PURE__ */ n("div", {
3157
- className: _("core-stat", h && "core-toned", l),
3158
- ...g,
3159
- "data-size": p,
3160
- style: u,
3161
- children: [
3162
- /* @__PURE__ */ t("div", {
3163
- className: "core-stat__value",
3164
- children: d
3165
- }),
3166
- r != null && /* @__PURE__ */ t(V, {
3167
- className: "core-stat__label",
3168
- tone: m === "on-dark" || m === "inherit" ? m : "subtle",
3169
- children: r
3170
- }),
3171
- v !== null && /* @__PURE__ */ t("div", {
3172
- className: "core-stat__progress",
3173
- role: "progressbar",
3174
- "aria-label": s ?? (typeof r == "string" ? r : "Progress"),
3175
- "aria-valuemin": 0,
3176
- "aria-valuemax": 100,
3177
- "aria-valuenow": v,
3178
- style: y({ "--core-stat-progress": `${v}%` }),
3179
- children: /* @__PURE__ */ t("div", { className: "core-stat__progress-fill" })
3180
- })
3181
- ]
3182
- });
3183
- }
3184
- function jn({ children: e, minColumnWidth: n = 200, maxColumns: r = 4, gap: i = 32, className: a, style: o }) {
3185
- return /* @__PURE__ */ t("div", {
3186
- className: _("core-stat-group", a),
3187
- style: y({
3188
- "--core-stat-group-min": `${n}px`,
3189
- "--core-stat-group-max": String(Math.max(1, r)),
3190
- "--core-stat-group-gap": `${i}px`
3191
- }, o),
3192
- children: e
3193
- });
3194
- }
3195
- //#endregion
3196
- //#region src/core/display/_shared/Reveal.tsx
3197
- var Mn = {
3198
- up: [0, 28],
3199
- left: [-40, 0],
3200
- right: [40, 0],
3201
- none: [0, 0]
3202
- };
3203
- function Nn({ direction: e = "up", delay: n = 0, duration: r = .5, threshold: i = .15, once: a = !0, className: o, style: s, children: l }) {
3204
- let u = p(null), [d, f] = m(!1);
3205
- c(() => {
3206
- let e = u.current;
3207
- if (!e) return;
3208
- if (typeof IntersectionObserver > "u") {
3209
- f(!0);
3210
- return;
3211
- }
3212
- let t = new IntersectionObserver((e) => {
3213
- let n = e[e.length - 1];
3214
- n && (n.isIntersecting ? (f(!0), a && t.disconnect()) : a || f(!1));
3215
- }, { threshold: Math.min(1, Math.max(0, i)) });
3216
- return t.observe(e), () => t.disconnect();
3217
- }, [a, i]);
3218
- let [h, g] = Mn[e];
3219
- return /* @__PURE__ */ t("div", {
3220
- ref: u,
3221
- className: _("core-reveal", o),
3222
- "data-revealed": d ? "true" : "false",
3223
- style: y({
3224
- "--core-reveal-x": `${h}px`,
3225
- "--core-reveal-y": `${g}px`,
3226
- "--core-reveal-duration": `${r}s`,
3227
- "--core-reveal-delay": `${n}s`
3228
- }, s),
3229
- children: l
3230
- });
3231
- }
3232
- //#endregion
3233
- //#region src/core/display/SectionHeader/SectionHeader.tsx
3234
- function Pn({ eyebrow: e, title: r, description: i, trailing: a, revealDelay: o = 0, className: s, style: c }) {
3235
- return /* @__PURE__ */ t(Nn, {
3236
- direction: "up",
3237
- delay: o,
3238
- className: _("core-section-header", s),
3239
- style: c,
3240
- children: /* @__PURE__ */ n("div", {
3241
- className: "core-section-header__inner",
3242
- "data-described": i ? "true" : void 0,
3243
- children: [/* @__PURE__ */ n("div", {
3244
- className: "core-section-header__text",
3245
- children: [
3246
- e ? /* @__PURE__ */ t(V, {
3247
- className: "core-section-header__eyebrow",
3248
- children: e
3249
- }) : null,
3250
- /* @__PURE__ */ t("h2", {
3251
- className: "core-section-header__title",
3252
- children: r
3253
- }),
3254
- i ? /* @__PURE__ */ t("p", {
3255
- className: "core-section-header__description",
3256
- children: i
3257
- }) : null
3258
- ]
3259
- }), a != null && a !== "" ? /* @__PURE__ */ t("div", {
3260
- className: "core-section-header__trailing",
3261
- children: a
3262
- }) : null]
3263
- })
3264
- });
3265
- }
3266
- //#endregion
3267
- //#region src/core/display/HighlightBox/HighlightBox.tsx
3268
- function Fn({ tone: e, label: r, headline: i, children: a, trailing: o, className: s, style: c }) {
3269
- let l = R(e, "accent"), u = o != null && o !== "";
3270
- return /* @__PURE__ */ n("div", {
3271
- className: _("core-highlight-box", "core-toned", s),
3272
- "data-tone": l,
3273
- style: c,
3274
- children: [/* @__PURE__ */ n("div", {
3275
- className: "core-highlight-box__text",
3276
- children: [
3277
- r ? /* @__PURE__ */ t("div", {
3278
- className: "core-highlight-box__label",
3279
- children: r
3280
- }) : null,
3281
- i ? /* @__PURE__ */ t("div", {
3282
- className: "core-highlight-box__headline",
3283
- children: i
3284
- }) : null,
3285
- a != null && a !== "" ? /* @__PURE__ */ t("div", {
3286
- className: "core-highlight-box__body",
3287
- children: a
3288
- }) : null
3289
- ]
3290
- }), u ? /* @__PURE__ */ t("div", {
3291
- className: "core-highlight-box__trailing",
3292
- children: o
3293
- }) : null]
3294
- });
3295
- }
3296
- //#endregion
3297
- //#region src/core/display/DisclaimerBlock/DisclaimerBlock.tsx
3298
- function In({ label: r, children: i, className: a, style: o }) {
3299
- return /* @__PURE__ */ n("div", {
3300
- className: _("core-disclaimer-block", a),
3301
- style: o,
3302
- children: [r ? /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("strong", {
3303
- className: "core-disclaimer-block__label",
3304
- children: r
3305
- }), " "] }) : null, i]
3306
- });
3307
- }
3308
- //#endregion
3309
- //#region src/core/display/StatStrip/StatStrip.tsx
3310
- function Ln(e) {
3311
- let t = Number(e);
3312
- return Number.isFinite(t) ? Math.max(0, Math.min(100, t)) : 0;
3313
- }
3314
- function Rn({ label: e, value: r, fillPercent: i, subtitle: a, tone: o, className: s, style: c }) {
3315
- let l = Ln(i);
3316
- return /* @__PURE__ */ n("div", {
3317
- className: _("core-stat-strip", "core-toned", s),
3318
- "data-tone": R(o, "info"),
3319
- style: y({ "--core-stat-strip-fill": `${l}%` }, c),
3320
- children: [
3321
- /* @__PURE__ */ n("div", {
3322
- className: "core-stat-strip__row",
3323
- children: [/* @__PURE__ */ t("span", {
3324
- className: "core-stat-strip__label",
3325
- children: e
3326
- }), /* @__PURE__ */ t("span", {
3327
- className: "core-stat-strip__value",
3328
- children: X(r)
3329
- })]
3330
- }),
3331
- /* @__PURE__ */ t("div", {
3332
- className: "core-stat-strip__track",
3333
- children: /* @__PURE__ */ t("div", { className: "core-stat-strip__fill" })
3334
- }),
3335
- a ? /* @__PURE__ */ t("div", {
3336
- className: "core-stat-strip__subtitle",
3337
- children: X(a)
3338
- }) : null
3339
- ]
3340
- });
3341
- }
3342
- //#endregion
3343
- //#region src/core/display/_shared/ValueBadge.tsx
3344
- function zn({ text: e, tone: n, className: r }) {
3345
- return /* @__PURE__ */ t("span", {
3346
- className: _("core-value-badge", "core-toned", r),
3347
- "data-tone": R(n),
3348
- children: X(e)
3349
- });
3350
- }
3351
- //#endregion
3352
- //#region src/core/display/OptionCard/OptionCard.tsx
3353
- var Bn = 8, Vn = {
3354
- good: "success",
3355
- warn: "warning",
3356
- critical: "danger"
3357
- };
3358
- function Hn(e, t, n) {
3359
- let r = { series: String(n % Bn + 1) }, i = e ?? t;
3360
- if (typeof i != "string" || i === "") return r;
3361
- if (i === "muted") return { series: "muted" };
3362
- let a = /^series-([1-9]\d*)$/.exec(i);
3363
- if (a) return { series: String((Number(a[1]) - 1) % Bn + 1) };
3364
- let o = Vn[i];
3365
- return o ? { tone: o } : I.includes(i) ? { tone: i } : (F("OptionCard:colour", `[OptionCard] bar fill "${i}" is not a tone or a series slot; using the chart series by position. Name a tone (success, danger, …) or a slot (series-1…series-8).`), r);
3366
- }
3367
- function Un(e) {
3368
- return typeof e == "number" && Number.isFinite(e) ? {
3369
- text: String(e).padStart(2, "0"),
3370
- kind: "numeral"
3371
- } : typeof e != "string" || e.trim() === "" ? null : /^\d+$/.test(e.trim()) ? {
3372
- text: e.trim().padStart(2, "0"),
3373
- kind: "numeral"
3374
- } : {
3375
- text: e,
3376
- kind: "label"
3377
- };
3378
- }
3379
- function Wn(e) {
3380
- let { number: r, title: i, description: a, badgeText: o, badgeTone: s, bars: c, tone: l, isSelected: u = !1, className: d, style: f } = e, p = Array.isArray(c) ? c : [], m = Un(r);
3381
- return /* @__PURE__ */ n("div", {
3382
- className: _("core-option-card", d),
3383
- "data-selected": u ? "true" : void 0,
3384
- "data-described": a ? "true" : void 0,
3385
- style: f,
3386
- children: [
3387
- /* @__PURE__ */ n("div", {
3388
- className: "core-option-card__head",
3389
- children: [m ? /* @__PURE__ */ t("div", {
3390
- className: "core-option-card__number",
3391
- "data-kind": m.kind,
3392
- children: m.text
3393
- }) : /* @__PURE__ */ t("span", {}), o != null && o !== "" ? /* @__PURE__ */ t(zn, {
3394
- text: o,
3395
- tone: R(s)
3396
- }) : null]
3397
- }),
3398
- i ? /* @__PURE__ */ t("div", {
3399
- className: "core-option-card__title",
3400
- children: i
3401
- }) : null,
3402
- a ? /* @__PURE__ */ t("p", {
3403
- className: "core-option-card__description",
3404
- children: a
3405
- }) : null,
3406
- p.map((e, r) => {
3407
- let i = Hn(e.tone, l, r), a = Math.min(100, Math.max(0, Number(e.fillPercent) || 0)), o = e.valueTone === void 0 || e.valueTone === "default" ? void 0 : R(e.valueTone);
3408
- return /* @__PURE__ */ n("div", {
3409
- className: "core-option-card__bar",
3410
- children: [/* @__PURE__ */ n("div", {
3411
- className: "core-option-card__bar-head",
3412
- children: [/* @__PURE__ */ t("span", {
3413
- className: "core-option-card__bar-label",
3414
- children: e.label
3415
- }), /* @__PURE__ */ t("span", {
3416
- className: _("core-option-card__bar-value", o && "core-toned"),
3417
- "data-tone": o,
3418
- children: X(e.value)
3419
- })]
3420
- }), /* @__PURE__ */ t("div", {
3421
- className: "core-option-card__track",
3422
- children: /* @__PURE__ */ t("div", {
3423
- className: _("core-option-card__fill", "tone" in i && "core-toned"),
3424
- "data-tone": "tone" in i ? i.tone : void 0,
3425
- "data-series": "series" in i ? i.series : void 0,
3426
- style: y({ "--core-option-card-fill": `${a}%` })
3427
- })
3428
- })]
3429
- }, r);
3430
- })
3431
- ]
3432
- });
3433
- }
3434
- //#endregion
3435
- //#region src/core/display/ProfileCard/ProfileCard.tsx
3436
- function Gn(e) {
3437
- let { title: r, subtitle: i, rows: a, className: o, style: s } = e, c = e.tone ?? "info", l = c === "none", u = Array.isArray(a) ? a : [];
3438
- return /* @__PURE__ */ n("div", {
3439
- className: _("core-profile-card", !l && "core-toned", o),
3440
- "data-tone": l ? void 0 : R(c, "info"),
3441
- "data-marker": l ? "none" : void 0,
3442
- style: s,
3443
- children: [/* @__PURE__ */ n("div", {
3444
- className: "core-profile-card__head",
3445
- children: [/* @__PURE__ */ t("div", {
3446
- className: "core-profile-card__title",
3447
- children: r
3448
- }), i ? /* @__PURE__ */ t("div", {
3449
- className: "core-profile-card__subtitle",
3450
- children: i
3451
- }) : null]
3452
- }), u.map((e, r) => /* @__PURE__ */ n("div", {
3453
- className: "core-profile-card__row",
3454
- children: [/* @__PURE__ */ t("span", {
3455
- className: "core-profile-card__label",
3456
- children: e.label
3457
- }), /* @__PURE__ */ n("div", {
3458
- className: "core-profile-card__end",
3459
- children: [/* @__PURE__ */ t("span", {
3460
- className: "core-profile-card__value",
3461
- children: X(e.value)
3462
- }), e.badge ? /* @__PURE__ */ t(zn, {
3463
- text: e.badge.text,
3464
- tone: R(e.badge.tone)
3465
- }) : null]
3466
- })]
3467
- }, r))]
3468
- });
3469
- }
3470
- //#endregion
3471
- //#region src/core/display/KpiCardGrid/KpiCardGrid.tsx
3472
- function Kn(e) {
3473
- if (typeof e == "string") {
3474
- let t = e.trim();
3475
- return t.startsWith("+") ? "up" : t.startsWith("-") || t.startsWith("−") ? "down" : "flat";
3476
- }
3477
- return e && typeof e == "object" && typeof e.value == "number" ? e.value > 0 ? "up" : e.value < 0 ? "down" : "flat" : "flat";
3478
- }
3479
- var qn = {
3480
- up: "▲",
3481
- down: "▼",
3482
- flat: "—"
3483
- }, Jn = {
3484
- up: "success",
3485
- down: "danger",
3486
- flat: void 0
3487
- }, Z = (e) => e != null && e !== "";
3488
- function Yn(e) {
3489
- let { columns: r = 4, gap: i = "tight", minColumnWidth: a, className: o, style: s } = e, c = Array.isArray(e.cards) ? e.cards : [], l = Math.max(1, Math.min(6, Math.round(Number(r)) || 4));
3490
- return /* @__PURE__ */ t("div", {
3491
- className: _("core-kpi-card-grid", o),
3492
- "data-gap": i === "normal" ? "normal" : "tight",
3493
- style: y({
3494
- "--core-kpi-card-grid-columns": String(l),
3495
- "--core-kpi-card-grid-min": typeof a == "number" && a > 0 ? `${a}px` : void 0
3496
- }, s),
3497
- children: c.map((e, r) => {
3498
- let { subtitle: i, badge: a } = e, o = Z(e.tone) ? R(e.tone) : void 0, s = Z(e.delta) ? Kn(e.delta) : void 0, c = s ? Jn[s] : void 0;
3499
- return /* @__PURE__ */ t(Nn, {
3500
- direction: "up",
3501
- delay: r * .06,
3502
- className: "core-kpi-card-grid__item",
3503
- children: /* @__PURE__ */ n("div", {
3504
- className: _("core-kpi-card-grid__card", o && "core-toned"),
3505
- "data-tone": o,
3506
- children: [
3507
- /* @__PURE__ */ n("div", {
3508
- className: "core-kpi-card-grid__head",
3509
- children: [/* @__PURE__ */ t("div", {
3510
- className: "core-kpi-card-grid__label",
3511
- children: e.label
3512
- }), a && Z(a.text) ? /* @__PURE__ */ t(zn, {
3513
- text: a.text,
3514
- tone: R(a.tone)
3515
- }) : null]
3516
- }),
3517
- /* @__PURE__ */ t("div", {
3518
- className: "core-kpi-card-grid__value",
3519
- children: X(e.value)
3520
- }),
3521
- s ? /* @__PURE__ */ n("div", {
3522
- className: _("core-kpi-card-grid__delta", c && "core-toned"),
3523
- "data-tone": c,
3524
- "data-direction": s,
3525
- children: [
3526
- /* @__PURE__ */ t("span", {
3527
- "aria-hidden": "true",
3528
- children: qn[s]
3529
- }),
3530
- " ",
3531
- X(e.delta)
3532
- ]
3533
- }) : null,
3534
- Z(i) ? /* @__PURE__ */ t("div", {
3535
- className: "core-kpi-card-grid__subtitle",
3536
- children: X(i)
3537
- }) : null
3538
- ]
3539
- })
3540
- }, r);
3541
- })
3542
- });
3543
- }
3544
- //#endregion
3545
- //#region src/core/display/DataTable/DataTable.tsx
3546
- function Xn(e) {
3547
- if (typeof e == "string" && e !== "" && e !== "default") return R(e);
3548
- }
3549
- var Zn = (e) => !!(e && typeof e == "object" && "value" in e && "format" in e), Qn = (e) => !!(e && typeof e == "object" && !Array.isArray(e) && !a(e) && "value" in e && !("format" in e));
3550
- function $n(e) {
3551
- return Qn(e) ? e : { value: e };
3552
- }
3553
- var er = /^\d{4}-\d{2}-\d{2}$/, tr = /^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)?)?$/;
3554
- function nr(e, t) {
3555
- if (!tr.test(e)) return e;
3556
- let n = er.test(e), r = new Date(n ? `${e}T00:00:00Z` : e.replace(" ", "T"));
3557
- return Number.isNaN(r.getTime()) ? e : r.toLocaleString("en-CA", {
3558
- year: "numeric",
3559
- month: "short",
3560
- day: "numeric",
3561
- ...t === "datetime" && !n ? {
3562
- hour: "numeric",
3563
- minute: "2-digit"
3564
- } : {},
3565
- ...n ? { timeZone: "UTC" } : {}
3566
- });
3567
- }
3568
- function rr(e) {
3569
- if (!/^[a-z][a-z0-9]*([_-][a-z0-9]+)+$/.test(e)) return e;
3570
- let t = e.replace(/[_-]+/g, " ");
3571
- return t[0].toUpperCase() + t.slice(1);
3572
- }
3573
- function ir(e, t) {
3574
- return typeof e == "string" && t === "raw" ? e : typeof e == "string" && t ? nr(e, t) : typeof e == "string" && !t ? X(rr(e)) : typeof e == "string" || Zn(e) ? X(e) : typeof e == "number" ? String(e) : a(e) ? e : null;
3575
- }
3576
- function ar({ title: e, subtitle: r, columns: i, rows: a, className: o, style: s }) {
3577
- let c = `${l()}-title`, u = Array.isArray(i) ? i : [], d = Array.isArray(a) ? a : [], f = (e) => u[e]?.align ?? (e === 0 ? "left" : "right");
3578
- return /* @__PURE__ */ t(Nn, {
3579
- direction: "up",
3580
- children: /* @__PURE__ */ n("div", {
3581
- className: _("core-data-table", o),
3582
- style: s,
3583
- children: [e || r ? /* @__PURE__ */ n("div", {
3584
- className: "core-data-table__head",
3585
- children: [e ? /* @__PURE__ */ t("div", {
3586
- id: c,
3587
- className: "core-data-table__title",
3588
- children: e
3589
- }) : null, r ? /* @__PURE__ */ t("div", {
3590
- className: "core-data-table__subtitle",
3591
- children: r
3592
- }) : null]
3593
- }) : null, /* @__PURE__ */ t("div", {
3594
- className: "core-data-table__scroll",
3595
- role: "region",
3596
- "aria-label": e ? void 0 : "Data table, scrollable",
3597
- "aria-labelledby": e ? c : void 0,
3598
- tabIndex: 0,
3599
- children: /* @__PURE__ */ n("table", {
3600
- className: "core-data-table__table",
3601
- children: [/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { children: u.map((e, r) => /* @__PURE__ */ n("th", {
3602
- scope: "col",
3603
- className: "core-data-table__col",
3604
- "data-align": f(r),
3605
- style: y({ "--core-data-table-min": typeof e.minWidth == "number" && e.minWidth > 0 ? `${e.minWidth}px` : void 0 }),
3606
- children: [e.header, e.sublabel ? /* @__PURE__ */ t("span", {
3607
- className: "core-data-table__sublabel",
3608
- children: e.sublabel
3609
- }) : null]
3610
- }, r)) }) }), /* @__PURE__ */ t("tbody", { children: d.map((e, n) => {
3611
- let { highlighted: r, total: i } = e, a = e.cells, o = Array.isArray(a) ? a : a && typeof a == "object" ? u.map((e) => a[e.key]) : [];
3612
- return /* @__PURE__ */ t("tr", {
3613
- className: "core-data-table__row",
3614
- "data-highlighted": r ? "true" : void 0,
3615
- "data-total": i ? "true" : void 0,
3616
- children: o.map((e, n) => {
3617
- let r = $n(e), i = Xn(r.tone), a = {
3618
- className: _("core-data-table__cell", i && "core-toned"),
3619
- "data-align": f(n),
3620
- "data-tone": i
3621
- };
3622
- return n === 0 ? /* @__PURE__ */ t("th", {
3623
- scope: "row",
3624
- ...a,
3625
- children: ir(r.value, u[n]?.format)
3626
- }, n) : /* @__PURE__ */ t("td", {
3627
- ...a,
3628
- children: ir(r.value, u[n]?.format)
3629
- }, n);
3630
- })
3631
- }, n);
3632
- }) })]
3633
- })
3634
- })]
3635
- })
3636
- });
3637
- }
3638
- //#endregion
3639
- //#region src/core/events/_shared/event.ts
3640
- function or(e, t, n) {
3641
- return e.cardComponent && typeof t == "function" ? t(e.cardComponent, {
3642
- ...n,
3643
- event: e
3644
- }) ?? null : null;
3645
- }
3646
- var sr = [
3647
- "accepted",
3648
- "tentative",
3649
- "declined"
3650
- ], cr = (e, t) => new Intl.DateTimeFormat(e, {
3651
- weekday: "short",
3652
- month: "short",
3653
- day: "numeric",
3654
- timeZone: t
3655
- }), lr = (e, t) => new Intl.DateTimeFormat(e, {
3656
- hour: "numeric",
3657
- minute: "2-digit",
3658
- timeZone: t
3659
- });
3660
- function ur(e, t, n) {
3661
- if (e.startOn) {
3662
- let n = /* @__PURE__ */ new Date(`${e.startOn}T00:00:00Z`), r = cr(t, "UTC").format(n);
3663
- if (!e.endOn) return `${r} (all day)`;
3664
- let i = /* @__PURE__ */ new Date((/* @__PURE__ */ new Date(`${e.endOn}T00:00:00Z`)).getTime() - 864e5);
3665
- return i.getTime() <= n.getTime() ? `${r} (all day)` : `${r} – ${cr(t, "UTC").format(i)}`;
3666
- }
3667
- if (!e.startsAt) return "";
3668
- let r = new Date(e.startsAt);
3669
- if (Number.isNaN(r.getTime())) return "";
3670
- let i = cr(t, n).format(r), a = lr(t, n).format(r);
3671
- if (!e.endsAt) return `${i} · ${a}`;
3672
- let o = new Date(e.endsAt);
3673
- return Number.isNaN(o.getTime()) || o.getTime() === r.getTime() ? `${i} · ${a}` : `${i} · ${a} – ${lr(t, n).format(o)}`;
3674
- }
3675
- var dr = () => Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
3676
- function fr(e) {
3677
- if (!e) return;
3678
- let t = new Date(e);
3679
- return Number.isNaN(t.getTime()) ? void 0 : t.toISOString();
3680
- }
3681
- function pr() {
3682
- let e = /* @__PURE__ */ new Date();
3683
- return e.setMinutes(e.getMinutes() - e.getTimezoneOffset()), e.toISOString().slice(0, 16);
3684
- }
3685
- function mr(e) {
3686
- return e.success ? "" : e.code === "DENIED" ? "You can't do that here." : e.code === "CONFLICT" ? "Someone changed this first. Reload and try again." : e.code === "INVALID" ? e.errors || "Some details are missing or not valid." : e.errors || "Something went wrong. Try again.";
3687
- }
3688
- function hr(e, t) {
3689
- let n = typeof e == "string" ? new Date(e) : e;
3690
- return new Intl.DateTimeFormat("en-CA", {
3691
- timeZone: t,
3692
- year: "numeric",
3693
- month: "2-digit",
3694
- day: "2-digit"
3695
- }).format(n);
3696
- }
3697
- function Q(e, t) {
3698
- let n = /* @__PURE__ */ new Date(`${e}T00:00:00Z`);
3699
- return n.setUTCDate(n.getUTCDate() + t), n.toISOString().slice(0, 10);
3700
- }
3701
- function gr(e) {
3702
- return Q(e, -(((/* @__PURE__ */ new Date(`${e}T00:00:00Z`)).getUTCDay() + 6) % 7));
3703
- }
3704
- function _r(e, t) {
3705
- if (e.startOn) {
3706
- let t = e.endOn && e.endOn > e.startOn ? e.endOn : Q(e.startOn, 1), n = [];
3707
- for (let r = e.startOn; r < t && n.length < 62; r = Q(r, 1)) n.push(r);
3708
- return n;
3709
- }
3710
- return e.startsAt ? [hr(e.startsAt, t)] : [];
3711
- }
3712
- var $ = (e, t) => e && t ? e.split("{id}").join(encodeURIComponent(t)) : void 0;
3713
- //#endregion
3714
- //#region src/core/events/EventCard/EventCard.tsx
3715
- function vr(r) {
3716
- let { event: i, href: a, locale: o, timeZone: s, className: c, style: l } = r, u = i && typeof i == "object" ? i : { name: "" }, d = ur(u, o, s), f = u.status && u.status !== "confirmed" ? u.status : void 0, p = /* @__PURE__ */ n(e, { children: [
3717
- /* @__PURE__ */ n("div", {
3718
- className: "core-event-card__top",
3719
- children: [u.typeName ? /* @__PURE__ */ t("span", {
3720
- className: "core-event-card__type",
3721
- children: u.typeName
3722
- }) : null, f ? /* @__PURE__ */ t("span", {
3723
- className: "core-event-card__status",
3724
- "data-status": f,
3725
- children: f
3726
- }) : null]
3727
- }),
3728
- /* @__PURE__ */ t("div", {
3729
- className: "core-event-card__name",
3730
- children: u.name
3731
- }),
3732
- d ? /* @__PURE__ */ t("div", {
3733
- className: "core-event-card__when",
3734
- children: d
3735
- }) : null,
3736
- u.location ? /* @__PURE__ */ t("div", {
3737
- className: "core-event-card__where",
3738
- children: u.location
3739
- }) : null
3740
- ] });
3741
- return /* @__PURE__ */ t("div", {
3742
- className: _("core-event-card", c),
3743
- "data-kind": u.kind,
3744
- "data-status": u.status,
3745
- style: l,
3746
- children: a ? /* @__PURE__ */ t("a", {
3747
- className: "core-event-card__link",
3748
- href: a,
3749
- children: p
3750
- }) : p
3751
- });
3752
- }
3753
- //#endregion
3754
- //#region src/core/events/EventRespond/EventRespond.tsx
3755
- var yr = {
3756
- accepted: "Accept",
3757
- tentative: "Maybe",
3758
- declined: "Decline"
3759
- };
3760
- function br(e) {
3761
- let { actions: r, className: i, style: a } = e, [o, s] = m(e.response), [c, l] = m(!1), [u, d] = m(""), f = r?.respond, p = async (e) => {
3762
- if (!f || c) return;
3763
- l(!0), d("");
3764
- let t = await f({ response: e });
3765
- l(!1), t.success ? s(e) : d(mr(t));
3766
- };
3767
- return /* @__PURE__ */ n("div", {
3768
- className: _("core-event-respond", i),
3769
- style: a,
3770
- children: [/* @__PURE__ */ t("div", {
3771
- className: "core-event-respond__choices",
3772
- role: "group",
3773
- "aria-label": "Your response",
3774
- children: sr.map((e) => /* @__PURE__ */ t("button", {
3775
- type: "button",
3776
- className: "core-event-respond__choice",
3777
- "aria-pressed": o === e,
3778
- disabled: !f || c,
3779
- onClick: () => void p(e),
3780
- children: yr[e]
3781
- }, e))
3782
- }), u ? /* @__PURE__ */ t("p", {
3783
- className: "core-event-respond__message",
3784
- role: "alert",
3785
- children: u
3786
- }) : null]
3787
- });
3788
- }
3789
- //#endregion
3790
- //#region src/core/events/EventDetail/EventDetail.tsx
3791
- function xr(e) {
3792
- let { event: r, actions: i, viewerResponse: a, locale: o, timeZone: s, className: c, style: l } = e, u = r && typeof r == "object" ? r : { name: "" }, d = Array.isArray(e.notes) ? e.notes : [], f = Array.isArray(e.participants) ? e.participants : [], p = ur(u, o, s);
3793
- return /* @__PURE__ */ n("article", {
3794
- className: _("core-event-detail", c),
3795
- "data-status": u.status,
3796
- style: l,
3797
- children: [
3798
- /* @__PURE__ */ n("header", {
3799
- className: "core-event-detail__head",
3800
- children: [
3801
- u.typeName ? /* @__PURE__ */ t("div", {
3802
- className: "core-event-detail__type",
3803
- children: u.typeName
3804
- }) : null,
3805
- /* @__PURE__ */ t("h2", {
3806
- className: "core-event-detail__name",
3807
- children: u.name
3808
- }),
3809
- p ? /* @__PURE__ */ t("div", {
3810
- className: "core-event-detail__meta",
3811
- children: p
3812
- }) : null,
3813
- u.location ? /* @__PURE__ */ t("div", {
3814
- className: "core-event-detail__meta",
3815
- children: u.location
3816
- }) : null,
3817
- u.status && u.status !== "confirmed" ? /* @__PURE__ */ t("div", {
3818
- className: "core-event-detail__status",
3819
- children: u.status
3820
- }) : null
3821
- ]
3822
- }),
3823
- a === void 0 ? null : /* @__PURE__ */ t(br, {
3824
- response: a,
3825
- actions: i,
3826
- className: "core-event-detail__respond"
3827
- }),
3828
- f.length ? /* @__PURE__ */ n("section", {
3829
- className: "core-event-detail__section",
3830
- "aria-label": "Participants",
3831
- children: [/* @__PURE__ */ t("h3", {
3832
- className: "core-event-detail__heading",
3833
- children: "Participants"
3834
- }), /* @__PURE__ */ t("ul", {
3835
- className: "core-event-detail__list",
3836
- children: f.map((e, r) => /* @__PURE__ */ n("li", {
3837
- className: "core-event-detail__person",
3838
- children: [/* @__PURE__ */ t("span", { children: e.name }), /* @__PURE__ */ t("span", {
3839
- className: "core-event-detail__muted",
3840
- children: [e.role, e.response && e.response !== "needs_action" ? e.response : void 0].filter(Boolean).join(" · ")
3841
- })]
3842
- }, r))
3843
- })]
3844
- }) : null,
3845
- d.length ? /* @__PURE__ */ n("section", {
3846
- className: "core-event-detail__section",
3847
- "aria-label": "Notes",
3848
- children: [/* @__PURE__ */ t("h3", {
3849
- className: "core-event-detail__heading",
3850
- children: "Notes"
3851
- }), d.map((e, r) => /* @__PURE__ */ n("div", {
3852
- className: "core-event-detail__note",
3853
- "data-audience": e.audience,
3854
- children: [
3855
- e.audience === "staff" ? /* @__PURE__ */ t("div", {
3856
- className: "core-event-detail__badge",
3857
- children: "Staff only"
3858
- }) : null,
3859
- /* @__PURE__ */ t("p", {
3860
- className: "core-event-detail__body",
3861
- children: e.body
3862
- }),
3863
- e.author || e.createdAt ? /* @__PURE__ */ t("div", {
3864
- className: "core-event-detail__muted",
3865
- children: [e.author, e.createdAt ? new Date(e.createdAt).toLocaleString(o, { timeZone: s }) : void 0].filter(Boolean).join(" · ")
3866
- }) : null
3867
- ]
3868
- }, r))]
3869
- }) : null
3870
- ]
3871
- });
3872
- }
3873
- //#endregion
3874
- //#region src/core/events/EventLogForm/EventLogForm.tsx
3875
- var Sr = (e) => {
3876
- let t = e?.dataSchema?.properties ?? {}, n = new Set(e?.dataSchema?.required ?? []);
3877
- return Object.entries(t).map(([e, t]) => [
3878
- e,
3879
- t,
3880
- n.has(e)
3881
- ]);
3882
- };
3883
- function Cr(e) {
3884
- let { orgId: r, projectId: i, actions: a, onDone: o, canWriteStaffNotes: s, className: c, style: u } = e, f = Array.isArray(e.types) ? e.types : [], p = l(), [h, g] = m(e.defaultTypeId ?? f[0]?.id ?? ""), v = f.find((e) => e.id === h), y = v?.kind === "scheduled", [b, x] = m(""), [S, C] = m(pr()), [w, T] = m(""), [E, D] = m(""), [O, k] = m({}), [A, j] = m(""), [M, N] = m(!!s), [P, F] = m(!1), [I, L] = m(""), R = d(() => Sr(v), [v]);
3885
- if (!f.length) return /* @__PURE__ */ t("p", {
3886
- className: _("core-event-log", "core-event-log__empty", c),
3887
- style: u,
3888
- children: "There's nothing you can log here."
3889
- });
3890
- let z = async (t) => {
3891
- if (t.preventDefault(), !a?.logEvent || P || !v) return;
3892
- F(!0), L("");
3893
- let n = fr(S), c = {
3894
- event_type_id: v.id,
3895
- org_id: r,
3896
- name: b.trim() || v.name,
3897
- starts_at: n,
3898
- tzid: dr(),
3899
- data: O,
3900
- subjects: e.subjects ? [...e.subjects] : []
3901
- };
3902
- i && (c.project_id = i), y && w && (c.ends_at = fr(w)), E.trim() && (c.location = E.trim());
3903
- let l = A.trim() ? [{
3904
- body: A.trim(),
3905
- audience: s && M ? "staff" : "shared"
3906
- }] : void 0, u = await a.logEvent(l ? {
3907
- event: c,
3908
- notes: l
3909
- } : { event: c });
3910
- F(!1), u.success ? (x(""), j(""), k({}), o?.(u)) : L(mr(u));
3911
- }, B = (e, t) => k((n) => ({
3912
- ...n,
3913
- [e]: t
3914
- }));
3915
- return /* @__PURE__ */ n("form", {
3916
- className: _("core-event-log", c),
3917
- style: u,
3918
- onSubmit: (e) => void z(e),
3919
- children: [
3920
- /* @__PURE__ */ n("label", {
3921
- className: "core-event-log__field",
3922
- children: [/* @__PURE__ */ t("span", {
3923
- className: "core-event-log__label",
3924
- children: "Type"
3925
- }), /* @__PURE__ */ t("select", {
3926
- value: h,
3927
- onChange: (e) => {
3928
- g(e.target.value), k({});
3929
- },
3930
- children: f.map((e) => /* @__PURE__ */ t("option", {
3931
- value: e.id,
3932
- children: e.name
3933
- }, e.id))
3934
- })]
3935
- }),
3936
- /* @__PURE__ */ n("label", {
3937
- className: "core-event-log__field",
3938
- children: [/* @__PURE__ */ t("span", {
3939
- className: "core-event-log__label",
3940
- children: "Title"
3941
- }), /* @__PURE__ */ t("input", {
3942
- value: b,
3943
- onChange: (e) => x(e.target.value),
3944
- placeholder: v?.name
3945
- })]
3946
- }),
3947
- /* @__PURE__ */ n("div", {
3948
- className: "core-event-log__row",
3949
- children: [/* @__PURE__ */ n("label", {
3950
- className: "core-event-log__field",
3951
- children: [/* @__PURE__ */ t("span", {
3952
- className: "core-event-log__label",
3953
- children: y ? "Starts" : "When"
3954
- }), /* @__PURE__ */ t("input", {
3955
- type: "datetime-local",
3956
- required: !0,
3957
- value: S,
3958
- onChange: (e) => C(e.target.value)
3959
- })]
3960
- }), y ? /* @__PURE__ */ n("label", {
3961
- className: "core-event-log__field",
3962
- children: [/* @__PURE__ */ t("span", {
3963
- className: "core-event-log__label",
3964
- children: "Ends"
3965
- }), /* @__PURE__ */ t("input", {
3966
- type: "datetime-local",
3967
- value: w,
3968
- min: S,
3969
- onChange: (e) => T(e.target.value)
3970
- })]
3971
- }) : null]
3972
- }),
3973
- /* @__PURE__ */ n("label", {
3974
- className: "core-event-log__field",
3975
- children: [/* @__PURE__ */ t("span", {
3976
- className: "core-event-log__label",
3977
- children: "Where"
3978
- }), /* @__PURE__ */ t("input", {
3979
- value: E,
3980
- onChange: (e) => D(e.target.value)
3981
- })]
3982
- }),
3983
- R.map(([e, r, i]) => {
3984
- let a = r.title ?? e;
3985
- if (r.enum) return /* @__PURE__ */ n("label", {
3986
- className: "core-event-log__field",
3987
- children: [/* @__PURE__ */ t("span", {
3988
- className: "core-event-log__label",
3989
- children: a
3990
- }), /* @__PURE__ */ n("select", {
3991
- required: i,
3992
- value: String(O[e] ?? ""),
3993
- onChange: (t) => B(e, t.target.value || void 0),
3994
- children: [/* @__PURE__ */ t("option", {
3995
- value: "",
3996
- children: "—"
3997
- }), r.enum.map((e) => /* @__PURE__ */ t("option", {
3998
- value: e,
3999
- children: e
4000
- }, e))]
4001
- })]
4002
- }, e);
4003
- if (r.type === "boolean") return /* @__PURE__ */ n("label", {
4004
- className: "core-event-log__check",
4005
- children: [/* @__PURE__ */ t("input", {
4006
- type: "checkbox",
4007
- checked: !!O[e],
4008
- onChange: (t) => B(e, t.target.checked)
4009
- }), /* @__PURE__ */ t("span", { children: a })]
4010
- }, e);
4011
- let o = r.type === "number" || r.type === "integer";
4012
- return /* @__PURE__ */ n("label", {
4013
- className: "core-event-log__field",
4014
- children: [/* @__PURE__ */ t("span", {
4015
- className: "core-event-log__label",
4016
- children: a
4017
- }), /* @__PURE__ */ t("input", {
4018
- type: o ? "number" : "text",
4019
- step: r.type === "integer" ? 1 : "any",
4020
- required: i,
4021
- value: O[e] === void 0 ? "" : String(O[e]),
4022
- onChange: (t) => B(e, t.target.value === "" ? void 0 : o ? Number(t.target.value) : t.target.value)
4023
- })]
4024
- }, e);
4025
- }),
4026
- /* @__PURE__ */ n("label", {
4027
- className: "core-event-log__field",
4028
- children: [/* @__PURE__ */ t("span", {
4029
- className: "core-event-log__label",
4030
- children: "Note"
4031
- }), /* @__PURE__ */ t("textarea", {
4032
- rows: 3,
4033
- value: A,
4034
- onChange: (e) => j(e.target.value)
4035
- })]
4036
- }),
4037
- s && A.trim() ? /* @__PURE__ */ n("label", {
4038
- className: "core-event-log__check",
4039
- children: [/* @__PURE__ */ t("input", {
4040
- type: "checkbox",
4041
- checked: M,
4042
- onChange: (e) => N(e.target.checked)
4043
- }), /* @__PURE__ */ t("span", { children: "Staff only: the client won't see this note" })]
4044
- }) : null,
4045
- I ? /* @__PURE__ */ t("p", {
4046
- id: `${p}-error`,
4047
- className: "core-event-log__message",
4048
- role: "alert",
4049
- children: I
4050
- }) : null,
4051
- /* @__PURE__ */ t("div", {
4052
- className: "core-event-log__actions",
4053
- children: /* @__PURE__ */ t("button", {
4054
- type: "submit",
4055
- className: "core-event-log__submit",
4056
- disabled: P || !a?.logEvent,
4057
- children: P ? "Saving…" : y ? "Schedule" : "Log"
4058
- })
4059
- })
4060
- ]
4061
- });
4062
- }
4063
- //#endregion
4064
- //#region src/core/events/EventSchedule/EventSchedule.tsx
4065
- var wr = (e, t) => new Intl.DateTimeFormat(t, {
4066
- weekday: "short",
4067
- month: "short",
4068
- day: "numeric",
4069
- timeZone: "UTC"
4070
- }).format(/* @__PURE__ */ new Date(`${e}T00:00:00Z`));
4071
- function Tr(e) {
4072
- let { view: r = "week", weekParam: i = "week", eventHref: a = "?panel=event:{id}", locale: o, timeZone: s, renderComponent: c, className: l, style: u } = e, d = Array.isArray(e.occurrences) ? e.occurrences : [], f = hr(/* @__PURE__ */ new Date(), s), p = gr(/^\d{4}-\d{2}-\d{2}$/.test(e.weekOf ?? "") ? e.weekOf : f), m = Array.from({ length: 7 }, (e, t) => Q(p, t)), h = new Map(m.map((e) => [e, []]));
4073
- for (let e of d) for (let t of _r(e, s)) h.get(t)?.push(e);
4074
- for (let e of h.values()) e.sort((e, t) => +!e.startOn - !t.startOn || (e.startsAt ?? "").localeCompare(t.startsAt ?? ""));
4075
- let g = r === "agenda" ? m.filter((e) => h.get(e).length) : m;
4076
- return /* @__PURE__ */ n("section", {
4077
- className: _("core-event-schedule", l),
4078
- "data-view": r,
4079
- style: u,
4080
- "aria-label": "Schedule",
4081
- children: [
4082
- /* @__PURE__ */ n("div", {
4083
- className: "core-event-schedule__nav",
4084
- children: [
4085
- /* @__PURE__ */ t("a", {
4086
- className: "core-event-schedule__step",
4087
- href: `?${i}=${Q(p, -7)}`,
4088
- "aria-label": "Previous week",
4089
- children: "‹"
4090
- }),
4091
- /* @__PURE__ */ t("span", {
4092
- className: "core-event-schedule__range",
4093
- children: `${wr(m[0], o)} – ${wr(m[6], o)}`
4094
- }),
4095
- /* @__PURE__ */ t("a", {
4096
- className: "core-event-schedule__step",
4097
- href: `?${i}=${Q(p, 7)}`,
4098
- "aria-label": "Next week",
4099
- children: "›"
4100
- })
4101
- ]
4102
- }),
4103
- g.length === 0 ? /* @__PURE__ */ t("p", {
4104
- className: "core-event-schedule__empty",
4105
- children: "Nothing scheduled this week."
4106
- }) : null,
4107
- /* @__PURE__ */ t("ol", {
4108
- className: "core-event-schedule__days",
4109
- children: g.map((e) => {
4110
- let r = h.get(e);
4111
- return /* @__PURE__ */ n("li", {
4112
- className: "core-event-schedule__day",
4113
- "data-today": e === f || void 0,
4114
- children: [/* @__PURE__ */ t("h3", {
4115
- className: "core-event-schedule__date",
4116
- children: wr(e, o)
4117
- }), r.length ? /* @__PURE__ */ t("ul", {
4118
- className: "core-event-schedule__events",
4119
- children: r.map((e, n) => /* @__PURE__ */ t("li", { children: or(e, c, {
4120
- href: $(a, e.id),
4121
- locale: o,
4122
- timeZone: s
4123
- }) ?? /* @__PURE__ */ t(vr, {
4124
- event: e,
4125
- href: $(a, e.id),
4126
- locale: o,
4127
- timeZone: s
4128
- }) }, `${e.id ?? n}-${e.startsAt ?? e.startOn ?? n}`))
4129
- }) : /* @__PURE__ */ t("p", {
4130
- className: "core-event-schedule__none",
4131
- children: "—"
4132
- })]
4133
- }, e);
4134
- })
4135
- })
4136
- ]
4137
- });
4138
- }
4139
- //#endregion
4140
- //#region src/core/events/EventTimeline/EventTimeline.tsx
4141
- var Er = (e, t) => new Intl.DateTimeFormat(t, {
4142
- weekday: "long",
4143
- month: "long",
4144
- day: "numeric",
4145
- year: "numeric",
4146
- timeZone: "UTC"
4147
- }).format(/* @__PURE__ */ new Date(`${e}T00:00:00Z`));
4148
- function Dr(e) {
4149
- let { eventHref: r = "?panel=event:{id}", emptyText: i = "No activity yet.", locale: a, timeZone: o, renderComponent: s, className: c, style: l } = e, u = [...(Array.isArray(e.items) ? e.items : []).filter((e) => e && !Number.isNaN(new Date(e.at).getTime()))].sort((e, t) => new Date(t.at).getTime() - new Date(e.at).getTime()), d = [];
4150
- for (let e of u) {
4151
- let t = hr(e.at, o), n = d[d.length - 1];
4152
- n && n[0] === t ? n[1].push(e) : d.push([t, [e]]);
4153
- }
4154
- let f = new Intl.DateTimeFormat(a, {
4155
- hour: "numeric",
4156
- minute: "2-digit",
4157
- timeZone: o
4158
- });
4159
- return /* @__PURE__ */ n("section", {
4160
- className: _("core-event-timeline", c),
4161
- style: l,
4162
- "aria-label": "Activity",
4163
- children: [d.length === 0 ? /* @__PURE__ */ t("p", {
4164
- className: "core-event-timeline__empty",
4165
- children: i
4166
- }) : null, d.map(([e, i]) => /* @__PURE__ */ n("section", {
4167
- className: "core-event-timeline__day",
4168
- children: [/* @__PURE__ */ t("h3", {
4169
- className: "core-event-timeline__date",
4170
- children: Er(e, a)
4171
- }), /* @__PURE__ */ t("ol", {
4172
- className: "core-event-timeline__items",
4173
- children: i.map((e, i) => /* @__PURE__ */ n("li", {
4174
- className: "core-event-timeline__item",
4175
- "data-op": e.op || void 0,
4176
- children: [/* @__PURE__ */ n("div", {
4177
- className: "core-event-timeline__line",
4178
- children: [
4179
- /* @__PURE__ */ t("time", {
4180
- className: "core-event-timeline__time",
4181
- dateTime: e.at,
4182
- children: f.format(new Date(e.at))
4183
- }),
4184
- e.summary ? /* @__PURE__ */ t("span", {
4185
- className: "core-event-timeline__summary",
4186
- children: e.summary
4187
- }) : null,
4188
- e.actor ? /* @__PURE__ */ t("span", {
4189
- className: "core-event-timeline__actor",
4190
- children: e.actor
4191
- }) : null
4192
- ]
4193
- }), e.event ? or(e.event, s, {
4194
- href: $(r, e.event.id),
4195
- locale: a,
4196
- timeZone: o
4197
- }) ?? /* @__PURE__ */ t(vr, {
4198
- event: e.event,
4199
- href: $(r, e.event.id),
4200
- locale: a,
4201
- timeZone: o
4202
- }) : null]
4203
- }, e.id ?? `${e.at}-${i}`))
4204
- })]
4205
- }, e))]
4206
- });
4207
- }
4208
- //#endregion
4209
- export { Kt as ANSWER_COLUMN_PX, Le as Accordion, qt as AnswerRows, bt as Aside, ae as Avatar, dt as BLOCK_KINDS, wn as BLOCK_SCHEMAS, we as Badge, b as Box, Me as Button, Re as Card, x as Center, de as Checkbox, fe as CheckboxGroup, Ne as Chip, oe as Code, Be as Columns, Zt as ComparisonBars, S as Container, _n as Contents, tt as DEFAULT_PROFILE_ID, ar as DataTable, pe as DateRange, Ct as Definition, In as DisclaimerBlock, He as Disclosure, C as Divider, xn as DocumentBlocks, Lt as DocumentLabel, Cn as DocumentSection, hn as DocumentShell, Wt as DocumentTable, Te as EmptyState, vr as EventCard, xr as EventDetail, Cr as EventLogForm, br as EventRespond, Tr as EventSchedule, Dr as EventTimeline, yn as ExecutionBlock, V as Eyebrow, Ft as Figure, he as FileField, Pt as Footnote, H as FormField, Ue as Grid, ce as Heading, w as Hide, Fn as HighlightBox, Pe as IconButton, T as Inline, Yn as KpiCardGrid, Fe as Link, M as ListRow, un as Masthead, kt as Math, fn as MetaRail, en as NextSteps, nn as Notes, De as Notice, Wn as OptionCard, Ge as PAGINATOR_BINDINGS, It as PageBreak, N as PageFrame, te as PageHead, Gn as ProfileCard, Oe as Progress, xt as Prose, St as Quote, ge as RadioGroup, Ut as Reference, We as Repeat, Gt as RowList, ne as RuleSection, mn as RunningFooter, ye as SearchField, Pn as SectionHeader, Ie as SegmentedControl, be as Select, E as Show, ke as Skeleton, an as SkippedSection, xe as Slider, D as Spacer, Ae as Spinner, Ve as Split, O as Stack, An as Stat, jn as StatGroup, Rn as StatStrip, Se as Switch, I as TONES, sn as TalkItThrough, ue as Text, Ce as TextArea, ve as TextField, je as Tooltip, re as UnderlinedAction, cn as WRITE_HEIGHT_PX, tn as WRITE_LINE_HEIGHT_PX, ln as WriteInField, _ as cx, et as documentProfiles, ur as eventWhen, me as fileSize, Yt as formatValue, ie as initialsOf, B as inkToneOf, v as length, ut as profileCss, Ze as profileIds, ct as profileTokens, Xe as registerProfile, X as renderFormatted, Qe as resolveProfile, $e as resolvedProfiles, _e as toNumber, R as toneOf, or as typeCard, y as vars };
4210
-
4211
- //# sourceMappingURL=index.js.map
1
+ import{Fragment as e,jsx as t,jsxs as n}from"react/jsx-runtime";import{Children as r,cloneElement as i,createContext as a,isValidElement as o,useCallback as s,useContext as c,useEffect as l,useId as u,useLayoutEffect as d,useMemo as f,useReducer as p,useRef as m,useState as h,useSyncExternalStore as g}from"react";var _=new Set(["baseProps","data","status","actions","_traversal","isLoading","error","navigate","onNavigate","size","store"]);function v(e2){let t2={};for(let n2 in e2)_.has(n2)||(t2[n2]=e2[n2]);return t2}var y=(...e2)=>e2.filter(Boolean).join(" ")||void 0,b=e2=>e2===void 0?void 0:typeof e2=="number"?`${e2}px`:e2;function x(e2,t2){let n2=Object.fromEntries(Object.entries(e2).filter(([,e3])=>e3!==void 0));return Object.keys(n2).length||t2?{...n2,...t2}:void 0}function S({as:e2,className:n2,children:r2,...i2}){return t(e2??"div",{className:y("core-box",n2),...v(i2),children:r2})}function C({minHeight:e2,className:n2,style:r2,children:i2,...a2}){return t(S,{...a2,className:y("core-center",n2),style:x({"--core-center-min-height":b(e2)},r2),children:i2})}function w({name:e2,className:n2,style:r2,children:i2,...a2}){return t(S,{...a2,className:y("core-container",n2),style:x({"--core-container-name":e2},r2),children:i2})}function T({orientation:e2="horizontal",weight:n2="subtle",spacing:r2,className:i2,style:a2,ref:o2,...s2}){let c2={className:y("core-divider",i2),"data-weight":n2,"data-orientation":e2,style:x({"--core-divider-spacing":b(r2)},a2)};return e2==="vertical"?t("span",{role:"separator","aria-orientation":"vertical",...c2}):t("hr",{ref:o2,...v(s2),...c2})}function E({when:e2,children:n2,as:r2="span"}){return t(r2,{className:"core-hide","data-when":e2,children:n2})}function D({gap:e2,align:n2="center",justify:r2="start",wrap:i2=true,stackWhen:a2,className:o2,style:s2,children:c2,...l2}){return t(S,{...l2,className:y("core-inline",o2),"data-align":n2,"data-justify":r2,"data-wrap":i2?"true":"false","data-stack-when":a2,style:x({"--core-inline-gap":b(e2)},s2),children:c2})}var O=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","summary",'[contenteditable=""]','[contenteditable="true"]','[tabindex]:not([tabindex="-1"])'].join(",");function k(e2){return[...e2.querySelectorAll(O)].filter(e3=>!e3.closest("[inert]")&&!e3.hidden&&e3.getAttribute("aria-hidden")!=="true")}var A=()=>typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,j=2;function M({label:e2,snap:i2="start",children:a2,className:o2,...c2}){let u2=m(null),[d2,f2]=h({prev:false,next:false}),[p2,g2]=h(false),_2=s(()=>{let e3=u2.current;if(!e3)return;let t2=e3.scrollLeft>j,n2=e3.scrollWidth-e3.clientWidth-e3.scrollLeft>j;f2(e4=>e4.prev===t2&&e4.next===n2?e4:{prev:t2,next:n2}),g2(e3.scrollWidth>e3.clientWidth&&k(e3).length===0)},[]);l(()=>{let e3=u2.current;if(!e3)return;_2();let t2=new ResizeObserver(_2);t2.observe(e3);for(let n2 of Array.from(e3.children))t2.observe(n2);return()=>t2.disconnect()},[_2,a2]);let b2=e3=>{let t2=u2.current;t2&&t2.scrollBy({left:e3*t2.clientWidth*.8,behavior:A()?"auto":"smooth"})};return n("div",{...v(c2),className:y("core-rail",o2),"data-snap":i2,"data-prev":d2.prev?"":void 0,"data-next":d2.next?"":void 0,children:[t("button",{type:"button",className:"core-rail__arrow","data-direction":"prev","aria-label":`Scroll ${e2} back`,hidden:!d2.prev,onClick:()=>b2(-1),children:t("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:t("path",{d:"M10 3 5 8l5 5"})})}),t("ul",{ref:u2,role:"list","aria-label":e2,className:"core-rail__track",tabIndex:p2?0:void 0,onScroll:_2,children:r.toArray(a2).map((e3,n2)=>t("li",{className:"core-rail__item",children:e3},n2))}),t("button",{type:"button",className:"core-rail__arrow","data-direction":"next","aria-label":`Scroll ${e2} forward`,hidden:!d2.next,onClick:()=>b2(1),children:t("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:t("path",{d:"m6 3 5 5-5 5"})})})]})}function N({when:e2,children:n2,as:r2="span"}){return t(r2,{className:"core-show","data-when":e2,children:n2})}function P(e2,t2,n2){let[r2,i2]=h(t2),a2=e2!==void 0,o2=a2?e2:r2,c2=m(n2);return c2.current=n2,[o2,s(e3=>{a2||i2(e3),c2.current?.(e3)},[a2])]}function F(...e2){return t2=>{for(let n2 of e2)typeof n2=="function"?n2(t2):n2&&(n2.current=t2)}}function I(e2){let[t2,n2]=h(()=>typeof matchMedia=="function"&&matchMedia(e2).matches);return l(()=>{if(typeof matchMedia!="function")return;let t3=matchMedia(e2),r2=()=>n2(t3.matches);return r2(),t3.addEventListener("change",r2),()=>t3.removeEventListener("change",r2)},[e2]),t2}var L=(e2,t2,n2)=>Math.max(t2,Math.min(e2,n2));function R({anchor:e2,size:t2,viewport:n2,placement:r2,gap:i2=4,margin:a2=8}){let[o2,s2="center"]=r2.split("-"),c2=n2.height-a2-e2.bottom-i2,l2=e2.top-i2-a2,u2=e3=>t2.height<=e3,d2=o2;o2==="bottom"&&!u2(c2)&&l2>c2?d2="top":o2==="top"&&!u2(l2)&&c2>l2&&(d2="bottom");let f2=d2==="bottom"?e2.bottom+i2:e2.top-i2-t2.height;return{x:L(s2==="start"?e2.left:s2==="end"?e2.right-t2.width:(e2.left+e2.right)/2-t2.width/2,a2,Math.max(a2,n2.width-a2-t2.width)),y:L(f2,a2,Math.max(a2,n2.height-a2-t2.height)),placement:s2==="center"?d2:`${d2}-${s2}`}}function z(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("anchor-name","--a")}var B=4;function ee({trigger:r2,label:a2,placement:o2="bottom-start",open:s2,defaultOpen:c2=false,onOpenChange:f2,popupRole:p2="dialog",initialFocus:g2,onTriggerKeyDown:_2,children:v2,className:b2}){let[x2,S2]=P(s2,c2,f2),C2=u(),w2=`--core-a${C2.replace(/\W/g,"")}`,T2=m(null),E2=m(null),[D2]=h(z),O2=m(x2);O2.current=x2;let A2=m("closed");d(()=>{let e2=T2.current;if(e2){if(x2&&A2.current==="closed")A2.current="open",e2.showPopover();else if(!x2&&A2.current==="open"){A2.current="closed";let t2=document.activeElement;(!t2||t2===document.body||e2.contains(t2))&&E2.current?.focus({preventScroll:true}),e2.hidePopover()}}},[x2]),l(()=>{let e2=T2.current;if(!e2)return;let t2=t3=>{let n3=t3.newState;if(A2.current=n3==="open"?"open":"closed",n3==="open"&&!O2.current&&S2(true),n3==="closed"&&O2.current){S2(false);let t4=document.activeElement;(!t4||t4===document.body||e2.contains(t4))&&E2.current?.focus({preventScroll:true})}},n2=t3=>{if(t3.newState!=="open"||g2===false)return;let n3=(typeof g2=="function"?g2(e2):g2?e2.querySelector(g2):null)??k(e2)[0];n3?n3.focus({preventScroll:true}):(e2.tabIndex=-1,e2.focus({preventScroll:true}))};return e2.addEventListener("beforetoggle",t2),e2.addEventListener("toggle",n2),()=>{e2.removeEventListener("beforetoggle",t2),e2.removeEventListener("toggle",n2)}},[S2,g2]),d(()=>{let e2=T2.current,t2=E2.current;if(D2||!x2||!e2||!t2)return;let n2=()=>{let n3=R({anchor:t2.getBoundingClientRect(),size:{width:e2.offsetWidth,height:e2.offsetHeight},viewport:{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight},placement:o2,gap:B});e2.style.setProperty("--core-popover-x",`${n3.x}px`),e2.style.setProperty("--core-popover-y",`${n3.y}px`),e2.dataset.placement=n3.placement,e2.dataset.placed=""};n2();let r3=new ResizeObserver(n2);return r3.observe(e2),window.addEventListener("resize",n2),window.addEventListener("scroll",n2,true),()=>{delete e2.dataset.placed,r3.disconnect(),window.removeEventListener("resize",n2),window.removeEventListener("scroll",n2,true)}},[D2,x2,o2]);let j2=()=>S2(false),M2=r2.props,N2={ref:F(E2,M2.ref),popoverTarget:C2,"aria-haspopup":p2,"aria-expanded":x2,"aria-controls":C2,className:y(M2.className,"core-popover-anchor"),style:{...M2.style,"--core-popover-anchor":w2},onKeyDown:e2=>{_2?.(e2),M2.onKeyDown?.(e2)}};return n(e,{children:[i(r2,N2),t("div",{ref:T2,id:C2,popover:"auto",role:p2==="menu"?void 0:p2,"aria-label":p2==="menu"?void 0:a2,className:y("core-popover",b2),"data-placement":o2,"data-placer":D2?"anchor":"script",style:{"--core-popover-anchor":w2},onBlur:e2=>{let t2=e2.relatedTarget;t2&&!e2.currentTarget.contains(t2)&&t2!==E2.current&&j2()},children:x2?typeof v2=="function"?v2({close:j2}):v2:null})]})}var te=Symbol.for("peripheries.overlay.scrollLock.v1"),V=globalThis;function H(){if(typeof document>"u")return()=>{};let e2=V[te]??={count:0,overflow:""};e2.count===0&&(e2.overflow=document.body.style.overflow,document.body.style.overflow="hidden"),e2.count+=1;let t2=false;return()=>{t2||(t2=true,--e2.count,e2.count===0&&(document.body.style.overflow=e2.overflow))}}function U({variant:e2,open:r2,onClose:i2,title:a2,label:o2,description:s2,role:c2="dialog",initialFocus:d2,dismissOnBackdrop:f2=true,headerStart:p2,headerTools:h2,footer:g2,children:_2,className:v2}){let b2=m(null),x2=m(null),S2=m(i2);S2.current=i2;let C2=u(),w2=u();l(()=>{let e3=b2.current;if(!e3||!r2)return;let t2=document.activeElement;e3.showModal();let n2=H(),i3=(d2?e3.querySelector(d2):null)??k(e3)[0];i3?i3.focus({preventScroll:true}):e3.focus({preventScroll:true});let a3=e4=>{e4.preventDefault(),S2.current()};return e3.addEventListener("cancel",a3),()=>{e3.removeEventListener("cancel",a3),n2(),e3.open&&e3.close();let r3=document.activeElement;(!r3||r3===document.body)&&t2?.isConnected&&t2.focus({preventScroll:true})}},[r2,d2]);let T2=o2??(typeof a2=="string"?a2:"dialog");return t("dialog",{ref:b2,className:y("core-modal",v2),"data-variant":e2,role:c2==="alertdialog"?"alertdialog":void 0,"aria-labelledby":C2,"aria-describedby":s2?w2:void 0,tabIndex:-1,onKeyDown:e3=>{if(e3.key!=="Tab"||e3.defaultPrevented||e3.target.closest("dialog")!==e3.currentTarget)return;let t2=k(e3.currentTarget),n2=t2[0],r3=t2[t2.length-1];if(!n2||!r3)return e3.preventDefault();let i3=document.activeElement;e3.shiftKey&&(i3===n2||i3===e3.currentTarget)?(e3.preventDefault(),r3.focus()):!e3.shiftKey&&i3===r3&&(e3.preventDefault(),n2.focus())},onPointerDown:e3=>{x2.current=e3.target},onClick:e3=>{f2&&e3.target===e3.currentTarget&&x2.current===e3.currentTarget&&S2.current()},children:r2&&n("div",{className:"core-modal__surface",children:[n("header",{className:"core-modal__header",children:[p2,t("h2",{id:C2,className:"core-modal__title",children:a2}),t("div",{className:"core-modal__tools",children:h2}),t("button",{type:"button",className:"core-modal__close","aria-label":`Close ${T2}`,onClick:()=>S2.current(),children:t("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:t("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]}),n("div",{className:"core-modal__body",children:[s2?t("p",{id:w2,className:"core-modal__description",children:s2}):null,_2]}),g2?t("footer",{className:"core-modal__footer",children:g2}):null]})})}function ne({side:e2="bottom",back:n2,...r2}){let i2=n2?t("button",{type:"button",className:"core-modal__back","aria-label":`Back to ${n2.label}`,onClick:n2.onBack,children:t("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:t("path",{d:"M13 8H3M7 4 3 8l4 4"})})}):void 0;return t(U,{variant:e2==="end"?"sheet-end":"sheet-bottom",headerStart:i2,...r2})}var re="(max-width: 640px)",ie=600,ae=e2=>"type"in e2;function oe({items:r2,label:i2,onChoose:a2,onTab:o2,className:s2}){let c2=m(null),l2=m({text:"",at:0}),u2=()=>[...c2.current?.querySelectorAll('[role="menuitem"]')??[]];return t("div",{ref:c2,role:"menu","aria-label":i2,className:y("core-menu",s2),onKeyDown:e2=>{let t2=u2(),n2=t2.indexOf(document.activeElement),r3=n3=>{e2.preventDefault(),t2[(n3+t2.length)%t2.length]?.focus({preventScroll:true})};if(e2.key==="ArrowDown")r3(n2+1);else if(e2.key==="ArrowUp")r3(n2<0?-1:n2-1);else if(e2.key==="Home")r3(0);else if(e2.key==="End")r3(-1);else if(e2.key==="Tab")o2();else if(e2.key.length===1&&!e2.ctrlKey&&!e2.metaKey&&!e2.altKey&&e2.key!==" "){let r4=Date.now();l2.current.text=r4-l2.current.at>ie?e2.key.toLowerCase():l2.current.text+e2.key.toLowerCase(),l2.current.at=r4;let i3=l2.current.text,a3=[...t2.slice(n2+1),...t2.slice(0,n2+1)],o3=[...i3].every(e3=>e3===i3[0]),s3=a3.find(e3=>e3.textContent?.trim().toLowerCase().startsWith(i3))??(o3?a3.find(e3=>e3.textContent?.trim().toLowerCase().startsWith(i3[0]??"")):void 0);s3&&(e2.preventDefault(),s3.focus({preventScroll:true}))}},children:r2.map(r3=>{if(ae(r3))return t("div",{role:"separator",className:"core-menu__separator"},r3.id);let i3={role:"menuitem",tabIndex:-1,className:"core-menu__item","data-tone":r3.tone,"aria-disabled":r3.disabled||void 0,onClick:e2=>{if(r3.disabled)return e2.preventDefault();a2(r3)}},o3=n(e,{children:[r3.icon?t("span",{className:"core-menu__icon","aria-hidden":"true",children:r3.icon}):null,t("span",{className:"core-menu__label",children:r3.label})]});return r3.href&&!r3.disabled?t("a",{...i3,href:r3.href,children:o3},r3.id):t("button",{...i3,type:"button",children:o3},r3.id)})})}function se({trigger:r2,items:a2,label:o2,placement:s2="bottom-start",presentation:c2="auto",defaultOpen:l2=false,onOpenChange:u2,className:d2}){let f2=I(re),p2=c2==="sheet"||c2==="auto"&&f2,[m2,g2]=P(void 0,l2,u2),[_2,v2]=h("first"),y2=t(oe,{items:a2,label:o2,onChoose:e2=>{e2.onSelect?.(),g2(false)},onTab:()=>g2(false),className:d2}),b2=e2=>{(e2.key==="ArrowDown"||e2.key==="ArrowUp")&&(e2.preventDefault(),v2(e2.key==="ArrowUp"?"last":"first"),g2(true))};if(p2){let a3=r2.props;return n(e,{children:[i(r2,{"aria-haspopup":"menu","aria-expanded":m2,onClick:e2=>{a3.onClick?.(e2),v2("first"),g2(true)},onKeyDown:e2=>{b2(e2),a3.onKeyDown?.(e2)}}),t(ne,{open:m2,onClose:()=>g2(false),title:o2,initialFocus:'[role="menuitem"]',className:"core-menu-sheet",children:y2})]})}return t(ee,{trigger:r2,label:o2,placement:s2,open:m2,onOpenChange:g2,popupRole:"menu",initialFocus:e2=>{let t2=e2.querySelectorAll('[role="menuitem"]');return(_2==="last"?t2[t2.length-1]:t2[0])??null},onTriggerKeyDown:b2,className:"core-menu-popover",children:y2})}var ce=new Set;function W(e2,t2){ce.has(e2)||(ce.add(e2),typeof console<"u"&&console.warn(t2))}var G={title:120,description:280,label:40,visible:4,perSource:2,burst:5,windowMs:1e4,defaultDuration:6e3},le=1,ue=Symbol.for("peripheries.toast.v1"),de=["neutral","info","success","warning","danger"],fe=globalThis;function pe(){let e2=fe[ue];if(e2===void 0){let e3={version:le,snapshot:{toasts:[],actions:[]},listeners:new Set,handlers:new Map,sent:new Map,regionClaim:null,next:1};return fe[ue]=e3,e3}return e2.version!==le||!e2.listeners||!e2.handlers?(W("toast:version",`[toast] A toast store of version ${String(e2.version)} is on this page; this copy expects ${le}. Toasts from this copy are ignored.`),null):e2}function me(e2,t2){e2.snapshot={toasts:t2,actions:[...e2.handlers.keys()]};for(let t3 of[...e2.listeners])t3()}var he=(e2,t2)=>e2.length>t2?`${e2.slice(0,t2-1)}…`:e2;function ge(e2){let t2=pe();if(!t2)return null;if(!e2||typeof e2.title!="string"||e2.title.trim()==="")return W("toast:title","[toast] A toast needs a title of text; nothing was shown."),null;if(t2.regionClaim===null)return W("toast:region","[toast] No ToastRegion is mounted, so the toast was not shown. Mount <ToastRegion /> once, in the shell."),null;let n2=typeof e2.source=="string"&&e2.source?he(e2.source,40):"app",r2=Date.now(),i2=(t2.sent.get(n2)??[]).filter(e3=>r2-e3<G.windowMs);if(i2.length>=G.burst)return W(`toast:burst:${n2}`,`[toast] "${n2}" sent more than ${G.burst} toasts in ${G.windowMs/1e3}s; the rest are dropped.`),t2.sent.set(n2,i2),null;t2.sent.set(n2,[...i2,r2]);let a2=de.includes(e2.tone)?e2.tone:"neutral",o2=he(e2.title.trim(),G.title),s2=typeof e2.description=="string"&&e2.description.trim()?he(e2.description.trim(),G.description):void 0,c2=e2.action&&typeof e2.action.id=="string"&&typeof e2.action.label=="string"&&e2.action.label.trim()?{id:e2.action.id,label:he(e2.action.label.trim(),G.label)}:void 0,l2=typeof e2.id=="string"&&e2.id?e2.id:`${a2}|${o2}|${s2??""}`,u2=c2?0:typeof e2.duration=="number"&&e2.duration>=0?e2.duration:G.defaultDuration,d2=[...t2.snapshot.toasts],f2=d2.findIndex(e3=>e3.id===l2);if(f2>=0){let e3=d2[f2];d2[f2]={id:l2,title:o2,description:s2,tone:a2,duration:u2,action:c2,source:n2,revision:e3.revision+1}}else{for(d2.push({id:l2,title:o2,description:s2,tone:a2,duration:u2,action:c2,source:n2,revision:0});d2.filter(e3=>e3.source===n2).length>G.perSource;)d2.splice(d2.findIndex(e3=>e3.source===n2),1);for(;d2.length>G.visible;)d2=d2.slice(1)}return me(t2,d2),l2}function _e(e2){let t2=pe();t2&&t2.snapshot.toasts.some(t3=>t3.id===e2)&&me(t2,t2.snapshot.toasts.filter(t3=>t3.id!==e2))}function ve(e2){let t2=pe()?.handlers.get(e2);return t2?.(),!!t2}var ye={toasts:[],actions:[]},be=e2=>{let t2=pe();return t2?.listeners.add(e2),()=>void t2?.listeners.delete(e2)},xe=()=>pe()?.snapshot??ye;function Se(){let e2=pe();if(!e2)return null;if(e2.regionClaim!==null)return W("toast:second-region","[toast] A second ToastRegion was mounted; it does nothing, and its actions are ignored. Mount one per page."),null;let t2=Symbol("region");return e2.regionClaim=t2,{release(){e2.regionClaim===t2&&(e2.regionClaim=null,e2.handlers.clear(),me(e2,[]))},setActions(n2){e2.regionClaim===t2&&(e2.handlers=new Map(Object.entries(n2)),me(e2,e2.snapshot.toasts))}}}function Ce(){return{toast:ge,dismiss:_e}}function we({toast:e2,actionAvailable:r2=false,onAction:i2,onDismiss:a2,className:o2,...s2}){return n("div",{...s2,className:y("core-toast",o2),"data-tone":e2.tone,children:[n("div",{className:"core-toast__text",children:[t("p",{className:"core-toast__title",children:e2.title}),e2.description?t("p",{className:"core-toast__description",children:e2.description}):null]}),e2.action&&r2?t("button",{type:"button",className:"core-toast__action",onClick:i2,children:e2.action.label}):null,t("button",{type:"button",className:"core-toast__dismiss","aria-label":"Dismiss notification",onClick:a2,children:t("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:t("path",{d:"M3.5 3.5l9 9M12.5 3.5l-9 9"})})})]})}function Te({item:e2,actionAvailable:n2}){let[r2,i2]=h(false);return l(()=>{if(e2.duration===0||r2)return;let t2=setTimeout(()=>_e(e2.id),e2.duration);return()=>clearTimeout(t2)},[e2.id,e2.duration,e2.revision,r2]),t("div",{className:"core-toast-slot",onPointerEnter:()=>i2(true),onPointerLeave:()=>i2(false),onFocus:()=>i2(true),onBlur:e3=>{e3.currentTarget.contains(e3.relatedTarget)||i2(false)},children:t(we,{toast:e2,actionAvailable:n2,onAction:()=>{e2.action&&ve(e2.action.id),_e(e2.id)},onDismiss:()=>_e(e2.id)})})}function Ee({className:e2,actions:r2}){let[i2,a2]=h(false),o2=m(null),s2=m(r2);s2.current=r2;let c2=Object.keys(r2??{}).sort().join("\n"),u2=m(null),d2=m(false),{toasts:f2,actions:p2}=g(be,xe,xe);l(()=>{let e3=Se();return o2.current=e3,a2(e3!==null),()=>{e3?.release(),o2.current=null}},[]),l(()=>{o2.current?.setActions(Object.fromEntries((c2?c2.split("\n"):[]).map(e3=>[e3,()=>s2.current?.[e3]?.()])))},[c2,i2]);let _2=f2[f2.length-1],v2=_2?`${_2.id}:${_2.revision}`:"";if(l(()=>{let e3=u2.current;e3&&(d2.current&&e3.hidePopover(),d2.current=v2!=="",d2.current&&e3.showPopover())},[v2,i2]),!i2)return null;let b2=e3=>f2.filter(e3).map(e4=>t(Te,{item:e4,actionAvailable:!!e4.action&&p2.includes(e4.action.id)},e4.id));return n("div",{ref:u2,popover:"manual",role:"region","aria-label":"Notifications",className:y("core-toast-region",e2),children:[t("div",{role:"status","aria-live":"polite",className:"core-toast-region__list",children:b2(e3=>e3.tone!=="danger")}),t("div",{role:"alert","aria-live":"assertive",className:"core-toast-region__list",children:b2(e3=>e3.tone==="danger")})]})}function De({role:e2="dialog",dismissOnBackdrop:n2,...r2}){return t(U,{variant:"dialog",role:e2,dismissOnBackdrop:n2??e2!=="alertdialog",...r2})}function Oe({size:e2,className:n2,style:r2}){return t("span",{"aria-hidden":true,className:y("core-spacer",n2),style:x({"--core-spacer-size":b(e2)},r2)})}function ke({gap:e2,align:n2="stretch",justify:r2="start",className:i2,style:a2,children:o2,...s2}){return t(S,{...s2,className:y("core-stack",i2),"data-align":n2,"data-justify":r2,style:x({"--core-stack-gap":b(e2)},a2),children:o2})}var Ae=e2=>e2.startsWith("/")&&!e2.startsWith("//")&&!e2.includes("\\"),je=e2=>/^#[A-Za-z][\w:.-]*$/.test(e2);function Me({href:e2,action:t2,input:n2,actions:r2,navigate:i2,onClick:a2}){let[o2,s2]=h(false),c2=r2&&t2?r2[t2]:void 0;return{busy:o2,onClick:t3=>{if(a2)return a2(t3);if(c2){t3.preventDefault(),s2(true),c2(n2).finally(()=>s2(false));return}e2&&i2&&Ae(e2)&&t3.button===0&&!t3.metaKey&&!t3.ctrlKey&&!t3.shiftKey&&!t3.altKey&&(t3.preventDefault(),i2(e2))},external:!!e2&&!Ae(e2)&&!je(e2)}}function Ne({title:e2,meta:r2,leading:i2,value:a2,trailing:o2,href:s2,navigate:c2,onClick:l2,as:u2="div",className:d2,...f2}){let p2=Me({href:s2,navigate:c2,onClick:l2}),m2=u2,h2=s2?t("a",{className:"core-list-row__title core-list-row__link",href:s2,onClick:p2.onClick,...p2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:e2}):t("span",{className:"core-list-row__title",children:e2});return n(m2,{...v(f2),className:y("core-list-row",d2),children:[i2!=null&&t("div",{className:"core-list-row__leading",children:i2}),n("div",{className:"core-list-row__main",children:[h2,r2!=null&&t("span",{className:"core-list-row__meta",children:r2})]}),a2!=null&&t("div",{className:"core-list-row__value",children:a2}),o2!=null&&t("div",{className:"core-list-row__trailing",children:o2})]})}function Pe({header:e2,children:r2,measure:i2="page",className:a2,...o2}){return t("div",{...v(o2),className:y("core-page-frame",a2),"data-measure":i2,children:n("div",{className:"core-page-frame__column",children:[e2!=null&&t("header",{className:"core-page-frame__header",children:e2}),r2]})})}var Fe=["neutral","strong","accent","info","success","warning","danger"],Ie=()=>typeof process>"u"||false;function K(e2,t2="neutral"){return typeof e2=="string"&&Fe.includes(e2)?e2:(typeof e2=="string"&&e2&&Ie()&&W(`unknown-tone:${e2}`,`[core] "${e2}" is not a tone (${Fe.join(", ")}); using "${t2}".`),t2)}var Le=["subtle","on-dark","inherit"];function Re(e2,t2){return typeof e2=="string"&&(Le.includes(e2)||Fe.includes(e2))?e2:t2}function ze(e2){return{"data-tone":e2,toned:!Le.includes(e2)}}function Be({children:e2,as:n2="span",tone:r2,tabular:i2=false,className:a2,style:o2}){let{toned:s2,...c2}=ze(Re(r2,"subtle"));return t(n2,{className:y("core-eyebrow",s2&&"core-toned",a2),...c2,"data-tabular":i2?"true":void 0,style:o2,children:e2})}function Ve({title:e2,eyebrow:r2,intro:i2,actions:a2,className:o2,...s2}){return n("header",{...v(s2),className:y("core-page-head",o2),children:[r2&&t(Be,{as:"p",children:r2}),n("div",{className:"core-page-head__row",children:[t("h1",{className:"core-page-head__title",children:e2}),a2!=null&&t("div",{className:"core-page-head__actions",children:a2})]}),i2!=null&&t("p",{className:"core-page-head__intro",children:i2})]})}function He({label:e2,actions:r2,children:i2,rail:a2=false,anchor:o2,className:s2,...c2}){return t("section",{...v(c2),id:o2,"aria-label":e2,className:y("core-rule-section",s2),"data-rail":a2||void 0,children:n("div",{className:"core-rule-section__grid",children:[n("div",{className:"core-rule-section__head",children:[e2&&t(Be,{as:"p",children:e2}),r2!=null&&t("div",{className:"core-rule-section__actions",children:r2})]}),t("div",{className:"core-rule-section__body",children:i2})]})})}function Ue({label:r2,children:i2,arrow:a2=true,className:o2,href:s2,action:c2,input:l2,actions:u2,navigate:d2,onClick:f2,...p2}){let m2=Me({href:s2,action:c2,input:l2,actions:u2,navigate:d2,onClick:f2}),h2=n(e,{children:[t("span",{className:"core-underlined-action__label",children:i2??r2}),a2&&t("svg",{className:"core-underlined-action__arrow",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:t("path",{d:"M5 12h14M13 6l6 6-6 6"})})]}),g2={...v(p2),className:y("core-underlined-action",o2)};return s2?t("a",{...g2,href:s2,onClick:m2.onClick,...m2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:h2}):t("button",{...g2,type:"button",onClick:m2.onClick,disabled:m2.busy,children:h2})}var We=(e2="")=>e2.trim().split(/\s+/).filter(Boolean).map(e3=>e3[0].toUpperCase()).filter((e3,t2,n2)=>t2===0||t2===n2.length-1).join("").slice(0,2);function Ge({name:e2,initials:n2,src:r2,alt:i2,size:a2="md",className:o2,...s2}){let[c2,l2]=h(false),u2=i2??e2??"";return t("span",{...v(s2),className:y("core-avatar",o2),"data-size":a2,role:"img","aria-label":u2||void 0,children:r2&&!c2?t("img",{src:r2,alt:"",onError:()=>l2(true)}):t("span",{"aria-hidden":"true",children:n2??We(e2)})})}function Ke({code:e2,children:n2,block:r2=false,className:i2,...a2}){let o2=n2??e2;return r2?t("pre",{...v(a2),className:y("core-code",i2),"data-block":"",children:t("code",{children:o2})}):t("code",{...v(a2),className:y("core-code",i2),children:o2})}var qe={1:"lg",2:"md",3:"sm",4:"xs",5:"xs",6:"xs"};function Je({text:e2,children:n2,level:r2=2,size:i2,anchor:a2,className:o2,...s2}){let c2=Math.min(6,Math.max(1,Math.round(r2))),l2=`h${c2}`;return t(l2,{...v(s2),id:a2,className:y("core-heading",o2),"data-size":i2??qe[c2],children:n2??e2})}var Ye={xs:"eyebrow",sm:"body-sm",md:"body",lg:"title-sm",xl:"title-md"};function Xe({text:e2,children:n2,as:r2="span",size:i2="md",weight:a2="normal",tone:o2="default",align:s2="start",truncate:c2=false,lines:l2,className:u2,...d2}){let f2=r2,p2=l2&&l2>0?Math.min(6,Math.round(l2)):void 0;return t(f2,{...v(d2),className:y("core-text",u2),"data-role":Ye[i2]??"body","data-weight":a2,"data-tone":o2,"data-align":s2,"data-truncate":c2||void 0,"data-lines":p2,children:n2??e2})}function Ze({label:e2,hint:r2,error:i2,required:a2,htmlFor:o2,hintId:s2,errorId:c2,as:l2="div",children:d2,className:f2,style:p2}){let m2=u().replace(/:/g,""),h2=s2??(r2?`${o2??m2}-hint`:void 0),g2=c2??(i2?`${o2??m2}-error`:void 0),_2=l2,v2=l2==="fieldset"?"legend":"label";return n(_2,{className:y("core-field",f2),style:p2,"data-invalid":i2?"":void 0,children:[e2&&n(v2,{className:"core-field__label",...v2==="label"&&o2?{htmlFor:o2}:{},children:[e2,a2&&n("span",{className:"core-field__required","aria-hidden":"true",children:[" ","*"]})]}),r2&&t("p",{className:"core-field__hint",id:h2,children:r2}),d2,i2&&t("p",{className:"core-field__error",id:g2,children:i2})]})}function q(e2,t2,n2){let r2=u(),i2=e2??`f${r2.replace(/:/g,"")}`,a2=t2?`${i2}-hint`:void 0,o2=n2?`${i2}-error`:void 0;return{control:i2,hintId:a2,errorId:o2,aria:{"aria-describedby":[a2,o2].filter(Boolean).join(" ")||void 0,"aria-invalid":n2?true:void 0}}}function J(e2,t2){return n2=>{e2?.(n2),t2?.(n2)}}function Qe({value:e2,defaultValue:r2,onChange:i2,setValue:a2,id:o2,name:s2,label:c2,children:l2,hint:u2,error:d2,required:f2,disabled:p2,readOnly:m2,className:g2,style:_2,ref:v2}){let b2=q(o2,u2,d2),[x2,S2]=h(r2??false),C2=e2??x2,w2=J(i2,a2);return t(Ze,{className:y("core-checkbox",g2),style:_2,hint:u2,error:d2,hintId:b2.hintId,errorId:b2.errorId,children:n("label",{className:"core-choices__option","data-disabled":p2?"":void 0,children:[t("input",{ref:v2,id:b2.control,type:"checkbox",name:s2,checked:C2,required:f2,"aria-required":f2||void 0,disabled:p2,"aria-readonly":m2||void 0,onChange:t2=>{m2||(e2===void 0&&S2(t2.target.checked),w2(t2.target.checked))},...b2.aria}),n("span",{children:[l2??c2,f2&&t("span",{className:"core-field__required","aria-hidden":"true",children:" *"})]})]})})}function $e({options:e2,value:r2,defaultValue:i2,onChange:a2,setValue:o2,id:s2,name:c2,label:l2,hint:u2,error:d2,required:f2,disabled:p2,readOnly:m2,orientation:g2="vertical",min:_2,max:v2,className:b2,style:x2,ref:S2}){let C2=[_2===void 0?"":`at least ${_2}`,v2===void 0?"":`at most ${v2}`].filter(Boolean).join(", "),w2=[u2,C2?`Choose ${C2}.`:""].filter(Boolean).join(" ")||void 0,T2=q(s2,w2,d2),[E2,D2]=h(i2??[]),O2=r2??E2,k2=J(a2,o2),A2=v2!==void 0&&O2.length>=v2;return t(Ze,{as:"fieldset",className:y("core-choices",b2),style:x2,label:l2,hint:w2,error:d2,required:f2,hintId:T2.hintId,errorId:T2.errorId,children:t("div",{className:"core-choices__list","data-orientation":g2,role:"group",...T2.aria,children:e2.map((i3,a3)=>{let o3=O2.includes(i3.value);return n("label",{className:"core-choices__option","data-disabled":i3.disabled||p2?"":void 0,children:[t("input",{ref:a3===0?S2:void 0,id:a3===0?T2.control:void 0,type:"checkbox",name:c2,value:i3.value,checked:o3,disabled:i3.disabled||p2||!o3&&A2||m2&&!o3,"aria-readonly":m2||void 0,onChange:()=>{if(m2)return;let t2=e2.map(e3=>e3.value).filter(e3=>e3===i3.value?!o3:O2.includes(e3));r2===void 0&&D2(t2),k2(t2)}}),t("span",{children:i3.label})]},i3.value)})})})}function et({value:e2,defaultValue:r2,onChange:i2,setValue:a2,id:o2,name:s2,label:c2,hint:l2,error:u2,required:d2,disabled:f2,readOnly:p2,min:m2,max:g2,fromLabel:_2="From",toLabel:v2="To",className:b2,style:x2,ref:S2}){let C2=q(o2,l2,u2),[w2,T2]=h(r2??{from:null,to:null}),E2=e2??w2,D2=J(i2,a2),O2=(t2,n2)=>{if(p2)return;let r3={...E2,[t2]:n2===""?null:n2};e2===void 0&&T2(r3),D2(r3)},k2={disabled:f2,readOnly:p2,required:d2,"aria-required":d2||void 0,className:"core-input",...C2.aria};return t(Ze,{as:"fieldset",className:y("core-date-range",b2),style:x2,label:c2,hint:l2,error:u2,required:d2,hintId:C2.hintId,errorId:C2.errorId,children:n("div",{className:"core-date-range__row",children:[n("label",{className:"core-date-range__part",children:[t("span",{className:"core-date-range__label",children:_2}),t("input",{ref:S2,id:C2.control,type:"date",name:s2?`${s2}.from`:void 0,value:E2.from??"",min:m2,max:E2.to??g2,onChange:e3=>O2("from",e3.target.value),...k2})]}),n("label",{className:"core-date-range__part",children:[t("span",{className:"core-date-range__label",children:v2}),t("input",{type:"date",name:s2?`${s2}.to`:void 0,value:E2.to??"",min:E2.from??m2,max:g2,onChange:e3=>O2("to",e3.target.value),...k2})]})]})})}function tt(e2){return!Number.isFinite(e2)||e2<0?"":e2<1024?`${e2} B`:e2<1048576?`${(e2/1024).toFixed(+(e2<10240))} KB`:`${(e2/1048576).toFixed(1)} MB`}function nt({value:r2,defaultValue:i2,onChange:a2,setValue:o2,id:s2,name:c2,label:l2,hint:u2,error:d2,required:f2,disabled:p2,readOnly:g2,upload:_2,accept:v2,hash:b2=false,className:x2,style:S2,ref:C2}){let w2=q(s2,u2,d2),[T2,E2]=h(i2??null),D2=r2===void 0?T2:r2,O2=J(a2,o2),[k2,A2]=h({busy:false,dragging:false}),j2=m(null),M2=e2=>{r2===void 0&&E2(e2),O2(e2)},N2=async e2=>{if(e2&&_2&&!g2&&!p2){A2({busy:true,dragging:false});try{let t2=await _2(e2,{hash:b2});"error"in t2?A2({busy:false,failed:t2.error,dragging:false}):(A2({busy:false,dragging:false}),M2(t2))}catch{A2({busy:false,failed:"That file couldn’t be stored. Try again.",dragging:false})}}},P2=e2=>{e2.preventDefault(),N2(e2.dataTransfer.files?.[0])},F2=d2??k2.failed;return t(Ze,{className:y("core-file-field",x2),style:S2,label:l2,hint:u2,error:F2,required:f2,htmlFor:w2.control,hintId:w2.hintId,errorId:F2?`${w2.control}-error`:void 0,children:n("div",{className:"core-file-field__box","data-dragging":k2.dragging?"":void 0,"data-busy":k2.busy?"":void 0,onDragOver:e2=>{g2||p2||!_2||(e2.preventDefault(),k2.dragging||A2(e3=>({...e3,dragging:true})))},onDragLeave:()=>A2(e2=>({...e2,dragging:false})),onDrop:P2,children:[D2?n("div",{className:"core-file-field__file",children:[t("span",{className:"core-file-field__name",children:D2.file.name}),t("span",{className:"core-file-field__size",children:tt(D2.file.size)}),!g2&&!p2&&t("button",{type:"button",className:"core-file-field__button",onClick:()=>M2(null),"aria-label":`Remove ${D2.file.name}`,children:"Remove"})]}):k2.busy?t("span",{className:"core-file-field__status",role:"status",children:"Uploading…"}):n(e,{children:[t("button",{ref:C2,id:w2.control,type:"button",className:"core-file-field__button",disabled:p2||g2||!_2,"aria-required":f2||void 0,"aria-describedby":[w2.hintId,F2?`${w2.control}-error`:void 0].filter(Boolean).join(" ")||void 0,"aria-invalid":F2?true:void 0,onClick:()=>j2.current?.click(),children:"Choose file"}),t("span",{className:"core-file-field__drop",children:"or drop it here"})]}),t("input",{ref:j2,type:"file",name:c2,accept:v2,hidden:true,tabIndex:-1,onChange:e2=>void N2(e2.target.files?.[0])})]})})}function rt({options:e2,value:r2,defaultValue:i2,onChange:a2,setValue:o2,id:s2,name:c2,label:l2,hint:u2,error:d2,required:f2,disabled:p2,readOnly:m2,orientation:g2="vertical",className:_2,style:v2,ref:b2}){let x2=q(s2,u2,d2),[S2,C2]=h(i2??null),w2=r2===void 0?S2:r2,T2=J(a2,o2),E2=c2??x2.control;return t(Ze,{as:"fieldset",className:y("core-choices",_2),style:v2,label:l2,hint:u2,error:d2,required:f2,hintId:x2.hintId,errorId:x2.errorId,children:t("div",{className:"core-choices__list","data-orientation":g2,role:"radiogroup","aria-required":f2||void 0,...x2.aria,children:e2.map((e3,i3)=>n("label",{className:"core-choices__option","data-disabled":e3.disabled||p2?"":void 0,children:[t("input",{ref:i3===0?b2:void 0,id:i3===0?x2.control:void 0,type:"radio",name:E2,value:e3.value,checked:w2===e3.value,disabled:e3.disabled||p2||m2&&w2!==e3.value,onChange:()=>{m2||(r2===void 0&&C2(e3.value),T2(e3.value))}}),t("span",{children:e3.label})]},e3.value))})})}var it=e2=>{if(e2.trim()==="")return null;let t2=Number(e2);return Number.isFinite(t2)?t2:null};function at({type:e2="text",value:r2,defaultValue:i2,onChange:a2,setValue:o2,id:s2,name:c2,label:u2,hint:d2,error:f2,required:p2,disabled:m2,readOnly:g2,placeholder:_2,inputMode:v2,autoComplete:b2,min:x2,max:S2,step:C2,prefix:w2,suffix:T2,onEnter:E2,onKeyDown:D2,onBlur:O2,className:k2,style:A2,ref:j2}){let M2=q(s2,d2,f2),[N2,P2]=h(i2),F2=r2===void 0?N2:r2,I2=J(a2,o2),L2=e3=>e3==null?"":String(e3),[R2,z2]=h(L2(F2));l(()=>{e2==="number"&&it(R2)!==(F2??null)&&z2(L2(F2))},[F2]);let B2=t("input",{ref:j2,id:M2.control,name:c2,type:e2==="number"?"text":e2,className:"core-input core-text-field__input",value:e2==="number"?R2:L2(F2),onChange:t2=>{let n2=t2.target.value,i3=e2==="number"?it(n2):n2;e2==="number"&&z2(n2),r2===void 0&&P2(i3),I2(i3)},onKeyDown:e3=>{D2?.(e3),!e3.defaultPrevented&&E2&&e3.key==="Enter"&&!e3.shiftKey&&!e3.nativeEvent.isComposing&&e3.keyCode!==229&&E2(e3)},onBlur:O2,placeholder:_2,inputMode:v2??(e2==="number"?"decimal":void 0),autoComplete:b2,min:e2==="number"?void 0:x2,max:e2==="number"?void 0:S2,step:e2==="number"?void 0:C2,required:p2,"aria-required":p2||void 0,disabled:m2,readOnly:g2,...M2.aria}),ee2=w2||T2?n("div",{className:"core-text-field__affixed",children:[w2&&t("span",{className:"core-text-field__affix","aria-hidden":"true",children:w2}),B2,T2&&t("span",{className:"core-text-field__affix","aria-hidden":"true",children:T2})]}):B2;return t(Ze,{className:y("core-text-field",k2),style:A2,label:u2,hint:d2,error:f2,required:p2,htmlFor:M2.control,hintId:M2.hintId,errorId:M2.errorId,children:ee2})}function ot({value:e2,defaultValue:r2,onChange:i2,setValue:a2,label:o2="Search",onSearch:s2,size:c2="md",className:l2,...u2}){let[d2,f2]=h(r2??""),p2=e2??d2,m2=t2=>{e2===void 0&&f2(t2),i2?.(t2),a2?.(t2)};return n("div",{className:y("core-search-field",l2),"data-filled":p2?"":void 0,"data-size":c2,children:[t(at,{...u2,label:o2,value:p2,onChange:e3=>m2(typeof e3=="string"?e3:""),onEnter:()=>s2?.(p2),inputMode:"search",className:"core-search-field__field"}),n("svg",{className:"core-search-field__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:[t("circle",{cx:"11",cy:"11",r:"6.5"}),t("path",{d:"M16 16l4 4"})]}),p2&&!u2.disabled&&!u2.readOnly&&t("button",{type:"button",className:"core-search-field__clear","aria-label":"Clear search",onClick:()=>m2(""),children:t("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:t("path",{d:"M6 6l12 12M18 6L6 18"})})})]})}function st({options:e2,value:r2,defaultValue:i2,onChange:a2,setValue:o2,id:s2,name:c2,label:l2,hint:u2,error:d2,required:f2,disabled:p2,readOnly:m2,placeholder:g2="Choose…",className:_2,style:v2,ref:b2}){let x2=q(s2,u2,d2),[S2,C2]=h(i2??null),w2=r2===void 0?S2:r2,T2=J(a2,o2);return t(Ze,{className:y("core-select",_2),style:v2,label:l2,hint:u2,error:d2,required:f2,htmlFor:x2.control,hintId:x2.hintId,errorId:x2.errorId,children:n("select",{ref:b2,id:x2.control,name:c2,className:"core-input core-select__input",value:w2??"",onChange:e3=>{let t2=e3.target.value===""?null:e3.target.value;r2===void 0&&C2(t2),T2(t2)},required:f2,"aria-required":f2||void 0,disabled:p2||m2,"aria-readonly":m2||void 0,...x2.aria,children:[t("option",{value:"",children:g2}),e2.map(e3=>t("option",{value:e3.value,disabled:e3.disabled,children:e3.label},e3.value))]})})}function ct({value:e2,defaultValue:r2,onChange:i2,setValue:a2,id:o2,name:s2,label:c2,hint:l2,error:u2,required:d2,disabled:f2,readOnly:p2,min:m2=0,max:g2=100,step:_2=1,format:v2=String,className:b2,style:x2,ref:S2}){let C2=q(o2,l2,u2),[w2,T2]=h(r2??m2),E2=e2??w2,D2=J(i2,a2);return t(Ze,{className:y("core-slider",b2),style:x2,label:c2,hint:l2,error:u2,required:d2,htmlFor:C2.control,hintId:C2.hintId,errorId:C2.errorId,children:n("div",{className:"core-slider__row",children:[t("input",{ref:S2,id:C2.control,name:s2,type:"range",className:"core-slider__input",min:m2,max:g2,step:_2,value:E2,disabled:f2,"aria-readonly":p2||void 0,"aria-valuetext":v2(E2),onChange:t2=>{if(p2)return;let n2=Number(t2.target.value);e2===void 0&&T2(n2),D2(n2)},...C2.aria}),t("output",{className:"core-slider__value",htmlFor:C2.control,children:v2(E2)})]})})}function lt({value:e2,defaultValue:r2,onChange:i2,setValue:a2,id:o2,name:s2,label:c2,hint:l2,error:u2,disabled:d2,readOnly:f2,className:p2,style:m2,ref:g2}){let _2=q(o2,l2,u2),[v2,b2]=h(r2??false),x2=e2??v2,S2=J(i2,a2);return n("div",{className:y("core-switch",p2),style:m2,children:[n("button",{ref:g2,id:_2.control,name:s2,type:"button",role:"switch","aria-checked":x2,"aria-readonly":f2||void 0,disabled:d2,className:"core-switch__control",onClick:()=>{f2||(e2===void 0&&b2(!x2),S2(!x2))},..._2.aria,children:[t("span",{className:"core-switch__track","aria-hidden":"true",children:t("span",{className:"core-switch__thumb"})}),t("span",{className:"core-switch__label",children:c2})]}),l2&&t("p",{className:"core-field__hint",id:_2.hintId,children:l2}),u2&&t("p",{className:"core-field__error",id:_2.errorId,children:u2})]})}function ut({value:e2,defaultValue:r2,onChange:i2,setValue:a2,id:o2,name:s2,label:c2,hint:l2,error:u2,required:f2,disabled:p2,readOnly:g2,placeholder:_2,rows:v2=3,autoGrow:b2=true,maxLength:x2,onKeyDown:S2,onBlur:C2,className:w2,style:T2,ref:E2}){let D2=q(o2,l2,u2),[O2,k2]=h(r2??""),A2=e2??O2,j2=J(i2,a2),M2=m(null);return d(()=>{let e3=M2.current;b2&&e3&&(e3.style.height="auto",e3.style.height=`${e3.scrollHeight+2}px`)},[A2,b2]),n(Ze,{className:y("core-text-area",w2),style:T2,label:c2,hint:l2,error:u2,required:f2,htmlFor:D2.control,hintId:D2.hintId,errorId:D2.errorId,children:[t("textarea",{ref:e3=>{M2.current=e3,typeof E2=="function"?E2(e3):E2&&(E2.current=e3)},id:D2.control,name:s2,className:"core-input core-text-area__input",rows:v2,value:A2,onChange:t2=>{e2===void 0&&k2(t2.target.value),j2(t2.target.value)},onKeyDown:S2,onBlur:C2,placeholder:_2,maxLength:x2,required:f2,"aria-required":f2||void 0,disabled:p2,readOnly:g2,...D2.aria}),x2!==void 0&&n("span",{className:"core-field__hint","aria-live":"polite",children:[A2.length," / ",x2]})]})}function dt({label:e2,children:n2,tone:r2,variant:i2="soft",className:a2,...o2}){return t("span",{...v(o2),className:y("core-badge","core-toned",a2),"data-tone":K(r2),"data-variant":i2,children:n2??e2})}function ft({message:e2,title:r2,action:i2,className:a2,...o2}){return n("div",{...v(o2),className:y("core-empty-state",a2),role:"status",children:[r2&&t("p",{className:"core-empty-state__title",children:r2}),t("p",{className:"core-empty-state__message",children:e2}),i2!=null&&t("div",{className:"core-empty-state__action",children:i2})]})}var pt={info:"M12 16v-5M12 8h.01M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z",success:"M8 12.5l2.5 2.5L16 9.5M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z",warning:"M12 9v4M12 17h.01M10.3 3.9L2.2 18a2 2 0 0 0 1.7 3h16.2a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z",danger:"M12 8v5M12 16h.01M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z"};function mt({title:e2,message:r2,children:i2,tone:a2,action:o2,onDismiss:s2,className:c2,...l2}){let u2=K(a2,"info"),d2=u2==="warning"||u2==="danger";return n("div",{...v(l2),role:d2?"alert":"status",className:y("core-notice","core-toned",c2),"data-tone":u2,children:[t("svg",{className:"core-notice__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:t("path",{d:pt[u2]??pt.info})}),n("div",{className:"core-notice__body",children:[e2&&t("p",{className:"core-notice__title",children:e2}),t("div",{className:"core-notice__message",children:i2??r2})]}),o2&&t("div",{className:"core-notice__action",children:o2}),s2&&t("button",{type:"button",className:"core-notice__dismiss","aria-label":"Dismiss",onClick:s2,children:t("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round","aria-hidden":"true",focusable:"false",children:t("path",{d:"M6 6l12 12M18 6L6 18"})})})]})}function ht({value:e2,max:r2=100,label:i2,showValue:a2=false,tone:o2,size:s2="md",className:c2,style:l2,...u2}){let d2=typeof e2=="number"&&Number.isFinite(e2)&&r2>0,f2=d2?Math.max(0,Math.min(100,e2/r2*100)):0;return n("div",{...v(u2),className:y("core-progress","core-toned",c2),"data-tone":K(o2,"accent"),"data-size":s2,style:l2,children:[(i2||a2&&d2)&&n("div",{className:"core-progress__head",children:[i2&&t("span",{className:"core-progress__label",children:i2}),a2&&d2&&n("span",{className:"core-progress__value",children:[Math.round(f2),"%"]})]}),t("div",{className:"core-progress__track",role:"progressbar","aria-label":i2,"aria-valuemin":0,"aria-valuemax":d2?r2:void 0,"aria-valuenow":d2?e2:void 0,"data-indeterminate":d2?void 0:"",style:x({"--core-progress-fill":`${f2}%`}),children:t("div",{className:"core-progress__fill"})})]})}function gt({shape:e2="text",lines:n2=3,width:r2,height:i2,className:a2,style:o2,...s2}){let c2=x({"--core-skeleton-w":b(r2),"--core-skeleton-h":b(i2)},o2);if(e2!=="text")return t("span",{...v(s2),"aria-hidden":"true",className:y("core-skeleton",a2),"data-shape":e2,style:c2});let l2=Math.max(1,Math.min(12,Math.round(n2)));return t("span",{...v(s2),"aria-hidden":"true",className:y("core-skeleton-lines",a2),style:c2,children:Array.from({length:l2},(e3,n3)=>t("span",{className:"core-skeleton","data-shape":"line","data-last":n3===l2-1&&l2>1?"":void 0},n3))})}function _t({label:e2="Loading",size:n2="md",className:r2,...i2}){return t("span",{...v(i2),role:"status","aria-label":e2,className:y("core-spinner",r2),"data-size":n2})}function vt({content:e2,text:r2,children:i2,side:a2="top",className:o2,...s2}){let[c2,d2]=h(false),f2=u();return l(()=>{if(!c2)return;let e3=e4=>{e4.key==="Escape"&&d2(false)};return document.addEventListener("keydown",e3),()=>document.removeEventListener("keydown",e3)},[c2]),n("span",{...v(s2),className:y("core-tooltip",o2),"aria-describedby":f2,onMouseEnter:()=>d2(true),onMouseLeave:()=>d2(false),onFocus:()=>d2(true),onBlur:()=>d2(false),children:[i2,t("span",{id:f2,role:"tooltip",className:"core-tooltip__bubble","data-side":a2,"data-open":c2?"":void 0,children:e2??r2})]})}function yt({children:r2,label:i2,variant:a2="primary",size:o2="md",tone:s2="neutral",iconLeft:c2,iconRight:l2,loading:u2=false,disabled:d2=false,type:f2="button",fullWidth:p2=false,className:m2,href:h2,action:g2,input:_2,actions:b2,navigate:x2,onClick:S2,...C2}){let w2=Me({href:h2,action:g2,input:_2,actions:b2,navigate:x2,onClick:S2}),T2=u2||w2.busy,E2={...v(C2),className:y("core-button",m2),"data-variant":a2,"data-size":o2,"data-tone":s2,"data-full":p2||void 0,"data-busy":T2||void 0},D2=n(e,{children:[T2?t("span",{className:"core-button__spinner","aria-hidden":"true"}):c2,t("span",{className:"core-button__label",children:r2??i2}),l2]});return h2&&!d2?t("a",{...E2,href:h2,onClick:w2.onClick,"aria-busy":T2||void 0,...w2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:D2}):t("button",{...E2,type:f2,disabled:d2||T2,"aria-busy":T2||void 0,onClick:w2.onClick,children:D2})}function bt({children:e2,label:r2,variant:i2="prompt",size:a2="md",selected:o2,onToggle:s2,iconLeft:c2,disabled:l2=false,className:u2,href:d2,action:f2,input:p2,actions:m2,navigate:h2,onClick:g2,..._2}){let b2=o2!==void 0||s2!==void 0,x2=Me({href:d2,action:f2,input:p2,actions:m2,navigate:h2,onClick:g2??(s2?()=>s2(!o2):void 0)});return n("button",{...v(_2),type:"button",className:y("core-chip",u2),"data-variant":i2,"data-size":a2,"aria-pressed":b2?!!o2:void 0,disabled:l2||x2.busy,onClick:x2.onClick,children:[c2,t("span",{className:"core-chip__label",children:e2??r2})]})}function xt({icon:e2,children:n2,label:r2,size:i2="md",variant:a2="ghost",pressed:o2,disabled:s2=false,className:c2,href:l2,action:u2,input:d2,actions:f2,navigate:p2,onClick:m2,...h2}){let g2=Me({href:l2,action:u2,input:d2,actions:f2,navigate:p2,onClick:m2}),_2={...v(h2),className:y("core-icon-button",c2),"data-size":i2,"data-variant":a2,"aria-label":r2,title:r2},b2=t("span",{className:"core-icon-button__glyph","aria-hidden":"true",children:e2??n2});return l2&&!s2?t("a",{..._2,href:l2,onClick:g2.onClick,...g2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:b2}):t("button",{..._2,type:"button","aria-pressed":o2,disabled:s2||g2.busy,onClick:g2.onClick,children:b2})}function St({href:r2,children:i2,label:a2,variant:o2="default",className:s2,navigate:c2,onClick:l2,...u2}){let d2=Me({href:r2,navigate:c2,onClick:l2});return Ae(r2)||je(r2)||/^(https?:|mailto:)/i.test(r2)?n("a",{...v(u2),className:y("core-link",s2),"data-variant":o2,href:r2,onClick:d2.onClick,...d2.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:[i2??a2,d2.external&&n(e,{children:[t("svg",{className:"core-link__away",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false",children:t("path",{d:"M7 17L17 7M8 7h9v9"})}),t("span",{className:"core-link__note",children:" (opens in a new tab)"})]})]}):t("span",{className:y("core-link",s2),children:i2??a2})}function Ct({options:e2,value:n2,defaultValue:r2,onChange:i2,label:a2,fullWidth:o2=false,size:s2="md",className:c2,setValue:l2,...d2}){let[f2,p2]=h(r2??e2[0]?.value),g2=n2??f2,_2=u(),b2=m([]),x2=e3=>{n2===void 0&&p2(e3),i2?.(e3),l2?.(e3)},S2=e2.map((e3,t2)=>e3.disabled?-1:t2).filter(e3=>e3>=0),C2=(t2,n3)=>{let r3=t2.key==="ArrowRight"||t2.key==="ArrowDown"?1:t2.key==="ArrowLeft"||t2.key==="ArrowUp"?-1:0;if(!r3||!S2.length)return;t2.preventDefault();let i3=S2.indexOf(n3),a3=S2[(i3+r3+S2.length)%S2.length];b2.current[a3]?.focus(),x2(e2[a3].value)};return t("div",{...v(d2),role:"radiogroup","aria-label":a2,className:y("core-segmented",c2),"data-full":o2||void 0,"data-size":s2,children:e2.map((e3,n3)=>{let r3=e3.value===g2;return t("button",{ref:e4=>{b2.current[n3]=e4},type:"button",role:"radio",name:_2,"aria-checked":r3,tabIndex:r3||g2===void 0&&n3===S2[0]?0:-1,disabled:e3.disabled,className:"core-segmented__option",onClick:()=>x2(e3.value),onKeyDown:e4=>C2(e4,n3),children:e3.label},e3.value)})})}function wt({items:e2=[],children:r2,numbered:i2=false,single:a2=false,rules:o2="subtle",className:s2,...c2}){let l2=u(),d2=i2?"ol":"ul";return n("div",{...v(c2),className:y("core-accordion",s2),"data-rules":o2,children:[e2.length>0&&t(d2,{className:"core-accordion__list","data-numbered":i2||void 0,children:e2.map((e3,r3)=>t("li",{className:"core-accordion__item",children:n("details",{className:"core-disclosure",name:a2?l2:void 0,open:e3.open||void 0,children:[n("summary",{className:"core-disclosure__summary",children:[i2&&t("span",{className:"core-accordion__number",children:r3+1}),e3.question]}),t("div",{className:"core-disclosure__content",children:e3.answer})]})},e3.id??r3))}),r2]})}function Tt({media:e2,header:r2,body:i2,footer:a2,children:o2,tone:s2="plain",className:c2,...l2}){return n("article",{...v(l2),className:y("core-card",c2),"data-tone":s2,children:[e2!=null&&t("div",{className:"core-card__media",children:e2}),r2!=null&&t("header",{className:"core-card__header",children:r2}),(i2!=null||o2!=null)&&n("div",{className:"core-card__body",children:[i2,o2]}),a2!=null&&t("footer",{className:"core-card__footer",children:a2})]})}var Et={"1:1":"1fr 1fr","2:1":"2fr 1fr","1:2":"1fr 2fr","3:1":"3fr 1fr","1:3":"1fr 3fr"};function Dt({start:e2,end:r2,children:i2,ratio:a2="1:1",gap:o2,stackBelow:s2="compact",className:c2,...l2}){return n("div",{...v(l2),className:y("core-columns",c2),"data-stack":s2,children:[n("div",{className:"core-columns__grid",style:x({"--core-columns-template":Et[a2]??Et["1:1"],"--core-columns-gap":b(o2)}),children:[t("div",{className:"core-columns__start",children:e2}),t("div",{className:"core-columns__end",children:r2})]}),i2]})}var Ot=Dt;function kt({summary:e2,content:r2,children:i2,open:a2=false,onToggle:o2,className:s2,...c2}){return n("details",{...v(c2),className:y("core-disclosure",s2),open:a2||void 0,onToggle:o2?e3=>o2(e3.currentTarget.open):void 0,children:[t("summary",{className:"core-disclosure__summary",children:e2}),n("div",{className:"core-disclosure__content",children:[r2,i2]})]})}function At({items:e2,children:n2,min:i2,columns:a2,gap:o2,className:s2,style:c2,...l2}){let u2=[...r.toArray(e2),...r.toArray(n2)];return t("div",{...v(l2),className:y("core-grid",s2),"data-capped":a2&&a2>0?"":void 0,style:x({"--core-grid-min":b(i2),"--core-grid-gap":b(o2),"--core-grid-cols":a2&&a2>0?String(Math.round(a2)):void 0},c2),children:u2})}function jt({item:e2,each:n2,as:i2,layout:a2="stack",gap:o2,min:s2,empty:c2,className:l2,style:u2,...d2}){let f2=r.toArray(e2);return f2.length?t("div",{...v(d2),className:y("core-repeat",l2),"data-layout":a2,style:x({"--core-repeat-gap":b(o2),"--core-repeat-min":b(s2)},u2),children:f2}):c2?t("p",{className:"core-repeat__empty",children:c2}):null}var Mt=["page-x-of-y","page-number","page-count"],Nt={display:{size:46,lineHeight:.98,weight:500,tracking:"-0.032em"},heading:{size:28,lineHeight:1.05,weight:500,tracking:"-0.03em"},subhead:{size:20,lineHeight:1.15,weight:500,tracking:"-0.02em"},title:{size:17,lineHeight:1.3,weight:500,tracking:"-0.018em"},body:{size:15,lineHeight:1.65,weight:400,tracking:"-0.012em"},bodySmall:{size:13,lineHeight:1.65,weight:400,tracking:"-0.012em"},label:{size:13,lineHeight:1.4,weight:500,tracking:"-0.015em"},note:{size:12,lineHeight:1.7,weight:400,tracking:"-0.012em"},eyebrow:{size:11,lineHeight:1,weight:600,tracking:"0.14em",uppercase:true}},Pt={full:"var(--color-text)",muted:"var(--color-text-muted)",subtle:"var(--color-text-subtle)",border:"var(--color-border)",accent:"var(--color-accent)",accentText:"var(--color-link)",sunken:"var(--color-surface-sunken)"},Ft=["cover","what-this-is","told-us","meaning","next-steps","talk-it-through","notes","footer"],It=[{id:"workbook",label:"Workbook",sheet:{width:"8.5in",height:"11in"},margins:{top:"0.60in",right:"0.70in",bottom:"0.55in",left:"0.95in"},measure:"6.85in",bodyMeasureCh:64,rail:{placement:"strip"},ink:Pt,rules:{head:"2px",structural:"1px",row:"1px",hairline:"1px"},type:Nt,floorPx:11,depth:{max:1,indent:["0"],numbering:"none"},fills:true,regions:{"page-footer":{left:"member-ref",centre:"document-id",right:"page-x-of-y"}},sections:{known:Ft,required:["next-steps","talk-it-through"]}},{id:"report",extends:"workbook",label:"Report",regions:{"page-footer":{right:"page-x-of-y"}},requiredBindings:[],sections:{known:Ft,required:["next-steps","talk-it-through"]}},{id:"instrument",extends:"workbook",label:"Instrument",sheet:{width:"8.5in",height:"11in"},margins:{top:"1.00in",right:"1.00in",bottom:"1.00in",left:"1.25in"},measure:"4.50in",bodyMeasureCh:void 0,rail:{placement:"column",axis:"4.75in",width:"1.50in",gutter:"0.25in"},ink:{full:"#000000",muted:"rgba(0,0,0,0.70)",subtle:"rgba(0,0,0,0.45)",border:"rgba(0,0,0,0.45)",accent:"#000000",accentText:"#000000",sunken:"transparent"},rules:{structural:"0.75pt",hairline:"0.25pt"},type:{...Nt,eyebrow:{...Nt.eyebrow,tracking:"0.08em"}},depth:{max:3,indent:["0","0.375in","0.75in"],numbering:"ladder"},fills:false,regions:{"page-footer":{left:"execution-state",right:"page-x-of-y"}},requiredBindings:["execution-state"],sections:{required:[]}}],Lt=new Map;function Rt(e2){Lt.set(e2.id,e2)}for(let e2 of It)Rt(e2);function zt(){return[...Lt.keys()].sort()}function Bt(e2){let t2=Lt.get(e2);if(!t2)throw Error(`[document-profile] unknown profile "${e2}". Registered: ${zt().join(", ")}`);if(!t2.extends)return t2;let n2=Lt.get(t2.extends);if(!n2)throw Error(`[document-profile] "${e2}" extends unknown profile "${t2.extends}"`);if(n2.extends)throw Error(`[document-profile] "${e2}" extends "${n2.id}", which extends "${n2.extends}": inheritance is one level deep.`);return{...n2,...t2,id:t2.id,extends:t2.extends}}function Vt(){let e2={};for(let t2 of zt())try{e2[t2]=Bt(t2)}catch(e3){console.warn(`[document-profile] skipping "${t2}": ${e3 instanceof Error?e3.message:String(e3)}`)}return e2}var Ht=Object.freeze(Vt()),Ut="workbook";function Wt(e2,t2){try{return Bt(e2)}catch{return W(`unknown-profile:${e2}`,`[document-profile] unknown profile "${e2}" (first seen in ${t2}): rendering with fallback values.`),null}}function Y(e2,t2){return e2===void 0?(W("no-profile",`[document-profile] no profileId supplied (first seen in ${t2}): falling back to "${Ut}". If this document is an instrument, its numbering and depth are being dropped.`),Wt(Ut,t2)):Wt(e2,t2)}var Gt=e2=>e2.replace(/[A-Z]/g,e3=>`-${e3.toLowerCase()}`),Kt=["full","muted","subtle","border","accent","accentText","sunken"],qt=["structural","hairline","head","row"],Jt=["display","heading","subhead","title","body","bodySmall","label","note","eyebrow"],Yt=3,Xt="initial";function Zt(e2){let t2={"--doc-sheet-width":e2.sheet.width,"--doc-sheet-height":e2.sheet.height,"--doc-margin-top":e2.margins.top,"--doc-margin-right":e2.margins.right,"--doc-margin-bottom":e2.margins.bottom,"--doc-margin-left":e2.margins.left,"--doc-measure":e2.measure,"--doc-body-measure":e2.bodyMeasureCh?`${e2.bodyMeasureCh}ch`:"none","--doc-rail-axis":e2.rail.axis??Xt,"--doc-rail-width":e2.rail.width??Xt,"--doc-rail-gutter":e2.rail.gutter??Xt,"--doc-floor":`${e2.floorPx}px`};for(let n2 of Kt)t2[`--doc-ink-${Gt(n2)}`]=e2.ink[n2];for(let n2 of qt)t2[`--doc-rule-${n2}`]=e2.rules[n2]??Xt;for(let n2 of Jt){let r2=e2.type[n2],i2=`--doc-type-${Gt(n2)}`;t2[`${i2}-size`]=`${r2.size}px`,t2[`${i2}-leading`]=String(r2.lineHeight),t2[`${i2}-weight`]=String(r2.weight),t2[`${i2}-tracking`]=r2.tracking,t2[`${i2}-case`]=r2.uppercase?"uppercase":"none"}for(let n2=1;n2<=Yt;n2++)t2[`--doc-indent-${n2}`]=e2.depth.indent[n2-1]??Xt;return t2}var Qt=(e2,t2)=>`${e2} {
2
+ ${Object.entries(t2).map(([e3,t3])=>` ${e3}: ${t3};`).join("\n")}
3
+ }`;function $t(e2,t2){return e2.map(e3=>Qt(e3.id===t2?`:root,
4
+ [data-profile='${e3.id}']`:`[data-profile='${e3.id}']`,Zt(e3))).join("\n\n")}var en=["prose","clause","definitions","table","notice","figure","execution"],tn=/\{\{ref:([^}|]+?)(?:\|(title|full|number))?\}\}/g,nn="[a-z0-9][a-z0-9_-]*",rn=RegExp(`^(?:(${nn}):)?(${nn}(?:\\.${nn})*)(?:#(${nn}))?$`);RegExp(`^${nn}$`);function an(e2,t2){let n2=e2.trim(),r2=rn.exec(n2);return r2?{key:n2,...r2[1]?{doc:r2[1]}:{},unit:r2[2],...r2[3]?{element:r2[3]}:{},...t2?{form:t2}:{}}:null}function on(e2){let t2=e2.lastIndexOf(".");return t2<0?e2:e2.slice(t2+1)}function sn(e2){let t2=[],n2=0;for(let r2 of e2.matchAll(new RegExp(tn.source,"g"))){let i2=an(r2[1],r2[2]);i2&&(r2.index>n2&&t2.push({kind:"text",text:e2.slice(n2,r2.index)}),t2.push({kind:"ref",...i2}),n2=r2.index+r2[0].length)}return n2<e2.length&&t2.push({kind:"text",text:e2.slice(n2)}),t2}function cn(e2){return e2.includes("{{ref:")}var X=e2=>e2?{"data-profile":e2}:{},ln=e2=>e2?.fills===false?{"data-fills":"none"}:{},un={note:"ⓘ",tip:"💡",warning:"⚠️",important:"❗"};function dn({children:e2,tone:r2="note",title:i2,profileId:a2,profile:o2,className:s2,style:c2}){let l2=o2??Y(a2,"Aside"),u2=l2?.fills===false;return n("aside",{className:y("core-aside",s2),"data-tone":r2,...X(o2?.id??a2),...ln(l2),style:c2,children:[u2?null:t("span",{className:"core-aside__icon","aria-hidden":true,children:un[r2]}),n("div",{className:"core-aside__body",children:[i2&&t("div",{className:"core-aside__title",children:i2}),t("div",{className:"core-aside__text",children:e2})]})]})}function fn({children:e2,profileId:n2,profile:r2,full:i2=false,className:a2,style:o2}){return r2||Y(n2,"Prose"),t("div",{className:y("core-prose",a2),"data-full":i2?"":void 0,...X(r2?.id??n2),style:o2,children:e2})}function pn({children:e2,citation:r2,className:i2,style:a2}){return n("figure",{className:y("core-quote",i2),style:a2,children:[t("blockquote",{className:"core-quote__body",children:e2}),r2&&n("figcaption",{className:"core-quote__citation",children:["— ",r2]})]})}function mn({term:e2,description:r2,pairs:i2,profileId:a2,profile:o2,className:s2,style:c2}){o2||Y(a2,"Definition");let l2=i2??(e2===void 0?[]:[{term:e2,description:r2}]);return t("dl",{className:y("core-definition",s2),...X(o2?.id??a2),style:c2,children:l2.map((e3,r3)=>n("div",{className:"core-definition__item",children:[t("dt",{className:"core-definition__term",children:e3.term}),t("dd",{className:"core-definition__description",children:e3.description})]},r3))})}var hn="katex";function gn(e2){if(typeof document>"u")return false;for(let t2 of document.querySelectorAll('script[type="importmap"]'))try{if(JSON.parse(t2.textContent??"").imports?.[e2])return true}catch{}return false}var _n=e2=>import(e2),vn;function yn(){return vn??=gn(hn)?_n(hn).then(e2=>{let t2=e2,n2=t2.default??t2;return typeof n2.render=="function"?n2:null},()=>null):Promise.resolve(null),vn}function bn({children:e2="",mode:n2="inline",className:r2}){let i2=m(null),[a2,o2]=h(null),[s2,c2]=h(null),u2=`${n2}:${e2}`;return l(()=>{let e3=true;return yn().then(t2=>{e3&&t2&&o2(()=>t2)}),()=>{e3=false}},[]),l(()=>{if(a2&&i2.current&&s2!==u2)try{a2.render(e2,i2.current,{displayMode:n2==="block",throwOnError:false})}catch{c2(u2)}},[a2,e2,n2,u2,s2]),!a2||s2===u2?t("span",{className:y("core-math",r2),"data-mode":n2,"data-fallback":"",title:"KaTeX not available — showing TeX source",children:e2}):t("span",{ref:i2,className:y("core-math",r2),"data-mode":n2})}function xn(e2,t2){switch(t2.type){case"register":return e2.footnotes.some(e3=>e3.id===t2.entry.id)?e2:{footnotes:[...e2.footnotes,t2.entry]};case"unregister":return{footnotes:e2.footnotes.filter(e3=>e3.id!==t2.id)};default:return e2}}var Sn=a(null);function Cn(){return c(Sn)}function wn({children:e2}){let[n2,r2]=p(xn,{footnotes:[]}),i2=m(0),a2=s(e3=>{i2.current+=1;let t2=i2.current;return r2({type:"register",entry:{...e3,number:t2}}),t2},[]),o2=s(e3=>r2({type:"unregister",id:e3}),[]),c2=f(()=>({state:n2,registerFootnote:a2,unregisterFootnote:o2}),[n2,a2,o2]);return t(Sn.Provider,{value:c2,children:e2})}function Tn({children:e2}){let r2=u(),i2=Cn(),[a2,o2]=h(null);return l(()=>{if(!i2)return;let t2=i2.registerFootnote({id:r2,content:e2});return o2(t2),()=>i2.unregisterFootnote(r2)},[r2]),i2?a2===null?null:t("sup",{id:`core-footnote-ref-${a2}`,className:"core-footnote",children:n("a",{href:`#core-footnote-${a2}`,className:"core-footnote__link",children:["[",a2,"]"]})}):n("span",{className:"core-footnote","data-fallback":"",children:[" ","(",e2,")"]})}function En({children:e2,caption:r2,profileId:i2,profile:a2,className:o2,style:s2}){return a2||Y(i2,"Figure"),n("figure",{className:y("core-figure",o2),...X(a2?.id??i2),style:s2,children:[t("div",{className:"core-figure__body",children:e2}),r2&&t("figcaption",{className:"core-figure__caption",children:r2})]})}function Dn({className:e2}){return t("div",{className:y("core-page-break",e2),"aria-hidden":true})}function On({children:e2,as:n2="div",profileId:r2,profile:i2,tone:a2="subtle",className:o2,style:s2}){return i2||Y(r2,"DocumentLabel"),t(n2,{className:y("core-document-label",o2),"data-tone":a2,...X(i2?.id??r2),style:s2,children:e2})}var kn=["one","two","three","four","five","six","seven","eight","nine","ten"];function An(e2){if(e2.length!==1)return null;let t2=e2[0],n2=kn[t2-1];return n2?`Article ${n2}`:`Article ${t2}`}function jn(e2){return e2.length===0?null:e2.length===1?`Article ${e2[0]}`:e2.join(".")}function Mn(e2,t2,n2){let r2=n2==="ladder"&&e2!==void 0&&e2.length>0,i2=[];return t2.map(({level:t3,marker:n3})=>{let a2=Math.min(Number.isInteger(t3)&&t3>=1?t3:1,i2.length+1);return i2.length=a2,i2[a2-1]=(i2[a2-1]??0)+1,n3===void 0?r2?[...e2,...i2].join("."):void 0:n3})}function Nn(e2,t2){return e2?.[t2]??t2}function Pn({target:e2,form:n2,sectionReferences:r2,sectionNumbers:i2,sectionTitles:a2,sectionAnchors:o2,profileId:s2,profile:c2,className:l2,style:u2}){let d2=c2??Y(s2,"Reference"),f2=an(e2),p2=r2?.[e2],m2=p2?.openable===false,h2=f2!==null&&f2.doc===void 0,g2=f2?on(f2.unit):e2,_2=p2?.number??(h2&&f2.element===void 0?i2?.[g2]:void 0),v2=p2?.title??(h2&&f2.element===void 0?a2?.[g2]:void 0),b2=null;if(f2?.element!==void 0){let e3=p2?.element;b2=e3?Mn(p2.number,e3.shape,d2?.depth.numbering)[e3.index]??null:null}else _2&&(b2=jn(_2));let x2=n2==="full"||f2?.doc!==void 0&&n2!=="title",S2;S2=m2?null:n2==="title"?v2??b2:x2&&b2&&v2&&f2?.element===void 0?`${b2} (${v2})`:b2??v2??null;let C2=S2!==null,w2=C2?p2?p2.href:`#${Nn(o2,g2)}`:void 0,T2={className:y("core-reference",l2),"data-target":e2,"data-unresolved":C2||m2?void 0:"","data-closed":m2?"":void 0,...X(c2?.id??s2),style:u2};return w2?t("a",{href:w2,...T2,children:S2}):t("span",{...T2,children:S2??e2})}function Fn({columns:e2,rows:r2,caption:i2,profileId:a2,profile:o2,className:s2,style:c2}){return o2||Y(a2,"DocumentTable"),e2.length===0?null:n("div",{className:y("core-document-table",s2),...X(o2?.id??a2),style:c2,children:[i2===void 0?null:t("div",{className:"core-document-table__caption",children:i2}),n("table",{className:"core-document-table__table",children:[t("thead",{children:t("tr",{children:e2.map((e3,n2)=>t("th",{scope:"col",className:"core-document-table__head","data-align":e3.align??"left",children:e3.header},n2))})}),t("tbody",{children:r2.map((n2,r3)=>t("tr",{children:e2.map((e3,r4)=>t("td",{className:"core-document-table__cell","data-align":e3.align??"left",children:n2[r4]??null},r4))},r3))})]})]})}var In={locale:"en-CA",currency:"CAD"},Ln=e2=>{if(typeof e2!="string"||!e2)return false;try{return Intl.NumberFormat.supportedLocalesOf(e2).length>0}catch{return false}},Rn=e2=>{if(typeof e2!="string"||!/^[A-Za-z]{3}$/.test(e2))return false;try{return new Intl.NumberFormat("en-CA",{style:"currency",currency:e2}),true}catch{return false}};function zn(e2){let t2=typeof e2=="object"&&e2?e2:{};return{locale:Ln(t2.locale)?t2.locale:In.locale,currency:Rn(t2.currency)?t2.currency.toUpperCase():In.currency}}var Bn=new Map;function Vn(e2){let t2=`${e2.locale}|${e2.currency}`,n2=Bn.get(t2);if(!n2){let r2=new Intl.NumberFormat(e2.locale,{style:"currency",currency:e2.currency,maximumFractionDigits:0}).formatToParts(1),i2=r2.findIndex(e3=>e3.type==="integer"),a2=r2.length-1-[...r2].reverse().findIndex(e3=>e3.type==="integer");n2={prefix:r2.slice(0,i2).filter(e3=>e3.type!=="minusSign"&&e3.type!=="plusSign").map(e3=>e3.value).join(""),suffix:r2.slice(a2+1).map(e3=>e3.value).join("")},Bn.set(t2,n2)}return n2}function Z(e2,t2){if(e2==null)return"";if(typeof e2=="string")return e2;let n2=e2.precision??(e2.format==="number"?Hn(e2.value):void 0),r2=Un(e2.format,e2.value,{precision:n2,signed:e2.signed,locale:t2});return e2.unit&&r2!=="—"?`${r2} ${e2.unit}`:r2}function Hn(e2){if(typeof e2!="number"||!Number.isFinite(e2))return 0;let t2=String(Number(e2.toFixed(3))),n2=t2.indexOf(".");return n2===-1||t2.includes("e")?0:t2.length-n2-1}function Un(e2,t2,n2={}){if(!Number.isFinite(t2))return"—";let r2=n2.signed===true,i2=t2<0,a2=Math.abs(t2),o2=i2?"-":r2?"+":"",s2=n2.locale??In,c2=(e3,t3)=>e3.toLocaleString(s2.locale,{minimumFractionDigits:t3,maximumFractionDigits:t3}),l2=(e3,t3="")=>{let{prefix:n3,suffix:r3}=Vn(s2);return`${o2}${n3}${e3}${t3}${r3}`};switch(e2){case"currency":return l2(c2(a2,n2.precision??0));case"currency-k":{let e3=n2.precision??0;return a2>=1e3?l2((a2/1e3).toFixed(e3),"k"):l2(a2.toFixed(0))}case"currency-m":{let e3=n2.precision??1;return a2>=1e6?l2((a2/1e6).toFixed(e3),"M"):a2>=1e3?l2((a2/1e3).toFixed(0),"k"):l2(a2.toFixed(0))}case"currency-compact":return a2>=1e9?l2((a2/1e9).toFixed(n2.precision??1),"B"):a2>=1e6?l2((a2/1e6).toFixed(n2.precision??1),"M"):a2>=1e3?l2((a2/1e3).toFixed(n2.precision??1),"k"):l2(a2.toFixed(n2.precision??0));case"currency-monthly":return`${l2(c2(a2,n2.precision??0))}/mo`;case"percent":{let e3=n2.precision??1;return`${o2}${a2.toFixed(e3)}%`}case"fraction-percent":return`${o2}${new Intl.NumberFormat(s2.locale,{style:"percent",minimumFractionDigits:n2.precision??0,maximumFractionDigits:n2.precision??1}).format(a2)}`;case"age":return`Age ${Math.round(t2)}`;case"years":{let e3=n2.precision??0;return`${o2}${a2.toFixed(e3)} yrs`}case"year":return String(Math.round(t2));case"number":return`${o2}${c2(a2,n2.precision??0)}`;default:{let e3=n2.precision??0;return l2((a2/1e3).toFixed(e3),"k")}}}var Wn=e2=>!!(e2&&typeof e2=="object"&&"value"in e2&&"format"in e2);function Gn({items:e2,profileId:r2,profile:i2,markerWidth:a2=44,secondaryWidth:o2=190,missingLabel:s2="Not answered yet",baseProps:c2,className:l2,style:u2}){if(i2||Y(r2,"RowList"),!Array.isArray(e2)||e2.length===0)return null;let d2=zn(c2),f2=e3=>Wn(e3)?Z(e3,d2):e3;return t("div",{className:y("core-row-list",l2),...X(i2?.id??r2),style:x({"--core-row-list-marker-width":b(a2),"--core-row-list-secondary-width":b(o2)},u2),children:e2.map((e3,r3)=>n("div",{className:"core-row-list__row",children:[e3.marker!==void 0&&t("div",{className:"core-row-list__marker",children:f2(e3.marker)}),t("div",{className:"core-row-list__primary",children:e3.primary}),(e3.secondary!==void 0||e3.missing)&&t("div",{className:"core-row-list__secondary","data-missing":e3.missing?"":void 0,children:e3.missing?s2:f2(e3.secondary)})]},r3))})}var Kn=190;function qn({items:e2,profileId:n2,profile:r2,missingLabel:i2="Not answered yet",answerWidth:a2=190,className:o2,style:s2}){let c2=e2.map(e3=>{let t2=typeof e3.answer=="string"&&e3.answer.trim().length>0;return{marker:e3.reference,primary:e3.question,secondary:t2?e3.answer:void 0,missing:!t2}});return t("div",{className:y("core-answer-rows",o2),...X(r2?.id??n2),style:s2,children:t(Gn,{items:c2,profileId:n2,profile:r2,secondaryWidth:a2,missingLabel:i2})})}var Jn=40;function Yn({bars:e2,target:r2,targetLabel:i2,max:a2,profileId:o2,profile:s2,baseProps:c2,className:l2,style:u2}){let d2=zn(c2),f2=s2??Y(o2,"ComparisonBars");if(e2.length===0)return null;let p2=e2.map(e3=>e3.value),m2=a2??Math.max(...p2,r2??0);if(!Number.isFinite(m2)||m2<=0)return W("ComparisonBars:no-scale","[ComparisonBars] every value is zero or negative, so there is no scale to draw against. Rendering nothing rather than a full-width or zero-width bar, either of which reads as a chart and is not one."),null;let h2=r2!==void 0&&r2>0&&r2<=m2?r2/m2*100:void 0;return n("figure",{className:y("core-comparison-bars",l2),...X(s2?.id??o2),...ln(f2),style:u2,children:[e2.map(e3=>{let r3=Math.max(0,Math.min(100,e3.value/m2*100));return n("div",{className:"core-comparison-bars__bar",style:x({"--core-comparison-bars-value":`${r3}%`}),children:[t("div",{className:"core-comparison-bars__label",children:e3.label}),n("div",{className:"core-comparison-bars__track",style:x({"--core-comparison-bars-target":h2===void 0?void 0:`${h2}%`}),children:[t("div",{className:"core-comparison-bars__fill"}),t("span",{className:"core-comparison-bars__value","data-placement":r3>Jn?"inside":"outside",children:Z(e3.display,d2)}),h2!==void 0&&t("div",{className:"core-comparison-bars__target","aria-hidden":"true"})]})]},e3.label)}),r2!==void 0&&i2&&t("figcaption",{className:"core-comparison-bars__target-label",children:i2})]})}var Xn=3,Zn=5;function Qn({items:e2,profileId:r2,profile:i2,checkboxes:a2=true,className:o2,style:s2}){return i2||Y(r2,"NextSteps"),e2.length===0?null:((e2.length<Xn||e2.length>Zn)&&W(`NextSteps:count:${e2.length}`,`[NextSteps] ${e2.length} step(s). A next-steps list takes three to five: fewer reads as an afterthought, more stops being a list a reader acts on this week. Rendering anyway — a document with six steps is far better than one with none.`),t("ol",{className:y("core-next-steps",o2),...X(i2?.id??r2),style:s2,children:e2.map((e3,r3)=>n("li",{className:"core-next-steps__step",children:[t("span",{className:"core-next-steps__marker",children:e3.marker??String(r3+1).padStart(2,"0")}),a2&&t("span",{className:"core-next-steps__box","aria-hidden":"true"}),t("span",{className:"core-next-steps__body",children:e3.body})]},r3))}))}var $n=38;function er({title:e2="Notes",lines:r2=4,profileId:i2,profile:a2,className:o2,style:s2}){return a2||Y(i2,"Notes"),r2<1?null:n("section",{className:y("core-notes",o2),...X(a2?.id??i2),style:s2,children:[t("div",{className:"core-notes__title",children:e2}),t("div",{className:"core-notes__lines","aria-hidden":"true",children:Array.from({length:r2},(e3,n2)=>t("div",{className:"core-notes__line"},n2))})]})}var tr="You left this section open, so it is not covered here.";function nr({wouldTell:e2,openingLine:r2=tr,profileId:i2,profile:a2,className:o2,style:s2}){return a2||Y(i2,"SkippedSection"),n("div",{className:y("core-skipped-section",o2),...X(a2?.id??i2),style:s2,children:[t("span",{className:"core-skipped-section__standard",children:r2})," ",t("span",{className:"core-skipped-section__would-tell",children:e2})]})}var rr="Nothing here is settled. If a number looks wrong, or a step does not fit your situation, say so and we will work through it together.";function ir({advisor:e2,title:r2="Talk it through",invitation:i2=rr,profileId:a2,profile:o2,className:s2,style:c2}){if(o2||Y(a2,"TalkItThrough"),!e2?.name?.trim())return W("TalkItThrough:no-advisor","[TalkItThrough] no advisor name — rendering NOTHING rather than an empty box. This section is mandatory in an approved output because it is the door to a human; a door with nobody behind it passes a structural check and fails the reader."),null;let l2=[e2.phone,e2.email].filter(e3=>typeof e3=="string"&&e3.trim().length>0);return l2.length===0&&W("TalkItThrough:no-contact",`[TalkItThrough] "${e2.name}" has no phone and no email. The section is the advisor's name, HOW TO REACH THEM, and an open invitation — a name alone is not a route. Rendering, because a named advisor is still better than a dropped section.`),n("section",{className:y("core-talk-it-through",s2),...X(o2?.id??a2),style:c2,children:[t("h3",{className:"core-talk-it-through__title",children:r2}),t("p",{className:"core-talk-it-through__invitation",children:i2}),n("div",{className:"core-talk-it-through__advisor",children:[t("div",{className:"core-talk-it-through__name",children:e2.name}),e2.role&&t("div",{className:"core-talk-it-through__role",children:e2.role}),l2.length>0&&t("div",{className:"core-talk-it-through__contact",children:l2.map(e3=>t("span",{children:e3},e3))})]})]})}var ar=38;function or({question:e2,answer:r2,lines:i2=1,profileId:a2,profile:o2,className:s2,style:c2}){o2||Y(a2,"WriteInField");let l2=typeof r2=="string"&&r2.trim().length>0,u2=Math.max(1,i2);return n("div",{className:y("core-write-in-field",s2),"data-answered":l2?"":void 0,...X(o2?.id??a2),style:c2,children:[e2&&t("div",{className:"core-write-in-field__question",children:e2}),l2?t("div",{className:"core-write-in-field__answer",children:r2}):Array.from({length:u2},(e3,n2)=>t("div",{className:"core-write-in-field__line","aria-hidden":"true"},n2))]})}function sr({mark:e2,identity:r2,codes:i2,profileId:a2,profile:o2,className:s2,style:c2}){return o2||Y(a2,"Masthead"),e2===void 0&&r2===void 0&&i2===void 0?null:n("header",{className:y("core-masthead",s2),"data-page-region":"page-header",...X(o2?.id??a2),style:c2,children:[e2!==void 0&&t("div",{className:"core-masthead__mark","data-slot":"mark",children:e2}),r2!==void 0&&t("div",{className:"core-masthead__identity","data-slot":"identity",children:r2}),i2!==void 0&&t("div",{className:"core-masthead__codes","data-slot":"codes",children:i2})]})}var cr=4;function lr({fields:e2,profileId:r2,profile:i2,className:a2,style:o2}){let s2=(i2??Y(r2,"MetaRail"))?.rail.placement??"strip";return s2==="none"||e2.length===0?null:(s2!=="column"&&e2.length>cr&&typeof console<"u"&&console.warn(`[MetaRail] ${e2.length} fields in a strip; the spec allows ${cr}. Rendering all of them — check the layout.`),t("div",{className:y("core-meta-rail",a2),"data-placement":s2,...X(i2?.id??r2),style:o2,children:e2.map(e3=>n("div",{className:"core-meta-rail__field",children:[t("div",{className:"core-meta-rail__label",children:e3.label}),t("div",{className:"core-meta-rail__value",children:e3.value})]},`${e3.label}:${e3.value}`))}))}var ur={left:"bottom-left",centre:"bottom-center",right:"bottom-right"};function dr({left:e2,centre:n2,right:r2,profileId:i2,profile:a2,className:o2,style:s2}){a2||Y(i2,"RunningFooter");let c2=[["left",e2],["centre",n2],["right",r2]].filter(([,e3])=>e3!=null);return c2.length===0?null:t("footer",{className:y("core-running-footer",o2),"data-page-region":"page-footer",...X(a2?.id??i2),style:s2,children:c2.map(([e3,n3])=>t("span",{className:"core-running-footer__slot","data-region-slot":e3,"data-margin-box":ur[e3],children:n3},e3))})}function fr({children:r2,rail:i2,profileId:a2,profile:o2,className:s2,style:c2}){let l2=o2??Y(a2,"DocumentShell"),u2=l2?.rail.placement==="column"&&i2!==void 0;return t(wn,{children:n("div",{className:y("core-document-shell",s2),...X(l2?.id??a2),"data-has-rail":u2?"":void 0,style:c2,children:[t("div",{className:"core-document-shell__body",children:r2}),u2&&n(e,{children:[t("div",{className:"core-document-shell__gutter","aria-hidden":true}),t("aside",{className:"core-document-shell__rail",children:i2})]})]})})}function pr(e2,t2){return!e2||e2.length===0?null:t2===0?String(e2[0]).padStart(2,"0"):e2.join(".")}function mr({entries:e2,depth:r2,title:i2,profileId:a2,profile:o2,className:s2,style:c2}){let l2=o2??Y(a2,"Contents"),u2=l2?.depth.max??Infinity,d2=e2??[],f2=r2===void 0?d2:d2.filter(e3=>e3.level<r2);if(f2.length===0)return null;let p2=l2?.depth.numbering??"none",m2=f2.some(e3=>e3.page!==void 0);return n("nav",{"aria-label":"Table of contents",className:y("core-contents",s2),...X(o2?.id??a2),style:c2,children:[i2&&t("div",{className:"core-contents__title",children:i2}),t("ol",{className:"core-contents__list",children:f2.map(e3=>{let r3=p2==="none"?null:pr(e3.ordinal,e3.level);return n("li",{className:"core-contents__entry","data-level":e3.level,"data-overdeep":e3.level>=u2?"":void 0,style:x({"--core-contents-level":String(e3.level)}),children:[r3&&t("span",{className:"core-contents__ordinal",children:r3}),t("a",{href:`#${e3.id}`,className:"core-contents__link",children:e3.title}),m2&&t("span",{className:"core-contents__page",children:e3.page??""})]},e3.id)})})]})}function hr({s:e2,dated:r2}){return n("div",{className:"core-execution-block__signature",children:[n("div",{className:"core-execution-block__lines",children:[t("div",{className:"core-execution-block__line","data-line":"sign"}),r2?t("div",{className:"core-execution-block__line","data-line":"date"}):null]}),n("div",{className:"core-execution-block__captions",children:[n("div",{className:"core-execution-block__party",children:[e2.role?t("div",{className:"core-execution-block__role",children:e2.role}):null,e2.name?t("div",{className:"core-execution-block__name",children:e2.name}):null,e2.detail?t("div",{className:"core-execution-block__detail",children:e2.detail}):null]}),r2?t("div",{className:"core-execution-block__date-label",children:"Date"}):null]})]})}function gr({attestation:e2,label:r2,signatories:i2,columns:a2=1,note:o2,profileId:s2,profile:c2,className:l2,style:u2}){c2||Y(s2,"ExecutionBlock");let d2=Array.isArray(i2)?i2:[];return n("section",{className:y("core-execution-block",l2),...X(c2?.id??s2),style:u2,children:[r2?t("div",{className:"core-execution-block__label",children:r2}):null,e2?t("div",{className:"core-execution-block__attestation",children:e2}):null,t("div",{className:"core-execution-block__signatories","data-columns":a2,children:d2.map((e3,n2)=>t(hr,{s:e3,dated:e3.dated===true},n2))}),o2?t("div",{className:"core-execution-block__note",children:o2}):null]})}function _r({kind:e2}){return n("div",{className:"core-document-blocks__unrenderable","data-unrenderable-block":e2,role:"alert",children:[t("strong",{children:"This provision could not be rendered."})," The document contains a block of type “",e2,"”, which this bundle has no renderer for. Nothing has been omitted silently — the content is present in the source document and is missing only from this page. Do not sign or rely on this document until it renders in full."]})}function vr({blocks:e2,profileId:n2,sectionNumbers:r2,sectionAnchors:i2,sectionTitles:a2,sectionReferences:o2,sectionOrdinal:s2,className:c2,style:l2}){let u2=Y(n2,"DocumentBlocks");if(e2.length===0)return null;let d2=Mn(s2,e2.flatMap(e3=>e3.kind==="clause"?e3.items:[]),u2?.depth.numbering),f2=0,p2=(e3,s3)=>cn(e3)?sn(e3).map((e4,c3)=>e4.kind==="text"?e4.text:t(Pn,{target:e4.key,form:e4.form,sectionReferences:o2,sectionNumbers:r2,sectionTitles:a2,sectionAnchors:i2,profileId:n2},`${s3}-ref-${c3}`)):e3,m2=e2.some(e3=>e3.kind==="execution");return t("div",{className:y("core-document-blocks",c2),"data-pinned":m2?"execution":void 0,...X(n2),style:l2,children:e2.map((e3,r3)=>{let i3=`${e3.kind}-${r3}`;switch(e3.kind){case"prose":return t(fn,{profileId:n2,full:e3.full,children:p2(e3.text,i3)},i3);case"clause":return t(Gn,{profileId:n2,items:e3.items.map((e4,t2)=>({marker:d2[f2++],primary:p2(e4.text,`${i3}-${t2}`),secondary:e4.note?p2(e4.note,`${i3}-${t2}-n`):void 0,missing:e4.missing}))},i3);case"definitions":return t(mn,{profileId:n2,pairs:e3.pairs.map((e4,t2)=>({term:e4.term,description:p2(e4.description,`${i3}-${t2}`)}))},i3);case"table":return t(Fn,{profileId:n2,caption:e3.caption?p2(e3.caption,`${i3}-cap`):void 0,columns:e3.columns,rows:e3.rows.map((e4,t2)=>e4.map((e5,n3)=>p2(e5,`${i3}-${t2}-${n3}`)))},i3);case"notice":return t(dn,{profileId:n2,tone:e3.tone,title:e3.title,children:p2(e3.text,i3)},i3);case"figure":return t(En,{profileId:n2,caption:p2(e3.caption,i3),children:e3.placeholder??null},i3);case"execution":return t(gr,{profileId:n2,label:e3.label,attestation:e3.attestation,signatories:e3.signatories,columns:e3.columns,note:e3.note},i3);default:return t(_r,{kind:String(e3.kind)},i3)}})})}var yr=["h2","h3","h4","h5","h6"];function br({sectionId:e2,title:r2,level:i2=0,ordinal:a2,sectionNumbers:o2,sectionAnchors:s2,sectionTitles:c2,sectionReferences:l2,sectionLevels:u2,continued:d2=false,continuedCount:f2,children:p2,blocks:m2,profileId:h2,profile:g2,className:_2,style:v2}){let b2=g2??Y(h2,"DocumentSection"),S2=o2?.[e2],C2=u2?.[e2],w2=S2??a2,T2=C2===void 0?i2:Math.max(0,C2-1),E2=T2>=(b2?.depth.max??Infinity),D2=Math.min(T2,(b2?.depth.indent.length??1)-1)+1,O2=b2?.depth.numbering==="ladder"&&w2!==void 0&&w2.length>0,k2=O2?An(w2):null,A2=yr[Math.min(T2,yr.length-1)],j2=Nn(s2,e2),M2=`${j2}-doc-heading`;return n("section",{id:j2,className:y("core-document-section",_2),"data-level":T2,"data-ordinal-source":w2?S2?"derived":"baked":void 0,"data-overdeep":E2?"":void 0,"aria-labelledby":M2,...X(g2?.id??h2),style:x({"--core-document-section-indent":`var(--doc-indent-${D2}, 0)`},v2),children:[k2&&t("div",{className:"core-document-section__article",children:k2}),n(A2,{id:M2,className:"core-document-section__heading",children:[O2&&!k2&&t("span",{className:"core-document-section__ordinal",children:w2.join(".")}),r2,d2&&t("span",{className:"core-document-section__continued",children:"continued"})]}),d2&&f2&&t("div",{className:"core-document-section__count",children:`Items ${f2.from} to ${f2.to} of ${f2.of}`}),t("div",{className:"core-document-section__body",children:p2??(m2?t(vr,{blocks:m2,profileId:h2,sectionNumbers:o2,sectionAnchors:s2,sectionTitles:c2,sectionReferences:l2,sectionOrdinal:O2?w2:void 0}):null)})]})}var xr={prose:{type:"object",required:["kind","text"],additionalProperties:false,properties:{kind:{const:"prose"},text:{type:"string",description:"ONE paragraph. Two paragraphs in one value run together on the page: emit a second prose block instead."},full:{type:"boolean",description:"Fill the measure rather than the reading-width cap. For a caption or text beside a table."}}},clause:{type:"object",required:["kind","items"],additionalProperties:false,properties:{kind:{const:"clause"},items:{type:"array",minItems:1,items:{type:"object",required:["text"],additionalProperties:false,properties:{marker:{type:"string",description:'An explicit number that overrides the derived one, only for numbering fixed by statute or a standard form. Omit it and the renderer numbers the clause from its article ("6.3").'},level:{type:"integer",minimum:1,description:"Depth within the section: 1 a clause, 2 a sub-clause, 3 a sub-sub-clause. Default 1."},id:{type:"string",pattern:"^[a-z0-9][a-z0-9_-]*$",description:"A slug, unique in the document, written only when prose cites this clause as {{ref:<section>#<id>}}. Keep it stable across edits."},text:{type:"string"},note:{type:"string",description:"A parenthetical, cross-reference or jurisdictional note set beside the text."},missing:{type:"boolean",description:"The value is not yet known. Use this instead of writing a [REQUIRED: ...] marker into the text."}}}}}},definitions:{type:"object",required:["kind","pairs"],additionalProperties:false,properties:{kind:{const:"definitions"},pairs:{type:"array",minItems:1,items:{type:"object",required:["term","description"],additionalProperties:false,properties:{term:{type:"string"},description:{type:"string"}}}}}},table:{type:"object",required:["kind","columns","rows"],additionalProperties:false,properties:{kind:{const:"table"},caption:{type:"string"},columns:{type:"array",minItems:1,items:{type:"object",required:["header"],additionalProperties:false,properties:{header:{type:"string"},align:{enum:["left","right","center"],description:"Right-align money and any other figure column."}}}},rows:{type:"array",items:{type:"array",items:{type:"string"}},description:"One array per row, each EXACTLY as long as columns. A short row is refused: a table that loses its last column loses data."}}},notice:{type:"object",required:["kind","tone","text"],additionalProperties:false,properties:{kind:{const:"notice"},tone:{enum:["note","warning","important"]},title:{type:"string"},text:{type:"string"}}},figure:{type:"object",required:["kind","caption"],additionalProperties:false,properties:{kind:{const:"figure"},caption:{type:"string",description:"Required. An uncaptioned exhibit cannot be cited from the text that relies on it."},src:{type:"string",description:"Reference the host resolves. Never a data URI."},placeholder:{type:"string",description:"Text stand-in when src is absent, so a figure never renders empty."}}},execution:{type:"object",required:["kind","signatories"],additionalProperties:false,properties:{kind:{const:"execution"},label:{type:"string"},attestation:{type:"string",description:"The attestation clause, as running text."},signatories:{type:"array",minItems:1,items:{type:"object",required:["role"],additionalProperties:false,properties:{role:{type:"string",description:'Capacity: "Testator", "Witness", "Grantor".'},name:{type:"string",description:"Printed BELOW the signing rule, never on it."},detail:{type:"string"},dated:{type:"boolean",description:"Add a second, shorter rule for the date."}}}},columns:{enum:[1,2]},note:{type:"string"}}}},Sr=["md","lg","xl"],Cr=5;function wr(e2){let t2=Sr.indexOf(e2);return t2>0?Sr[t2-1]:e2}var Tr=e2=>typeof e2=="object"&&!!e2&&"format"in e2&&"value"in e2;function Er(e2){let t2=Number(e2);return Number.isFinite(t2)?Math.max(0,Math.min(100,t2)):0}function Dr({value:e2,label:r2,size:i2="lg",tone:a2,progress:o2,progressLabel:s2,autoStepDown:c2=true,baseProps:l2,className:u2,style:d2}){let f2=Tr(e2)?Z(e2,zn(l2)):e2,p2=typeof f2=="string"||typeof f2=="number"?String(f2).length:0,m2=c2&&p2>Cr?wr(i2):i2,h2=Re(a2,"strong"),{toned:g2,..._2}=ze(h2),v2=o2==null?null:Er(o2);return n("div",{className:y("core-stat",g2&&"core-toned",u2),..._2,"data-size":m2,style:d2,children:[t("div",{className:"core-stat__value",children:f2}),r2!=null&&t(Be,{className:"core-stat__label",tone:h2==="on-dark"||h2==="inherit"?h2:"subtle",children:r2}),v2!==null&&t("div",{className:"core-stat__progress",role:"progressbar","aria-label":s2??(typeof r2=="string"?r2:"Progress"),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":v2,style:x({"--core-stat-progress":`${v2}%`}),children:t("div",{className:"core-stat__progress-fill"})})]})}function Or({children:e2,minColumnWidth:n2=200,maxColumns:r2=4,gap:i2=32,className:a2,style:o2}){return t("div",{className:y("core-stat-group",a2),style:x({"--core-stat-group-min":`${n2}px`,"--core-stat-group-max":String(Math.max(1,r2)),"--core-stat-group-gap":`${i2}px`},o2),children:e2})}var kr={up:[0,28],left:[-40,0],right:[40,0],none:[0,0]};function Ar({direction:e2="up",delay:n2=0,duration:r2=.5,threshold:i2=.15,once:a2=true,className:o2,style:s2,children:c2}){let u2=m(null),[d2,f2]=h(false);l(()=>{let e3=u2.current;if(!e3)return;if(typeof IntersectionObserver>"u"){f2(true);return}let t2=new IntersectionObserver(e4=>{let n3=e4[e4.length-1];n3&&(n3.isIntersecting?(f2(true),a2&&t2.disconnect()):a2||f2(false))},{threshold:Math.min(1,Math.max(0,i2))});return t2.observe(e3),()=>t2.disconnect()},[a2,i2]);let[p2,g2]=kr[e2];return t("div",{ref:u2,className:y("core-reveal",o2),"data-revealed":d2?"true":"false",style:x({"--core-reveal-x":`${p2}px`,"--core-reveal-y":`${g2}px`,"--core-reveal-duration":`${r2}s`,"--core-reveal-delay":`${n2}s`},s2),children:c2})}function jr({eyebrow:e2,title:r2,description:i2,trailing:a2,level:o2=2,revealDelay:s2=0,className:c2,style:l2}){let u2=o2===3,d2=u2?"h3":"h2";return t(Ar,{direction:"up",delay:s2,className:y("core-section-header",c2),style:l2,children:n("div",{className:"core-section-header__inner","data-described":i2?"true":void 0,"data-level":u2?"3":void 0,children:[n("div",{className:"core-section-header__text",children:[e2?t(Be,{className:"core-section-header__eyebrow",children:e2}):null,t(d2,{className:"core-section-header__title",children:r2}),i2?t("p",{className:"core-section-header__description",children:i2}):null]}),a2!=null&&a2!==""?t("div",{className:"core-section-header__trailing",children:a2}):null]})})}function Mr({tone:e2,label:r2,headline:i2,children:a2,trailing:o2,className:s2,style:c2}){let l2=K(e2,"accent"),u2=o2!=null&&o2!=="";return n("div",{className:y("core-highlight-box","core-toned",s2),"data-tone":l2,style:c2,children:[n("div",{className:"core-highlight-box__text",children:[r2?t("div",{className:"core-highlight-box__label",children:r2}):null,i2?t("div",{className:"core-highlight-box__headline",children:i2}):null,a2!=null&&a2!==""?t("div",{className:"core-highlight-box__body",children:a2}):null]}),u2?t("div",{className:"core-highlight-box__trailing",children:o2}):null]})}function Nr({label:r2,children:i2,className:a2,style:o2}){return n("div",{className:y("core-disclaimer-block",a2),style:o2,children:[r2?n(e,{children:[t("strong",{className:"core-disclaimer-block__label",children:r2})," "]}):null,i2]})}function Pr(e2){let t2=Number(e2);return Number.isFinite(t2)?Math.max(0,Math.min(100,t2)):0}function Fr({label:e2,value:r2,fillPercent:i2,subtitle:a2,tone:o2,baseProps:s2,className:c2,style:l2}){let u2=zn(s2),d2=Pr(i2);return n("div",{className:y("core-stat-strip","core-toned",c2),"data-tone":K(o2,"info"),style:x({"--core-stat-strip-fill":`${d2}%`},l2),children:[n("div",{className:"core-stat-strip__row",children:[t("span",{className:"core-stat-strip__label",children:e2}),t("span",{className:"core-stat-strip__value",children:Z(r2,u2)})]}),t("div",{className:"core-stat-strip__track",children:t("div",{className:"core-stat-strip__fill"})}),a2?t("div",{className:"core-stat-strip__subtitle",children:Z(a2,u2)}):null]})}function Ir({text:e2,tone:n2,locale:r2,className:i2}){return t("span",{className:y("core-value-badge","core-toned",i2),"data-tone":K(n2),children:Z(e2,r2)})}var Lr=8,Rr={good:"success",warn:"warning",critical:"danger"};function zr(e2,t2,n2){let r2={series:String(n2%Lr+1)},i2=e2??t2;if(typeof i2!="string"||i2==="")return r2;if(i2==="muted")return{series:"muted"};let a2=/^series-([1-9]\d*)$/.exec(i2);if(a2)return{series:String((Number(a2[1])-1)%Lr+1)};let o2=Rr[i2];return o2?{tone:o2}:Fe.includes(i2)?{tone:i2}:(W("OptionCard:colour",`[OptionCard] bar fill "${i2}" is not a tone or a series slot; using the chart series by position. Name a tone (success, danger, …) or a slot (series-1…series-8).`),r2)}function Br(e2){return typeof e2=="number"&&Number.isFinite(e2)?{text:String(e2).padStart(2,"0"),kind:"numeral"}:typeof e2!="string"||e2.trim()===""?null:/^\d+$/.test(e2.trim())?{text:e2.trim().padStart(2,"0"),kind:"numeral"}:{text:e2,kind:"label"}}function Vr(e2){let{number:r2,title:i2,description:a2,badgeText:o2,badgeTone:s2,bars:c2,tone:l2,isSelected:u2=false,className:d2,style:f2}=e2,p2=zn(e2.baseProps),m2=Array.isArray(c2)?c2:[],h2=Br(r2);return n("div",{className:y("core-option-card",d2),"data-selected":u2?"true":void 0,"data-described":a2?"true":void 0,style:f2,children:[n("div",{className:"core-option-card__head",children:[h2?t("div",{className:"core-option-card__number","data-kind":h2.kind,children:h2.text}):t("span",{}),o2!=null&&o2!==""?t(Ir,{text:o2,tone:K(s2),locale:p2}):null]}),i2?t("div",{className:"core-option-card__title",children:i2}):null,a2?t("p",{className:"core-option-card__description",children:a2}):null,m2.map((e3,r3)=>{let i3=zr(e3.tone,l2,r3),a3=Math.min(100,Math.max(0,Number(e3.fillPercent)||0)),o3=e3.valueTone===void 0||e3.valueTone==="default"?void 0:K(e3.valueTone);return n("div",{className:"core-option-card__bar",children:[n("div",{className:"core-option-card__bar-head",children:[t("span",{className:"core-option-card__bar-label",children:e3.label}),t("span",{className:y("core-option-card__bar-value",o3&&"core-toned"),"data-tone":o3,children:Z(e3.value,p2)})]}),t("div",{className:"core-option-card__track",children:t("div",{className:y("core-option-card__fill","tone"in i3&&"core-toned"),"data-tone":"tone"in i3?i3.tone:void 0,"data-series":"series"in i3?i3.series:void 0,style:x({"--core-option-card-fill":`${a3}%`})})})]},r3)})]})}function Hr(e2){let{title:r2,subtitle:i2,rows:a2,className:o2,style:s2}=e2,c2=zn(e2.baseProps),l2=e2.tone??"info",u2=l2==="none",d2=Array.isArray(a2)?a2:[];return n("div",{className:y("core-profile-card",!u2&&"core-toned",o2),"data-tone":u2?void 0:K(l2,"info"),"data-marker":u2?"none":void 0,style:s2,children:[n("div",{className:"core-profile-card__head",children:[t("div",{className:"core-profile-card__title",children:r2}),i2?t("div",{className:"core-profile-card__subtitle",children:i2}):null]}),d2.map((e3,r3)=>n("div",{className:"core-profile-card__row",children:[t("span",{className:"core-profile-card__label",children:e3.label}),n("div",{className:"core-profile-card__end",children:[t("span",{className:"core-profile-card__value",children:Z(e3.value,c2)}),e3.badge?t(Ir,{text:e3.badge.text,tone:K(e3.badge.tone),locale:c2}):null]})]},r3))]})}function Ur(e2){if(typeof e2=="string"){let t2=e2.trim();return t2.startsWith("+")?"up":t2.startsWith("-")||t2.startsWith("−")?"down":"flat"}return e2&&typeof e2=="object"&&typeof e2.value=="number"?e2.value>0?"up":e2.value<0?"down":"flat":"flat"}var Wr={up:"▲",down:"▼",flat:"—"},Gr={up:"success",down:"danger",flat:void 0},Kr=e2=>e2!=null&&e2!=="";function qr(e2){let{columns:r2=4,gap:i2="tight",minColumnWidth:a2,className:o2,style:s2}=e2,c2=zn(e2.baseProps),l2=Array.isArray(e2.cards)?e2.cards:[],u2=Math.max(1,Math.min(6,Math.round(Number(r2))||4));return t("div",{className:y("core-kpi-card-grid",o2),"data-gap":i2==="normal"?"normal":"tight",style:x({"--core-kpi-card-grid-columns":String(u2),"--core-kpi-card-grid-min":typeof a2=="number"&&a2>0?`${a2}px`:void 0},s2),children:l2.map((e3,r3)=>{let{subtitle:i3,badge:a3}=e3,o3=Kr(e3.tone)?K(e3.tone):void 0,s3=Kr(e3.delta)?Ur(e3.delta):void 0,l3=s3?Gr[s3]:void 0;return t(Ar,{direction:"up",delay:r3*.06,className:"core-kpi-card-grid__item",children:n("div",{className:y("core-kpi-card-grid__card",o3&&"core-toned"),"data-tone":o3,children:[n("div",{className:"core-kpi-card-grid__head",children:[t("div",{className:"core-kpi-card-grid__label",children:e3.label}),a3&&Kr(a3.text)?t(Ir,{text:a3.text,tone:K(a3.tone),locale:c2}):null]}),t("div",{className:"core-kpi-card-grid__value",children:Z(e3.value,c2)}),s3?n("div",{className:y("core-kpi-card-grid__delta",l3&&"core-toned"),"data-tone":l3,"data-direction":s3,children:[t("span",{"aria-hidden":"true",children:Wr[s3]})," ",Z(e3.delta,c2)]}):null,Kr(i3)?t("div",{className:"core-kpi-card-grid__subtitle",children:Z(i3,c2)}):null]})},r3)})})}function Jr(e2){if(typeof e2=="string"&&e2!==""&&e2!=="default")return K(e2)}var Yr=e2=>!!(e2&&typeof e2=="object"&&"value"in e2&&"format"in e2),Xr=e2=>!!(e2&&typeof e2=="object"&&!Array.isArray(e2)&&!o(e2)&&"value"in e2&&!("format"in e2));function Zr(e2){return Xr(e2)?e2:{value:e2}}var Qr=/^\d{4}-\d{2}-\d{2}$/,$r=/^\d{4}-\d{2}-\d{2}(?:[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)?)?$/;function ei(e2,t2,n2){if(!$r.test(e2))return e2;let r2=Qr.test(e2),i2=new Date(r2?`${e2}T00:00:00Z`:e2.replace(" ","T"));return Number.isNaN(i2.getTime())?e2:i2.toLocaleString(n2,{year:"numeric",month:"short",day:"numeric",...t2==="datetime"&&!r2?{hour:"numeric",minute:"2-digit"}:{},...r2?{timeZone:"UTC"}:{}})}function ti(e2){if(!/^[a-z][a-z0-9]*([_-][a-z0-9]+)+$/.test(e2))return e2;let t2=e2.replace(/[_-]+/g," ");return t2[0].toUpperCase()+t2.slice(1)}var ni=new Set(["currency","currency-k","currency-m","currency-compact","currency-monthly","percent","fraction-percent","age","years","year","number"]),ri={fraction:"fraction-percent"};function ii(e2,t2,n2,r2){if(t2==="unit"){let t3=typeof n2=="string"?n2.trim():"",i2=ri[t3]??(ni.has(t3)?t3:void 0);return Z(i2?{value:e2,format:i2}:{value:e2,format:"number",...t3?{unit:t3}:{}},r2)}return t2&&ni.has(t2)?Un(t2,e2,{locale:r2}):String(e2)}function ai(e2,t2,n2,r2){return typeof e2=="string"&&t2==="raw"?e2:typeof e2=="string"&&(t2==="date"||t2==="datetime")?ei(e2,t2,r2.locale):typeof e2=="string"?Z(ti(e2),r2):Yr(e2)?Z(e2,r2):typeof e2=="number"?ii(e2,t2,n2,r2):o(e2)?e2:null}function oi({title:e2,subtitle:r2,columns:i2,rows:a2,baseProps:o2,className:s2,style:c2}){let l2=zn(o2),d2=`${u()}-title`,f2=Array.isArray(i2)?i2:[],p2=Array.isArray(a2)?a2:[],m2=e3=>f2[e3]?.align??(e3===0?"left":"right");return t(Ar,{direction:"up",children:n("div",{className:y("core-data-table",s2),style:c2,children:[e2||r2?n("div",{className:"core-data-table__head",children:[e2?t("div",{id:d2,className:"core-data-table__title",children:e2}):null,r2?t("div",{className:"core-data-table__subtitle",children:r2}):null]}):null,t("div",{className:"core-data-table__scroll",role:"region","aria-label":e2?void 0:"Data table, scrollable","aria-labelledby":e2?d2:void 0,tabIndex:0,children:n("table",{className:"core-data-table__table",children:[t("thead",{children:t("tr",{children:f2.map((e3,r3)=>n("th",{scope:"col",className:"core-data-table__col","data-align":m2(r3),style:x({"--core-data-table-min":typeof e3.minWidth=="number"&&e3.minWidth>0?`${e3.minWidth}px`:void 0}),children:[e3.header,e3.sublabel?t("span",{className:"core-data-table__sublabel",children:e3.sublabel}):null]},r3))})}),t("tbody",{children:p2.map((e3,n2)=>{let{highlighted:r3,total:i3}=e3,a3=e3.cells,o3=Array.isArray(a3)?a3:a3&&typeof a3=="object"?f2.map(e4=>a3[e4.key]):[];return t("tr",{className:"core-data-table__row","data-highlighted":r3?"true":void 0,"data-total":i3?"true":void 0,children:o3.map((n3,r4)=>{let i4=Zr(n3),a4=Jr(i4.tone),o4={className:y("core-data-table__cell",a4&&"core-toned"),"data-align":m2(r4),"data-tone":a4};return r4===0?t("th",{scope:"row",...o4,children:ai(i4.value,f2[r4]?.format,e3.unit,l2)},r4):t("td",{...o4,children:ai(i4.value,f2[r4]?.format,e3.unit,l2)},r4)})},n2)})})]})})]})})}function si(e2,t2,n2){return e2.cardComponent&&typeof t2=="function"?t2(e2.cardComponent,{...n2,event:e2})??null:null}function ci(e2){return e2?typeof e2=="string"?e2:e2.map(e3=>e3&&typeof e3.message=="string"?e3.message:"").filter(Boolean).join(" "):""}var li=["accepted","tentative","declined"],ui=(e2,t2)=>new Intl.DateTimeFormat(e2,{weekday:"short",month:"short",day:"numeric",timeZone:t2}),di=(e2,t2)=>new Intl.DateTimeFormat(e2,{hour:"numeric",minute:"2-digit",timeZone:t2});function fi(e2,t2,n2){if(e2.startOn){let n3=new Date(`${e2.startOn}T00:00:00Z`),r3=ui(t2,"UTC").format(n3);if(!e2.endOn)return`${r3} (all day)`;let i3=new Date(new Date(`${e2.endOn}T00:00:00Z`).getTime()-864e5);return i3.getTime()<=n3.getTime()?`${r3} (all day)`:`${r3} – ${ui(t2,"UTC").format(i3)}`}if(!e2.startsAt)return"";let r2=new Date(e2.startsAt);if(Number.isNaN(r2.getTime()))return"";let i2=ui(t2,n2).format(r2),a2=di(t2,n2).format(r2);if(!e2.endsAt)return`${i2} · ${a2}`;let o2=new Date(e2.endsAt);return Number.isNaN(o2.getTime())||o2.getTime()===r2.getTime()?`${i2} · ${a2}`:`${i2} · ${a2} – ${di(t2,n2).format(o2)}`}var pi=()=>Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC";function mi(e2){if(!e2)return;let t2=new Date(e2);return Number.isNaN(t2.getTime())?void 0:t2.toISOString()}function hi(){let e2=new Date;return e2.setMinutes(e2.getMinutes()-e2.getTimezoneOffset()),e2.toISOString().slice(0,16)}function gi(e2){return e2.success?"":e2.code==="DENIED"?"You can't do that here.":e2.code==="CONFLICT"?"Someone changed this first. Reload and try again.":e2.code==="INVALID"?ci(e2.errors)||"Some details are missing or not valid.":ci(e2.errors)||"Something went wrong. Try again."}function _i(e2,t2){let n2=typeof e2=="string"?new Date(e2):e2;return new Intl.DateTimeFormat("en-CA",{timeZone:t2,year:"numeric",month:"2-digit",day:"2-digit"}).format(n2)}function Q(e2,t2){let n2=new Date(`${e2}T00:00:00Z`);return n2.setUTCDate(n2.getUTCDate()+t2),n2.toISOString().slice(0,10)}function vi(e2){return Q(e2,-((new Date(`${e2}T00:00:00Z`).getUTCDay()+6)%7))}function yi(e2,t2){if(e2.startOn){let t3=e2.endOn&&e2.endOn>e2.startOn?e2.endOn:Q(e2.startOn,1),n2=[];for(let r2=e2.startOn;r2<t3&&n2.length<62;r2=Q(r2,1))n2.push(r2);return n2}return e2.startsAt?[_i(e2.startsAt,t2)]:[]}var bi=(e2,t2)=>e2&&t2?e2.split("{id}").join(encodeURIComponent(t2)):void 0;function xi(r2){let{event:i2,href:a2,locale:o2,timeZone:s2,size:c2,className:l2,style:u2}=r2,d2=i2&&typeof i2=="object"?i2:{name:""},f2=fi(d2,o2,s2),p2=d2.status&&d2.status!=="confirmed"?d2.status:void 0,m2=n(e,{children:[n("div",{className:"core-event-card__top",children:[d2.typeName?t("span",{className:"core-event-card__type",children:d2.typeName}):null,p2?t("span",{className:"core-event-card__status","data-status":p2,children:p2}):null]}),t("div",{className:"core-event-card__name",children:d2.name}),f2?t("div",{className:"core-event-card__when",children:f2}):null,d2.location?t("div",{className:"core-event-card__where",children:d2.location}):null]});return t("div",{className:y("core-event-card",l2),"data-kind":d2.kind,"data-status":d2.status,"data-size":c2==="compact"?"compact":void 0,style:u2,children:a2?t("a",{className:"core-event-card__link",href:a2,children:m2}):m2})}var Si={accepted:"Accept",tentative:"Maybe",declined:"Decline"};function Ci(e2){let{actions:r2,className:i2,style:a2}=e2,[o2,s2]=h(e2.response),[c2,l2]=h(false),[u2,d2]=h(""),f2=r2?.respond,p2=async e3=>{if(!f2||c2)return;l2(true),d2("");let t2=await f2({response:e3});l2(false),t2.success?s2(e3):d2(gi(t2))};return n("div",{className:y("core-event-respond",i2),style:a2,children:[t("div",{className:"core-event-respond__choices",role:"group","aria-label":"Your response",children:li.map(e3=>t("button",{type:"button",className:"core-event-respond__choice","aria-pressed":o2===e3,disabled:!f2||c2,onClick:()=>void p2(e3),children:Si[e3]},e3))}),u2?t("p",{className:"core-event-respond__message",role:"alert",children:u2}):null]})}function wi(e2){let{event:r2,actions:i2,viewerResponse:a2,locale:o2,timeZone:s2,className:c2,style:l2}=e2,u2=r2&&typeof r2=="object"?r2:{name:""},d2=Array.isArray(e2.notes)?e2.notes:[],f2=Array.isArray(e2.participants)?e2.participants:[],p2=fi(u2,o2,s2);return n("article",{className:y("core-event-detail",c2),"data-status":u2.status,style:l2,children:[n("header",{className:"core-event-detail__head",children:[u2.typeName?t("div",{className:"core-event-detail__type",children:u2.typeName}):null,t("h2",{className:"core-event-detail__name",children:u2.name}),p2?t("div",{className:"core-event-detail__meta",children:p2}):null,u2.location?t("div",{className:"core-event-detail__meta",children:u2.location}):null,u2.status&&u2.status!=="confirmed"?t("div",{className:"core-event-detail__status",children:u2.status}):null]}),a2===void 0?null:t(Ci,{response:a2,actions:i2,className:"core-event-detail__respond"}),f2.length?n("section",{className:"core-event-detail__section","aria-label":"Participants",children:[t("h3",{className:"core-event-detail__heading",children:"Participants"}),t("ul",{className:"core-event-detail__list",children:f2.map((e3,r3)=>n("li",{className:"core-event-detail__person",children:[t("span",{children:e3.name}),t("span",{className:"core-event-detail__muted",children:[e3.role,e3.response&&e3.response!=="needs_action"?e3.response:void 0].filter(Boolean).join(" · ")})]},r3))})]}):null,d2.length?n("section",{className:"core-event-detail__section","aria-label":"Notes",children:[t("h3",{className:"core-event-detail__heading",children:"Notes"}),d2.map((e3,r3)=>n("div",{className:"core-event-detail__note","data-audience":e3.audience,children:[e3.audience==="staff"?t("div",{className:"core-event-detail__badge",children:"Staff only"}):null,t("p",{className:"core-event-detail__body",children:e3.body}),e3.author||e3.createdAt?t("div",{className:"core-event-detail__muted",children:[e3.author,e3.createdAt?new Date(e3.createdAt).toLocaleString(o2,{timeZone:s2}):void 0].filter(Boolean).join(" · ")}):null]},r3))]}):null]})}var Ti=e2=>{let t2=e2?.dataSchema?.properties??{},n2=new Set(e2?.dataSchema?.required??[]);return Object.entries(t2).map(([e3,t3])=>[e3,t3,n2.has(e3)])};function Ei(e2){let{orgId:r2,projectId:i2,actions:a2,onDone:o2,canWriteStaffNotes:s2,className:c2,style:l2}=e2,d2=Array.isArray(e2.types)?e2.types:[],p2=u(),[m2,g2]=h(e2.defaultTypeId??d2[0]?.id??""),_2=d2.find(e3=>e3.id===m2),v2=_2?.kind==="scheduled",[b2,x2]=h(""),[S2,C2]=h(hi()),[w2,T2]=h(""),[E2,D2]=h(""),[O2,k2]=h({}),[A2,j2]=h(""),[M2,N2]=h(!!s2),[P2,F2]=h(false),[I2,L2]=h(""),R2=f(()=>Ti(_2),[_2]);if(!d2.length)return t("p",{className:y("core-event-log","core-event-log__empty",c2),style:l2,children:"There's nothing you can log here."});let z2=async t2=>{if(t2.preventDefault(),!a2?.logEvent||P2||!_2)return;F2(true),L2("");let n2=mi(S2),c3={event_type_id:_2.id,org_id:r2,name:b2.trim()||_2.name,starts_at:n2,tzid:pi(),data:O2,subjects:e2.subjects?[...e2.subjects]:[]};i2&&(c3.project_id=i2),v2&&w2&&(c3.ends_at=mi(w2)),E2.trim()&&(c3.location=E2.trim());let l3=A2.trim()?[{body:A2.trim(),audience:s2&&M2?"staff":"shared"}]:void 0,u2=await a2.logEvent(l3?{event:c3,notes:l3}:{event:c3});F2(false),u2.success?(x2(""),j2(""),k2({}),o2?.(u2)):L2(gi(u2))},B2=(e3,t2)=>k2(n2=>({...n2,[e3]:t2}));return n("form",{className:y("core-event-log",c2),style:l2,onSubmit:e3=>void z2(e3),children:[n("label",{className:"core-event-log__field",children:[t("span",{className:"core-event-log__label",children:"Type"}),t("select",{value:m2,onChange:e3=>{g2(e3.target.value),k2({})},children:d2.map(e3=>t("option",{value:e3.id,children:e3.name},e3.id))})]}),n("label",{className:"core-event-log__field",children:[t("span",{className:"core-event-log__label",children:"Title"}),t("input",{value:b2,onChange:e3=>x2(e3.target.value),placeholder:_2?.name})]}),n("div",{className:"core-event-log__row",children:[n("label",{className:"core-event-log__field",children:[t("span",{className:"core-event-log__label",children:v2?"Starts":"When"}),t("input",{type:"datetime-local",required:true,value:S2,onChange:e3=>C2(e3.target.value)})]}),v2?n("label",{className:"core-event-log__field",children:[t("span",{className:"core-event-log__label",children:"Ends"}),t("input",{type:"datetime-local",value:w2,min:S2,onChange:e3=>T2(e3.target.value)})]}):null]}),n("label",{className:"core-event-log__field",children:[t("span",{className:"core-event-log__label",children:"Where"}),t("input",{value:E2,onChange:e3=>D2(e3.target.value)})]}),R2.map(([e3,r3,i3])=>{let a3=r3.title??e3;if(r3.enum)return n("label",{className:"core-event-log__field",children:[t("span",{className:"core-event-log__label",children:a3}),n("select",{required:i3,value:String(O2[e3]??""),onChange:t2=>B2(e3,t2.target.value||void 0),children:[t("option",{value:"",children:"—"}),r3.enum.map(e4=>t("option",{value:e4,children:e4},e4))]})]},e3);if(r3.type==="boolean")return n("label",{className:"core-event-log__check",children:[t("input",{type:"checkbox",checked:!!O2[e3],onChange:t2=>B2(e3,t2.target.checked)}),t("span",{children:a3})]},e3);let o3=r3.type==="number"||r3.type==="integer";return n("label",{className:"core-event-log__field",children:[t("span",{className:"core-event-log__label",children:a3}),t("input",{type:o3?"number":"text",step:r3.type==="integer"?1:"any",required:i3,value:O2[e3]===void 0?"":String(O2[e3]),onChange:t2=>B2(e3,t2.target.value===""?void 0:o3?Number(t2.target.value):t2.target.value)})]},e3)}),n("label",{className:"core-event-log__field",children:[t("span",{className:"core-event-log__label",children:"Note"}),t("textarea",{rows:3,value:A2,onChange:e3=>j2(e3.target.value)})]}),s2&&A2.trim()?n("label",{className:"core-event-log__check",children:[t("input",{type:"checkbox",checked:M2,onChange:e3=>N2(e3.target.checked)}),t("span",{children:"Staff only: the client won't see this note"})]}):null,I2?t("p",{id:`${p2}-error`,className:"core-event-log__message",role:"alert",children:I2}):null,t("div",{className:"core-event-log__actions",children:t("button",{type:"submit",className:"core-event-log__submit",disabled:P2||!a2?.logEvent,children:P2?"Saving…":v2?"Schedule":"Log"})})]})}var Di=(e2,t2)=>new Intl.DateTimeFormat(t2,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`));function Oi(e2){let{view:r2="week",weekParam:i2="week",linkParams:a2,eventHref:o2="?panel=event:{id}",locale:s2,timeZone:c2,renderComponent:l2,label:u2="Schedule",className:d2,style:f2}=e2,p2=e3=>`?${a2?new URLSearchParams({...a2,[i2]:e3}).toString():`${i2}=${e3}`}`,m2=Array.isArray(e2.occurrences)?e2.occurrences:[],h2=_i(new Date,c2),g2=vi(/^\d{4}-\d{2}-\d{2}$/.test(e2.weekOf??"")?e2.weekOf:h2),_2=Array.from({length:7},(e3,t2)=>Q(g2,t2)),v2=new Map(_2.map(e3=>[e3,[]]));for(let e3 of m2)for(let t2 of yi(e3,c2))v2.get(t2)?.push(e3);for(let e3 of v2.values())e3.sort((e4,t2)=>+!e4.startOn-!t2.startOn||(e4.startsAt??"").localeCompare(t2.startsAt??""));let b2=r2==="agenda"?_2.filter(e3=>v2.get(e3).length):_2;return n("section",{className:y("core-event-schedule",d2),"data-view":r2,style:f2,"aria-label":u2,children:[n("div",{className:"core-event-schedule__nav",children:[t("a",{className:"core-event-schedule__step",href:p2(Q(g2,-7)),"aria-label":"Previous week",children:"‹"}),t("span",{className:"core-event-schedule__range",children:`${Di(_2[0],s2)} – ${Di(_2[6],s2)}`}),t("a",{className:"core-event-schedule__step",href:p2(Q(g2,7)),"aria-label":"Next week",children:"›"})]}),b2.length===0?t("p",{className:"core-event-schedule__empty",children:"Nothing scheduled this week."}):null,t("ol",{className:"core-event-schedule__days",children:b2.map(e3=>{let r3=v2.get(e3);return n("li",{className:"core-event-schedule__day","data-today":e3===h2||void 0,children:[t("h3",{className:"core-event-schedule__date",children:Di(e3,s2)}),r3.length?t("ul",{className:"core-event-schedule__events",children:r3.map((e4,n2)=>t("li",{children:si(e4,l2,{href:bi(o2,e4.id),locale:s2,timeZone:c2})??t(xi,{event:e4,href:bi(o2,e4.id),locale:s2,timeZone:c2})},`${e4.id??n2}-${e4.startsAt??e4.startOn??n2}`))}):t("p",{className:"core-event-schedule__none",children:"—"})]},e3)})})]})}var ki=(e2,t2)=>new Intl.DateTimeFormat(t2,{weekday:"long",month:"long",day:"numeric",year:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`));function Ai(e2){let{eventHref:r2="?panel=event:{id}",emptyText:i2="No activity yet.",locale:a2,timeZone:o2,renderComponent:s2,className:c2,style:l2}=e2,u2=[...(Array.isArray(e2.items)?e2.items:[]).filter(e3=>e3&&!Number.isNaN(new Date(e3.at).getTime()))].sort((e3,t2)=>new Date(t2.at).getTime()-new Date(e3.at).getTime()),d2=[];for(let e3 of u2){let t2=_i(e3.at,o2),n2=d2[d2.length-1];n2&&n2[0]===t2?n2[1].push(e3):d2.push([t2,[e3]])}let f2=new Intl.DateTimeFormat(a2,{hour:"numeric",minute:"2-digit",timeZone:o2});return n("section",{className:y("core-event-timeline",c2),style:l2,"aria-label":"Activity",children:[d2.length===0?t("p",{className:"core-event-timeline__empty",children:i2}):null,d2.map(([e3,i3])=>n("section",{className:"core-event-timeline__day",children:[t("h3",{className:"core-event-timeline__date",children:ki(e3,a2)}),t("ol",{className:"core-event-timeline__items",children:i3.map((e4,i4)=>n("li",{className:"core-event-timeline__item","data-op":e4.op||void 0,children:[n("div",{className:"core-event-timeline__line",children:[t("time",{className:"core-event-timeline__time",dateTime:e4.at,children:f2.format(new Date(e4.at))}),e4.summary?t("span",{className:"core-event-timeline__summary",children:e4.summary}):null,e4.actor?t("span",{className:"core-event-timeline__actor",children:e4.actor}):null]}),e4.event?si(e4.event,s2,{href:bi(r2,e4.event.id),locale:a2,timeZone:o2})??t(xi,{event:e4.event,href:bi(r2,e4.event.id),locale:a2,timeZone:o2}):null]},e4.id??`${e4.at}-${i4}`))})]},e3))]})}var ji=1440,Mi=e2=>new Intl.DateTimeFormat("en-CA",{timeZone:e2,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"});function Ni(e2,t2){let n2=e2 instanceof Date?e2:new Date(e2);if(Number.isNaN(n2.getTime()))return null;let r2=Object.fromEntries(Mi(t2).formatToParts(n2).map(e3=>[e3.type,e3.value]));return{date:`${r2.year}-${r2.month}-${r2.day}`,minutes:Number(r2.hour)*60+Number(r2.minute)+Number(r2.second)/60}}var Pi=e2=>e2.busyOnly===true;function Fi(e2,t2){if(!e2.startsAt)return null;let n2=Ni(e2.startsAt,t2);if(!n2)return null;let r2=new Date(e2.startsAt).getTime(),i2=e2.endsAt?new Date(e2.endsAt).getTime():NaN,a2=Ni(Number.isFinite(i2)&&i2>r2?i2:r2+18e5,t2);return a2?{start:n2,end:a2}:null}function Ii(e2,t2,{timeZone:n2,minMinutes:r2=42}={}){let i2=[],a2=[];for(let r3 of e2){if(!r3||typeof r3!="object")continue;if(r3.startOn){yi(r3).includes(t2)&&i2.push(r3);continue}let e3=Fi(r3,n2);if(!e3||e3.start.date>t2||e3.end.date<t2||e3.end.date===t2&&e3.end.minutes===0&&e3.start.date<t2)continue;let o3=e3.start.date<t2?0:e3.start.minutes,s3=e3.end.date>t2?ji:e3.end.minutes;a2.push({event:r3,startMin:o3,endMin:Math.max(s3,o3+1),continuesBefore:e3.start.date<t2,continuesAfter:e3.end.date>t2,busyOnly:Pi(r3)})}a2.sort((e3,t3)=>e3.startMin-t3.startMin||t3.endMin-e3.endMin);let o2=[],s2=[],c2=-1,l2=[],u2=()=>{for(let e4 of s2)e4.cols=l2.length;let e3=s2.filter(e4=>!e4.busyOnly);for(let t3 of e3)t3.overlaps=e3.some(e4=>e4!==t3&&e4.startMin<t3.endMin&&t3.startMin<e4.endMin);o2.push(...s2),s2=[],l2=[],c2=-1};for(let e3 of a2){s2.length&&e3.startMin>=c2&&u2();let t3=Math.min(Math.max(e3.endMin,e3.startMin+r2),ji),n3=l2.findIndex(t4=>t4<=e3.startMin);n3<0&&(n3=l2.length),l2[n3]=t3,c2=Math.max(c2,t3),s2.push({...e3,shownEndMin:t3,col:n3,cols:1,overlaps:false})}return u2(),i2.sort((e3,t3)=>(e3.name??"").localeCompare(t3.name??"")),{date:t2,blocks:o2,allDay:i2}}function Li(e2,t2=7,n2=19){let r2=Math.max(0,Math.min(23,t2))*60,i2=Math.max(r2/60+1,Math.min(24,n2))*60;for(let t3 of e2)for(let e3 of t3.blocks)r2=Math.min(r2,Math.floor(e3.startMin/60)*60),i2=Math.max(i2,Math.ceil(e3.shownEndMin/60)*60);return{fromMin:r2,toMin:Math.min(i2,ji)}}function Ri(e2,t2=1){let n2=Q(vi(e2),(t2%7+6)%7);return n2>e2&&(n2=Q(n2,-7)),Array.from({length:7},(e3,t3)=>Q(n2,t3))}function zi(e2,t2,n2){return t2.filter(t3=>Ii(e2,t3,{timeZone:n2,minMinutes:0}).blocks.some(e3=>e3.overlaps))}function Bi(e2){if(typeof e2!="string")return;let t2=e2.trim();if(t2===""||/[\\\u0000-\u001f]/.test(t2))return;let n2=t2;for(let e3=0;e3<3;e3++)try{let e4=decodeURIComponent(n2);if(e4===n2)break;n2=e4}catch{return}if(/[\\\u0000-\u001f]/.test(n2)||n2.startsWith("//")||/^[a-z][a-z0-9+.-]*:/i.test(n2))return;let r2=n2.split(/[?#]/)[0]??"";if(!(/^\/(auth|api)(\/|$)/i.test(r2.replace(/\/\.\//g,"/"))||/(^|\/)\.\.(\/|$)/.test(r2)))return/^[/?#]/.test(t2)?t2:void 0}var Vi=["circle","square","triangle","diamond","plus","hexagon"],Hi={circle:"M5 1.5a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7z",square:"M1.5 1.5h7v7h-7z",triangle:"M5 1.2 9 8.5H1z",diamond:"M5 .8 9.2 5 5 9.2.8 5z",plus:"M3.5 1h3v2.5H9v3H6.5V9h-3V6.5H1v-3h2.5z",hexagon:"M5 .8 8.6 2.9v4.2L5 9.2 1.4 7.1V2.9z"},Ui=e2=>Vi[(Math.max(1,Math.floor(e2))-1)%Vi.length],Wi=e2=>typeof e2=="number"&&Number.isFinite(e2)&&e2>=1?(Math.floor(e2)-1)%8+1:1;function Gi({series:e2,className:n2}){let r2=Wi(e2);return t("svg",{className:n2?`core-series-glyph ${n2}`:"core-series-glyph",viewBox:"0 0 10 10","aria-hidden":"true",focusable:"false","data-series":r2,"data-shape":Ui(r2),children:t("path",{d:Hi[Ui(r2)]})})}var Ki=44,qi=28,Ji=(e2,t2,n2)=>`${((e2-t2)/n2*100).toFixed(3)}%`;function Yi(e2){let t2=e2===void 0?void 0:typeof e2=="number"?e2:new Date(e2).getTime(),[n2,r2]=h(()=>Date.now());return l(()=>{if(t2!==void 0)return;let e3=setInterval(()=>r2(Date.now()),6e4);return()=>clearInterval(e3)},[t2]),t2!==void 0&&Number.isFinite(t2)?t2:n2}function Xi(r2){let{label:i2="Schedule",startHour:a2=7,endHour:o2=19,hourHeight:s2=64,eventHref:c2="?panel=event:{id}",locale:u2,timeZone:d2,className:f2,style:p2}=r2,g2=(Array.isArray(r2.columns)?r2.columns:[]).filter(e2=>e2&&typeof e2.date=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e2.date)),_2=Yi(r2.now),v2=m(null),[b2,S2]=h(false);l(()=>{let e2=v2.current;if(!e2)return;let t2=()=>S2(e2.scrollWidth>e2.clientWidth+1);t2();let n2=new ResizeObserver(t2);return n2.observe(e2),()=>n2.disconnect()},[g2.length]);let C2=Ni(_2,d2),w2=Math.ceil(Ki/Math.max(s2,24)*60),T2=g2.map(e2=>Ii(Array.isArray(e2.events)?e2.events:[],e2.date,{timeZone:d2,minMinutes:w2})),E2=T2.map(e2=>Math.max(Ki,qi*Math.max(1,...e2.blocks.map(e3=>e3.cols)))),{fromMin:D2,toMin:O2}=Li(T2,a2,o2),k2=O2-D2,A2=Array.from({length:Math.floor(k2/60)+1},(e2,t2)=>D2+t2*60),j2=new Intl.DateTimeFormat(u2,{hour:"numeric",timeZone:"UTC"}),M2=new Intl.DateTimeFormat(u2,{hour:"numeric",minute:"2-digit",timeZone:"UTC"}),N2=e2=>M2.format(new Date(Date.UTC(2e3,0,1,0,Math.min(e2,ji-1)))),P2=e2=>e2.continuesBefore?e2.continuesAfter?"All day":`Until ${N2(e2.endMin)}`:e2.continuesAfter?`From ${N2(e2.startMin)}`:`${N2(e2.startMin)} – ${N2(e2.endMin)}`;return n("div",{ref:v2,className:y("core-hour-grid",f2),role:"group","aria-label":i2,tabIndex:b2?0:void 0,style:x({"--core-hour-grid-cols":String(g2.length),"--core-hour-grid-tracks":E2.map(e2=>`minmax(${e2}px, 1fr)`).join(" "),"--core-hour-grid-min":`${E2.reduce((e2,t2)=>e2+t2,0)}px`,"--core-hour-grid-hour":`${s2}px`,"--core-hour-grid-hours":String(k2/60)},p2),children:[n("div",{className:"core-hour-grid__head",children:[t("span",{className:"core-hour-grid__corner","aria-hidden":"true"}),g2.map(r3=>{let i3=C2?.date===r3.date,a3=n(e,{children:[t("span",{className:"core-hour-grid__label",children:r3.label}),r3.sublabel?t("span",{className:"core-hour-grid__sublabel",children:r3.sublabel}):null]}),o3=Bi(r3.href);return o3?t("a",{className:"core-hour-grid__day",href:o3,"data-today":i3||void 0,"aria-current":i3?"date":void 0,children:a3},r3.id):t("div",{className:"core-hour-grid__day","data-today":i3||void 0,"aria-current":i3?"date":void 0,children:a3},r3.id)})]}),T2.some(e2=>e2.allDay.length)?n("div",{className:"core-hour-grid__allday",children:[t("span",{className:"core-hour-grid__corner","aria-hidden":"true"}),T2.map((e2,n2)=>t("ul",{className:"core-hour-grid__chips","aria-label":`All day, ${g2[n2].label}`,children:e2.allDay.map((e3,n3)=>{let r3=Zi(e3)?void 0:Bi(bi(c2,e3.id));return t("li",{className:"core-hour-grid__chip","data-busy":Zi(e3)||void 0,children:Zi(e3)?t("span",{className:"core-hour-grid__sr",children:"Busy all day"}):r3?t("a",{href:r3,children:e3.name}):e3.name},`${e3.id??n3}`)})},g2[n2].id))]}):null,n("div",{className:"core-hour-grid__body",children:[t("div",{className:"core-hour-grid__axis","aria-hidden":"true",children:A2.map((e2,n2)=>t("span",{className:"core-hour-grid__tick",style:{top:Ji(e2,D2,k2)},"data-first":n2===0||void 0,children:n2===0?"":j2.format(new Date(Date.UTC(2e3,0,1,e2/60)))},e2))}),T2.map((r3,i3)=>{let a3=g2[i3],o3=C2?.date===a3.date;return n("section",{className:"core-hour-grid__col","aria-label":a3.label,"data-today":o3||void 0,children:[t("ol",{className:"core-hour-grid__events",children:r3.blocks.map((r4,i4)=>{let a4=r4.event,o4={"--core-hour-grid-top":Ji(r4.startMin,D2,k2),"--core-hour-grid-height":`${((r4.shownEndMin-r4.startMin)/k2*100).toFixed(3)}%`,"--core-hour-grid-left":`${(r4.col/r4.cols*100).toFixed(3)}%`,"--core-hour-grid-width":`${(100/r4.cols).toFixed(3)}%`};if(r4.busyOnly)return t("li",{className:"core-hour-grid__block","data-busy":"",style:x(o4),children:t("span",{className:"core-hour-grid__sr",children:`Busy, ${P2(r4)}`})},i4);let s3=Bi(bi(c2,a4.id)),l2=r4.endMin-r4.startMin,u3=l2<45?"short":l2<90?"medium":"long",d3=n(e,{children:[r4.overlaps?t("span",{className:"core-hour-grid__overlap",children:"Overlaps"}):null,n("span",{className:"core-hour-grid__name",children:[typeof a4.series=="number"?t(Gi,{series:a4.series,className:"core-hour-grid__series"}):null,a4.name]}),t("span",{className:"core-hour-grid__time",children:P2(r4)}),u3==="long"&&a4.typeName?t("span",{className:"core-hour-grid__type",children:a4.typeName}):null]}),f3={className:"core-hour-grid__event","data-kind":a4.kind,"data-status":a4.status,"data-size":u3,"data-overlaps":r4.overlaps||void 0};return t("li",{className:"core-hour-grid__block","data-before":r4.continuesBefore||void 0,"data-after":r4.continuesAfter||void 0,style:x(o4),children:s3?t("a",{...f3,href:s3,children:d3}):t("div",{...f3,children:d3})},`${a4.id??"e"}-${i4}`)})}),o3&&C2&&C2.minutes>=D2&&C2.minutes<=O2?t("div",{className:"core-hour-grid__now","aria-hidden":"true",style:{top:Ji(C2.minutes,D2,k2)}}):null]},a3.id)})]})]})}var Zi=e2=>e2.busyOnly===true;function Qi(e2){let{param:r2="type",cancelledParam:i2="cancelled",keep:a2,label:o2="Show",onChange:s2,className:c2,style:l2}=e2,d2=(Array.isArray(e2.types)?e2.types:[]).filter(e3=>e3&&typeof e3.id=="string"&&typeof e3.label=="string"&&e3.label!==""),f2=u(),p2=d2.map(e3=>e3.id),m2=Array.isArray(e2.selected)?e2.selected:p2,h2=e2.showCancelled===true;if(d2.length===0)return null;let g2=e3=>{let t2=new FormData(e3);return{selected:t2.getAll(r2).map(String),showCancelled:t2.has(i2)}};return n("form",{className:y("core-calendar-filters",c2),style:l2,method:"get",action:"",onChange:e3=>{s2?s2(g2(e3.currentTarget)):typeof e3.currentTarget.requestSubmit=="function"&&e3.currentTarget.requestSubmit()},onSubmit:e3=>s2&&e3.preventDefault(),children:[Object.entries(a2??{}).map(([e3,n2])=>t("input",{type:"hidden",name:e3,value:n2},e3)),n("fieldset",{className:"core-calendar-filters__set",children:[t("legend",{className:"core-calendar-filters__legend",children:o2}),d2.map((e3,i3)=>n("label",{className:"core-calendar-filters__option",children:[t("input",{type:"checkbox",name:r2,value:e3.id,defaultChecked:m2.includes(e3.id)}),t(Gi,{series:Wi(e3.series??i3+1)}),t("span",{className:"core-calendar-filters__label",children:e3.label})]},e3.id)),n("label",{className:"core-calendar-filters__option core-calendar-filters__option--cancelled",children:[t("input",{type:"checkbox",name:i2,value:"1",defaultChecked:h2}),t("span",{className:"core-calendar-filters__label",children:"Cancelled"})]})]}),t("button",{type:"submit",className:"core-calendar-filters__apply",id:`${f2}-apply`,children:"Apply"})]})}var $i=(e2,t2,n2)=>`?${new URLSearchParams({...e2??{},[t2]:n2}).toString()}`,ea=(e2,t2)=>{let[n2,r2]=e2.split("-").map(Number),i2=new Date(Date.UTC(n2,r2-1+t2,1));return`${i2.getUTCFullYear()}-${String(i2.getUTCMonth()+1).padStart(2,"0")}`};function ta({month:e2,date:r2,highlight:i2="week",occurrences:a2,weekStartsOn:o2=1,param:s2="date",monthParam:c2="month",keep:l2,locale:u2,timeZone:d2,now:f2,className:p2,style:g2}){let _2=f2===void 0?Date.now():typeof f2=="number"?f2:new Date(f2).getTime(),v2=Ni(Number.isFinite(_2)?_2:Date.now(),d2)?.date??"1970-01-01",b2=r2&&/^\d{4}-\d{2}-\d{2}$/.test(r2)?r2:v2,x2=e2&&/^\d{4}-\d{2}$/.test(e2)?e2:b2.slice(0,7),S2=`${x2}-01`,C2=Ri(S2,o2)[0],w2=Array.from({length:42},(e3,t2)=>Q(C2,t2)),T2=Array.from({length:6},(e3,t2)=>w2.slice(t2*7,t2*7+7)),E2=i2==="week"?new Set(Ri(b2,o2)):new Set([b2]),D2=Array.isArray(a2)?a2:[],O2=new Map(w2.map(e3=>{let t2=Ii(D2,e3,{timeZone:d2,minMinutes:0});return[e3,t2.blocks.length+t2.allDay.length]})),k2=(e3,t2)=>new Intl.DateTimeFormat(u2,{...e3,timeZone:"UTC"}).format(new Date(`${t2}T00:00:00Z`)),A2=k2({month:"long",year:"numeric"},S2),j2=T2[0].map(e3=>({short:k2({weekday:"narrow"},e3),long:k2({weekday:"long"},e3)})),M2=w2.includes(b2)?b2:w2.includes(v2)?v2:S2,[N2,P2]=h(null),F2=N2&&w2.includes(N2)?N2:M2,I2=m(null),L2=e3=>{w2.includes(e3)&&(P2(e3),I2.current?.querySelector(`[data-date="${e3}"]`)?.focus())};return n("div",{className:y("core-mini-month",p2),style:g2,children:[n("div",{className:"core-mini-month__head",children:[t("a",{className:"core-mini-month__step","data-step":"prev",href:$i(l2,c2,ea(x2,-1)),"aria-label":"Previous month",children:"‹"}),t("div",{className:"core-mini-month__title",id:`mm-${x2}`,"aria-live":"polite",children:A2}),t("a",{className:"core-mini-month__step","data-step":"next",href:$i(l2,c2,ea(x2,1)),"aria-label":"Next month",children:"›"})]}),n("div",{ref:I2,role:"grid","aria-labelledby":`mm-${x2}`,className:"core-mini-month__grid",onKeyDown:e3=>{let t2=e3.target.closest("[data-date]")?.dataset.date;if(!t2)return;let n2=T2.find(e4=>e4.includes(t2)),r3={ArrowLeft:Q(t2,-1),ArrowRight:Q(t2,1),ArrowUp:Q(t2,-7),ArrowDown:Q(t2,7),Home:n2[0],End:n2[6]};r3[e3.key]?(e3.preventDefault(),L2(r3[e3.key])):(e3.key==="PageUp"||e3.key==="PageDown")&&(e3.preventDefault(),I2.current?.parentElement?.querySelector(`a[data-step="${e3.key==="PageUp"?"prev":"next"}"]`)?.click())},children:[t("div",{role:"row",className:"core-mini-month__row core-mini-month__row--head",children:j2.map((e3,n2)=>t("span",{role:"columnheader","aria-label":e3.long,className:"core-mini-month__weekday",children:e3.short},n2))}),T2.map(e3=>t("div",{role:"row",className:"core-mini-month__row",children:e3.map(e4=>{let r3=O2.get(e4)??0,i3=`${k2({weekday:"long",month:"long",day:"numeric"},e4)}${e4===v2?", today":""}${r3?`, ${r3} ${r3===1?"event":"events"}`:""}`;return t("span",{role:"gridcell","aria-selected":e4===b2,className:"core-mini-month__cell","data-range":E2.has(e4)||void 0,"data-outside":e4.slice(0,7)!==x2||void 0,children:n("a",{className:"core-mini-month__day",href:$i(l2,s2,e4),"data-date":e4,"data-today":e4===v2||void 0,"data-selected":e4===b2||void 0,"aria-current":e4===b2?"date":void 0,"aria-label":i3,tabIndex:e4===F2?0:-1,onFocus:()=>P2(e4),children:[t("span",{"aria-hidden":"true",children:Number(e4.slice(8))}),t("span",{className:"core-mini-month__dot","aria-hidden":"true","data-has":r3>0||void 0})]})},e4)})},e3[0]))]})]})}var na=(e2,t2,n2)=>`?${new URLSearchParams({...n2??{},[e2]:t2}).toString()}`;function ra({date:e2,occurrences:r2,weekStartsOn:i2=1,param:a2="date",steps:o2=true,keep:s2,locale:c2,timeZone:l2,now:u2,className:d2,style:f2}){let p2=u2===void 0?Date.now():typeof u2=="number"?u2:new Date(u2).getTime(),m2=Ni(Number.isFinite(p2)?p2:Date.now(),l2)?.date??"1970-01-01",h2=e2&&/^\d{4}-\d{2}-\d{2}$/.test(e2)?e2:m2,g2=Ri(h2,i2),_2=Array.isArray(r2)?r2:[],v2=new Intl.DateTimeFormat(c2,{weekday:"short",timeZone:"UTC"}),b2=new Intl.DateTimeFormat(c2,{weekday:"long",month:"long",day:"numeric",timeZone:"UTC"}),x2=e3=>new Date(`${e3}T00:00:00Z`),S2=new Map(g2.map(e3=>{let t2=Ii(_2,e3,{timeZone:l2});return[e3,t2.blocks.length+t2.allDay.length]}));return t("nav",{className:y("core-week-strip",d2),style:f2,"aria-label":"Week",children:n("div",{className:"core-week-strip__frame",children:[o2?t("a",{className:"core-week-strip__step",href:na(a2,Q(h2,-7),s2),"aria-label":"Previous week",children:"‹"}):null,t("ol",{className:"core-week-strip__days",children:g2.map(e3=>{let r3=S2.get(e3)??0;return t("li",{children:n("a",{className:"core-week-strip__day",href:na(a2,e3,s2),"aria-current":e3===h2?"date":void 0,"aria-label":`${b2.format(x2(e3))}${e3===m2?", today":""}${r3?`, ${r3} ${r3===1?"event":"events"}`:""}`,"data-selected":e3===h2||void 0,"data-today":e3===m2||void 0,children:[t("span",{className:"core-week-strip__weekday","aria-hidden":"true",children:v2.format(x2(e3))}),t("span",{className:"core-week-strip__date","aria-hidden":"true",children:Number(e3.slice(8))}),t("span",{className:"core-week-strip__mark","aria-hidden":"true","data-has":r3>0||void 0})]})},e3)})}),o2?t("a",{className:"core-week-strip__step",href:na(a2,Q(h2,7),s2),"aria-label":"Next week",children:"›"}):null]})})}var ia=[["day","Day"],["week","Week"],["agenda","Agenda"]];function aa(r2){let{weekStartsOn:i2=1,viewParam:a2="view",dateParam:o2="date",eventHref:s2,newEventHref:c2,summary:l2,notice:u2,startHour:d2,endHour:f2,locale:p2,timeZone:m2,className:h2,style:g2}=r2,_2=r2.view==="day"||r2.view==="agenda"?r2.view:"week",v2=Array.isArray(r2.occurrences)?r2.occurrences:[],b2=r2.now===void 0?Date.now():typeof r2.now=="number"?r2.now:new Date(r2.now).getTime(),x2=Ni(Number.isFinite(b2)?b2:Date.now(),m2)?.date??"1970-01-01",S2=r2.date&&/^\d{4}-\d{2}-\d{2}$/.test(r2.date)?r2.date:x2,C2=(e2,t2)=>`?${new URLSearchParams({[a2]:e2,[o2]:t2}).toString()}`,w2=_2==="day"?1:7,T2=Bi(c2),E2=(e2,t2)=>new Intl.DateTimeFormat(p2,{...e2,timeZone:"UTC"}).format(new Date(`${t2}T00:00:00Z`)),D2=Ri(S2,i2),O2=_2==="day"?E2({weekday:"long",month:"long",day:"numeric"},S2):`${E2({month:"short",day:"numeric"},D2[0])} – ${E2({month:"short",day:"numeric",year:"numeric"},D2[6])}`,k2=(e2,n2)=>t(Xi,{columns:e2,label:n2,eventHref:s2,startHour:d2,endHour:f2,locale:p2,timeZone:m2,now:r2.now}),A2=e2=>({id:e2,date:e2,label:`${E2({weekday:"short"},e2)} ${Number(e2.slice(8))}`,sublabel:e2===x2?"Today":void 0,events:v2}),j2=D2.map(e2=>({...A2(e2),href:C2("day",e2)}));return n("section",{className:y("core-calendar","core-calendar-view",h2),style:g2,"aria-label":"Schedule","data-view":_2,children:[n("header",{className:"core-calendar__head",children:[t("h2",{className:"core-calendar__title",children:O2}),n("nav",{className:"core-calendar__nav","aria-label":"Calendar",children:[_2==="agenda"?null:t("a",{className:"core-calendar__step",href:C2(_2,Q(S2,-w2)),"aria-label":_2==="day"?"Previous day":"Previous week",children:"‹"}),t("a",{className:"core-calendar__today",href:C2(_2,x2),"aria-current":S2===x2||D2.includes(x2)?"date":void 0,children:"Today"}),_2==="agenda"?null:t("a",{className:"core-calendar__step",href:C2(_2,Q(S2,w2)),"aria-label":_2==="day"?"Next day":"Next week",children:"›"})]}),t("nav",{className:"core-calendar__views","aria-label":"View",children:ia.map(([e2,n2])=>t("a",{className:"core-calendar__view",href:C2(e2,S2),"aria-current":e2===_2?"page":void 0,children:n2},e2))}),T2?t("a",{className:"core-calendar__new",href:T2,children:"New event"}):null]}),l2?t("p",{className:"core-calendar__summary",children:l2}):null,u2?t("div",{className:"core-calendar__notice",children:u2}):null,_2==="day"?k2([A2(S2)],E2({weekday:"long",month:"long",day:"numeric"},S2)):null,_2==="week"?n(e,{children:[t("div",{className:"core-calendar__wide",children:k2(j2,`Week of ${E2({month:"long",day:"numeric"},D2[0])}`)}),n("div",{className:"core-calendar__narrow",children:[t(ra,{date:S2,occurrences:v2,weekStartsOn:i2,param:o2,steps:false,keep:{[a2]:"week"},locale:p2,timeZone:m2,now:r2.now}),k2([A2(S2)],E2({weekday:"long",month:"long",day:"numeric"},S2))]})]}):null,_2==="agenda"?t(Oi,{label:"Agenda",occurrences:v2,view:"agenda",weekOf:S2,weekParam:o2,linkParams:{[a2]:"agenda"},eventHref:s2,locale:p2,timeZone:m2}):null]})}function $(e2){if(typeof e2!="string")return;let t2=e2.replace(/\s+/g," ").trim();if(t2!=="")return t2.length>60?`${t2.slice(0,59)}…`:t2}var oa="This can’t be done from here yet.";function sa(e2){let[t2,n2]=h(null),[r2,i2]=h(""),a2=m(false),o2=typeof e2=="function";return{run:s(async(t3,r3)=>{if(typeof e2!="function"||a2.current)return{ok:false};a2.current=true,n2(t3),i2("");try{let n3=await e2(r3?{action:t3,values:r3}:{action:t3});return n3&&typeof n3=="object"&&n3.success===false?(i2(gi(n3)||"Something went wrong. Try again."),{ok:false,result:n3}):{ok:true,result:n3}}catch{return i2("Something went wrong. Try again."),{ok:false}}finally{a2.current=false,n2(null)}},[e2]),busy:t2,message:r2,available:o2,clearMessage:()=>i2("")}}var ca=[5,10,15,20,30,45,60,90],la={line:300,note:2e3,attendees:20,attendee:80},ua=(e2,t2)=>typeof e2=="string"?e2.slice(0,t2):"",da=e2=>e2.split(/[,\n]/).map(e3=>e3.trim()).filter(Boolean);function fa(e2){if(!e2)return hi();let t2=new Date(e2);return Number.isNaN(t2.getTime())?hi():(t2.setMinutes(t2.getMinutes()-t2.getTimezoneOffset()),t2.toISOString().slice(0,16))}function pa(e2){let{canWriteStaffNotes:r2=false,onIntent:i2,className:a2,style:o2}=e2,s2=$(e2.subjectName),c2=Array.isArray(e2.types)?e2.types.filter(e3=>e3&&typeof e3.id=="string"):[],d2=e2.prefill&&typeof e2.prefill=="object"?e2.prefill:{},f2=u(),{run:p2,busy:g2,message:_2,available:v2}=sa(i2),[b2,x2]=h(c2.find(e3=>e3.id===d2.typeId)?.id??c2[0]?.id??""),[S2,C2]=h(fa(d2.startsAt)),[w2,T2]=h(typeof d2.durationMin=="number"&&d2.durationMin>0?String(Math.round(d2.durationMin)):""),[E2,D2]=h(Array.isArray(d2.attendees)?d2.attendees.filter(e3=>typeof e3=="string").slice(0,la.attendees).map(e3=>ua(e3,la.attendee)).join(", "):""),[O2,k2]=h(ua(d2.outcome,la.line)),[A2,j2]=h(ua(d2.followUp,la.line)),[M2,N2]=h(ua(d2.note,la.note)),[P2,F2]=h(r2),[I2,L2]=h(null),R2=m(null);l(()=>{I2&&R2.current?.focus({preventScroll:true})},[I2]);let z2=I2??(e2.logged&&typeof e2.logged=="object"?e2.logged:null);if(z2){let e3=Bi(z2.href);return n("div",{ref:R2,tabIndex:-1,role:"group","aria-labelledby":`${f2}-status`,className:y("core-intent-card","core-log-card",a2),style:o2,"data-state":"logged",children:[n("div",{className:"core-intent-card__head",children:[n("span",{id:`${f2}-status`,className:"core-intent-card__eyebrow",children:["Logged",s2?` · ${s2}`:""]}),t("p",{className:"core-intent-card__title",children:z2.name??"Logged"})]}),e3?t("a",{className:"core-log-card__go",href:e3,children:"Go to event"}):null]})}if(c2.length===0)return t("p",{className:y("core-intent-card","core-log-card","core-log-card__empty",a2),style:o2,children:"There’s nothing you can log here."});let B2=c2.find(e3=>e3.id===b2),ee2=v2&&g2===null,te2=v2&&!!s2&&!!B2&&!!S2,V2=v2?s2?"":"Choose who this is about before logging.":oa,H2=async e3=>{if(e3.preventDefault(),!te2||g2!==null||!B2)return;let t2={typeId:B2.id,startsAt:mi(S2),tzid:pi()};w2&&(t2.durationMin=Number(w2)),da(E2).length&&(t2.attendees=da(E2)),O2.trim()&&(t2.outcome=O2.trim()),A2.trim()&&(t2.followUp=A2.trim()),M2.trim()&&(t2.note=M2.trim(),t2.staffOnly=r2&&P2);let{ok:n2,result:i3}=await p2("log_event",t2);n2&&L2({name:B2.name,href:i3&&typeof i3=="object"?i3.data?.href:void 0})},U2=!ee2;return n("form",{className:y("core-intent-card","core-log-card",a2),style:o2,"data-state":v2?"editing":"display",onSubmit:e3=>void H2(e3),"aria-busy":g2!==null||void 0,children:[n("div",{className:"core-intent-card__head",children:[t("span",{className:"core-intent-card__eyebrow",children:"Log"}),t("p",{className:"core-intent-card__title",children:s2??"Who is this about?"})]}),n("div",{className:"core-intent-card__row",children:[n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"Type"}),t("select",{value:b2,disabled:U2,onChange:e3=>x2(e3.target.value),children:c2.map(e3=>t("option",{value:e3.id,children:e3.name},e3.id))})]}),n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"When"}),t("input",{type:"datetime-local",required:true,value:S2,readOnly:U2,onChange:e3=>C2(e3.target.value)})]})]}),n("div",{className:"core-intent-card__row",children:[n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"How long"}),n("select",{value:w2,disabled:U2,onChange:e3=>T2(e3.target.value),children:[t("option",{value:"",children:"—"}),[...new Set([...ca,...w2?[Number(w2)]:[]])].sort((e3,t2)=>e3-t2).map(e3=>t("option",{value:e3,children:`${e3} min`},e3))]})]}),n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"Who attended"}),t("input",{value:E2,maxLength:la.attendees*(la.attendee+2),readOnly:U2,placeholder:"Names, separated by commas",onChange:e3=>D2(e3.target.value)})]})]}),n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"Outcome"}),t("input",{value:O2,maxLength:la.line,readOnly:U2,onChange:e3=>k2(e3.target.value)})]}),n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"Follow-up"}),t("input",{value:A2,maxLength:la.line,readOnly:U2,onChange:e3=>j2(e3.target.value)})]}),n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"Note"}),t("textarea",{rows:Math.min(10,Math.max(2,M2.split("\n").length+Math.floor(M2.length/40))),maxLength:la.note,value:M2,readOnly:U2,onChange:e3=>N2(e3.target.value)})]}),r2&&M2.trim()?n("label",{className:"core-log-card__check",children:[t("input",{type:"checkbox",checked:P2,disabled:U2,onChange:e3=>F2(e3.target.checked)}),t("span",{children:"Staff only: the client won’t see this note"})]}):null,_2?t("p",{id:`${f2}-message`,className:"core-intent-card__message",role:"alert",children:_2}):null,t("p",{className:"core-intent-card__does",id:`${f2}-does`,children:te2?`Log saves this to ${s2}’s file.`:V2}),t("div",{className:"core-intent-card__actions",children:t("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!te2||g2!==null,"aria-describedby":`${f2}-does`,children:g2==="log_event"?"Logging…":"Log"})})]})}var ma=250,ha=500,ga=(e2,t2)=>{let n2=t2.trim().toLowerCase();return n2===""||e2.label.toLowerCase().includes(n2)||!!e2.description?.toLowerCase().includes(n2)};function _a({label:e2,options:t2,loadOptions:n2,value:r2,defaultValue:i2="",onValueChange:a2,onSelect:o2,orientation:c2="vertical",debounceMs:d2=150,minChars:p2=0,closeOnSelect:g2=true,fillOnSelect:_2=false,openOnFocus:v2=false,defaultOpen:y2=false,emptyText:b2="No results",errorText:x2="Could not load results"}){let S2=u(),C2=`${S2}-list`,[w2,T2]=h(i2),E2=r2??w2,[D2,O2]=h(y2),[k2,A2]=h(y2),[j2,M2]=h([]),[N2,P2]=h("idle"),[F2,I2]=h(null),[L2,R2]=h(""),z2=m(0),B2=m({onValueChange:a2,onSelect:o2,loadOptions:n2});B2.current={onValueChange:a2,onSelect:o2,loadOptions:n2};let ee2=f(()=>n2?j2:(t2??[]).filter(e3=>ga(e3,E2)),[n2,j2,t2,E2]),te2=!!n2,V2=E2.trim().length>=p2,H2=V2?ee2:[];l(()=>{if(!te2||!D2)return;if(!V2){z2.current+=1,M2([]),P2("idle");return}let e3=++z2.current,t3=new AbortController;P2("loading");let n3=setTimeout(()=>{B2.current.loadOptions?.(E2,t3.signal).then(t4=>{e3===z2.current&&(M2(t4),P2(t4.length?"ready":"empty"))},t4=>{e3===z2.current&&t4?.name!=="AbortError"&&(M2([]),P2("error"))})},d2);return()=>{clearTimeout(n3),t3.abort()}},[E2,D2,V2,te2,d2]);let U2=te2?N2:!D2||!V2?"idle":H2.length?"ready":"empty";l(()=>{F2!==null&&!H2.some(e3=>e3.id===F2)&&I2(null)},[H2,F2]),l(()=>{if(!k2||U2==="idle"){R2("");return}let e3=E2.trim().slice(0,60),t3=U2==="loading"?"Loading results":U2==="error"?x2.split("{query}").join(e3):U2==="empty"?b2.split("{query}").join(e3):`${H2.length} ${H2.length===1?"result":"results"}`,n3=setTimeout(()=>R2(t3),U2==="loading"?ha:ma);return()=>clearTimeout(n3)},[U2,H2.length,k2,E2,b2,x2]);let ne2=s(e3=>{r2===void 0&&T2(e3),B2.current.onValueChange?.(e3)},[r2]),re2=s(()=>{A2(false),I2(null)},[]),ie2=s(e3=>{e3.disabled||(_2&&ne2(e3.label),B2.current.onSelect?.(e3),g2&&re2())},[_2,ne2,g2,re2]),ae2=e3=>`${S2}-opt-${e3.id}`,oe2=k2&&H2.length>0,se2=oe2?H2.find(e3=>e3.id===F2):void 0,ce2=e3=>{if(H2.length===0)return;let t3=H2.filter(e4=>!e4.disabled);if(t3.length===0)return;let n3=t3.findIndex(e4=>e4.id===F2),r3=n3<0?e3===1?0:t3.length-1:(n3+e3+t3.length)%t3.length;I2(t3[r3].id)};return{options:H2,status:U2,statusText:L2,open:oe2,activeId:F2,close:re2,inputProps:{role:"combobox","aria-label":e2,"aria-expanded":oe2,"aria-controls":C2,"aria-autocomplete":"list","aria-activedescendant":se2?ae2(se2):void 0,autoComplete:"off",value:E2,onChange:e3=>{O2(true),A2(true),I2(null),ne2(e3.target.value)},onKeyDown:e3=>{if(e3.nativeEvent.isComposing||e3.altKey||e3.ctrlKey||e3.metaKey)return;let t3=c2==="horizontal"?"ArrowRight":"ArrowDown",n3=c2==="horizontal"?"ArrowLeft":"ArrowUp";e3.key==="ArrowDown"||e3.key==="ArrowUp"?(e3.preventDefault(),O2(true),k2?ce2(e3.key==="ArrowDown"?1:-1):A2(true)):(e3.key===t3||e3.key===n3)&&oe2&&se2?(e3.preventDefault(),ce2(e3.key===t3?1:-1)):e3.key==="Enter"&&se2?(e3.preventDefault(),ie2(se2)):e3.key==="Escape"&&k2?(e3.preventDefault(),e3.stopPropagation(),re2()):e3.key==="Tab"&&re2()},onFocus:()=>{v2&&(O2(true),A2(true))},onBlur:()=>re2()},listboxProps:{id:C2,role:"listbox","aria-label":e2,"aria-orientation":c2},statusProps:{role:"status","aria-live":"polite","aria-atomic":true},getOptionProps:e3=>({id:ae2(e3),role:"option","aria-selected":e3.id===se2?.id,"aria-disabled":e3.disabled||void 0,"data-active":e3.id===se2?.id?"":void 0,onPointerDown:e4=>e4.preventDefault(),onClick:()=>ie2(e3)}),query:E2}}function va({text:r2,match:i2}){let a2=i2?r2.toLowerCase().indexOf(i2.trim().toLowerCase()):-1;if(a2<0||!i2.trim())return t(e,{children:r2});let o2=a2+i2.trim().length;return n(e,{children:[r2.slice(0,a2),t("mark",{className:"core-combobox__match",children:r2.slice(a2,o2)}),r2.slice(o2)]})}function ya({placeholder:r2,emptyText:i2="No results",errorText:a2="Could not load results",renderOption:o2,className:s2,style:c2,...d2}){let f2=_a({...d2,emptyText:i2,errorText:a2}),p2=f2.query.trim().slice(0,60),h2=m(null),g2=d2.orientation==="horizontal",_2=u(),v2=[];for(let e2 of f2.options){let t2=g2?void 0:e2.group,n2=v2[v2.length-1];n2&&n2.group===t2?n2.options.push(e2):v2.push({group:t2,options:[e2]})}l(()=>{f2.activeId!==null&&h2.current?.querySelector("[data-active]")?.scrollIntoView({block:"nearest",inline:"nearest"})},[f2.activeId]);let b2=f2.status==="empty"?i2.split("{query}").join(p2):f2.status==="error"?a2.split("{query}").join(p2):f2.status==="loading"?"Loading…":null;return n("div",{className:y("core-combobox",s2),style:c2,"data-orientation":d2.orientation??"vertical","data-status":f2.status,children:[t("input",{...f2.inputProps,type:"text",className:"core-combobox__input",placeholder:r2}),t("ul",{ref:h2,...f2.listboxProps,className:"core-combobox__list",hidden:!f2.open,children:v2.map((r3,i3)=>{let a3=r3.options.map(r4=>t("li",{...f2.getOptionProps(r4),className:"core-combobox__option",children:o2?o2(r4,f2.query):n(e,{children:[t("span",{className:"core-combobox__label",children:t(va,{text:r4.label,match:r4.highlight??f2.query})}),r4.description?t("span",{className:"core-combobox__description",children:r4.description}):null]})},r4.id));return r3.group?n("li",{role:"presentation",className:"core-combobox__section",children:[t("span",{id:`${_2}-${i3}`,className:"core-combobox__heading",children:r3.group}),t("ul",{role:"group","aria-labelledby":`${_2}-${i3}`,className:"core-combobox__group",children:a3})]},`g${i3}`):a3})}),b2&&!f2.open?t("p",{className:"core-combobox__note","data-status":f2.status,"aria-hidden":"true",children:b2}):null,t("span",{...f2.statusProps,className:"core-combobox__status",children:f2.statusText})]})}var ba=["saved","assigned","event","archived","discarded","unavailable"],xa=6e3;function Sa(r2){let{locale:i2,timeZone:a2,searchTargets:o2,onIntent:s2,className:c2,style:d2}=r2,f2=r2.note&&typeof r2.note=="object"&&(r2.note.state==="unavailable"||typeof r2.note.body=="string")?r2.note:null,p2=u(),{run:g2,busy:_2,message:v2,available:b2}=sa(s2),[x2,S2]=h(null),C2=f2?.state&&ba.includes(f2.state)?f2.state:"saved",w2=x2&&C2==="saved"?x2:C2,[T2,E2]=h(false),D2=m(null),O2=m(null),k2=m(null);l(()=>()=>{D2.current&&clearTimeout(D2.current),O2.current?.()},[]),l(()=>{T2&&k2.current?.focus({preventScroll:true})},[T2]);let[A2,j2]=h(false),[M2,N2]=h(false),P2=m(null);l(()=>{M2&&P2.current?.focus({preventScroll:true})},[M2]);let[F2,I2]=h(void 0),[L2,R2]=h(false),z2=m(null);if(l(()=>{x2&&z2.current?.focus({preventScroll:true})},[x2]),!f2)return null;if(C2==="unavailable")return t("div",{role:"group","aria-label":"Note",className:y("core-intent-card","core-quick-note-card","core-note-card",c2),style:d2,"data-state":"unavailable",children:t("p",{className:"core-note-card__unavailable",children:"This note is no longer available"})});let B2=w2==="saved"&&!T2,ee2=f2.createdAt&&!Number.isNaN(new Date(f2.createdAt).getTime())?new Intl.DateTimeFormat(i2,{weekday:"short",hour:"numeric",minute:"2-digit",timeZone:a2}).format(new Date(f2.createdAt)):"",te2=Bi(f2.eventHref),V2=_2===null,H2=async e2=>{let{ok:t2}=await g2("assign",{targetId:e2.id,...A2?{keepPrivate:true}:{},...e2.data&&typeof e2.data=="object"&&"kind"in e2.data?{targetKind:e2.data.kind}:{}});t2&&(I2(e2.label),S2("assigned"),R2(false))},U2=async()=>{let{ok:e2}=await g2("make_event");e2&&S2("started")},ne2=()=>{let e2=async()=>{O2.current=null,D2.current=null;let{ok:e3}=await g2("archive");E2(false),e3&&S2("archived")};O2.current=()=>void e2(),D2.current=setTimeout(()=>void e2(),xa),E2(true)},re2=()=>{D2.current&&clearTimeout(D2.current),D2.current=null,O2.current=null,E2(false)},ie2=async()=>{let{ok:e2}=await g2("discard");N2(false),e2&&S2("discarded")},ae2=async()=>{let{ok:e2}=await g2("ask_instead");e2&&S2("asked")},oe2=T2?"Archived":B2?"Saved as note":w2==="asked"?"Sent to the assistant instead":w2==="assigned"?`Assigned${F2??f2.assignedToName?` to ${F2??f2.assignedToName}`:""}`:w2==="event"?"Made into an event":w2==="started"?"Event started below":w2==="discarded"?"Discarded":"Archived";return n("div",{ref:z2,tabIndex:-1,role:"group","aria-labelledby":`${p2}-status`,className:y("core-intent-card","core-quick-note-card","core-note-card",c2),style:d2,"data-state":T2?"archived":w2,"aria-busy":_2!==null||void 0,children:[n("div",{className:"core-intent-card__head",children:[t("span",{id:`${p2}-status`,className:"core-intent-card__eyebrow",children:oe2}),t("p",{className:"core-note-card__body",children:f2.body}),n("span",{className:"core-note-card__private",children:["Private",ee2?` · saved ${ee2}`:""]})]}),w2==="event"&&te2?t("a",{className:"core-note-card__go",href:te2,children:"Go to event"}):null,v2?t("p",{className:"core-intent-card__message",role:"alert",children:v2}):null,T2?t("div",{className:"core-intent-card__actions",children:t("button",{ref:k2,type:"button",className:"core-intent-card__button",onClick:re2,children:"Undo"})}):null,B2?n(e,{children:[L2&&o2?n("div",{className:"core-note-card__picker",children:[t(ya,{label:"Assign to a client or project",placeholder:"Search clients and projects",loadOptions:o2,onSelect:e2=>void H2(e2),defaultOpen:false}),n("label",{className:"core-note-card__private-check",children:[t("input",{type:"checkbox",checked:A2,disabled:!V2,onChange:e2=>j2(e2.target.checked)}),t("span",{children:"Keep this note private"})]})]}):null,t("p",{className:"core-intent-card__does",id:`${p2}-does`,children:(e2=>b2?e2:oa)("Assign moves this note to the client or project you choose. Make event turns it into an event. Archive takes it out of Needs me, and you can undo it for a few seconds. Discard deletes it for good.")}),n("div",{className:"core-intent-card__actions",children:[t("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!b2||!o2||!V2,"aria-expanded":L2,"aria-describedby":`${p2}-does`,onClick:()=>R2(e2=>!e2),children:"Assign"}),t("button",{type:"button",className:"core-intent-card__button",disabled:!b2||!V2,"aria-describedby":`${p2}-does`,onClick:()=>void U2(),children:"Make event"}),t("button",{type:"button",className:"core-intent-card__button",disabled:!b2||!V2,"aria-describedby":`${p2}-does`,onClick:ne2,children:"Archive"}),t("button",{type:"button",className:"core-intent-card__button",disabled:!b2||!V2,"aria-describedby":`${p2}-does`,onClick:()=>N2(true),children:"Discard"})]}),M2?n("div",{className:"core-note-card__confirm",role:"group","aria-label":"Discard this note",children:[t("p",{className:"core-intent-card__does",children:"Discard this note? It can’t be brought back from here."}),n("div",{className:"core-intent-card__actions",children:[t("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!V2,onClick:()=>void ie2(),children:_2==="discard"?"Discarding…":"Yes, discard"}),t("button",{ref:P2,type:"button",className:"core-intent-card__button",disabled:!V2,onClick:()=>N2(false),children:"Cancel"})]})]}):null,t("button",{type:"button",className:"core-note-card__instead",disabled:!b2||!V2,onClick:()=>void ae2(),children:"Ask the assistant instead"})]}):null]})}var Ca=["proposed","created","done"],wa=200,Ta=(e2,t2)=>!e2||!/^\d{4}-\d{2}-\d{2}$/.test(e2)?"":new Intl.DateTimeFormat(t2,{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(`${e2}T00:00:00Z`));function Ea(r2){let{locale:i2,onIntent:a2,className:o2,style:s2}=r2,c2=$(r2.subjectName),d2=r2.task&&typeof r2.task=="object"&&typeof r2.task.title=="string"?r2.task:null,f2=u(),{run:p2,busy:g2,message:_2,available:v2}=sa(a2),[b2,x2]=h((d2?.title??"").slice(0,wa)),[S2,C2]=h(d2?.dueOn&&/^\d{4}-\d{2}-\d{2}$/.test(d2.dueOn)?d2.dueOn:""),[w2,T2]=h(null),E2=d2?.state&&Ca.includes(d2.state)?d2.state:"proposed",D2=w2&&Ca.indexOf(w2)>Ca.indexOf(E2)?w2:E2,O2=m(null),k2=m(null),[A2,j2]=h(false);if(l(()=>{A2&&k2.current?.focus({preventScroll:true})},[A2]),l(()=>{w2&&O2.current?.focus({preventScroll:true})},[w2]),!d2)return null;let M2=D2==="proposed"&&v2&&g2===null,N2=v2&&!!c2&&b2.trim()!=="",P2=async e2=>{if(e2.preventDefault(),!N2||g2!==null)return;let{ok:t2}=await p2("log_event",{title:b2.trim(),...S2?{dueOn:S2}:{}});t2&&T2("created")},F2=async()=>{let{ok:e2}=await p2("complete");j2(false),e2&&T2("done")},I2=Ta(D2==="proposed"?S2:d2.dueOn,i2),L2=D2==="proposed"?"Task · suggested":D2==="done"?"Task · done":"Task",R2=D2==="proposed"?N2?`Create task adds this to ${c2}’s tasks.`:v2?c2?"":"Choose whose file this goes in first.":oa:D2==="created"?A2?"Mark this task done? It can’t be reopened from here.":"Mark done closes this task.":"";return n("form",{ref:O2,tabIndex:-1,"aria-labelledby":`${f2}-status`,className:y("core-intent-card","core-task-card",o2),style:s2,"data-state":D2,onSubmit:e2=>void P2(e2),"aria-busy":g2!==null||void 0,children:[n("div",{className:"core-intent-card__head",children:[n("span",{id:`${f2}-status`,className:"core-intent-card__eyebrow",children:[L2,c2?` · ${c2}`:""]}),D2==="proposed"?n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"What needs doing"}),t("input",{value:b2,maxLength:wa,readOnly:!M2,onChange:e2=>x2(e2.target.value),required:true})]}):t("p",{className:"core-intent-card__title core-task-card__title","data-done":D2==="done"?"":void 0,children:d2.title})]}),D2==="proposed"?n("label",{className:"core-intent-card__field",children:[t("span",{className:"core-intent-card__label",children:"Due"}),t("input",{type:"date",value:S2,readOnly:!M2,onChange:e2=>C2(e2.target.value)})]}):null,t("p",{className:"core-task-card__meta",children:[I2?`Due ${I2}`:"",d2.assigneeName?`For ${d2.assigneeName}`:""].filter(Boolean).join(" · ")||(D2==="proposed"?"":"No due date")}),_2?t("p",{className:"core-intent-card__message",role:"alert",children:_2}):null,R2?t("p",{className:"core-intent-card__does",id:`${f2}-does`,children:R2}):null,D2==="done"?null:t("div",{className:"core-intent-card__actions",children:D2==="proposed"?t("button",{type:"submit",className:"core-intent-card__button","data-primary":"",disabled:!N2||g2!==null,"aria-describedby":`${f2}-does`,children:g2==="log_event"?"Creating…":"Create task"}):A2?n(e,{children:[t("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:g2!==null,onClick:()=>void F2(),children:g2==="complete"?"Saving…":"Yes, mark done"}),t("button",{ref:k2,type:"button",className:"core-intent-card__button",disabled:g2!==null,onClick:()=>j2(false),children:"Cancel"})]}):t("button",{type:"button",className:"core-intent-card__button",disabled:!v2||g2!==null,"aria-describedby":`${f2}-does`,onClick:()=>j2(true),children:"Mark done"})})]})}function Da(r2){let{locale:i2,timeZone:a2,onIntent:o2,className:s2,style:c2}=r2,d2=$(r2.scopeName),f2=u(),{run:p2,busy:g2,message:_2,available:v2}=sa(o2),[b2,x2]=h(null),S2=m(null);if(l(()=>{b2&&S2.current?.focus({preventScroll:true})},[b2]),!d2)return null;let C2=r2.pointer&&typeof r2.pointer=="object"?r2.pointer:void 0,w2="";if(C2?.kind==="conversation"){let e2=typeof C2.at=="string"?new Date(C2.at):null;w2=e2&&!Number.isNaN(e2.getTime())?`Conversation · ${new Intl.DateTimeFormat(i2,{month:"short",day:"numeric",timeZone:a2}).format(e2)}`:"Conversation"}else C2?.kind==="event"&&(w2=$(C2.name)??"Event");let T2=g2===null,E2=async e2=>{let{ok:t2}=await p2(e2);t2&&x2(e2==="dismiss"?"dismissed":"continued")},D2=b2==="continued"?"Picked up":b2==="dismissed"?"Dismissed":"Pick up where you left off";return n("div",{ref:S2,tabIndex:-1,role:"group","aria-labelledby":`${f2}-status`,className:y("core-intent-card","core-handover-card",s2),style:c2,"data-state":b2??(v2?"offered":"display"),"aria-busy":g2!==null||void 0,children:[n("div",{className:"core-intent-card__head",children:[t("span",{id:`${f2}-status`,className:"core-intent-card__eyebrow",children:D2}),t("p",{className:"core-intent-card__title",children:d2}),w2?t("span",{className:"core-handover-card__where",children:w2}):null]}),_2?t("p",{className:"core-intent-card__message",role:"alert",children:_2}):null,b2?null:n(e,{children:[t("p",{className:"core-intent-card__does",id:`${f2}-does`,children:v2?`Continue opens your earlier conversation about ${d2}. Dismiss hides this.`:oa}),n("div",{className:"core-intent-card__actions",children:[t("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!v2||!T2,"aria-describedby":`${f2}-does`,onClick:()=>void E2("handover_continue"),children:g2==="handover_continue"?"Opening…":"Continue"}),t("button",{type:"button",className:"core-intent-card__button",disabled:!v2||!T2,"aria-describedby":`${f2}-does`,onClick:()=>void E2("dismiss"),children:"Dismiss"})]})]})]})}var Oa=12,ka=(e2,t2=200)=>typeof e2=="string"?e2.replace(/\s+/g," ").trim().slice(0,t2):"";function Aa(r2){let{typicalTime:i2,typicalCost:a2,costCap:o2,onIntent:s2,className:c2,style:d2}=r2,f2=$(r2.processName),p2=$(r2.subjectName),g2=u(),{run:_2,busy:v2,message:b2,available:x2}=sa(s2),[S2,C2]=h(false),w2=m(null);if(l(()=>{S2&&w2.current?.focus({preventScroll:true})},[S2]),!f2)return null;let T2=ka(r2.description),E2=(Array.isArray(r2.needs)?r2.needs:[]).filter(e2=>e2&&typeof e2=="object"&&ka(e2.label)).slice(0,Oa),D2=[i2&&`Typical time: ${ka(i2,60)}`,a2&&`Typical cost: ${ka(a2,60)}`,o2&&`Cost cap: ${ka(o2,60)}`].filter(Boolean).join(" · "),O2=r2.running&&typeof r2.running=="object"?r2.running:null,k2=Bi(O2?.href),A2=x2&&!!p2,j2=x2?p2?"":"Choose who this is for before starting.":oa,M2=S2?"Started":O2?"Running":"Start a service",N2=async()=>{if(!A2||v2!==null)return;let{ok:e2}=await _2("start_process");e2&&C2(true)};return n("div",{ref:w2,tabIndex:-1,role:"group","aria-labelledby":`${g2}-status`,className:y("core-intent-card","core-start-process-card",c2),style:d2,"data-state":S2?"started":O2?"running":x2?"offered":"display","aria-busy":v2!==null||void 0,children:[n("div",{className:"core-intent-card__head",children:[t("span",{id:`${g2}-status`,className:"core-intent-card__eyebrow",children:M2}),t("p",{className:"core-intent-card__title",children:f2}),p2?n("span",{className:"core-start-process-card__for",children:["For ",p2]}):null]}),T2?t("p",{className:"core-start-process-card__description",children:T2}):null,E2.length>0?n("div",{className:"core-start-process-card__needs",children:[t("span",{className:"core-start-process-card__label",children:"What it needs"}),t("ul",{children:E2.map((e2,r3)=>n("li",{"data-have":e2.have===true?"":void 0,children:[t("span",{className:"core-start-process-card__mark","aria-hidden":"true"}),t("span",{children:ka(e2.label)}),t("span",{className:"core-start-process-card__have",children:e2.have===true?"Have":"Needed"})]},r3))})]}):null,D2?t("p",{className:"core-start-process-card__meta",children:D2}):null,b2?t("p",{className:"core-intent-card__message",role:"alert",children:b2}):null,S2?t("p",{className:"core-intent-card__does",children:"Started. Progress will arrive in the conversation."}):O2?k2?t("a",{className:"core-start-process-card__go",href:k2,children:"Open"}):null:n(e,{children:[t("p",{className:"core-intent-card__does",id:`${g2}-does`,children:A2?`Start begins ${f2} for ${p2}. Nothing is shared with ${p2} until you choose to share it.`:j2}),t("div",{className:"core-intent-card__actions",children:t("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!A2||v2!==null,"aria-describedby":`${g2}-does`,onClick:()=>void N2(),children:v2==="start_process"?"Starting…":"Start"})})]})]})}var ja=12,Ma=8,Na=600;function Pa(r2){let{onIntent:i2,className:a2,style:o2}=r2,s2=u(),{run:c2,busy:d2,message:f2,available:p2}=sa(i2),[g2,_2]=h({}),[v2,b2]=h({}),[x2,S2]=h(null),C2=m(null),w2=m(false);l(()=>{w2.current&&C2.current?.focus({preventScroll:true})},[g2]);let T2=new Set,E2=(Array.isArray(r2.parts)?r2.parts:[]).filter(e2=>!e2||typeof e2!="object"||typeof e2.id!="string"||typeof e2.text!="string"||!e2.text.trim()||T2.has(e2.id)?false:(T2.add(e2.id),true)).slice(0,ja);if(E2.length===0)return null;let D2=e2=>(Array.isArray(e2.matches)?e2.matches:[]).filter(e3=>e3&&typeof e3.id=="string"&&$(e3.name)&&(e3.kind==="client"||e3.kind==="project")).slice(0,Ma),O2=e2=>g2[e2.id]??(e2.state==="assigned"||e2.state==="dropped"?{state:e2.state,name:$(e2.assignedToName)}:null),k2=E2.filter(e2=>!O2(e2)),A2=k2.length===0,j2=async(e2,t2)=>{S2(e2.id);let{ok:n2}=await c2("confirm_part",{partId:e2.id,targetId:t2.id,targetKind:t2.kind});n2&&(w2.current=true,_2(n3=>({...n3,[e2.id]:{state:"assigned",name:$(t2.name)}})))},M2=async e2=>{S2(e2.id);let{ok:t2}=await c2("drop_part",{partId:e2.id});t2&&(w2.current=true,_2(t3=>({...t3,[e2.id]:{state:"dropped"}})))},N2=d2===null;return n("div",{ref:C2,tabIndex:-1,role:"group","aria-labelledby":`${s2}-status`,className:y("core-intent-card","core-note-split-card",a2),style:o2,"data-state":A2?"sorted":p2?"open":"display","aria-busy":d2!==null||void 0,children:[n("div",{className:"core-intent-card__head",children:[t("span",{id:`${s2}-status`,className:"core-intent-card__eyebrow",children:A2?"Note sorted":"Note to sort"}),t("p",{className:"core-intent-card__title",children:A2?"Every part is sorted":`${k2.length} of ${E2.length} ${E2.length===1?"part":"parts"} to sort`})]}),t("ol",{className:"core-note-split-card__parts",children:E2.map((r3,i3)=>{let a3=O2(r3),o3=D2(r3),c3=v2[r3.id]??(o3.length===1?o3[0].id:""),l2=o3.find(e2=>e2.id===c3),u2=r3.text.length>Na?`${r3.text.slice(0,599)}…`:r3.text,m2=`Part ${i3+1}`;return n("li",{className:"core-note-split-card__part","data-state":a3?.state??"open",children:[t("span",{className:"core-note-split-card__label",children:m2}),t("p",{className:"core-note-split-card__text",children:u2}),a3?t("p",{className:"core-note-split-card__result",children:a3.state==="dropped"?"Dropped":`Assigned${a3.name?` to ${a3.name}`:""}`}):n(e,{children:[o3.length===0?t("p",{className:"core-note-split-card__hint",children:"No client or project matches. You can drop this part."}):o3.length===1?n("p",{className:"core-note-split-card__hint",children:["Looks like ",t("strong",{children:$(o3[0].name)}),o3[0].detail?` · ${$(o3[0].detail)}`:"",". Confirm it, or drop the part."]}):n("fieldset",{className:"core-note-split-card__choices",disabled:!p2||!N2,children:[n("legend",{className:"core-note-split-card__hint",children:[o3.length," match: choose who this is for."]}),o3.map(e2=>n("label",{className:"core-note-split-card__choice",children:[t("input",{type:"radio",name:`${s2}-${r3.id}`,value:e2.id,checked:c3===e2.id,onChange:()=>b2(t2=>({...t2,[r3.id]:e2.id}))}),n("span",{children:[t("span",{className:"core-note-split-card__name",children:$(e2.name)}),t("span",{className:"core-note-split-card__detail",children:[e2.kind==="project"?"Project":"Client",$(e2.detail)].filter(Boolean).join(" · ")})]})]},e2.id))]}),x2===r3.id&&f2?t("p",{className:"core-intent-card__message",role:"alert",children:f2}):null,n("div",{className:"core-intent-card__actions",children:[o3.length>0?t("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!p2||!N2||!l2,"aria-label":`Confirm ${m2}${l2?` for ${$(l2.name)}`:""}`,onClick:()=>l2&&void j2(r3,l2),children:d2==="confirm_part"&&x2===r3.id?"Confirming…":"Confirm"}):null,t("button",{type:"button",className:"core-intent-card__button",disabled:!p2||!N2,"aria-label":`Drop ${m2}`,onClick:()=>void M2(r3),children:"Drop"})]})]})]},r3.id)})}),A2?null:t("p",{className:"core-intent-card__does",children:p2?"Confirm sends that part to the client or project you choose. Drop leaves it out. The original note stays as the record.":oa})]})}var Fa=20;function Ia(r2){let{onIntent:i2,onCancel:a2,className:o2,style:s2}=r2,c2=r2.mode==="withdraw"?"withdraw":"share",d2=$(r2.clientName),f2=u(),{run:p2,busy:g2,message:_2,available:v2}=sa(i2),[b2,x2]=h(false),[S2,C2]=h(false),w2=m(null);l(()=>{S2&&w2.current?.focus({preventScroll:true})},[S2]);let T2=(Array.isArray(r2.items)?r2.items:[]).filter(e2=>e2&&typeof e2=="object"&&$(e2.name)).slice(0,Fa);if(T2.length===0)return null;let E2=c2==="share",D2=v2&&!!d2&&(!E2||b2),O2=v2?d2?E2&&!b2?"Tick “I’ve reviewed this” to share.":"":"Choose who this is for before sending.":oa,k2=E2?"Share":"Stop sharing",A2=S2?E2?"Shared":"Sharing stopped":E2?"Share for approval":"Stop sharing",j2=async()=>{if(!D2||g2!==null)return;let{ok:e2}=await p2(E2?"share":"withdraw",E2?{reviewed:true}:void 0);e2&&C2(true)};return n("div",{ref:w2,tabIndex:-1,role:"group","aria-labelledby":`${f2}-status`,className:y("core-intent-card","core-share-approval-card",o2),style:s2,"data-state":S2?"done":v2?"asking":"display","data-mode":c2,"aria-busy":g2!==null||void 0,children:[n("div",{className:"core-intent-card__head",children:[t("span",{id:`${f2}-status`,className:"core-intent-card__eyebrow",children:A2}),t("p",{className:"core-intent-card__title",children:d2?E2?`Share with ${d2}`:`Stop sharing with ${d2}`:E2?"Share with whom?":"Stop sharing with whom?"})]}),t("ul",{className:"core-share-approval-card__items",children:T2.map((e2,r3)=>n("li",{children:[t("span",{className:"core-share-approval-card__name",children:$(e2.name)}),$(e2.projectName)?t("span",{className:"core-share-approval-card__project",children:$(e2.projectName)}):null]},r3))}),_2?t("p",{className:"core-intent-card__message",role:"alert",children:_2}):null,S2?t("p",{className:"core-intent-card__does",children:E2?`${T2.length===1?"This is":"These are"} now shared with ${d2}.`:`${T2.length===1?"This is":"These are"} no longer shared with ${d2}.`}):n(e,{children:[t("p",{className:"core-intent-card__does",id:`${f2}-does`,children:d2?E2?`Sharing makes ${T2.length===1?"this":"these"} visible to ${d2} in their portal. You can stop sharing later.`:`Stop sharing takes ${T2.length===1?"this":"these"} out of ${d2}’s portal.`:O2}),E2?n("label",{className:"core-share-approval-card__review",children:[t("input",{type:"checkbox",checked:b2,disabled:!v2||g2!==null,onChange:e2=>x2(e2.target.checked)}),t("span",{children:"I’ve reviewed this"})]}):null,O2&&d2?t("p",{className:"core-share-approval-card__reason",id:`${f2}-reason`,children:O2}):null,n("div",{className:"core-intent-card__actions",children:[t("button",{type:"button",className:"core-intent-card__button","data-primary":"",disabled:!D2||g2!==null,"aria-describedby":`${f2}-does`,onClick:()=>void j2(),children:g2===null?k2:"Saving…"}),typeof a2=="function"?t("button",{type:"button",className:"core-intent-card__button",disabled:g2!==null,onClick:a2,children:"Not now"}):null]})]})]})}var La={save_as_note:{label:"Save as note",busy:"Saving…",done:"Saved as note"},make_follow_up:{label:"Make follow-up",busy:"Making…",done:"Follow-up made"}},Ra=["save_as_note","make_follow_up"];function za(e2){let{onIntent:r2,className:i2,style:a2}=e2,o2=Array.isArray(e2.actions)?Ra.filter(t2=>e2.actions.includes(t2)):Ra,s2=u(),{run:c2,busy:l2,message:d2,available:f2}=sa(r2),[p2,m2]=h(new Set);if(o2.length===0)return null;let g2=async e3=>{let{ok:t2}=await c2(e3);t2&&m2(t3=>new Set(t3).add(e3))};return n("div",{role:"group","aria-label":"Suggested actions",className:y("core-suggested-actions",i2),style:a2,"aria-busy":l2!==null||void 0,children:[t("div",{className:"core-suggested-actions__row",children:o2.map(e3=>{let n2=p2.has(e3);return t("button",{type:"button",className:"core-suggested-actions__chip","data-done":n2||void 0,disabled:!f2||l2!==null||n2,"aria-describedby":f2?void 0:`${s2}-does`,onClick:()=>void g2(e3),children:n2?La[e3].done:l2===e3?La[e3].busy:La[e3].label},e3)})}),d2?t("p",{className:"core-intent-card__message",role:"alert",children:d2}):null,f2?null:t("p",{id:`${s2}-does`,className:"core-suggested-actions__does",children:oa})]})}var Ba=new Set(["http:","https:","mailto:","tel:"]);function Va(e2){let t2=/^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(e2.replace(/[\u0000- ]/g,""));return t2?`${t2[1].toLowerCase()}:`:null}function Ha(e2){if(typeof e2!="string"||!e2.trim())return null;let t2=Va(e2.trim());return t2===null||Ba.has(t2)?e2.trim():(W(`unsafe-href:${t2}`,`Refused a link with the "${t2}" scheme; links are relative, http(s):, mailto: or tel:`),null)}function Ua(e2){if(typeof e2!="string"||!e2.trim())return null;let t2=e2.trim(),n2=Va(t2);return n2===null||n2==="https:"||n2==="data:"&&/^data:image\//i.test(t2.replace(/[\u0000- ]/g,""))?t2:(W(`unsafe-src:${n2}`,`Refused an image with the "${n2}" scheme; images are relative, https: or data:image/`),null)}var Wa=e2=>!!e2&&typeof e2=="object"&&typeof e2.label=="string"&&Ha(e2.href)!==null;function Ga(e2){return(Array.isArray(e2)?e2:e2?[e2]:[]).filter(Wa)}function Ka({action:e2,className:n2}){let r2=Ha(e2.href);if(r2===null)return null;let i2=e2.variant==="secondary"?"secondary":"primary";return t("a",{className:y("core-public-action",n2),"data-variant":i2,href:r2,children:e2.label})}function qa({actions:e2,className:n2}){return e2.length?t("div",{className:y("core-public-actions",n2),children:e2.map((e3,n3)=>t(Ka,{action:e3},`${e3.href}-${n3}`))}):null}function Ja(e2){if(!e2||typeof e2!="object")return null;let t2=e2,n2=Ua(t2.src);return n2===null?null:{src:n2,alt:t2.decorative?"":typeof t2.alt=="string"?t2.alt:""}}function Ya({eyebrow:e2,title:r2,intro:i2,actions:a2,media:o2,align:s2,className:c2,style:l2}){let u2=Ja(o2),d2=s2==="center";return n("section",{className:y("core-hero",c2),"data-align":d2?"center":"start","data-media":u2?"yes":"no",style:l2,children:[n("div",{className:"core-hero__text",children:[e2?t("p",{className:"core-hero__eyebrow",children:e2}):null,t("h1",{className:"core-hero__title",children:r2}),i2?t("p",{className:"core-hero__intro",children:i2}):null,t(qa,{actions:Ga(a2).slice(0,2),className:"core-hero__actions"})]}),u2?t("div",{className:"core-hero__media",children:t("img",{src:u2.src,alt:u2.alt,loading:"eager",decoding:"async"})}):null]})}function Xa({text:e2,src:n2,href:r2,size:i2,className:a2,style:o2}){let s2=i2==="sm"||i2==="lg"?i2:"md",c2=Ua(n2),l2=Ha(r2),u2=c2?t("img",{className:"core-logo-mark__img",src:c2,alt:e2}):t("span",{className:"core-logo-mark__text",children:e2});return l2?t("a",{className:y("core-logo-mark",a2),"data-size":s2,href:l2,style:o2,children:u2}):t("span",{className:y("core-logo-mark",a2),"data-size":s2,style:o2,children:u2})}var Za=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.label=="string"&&Ha(e3.href)!==null).map(e3=>({label:e3.label,href:Ha(e3.href)}));function Qa({logo:e2,links:r2,signIn:i2,className:a2,style:o2}){let s2=Za(r2).slice(0,5),c2=i2===false?null:{label:"Sign in",href:"/auth/login",variant:"secondary",...i2??{}};return n("header",{className:y("core-public-header",a2),style:o2,children:[e2?t(Xa,{...e2}):t("span",{}),s2.length?n("nav",{className:"core-public-header__nav","aria-label":"Main",children:[t("ul",{className:"core-public-header__links",children:s2.map(e3=>t("li",{children:t("a",{href:e3.href,children:e3.label})},e3.href))}),n("details",{className:"core-public-header__menu",children:[t("summary",{children:"Menu"}),t("ul",{children:s2.map(e3=>t("li",{children:t("a",{href:e3.href,children:e3.label})},e3.href))})]})]}):null,c2?t(Ka,{action:c2,className:"core-public-header__sign-in"}):null]})}var $a=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.title=="string"&&Array.isArray(e3.links)).map(e3=>({title:e3.title,links:Za(e3.links)}));function eo({logo:e2,groups:r2,legal:i2,className:a2,style:o2}){let s2=$a(r2).slice(0,4);return n("footer",{className:y("core-public-footer",a2),style:o2,children:[n("div",{className:"core-public-footer__top",children:[e2?t(Xa,{size:"sm",...e2}):null,s2.length?t("div",{className:"core-public-footer__groups",children:s2.map(e3=>n("nav",{"aria-label":e3.title,className:"core-public-footer__group",children:[t("p",{className:"core-public-footer__title",children:e3.title}),t("ul",{children:e3.links.map(e4=>t("li",{children:t("a",{href:e4.href,children:e4.label})},e4.href))})]},e3.title))}):null]}),i2?t("p",{className:"core-public-footer__legal",children:i2}):null]})}var to=/^\d+(\.\d+)?\s*\/\s*\d+(\.\d+)?$/;function no({src:e2,alt:r2,decorative:i2,ratio:a2,caption:o2,priority:s2,className:c2,style:l2}){let u2=Ua(e2);if(u2===null)return null;!i2&&!r2&&W(`image-alt:${e2}`,`Image: "${e2}" has no alt text; give alt or set decorative`);let d2=a2&&to.test(a2)?{aspectRatio:a2.replace(/\s/g,"")}:void 0;return n("figure",{className:y("core-image",c2),style:l2,children:[t("div",{className:"core-image__frame","data-ratio":d2?"set":"auto",style:d2,children:t("img",{src:u2,alt:i2?"":r2??"",loading:s2?"eager":"lazy",decoding:"async"})}),o2?t("figcaption",{className:"core-image__caption",children:o2}):null]})}var ro=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.title=="string");function io({title:e2,intro:r2,items:i2,columns:a2,className:o2,style:s2}){let c2=ro(i2);if(!c2.length)return null;let l2=a2===2||a2===4?a2:3;return n("section",{className:y("core-feature-grid",o2),"data-columns":l2,style:s2,children:[e2||r2?n("div",{className:"core-feature-grid__head",children:[e2?t("h2",{className:"core-feature-grid__title",children:e2}):null,r2?t("p",{className:"core-feature-grid__intro",children:r2}):null]}):null,t("ul",{className:"core-feature-grid__items",children:c2.map((e3,r3)=>n("li",{className:"core-feature-grid__item",children:[e3.icon?t("span",{className:"core-feature-grid__icon","aria-hidden":"true",children:e3.icon}):null,t("h3",{className:"core-feature-grid__item-title",children:e3.title}),e3.text?t("p",{className:"core-feature-grid__text",children:e3.text}):null]},`${e3.title}-${r3}`))})]})}var ao=e2=>(Array.isArray(e2)?e2:[]).filter(e3=>!!e3&&typeof e3.name=="string"),oo=e2=>e2.split(/\s+/).filter(Boolean).slice(0,2).map(e3=>e3[0].toUpperCase()).join("");function so({title:e2,intro:r2,members:i2,className:a2,style:o2}){let s2=ao(i2);return s2.length?n("section",{className:y("core-team-grid",a2),style:o2,children:[e2||r2?n("div",{className:"core-team-grid__head",children:[e2?t("h2",{className:"core-team-grid__title",children:e2}):null,r2?t("p",{className:"core-team-grid__intro",children:r2}):null]}):null,t("ul",{className:"core-team-grid__members",children:s2.map((e3,r3)=>{let i3=Ja(e3.photo);return n("li",{className:"core-team-grid__member",children:[t("div",{className:"core-team-grid__photo",children:i3?t("img",{src:i3.src,alt:i3.alt||e3.name,loading:"lazy",decoding:"async"}):t("span",{"aria-hidden":"true",children:oo(e3.name)})}),t("p",{className:"core-team-grid__name",children:e3.name}),e3.role?t("p",{className:"core-team-grid__role",children:e3.role}):null,e3.bio?t("p",{className:"core-team-grid__bio",children:e3.bio}):null]},`${e3.name}-${r3}`)})})]}):null}function co({quote:e2,name:r2,role:i2,photo:a2,className:o2,style:s2}){if(typeof e2!="string"||!e2)return null;let c2=Ja(a2);return n("figure",{className:y("core-testimonial",o2),style:s2,children:[t("blockquote",{className:"core-testimonial__quote",children:t("p",{children:e2})}),n("figcaption",{className:"core-testimonial__by",children:[c2?t("img",{className:"core-testimonial__photo",src:c2.src,alt:c2.alt||r2,loading:"lazy",decoding:"async"}):null,n("span",{children:[t("span",{className:"core-testimonial__name",children:r2}),i2?t("span",{className:"core-testimonial__role",children:i2}):null]})]})]})}function lo({title:e2,text:r2,actions:i2,tone:a2,className:o2,style:s2}){let c2=a2==="strong"||a2==="neutral"?a2:"accent";return n("section",{className:y("core-cta-band",o2),"data-tone":c2,style:s2,children:[n("div",{className:"core-cta-band__text",children:[t("h2",{className:"core-cta-band__title",children:e2}),r2?t("p",{className:"core-cta-band__body",children:r2}):null]}),t(qa,{actions:Ga(i2).slice(0,2)})]})}function uo({title:e2,intro:r2,askPhone:i2,consent:a2,submitLabel:o2,thanks:s2,actions:c2,className:l2,style:d2}){let f2=u(),[p2,m2]=h({name:"",email:"",phone:"",message:"",consent:false,website:""}),[g2,_2]=h(false),[v2,b2]=h(false),[x2,S2]=h(""),C2=c2?.submitRequest,w2=e3=>t2=>m2(n2=>({...n2,[e3]:t2.target.type==="checkbox"?!!t2.target.checked:t2.target.value}));return v2?t("section",{className:y("core-contact-form",l2),style:d2,children:t("p",{className:"core-contact-form__thanks",role:"status",children:s2||"Thanks. We'll be in touch within one business day."})}):n("section",{className:y("core-contact-form",l2),style:d2,children:[e2?t("h2",{className:"core-contact-form__title",children:e2}):null,r2?t("p",{className:"core-contact-form__intro",children:r2}):null,n("form",{className:"core-contact-form__form",onSubmit:async e3=>{if(e3.preventDefault(),C2&&!g2){if(!p2.consent){S2("Please tick the box to agree to be contacted.");return}_2(true),S2("");try{let e4=await C2({name:p2.name.trim(),email:p2.email.trim(),...i2&&p2.phone.trim()?{phone:p2.phone.trim()}:{},...p2.message.trim()?{message:p2.message.trim()}:{},consent:p2.consent,website:p2.website});e4.success?b2(true):S2(gi(e4))}catch{S2("Something went wrong. Try again.")}finally{_2(false)}}},children:[n("div",{className:"core-contact-form__row",children:[n("label",{className:"core-contact-form__field",children:[t("span",{children:"Name"}),t("input",{name:"name",autoComplete:"name",required:true,value:p2.name,onChange:w2("name")})]}),n("label",{className:"core-contact-form__field",children:[t("span",{children:"Email"}),t("input",{name:"email",type:"email",autoComplete:"email",required:true,value:p2.email,onChange:w2("email")})]})]}),i2?n("label",{className:"core-contact-form__field",children:[t("span",{children:"Phone (optional)"}),t("input",{name:"phone",type:"tel",autoComplete:"tel",value:p2.phone,onChange:w2("phone")})]}):null,n("label",{className:"core-contact-form__field",children:[t("span",{children:"Message (optional)"}),t("textarea",{name:"message",rows:4,value:p2.message,onChange:w2("message")})]}),n("div",{className:"core-contact-form__trap","aria-hidden":"true",children:[t("label",{htmlFor:`${f2}-website`,children:"Website"}),t("input",{id:`${f2}-website`,name:"website",tabIndex:-1,autoComplete:"off",value:p2.website,onChange:w2("website")})]}),n("label",{className:"core-contact-form__check",children:[t("input",{type:"checkbox",name:"consent",checked:p2.consent,onChange:w2("consent")}),t("span",{children:a2||"I agree to be contacted about my request."})]}),x2?t("p",{className:"core-contact-form__error",role:"alert",children:x2}):null,C2?null:t("p",{className:"core-contact-form__error",children:"This form isn't connected yet."}),t("div",{className:"core-contact-form__actions",children:t("button",{type:"submit",className:"core-contact-form__submit",disabled:g2||!C2,children:g2?"Sending…":o2||"Send"})})]})]})}function fo({length:e2=6,label:r2,value:i2,onChange:a2,onComplete:o2,error:s2,disabled:c2,autoFocus:l2,name:d2="code",className:f2,style:p2}){let m2=u(),g2=Number.isInteger(e2)&&e2>0&&e2<=12?e2:6,[_2,v2]=h(""),b2=(i2??_2).replace(/\D/g,"").slice(0,g2),x2=e3=>{let t2=e3.target.value.replace(/\D/g,"").slice(0,g2);i2===void 0&&v2(t2),a2?.(t2),t2.length===g2&&b2.length!==g2&&o2?.(t2)};return n("div",{className:y("core-code-field",f2),style:{...p2,"--core-code-field-n":g2},children:[t("label",{className:"core-code-field__label",htmlFor:m2,children:r2||"Code"}),n("div",{className:"core-code-field__boxes","data-error":s2?"yes":"no",children:[t("input",{id:m2,className:"core-code-field__input",name:d2,value:b2,onChange:x2,inputMode:"numeric",autoComplete:"one-time-code",pattern:`\\d{${g2}}`,maxLength:g2,disabled:c2,autoFocus:l2,"aria-invalid":s2?true:void 0,"aria-describedby":s2?`${m2}-error`:void 0}),t("div",{className:"core-code-field__cells","aria-hidden":"true",children:Array.from({length:g2},(e3,n2)=>t("span",{className:"core-code-field__cell","data-filled":n2<b2.length?"yes":"no","data-caret":n2===Math.min(b2.length,g2-1)?"yes":"no",children:b2[n2]??""},n2))})]}),s2?t("p",{id:`${m2}-error`,className:"core-code-field__error",role:"alert",children:s2}):null]})}var po=Symbol.for("peripheries.viewer.context.v1"),mo=20,ho=/^[a-z0-9]+(?:[-_][a-z0-9]+)*$/,go=Object.freeze({audience:"client",roles:Object.freeze([])});function _o(e2){if(!e2||typeof e2!="object")return go;let t2=e2,n2=[...new Set((Array.isArray(t2.roles)?t2.roles:[]).filter(e3=>typeof e3=="string"&&ho.test(e3)&&e3.length<=40))].sort().slice(0,mo);return{audience:t2.audience==="staff"?"staff":"client",roles:n2,...t2.previewing===true?{previewing:true}:{}}}var vo=globalThis,yo=vo[po]??=a(go);function bo({value:e2,children:n2}){return t(yo.Provider,{value:_o(e2),children:n2})}function xo(){return c(yo)}var So=e2=>e2.audience==="staff",Co=(e2,t2)=>e2.roles.includes(t2);export{Kn as ANSWER_COLUMN_PX,wt as Accordion,Ka as ActionLink,qa as ActionRow,qn as AnswerRows,dn as Aside,Ge as Avatar,en as BLOCK_KINDS,xr as BLOCK_SCHEMAS,dt as Badge,S as Box,yt as Button,Qi as CalendarFilters,aa as CalendarView,Tt as Card,C as Center,Qe as Checkbox,$e as CheckboxGroup,bt as Chip,Ke as Code,fo as CodeField,Dt as Columns,ya as Combobox,Yn as ComparisonBars,uo as ContactForm,w as Container,mr as Contents,lo as CtaBand,ji as DAY_MINUTES,In as DEFAULT_DISPLAY_LOCALE,Ut as DEFAULT_PROFILE_ID,go as DEFAULT_VIEWER,oi as DataTable,et as DateRange,mn as Definition,De as Dialog,Nr as DisclaimerBlock,kt as Disclosure,T as Divider,vr as DocumentBlocks,On as DocumentLabel,br as DocumentSection,fr as DocumentShell,Fn as DocumentTable,ft as EmptyState,xi as EventCard,wi as EventDetail,Ei as EventLogForm,Ci as EventRespond,Oi as EventSchedule,Ai as EventTimeline,gr as ExecutionBlock,Be as Eyebrow,io as FeatureGrid,En as Figure,nt as FileField,Tn as Footnote,Ze as FormField,At as Grid,Da as HandoverCard,Je as Heading,Ya as Hero,E as Hide,Mr as HighlightBox,va as Highlighted,Xi as HourGrid,xt as IconButton,no as Image,D as Inline,qr as KpiCardGrid,St as Link,Ne as ListRow,pa as LogCard,Xa as LogoMark,sr as Masthead,bn as Math,se as Menu,lr as MetaRail,ta as MiniMonth,oa as NOT_AVAILABLE,Qn as NextSteps,Pa as NoteSplitCard,er as Notes,mt as Notice,Vr as OptionCard,Mt as PAGINATOR_BINDINGS,Dn as PageBreak,Pe as PageFrame,Ve as PageHead,ee as Popover,Hr as ProfileCard,ht as Progress,fn as Prose,eo as PublicFooter,Qa as PublicHeader,Sa as QuickNoteCard,pn as Quote,rt as RadioGroup,M as Rail,Pn as Reference,jt as Repeat,Gn as RowList,He as RuleSection,dr as RunningFooter,Vi as SERIES_SHAPES,ot as SearchField,jr as SectionHeader,Ct as SegmentedControl,st as Select,Gi as SeriesGlyph,Ia as ShareApprovalCard,ne as Sheet,N as Show,gt as Skeleton,nr as SkippedSection,ct as Slider,Oe as Spacer,_t as Spinner,Ot as Split,ke as Stack,Aa as StartProcessCard,Dr as Stat,Or as StatGroup,Fr as StatStrip,za as SuggestedActions,lt as Switch,Fe as TONES,ir as TalkItThrough,Ea as TaskCard,so as TeamGrid,co as Testimonial,Xe as Text,ut as TextArea,at as TextField,we as Toast,Ee as ToastRegion,vt as Tooltip,Ue as UnderlinedAction,bo as ViewerProvider,ar as WRITE_HEIGHT_PX,$n as WRITE_LINE_HEIGHT_PX,ra as WeekStrip,or as WriteInField,Ga as actionsOf,y as cx,_e as dismissToast,zn as displayLocale,Ht as documentProfiles,fi as eventWhen,tt as fileSize,Un as formatValue,Co as hasRole,bi as hrefFrom,Ja as imageOf,We as initialsOf,Re as inkToneOf,Pi as isBusyOnly,So as isStaff,Ii as layoutDay,b as length,_o as normalizeViewer,zi as overlapDays,$t as profileCss,zt as profileIds,Zt as profileTokens,Rt as registerProfile,Z as renderFormatted,Bt as resolveProfile,Vt as resolvedProfiles,Bi as sameOriginPath,Wi as seriesNumber,Ui as seriesShape,it as toNumber,ge as toast,K as toneOf,si as typeCard,_a as useCombobox,sa as useIntent,Ce as useToast,xo as useViewer,x as vars,Li as visibleRange,Ni as wallOf,Ri as weekDates};