@brucesantos/design-space 0.4.0 → 0.5.0

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