@brucesantos/design-space 0.9.1 → 0.9.3

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,145 +1,145 @@
1
- import { jsx as n, jsxs as C, Fragment as q } from "react/jsx-runtime";
2
- import { useState as K, useRef as G, useCallback as U, useEffect as I, useMemo as D, useContext as ct, createContext as lt, useLayoutEffect as Ue } from "react";
3
- import { r as Ne, s as dt, h as oe, v as ut, a as ve, b as Ie, p as ht, P as M, c as We, C as we, d as Te, e as ae, t as de, f as xe, N as He, g as Be, i as pt, j as he, k as ye, l as mt, m as _e, F as ft, n as vt, o as wt, q as gt } from "./index-Bj69Oe2X.js";
4
- import { u as gn, H as bn, w as kn, x as Cn, y as Sn, z as Nn, A as xn, B as yn, D as $n, E as Mn } from "./index-Bj69Oe2X.js";
5
- function bt(e) {
6
- const t = e.scenarios ?? [], s = e.routes ?? [], o = e.components ?? [], r = new Map(t.map((c) => [c.id, c])), i = new Map(o.map((c) => [c.id, c])), l = new Map((e.personas ?? []).map((c) => [c.id, c])), a = new Map((e.fixtures ?? []).map((c) => [c.id, c])), h = new Map((e.rules ?? []).map((c) => [c.id, c])), m = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
1
+ import { jsx as n, jsxs as C, Fragment as Y } from "react/jsx-runtime";
2
+ import { useState as V, useRef as q, useCallback as U, useEffect as I, useMemo as D, useContext as ct, createContext as lt, useLayoutEffect as Ue } from "react";
3
+ import { r as xe, s as dt, h as oe, v as ut, a as ve, b as Ie, p as ht, P as $, c as We, C as ge, d as Pe, e as ae, t as ue, f as Ne, N as He, g as Be, F as pt, i as mt, j as ft, k as pe, l as ye, m as wt, n as _e, o as vt, q as gt, u as bt, w as St } from "./index-BnTStnNk.js";
4
+ import { H as bn, x as Sn, y as kn, z as Cn, A as xn, B as Nn, D as yn, E as $n, G as Mn } from "./index-BnTStnNk.js";
5
+ function kt(e) {
6
+ const t = e.scenarios ?? [], s = e.routes ?? [], o = e.components ?? [], r = new Map(t.map((c) => [c.id, c])), i = new Map(o.map((c) => [c.id, c])), l = new Map((e.personas ?? []).map((c) => [c.id, c])), a = new Map((e.fixtures ?? []).map((c) => [c.id, c])), p = new Map((e.rules ?? []).map((c) => [c.id, c])), m = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map();
7
7
  for (const c of t) {
8
- const g = Ne(s, c.route ?? "");
9
- if (!g) continue;
10
- const y = g.definition.path;
11
- p.set(c.id, y);
12
- const L = m.get(y) ?? [];
13
- L.push(c), m.set(y, L);
8
+ const v = xe(s, c.route ?? "");
9
+ if (!v) continue;
10
+ const x = v.definition.path;
11
+ h.set(c.id, x);
12
+ const M = m.get(x) ?? [];
13
+ M.push(c), m.set(x, M);
14
14
  }
15
- const d = /* @__PURE__ */ new Set(), v = [];
15
+ const d = /* @__PURE__ */ new Set(), f = [];
16
16
  for (const c of s) {
17
17
  if (d.has(c.path)) continue;
18
18
  d.add(c.path);
19
- const g = m.get(c.path) ?? [];
20
- v.push({
19
+ const v = m.get(c.path) ?? [];
20
+ f.push({
21
21
  id: c.path,
22
- name: c.name?.trim() || g[0]?.title || c.path,
22
+ name: c.name?.trim() || v[0]?.title || c.path,
23
23
  description: c.description,
24
24
  route: c,
25
25
  href: dt(c.path, c.params),
26
- variations: g,
26
+ variations: v,
27
27
  group: c.group?.trim() || void 0,
28
28
  controls: Array.isArray(c.controls) ? c.controls : []
29
29
  });
30
30
  }
31
- const f = new Map(v.map((c) => [c.id, c])), k = (c) => c ? r.get(c) : void 0, T = (c) => c ? l.get(c) : void 0, E = T(e.defaultPersona)?.id, x = (c, g) => {
32
- if (!(!c || !g))
33
- return i.get(c)?.fixtures?.find((y) => y.id === g);
34
- }, w = (c = {}) => t.filter((g) => oe(c.handoff, g.id)), b = (c) => {
35
- const g = Ne(s, c);
36
- return g ? f.get(g.definition.path) : void 0;
37
- }, N = (c = {}) => {
38
- const { handoff: g } = c;
39
- return g ? v.map((y) => ({
40
- ...y,
41
- variations: y.variations.filter((L) => oe(g, L.id))
31
+ const S = new Map(f.map((c) => [c.id, c])), b = (c) => c ? r.get(c) : void 0, L = (c) => c ? l.get(c) : void 0, T = L(e.defaultPersona)?.id, N = (c, v) => {
32
+ if (!(!c || !v))
33
+ return i.get(c)?.fixtures?.find((x) => x.id === v);
34
+ }, w = (c = {}) => t.filter((v) => oe(c.handoff, v.id)), u = (c) => {
35
+ const v = xe(s, c);
36
+ return v ? S.get(v.definition.path) : void 0;
37
+ }, k = (c = {}) => {
38
+ const { handoff: v } = c;
39
+ return v ? f.map((x) => ({
40
+ ...x,
41
+ variations: x.variations.filter((M) => oe(v, M.id))
42
42
  })).filter(
43
- (y) => y.variations.length > 0 || (g.routes ?? []).length > 0 && Ie(g, y.href)
44
- ) : v;
45
- }, S = (c) => c ? c.permissions ? c.permissions : T(c.persona ?? E)?.permissions ?? [] : [], u = (c = {}) => je(N(c)), $ = (c, g) => {
46
- const y = new Set(c?.route.components ?? []), L = g ? [g] : c?.variations ?? [];
47
- for (const O of L)
48
- for (const R of O.components ?? []) y.add(R);
49
- return [...y];
50
- }, F = (c) => o.filter((g) => ve(c, g.id));
43
+ (x) => x.variations.length > 0 || (v.routes ?? []).length > 0 && Ie(v, x.href)
44
+ ) : f;
45
+ }, g = (c) => c ? c.permissions ? c.permissions : L(c.persona ?? T)?.permissions ?? [] : [], y = (c = {}) => je(k(c)), _ = (c, v) => {
46
+ const x = new Set(c?.route.components ?? []), M = v ? [v] : c?.variations ?? [];
47
+ for (const F of M)
48
+ for (const E of F.components ?? []) x.add(E);
49
+ return [...x];
50
+ }, z = (c) => o.filter((v) => ve(c, v.id));
51
51
  return {
52
52
  product: e,
53
- screens: v,
53
+ screens: f,
54
54
  issues: ut(e),
55
- defaultPersona: E,
56
- scenario: k,
55
+ defaultPersona: T,
56
+ scenario: b,
57
57
  component: (c) => c ? i.get(c) : void 0,
58
- componentFixture: x,
59
- resolveComponentFixture: (c, g) => {
60
- const y = c ? i.get(c) : void 0, L = x(c, g), O = x(c, y?.defaultFixture) ?? y?.fixtures?.[0];
58
+ componentFixture: N,
59
+ resolveComponentFixture: (c, v) => {
60
+ const x = c ? i.get(c) : void 0, M = N(c, v), F = N(c, x?.defaultFixture) ?? x?.fixtures?.[0];
61
61
  return {
62
- fixture: L ?? O,
63
- requestedId: g,
64
- didFallback: !!(g && !L)
62
+ fixture: M ?? F,
63
+ requestedId: v,
64
+ didFallback: !!(v && !M)
65
65
  };
66
66
  },
67
- persona: T,
67
+ persona: L,
68
68
  fixture: (c) => c ? a.get(c) : void 0,
69
- rule: (c) => c ? h.get(c) : void 0,
70
- screen: (c) => c ? f.get(c) : void 0,
71
- screenForPath: b,
69
+ rule: (c) => c ? p.get(c) : void 0,
70
+ screen: (c) => c ? S.get(c) : void 0,
71
+ screenForPath: u,
72
72
  screenOf: (c) => {
73
- const g = c ? p.get(c.id) : void 0;
74
- return g ? f.get(g) : void 0;
73
+ const v = c ? h.get(c.id) : void 0;
74
+ return v ? S.get(v) : void 0;
75
75
  },
76
- screensFor: N,
77
- flows: u,
78
- flowOf: (c, g) => {
76
+ screensFor: k,
77
+ flows: y,
78
+ flowOf: (c, v) => {
79
79
  if (c)
80
- return u(g).find((y) => y.name === c.group);
80
+ return y(v).find((x) => x.name === c.group);
81
81
  },
82
- controlsOf: (c) => (c?.controls ?? []).flatMap((g) => g.controls ?? []),
83
- resolveControls: (c, g = {}) => kt(c?.controls ?? [], g),
84
- rulesOf: (c) => (c?.rules ?? []).map((g) => h.get(g)).filter((g) => !!g),
85
- permissionsOf: S,
86
- scenariosForRoute: (c, g) => {
87
- const y = b(c);
88
- return y ? y.variations.filter((L) => oe(g?.handoff, L.id)) : [];
82
+ controlsOf: (c) => (c?.controls ?? []).flatMap((v) => v.controls ?? []),
83
+ resolveControls: (c, v = {}) => Ct(c?.controls ?? [], v),
84
+ rulesOf: (c) => (c?.rules ?? []).map((v) => p.get(v)).filter((v) => !!v),
85
+ permissionsOf: g,
86
+ scenariosForRoute: (c, v) => {
87
+ const x = u(c);
88
+ return x ? x.variations.filter((M) => oe(v?.handoff, M.id)) : [];
89
89
  },
90
90
  activeScenarios: w,
91
- search: (c, g) => {
92
- const y = X(c), L = w(g);
93
- return y ? L.filter(
94
- (O) => X(
91
+ search: (c, v) => {
92
+ const x = X(c), M = w(v);
93
+ return x ? M.filter(
94
+ (F) => X(
95
95
  [
96
- O.title,
97
- O.id,
98
- O.intent ?? "",
99
- O.route,
100
- T(O.persona)?.name ?? "",
101
- (O.tags ?? []).join(" "),
102
- (O.expected ?? []).join(" ")
96
+ F.title,
97
+ F.id,
98
+ F.intent ?? "",
99
+ F.route,
100
+ L(F.persona)?.name ?? "",
101
+ (F.tags ?? []).join(" "),
102
+ (F.expected ?? []).join(" ")
103
103
  ].join(" ")
104
- ).includes(y)
105
- ) : L;
104
+ ).includes(x)
105
+ ) : M;
106
106
  },
107
- searchScreens: (c, g) => {
108
- const y = X(c), L = N(g);
109
- return y ? L.filter(
110
- (O) => X(
107
+ searchScreens: (c, v) => {
108
+ const x = X(c), M = k(v);
109
+ return x ? M.filter(
110
+ (F) => X(
111
111
  [
112
- O.name,
113
- O.description ?? "",
114
- O.id,
115
- O.group ?? "",
116
- ...O.variations.flatMap((R) => [
117
- R.title,
118
- R.id,
119
- (R.tags ?? []).join(" ")
112
+ F.name,
113
+ F.description ?? "",
114
+ F.id,
115
+ F.group ?? "",
116
+ ...F.variations.flatMap((E) => [
117
+ E.title,
118
+ E.id,
119
+ (E.tags ?? []).join(" ")
120
120
  ])
121
121
  ].join(" ")
122
- ).includes(y)
123
- ) : L;
122
+ ).includes(x)
123
+ ) : M;
124
124
  },
125
- searchComponents: (c, g) => {
126
- const y = X(c), L = F(g);
127
- return y ? L.filter(
128
- (O) => X(
125
+ searchComponents: (c, v) => {
126
+ const x = X(c), M = z(v);
127
+ return x ? M.filter(
128
+ (F) => X(
129
129
  [
130
- O.name,
131
- O.description ?? "",
132
- O.group ?? "",
133
- O.id,
134
- O.source ?? ""
130
+ F.name,
131
+ F.description ?? "",
132
+ F.group ?? "",
133
+ F.id,
134
+ F.source ?? ""
135
135
  ].join(" ")
136
- ).includes(y)
137
- ) : L;
136
+ ).includes(x)
137
+ ) : M;
138
138
  },
139
- componentsFor: F,
140
- componentsOfScreen: (c, g) => $(c, g).map((y) => i.get(y)).filter((y) => !!y),
141
- usagesOf: (c, g) => c ? N(g).filter(
142
- (y) => y.route.components?.includes(c) || y.variations.some((L) => L.components?.includes(c))
139
+ componentsFor: z,
140
+ componentsOfScreen: (c, v) => _(c, v).map((x) => i.get(x)).filter((x) => !!x),
141
+ usagesOf: (c, v) => c ? k(v).filter(
142
+ (x) => x.route.components?.includes(c) || x.variations.some((M) => M.components?.includes(c))
143
143
  ) : []
144
144
  };
145
145
  }
@@ -159,210 +159,210 @@ function je(e) {
159
159
  const o = [...s].map(([r, i]) => ({ name: r, screens: i }));
160
160
  return t.length > 0 ? [{ name: void 0, screens: t }, ...o] : o;
161
161
  }
162
- function ge(e) {
162
+ function be(e) {
163
163
  const t = e.options ?? [];
164
164
  return e.default !== void 0 && t.some((s) => s.value === e.default) ? e.default : t[0]?.value ?? "";
165
165
  }
166
- function kt(e, t = {}) {
166
+ function Ct(e, t = {}) {
167
167
  const s = {}, o = [], r = /* @__PURE__ */ new Set(), i = t.requested ?? {};
168
168
  for (const l of e)
169
169
  for (const a of l.controls ?? []) {
170
170
  if (r.has(a.id)) continue;
171
171
  r.add(a.id);
172
- const h = (v) => v !== void 0 && (a.options ?? []).some((f) => f.value === v);
173
- let m = ge(a);
174
- const p = t.scenario?.controls?.[a.id];
175
- h(p) && (m = p);
172
+ const p = (f) => f !== void 0 && (a.options ?? []).some((S) => S.value === f);
173
+ let m = be(a);
174
+ const h = t.scenario?.controls?.[a.id];
175
+ p(h) && (m = h);
176
176
  const d = i[a.id];
177
- d !== void 0 && (h(d) ? m = d : o.push({ id: a.id, value: d, reason: "invalid-value", fallback: m })), s[a.id] = m;
177
+ d !== void 0 && (p(d) ? m = d : o.push({ id: a.id, value: d, reason: "invalid-value", fallback: m })), s[a.id] = m;
178
178
  }
179
179
  for (const [l, a] of Object.entries(i))
180
180
  r.has(l) || o.push({ id: l, value: a, reason: "unknown-control" });
181
181
  return { values: s, invalid: o };
182
182
  }
183
- function Ct(e, t) {
183
+ function xt(e, t) {
184
184
  return e ? Object.entries(e.controls ?? {}).every(([s, o]) => t?.[s] === o) : !1;
185
185
  }
186
- const St = [
186
+ const Nt = [
187
187
  { id: "mobile", label: "Celular", width: 375, height: 812 },
188
188
  { id: "tablet", label: "Tablet", width: 768, height: 1024 },
189
189
  { id: "desktop", label: "Desktop", width: 1280, height: 800 },
190
190
  { id: "fit", label: "Ajustar" },
191
191
  { id: "custom", label: "Personalizado" }
192
- ], Pe = 25, Ee = 150, pe = 100;
192
+ ], Te = 25, Ee = 150, me = 100;
193
193
  function qe(e, t, s) {
194
194
  const o = s !== void 0 ? e.screenForPath(s) : e.screenOf(t), r = t && o && e.screenOf(t)?.id === o.id ? t : void 0;
195
195
  return { screen: o, scenario: r };
196
196
  }
197
197
  function $e(e, t, s) {
198
- const o = new URLSearchParams(e), r = ht(o), i = o.get(M.component) ?? void 0, l = ve(r, i) ? t.component(i) : void 0, a = o.get(M.scenario) ?? void 0, h = l || !oe(r, a) ? void 0 : t.scenario(a), m = o.get(M.fixture) ?? void 0, p = l ? m ?? t.componentFixture(l.id, l.defaultFixture)?.id ?? l.fixtures?.[0]?.id : void 0, d = o.get(M.network), v = l ? void 0 : qe(t, h, s), f = v?.screen && v.screen.controls.length > 0 ? t.resolveControls(v.screen, {
199
- scenario: v.scenario,
198
+ const o = new URLSearchParams(e), r = ht(o), i = o.get($.component) ?? void 0, l = ve(r, i) ? t.component(i) : void 0, a = o.get($.scenario) ?? void 0, p = l || !oe(r, a) ? void 0 : t.scenario(a), m = o.get($.fixture) ?? void 0, h = l ? m ?? t.componentFixture(l.id, l.defaultFixture)?.id ?? l.fixtures?.[0]?.id : void 0, d = o.get($.network), f = l ? void 0 : qe(t, p, s), S = f?.screen && f.screen.controls.length > 0 ? t.resolveControls(f.screen, {
199
+ scenario: f.scenario,
200
200
  requested: We(o)
201
201
  }).values : void 0;
202
202
  return {
203
- scenario: h?.id,
203
+ scenario: p?.id,
204
204
  handoff: r,
205
205
  component: l?.id,
206
206
  // Precedência: URL, cenário, padrão do produto. O preview de componente não
207
207
  // tem persona, então o padrão não se aplica a ele.
208
- persona: o.get(M.persona) ?? h?.persona ?? (l ? void 0 : t.defaultPersona),
209
- fixture: l ? p : m ?? h?.fixture,
210
- network: $t(d) ? d : h?.network ?? "success",
211
- viewport: o.get(M.viewport) ?? "fit",
212
- customWidth: Tt(o.get(M.customWidth)),
213
- themeMode: o.get(M.themeMode) ?? t.product.theme?.modes?.[0],
214
- locale: o.get(M.locale) ?? t.product.theme?.locales?.[0],
215
- dataSource: o.get(M.dataSource) ?? t.product.dataSources?.default ?? "fixtures",
208
+ persona: o.get($.persona) ?? p?.persona ?? (l ? void 0 : t.defaultPersona),
209
+ fixture: l ? h : m ?? p?.fixture,
210
+ network: Pt(d) ? d : p?.network ?? "success",
211
+ viewport: o.get($.viewport) ?? "fit",
212
+ customWidth: Rt(o.get($.customWidth)),
213
+ themeMode: o.get($.themeMode) ?? t.product.theme?.modes?.[0],
214
+ locale: o.get($.locale) ?? t.product.theme?.locales?.[0],
215
+ dataSource: o.get($.dataSource) ?? t.product.dataSources?.default ?? "fixtures",
216
216
  // Sem parâmetro, o tema do chrome fica em aberto: o shell resolve pela
217
217
  // última escolha da pessoa e, na falta dela, pelo sistema.
218
- chromeTheme: Mt(o.get(M.chromeTheme)) ? o.get(M.chromeTheme) : void 0,
218
+ chromeTheme: Tt(o.get($.chromeTheme)) ? o.get($.chromeTheme) : void 0,
219
219
  // Chrome visível por padrão. `?chrome=0` é o modo de revisão limpa e captura
220
220
  // de tela, então precisa ser explícito para não sumir sem pedido.
221
- chrome: o.get(M.chrome) !== "0",
222
- inspector: o.get(M.inspector) !== "0",
223
- panelTab: Lt(o.get(M.panelTab)) ? o.get(M.panelTab) : "variations",
224
- zoom: Ze(o.get(M.zoom)),
225
- rotated: o.get(M.rotated) === "1",
226
- screenControls: f
221
+ chrome: o.get($.chrome) !== "0",
222
+ inspector: o.get($.inspector) !== "0",
223
+ panelTab: Et(o.get($.panelTab)) ? o.get($.panelTab) : "variations",
224
+ zoom: Ze(o.get($.zoom)),
225
+ rotated: o.get($.rotated) === "1",
226
+ screenControls: S
227
227
  };
228
228
  }
229
229
  function se(e, t, s) {
230
230
  const o = new URLSearchParams(), r = t.scenario(e.scenario);
231
- if (e.component ? o.set(M.component, e.component) : e.scenario && o.set(M.scenario, e.scenario), e.persona && e.persona !== (r?.persona ?? t.defaultPersona) && o.set(M.persona, e.persona), e.component && e.fixture ? o.set(M.fixture, e.fixture) : e.fixture && e.fixture !== r?.fixture && o.set(M.fixture, e.fixture), e.network !== (r?.network ?? "success") && o.set(M.network, e.network), e.screenControls && !e.component) {
232
- const p = qe(t, r, s), d = p.screen ? t.resolveControls(p.screen, { scenario: p.scenario }).values : {}, v = p.screen ? t.controlsOf(p.screen).map((f) => f.id) : Object.keys(e.screenControls);
233
- for (const f of v) {
234
- const k = e.screenControls[f];
235
- k !== void 0 && k !== d[f] && o.set(`${we}${f}`, k);
231
+ if (e.component ? o.set($.component, e.component) : e.scenario && o.set($.scenario, e.scenario), e.persona && e.persona !== (r?.persona ?? t.defaultPersona) && o.set($.persona, e.persona), e.component && e.fixture ? o.set($.fixture, e.fixture) : e.fixture && e.fixture !== r?.fixture && o.set($.fixture, e.fixture), e.network !== (r?.network ?? "success") && o.set($.network, e.network), e.screenControls && !e.component) {
232
+ const h = qe(t, r, s), d = h.screen ? t.resolveControls(h.screen, { scenario: h.scenario }).values : {}, f = h.screen ? t.controlsOf(h.screen).map((S) => S.id) : Object.keys(e.screenControls);
233
+ for (const S of f) {
234
+ const b = e.screenControls[S];
235
+ b !== void 0 && b !== d[S] && o.set(`${ge}${S}`, b);
236
236
  }
237
237
  }
238
- e.viewport !== "fit" && o.set(M.viewport, e.viewport), e.viewport === "custom" && e.customWidth && o.set(M.customWidth, String(e.customWidth));
238
+ e.viewport !== "fit" && o.set($.viewport, e.viewport), e.viewport === "custom" && e.customWidth && o.set($.customWidth, String(e.customWidth));
239
239
  const i = t.product.theme?.modes?.[0];
240
- e.themeMode && e.themeMode !== i && o.set(M.themeMode, e.themeMode);
240
+ e.themeMode && e.themeMode !== i && o.set($.themeMode, e.themeMode);
241
241
  const l = t.product.theme?.locales?.[0];
242
- e.locale && e.locale !== l && o.set(M.locale, e.locale);
242
+ e.locale && e.locale !== l && o.set($.locale, e.locale);
243
243
  const a = t.product.dataSources?.default ?? "fixtures";
244
- e.dataSource && e.dataSource !== a && o.set(M.dataSource, e.dataSource), e.chromeTheme && o.set(M.chromeTheme, e.chromeTheme), e.chrome || o.set(M.chrome, "0"), e.inspector || o.set(M.inspector, "0"), e.panelTab === "info" && o.set(M.panelTab, "info");
245
- const h = Ze(e.zoom === void 0 ? null : String(e.zoom));
246
- h !== pe && o.set(M.zoom, String(h)), e.rotated && o.set(M.rotated, "1"), Te(o, e.handoff);
244
+ e.dataSource && e.dataSource !== a && o.set($.dataSource, e.dataSource), e.chromeTheme && o.set($.chromeTheme, e.chromeTheme), e.chrome || o.set($.chrome, "0"), e.inspector || o.set($.inspector, "0"), e.panelTab === "info" && o.set($.panelTab, "info");
245
+ const p = Ze(e.zoom === void 0 ? null : String(e.zoom));
246
+ p !== me && o.set($.zoom, String(p)), e.rotated && o.set($.rotated, "1"), Pe(o, e.handoff);
247
247
  const m = o.toString();
248
248
  return m ? `?${m}` : "";
249
249
  }
250
250
  function Ge(e, t = {}) {
251
- const s = !!t.frame, [o, r] = K(() => be()), i = G(o), l = U((w) => {
251
+ const s = !!t.frame, [o, r] = V(() => Se()), i = q(o), l = U((w) => {
252
252
  i.current = w, r(w);
253
253
  }, []);
254
254
  I(() => {
255
- const w = () => l(be());
255
+ const w = () => l(Se());
256
256
  return window.addEventListener("popstate", w), () => window.removeEventListener("popstate", w);
257
257
  }, [l]), I(() => {
258
258
  if (!s || window.parent === window) return;
259
- const w = window.location.origin, b = (S) => {
260
- const u = Be(S, { origin: w, source: window.parent });
261
- if (u?.type !== "location") return;
262
- const { path: $, search: F } = xe(u.url);
263
- window.history.replaceState(null, "", de($, F)), l({ path: $, search: F });
259
+ const w = window.location.origin, u = (g) => {
260
+ const y = Be(g, { origin: w, source: window.parent });
261
+ if (y?.type !== "location") return;
262
+ const { path: _, search: z } = Ne(y.url);
263
+ window.history.replaceState(null, "", ue(_, z)), l({ path: _, search: z });
264
264
  };
265
- window.addEventListener("message", b);
266
- const N = be();
265
+ window.addEventListener("message", u);
266
+ const k = Se();
267
267
  return ae(
268
268
  window.parent,
269
- { ds: 1, type: "ready", url: de(N.path, N.search) },
269
+ { ds: 1, type: "ready", url: ue(k.path, k.search) },
270
270
  w
271
- ), () => window.removeEventListener("message", b);
271
+ ), () => window.removeEventListener("message", u);
272
272
  }, [s, l]);
273
273
  const a = D(
274
274
  () => $e(o.search, e, o.path),
275
275
  [o.path, o.search, e]
276
- ), h = U(
277
- (w, b, N = !1) => {
276
+ ), p = U(
277
+ (w, u, k = !1) => {
278
278
  if (s) {
279
- const u = de(w, b), $ = xe(u);
280
- window.history.replaceState(null, "", u), l($), ae(
279
+ const y = ue(w, u), _ = Ne(y);
280
+ window.history.replaceState(null, "", y), l(_), ae(
281
281
  window.parent === window ? void 0 : window.parent,
282
- { ds: 1, type: "navigate", url: u, replace: N },
282
+ { ds: 1, type: "navigate", url: y, replace: k },
283
283
  window.location.origin
284
284
  );
285
285
  return;
286
286
  }
287
- const S = `${w}${b}`;
288
- N ? window.history.replaceState(null, "", S) : window.history.pushState(null, "", S), l({ path: w, search: b });
287
+ const g = `${w}${u}`;
288
+ k ? window.history.replaceState(null, "", g) : window.history.pushState(null, "", g), l({ path: w, search: u });
289
289
  },
290
290
  [s, l]
291
291
  ), m = U(() => {
292
292
  const w = i.current;
293
293
  return w === o ? a : $e(w.search, e, w.path);
294
- }, [a, o, e]), p = U(
294
+ }, [a, o, e]), h = U(
295
295
  (w) => {
296
- const b = i.current, N = { ...m(), ...w }, S = se(N, e, b.path);
297
- S !== b.search && h(b.path, S, !0);
296
+ const u = i.current, k = { ...m(), ...w }, g = $t(se(k, e, u.path), u.search);
297
+ g !== u.search && p(u.path, g, !0);
298
298
  },
299
- [m, h, e]
299
+ [m, p, e]
300
300
  ), d = U(
301
301
  (w) => {
302
- const b = m().screenControls ?? {};
303
- Object.entries(w).some(([S, u]) => b[S] !== u) && p({ screenControls: { ...b, ...w } });
302
+ const u = m().screenControls ?? {};
303
+ Object.entries(w).some(([g, y]) => u[g] !== y) && h({ screenControls: { ...u, ...w } });
304
304
  },
305
- [m, p]
306
- ), v = U(
307
- (w, b) => {
308
- const N = Nt(w, i.current, e, {
309
- controls: b?.controls
305
+ [m, h]
306
+ ), f = U(
307
+ (w, u) => {
308
+ const k = yt(w, i.current, e, {
309
+ controls: u?.controls
310
310
  });
311
- h(N.path, N.search, b?.replace ?? !1);
311
+ p(k.path, k.search, u?.replace ?? !1);
312
312
  },
313
- [h, e]
314
- ), f = U(
313
+ [p, e]
314
+ ), S = U(
315
315
  (w) => {
316
- const b = e.scenario(w);
317
- if (!b || !oe(a.handoff, w)) return;
318
- const N = {
316
+ const u = e.scenario(w);
317
+ if (!u || !oe(a.handoff, w)) return;
318
+ const k = {
319
319
  ...a,
320
- scenario: b.id,
320
+ scenario: u.id,
321
321
  component: void 0,
322
- persona: b.persona,
323
- fixture: b.fixture,
324
- network: b.network ?? "success",
322
+ persona: u.persona,
323
+ fixture: u.fixture,
324
+ network: u.network ?? "success",
325
325
  // Os controles voltam ao que o cenário fixa, sobre os padrões da tela.
326
326
  screenControls: void 0
327
327
  };
328
- h(b.route, se(N, e, b.route), !1);
328
+ p(u.route, se(k, e, u.route), !1);
329
329
  },
330
- [a, h, e]
331
- ), k = U(
332
- (w, b) => {
333
- const N = e.component(w);
334
- if (!N || !ve(a.handoff, w)) return;
335
- const S = {
330
+ [a, p, e]
331
+ ), b = U(
332
+ (w, u) => {
333
+ const k = e.component(w);
334
+ if (!k || !ve(a.handoff, w)) return;
335
+ const g = {
336
336
  ...a,
337
337
  scenario: void 0,
338
- component: N.id,
338
+ component: k.id,
339
339
  persona: void 0,
340
340
  fixture: void 0,
341
341
  network: "success",
342
342
  screenControls: void 0
343
343
  };
344
- S.fixture = e.componentFixture(N.id, N.defaultFixture)?.id ?? N.fixtures?.[0]?.id, h("/", se(S, e), b?.replace ?? !1);
344
+ g.fixture = e.componentFixture(k.id, k.defaultFixture)?.id ?? k.fixtures?.[0]?.id, p("/", se(g, e), u?.replace ?? !1);
345
345
  },
346
- [a, h, e]
347
- ), T = U(
348
- (w, b) => {
349
- const N = e.screensFor({ handoff: a.handoff }).find(($) => $.id === w);
350
- if (!N) return;
351
- const S = N.variations[0];
352
- if (S) {
353
- const $ = {
346
+ [a, p, e]
347
+ ), L = U(
348
+ (w, u) => {
349
+ const k = e.screensFor({ handoff: a.handoff }).find((_) => _.id === w);
350
+ if (!k) return;
351
+ const g = k.variations[0];
352
+ if (g) {
353
+ const _ = {
354
354
  ...a,
355
- scenario: S.id,
355
+ scenario: g.id,
356
356
  component: void 0,
357
- persona: S.persona,
358
- fixture: S.fixture,
359
- network: S.network ?? "success",
357
+ persona: g.persona,
358
+ fixture: g.fixture,
359
+ network: g.network ?? "success",
360
360
  screenControls: void 0
361
361
  };
362
- h(S.route, se($, e, S.route), b?.replace ?? !1);
362
+ p(g.route, se(_, e, g.route), u?.replace ?? !1);
363
363
  return;
364
364
  }
365
- const u = {
365
+ const y = {
366
366
  ...a,
367
367
  scenario: void 0,
368
368
  component: void 0,
@@ -371,129 +371,137 @@ function Ge(e, t = {}) {
371
371
  network: "success",
372
372
  screenControls: void 0
373
373
  };
374
- h(N.href, se(u, e, N.href), b?.replace ?? !1);
374
+ p(k.href, se(y, e, k.href), u?.replace ?? !1);
375
375
  },
376
- [a, h, e]
377
- ), E = U(
378
- (w, b, N) => h(w || "/", b, N?.replace ?? !1),
379
- [h]
380
- ), x = D(() => yt(a), [a]);
376
+ [a, p, e]
377
+ ), T = U(
378
+ (w, u, k) => p(w || "/", u, k?.replace ?? !1),
379
+ [p]
380
+ ), N = D(() => Lt(a), [a]);
381
381
  return {
382
382
  location: o,
383
383
  controls: a,
384
- viewport: x,
385
- setControls: p,
384
+ viewport: N,
385
+ setControls: h,
386
386
  setScreenControls: d,
387
- navigate: v,
388
- openScenario: f,
389
- openComponent: k,
390
- openScreen: T,
391
- go: E
387
+ navigate: f,
388
+ openScenario: S,
389
+ openComponent: b,
390
+ openScreen: L,
391
+ go: T
392
392
  };
393
393
  }
394
- function Nt(e, t, s, o = {}) {
395
- const r = e.split("#")[0] ?? e, i = r.indexOf("?"), l = (i === -1 ? r : r.slice(0, i)) || "/", a = i === -1 ? void 0 : r.slice(i + 1), h = new URLSearchParams(t.search), m = $e(t.search, s, t.path);
396
- let p;
394
+ function yt(e, t, s, o = {}) {
395
+ const r = e.split("#")[0] ?? e, i = r.indexOf("?"), l = (i === -1 ? r : r.slice(0, i)) || "/", a = i === -1 ? void 0 : r.slice(i + 1), p = new URLSearchParams(t.search), m = $e(t.search, s, t.path);
396
+ let h;
397
397
  if (a === void 0 && o.controls === void 0)
398
- p = new URLSearchParams(t.search), s.screenForPath(l)?.id !== s.screenForPath(t.path)?.id && pt(p);
398
+ h = new URLSearchParams(t.search), s.screenForPath(l)?.id !== s.screenForPath(t.path)?.id && ft(h);
399
399
  else {
400
- const v = new URLSearchParams(a ?? "");
401
- p = new URLSearchParams();
402
- for (const [f, k] of h)
403
- !xt(f) || v.has(f) || p.append(f, k);
404
- m.scenario && !v.has(M.scenario) && m.persona && m.persona !== s.defaultPersona && !p.has(M.persona) && !v.has(M.persona) && p.set(M.persona, m.persona);
405
- for (const [f, k] of v) p.append(f, k);
400
+ const f = new URLSearchParams(a ?? "");
401
+ h = new URLSearchParams();
402
+ for (const [S, b] of p)
403
+ !Mt(S) || f.has(S) || h.append(S, b);
404
+ m.scenario && !f.has($.scenario) && m.persona && m.persona !== s.defaultPersona && !h.has($.persona) && !f.has($.persona) && h.set($.persona, m.persona);
405
+ for (const [S, b] of f) h.append(S, b);
406
406
  if (o.controls) {
407
- const f = s.screenForPath(l), k = s.scenario(p.get(M.scenario) ?? void 0), T = k && f && s.screenOf(k)?.id === f.id ? k : void 0, E = f ? s.resolveControls(f, { scenario: T }).values : {};
408
- for (const [x, w] of Object.entries(o.controls)) {
409
- const b = `${we}${x}`;
410
- E[x] === w ? p.delete(b) : p.set(b, w);
407
+ const S = s.screenForPath(l), b = s.scenario(h.get($.scenario) ?? void 0), L = b && S && s.screenOf(b)?.id === S.id ? b : void 0, T = S ? s.resolveControls(S, { scenario: L }).values : {};
408
+ for (const [N, w] of Object.entries(o.controls)) {
409
+ const u = `${ge}${N}`;
410
+ T[N] === w ? h.delete(u) : h.set(u, w);
411
411
  }
412
412
  }
413
413
  }
414
- m.handoff && Te(p, m.handoff);
415
- const d = p.toString();
414
+ m.handoff && Pe(h, m.handoff);
415
+ const d = h.toString();
416
416
  return { path: l, search: d ? `?${d}` : "" };
417
417
  }
418
- function xt(e) {
419
- return e.startsWith(we) ? !1 : e !== M.scenario && e !== M.fixture && e !== M.component;
418
+ function $t(e, t) {
419
+ const s = new URLSearchParams(e);
420
+ for (const [r, i] of new URLSearchParams(t))
421
+ r === pt || mt(r) || s.append(r, i);
422
+ const o = s.toString();
423
+ return o ? `?${o}` : "";
424
+ }
425
+ function Mt(e) {
426
+ return e.startsWith(ge) ? !1 : e !== $.scenario && e !== $.fixture && e !== $.component;
420
427
  }
421
- function yt(e) {
428
+ function Lt(e) {
422
429
  if (e.viewport === "custom")
423
430
  return { id: "custom", label: "Personalizado", width: e.customWidth ?? 1024 };
424
- const t = St.find((s) => s.id === e.viewport) ?? {
431
+ const t = Nt.find((s) => s.id === e.viewport) ?? {
425
432
  id: "fit",
426
433
  label: "Ajustar"
427
434
  };
428
435
  return e.rotated && t.width && t.height ? { ...t, width: t.height, height: t.width } : { ...t };
429
436
  }
430
437
  function Ze(e) {
431
- if (e === null) return pe;
438
+ if (e === null) return me;
432
439
  const t = Number.parseInt(e, 10);
433
- return Number.isFinite(t) ? Math.min(Ee, Math.max(Pe, t)) : pe;
440
+ return Number.isFinite(t) ? Math.min(Ee, Math.max(Te, t)) : me;
434
441
  }
435
- function be() {
442
+ function Se() {
436
443
  return typeof window > "u" ? { path: "/", search: "" } : { path: window.location.pathname, search: window.location.search };
437
444
  }
438
- function $t(e) {
445
+ function Pt(e) {
439
446
  return e !== null && He.includes(e);
440
447
  }
441
- function Mt(e) {
448
+ function Tt(e) {
442
449
  return e === "dark" || e === "light";
443
450
  }
444
- function Lt(e) {
451
+ function Et(e) {
445
452
  return e === "variations" || e === "info";
446
453
  }
447
- function Tt(e) {
454
+ function Rt(e) {
448
455
  if (!e) return;
449
456
  const t = Number.parseInt(e, 10);
450
457
  return Number.isFinite(t) && t > 0 ? t : void 0;
451
458
  }
452
- const Pt = "@brucesantos/design-space", Fe = "0.9.1", Et = {
453
- mobile: /* @__PURE__ */ C(q, { children: [
459
+ const _t = "@brucesantos/design-space", Fe = "0.9.3", Ft = {
460
+ mobile: /* @__PURE__ */ C(Y, { children: [
454
461
  /* @__PURE__ */ n("rect", { x: "7", y: "2.5", width: "10", height: "19", rx: "2" }),
455
462
  /* @__PURE__ */ n("path", { d: "M11 18.5h2" })
456
463
  ] }),
457
- tablet: /* @__PURE__ */ C(q, { children: [
464
+ tablet: /* @__PURE__ */ C(Y, { children: [
458
465
  /* @__PURE__ */ n("rect", { x: "4.5", y: "2.5", width: "15", height: "19", rx: "2" }),
459
466
  /* @__PURE__ */ n("path", { d: "M11 18.5h2" })
460
467
  ] }),
461
- desktop: /* @__PURE__ */ C(q, { children: [
468
+ desktop: /* @__PURE__ */ C(Y, { children: [
462
469
  /* @__PURE__ */ n("rect", { x: "2.5", y: "4", width: "19", height: "12.5", rx: "1.5" }),
463
470
  /* @__PURE__ */ n("path", { d: "M8.5 20.5h7M12 16.5v4" })
464
471
  ] }),
465
472
  fit: /* @__PURE__ */ n("path", { d: "M3 12h7M3 12l3-3M3 12l3 3M21 12h-7M21 12l-3-3M21 12l-3 3" }),
466
- rotate: /* @__PURE__ */ C(q, { children: [
473
+ rotate: /* @__PURE__ */ C(Y, { children: [
467
474
  /* @__PURE__ */ n("path", { d: "M20 12a8 8 0 1 1-2.34-5.66" }),
468
475
  /* @__PURE__ */ n("path", { d: "M20 4v4.5h-4.5" })
469
476
  ] }),
470
477
  minus: /* @__PURE__ */ n("path", { d: "M5 12h14" }),
471
478
  plus: /* @__PURE__ */ n("path", { d: "M5 12h14M12 5v14" }),
472
- link: /* @__PURE__ */ C(q, { children: [
479
+ "arrow-up-right": /* @__PURE__ */ n("path", { d: "M7 17 17 7M8 7h9v9" }),
480
+ link: /* @__PURE__ */ C(Y, { children: [
473
481
  /* @__PURE__ */ n("path", { d: "M10 14a4 4 0 0 0 5.66 0l3-3a4 4 0 0 0-5.66-5.66l-1 1" }),
474
482
  /* @__PURE__ */ n("path", { d: "M14 10a4 4 0 0 0-5.66 0l-3 3a4 4 0 0 0 5.66 5.66l1-1" })
475
483
  ] }),
476
484
  check: /* @__PURE__ */ n("path", { d: "M5 12.5l4.5 4.5L19 7.5" }),
477
485
  fullscreen: /* @__PURE__ */ n("path", { d: "M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5" }),
478
- sun: /* @__PURE__ */ C(q, { children: [
486
+ sun: /* @__PURE__ */ C(Y, { children: [
479
487
  /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "4" }),
480
488
  /* @__PURE__ */ n("path", { d: "M12 2.5v2M12 19.5v2M4.6 4.6 6 6M18 18l1.4 1.4M2.5 12h2M19.5 12h2M4.6 19.4 6 18M18 6l1.4-1.4" })
481
489
  ] }),
482
490
  moon: /* @__PURE__ */ n("path", { d: "M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5Z" }),
483
- panel: /* @__PURE__ */ C(q, { children: [
491
+ panel: /* @__PURE__ */ C(Y, { children: [
484
492
  /* @__PURE__ */ n("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
485
493
  /* @__PURE__ */ n("path", { d: "M15 4v16" })
486
494
  ] }),
487
- alert: /* @__PURE__ */ C(q, { children: [
495
+ alert: /* @__PURE__ */ C(Y, { children: [
488
496
  /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "9" }),
489
497
  /* @__PURE__ */ n("path", { d: "M12 7.5v5.5M12 16.2v.3" })
490
498
  ] }),
491
499
  chevron: /* @__PURE__ */ n("path", { d: "M9 6l6 6-6 6" }),
492
- search: /* @__PURE__ */ C(q, { children: [
500
+ search: /* @__PURE__ */ C(Y, { children: [
493
501
  /* @__PURE__ */ n("circle", { cx: "11", cy: "11", r: "6.5" }),
494
502
  /* @__PURE__ */ n("path", { d: "M20 20l-4.2-4.2" })
495
503
  ] }),
496
- copy: /* @__PURE__ */ C(q, { children: [
504
+ copy: /* @__PURE__ */ C(Y, { children: [
497
505
  /* @__PURE__ */ n("rect", { x: "8.5", y: "8.5", width: "12", height: "12", rx: "2" }),
498
506
  /* @__PURE__ */ n("path", { d: "M15.5 8.5V5.5a2 2 0 0 0-2-2h-8a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h3" })
499
507
  ] })
@@ -513,7 +521,7 @@ function H({ name: e, size: t = 16 }) {
513
521
  strokeLinejoin: "round",
514
522
  "aria-hidden": "true",
515
523
  focusable: "false",
516
- children: Et[e]
524
+ children: Ft[e]
517
525
  }
518
526
  );
519
527
  }
@@ -578,6 +586,7 @@ const ne = {
578
586
  infoTab: "Informações",
579
587
  resize: "Redimensionar o painel",
580
588
  variationsList: "Variações da tela",
589
+ componentVariations: "Variações do componente",
581
590
  defaultVariation: "Padrão",
582
591
  defaultVariationHint: "A tela sem cenário declarado, sem fixture.",
583
592
  noVariations: "Esta tela não tem variações.",
@@ -657,7 +666,7 @@ const ne = {
657
666
  empty: "Nada para mostrar ainda",
658
667
  emptyHint: "O produto ainda não registrou telas nem componentes."
659
668
  }
660
- }, dn = {
669
+ }, un = {
661
670
  network: {
662
671
  success: "Success",
663
672
  loading: "Loading",
@@ -718,6 +727,7 @@ const ne = {
718
727
  infoTab: "Information",
719
728
  resize: "Resize panel",
720
729
  variationsList: "Screen variations",
730
+ componentVariations: "Component variations",
721
731
  defaultVariation: "Default",
722
732
  defaultVariationHint: "The screen without a declared scenario or fixture.",
723
733
  noVariations: "This screen has no variations.",
@@ -798,7 +808,7 @@ const ne = {
798
808
  emptyHint: "The product has not registered any screens or components yet."
799
809
  }
800
810
  };
801
- function Rt(e) {
811
+ function Ot(e) {
802
812
  if (!e) return ne;
803
813
  const t = { ...ne };
804
814
  for (const s of Object.keys(ne)) {
@@ -808,19 +818,19 @@ function Rt(e) {
808
818
  return t;
809
819
  }
810
820
  const Ye = lt(ne);
811
- function Q() {
821
+ function J() {
812
822
  return ct(Ye);
813
823
  }
814
- const un = ne.network, _t = [
824
+ const hn = ne.network, zt = [
815
825
  { id: "mobile", icon: "mobile" },
816
826
  { id: "tablet", icon: "tablet" },
817
827
  { id: "desktop", icon: "desktop" },
818
828
  { id: "fit", icon: "fit" }
819
829
  ], Oe = [25, 33, 50, 67, 75, 90, 100, 110, 125, 150];
820
830
  function ze(e, t) {
821
- return t > 0 ? Oe.find((s) => s > e) ?? Ee : [...Oe].reverse().find((s) => s < e) ?? Pe;
831
+ return t > 0 ? Oe.find((s) => s > e) ?? Ee : [...Oe].reverse().find((s) => s < e) ?? Te;
822
832
  }
823
- function Ft({
833
+ function At({
824
834
  productName: e,
825
835
  viewportId: t,
826
836
  viewport: s,
@@ -829,50 +839,50 @@ function Ft({
829
839
  theme: i,
830
840
  issues: l,
831
841
  linkUrl: a,
832
- onViewport: h,
842
+ onViewport: p,
833
843
  onRotate: m,
834
- onZoom: p,
844
+ onZoom: h,
835
845
  onCleanReview: d,
836
- onToggleTheme: v
846
+ onToggleTheme: f
837
847
  }) {
838
- const f = Q(), k = f.topbar, [T, E] = K(!1), x = (t === "mobile" || t === "tablet") && !!(s.width && s.height), w = async () => {
848
+ const S = J(), b = S.topbar, [L, T] = V(!1), N = (t === "mobile" || t === "tablet") && !!(s.width && s.height), w = async () => {
839
849
  try {
840
850
  await navigator.clipboard.writeText(a);
841
851
  } catch {
842
- window.prompt(k.copyPrompt, a);
852
+ window.prompt(b.copyPrompt, a);
843
853
  }
844
- E(!0), window.setTimeout(() => E(!1), 1600);
854
+ T(!0), window.setTimeout(() => T(!1), 1600);
845
855
  };
846
- return /* @__PURE__ */ C("header", { className: "ds-topbar", "aria-label": k.region, children: [
856
+ return /* @__PURE__ */ C("header", { className: "ds-topbar", "aria-label": b.region, children: [
847
857
  /* @__PURE__ */ C("div", { className: "ds-topbar__product", children: [
848
858
  /* @__PURE__ */ n("span", { className: "ds-topbar__name", children: e }),
849
859
  /* @__PURE__ */ n(
850
860
  "a",
851
861
  {
852
862
  className: "ds-topbar__version",
853
- href: `https://www.npmjs.com/package/${Pt}/v/${Fe}`,
863
+ href: `https://www.npmjs.com/package/${_t}/v/${Fe}`,
854
864
  target: "_blank",
855
865
  rel: "noreferrer",
856
- children: k.engineVersion(Fe)
866
+ children: b.engineVersion(Fe)
857
867
  }
858
868
  )
859
869
  ] }),
860
870
  /* @__PURE__ */ C("div", { className: "ds-topbar__view", children: [
861
- /* @__PURE__ */ C("div", { className: "ds-group", role: "group", "aria-label": k.viewportGroup, children: [
862
- _t.map((b) => {
863
- const N = f.viewport[b.id] ?? b.id;
871
+ /* @__PURE__ */ C("div", { className: "ds-group", role: "group", "aria-label": b.viewportGroup, children: [
872
+ zt.map((u) => {
873
+ const k = S.viewport[u.id] ?? u.id;
864
874
  return /* @__PURE__ */ n(
865
875
  "button",
866
876
  {
867
877
  type: "button",
868
878
  className: "ds-btn ds-btn--icon",
869
- "aria-pressed": t === b.id,
870
- "aria-label": N,
871
- title: N,
872
- onClick: () => h(b.id),
873
- children: /* @__PURE__ */ n(H, { name: b.icon })
879
+ "aria-pressed": t === u.id,
880
+ "aria-label": k,
881
+ title: k,
882
+ onClick: () => p(u.id),
883
+ children: /* @__PURE__ */ n(H, { name: u.icon })
874
884
  },
875
- b.id
885
+ u.id
876
886
  );
877
887
  }),
878
888
  /* @__PURE__ */ n(
@@ -881,9 +891,9 @@ function Ft({
881
891
  type: "button",
882
892
  className: "ds-btn ds-btn--icon",
883
893
  "aria-pressed": r,
884
- "aria-label": k.rotate,
885
- title: k.rotate,
886
- disabled: !x,
894
+ "aria-label": b.rotate,
895
+ title: b.rotate,
896
+ disabled: !N,
887
897
  onClick: m,
888
898
  children: /* @__PURE__ */ n(H, { name: "rotate" })
889
899
  }
@@ -895,10 +905,10 @@ function Ft({
895
905
  {
896
906
  type: "button",
897
907
  className: "ds-btn ds-btn--icon",
898
- "aria-label": k.zoomOut,
899
- title: k.zoomOut,
900
- disabled: o <= Pe,
901
- onClick: () => p(ze(o, -1)),
908
+ "aria-label": b.zoomOut,
909
+ title: b.zoomOut,
910
+ disabled: o <= Te,
911
+ onClick: () => h(ze(o, -1)),
902
912
  children: /* @__PURE__ */ n(H, { name: "minus" })
903
913
  }
904
914
  ),
@@ -907,10 +917,10 @@ function Ft({
907
917
  {
908
918
  type: "button",
909
919
  className: "ds-btn ds-btn--zoom",
910
- "aria-label": k.zoomReset,
911
- title: k.zoomReset,
912
- onClick: () => p(pe),
913
- children: k.zoomValue(o)
920
+ "aria-label": b.zoomReset,
921
+ title: b.zoomReset,
922
+ onClick: () => h(me),
923
+ children: b.zoomValue(o)
914
924
  }
915
925
  ),
916
926
  /* @__PURE__ */ n(
@@ -918,10 +928,10 @@ function Ft({
918
928
  {
919
929
  type: "button",
920
930
  className: "ds-btn ds-btn--icon",
921
- "aria-label": k.zoomIn,
922
- title: k.zoomIn,
931
+ "aria-label": b.zoomIn,
932
+ title: b.zoomIn,
923
933
  disabled: o >= Ee,
924
- onClick: () => p(ze(o, 1)),
934
+ onClick: () => h(ze(o, 1)),
925
935
  children: /* @__PURE__ */ n(H, { name: "plus" })
926
936
  }
927
937
  )
@@ -931,8 +941,8 @@ function Ft({
931
941
  {
932
942
  type: "button",
933
943
  className: "ds-btn ds-btn--icon",
934
- "aria-label": k.cleanReview,
935
- title: k.cleanReview,
944
+ "aria-label": b.cleanReview,
945
+ title: b.cleanReview,
936
946
  onClick: d,
937
947
  children: /* @__PURE__ */ n(H, { name: "fullscreen" })
938
948
  }
@@ -944,10 +954,10 @@ function Ft({
944
954
  {
945
955
  type: "button",
946
956
  className: "ds-btn ds-btn--icon",
947
- "aria-label": T ? k.copied : k.copyLink,
948
- title: T ? k.copied : k.copyLink,
957
+ "aria-label": L ? b.copied : b.copyLink,
958
+ title: L ? b.copied : b.copyLink,
949
959
  onClick: w,
950
- children: /* @__PURE__ */ n(H, { name: T ? "check" : "link" })
960
+ children: /* @__PURE__ */ n(H, { name: L ? "check" : "link" })
951
961
  }
952
962
  ),
953
963
  /* @__PURE__ */ n(
@@ -955,27 +965,27 @@ function Ft({
955
965
  {
956
966
  type: "button",
957
967
  className: "ds-btn ds-btn--icon",
958
- "aria-label": i === "dark" ? k.lightMode : k.darkMode,
959
- title: i === "dark" ? k.lightMode : k.darkMode,
960
- onClick: v,
968
+ "aria-label": i === "dark" ? b.lightMode : b.darkMode,
969
+ title: i === "dark" ? b.lightMode : b.darkMode,
970
+ onClick: f,
961
971
  children: /* @__PURE__ */ n(H, { name: i === "dark" ? "sun" : "moon" })
962
972
  }
963
973
  ),
964
- l.length > 0 && /* @__PURE__ */ n(Ot, { issues: l })
974
+ l.length > 0 && /* @__PURE__ */ n(Dt, { issues: l })
965
975
  ] })
966
976
  ] });
967
977
  }
968
- function Ot({ issues: e }) {
969
- const t = Q(), [s, o] = K(!1), r = G(null), i = e.filter((h) => h.level === "error").length, l = e.length - i, a = t.topbar.diagnostics(i, l);
978
+ function Dt({ issues: e }) {
979
+ const t = J(), [s, o] = V(!1), r = q(null), i = e.filter((p) => p.level === "error").length, l = e.length - i, a = t.topbar.diagnostics(i, l);
970
980
  return I(() => {
971
981
  if (!s) return;
972
- const h = (p) => {
973
- r.current?.contains(p.target) || o(!1);
974
- }, m = (p) => {
975
- p.key === "Escape" && o(!1);
982
+ const p = (h) => {
983
+ r.current?.contains(h.target) || o(!1);
984
+ }, m = (h) => {
985
+ h.key === "Escape" && o(!1);
976
986
  };
977
- return window.addEventListener("pointerdown", h), window.addEventListener("keydown", m), () => {
978
- window.removeEventListener("pointerdown", h), window.removeEventListener("keydown", m);
987
+ return window.addEventListener("pointerdown", p), window.addEventListener("keydown", m), () => {
988
+ window.removeEventListener("pointerdown", p), window.removeEventListener("keydown", m);
979
989
  };
980
990
  }, [s]), /* @__PURE__ */ C("div", { className: "ds-diagnostics", ref: r, children: [
981
991
  /* @__PURE__ */ C(
@@ -987,7 +997,7 @@ function Ot({ issues: e }) {
987
997
  "aria-expanded": s,
988
998
  "aria-label": a,
989
999
  title: a,
990
- onClick: () => o((h) => !h),
1000
+ onClick: () => o((p) => !p),
991
1001
  children: [
992
1002
  /* @__PURE__ */ n(H, { name: "alert" }),
993
1003
  /* @__PURE__ */ n("span", { children: i > 0 ? i : l })
@@ -999,28 +1009,28 @@ function Ot({ issues: e }) {
999
1009
  /* @__PURE__ */ n("strong", { children: t.diagnostics.title }),
1000
1010
  /* @__PURE__ */ n("span", { className: "ds-muted", children: a })
1001
1011
  ] }),
1002
- /* @__PURE__ */ n("ul", { className: "ds-diagnostics__list", children: e.map((h, m) => /* @__PURE__ */ C("li", { className: "ds-diagnostics__item", "data-level": h.level, children: [
1003
- /* @__PURE__ */ n("span", { className: "ds-diagnostics__level", children: h.level === "error" ? t.diagnostics.error : t.diagnostics.warning }),
1004
- /* @__PURE__ */ n("code", { className: "ds-diagnostics__where", children: h.where }),
1005
- /* @__PURE__ */ n("span", { className: "ds-diagnostics__message", children: h.message })
1006
- ] }, `${h.where}-${m}`)) })
1012
+ /* @__PURE__ */ n("ul", { className: "ds-diagnostics__list", children: e.map((p, m) => /* @__PURE__ */ C("li", { className: "ds-diagnostics__item", "data-level": p.level, children: [
1013
+ /* @__PURE__ */ n("span", { className: "ds-diagnostics__level", children: p.level === "error" ? t.diagnostics.error : t.diagnostics.warning }),
1014
+ /* @__PURE__ */ n("code", { className: "ds-diagnostics__where", children: p.where }),
1015
+ /* @__PURE__ */ n("span", { className: "ds-diagnostics__message", children: p.message })
1016
+ ] }, `${p.where}-${m}`)) })
1007
1017
  ] })
1008
1018
  ] });
1009
1019
  }
1010
- const zt = 16;
1020
+ const Vt = 16;
1011
1021
  function Xe({ side: e, label: t, value: s, onChange: o, onStart: r, onEnd: i }) {
1012
- const l = G(void 0), a = e === "left" ? 1 : -1, h = (v) => {
1013
- if (v.button === 0) {
1014
- v.preventDefault(), l.current = { x: v.clientX, width: s };
1022
+ const l = q(void 0), a = e === "left" ? 1 : -1, p = (f) => {
1023
+ if (f.button === 0) {
1024
+ f.preventDefault(), l.current = { x: f.clientX, width: s };
1015
1025
  try {
1016
- v.currentTarget.setPointerCapture(v.pointerId);
1026
+ f.currentTarget.setPointerCapture(f.pointerId);
1017
1027
  } catch {
1018
1028
  }
1019
1029
  r?.();
1020
1030
  }
1021
- }, m = (v) => {
1022
- l.current && o(l.current.width + (v.clientX - l.current.x) * a);
1023
- }, p = () => {
1031
+ }, m = (f) => {
1032
+ l.current && o(l.current.width + (f.clientX - l.current.x) * a);
1033
+ }, h = () => {
1024
1034
  l.current && (l.current = void 0, i?.());
1025
1035
  };
1026
1036
  return /* @__PURE__ */ n(
@@ -1033,21 +1043,21 @@ function Xe({ side: e, label: t, value: s, onChange: o, onStart: r, onEnd: i })
1033
1043
  "aria-label": t,
1034
1044
  "aria-valuenow": s,
1035
1045
  tabIndex: 0,
1036
- onPointerDown: h,
1046
+ onPointerDown: p,
1037
1047
  onPointerMove: m,
1038
- onPointerUp: p,
1039
- onPointerCancel: p,
1040
- onLostPointerCapture: p,
1041
- onKeyDown: (v) => {
1042
- if (v.key !== "ArrowLeft" && v.key !== "ArrowRight") return;
1043
- v.preventDefault();
1044
- const f = v.key === "ArrowRight" ? 1 : -1;
1045
- o(s + f * a * zt);
1048
+ onPointerUp: h,
1049
+ onPointerCancel: h,
1050
+ onLostPointerCapture: h,
1051
+ onKeyDown: (f) => {
1052
+ if (f.key !== "ArrowLeft" && f.key !== "ArrowRight") return;
1053
+ f.preventDefault();
1054
+ const S = f.key === "ArrowRight" ? 1 : -1;
1055
+ o(s + S * a * Vt);
1046
1056
  }
1047
1057
  }
1048
1058
  );
1049
1059
  }
1050
- function At({
1060
+ function Kt({
1051
1061
  registry: e,
1052
1062
  handoff: t,
1053
1063
  activeScreen: s,
@@ -1056,31 +1066,31 @@ function At({
1056
1066
  onOpenComponent: i,
1057
1067
  width: l,
1058
1068
  onResize: a,
1059
- onResizeStart: h,
1069
+ onResizeStart: p,
1060
1070
  onResizeEnd: m
1061
1071
  }) {
1062
- const d = Q().sidebar, [v, f] = K(""), [k, T] = K(() => /* @__PURE__ */ new Set()), E = G(null), x = e.screensFor({ handoff: t }), w = e.componentsFor(t), b = x.length > 0, N = w.length > 0, [S, u] = K(
1063
- () => o || !b ? "components" : "screens"
1072
+ const d = J().sidebar, [f, S] = V(""), [b, L] = V(() => /* @__PURE__ */ new Set()), T = q(null), N = e.screensFor({ handoff: t }), w = e.componentsFor(t), u = N.length > 0, k = w.length > 0, [g, y] = V(
1073
+ () => o || !u ? "components" : "screens"
1064
1074
  );
1065
1075
  I(() => {
1066
- o && N ? u("components") : s && b && u("screens");
1067
- }, [o, s, N, b]);
1068
- const $ = S;
1076
+ o && k ? y("components") : s && u && y("screens");
1077
+ }, [o, s, k, u]);
1078
+ const _ = g;
1069
1079
  I(() => {
1070
- const R = (V) => {
1071
- Vt(V) && (V.preventDefault(), E.current?.focus(), E.current?.select());
1080
+ const E = (K) => {
1081
+ Wt(K) && (K.preventDefault(), T.current?.focus(), T.current?.select());
1072
1082
  };
1073
- return window.addEventListener("keydown", R), () => window.removeEventListener("keydown", R);
1083
+ return window.addEventListener("keydown", E), () => window.removeEventListener("keydown", E);
1074
1084
  }, []);
1075
- const F = D(
1076
- () => e.searchScreens(v, { handoff: t }),
1077
- [t, v, e]
1085
+ const z = D(
1086
+ () => e.searchScreens(f, { handoff: t }),
1087
+ [t, f, e]
1078
1088
  ), c = D(
1079
- () => e.searchComponents(v, t),
1080
- [t, v, e]
1081
- ), g = D(() => Kt(c, d.ungrouped), [c, d.ungrouped]), y = D(() => je(F), [F]), L = v.trim().length > 0, O = (R) => T((V) => {
1082
- const P = new Set(V);
1083
- return P.has(R) ? P.delete(R) : P.add(R), P;
1089
+ () => e.searchComponents(f, t),
1090
+ [t, f, e]
1091
+ ), v = D(() => It(c, d.ungrouped), [c, d.ungrouped]), x = D(() => je(z), [z]), M = f.trim().length > 0, F = (E) => L((K) => {
1092
+ const P = new Set(K);
1093
+ return P.has(E) ? P.delete(E) : P.add(E), P;
1084
1094
  });
1085
1095
  return /* @__PURE__ */ C("nav", { className: "ds-sidebar", "aria-label": d.region, style: { width: l }, children: [
1086
1096
  /* @__PURE__ */ C("div", { className: "ds-search", children: [
@@ -1088,15 +1098,15 @@ function At({
1088
1098
  /* @__PURE__ */ n(
1089
1099
  "input",
1090
1100
  {
1091
- ref: E,
1101
+ ref: T,
1092
1102
  className: "ds-input ds-search__input",
1093
1103
  type: "search",
1094
- value: v,
1104
+ value: f,
1095
1105
  placeholder: d.searchPlaceholder,
1096
1106
  "aria-label": d.searchLabel,
1097
- onChange: (R) => f(R.target.value),
1098
- onKeyDown: (R) => {
1099
- R.key === "Escape" && f("");
1107
+ onChange: (E) => S(E.target.value),
1108
+ onKeyDown: (E) => {
1109
+ E.key === "Escape" && S("");
1100
1110
  }
1101
1111
  }
1102
1112
  ),
@@ -1106,25 +1116,25 @@ function At({
1106
1116
  /* @__PURE__ */ n(
1107
1117
  Ae,
1108
1118
  {
1109
- selected: $ === "screens",
1119
+ selected: _ === "screens",
1110
1120
  label: d.screensTab,
1111
- count: L ? F.length : void 0,
1112
- onSelect: () => u("screens")
1121
+ count: M ? z.length : void 0,
1122
+ onSelect: () => y("screens")
1113
1123
  }
1114
1124
  ),
1115
1125
  /* @__PURE__ */ n(
1116
1126
  Ae,
1117
1127
  {
1118
- selected: $ === "components",
1128
+ selected: _ === "components",
1119
1129
  label: d.componentsTab,
1120
- count: L ? c.length : void 0,
1121
- onSelect: () => u("components")
1130
+ count: M ? c.length : void 0,
1131
+ onSelect: () => y("components")
1122
1132
  }
1123
1133
  )
1124
1134
  ] }),
1125
- /* @__PURE__ */ n("div", { className: "ds-sidebar__list", role: "tabpanel", children: $ === "screens" ? b ? F.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: d.noMatch(v) }) : y.map((R) => {
1126
- const V = /* @__PURE__ */ n("ul", { className: "ds-items", children: R.screens.map((A) => /* @__PURE__ */ n(
1127
- Dt,
1135
+ /* @__PURE__ */ n("div", { className: "ds-sidebar__list", role: "tabpanel", children: _ === "screens" ? u ? z.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: d.noMatch(f) }) : x.map((E) => {
1136
+ const K = /* @__PURE__ */ n("ul", { className: "ds-items", children: E.screens.map((A) => /* @__PURE__ */ n(
1137
+ Ut,
1128
1138
  {
1129
1139
  screen: A,
1130
1140
  active: A.id === s && !o,
@@ -1132,28 +1142,28 @@ function At({
1132
1142
  },
1133
1143
  A.id
1134
1144
  )) });
1135
- if (R.name === void 0) return /* @__PURE__ */ n("div", { className: "ds-group-section", children: V }, "");
1136
- const P = `screens:${R.name}`, z = k.has(P) && !L;
1145
+ if (E.name === void 0) return /* @__PURE__ */ n("div", { className: "ds-group-section", children: K }, "");
1146
+ const P = `screens:${E.name}`, O = b.has(P) && !M;
1137
1147
  return /* @__PURE__ */ C("section", { className: "ds-group-section", children: [
1138
1148
  /* @__PURE__ */ C(
1139
1149
  "button",
1140
1150
  {
1141
1151
  type: "button",
1142
1152
  className: "ds-group-section__head",
1143
- "aria-expanded": !z,
1144
- "aria-label": d.toggleGroup(R.name),
1145
- onClick: () => O(P),
1153
+ "aria-expanded": !O,
1154
+ "aria-label": d.toggleGroup(E.name),
1155
+ onClick: () => F(P),
1146
1156
  children: [
1147
1157
  /* @__PURE__ */ n(H, { name: "chevron", size: 12 }),
1148
- /* @__PURE__ */ n("span", { children: R.name }),
1149
- /* @__PURE__ */ n("span", { className: "ds-count", children: R.screens.length })
1158
+ /* @__PURE__ */ n("span", { children: E.name }),
1159
+ /* @__PURE__ */ n("span", { className: "ds-count", children: E.screens.length })
1150
1160
  ]
1151
1161
  }
1152
1162
  ),
1153
- !z && V
1163
+ !O && K
1154
1164
  ] }, P);
1155
- }) : /* @__PURE__ */ n("p", { className: "ds-empty", children: d.emptyScreens }) : N ? c.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: d.noMatch(v) }) : g.map(({ group: R, items: V }) => {
1156
- const P = k.has(R) && !L;
1165
+ }) : /* @__PURE__ */ n("p", { className: "ds-empty", children: d.emptyScreens }) : k ? c.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: d.noMatch(f) }) : v.map(({ group: E, items: K }) => {
1166
+ const P = b.has(E) && !M;
1157
1167
  return /* @__PURE__ */ C("section", { className: "ds-group-section", children: [
1158
1168
  /* @__PURE__ */ C(
1159
1169
  "button",
@@ -1161,26 +1171,26 @@ function At({
1161
1171
  type: "button",
1162
1172
  className: "ds-group-section__head",
1163
1173
  "aria-expanded": !P,
1164
- "aria-label": d.toggleGroup(R),
1165
- onClick: () => O(R),
1174
+ "aria-label": d.toggleGroup(E),
1175
+ onClick: () => F(E),
1166
1176
  children: [
1167
1177
  /* @__PURE__ */ n(H, { name: "chevron", size: 12 }),
1168
- /* @__PURE__ */ n("span", { children: R }),
1169
- /* @__PURE__ */ n("span", { className: "ds-count", children: V.length })
1178
+ /* @__PURE__ */ n("span", { children: E }),
1179
+ /* @__PURE__ */ n("span", { className: "ds-count", children: K.length })
1170
1180
  ]
1171
1181
  }
1172
1182
  ),
1173
- !P && /* @__PURE__ */ n("ul", { className: "ds-items", children: V.map((z) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
1183
+ !P && /* @__PURE__ */ n("ul", { className: "ds-items", children: K.map((O) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
1174
1184
  "button",
1175
1185
  {
1176
1186
  type: "button",
1177
1187
  className: "ds-item",
1178
- "aria-current": z.id === o ? "true" : void 0,
1179
- onClick: () => i(z.id),
1180
- children: /* @__PURE__ */ n("span", { className: "ds-item__title", children: z.name })
1188
+ "aria-current": O.id === o ? "true" : void 0,
1189
+ onClick: () => i(O.id),
1190
+ children: /* @__PURE__ */ n("span", { className: "ds-item__title", children: O.name })
1181
1191
  }
1182
- ) }, z.id)) })
1183
- ] }, R);
1192
+ ) }, O.id)) })
1193
+ ] }, E);
1184
1194
  }) : /* @__PURE__ */ n("p", { className: "ds-empty", children: d.emptyComponents }) }),
1185
1195
  /* @__PURE__ */ n(
1186
1196
  Xe,
@@ -1189,7 +1199,7 @@ function At({
1189
1199
  label: d.resize,
1190
1200
  value: l,
1191
1201
  onChange: a,
1192
- onStart: h,
1202
+ onStart: p,
1193
1203
  onEnd: m
1194
1204
  }
1195
1205
  )
@@ -1217,7 +1227,7 @@ function Ae({
1217
1227
  }
1218
1228
  );
1219
1229
  }
1220
- function Dt({
1230
+ function Ut({
1221
1231
  screen: e,
1222
1232
  active: t,
1223
1233
  onOpen: s
@@ -1236,7 +1246,7 @@ function Dt({
1236
1246
  }
1237
1247
  ) });
1238
1248
  }
1239
- function Kt(e, t) {
1249
+ function It(e, t) {
1240
1250
  const s = /* @__PURE__ */ new Map();
1241
1251
  for (const o of e) {
1242
1252
  const r = o.group?.trim() || t, i = s.get(r) ?? [];
@@ -1244,10 +1254,10 @@ function Kt(e, t) {
1244
1254
  }
1245
1255
  return [...s].map(([o, r]) => ({ group: o, items: r }));
1246
1256
  }
1247
- function Vt(e) {
1257
+ function Wt(e) {
1248
1258
  return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "k";
1249
1259
  }
1250
- function Ut({
1260
+ function Ht({
1251
1261
  screen: e,
1252
1262
  variations: t,
1253
1263
  components: s,
@@ -1257,32 +1267,32 @@ function Ut({
1257
1267
  }) {
1258
1268
  const l = r.pr, a = [`## ${e.name}`, ""];
1259
1269
  e.description && a.push(e.description, ""), a.push(`\`${e.route.path}\``, "");
1260
- const h = o.deploymentUrl ? `https://${o.deploymentUrl}` : void 0, m = o.shortCommit ? l.commit(o.shortCommit) : void 0;
1270
+ const p = o.deploymentUrl ? `https://${o.deploymentUrl}` : void 0, m = o.shortCommit ? l.commit(o.shortCommit) : void 0;
1261
1271
  if (a.push(`### ${l.variations}`, ""), t.length === 0) {
1262
- const p = new URL(e.href, o.origin);
1263
- ye(p.searchParams, i), a.push(`- [${r.panel.defaultVariation}](${p.toString()})`);
1272
+ const h = new URL(e.href, o.origin);
1273
+ ye(h.searchParams, i), a.push(`- [${r.panel.defaultVariation}](${h.toString()})`);
1264
1274
  }
1265
- for (const p of t) {
1266
- const d = he(p, { origin: o.origin, overrides: i });
1267
- let v = `- [${Qe(p.title)}](${d})`;
1268
- if (h) {
1269
- const f = he(p, { origin: h, overrides: i });
1270
- v += ` · [${m ?? l.immutableLink}](${f})`;
1271
- } else m && (v += ` · ${m}`);
1272
- a.push(v);
1275
+ for (const h of t) {
1276
+ const d = pe(h, { origin: o.origin, overrides: i });
1277
+ let f = `- [${Qe(h.title)}](${d})`;
1278
+ if (p) {
1279
+ const S = pe(h, { origin: p, overrides: i });
1280
+ f += ` · [${m ?? l.immutableLink}](${S})`;
1281
+ } else m && (f += ` · ${m}`);
1282
+ a.push(f);
1273
1283
  }
1274
1284
  if (a.push(""), s.length > 0) {
1275
1285
  a.push(`### ${l.components}`, ""), a.push(`| ${l.component} | ${l.source} |`, "| --- | --- |");
1276
- for (const p of s) {
1277
- const d = p.source ? `\`${me(p.source)}\`` : l.empty;
1278
- a.push(`| ${me(p.name)} (\`${p.id}\`) | ${d} |`);
1286
+ for (const h of s) {
1287
+ const d = h.source ? `\`${fe(h.source)}\`` : l.empty;
1288
+ a.push(`| ${fe(h.name)} (\`${h.id}\`) | ${d} |`);
1279
1289
  }
1280
1290
  a.push("");
1281
1291
  }
1282
1292
  a.push(`### ${l.expected}`, ""), t.length === 0 && a.push(`**${r.panel.defaultVariation}**`, "", l.noExpected, "");
1283
- for (const p of t) {
1284
- if (a.push(`**${p.title}**`, ""), p.expected?.length)
1285
- for (const d of p.expected) a.push(`- ${d}`);
1293
+ for (const h of t) {
1294
+ if (a.push(`**${h.title}**`, ""), h.expected?.length)
1295
+ for (const d of h.expected) a.push(`- ${d}`);
1286
1296
  else
1287
1297
  a.push(l.noExpected);
1288
1298
  a.push("");
@@ -1291,13 +1301,13 @@ function Ut({
1291
1301
  `).trimEnd()}
1292
1302
  `;
1293
1303
  }
1294
- function me(e) {
1304
+ function fe(e) {
1295
1305
  return e.replace(/\|/g, "\\|").replace(/\n/g, " ");
1296
1306
  }
1297
1307
  function Qe(e) {
1298
1308
  return e.replace(/([[\]])/g, "\\$1");
1299
1309
  }
1300
- function It({
1310
+ function Bt({
1301
1311
  flow: e,
1302
1312
  registry: t,
1303
1313
  open: s,
@@ -1305,61 +1315,61 @@ function It({
1305
1315
  labels: r,
1306
1316
  overrides: i
1307
1317
  }) {
1308
- const l = r.pr, a = [`## ${e.name}`, ""], h = o.deploymentUrl ? `https://${o.deploymentUrl}` : void 0, m = o.shortCommit ? l.commit(o.shortCommit) : void 0, p = (d, v) => {
1318
+ const l = r.pr, a = [`## ${e.name}`, ""], p = o.deploymentUrl ? `https://${o.deploymentUrl}` : void 0, m = o.shortCommit ? l.commit(o.shortCommit) : void 0, h = (d, f) => {
1309
1319
  if (s && s.screen.id === d.id) {
1310
- const T = new URL(s.location.path || "/", v), E = new URLSearchParams(s.location.search);
1311
- for (const x of mt) E.delete(x);
1312
- for (const [x, w] of E) T.searchParams.append(x, w);
1313
- return ye(T.searchParams, i), T.toString();
1320
+ const L = new URL(s.location.path || "/", f), T = new URLSearchParams(s.location.search);
1321
+ for (const N of wt) T.delete(N);
1322
+ for (const [N, w] of T) L.searchParams.append(N, w);
1323
+ return ye(L.searchParams, i), L.toString();
1314
1324
  }
1315
- const f = d.variations[0];
1316
- if (f) return he(f, { origin: v, overrides: i });
1317
- const k = new URL(d.href, v);
1318
- return ye(k.searchParams, i), k.toString();
1325
+ const S = d.variations[0];
1326
+ if (S) return pe(S, { origin: f, overrides: i });
1327
+ const b = new URL(d.href, f);
1328
+ return ye(b.searchParams, i), b.toString();
1319
1329
  };
1320
1330
  for (const d of e.screens) {
1321
1331
  a.push(`### ${d.name}`, ""), d.description && a.push(d.description, "");
1322
- let v = `\`${d.route.path}\` · [${l.open}](${p(d, o.origin)})`;
1323
- if (h ? v += ` · [${m ?? l.immutableLink}](${p(d, h)})` : m && (v += ` · ${m}`), a.push(v, ""), d.controls.length > 0) {
1332
+ let f = `\`${d.route.path}\` · [${l.open}](${h(d, o.origin)})`;
1333
+ if (p ? f += ` · [${m ?? l.immutableLink}](${h(d, p)})` : m && (f += ` · ${m}`), a.push(f, ""), d.controls.length > 0) {
1324
1334
  a.push(`**${l.controls}**`, "");
1325
- for (const x of d.controls) {
1326
- a.push(`- ${ce(x.title)} (\`${x.id}\`)`);
1327
- for (const w of x.controls) {
1328
- const b = ge(w), N = w.options.map(
1329
- (S) => S.value === b ? `${ce(S.label)} (\`${S.value}\`, ${l.defaultOption})` : `${ce(S.label)} (\`${S.value}\`)`
1335
+ for (const N of d.controls) {
1336
+ a.push(`- ${ce(N.title)} (\`${N.id}\`)`);
1337
+ for (const w of N.controls) {
1338
+ const u = be(w), k = w.options.map(
1339
+ (g) => g.value === u ? `${ce(g.label)} (\`${g.value}\`, ${l.defaultOption})` : `${ce(g.label)} (\`${g.value}\`)`
1330
1340
  ).join(" · ");
1331
- a.push(` - ${ce(w.label)} (\`c.${w.id}\`): ${N}`);
1341
+ a.push(` - ${ce(w.label)} (\`c.${w.id}\`): ${k}`);
1332
1342
  }
1333
1343
  }
1334
1344
  a.push("");
1335
1345
  }
1336
1346
  if (d.variations.length > 0) {
1337
1347
  a.push(`**${l.shortcuts}**`, "");
1338
- for (const x of d.variations)
1348
+ for (const N of d.variations)
1339
1349
  a.push(
1340
- `- [${Qe(x.title)}](${he(x, { origin: o.origin, overrides: i })})`
1350
+ `- [${Qe(N.title)}](${pe(N, { origin: o.origin, overrides: i })})`
1341
1351
  );
1342
1352
  a.push("");
1343
1353
  }
1344
1354
  a.push(`**${l.expected}**`, "");
1345
- const f = s?.screen.id === d.id ? s.variation : void 0, k = f?.expected?.length ? f.expected : d.route.expected, T = d.variations.filter(
1346
- (x) => x.expected?.length && x.id !== f?.id
1355
+ const S = s?.screen.id === d.id ? s.variation : void 0, b = S?.expected?.length ? S.expected : d.route.expected, L = d.variations.filter(
1356
+ (N) => N.expected?.length && N.id !== S?.id
1347
1357
  );
1348
- if (!k?.length && T.length === 0 && a.push(l.noExpected, ""), k?.length) {
1349
- for (const x of k) a.push(`- ${x}`);
1358
+ if (!b?.length && L.length === 0 && a.push(l.noExpected, ""), b?.length) {
1359
+ for (const N of b) a.push(`- ${N}`);
1350
1360
  a.push("");
1351
1361
  }
1352
- for (const x of T) {
1353
- a.push(`*${x.title}*`, "");
1354
- for (const w of x.expected ?? []) a.push(`- ${w}`);
1362
+ for (const N of L) {
1363
+ a.push(`*${N.title}*`, "");
1364
+ for (const w of N.expected ?? []) a.push(`- ${w}`);
1355
1365
  a.push("");
1356
1366
  }
1357
- const E = t.componentsOfScreen(d);
1358
- if (E.length > 0) {
1367
+ const T = t.componentsOfScreen(d);
1368
+ if (T.length > 0) {
1359
1369
  a.push(`**${l.components}**`, ""), a.push(`| ${l.component} | ${l.source} |`, "| --- | --- |");
1360
- for (const x of E) {
1361
- const w = x.source ? `\`${me(x.source)}\`` : l.empty;
1362
- a.push(`| ${me(x.name)} (\`${x.id}\`) | ${w} |`);
1370
+ for (const N of T) {
1371
+ const w = N.source ? `\`${fe(N.source)}\`` : l.empty;
1372
+ a.push(`| ${fe(N.name)} (\`${N.id}\`) | ${w} |`);
1363
1373
  }
1364
1374
  a.push("");
1365
1375
  }
@@ -1371,18 +1381,18 @@ function It({
1371
1381
  function ce(e) {
1372
1382
  return e.replace(/([*_[\]`])/g, "\\$1");
1373
1383
  }
1374
- function Wt(e) {
1375
- const { tab: t, onTab: s, width: o, onResize: r, onResizeStart: i, onResizeEnd: l } = e, a = Q().panel, [h, m] = K(""), p = G(null), d = G(null), [v, f] = K(!1), [k, T] = K(() => /* @__PURE__ */ new Set()), E = (w) => T((b) => {
1376
- const N = new Set(b);
1377
- return N.has(w) ? N.delete(w) : N.add(w), N;
1378
- }), x = h.trim().length > 0;
1384
+ function jt(e) {
1385
+ const { tab: t, onTab: s, width: o, onResize: r, onResizeStart: i, onResizeEnd: l } = e, a = J().panel, [p, m] = V(""), h = q(null), d = q(null), [f, S] = V(!1), [b, L] = V(() => /* @__PURE__ */ new Set()), T = (w) => L((u) => {
1386
+ const k = new Set(u);
1387
+ return k.has(w) ? k.delete(w) : k.add(w), k;
1388
+ }), N = p.trim().length > 0;
1379
1389
  return I(() => {
1380
- const w = (b) => {
1381
- Gt(b) && (b.preventDefault(), p.current?.focus(), p.current?.select());
1390
+ const w = (u) => {
1391
+ Zt(u) && (u.preventDefault(), h.current?.focus(), h.current?.select());
1382
1392
  };
1383
1393
  return window.addEventListener("keydown", w), () => window.removeEventListener("keydown", w);
1384
1394
  }, []), Ue(() => {
1385
- f(Zt(d.current, h));
1395
+ S(Yt(d.current, p));
1386
1396
  }), /* @__PURE__ */ C("aside", { className: "ds-panel", "aria-label": a.region, style: { width: o }, children: [
1387
1397
  /* @__PURE__ */ n(
1388
1398
  Xe,
@@ -1400,10 +1410,10 @@ function Wt(e) {
1400
1410
  /* @__PURE__ */ n(
1401
1411
  "input",
1402
1412
  {
1403
- ref: p,
1413
+ ref: h,
1404
1414
  className: "ds-input ds-search__input",
1405
1415
  type: "search",
1406
- value: h,
1416
+ value: p,
1407
1417
  placeholder: a.searchPlaceholder,
1408
1418
  "aria-label": a.searchLabel,
1409
1419
  onChange: (w) => m(w.target.value),
@@ -1441,12 +1451,12 @@ function Wt(e) {
1441
1451
  )
1442
1452
  ] }),
1443
1453
  /* @__PURE__ */ C("div", { className: "ds-panel__body", role: "tabpanel", ref: d, children: [
1444
- t === "variations" ? /* @__PURE__ */ n(Ht, { ...e, collapsed: k, onToggle: E, filtering: x }) : /* @__PURE__ */ n(qt, { ...e }),
1445
- v && /* @__PURE__ */ n("p", { className: "ds-empty", children: a.noMatch(h) })
1454
+ t === "variations" ? /* @__PURE__ */ n(qt, { ...e, collapsed: b, onToggle: T, filtering: N }) : /* @__PURE__ */ n(Gt, { ...e }),
1455
+ f && /* @__PURE__ */ n("p", { className: "ds-empty", children: a.noMatch(p) })
1446
1456
  ] })
1447
1457
  ] });
1448
1458
  }
1449
- function Ht({
1459
+ function qt({
1450
1460
  registry: e,
1451
1461
  controls: t,
1452
1462
  screen: s,
@@ -1455,209 +1465,156 @@ function Ht({
1455
1465
  componentFixture: i,
1456
1466
  onOpenScenario: l,
1457
1467
  onOpenComponent: a,
1458
- onChange: h,
1459
- collapsed: m,
1460
- onToggle: p,
1461
- filtering: d
1468
+ onChange: p
1462
1469
  }) {
1463
- const v = Q(), f = v.panel;
1470
+ const m = J(), h = m.panel;
1464
1471
  if (r) {
1465
1472
  const u = r.fixtures ?? [];
1466
- return u.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: f.noComponentVariations }) : /* @__PURE__ */ C(q, { children: [
1467
- i.didFallback && i.requestedId && i.fixture && /* @__PURE__ */ n("p", { className: "ds-notice", children: f.fixtureFallback(i.requestedId, i.fixture.id) }),
1468
- /* @__PURE__ */ n("ul", { className: "ds-items", "aria-label": f.variationsList, children: u.map(($) => /* @__PURE__ */ n("li", { "data-ds-filter": !0, children: /* @__PURE__ */ C(
1469
- "button",
1473
+ if (u.length === 0) return /* @__PURE__ */ n("p", { className: "ds-empty", children: h.noComponentVariations });
1474
+ const k = i.fixture;
1475
+ return /* @__PURE__ */ C("div", { className: "ds-vcards", children: [
1476
+ i.didFallback && i.requestedId && k && /* @__PURE__ */ n("p", { className: "ds-notice", children: h.fixtureFallback(i.requestedId, k.id) }),
1477
+ /* @__PURE__ */ n(le, { title: r.name, hint: k?.description, children: /* @__PURE__ */ n(
1478
+ ee,
1470
1479
  {
1471
- type: "button",
1472
- className: "ds-item ds-item--stacked",
1473
- "aria-current": i.fixture?.id === $.id ? "true" : void 0,
1474
- onClick: () => h({ fixture: $.id }),
1475
- children: [
1476
- /* @__PURE__ */ n("span", { className: "ds-item__title", children: $.label }),
1477
- $.description && /* @__PURE__ */ n("span", { className: "ds-item__hint", children: $.description })
1478
- ]
1480
+ label: h.componentVariations,
1481
+ value: k?.id ?? "",
1482
+ options: u.map((g) => ({ value: g.id, label: g.label })),
1483
+ onChange: (g) => p({ fixture: g })
1479
1484
  }
1480
- ) }, $.id)) })
1485
+ ) })
1481
1486
  ] });
1482
1487
  }
1483
- if (!s) return /* @__PURE__ */ n("p", { className: "ds-empty", children: f.nothingSelected });
1484
- const k = s.variations, T = e.product, E = T.theme?.modes ?? [], x = T.theme?.locales ?? [], w = T.dataSources?.adapters ?? [], b = t.screenControls ?? {}, N = o && Ct(o, b) ? o : void 0, S = (u, $) => h({ screenControls: { ...b, [u]: $ } });
1485
- return /* @__PURE__ */ C(q, { children: [
1486
- /* @__PURE__ */ n(ke, { id: "context", title: f.context, collapsed: m, onToggle: p, filtering: d, children: /* @__PURE__ */ C("div", { className: "ds-fields ds-fields--flush", children: [
1487
- /* @__PURE__ */ n(te, { label: f.persona, children: /* @__PURE__ */ C(
1488
- "select",
1488
+ if (!s) return /* @__PURE__ */ n("p", { className: "ds-empty", children: h.nothingSelected });
1489
+ const d = s.variations, f = e.product, S = f.theme?.modes ?? [], b = f.theme?.locales ?? [], L = f.dataSources?.adapters ?? [], T = t.screenControls ?? {}, N = o && xt(o, T) ? o : void 0, w = (u, k) => p({ screenControls: { ...T, [u]: k } });
1490
+ return /* @__PURE__ */ C("div", { className: "ds-vcards", children: [
1491
+ /* @__PURE__ */ C(le, { title: h.context, children: [
1492
+ /* @__PURE__ */ n(
1493
+ ee,
1489
1494
  {
1490
- className: "ds-select",
1495
+ label: h.persona,
1491
1496
  value: t.persona ?? "",
1492
- onChange: (u) => h({ persona: u.target.value || void 0 }),
1493
- children: [
1494
- !e.defaultPersona && /* @__PURE__ */ n("option", { value: "", children: f.none }),
1495
- T.personas.map((u) => /* @__PURE__ */ n("option", { value: u.id, children: u.name }, u.id))
1496
- ]
1497
+ options: [
1498
+ // Com persona padrão, "nenhuma" não é uma situação possível.
1499
+ ...e.defaultPersona ? [] : [{ value: "", label: h.none }],
1500
+ ...f.personas.map((u) => ({ value: u.id, label: u.name }))
1501
+ ],
1502
+ onChange: (u) => p({ persona: u || void 0 })
1497
1503
  }
1498
- ) }),
1499
- /* @__PURE__ */ n(te, { label: f.network, children: /* @__PURE__ */ n(
1500
- "select",
1504
+ ),
1505
+ /* @__PURE__ */ n(
1506
+ ee,
1501
1507
  {
1502
- className: "ds-select",
1508
+ label: h.network,
1503
1509
  value: t.network,
1504
- onChange: (u) => h({ network: u.target.value }),
1505
- children: He.map((u) => /* @__PURE__ */ n("option", { value: u, children: v.network[u] }, u))
1510
+ options: He.map((u) => ({ value: u, label: m.network[u] })),
1511
+ onChange: (u) => p({ network: u })
1506
1512
  }
1507
- ) }),
1508
- E.length > 1 && /* @__PURE__ */ n(te, { label: f.theme, children: /* @__PURE__ */ n(
1509
- "select",
1513
+ ),
1514
+ S.length > 1 && /* @__PURE__ */ n(
1515
+ ee,
1510
1516
  {
1511
- className: "ds-select",
1512
- value: t.themeMode ?? E[0],
1513
- onChange: (u) => h({ themeMode: u.target.value }),
1514
- children: E.map((u) => /* @__PURE__ */ n("option", { value: u, children: u }, u))
1517
+ label: h.theme,
1518
+ value: t.themeMode ?? S[0],
1519
+ options: S.map((u) => ({ value: u, label: u })),
1520
+ onChange: (u) => p({ themeMode: u })
1515
1521
  }
1516
- ) }),
1517
- x.length > 1 && /* @__PURE__ */ n(te, { label: f.locale, children: /* @__PURE__ */ n(
1518
- "select",
1522
+ ),
1523
+ b.length > 1 && /* @__PURE__ */ n(
1524
+ ee,
1519
1525
  {
1520
- className: "ds-select",
1521
- value: t.locale ?? x[0],
1522
- onChange: (u) => h({ locale: u.target.value }),
1523
- children: x.map((u) => /* @__PURE__ */ n("option", { value: u, children: u }, u))
1526
+ label: h.locale,
1527
+ value: t.locale ?? b[0],
1528
+ options: b.map((u) => ({ value: u, label: u })),
1529
+ onChange: (u) => p({ locale: u })
1524
1530
  }
1525
- ) }),
1526
- w.length > 0 && /* @__PURE__ */ n(te, { label: f.dataSource, children: /* @__PURE__ */ C(
1527
- "select",
1531
+ ),
1532
+ L.length > 0 && /* @__PURE__ */ n(
1533
+ ee,
1528
1534
  {
1529
- className: "ds-select",
1535
+ label: h.dataSource,
1530
1536
  value: t.dataSource ?? "fixtures",
1531
- onChange: (u) => h({ dataSource: u.target.value }),
1532
- children: [
1533
- /* @__PURE__ */ n("option", { value: "fixtures", children: f.fixturesOption }),
1534
- w.map((u) => /* @__PURE__ */ n("option", { value: u.id, children: u.label }, u.id))
1535
- ]
1537
+ options: [
1538
+ { value: "fixtures", label: h.fixturesOption },
1539
+ ...L.map((u) => ({ value: u.id, label: u.label }))
1540
+ ],
1541
+ onChange: (u) => p({ dataSource: u })
1536
1542
  }
1537
- ) })
1538
- ] }) }),
1543
+ )
1544
+ ] }),
1539
1545
  s.controls.map((u) => {
1540
- const $ = e.component(u.component);
1541
- return /* @__PURE__ */ C(
1542
- ke,
1546
+ const k = e.component(u.component);
1547
+ return /* @__PURE__ */ n(
1548
+ le,
1543
1549
  {
1544
- id: `group:${u.id}`,
1545
1550
  title: u.title,
1546
- count: u.controls.length,
1547
- collapsed: m,
1548
- onToggle: p,
1549
- filtering: d,
1550
- children: [
1551
- (u.note || $) && /* @__PURE__ */ C("div", { className: "ds-group-section__note", "data-ds-filter": !0, children: [
1552
- u.note && /* @__PURE__ */ n("span", { children: u.note }),
1553
- $ && /* @__PURE__ */ n("button", { type: "button", className: "ds-link", onClick: () => a($.id), children: f.openComponent($.name) })
1554
- ] }),
1555
- /* @__PURE__ */ n("div", { className: "ds-fields ds-fields--flush", children: u.controls.map((F) => /* @__PURE__ */ n(
1556
- jt,
1557
- {
1558
- control: F,
1559
- value: b[F.id] ?? ge(F),
1560
- onChange: (c) => S(F.id, c)
1561
- },
1562
- F.id
1563
- )) })
1564
- ]
1551
+ hint: u.note,
1552
+ link: k ? { label: h.openComponent(k.name), onOpen: () => a(k.id) } : void 0,
1553
+ children: u.controls.map((g) => /* @__PURE__ */ n(
1554
+ ee,
1555
+ {
1556
+ label: g.label,
1557
+ hint: g.description,
1558
+ value: T[g.id] ?? be(g),
1559
+ options: g.options ?? [],
1560
+ onChange: (y) => w(g.id, y)
1561
+ },
1562
+ g.id
1563
+ ))
1565
1564
  },
1566
1565
  u.id
1567
1566
  );
1568
1567
  }),
1569
- (k.length > 0 || s.controls.length === 0) && /* @__PURE__ */ n(
1570
- ke,
1571
- {
1572
- id: "shortcuts",
1573
- title: f.shortcuts,
1574
- count: k.length || void 0,
1575
- collapsed: m,
1576
- onToggle: p,
1577
- filtering: d,
1578
- children: /* @__PURE__ */ n("ul", { className: "ds-items", "aria-label": f.variationsList, children: k.length === 0 ? /* @__PURE__ */ n("li", { children: /* @__PURE__ */ C("div", { className: "ds-item ds-item--stacked", "aria-current": "true", children: [
1579
- /* @__PURE__ */ n("span", { className: "ds-item__title", children: f.defaultVariation }),
1580
- /* @__PURE__ */ n("span", { className: "ds-item__hint", children: f.defaultVariationHint })
1581
- ] }) }) : k.map((u) => /* @__PURE__ */ n("li", { "data-ds-filter": !0, children: /* @__PURE__ */ n(
1582
- "button",
1583
- {
1584
- type: "button",
1585
- className: "ds-item",
1586
- title: u.intent,
1587
- "aria-current": N?.id === u.id ? "true" : void 0,
1588
- onClick: () => l(u.id),
1589
- children: /* @__PURE__ */ n("span", { className: "ds-item__title", children: u.title })
1590
- }
1591
- ) }, u.id)) })
1592
- }
1593
- )
1594
- ] });
1595
- }
1596
- function ke({
1597
- id: e,
1598
- title: t,
1599
- count: s,
1600
- collapsed: o,
1601
- onToggle: r,
1602
- filtering: i,
1603
- children: l
1604
- }) {
1605
- const a = Q().panel, h = o.has(e) && !i;
1606
- return /* @__PURE__ */ C("section", { className: "ds-group-section", "data-ds-filter-group": !0, children: [
1607
- /* @__PURE__ */ C(
1568
+ d.length > 0 && /* @__PURE__ */ n(le, { title: h.shortcuts, children: /* @__PURE__ */ n("ul", { className: "ds-items", "aria-label": h.variationsList, children: d.map((u) => /* @__PURE__ */ n("li", { "data-ds-filter": !0, children: /* @__PURE__ */ n(
1608
1569
  "button",
1609
1570
  {
1610
1571
  type: "button",
1611
- className: "ds-group-section__head",
1612
- "aria-expanded": !h,
1613
- "aria-label": a.toggleGroup(t),
1614
- onClick: () => r(e),
1615
- children: [
1616
- /* @__PURE__ */ n(H, { name: "chevron", size: 12 }),
1617
- /* @__PURE__ */ n("span", { "data-ds-filter-title": !0, children: t }),
1618
- s !== void 0 && /* @__PURE__ */ n("span", { className: "ds-count", children: s })
1619
- ]
1572
+ className: "ds-item",
1573
+ title: u.intent,
1574
+ "aria-current": N?.id === u.id ? "true" : void 0,
1575
+ onClick: () => l(u.id),
1576
+ children: /* @__PURE__ */ n("span", { className: "ds-item__title", children: u.title })
1620
1577
  }
1621
- ),
1622
- !h && l
1578
+ ) }, u.id)) }) })
1623
1579
  ] });
1624
1580
  }
1625
- function Bt(e) {
1626
- const t = e.options ?? [], s = t.reduce((o, r) => o + r.label.length, 0);
1627
- return t.length > 0 && t.length <= 4 && s <= 24;
1581
+ function le({
1582
+ title: e,
1583
+ hint: t,
1584
+ link: s,
1585
+ children: o
1586
+ }) {
1587
+ return /* @__PURE__ */ C("section", { className: "ds-vcard", "data-ds-filter-group": !0, children: [
1588
+ /* @__PURE__ */ C("header", { className: "ds-vcard__head", title: t ? `${e} — ${t}` : e, children: [
1589
+ /* @__PURE__ */ n("h3", { className: "ds-vcard__title ds-section__title", "data-ds-filter-title": !0, children: e }),
1590
+ s && /* @__PURE__ */ n(
1591
+ "button",
1592
+ {
1593
+ type: "button",
1594
+ className: "ds-btn ds-btn--icon ds-vcard__link",
1595
+ "aria-label": s.label,
1596
+ title: s.label,
1597
+ onClick: s.onOpen,
1598
+ children: /* @__PURE__ */ n(H, { name: "arrow-up-right", size: 14 })
1599
+ }
1600
+ )
1601
+ ] }),
1602
+ /* @__PURE__ */ n("div", { className: "ds-vcard__body", children: o })
1603
+ ] });
1628
1604
  }
1629
- function jt({
1630
- control: e,
1631
- value: t,
1632
- onChange: s
1605
+ function ee({
1606
+ label: e,
1607
+ hint: t,
1608
+ value: s,
1609
+ options: o,
1610
+ onChange: r
1633
1611
  }) {
1634
- const o = e.options ?? [];
1635
- return Bt(e) ? /* @__PURE__ */ C("div", { className: "ds-field", "data-ds-filter": !0, children: [
1636
- /* @__PURE__ */ n("span", { className: "ds-field__label", id: `ds-control-${e.id}`, children: e.label }),
1637
- /* @__PURE__ */ n("div", { className: "ds-tabs ds-tabs--segmented", role: "radiogroup", "aria-labelledby": `ds-control-${e.id}`, children: o.map((r) => /* @__PURE__ */ n(
1638
- "button",
1639
- {
1640
- type: "button",
1641
- role: "radio",
1642
- className: "ds-tab",
1643
- "aria-checked": r.value === t,
1644
- tabIndex: r.value === t ? 0 : -1,
1645
- onClick: () => s(r.value),
1646
- children: r.label
1647
- },
1648
- r.value
1649
- )) }),
1650
- e.description && /* @__PURE__ */ n("span", { className: "ds-field__hint", children: e.description })
1651
- ] }) : /* @__PURE__ */ n(te, { label: e.label, hint: e.description, children: /* @__PURE__ */ n("select", { className: "ds-select", value: t, onChange: (r) => s(r.target.value), children: o.map((r) => /* @__PURE__ */ n("option", { value: r.value, children: r.label }, r.value)) }) });
1652
- }
1653
- function te({ label: e, hint: t, children: s }) {
1654
- return /* @__PURE__ */ C("label", { className: "ds-field", "data-ds-filter": !0, children: [
1655
- /* @__PURE__ */ n("span", { className: "ds-field__label", children: e }),
1656
- s,
1657
- t && /* @__PURE__ */ n("span", { className: "ds-field__hint", children: t })
1612
+ return /* @__PURE__ */ C("label", { className: "ds-vcard__field", "data-ds-filter": !0, title: t ? `${e} — ${t}` : e, children: [
1613
+ /* @__PURE__ */ n("span", { className: "ds-visually-hidden", children: e }),
1614
+ /* @__PURE__ */ n("select", { className: "ds-select", value: s, onChange: (i) => r(i.target.value), children: o.map((i) => /* @__PURE__ */ n("option", { value: i.value, children: i.label }, i.value)) })
1658
1615
  ] });
1659
1616
  }
1660
- function qt({
1617
+ function Gt({
1661
1618
  registry: e,
1662
1619
  controls: t,
1663
1620
  deploy: s,
@@ -1666,100 +1623,100 @@ function qt({
1666
1623
  variation: i,
1667
1624
  component: l,
1668
1625
  onOpenScenario: a,
1669
- onOpenComponent: h,
1626
+ onOpenComponent: p,
1670
1627
  onOpenScreen: m
1671
1628
  }) {
1672
- const p = Q(), d = p.info, [v, f] = K(!1);
1629
+ const h = J(), d = h.info, [f, S] = V(!1);
1673
1630
  if (l) {
1674
- const S = e.usagesOf(l.id, { handoff: t.handoff });
1631
+ const g = e.usagesOf(l.id, { handoff: t.handoff });
1675
1632
  return /* @__PURE__ */ C("div", { className: "ds-info", children: [
1676
- /* @__PURE__ */ C(ee, { title: d.component, children: [
1633
+ /* @__PURE__ */ C(te, { title: d.component, children: [
1677
1634
  /* @__PURE__ */ n(W, { term: d.name, children: l.name }),
1678
1635
  /* @__PURE__ */ n(W, { term: d.id, children: /* @__PURE__ */ n("code", { children: l.id }) }),
1679
1636
  l.group && /* @__PURE__ */ n(W, { term: d.group, children: l.group }),
1680
1637
  l.description && /* @__PURE__ */ n(W, { term: d.description, children: l.description }),
1681
1638
  l.source && /* @__PURE__ */ n(W, { term: d.source, children: /* @__PURE__ */ n("code", { children: l.source }) })
1682
1639
  ] }),
1683
- /* @__PURE__ */ n(ee, { title: d.usedIn, children: S.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-muted", children: d.notUsed }) : /* @__PURE__ */ n("ul", { className: "ds-links", children: S.map((u) => {
1684
- const $ = u.variations.find((F) => F.components?.includes(l.id)) ?? u.variations[0];
1640
+ /* @__PURE__ */ n(te, { title: d.usedIn, children: g.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-muted", children: d.notUsed }) : /* @__PURE__ */ n("ul", { className: "ds-links", children: g.map((y) => {
1641
+ const _ = y.variations.find((z) => z.components?.includes(l.id)) ?? y.variations[0];
1685
1642
  return /* @__PURE__ */ C("li", { "data-ds-filter": !0, children: [
1686
1643
  /* @__PURE__ */ n(
1687
1644
  "button",
1688
1645
  {
1689
1646
  type: "button",
1690
1647
  className: "ds-link",
1691
- onClick: () => $ ? a($.id) : m?.(u.id),
1692
- children: u.name
1648
+ onClick: () => _ ? a(_.id) : m?.(y.id),
1649
+ children: y.name
1693
1650
  }
1694
1651
  ),
1695
- /* @__PURE__ */ n("code", { className: "ds-muted", children: u.id })
1696
- ] }, u.id);
1652
+ /* @__PURE__ */ n("code", { className: "ds-muted", children: y.id })
1653
+ ] }, y.id);
1697
1654
  }) }) })
1698
1655
  ] });
1699
1656
  }
1700
- if (!r) return /* @__PURE__ */ n("p", { className: "ds-empty", children: p.panel.nothingSelected });
1701
- const k = i ? e.componentsOfScreen(r, i) : e.componentsOfScreen(r), T = e.persona(t.persona ?? i?.persona), E = e.rulesOf(i), x = t.screenControls ?? {}, w = i?.expected?.length ? i.expected : r.route.expected, b = t.handoff ? { handoff: t.handoff } : void 0, N = async () => {
1702
- const S = r.group ? e.flowOf(r, { handoff: t.handoff }) : void 0, u = S?.name ? It({
1703
- flow: { name: S.name, screens: S.screens },
1657
+ if (!r) return /* @__PURE__ */ n("p", { className: "ds-empty", children: h.panel.nothingSelected });
1658
+ const b = i ? e.componentsOfScreen(r, i) : e.componentsOfScreen(r), L = e.persona(t.persona ?? i?.persona), T = e.rulesOf(i), N = t.screenControls ?? {}, w = i?.expected?.length ? i.expected : r.route.expected, u = t.handoff ? { handoff: t.handoff } : void 0, k = async () => {
1659
+ const g = r.group ? e.flowOf(r, { handoff: t.handoff }) : void 0, y = g?.name ? Bt({
1660
+ flow: { name: g.name, screens: g.screens },
1704
1661
  registry: e,
1705
1662
  open: { screen: r, location: o, variation: i },
1706
1663
  deploy: s,
1707
- labels: p,
1708
- overrides: b
1709
- }) : Ut({
1664
+ labels: h,
1665
+ overrides: u
1666
+ }) : Ht({
1710
1667
  screen: r,
1711
1668
  variations: r.variations,
1712
1669
  components: e.componentsOfScreen(r),
1713
1670
  deploy: s,
1714
- labels: p,
1715
- overrides: b
1671
+ labels: h,
1672
+ overrides: u
1716
1673
  });
1717
1674
  try {
1718
- await navigator.clipboard.writeText(u);
1675
+ await navigator.clipboard.writeText(y);
1719
1676
  } catch {
1720
- window.prompt(d.copyPrompt, u);
1677
+ window.prompt(d.copyPrompt, y);
1721
1678
  }
1722
- f(!0), window.setTimeout(() => f(!1), 1600);
1679
+ S(!0), window.setTimeout(() => S(!1), 1600);
1723
1680
  };
1724
1681
  return /* @__PURE__ */ C("div", { className: "ds-info", children: [
1725
- /* @__PURE__ */ C(ee, { title: d.screen, children: [
1682
+ /* @__PURE__ */ C(te, { title: d.screen, children: [
1726
1683
  /* @__PURE__ */ n(W, { term: d.name, children: r.name }),
1727
1684
  /* @__PURE__ */ n(W, { term: d.route, children: /* @__PURE__ */ n("code", { children: r.route.path }) }),
1728
1685
  r.group && /* @__PURE__ */ n(W, { term: d.flow, children: r.group }),
1729
1686
  r.description && /* @__PURE__ */ n(W, { term: d.description, children: r.description }),
1730
- /* @__PURE__ */ n(le, { term: d.expected, items: w })
1687
+ /* @__PURE__ */ n(de, { term: d.expected, items: w })
1731
1688
  ] }),
1732
- r.controls.length > 0 && /* @__PURE__ */ n(ee, { title: d.controls, children: r.controls.flatMap(
1733
- (S) => S.controls.map((u) => {
1734
- const $ = x[u.id] ?? ge(u), F = u.options.find((c) => c.value === $);
1735
- return /* @__PURE__ */ C(W, { term: u.label, children: [
1736
- F?.label ?? $,
1689
+ r.controls.length > 0 && /* @__PURE__ */ n(te, { title: d.controls, children: r.controls.flatMap(
1690
+ (g) => g.controls.map((y) => {
1691
+ const _ = N[y.id] ?? be(y), z = y.options.find((c) => c.value === _);
1692
+ return /* @__PURE__ */ C(W, { term: y.label, children: [
1693
+ z?.label ?? _,
1737
1694
  " ",
1738
- /* @__PURE__ */ n("code", { children: `c.${u.id}=${$}` })
1739
- ] }, `${S.id}/${u.id}`);
1695
+ /* @__PURE__ */ n("code", { children: `c.${y.id}=${_}` })
1696
+ ] }, `${g.id}/${y.id}`);
1740
1697
  })
1741
1698
  ) }),
1742
- i && /* @__PURE__ */ C(ee, { title: d.variation, children: [
1699
+ i && /* @__PURE__ */ C(te, { title: d.variation, children: [
1743
1700
  /* @__PURE__ */ n(W, { term: d.name, children: i.title }),
1744
1701
  /* @__PURE__ */ n(W, { term: d.id, children: /* @__PURE__ */ n("code", { children: i.id }) }),
1745
- T && /* @__PURE__ */ n(W, { term: d.persona, children: T.name }),
1702
+ L && /* @__PURE__ */ n(W, { term: d.persona, children: L.name }),
1746
1703
  i.intent && /* @__PURE__ */ n(W, { term: d.intent, children: i.intent }),
1747
- /* @__PURE__ */ n(le, { term: d.preconditions, items: i.preconditions }),
1748
- /* @__PURE__ */ n(le, { term: d.actions, items: i.actions }),
1749
- /* @__PURE__ */ n(le, { term: d.rules, items: E.map((S) => S.statement) }),
1704
+ /* @__PURE__ */ n(de, { term: d.preconditions, items: i.preconditions }),
1705
+ /* @__PURE__ */ n(de, { term: d.actions, items: i.actions }),
1706
+ /* @__PURE__ */ n(de, { term: d.rules, items: T.map((g) => g.statement) }),
1750
1707
  i.ticket && /* @__PURE__ */ n(W, { term: d.ticket, children: /* @__PURE__ */ n("code", { children: i.ticket }) })
1751
1708
  ] }),
1752
- k.length > 0 && /* @__PURE__ */ n(ee, { title: d.components, children: /* @__PURE__ */ n("ul", { className: "ds-links", children: k.map((S) => /* @__PURE__ */ C("li", { "data-ds-filter": !0, children: [
1753
- /* @__PURE__ */ n("button", { type: "button", className: "ds-link", onClick: () => h(S.id), children: S.name }),
1754
- S.source && /* @__PURE__ */ n("code", { className: "ds-muted", children: S.source })
1755
- ] }, S.id)) }) }),
1756
- /* @__PURE__ */ C("button", { type: "button", className: "ds-btn ds-btn--block", onClick: N, children: [
1757
- /* @__PURE__ */ n(H, { name: v ? "check" : "copy", size: 14 }),
1758
- /* @__PURE__ */ n("span", { children: v ? d.copiedForPr : d.copyForPr })
1709
+ b.length > 0 && /* @__PURE__ */ n(te, { title: d.components, children: /* @__PURE__ */ n("ul", { className: "ds-links", children: b.map((g) => /* @__PURE__ */ C("li", { "data-ds-filter": !0, children: [
1710
+ /* @__PURE__ */ n("button", { type: "button", className: "ds-link", onClick: () => p(g.id), children: g.name }),
1711
+ g.source && /* @__PURE__ */ n("code", { className: "ds-muted", children: g.source })
1712
+ ] }, g.id)) }) }),
1713
+ /* @__PURE__ */ C("button", { type: "button", className: "ds-btn ds-btn--block", onClick: k, children: [
1714
+ /* @__PURE__ */ n(H, { name: f ? "check" : "copy", size: 14 }),
1715
+ /* @__PURE__ */ n("span", { children: f ? d.copiedForPr : d.copyForPr })
1759
1716
  ] })
1760
1717
  ] });
1761
1718
  }
1762
- function ee({ title: e, children: t }) {
1719
+ function te({ title: e, children: t }) {
1763
1720
  return /* @__PURE__ */ C("section", { className: "ds-section", "data-ds-filter-group": !0, children: [
1764
1721
  /* @__PURE__ */ n("h2", { className: "ds-section__title", children: e }),
1765
1722
  /* @__PURE__ */ n("div", { className: "ds-defs", children: t })
@@ -1771,16 +1728,16 @@ function W({ term: e, children: t }) {
1771
1728
  /* @__PURE__ */ n("dd", { children: t })
1772
1729
  ] });
1773
1730
  }
1774
- function le({ term: e, items: t }) {
1731
+ function de({ term: e, items: t }) {
1775
1732
  return t?.length ? /* @__PURE__ */ C("dl", { className: "ds-def", "data-ds-filter": !0, children: [
1776
1733
  /* @__PURE__ */ n("dt", { children: e }),
1777
1734
  /* @__PURE__ */ n("dd", { children: /* @__PURE__ */ n("ul", { className: "ds-list", children: t.map((s) => /* @__PURE__ */ n("li", { children: s }, s)) }) })
1778
1735
  ] }) : null;
1779
1736
  }
1780
- function Gt(e) {
1737
+ function Zt(e) {
1781
1738
  return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "f";
1782
1739
  }
1783
- function Zt(e, t) {
1740
+ function Yt(e, t) {
1784
1741
  if (!e) return !1;
1785
1742
  const s = X(t), o = [...e.querySelectorAll("[data-ds-filter]")];
1786
1743
  for (const r of o)
@@ -1798,8 +1755,8 @@ function Zt(e, t) {
1798
1755
  }
1799
1756
  return s.length > 0 && o.length > 0 && o.every((r) => r.hidden);
1800
1757
  }
1801
- const Yt = 24;
1802
- function Xt({
1758
+ const Xt = 24;
1759
+ function Qt({
1803
1760
  location: e,
1804
1761
  viewport: t,
1805
1762
  zoom: s,
@@ -1809,77 +1766,77 @@ function Xt({
1809
1766
  onShortcut: l,
1810
1767
  onEffectiveZoom: a
1811
1768
  }) {
1812
- const h = G(null), m = G(null), p = Qt(h), d = de(e.path, e.search), [v] = K(d), f = G(d), k = G(d), T = typeof window > "u" ? "" : window.location.origin, E = U(
1813
- (g) => {
1814
- k.current = g;
1815
- const y = m.current?.contentWindow;
1769
+ const p = q(null), m = q(null), h = Jt(p), d = ue(e.path, e.search), [f] = V(d), S = q(d), b = q(d), L = typeof window > "u" ? "" : window.location.origin, T = U(
1770
+ (v) => {
1771
+ b.current = v;
1772
+ const x = m.current?.contentWindow;
1816
1773
  try {
1817
- y?.location.replace(new URL(g, T).toString());
1774
+ x?.location.replace(new URL(v, L).toString());
1818
1775
  } catch {
1819
- m.current && (m.current.src = g);
1776
+ m.current && (m.current.src = v);
1820
1777
  }
1821
1778
  },
1822
- [T]
1779
+ [L]
1823
1780
  );
1824
1781
  I(() => {
1825
- if (d === f.current) return;
1826
- const g = f.current;
1827
- f.current = d, _e(g) !== _e(d) ? E(d) : ae(m.current?.contentWindow, { ds: 1, type: "location", url: d }, T);
1828
- }, [d, E, T]), I(() => {
1829
- const g = (y) => {
1830
- const L = Be(y, {
1831
- origin: T,
1782
+ if (d === S.current) return;
1783
+ const v = S.current;
1784
+ S.current = d, _e(v) !== _e(d) ? T(d) : ae(m.current?.contentWindow, { ds: 1, type: "location", url: d }, L);
1785
+ }, [d, T, L]), I(() => {
1786
+ const v = (x) => {
1787
+ const M = Be(x, {
1788
+ origin: L,
1832
1789
  source: m.current?.contentWindow
1833
1790
  });
1834
- if (L)
1835
- switch (L.type) {
1791
+ if (M)
1792
+ switch (M.type) {
1836
1793
  case "ready": {
1837
- if (L.url === f.current) return;
1838
- if (L.url === k.current) {
1794
+ if (M.url === S.current) return;
1795
+ if (M.url === b.current) {
1839
1796
  ae(
1840
1797
  m.current?.contentWindow,
1841
- { ds: 1, type: "location", url: f.current },
1842
- T
1798
+ { ds: 1, type: "location", url: S.current },
1799
+ L
1843
1800
  );
1844
1801
  return;
1845
1802
  }
1846
- f.current = L.url, k.current = L.url, i(L.url, !0);
1803
+ S.current = M.url, b.current = M.url, i(M.url, !0);
1847
1804
  return;
1848
1805
  }
1849
1806
  case "navigate":
1850
- f.current = L.url, i(L.url, L.replace);
1807
+ S.current = M.url, i(M.url, M.replace);
1851
1808
  return;
1852
1809
  case "shortcut":
1853
- l(L.key);
1810
+ l(M.key);
1854
1811
  return;
1855
1812
  default:
1856
1813
  return;
1857
1814
  }
1858
1815
  };
1859
- return window.addEventListener("message", g), () => window.removeEventListener("message", g);
1860
- }, [i, l, T]);
1861
- const x = !!t.width, w = x ? Yt : 0, b = Math.max(0, p.width - w * 2), N = Math.max(0, p.height - w * 2), S = !t.width || b === 0 || t.width <= b, u = s === 100 && !S ? Math.max(10, Math.floor(b / t.width * 100)) : s, $ = u / 100;
1816
+ return window.addEventListener("message", v), () => window.removeEventListener("message", v);
1817
+ }, [i, l, L]);
1818
+ const N = !!t.width, w = N ? Xt : 0, u = Math.max(0, h.width - w * 2), k = Math.max(0, h.height - w * 2), g = !t.width || u === 0 || t.width <= u, y = s === 100 && !g ? Math.max(10, Math.floor(u / t.width * 100)) : s, _ = y / 100;
1862
1819
  I(() => {
1863
- a?.(u);
1864
- }, [u, a]);
1865
- const F = t.width ?? b / $, c = t.height ?? N / $;
1866
- return /* @__PURE__ */ n("div", { className: "ds-canvas", ref: h, "data-fit": x ? void 0 : "true", children: /* @__PURE__ */ n(
1820
+ a?.(y);
1821
+ }, [y, a]);
1822
+ const z = t.width ?? u / _, c = t.height ?? k / _;
1823
+ return /* @__PURE__ */ n("div", { className: "ds-canvas", ref: p, "data-fit": N ? void 0 : "true", children: /* @__PURE__ */ n(
1867
1824
  "div",
1868
1825
  {
1869
1826
  className: "ds-canvas__box",
1870
- style: { width: Math.floor(F * $), height: Math.floor(c * $) },
1827
+ style: { width: Math.floor(z * _), height: Math.floor(c * _) },
1871
1828
  children: /* @__PURE__ */ n(
1872
1829
  "iframe",
1873
1830
  {
1874
1831
  ref: m,
1875
- [ft]: "",
1832
+ [vt]: "",
1876
1833
  className: "ds-frame",
1877
- src: v,
1834
+ src: f,
1878
1835
  title: o,
1879
1836
  style: {
1880
- width: Math.floor(F),
1837
+ width: Math.floor(z),
1881
1838
  height: Math.floor(c),
1882
- transform: $ === 1 ? void 0 : `scale(${$})`,
1839
+ transform: _ === 1 ? void 0 : `scale(${_})`,
1883
1840
  pointerEvents: r ? "none" : void 0
1884
1841
  }
1885
1842
  }
@@ -1887,15 +1844,15 @@ function Xt({
1887
1844
  }
1888
1845
  ) });
1889
1846
  }
1890
- function Qt(e) {
1891
- const [t, s] = K({ width: 0, height: 0 });
1847
+ function Jt(e) {
1848
+ const [t, s] = V({ width: 0, height: 0 });
1892
1849
  return Ue(() => {
1893
1850
  const o = e.current;
1894
1851
  if (!o) return;
1895
1852
  const r = () => {
1896
1853
  const l = o.clientWidth, a = o.clientHeight;
1897
1854
  s(
1898
- (h) => h.width === l && h.height === a ? h : { width: l, height: a }
1855
+ (p) => p.width === l && p.height === a ? p : { width: l, height: a }
1899
1856
  );
1900
1857
  };
1901
1858
  if (r(), typeof ResizeObserver > "u")
@@ -1927,35 +1884,35 @@ const Le = {
1927
1884
  return new Promise(() => {
1928
1885
  });
1929
1886
  case "slow":
1930
- return await Jt(Je), Me(t);
1887
+ return await en(Je), Me(t);
1931
1888
  default:
1932
1889
  return Me(t);
1933
1890
  }
1934
1891
  }
1935
1892
  };
1936
- function hn(e) {
1893
+ function pn(e) {
1937
1894
  const { id: t, label: s, baseUrl: o, path: r, init: i, fallbackToFixture: l = !0 } = e;
1938
1895
  return {
1939
1896
  id: t,
1940
1897
  label: s,
1941
1898
  load: async (a) => {
1942
- const h = new URL(r ? r(a) : a.scenario.route, o);
1899
+ const p = new URL(r ? r(a) : a.scenario.route, o);
1943
1900
  try {
1944
- const m = await fetch(h, i);
1901
+ const m = await fetch(p, i);
1945
1902
  if (!m.ok) throw new Error(`${m.status} ${m.statusText}`);
1946
1903
  return await m.json();
1947
1904
  } catch (m) {
1948
1905
  if (l) return Me(a.fixture);
1949
- throw new Error(`Adapter "${t}" falhou em ${h.toString()}`, { cause: m });
1906
+ throw new Error(`Adapter "${t}" falhou em ${p.toString()}`, { cause: m });
1950
1907
  }
1951
1908
  }
1952
1909
  };
1953
1910
  }
1954
- function Jt(e) {
1911
+ function en(e) {
1955
1912
  return new Promise((t) => setTimeout(t, e));
1956
1913
  }
1957
- function en(e) {
1958
- const { scenario: t, fixture: s, network: o, adapter: r } = e, [i, l] = K({
1914
+ function tn(e) {
1915
+ const { scenario: t, fixture: s, network: o, adapter: r } = e, [i, l] = V({
1959
1916
  data: void 0,
1960
1917
  isLoading: !!t || o === "loading" || o === "slow",
1961
1918
  error: void 0
@@ -1990,8 +1947,8 @@ function en(e) {
1990
1947
  }
1991
1948
  let a = !0;
1992
1949
  l({ data: void 0, isLoading: !0, error: void 0 });
1993
- const h = r ?? Le;
1994
- return Promise.resolve(h.load({ scenario: t, fixture: s, network: o })).then((m) => {
1950
+ const p = r ?? Le;
1951
+ return Promise.resolve(p.load({ scenario: t, fixture: s, network: o })).then((m) => {
1995
1952
  a && l({ data: m, isLoading: !1, error: void 0 });
1996
1953
  }).catch((m) => {
1997
1954
  a && l({
@@ -2010,15 +1967,15 @@ function De({ title: e, children: t }) {
2010
1967
  t
2011
1968
  ] });
2012
1969
  }
2013
- function tn({ product: e, registry: t }) {
2014
- const s = Q(), { location: o, controls: r, viewport: i, navigate: l, openScenario: a, setScreenControls: h } = Ge(
1970
+ function nn({ product: e, registry: t }) {
1971
+ const s = J(), { location: o, controls: r, viewport: i, navigate: l, openScenario: a, setScreenControls: p } = Ge(
2015
1972
  t,
2016
1973
  { frame: !0 }
2017
- ), m = G(null);
1974
+ ), m = q(null);
2018
1975
  I(() => {
2019
- const P = (z) => {
2020
- if (z.defaultPrevented || z.button !== 0 || z.metaKey || z.ctrlKey || z.shiftKey || z.altKey) return;
2021
- const A = z.target?.closest?.("a[href]");
1976
+ const P = (O) => {
1977
+ if (O.defaultPrevented || O.button !== 0 || O.metaKey || O.ctrlKey || O.shiftKey || O.altKey) return;
1978
+ const A = O.target?.closest?.("a[href]");
2022
1979
  if (!(A instanceof HTMLAnchorElement) || A.target && A.target !== "_self" || A.hasAttribute("download")) return;
2023
1980
  const j = A.getAttribute("href") ?? "";
2024
1981
  if (j.startsWith("#")) return;
@@ -2028,115 +1985,115 @@ function tn({ product: e, registry: t }) {
2028
1985
  } catch {
2029
1986
  return;
2030
1987
  }
2031
- B.origin === window.location.origin && (z.preventDefault(), l(`${B.pathname}${B.search}`));
1988
+ B.origin === window.location.origin && (O.preventDefault(), l(`${B.pathname}${B.search}`));
2032
1989
  };
2033
1990
  return document.addEventListener("click", P), () => document.removeEventListener("click", P);
2034
1991
  }, [l]), I(() => {
2035
- const P = (z) => {
1992
+ const P = (O) => {
2036
1993
  if (window.parent === window) return;
2037
- const A = nn(z);
1994
+ const A = on(O);
2038
1995
  if (!A) return;
2039
- const j = z.target;
2040
- A === "C" && j?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (z.preventDefault(), ae(window.parent, { ds: 1, type: "shortcut", key: A }, window.location.origin));
1996
+ const j = O.target;
1997
+ A === "C" && j?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (O.preventDefault(), ae(window.parent, { ds: 1, type: "shortcut", key: A }, window.location.origin));
2041
1998
  };
2042
1999
  return window.addEventListener("keydown", P), () => window.removeEventListener("keydown", P);
2043
2000
  }, []), I(() => {
2044
2001
  const P = m.current;
2045
2002
  if (!P || !r.handoff) return;
2046
- const z = () => {
2003
+ const O = () => {
2047
2004
  for (const j of P.querySelectorAll("a[href]")) {
2048
2005
  const B = j.getAttribute("href");
2049
2006
  if (!B || B.startsWith("#")) continue;
2050
- let J;
2007
+ let Q;
2051
2008
  try {
2052
- J = new URL(B, window.location.href);
2009
+ Q = new URL(B, window.location.href);
2053
2010
  } catch {
2054
2011
  continue;
2055
2012
  }
2056
- if (J.origin !== window.location.origin) continue;
2057
- Te(J.searchParams, r.handoff);
2058
- const ie = `${J.pathname}${J.search}${J.hash}`;
2013
+ if (Q.origin !== window.location.origin) continue;
2014
+ Pe(Q.searchParams, r.handoff);
2015
+ const ie = `${Q.pathname}${Q.search}${Q.hash}`;
2059
2016
  B !== ie && j.setAttribute("href", ie);
2060
2017
  }
2061
2018
  };
2062
- z();
2063
- const A = new MutationObserver(z);
2019
+ O();
2020
+ const A = new MutationObserver(O);
2064
2021
  return A.observe(P, { subtree: !0, childList: !0, attributes: !0, attributeFilter: ["href"] }), () => A.disconnect();
2065
2022
  }, [r.handoff]);
2066
- const p = t.scenario(r.scenario), d = t.component(r.component), v = D(() => {
2023
+ const h = t.scenario(r.scenario), d = t.component(r.component), f = D(() => {
2067
2024
  const P = new URLSearchParams(o.search);
2068
2025
  return {
2069
- scenario: P.get(M.scenario) ?? void 0,
2070
- component: P.get(M.component) ?? void 0
2026
+ scenario: P.get($.scenario) ?? void 0,
2027
+ component: P.get($.component) ?? void 0
2071
2028
  };
2072
- }, [o.search]), f = !!(r.handoff && (v.scenario && !oe(r.handoff, v.scenario) || v.component && !ve(r.handoff, v.component) || !v.component && !Ie(r.handoff, o.path, e.scenarios))), k = D(
2029
+ }, [o.search]), S = !!(r.handoff && (f.scenario && !oe(r.handoff, f.scenario) || f.component && !ve(r.handoff, f.component) || !f.component && !Ie(r.handoff, o.path, e.scenarios))), b = D(
2073
2030
  () => t.resolveComponentFixture(d?.id, d ? r.fixture : void 0),
2074
2031
  [d, r.fixture, t]
2075
- ), T = D(() => {
2076
- const P = k.fixture?.data;
2032
+ ), L = D(() => {
2033
+ const P = b.fixture?.data;
2077
2034
  return typeof P == "function" ? P() : P;
2078
- }, [k.fixture]), E = t.persona(r.persona ?? p?.persona), x = t.fixture(r.fixture ?? p?.fixture), w = D(() => {
2035
+ }, [b.fixture]), T = t.persona(r.persona ?? h?.persona), N = t.fixture(r.fixture ?? h?.fixture), w = D(() => {
2079
2036
  const P = r.dataSource ?? "fixtures";
2080
- return P === "fixtures" ? Le : e.dataSources?.adapters?.find((z) => z.id === P) ?? Le;
2081
- }, [r.dataSource, e.dataSources?.adapters]), { data: b, isLoading: N, error: S } = en({
2082
- scenario: p,
2083
- fixture: x,
2037
+ return P === "fixtures" ? Le : e.dataSources?.adapters?.find((O) => O.id === P) ?? Le;
2038
+ }, [r.dataSource, e.dataSources?.adapters]), { data: u, isLoading: k, error: g } = tn({
2039
+ scenario: h,
2040
+ fixture: N,
2084
2041
  network: r.network,
2085
2042
  adapter: w,
2086
2043
  screen: o.path
2087
- }), u = D(() => p ? r.persona && r.persona !== (p.persona ?? t.defaultPersona) ? t.persona(r.persona)?.permissions ?? [] : t.permissionsOf(p) : t.persona(r.persona)?.permissions ?? [], [r.persona, t, p]), $ = r.screenControls, F = D(() => $ ?? {}, [$]), c = U(
2088
- (P, z) => h({ [P]: z }),
2089
- [h]
2090
- ), g = D(
2044
+ }), y = D(() => h ? r.persona && r.persona !== (h.persona ?? t.defaultPersona) ? t.persona(r.persona)?.permissions ?? [] : t.permissionsOf(h) : t.persona(r.persona)?.permissions ?? [], [r.persona, t, h]), _ = r.screenControls, z = D(() => _ ?? {}, [_]), c = U(
2045
+ (P, O) => p({ [P]: O }),
2046
+ [p]
2047
+ ), v = D(
2091
2048
  () => ({
2092
- scenario: p,
2093
- persona: E,
2094
- permissions: u,
2095
- can: (P) => u.includes(P),
2096
- data: b,
2097
- fixture: x,
2049
+ scenario: h,
2050
+ persona: T,
2051
+ permissions: y,
2052
+ can: (P) => y.includes(P),
2053
+ data: u,
2054
+ fixture: N,
2098
2055
  network: r.network,
2099
- isLoading: N,
2100
- error: S,
2101
- rules: t.rulesOf(p),
2056
+ isLoading: k,
2057
+ error: g,
2058
+ rules: t.rulesOf(h),
2102
2059
  viewport: i,
2103
2060
  themeMode: r.themeMode,
2104
2061
  locale: r.locale,
2105
2062
  navigate: l,
2106
2063
  openScenario: a,
2107
- controls: F,
2064
+ controls: z,
2108
2065
  setControl: c,
2109
- setControls: h
2066
+ setControls: p
2110
2067
  }),
2111
2068
  [
2112
- p,
2113
- E,
2069
+ h,
2070
+ T,
2071
+ y,
2114
2072
  u,
2115
- b,
2116
- x,
2073
+ N,
2117
2074
  r.network,
2118
2075
  r.themeMode,
2119
2076
  r.locale,
2120
- N,
2121
- S,
2077
+ k,
2078
+ g,
2122
2079
  t,
2123
2080
  i,
2124
2081
  l,
2125
2082
  a,
2126
- F,
2083
+ z,
2127
2084
  c,
2128
- h
2085
+ p
2129
2086
  ]
2130
- ), y = Ne(e.routes ?? [], o.path), L = e.wrapper, O = e.notFound, R = d?.preview, V = f ? /* @__PURE__ */ n(De, { title: s.shell.outsideHandoff, children: /* @__PURE__ */ n("p", { children: s.shell.outsideHandoffHint }) }) : R ? /* @__PURE__ */ n(
2131
- R,
2087
+ ), x = xe(e.routes ?? [], o.path), M = e.wrapper, F = e.notFound, E = d?.preview, K = S ? /* @__PURE__ */ n(De, { title: s.shell.outsideHandoff, children: /* @__PURE__ */ n("p", { children: s.shell.outsideHandoffHint }) }) : E ? /* @__PURE__ */ n(
2088
+ E,
2132
2089
  {
2133
- fixture: k.fixture,
2134
- data: T,
2090
+ fixture: b.fixture,
2091
+ data: L,
2135
2092
  viewport: i,
2136
2093
  themeMode: r.themeMode ?? "default",
2137
2094
  locale: r.locale ?? "default"
2138
2095
  }
2139
- ) : y ? /* @__PURE__ */ n(y.definition.screen, { params: y.params, context: g }) : O ? /* @__PURE__ */ n(O, { path: o.path }) : /* @__PURE__ */ n(De, { title: s.shell.noRoute, children: /* @__PURE__ */ C("p", { children: [
2096
+ ) : x ? /* @__PURE__ */ n(x.definition.screen, { params: x.params, context: v }) : F ? /* @__PURE__ */ n(F, { path: o.path }) : /* @__PURE__ */ n(De, { title: s.shell.noRoute, children: /* @__PURE__ */ C("p", { children: [
2140
2097
  /* @__PURE__ */ n("code", { children: o.path }),
2141
2098
  " ",
2142
2099
  s.shell.noRouteHint
@@ -2144,10 +2101,10 @@ function tn({ product: e, registry: t }) {
2144
2101
  return (
2145
2102
  // `display: contents` deixa o layout do produto como se este nó não
2146
2103
  // existisse: ele só serve de raiz para observar os links.
2147
- /* @__PURE__ */ n("div", { ref: m, style: { display: "contents" }, children: L && !f ? /* @__PURE__ */ n(L, { context: g, children: V }) : V })
2104
+ /* @__PURE__ */ n("div", { ref: m, style: { display: "contents" }, children: M && !S ? /* @__PURE__ */ n(M, { context: v, children: K }) : K })
2148
2105
  );
2149
2106
  }
2150
- function nn(e) {
2107
+ function on(e) {
2151
2108
  if (!e.altKey) {
2152
2109
  if (e.shiftKey && !e.metaKey && !e.ctrlKey && e.key === "C") return "C";
2153
2110
  if ((e.metaKey || e.ctrlKey) && !e.shiftKey) {
@@ -2157,7 +2114,7 @@ function nn(e) {
2157
2114
  }
2158
2115
  }
2159
2116
  }
2160
- const ue = {
2117
+ const he = {
2161
2118
  leftWidth: "ds:left-width",
2162
2119
  rightWidth: "ds:right-width",
2163
2120
  appearance: "ds:appearance"
@@ -2175,30 +2132,30 @@ function nt(e, t) {
2175
2132
  } catch {
2176
2133
  }
2177
2134
  }
2178
- function Ke(e, t, s) {
2135
+ function Ve(e, t, s) {
2179
2136
  return Math.round(Math.min(s, Math.max(t, e)));
2180
2137
  }
2181
- function Ve(e, t, s, o) {
2182
- const [r, i] = K(() => {
2138
+ function Ke(e, t, s, o) {
2139
+ const [r, i] = V(() => {
2183
2140
  const a = Number.parseInt(tt(e) ?? "", 10);
2184
- return Number.isFinite(a) ? Ke(a, s, o) : t;
2141
+ return Number.isFinite(a) ? Ve(a, s, o) : t;
2185
2142
  }), l = U(
2186
2143
  (a) => {
2187
- const h = Ke(a, s, o);
2188
- i(h), nt(e, String(h));
2144
+ const p = Ve(a, s, o);
2145
+ i(p), nt(e, String(p));
2189
2146
  },
2190
2147
  [e, o, s]
2191
2148
  );
2192
2149
  return [r, l];
2193
2150
  }
2194
- function on() {
2151
+ function rn() {
2195
2152
  const e = "(prefers-color-scheme: dark)", t = () => {
2196
2153
  try {
2197
2154
  return window.matchMedia(e).matches ? "dark" : "light";
2198
2155
  } catch {
2199
2156
  return "light";
2200
2157
  }
2201
- }, [s, o] = K(t);
2158
+ }, [s, o] = V(t);
2202
2159
  return I(() => {
2203
2160
  let r;
2204
2161
  try {
@@ -2210,89 +2167,89 @@ function on() {
2210
2167
  return r.addEventListener?.("change", i), () => r?.removeEventListener?.("change", i);
2211
2168
  }, []), s;
2212
2169
  }
2213
- function rn() {
2214
- const e = tt(ue.appearance);
2170
+ function sn() {
2171
+ const e = tt(he.appearance);
2215
2172
  return e === "dark" || e === "light" ? e : void 0;
2216
2173
  }
2217
- function pn({ product: e }) {
2218
- const t = D(() => bt(e), [e]), s = D(() => Rt(e.theme?.labels), [e.theme?.labels]), [o] = K(() => vt());
2219
- return /* @__PURE__ */ n(Ye.Provider, { value: s, children: o ? /* @__PURE__ */ n(tn, { product: e, registry: t }) : /* @__PURE__ */ n(sn, { product: e, registry: t }) });
2220
- }
2221
- const Ce = { initial: 290, min: 200, max: 480 }, Se = { initial: 320, min: 260, max: 560 };
2222
- function sn({ product: e, registry: t }) {
2223
- const s = Q(), o = D(() => wt(e.deploy), [e.deploy]), { location: r, controls: i, viewport: l, setControls: a, openScenario: h, openComponent: m, openScreen: p, go: d } = Ge(t), v = G(r);
2224
- v.current = r;
2225
- const f = on(), [k, T] = K(() => rn()), E = i.chromeTheme ?? k ?? f, [x, w] = Ve(
2226
- ue.leftWidth,
2174
+ function mn({ product: e }) {
2175
+ const t = D(() => kt(e), [e]), s = D(() => Ot(e.theme?.labels), [e.theme?.labels]), [o] = V(() => gt());
2176
+ return /* @__PURE__ */ n(Ye.Provider, { value: s, children: o ? /* @__PURE__ */ n(nn, { product: e, registry: t }) : /* @__PURE__ */ n(an, { product: e, registry: t }) });
2177
+ }
2178
+ const ke = { initial: 290, min: 200, max: 480 }, Ce = { initial: 320, min: 260, max: 560 };
2179
+ function an({ product: e, registry: t }) {
2180
+ const s = J(), o = D(() => bt(e.deploy), [e.deploy]), { location: r, controls: i, viewport: l, setControls: a, openScenario: p, openComponent: m, openScreen: h, go: d } = Ge(t), f = q(r);
2181
+ f.current = r;
2182
+ const S = rn(), [b, L] = V(() => sn()), T = i.chromeTheme ?? b ?? S, [N, w] = Ke(
2183
+ he.leftWidth,
2184
+ ke.initial,
2185
+ ke.min,
2186
+ ke.max
2187
+ ), [u, k] = Ke(
2188
+ he.rightWidth,
2227
2189
  Ce.initial,
2228
2190
  Ce.min,
2229
2191
  Ce.max
2230
- ), [b, N] = Ve(
2231
- ue.rightWidth,
2232
- Se.initial,
2233
- Se.min,
2234
- Se.max
2235
- ), [S, u] = K(!1), $ = i.handoff, F = t.component(i.component), c = t.scenario(i.scenario), g = F ? void 0 : t.screensFor({ handoff: $ }).find((_) => _.id === t.screenForPath(r.path)?.id), y = g && c && g.variations.some((_) => _.id === c.id) ? c : void 0, L = D(
2236
- () => t.resolveComponentFixture(F?.id, F ? i.fixture : void 0),
2237
- [F, i.fixture, t]
2238
- ), O = D(() => {
2239
- if (!g || g.controls.length === 0) return t.issues;
2240
- const { invalid: _ } = t.resolveControls(g, {
2241
- scenario: y,
2192
+ ), [g, y] = V(!1), _ = i.handoff, z = t.component(i.component), c = t.scenario(i.scenario), v = z ? void 0 : t.screensFor({ handoff: _ }).find((R) => R.id === t.screenForPath(r.path)?.id), x = v && c && v.variations.some((R) => R.id === c.id) ? c : void 0, M = D(
2193
+ () => t.resolveComponentFixture(z?.id, z ? i.fixture : void 0),
2194
+ [z, i.fixture, t]
2195
+ ), F = D(() => {
2196
+ if (!v || v.controls.length === 0) return t.issues;
2197
+ const { invalid: R } = t.resolveControls(v, {
2198
+ scenario: x,
2242
2199
  requested: We(r.search)
2243
2200
  });
2244
- return _.length === 0 ? t.issues : [..._.map((Y) => ({
2201
+ return R.length === 0 ? t.issues : [...R.map((Z) => ({
2245
2202
  level: "warning",
2246
- where: `url:${we}${Y.id}`,
2247
- message: Y.reason === "invalid-value" ? s.diagnostics.invalidControl(Y.id, Y.value, Y.fallback ?? "") : s.diagnostics.unknownControl(Y.id, Y.value)
2203
+ where: `url:${ge}${Z.id}`,
2204
+ message: Z.reason === "invalid-value" ? s.diagnostics.invalidControl(Z.id, Z.value, Z.fallback ?? "") : s.diagnostics.unknownControl(Z.id, Z.value)
2248
2205
  })), ...t.issues];
2249
- }, [s, r.search, t, g, y]), R = t.screensFor({ handoff: $ })[0], V = t.componentsFor($)[0], P = !R && !V, z = D(() => {
2250
- const _ = new URLSearchParams(r.search);
2251
- return _.has(M.scenario) || _.has(M.component);
2252
- }, [r.search]), A = r.path === "/" && !z && !t.screenForPath("/") && !P;
2206
+ }, [s, r.search, t, v, x]), E = t.screensFor({ handoff: _ })[0], K = t.componentsFor(_)[0], P = !E && !K, O = D(() => {
2207
+ const R = new URLSearchParams(r.search);
2208
+ return R.has($.scenario) || R.has($.component);
2209
+ }, [r.search]), A = r.path === "/" && !O && !t.screenForPath("/") && !P;
2253
2210
  I(() => {
2254
- A && (R ? p(R.id, { replace: !0 }) : V && m(V.id, { replace: !0 }));
2255
- }, [V, R, m, p, A]);
2211
+ A && (E ? h(E.id, { replace: !0 }) : K && m(K.id, { replace: !0 }));
2212
+ }, [K, E, m, h, A]);
2256
2213
  const j = U(
2257
2214
  () => a({ chrome: !i.chrome }),
2258
2215
  [i.chrome, a]
2259
2216
  ), B = U(
2260
- (_) => {
2261
- if (_ === "C") {
2217
+ (R) => {
2218
+ if (R === "C") {
2262
2219
  j();
2263
2220
  return;
2264
2221
  }
2265
- window.dispatchEvent(new KeyboardEvent("keydown", { key: _.toLowerCase(), metaKey: !0 }));
2222
+ window.dispatchEvent(new KeyboardEvent("keydown", { key: R.toLowerCase(), metaKey: !0 }));
2266
2223
  },
2267
2224
  [j]
2268
2225
  );
2269
2226
  I(() => {
2270
- const _ = (Z) => {
2271
- !Z.shiftKey || Z.metaKey || Z.ctrlKey || Z.altKey || Z.key !== "C" || Z.target?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (Z.preventDefault(), B(Z.key));
2227
+ const R = (G) => {
2228
+ !G.shiftKey || G.metaKey || G.ctrlKey || G.altKey || G.key !== "C" || G.target?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (G.preventDefault(), B(G.key));
2272
2229
  };
2273
- return window.addEventListener("keydown", _), () => window.removeEventListener("keydown", _);
2230
+ return window.addEventListener("keydown", R), () => window.removeEventListener("keydown", R);
2274
2231
  }, [B]);
2275
- const J = U(
2276
- (_, Z) => {
2277
- const { path: Y, search: it } = xe(_);
2278
- d(Y, gt(it, v.current.search), { replace: Z });
2232
+ const Q = U(
2233
+ (R, G) => {
2234
+ const { path: Z, search: it } = Ne(R);
2235
+ d(Z, St(it, f.current.search), { replace: G });
2279
2236
  },
2280
2237
  [d]
2281
2238
  ), ie = () => {
2282
- const _ = E === "dark" ? "light" : "dark";
2283
- nt(ue.appearance, _), T(_), a({ chromeTheme: _ });
2284
- }, re = (_) => a(_), ot = `${o.origin}${r.path}${r.search}`, rt = i.panelTab ?? "variations", Re = i.zoom ?? 100, [st, at] = K(Re);
2239
+ const R = T === "dark" ? "light" : "dark";
2240
+ nt(he.appearance, R), L(R), a({ chromeTheme: R });
2241
+ }, re = (R) => a(R), ot = `${o.origin}${r.path}${r.search}`, rt = i.panelTab ?? "variations", Re = i.zoom ?? 100, [st, at] = V(Re);
2285
2242
  return /* @__PURE__ */ C(
2286
2243
  "div",
2287
2244
  {
2288
2245
  className: "ds-root",
2289
- "data-appearance": E,
2246
+ "data-appearance": T,
2290
2247
  "data-chrome": i.chrome ? "visible" : "hidden",
2291
- "data-resizing": S ? "true" : void 0,
2248
+ "data-resizing": g ? "true" : void 0,
2292
2249
  "data-viewport": l.id,
2293
2250
  children: [
2294
2251
  i.chrome && /* @__PURE__ */ n(
2295
- Ft,
2252
+ At,
2296
2253
  {
2297
2254
  productName: e.name,
2298
2255
  deploy: o,
@@ -2300,69 +2257,69 @@ function sn({ product: e, registry: t }) {
2300
2257
  viewport: l,
2301
2258
  zoom: st,
2302
2259
  rotated: !!i.rotated,
2303
- theme: E,
2304
- issues: O,
2260
+ theme: T,
2261
+ issues: F,
2305
2262
  linkUrl: ot,
2306
- onViewport: (_) => re({ viewport: _ }),
2263
+ onViewport: (R) => re({ viewport: R }),
2307
2264
  onRotate: () => re({ rotated: !i.rotated }),
2308
- onZoom: (_) => re({ zoom: _ }),
2265
+ onZoom: (R) => re({ zoom: R }),
2309
2266
  onCleanReview: j,
2310
2267
  onToggleTheme: ie
2311
2268
  }
2312
2269
  ),
2313
2270
  /* @__PURE__ */ C("div", { className: "ds-body", children: [
2314
2271
  i.chrome && /* @__PURE__ */ n(
2315
- At,
2272
+ Kt,
2316
2273
  {
2317
2274
  registry: t,
2318
- handoff: $,
2319
- activeScreen: g?.id,
2320
- activeComponent: F?.id,
2321
- onOpenScreen: (_) => p(_),
2322
- onOpenComponent: (_) => m(_),
2323
- width: x,
2275
+ handoff: _,
2276
+ activeScreen: v?.id,
2277
+ activeComponent: z?.id,
2278
+ onOpenScreen: (R) => h(R),
2279
+ onOpenComponent: (R) => m(R),
2280
+ width: N,
2324
2281
  onResize: w,
2325
- onResizeStart: () => u(!0),
2326
- onResizeEnd: () => u(!1)
2282
+ onResizeStart: () => y(!0),
2283
+ onResizeEnd: () => y(!1)
2327
2284
  }
2328
2285
  ),
2329
2286
  /* @__PURE__ */ n("main", { className: "ds-main", children: P ? /* @__PURE__ */ C("div", { className: "ds-chrome-empty", children: [
2330
2287
  /* @__PURE__ */ n("h1", { className: "ds-chrome-empty__title", children: s.shell.empty }),
2331
2288
  /* @__PURE__ */ n("p", { className: "ds-muted", children: s.shell.emptyHint })
2332
2289
  ] }) : A ? null : /* @__PURE__ */ n(
2333
- Xt,
2290
+ Qt,
2334
2291
  {
2335
2292
  location: r,
2336
2293
  viewport: l,
2337
2294
  zoom: Re,
2338
2295
  onEffectiveZoom: at,
2339
2296
  title: s.shell.frameTitle(e.name),
2340
- resizing: S,
2341
- onFrameNavigate: J,
2297
+ resizing: g,
2298
+ onFrameNavigate: Q,
2342
2299
  onShortcut: B
2343
2300
  }
2344
2301
  ) }),
2345
2302
  i.chrome && /* @__PURE__ */ n(
2346
- Wt,
2303
+ jt,
2347
2304
  {
2348
2305
  registry: t,
2349
2306
  controls: i,
2350
2307
  deploy: o,
2351
2308
  location: r,
2352
- screen: g,
2353
- variation: y,
2354
- component: F,
2355
- componentFixture: L,
2309
+ screen: v,
2310
+ variation: x,
2311
+ component: z,
2312
+ componentFixture: M,
2356
2313
  tab: rt,
2357
- onTab: (_) => re({ panelTab: _ }),
2358
- onOpenScenario: h,
2359
- onOpenComponent: (_) => m(_),
2360
- onOpenScreen: (_) => p(_),
2314
+ onTab: (R) => re({ panelTab: R }),
2315
+ onOpenScenario: p,
2316
+ onOpenComponent: (R) => m(R),
2317
+ onOpenScreen: (R) => h(R),
2361
2318
  onChange: re,
2362
- width: b,
2363
- onResize: N,
2364
- onResizeStart: () => u(!0),
2365
- onResizeEnd: () => u(!1)
2319
+ width: u,
2320
+ onResize: k,
2321
+ onResizeStart: () => y(!0),
2322
+ onResizeEnd: () => y(!1)
2366
2323
  }
2367
2324
  )
2368
2325
  ] }),
@@ -2381,69 +2338,69 @@ function sn({ product: e, registry: t }) {
2381
2338
  }
2382
2339
  );
2383
2340
  }
2384
- function fe(e) {
2341
+ function we(e) {
2385
2342
  return new Date(e.length === 10 ? `${e}T00:00:00` : e);
2386
2343
  }
2387
- function mn(e, t) {
2388
- const s = fe(e), o = fe(t);
2344
+ function fn(e, t) {
2345
+ const s = we(e), o = we(t);
2389
2346
  let r = o.getFullYear() - s.getFullYear();
2390
2347
  const i = o.getMonth() - s.getMonth();
2391
2348
  return (i < 0 || i === 0 && o.getDate() < s.getDate()) && (r -= 1), r;
2392
2349
  }
2393
- function fn(e, t) {
2394
- const s = fe(e), o = fe(t);
2350
+ function wn(e, t) {
2351
+ const s = we(e), o = we(t);
2395
2352
  return Math.floor((o.getTime() - s.getTime()) / 864e5);
2396
2353
  }
2397
2354
  export {
2398
- we as CONTROL_PARAM_PREFIX,
2355
+ ge as CONTROL_PARAM_PREFIX,
2399
2356
  ne as DEFAULT_LABELS,
2400
- pn as DesignSpace,
2401
- dn as EN_US_LABELS,
2402
- ft as FRAME_ATTRIBUTE,
2403
- gn as FRAME_PARAM,
2357
+ mn as DesignSpace,
2358
+ un as EN_US_LABELS,
2359
+ vt as FRAME_ATTRIBUTE,
2360
+ pt as FRAME_PARAM,
2404
2361
  bn as HANDOFF_PARAM,
2405
- un as NETWORK_LABELS,
2362
+ hn as NETWORK_LABELS,
2406
2363
  He as NETWORK_STATES,
2407
- M as PARAM,
2364
+ $ as PARAM,
2408
2365
  Je as SLOW_NETWORK_DELAY_MS,
2409
2366
  et as SimulatedNetworkError,
2410
2367
  De as StageEmpty,
2411
- St as VIEWPORTS,
2412
- pe as ZOOM_DEFAULT,
2368
+ Nt as VIEWPORTS,
2369
+ me as ZOOM_DEFAULT,
2413
2370
  Ee as ZOOM_MAX,
2414
- Pe as ZOOM_MIN,
2415
- mn as ageInYears,
2416
- Te as applyHandoffScope,
2371
+ Te as ZOOM_MIN,
2372
+ fn as ageInYears,
2373
+ Pe as applyHandoffScope,
2417
2374
  ye as applyOverrides,
2418
2375
  Ze as clampZoom,
2419
- kn as commitUrl,
2420
- Cn as componentUrl,
2421
- hn as createHttpAdapter,
2422
- bt as createRegistry,
2423
- fn as daysBetween,
2376
+ Sn as commitUrl,
2377
+ kn as componentUrl,
2378
+ pn as createHttpAdapter,
2379
+ kt as createRegistry,
2380
+ wn as daysBetween,
2424
2381
  Le as fixtureAdapter,
2425
- Sn as formatIssues,
2426
- wt as getDeployContext,
2382
+ Cn as formatIssues,
2383
+ bt as getDeployContext,
2427
2384
  ve as handoffAllowsComponent,
2428
2385
  Ie as handoffAllowsPath,
2429
2386
  oe as handoffAllowsScenario,
2430
- Nn as hasErrors,
2431
- xn as matchPath,
2387
+ xn as hasErrors,
2388
+ Nn as matchPath,
2432
2389
  yn as normalizeHandoffScope,
2433
2390
  X as normalizeSearch,
2434
2391
  $e as parseControls,
2435
2392
  ht as parseHandoffScope,
2436
- fe as parseIsoDate,
2393
+ we as parseIsoDate,
2437
2394
  Me as resolveFixture,
2438
- Rt as resolveLabels,
2439
- Ne as resolveRoute,
2440
- yt as resolveViewport,
2441
- he as scenarioUrl,
2395
+ Ot as resolveLabels,
2396
+ xe as resolveRoute,
2397
+ Lt as resolveViewport,
2398
+ pe as scenarioUrl,
2442
2399
  se as serializeControls,
2443
2400
  $n as serializeValue,
2444
2401
  Ge as useDesignSpaceState,
2445
- Q as useLabels,
2446
- en as useScenarioData,
2402
+ J as useLabels,
2403
+ tn as useScenarioData,
2447
2404
  ut as validateProduct,
2448
2405
  Mn as validateScenario
2449
2406
  };