@brucesantos/design-space 0.5.1 → 0.6.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.
package/dist/index.js CHANGED
@@ -1,356 +1,325 @@
1
- import { jsxs as u, jsx as o, Fragment as A } from "react/jsx-runtime";
2
- import { useState as $, useEffect as I, useMemo as C, useCallback as E, useContext as ue, createContext as he, useRef as Q, forwardRef as pe } from "react";
3
- import { S as se, v as me, P as g, N as ie, s as fe, c as be, g as ve } from "./contrast-BseNi5QD.js";
4
- import { C as At, a as Pt, b as Lt, d as $t, e as Et, f as Ft, h as Rt, i as Dt, j as Ot, k as It, p as Bt, r as Wt, l as jt, m as Ht, n as Kt } from "./contrast-BseNi5QD.js";
5
- function ge(e) {
6
- const t = new Map(e.scenarios.map((d) => [d.id, d])), n = new Map(
7
- (e.components ?? []).map((d) => [d.id, d])
8
- ), s = new Map(e.personas.map((d) => [d.id, d])), l = new Map(e.fixtures.map((d) => [d.id, d])), a = new Map((e.rules ?? []).map((d) => [d.id, d])), r = new Map(e.modules.map((d) => [d.id, d])), c = new Map(
9
- e.modules.flatMap((d) => (d.flows ?? []).map((f) => [f.id, f]))
10
- ), h = e.modules.map((d) => ({
11
- module: d,
12
- scenarios: e.scenarios.filter((f) => f.id.split(".")[0] === d.id)
13
- })), p = new Set(h.flatMap((d) => d.scenarios.map((f) => f.id))), m = e.scenarios.filter((d) => !p.has(d.id)), v = (d) => d ? t.get(d) : void 0, i = (d) => d ? s.get(d) : void 0, N = (d, f) => {
14
- if (!(!d || !f))
15
- return n.get(d)?.fixtures?.find((k) => k.id === f);
16
- }, x = (d = {}) => e.scenarios.filter(
17
- (f) => d.includePorted || (d.view === "ported" ? f.status === "ported" : f.status !== "ported") || d.view === void 0 && f.id === d.activeScenario
18
- ), S = (d) => d ? d.permissions ? d.permissions : i(d.persona)?.permissions ?? [] : [];
1
+ import { jsxs as l, jsx as t, Fragment as A } from "react/jsx-runtime";
2
+ import { useState as F, useEffect as D, useMemo as T, useCallback as R, useContext as Ne, createContext as Se, useRef as re, forwardRef as xe } from "react";
3
+ import { S as be, h as ee, v as ye, a as te, p as _e, P as w, b as oe, N as ve, s as Me, c as Ce, g as Te, d as Ae, r as Pe } from "./contrast-B8xa1UIu.js";
4
+ import { C as It, H as Bt, e as Ht, f as Wt, i as zt, j as Ut, k as jt, l as Kt, m as Vt, n as qt, o as Gt, q as Yt, t as Jt, u as Qt, w as Xt, x as Zt, y as eo, z as to } from "./contrast-B8xa1UIu.js";
5
+ function Le(e) {
6
+ const o = new Map(e.scenarios.map((s) => [s.id, s])), a = new Map(
7
+ (e.components ?? []).map((s) => [s.id, s])
8
+ ), i = new Map(e.personas.map((s) => [s.id, s])), d = new Map(e.fixtures.map((s) => [s.id, s])), r = new Map((e.rules ?? []).map((s) => [s.id, s])), n = new Map(e.modules.map((s) => [s.id, s])), c = new Map(
9
+ e.modules.flatMap((s) => (s.flows ?? []).map((m) => [m.id, m]))
10
+ ), h = e.modules.map((s) => ({
11
+ module: s,
12
+ scenarios: e.scenarios.filter((m) => m.id.split(".")[0] === s.id)
13
+ })), u = new Set(h.flatMap((s) => s.scenarios.map((m) => m.id))), g = e.scenarios.filter((s) => !u.has(s.id)), f = (s) => s ? o.get(s) : void 0, p = (s) => s ? i.get(s) : void 0, b = (s, m) => {
14
+ if (!(!s || !m))
15
+ return a.get(s)?.fixtures?.find((k) => k.id === m);
16
+ }, S = (s = {}) => e.scenarios.filter(
17
+ (m) => te(s.handoff, m.id) && (s.includePorted || (s.view === "ported" ? m.status === "ported" : m.status !== "ported") || s.view === void 0 && m.id === s.activeScenario)
18
+ ), _ = (s) => s ? s.permissions ? s.permissions : p(s.persona)?.permissions ?? [] : [];
19
19
  return {
20
20
  product: e,
21
21
  tree: h,
22
- orphans: m,
23
- issues: me(e),
24
- scenario: v,
25
- component: (d) => d ? n.get(d) : void 0,
26
- componentFixture: N,
27
- resolveComponentFixture: (d, f) => {
28
- const k = d ? n.get(d) : void 0, M = N(d, f), _ = N(d, k?.defaultFixture) ?? k?.fixtures?.[0];
22
+ orphans: g,
23
+ issues: ye(e),
24
+ scenario: f,
25
+ component: (s) => s ? a.get(s) : void 0,
26
+ componentFixture: b,
27
+ resolveComponentFixture: (s, m) => {
28
+ const k = s ? a.get(s) : void 0, M = b(s, m), y = b(s, k?.defaultFixture) ?? k?.fixtures?.[0];
29
29
  return {
30
- fixture: M ?? _,
31
- requestedId: f,
32
- didFallback: !!(f && !M)
30
+ fixture: M ?? y,
31
+ requestedId: m,
32
+ didFallback: !!(m && !M)
33
33
  };
34
34
  },
35
- persona: i,
36
- fixture: (d) => d ? l.get(d) : void 0,
37
- rule: (d) => d ? a.get(d) : void 0,
38
- module: (d) => d ? r.get(d) : void 0,
39
- flow: (d) => d ? c.get(d) : void 0,
40
- rulesOf: (d) => (d?.rules ?? []).map((f) => a.get(f)).filter((f) => !!f),
41
- permissionsOf: S,
42
- scenariosForRoute: (d, f) => {
43
- const k = d.split("?")[0];
44
- return x(f).filter((M) => M.route.split("?")[0] === k);
35
+ persona: p,
36
+ fixture: (s) => s ? d.get(s) : void 0,
37
+ rule: (s) => s ? r.get(s) : void 0,
38
+ module: (s) => s ? n.get(s) : void 0,
39
+ flow: (s) => s ? c.get(s) : void 0,
40
+ rulesOf: (s) => (s?.rules ?? []).map((m) => r.get(m)).filter((m) => !!m),
41
+ permissionsOf: _,
42
+ scenariosForRoute: (s, m) => {
43
+ const k = s.split("?")[0];
44
+ return S(m).filter((M) => M.route.split("?")[0] === k);
45
45
  },
46
- activeScenarios: x,
47
- treeFor: (d) => {
48
- const f = new Set(x(d).map((k) => k.id));
46
+ activeScenarios: S,
47
+ treeFor: (s) => {
48
+ const m = new Set(S(s).map((k) => k.id));
49
49
  return h.map((k) => ({
50
50
  ...k,
51
- scenarios: k.scenarios.filter((M) => f.has(M.id))
51
+ scenarios: k.scenarios.filter((M) => m.has(M.id))
52
52
  }));
53
53
  },
54
- orphansFor: (d) => {
55
- const f = new Set(x(d).map((k) => k.id));
56
- return m.filter((k) => f.has(k.id));
54
+ orphansFor: (s) => {
55
+ const m = new Set(S(s).map((k) => k.id));
56
+ return g.filter((k) => m.has(k.id));
57
57
  },
58
- search: (d, f) => {
59
- const k = te(d), M = x(f);
60
- return k ? M.filter((_) => {
61
- const T = r.get(_.id.split(".")[0] ?? "")?.name ?? "";
62
- return te(
58
+ search: (s, m) => {
59
+ const k = pe(s), M = S(m);
60
+ return k ? M.filter((y) => {
61
+ const E = n.get(y.id.split(".")[0] ?? "")?.name ?? "";
62
+ return pe(
63
63
  [
64
- _.title,
65
- _.id,
66
- _.intent ?? "",
67
- _.route,
68
- T,
69
- s.get(_.persona)?.name ?? "",
70
- (_.tags ?? []).join(" "),
71
- (_.expected ?? []).join(" ")
64
+ y.title,
65
+ y.id,
66
+ y.intent ?? "",
67
+ y.route,
68
+ E,
69
+ i.get(y.persona)?.name ?? "",
70
+ (y.tags ?? []).join(" "),
71
+ (y.expected ?? []).join(" ")
72
72
  ].join(" ")
73
73
  ).includes(k);
74
74
  }) : M;
75
75
  },
76
- byStatus: (d) => e.scenarios.filter((f) => f.status === d),
77
- coverage: (d) => {
78
- const f = Object.fromEntries(
79
- se.map((k) => [k, 0])
76
+ byStatus: (s, m) => S({ ...m, includePorted: !0 }).filter((k) => k.status === s),
77
+ componentsFor: (s) => (e.components ?? []).filter(
78
+ (m) => ee(s, m.id)
79
+ ),
80
+ coverage: (s) => {
81
+ const m = Object.fromEntries(
82
+ be.map((k) => [k, 0])
80
83
  );
81
- for (const k of x(d)) f[k.status] += 1;
82
- return f;
84
+ for (const k of S(s)) m[k.status] += 1;
85
+ return m;
83
86
  }
84
87
  };
85
88
  }
86
- function te(e) {
89
+ function pe(e) {
87
90
  return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").trim();
88
91
  }
89
- const ce = [
92
+ const ge = [
90
93
  { id: "fit", label: "Ajustar" },
91
94
  { id: "mobile", label: "Celular", width: 390, height: 844 },
92
95
  { id: "tablet", label: "Tablet", width: 834, height: 1112 },
93
96
  { id: "desktop", label: "Desktop", width: 1440, height: 900 },
94
97
  { id: "custom", label: "Personalizado" }
95
- ], we = [1, 1.25, 1.5, 2];
96
- function ke(e, t) {
97
- const n = new URLSearchParams(e), s = n.get(g.component) ?? void 0, l = t.component(s), a = n.get(g.scenario) ?? void 0, r = l ? void 0 : t.scenario(a), c = n.get(g.fixture) ?? void 0, h = l ? c ?? t.componentFixture(l.id, l.defaultFixture)?.id ?? l.fixtures?.[0]?.id : void 0, p = n.get(g.network), m = Number(n.get(g.textScale)), v = n.get(g.view), i = r?.status === "ported" || v === "ported" || n.get(g.showPorted) === "1" ? "ported" : "active";
98
+ ], Fe = [1, 1.25, 1.5, 2];
99
+ function $e(e, o) {
100
+ const a = new URLSearchParams(e), i = _e(a), d = a.get(w.component) ?? void 0, r = ee(i, d) ? o.component(d) : void 0, n = a.get(w.scenario) ?? void 0, c = r || !te(i, n) ? void 0 : o.scenario(n), h = a.get(w.fixture) ?? void 0, u = r ? h ?? o.componentFixture(r.id, r.defaultFixture)?.id ?? r.fixtures?.[0]?.id : void 0, g = a.get(w.network), f = Number(a.get(w.textScale)), p = a.get(w.view), b = c?.status === "ported" || p === "ported" || a.get(w.showPorted) === "1" ? "ported" : "active";
98
101
  return {
99
- scenario: r?.id,
100
- view: i,
101
- showPorted: i === "ported",
102
- component: l?.id,
103
- persona: n.get(g.persona) ?? r?.persona,
104
- fixture: l ? h : c ?? r?.fixture,
105
- network: ye(p) ? p : r?.network ?? "success",
106
- viewport: n.get(g.viewport) ?? "fit",
107
- customWidth: _e(n.get(g.customWidth)),
108
- themeMode: n.get(g.themeMode) ?? t.product.theme?.modes?.[0],
109
- locale: n.get(g.locale) ?? t.product.theme?.locales?.[0],
110
- dataSource: n.get(g.dataSource) ?? t.product.dataSources?.default ?? "fixtures",
111
- chromeTheme: Se(n.get(g.chromeTheme)) ? n.get(g.chromeTheme) : "dark",
102
+ scenario: c?.id,
103
+ handoff: i,
104
+ view: b,
105
+ showPorted: b === "ported",
106
+ component: r?.id,
107
+ persona: a.get(w.persona) ?? c?.persona,
108
+ fixture: r ? u : h ?? c?.fixture,
109
+ network: De(g) ? g : c?.network ?? "success",
110
+ viewport: a.get(w.viewport) ?? "fit",
111
+ customWidth: Ie(a.get(w.customWidth)),
112
+ themeMode: a.get(w.themeMode) ?? o.product.theme?.modes?.[0],
113
+ locale: a.get(w.locale) ?? o.product.theme?.locales?.[0],
114
+ dataSource: a.get(w.dataSource) ?? o.product.dataSources?.default ?? "fixtures",
115
+ chromeTheme: Oe(a.get(w.chromeTheme)) ? a.get(w.chromeTheme) : "dark",
112
116
  // Chrome visível por padrão. `?chrome=0` é o modo de revisão limpa e captura
113
117
  // de tela, então precisa ser explícito para não sumir sem pedido.
114
- chrome: n.get(g.chrome) !== "0",
115
- keyboardMode: n.get(g.keyboardMode) === "1",
116
- reducedMotion: n.get(g.reducedMotion) === "1",
117
- textScale: we.includes(m) ? m : 1,
118
- inspector: n.get(g.inspector) !== "0"
118
+ chrome: a.get(w.chrome) !== "0",
119
+ keyboardMode: a.get(w.keyboardMode) === "1",
120
+ reducedMotion: a.get(w.reducedMotion) === "1",
121
+ textScale: Fe.includes(f) ? f : 1,
122
+ inspector: a.get(w.inspector) !== "0"
119
123
  };
120
124
  }
121
- function q(e, t) {
122
- const n = new URLSearchParams(), s = t.scenario(e.scenario);
123
- e.component ? n.set(g.component, e.component) : e.scenario && n.set(g.scenario, e.scenario), ee(e) === "ported" && n.set(g.view, "ported"), e.persona && e.persona !== s?.persona && n.set(g.persona, e.persona), e.component && e.fixture ? n.set(g.fixture, e.fixture) : e.fixture && e.fixture !== s?.fixture && n.set(g.fixture, e.fixture), e.network !== (s?.network ?? "success") && n.set(g.network, e.network), e.viewport !== "fit" && n.set(g.viewport, e.viewport), e.viewport === "custom" && e.customWidth && n.set(g.customWidth, String(e.customWidth));
124
- const l = t.product.theme?.modes?.[0];
125
- e.themeMode && e.themeMode !== l && n.set(g.themeMode, e.themeMode);
126
- const a = t.product.theme?.locales?.[0];
127
- e.locale && e.locale !== a && n.set(g.locale, e.locale);
128
- const r = t.product.dataSources?.default ?? "fixtures";
129
- e.dataSource && e.dataSource !== r && n.set(g.dataSource, e.dataSource), e.chromeTheme === "light" && n.set(g.chromeTheme, "light"), e.chrome || n.set(g.chrome, "0"), e.keyboardMode && n.set(g.keyboardMode, "1"), e.reducedMotion && n.set(g.reducedMotion, "1"), e.textScale !== 1 && n.set(g.textScale, String(e.textScale)), e.inspector || n.set(g.inspector, "0");
130
- const c = n.toString();
125
+ function X(e, o) {
126
+ const a = new URLSearchParams(), i = o.scenario(e.scenario);
127
+ e.component ? a.set(w.component, e.component) : e.scenario && a.set(w.scenario, e.scenario), ce(e) === "ported" && a.set(w.view, "ported"), e.persona && e.persona !== i?.persona && a.set(w.persona, e.persona), e.component && e.fixture ? a.set(w.fixture, e.fixture) : e.fixture && e.fixture !== i?.fixture && a.set(w.fixture, e.fixture), e.network !== (i?.network ?? "success") && a.set(w.network, e.network), e.viewport !== "fit" && a.set(w.viewport, e.viewport), e.viewport === "custom" && e.customWidth && a.set(w.customWidth, String(e.customWidth));
128
+ const d = o.product.theme?.modes?.[0];
129
+ e.themeMode && e.themeMode !== d && a.set(w.themeMode, e.themeMode);
130
+ const r = o.product.theme?.locales?.[0];
131
+ e.locale && e.locale !== r && a.set(w.locale, e.locale);
132
+ const n = o.product.dataSources?.default ?? "fixtures";
133
+ e.dataSource && e.dataSource !== n && a.set(w.dataSource, e.dataSource), e.chromeTheme === "light" && a.set(w.chromeTheme, "light"), e.chrome || a.set(w.chrome, "0"), e.keyboardMode && a.set(w.keyboardMode, "1"), e.reducedMotion && a.set(w.reducedMotion, "1"), e.textScale !== 1 && a.set(w.textScale, String(e.textScale)), e.inspector || a.set(w.inspector, "0"), oe(a, e.handoff);
134
+ const c = a.toString();
131
135
  return c ? `?${c}` : "";
132
136
  }
133
- function Ne(e) {
134
- const [t, n] = $(() => oe());
135
- I(() => {
136
- const v = () => n(oe());
137
- return window.addEventListener("popstate", v), () => window.removeEventListener("popstate", v);
137
+ function Ee(e) {
138
+ const [o, a] = F(() => ue());
139
+ D(() => {
140
+ const f = () => a(ue());
141
+ return window.addEventListener("popstate", f), () => window.removeEventListener("popstate", f);
138
142
  }, []);
139
- const s = C(() => ke(t.search, e), [t.search, e]), l = E((v, i, N = !1) => {
140
- const x = `${v}${i}`;
141
- N ? window.history.replaceState(null, "", x) : window.history.pushState(null, "", x), n({ path: v, search: i });
142
- }, []), a = E(
143
- (v) => {
144
- const i = v.view ?? (v.showPorted === void 0 ? void 0 : v.showPorted ? "ported" : "active"), N = {
145
- ...s,
146
- ...v,
147
- ...i ? { view: i, showPorted: i === "ported" } : {}
143
+ const i = T(() => $e(o.search, e), [o.search, e]), d = R((f, p, b = !1) => {
144
+ const S = `${f}${p}`;
145
+ b ? window.history.replaceState(null, "", S) : window.history.pushState(null, "", S), a({ path: f, search: p });
146
+ }, []), r = R(
147
+ (f) => {
148
+ const p = f.view ?? (f.showPorted === void 0 ? void 0 : f.showPorted ? "ported" : "active"), b = {
149
+ ...i,
150
+ ...f,
151
+ ...p ? { view: p, showPorted: p === "ported" } : {}
148
152
  };
149
- l(t.path, q(N, e), !0);
153
+ d(o.path, X(b, e), !0);
150
154
  },
151
- [s, t.path, l, e]
152
- ), r = E(
153
- (v) => {
154
- const i = e.scenario(s.scenario), N = !i || (v === "ported" ? i.status === "ported" : i.status !== "ported"), x = {
155
- ...s,
156
- view: v,
157
- showPorted: v === "ported",
158
- ...N ? {} : {
155
+ [i, o.path, d, e]
156
+ ), n = R(
157
+ (f) => {
158
+ const p = e.scenario(i.scenario), b = !p || (f === "ported" ? p.status === "ported" : p.status !== "ported"), S = {
159
+ ...i,
160
+ view: f,
161
+ showPorted: f === "ported",
162
+ ...b ? {} : {
159
163
  scenario: void 0,
160
164
  persona: void 0,
161
165
  fixture: void 0,
162
166
  network: "success"
163
167
  }
164
168
  };
165
- l(N ? t.path : "/", q(x, e), !1);
169
+ d(b ? o.path : "/", X(S, e), !1);
166
170
  },
167
- [s, t.path, l, e]
168
- ), c = E(
169
- (v, i) => {
170
- const [N, x] = v.split("?"), S = N || "/", d = x ? `?${x}` : t.search;
171
- l(S, d, i?.replace ?? !1);
171
+ [i, o.path, d, e]
172
+ ), c = R(
173
+ (f, p) => {
174
+ const [b, S] = f.split("?"), _ = b || "/", s = new URLSearchParams(S ?? o.search);
175
+ i.handoff && oe(s, i.handoff);
176
+ const m = s.toString(), k = m ? `?${m}` : "";
177
+ d(_, k, p?.replace ?? !1);
172
178
  },
173
- [t.search, l]
174
- ), h = E(
175
- (v) => {
176
- const i = e.scenario(v);
177
- if (!i) return;
178
- const N = {
179
- ...s,
180
- scenario: i.id,
181
- view: i.status === "ported" ? "ported" : "active",
182
- showPorted: i.status === "ported",
179
+ [i.handoff, o.search, d]
180
+ ), h = R(
181
+ (f) => {
182
+ const p = e.scenario(f);
183
+ if (!p || !te(i.handoff, f)) return;
184
+ const b = {
185
+ ...i,
186
+ scenario: p.id,
187
+ view: p.status === "ported" ? "ported" : "active",
188
+ showPorted: p.status === "ported",
183
189
  component: void 0,
184
- persona: i.persona,
185
- fixture: i.fixture,
186
- network: i.network ?? "success"
190
+ persona: p.persona,
191
+ fixture: p.fixture,
192
+ network: p.network ?? "success"
187
193
  };
188
- l(i.route, q(N, e), !1);
194
+ d(p.route, X(b, e), !1);
189
195
  },
190
- [s, l, e]
191
- ), p = E(
192
- (v) => {
193
- const i = e.component(v);
194
- if (!i) return;
195
- const N = {
196
- ...s,
196
+ [i, d, e]
197
+ ), u = R(
198
+ (f) => {
199
+ const p = e.component(f);
200
+ if (!p || !ee(i.handoff, f)) return;
201
+ const b = {
202
+ ...i,
197
203
  scenario: void 0,
198
- component: i.id,
204
+ component: p.id,
199
205
  persona: void 0,
200
206
  fixture: void 0,
201
207
  network: "success"
202
208
  };
203
- N.fixture = e.componentFixture(i.id, i.defaultFixture)?.id ?? i.fixtures?.[0]?.id, l("/", q(N, e), !1);
209
+ b.fixture = e.componentFixture(p.id, p.defaultFixture)?.id ?? p.fixtures?.[0]?.id, d("/", X(b, e), !1);
204
210
  },
205
- [s, l, e]
206
- ), m = C(() => xe(s), [s]);
211
+ [i, d, e]
212
+ ), g = T(() => Re(i), [i]);
207
213
  return {
208
- location: t,
209
- controls: s,
210
- viewport: m,
211
- setControls: a,
212
- setScenarioView: r,
214
+ location: o,
215
+ controls: i,
216
+ viewport: g,
217
+ setControls: r,
218
+ setScenarioView: n,
213
219
  navigate: c,
214
220
  openScenario: h,
215
- openComponent: p
221
+ openComponent: u
216
222
  };
217
223
  }
218
- function ee(e) {
224
+ function ce(e) {
219
225
  return e.view ?? (e.showPorted ? "ported" : "active");
220
226
  }
221
- function xe(e) {
222
- const t = ce.find((n) => n.id === e.viewport);
223
- return e.viewport === "custom" ? { id: "custom", label: "Personalizado", width: e.customWidth ?? 1024 } : t ?? { id: "fit", label: "Ajustar" };
227
+ function Re(e) {
228
+ const o = ge.find((a) => a.id === e.viewport);
229
+ return e.viewport === "custom" ? { id: "custom", label: "Personalizado", width: e.customWidth ?? 1024 } : o ?? { id: "fit", label: "Ajustar" };
224
230
  }
225
- function oe() {
231
+ function ue() {
226
232
  return typeof window > "u" ? { path: "/", search: "" } : { path: window.location.pathname, search: window.location.search };
227
233
  }
228
- function ye(e) {
229
- return e !== null && ie.includes(e);
234
+ function De(e) {
235
+ return e !== null && ve.includes(e);
230
236
  }
231
- function Se(e) {
237
+ function Oe(e) {
232
238
  return e === "dark" || e === "light";
233
239
  }
234
- function _e(e) {
240
+ function Ie(e) {
235
241
  if (!e) return;
236
- const t = Number.parseInt(e, 10);
237
- return Number.isFinite(t) && t > 0 ? t : void 0;
238
- }
239
- function Me(e, t) {
240
- const n = e.split("/").filter(Boolean), s = Te(t).split("/").filter(Boolean), l = {};
241
- for (const [a, r] of n.entries()) {
242
- if (r === "*")
243
- return l["*"] = s.slice(a).join("/"), l;
244
- const c = s[a];
245
- if (c === void 0) return null;
246
- if (r.startsWith(":")) {
247
- l[r.slice(1)] = c;
248
- continue;
249
- }
250
- if (r !== c) return null;
251
- }
252
- return n.length !== s.length ? null : l;
242
+ const o = Number.parseInt(e, 10);
243
+ return Number.isFinite(o) && o > 0 ? o : void 0;
253
244
  }
254
- function Ce(e, t) {
255
- const n = [...e].sort((s, l) => ne(l.path) - ne(s.path));
256
- for (const s of n) {
257
- const l = Me(s.path, t);
258
- if (l) return { definition: s, params: l };
245
+ const Be = 2500;
246
+ class He extends Error {
247
+ constructor(o) {
248
+ super(`Falha de rede simulada no cenário "${o}".`), this.name = "SimulatedNetworkError";
259
249
  }
260
250
  }
261
- function ne(e) {
262
- const t = e.split("/").filter(Boolean);
263
- let n = t.length;
264
- for (const s of t)
265
- s === "*" ? n -= 2 : s.startsWith(":") ? n += 1 : n += 4;
266
- return n;
267
- }
268
- function Te(e) {
269
- const t = e.split("?")[0] ?? e;
270
- try {
271
- return decodeURI(t);
272
- } catch {
273
- return t;
274
- }
275
- }
276
- const Ae = 2500;
277
- class Pe extends Error {
278
- constructor(t) {
279
- super(`Falha de rede simulada no cenário "${t}".`), this.name = "SimulatedNetworkError";
280
- }
281
- }
282
- function X(e) {
251
+ function se(e) {
283
252
  if (e)
284
253
  return typeof e.data == "function" ? e.data() : e.data;
285
254
  }
286
- const Z = {
255
+ const ie = {
287
256
  id: "fixtures",
288
257
  label: "Fixtures",
289
- load: async ({ scenario: e, fixture: t, network: n }) => {
290
- switch (n) {
258
+ load: async ({ scenario: e, fixture: o, network: a }) => {
259
+ switch (a) {
291
260
  case "empty":
292
261
  return null;
293
262
  case "error":
294
- throw new Pe(e.id);
263
+ throw new He(e.id);
295
264
  case "loading":
296
265
  return new Promise(() => {
297
266
  });
298
267
  case "slow":
299
- return await Le(Ae), X(t);
268
+ return await We(Be), se(o);
300
269
  default:
301
- return X(t);
270
+ return se(o);
302
271
  }
303
272
  }
304
273
  };
305
- function gt(e) {
306
- const { id: t, label: n, baseUrl: s, path: l, init: a, fallbackToFixture: r = !0 } = e;
274
+ function Ct(e) {
275
+ const { id: o, label: a, baseUrl: i, path: d, init: r, fallbackToFixture: n = !0 } = e;
307
276
  return {
308
- id: t,
309
- label: n,
277
+ id: o,
278
+ label: a,
310
279
  load: async (c) => {
311
- const h = new URL(l ? l(c) : c.scenario.route, s);
280
+ const h = new URL(d ? d(c) : c.scenario.route, i);
312
281
  try {
313
- const p = await fetch(h, a);
314
- if (!p.ok) throw new Error(`${p.status} ${p.statusText}`);
315
- return await p.json();
316
- } catch (p) {
317
- if (r) return X(c.fixture);
318
- throw new Error(`Adapter "${t}" falhou em ${h.toString()}`, { cause: p });
282
+ const u = await fetch(h, r);
283
+ if (!u.ok) throw new Error(`${u.status} ${u.statusText}`);
284
+ return await u.json();
285
+ } catch (u) {
286
+ if (n) return se(c.fixture);
287
+ throw new Error(`Adapter "${o}" falhou em ${h.toString()}`, { cause: u });
319
288
  }
320
289
  }
321
290
  };
322
291
  }
323
- function Le(e) {
324
- return new Promise((t) => setTimeout(t, e));
292
+ function We(e) {
293
+ return new Promise((o) => setTimeout(o, e));
325
294
  }
326
- function $e(e) {
327
- const { scenario: t, fixture: n, network: s, adapter: l } = e, [a, r] = $({
295
+ function ze(e) {
296
+ const { scenario: o, fixture: a, network: i, adapter: d } = e, [r, n] = F({
328
297
  data: void 0,
329
- isLoading: !!t,
298
+ isLoading: !!o,
330
299
  error: void 0
331
300
  });
332
- return I(() => {
333
- if (!t) {
334
- r({ data: void 0, isLoading: !1, error: void 0 });
301
+ return D(() => {
302
+ if (!o) {
303
+ n({ data: void 0, isLoading: !1, error: void 0 });
335
304
  return;
336
305
  }
337
306
  let c = !0;
338
- r({ data: void 0, isLoading: !0, error: void 0 });
339
- const h = l ?? Z;
340
- return Promise.resolve(h.load({ scenario: t, fixture: n, network: s })).then((p) => {
341
- c && r({ data: p, isLoading: !1, error: void 0 });
342
- }).catch((p) => {
343
- c && r({
307
+ n({ data: void 0, isLoading: !0, error: void 0 });
308
+ const h = d ?? ie;
309
+ return Promise.resolve(h.load({ scenario: o, fixture: a, network: i })).then((u) => {
310
+ c && n({ data: u, isLoading: !1, error: void 0 });
311
+ }).catch((u) => {
312
+ c && n({
344
313
  data: void 0,
345
314
  isLoading: !1,
346
- error: p instanceof Error ? p : new Error(String(p))
315
+ error: u instanceof Error ? u : new Error(String(u))
347
316
  });
348
317
  }), () => {
349
318
  c = !1;
350
319
  };
351
- }, [t, n, s, l]), a;
320
+ }, [o, a, i, d]), r;
352
321
  }
353
- const Ee = {
322
+ const Ue = {
354
323
  a: "link",
355
324
  article: "article",
356
325
  aside: "complementary",
@@ -384,7 +353,7 @@ const Ee = {
384
353
  th: "columnheader",
385
354
  tr: "row",
386
355
  ul: "list"
387
- }, Fe = {
356
+ }, je = {
388
357
  button: "button",
389
358
  checkbox: "checkbox",
390
359
  email: "textbox",
@@ -399,88 +368,88 @@ const Ee = {
399
368
  text: "textbox",
400
369
  url: "textbox"
401
370
  };
402
- function Re(e) {
371
+ function Ke(e) {
403
372
  if (!e || !(e instanceof HTMLElement)) return;
404
- const { name: t, nameFrom: n } = Oe(e);
373
+ const { name: o, nameFrom: a } = qe(e);
405
374
  return {
406
- role: De(e),
407
- name: t,
408
- nameFrom: n,
409
- description: Ie(e),
410
- states: Be(e),
411
- selector: He(e),
375
+ role: Ve(e),
376
+ name: o,
377
+ nameFrom: a,
378
+ description: Ge(e),
379
+ states: Ye(e),
380
+ selector: Xe(e),
412
381
  hiddenFromTabOrder: e.tabIndex < 0,
413
- hiddenFromAssistiveTech: We(e)
382
+ hiddenFromAssistiveTech: Je(e)
414
383
  };
415
384
  }
416
- function De(e) {
417
- const t = e.getAttribute("role");
418
- if (t) return t.split(/\s+/)[0] ?? t;
419
- const n = e.tagName.toLowerCase();
420
- if (n === "input") {
421
- const s = e.type.toLowerCase();
422
- return Fe[s] ?? "textbox";
385
+ function Ve(e) {
386
+ const o = e.getAttribute("role");
387
+ if (o) return o.split(/\s+/)[0] ?? o;
388
+ const a = e.tagName.toLowerCase();
389
+ if (a === "input") {
390
+ const i = e.type.toLowerCase();
391
+ return je[i] ?? "textbox";
423
392
  }
424
- return n === "a" && !e.hasAttribute("href") ? "generic" : Ee[n] ?? "generic";
393
+ return a === "a" && !e.hasAttribute("href") ? "generic" : Ue[a] ?? "generic";
425
394
  }
426
- function Oe(e) {
427
- const t = e.getAttribute("aria-labelledby");
428
- if (t) {
429
- const r = t.split(/\s+/).map((c) => e.ownerDocument.getElementById(c)?.textContent?.trim() ?? "").filter(Boolean).join(" ");
430
- if (r) return { name: r, nameFrom: "aria-labelledby" };
395
+ function qe(e) {
396
+ const o = e.getAttribute("aria-labelledby");
397
+ if (o) {
398
+ const n = o.split(/\s+/).map((c) => e.ownerDocument.getElementById(c)?.textContent?.trim() ?? "").filter(Boolean).join(" ");
399
+ if (n) return { name: n, nameFrom: "aria-labelledby" };
431
400
  }
432
- const n = e.getAttribute("aria-label")?.trim();
433
- if (n) return { name: n, nameFrom: "aria-label" };
401
+ const a = e.getAttribute("aria-label")?.trim();
402
+ if (a) return { name: a, nameFrom: "aria-label" };
434
403
  if (e instanceof HTMLInputElement || e instanceof HTMLSelectElement || e instanceof HTMLTextAreaElement) {
435
- const r = Array.from(e.labels ?? []).map((c) => c.textContent?.trim() ?? "").filter(Boolean);
436
- if (r.length) return { name: r.join(" "), nameFrom: "label" };
404
+ const n = Array.from(e.labels ?? []).map((c) => c.textContent?.trim() ?? "").filter(Boolean);
405
+ if (n.length) return { name: n.join(" "), nameFrom: "label" };
437
406
  }
438
407
  if (e instanceof HTMLImageElement) {
439
- const r = e.getAttribute("alt");
440
- if (r !== null) return { name: r, nameFrom: "alt" };
408
+ const n = e.getAttribute("alt");
409
+ if (n !== null) return { name: n, nameFrom: "alt" };
441
410
  }
442
- const s = e.getAttribute("title")?.trim(), l = je(e);
443
- return l ? { name: l, nameFrom: "content" } : s ? { name: s, nameFrom: "title" } : e instanceof HTMLInputElement && e.value ? { name: e.value, nameFrom: "value" } : e.getAttribute("placeholder")?.trim() ? { name: "", nameFrom: "none" } : { name: "", nameFrom: "none" };
411
+ const i = e.getAttribute("title")?.trim(), d = Qe(e);
412
+ return d ? { name: d, nameFrom: "content" } : i ? { name: i, nameFrom: "title" } : e instanceof HTMLInputElement && e.value ? { name: e.value, nameFrom: "value" } : e.getAttribute("placeholder")?.trim() ? { name: "", nameFrom: "none" } : { name: "", nameFrom: "none" };
444
413
  }
445
- function Ie(e) {
446
- const t = e.getAttribute("aria-describedby");
447
- if (t) {
448
- const n = t.split(/\s+/).map((s) => e.ownerDocument.getElementById(s)?.textContent?.trim() ?? "").filter(Boolean).join(" ");
449
- if (n) return n;
414
+ function Ge(e) {
415
+ const o = e.getAttribute("aria-describedby");
416
+ if (o) {
417
+ const a = o.split(/\s+/).map((i) => e.ownerDocument.getElementById(i)?.textContent?.trim() ?? "").filter(Boolean).join(" ");
418
+ if (a) return a;
450
419
  }
451
420
  return e.getAttribute("aria-description")?.trim() || void 0;
452
421
  }
453
- function Be(e) {
454
- const t = [], n = (s, l = s.replace("aria-", "")) => {
455
- const a = e.getAttribute(s);
456
- a !== null && a !== "false" && t.push(a === "true" || a === "" ? l : `${l}=${a}`);
422
+ function Ye(e) {
423
+ const o = [], a = (i, d = i.replace("aria-", "")) => {
424
+ const r = e.getAttribute(i);
425
+ r !== null && r !== "false" && o.push(r === "true" || r === "" ? d : `${d}=${r}`);
457
426
  };
458
- return e.disabled && t.push("disabled"), e.getAttribute("aria-disabled") === "true" && t.push("disabled"), e.required && t.push("required"), e.readOnly && t.push("readonly"), e.checked && t.push("checked"), n("aria-expanded"), n("aria-selected"), n("aria-checked"), n("aria-pressed"), n("aria-current"), n("aria-invalid"), n("aria-busy"), n("aria-live"), n("aria-haspopup"), n("aria-level", "level"), e.ownerDocument.activeElement === e && t.push("focused"), [...new Set(t)];
427
+ return e.disabled && o.push("disabled"), e.getAttribute("aria-disabled") === "true" && o.push("disabled"), e.required && o.push("required"), e.readOnly && o.push("readonly"), e.checked && o.push("checked"), a("aria-expanded"), a("aria-selected"), a("aria-checked"), a("aria-pressed"), a("aria-current"), a("aria-invalid"), a("aria-busy"), a("aria-live"), a("aria-haspopup"), a("aria-level", "level"), e.ownerDocument.activeElement === e && o.push("focused"), [...new Set(o)];
459
428
  }
460
- function We(e) {
461
- let t = e;
462
- for (; t; ) {
463
- if (t.getAttribute("aria-hidden") === "true" || t.hasAttribute("hidden")) return !0;
464
- t = t.parentElement;
429
+ function Je(e) {
430
+ let o = e;
431
+ for (; o; ) {
432
+ if (o.getAttribute("aria-hidden") === "true" || o.hasAttribute("hidden")) return !0;
433
+ o = o.parentElement;
465
434
  }
466
435
  return !1;
467
436
  }
468
- function je(e) {
469
- const t = e.cloneNode(!0);
470
- for (const n of t.querySelectorAll("[aria-hidden='true'],[hidden]"))
471
- n.remove();
472
- return (t.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, 160);
437
+ function Qe(e) {
438
+ const o = e.cloneNode(!0);
439
+ for (const a of o.querySelectorAll("[aria-hidden='true'],[hidden]"))
440
+ a.remove();
441
+ return (o.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, 160);
473
442
  }
474
- function He(e) {
475
- const t = e.tagName.toLowerCase();
476
- if (e.id) return `${t}#${e.id}`;
477
- const n = e.getAttribute("data-testid");
478
- if (n) return `${t}[data-testid="${n}"]`;
479
- const s = Array.from(e.classList).slice(0, 2);
480
- return s.length ? `${t}.${s.join(".")}` : t;
443
+ function Xe(e) {
444
+ const o = e.tagName.toLowerCase();
445
+ if (e.id) return `${o}#${e.id}`;
446
+ const a = e.getAttribute("data-testid");
447
+ if (a) return `${o}[data-testid="${a}"]`;
448
+ const i = Array.from(e.classList).slice(0, 2);
449
+ return i.length ? `${o}.${i.join(".")}` : o;
481
450
  }
482
- function Ke(e = document) {
483
- const t = [
451
+ function Ze(e = document) {
452
+ const o = [
484
453
  "a[href]",
485
454
  "button",
486
455
  "input",
@@ -490,40 +459,40 @@ function Ke(e = document) {
490
459
  "[tabindex]",
491
460
  "[contenteditable='true']"
492
461
  ].join(",");
493
- return Array.from(e.querySelectorAll(t)).filter((n) => {
494
- if (n.tabIndex < 0 || n.disabled || n.getAttribute("aria-hidden") === "true") return !1;
495
- const s = window.getComputedStyle(n);
496
- return s.display === "none" || s.visibility === "hidden" ? !1 : n.offsetWidth > 0 || n.offsetHeight > 0 || n === document.activeElement;
462
+ return Array.from(e.querySelectorAll(o)).filter((a) => {
463
+ if (a.tabIndex < 0 || a.disabled || a.getAttribute("aria-hidden") === "true") return !1;
464
+ const i = window.getComputedStyle(a);
465
+ return i.display === "none" || i.visibility === "hidden" ? !1 : a.offsetWidth > 0 || a.offsetHeight > 0 || a === document.activeElement;
497
466
  });
498
467
  }
499
- function ze(e, t) {
500
- const [n, s] = $(), [l, a] = $([]), r = E(() => {
501
- const c = t.current;
468
+ function et(e, o) {
469
+ const [a, i] = F(), [d, r] = F([]), n = R(() => {
470
+ const c = o.current;
502
471
  if (!c) {
503
- a([]);
472
+ r([]);
504
473
  return;
505
474
  }
506
- a(
507
- Ke(c).map((h, p) => ({
508
- index: p + 1,
475
+ r(
476
+ Ze(c).map((h, u) => ({
477
+ index: u + 1,
509
478
  element: h,
510
479
  rect: h.getBoundingClientRect(),
511
480
  forcedOrder: h.tabIndex > 0
512
481
  }))
513
482
  );
514
- }, [t]);
515
- return I(() => {
483
+ }, [o]);
484
+ return D(() => {
516
485
  if (!e) {
517
- s(void 0), a([]);
486
+ i(void 0), r([]);
518
487
  return;
519
488
  }
520
- const c = () => s(Re(document.activeElement));
521
- document.addEventListener("focusin", c), window.addEventListener("resize", r), window.addEventListener("scroll", r, !0), c(), r();
522
- const h = t.current, p = h ? new MutationObserver(() => r()) : void 0;
523
- return p?.observe(h, { childList: !0, subtree: !0, attributes: !0 }), () => {
524
- document.removeEventListener("focusin", c), window.removeEventListener("resize", r), window.removeEventListener("scroll", r, !0), p?.disconnect();
489
+ const c = () => i(Ke(document.activeElement));
490
+ document.addEventListener("focusin", c), window.addEventListener("resize", n), window.addEventListener("scroll", n, !0), c(), n();
491
+ const h = o.current, u = h ? new MutationObserver(() => n()) : void 0;
492
+ return u?.observe(h, { childList: !0, subtree: !0, attributes: !0 }), () => {
493
+ document.removeEventListener("focusin", c), window.removeEventListener("resize", n), window.removeEventListener("scroll", n, !0), u?.disconnect();
525
494
  };
526
- }, [e, r, t]), { focused: n, tabStops: l, refresh: r };
495
+ }, [e, n, o]), { focused: a, tabStops: d, refresh: n };
527
496
  }
528
497
  const L = {
529
498
  status: {
@@ -639,7 +608,15 @@ const L = {
639
608
  componentGroup: "Grupo",
640
609
  componentFixture: "Fixture ativa",
641
610
  componentFixtureDescription: "Descrição da fixture",
642
- componentFixtureFallback: (e, t) => `A fixture \`${e}\` não existe neste componente. Exibindo \`${t}\` como fallback.`,
611
+ componentFixtureFallback: (e, o) => `A fixture \`${e}\` não existe neste componente. Exibindo \`${o}\` como fallback.`,
612
+ taskScope: "Dados desta tarefa",
613
+ taskScopeDescription: "Contrato e estado autorizados para a situação ativa.",
614
+ inheritedScope: "Contexto herdado do produto e da persona",
615
+ inheritedScopeDescription: "Informações compartilhadas que ajudam a interpretar a tarefa, mas não pertencem só a ela.",
616
+ screenScope: "Inspeção da tela atual",
617
+ screenScopeDescription: "Leitura ao vivo do que está renderizado no palco agora.",
618
+ productScope: "Verificações gerais do produto",
619
+ productScopeDescription: "Resultados compartilhados por todo o catálogo, não só por esta tarefa.",
643
620
  situation: "Situação",
644
621
  reproduction: "Reprodução",
645
622
  id: "Id",
@@ -655,6 +632,9 @@ const L = {
655
632
  actions: "Ações disponíveis",
656
633
  expected: "Critérios de aceite",
657
634
  approval: "Aprovação",
635
+ approvalPendingStatus: "Aprovado — registro pendente",
636
+ approvalPendingMeaning: "O status foi marcado como aprovado, mas ainda não há URL de commit que registre a versão autorizada.",
637
+ approvalMissing: "A aprovação ainda não está completamente registrada. Preencha approvedAt com a URL imutável do commit aprovado.",
658
638
  openApproved: "Abrir a versão aprovada",
659
639
  engineering: "Engenharia",
660
640
  a11yContract: "Contrato do cenário",
@@ -682,7 +662,8 @@ const L = {
682
662
  coverage: "Cobertura por status",
683
663
  scenariosRegistered: (e) => `${e} cenários registrados.`,
684
664
  scenarioContract: "Contrato de cenário",
685
- noIssues: "Nenhum problema encontrado."
665
+ noIssues: "Nenhum problema encontrado.",
666
+ diagnosticsProductNotice: "Este diagnóstico avalia o catálogo inteiro do produto, inclusive itens fora da tarefa e do handoff ativos."
686
667
  },
687
668
  home: {
688
669
  lead: (e) => `Especificação executável: cada situação abaixo abre por link, com persona, dados e regras próprios. ${e} ${e === 1 ? "situação registrada" : "situações registradas"}.`,
@@ -697,9 +678,11 @@ const L = {
697
678
  shell: {
698
679
  restoreChrome: "Mostrar controles",
699
680
  noRoute: "Nenhuma rota para este endereço",
700
- noRouteHint: "não casa com nenhuma rota declarada. Escolha uma situação na navegação."
681
+ noRouteHint: "não casa com nenhuma rota declarada. Escolha uma situação na navegação.",
682
+ outsideHandoff: "Fora do escopo deste handoff",
683
+ outsideHandoffHint: "Este link permite revisar somente os cenários, rotas e componentes listados no handoff. Escolha um item disponível na navegação."
701
684
  }
702
- }, wt = {
685
+ }, Tt = {
703
686
  status: {
704
687
  ported: "Ported — not validated",
705
688
  proposed: "Proposed",
@@ -813,7 +796,15 @@ const L = {
813
796
  componentGroup: "Group",
814
797
  componentFixture: "Active fixture",
815
798
  componentFixtureDescription: "Fixture description",
816
- componentFixtureFallback: (e, t) => `Fixture \`${e}\` does not exist for this component. Showing \`${t}\` as fallback.`,
799
+ componentFixtureFallback: (e, o) => `Fixture \`${e}\` does not exist for this component. Showing \`${o}\` as fallback.`,
800
+ taskScope: "This task",
801
+ taskScopeDescription: "The contract and authorized state for the active scenario.",
802
+ inheritedScope: "Inherited product and persona context",
803
+ inheritedScopeDescription: "Shared information that helps interpret the task but does not belong only to it.",
804
+ screenScope: "Current screen inspection",
805
+ screenScopeDescription: "A live reading of what is rendered in the stage now.",
806
+ productScope: "Product-wide checks",
807
+ productScopeDescription: "Results shared across the catalog, not only this task.",
817
808
  situation: "State",
818
809
  reproduction: "Reproduction",
819
810
  id: "ID",
@@ -829,6 +820,9 @@ const L = {
829
820
  actions: "Available actions",
830
821
  expected: "Acceptance criteria",
831
822
  approval: "Approval",
823
+ approvalPendingStatus: "Approved — record pending",
824
+ approvalPendingMeaning: "The status is approved, but there is no commit URL recording the authorized version yet.",
825
+ approvalMissing: "Approval is not fully recorded yet. Fill approvedAt with the immutable URL of the approved commit.",
832
826
  openApproved: "Open approved version",
833
827
  engineering: "Engineering",
834
828
  a11yContract: "Scenario contract",
@@ -856,7 +850,8 @@ const L = {
856
850
  coverage: "Coverage by status",
857
851
  scenariosRegistered: (e) => `${e} ${e === 1 ? "scenario" : "scenarios"} registered.`,
858
852
  scenarioContract: "Scenario contract",
859
- noIssues: "No issues found."
853
+ noIssues: "No issues found.",
854
+ diagnosticsProductNotice: "These diagnostics evaluate the entire product catalog, including items outside the active task and handoff."
860
855
  },
861
856
  home: {
862
857
  lead: (e) => `Executable specification: each state below opens from a link with its own persona, data, and rules. ${e} ${e === 1 ? "state registered" : "states registered"}.`,
@@ -871,370 +866,383 @@ const L = {
871
866
  shell: {
872
867
  restoreChrome: "Show controls",
873
868
  noRoute: "No route for this address",
874
- noRouteHint: "does not match any declared route. Choose a state from the navigation."
869
+ noRouteHint: "does not match any declared route. Choose a state from the navigation.",
870
+ outsideHandoff: "Outside this handoff scope",
871
+ outsideHandoffHint: "This link only allows review of the scenarios, routes, and components listed in the handoff. Choose an available item from the navigation."
875
872
  }
876
873
  };
877
- function Ue(e) {
874
+ function tt(e) {
878
875
  if (!e) return L;
879
- const t = { ...L };
880
- for (const n of Object.keys(L)) {
881
- const s = e[n];
882
- s && (t[n] = { ...L[n], ...s });
876
+ const o = { ...L };
877
+ for (const a of Object.keys(L)) {
878
+ const i = e[a];
879
+ i && (o[a] = { ...L[a], ...i });
883
880
  }
884
- return t;
881
+ return o;
885
882
  }
886
- const de = he(L);
883
+ const we = Se(L);
887
884
  function P() {
888
- return ue(de);
885
+ return Ne(we);
889
886
  }
890
- const kt = L.status, Nt = L.statusMeaning, xt = L.network, yt = L.keyboard;
891
- function Ve({
887
+ const At = L.status, Pt = L.statusMeaning, Lt = L.network, Ft = L.keyboard;
888
+ function ot({
892
889
  registry: e,
893
- activeScenario: t,
894
- activeComponent: n,
895
- controls: s,
896
- onOpenScenario: l,
897
- onOpenComponent: a,
898
- onViewChange: r
890
+ activeScenario: o,
891
+ activeComponent: a,
892
+ controls: i,
893
+ onOpenScenario: d,
894
+ onOpenComponent: r,
895
+ onViewChange: n
899
896
  }) {
900
- const c = P(), [h, p] = $(n ? "components" : "flows"), [m, v] = $(""), [i, N] = $(/* @__PURE__ */ new Set()), x = Q(null), S = Q(/* @__PURE__ */ new Map()), d = ee(s), f = e.byStatus("ported").length, k = e.activeScenarios({ view: d }).length, M = d === "ported" ? c.sidebar.portedReferences(f) : c.sidebar.activeWork;
901
- I(() => {
902
- n ? p("components") : t && p("flows");
903
- }, [n, t]), I(() => {
904
- const b = (w) => {
905
- Ye(w) && (w.preventDefault(), x.current?.focus(), x.current?.select());
897
+ const c = P(), [h, u] = F(a ? "components" : "flows"), [g, f] = F(""), [p, b] = F(/* @__PURE__ */ new Set()), S = re(null), _ = re(/* @__PURE__ */ new Map()), s = ce(i), m = i.handoff, k = e.byStatus("ported", { handoff: m }).length, M = e.activeScenarios({ view: s, handoff: m }).length, y = s === "ported" ? c.sidebar.portedReferences(k) : c.sidebar.activeWork;
898
+ D(() => {
899
+ a ? u("components") : o && u("flows");
900
+ }, [a, o]), D(() => {
901
+ const v = (x) => {
902
+ rt(x) && (x.preventDefault(), S.current?.focus(), S.current?.select());
906
903
  };
907
- return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
904
+ return window.addEventListener("keydown", v), () => window.removeEventListener("keydown", v);
908
905
  }, []);
909
- const _ = C(() => {
910
- if (m.trim())
906
+ const E = T(() => {
907
+ if (g.trim())
911
908
  return new Set(
912
- e.search(m, { view: d }).map((b) => b.id)
909
+ e.search(g, { view: s, handoff: m }).map((v) => v.id)
913
910
  );
914
- }, [m, e, d]), T = C(() => {
915
- const b = re(m);
916
- return (e.product.components ?? []).filter(
917
- (w) => re([w.name, w.id, w.group, w.description].join(" ")).includes(
918
- b
911
+ }, [m, g, e, s]), $ = T(() => {
912
+ const v = me(g);
913
+ return e.componentsFor(m).filter(
914
+ (x) => me([x.name, x.id, x.group, x.description].join(" ")).includes(
915
+ v
919
916
  )
920
917
  );
921
- }, [m, e.product.components]), B = (b) => _ ? b.filter((w) => _.has(w.id)) : b, W = {
922
- view: d
923
- }, F = e.treeFor(W).map((b) => ({ ...b, scenarios: B(b.scenarios) })).filter((b) => b.scenarios.length > 0), R = B(e.orphansFor(W)), D = F.reduce((b, w) => b + w.scenarios.length, 0) + R.length, j = qe(T), z = h === "flows" ? [...F.flatMap((b) => b.scenarios), ...R].map((b) => b.id) : T.map((b) => b.id), O = (b, w) => {
924
- if (z.length === 0) return;
925
- const y = Je(z, b, w);
926
- y && S.current.get(y)?.focus();
927
- }, U = (b) => {
928
- b.key === "ArrowDown" ? (b.preventDefault(), O(void 0, 1)) : b.key === "Escape" && v("");
929
- }, H = (b, w) => {
930
- w.key !== "ArrowDown" && w.key !== "ArrowUp" || (w.preventDefault(), O(b, w.key === "ArrowDown" ? 1 : -1));
931
- }, K = (b, w) => {
932
- w ? S.current.set(b, w) : S.current.delete(b);
933
- }, V = (b) => N((w) => {
934
- const y = new Set(w);
935
- return y.has(b) ? y.delete(b) : y.add(b), y;
918
+ }, [m, g, e]), O = (v) => E ? v.filter((x) => E.has(x.id)) : v, G = {
919
+ view: s,
920
+ handoff: m
921
+ }, I = e.treeFor(G).map((v) => ({ ...v, scenarios: O(v.scenarios) })).filter((v) => v.scenarios.length > 0), B = O(e.orphansFor(G)), U = I.reduce((v, x) => v + x.scenarios.length, 0) + B.length, H = nt($), j = h === "flows" ? [...I.flatMap((v) => v.scenarios), ...B].map((v) => v.id) : $.map((v) => v.id), Y = (v, x) => {
922
+ if (j.length === 0) return;
923
+ const N = st(j, v, x);
924
+ N && _.current.get(N)?.focus();
925
+ }, K = (v) => {
926
+ v.key === "ArrowDown" ? (v.preventDefault(), Y(void 0, 1)) : v.key === "Escape" && f("");
927
+ }, V = (v, x) => {
928
+ x.key !== "ArrowDown" && x.key !== "ArrowUp" || (x.preventDefault(), Y(v, x.key === "ArrowDown" ? 1 : -1));
929
+ }, q = (v, x) => {
930
+ x ? _.current.set(v, x) : _.current.delete(v);
931
+ }, J = (v) => b((x) => {
932
+ const N = new Set(x);
933
+ return N.has(v) ? N.delete(v) : N.add(v), N;
936
934
  });
937
- return /* @__PURE__ */ u("nav", { className: "ds-chrome ds-sidebar", "aria-label": c.sidebar.region, children: [
938
- /* @__PURE__ */ u("div", { className: "ds-sidebar__tabs", role: "tablist", children: [
939
- /* @__PURE__ */ o(
935
+ return /* @__PURE__ */ l("nav", { className: "ds-chrome ds-sidebar", "aria-label": c.sidebar.region, children: [
936
+ /* @__PURE__ */ l("div", { className: "ds-sidebar__tabs", role: "tablist", children: [
937
+ /* @__PURE__ */ t(
940
938
  "button",
941
939
  {
942
940
  type: "button",
943
941
  role: "tab",
944
942
  "aria-selected": h === "flows",
945
943
  onClick: () => {
946
- p("flows"), v("");
944
+ u("flows"), f("");
947
945
  },
948
946
  children: c.sidebar.flowsTab
949
947
  }
950
948
  ),
951
- /* @__PURE__ */ o(
949
+ /* @__PURE__ */ t(
952
950
  "button",
953
951
  {
954
952
  type: "button",
955
953
  role: "tab",
956
954
  "aria-selected": h === "components",
957
955
  onClick: () => {
958
- p("components"), v("");
956
+ u("components"), f("");
959
957
  },
960
958
  children: c.sidebar.componentsTab
961
959
  }
962
960
  )
963
961
  ] }),
964
- /* @__PURE__ */ u("div", { className: "ds-sidebar__search", children: [
965
- /* @__PURE__ */ o(
962
+ /* @__PURE__ */ l("div", { className: "ds-sidebar__search", children: [
963
+ /* @__PURE__ */ t(
966
964
  "input",
967
965
  {
968
- ref: x,
966
+ ref: S,
969
967
  className: "ds-input ds-input--search",
970
968
  type: "search",
971
- value: m,
969
+ value: g,
972
970
  placeholder: h === "flows" ? c.sidebar.searchPlaceholder : c.sidebar.componentSearchPlaceholder,
973
971
  "aria-label": h === "flows" ? c.sidebar.searchLabel : c.sidebar.componentSearchLabel,
974
- onChange: (b) => v(b.target.value),
975
- onKeyDown: U
972
+ onChange: (v) => f(v.target.value),
973
+ onKeyDown: K
976
974
  }
977
975
  ),
978
- /* @__PURE__ */ o("kbd", { children: c.sidebar.searchShortcut })
976
+ /* @__PURE__ */ t("kbd", { children: c.sidebar.searchShortcut })
979
977
  ] }),
980
- /* @__PURE__ */ u(
978
+ /* @__PURE__ */ l(
981
979
  "div",
982
980
  {
983
981
  className: "ds-sidebar__tree",
984
982
  role: "tabpanel",
985
- "aria-label": h === "flows" ? c.sidebar.currentView(M) : void 0,
983
+ "aria-label": h === "flows" ? c.sidebar.currentView(y) : void 0,
986
984
  children: [
987
- h === "flows" && /* @__PURE__ */ u("header", { className: "ds-sidebar__view-header", children: [
988
- /* @__PURE__ */ o("h2", { children: M }),
989
- d === "ported" && /* @__PURE__ */ o(
985
+ h === "flows" && /* @__PURE__ */ l("header", { className: "ds-sidebar__view-header", children: [
986
+ /* @__PURE__ */ t("h2", { children: y }),
987
+ s === "ported" && /* @__PURE__ */ t(
990
988
  "button",
991
989
  {
992
990
  type: "button",
993
991
  className: "ds-text-action",
994
- onClick: () => r("active"),
992
+ onClick: () => n("active"),
995
993
  children: c.sidebar.backToActive
996
994
  }
997
995
  )
998
996
  ] }),
999
- m.trim() !== "" && /* @__PURE__ */ o("p", { className: "ds-sidebar__empty", role: "status", children: h === "flows" ? D === 0 ? c.sidebar.noMatch(m) : c.sidebar.matchCount(D) : T.length === 0 ? c.sidebar.noComponentMatch(m) : c.sidebar.componentMatchCount(T.length) }),
1000
- h === "flows" && m.trim() === "" && k === 0 ? /* @__PURE__ */ u("div", { className: "ds-sidebar__view-empty", children: [
1001
- /* @__PURE__ */ o("p", { children: d === "ported" ? c.sidebar.noPortedReferences : c.sidebar.noActiveWork }),
1002
- d === "active" && f > 0 && /* @__PURE__ */ o(
997
+ g.trim() !== "" && /* @__PURE__ */ t("p", { className: "ds-sidebar__empty", role: "status", children: h === "flows" ? U === 0 ? c.sidebar.noMatch(g) : c.sidebar.matchCount(U) : $.length === 0 ? c.sidebar.noComponentMatch(g) : c.sidebar.componentMatchCount($.length) }),
998
+ h === "flows" && g.trim() === "" && M === 0 ? /* @__PURE__ */ l("div", { className: "ds-sidebar__view-empty", children: [
999
+ /* @__PURE__ */ t("p", { children: s === "ported" ? c.sidebar.noPortedReferences : c.sidebar.noActiveWork }),
1000
+ s === "active" && k > 0 && /* @__PURE__ */ t(
1003
1001
  "button",
1004
1002
  {
1005
1003
  type: "button",
1006
1004
  className: "ds-text-action",
1007
- onClick: () => r("ported"),
1008
- children: c.sidebar.viewPorted(f)
1005
+ onClick: () => n("ported"),
1006
+ children: c.sidebar.viewPorted(k)
1009
1007
  }
1010
1008
  )
1011
- ] }) : h === "flows" ? /* @__PURE__ */ o(
1012
- Ge,
1009
+ ] }) : h === "flows" ? /* @__PURE__ */ t(
1010
+ at,
1013
1011
  {
1014
- nodes: F,
1015
- orphans: R,
1016
- matches: _,
1017
- collapsed: i,
1018
- activeScenario: t?.id,
1012
+ nodes: I,
1013
+ orphans: B,
1014
+ matches: E,
1015
+ collapsed: p,
1016
+ activeScenario: o?.id,
1019
1017
  withoutModuleLabel: c.sidebar.withoutModule,
1020
- onToggle: V,
1021
- onOpen: l,
1022
- onKeyDown: H,
1023
- setItemRef: K
1018
+ onToggle: J,
1019
+ onOpen: d,
1020
+ onKeyDown: V,
1021
+ setItemRef: q
1024
1022
  }
1025
- ) : j.length === 0 && !m ? /* @__PURE__ */ o("p", { className: "ds-sidebar__empty", children: c.sidebar.emptyComponents }) : j.map(([b, w]) => /* @__PURE__ */ u("section", { className: "ds-component-group", children: [
1026
- /* @__PURE__ */ o("h2", { children: b }),
1027
- /* @__PURE__ */ o("ul", { children: w.map((y) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ u(
1023
+ ) : H.length === 0 && !g ? /* @__PURE__ */ t("p", { className: "ds-sidebar__empty", children: c.sidebar.emptyComponents }) : H.map(([v, x]) => /* @__PURE__ */ l("section", { className: "ds-component-group", children: [
1024
+ /* @__PURE__ */ t("h2", { children: v }),
1025
+ /* @__PURE__ */ t("ul", { children: x.map((N) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ l(
1028
1026
  "button",
1029
1027
  {
1030
- ref: (G) => K(y.id, G),
1028
+ ref: (C) => q(N.id, C),
1031
1029
  type: "button",
1032
1030
  className: "ds-component-item",
1033
- "aria-current": y.id === n,
1034
- onClick: () => a(y.id),
1035
- onKeyDown: (G) => H(y.id, G),
1031
+ "aria-current": N.id === a,
1032
+ onClick: () => r(N.id),
1033
+ onKeyDown: (C) => V(N.id, C),
1036
1034
  children: [
1037
- /* @__PURE__ */ o("span", { children: y.name }),
1038
- y.description && /* @__PURE__ */ o("small", { children: y.description })
1035
+ /* @__PURE__ */ t("span", { children: N.name }),
1036
+ N.description && /* @__PURE__ */ t("small", { children: N.description })
1039
1037
  ]
1040
1038
  }
1041
- ) }, y.id)) })
1042
- ] }, b))
1039
+ ) }, N.id)) })
1040
+ ] }, v))
1043
1041
  ]
1044
1042
  }
1045
1043
  ),
1046
- h === "flows" && d === "active" && k > 0 && f > 0 && /* @__PURE__ */ o("div", { className: "ds-sidebar__view-footer", children: /* @__PURE__ */ o(
1044
+ h === "flows" && s === "active" && M > 0 && k > 0 && /* @__PURE__ */ t("div", { className: "ds-sidebar__view-footer", children: /* @__PURE__ */ t(
1047
1045
  "button",
1048
1046
  {
1049
1047
  type: "button",
1050
1048
  className: "ds-text-action",
1051
- onClick: () => r("ported"),
1052
- children: c.sidebar.viewPorted(f)
1049
+ onClick: () => n("ported"),
1050
+ children: c.sidebar.viewPorted(k)
1053
1051
  }
1054
1052
  ) }),
1055
- h === "flows" && t && /* @__PURE__ */ u("aside", { className: "ds-sidebar__scope", "aria-label": c.sidebar.scope, children: [
1056
- /* @__PURE__ */ o("h2", { children: c.sidebar.scope }),
1057
- /* @__PURE__ */ u("dl", { children: [
1058
- /* @__PURE__ */ o("dt", { children: c.sidebar.scopeData }),
1059
- /* @__PURE__ */ o("dd", { children: e.fixture(s.fixture ?? t.fixture)?.label ?? c.controls.none }),
1060
- /* @__PURE__ */ o("dt", { children: c.sidebar.scopePersona }),
1061
- /* @__PURE__ */ o("dd", { children: e.persona(s.persona ?? t.persona)?.name ?? c.controls.none }),
1062
- /* @__PURE__ */ o("dt", { children: c.sidebar.scopeNetwork }),
1063
- /* @__PURE__ */ o("dd", { children: c.network[s.network] })
1053
+ h === "flows" && o && /* @__PURE__ */ l("aside", { className: "ds-sidebar__scope", "aria-label": c.sidebar.scope, children: [
1054
+ /* @__PURE__ */ t("h2", { children: c.sidebar.scope }),
1055
+ /* @__PURE__ */ l("dl", { children: [
1056
+ /* @__PURE__ */ t("dt", { children: c.sidebar.scopeData }),
1057
+ /* @__PURE__ */ t("dd", { children: e.fixture(i.fixture ?? o.fixture)?.label ?? c.controls.none }),
1058
+ /* @__PURE__ */ t("dt", { children: c.sidebar.scopePersona }),
1059
+ /* @__PURE__ */ t("dd", { children: e.persona(i.persona ?? o.persona)?.name ?? c.controls.none }),
1060
+ /* @__PURE__ */ t("dt", { children: c.sidebar.scopeNetwork }),
1061
+ /* @__PURE__ */ t("dd", { children: c.network[i.network] })
1064
1062
  ] })
1065
1063
  ] })
1066
1064
  ] });
1067
1065
  }
1068
- function Ge(e) {
1069
- return /* @__PURE__ */ u(A, { children: [
1070
- e.nodes.map((t) => {
1071
- const n = !e.collapsed.has(t.module.id) || !!e.matches;
1072
- return /* @__PURE__ */ u("section", { className: "ds-module", children: [
1073
- /* @__PURE__ */ u(
1066
+ function at(e) {
1067
+ return /* @__PURE__ */ l(A, { children: [
1068
+ e.nodes.map((o) => {
1069
+ const a = !e.collapsed.has(o.module.id) || !!e.matches;
1070
+ return /* @__PURE__ */ l("section", { className: "ds-module", children: [
1071
+ /* @__PURE__ */ l(
1074
1072
  "button",
1075
1073
  {
1076
1074
  type: "button",
1077
1075
  className: "ds-module__header",
1078
- "aria-expanded": n,
1079
- onClick: () => e.onToggle(t.module.id),
1076
+ "aria-expanded": a,
1077
+ onClick: () => e.onToggle(o.module.id),
1080
1078
  children: [
1081
- /* @__PURE__ */ o("span", { className: "ds-module__chevron", "aria-hidden": "true", children: "▶" }),
1082
- /* @__PURE__ */ o("span", { children: t.module.name }),
1083
- /* @__PURE__ */ o("span", { className: "ds-module__count", children: t.scenarios.length })
1079
+ /* @__PURE__ */ t("span", { className: "ds-module__chevron", "aria-hidden": "true", children: "▶" }),
1080
+ /* @__PURE__ */ t("span", { children: o.module.name }),
1081
+ /* @__PURE__ */ t("span", { className: "ds-module__count", children: o.scenarios.length })
1084
1082
  ]
1085
1083
  }
1086
1084
  ),
1087
- n && /* @__PURE__ */ o("ul", { className: "ds-module__scenarios", children: t.scenarios.map((s) => /* @__PURE__ */ o(ae, { scenario: s, ...e }, s.id)) })
1088
- ] }, t.module.id);
1085
+ a && /* @__PURE__ */ t("ul", { className: "ds-module__scenarios", children: o.scenarios.map((i) => /* @__PURE__ */ t(he, { scenario: i, ...e }, i.id)) })
1086
+ ] }, o.module.id);
1089
1087
  }),
1090
- e.orphans.length > 0 && /* @__PURE__ */ u("section", { className: "ds-module", children: [
1091
- /* @__PURE__ */ u("div", { className: "ds-module__header", "aria-hidden": "true", children: [
1092
- /* @__PURE__ */ o("span", { className: "ds-module__chevron", children: "▶" }),
1093
- /* @__PURE__ */ o("span", { children: e.withoutModuleLabel }),
1094
- /* @__PURE__ */ o("span", { className: "ds-module__count", children: e.orphans.length })
1088
+ e.orphans.length > 0 && /* @__PURE__ */ l("section", { className: "ds-module", children: [
1089
+ /* @__PURE__ */ l("div", { className: "ds-module__header", "aria-hidden": "true", children: [
1090
+ /* @__PURE__ */ t("span", { className: "ds-module__chevron", children: "▶" }),
1091
+ /* @__PURE__ */ t("span", { children: e.withoutModuleLabel }),
1092
+ /* @__PURE__ */ t("span", { className: "ds-module__count", children: e.orphans.length })
1095
1093
  ] }),
1096
- /* @__PURE__ */ o("ul", { className: "ds-module__scenarios", children: e.orphans.map((t) => /* @__PURE__ */ o(ae, { scenario: t, ...e }, t.id)) })
1094
+ /* @__PURE__ */ t("ul", { className: "ds-module__scenarios", children: e.orphans.map((o) => /* @__PURE__ */ t(he, { scenario: o, ...e }, o.id)) })
1097
1095
  ] })
1098
1096
  ] });
1099
1097
  }
1100
- function ae({
1098
+ function he({
1101
1099
  scenario: e,
1102
- activeScenario: t,
1103
- onOpen: n,
1104
- onKeyDown: s,
1105
- setItemRef: l
1100
+ activeScenario: o,
1101
+ onOpen: a,
1102
+ onKeyDown: i,
1103
+ setItemRef: d
1106
1104
  }) {
1107
- const a = P().status[e.status];
1108
- return /* @__PURE__ */ o("li", { children: /* @__PURE__ */ u(
1105
+ const r = P(), n = e.status === "approved" && !e.approvedAt, c = n ? r.inspector.approvalPendingStatus : r.status[e.status];
1106
+ return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ l(
1109
1107
  "button",
1110
1108
  {
1111
- ref: (r) => l(e.id, r),
1109
+ ref: (h) => d(e.id, h),
1112
1110
  type: "button",
1113
1111
  className: "ds-scenario",
1114
- "aria-current": e.id === t,
1115
- onClick: () => n(e.id),
1116
- onKeyDown: (r) => s(e.id, r),
1112
+ "aria-current": e.id === o,
1113
+ onClick: () => a(e.id),
1114
+ onKeyDown: (h) => i(e.id, h),
1117
1115
  children: [
1118
- /* @__PURE__ */ o("span", { className: "ds-status-dot", "data-status": e.status, title: a }),
1119
- /* @__PURE__ */ o("span", { className: "ds-scenario__title", children: e.title }),
1120
- /* @__PURE__ */ o("span", { className: "ds-visually-hidden", children: a })
1116
+ /* @__PURE__ */ t(
1117
+ "span",
1118
+ {
1119
+ className: "ds-status-dot",
1120
+ "data-status": e.status,
1121
+ "data-approval": n ? "incomplete" : void 0,
1122
+ title: c
1123
+ }
1124
+ ),
1125
+ /* @__PURE__ */ t("span", { className: "ds-scenario__title", children: e.title }),
1126
+ /* @__PURE__ */ t("span", { className: "ds-visually-hidden", children: c })
1121
1127
  ]
1122
1128
  }
1123
1129
  ) });
1124
1130
  }
1125
- function qe(e) {
1126
- const t = /* @__PURE__ */ new Map();
1127
- for (const n of e) {
1128
- const s = n.group ?? "Componentes";
1129
- t.set(s, [...t.get(s) ?? [], n]);
1131
+ function nt(e) {
1132
+ const o = /* @__PURE__ */ new Map();
1133
+ for (const a of e) {
1134
+ const i = a.group ?? "Componentes";
1135
+ o.set(i, [...o.get(i) ?? [], a]);
1130
1136
  }
1131
- return [...t.entries()];
1137
+ return [...o.entries()];
1132
1138
  }
1133
- function re(e) {
1139
+ function me(e) {
1134
1140
  return e.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, "").trim();
1135
1141
  }
1136
- function Ye(e) {
1137
- const t = e.key.toLowerCase();
1138
- return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && (t === "k" || t === "f");
1142
+ function rt(e) {
1143
+ const o = e.key.toLowerCase();
1144
+ return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && (o === "k" || o === "f");
1139
1145
  }
1140
- function Je(e, t, n) {
1146
+ function st(e, o, a) {
1141
1147
  if (e.length === 0) return;
1142
- const s = t ? e.indexOf(t) : -1, l = Math.max(0, Math.min(e.length - 1, s + n));
1143
- return e[l];
1148
+ const i = o ? e.indexOf(o) : -1, d = Math.max(0, Math.min(e.length - 1, i + a));
1149
+ return e[d];
1144
1150
  }
1145
- function Qe({
1151
+ function it({
1146
1152
  product: e,
1147
- scenario: t,
1148
- deploy: n,
1149
- inspectorOpen: s,
1150
- chromeTheme: l,
1151
- view: a,
1152
- onToggleInspector: r,
1153
- onToggleChromeTheme: c
1153
+ scenario: o,
1154
+ deploy: a,
1155
+ inspectorOpen: i,
1156
+ chromeTheme: d,
1157
+ view: r,
1158
+ handoff: n,
1159
+ onToggleInspector: c,
1160
+ onToggleChromeTheme: h
1154
1161
  }) {
1155
- const h = P().topbar, [p, m] = $(!1), v = async () => {
1156
- const x = t ? fe(t, {
1157
- origin: n.origin,
1162
+ const u = P().topbar, [g, f] = F(!1), p = async () => {
1163
+ const _ = o ? Me(o, {
1164
+ origin: a.origin,
1158
1165
  overrides: {
1159
- ...l === "light" ? { chromeTheme: l } : {},
1160
- ...a === "ported" ? { view: a } : {}
1166
+ ...d === "light" ? { chromeTheme: d } : {},
1167
+ ...r === "ported" ? { view: r } : {},
1168
+ ...n ? { handoff: n } : {}
1161
1169
  }
1162
- }) : `${n.origin}${window.location.pathname}${window.location.search}`;
1170
+ }) : `${a.origin}${window.location.pathname}${window.location.search}`;
1163
1171
  try {
1164
- await navigator.clipboard.writeText(x);
1172
+ await navigator.clipboard.writeText(_);
1165
1173
  } catch {
1166
- window.prompt(h.copyPrompt, x);
1174
+ window.prompt(u.copyPrompt, _);
1167
1175
  }
1168
- m(!0), window.setTimeout(() => m(!1), 1600);
1169
- }, i = Xe(
1170
- typeof window > "u" ? `${n.origin}/` : window.location.href
1171
- ), N = Ze(n.origin, l, a);
1172
- return /* @__PURE__ */ u("header", { className: "ds-chrome ds-topbar", children: [
1173
- /* @__PURE__ */ u("div", { className: "ds-topbar__product", children: [
1174
- /* @__PURE__ */ o(
1176
+ f(!0), window.setTimeout(() => f(!1), 1600);
1177
+ }, b = ct(
1178
+ typeof window > "u" ? `${a.origin}/` : window.location.href
1179
+ ), S = dt(a.origin, d, r, n);
1180
+ return /* @__PURE__ */ l("header", { className: "ds-chrome ds-topbar", children: [
1181
+ /* @__PURE__ */ l("div", { className: "ds-topbar__product", children: [
1182
+ /* @__PURE__ */ t(
1175
1183
  "a",
1176
1184
  {
1177
1185
  className: "ds-topbar__home",
1178
- href: N,
1179
- "aria-label": h.homeTitle(e.name),
1180
- title: h.homeTitle(e.name),
1186
+ href: S,
1187
+ "aria-label": u.homeTitle(e.name),
1188
+ title: u.homeTitle(e.name),
1181
1189
  children: e.name
1182
1190
  }
1183
1191
  ),
1184
- e.tagline && /* @__PURE__ */ o("span", { className: "ds-topbar__tagline", children: e.tagline })
1192
+ e.tagline && /* @__PURE__ */ t("span", { className: "ds-topbar__tagline", children: e.tagline })
1185
1193
  ] }),
1186
- /* @__PURE__ */ o("div", { className: "ds-topbar__spacer" }),
1187
- /* @__PURE__ */ u("div", { className: "ds-topbar__meta", children: [
1188
- n.branch && /* @__PURE__ */ o("code", { title: h.branchTitle(n.branch), children: n.branch.length > 28 ? `${n.branch.slice(0, 27)}…` : n.branch }),
1189
- n.commit && /* @__PURE__ */ o("code", { title: h.commitTitle(n.commit), children: n.shortCommit }),
1190
- /* @__PURE__ */ o("code", { title: h.envTitle(n.env), children: n.env })
1194
+ /* @__PURE__ */ t("div", { className: "ds-topbar__spacer" }),
1195
+ /* @__PURE__ */ l("div", { className: "ds-topbar__meta", children: [
1196
+ a.branch && /* @__PURE__ */ t("code", { title: u.branchTitle(a.branch), children: a.branch.length > 28 ? `${a.branch.slice(0, 27)}…` : a.branch }),
1197
+ a.commit && /* @__PURE__ */ t("code", { title: u.commitTitle(a.commit), children: a.shortCommit }),
1198
+ /* @__PURE__ */ t("code", { title: u.envTitle(a.env), children: a.env })
1191
1199
  ] }),
1192
- /* @__PURE__ */ o(
1200
+ /* @__PURE__ */ t(
1193
1201
  "button",
1194
1202
  {
1195
1203
  type: "button",
1196
1204
  className: "ds-btn ds-btn--icon",
1197
- "aria-pressed": l === "light",
1198
- "aria-label": l === "dark" ? h.lightMode : h.darkMode,
1199
- title: l === "dark" ? h.lightMode : h.darkMode,
1200
- onClick: c,
1201
- children: /* @__PURE__ */ o(et, { theme: l })
1205
+ "aria-pressed": d === "light",
1206
+ "aria-label": d === "dark" ? u.lightMode : u.darkMode,
1207
+ title: d === "dark" ? u.lightMode : u.darkMode,
1208
+ onClick: h,
1209
+ children: /* @__PURE__ */ t(lt, { theme: d })
1202
1210
  }
1203
1211
  ),
1204
- /* @__PURE__ */ o("button", { type: "button", className: "ds-btn", onClick: v, children: p ? h.copied : h.copyLink }),
1205
- /* @__PURE__ */ o(
1212
+ /* @__PURE__ */ t("button", { type: "button", className: "ds-btn", onClick: p, children: g ? u.copied : u.copyLink }),
1213
+ /* @__PURE__ */ t(
1206
1214
  "a",
1207
1215
  {
1208
1216
  className: "ds-btn",
1209
- href: i,
1217
+ href: b,
1210
1218
  target: "_blank",
1211
1219
  rel: "noreferrer",
1212
- title: h.cleanReviewTitle,
1213
- children: h.cleanReview
1220
+ title: u.cleanReviewTitle,
1221
+ children: u.cleanReview
1214
1222
  }
1215
1223
  ),
1216
- /* @__PURE__ */ o(
1224
+ /* @__PURE__ */ t(
1217
1225
  "button",
1218
1226
  {
1219
1227
  type: "button",
1220
1228
  className: "ds-btn",
1221
- "aria-pressed": s,
1222
- onClick: r,
1223
- children: h.panel
1229
+ "aria-pressed": i,
1230
+ onClick: c,
1231
+ children: u.panel
1224
1232
  }
1225
1233
  )
1226
1234
  ] });
1227
1235
  }
1228
- function Xe(e) {
1229
- const t = new URL(e);
1230
- return t.searchParams.set(g.chrome, "0"), t.toString();
1236
+ function ct(e) {
1237
+ const o = new URL(e);
1238
+ return o.searchParams.set(w.chrome, "0"), o.toString();
1231
1239
  }
1232
- function Ze(e, t, n = "active") {
1233
- const s = new URL("/", e);
1234
- return t === "light" && s.searchParams.set(g.chromeTheme, t), n === "ported" && s.searchParams.set(g.view, "ported"), s.toString();
1240
+ function dt(e, o, a = "active", i) {
1241
+ const d = new URL("/", e);
1242
+ return o === "light" && d.searchParams.set(w.chromeTheme, o), a === "ported" && d.searchParams.set(w.view, "ported"), oe(d.searchParams, i), d.toString();
1235
1243
  }
1236
- function et({ theme: e }) {
1237
- const t = {
1244
+ function lt({ theme: e }) {
1245
+ const o = {
1238
1246
  width: 15,
1239
1247
  height: 15,
1240
1248
  viewBox: "0 0 24 24",
@@ -1245,79 +1253,79 @@ function et({ theme: e }) {
1245
1253
  strokeLinejoin: "round",
1246
1254
  "aria-hidden": !0
1247
1255
  };
1248
- return e === "dark" ? /* @__PURE__ */ u("svg", { ...t, children: [
1249
- /* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "4" }),
1250
- /* @__PURE__ */ o("path", { d: "M12 2v2M12 20v2M4.93 4.93l1.42 1.42M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.42" })
1251
- ] }) : /* @__PURE__ */ o("svg", { ...t, children: /* @__PURE__ */ o("path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" }) });
1256
+ return e === "dark" ? /* @__PURE__ */ l("svg", { ...o, children: [
1257
+ /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "4" }),
1258
+ /* @__PURE__ */ t("path", { d: "M12 2v2M12 20v2M4.93 4.93l1.42 1.42M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.42" })
1259
+ ] }) : /* @__PURE__ */ t("svg", { ...o, children: /* @__PURE__ */ t("path", { d: "M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" }) });
1252
1260
  }
1253
- function tt({
1261
+ function pt({
1254
1262
  registry: e,
1255
- controls: t,
1256
- scenarioActive: n,
1257
- component: s,
1258
- componentFixture: l,
1259
- onChange: a
1263
+ controls: o,
1264
+ scenarioActive: a,
1265
+ component: i,
1266
+ componentFixture: d,
1267
+ onChange: r
1260
1268
  }) {
1261
- const r = P(), c = r.controls, { product: h } = e, p = h.dataSources?.adapters ?? [], m = h.theme?.modes ?? [], v = h.theme?.locales ?? [];
1262
- return /* @__PURE__ */ u("div", { className: "ds-chrome ds-controls", role: "group", "aria-label": c.region, children: [
1263
- s?.fixtures?.length ? /* @__PURE__ */ u("div", { className: "ds-field", children: [
1264
- /* @__PURE__ */ o("label", { htmlFor: "ds-component-fixture", children: c.componentFixture }),
1265
- /* @__PURE__ */ o(
1269
+ const n = P(), c = n.controls, { product: h } = e, u = h.dataSources?.adapters ?? [], g = h.theme?.modes ?? [], f = h.theme?.locales ?? [];
1270
+ return /* @__PURE__ */ l("div", { className: "ds-chrome ds-controls", role: "group", "aria-label": c.region, children: [
1271
+ i?.fixtures?.length ? /* @__PURE__ */ l("div", { className: "ds-field", children: [
1272
+ /* @__PURE__ */ t("label", { htmlFor: "ds-component-fixture", children: c.componentFixture }),
1273
+ /* @__PURE__ */ t(
1266
1274
  "select",
1267
1275
  {
1268
1276
  id: "ds-component-fixture",
1269
1277
  className: "ds-select",
1270
- value: l?.fixture?.id ?? "",
1271
- onChange: (i) => a({ fixture: i.target.value || void 0 }),
1272
- children: s.fixtures.map((i) => /* @__PURE__ */ o("option", { value: i.id, children: i.label }, i.id))
1278
+ value: d?.fixture?.id ?? "",
1279
+ onChange: (p) => r({ fixture: p.target.value || void 0 }),
1280
+ children: i.fixtures.map((p) => /* @__PURE__ */ t("option", { value: p.id, children: p.label }, p.id))
1273
1281
  }
1274
1282
  )
1275
1283
  ] }) : null,
1276
- n && /* @__PURE__ */ u("div", { className: "ds-field", children: [
1277
- /* @__PURE__ */ o("label", { htmlFor: "ds-persona", children: c.persona }),
1278
- /* @__PURE__ */ u(
1284
+ a && /* @__PURE__ */ l("div", { className: "ds-field", children: [
1285
+ /* @__PURE__ */ t("label", { htmlFor: "ds-persona", children: c.persona }),
1286
+ /* @__PURE__ */ l(
1279
1287
  "select",
1280
1288
  {
1281
1289
  id: "ds-persona",
1282
1290
  className: "ds-select",
1283
- value: t.persona ?? "",
1284
- onChange: (i) => a({ persona: i.target.value || void 0 }),
1291
+ value: o.persona ?? "",
1292
+ onChange: (p) => r({ persona: p.target.value || void 0 }),
1285
1293
  children: [
1286
- /* @__PURE__ */ o("option", { value: "", children: c.none }),
1287
- h.personas.map((i) => /* @__PURE__ */ o("option", { value: i.id, children: i.name }, i.id))
1294
+ /* @__PURE__ */ t("option", { value: "", children: c.none }),
1295
+ h.personas.map((p) => /* @__PURE__ */ t("option", { value: p.id, children: p.name }, p.id))
1288
1296
  ]
1289
1297
  }
1290
1298
  )
1291
1299
  ] }),
1292
- n && /* @__PURE__ */ u("div", { className: "ds-field", children: [
1293
- /* @__PURE__ */ o("span", { className: "ds-field__label", id: "ds-network-label", children: c.network }),
1294
- /* @__PURE__ */ o("div", { className: "ds-segmented", role: "group", "aria-labelledby": "ds-network-label", children: ie.map((i) => /* @__PURE__ */ o(
1300
+ a && /* @__PURE__ */ l("div", { className: "ds-field", children: [
1301
+ /* @__PURE__ */ t("span", { className: "ds-field__label", id: "ds-network-label", children: c.network }),
1302
+ /* @__PURE__ */ t("div", { className: "ds-segmented", role: "group", "aria-labelledby": "ds-network-label", children: ve.map((p) => /* @__PURE__ */ t(
1295
1303
  "button",
1296
1304
  {
1297
1305
  type: "button",
1298
- "aria-pressed": t.network === i,
1299
- onClick: () => a({ network: i }),
1300
- children: r.network[i]
1306
+ "aria-pressed": o.network === p,
1307
+ onClick: () => r({ network: p }),
1308
+ children: n.network[p]
1301
1309
  },
1302
- i
1310
+ p
1303
1311
  )) })
1304
1312
  ] }),
1305
- /* @__PURE__ */ u("div", { className: "ds-field", children: [
1306
- /* @__PURE__ */ o("span", { className: "ds-field__label", id: "ds-viewport-label", children: c.viewport }),
1307
- /* @__PURE__ */ o("div", { className: "ds-segmented", role: "group", "aria-labelledby": "ds-viewport-label", children: ce.map((i) => /* @__PURE__ */ o(
1313
+ /* @__PURE__ */ l("div", { className: "ds-field", children: [
1314
+ /* @__PURE__ */ t("span", { className: "ds-field__label", id: "ds-viewport-label", children: c.viewport }),
1315
+ /* @__PURE__ */ t("div", { className: "ds-segmented", role: "group", "aria-labelledby": "ds-viewport-label", children: ge.map((p) => /* @__PURE__ */ t(
1308
1316
  "button",
1309
1317
  {
1310
1318
  type: "button",
1311
1319
  className: "ds-icon-button",
1312
- "aria-pressed": t.viewport === i.id,
1313
- "aria-label": r.viewport[i.id] ?? i.label,
1314
- title: r.viewport[i.id] ?? i.label,
1315
- onClick: () => a({ viewport: i.id }),
1316
- children: /* @__PURE__ */ o(ot, { id: i.id })
1320
+ "aria-pressed": o.viewport === p.id,
1321
+ "aria-label": n.viewport[p.id] ?? p.label,
1322
+ title: n.viewport[p.id] ?? p.label,
1323
+ onClick: () => r({ viewport: p.id }),
1324
+ children: /* @__PURE__ */ t(ut, { id: p.id })
1317
1325
  },
1318
- i.id
1326
+ p.id
1319
1327
  )) }),
1320
- t.viewport === "custom" && /* @__PURE__ */ o(
1328
+ o.viewport === "custom" && /* @__PURE__ */ t(
1321
1329
  "input",
1322
1330
  {
1323
1331
  className: "ds-input",
@@ -1327,57 +1335,57 @@ function tt({
1327
1335
  step: 10,
1328
1336
  style: { width: 88 },
1329
1337
  "aria-label": c.customWidth,
1330
- value: t.customWidth ?? 1024,
1331
- onChange: (i) => a({ customWidth: Number(i.target.value) || void 0 })
1338
+ value: o.customWidth ?? 1024,
1339
+ onChange: (p) => r({ customWidth: Number(p.target.value) || void 0 })
1332
1340
  }
1333
1341
  )
1334
1342
  ] }),
1335
- m.length > 1 && /* @__PURE__ */ u("div", { className: "ds-field", children: [
1336
- /* @__PURE__ */ o("label", { htmlFor: "ds-theme", children: c.theme }),
1337
- /* @__PURE__ */ o(
1343
+ g.length > 1 && /* @__PURE__ */ l("div", { className: "ds-field", children: [
1344
+ /* @__PURE__ */ t("label", { htmlFor: "ds-theme", children: c.theme }),
1345
+ /* @__PURE__ */ t(
1338
1346
  "select",
1339
1347
  {
1340
1348
  id: "ds-theme",
1341
1349
  className: "ds-select",
1342
- value: t.themeMode ?? m[0],
1343
- onChange: (i) => a({ themeMode: i.target.value }),
1344
- children: m.map((i) => /* @__PURE__ */ o("option", { value: i, children: i }, i))
1350
+ value: o.themeMode ?? g[0],
1351
+ onChange: (p) => r({ themeMode: p.target.value }),
1352
+ children: g.map((p) => /* @__PURE__ */ t("option", { value: p, children: p }, p))
1345
1353
  }
1346
1354
  )
1347
1355
  ] }),
1348
- v.length > 1 && /* @__PURE__ */ u("div", { className: "ds-field", children: [
1349
- /* @__PURE__ */ o("label", { htmlFor: "ds-locale", children: c.locale }),
1350
- /* @__PURE__ */ o(
1356
+ f.length > 1 && /* @__PURE__ */ l("div", { className: "ds-field", children: [
1357
+ /* @__PURE__ */ t("label", { htmlFor: "ds-locale", children: c.locale }),
1358
+ /* @__PURE__ */ t(
1351
1359
  "select",
1352
1360
  {
1353
1361
  id: "ds-locale",
1354
1362
  className: "ds-select",
1355
- value: t.locale ?? v[0],
1356
- onChange: (i) => a({ locale: i.target.value }),
1357
- children: v.map((i) => /* @__PURE__ */ o("option", { value: i, children: i }, i))
1363
+ value: o.locale ?? f[0],
1364
+ onChange: (p) => r({ locale: p.target.value }),
1365
+ children: f.map((p) => /* @__PURE__ */ t("option", { value: p, children: p }, p))
1358
1366
  }
1359
1367
  )
1360
1368
  ] }),
1361
- n && p.length > 0 && /* @__PURE__ */ u("div", { className: "ds-field", children: [
1362
- /* @__PURE__ */ o("label", { htmlFor: "ds-source", children: c.dataSource }),
1363
- /* @__PURE__ */ u(
1369
+ a && u.length > 0 && /* @__PURE__ */ l("div", { className: "ds-field", children: [
1370
+ /* @__PURE__ */ t("label", { htmlFor: "ds-source", children: c.dataSource }),
1371
+ /* @__PURE__ */ l(
1364
1372
  "select",
1365
1373
  {
1366
1374
  id: "ds-source",
1367
1375
  className: "ds-select",
1368
- value: t.dataSource ?? "fixtures",
1369
- onChange: (i) => a({ dataSource: i.target.value }),
1376
+ value: o.dataSource ?? "fixtures",
1377
+ onChange: (p) => r({ dataSource: p.target.value }),
1370
1378
  children: [
1371
- /* @__PURE__ */ o("option", { value: "fixtures", children: c.fixturesOption }),
1372
- p.filter((i) => i.id !== "fixtures").map((i) => /* @__PURE__ */ o("option", { value: i.id, children: i.label }, i.id))
1379
+ /* @__PURE__ */ t("option", { value: "fixtures", children: c.fixturesOption }),
1380
+ u.filter((p) => p.id !== "fixtures").map((p) => /* @__PURE__ */ t("option", { value: p.id, children: p.label }, p.id))
1373
1381
  ]
1374
1382
  }
1375
1383
  )
1376
1384
  ] })
1377
1385
  ] });
1378
1386
  }
1379
- function ot({ id: e }) {
1380
- const t = {
1387
+ function ut({ id: e }) {
1388
+ const o = {
1381
1389
  width: 16,
1382
1390
  height: 16,
1383
1391
  viewBox: "0 0 24 24",
@@ -1388,292 +1396,350 @@ function ot({ id: e }) {
1388
1396
  strokeLinejoin: "round",
1389
1397
  "aria-hidden": !0
1390
1398
  };
1391
- return e === "fit" ? /* @__PURE__ */ o("svg", { ...t, children: /* @__PURE__ */ o("path", { d: "M8 3H5a2 2 0 0 0-2 2v3M16 3h3a2 2 0 0 1 2 2v3M8 21H5a2 2 0 0 1-2-2v-3M16 21h3a2 2 0 0 0 2-2v-3" }) }) : e === "mobile" ? /* @__PURE__ */ u("svg", { ...t, children: [
1392
- /* @__PURE__ */ o("rect", { width: "14", height: "20", x: "5", y: "2", rx: "2", ry: "2" }),
1393
- /* @__PURE__ */ o("path", { d: "M12 18h.01" })
1394
- ] }) : e === "tablet" ? /* @__PURE__ */ u("svg", { ...t, children: [
1395
- /* @__PURE__ */ o("rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", ry: "2" }),
1396
- /* @__PURE__ */ o("path", { d: "M12 18h.01" })
1397
- ] }) : e === "desktop" ? /* @__PURE__ */ u("svg", { ...t, children: [
1398
- /* @__PURE__ */ o("rect", { width: "20", height: "14", x: "2", y: "3", rx: "2" }),
1399
- /* @__PURE__ */ o("path", { d: "M8 21h8M12 17v4" })
1400
- ] }) : /* @__PURE__ */ o("svg", { ...t, children: /* @__PURE__ */ o("path", { d: "M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7" }) });
1399
+ return e === "fit" ? /* @__PURE__ */ t("svg", { ...o, children: /* @__PURE__ */ t("path", { d: "M8 3H5a2 2 0 0 0-2 2v3M16 3h3a2 2 0 0 1 2 2v3M8 21H5a2 2 0 0 1-2-2v-3M16 21h3a2 2 0 0 0 2-2v-3" }) }) : e === "mobile" ? /* @__PURE__ */ l("svg", { ...o, children: [
1400
+ /* @__PURE__ */ t("rect", { width: "14", height: "20", x: "5", y: "2", rx: "2", ry: "2" }),
1401
+ /* @__PURE__ */ t("path", { d: "M12 18h.01" })
1402
+ ] }) : e === "tablet" ? /* @__PURE__ */ l("svg", { ...o, children: [
1403
+ /* @__PURE__ */ t("rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", ry: "2" }),
1404
+ /* @__PURE__ */ t("path", { d: "M12 18h.01" })
1405
+ ] }) : e === "desktop" ? /* @__PURE__ */ l("svg", { ...o, children: [
1406
+ /* @__PURE__ */ t("rect", { width: "20", height: "14", x: "2", y: "3", rx: "2" }),
1407
+ /* @__PURE__ */ t("path", { d: "M8 21h8M12 17v4" })
1408
+ ] }) : /* @__PURE__ */ t("svg", { ...o, children: /* @__PURE__ */ t("path", { d: "M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7" }) });
1401
1409
  }
1402
- function nt({
1410
+ function ht({
1403
1411
  registry: e,
1404
- scenario: t,
1405
- component: n,
1406
- componentFixture: s,
1407
- controls: l,
1408
- focusedNode: a,
1409
- tabStopCount: r
1412
+ scenario: o,
1413
+ component: a,
1414
+ componentFixture: i,
1415
+ controls: d,
1416
+ focusedNode: r,
1417
+ tabStopCount: n
1410
1418
  }) {
1411
- const c = P().inspector, [h, p] = $("scenario"), m = e.issues.filter((v) => v.level === "error").length;
1412
- return /* @__PURE__ */ u("aside", { className: "ds-chrome ds-inspector", "aria-label": c.region, children: [
1413
- /* @__PURE__ */ u("div", { className: "ds-inspector__tabs", role: "tablist", children: [
1414
- /* @__PURE__ */ o(J, { id: "scenario", current: h, onSelect: p, children: n ? c.componentReference : c.tabScenario }),
1415
- /* @__PURE__ */ o(J, { id: "a11y", current: h, onSelect: p, children: c.tabA11y }),
1416
- /* @__PURE__ */ o(J, { id: "diagnostics", current: h, onSelect: p, children: m > 0 ? c.diagnosticsWithErrors(m) : c.tabDiagnostics })
1419
+ const c = P().inspector, [h, u] = F("scenario"), g = e.issues.filter((f) => f.level === "error").length;
1420
+ return /* @__PURE__ */ l("aside", { className: "ds-chrome ds-inspector", "aria-label": c.region, children: [
1421
+ /* @__PURE__ */ l("div", { className: "ds-inspector__tabs", role: "tablist", children: [
1422
+ /* @__PURE__ */ t(ne, { id: "scenario", current: h, onSelect: u, children: a ? c.componentReference : c.tabScenario }),
1423
+ /* @__PURE__ */ t(ne, { id: "a11y", current: h, onSelect: u, children: c.tabA11y }),
1424
+ /* @__PURE__ */ t(ne, { id: "diagnostics", current: h, onSelect: u, children: g > 0 ? c.diagnosticsWithErrors(g) : c.tabDiagnostics })
1417
1425
  ] }),
1418
- /* @__PURE__ */ u("div", { className: "ds-inspector__body", role: "tabpanel", children: [
1419
- h === "scenario" && /* @__PURE__ */ o(
1420
- at,
1426
+ /* @__PURE__ */ l("div", { className: "ds-inspector__body", role: "tabpanel", children: [
1427
+ h === "scenario" && /* @__PURE__ */ t(
1428
+ mt,
1421
1429
  {
1422
1430
  registry: e,
1423
- scenario: t,
1424
- component: n,
1425
- componentFixture: s,
1426
- controls: l
1431
+ scenario: o,
1432
+ component: a,
1433
+ componentFixture: i,
1434
+ controls: d
1427
1435
  }
1428
1436
  ),
1429
- h === "a11y" && /* @__PURE__ */ o(
1430
- rt,
1437
+ h === "a11y" && /* @__PURE__ */ t(
1438
+ ft,
1431
1439
  {
1432
1440
  registry: e,
1433
- scenario: t,
1434
- focusedNode: a,
1435
- keyboardMode: l.keyboardMode,
1436
- tabStopCount: r
1441
+ scenario: o,
1442
+ focusedNode: r,
1443
+ keyboardMode: d.keyboardMode,
1444
+ tabStopCount: n
1437
1445
  }
1438
1446
  ),
1439
- h === "diagnostics" && /* @__PURE__ */ o(st, { registry: e })
1447
+ h === "diagnostics" && /* @__PURE__ */ t(bt, { registry: e })
1440
1448
  ] })
1441
1449
  ] });
1442
1450
  }
1443
- function J({
1451
+ function ne({
1444
1452
  id: e,
1445
- current: t,
1446
- onSelect: n,
1447
- children: s
1453
+ current: o,
1454
+ onSelect: a,
1455
+ children: i
1448
1456
  }) {
1449
- return /* @__PURE__ */ o(
1457
+ return /* @__PURE__ */ t(
1450
1458
  "button",
1451
1459
  {
1452
1460
  type: "button",
1453
1461
  role: "tab",
1454
- "aria-selected": t === e,
1455
- onClick: () => n(e),
1456
- children: s
1462
+ "aria-selected": o === e,
1463
+ onClick: () => a(e),
1464
+ children: i
1457
1465
  }
1458
1466
  );
1459
1467
  }
1460
- function at({
1468
+ function mt({
1461
1469
  registry: e,
1462
- scenario: t,
1463
- component: n,
1464
- componentFixture: s,
1465
- controls: l
1470
+ scenario: o,
1471
+ component: a,
1472
+ componentFixture: i,
1473
+ controls: d
1466
1474
  }) {
1467
- const a = P(), r = a.inspector;
1468
- if (!t)
1469
- return n ? /* @__PURE__ */ u("div", { className: "ds-block", children: [
1470
- /* @__PURE__ */ o("h2", { className: "ds-block__title", children: r.componentReference }),
1471
- /* @__PURE__ */ o("p", { style: { color: "var(--ds-fg)", fontSize: 15, fontWeight: 600 }, children: n.name }),
1472
- n.description && /* @__PURE__ */ o("p", { children: n.description }),
1473
- /* @__PURE__ */ u("dl", { className: "ds-kv", style: { marginTop: 14 }, children: [
1474
- /* @__PURE__ */ o("dt", { children: r.id }),
1475
- /* @__PURE__ */ o("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: n.id }),
1476
- n.group && /* @__PURE__ */ u(A, { children: [
1477
- /* @__PURE__ */ o("dt", { children: r.componentGroup }),
1478
- /* @__PURE__ */ o("dd", { children: n.group })
1475
+ const r = P(), n = r.inspector;
1476
+ if (!o)
1477
+ return a ? /* @__PURE__ */ l("div", { className: "ds-block", children: [
1478
+ /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.componentReference }),
1479
+ /* @__PURE__ */ t("p", { style: { color: "var(--ds-fg)", fontSize: 15, fontWeight: 600 }, children: a.name }),
1480
+ a.description && /* @__PURE__ */ t("p", { children: a.description }),
1481
+ /* @__PURE__ */ l("dl", { className: "ds-kv", style: { marginTop: 14 }, children: [
1482
+ /* @__PURE__ */ t("dt", { children: n.id }),
1483
+ /* @__PURE__ */ t("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: a.id }),
1484
+ a.group && /* @__PURE__ */ l(A, { children: [
1485
+ /* @__PURE__ */ t("dt", { children: n.componentGroup }),
1486
+ /* @__PURE__ */ t("dd", { children: a.group })
1479
1487
  ] }),
1480
- s?.fixture && /* @__PURE__ */ u(A, { children: [
1481
- /* @__PURE__ */ o("dt", { children: r.componentFixture }),
1482
- /* @__PURE__ */ u("dd", { children: [
1483
- s.fixture.label,
1488
+ i?.fixture && /* @__PURE__ */ l(A, { children: [
1489
+ /* @__PURE__ */ t("dt", { children: n.componentFixture }),
1490
+ /* @__PURE__ */ l("dd", { children: [
1491
+ i.fixture.label,
1484
1492
  " ",
1485
- /* @__PURE__ */ o("code", { children: s.fixture.id })
1493
+ /* @__PURE__ */ t("code", { children: i.fixture.id })
1486
1494
  ] }),
1487
- s.fixture.description && /* @__PURE__ */ u(A, { children: [
1488
- /* @__PURE__ */ o("dt", { children: r.componentFixtureDescription }),
1489
- /* @__PURE__ */ o("dd", { children: s.fixture.description })
1495
+ i.fixture.description && /* @__PURE__ */ l(A, { children: [
1496
+ /* @__PURE__ */ t("dt", { children: n.componentFixtureDescription }),
1497
+ /* @__PURE__ */ t("dd", { children: i.fixture.description })
1490
1498
  ] })
1491
1499
  ] })
1492
1500
  ] }),
1493
- s?.didFallback && s.fixture && /* @__PURE__ */ o("p", { className: "ds-note", "data-tone": "warn", children: r.componentFixtureFallback(
1494
- s.requestedId ?? "",
1495
- s.fixture.id
1501
+ i?.didFallback && i.fixture && /* @__PURE__ */ t("p", { className: "ds-note", "data-tone": "warn", children: n.componentFixtureFallback(
1502
+ i.requestedId ?? "",
1503
+ i.fixture.id
1496
1504
  ) })
1497
- ] }) : /* @__PURE__ */ o("p", { className: "ds-block", children: r.noScenario });
1498
- const c = e.persona(l.persona ?? t.persona), h = l.persona ? e.persona(l.persona)?.permissions ?? [] : e.permissionsOf(t), p = e.rulesOf(t), m = e.fixture(l.fixture ?? t.fixture), v = !!(l.persona && l.persona !== t.persona);
1499
- return /* @__PURE__ */ u(A, { children: [
1500
- /* @__PURE__ */ u("div", { className: "ds-block", children: [
1501
- /* @__PURE__ */ o("h2", { className: "ds-block__title", children: r.situation }),
1502
- /* @__PURE__ */ o("p", { style: { color: "var(--ds-fg)", fontSize: 14, fontWeight: 600 }, children: t.title }),
1503
- t.intent && /* @__PURE__ */ o("p", { children: t.intent }),
1504
- /* @__PURE__ */ u("div", { className: "ds-chips", children: [
1505
- /* @__PURE__ */ o("span", { className: "ds-chip", "data-tone": ct(t.status), children: a.status[t.status] }),
1506
- (t.tags ?? []).map((i) => /* @__PURE__ */ o("span", { className: "ds-chip", children: i }, i))
1507
- ] }),
1508
- /* @__PURE__ */ o("p", { style: { marginTop: 6 }, children: a.statusMeaning[t.status] })
1509
- ] }),
1510
- /* @__PURE__ */ u("div", { className: "ds-block", children: [
1511
- /* @__PURE__ */ o("h2", { className: "ds-block__title", children: r.reproduction }),
1512
- /* @__PURE__ */ u("dl", { className: "ds-kv", children: [
1513
- /* @__PURE__ */ o("dt", { children: r.id }),
1514
- /* @__PURE__ */ o("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: t.id }),
1515
- /* @__PURE__ */ o("dt", { children: r.route }),
1516
- /* @__PURE__ */ o("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: t.route }),
1517
- /* @__PURE__ */ o("dt", { children: r.persona }),
1518
- /* @__PURE__ */ u("dd", { children: [
1519
- c?.name ?? "—",
1520
- v && /* @__PURE__ */ o("span", { className: "ds-chip", "data-tone": "warn", style: { marginLeft: 6 }, children: r.personaSwapped })
1521
- ] }),
1522
- /* @__PURE__ */ o("dt", { children: r.data }),
1523
- /* @__PURE__ */ o("dd", { children: m?.label ?? "—" }),
1524
- /* @__PURE__ */ o("dt", { children: r.network }),
1525
- /* @__PURE__ */ o("dd", { children: a.network[l.network] })
1526
- ] }),
1527
- c?.goal && /* @__PURE__ */ o("p", { style: { marginTop: 8 }, children: r.goal(c.goal) })
1528
- ] }),
1529
- h.length > 0 && /* @__PURE__ */ u("div", { className: "ds-block", children: [
1530
- /* @__PURE__ */ o("h2", { className: "ds-block__title", children: r.permissions }),
1531
- /* @__PURE__ */ o("div", { className: "ds-chips", children: h.map((i) => /* @__PURE__ */ o("span", { className: "ds-chip", children: i }, i)) })
1532
- ] }),
1533
- t.preconditions?.length ? /* @__PURE__ */ u("div", { className: "ds-block", children: [
1534
- /* @__PURE__ */ o("h2", { className: "ds-block__title", children: r.preconditions }),
1535
- /* @__PURE__ */ o("ul", { className: "ds-list", children: t.preconditions.map((i) => /* @__PURE__ */ o("li", { children: i }, i)) })
1536
- ] }) : null,
1537
- p.length > 0 && /* @__PURE__ */ u("div", { className: "ds-block", children: [
1538
- /* @__PURE__ */ o("h2", { className: "ds-block__title", children: r.rules }),
1539
- p.map((i) => /* @__PURE__ */ u("div", { className: "ds-rule", children: [
1540
- /* @__PURE__ */ o("span", { className: "ds-rule__id", children: i.id }),
1541
- /* @__PURE__ */ o("span", { className: "ds-rule__statement", children: i.statement }),
1542
- i.rationale && /* @__PURE__ */ o("p", { className: "ds-rule__rationale", children: i.rationale })
1543
- ] }, i.id))
1544
- ] }),
1545
- t.actions?.length ? /* @__PURE__ */ u("div", { className: "ds-block", children: [
1546
- /* @__PURE__ */ o("h2", { className: "ds-block__title", children: r.actions }),
1547
- /* @__PURE__ */ o("ul", { className: "ds-list", children: t.actions.map((i) => /* @__PURE__ */ o("li", { children: i }, i)) })
1548
- ] }) : null,
1549
- t.expected?.length ? /* @__PURE__ */ u("div", { className: "ds-block", children: [
1550
- /* @__PURE__ */ o("h2", { className: "ds-block__title", children: r.expected }),
1551
- /* @__PURE__ */ o("ul", { className: "ds-list", children: t.expected.map((i) => /* @__PURE__ */ o("li", { children: i }, i)) })
1552
- ] }) : null,
1553
- t.approvedAt && /* @__PURE__ */ u("div", { className: "ds-block", children: [
1554
- /* @__PURE__ */ o("h2", { className: "ds-block__title", children: r.approval }),
1555
- /* @__PURE__ */ u("p", { children: [
1556
- t.approvedAt.date,
1557
- " · ",
1558
- /* @__PURE__ */ o("code", { children: t.approvedAt.commit.slice(0, 7) })
1559
- ] }),
1560
- /* @__PURE__ */ o("a", { href: t.approvedAt.url, target: "_blank", rel: "noreferrer", children: r.openApproved })
1561
- ] }),
1562
- t.ticket && /* @__PURE__ */ u("div", { className: "ds-block", children: [
1563
- /* @__PURE__ */ o("h2", { className: "ds-block__title", children: r.engineering }),
1564
- /* @__PURE__ */ o("p", { children: t.ticket })
1565
- ] })
1505
+ ] }) : /* @__PURE__ */ t("p", { className: "ds-block", children: n.noScenario });
1506
+ const c = e.persona(d.persona ?? o.persona), h = d.persona ? e.persona(d.persona)?.permissions ?? [] : e.permissionsOf(o), u = e.rulesOf(o), g = e.fixture(d.fixture ?? o.fixture), f = !!(d.persona && d.persona !== o.persona), p = o.status !== "approved" || !!o.approvedAt;
1507
+ return /* @__PURE__ */ l(A, { children: [
1508
+ /* @__PURE__ */ l(
1509
+ z,
1510
+ {
1511
+ scope: "task",
1512
+ title: n.taskScope,
1513
+ description: n.taskScopeDescription,
1514
+ children: [
1515
+ /* @__PURE__ */ l("div", { className: "ds-block", children: [
1516
+ /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.situation }),
1517
+ /* @__PURE__ */ t("p", { style: { color: "var(--ds-fg)", fontSize: 14, fontWeight: 600 }, children: o.title }),
1518
+ o.intent && /* @__PURE__ */ t("p", { children: o.intent }),
1519
+ /* @__PURE__ */ l("div", { className: "ds-chips", children: [
1520
+ /* @__PURE__ */ t("span", { className: "ds-chip", "data-tone": gt(o), children: p ? r.status[o.status] : n.approvalPendingStatus }),
1521
+ (o.tags ?? []).map((b) => /* @__PURE__ */ t("span", { className: "ds-chip", children: b }, b))
1522
+ ] }),
1523
+ /* @__PURE__ */ t("p", { style: { marginTop: 6 }, children: p ? r.statusMeaning[o.status] : n.approvalPendingMeaning })
1524
+ ] }),
1525
+ /* @__PURE__ */ l("div", { className: "ds-block", children: [
1526
+ /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.reproduction }),
1527
+ /* @__PURE__ */ l("dl", { className: "ds-kv", children: [
1528
+ /* @__PURE__ */ t("dt", { children: n.id }),
1529
+ /* @__PURE__ */ t("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: o.id }),
1530
+ /* @__PURE__ */ t("dt", { children: n.route }),
1531
+ /* @__PURE__ */ t("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: o.route }),
1532
+ /* @__PURE__ */ t("dt", { children: n.data }),
1533
+ /* @__PURE__ */ t("dd", { children: g?.label ?? "—" }),
1534
+ /* @__PURE__ */ t("dt", { children: n.network }),
1535
+ /* @__PURE__ */ t("dd", { children: r.network[d.network] })
1536
+ ] })
1537
+ ] }),
1538
+ o.preconditions?.length ? /* @__PURE__ */ l("div", { className: "ds-block", children: [
1539
+ /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.preconditions }),
1540
+ /* @__PURE__ */ t("ul", { className: "ds-list", children: o.preconditions.map((b) => /* @__PURE__ */ t("li", { children: b }, b)) })
1541
+ ] }) : null,
1542
+ u.length > 0 && /* @__PURE__ */ l("div", { className: "ds-block", children: [
1543
+ /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.rules }),
1544
+ u.map((b) => /* @__PURE__ */ l("div", { className: "ds-rule", children: [
1545
+ /* @__PURE__ */ t("span", { className: "ds-rule__id", children: b.id }),
1546
+ /* @__PURE__ */ t("span", { className: "ds-rule__statement", children: b.statement }),
1547
+ b.rationale && /* @__PURE__ */ t("p", { className: "ds-rule__rationale", children: b.rationale })
1548
+ ] }, b.id))
1549
+ ] }),
1550
+ o.actions?.length ? /* @__PURE__ */ l("div", { className: "ds-block", children: [
1551
+ /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.actions }),
1552
+ /* @__PURE__ */ t("ul", { className: "ds-list", children: o.actions.map((b) => /* @__PURE__ */ t("li", { children: b }, b)) })
1553
+ ] }) : null,
1554
+ o.expected?.length ? /* @__PURE__ */ l("div", { className: "ds-block", children: [
1555
+ /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.expected }),
1556
+ /* @__PURE__ */ t("ul", { className: "ds-list", children: o.expected.map((b) => /* @__PURE__ */ t("li", { children: b }, b)) })
1557
+ ] }) : null,
1558
+ (o.status === "approved" || o.approvedAt) && /* @__PURE__ */ l("div", { className: "ds-block", children: [
1559
+ /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.approval }),
1560
+ o.approvedAt ? /* @__PURE__ */ l(A, { children: [
1561
+ /* @__PURE__ */ l("p", { children: [
1562
+ o.approvedAt.date,
1563
+ " · ",
1564
+ /* @__PURE__ */ t("code", { children: o.approvedAt.commit.slice(0, 7) })
1565
+ ] }),
1566
+ /* @__PURE__ */ t("a", { href: o.approvedAt.url, target: "_blank", rel: "noreferrer", children: n.openApproved })
1567
+ ] }) : /* @__PURE__ */ t("p", { className: "ds-note", "data-tone": "warn", role: "alert", children: n.approvalMissing })
1568
+ ] }),
1569
+ o.ticket && /* @__PURE__ */ l("div", { className: "ds-block", children: [
1570
+ /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.engineering }),
1571
+ /* @__PURE__ */ t("p", { children: o.ticket })
1572
+ ] })
1573
+ ]
1574
+ }
1575
+ ),
1576
+ /* @__PURE__ */ l(
1577
+ z,
1578
+ {
1579
+ scope: "inherited",
1580
+ title: n.inheritedScope,
1581
+ description: n.inheritedScopeDescription,
1582
+ children: [
1583
+ /* @__PURE__ */ l("div", { className: "ds-block", children: [
1584
+ /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.persona }),
1585
+ /* @__PURE__ */ l("p", { style: { color: "var(--ds-fg)", fontWeight: 600 }, children: [
1586
+ c?.name ?? "—",
1587
+ f && /* @__PURE__ */ t("span", { className: "ds-chip", "data-tone": "warn", style: { marginLeft: 6 }, children: n.personaSwapped })
1588
+ ] }),
1589
+ c?.goal && /* @__PURE__ */ t("p", { children: n.goal(c.goal) })
1590
+ ] }),
1591
+ h.length > 0 && /* @__PURE__ */ l("div", { className: "ds-block", children: [
1592
+ /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.permissions }),
1593
+ /* @__PURE__ */ t("div", { className: "ds-chips", children: h.map((b) => /* @__PURE__ */ t("span", { className: "ds-chip", children: b }, b)) })
1594
+ ] })
1595
+ ]
1596
+ }
1597
+ )
1566
1598
  ] });
1567
1599
  }
1568
- function rt({
1600
+ function ft({
1569
1601
  registry: e,
1570
- scenario: t,
1571
- focusedNode: n,
1572
- keyboardMode: s,
1573
- tabStopCount: l
1602
+ scenario: o,
1603
+ focusedNode: a,
1604
+ keyboardMode: i,
1605
+ tabStopCount: d
1574
1606
  }) {
1575
- const a = P(), r = a.inspector, c = be(e.product.theme?.contrastPairs), h = c.filter((p) => p.passes !== !0);
1576
- return /* @__PURE__ */ u(A, { children: [
1577
- t && /* @__PURE__ */ u("div", { className: "ds-block", children: [
1578
- /* @__PURE__ */ o("h2", { className: "ds-block__title", children: r.a11yContract }),
1579
- /* @__PURE__ */ u("dl", { className: "ds-kv", children: [
1580
- /* @__PURE__ */ o("dt", { children: r.keyboard }),
1581
- /* @__PURE__ */ o("dd", { children: a.keyboard[t.a11y.keyboard] }),
1582
- /* @__PURE__ */ o("dt", { children: r.contrast }),
1583
- /* @__PURE__ */ o("dd", { children: r.contrastTarget(t.a11y.contrast) })
1584
- ] }),
1585
- t.a11y.announces?.length ? /* @__PURE__ */ u(A, { children: [
1586
- /* @__PURE__ */ o("p", { style: { marginTop: 8 }, children: r.announces }),
1587
- /* @__PURE__ */ o("div", { className: "ds-chips", children: t.a11y.announces.map((p) => /* @__PURE__ */ o("span", { className: "ds-chip", children: p }, p)) })
1588
- ] }) : null,
1589
- t.a11y.notes && /* @__PURE__ */ o("p", { style: { marginTop: 8 }, children: t.a11y.notes })
1590
- ] }),
1591
- /* @__PURE__ */ u("div", { className: "ds-block", children: [
1592
- /* @__PURE__ */ o("h2", { className: "ds-block__title", children: r.focusedElement }),
1593
- s ? n ? /* @__PURE__ */ u(A, { children: [
1594
- /* @__PURE__ */ u("dl", { className: "ds-kv", children: [
1595
- /* @__PURE__ */ o("dt", { children: r.role }),
1596
- /* @__PURE__ */ o("dd", { children: n.role }),
1597
- /* @__PURE__ */ o("dt", { children: r.name }),
1598
- /* @__PURE__ */ o("dd", { children: n.name ? n.name : /* @__PURE__ */ o("span", { style: { color: "var(--ds-err)" }, children: r.noAccessibleName }) }),
1599
- /* @__PURE__ */ o("dt", { children: r.nameFrom }),
1600
- /* @__PURE__ */ o("dd", { children: n.nameFrom }),
1601
- n.description ? /* @__PURE__ */ u(A, { children: [
1602
- /* @__PURE__ */ o("dt", { children: r.description }),
1603
- /* @__PURE__ */ o("dd", { children: n.description })
1607
+ const r = P(), n = r.inspector, c = Ce(e.product.theme?.contrastPairs), h = c.filter((u) => u.passes !== !0);
1608
+ return /* @__PURE__ */ l(A, { children: [
1609
+ o && /* @__PURE__ */ t(
1610
+ z,
1611
+ {
1612
+ scope: "task",
1613
+ title: n.taskScope,
1614
+ description: n.taskScopeDescription,
1615
+ children: /* @__PURE__ */ l("div", { className: "ds-block", children: [
1616
+ /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.a11yContract }),
1617
+ /* @__PURE__ */ l("dl", { className: "ds-kv", children: [
1618
+ /* @__PURE__ */ t("dt", { children: n.keyboard }),
1619
+ /* @__PURE__ */ t("dd", { children: r.keyboard[o.a11y.keyboard] }),
1620
+ /* @__PURE__ */ t("dt", { children: n.contrast }),
1621
+ /* @__PURE__ */ t("dd", { children: n.contrastTarget(o.a11y.contrast) })
1622
+ ] }),
1623
+ o.a11y.announces?.length ? /* @__PURE__ */ l(A, { children: [
1624
+ /* @__PURE__ */ t("p", { style: { marginTop: 8 }, children: n.announces }),
1625
+ /* @__PURE__ */ t("div", { className: "ds-chips", children: o.a11y.announces.map((u) => /* @__PURE__ */ t("span", { className: "ds-chip", children: u }, u)) })
1604
1626
  ] }) : null,
1605
- /* @__PURE__ */ o("dt", { children: r.selector }),
1606
- /* @__PURE__ */ o("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: n.selector })
1607
- ] }),
1608
- n.states.length > 0 && /* @__PURE__ */ o("div", { className: "ds-chips", style: { marginTop: 8 }, children: n.states.map((p) => /* @__PURE__ */ o("span", { className: "ds-chip", children: p }, p)) }),
1609
- n.hiddenFromAssistiveTech && /* @__PURE__ */ o("p", { className: "ds-note", style: { marginTop: 8 }, children: r.focusableButHidden }),
1610
- /* @__PURE__ */ o("p", { style: { marginTop: 8 }, children: r.tabStopsInStage(l) })
1611
- ] }) : /* @__PURE__ */ o("p", { children: r.pressTab(l) }) : /* @__PURE__ */ o("p", { children: r.keyboardModeOff })
1612
- ] }),
1613
- /* @__PURE__ */ u("div", { className: "ds-block", children: [
1614
- /* @__PURE__ */ o("h2", { className: "ds-block__title", children: r.tokenContrast }),
1615
- c.length === 0 ? /* @__PURE__ */ o("p", { children: r.noContrastPairs }) : /* @__PURE__ */ u("table", { className: "ds-contrast", children: [
1616
- /* @__PURE__ */ o("thead", { children: /* @__PURE__ */ u("tr", { children: [
1617
- /* @__PURE__ */ o("th", { scope: "col", children: r.pair }),
1618
- /* @__PURE__ */ o("th", { scope: "col", children: r.ratio })
1619
- ] }) }),
1620
- /* @__PURE__ */ o("tbody", { children: c.map((p) => /* @__PURE__ */ u("tr", { children: [
1621
- /* @__PURE__ */ u("td", { children: [
1622
- /* @__PURE__ */ o(
1623
- "span",
1624
- {
1625
- className: "ds-swatch",
1626
- style: { background: p.pair.background },
1627
- "aria-hidden": "true"
1628
- }
1629
- ),
1630
- /* @__PURE__ */ o(
1631
- "span",
1632
- {
1633
- className: "ds-swatch",
1634
- style: { background: p.pair.foreground },
1635
- "aria-hidden": "true"
1636
- }
1637
- ),
1638
- p.pair.name
1627
+ o.a11y.notes && /* @__PURE__ */ t("p", { style: { marginTop: 8 }, children: o.a11y.notes })
1628
+ ] })
1629
+ }
1630
+ ),
1631
+ /* @__PURE__ */ t(
1632
+ z,
1633
+ {
1634
+ scope: "screen",
1635
+ title: n.screenScope,
1636
+ description: n.screenScopeDescription,
1637
+ children: /* @__PURE__ */ l("div", { className: "ds-block", children: [
1638
+ /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.focusedElement }),
1639
+ i ? a ? /* @__PURE__ */ l(A, { children: [
1640
+ /* @__PURE__ */ l("dl", { className: "ds-kv", children: [
1641
+ /* @__PURE__ */ t("dt", { children: n.role }),
1642
+ /* @__PURE__ */ t("dd", { children: a.role }),
1643
+ /* @__PURE__ */ t("dt", { children: n.name }),
1644
+ /* @__PURE__ */ t("dd", { children: a.name ? a.name : /* @__PURE__ */ t("span", { style: { color: "var(--ds-err)" }, children: n.noAccessibleName }) }),
1645
+ /* @__PURE__ */ t("dt", { children: n.nameFrom }),
1646
+ /* @__PURE__ */ t("dd", { children: a.nameFrom }),
1647
+ a.description ? /* @__PURE__ */ l(A, { children: [
1648
+ /* @__PURE__ */ t("dt", { children: n.description }),
1649
+ /* @__PURE__ */ t("dd", { children: a.description })
1650
+ ] }) : null,
1651
+ /* @__PURE__ */ t("dt", { children: n.selector }),
1652
+ /* @__PURE__ */ t("dd", { style: { fontFamily: "var(--ds-mono)", fontSize: 11 }, children: a.selector })
1653
+ ] }),
1654
+ a.states.length > 0 && /* @__PURE__ */ t("div", { className: "ds-chips", style: { marginTop: 8 }, children: a.states.map((u) => /* @__PURE__ */ t("span", { className: "ds-chip", children: u }, u)) }),
1655
+ a.hiddenFromAssistiveTech && /* @__PURE__ */ t("p", { className: "ds-note", style: { marginTop: 8 }, children: n.focusableButHidden }),
1656
+ /* @__PURE__ */ t("p", { style: { marginTop: 8 }, children: n.tabStopsInStage(d) })
1657
+ ] }) : /* @__PURE__ */ t("p", { children: n.pressTab(d) }) : /* @__PURE__ */ t("p", { children: n.keyboardModeOff })
1658
+ ] })
1659
+ }
1660
+ ),
1661
+ /* @__PURE__ */ l(
1662
+ z,
1663
+ {
1664
+ scope: "product",
1665
+ title: n.productScope,
1666
+ description: n.productScopeDescription,
1667
+ children: [
1668
+ /* @__PURE__ */ l("div", { className: "ds-block", children: [
1669
+ /* @__PURE__ */ t("h2", { className: "ds-block__title", children: n.tokenContrast }),
1670
+ c.length === 0 ? /* @__PURE__ */ t("p", { children: n.noContrastPairs }) : /* @__PURE__ */ l("table", { className: "ds-contrast", children: [
1671
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { children: [
1672
+ /* @__PURE__ */ t("th", { scope: "col", children: n.pair }),
1673
+ /* @__PURE__ */ t("th", { scope: "col", children: n.ratio })
1674
+ ] }) }),
1675
+ /* @__PURE__ */ t("tbody", { children: c.map((u) => /* @__PURE__ */ l("tr", { children: [
1676
+ /* @__PURE__ */ l("td", { children: [
1677
+ /* @__PURE__ */ t(
1678
+ "span",
1679
+ {
1680
+ className: "ds-swatch",
1681
+ style: { background: u.pair.background },
1682
+ "aria-hidden": "true"
1683
+ }
1684
+ ),
1685
+ /* @__PURE__ */ t(
1686
+ "span",
1687
+ {
1688
+ className: "ds-swatch",
1689
+ style: { background: u.pair.foreground },
1690
+ "aria-hidden": "true"
1691
+ }
1692
+ ),
1693
+ u.pair.name
1694
+ ] }),
1695
+ /* @__PURE__ */ t(
1696
+ "td",
1697
+ {
1698
+ style: {
1699
+ color: u.passes === !0 ? "var(--ds-ok)" : u.passes === !1 ? "var(--ds-err)" : "var(--ds-warn)"
1700
+ },
1701
+ children: u.label
1702
+ }
1703
+ )
1704
+ ] }, u.pair.name)) })
1705
+ ] }),
1706
+ h.length > 0 && /* @__PURE__ */ t("p", { className: "ds-note", style: { marginTop: 8 }, children: n.pairsFailing(h.length) })
1639
1707
  ] }),
1640
- /* @__PURE__ */ o(
1641
- "td",
1642
- {
1643
- style: {
1644
- color: p.passes === !0 ? "var(--ds-ok)" : p.passes === !1 ? "var(--ds-err)" : "var(--ds-warn)"
1645
- },
1646
- children: p.label
1647
- }
1648
- )
1649
- ] }, p.pair.name)) })
1650
- ] }),
1651
- h.length > 0 && /* @__PURE__ */ o("p", { className: "ds-note", style: { marginTop: 8 }, children: r.pairsFailing(h.length) })
1652
- ] }),
1653
- /* @__PURE__ */ o("p", { className: "ds-note", children: r.automatedIsFloor })
1708
+ /* @__PURE__ */ t("p", { className: "ds-note", children: n.automatedIsFloor })
1709
+ ]
1710
+ }
1711
+ )
1654
1712
  ] });
1655
1713
  }
1656
- function st({ registry: e }) {
1657
- const t = P(), n = t.inspector, s = e.coverage({ includePorted: !0 }), { issues: l } = e;
1658
- return /* @__PURE__ */ u(A, { children: [
1659
- /* @__PURE__ */ u("div", { className: "ds-block", children: [
1660
- /* @__PURE__ */ o("h2", { className: "ds-block__title", children: n.coverage }),
1661
- /* @__PURE__ */ o("dl", { className: "ds-kv", children: Object.entries(s).filter(([, a]) => a > 0).map(([a, r]) => /* @__PURE__ */ u("div", { style: { display: "contents" }, children: [
1662
- /* @__PURE__ */ o("dt", { children: t.status[a] }),
1663
- /* @__PURE__ */ o("dd", { style: { fontVariantNumeric: "tabular-nums" }, children: r })
1664
- ] }, a)) }),
1665
- /* @__PURE__ */ o("p", { style: { marginTop: 8 }, children: n.scenariosRegistered(e.product.scenarios.length) })
1666
- ] }),
1667
- /* @__PURE__ */ u("div", { className: "ds-block", children: [
1668
- /* @__PURE__ */ o("h2", { className: "ds-block__title", children: n.scenarioContract }),
1669
- l.length === 0 ? /* @__PURE__ */ o("p", { children: n.noIssues }) : l.map((a, r) => /* @__PURE__ */ u("div", { className: "ds-issue", "data-level": a.level, children: [
1670
- /* @__PURE__ */ o("span", { className: "ds-issue__where", children: a.where }),
1671
- a.message
1672
- ] }, `${a.where}-${r}`))
1673
- ] })
1674
- ] });
1714
+ function bt({ registry: e }) {
1715
+ const o = P(), a = o.inspector, i = e.coverage({ includePorted: !0 }), { issues: d } = e;
1716
+ return /* @__PURE__ */ t(A, { children: /* @__PURE__ */ l(
1717
+ z,
1718
+ {
1719
+ scope: "product",
1720
+ title: a.productScope,
1721
+ description: a.diagnosticsProductNotice,
1722
+ children: [
1723
+ /* @__PURE__ */ l("div", { className: "ds-block", children: [
1724
+ /* @__PURE__ */ t("h2", { className: "ds-block__title", children: a.coverage }),
1725
+ /* @__PURE__ */ t("dl", { className: "ds-kv", children: Object.entries(i).filter(([, r]) => r > 0).map(([r, n]) => /* @__PURE__ */ l("div", { style: { display: "contents" }, children: [
1726
+ /* @__PURE__ */ t("dt", { children: o.status[r] }),
1727
+ /* @__PURE__ */ t("dd", { style: { fontVariantNumeric: "tabular-nums" }, children: n })
1728
+ ] }, r)) }),
1729
+ /* @__PURE__ */ t("p", { style: { marginTop: 8 }, children: a.scenariosRegistered(e.product.scenarios.length) })
1730
+ ] }),
1731
+ /* @__PURE__ */ l("div", { className: "ds-block", children: [
1732
+ /* @__PURE__ */ t("h2", { className: "ds-block__title", children: a.scenarioContract }),
1733
+ d.length === 0 ? /* @__PURE__ */ t("p", { children: a.noIssues }) : d.map((r, n) => /* @__PURE__ */ l("div", { className: "ds-issue", "data-level": r.level, children: [
1734
+ /* @__PURE__ */ t("span", { className: "ds-issue__where", children: r.where }),
1735
+ r.message
1736
+ ] }, `${r.where}-${n}`))
1737
+ ] })
1738
+ ]
1739
+ }
1740
+ ) });
1675
1741
  }
1676
- const it = {
1742
+ const vt = {
1677
1743
  ported: void 0,
1678
1744
  proposed: "warn",
1679
1745
  "in-review": "warn",
@@ -1682,475 +1748,549 @@ const it = {
1682
1748
  implemented: "ok",
1683
1749
  superseded: void 0
1684
1750
  };
1685
- function ct(e) {
1686
- return it[e];
1751
+ function gt(e) {
1752
+ return e.status === "approved" && !e.approvedAt ? "warn" : vt[e.status];
1687
1753
  }
1688
- const dt = pe(function({ viewport: t, textScale: n, reducedMotion: s, keyboardMode: l, children: a }, r) {
1689
- return /* @__PURE__ */ o("div", { className: "ds-stage-scroll", children: /* @__PURE__ */ o(
1754
+ function z({
1755
+ scope: e,
1756
+ title: o,
1757
+ description: a,
1758
+ children: i
1759
+ }) {
1760
+ return /* @__PURE__ */ l("section", { className: "ds-scope-group", "data-scope": e, children: [
1761
+ /* @__PURE__ */ l("header", { className: "ds-scope-group__header", children: [
1762
+ /* @__PURE__ */ t("h2", { children: o }),
1763
+ /* @__PURE__ */ t("p", { children: a })
1764
+ ] }),
1765
+ i
1766
+ ] });
1767
+ }
1768
+ const wt = xe(function({ viewport: o, textScale: a, reducedMotion: i, keyboardMode: d, children: r }, n) {
1769
+ return /* @__PURE__ */ t("div", { className: "ds-stage-scroll", children: /* @__PURE__ */ t(
1690
1770
  "div",
1691
1771
  {
1692
- ref: r,
1772
+ ref: n,
1693
1773
  className: "ds-stage",
1694
- "data-viewport": t.id,
1695
- "data-keyboard-mode": l,
1696
- "data-reduced-motion": s,
1774
+ "data-viewport": o.id,
1775
+ "data-keyboard-mode": d,
1776
+ "data-reduced-motion": i,
1697
1777
  style: {
1698
- width: t.width ? `${t.width}px` : "100%",
1699
- minHeight: t.height ? `${t.height}px` : void 0,
1778
+ width: o.width ? `${o.width}px` : "100%",
1779
+ minHeight: o.height ? `${o.height}px` : void 0,
1700
1780
  // A ampliação é aplicada no `font-size` do contêiner, não com
1701
1781
  // `transform: scale`. É a diferença entre testar se o layout aguenta
1702
1782
  // texto grande e só dar zoom na captura de tela.
1703
- fontSize: n === 1 ? void 0 : `${n * 100}%`
1783
+ fontSize: a === 1 ? void 0 : `${a * 100}%`
1704
1784
  },
1705
- children: a
1785
+ children: r
1706
1786
  }
1707
1787
  ) });
1708
1788
  });
1709
- function lt({ stops: e }) {
1710
- return e.length === 0 ? null : /* @__PURE__ */ o("div", { className: "ds-chrome ds-taborder", "aria-hidden": "true", children: e.map((t) => /* @__PURE__ */ o(
1789
+ function kt({ stops: e }) {
1790
+ return e.length === 0 ? null : /* @__PURE__ */ t("div", { className: "ds-chrome ds-taborder", "aria-hidden": "true", children: e.map((o) => /* @__PURE__ */ t(
1711
1791
  "span",
1712
1792
  {
1713
1793
  className: "ds-taborder__badge",
1714
- "data-forced": t.forcedOrder,
1715
- style: { top: t.rect.top, left: t.rect.left },
1716
- children: t.index
1794
+ "data-forced": o.forcedOrder,
1795
+ style: { top: o.rect.top, left: o.rect.left },
1796
+ children: o.index
1717
1797
  },
1718
- `${t.index}-${t.rect.top}-${t.rect.left}`
1798
+ `${o.index}-${o.rect.top}-${o.rect.left}`
1719
1799
  )) });
1720
1800
  }
1721
- function ut({ title: e, children: t }) {
1722
- return /* @__PURE__ */ u("div", { className: "ds-chrome ds-stage-empty", children: [
1723
- /* @__PURE__ */ o("h2", { children: e }),
1724
- t
1801
+ function fe({ title: e, children: o }) {
1802
+ return /* @__PURE__ */ l("div", { className: "ds-chrome ds-stage-empty", children: [
1803
+ /* @__PURE__ */ t("h2", { children: e }),
1804
+ o
1725
1805
  ] });
1726
1806
  }
1727
- function ht({
1807
+ function Nt({
1728
1808
  registry: e,
1729
- onOpenScenario: t,
1730
- view: n,
1731
- onViewChange: s,
1732
- showPorted: l = !1
1809
+ onOpenScenario: o,
1810
+ view: a,
1811
+ onViewChange: i,
1812
+ handoff: d,
1813
+ showPorted: r = !1
1733
1814
  }) {
1734
- const a = P(), { product: r } = e, c = n ?? (l ? "ported" : "active"), h = { view: c }, p = e.coverage(h), m = e.activeScenarios(h).length, v = e.treeFor(h).filter((S) => S.scenarios.length > 0), i = e.orphansFor(h), N = e.byStatus("ported").length, x = c === "ported" ? a.sidebar.portedReferences(N) : a.sidebar.activeWork;
1735
- return /* @__PURE__ */ u("div", { className: "ds-chrome ds-home", children: [
1736
- /* @__PURE__ */ u("header", { className: "ds-home__header", children: [
1737
- /* @__PURE__ */ o("p", { className: "ds-home__view", "aria-live": "polite", children: x }),
1738
- /* @__PURE__ */ o("h1", { children: r.name }),
1739
- r.tagline && /* @__PURE__ */ o("p", { className: "ds-home__tagline", children: r.tagline }),
1740
- /* @__PURE__ */ o("p", { className: "ds-home__lead", children: a.home.lead(m) }),
1741
- /* @__PURE__ */ o("div", { className: "ds-chips", children: Object.entries(p).filter(([, S]) => S > 0).map(([S, d]) => /* @__PURE__ */ u("span", { className: "ds-chip", children: [
1742
- a.status[S],
1815
+ const n = P(), { product: c } = e, h = a ?? (r ? "ported" : "active"), u = { view: h, handoff: d }, g = e.coverage(u), f = e.activeScenarios(u).length, p = e.treeFor(u).filter((s) => s.scenarios.length > 0), b = e.orphansFor(u), S = e.byStatus("ported", { handoff: d }).length, _ = h === "ported" ? n.sidebar.portedReferences(S) : n.sidebar.activeWork;
1816
+ return /* @__PURE__ */ l("div", { className: "ds-chrome ds-home", children: [
1817
+ /* @__PURE__ */ l("header", { className: "ds-home__header", children: [
1818
+ /* @__PURE__ */ t("p", { className: "ds-home__view", "aria-live": "polite", children: _ }),
1819
+ /* @__PURE__ */ t("h1", { children: c.name }),
1820
+ c.tagline && /* @__PURE__ */ t("p", { className: "ds-home__tagline", children: c.tagline }),
1821
+ /* @__PURE__ */ t("p", { className: "ds-home__lead", children: n.home.lead(f) }),
1822
+ /* @__PURE__ */ t("div", { className: "ds-chips", children: Object.entries(g).filter(([, s]) => s > 0).map(([s, m]) => /* @__PURE__ */ l("span", { className: "ds-chip", children: [
1823
+ n.status[s],
1743
1824
  ": ",
1744
- d
1745
- ] }, S)) }),
1746
- m > 0 && c === "active" && N > 0 && /* @__PURE__ */ o(
1825
+ m
1826
+ ] }, s)) }),
1827
+ f > 0 && h === "active" && S > 0 && /* @__PURE__ */ t(
1747
1828
  "button",
1748
1829
  {
1749
1830
  type: "button",
1750
1831
  className: "ds-text-action ds-home__view-action",
1751
- onClick: () => s?.("ported"),
1752
- children: a.sidebar.viewPorted(N)
1832
+ onClick: () => i?.("ported"),
1833
+ children: n.sidebar.viewPorted(S)
1753
1834
  }
1754
1835
  ),
1755
- c === "ported" && /* @__PURE__ */ o(
1836
+ h === "ported" && /* @__PURE__ */ t(
1756
1837
  "button",
1757
1838
  {
1758
1839
  type: "button",
1759
1840
  className: "ds-text-action ds-home__view-action",
1760
- onClick: () => s?.("active"),
1761
- children: a.sidebar.backToActive
1841
+ onClick: () => i?.("active"),
1842
+ children: n.sidebar.backToActive
1762
1843
  }
1763
1844
  )
1764
1845
  ] }),
1765
- /* @__PURE__ */ u("section", { className: "ds-home__legend", "aria-labelledby": "ds-status-legend-title", children: [
1766
- /* @__PURE__ */ o("h2", { id: "ds-status-legend-title", children: a.home.statusLegend }),
1767
- /* @__PURE__ */ o("ul", { children: se.map((S) => /* @__PURE__ */ u("li", { children: [
1768
- /* @__PURE__ */ o("span", { className: "ds-status-dot", "data-status": S, "aria-hidden": "true" }),
1769
- /* @__PURE__ */ u("span", { children: [
1770
- /* @__PURE__ */ o("strong", { children: a.status[S] }),
1771
- /* @__PURE__ */ o("small", { children: a.statusMeaning[S] })
1846
+ /* @__PURE__ */ l("section", { className: "ds-home__legend", "aria-labelledby": "ds-status-legend-title", children: [
1847
+ /* @__PURE__ */ t("h2", { id: "ds-status-legend-title", children: n.home.statusLegend }),
1848
+ /* @__PURE__ */ t("ul", { children: be.map((s) => /* @__PURE__ */ l("li", { children: [
1849
+ /* @__PURE__ */ t("span", { className: "ds-status-dot", "data-status": s, "aria-hidden": "true" }),
1850
+ /* @__PURE__ */ l("span", { children: [
1851
+ /* @__PURE__ */ t("strong", { children: n.status[s] }),
1852
+ /* @__PURE__ */ t("small", { children: n.statusMeaning[s] })
1772
1853
  ] })
1773
- ] }, S)) })
1854
+ ] }, s)) })
1774
1855
  ] }),
1775
- m === 0 && /* @__PURE__ */ u("section", { className: "ds-home__empty", "aria-label": a.sidebar.currentView(x), children: [
1776
- /* @__PURE__ */ o("p", { children: c === "ported" ? a.home.noPortedReferences : a.home.noActiveWork }),
1777
- c === "active" && N > 0 && /* @__PURE__ */ o(
1856
+ f === 0 && /* @__PURE__ */ l("section", { className: "ds-home__empty", "aria-label": n.sidebar.currentView(_), children: [
1857
+ /* @__PURE__ */ t("p", { children: h === "ported" ? n.home.noPortedReferences : n.home.noActiveWork }),
1858
+ h === "active" && S > 0 && /* @__PURE__ */ t(
1778
1859
  "button",
1779
1860
  {
1780
1861
  type: "button",
1781
1862
  className: "ds-text-action",
1782
- onClick: () => s?.("ported"),
1783
- children: a.sidebar.viewPorted(N)
1863
+ onClick: () => i?.("ported"),
1864
+ children: n.sidebar.viewPorted(S)
1784
1865
  }
1785
1866
  )
1786
1867
  ] }),
1787
- v.map(({ module: S, scenarios: d }) => /* @__PURE__ */ o(
1788
- pt,
1868
+ p.map(({ module: s, scenarios: m }) => /* @__PURE__ */ t(
1869
+ St,
1789
1870
  {
1790
- module: S,
1791
- scenarios: d,
1871
+ module: s,
1872
+ scenarios: m,
1792
1873
  registry: e,
1793
- view: c,
1794
- onOpenScenario: t
1874
+ view: h,
1875
+ handoff: d,
1876
+ onOpenScenario: o
1795
1877
  },
1796
- S.id
1878
+ s.id
1797
1879
  )),
1798
- i.length > 0 && /* @__PURE__ */ u("section", { className: "ds-home__module", children: [
1799
- /* @__PURE__ */ o("h2", { children: a.home.withoutModule }),
1800
- /* @__PURE__ */ o("p", { className: "ds-home__hint", children: a.home.withoutModuleHint }),
1801
- /* @__PURE__ */ o(
1802
- le,
1880
+ b.length > 0 && /* @__PURE__ */ l("section", { className: "ds-home__module", children: [
1881
+ /* @__PURE__ */ t("h2", { children: n.home.withoutModule }),
1882
+ /* @__PURE__ */ t("p", { className: "ds-home__hint", children: n.home.withoutModuleHint }),
1883
+ /* @__PURE__ */ t(
1884
+ ke,
1803
1885
  {
1804
- scenarios: i,
1886
+ scenarios: b,
1805
1887
  registry: e,
1806
- onOpenScenario: t
1888
+ onOpenScenario: o
1807
1889
  }
1808
1890
  )
1809
1891
  ] })
1810
1892
  ] });
1811
1893
  }
1812
- function pt({
1894
+ function St({
1813
1895
  module: e,
1814
- scenarios: t,
1815
- registry: n,
1816
- view: s,
1817
- onOpenScenario: l
1896
+ scenarios: o,
1897
+ registry: a,
1898
+ view: i,
1899
+ handoff: d,
1900
+ onOpenScenario: r
1818
1901
  }) {
1819
- return /* @__PURE__ */ u("section", { className: "ds-home__module", children: [
1820
- /* @__PURE__ */ o("h2", { children: e.name }),
1821
- e.description && /* @__PURE__ */ o("p", { className: "ds-home__hint", children: e.description }),
1822
- (e.flows ?? []).map((a) => /* @__PURE__ */ o(
1823
- mt,
1902
+ return /* @__PURE__ */ l("section", { className: "ds-home__module", children: [
1903
+ /* @__PURE__ */ t("h2", { children: e.name }),
1904
+ e.description && /* @__PURE__ */ t("p", { className: "ds-home__hint", children: e.description }),
1905
+ (e.flows ?? []).map((n) => /* @__PURE__ */ t(
1906
+ xt,
1824
1907
  {
1825
- flow: a,
1826
- registry: n,
1827
- view: s,
1828
- onOpenScenario: l
1908
+ flow: n,
1909
+ registry: a,
1910
+ view: i,
1911
+ handoff: d,
1912
+ onOpenScenario: r
1829
1913
  },
1830
- a.id
1914
+ n.id
1831
1915
  )),
1832
- /* @__PURE__ */ o(le, { scenarios: t, registry: n, onOpenScenario: l })
1916
+ /* @__PURE__ */ t(ke, { scenarios: o, registry: a, onOpenScenario: r })
1833
1917
  ] });
1834
1918
  }
1835
- function mt({
1919
+ function xt({
1836
1920
  flow: e,
1837
- registry: t,
1838
- view: n,
1839
- onOpenScenario: s
1921
+ registry: o,
1922
+ view: a,
1923
+ handoff: i,
1924
+ onOpenScenario: d
1840
1925
  }) {
1841
- const l = e.steps.filter((a) => {
1842
- const r = t.scenario(a.scenario);
1843
- return r && (n === "ported" ? r.status === "ported" : r.status !== "ported");
1926
+ const r = e.steps.filter((n) => {
1927
+ const c = o.scenario(n.scenario);
1928
+ return c && (!i || i.scenarios?.includes(c.id)) && (a === "ported" ? c.status === "ported" : c.status !== "ported");
1844
1929
  });
1845
- return l.length === 0 ? null : /* @__PURE__ */ u("div", { className: "ds-flow", children: [
1846
- /* @__PURE__ */ o("h3", { children: e.title }),
1847
- e.description && /* @__PURE__ */ o("p", { className: "ds-home__hint", children: e.description }),
1848
- /* @__PURE__ */ o("ol", { className: "ds-flow__steps", children: l.map((a, r) => {
1849
- const c = t.scenario(a.scenario), h = Object.entries(a.branches ?? {}).filter(([, p]) => {
1850
- const m = t.scenario(p);
1851
- return m && (n === "ported" ? m.status === "ported" : m.status !== "ported");
1930
+ return r.length === 0 ? null : /* @__PURE__ */ l("div", { className: "ds-flow", children: [
1931
+ /* @__PURE__ */ t("h3", { children: e.title }),
1932
+ e.description && /* @__PURE__ */ t("p", { className: "ds-home__hint", children: e.description }),
1933
+ /* @__PURE__ */ t("ol", { className: "ds-flow__steps", children: r.map((n, c) => {
1934
+ const h = o.scenario(n.scenario), u = Object.entries(n.branches ?? {}).filter(([, g]) => {
1935
+ const f = o.scenario(g);
1936
+ return f && (!i || i.scenarios?.includes(f.id)) && (a === "ported" ? f.status === "ported" : f.status !== "ported");
1852
1937
  });
1853
- return /* @__PURE__ */ u("li", { children: [
1854
- /* @__PURE__ */ o("button", { type: "button", className: "ds-flow__step", onClick: () => s(a.scenario), children: a.label ?? c?.title ?? a.scenario }),
1855
- a.decision && /* @__PURE__ */ o("p", { className: "ds-flow__decision", children: a.decision }),
1856
- h.length > 0 && /* @__PURE__ */ o("ul", { className: "ds-flow__branches", children: h.map(([p, m]) => /* @__PURE__ */ u("li", { children: [
1857
- /* @__PURE__ */ o("span", { className: "ds-flow__branch-label", children: p }),
1858
- /* @__PURE__ */ o(
1938
+ return /* @__PURE__ */ l("li", { children: [
1939
+ /* @__PURE__ */ t("button", { type: "button", className: "ds-flow__step", onClick: () => d(n.scenario), children: n.label ?? h?.title ?? n.scenario }),
1940
+ n.decision && /* @__PURE__ */ t("p", { className: "ds-flow__decision", children: n.decision }),
1941
+ u.length > 0 && /* @__PURE__ */ t("ul", { className: "ds-flow__branches", children: u.map(([g, f]) => /* @__PURE__ */ l("li", { children: [
1942
+ /* @__PURE__ */ t("span", { className: "ds-flow__branch-label", children: g }),
1943
+ /* @__PURE__ */ t(
1859
1944
  "button",
1860
1945
  {
1861
1946
  type: "button",
1862
1947
  className: "ds-flow__step",
1863
- onClick: () => s(m),
1864
- children: t.scenario(m)?.title ?? m
1948
+ onClick: () => d(f),
1949
+ children: o.scenario(f)?.title ?? f
1865
1950
  }
1866
1951
  )
1867
- ] }, p)) })
1868
- ] }, `${a.scenario}-${r}`);
1952
+ ] }, g)) })
1953
+ ] }, `${n.scenario}-${c}`);
1869
1954
  }) })
1870
1955
  ] });
1871
1956
  }
1872
- function le({
1957
+ function ke({
1873
1958
  scenarios: e,
1874
- registry: t,
1875
- onOpenScenario: n
1959
+ registry: o,
1960
+ onOpenScenario: a
1876
1961
  }) {
1877
- const s = P();
1878
- return /* @__PURE__ */ o("ul", { className: "ds-home__grid", children: e.map((l) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ u("button", { type: "button", className: "ds-home__card", onClick: () => n(l.id), children: [
1879
- /* @__PURE__ */ u("span", { className: "ds-home__card-head", children: [
1880
- /* @__PURE__ */ o("span", { className: "ds-status-dot", "data-status": l.status }),
1881
- /* @__PURE__ */ o("span", { className: "ds-home__card-title", children: l.title })
1962
+ const i = P();
1963
+ return /* @__PURE__ */ t("ul", { className: "ds-home__grid", children: e.map((d) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ l("button", { type: "button", className: "ds-home__card", onClick: () => a(d.id), children: [
1964
+ /* @__PURE__ */ l("span", { className: "ds-home__card-head", children: [
1965
+ /* @__PURE__ */ t(
1966
+ "span",
1967
+ {
1968
+ className: "ds-status-dot",
1969
+ "data-status": d.status,
1970
+ "data-approval": d.status === "approved" && !d.approvedAt ? "incomplete" : void 0
1971
+ }
1972
+ ),
1973
+ /* @__PURE__ */ t("span", { className: "ds-home__card-title", children: d.title })
1882
1974
  ] }),
1883
- l.intent && /* @__PURE__ */ o("span", { className: "ds-home__card-intent", children: l.intent }),
1884
- /* @__PURE__ */ u("span", { className: "ds-home__card-meta", children: [
1885
- t.persona(l.persona)?.name ?? l.persona,
1975
+ d.intent && /* @__PURE__ */ t("span", { className: "ds-home__card-intent", children: d.intent }),
1976
+ /* @__PURE__ */ l("span", { className: "ds-home__card-meta", children: [
1977
+ o.persona(d.persona)?.name ?? d.persona,
1886
1978
  " · ",
1887
- s.status[l.status],
1888
- l.a11y.keyboard === "full" ? ` · ${s.home.keyboardBadge}` : ""
1979
+ d.status === "approved" && !d.approvedAt ? i.inspector.approvalPendingStatus : i.status[d.status],
1980
+ d.a11y.keyboard === "full" ? ` · ${i.home.keyboardBadge}` : ""
1889
1981
  ] })
1890
- ] }) }, l.id)) });
1982
+ ] }) }, d.id)) });
1891
1983
  }
1892
- function St({ product: e }) {
1893
- const t = C(() => ge(e), [e]), n = C(() => Ue(e.theme?.labels), [e.theme?.labels]), s = C(() => ve(e.deploy), [e.deploy]), {
1894
- location: l,
1895
- controls: a,
1896
- viewport: r,
1984
+ function $t({ product: e }) {
1985
+ const o = T(() => Le(e), [e]), a = T(() => tt(e.theme?.labels), [e.theme?.labels]), i = T(() => Te(e.deploy), [e.deploy]), {
1986
+ location: d,
1987
+ controls: r,
1988
+ viewport: n,
1897
1989
  setControls: c,
1898
1990
  setScenarioView: h,
1899
- navigate: p,
1900
- openScenario: m,
1901
- openComponent: v
1902
- } = Ne(t), i = ee(a), N = Q(null), { focused: x, tabStops: S } = ze(a.keyboardMode, N), d = t.scenario(a.scenario), f = t.component(a.component), k = C(
1903
- () => t.resolveComponentFixture(f?.id, f ? a.fixture : void 0),
1904
- [f, a.fixture, t]
1905
- ), M = C(() => {
1906
- const w = k.fixture?.data;
1907
- return typeof w == "function" ? w() : w;
1908
- }, [k.fixture]), _ = t.persona(a.persona ?? d?.persona), T = t.fixture(a.fixture ?? d?.fixture), B = C(() => {
1909
- const w = a.dataSource ?? "fixtures";
1910
- return w === "fixtures" ? Z : e.dataSources?.adapters?.find((y) => y.id === w) ?? Z;
1911
- }, [a.dataSource, e.dataSources?.adapters]), { data: W, isLoading: F, error: R } = $e({ scenario: d, fixture: T, network: a.network, adapter: B });
1912
- I(() => {
1913
- const w = (y) => {
1914
- if (!(!y.shiftKey || y.metaKey || y.ctrlKey || y.altKey || y.target?.matches("input, textarea, select, [contenteditable='true']"))) {
1915
- switch (y.key) {
1991
+ navigate: u,
1992
+ openScenario: g,
1993
+ openComponent: f
1994
+ } = Ee(o), p = ce(r), b = re(null), { focused: S, tabStops: _ } = et(r.keyboardMode, b);
1995
+ D(() => {
1996
+ const N = b.current;
1997
+ if (!N || !r.handoff) return;
1998
+ const C = () => {
1999
+ for (const de of N.querySelectorAll("a[href]")) {
2000
+ const Q = de.getAttribute("href");
2001
+ if (!Q || Q.startsWith("#")) continue;
2002
+ let W;
2003
+ try {
2004
+ W = new URL(Q, window.location.href);
2005
+ } catch {
2006
+ continue;
2007
+ }
2008
+ if (W.origin !== window.location.origin) continue;
2009
+ oe(W.searchParams, r.handoff);
2010
+ const le = `${W.pathname}${W.search}${W.hash}`;
2011
+ Q !== le && de.setAttribute("href", le);
2012
+ }
2013
+ };
2014
+ C();
2015
+ const ae = new MutationObserver(C);
2016
+ return ae.observe(N, {
2017
+ subtree: !0,
2018
+ childList: !0,
2019
+ attributes: !0,
2020
+ attributeFilter: ["href"]
2021
+ }), () => ae.disconnect();
2022
+ }, [r.handoff]);
2023
+ const s = o.scenario(r.scenario), m = o.component(r.component), k = T(() => {
2024
+ const N = new URLSearchParams(d.search);
2025
+ return {
2026
+ scenario: N.get(w.scenario) ?? void 0,
2027
+ component: N.get(w.component) ?? void 0
2028
+ };
2029
+ }, [d.search]), M = !!(r.handoff && (k.scenario && !te(r.handoff, k.scenario) || k.component && !ee(r.handoff, k.component) || !k.component && !Ae(
2030
+ r.handoff,
2031
+ d.path,
2032
+ e.scenarios
2033
+ ))), y = T(
2034
+ () => o.resolveComponentFixture(m?.id, m ? r.fixture : void 0),
2035
+ [m, r.fixture, o]
2036
+ ), E = T(() => {
2037
+ const N = y.fixture?.data;
2038
+ return typeof N == "function" ? N() : N;
2039
+ }, [y.fixture]), $ = o.persona(r.persona ?? s?.persona), O = o.fixture(r.fixture ?? s?.fixture), G = T(() => {
2040
+ const N = r.dataSource ?? "fixtures";
2041
+ return N === "fixtures" ? ie : e.dataSources?.adapters?.find((C) => C.id === N) ?? ie;
2042
+ }, [r.dataSource, e.dataSources?.adapters]), { data: I, isLoading: B, error: U } = ze({ scenario: s, fixture: O, network: r.network, adapter: G });
2043
+ D(() => {
2044
+ const N = (C) => {
2045
+ if (!(!C.shiftKey || C.metaKey || C.ctrlKey || C.altKey || C.target?.matches("input, textarea, select, [contenteditable='true']"))) {
2046
+ switch (C.key) {
1916
2047
  case "K":
1917
- c({ keyboardMode: !a.keyboardMode });
2048
+ c({ keyboardMode: !r.keyboardMode });
1918
2049
  break;
1919
2050
  case "P":
1920
- c({ inspector: !a.inspector });
2051
+ c({ inspector: !r.inspector });
1921
2052
  break;
1922
2053
  default:
1923
2054
  return;
1924
2055
  }
1925
- y.preventDefault();
2056
+ C.preventDefault();
1926
2057
  }
1927
2058
  };
1928
- return window.addEventListener("keydown", w), () => window.removeEventListener("keydown", w);
1929
- }, [a.keyboardMode, a.inspector, c]);
1930
- const D = C(() => a.persona && a.persona !== d?.persona ? t.persona(a.persona)?.permissions ?? [] : t.permissionsOf(d), [a.persona, t, d]), j = C(
2059
+ return window.addEventListener("keydown", N), () => window.removeEventListener("keydown", N);
2060
+ }, [r.keyboardMode, r.inspector, c]);
2061
+ const H = T(() => r.persona && r.persona !== s?.persona ? o.persona(r.persona)?.permissions ?? [] : o.permissionsOf(s), [r.persona, o, s]), j = T(
1931
2062
  () => ({
1932
- scenario: d,
1933
- persona: _,
1934
- permissions: D,
1935
- can: (w) => D.includes(w),
1936
- data: W,
1937
- fixture: T,
1938
- network: a.network,
1939
- isLoading: F,
1940
- error: R,
1941
- rules: t.rulesOf(d),
1942
- viewport: r,
1943
- themeMode: a.themeMode,
1944
- locale: a.locale,
2063
+ scenario: s,
2064
+ persona: $,
2065
+ permissions: H,
2066
+ can: (N) => H.includes(N),
2067
+ data: I,
2068
+ fixture: O,
2069
+ network: r.network,
2070
+ isLoading: B,
2071
+ error: U,
2072
+ rules: o.rulesOf(s),
2073
+ viewport: n,
2074
+ themeMode: r.themeMode,
2075
+ locale: r.locale,
1945
2076
  a11y: {
1946
- keyboardMode: a.keyboardMode,
1947
- reducedMotion: a.reducedMotion,
1948
- textScale: a.textScale
2077
+ keyboardMode: r.keyboardMode,
2078
+ reducedMotion: r.reducedMotion,
2079
+ textScale: r.textScale
1949
2080
  },
1950
- navigate: p,
1951
- openScenario: m
2081
+ navigate: u,
2082
+ openScenario: g
1952
2083
  }),
1953
2084
  [
1954
- d,
1955
- _,
1956
- D,
1957
- W,
1958
- T,
1959
- a.network,
1960
- a.themeMode,
1961
- a.locale,
1962
- a.keyboardMode,
1963
- a.reducedMotion,
1964
- a.textScale,
1965
- F,
1966
- R,
1967
- t,
1968
- r,
1969
- p,
1970
- m
2085
+ s,
2086
+ $,
2087
+ H,
2088
+ I,
2089
+ O,
2090
+ r.network,
2091
+ r.themeMode,
2092
+ r.locale,
2093
+ r.keyboardMode,
2094
+ r.reducedMotion,
2095
+ r.textScale,
2096
+ B,
2097
+ U,
2098
+ o,
2099
+ n,
2100
+ u,
2101
+ g
1971
2102
  ]
1972
- ), z = !d && !f && l.path === "/", O = Ce(e.routes, l.path), U = e.wrapper, H = e.notFound, K = f?.preview, V = K ? /* @__PURE__ */ o(
1973
- K,
2103
+ ), Y = !M && !s && !m && d.path === "/", K = Pe(e.routes, d.path), V = e.wrapper, q = e.notFound, J = m?.preview, v = M ? /* @__PURE__ */ t(fe, { title: a.shell.outsideHandoff, children: /* @__PURE__ */ t("p", { children: a.shell.outsideHandoffHint }) }) : J ? /* @__PURE__ */ t(
2104
+ J,
1974
2105
  {
1975
- fixture: k.fixture,
1976
- data: M,
1977
- viewport: r,
1978
- themeMode: a.themeMode ?? "default",
1979
- locale: a.locale ?? "default",
2106
+ fixture: y.fixture,
2107
+ data: E,
2108
+ viewport: n,
2109
+ themeMode: r.themeMode ?? "default",
2110
+ locale: r.locale ?? "default",
1980
2111
  a11y: {
1981
- keyboardMode: a.keyboardMode,
1982
- reducedMotion: a.reducedMotion,
1983
- textScale: a.textScale
2112
+ keyboardMode: r.keyboardMode,
2113
+ reducedMotion: r.reducedMotion,
2114
+ textScale: r.textScale
1984
2115
  }
1985
2116
  }
1986
- ) : O ? /* @__PURE__ */ o(O.definition.screen, { params: O.params, context: j }) : H ? /* @__PURE__ */ o(H, { path: l.path }) : /* @__PURE__ */ o(ut, { title: n.shell.noRoute, children: /* @__PURE__ */ u("p", { children: [
1987
- /* @__PURE__ */ o("code", { children: l.path }),
2117
+ ) : K ? /* @__PURE__ */ t(K.definition.screen, { params: K.params, context: j }) : q ? /* @__PURE__ */ t(q, { path: d.path }) : /* @__PURE__ */ t(fe, { title: a.shell.noRoute, children: /* @__PURE__ */ l("p", { children: [
2118
+ /* @__PURE__ */ t("code", { children: d.path }),
1988
2119
  " ",
1989
- n.shell.noRouteHint
1990
- ] }) }), b = U ? /* @__PURE__ */ o(U, { context: j, children: V }) : V;
1991
- return /* @__PURE__ */ o(de.Provider, { value: n, children: /* @__PURE__ */ u(
2120
+ a.shell.noRouteHint
2121
+ ] }) }), x = V && !M ? /* @__PURE__ */ t(V, { context: j, children: v }) : v;
2122
+ return /* @__PURE__ */ t(we.Provider, { value: a, children: /* @__PURE__ */ l(
1992
2123
  "div",
1993
2124
  {
1994
2125
  className: "ds-root",
1995
- "data-chrome": a.chrome ? "visible" : "hidden",
1996
- "data-appearance": a.chromeTheme ?? "dark",
1997
- "data-inspector": a.inspector ? "open" : "closed",
1998
- "data-viewport": r.id,
2126
+ "data-chrome": r.chrome ? "visible" : "hidden",
2127
+ "data-appearance": r.chromeTheme ?? "dark",
2128
+ "data-inspector": r.inspector ? "open" : "closed",
2129
+ "data-viewport": n.id,
1999
2130
  children: [
2000
- a.chrome && /* @__PURE__ */ o(
2001
- Qe,
2131
+ r.chrome && /* @__PURE__ */ t(
2132
+ it,
2002
2133
  {
2003
2134
  product: e,
2004
- scenario: d,
2005
- deploy: s,
2006
- inspectorOpen: a.inspector,
2007
- chromeTheme: a.chromeTheme ?? "dark",
2008
- view: i,
2009
- onToggleInspector: () => c({ inspector: !a.inspector }),
2010
- onToggleChromeTheme: () => c({ chromeTheme: a.chromeTheme === "light" ? "dark" : "light" })
2135
+ scenario: s,
2136
+ deploy: i,
2137
+ inspectorOpen: r.inspector,
2138
+ chromeTheme: r.chromeTheme ?? "dark",
2139
+ view: p,
2140
+ handoff: r.handoff,
2141
+ onToggleInspector: () => c({ inspector: !r.inspector }),
2142
+ onToggleChromeTheme: () => c({ chromeTheme: r.chromeTheme === "light" ? "dark" : "light" })
2011
2143
  }
2012
2144
  ),
2013
- a.chrome && /* @__PURE__ */ o(
2014
- Ve,
2145
+ r.chrome && /* @__PURE__ */ t(
2146
+ ot,
2015
2147
  {
2016
- registry: t,
2017
- activeScenario: d,
2018
- activeComponent: a.component,
2019
- controls: a,
2020
- onOpenScenario: m,
2021
- onOpenComponent: v,
2148
+ registry: o,
2149
+ activeScenario: s,
2150
+ activeComponent: r.component,
2151
+ controls: r,
2152
+ onOpenScenario: g,
2153
+ onOpenComponent: f,
2022
2154
  onViewChange: h
2023
2155
  }
2024
2156
  ),
2025
- /* @__PURE__ */ u("div", { className: "ds-stage-area", children: [
2026
- z ? /* @__PURE__ */ o("div", { className: "ds-stage-scroll", children: /* @__PURE__ */ o(
2027
- ht,
2157
+ /* @__PURE__ */ l("div", { className: "ds-stage-area", children: [
2158
+ Y ? /* @__PURE__ */ t("div", { className: "ds-stage-scroll", children: /* @__PURE__ */ t(
2159
+ Nt,
2028
2160
  {
2029
- registry: t,
2030
- view: i,
2161
+ registry: o,
2162
+ view: p,
2163
+ handoff: r.handoff,
2031
2164
  onViewChange: h,
2032
- onOpenScenario: m
2165
+ onOpenScenario: g
2033
2166
  }
2034
- ) }) : /* @__PURE__ */ o(
2035
- dt,
2167
+ ) }) : /* @__PURE__ */ t(
2168
+ wt,
2036
2169
  {
2037
- ref: N,
2038
- viewport: r,
2039
- textScale: a.textScale,
2040
- reducedMotion: a.reducedMotion,
2041
- keyboardMode: a.keyboardMode,
2042
- children: b
2170
+ ref: b,
2171
+ viewport: n,
2172
+ textScale: r.textScale,
2173
+ reducedMotion: r.reducedMotion,
2174
+ keyboardMode: r.keyboardMode,
2175
+ children: x
2043
2176
  }
2044
2177
  ),
2045
- a.chrome && /* @__PURE__ */ o(
2046
- tt,
2178
+ r.chrome && /* @__PURE__ */ t(
2179
+ pt,
2047
2180
  {
2048
- registry: t,
2049
- controls: a,
2050
- scenarioActive: !!d,
2051
- component: f,
2052
- componentFixture: k,
2181
+ registry: o,
2182
+ controls: r,
2183
+ scenarioActive: !!s,
2184
+ component: m,
2185
+ componentFixture: y,
2053
2186
  onChange: c
2054
2187
  }
2055
2188
  )
2056
2189
  ] }),
2057
- a.chrome && /* @__PURE__ */ o(
2058
- nt,
2190
+ r.chrome && /* @__PURE__ */ t(
2191
+ ht,
2059
2192
  {
2060
- registry: t,
2061
- scenario: d,
2062
- component: f,
2063
- componentFixture: k,
2064
- controls: a,
2065
- focusedNode: x,
2066
- tabStopCount: S.length
2193
+ registry: o,
2194
+ scenario: s,
2195
+ component: m,
2196
+ componentFixture: y,
2197
+ controls: r,
2198
+ focusedNode: S,
2199
+ tabStopCount: _.length
2067
2200
  }
2068
2201
  ),
2069
- a.keyboardMode && /* @__PURE__ */ o(lt, { stops: S }),
2070
- !a.chrome && /* @__PURE__ */ o(
2202
+ r.keyboardMode && /* @__PURE__ */ t(kt, { stops: _ }),
2203
+ !r.chrome && /* @__PURE__ */ t(
2071
2204
  "button",
2072
2205
  {
2073
2206
  type: "button",
2074
2207
  className: "ds-chrome ds-restore",
2075
2208
  onClick: () => c({ chrome: !0 }),
2076
- children: n.shell.restoreChrome
2209
+ children: a.shell.restoreChrome
2077
2210
  }
2078
2211
  )
2079
2212
  ]
2080
2213
  }
2081
2214
  ) });
2082
2215
  }
2083
- function Y(e) {
2216
+ function Z(e) {
2084
2217
  return new Date(e.length === 10 ? `${e}T00:00:00` : e);
2085
2218
  }
2086
- function _t(e, t) {
2087
- const n = Y(e), s = Y(t);
2088
- let l = s.getFullYear() - n.getFullYear();
2089
- const a = s.getMonth() - n.getMonth();
2090
- return (a < 0 || a === 0 && s.getDate() < n.getDate()) && (l -= 1), l;
2219
+ function Et(e, o) {
2220
+ const a = Z(e), i = Z(o);
2221
+ let d = i.getFullYear() - a.getFullYear();
2222
+ const r = i.getMonth() - a.getMonth();
2223
+ return (r < 0 || r === 0 && i.getDate() < a.getDate()) && (d -= 1), d;
2091
2224
  }
2092
- function Mt(e, t) {
2093
- const n = Y(e), s = Y(t);
2094
- return Math.floor((s.getTime() - n.getTime()) / 864e5);
2225
+ function Rt(e, o) {
2226
+ const a = Z(e), i = Z(o);
2227
+ return Math.floor((i.getTime() - a.getTime()) / 864e5);
2095
2228
  }
2096
2229
  export {
2097
- At as CONTRAST_THRESHOLDS,
2230
+ It as CONTRAST_THRESHOLDS,
2098
2231
  L as DEFAULT_LABELS,
2099
- St as DesignSpace,
2100
- wt as EN_US_LABELS,
2101
- ht as Home,
2102
- yt as KEYBOARD_LABELS,
2103
- xt as NETWORK_LABELS,
2104
- ie as NETWORK_STATES,
2105
- g as PARAM,
2106
- se as SCENARIO_STATUSES,
2107
- Ae as SLOW_NETWORK_DELAY_MS,
2108
- kt as STATUS_LABELS,
2109
- Nt as STATUS_MEANING,
2110
- Pe as SimulatedNetworkError,
2111
- dt as Stage,
2112
- ut as StageEmpty,
2113
- we as TEXT_SCALES,
2114
- lt as TabOrderOverlay,
2115
- ce as VIEWPORTS,
2116
- _t as ageInYears,
2117
- Pt as applyOverrides,
2118
- Lt as assertContrastPairs,
2119
- $t as checkContrastPair,
2120
- be as checkContrastPairs,
2121
- Et as commitUrl,
2122
- Ft as componentUrl,
2123
- De as computeRole,
2124
- Rt as contrastRatio,
2125
- gt as createHttpAdapter,
2126
- ge as createRegistry,
2127
- Mt as daysBetween,
2128
- Re as describeElement,
2129
- Z as fixtureAdapter,
2130
- Dt as flatten,
2131
- Ot as formatIssues,
2132
- ve as getDeployContext,
2133
- It as hasErrors,
2134
- Me as matchPath,
2135
- Bt as parseColor,
2136
- ke as parseControls,
2137
- Y as parseIsoDate,
2138
- Wt as readCssVariable,
2139
- jt as relativeLuminance,
2140
- X as resolveFixture,
2141
- Ue as resolveLabels,
2142
- Ce as resolveRoute,
2143
- xe as resolveViewport,
2144
- fe as scenarioUrl,
2145
- q as serializeControls,
2146
- Ht as serializeValue,
2147
- He as shortSelector,
2148
- Ke as tabbableElements,
2149
- Ne as useDesignSpaceState,
2150
- ze as useKeyboardMode,
2232
+ $t as DesignSpace,
2233
+ Tt as EN_US_LABELS,
2234
+ Bt as HANDOFF_PARAM,
2235
+ Nt as Home,
2236
+ Ft as KEYBOARD_LABELS,
2237
+ Lt as NETWORK_LABELS,
2238
+ ve as NETWORK_STATES,
2239
+ w as PARAM,
2240
+ be as SCENARIO_STATUSES,
2241
+ Be as SLOW_NETWORK_DELAY_MS,
2242
+ At as STATUS_LABELS,
2243
+ Pt as STATUS_MEANING,
2244
+ He as SimulatedNetworkError,
2245
+ wt as Stage,
2246
+ fe as StageEmpty,
2247
+ Fe as TEXT_SCALES,
2248
+ kt as TabOrderOverlay,
2249
+ ge as VIEWPORTS,
2250
+ Et as ageInYears,
2251
+ oe as applyHandoffScope,
2252
+ Ht as applyOverrides,
2253
+ Wt as assertContrastPairs,
2254
+ zt as checkContrastPair,
2255
+ Ce as checkContrastPairs,
2256
+ Ut as commitUrl,
2257
+ jt as componentUrl,
2258
+ Ve as computeRole,
2259
+ Kt as contrastRatio,
2260
+ Ct as createHttpAdapter,
2261
+ Le as createRegistry,
2262
+ Rt as daysBetween,
2263
+ Ke as describeElement,
2264
+ ie as fixtureAdapter,
2265
+ Vt as flatten,
2266
+ qt as formatIssues,
2267
+ Te as getDeployContext,
2268
+ ee as handoffAllowsComponent,
2269
+ Ae as handoffAllowsPath,
2270
+ te as handoffAllowsScenario,
2271
+ Gt as hasErrors,
2272
+ Yt as matchPath,
2273
+ Jt as normalizeHandoffScope,
2274
+ Qt as parseColor,
2275
+ $e as parseControls,
2276
+ _e as parseHandoffScope,
2277
+ Z as parseIsoDate,
2278
+ Xt as readCssVariable,
2279
+ Zt as relativeLuminance,
2280
+ se as resolveFixture,
2281
+ tt as resolveLabels,
2282
+ Pe as resolveRoute,
2283
+ Re as resolveViewport,
2284
+ Me as scenarioUrl,
2285
+ X as serializeControls,
2286
+ eo as serializeValue,
2287
+ Xe as shortSelector,
2288
+ Ze as tabbableElements,
2289
+ Ee as useDesignSpaceState,
2290
+ et as useKeyboardMode,
2151
2291
  P as useLabels,
2152
- $e as useScenarioData,
2153
- me as validateProduct,
2154
- Kt as validateScenario
2292
+ ze as useScenarioData,
2293
+ ye as validateProduct,
2294
+ to as validateScenario
2155
2295
  };
2156
2296
  //# sourceMappingURL=index.js.map