@brucesantos/design-space 0.13.0 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,356 +1,178 @@
1
- import { jsx as o, jsxs as y, Fragment as G } from "react/jsx-runtime";
2
- import { useState as D, useRef as q, useCallback as K, useEffect as V, useMemo as A, useContext as St, createContext as Ct, useLayoutEffect as qe } from "react";
3
- import { r as Ne, s as yt, h as re, v as xt, a as be, b as Ge, p as Nt, P as M, c as Ze, C as ke, d as Pe, e as se, t as ie, f as he, N as Ye, g as Qe, F as $t, i as Re, j as Mt, k as me, l as $e, m as Et, n as ze, o as Lt, q as fe, u as Tt, w as Pt, x as Rt, y as _t } from "./index-CLox5DuH.js";
4
- import { H as Zn, z as Yn, A as Qn, B as Xn, D as Jn, E as eo, G as to, I as no, J as oo } from "./index-CLox5DuH.js";
5
- import { createPortal as Ft } from "react-dom";
6
- import { r as Ot, i as zt, s as At } from "./hook-CeXcli-1.js";
7
- function Dt(e) {
8
- const t = e.scenarios ?? [], n = e.routes ?? [], r = e.components ?? [], s = new Map(t.map((d) => [d.id, d])), a = new Map(r.map((d) => [d.id, d])), c = new Map((e.personas ?? []).map((d) => [d.id, d])), l = new Map((e.fixtures ?? []).map((d) => [d.id, d])), h = new Map((e.rules ?? []).map((d) => [d.id, d])), p = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
9
- for (const d of t) {
10
- const g = Ne(n, d.route ?? "");
11
- if (!g) continue;
12
- const C = g.definition.path;
13
- u.set(d.id, C);
14
- const E = p.get(C) ?? [];
15
- E.push(d), p.set(C, E);
16
- }
17
- const i = /* @__PURE__ */ new Set(), f = [];
18
- for (const d of n) {
19
- if (i.has(d.path)) continue;
20
- i.add(d.path);
21
- const g = p.get(d.path) ?? [];
22
- f.push({
23
- id: d.path,
24
- name: d.name?.trim() || g[0]?.title || d.path,
25
- description: d.description,
26
- route: d,
27
- href: yt(d.path, d.params),
28
- variations: g,
29
- group: d.group?.trim() || void 0,
30
- controls: Array.isArray(d.controls) ? d.controls : []
31
- });
32
- }
33
- const S = new Map(f.map((d) => [d.id, d])), N = (d) => d ? s.get(d) : void 0, $ = (d) => d ? c.get(d) : void 0, _ = $(e.defaultPersona)?.id, v = (d, g) => {
34
- if (!(!d || !g))
35
- return a.get(d)?.fixtures?.find((C) => C.id === g);
36
- }, L = (d = {}) => t.filter((g) => re(d.handoff, g.id)), b = (d) => {
37
- const g = Ne(n, d);
38
- return g ? S.get(g.definition.path) : void 0;
39
- }, m = (d = {}) => {
40
- const { handoff: g } = d;
41
- return g ? f.map((C) => ({
42
- ...C,
43
- variations: C.variations.filter((E) => re(g, E.id))
44
- })).filter(
45
- (C) => C.variations.length > 0 || (g.routes ?? []).length > 0 && Ge(g, C.href)
46
- ) : f;
47
- }, w = (d) => d ? d.permissions ? d.permissions : $(d.persona ?? _)?.permissions ?? [] : [], k = (d = {}) => Xe(m(d)), x = (d, g) => {
48
- const C = new Set(d?.route.components ?? []), E = g ? [g] : d?.variations ?? [];
49
- for (const F of E)
50
- for (const O of F.components ?? []) C.add(O);
51
- return [...C];
52
- }, T = (d) => r.filter((g) => be(d, g.id));
53
- return {
54
- product: e,
55
- screens: f,
56
- issues: xt(e),
57
- defaultPersona: _,
58
- scenario: N,
59
- component: (d) => d ? a.get(d) : void 0,
60
- componentFixture: v,
61
- resolveComponentFixture: (d, g) => {
62
- const C = d ? a.get(d) : void 0, E = v(d, g), F = v(d, C?.defaultFixture) ?? C?.fixtures?.[0];
63
- return {
64
- fixture: E ?? F,
65
- requestedId: g,
66
- didFallback: !!(g && !E)
67
- };
68
- },
69
- persona: $,
70
- fixture: (d) => d ? l.get(d) : void 0,
71
- rule: (d) => d ? h.get(d) : void 0,
72
- screen: (d) => d ? S.get(d) : void 0,
73
- screenForPath: b,
74
- screenOf: (d) => {
75
- const g = d ? u.get(d.id) : void 0;
76
- return g ? S.get(g) : void 0;
77
- },
78
- screensFor: m,
79
- flows: k,
80
- flowOf: (d, g) => {
81
- if (d)
82
- return k(g).find((C) => C.name === d.group);
83
- },
84
- controlsOf: (d) => (d?.controls ?? []).flatMap((g) => g.controls ?? []),
85
- resolveControls: (d, g = {}) => It(d?.controls ?? [], g),
86
- rulesOf: (d) => (d?.rules ?? []).map((g) => h.get(g)).filter((g) => !!g),
87
- permissionsOf: w,
88
- scenariosForRoute: (d, g) => {
89
- const C = b(d);
90
- return C ? C.variations.filter((E) => re(g?.handoff, E.id)) : [];
91
- },
92
- activeScenarios: L,
93
- search: (d, g) => {
94
- const C = X(d), E = L(g);
95
- return C ? E.filter(
96
- (F) => X(
97
- [
98
- F.title,
99
- F.id,
100
- F.intent ?? "",
101
- F.route,
102
- $(F.persona)?.name ?? "",
103
- (F.tags ?? []).join(" "),
104
- (F.expected ?? []).join(" ")
105
- ].join(" ")
106
- ).includes(C)
107
- ) : E;
108
- },
109
- searchScreens: (d, g) => {
110
- const C = X(d), E = m(g);
111
- return C ? E.filter(
112
- (F) => X(
113
- [
114
- F.name,
115
- F.description ?? "",
116
- F.id,
117
- F.group ?? "",
118
- ...F.variations.flatMap((O) => [
119
- O.title,
120
- O.id,
121
- (O.tags ?? []).join(" ")
122
- ])
123
- ].join(" ")
124
- ).includes(C)
125
- ) : E;
126
- },
127
- searchComponents: (d, g) => {
128
- const C = X(d), E = T(g);
129
- return C ? E.filter(
130
- (F) => X(
131
- [
132
- F.name,
133
- F.description ?? "",
134
- F.group ?? "",
135
- F.id,
136
- F.source ?? ""
137
- ].join(" ")
138
- ).includes(C)
139
- ) : E;
140
- },
141
- componentsFor: T,
142
- componentsOfScreen: (d, g) => x(d, g).map((C) => a.get(C)).filter((C) => !!C),
143
- usagesOf: (d, g) => d ? m(g).filter(
144
- (C) => C.route.components?.includes(d) || C.variations.some((E) => E.components?.includes(d))
145
- ) : []
146
- };
147
- }
148
- function X(e) {
149
- return e.toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g, "").trim();
150
- }
151
- function Xe(e) {
152
- const t = [], n = /* @__PURE__ */ new Map();
153
- for (const s of e) {
154
- if (!s.group) {
155
- t.push(s);
156
- continue;
157
- }
158
- const a = n.get(s.group) ?? [];
159
- a.push(s), n.set(s.group, a);
160
- }
161
- const r = [...n].map(([s, a]) => ({ name: s, screens: a }));
162
- return t.length > 0 ? [{ name: void 0, screens: t }, ...r] : r;
163
- }
164
- function Se(e) {
165
- const t = e.options ?? [];
166
- return e.default !== void 0 && t.some((n) => n.value === e.default) ? e.default : t[0]?.value ?? "";
167
- }
168
- function It(e, t = {}) {
169
- const n = {}, r = [], s = /* @__PURE__ */ new Set(), a = t.requested ?? {};
170
- for (const c of e)
171
- for (const l of c.controls ?? []) {
172
- if (s.has(l.id)) continue;
173
- s.add(l.id);
174
- const h = (f) => f !== void 0 && (l.options ?? []).some((S) => S.value === f);
175
- let p = Se(l);
176
- const u = t.scenario?.controls?.[l.id];
177
- h(u) && (p = u);
178
- const i = a[l.id];
179
- i !== void 0 && (h(i) ? p = i : r.push({ id: l.id, value: i, reason: "invalid-value", fallback: p })), n[l.id] = p;
180
- }
181
- for (const [c, l] of Object.entries(a))
182
- s.has(c) || r.push({ id: c, value: l, reason: "unknown-control" });
183
- return { values: n, invalid: r };
184
- }
185
- function Ut(e, t) {
186
- return e ? Object.entries(e.controls ?? {}).every(([n, r]) => t?.[n] === r) : !1;
187
- }
188
- const Vt = [
1
+ import { jsx as n, jsxs as b, Fragment as V } from "react/jsx-runtime";
2
+ import { useState as z, useRef as j, useCallback as W, useEffect as I, useMemo as $, useLayoutEffect as Ie } from "react";
3
+ import { u as X, g as ht, n as fe, s as ut, c as We, a as mt, r as ft, L as pt } from "./labels-BlpcrSph.js";
4
+ import { D as On, E as $n, N as zn } from "./labels-BlpcrSph.js";
5
+ import { p as wt, P as y, h as Se, a as Ne, r as Ue, C as me, b as Ce, N as He, i as xe, d as bt, c as gt, e as vt, g as kt } from "./index-CaxlsfFr.js";
6
+ import { H as Kn, f as In, j as Wn, k as Un, l as Hn, m as qn, n as Bn, o as jn, s as Vn, q as Gn, v as Zn, t as Yn } from "./index-CaxlsfFr.js";
7
+ import { p as ne, t as re, f as ce, a as qe, F as yt, b as _e, c as St, C as de, i as Nt, m as Ct, s as xt } from "./index-BobUYxei.js";
8
+ import { createPortal as Mt } from "react-dom";
9
+ import { r as Et, i as Lt, s as _t } from "./hook-CeXcli-1.js";
10
+ const Tt = [
189
11
  { id: "mobile", label: "Celular", width: 375, height: 812 },
190
12
  { id: "tablet", label: "Tablet", width: 768, height: 1024 },
191
13
  { id: "desktop", label: "Desktop", width: 1280, height: 800 },
192
14
  { id: "fit", label: "Ajustar" },
193
15
  { id: "custom", label: "Personalizado" }
194
- ], _e = 25, Fe = 150, we = 100;
195
- function Je(e, t, n) {
196
- const r = n !== void 0 ? e.screenForPath(n) : e.screenOf(t), s = t && r && e.screenOf(t)?.id === r.id ? t : void 0;
16
+ ], Me = 25, Ee = 150, he = 100;
17
+ function Be(e, t, o) {
18
+ const r = o !== void 0 ? e.screenForPath(o) : e.screenOf(t), s = t && r && e.screenOf(t)?.id === r.id ? t : void 0;
197
19
  return { screen: r, scenario: s };
198
20
  }
199
- function Me(e, t, n) {
200
- const r = new URLSearchParams(e), s = Nt(r), a = r.get(M.component) ?? void 0, c = be(s, a) ? t.component(a) : void 0, l = r.get(M.scenario) ?? void 0, h = c || !re(s, l) ? void 0 : t.scenario(l), p = r.get(M.fixture) ?? void 0, u = c ? p ?? t.componentFixture(c.id, c.defaultFixture)?.id ?? c.fixtures?.[0]?.id : void 0, i = r.get(M.network), f = c ? void 0 : Je(t, h, n), S = f?.screen && f.screen.controls.length > 0 ? t.resolveControls(f.screen, {
201
- scenario: f.scenario,
202
- requested: Ze(r)
21
+ function ge(e, t, o) {
22
+ const r = new URLSearchParams(e), s = wt(r), a = r.get(y.component) ?? void 0, i = Se(s, a) ? t.component(a) : void 0, d = r.get(y.scenario) ?? void 0, l = i || !Ne(s, d) ? void 0 : t.scenario(d), c = r.get(y.fixture) ?? void 0, h = i ? c ?? t.componentFixture(i.id, i.defaultFixture)?.id ?? i.fixtures?.[0]?.id : void 0, u = r.get(y.network), p = i ? void 0 : Be(t, l, o), S = p?.screen && p.screen.controls.length > 0 ? t.resolveControls(p.screen, {
23
+ scenario: p.scenario,
24
+ requested: Ue(r)
203
25
  }).values : void 0;
204
26
  return {
205
- scenario: h?.id,
27
+ scenario: l?.id,
206
28
  handoff: s,
207
- component: c?.id,
29
+ component: i?.id,
208
30
  // Precedência: URL, cenário, padrão do produto. O preview de componente não
209
31
  // tem persona, então o padrão não se aplica a ele.
210
- persona: r.get(M.persona) ?? h?.persona ?? (c ? void 0 : t.defaultPersona),
211
- fixture: c ? u : p ?? h?.fixture,
212
- network: jt(i) ? i : h?.network ?? "success",
213
- viewport: r.get(M.viewport) ?? "fit",
214
- customWidth: Zt(r.get(M.customWidth)),
215
- themeMode: r.get(M.themeMode) ?? t.product.theme?.modes?.[0],
216
- locale: r.get(M.locale) ?? t.product.theme?.locales?.[0],
217
- dataSource: r.get(M.dataSource) ?? t.product.dataSources?.default ?? "fixtures",
32
+ persona: r.get(y.persona) ?? l?.persona ?? (i ? void 0 : t.defaultPersona),
33
+ fixture: i ? h : c ?? l?.fixture,
34
+ network: Ot(u) ? u : l?.network ?? "success",
35
+ viewport: r.get(y.viewport) ?? "fit",
36
+ customWidth: Dt(r.get(y.customWidth)),
37
+ themeMode: r.get(y.themeMode) ?? t.product.theme?.modes?.[0],
38
+ locale: r.get(y.locale) ?? t.product.theme?.locales?.[0],
39
+ dataSource: r.get(y.dataSource) ?? t.product.dataSources?.default ?? "fixtures",
218
40
  // Sem parâmetro, o tema do chrome fica em aberto: o shell resolve pela
219
41
  // última escolha da pessoa e, na falta dela, pelo sistema.
220
- chromeTheme: qt(r.get(M.chromeTheme)) ? r.get(M.chromeTheme) : void 0,
42
+ chromeTheme: $t(r.get(y.chromeTheme)) ? r.get(y.chromeTheme) : void 0,
221
43
  // Chrome visível por padrão. `?chrome=0` é o modo de revisão limpa e captura
222
44
  // de tela, então precisa ser explícito para não sumir sem pedido.
223
- chrome: r.get(M.chrome) !== "0",
224
- inspector: r.get(M.inspector) !== "0",
225
- panelTab: Gt(r.get(M.panelTab)) ? r.get(M.panelTab) : "variations",
226
- zoom: nt(r.get(M.zoom)),
227
- rotated: r.get(M.rotated) === "1",
228
- highlight: r.get(M.highlight) === "1",
45
+ chrome: r.get(y.chrome) !== "0",
46
+ inspector: r.get(y.inspector) !== "0",
47
+ panelTab: zt(r.get(y.panelTab)) ? r.get(y.panelTab) : "variations",
48
+ zoom: Ge(r.get(y.zoom)),
49
+ rotated: r.get(y.rotated) === "1",
50
+ highlight: r.get(y.highlight) === "1",
229
51
  screenControls: S
230
52
  };
231
53
  }
232
- function ae(e, t, n) {
54
+ function oe(e, t, o) {
233
55
  const r = new URLSearchParams(), s = t.scenario(e.scenario);
234
- if (e.component ? r.set(M.component, e.component) : e.scenario && r.set(M.scenario, e.scenario), e.persona && e.persona !== (s?.persona ?? t.defaultPersona) && r.set(M.persona, e.persona), e.component && e.fixture ? r.set(M.fixture, e.fixture) : e.fixture && e.fixture !== s?.fixture && r.set(M.fixture, e.fixture), e.network !== (s?.network ?? "success") && r.set(M.network, e.network), e.screenControls && !e.component) {
235
- const u = Je(t, s, n), i = u.screen ? t.resolveControls(u.screen, { scenario: u.scenario }).values : {}, f = u.screen ? t.controlsOf(u.screen).map((S) => S.id) : Object.keys(e.screenControls);
236
- for (const S of f) {
237
- const N = e.screenControls[S];
238
- N !== void 0 && N !== i[S] && r.set(`${ke}${S}`, N);
56
+ if (e.component ? r.set(y.component, e.component) : e.scenario && r.set(y.scenario, e.scenario), e.persona && e.persona !== (s?.persona ?? t.defaultPersona) && r.set(y.persona, e.persona), e.component && e.fixture ? r.set(y.fixture, e.fixture) : e.fixture && e.fixture !== s?.fixture && r.set(y.fixture, e.fixture), e.network !== (s?.network ?? "success") && r.set(y.network, e.network), e.screenControls && !e.component) {
57
+ const h = Be(t, s, o), u = h.screen ? t.resolveControls(h.screen, { scenario: h.scenario }).values : {}, p = h.screen ? t.controlsOf(h.screen).map((S) => S.id) : Object.keys(e.screenControls);
58
+ for (const S of p) {
59
+ const C = e.screenControls[S];
60
+ C !== void 0 && C !== u[S] && r.set(`${me}${S}`, C);
239
61
  }
240
62
  }
241
- e.viewport !== "fit" && r.set(M.viewport, e.viewport), e.viewport === "custom" && e.customWidth && r.set(M.customWidth, String(e.customWidth));
63
+ e.viewport !== "fit" && r.set(y.viewport, e.viewport), e.viewport === "custom" && e.customWidth && r.set(y.customWidth, String(e.customWidth));
242
64
  const a = t.product.theme?.modes?.[0];
243
- e.themeMode && e.themeMode !== a && r.set(M.themeMode, e.themeMode);
244
- const c = t.product.theme?.locales?.[0];
245
- e.locale && e.locale !== c && r.set(M.locale, e.locale);
246
- const l = t.product.dataSources?.default ?? "fixtures";
247
- e.dataSource && e.dataSource !== l && r.set(M.dataSource, e.dataSource), e.chromeTheme && r.set(M.chromeTheme, e.chromeTheme), e.chrome || r.set(M.chrome, "0"), e.inspector || r.set(M.inspector, "0"), e.panelTab === "info" && r.set(M.panelTab, "info");
248
- const h = nt(e.zoom === void 0 ? null : String(e.zoom));
249
- h !== we && r.set(M.zoom, String(h)), e.rotated && r.set(M.rotated, "1"), e.highlight && r.set(M.highlight, "1"), Pe(r, e.handoff);
250
- const p = r.toString();
251
- return p ? `?${p}` : "";
252
- }
253
- function et(e, t = {}) {
254
- const n = !!t.frame, [r, s] = D(() => Ce()), a = q(r), c = K((m) => {
65
+ e.themeMode && e.themeMode !== a && r.set(y.themeMode, e.themeMode);
66
+ const i = t.product.theme?.locales?.[0];
67
+ e.locale && e.locale !== i && r.set(y.locale, e.locale);
68
+ const d = t.product.dataSources?.default ?? "fixtures";
69
+ e.dataSource && e.dataSource !== d && r.set(y.dataSource, e.dataSource), e.chromeTheme && r.set(y.chromeTheme, e.chromeTheme), e.chrome || r.set(y.chrome, "0"), e.inspector || r.set(y.inspector, "0"), e.panelTab === "info" && r.set(y.panelTab, "info");
70
+ const l = Ge(e.zoom === void 0 ? null : String(e.zoom));
71
+ l !== he && r.set(y.zoom, String(l)), e.rotated && r.set(y.rotated, "1"), e.highlight && r.set(y.highlight, "1"), Ce(r, e.handoff);
72
+ const c = r.toString();
73
+ return c ? `?${c}` : "";
74
+ }
75
+ function je(e, t = {}) {
76
+ const o = !!t.frame, [r, s] = z(() => pe()), a = j(r), i = W((m) => {
255
77
  a.current = m, s(m);
256
- }, []), l = q(!1), h = K((m) => {
257
- l.current = !0;
78
+ }, []), d = j(!1), l = W((m) => {
79
+ d.current = !0;
258
80
  try {
259
81
  window.history.replaceState(null, "", m);
260
82
  } finally {
261
- l.current = !1;
83
+ d.current = !1;
262
84
  }
263
85
  }, []);
264
- V(() => {
265
- const m = () => c(Ce());
86
+ I(() => {
87
+ const m = () => i(pe());
266
88
  return window.addEventListener("popstate", m), () => window.removeEventListener("popstate", m);
267
- }, [c]), V(() => {
268
- if (!n) return;
269
- const m = window.history, { pushState: w, replaceState: k } = m, x = (T) => {
270
- const d = a.current;
271
- if (window.location.pathname !== d.path) return !1;
272
- const g = Ae(d.search, he(window.location.href).search), C = ie(d.path, g);
273
- if (`${window.location.pathname}${window.location.search}` !== C && k.call(m, m.state, "", `${C}${window.location.hash}`), g === d.search) return !0;
274
- const F = { path: d.path, search: g };
275
- return a.current = F, queueMicrotask(() => {
276
- a.current === F && (s(F), se(
89
+ }, [i]), I(() => {
90
+ if (!o) return;
91
+ const m = window.history, { pushState: w, replaceState: g } = m, N = (T) => {
92
+ const L = a.current;
93
+ if (window.location.pathname !== L.path) return !1;
94
+ const P = Te(L.search, ce(window.location.href).search), A = re(L.path, P);
95
+ if (`${window.location.pathname}${window.location.search}` !== A && g.call(m, m.state, "", `${A}${window.location.hash}`), P === L.search) return !0;
96
+ const G = { path: L.path, search: P };
97
+ return a.current = G, queueMicrotask(() => {
98
+ a.current === G && (s(G), ne(
277
99
  window.parent === window ? void 0 : window.parent,
278
- { ds: 1, type: "navigate", url: C, replace: T },
100
+ { ds: 1, type: "navigate", url: A, replace: T },
279
101
  window.location.origin
280
102
  ));
281
103
  }), !0;
282
104
  };
283
- return m.replaceState = function(T, d, g) {
284
- k.call(m, T, d, g), l.current || x(!0);
285
- }, m.pushState = function(T, d, g) {
286
- const C = `${window.location.pathname}${window.location.search}${window.location.hash}`;
287
- k.call(m, T, d, g), !x(!1) && (k.call(m, m.state, "", C), w.call(m, T, d, g));
288
- }, x(!0), () => {
289
- m.pushState = w, m.replaceState = k;
105
+ return m.replaceState = function(T, L, P) {
106
+ g.call(m, T, L, P), d.current || N(!0);
107
+ }, m.pushState = function(T, L, P) {
108
+ const A = `${window.location.pathname}${window.location.search}${window.location.hash}`;
109
+ g.call(m, T, L, P), !N(!1) && (g.call(m, m.state, "", A), w.call(m, T, L, P));
110
+ }, N(!0), () => {
111
+ m.pushState = w, m.replaceState = g;
290
112
  };
291
- }, [n]), V(() => {
292
- if (!n || window.parent === window) return;
293
- const m = window.location.origin, w = (x) => {
294
- const T = Qe(x, { origin: m, source: window.parent });
113
+ }, [o]), I(() => {
114
+ if (!o || window.parent === window) return;
115
+ const m = window.location.origin, w = (N) => {
116
+ const T = qe(N, { origin: m, source: window.parent });
295
117
  if (T?.type !== "location") return;
296
- const { path: d, search: g } = he(T.url);
297
- h(ie(d, g)), c({ path: d, search: g });
118
+ const { path: L, search: P } = ce(T.url);
119
+ l(re(L, P)), i({ path: L, search: P });
298
120
  };
299
121
  window.addEventListener("message", w);
300
- const k = Ce();
301
- return se(
122
+ const g = pe();
123
+ return ne(
302
124
  window.parent,
303
- { ds: 1, type: "ready", url: ie(k.path, k.search) },
125
+ { ds: 1, type: "ready", url: re(g.path, g.search) },
304
126
  m
305
127
  ), () => window.removeEventListener("message", w);
306
- }, [n, c, h]);
307
- const p = A(
308
- () => Me(r.search, e, r.path),
128
+ }, [o, i, l]);
129
+ const c = $(
130
+ () => ge(r.search, e, r.path),
309
131
  [r.path, r.search, e]
310
- ), u = K(
311
- (m, w, k = !1) => {
312
- if (n) {
313
- const T = ie(m, w), d = he(T);
314
- h(T), c(d), se(
132
+ ), h = W(
133
+ (m, w, g = !1) => {
134
+ if (o) {
135
+ const T = re(m, w), L = ce(T);
136
+ l(T), i(L), ne(
315
137
  window.parent === window ? void 0 : window.parent,
316
- { ds: 1, type: "navigate", url: T, replace: k },
138
+ { ds: 1, type: "navigate", url: T, replace: g },
317
139
  window.location.origin
318
140
  );
319
141
  return;
320
142
  }
321
- const x = `${m}${w}`;
322
- k ? window.history.replaceState(null, "", x) : window.history.pushState(null, "", x), c({ path: m, search: w });
143
+ const N = `${m}${w}`;
144
+ g ? window.history.replaceState(null, "", N) : window.history.pushState(null, "", N), i({ path: m, search: w });
323
145
  },
324
- [n, c, h]
325
- ), i = K(() => {
146
+ [o, i, l]
147
+ ), u = W(() => {
326
148
  const m = a.current;
327
- return m === r ? p : Me(m.search, e, m.path);
328
- }, [p, r, e]), f = K(
149
+ return m === r ? c : ge(m.search, e, m.path);
150
+ }, [c, r, e]), p = W(
329
151
  (m) => {
330
- const w = a.current, k = { ...i(), ...m }, x = Ae(ae(k, e, w.path), w.search);
331
- x !== w.search && u(w.path, x, !0);
152
+ const w = a.current, g = { ...u(), ...m }, N = Te(oe(g, e, w.path), w.search);
153
+ N !== w.search && h(w.path, N, !0);
332
154
  },
333
- [i, u, e]
334
- ), S = K(
155
+ [u, h, e]
156
+ ), S = W(
335
157
  (m) => {
336
- const w = i().screenControls ?? {};
337
- Object.entries(m).some(([x, T]) => w[x] !== T) && f({ screenControls: { ...w, ...m } });
158
+ const w = u().screenControls ?? {};
159
+ Object.entries(m).some(([N, T]) => w[N] !== T) && p({ screenControls: { ...w, ...m } });
338
160
  },
339
- [i, f]
340
- ), N = K(
161
+ [u, p]
162
+ ), C = W(
341
163
  (m, w) => {
342
- const k = Kt(m, a.current, e, {
164
+ const g = Rt(m, a.current, e, {
343
165
  controls: w?.controls
344
166
  });
345
- u(k.path, k.search, w?.replace ?? !1);
167
+ h(g.path, g.search, w?.replace ?? !1);
346
168
  },
347
- [u, e]
348
- ), $ = K(
169
+ [h, e]
170
+ ), k = W(
349
171
  (m) => {
350
172
  const w = e.scenario(m);
351
- if (!w || !re(p.handoff, m)) return;
352
- const k = {
353
- ...p,
173
+ if (!w || !Ne(c.handoff, m)) return;
174
+ const g = {
175
+ ...c,
354
176
  scenario: w.id,
355
177
  component: void 0,
356
178
  persona: w.persona,
@@ -359,45 +181,45 @@ function et(e, t = {}) {
359
181
  // Os controles voltam ao que o cenário fixa, sobre os padrões da tela.
360
182
  screenControls: void 0
361
183
  };
362
- u(w.route, ae(k, e, w.route), !1);
184
+ h(w.route, oe(g, e, w.route), !1);
363
185
  },
364
- [p, u, e]
365
- ), _ = K(
186
+ [c, h, e]
187
+ ), E = W(
366
188
  (m, w) => {
367
- const k = e.component(m);
368
- if (!k || !be(p.handoff, m)) return;
369
- const x = {
370
- ...p,
189
+ const g = e.component(m);
190
+ if (!g || !Se(c.handoff, m)) return;
191
+ const N = {
192
+ ...c,
371
193
  scenario: void 0,
372
- component: k.id,
194
+ component: g.id,
373
195
  persona: void 0,
374
196
  fixture: void 0,
375
197
  network: "success",
376
198
  screenControls: void 0
377
199
  };
378
- x.fixture = e.componentFixture(k.id, k.defaultFixture)?.id ?? k.fixtures?.[0]?.id, u("/", ae(x, e), w?.replace ?? !1);
200
+ N.fixture = e.componentFixture(g.id, g.defaultFixture)?.id ?? g.fixtures?.[0]?.id, h("/", oe(N, e), w?.replace ?? !1);
379
201
  },
380
- [p, u, e]
381
- ), v = K(
202
+ [c, h, e]
203
+ ), v = W(
382
204
  (m, w) => {
383
- const k = e.screensFor({ handoff: p.handoff }).find((d) => d.id === m);
384
- if (!k) return;
385
- const x = k.variations[0];
386
- if (x) {
387
- const d = {
388
- ...p,
389
- scenario: x.id,
205
+ const g = e.screensFor({ handoff: c.handoff }).find((L) => L.id === m);
206
+ if (!g) return;
207
+ const N = g.variations[0];
208
+ if (N) {
209
+ const L = {
210
+ ...c,
211
+ scenario: N.id,
390
212
  component: void 0,
391
- persona: x.persona,
392
- fixture: x.fixture,
393
- network: x.network ?? "success",
213
+ persona: N.persona,
214
+ fixture: N.fixture,
215
+ network: N.network ?? "success",
394
216
  screenControls: void 0
395
217
  };
396
- u(x.route, ae(d, e, x.route), w?.replace ?? !1);
218
+ h(N.route, oe(L, e, N.route), w?.replace ?? !1);
397
219
  return;
398
220
  }
399
221
  const T = {
400
- ...p,
222
+ ...c,
401
223
  scenario: void 0,
402
224
  component: void 0,
403
225
  persona: void 0,
@@ -405,161 +227,161 @@ function et(e, t = {}) {
405
227
  network: "success",
406
228
  screenControls: void 0
407
229
  };
408
- u(k.href, ae(T, e, k.href), w?.replace ?? !1);
230
+ h(g.href, oe(T, e, g.href), w?.replace ?? !1);
409
231
  },
410
- [p, u, e]
411
- ), L = K(
412
- (m, w, k) => u(m || "/", w, k?.replace ?? !1),
413
- [u]
414
- ), b = A(() => Bt(p), [p]);
232
+ [c, h, e]
233
+ ), _ = W(
234
+ (m, w, g) => h(m || "/", w, g?.replace ?? !1),
235
+ [h]
236
+ ), f = $(() => At(c), [c]);
415
237
  return {
416
238
  location: r,
417
- controls: p,
418
- viewport: b,
419
- setControls: f,
239
+ controls: c,
240
+ viewport: f,
241
+ setControls: p,
420
242
  setScreenControls: S,
421
- navigate: N,
422
- openScenario: $,
423
- openComponent: _,
243
+ navigate: C,
244
+ openScenario: k,
245
+ openComponent: E,
424
246
  openScreen: v,
425
- go: L
247
+ go: _
426
248
  };
427
249
  }
428
- function Kt(e, t, n, r = {}) {
429
- const s = e.split("#")[0] ?? e, a = s.indexOf("?"), c = (a === -1 ? s : s.slice(0, a)) || "/", l = a === -1 ? void 0 : s.slice(a + 1), h = new URLSearchParams(t.search), p = Me(t.search, n, t.path), u = !Ht(n, c, t.path);
430
- let i;
431
- if (l === void 0 && r.controls === void 0)
432
- i = new URLSearchParams(t.search), u && (Mt(i), tt(i));
250
+ function Rt(e, t, o, r = {}) {
251
+ const s = e.split("#")[0] ?? e, a = s.indexOf("?"), i = (a === -1 ? s : s.slice(0, a)) || "/", d = a === -1 ? void 0 : s.slice(a + 1), l = new URLSearchParams(t.search), c = ge(t.search, o, t.path), h = !Pt(o, i, t.path);
252
+ let u;
253
+ if (d === void 0 && r.controls === void 0)
254
+ u = new URLSearchParams(t.search), h && (bt(u), Ve(u));
433
255
  else {
434
- const S = new URLSearchParams(l ?? "");
435
- i = new URLSearchParams();
436
- for (const [N, $] of h)
437
- !Wt(N) || S.has(N) || u && !Re(N) || i.append(N, $);
438
- p.scenario && !S.has(M.scenario) && p.persona && p.persona !== n.defaultPersona && !i.has(M.persona) && !S.has(M.persona) && i.set(M.persona, p.persona);
439
- for (const [N, $] of S) i.append(N, $);
256
+ const S = new URLSearchParams(d ?? "");
257
+ u = new URLSearchParams();
258
+ for (const [C, k] of l)
259
+ !Ft(C) || S.has(C) || h && !xe(C) || u.append(C, k);
260
+ c.scenario && !S.has(y.scenario) && c.persona && c.persona !== o.defaultPersona && !u.has(y.persona) && !S.has(y.persona) && u.set(y.persona, c.persona);
261
+ for (const [C, k] of S) u.append(C, k);
440
262
  if (r.controls) {
441
- const N = n.screenForPath(c), $ = n.scenario(i.get(M.scenario) ?? void 0), _ = $ && N && n.screenOf($)?.id === N.id ? $ : void 0, v = N ? n.resolveControls(N, { scenario: _ }).values : {};
442
- for (const [L, b] of Object.entries(r.controls)) {
443
- const m = `${ke}${L}`;
444
- v[L] === b ? i.delete(m) : i.set(m, b);
263
+ const C = o.screenForPath(i), k = o.scenario(u.get(y.scenario) ?? void 0), E = k && C && o.screenOf(k)?.id === C.id ? k : void 0, v = C ? o.resolveControls(C, { scenario: E }).values : {};
264
+ for (const [_, f] of Object.entries(r.controls)) {
265
+ const m = `${me}${_}`;
266
+ v[_] === f ? u.delete(m) : u.set(m, f);
445
267
  }
446
268
  }
447
269
  }
448
- p.handoff && Pe(i, p.handoff);
449
- const f = i.toString();
450
- return { path: c, search: f ? `?${f}` : "" };
270
+ c.handoff && Ce(u, c.handoff);
271
+ const p = u.toString();
272
+ return { path: i, search: p ? `?${p}` : "" };
451
273
  }
452
- function Ae(e, t) {
453
- const n = new URLSearchParams(e);
454
- tt(n);
274
+ function Te(e, t) {
275
+ const o = new URLSearchParams(e);
276
+ Ve(o);
455
277
  for (const [s, a] of new URLSearchParams(t))
456
- s === $t || Re(s) || n.append(s, a);
457
- const r = n.toString();
278
+ s === yt || xe(s) || o.append(s, a);
279
+ const r = o.toString();
458
280
  return r ? `?${r}` : "";
459
281
  }
460
- function tt(e) {
282
+ function Ve(e) {
461
283
  for (const t of [...e.keys()])
462
- Re(t) || e.delete(t);
284
+ xe(t) || e.delete(t);
463
285
  }
464
- function Ht(e, t, n) {
465
- const r = e.screenForPath(t)?.id, s = e.screenForPath(n)?.id;
466
- return r === void 0 && s === void 0 ? t === n : r === s;
286
+ function Pt(e, t, o) {
287
+ const r = e.screenForPath(t)?.id, s = e.screenForPath(o)?.id;
288
+ return r === void 0 && s === void 0 ? t === o : r === s;
467
289
  }
468
- function Wt(e) {
469
- return e.startsWith(ke) ? !1 : e !== M.scenario && e !== M.fixture && e !== M.component;
290
+ function Ft(e) {
291
+ return e.startsWith(me) ? !1 : e !== y.scenario && e !== y.fixture && e !== y.component;
470
292
  }
471
- function Bt(e) {
293
+ function At(e) {
472
294
  if (e.viewport === "custom")
473
295
  return { id: "custom", label: "Personalizado", width: e.customWidth ?? 1024 };
474
- const t = Vt.find((n) => n.id === e.viewport) ?? {
296
+ const t = Tt.find((o) => o.id === e.viewport) ?? {
475
297
  id: "fit",
476
298
  label: "Ajustar"
477
299
  };
478
300
  return e.rotated && t.width && t.height ? { ...t, width: t.height, height: t.width } : { ...t };
479
301
  }
480
- function nt(e) {
481
- if (e === null) return we;
302
+ function Ge(e) {
303
+ if (e === null) return he;
482
304
  const t = Number.parseInt(e, 10);
483
- return Number.isFinite(t) ? Math.min(Fe, Math.max(_e, t)) : we;
305
+ return Number.isFinite(t) ? Math.min(Ee, Math.max(Me, t)) : he;
484
306
  }
485
- function Ce() {
307
+ function pe() {
486
308
  return typeof window > "u" ? { path: "/", search: "" } : { path: window.location.pathname, search: window.location.search };
487
309
  }
488
- function jt(e) {
489
- return e !== null && Ye.includes(e);
310
+ function Ot(e) {
311
+ return e !== null && He.includes(e);
490
312
  }
491
- function qt(e) {
313
+ function $t(e) {
492
314
  return e === "dark" || e === "light";
493
315
  }
494
- function Gt(e) {
316
+ function zt(e) {
495
317
  return e === "variations" || e === "info";
496
318
  }
497
- function Zt(e) {
319
+ function Dt(e) {
498
320
  if (!e) return;
499
321
  const t = Number.parseInt(e, 10);
500
322
  return Number.isFinite(t) && t > 0 ? t : void 0;
501
323
  }
502
- const Yt = "@brucesantos/design-space", De = "0.13.0", Qt = {
503
- mobile: /* @__PURE__ */ y(G, { children: [
504
- /* @__PURE__ */ o("rect", { x: "7", y: "2.5", width: "10", height: "19", rx: "2" }),
505
- /* @__PURE__ */ o("path", { d: "M11 18.5h2" })
324
+ const Kt = "@brucesantos/design-space", Re = "0.14.1", It = {
325
+ mobile: /* @__PURE__ */ b(V, { children: [
326
+ /* @__PURE__ */ n("rect", { x: "7", y: "2.5", width: "10", height: "19", rx: "2" }),
327
+ /* @__PURE__ */ n("path", { d: "M11 18.5h2" })
506
328
  ] }),
507
- tablet: /* @__PURE__ */ y(G, { children: [
508
- /* @__PURE__ */ o("rect", { x: "4.5", y: "2.5", width: "15", height: "19", rx: "2" }),
509
- /* @__PURE__ */ o("path", { d: "M11 18.5h2" })
329
+ tablet: /* @__PURE__ */ b(V, { children: [
330
+ /* @__PURE__ */ n("rect", { x: "4.5", y: "2.5", width: "15", height: "19", rx: "2" }),
331
+ /* @__PURE__ */ n("path", { d: "M11 18.5h2" })
510
332
  ] }),
511
- desktop: /* @__PURE__ */ y(G, { children: [
512
- /* @__PURE__ */ o("rect", { x: "2.5", y: "4", width: "19", height: "12.5", rx: "1.5" }),
513
- /* @__PURE__ */ o("path", { d: "M8.5 20.5h7M12 16.5v4" })
333
+ desktop: /* @__PURE__ */ b(V, { children: [
334
+ /* @__PURE__ */ n("rect", { x: "2.5", y: "4", width: "19", height: "12.5", rx: "1.5" }),
335
+ /* @__PURE__ */ n("path", { d: "M8.5 20.5h7M12 16.5v4" })
514
336
  ] }),
515
- fit: /* @__PURE__ */ o("path", { d: "M3 12h7M3 12l3-3M3 12l3 3M21 12h-7M21 12l-3-3M21 12l-3 3" }),
516
- rotate: /* @__PURE__ */ y(G, { children: [
517
- /* @__PURE__ */ o("path", { d: "M20 12a8 8 0 1 1-2.34-5.66" }),
518
- /* @__PURE__ */ o("path", { d: "M20 4v4.5h-4.5" })
337
+ fit: /* @__PURE__ */ n("path", { d: "M3 12h7M3 12l3-3M3 12l3 3M21 12h-7M21 12l-3-3M21 12l-3 3" }),
338
+ rotate: /* @__PURE__ */ b(V, { children: [
339
+ /* @__PURE__ */ n("path", { d: "M20 12a8 8 0 1 1-2.34-5.66" }),
340
+ /* @__PURE__ */ n("path", { d: "M20 4v4.5h-4.5" })
519
341
  ] }),
520
- minus: /* @__PURE__ */ o("path", { d: "M5 12h14" }),
521
- plus: /* @__PURE__ */ o("path", { d: "M5 12h14M12 5v14" }),
522
- "arrow-up-right": /* @__PURE__ */ o("path", { d: "M7 17 17 7M8 7h9v9" }),
523
- link: /* @__PURE__ */ y(G, { children: [
524
- /* @__PURE__ */ o("path", { d: "M10 14a4 4 0 0 0 5.66 0l3-3a4 4 0 0 0-5.66-5.66l-1 1" }),
525
- /* @__PURE__ */ o("path", { d: "M14 10a4 4 0 0 0-5.66 0l-3 3a4 4 0 0 0 5.66 5.66l1-1" })
342
+ minus: /* @__PURE__ */ n("path", { d: "M5 12h14" }),
343
+ plus: /* @__PURE__ */ n("path", { d: "M5 12h14M12 5v14" }),
344
+ "arrow-up-right": /* @__PURE__ */ n("path", { d: "M7 17 17 7M8 7h9v9" }),
345
+ link: /* @__PURE__ */ b(V, { children: [
346
+ /* @__PURE__ */ n("path", { d: "M10 14a4 4 0 0 0 5.66 0l3-3a4 4 0 0 0-5.66-5.66l-1 1" }),
347
+ /* @__PURE__ */ n("path", { d: "M14 10a4 4 0 0 0-5.66 0l-3 3a4 4 0 0 0 5.66 5.66l1-1" })
526
348
  ] }),
527
- check: /* @__PURE__ */ o("path", { d: "M5 12.5l4.5 4.5L19 7.5" }),
528
- fullscreen: /* @__PURE__ */ o("path", { d: "M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5" }),
529
- components: /* @__PURE__ */ y(G, { children: [
530
- /* @__PURE__ */ o("rect", { x: "4", y: "4", width: "7", height: "7", rx: "1" }),
531
- /* @__PURE__ */ o("rect", { x: "13", y: "13", width: "7", height: "7", rx: "1" }),
532
- /* @__PURE__ */ o("path", { d: "M13 4h7v7M4 13v7h7", strokeDasharray: "2 2" })
349
+ check: /* @__PURE__ */ n("path", { d: "M5 12.5l4.5 4.5L19 7.5" }),
350
+ fullscreen: /* @__PURE__ */ n("path", { d: "M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5" }),
351
+ components: /* @__PURE__ */ b(V, { children: [
352
+ /* @__PURE__ */ n("rect", { x: "4", y: "4", width: "7", height: "7", rx: "1" }),
353
+ /* @__PURE__ */ n("rect", { x: "13", y: "13", width: "7", height: "7", rx: "1" }),
354
+ /* @__PURE__ */ n("path", { d: "M13 4h7v7M4 13v7h7", strokeDasharray: "2 2" })
533
355
  ] }),
534
- external: /* @__PURE__ */ y(G, { children: [
535
- /* @__PURE__ */ o("path", { d: "M14 4h6v6M20 4l-8.5 8.5" }),
536
- /* @__PURE__ */ o("path", { d: "M18 14v4.5a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 4 18.5v-11A1.5 1.5 0 0 1 5.5 6H10" })
356
+ external: /* @__PURE__ */ b(V, { children: [
357
+ /* @__PURE__ */ n("path", { d: "M14 4h6v6M20 4l-8.5 8.5" }),
358
+ /* @__PURE__ */ n("path", { d: "M18 14v4.5a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 4 18.5v-11A1.5 1.5 0 0 1 5.5 6H10" })
537
359
  ] }),
538
- sun: /* @__PURE__ */ y(G, { children: [
539
- /* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "4" }),
540
- /* @__PURE__ */ o("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" })
360
+ sun: /* @__PURE__ */ b(V, { children: [
361
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "4" }),
362
+ /* @__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" })
541
363
  ] }),
542
- moon: /* @__PURE__ */ o("path", { d: "M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5Z" }),
543
- panel: /* @__PURE__ */ y(G, { children: [
544
- /* @__PURE__ */ o("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
545
- /* @__PURE__ */ o("path", { d: "M15 4v16" })
364
+ 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" }),
365
+ panel: /* @__PURE__ */ b(V, { children: [
366
+ /* @__PURE__ */ n("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
367
+ /* @__PURE__ */ n("path", { d: "M15 4v16" })
546
368
  ] }),
547
- alert: /* @__PURE__ */ y(G, { children: [
548
- /* @__PURE__ */ o("circle", { cx: "12", cy: "12", r: "9" }),
549
- /* @__PURE__ */ o("path", { d: "M12 7.5v5.5M12 16.2v.3" })
369
+ alert: /* @__PURE__ */ b(V, { children: [
370
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "9" }),
371
+ /* @__PURE__ */ n("path", { d: "M12 7.5v5.5M12 16.2v.3" })
550
372
  ] }),
551
- chevron: /* @__PURE__ */ o("path", { d: "M9 6l6 6-6 6" }),
552
- search: /* @__PURE__ */ y(G, { children: [
553
- /* @__PURE__ */ o("circle", { cx: "11", cy: "11", r: "6.5" }),
554
- /* @__PURE__ */ o("path", { d: "M20 20l-4.2-4.2" })
373
+ chevron: /* @__PURE__ */ n("path", { d: "M9 6l6 6-6 6" }),
374
+ search: /* @__PURE__ */ b(V, { children: [
375
+ /* @__PURE__ */ n("circle", { cx: "11", cy: "11", r: "6.5" }),
376
+ /* @__PURE__ */ n("path", { d: "M20 20l-4.2-4.2" })
555
377
  ] }),
556
- copy: /* @__PURE__ */ y(G, { children: [
557
- /* @__PURE__ */ o("rect", { x: "8.5", y: "8.5", width: "12", height: "12", rx: "2" }),
558
- /* @__PURE__ */ o("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" })
378
+ copy: /* @__PURE__ */ b(V, { children: [
379
+ /* @__PURE__ */ n("rect", { x: "8.5", y: "8.5", width: "12", height: "12", rx: "2" }),
380
+ /* @__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" })
559
381
  ] })
560
382
  };
561
383
  function H({ name: e, size: t = 16 }) {
562
- return /* @__PURE__ */ o(
384
+ return /* @__PURE__ */ n(
563
385
  "svg",
564
386
  {
565
387
  className: "ds-icon",
@@ -573,384 +395,78 @@ function H({ name: e, size: t = 16 }) {
573
395
  strokeLinejoin: "round",
574
396
  "aria-hidden": "true",
575
397
  focusable: "false",
576
- children: Qt[e]
398
+ children: It[e]
577
399
  }
578
400
  );
579
401
  }
580
- const oe = {
581
- network: {
582
- success: "Sucesso",
583
- loading: "Carregando",
584
- empty: "Vazio",
585
- error: "Erro",
586
- slow: "Lento"
587
- },
588
- viewport: {
589
- fit: "Ajustar",
590
- mobile: "Celular",
591
- tablet: "Tablet",
592
- desktop: "Desktop",
593
- custom: "Personalizado"
594
- },
595
- topbar: {
596
- region: "Barra do Design Space",
597
- viewportGroup: "Viewport",
598
- rotate: "Girar",
599
- zoomOut: "Diminuir zoom",
600
- zoomIn: "Aumentar zoom",
601
- zoomReset: "Voltar o zoom para 100%",
602
- zoomValue: (e) => `${e}%`,
603
- copyLink: "Copiar link",
604
- copied: "Link copiado",
605
- copyPrompt: "Copie o link:",
606
- cleanReview: "Revisão limpa (Shift+C)",
607
- highlight: "Destacar componentes",
608
- openFrame: "Abrir em nova janela",
609
- lightMode: "Tema claro",
610
- darkMode: "Tema escuro",
611
- engineVersion: (e) => `Design Space ${e}`,
612
- diagnostics: (e, t) => `Diagnóstico: ${e} ${e === 1 ? "erro" : "erros"}, ${t} ${t === 1 ? "aviso" : "avisos"}`,
613
- branchTitle: (e) => `Branch: ${e}`,
614
- commitTitle: (e) => `Commit: ${e}`,
615
- envTitle: (e) => `Ambiente: ${e}`
616
- },
617
- highlight: {
618
- notInCatalog: (e) => `${e} · fora do catálogo`
619
- },
620
- sidebar: {
621
- region: "Navegação",
622
- tabs: "Telas e componentes",
623
- screensTab: "Telas",
624
- componentsTab: "Componentes",
625
- searchPlaceholder: "Buscar",
626
- searchLabel: "Buscar telas e componentes",
627
- searchShortcut: "⌘K",
628
- noMatch: (e) => `Nada encontrado para "${e}".`,
629
- emptyScreens: "Nenhuma tela neste branch. Telas de feature entram por PR, enquanto estão em desenho.",
630
- emptyComponents: "O produto ainda não registrou componentes.",
631
- ungrouped: "Outros",
632
- toggleGroup: (e) => `Mostrar ou ocultar ${e}`,
633
- resize: "Redimensionar a navegação"
634
- },
635
- panel: {
636
- region: "Painel",
637
- searchPlaceholder: "Filtrar",
638
- searchLabel: "Filtrar variações e informações",
639
- searchShortcut: "⌘F",
640
- noMatch: (e) => `Nada neste painel para "${e}".`,
641
- tabs: "Variações e informações",
642
- variationsTab: "Variações",
643
- infoTab: "Informações",
644
- resize: "Redimensionar o painel",
645
- variationsList: "Variações da tela",
646
- componentVariations: "Variações do componente",
647
- defaultVariation: "Padrão",
648
- defaultVariationHint: "A tela sem cenário declarado, sem fixture.",
649
- noVariations: "Esta tela não tem variações.",
650
- noComponentVariations: "Este componente não declara variações de dados.",
651
- nothingSelected: "Escolha uma tela ou um componente na navegação.",
652
- persona: "Persona",
653
- network: "Estado de rede",
654
- theme: "Tema",
655
- locale: "Idioma",
656
- dataSource: "Fonte de dados",
657
- fixturesOption: "Fixtures",
658
- none: "—",
659
- fixtureFallback: (e, t) => `A variação \`${e}\` não existe neste componente. Exibindo \`${t}\`.`,
660
- context: "Contexto",
661
- shortcuts: "Atalhos",
662
- toggleGroup: (e) => `Mostrar ou ocultar ${e}`,
663
- openComponent: (e) => `Abrir ${e} no catálogo`
664
- },
665
- info: {
666
- screen: "Tela",
667
- variation: "Variação",
668
- component: "Componente",
669
- name: "Nome",
670
- id: "Id",
671
- group: "Grupo",
672
- description: "Descrição",
673
- source: "Origem",
674
- usedIn: "Usado em",
675
- notUsed: "Nenhuma tela declara este componente.",
676
- route: "Rota",
677
- persona: "Persona",
678
- permissions: "Permissões",
679
- intent: "Intenção",
680
- preconditions: "Pré-condições",
681
- actions: "Ações",
682
- expected: "Comportamento esperado",
683
- rules: "Regras",
684
- components: "Componentes usados",
685
- ticket: "Ticket",
686
- flow: "Fluxo",
687
- controls: "Controles",
688
- copyForPr: "Copiar para o PR",
689
- copiedForPr: "Copiado",
690
- copyPrompt: "Copie o texto para o PR:"
691
- },
692
- diagnostics: {
693
- title: "Diagnóstico",
694
- noIssues: "Nenhum problema encontrado.",
695
- error: "Erro",
696
- warning: "Aviso",
697
- close: "Fechar diagnóstico",
698
- invalidControl: (e, t, n) => `O controle \`${e}\` não tem a opção \`${t}\`. Exibindo \`${n}\`.`,
699
- unknownControl: (e, t) => `A tela não tem o controle \`${e}\` (pedido \`${t}\` na URL). O parâmetro foi ignorado.`
700
- },
701
- pr: {
702
- variations: "Variações",
703
- components: "Componentes",
704
- component: "Componente",
705
- source: "Origem",
706
- expected: "Comportamento esperado",
707
- commit: (e) => `Commit \`${e}\``,
708
- immutableLink: "link deste deployment",
709
- noExpected: "Sem comportamento esperado declarado.",
710
- empty: "—",
711
- open: "Abrir a tela",
712
- controls: "Controles",
713
- shortcuts: "Atalhos",
714
- defaultOption: "padrão"
715
- },
716
- shell: {
717
- restoreChrome: "Mostrar o chrome (Shift+C)",
718
- frameTitle: (e) => `Pré-visualização de ${e}`,
719
- noRoute: "Nenhuma rota para este endereço",
720
- noRouteHint: "não casa com nenhuma rota declarada. Escolha uma tela na navegação.",
721
- outsideHandoff: "Fora do escopo deste handoff",
722
- outsideHandoffHint: "Este link permite revisar somente os cenários, rotas e componentes listados no handoff. Escolha um item disponível na navegação.",
723
- empty: "Nada para mostrar ainda",
724
- emptyHint: "O produto ainda não registrou telas nem componentes."
725
- }
726
- }, Vn = {
727
- network: {
728
- success: "Success",
729
- loading: "Loading",
730
- empty: "Empty",
731
- error: "Error",
732
- slow: "Slow"
733
- },
734
- viewport: {
735
- fit: "Fit",
736
- mobile: "Mobile",
737
- tablet: "Tablet",
738
- desktop: "Desktop",
739
- custom: "Custom"
740
- },
741
- topbar: {
742
- region: "Design Space bar",
743
- viewportGroup: "Viewport",
744
- rotate: "Rotate",
745
- zoomOut: "Zoom out",
746
- zoomIn: "Zoom in",
747
- zoomReset: "Reset zoom to 100%",
748
- zoomValue: (e) => `${e}%`,
749
- copyLink: "Copy link",
750
- copied: "Link copied",
751
- copyPrompt: "Copy the link:",
752
- cleanReview: "Clean review (Shift+C)",
753
- highlight: "Highlight components",
754
- openFrame: "Open in new window",
755
- lightMode: "Light theme",
756
- darkMode: "Dark theme",
757
- engineVersion: (e) => `Design Space ${e}`,
758
- diagnostics: (e, t) => `Diagnostics: ${e} ${e === 1 ? "error" : "errors"}, ${t} ${t === 1 ? "warning" : "warnings"}`,
759
- branchTitle: (e) => `Branch: ${e}`,
760
- commitTitle: (e) => `Commit: ${e}`,
761
- envTitle: (e) => `Environment: ${e}`
762
- },
763
- highlight: {
764
- notInCatalog: (e) => `${e} · not in catalog`
765
- },
766
- sidebar: {
767
- region: "Navigation",
768
- tabs: "Screens and components",
769
- screensTab: "Screens",
770
- componentsTab: "Components",
771
- searchPlaceholder: "Search",
772
- searchLabel: "Search screens and components",
773
- searchShortcut: "⌘K",
774
- noMatch: (e) => `Nothing found for "${e}".`,
775
- emptyScreens: "No screens on this branch. Feature screens come in through a pull request while they are being designed.",
776
- emptyComponents: "The product has not registered any components yet.",
777
- ungrouped: "Other",
778
- toggleGroup: (e) => `Show or hide ${e}`,
779
- resize: "Resize navigation"
780
- },
781
- panel: {
782
- region: "Panel",
783
- searchPlaceholder: "Filter",
784
- searchLabel: "Filter variations and details",
785
- searchShortcut: "⌘F",
786
- noMatch: (e) => `Nothing in this panel for "${e}".`,
787
- tabs: "Variations and information",
788
- variationsTab: "Variations",
789
- infoTab: "Information",
790
- resize: "Resize panel",
791
- variationsList: "Screen variations",
792
- componentVariations: "Component variations",
793
- defaultVariation: "Default",
794
- defaultVariationHint: "The screen without a declared scenario or fixture.",
795
- noVariations: "This screen has no variations.",
796
- noComponentVariations: "This component does not declare data variations.",
797
- nothingSelected: "Choose a screen or a component in the navigation.",
798
- persona: "Persona",
799
- network: "Network state",
800
- theme: "Theme",
801
- locale: "Language",
802
- dataSource: "Data source",
803
- fixturesOption: "Fixtures",
804
- none: "—",
805
- fixtureFallback: (e, t) => `Variation \`${e}\` does not exist for this component. Showing \`${t}\`.`,
806
- context: "Context",
807
- shortcuts: "Shortcuts",
808
- toggleGroup: (e) => `Show or hide ${e}`,
809
- openComponent: (e) => `Open ${e} in the catalog`
810
- },
811
- info: {
812
- screen: "Screen",
813
- variation: "Variation",
814
- component: "Component",
815
- name: "Name",
816
- id: "ID",
817
- group: "Group",
818
- description: "Description",
819
- source: "Source",
820
- usedIn: "Used in",
821
- notUsed: "No screen declares this component.",
822
- route: "Route",
823
- persona: "Persona",
824
- permissions: "Permissions",
825
- intent: "Intent",
826
- preconditions: "Preconditions",
827
- actions: "Actions",
828
- expected: "Expected behavior",
829
- rules: "Rules",
830
- components: "Components used",
831
- ticket: "Ticket",
832
- flow: "Flow",
833
- controls: "Controls",
834
- copyForPr: "Copy for PR",
835
- copiedForPr: "Copied",
836
- copyPrompt: "Copy the text for the PR:"
837
- },
838
- diagnostics: {
839
- title: "Diagnostics",
840
- noIssues: "No issues found.",
841
- error: "Error",
842
- warning: "Warning",
843
- close: "Close diagnostics",
844
- invalidControl: (e, t, n) => `Control \`${e}\` has no option \`${t}\`. Showing \`${n}\`.`,
845
- unknownControl: (e, t) => `This screen has no control \`${e}\` (\`${t}\` requested in the URL). The parameter was ignored.`
846
- },
847
- pr: {
848
- variations: "Variations",
849
- components: "Components",
850
- component: "Component",
851
- source: "Source",
852
- expected: "Expected behavior",
853
- commit: (e) => `Commit \`${e}\``,
854
- immutableLink: "this deployment",
855
- noExpected: "No expected behavior declared.",
856
- empty: "—",
857
- open: "Open the screen",
858
- controls: "Controls",
859
- shortcuts: "Shortcuts",
860
- defaultOption: "default"
861
- },
862
- shell: {
863
- restoreChrome: "Show chrome (Shift+C)",
864
- frameTitle: (e) => `${e} preview`,
865
- noRoute: "No route for this address",
866
- noRouteHint: "does not match any declared route. Choose a screen from the navigation.",
867
- outsideHandoff: "Outside this handoff scope",
868
- outsideHandoffHint: "This link only allows review of the scenarios, routes, and components listed in the handoff. Choose an available item from the navigation.",
869
- empty: "Nothing to show yet",
870
- emptyHint: "The product has not registered any screens or components yet."
871
- }
872
- };
873
- function Xt(e) {
874
- if (!e) return oe;
875
- const t = { ...oe };
876
- for (const n of Object.keys(oe)) {
877
- const r = e[n];
878
- r && (t[n] = { ...oe[n], ...r });
879
- }
880
- return t;
881
- }
882
- const ot = Ct(oe);
883
- function J() {
884
- return St(ot);
885
- }
886
- const Kn = oe.network, Jt = [
402
+ const Wt = [
887
403
  { id: "mobile", icon: "mobile" },
888
404
  { id: "tablet", icon: "tablet" },
889
405
  { id: "desktop", icon: "desktop" },
890
406
  { id: "fit", icon: "fit" }
891
- ], Ie = [25, 33, 50, 67, 75, 90, 100, 110, 125, 150];
892
- function Ue(e, t) {
893
- return t > 0 ? Ie.find((n) => n > e) ?? Fe : [...Ie].reverse().find((n) => n < e) ?? _e;
407
+ ], Pe = [25, 33, 50, 67, 75, 90, 100, 110, 125, 150];
408
+ function Fe(e, t) {
409
+ return t > 0 ? Pe.find((o) => o > e) ?? Ee : [...Pe].reverse().find((o) => o < e) ?? Me;
894
410
  }
895
- function en({
411
+ function Ut({
896
412
  productName: e,
897
413
  viewportId: t,
898
- viewport: n,
414
+ viewport: o,
899
415
  zoom: r,
900
416
  rotated: s,
901
417
  highlight: a,
902
- theme: c,
903
- issues: l,
904
- linkUrl: h,
905
- onViewport: p,
906
- onRotate: u,
907
- onZoom: i,
908
- onHighlight: f,
418
+ theme: i,
419
+ issues: d,
420
+ linkUrl: l,
421
+ onViewport: c,
422
+ onRotate: h,
423
+ onZoom: u,
424
+ onHighlight: p,
909
425
  onCleanReview: S,
910
- onOpenFrame: N,
911
- onToggleTheme: $
426
+ onOpenFrame: C,
427
+ onToggleTheme: k
912
428
  }) {
913
- const _ = J(), v = _.topbar, [L, b] = D(!1), m = (t === "mobile" || t === "tablet") && !!(n.width && n.height), w = async () => {
429
+ const E = X(), v = E.topbar, [_, f] = z(!1), m = (t === "mobile" || t === "tablet") && !!(o.width && o.height), w = async () => {
914
430
  try {
915
- await navigator.clipboard.writeText(h);
431
+ await navigator.clipboard.writeText(l);
916
432
  } catch {
917
- window.prompt(v.copyPrompt, h);
433
+ window.prompt(v.copyPrompt, l);
918
434
  }
919
- b(!0), window.setTimeout(() => b(!1), 1600);
435
+ f(!0), window.setTimeout(() => f(!1), 1600);
920
436
  };
921
- return /* @__PURE__ */ y("header", { className: "ds-topbar", "aria-label": v.region, children: [
922
- /* @__PURE__ */ y("div", { className: "ds-topbar__product", children: [
923
- /* @__PURE__ */ o("span", { className: "ds-topbar__name", children: e }),
924
- /* @__PURE__ */ o(
437
+ return /* @__PURE__ */ b("header", { className: "ds-topbar", "aria-label": v.region, children: [
438
+ /* @__PURE__ */ b("div", { className: "ds-topbar__product", children: [
439
+ /* @__PURE__ */ n("span", { className: "ds-topbar__name", children: e }),
440
+ /* @__PURE__ */ n(
925
441
  "a",
926
442
  {
927
443
  className: "ds-topbar__version",
928
- href: `https://www.npmjs.com/package/${Yt}/v/${De}`,
444
+ href: `https://www.npmjs.com/package/${Kt}/v/${Re}`,
929
445
  target: "_blank",
930
446
  rel: "noreferrer",
931
- children: v.engineVersion(De)
447
+ children: v.engineVersion(Re)
932
448
  }
933
449
  )
934
450
  ] }),
935
- /* @__PURE__ */ y("div", { className: "ds-topbar__view", children: [
936
- /* @__PURE__ */ y("div", { className: "ds-group", role: "group", "aria-label": v.viewportGroup, children: [
937
- Jt.map((k) => {
938
- const x = _.viewport[k.id] ?? k.id;
939
- return /* @__PURE__ */ o(
451
+ /* @__PURE__ */ b("div", { className: "ds-topbar__view", children: [
452
+ /* @__PURE__ */ b("div", { className: "ds-group", role: "group", "aria-label": v.viewportGroup, children: [
453
+ Wt.map((g) => {
454
+ const N = E.viewport[g.id] ?? g.id;
455
+ return /* @__PURE__ */ n(
940
456
  "button",
941
457
  {
942
458
  type: "button",
943
459
  className: "ds-btn ds-btn--icon",
944
- "aria-pressed": t === k.id,
945
- "aria-label": x,
946
- title: x,
947
- onClick: () => p(k.id),
948
- children: /* @__PURE__ */ o(H, { name: k.icon })
460
+ "aria-pressed": t === g.id,
461
+ "aria-label": N,
462
+ title: N,
463
+ onClick: () => c(g.id),
464
+ children: /* @__PURE__ */ n(H, { name: g.icon })
949
465
  },
950
- k.id
466
+ g.id
951
467
  );
952
468
  }),
953
- /* @__PURE__ */ o(
469
+ /* @__PURE__ */ n(
954
470
  "button",
955
471
  {
956
472
  type: "button",
@@ -959,49 +475,49 @@ function en({
959
475
  "aria-label": v.rotate,
960
476
  title: v.rotate,
961
477
  disabled: !m,
962
- onClick: u,
963
- children: /* @__PURE__ */ o(H, { name: "rotate" })
478
+ onClick: h,
479
+ children: /* @__PURE__ */ n(H, { name: "rotate" })
964
480
  }
965
481
  )
966
482
  ] }),
967
- /* @__PURE__ */ y("div", { className: "ds-group", role: "group", children: [
968
- /* @__PURE__ */ o(
483
+ /* @__PURE__ */ b("div", { className: "ds-group", role: "group", children: [
484
+ /* @__PURE__ */ n(
969
485
  "button",
970
486
  {
971
487
  type: "button",
972
488
  className: "ds-btn ds-btn--icon",
973
489
  "aria-label": v.zoomOut,
974
490
  title: v.zoomOut,
975
- disabled: r <= _e,
976
- onClick: () => i(Ue(r, -1)),
977
- children: /* @__PURE__ */ o(H, { name: "minus" })
491
+ disabled: r <= Me,
492
+ onClick: () => u(Fe(r, -1)),
493
+ children: /* @__PURE__ */ n(H, { name: "minus" })
978
494
  }
979
495
  ),
980
- /* @__PURE__ */ o(
496
+ /* @__PURE__ */ n(
981
497
  "button",
982
498
  {
983
499
  type: "button",
984
500
  className: "ds-btn ds-btn--zoom",
985
501
  "aria-label": v.zoomReset,
986
502
  title: v.zoomReset,
987
- onClick: () => i(we),
503
+ onClick: () => u(he),
988
504
  children: v.zoomValue(r)
989
505
  }
990
506
  ),
991
- /* @__PURE__ */ o(
507
+ /* @__PURE__ */ n(
992
508
  "button",
993
509
  {
994
510
  type: "button",
995
511
  className: "ds-btn ds-btn--icon",
996
512
  "aria-label": v.zoomIn,
997
513
  title: v.zoomIn,
998
- disabled: r >= Fe,
999
- onClick: () => i(Ue(r, 1)),
1000
- children: /* @__PURE__ */ o(H, { name: "plus" })
514
+ disabled: r >= Ee,
515
+ onClick: () => u(Fe(r, 1)),
516
+ children: /* @__PURE__ */ n(H, { name: "plus" })
1001
517
  }
1002
518
  )
1003
519
  ] }),
1004
- /* @__PURE__ */ o(
520
+ /* @__PURE__ */ n(
1005
521
  "button",
1006
522
  {
1007
523
  type: "button",
@@ -1009,11 +525,11 @@ function en({
1009
525
  "aria-pressed": a,
1010
526
  "aria-label": v.highlight,
1011
527
  title: v.highlight,
1012
- onClick: f,
1013
- children: /* @__PURE__ */ o(H, { name: "components" })
528
+ onClick: p,
529
+ children: /* @__PURE__ */ n(H, { name: "components" })
1014
530
  }
1015
531
  ),
1016
- /* @__PURE__ */ o(
532
+ /* @__PURE__ */ n(
1017
533
  "button",
1018
534
  {
1019
535
  type: "button",
@@ -1021,107 +537,107 @@ function en({
1021
537
  "aria-label": v.cleanReview,
1022
538
  title: v.cleanReview,
1023
539
  onClick: S,
1024
- children: /* @__PURE__ */ o(H, { name: "fullscreen" })
540
+ children: /* @__PURE__ */ n(H, { name: "fullscreen" })
1025
541
  }
1026
542
  ),
1027
- /* @__PURE__ */ o(
543
+ /* @__PURE__ */ n(
1028
544
  "button",
1029
545
  {
1030
546
  type: "button",
1031
547
  className: "ds-btn ds-btn--icon",
1032
548
  "aria-label": v.openFrame,
1033
549
  title: v.openFrame,
1034
- onClick: N,
1035
- children: /* @__PURE__ */ o(H, { name: "external" })
550
+ onClick: C,
551
+ children: /* @__PURE__ */ n(H, { name: "external" })
1036
552
  }
1037
553
  )
1038
554
  ] }),
1039
- /* @__PURE__ */ y("div", { className: "ds-topbar__tools", children: [
1040
- /* @__PURE__ */ o(
555
+ /* @__PURE__ */ b("div", { className: "ds-topbar__tools", children: [
556
+ /* @__PURE__ */ n(
1041
557
  "button",
1042
558
  {
1043
559
  type: "button",
1044
560
  className: "ds-btn ds-btn--icon",
1045
- "aria-label": L ? v.copied : v.copyLink,
1046
- title: L ? v.copied : v.copyLink,
561
+ "aria-label": _ ? v.copied : v.copyLink,
562
+ title: _ ? v.copied : v.copyLink,
1047
563
  onClick: w,
1048
- children: /* @__PURE__ */ o(H, { name: L ? "check" : "link" })
564
+ children: /* @__PURE__ */ n(H, { name: _ ? "check" : "link" })
1049
565
  }
1050
566
  ),
1051
- /* @__PURE__ */ o(
567
+ /* @__PURE__ */ n(
1052
568
  "button",
1053
569
  {
1054
570
  type: "button",
1055
571
  className: "ds-btn ds-btn--icon",
1056
- "aria-label": c === "dark" ? v.lightMode : v.darkMode,
1057
- title: c === "dark" ? v.lightMode : v.darkMode,
1058
- onClick: $,
1059
- children: /* @__PURE__ */ o(H, { name: c === "dark" ? "sun" : "moon" })
572
+ "aria-label": i === "dark" ? v.lightMode : v.darkMode,
573
+ title: i === "dark" ? v.lightMode : v.darkMode,
574
+ onClick: k,
575
+ children: /* @__PURE__ */ n(H, { name: i === "dark" ? "sun" : "moon" })
1060
576
  }
1061
577
  ),
1062
- l.length > 0 && /* @__PURE__ */ o(tn, { issues: l })
578
+ d.length > 0 && /* @__PURE__ */ n(Ht, { issues: d })
1063
579
  ] })
1064
580
  ] });
1065
581
  }
1066
- function tn({ issues: e }) {
1067
- const t = J(), [n, r] = D(!1), s = q(null), a = e.filter((h) => h.level === "error").length, c = e.length - a, l = t.topbar.diagnostics(a, c);
1068
- return V(() => {
1069
- if (!n) return;
1070
- const h = (u) => {
1071
- s.current?.contains(u.target) || r(!1);
1072
- }, p = (u) => {
1073
- u.key === "Escape" && r(!1);
582
+ function Ht({ issues: e }) {
583
+ const t = X(), [o, r] = z(!1), s = j(null), a = e.filter((l) => l.level === "error").length, i = e.length - a, d = t.topbar.diagnostics(a, i);
584
+ return I(() => {
585
+ if (!o) return;
586
+ const l = (h) => {
587
+ s.current?.contains(h.target) || r(!1);
588
+ }, c = (h) => {
589
+ h.key === "Escape" && r(!1);
1074
590
  };
1075
- return window.addEventListener("pointerdown", h), window.addEventListener("keydown", p), () => {
1076
- window.removeEventListener("pointerdown", h), window.removeEventListener("keydown", p);
591
+ return window.addEventListener("pointerdown", l), window.addEventListener("keydown", c), () => {
592
+ window.removeEventListener("pointerdown", l), window.removeEventListener("keydown", c);
1077
593
  };
1078
- }, [n]), /* @__PURE__ */ y("div", { className: "ds-diagnostics", ref: s, children: [
1079
- /* @__PURE__ */ y(
594
+ }, [o]), /* @__PURE__ */ b("div", { className: "ds-diagnostics", ref: s, children: [
595
+ /* @__PURE__ */ b(
1080
596
  "button",
1081
597
  {
1082
598
  type: "button",
1083
599
  className: "ds-btn ds-diagnostics__trigger",
1084
600
  "data-level": a > 0 ? "error" : "warning",
1085
- "aria-expanded": n,
1086
- "aria-label": l,
1087
- title: l,
1088
- onClick: () => r((h) => !h),
601
+ "aria-expanded": o,
602
+ "aria-label": d,
603
+ title: d,
604
+ onClick: () => r((l) => !l),
1089
605
  children: [
1090
- /* @__PURE__ */ o(H, { name: "alert" }),
1091
- /* @__PURE__ */ o("span", { children: a > 0 ? a : c })
606
+ /* @__PURE__ */ n(H, { name: "alert" }),
607
+ /* @__PURE__ */ n("span", { children: a > 0 ? a : i })
1092
608
  ]
1093
609
  }
1094
610
  ),
1095
- n && /* @__PURE__ */ y("div", { className: "ds-diagnostics__popover", role: "dialog", "aria-label": t.diagnostics.title, children: [
1096
- /* @__PURE__ */ y("div", { className: "ds-diagnostics__head", children: [
1097
- /* @__PURE__ */ o("strong", { children: t.diagnostics.title }),
1098
- /* @__PURE__ */ o("span", { className: "ds-muted", children: l })
611
+ o && /* @__PURE__ */ b("div", { className: "ds-diagnostics__popover", role: "dialog", "aria-label": t.diagnostics.title, children: [
612
+ /* @__PURE__ */ b("div", { className: "ds-diagnostics__head", children: [
613
+ /* @__PURE__ */ n("strong", { children: t.diagnostics.title }),
614
+ /* @__PURE__ */ n("span", { className: "ds-muted", children: d })
1099
615
  ] }),
1100
- /* @__PURE__ */ o("ul", { className: "ds-diagnostics__list", children: e.map((h, p) => /* @__PURE__ */ y("li", { className: "ds-diagnostics__item", "data-level": h.level, children: [
1101
- /* @__PURE__ */ o("span", { className: "ds-diagnostics__level", children: h.level === "error" ? t.diagnostics.error : t.diagnostics.warning }),
1102
- /* @__PURE__ */ o("code", { className: "ds-diagnostics__where", children: h.where }),
1103
- /* @__PURE__ */ o("span", { className: "ds-diagnostics__message", children: h.message })
1104
- ] }, `${h.where}-${p}`)) })
616
+ /* @__PURE__ */ n("ul", { className: "ds-diagnostics__list", children: e.map((l, c) => /* @__PURE__ */ b("li", { className: "ds-diagnostics__item", "data-level": l.level, children: [
617
+ /* @__PURE__ */ n("span", { className: "ds-diagnostics__level", children: l.level === "error" ? t.diagnostics.error : t.diagnostics.warning }),
618
+ /* @__PURE__ */ n("code", { className: "ds-diagnostics__where", children: l.where }),
619
+ /* @__PURE__ */ n("span", { className: "ds-diagnostics__message", children: l.message })
620
+ ] }, `${l.where}-${c}`)) })
1105
621
  ] })
1106
622
  ] });
1107
623
  }
1108
- const nn = 16;
1109
- function rt({ side: e, label: t, value: n, onChange: r, onStart: s, onEnd: a }) {
1110
- const c = q(void 0), l = e === "left" ? 1 : -1, h = (f) => {
1111
- if (f.button === 0) {
1112
- f.preventDefault(), c.current = { x: f.clientX, width: n };
624
+ const qt = 16;
625
+ function Ze({ side: e, label: t, value: o, onChange: r, onStart: s, onEnd: a }) {
626
+ const i = j(void 0), d = e === "left" ? 1 : -1, l = (p) => {
627
+ if (p.button === 0) {
628
+ p.preventDefault(), i.current = { x: p.clientX, width: o };
1113
629
  try {
1114
- f.currentTarget.setPointerCapture(f.pointerId);
630
+ p.currentTarget.setPointerCapture(p.pointerId);
1115
631
  } catch {
1116
632
  }
1117
633
  s?.();
1118
634
  }
1119
- }, p = (f) => {
1120
- c.current && r(c.current.width + (f.clientX - c.current.x) * l);
1121
- }, u = () => {
1122
- c.current && (c.current = void 0, a?.());
635
+ }, c = (p) => {
636
+ i.current && r(i.current.width + (p.clientX - i.current.x) * d);
637
+ }, h = () => {
638
+ i.current && (i.current = void 0, a?.());
1123
639
  };
1124
- return /* @__PURE__ */ o(
640
+ return /* @__PURE__ */ n(
1125
641
  "div",
1126
642
  {
1127
643
  className: "ds-resizer",
@@ -1129,177 +645,177 @@ function rt({ side: e, label: t, value: n, onChange: r, onStart: s, onEnd: a })
1129
645
  role: "separator",
1130
646
  "aria-orientation": "vertical",
1131
647
  "aria-label": t,
1132
- "aria-valuenow": n,
648
+ "aria-valuenow": o,
1133
649
  tabIndex: 0,
1134
- onPointerDown: h,
1135
- onPointerMove: p,
1136
- onPointerUp: u,
1137
- onPointerCancel: u,
1138
- onLostPointerCapture: u,
1139
- onKeyDown: (f) => {
1140
- if (f.key !== "ArrowLeft" && f.key !== "ArrowRight") return;
1141
- f.preventDefault();
1142
- const S = f.key === "ArrowRight" ? 1 : -1;
1143
- r(n + S * l * nn);
650
+ onPointerDown: l,
651
+ onPointerMove: c,
652
+ onPointerUp: h,
653
+ onPointerCancel: h,
654
+ onLostPointerCapture: h,
655
+ onKeyDown: (p) => {
656
+ if (p.key !== "ArrowLeft" && p.key !== "ArrowRight") return;
657
+ p.preventDefault();
658
+ const S = p.key === "ArrowRight" ? 1 : -1;
659
+ r(o + S * d * qt);
1144
660
  }
1145
661
  }
1146
662
  );
1147
663
  }
1148
- function on({
664
+ function Bt({
1149
665
  registry: e,
1150
666
  handoff: t,
1151
- activeScreen: n,
667
+ activeScreen: o,
1152
668
  activeComponent: r,
1153
669
  onOpenScreen: s,
1154
670
  onOpenComponent: a,
1155
- width: c,
1156
- onResize: l,
1157
- onResizeStart: h,
1158
- onResizeEnd: p
671
+ width: i,
672
+ onResize: d,
673
+ onResizeStart: l,
674
+ onResizeEnd: c
1159
675
  }) {
1160
- const i = J().sidebar, [f, S] = D(""), [N, $] = D(() => /* @__PURE__ */ new Set()), _ = q(null), v = e.screensFor({ handoff: t }), L = e.componentsFor(t), b = v.length > 0, m = L.length > 0, [w, k] = D(
1161
- () => r || !b ? "components" : "screens"
676
+ const u = X().sidebar, [p, S] = z(""), [C, k] = z(() => /* @__PURE__ */ new Set()), E = j(null), v = e.screensFor({ handoff: t }), _ = e.componentsFor(t), f = v.length > 0, m = _.length > 0, [w, g] = z(
677
+ () => r || !f ? "components" : "screens"
1162
678
  );
1163
- V(() => {
1164
- r && m ? k("components") : n && b && k("screens");
1165
- }, [r, n, m, b]);
1166
- const x = w;
1167
- V(() => {
1168
- const O = (I) => {
1169
- an(I) && (I.preventDefault(), _.current?.focus(), _.current?.select());
679
+ I(() => {
680
+ r && m ? g("components") : o && f && g("screens");
681
+ }, [r, o, m, f]);
682
+ const N = w;
683
+ I(() => {
684
+ const F = (D) => {
685
+ Gt(D) && (D.preventDefault(), E.current?.focus(), E.current?.select());
1170
686
  };
1171
- return window.addEventListener("keydown", O), () => window.removeEventListener("keydown", O);
687
+ return window.addEventListener("keydown", F), () => window.removeEventListener("keydown", F);
1172
688
  }, []);
1173
- const T = A(
1174
- () => e.searchScreens(f, { handoff: t }),
1175
- [t, f, e]
1176
- ), d = A(
1177
- () => e.searchComponents(f, t),
1178
- [t, f, e]
1179
- ), g = A(() => sn(d, i.ungrouped), [d, i.ungrouped]), C = A(() => Xe(T), [T]), E = f.trim().length > 0, F = (O) => $((I) => {
1180
- const P = new Set(I);
1181
- return P.has(O) ? P.delete(O) : P.add(O), P;
689
+ const T = $(
690
+ () => e.searchScreens(p, { handoff: t }),
691
+ [t, p, e]
692
+ ), L = $(
693
+ () => e.searchComponents(p, t),
694
+ [t, p, e]
695
+ ), P = $(() => Vt(L, u.ungrouped), [L, u.ungrouped]), A = $(() => ht(T), [T]), O = p.trim().length > 0, G = (F) => k((D) => {
696
+ const x = new Set(D);
697
+ return x.has(F) ? x.delete(F) : x.add(F), x;
1182
698
  });
1183
- return /* @__PURE__ */ y("nav", { className: "ds-sidebar", "aria-label": i.region, style: { width: c }, children: [
1184
- /* @__PURE__ */ y("div", { className: "ds-search", children: [
1185
- /* @__PURE__ */ o(H, { name: "search", size: 14 }),
1186
- /* @__PURE__ */ o(
699
+ return /* @__PURE__ */ b("nav", { className: "ds-sidebar", "aria-label": u.region, style: { width: i }, children: [
700
+ /* @__PURE__ */ b("div", { className: "ds-search", children: [
701
+ /* @__PURE__ */ n(H, { name: "search", size: 14 }),
702
+ /* @__PURE__ */ n(
1187
703
  "input",
1188
704
  {
1189
- ref: _,
705
+ ref: E,
1190
706
  className: "ds-input ds-search__input",
1191
707
  type: "search",
1192
- value: f,
1193
- placeholder: i.searchPlaceholder,
1194
- "aria-label": i.searchLabel,
1195
- onChange: (O) => S(O.target.value),
1196
- onKeyDown: (O) => {
1197
- O.key === "Escape" && S("");
708
+ value: p,
709
+ placeholder: u.searchPlaceholder,
710
+ "aria-label": u.searchLabel,
711
+ onChange: (F) => S(F.target.value),
712
+ onKeyDown: (F) => {
713
+ F.key === "Escape" && S("");
1198
714
  }
1199
715
  }
1200
716
  ),
1201
- /* @__PURE__ */ o("kbd", { className: "ds-kbd", "aria-hidden": "true", children: i.searchShortcut })
717
+ /* @__PURE__ */ n("kbd", { className: "ds-kbd", "aria-hidden": "true", children: u.searchShortcut })
1202
718
  ] }),
1203
- /* @__PURE__ */ y("div", { className: "ds-tabs", role: "tablist", "aria-label": i.tabs, children: [
1204
- /* @__PURE__ */ o(
1205
- Ve,
719
+ /* @__PURE__ */ b("div", { className: "ds-tabs", role: "tablist", "aria-label": u.tabs, children: [
720
+ /* @__PURE__ */ n(
721
+ Ae,
1206
722
  {
1207
- selected: x === "screens",
1208
- label: i.screensTab,
1209
- count: E ? T.length : void 0,
1210
- onSelect: () => k("screens")
723
+ selected: N === "screens",
724
+ label: u.screensTab,
725
+ count: O ? T.length : void 0,
726
+ onSelect: () => g("screens")
1211
727
  }
1212
728
  ),
1213
- /* @__PURE__ */ o(
1214
- Ve,
729
+ /* @__PURE__ */ n(
730
+ Ae,
1215
731
  {
1216
- selected: x === "components",
1217
- label: i.componentsTab,
1218
- count: E ? d.length : void 0,
1219
- onSelect: () => k("components")
732
+ selected: N === "components",
733
+ label: u.componentsTab,
734
+ count: O ? L.length : void 0,
735
+ onSelect: () => g("components")
1220
736
  }
1221
737
  )
1222
738
  ] }),
1223
- /* @__PURE__ */ o("div", { className: "ds-sidebar__list", role: "tabpanel", children: x === "screens" ? b ? T.length === 0 ? /* @__PURE__ */ o("p", { className: "ds-empty", children: i.noMatch(f) }) : C.map((O) => {
1224
- const I = /* @__PURE__ */ o("ul", { className: "ds-items", children: O.screens.map((U) => /* @__PURE__ */ o(
1225
- rn,
739
+ /* @__PURE__ */ n("div", { className: "ds-sidebar__list", role: "tabpanel", children: N === "screens" ? f ? T.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: u.noMatch(p) }) : A.map((F) => {
740
+ const D = /* @__PURE__ */ n("ul", { className: "ds-items", children: F.screens.map((K) => /* @__PURE__ */ n(
741
+ jt,
1226
742
  {
1227
- screen: U,
1228
- active: U.id === n && !r,
743
+ screen: K,
744
+ active: K.id === o && !r,
1229
745
  onOpen: s
1230
746
  },
1231
- U.id
747
+ K.id
1232
748
  )) });
1233
- if (O.name === void 0) return /* @__PURE__ */ o("div", { className: "ds-group-section", children: I }, "");
1234
- const P = `screens:${O.name}`, z = N.has(P) && !E;
1235
- return /* @__PURE__ */ y("section", { className: "ds-group-section", children: [
1236
- /* @__PURE__ */ y(
749
+ if (F.name === void 0) return /* @__PURE__ */ n("div", { className: "ds-group-section", children: D }, "");
750
+ const x = `screens:${F.name}`, R = C.has(x) && !O;
751
+ return /* @__PURE__ */ b("section", { className: "ds-group-section", children: [
752
+ /* @__PURE__ */ b(
1237
753
  "button",
1238
754
  {
1239
755
  type: "button",
1240
756
  className: "ds-group-section__head",
1241
- "aria-expanded": !z,
1242
- "aria-label": i.toggleGroup(O.name),
1243
- onClick: () => F(P),
757
+ "aria-expanded": !R,
758
+ "aria-label": u.toggleGroup(F.name),
759
+ onClick: () => G(x),
1244
760
  children: [
1245
- /* @__PURE__ */ o(H, { name: "chevron", size: 12 }),
1246
- /* @__PURE__ */ o("span", { children: O.name }),
1247
- /* @__PURE__ */ o("span", { className: "ds-count", children: O.screens.length })
761
+ /* @__PURE__ */ n(H, { name: "chevron", size: 12 }),
762
+ /* @__PURE__ */ n("span", { children: F.name }),
763
+ /* @__PURE__ */ n("span", { className: "ds-count", children: F.screens.length })
1248
764
  ]
1249
765
  }
1250
766
  ),
1251
- !z && I
1252
- ] }, P);
1253
- }) : /* @__PURE__ */ o("p", { className: "ds-empty", children: i.emptyScreens }) : m ? d.length === 0 ? /* @__PURE__ */ o("p", { className: "ds-empty", children: i.noMatch(f) }) : g.map(({ group: O, items: I }) => {
1254
- const P = N.has(O) && !E;
1255
- return /* @__PURE__ */ y("section", { className: "ds-group-section", children: [
1256
- /* @__PURE__ */ y(
767
+ !R && D
768
+ ] }, x);
769
+ }) : /* @__PURE__ */ n("p", { className: "ds-empty", children: u.emptyScreens }) : m ? L.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-empty", children: u.noMatch(p) }) : P.map(({ group: F, items: D }) => {
770
+ const x = C.has(F) && !O;
771
+ return /* @__PURE__ */ b("section", { className: "ds-group-section", children: [
772
+ /* @__PURE__ */ b(
1257
773
  "button",
1258
774
  {
1259
775
  type: "button",
1260
776
  className: "ds-group-section__head",
1261
- "aria-expanded": !P,
1262
- "aria-label": i.toggleGroup(O),
1263
- onClick: () => F(O),
777
+ "aria-expanded": !x,
778
+ "aria-label": u.toggleGroup(F),
779
+ onClick: () => G(F),
1264
780
  children: [
1265
- /* @__PURE__ */ o(H, { name: "chevron", size: 12 }),
1266
- /* @__PURE__ */ o("span", { children: O }),
1267
- /* @__PURE__ */ o("span", { className: "ds-count", children: I.length })
781
+ /* @__PURE__ */ n(H, { name: "chevron", size: 12 }),
782
+ /* @__PURE__ */ n("span", { children: F }),
783
+ /* @__PURE__ */ n("span", { className: "ds-count", children: D.length })
1268
784
  ]
1269
785
  }
1270
786
  ),
1271
- !P && /* @__PURE__ */ o("ul", { className: "ds-items", children: I.map((z) => /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o(
787
+ !x && /* @__PURE__ */ n("ul", { className: "ds-items", children: D.map((R) => /* @__PURE__ */ n("li", { children: /* @__PURE__ */ n(
1272
788
  "button",
1273
789
  {
1274
790
  type: "button",
1275
791
  className: "ds-item",
1276
- "aria-current": z.id === r ? "true" : void 0,
1277
- onClick: () => a(z.id),
1278
- children: /* @__PURE__ */ o("span", { className: "ds-item__title", children: z.name })
792
+ "aria-current": R.id === r ? "true" : void 0,
793
+ onClick: () => a(R.id),
794
+ children: /* @__PURE__ */ n("span", { className: "ds-item__title", children: R.name })
1279
795
  }
1280
- ) }, z.id)) })
1281
- ] }, O);
1282
- }) : /* @__PURE__ */ o("p", { className: "ds-empty", children: i.emptyComponents }) }),
1283
- /* @__PURE__ */ o(
1284
- rt,
796
+ ) }, R.id)) })
797
+ ] }, F);
798
+ }) : /* @__PURE__ */ n("p", { className: "ds-empty", children: u.emptyComponents }) }),
799
+ /* @__PURE__ */ n(
800
+ Ze,
1285
801
  {
1286
802
  side: "left",
1287
- label: i.resize,
1288
- value: c,
1289
- onChange: l,
1290
- onStart: h,
1291
- onEnd: p
803
+ label: u.resize,
804
+ value: i,
805
+ onChange: d,
806
+ onStart: l,
807
+ onEnd: c
1292
808
  }
1293
809
  )
1294
810
  ] });
1295
811
  }
1296
- function Ve({
812
+ function Ae({
1297
813
  selected: e,
1298
814
  label: t,
1299
- count: n,
815
+ count: o,
1300
816
  onSelect: r
1301
817
  }) {
1302
- return /* @__PURE__ */ y(
818
+ return /* @__PURE__ */ b(
1303
819
  "button",
1304
820
  {
1305
821
  type: "button",
@@ -1309,211 +825,87 @@ function Ve({
1309
825
  tabIndex: e ? 0 : -1,
1310
826
  onClick: r,
1311
827
  children: [
1312
- /* @__PURE__ */ o("span", { children: t }),
1313
- n !== void 0 && /* @__PURE__ */ o("span", { className: "ds-count", children: n })
828
+ /* @__PURE__ */ n("span", { children: t }),
829
+ o !== void 0 && /* @__PURE__ */ n("span", { className: "ds-count", children: o })
1314
830
  ]
1315
831
  }
1316
832
  );
1317
833
  }
1318
- function rn({
834
+ function jt({
1319
835
  screen: e,
1320
836
  active: t,
1321
- onOpen: n
837
+ onOpen: o
1322
838
  }) {
1323
- return /* @__PURE__ */ o("li", { children: /* @__PURE__ */ y(
839
+ return /* @__PURE__ */ n("li", { children: /* @__PURE__ */ b(
1324
840
  "button",
1325
841
  {
1326
842
  type: "button",
1327
843
  className: "ds-item",
1328
844
  "aria-current": t ? "true" : void 0,
1329
- onClick: () => n(e.id),
845
+ onClick: () => o(e.id),
1330
846
  children: [
1331
- /* @__PURE__ */ o("span", { className: "ds-item__title", children: e.name }),
1332
- e.variations.length > 1 && /* @__PURE__ */ o("span", { className: "ds-count", children: e.variations.length })
847
+ /* @__PURE__ */ n("span", { className: "ds-item__title", children: e.name }),
848
+ e.variations.length > 1 && /* @__PURE__ */ n("span", { className: "ds-count", children: e.variations.length })
1333
849
  ]
1334
850
  }
1335
851
  ) });
1336
852
  }
1337
- function sn(e, t) {
1338
- const n = /* @__PURE__ */ new Map();
853
+ function Vt(e, t) {
854
+ const o = /* @__PURE__ */ new Map();
1339
855
  for (const r of e) {
1340
- const s = r.group?.trim() || t, a = n.get(s) ?? [];
1341
- a.push(r), n.set(s, a);
856
+ const s = r.group?.trim() || t, a = o.get(s) ?? [];
857
+ a.push(r), o.set(s, a);
1342
858
  }
1343
- return [...n].map(([r, s]) => ({ group: r, items: s }));
859
+ return [...o].map(([r, s]) => ({ group: r, items: s }));
1344
860
  }
1345
- function an(e) {
861
+ function Gt(e) {
1346
862
  return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "k";
1347
863
  }
1348
- function cn({
1349
- screen: e,
1350
- variations: t,
1351
- components: n,
1352
- deploy: r,
1353
- labels: s,
1354
- overrides: a
1355
- }) {
1356
- const c = s.pr, l = [`## ${e.name}`, ""];
1357
- e.description && l.push(e.description, ""), l.push(`\`${e.route.path}\``, "");
1358
- const h = r.deploymentUrl ? `https://${r.deploymentUrl}` : void 0, p = r.shortCommit ? c.commit(r.shortCommit) : void 0;
1359
- if (l.push(`### ${c.variations}`, ""), t.length === 0) {
1360
- const u = new URL(e.href, r.origin);
1361
- $e(u.searchParams, a), l.push(`- [${s.panel.defaultVariation}](${u.toString()})`);
1362
- }
1363
- for (const u of t) {
1364
- const i = me(u, { origin: r.origin, overrides: a });
1365
- let f = `- [${st(u.title)}](${i})`;
1366
- if (h) {
1367
- const S = me(u, { origin: h, overrides: a });
1368
- f += ` · [${p ?? c.immutableLink}](${S})`;
1369
- } else p && (f += ` · ${p}`);
1370
- l.push(f);
1371
- }
1372
- if (l.push(""), n.length > 0) {
1373
- l.push(`### ${c.components}`, ""), l.push(`| ${c.component} | ${c.source} |`, "| --- | --- |");
1374
- for (const u of n) {
1375
- const i = u.source ? `\`${ge(u.source)}\`` : c.empty;
1376
- l.push(`| ${ge(u.name)} (\`${u.id}\`) | ${i} |`);
1377
- }
1378
- l.push("");
1379
- }
1380
- l.push(`### ${c.expected}`, ""), t.length === 0 && l.push(`**${s.panel.defaultVariation}**`, "", c.noExpected, "");
1381
- for (const u of t) {
1382
- if (l.push(`**${u.title}**`, ""), u.expected?.length)
1383
- for (const i of u.expected) l.push(`- ${i}`);
1384
- else
1385
- l.push(c.noExpected);
1386
- l.push("");
1387
- }
1388
- return `${l.join(`
1389
- `).trimEnd()}
1390
- `;
1391
- }
1392
- function ge(e) {
1393
- return e.replace(/\|/g, "\\|").replace(/\n/g, " ");
1394
- }
1395
- function st(e) {
1396
- return e.replace(/([[\]])/g, "\\$1");
1397
- }
1398
- function ln({
1399
- flow: e,
1400
- registry: t,
1401
- open: n,
1402
- deploy: r,
1403
- labels: s,
1404
- overrides: a
1405
- }) {
1406
- const c = s.pr, l = [`## ${e.name}`, ""], h = r.deploymentUrl ? `https://${r.deploymentUrl}` : void 0, p = r.shortCommit ? c.commit(r.shortCommit) : void 0, u = (i, f) => {
1407
- if (n && n.screen.id === i.id) {
1408
- const $ = new URL(n.location.path || "/", f), _ = new URLSearchParams(n.location.search);
1409
- for (const v of Et) _.delete(v);
1410
- for (const [v, L] of _) $.searchParams.append(v, L);
1411
- return $e($.searchParams, a), $.toString();
1412
- }
1413
- const S = i.variations[0];
1414
- if (S) return me(S, { origin: f, overrides: a });
1415
- const N = new URL(i.href, f);
1416
- return $e(N.searchParams, a), N.toString();
1417
- };
1418
- for (const i of e.screens) {
1419
- l.push(`### ${i.name}`, ""), i.description && l.push(i.description, "");
1420
- let f = `\`${i.route.path}\` · [${c.open}](${u(i, r.origin)})`;
1421
- if (h ? f += ` · [${p ?? c.immutableLink}](${u(i, h)})` : p && (f += ` · ${p}`), l.push(f, ""), i.controls.length > 0) {
1422
- l.push(`**${c.controls}**`, "");
1423
- for (const v of i.controls) {
1424
- l.push(`- ${le(v.title)} (\`${v.id}\`)`);
1425
- for (const L of v.controls) {
1426
- const b = Se(L), m = L.options.map(
1427
- (w) => w.value === b ? `${le(w.label)} (\`${w.value}\`, ${c.defaultOption})` : `${le(w.label)} (\`${w.value}\`)`
1428
- ).join(" · ");
1429
- l.push(` - ${le(L.label)} (\`c.${L.id}\`): ${m}`);
1430
- }
1431
- }
1432
- l.push("");
1433
- }
1434
- if (i.variations.length > 0) {
1435
- l.push(`**${c.shortcuts}**`, "");
1436
- for (const v of i.variations)
1437
- l.push(
1438
- `- [${st(v.title)}](${me(v, { origin: r.origin, overrides: a })})`
1439
- );
1440
- l.push("");
1441
- }
1442
- l.push(`**${c.expected}**`, "");
1443
- const S = n?.screen.id === i.id ? n.variation : void 0, N = S?.expected?.length ? S.expected : i.route.expected, $ = i.variations.filter(
1444
- (v) => v.expected?.length && v.id !== S?.id
1445
- );
1446
- if (!N?.length && $.length === 0 && l.push(c.noExpected, ""), N?.length) {
1447
- for (const v of N) l.push(`- ${v}`);
1448
- l.push("");
1449
- }
1450
- for (const v of $) {
1451
- l.push(`*${v.title}*`, "");
1452
- for (const L of v.expected ?? []) l.push(`- ${L}`);
1453
- l.push("");
1454
- }
1455
- const _ = t.componentsOfScreen(i);
1456
- if (_.length > 0) {
1457
- l.push(`**${c.components}**`, ""), l.push(`| ${c.component} | ${c.source} |`, "| --- | --- |");
1458
- for (const v of _) {
1459
- const L = v.source ? `\`${ge(v.source)}\`` : c.empty;
1460
- l.push(`| ${ge(v.name)} (\`${v.id}\`) | ${L} |`);
1461
- }
1462
- l.push("");
1463
- }
1464
- }
1465
- return `${l.join(`
1466
- `).trimEnd()}
1467
- `;
1468
- }
1469
- function le(e) {
1470
- return e.replace(/([*_[\]`])/g, "\\$1");
1471
- }
1472
- function dn(e) {
1473
- const { tab: t, onTab: n, width: r, onResize: s, onResizeStart: a, onResizeEnd: c } = e, l = J().panel, [h, p] = D(""), u = q(null), i = q(null), [f, S] = D(!1), [N, $] = D(() => /* @__PURE__ */ new Set()), _ = (L) => $((b) => {
1474
- const m = new Set(b);
1475
- return m.has(L) ? m.delete(L) : m.add(L), m;
1476
- }), v = h.trim().length > 0;
1477
- return V(() => {
1478
- const L = (b) => {
1479
- pn(b) && (b.preventDefault(), u.current?.focus(), u.current?.select());
864
+ function Zt(e) {
865
+ const { tab: t, onTab: o, width: r, onResize: s, onResizeStart: a, onResizeEnd: i } = e, d = X().panel, [l, c] = z(""), h = j(null), u = j(null), [p, S] = z(!1), [C, k] = z(() => /* @__PURE__ */ new Set()), E = (_) => k((f) => {
866
+ const m = new Set(f);
867
+ return m.has(_) ? m.delete(_) : m.add(_), m;
868
+ }), v = l.trim().length > 0;
869
+ return I(() => {
870
+ const _ = (f) => {
871
+ Xt(f) && (f.preventDefault(), h.current?.focus(), h.current?.select());
1480
872
  };
1481
- return window.addEventListener("keydown", L), () => window.removeEventListener("keydown", L);
1482
- }, []), qe(() => {
1483
- S(mn(i.current, h));
1484
- }), /* @__PURE__ */ y("aside", { className: "ds-panel", "aria-label": l.region, style: { width: r }, children: [
1485
- /* @__PURE__ */ o(
1486
- rt,
873
+ return window.addEventListener("keydown", _), () => window.removeEventListener("keydown", _);
874
+ }, []), Ie(() => {
875
+ S(Jt(u.current, l));
876
+ }), /* @__PURE__ */ b("aside", { className: "ds-panel", "aria-label": d.region, style: { width: r }, children: [
877
+ /* @__PURE__ */ n(
878
+ Ze,
1487
879
  {
1488
880
  side: "right",
1489
- label: l.resize,
881
+ label: d.resize,
1490
882
  value: r,
1491
883
  onChange: s,
1492
884
  onStart: a,
1493
- onEnd: c
885
+ onEnd: i
1494
886
  }
1495
887
  ),
1496
- /* @__PURE__ */ y("div", { className: "ds-search", children: [
1497
- /* @__PURE__ */ o(H, { name: "search", size: 14 }),
1498
- /* @__PURE__ */ o(
888
+ /* @__PURE__ */ b("div", { className: "ds-search", children: [
889
+ /* @__PURE__ */ n(H, { name: "search", size: 14 }),
890
+ /* @__PURE__ */ n(
1499
891
  "input",
1500
892
  {
1501
- ref: u,
893
+ ref: h,
1502
894
  className: "ds-input ds-search__input",
1503
895
  type: "search",
1504
- value: h,
1505
- placeholder: l.searchPlaceholder,
1506
- "aria-label": l.searchLabel,
1507
- onChange: (L) => p(L.target.value),
1508
- onKeyDown: (L) => {
1509
- L.key === "Escape" && p("");
896
+ value: l,
897
+ placeholder: d.searchPlaceholder,
898
+ "aria-label": d.searchLabel,
899
+ onChange: (_) => c(_.target.value),
900
+ onKeyDown: (_) => {
901
+ _.key === "Escape" && c("");
1510
902
  }
1511
903
  }
1512
904
  ),
1513
- /* @__PURE__ */ o("kbd", { className: "ds-kbd", "aria-hidden": "true", children: l.searchShortcut })
905
+ /* @__PURE__ */ n("kbd", { className: "ds-kbd", "aria-hidden": "true", children: d.searchShortcut })
1514
906
  ] }),
1515
- /* @__PURE__ */ y("div", { className: "ds-tabs", role: "tablist", "aria-label": l.tabs, children: [
1516
- /* @__PURE__ */ o(
907
+ /* @__PURE__ */ b("div", { className: "ds-tabs", role: "tablist", "aria-label": d.tabs, children: [
908
+ /* @__PURE__ */ n(
1517
909
  "button",
1518
910
  {
1519
911
  type: "button",
@@ -1521,11 +913,11 @@ function dn(e) {
1521
913
  className: "ds-tab",
1522
914
  "aria-selected": t === "variations",
1523
915
  tabIndex: t === "variations" ? 0 : -1,
1524
- onClick: () => n("variations"),
1525
- children: l.variationsTab
916
+ onClick: () => o("variations"),
917
+ children: d.variationsTab
1526
918
  }
1527
919
  ),
1528
- /* @__PURE__ */ o(
920
+ /* @__PURE__ */ n(
1529
921
  "button",
1530
922
  {
1531
923
  type: "button",
@@ -1533,399 +925,371 @@ function dn(e) {
1533
925
  className: "ds-tab",
1534
926
  "aria-selected": t === "info",
1535
927
  tabIndex: t === "info" ? 0 : -1,
1536
- onClick: () => n("info"),
1537
- children: l.infoTab
928
+ onClick: () => o("info"),
929
+ children: d.infoTab
1538
930
  }
1539
931
  )
1540
932
  ] }),
1541
- /* @__PURE__ */ y("div", { className: "ds-panel__body", role: "tabpanel", ref: i, children: [
1542
- t === "variations" ? /* @__PURE__ */ o(un, { ...e, collapsed: N, onToggle: _, filtering: v }) : /* @__PURE__ */ o(hn, { ...e }),
1543
- f && /* @__PURE__ */ o("p", { className: "ds-empty", children: l.noMatch(h) })
933
+ /* @__PURE__ */ b("div", { className: "ds-panel__body", role: "tabpanel", ref: u, children: [
934
+ t === "variations" ? /* @__PURE__ */ n(Yt, { ...e, collapsed: C, onToggle: E, filtering: v }) : /* @__PURE__ */ n(Qt, { ...e }),
935
+ p && /* @__PURE__ */ n("p", { className: "ds-empty", children: d.noMatch(l) })
1544
936
  ] })
1545
937
  ] });
1546
938
  }
1547
- function un({
939
+ function Yt({
1548
940
  registry: e,
1549
941
  controls: t,
1550
- screen: n,
942
+ screen: o,
1551
943
  variation: r,
1552
944
  component: s,
1553
945
  componentFixture: a,
1554
- onOpenScenario: c,
1555
- onOpenComponent: l,
1556
- onChange: h
946
+ onOpenScenario: i,
947
+ onOpenComponent: d,
948
+ onChange: l
1557
949
  }) {
1558
- const p = J(), u = p.panel;
950
+ const c = X(), h = c.panel;
1559
951
  if (s) {
1560
- const b = s.fixtures ?? [];
1561
- if (b.length === 0) return /* @__PURE__ */ o("p", { className: "ds-empty", children: u.noComponentVariations });
952
+ const f = s.fixtures ?? [];
953
+ if (f.length === 0) return /* @__PURE__ */ n("p", { className: "ds-empty", children: h.noComponentVariations });
1562
954
  const m = a.fixture;
1563
- return /* @__PURE__ */ y("div", { className: "ds-vcards", children: [
1564
- a.didFallback && a.requestedId && m && /* @__PURE__ */ o("p", { className: "ds-notice", children: u.fixtureFallback(a.requestedId, m.id) }),
1565
- /* @__PURE__ */ o(de, { title: s.name, hint: m?.description, children: /* @__PURE__ */ o(
1566
- ee,
955
+ return /* @__PURE__ */ b("div", { className: "ds-vcards", children: [
956
+ a.didFallback && a.requestedId && m && /* @__PURE__ */ n("p", { className: "ds-notice", children: h.fixtureFallback(a.requestedId, m.id) }),
957
+ /* @__PURE__ */ n(ae, { title: s.name, hint: m?.description, children: /* @__PURE__ */ n(
958
+ J,
1567
959
  {
1568
- label: u.componentVariations,
960
+ label: h.componentVariations,
1569
961
  value: m?.id ?? "",
1570
- options: b.map((w) => ({ value: w.id, label: w.label })),
1571
- onChange: (w) => h({ fixture: w })
962
+ options: f.map((w) => ({ value: w.id, label: w.label })),
963
+ onChange: (w) => l({ fixture: w })
1572
964
  }
1573
965
  ) })
1574
966
  ] });
1575
967
  }
1576
- if (!n) return /* @__PURE__ */ o("p", { className: "ds-empty", children: u.nothingSelected });
1577
- const i = n.variations, f = e.product, S = f.theme?.modes ?? [], N = f.theme?.locales ?? [], $ = f.dataSources?.adapters ?? [], _ = t.screenControls ?? {}, v = r && Ut(r, _) ? r : void 0, L = (b, m) => h({ screenControls: { ..._, [b]: m } });
1578
- return /* @__PURE__ */ y("div", { className: "ds-vcards", children: [
1579
- /* @__PURE__ */ y(de, { title: u.context, children: [
1580
- /* @__PURE__ */ o(
1581
- ee,
968
+ if (!o) return /* @__PURE__ */ n("p", { className: "ds-empty", children: h.nothingSelected });
969
+ const u = o.variations, p = e.product, S = p.theme?.modes ?? [], C = p.theme?.locales ?? [], k = p.dataSources?.adapters ?? [], E = t.screenControls ?? {}, v = r && ut(r, E) ? r : void 0, _ = (f, m) => l({ screenControls: { ...E, [f]: m } });
970
+ return /* @__PURE__ */ b("div", { className: "ds-vcards", children: [
971
+ /* @__PURE__ */ b(ae, { title: h.context, children: [
972
+ /* @__PURE__ */ n(
973
+ J,
1582
974
  {
1583
- label: u.persona,
975
+ label: h.persona,
1584
976
  value: t.persona ?? "",
1585
977
  options: [
1586
978
  // Com persona padrão, "nenhuma" não é uma situação possível.
1587
- ...e.defaultPersona ? [] : [{ value: "", label: u.none }],
1588
- ...f.personas.map((b) => ({ value: b.id, label: b.name }))
979
+ ...e.defaultPersona ? [] : [{ value: "", label: h.none }],
980
+ ...p.personas.map((f) => ({ value: f.id, label: f.name }))
1589
981
  ],
1590
- onChange: (b) => h({ persona: b || void 0 })
982
+ onChange: (f) => l({ persona: f || void 0 })
1591
983
  }
1592
984
  ),
1593
- /* @__PURE__ */ o(
1594
- ee,
985
+ /* @__PURE__ */ n(
986
+ J,
1595
987
  {
1596
- label: u.network,
988
+ label: h.network,
1597
989
  value: t.network,
1598
- options: Ye.map((b) => ({ value: b, label: p.network[b] })),
1599
- onChange: (b) => h({ network: b })
990
+ options: He.map((f) => ({ value: f, label: c.network[f] })),
991
+ onChange: (f) => l({ network: f })
1600
992
  }
1601
993
  ),
1602
- S.length > 1 && /* @__PURE__ */ o(
1603
- ee,
994
+ S.length > 1 && /* @__PURE__ */ n(
995
+ J,
1604
996
  {
1605
- label: u.theme,
997
+ label: h.theme,
1606
998
  value: t.themeMode ?? S[0],
1607
- options: S.map((b) => ({ value: b, label: b })),
1608
- onChange: (b) => h({ themeMode: b })
999
+ options: S.map((f) => ({ value: f, label: f })),
1000
+ onChange: (f) => l({ themeMode: f })
1609
1001
  }
1610
1002
  ),
1611
- N.length > 1 && /* @__PURE__ */ o(
1612
- ee,
1003
+ C.length > 1 && /* @__PURE__ */ n(
1004
+ J,
1613
1005
  {
1614
- label: u.locale,
1615
- value: t.locale ?? N[0],
1616
- options: N.map((b) => ({ value: b, label: b })),
1617
- onChange: (b) => h({ locale: b })
1006
+ label: h.locale,
1007
+ value: t.locale ?? C[0],
1008
+ options: C.map((f) => ({ value: f, label: f })),
1009
+ onChange: (f) => l({ locale: f })
1618
1010
  }
1619
1011
  ),
1620
- $.length > 0 && /* @__PURE__ */ o(
1621
- ee,
1012
+ k.length > 0 && /* @__PURE__ */ n(
1013
+ J,
1622
1014
  {
1623
- label: u.dataSource,
1015
+ label: h.dataSource,
1624
1016
  value: t.dataSource ?? "fixtures",
1625
1017
  options: [
1626
- { value: "fixtures", label: u.fixturesOption },
1627
- ...$.map((b) => ({ value: b.id, label: b.label }))
1018
+ { value: "fixtures", label: h.fixturesOption },
1019
+ ...k.map((f) => ({ value: f.id, label: f.label }))
1628
1020
  ],
1629
- onChange: (b) => h({ dataSource: b })
1021
+ onChange: (f) => l({ dataSource: f })
1630
1022
  }
1631
1023
  )
1632
1024
  ] }),
1633
- n.controls.map((b) => {
1634
- const m = e.component(b.component);
1635
- return /* @__PURE__ */ o(
1636
- de,
1025
+ o.controls.map((f) => {
1026
+ const m = e.component(f.component);
1027
+ return /* @__PURE__ */ n(
1028
+ ae,
1637
1029
  {
1638
- title: b.title,
1639
- hint: b.note,
1640
- link: m ? { label: u.openComponent(m.name), onOpen: () => l(m.id) } : void 0,
1641
- children: b.controls.map((w) => /* @__PURE__ */ o(
1642
- ee,
1030
+ title: f.title,
1031
+ hint: f.note,
1032
+ link: m ? { label: h.openComponent(m.name), onOpen: () => d(m.id) } : void 0,
1033
+ children: f.controls.map((w) => /* @__PURE__ */ n(
1034
+ J,
1643
1035
  {
1644
1036
  label: w.label,
1645
1037
  hint: w.description,
1646
- value: _[w.id] ?? Se(w),
1038
+ value: E[w.id] ?? We(w),
1647
1039
  options: w.options ?? [],
1648
- onChange: (k) => L(w.id, k)
1040
+ onChange: (g) => _(w.id, g)
1649
1041
  },
1650
1042
  w.id
1651
1043
  ))
1652
1044
  },
1653
- b.id
1045
+ f.id
1654
1046
  );
1655
1047
  }),
1656
- i.length > 0 && /* @__PURE__ */ o(de, { title: u.shortcuts, children: /* @__PURE__ */ o("ul", { className: "ds-items", "aria-label": u.variationsList, children: i.map((b) => /* @__PURE__ */ o("li", { "data-ds-filter": !0, children: /* @__PURE__ */ o(
1048
+ u.length > 0 && /* @__PURE__ */ n(ae, { title: h.shortcuts, children: /* @__PURE__ */ n("ul", { className: "ds-items", "aria-label": h.variationsList, children: u.map((f) => /* @__PURE__ */ n("li", { "data-ds-filter": !0, children: /* @__PURE__ */ n(
1657
1049
  "button",
1658
1050
  {
1659
1051
  type: "button",
1660
1052
  className: "ds-item",
1661
- title: b.intent,
1662
- "aria-current": v?.id === b.id ? "true" : void 0,
1663
- onClick: () => c(b.id),
1664
- children: /* @__PURE__ */ o("span", { className: "ds-item__title", children: b.title })
1053
+ title: f.intent,
1054
+ "aria-current": v?.id === f.id ? "true" : void 0,
1055
+ onClick: () => i(f.id),
1056
+ children: /* @__PURE__ */ n("span", { className: "ds-item__title", children: f.title })
1665
1057
  }
1666
- ) }, b.id)) }) })
1058
+ ) }, f.id)) }) })
1667
1059
  ] });
1668
1060
  }
1669
- function de({
1061
+ function ae({
1670
1062
  title: e,
1671
1063
  hint: t,
1672
- link: n,
1064
+ link: o,
1673
1065
  children: r
1674
1066
  }) {
1675
- return /* @__PURE__ */ y("section", { className: "ds-vcard", "data-ds-filter-group": !0, children: [
1676
- /* @__PURE__ */ y("header", { className: "ds-vcard__head", title: t ? `${e} — ${t}` : e, children: [
1677
- /* @__PURE__ */ o("h3", { className: "ds-vcard__title ds-section__title", "data-ds-filter-title": !0, children: e }),
1678
- n && /* @__PURE__ */ o(
1067
+ return /* @__PURE__ */ b("section", { className: "ds-vcard", "data-ds-filter-group": !0, children: [
1068
+ /* @__PURE__ */ b("header", { className: "ds-vcard__head", title: t ? `${e} — ${t}` : e, children: [
1069
+ /* @__PURE__ */ n("h3", { className: "ds-vcard__title ds-section__title", "data-ds-filter-title": !0, children: e }),
1070
+ o && /* @__PURE__ */ n(
1679
1071
  "button",
1680
1072
  {
1681
1073
  type: "button",
1682
1074
  className: "ds-btn ds-btn--icon ds-vcard__link",
1683
- "aria-label": n.label,
1684
- title: n.label,
1685
- onClick: n.onOpen,
1686
- children: /* @__PURE__ */ o(H, { name: "arrow-up-right", size: 14 })
1075
+ "aria-label": o.label,
1076
+ title: o.label,
1077
+ onClick: o.onOpen,
1078
+ children: /* @__PURE__ */ n(H, { name: "arrow-up-right", size: 14 })
1687
1079
  }
1688
1080
  )
1689
1081
  ] }),
1690
- /* @__PURE__ */ o("div", { className: "ds-vcard__body", children: r })
1082
+ /* @__PURE__ */ n("div", { className: "ds-vcard__body", children: r })
1691
1083
  ] });
1692
1084
  }
1693
- function ee({
1085
+ function J({
1694
1086
  label: e,
1695
1087
  hint: t,
1696
- value: n,
1088
+ value: o,
1697
1089
  options: r,
1698
1090
  onChange: s
1699
1091
  }) {
1700
- return /* @__PURE__ */ y("label", { className: "ds-vcard__field", "data-ds-filter": !0, title: t ? `${e} — ${t}` : e, children: [
1701
- /* @__PURE__ */ o("span", { className: "ds-visually-hidden", children: e }),
1702
- /* @__PURE__ */ o("select", { className: "ds-select", value: n, onChange: (a) => s(a.target.value), children: r.map((a) => /* @__PURE__ */ o("option", { value: a.value, children: a.label }, a.value)) })
1092
+ return /* @__PURE__ */ b("label", { className: "ds-vcard__field", "data-ds-filter": !0, title: t ? `${e} — ${t}` : e, children: [
1093
+ /* @__PURE__ */ n("span", { className: "ds-visually-hidden", children: e }),
1094
+ /* @__PURE__ */ n("select", { className: "ds-select", value: o, onChange: (a) => s(a.target.value), children: r.map((a) => /* @__PURE__ */ n("option", { value: a.value, children: a.label }, a.value)) })
1703
1095
  ] });
1704
1096
  }
1705
- function hn({
1097
+ function Qt({
1706
1098
  registry: e,
1707
1099
  controls: t,
1708
- deploy: n,
1709
- location: r,
1710
- screen: s,
1711
- variation: a,
1712
- component: c,
1713
- onOpenScenario: l,
1714
- onOpenComponent: h,
1715
- onOpenScreen: p
1100
+ screen: o,
1101
+ variation: r,
1102
+ component: s,
1103
+ onOpenScenario: a,
1104
+ onOpenComponent: i,
1105
+ onOpenScreen: d
1716
1106
  }) {
1717
- const u = J(), i = u.info, [f, S] = D(!1);
1718
- if (c) {
1719
- const w = e.usagesOf(c.id, { handoff: t.handoff });
1720
- return /* @__PURE__ */ y("div", { className: "ds-info", children: [
1721
- /* @__PURE__ */ y(ne, { title: i.component, children: [
1722
- /* @__PURE__ */ o(W, { term: i.name, children: c.name }),
1723
- /* @__PURE__ */ o(W, { term: i.id, children: /* @__PURE__ */ o("code", { children: c.id }) }),
1724
- c.group && /* @__PURE__ */ o(W, { term: i.group, children: c.group }),
1725
- c.description && /* @__PURE__ */ o(W, { term: i.description, children: c.description }),
1726
- c.source && /* @__PURE__ */ o(W, { term: i.source, children: /* @__PURE__ */ o("code", { children: c.source }) })
1107
+ const l = X(), c = l.info;
1108
+ if (s) {
1109
+ const k = e.usagesOf(s.id, { handoff: t.handoff });
1110
+ return /* @__PURE__ */ b("div", { className: "ds-info", children: [
1111
+ /* @__PURE__ */ b(te, { title: c.component, children: [
1112
+ /* @__PURE__ */ n(U, { term: c.name, children: s.name }),
1113
+ /* @__PURE__ */ n(U, { term: c.id, children: /* @__PURE__ */ n("code", { children: s.id }) }),
1114
+ s.group && /* @__PURE__ */ n(U, { term: c.group, children: s.group }),
1115
+ s.description && /* @__PURE__ */ n(U, { term: c.description, children: s.description }),
1116
+ s.source && /* @__PURE__ */ n(U, { term: c.source, children: /* @__PURE__ */ n("code", { children: s.source }) })
1727
1117
  ] }),
1728
- /* @__PURE__ */ o(ne, { title: i.usedIn, children: w.length === 0 ? /* @__PURE__ */ o("p", { className: "ds-muted", children: i.notUsed }) : /* @__PURE__ */ o("ul", { className: "ds-links", children: w.map((k) => {
1729
- const x = k.variations.find((T) => T.components?.includes(c.id)) ?? k.variations[0];
1730
- return /* @__PURE__ */ y("li", { "data-ds-filter": !0, children: [
1731
- /* @__PURE__ */ o(
1118
+ /* @__PURE__ */ n(te, { title: c.usedIn, children: k.length === 0 ? /* @__PURE__ */ n("p", { className: "ds-muted", children: c.notUsed }) : /* @__PURE__ */ n("ul", { className: "ds-links", children: k.map((E) => {
1119
+ const v = E.variations.find((_) => _.components?.includes(s.id)) ?? E.variations[0];
1120
+ return /* @__PURE__ */ b("li", { "data-ds-filter": !0, children: [
1121
+ /* @__PURE__ */ n(
1732
1122
  "button",
1733
1123
  {
1734
1124
  type: "button",
1735
1125
  className: "ds-link",
1736
- onClick: () => x ? l(x.id) : p?.(k.id),
1737
- children: k.name
1126
+ onClick: () => v ? a(v.id) : d?.(E.id),
1127
+ children: E.name
1738
1128
  }
1739
1129
  ),
1740
- /* @__PURE__ */ o("code", { className: "ds-muted", children: k.id })
1741
- ] }, k.id);
1130
+ /* @__PURE__ */ n("code", { className: "ds-muted", children: E.id })
1131
+ ] }, E.id);
1742
1132
  }) }) })
1743
1133
  ] });
1744
1134
  }
1745
- if (!s) return /* @__PURE__ */ o("p", { className: "ds-empty", children: u.panel.nothingSelected });
1746
- const N = a ? e.componentsOfScreen(s, a) : e.componentsOfScreen(s), $ = e.persona(t.persona ?? a?.persona), _ = e.rulesOf(a), v = t.screenControls ?? {}, L = a?.expected?.length ? a.expected : s.route.expected, b = t.handoff ? { handoff: t.handoff } : void 0, m = async () => {
1747
- const w = s.group ? e.flowOf(s, { handoff: t.handoff }) : void 0, k = w?.name ? ln({
1748
- flow: { name: w.name, screens: w.screens },
1749
- registry: e,
1750
- open: { screen: s, location: r, variation: a },
1751
- deploy: n,
1752
- labels: u,
1753
- overrides: b
1754
- }) : cn({
1755
- screen: s,
1756
- variations: s.variations,
1757
- components: e.componentsOfScreen(s),
1758
- deploy: n,
1759
- labels: u,
1760
- overrides: b
1761
- });
1762
- try {
1763
- await navigator.clipboard.writeText(k);
1764
- } catch {
1765
- window.prompt(i.copyPrompt, k);
1766
- }
1767
- S(!0), window.setTimeout(() => S(!1), 1600);
1768
- };
1769
- return /* @__PURE__ */ y("div", { className: "ds-info", children: [
1770
- /* @__PURE__ */ y(ne, { title: i.screen, children: [
1771
- /* @__PURE__ */ o(W, { term: i.name, children: s.name }),
1772
- /* @__PURE__ */ o(W, { term: i.route, children: /* @__PURE__ */ o("code", { children: s.route.path }) }),
1773
- s.group && /* @__PURE__ */ o(W, { term: i.flow, children: s.group }),
1774
- s.description && /* @__PURE__ */ o(W, { term: i.description, children: s.description }),
1775
- /* @__PURE__ */ o(ue, { term: i.expected, items: L })
1135
+ if (!o) return /* @__PURE__ */ n("p", { className: "ds-empty", children: l.panel.nothingSelected });
1136
+ const h = r ? e.componentsOfScreen(o, r) : e.componentsOfScreen(o), u = e.persona(t.persona ?? r?.persona), p = e.rulesOf(r), S = t.screenControls ?? {}, C = r?.expected?.length ? r.expected : o.route.expected;
1137
+ return /* @__PURE__ */ b("div", { className: "ds-info", children: [
1138
+ /* @__PURE__ */ b(te, { title: c.screen, children: [
1139
+ /* @__PURE__ */ n(U, { term: c.name, children: o.name }),
1140
+ /* @__PURE__ */ n(U, { term: c.route, children: /* @__PURE__ */ n("code", { children: o.route.path }) }),
1141
+ o.group && /* @__PURE__ */ n(U, { term: c.flow, children: o.group }),
1142
+ o.description && /* @__PURE__ */ n(U, { term: c.description, children: o.description }),
1143
+ /* @__PURE__ */ n(ie, { term: c.expected, items: C })
1776
1144
  ] }),
1777
- s.controls.length > 0 && /* @__PURE__ */ o(ne, { title: i.controls, children: s.controls.flatMap(
1778
- (w) => w.controls.map((k) => {
1779
- const x = v[k.id] ?? Se(k), T = k.options.find((d) => d.value === x);
1780
- return /* @__PURE__ */ y(W, { term: k.label, children: [
1781
- T?.label ?? x,
1145
+ o.controls.length > 0 && /* @__PURE__ */ n(te, { title: c.controls, children: o.controls.flatMap(
1146
+ (k) => k.controls.map((E) => {
1147
+ const v = S[E.id] ?? We(E), _ = E.options.find((f) => f.value === v);
1148
+ return /* @__PURE__ */ b(U, { term: E.label, children: [
1149
+ _?.label ?? v,
1782
1150
  " ",
1783
- /* @__PURE__ */ o("code", { children: `c.${k.id}=${x}` })
1784
- ] }, `${w.id}/${k.id}`);
1151
+ /* @__PURE__ */ n("code", { children: `c.${E.id}=${v}` })
1152
+ ] }, `${k.id}/${E.id}`);
1785
1153
  })
1786
1154
  ) }),
1787
- a && /* @__PURE__ */ y(ne, { title: i.variation, children: [
1788
- /* @__PURE__ */ o(W, { term: i.name, children: a.title }),
1789
- /* @__PURE__ */ o(W, { term: i.id, children: /* @__PURE__ */ o("code", { children: a.id }) }),
1790
- $ && /* @__PURE__ */ o(W, { term: i.persona, children: $.name }),
1791
- a.intent && /* @__PURE__ */ o(W, { term: i.intent, children: a.intent }),
1792
- /* @__PURE__ */ o(ue, { term: i.preconditions, items: a.preconditions }),
1793
- /* @__PURE__ */ o(ue, { term: i.actions, items: a.actions }),
1794
- /* @__PURE__ */ o(ue, { term: i.rules, items: _.map((w) => w.statement) }),
1795
- a.ticket && /* @__PURE__ */ o(W, { term: i.ticket, children: /* @__PURE__ */ o("code", { children: a.ticket }) })
1155
+ r && /* @__PURE__ */ b(te, { title: c.variation, children: [
1156
+ /* @__PURE__ */ n(U, { term: c.name, children: r.title }),
1157
+ /* @__PURE__ */ n(U, { term: c.id, children: /* @__PURE__ */ n("code", { children: r.id }) }),
1158
+ u && /* @__PURE__ */ n(U, { term: c.persona, children: u.name }),
1159
+ r.intent && /* @__PURE__ */ n(U, { term: c.intent, children: r.intent }),
1160
+ /* @__PURE__ */ n(ie, { term: c.preconditions, items: r.preconditions }),
1161
+ /* @__PURE__ */ n(ie, { term: c.actions, items: r.actions }),
1162
+ /* @__PURE__ */ n(ie, { term: c.rules, items: p.map((k) => k.statement) }),
1163
+ r.ticket && /* @__PURE__ */ n(U, { term: c.ticket, children: /* @__PURE__ */ n("code", { children: r.ticket }) })
1796
1164
  ] }),
1797
- N.length > 0 && /* @__PURE__ */ o(ne, { title: i.components, children: /* @__PURE__ */ o("ul", { className: "ds-links", children: N.map((w) => /* @__PURE__ */ y("li", { "data-ds-filter": !0, children: [
1798
- /* @__PURE__ */ o("button", { type: "button", className: "ds-link", onClick: () => h(w.id), children: w.name }),
1799
- w.source && /* @__PURE__ */ o("code", { className: "ds-muted", children: w.source })
1800
- ] }, w.id)) }) }),
1801
- /* @__PURE__ */ y("button", { type: "button", className: "ds-btn ds-btn--block", onClick: m, children: [
1802
- /* @__PURE__ */ o(H, { name: f ? "check" : "copy", size: 14 }),
1803
- /* @__PURE__ */ o("span", { children: f ? i.copiedForPr : i.copyForPr })
1804
- ] })
1165
+ h.length > 0 && /* @__PURE__ */ n(te, { title: c.components, children: /* @__PURE__ */ n("ul", { className: "ds-links", children: h.map((k) => /* @__PURE__ */ b("li", { "data-ds-filter": !0, children: [
1166
+ /* @__PURE__ */ n("button", { type: "button", className: "ds-link", onClick: () => i(k.id), children: k.name }),
1167
+ k.source && /* @__PURE__ */ n("code", { className: "ds-muted", children: k.source })
1168
+ ] }, k.id)) }) })
1805
1169
  ] });
1806
1170
  }
1807
- function ne({ title: e, children: t }) {
1808
- return /* @__PURE__ */ y("section", { className: "ds-section", "data-ds-filter-group": !0, children: [
1809
- /* @__PURE__ */ o("h2", { className: "ds-section__title", children: e }),
1810
- /* @__PURE__ */ o("div", { className: "ds-defs", children: t })
1171
+ function te({ title: e, children: t }) {
1172
+ return /* @__PURE__ */ b("section", { className: "ds-section", "data-ds-filter-group": !0, children: [
1173
+ /* @__PURE__ */ n("h2", { className: "ds-section__title", children: e }),
1174
+ /* @__PURE__ */ n("div", { className: "ds-defs", children: t })
1811
1175
  ] });
1812
1176
  }
1813
- function W({ term: e, children: t }) {
1814
- return /* @__PURE__ */ y("dl", { className: "ds-def", "data-ds-filter": !0, children: [
1815
- /* @__PURE__ */ o("dt", { children: e }),
1816
- /* @__PURE__ */ o("dd", { children: t })
1177
+ function U({ term: e, children: t }) {
1178
+ return /* @__PURE__ */ b("dl", { className: "ds-def", "data-ds-filter": !0, children: [
1179
+ /* @__PURE__ */ n("dt", { children: e }),
1180
+ /* @__PURE__ */ n("dd", { children: t })
1817
1181
  ] });
1818
1182
  }
1819
- function ue({ term: e, items: t }) {
1820
- return t?.length ? /* @__PURE__ */ y("dl", { className: "ds-def", "data-ds-filter": !0, children: [
1821
- /* @__PURE__ */ o("dt", { children: e }),
1822
- /* @__PURE__ */ o("dd", { children: /* @__PURE__ */ o("ul", { className: "ds-list", children: t.map((n) => /* @__PURE__ */ o("li", { children: n }, n)) }) })
1183
+ function ie({ term: e, items: t }) {
1184
+ return t?.length ? /* @__PURE__ */ b("dl", { className: "ds-def", "data-ds-filter": !0, children: [
1185
+ /* @__PURE__ */ n("dt", { children: e }),
1186
+ /* @__PURE__ */ n("dd", { children: /* @__PURE__ */ n("ul", { className: "ds-list", children: t.map((o) => /* @__PURE__ */ n("li", { children: o }, o)) }) })
1823
1187
  ] }) : null;
1824
1188
  }
1825
- function pn(e) {
1189
+ function Xt(e) {
1826
1190
  return (e.metaKey || e.ctrlKey) && !e.altKey && !e.shiftKey && e.key.toLowerCase() === "f";
1827
1191
  }
1828
- function mn(e, t) {
1192
+ function Jt(e, t) {
1829
1193
  if (!e) return !1;
1830
- const n = X(t), r = [...e.querySelectorAll("[data-ds-filter]")];
1194
+ const o = fe(t), r = [...e.querySelectorAll("[data-ds-filter]")];
1831
1195
  for (const s of r)
1832
- s.hidden = n.length > 0 && !X(s.textContent ?? "").includes(n);
1196
+ s.hidden = o.length > 0 && !fe(s.textContent ?? "").includes(o);
1833
1197
  for (const s of e.querySelectorAll("[data-ds-filter-group]")) {
1834
- const a = [...s.querySelectorAll("[data-ds-filter]")], c = X(
1198
+ const a = [...s.querySelectorAll("[data-ds-filter]")], i = fe(
1835
1199
  s.querySelector("[data-ds-filter-title], .ds-section__title")?.textContent ?? ""
1836
1200
  );
1837
- if (n.length > 0 && c.includes(n)) {
1201
+ if (o.length > 0 && i.includes(o)) {
1838
1202
  s.hidden = !1;
1839
- for (const l of a) l.hidden = !1;
1203
+ for (const d of a) d.hidden = !1;
1840
1204
  continue;
1841
1205
  }
1842
- s.hidden = n.length > 0 && a.every((l) => l.hidden);
1206
+ s.hidden = o.length > 0 && a.every((d) => d.hidden);
1843
1207
  }
1844
- return n.length > 0 && r.length > 0 && r.every((s) => s.hidden);
1208
+ return o.length > 0 && r.length > 0 && r.every((s) => s.hidden);
1845
1209
  }
1846
- const fn = 24;
1847
- function wn({
1210
+ const en = 24;
1211
+ function tn({
1848
1212
  location: e,
1849
1213
  viewport: t,
1850
- zoom: n,
1214
+ zoom: o,
1851
1215
  title: r,
1852
1216
  resizing: s,
1853
1217
  onFrameNavigate: a,
1854
- onShortcut: c,
1855
- onEffectiveZoom: l,
1856
- frameRef: h
1218
+ onShortcut: i,
1219
+ onEffectiveZoom: d,
1220
+ frameRef: l
1857
1221
  }) {
1858
- const p = q(null), u = gn(p), i = ie(e.path, e.search), [f] = D(i), S = q(i), N = q(i), $ = typeof window > "u" ? "" : window.location.origin, _ = K(
1859
- (g) => {
1860
- N.current = g;
1861
- const C = h.current?.contentWindow;
1222
+ const c = j(null), h = nn(c), u = re(e.path, e.search), [p] = z(u), S = j(u), C = j(u), k = typeof window > "u" ? "" : window.location.origin, E = W(
1223
+ (P) => {
1224
+ C.current = P;
1225
+ const A = l.current?.contentWindow;
1862
1226
  try {
1863
- C?.location.replace(new URL(g, $).toString());
1227
+ A?.location.replace(new URL(P, k).toString());
1864
1228
  } catch {
1865
- h.current && (h.current.src = g);
1229
+ l.current && (l.current.src = P);
1866
1230
  }
1867
1231
  },
1868
- [h, $]
1232
+ [l, k]
1869
1233
  );
1870
- V(() => {
1871
- if (i === S.current) return;
1872
- const g = S.current;
1873
- S.current = i, ze(g) !== ze(i) ? _(i) : se(h.current?.contentWindow, { ds: 1, type: "location", url: i }, $);
1874
- }, [i, h, _, $]), V(() => {
1875
- const g = (C) => {
1876
- const E = Qe(C, {
1877
- origin: $,
1878
- source: h.current?.contentWindow
1234
+ I(() => {
1235
+ if (u === S.current) return;
1236
+ const P = S.current;
1237
+ S.current = u, _e(P) !== _e(u) ? E(u) : ne(l.current?.contentWindow, { ds: 1, type: "location", url: u }, k);
1238
+ }, [u, l, E, k]), I(() => {
1239
+ const P = (A) => {
1240
+ const O = qe(A, {
1241
+ origin: k,
1242
+ source: l.current?.contentWindow
1879
1243
  });
1880
- if (E)
1881
- switch (E.type) {
1244
+ if (O)
1245
+ switch (O.type) {
1882
1246
  case "ready": {
1883
- if (E.url === S.current) return;
1884
- if (E.url === N.current) {
1885
- se(
1886
- h.current?.contentWindow,
1247
+ if (O.url === S.current) return;
1248
+ if (O.url === C.current) {
1249
+ ne(
1250
+ l.current?.contentWindow,
1887
1251
  { ds: 1, type: "location", url: S.current },
1888
- $
1252
+ k
1889
1253
  );
1890
1254
  return;
1891
1255
  }
1892
- S.current = E.url, N.current = E.url, a(E.url, !0);
1256
+ S.current = O.url, C.current = O.url, a(O.url, !0);
1893
1257
  return;
1894
1258
  }
1895
1259
  case "navigate":
1896
- S.current = E.url, a(E.url, E.replace);
1260
+ S.current = O.url, a(O.url, O.replace);
1897
1261
  return;
1898
1262
  case "shortcut":
1899
- c(E.key);
1263
+ i(O.key);
1900
1264
  return;
1901
1265
  default:
1902
1266
  return;
1903
1267
  }
1904
1268
  };
1905
- return window.addEventListener("message", g), () => window.removeEventListener("message", g);
1906
- }, [h, a, c, $]);
1907
- const v = !!t.width, L = v ? fn : 0, b = Math.max(0, u.width - L * 2), m = Math.max(0, u.height - L * 2), w = !t.width || b === 0 || t.width <= b, k = n === 100 && !w ? Math.max(10, Math.floor(b / t.width * 100)) : n, x = k / 100;
1908
- V(() => {
1909
- l?.(k);
1910
- }, [k, l]);
1911
- const T = t.width ?? b / x, d = t.height ?? m / x;
1912
- return /* @__PURE__ */ o("div", { className: "ds-canvas", ref: p, "data-fit": v ? void 0 : "true", children: /* @__PURE__ */ o(
1269
+ return window.addEventListener("message", P), () => window.removeEventListener("message", P);
1270
+ }, [l, a, i, k]);
1271
+ const v = !!t.width, _ = v ? en : 0, f = Math.max(0, h.width - _ * 2), m = Math.max(0, h.height - _ * 2), w = !t.width || f === 0 || t.width <= f, g = o === 100 && !w ? Math.max(10, Math.floor(f / t.width * 100)) : o, N = g / 100;
1272
+ I(() => {
1273
+ d?.(g);
1274
+ }, [g, d]);
1275
+ const T = t.width ?? f / N, L = t.height ?? m / N;
1276
+ return /* @__PURE__ */ n("div", { className: "ds-canvas", ref: c, "data-fit": v ? void 0 : "true", children: /* @__PURE__ */ n(
1913
1277
  "div",
1914
1278
  {
1915
1279
  className: "ds-canvas__box",
1916
- style: { width: Math.floor(T * x), height: Math.floor(d * x) },
1917
- children: /* @__PURE__ */ o(
1280
+ style: { width: Math.floor(T * N), height: Math.floor(L * N) },
1281
+ children: /* @__PURE__ */ n(
1918
1282
  "iframe",
1919
1283
  {
1920
- ref: h,
1921
- [Lt]: "",
1284
+ ref: l,
1285
+ [St]: "",
1922
1286
  className: "ds-frame",
1923
- src: f,
1287
+ src: p,
1924
1288
  title: r,
1925
1289
  style: {
1926
1290
  width: Math.floor(T),
1927
- height: Math.floor(d),
1928
- transform: x === 1 ? void 0 : `scale(${x})`,
1291
+ height: Math.floor(L),
1292
+ transform: N === 1 ? void 0 : `scale(${N})`,
1929
1293
  pointerEvents: s ? "none" : void 0
1930
1294
  }
1931
1295
  }
@@ -1933,15 +1297,15 @@ function wn({
1933
1297
  }
1934
1298
  ) });
1935
1299
  }
1936
- function gn(e) {
1937
- const [t, n] = D({ width: 0, height: 0 });
1938
- return qe(() => {
1300
+ function nn(e) {
1301
+ const [t, o] = z({ width: 0, height: 0 });
1302
+ return Ie(() => {
1939
1303
  const r = e.current;
1940
1304
  if (!r) return;
1941
1305
  const s = () => {
1942
- const c = r.clientWidth, l = r.clientHeight;
1943
- n(
1944
- (h) => h.width === c && h.height === l ? h : { width: c, height: l }
1306
+ const i = r.clientWidth, d = r.clientHeight;
1307
+ o(
1308
+ (l) => l.width === i && l.height === d ? l : { width: i, height: d }
1945
1309
  );
1946
1310
  };
1947
1311
  if (s(), typeof ResizeObserver > "u")
@@ -1950,260 +1314,260 @@ function gn(e) {
1950
1314
  return a.observe(r), () => a.disconnect();
1951
1315
  }, [e]), t;
1952
1316
  }
1953
- const at = 2500;
1954
- class it extends Error {
1317
+ const Ye = 2500;
1318
+ class Qe extends Error {
1955
1319
  constructor(t) {
1956
1320
  super(`Falha de rede simulada no cenário "${t}".`), this.name = "SimulatedNetworkError";
1957
1321
  }
1958
1322
  }
1959
- function Ee(e) {
1323
+ function ve(e) {
1960
1324
  if (e)
1961
1325
  return typeof e.data == "function" ? e.data() : e.data;
1962
1326
  }
1963
- const Le = {
1327
+ const ke = {
1964
1328
  id: "fixtures",
1965
1329
  label: "Fixtures",
1966
- load: async ({ scenario: e, fixture: t, network: n }) => {
1967
- switch (n) {
1330
+ load: async ({ scenario: e, fixture: t, network: o }) => {
1331
+ switch (o) {
1968
1332
  case "empty":
1969
1333
  return null;
1970
1334
  case "error":
1971
- throw new it(e.id);
1335
+ throw new Qe(e.id);
1972
1336
  case "loading":
1973
1337
  return new Promise(() => {
1974
1338
  });
1975
1339
  case "slow":
1976
- return await vn(at), Ee(t);
1340
+ return await on(Ye), ve(t);
1977
1341
  default:
1978
- return Ee(t);
1342
+ return ve(t);
1979
1343
  }
1980
1344
  }
1981
1345
  };
1982
- function Hn(e) {
1983
- const { id: t, label: n, baseUrl: r, path: s, init: a, fallbackToFixture: c = !0 } = e;
1346
+ function _n(e) {
1347
+ const { id: t, label: o, baseUrl: r, path: s, init: a, fallbackToFixture: i = !0 } = e;
1984
1348
  return {
1985
1349
  id: t,
1986
- label: n,
1987
- load: async (l) => {
1988
- const h = new URL(s ? s(l) : l.scenario.route, r);
1350
+ label: o,
1351
+ load: async (d) => {
1352
+ const l = new URL(s ? s(d) : d.scenario.route, r);
1989
1353
  try {
1990
- const p = await fetch(h, a);
1991
- if (!p.ok) throw new Error(`${p.status} ${p.statusText}`);
1992
- return await p.json();
1993
- } catch (p) {
1994
- if (c) return Ee(l.fixture);
1995
- throw new Error(`Adapter "${t}" falhou em ${h.toString()}`, { cause: p });
1354
+ const c = await fetch(l, a);
1355
+ if (!c.ok) throw new Error(`${c.status} ${c.statusText}`);
1356
+ return await c.json();
1357
+ } catch (c) {
1358
+ if (i) return ve(d.fixture);
1359
+ throw new Error(`Adapter "${t}" falhou em ${l.toString()}`, { cause: c });
1996
1360
  }
1997
1361
  }
1998
1362
  };
1999
1363
  }
2000
- function vn(e) {
1364
+ function on(e) {
2001
1365
  return new Promise((t) => setTimeout(t, e));
2002
1366
  }
2003
- function bn(e) {
2004
- const { scenario: t, fixture: n, network: r, adapter: s } = e, [a, c] = D({
1367
+ function rn(e) {
1368
+ const { scenario: t, fixture: o, network: r, adapter: s } = e, [a, i] = z({
2005
1369
  data: void 0,
2006
1370
  isLoading: !!t || r === "loading" || r === "slow",
2007
1371
  error: void 0
2008
1372
  });
2009
- return V(() => {
1373
+ return I(() => {
2010
1374
  if (!t)
2011
1375
  switch (r) {
2012
1376
  case "loading":
2013
- c({ data: void 0, isLoading: !0, error: void 0 });
1377
+ i({ data: void 0, isLoading: !0, error: void 0 });
2014
1378
  return;
2015
1379
  case "empty":
2016
- c({ data: null, isLoading: !1, error: void 0 });
1380
+ i({ data: null, isLoading: !1, error: void 0 });
2017
1381
  return;
2018
1382
  case "error":
2019
- c({
1383
+ i({
2020
1384
  data: void 0,
2021
1385
  isLoading: !1,
2022
- error: new it(e.screen ?? "—")
1386
+ error: new Qe(e.screen ?? "—")
2023
1387
  });
2024
1388
  return;
2025
1389
  case "slow": {
2026
- c({ data: void 0, isLoading: !0, error: void 0 });
2027
- const p = setTimeout(
2028
- () => c({ data: void 0, isLoading: !1, error: void 0 }),
2029
- at
1390
+ i({ data: void 0, isLoading: !0, error: void 0 });
1391
+ const c = setTimeout(
1392
+ () => i({ data: void 0, isLoading: !1, error: void 0 }),
1393
+ Ye
2030
1394
  );
2031
- return () => clearTimeout(p);
1395
+ return () => clearTimeout(c);
2032
1396
  }
2033
1397
  default:
2034
- c({ data: void 0, isLoading: !1, error: void 0 });
1398
+ i({ data: void 0, isLoading: !1, error: void 0 });
2035
1399
  return;
2036
1400
  }
2037
- let l = !0;
2038
- c({ data: void 0, isLoading: !0, error: void 0 });
2039
- const h = s ?? Le;
2040
- return Promise.resolve(h.load({ scenario: t, fixture: n, network: r })).then((p) => {
2041
- l && c({ data: p, isLoading: !1, error: void 0 });
2042
- }).catch((p) => {
2043
- l && c({
1401
+ let d = !0;
1402
+ i({ data: void 0, isLoading: !0, error: void 0 });
1403
+ const l = s ?? ke;
1404
+ return Promise.resolve(l.load({ scenario: t, fixture: o, network: r })).then((c) => {
1405
+ d && i({ data: c, isLoading: !1, error: void 0 });
1406
+ }).catch((c) => {
1407
+ d && i({
2044
1408
  data: void 0,
2045
1409
  isLoading: !1,
2046
- error: p instanceof Error ? p : new Error(String(p))
1410
+ error: c instanceof Error ? c : new Error(String(c))
2047
1411
  });
2048
1412
  }), () => {
2049
- l = !1;
1413
+ d = !1;
2050
1414
  };
2051
- }, [t, n, r, s, e.screen]), a;
1415
+ }, [t, o, r, s, e.screen]), a;
2052
1416
  }
2053
- function Ke({ title: e, children: t }) {
2054
- return /* @__PURE__ */ y("div", { className: "ds-stage-empty", children: [
2055
- /* @__PURE__ */ o("h2", { className: "ds-stage-empty__title", children: e }),
1417
+ function Oe({ title: e, children: t }) {
1418
+ return /* @__PURE__ */ b("div", { className: "ds-stage-empty", children: [
1419
+ /* @__PURE__ */ n("h2", { className: "ds-stage-empty__title", children: e }),
2056
1420
  t
2057
1421
  ] });
2058
1422
  }
2059
- const kn = /* @__PURE__ */ Symbol.for("react.memo"), Sn = /* @__PURE__ */ Symbol.for("react.forward_ref");
2060
- class ct extends Error {
1423
+ const sn = /* @__PURE__ */ Symbol.for("react.memo"), an = /* @__PURE__ */ Symbol.for("react.forward_ref");
1424
+ class Xe extends Error {
2061
1425
  }
2062
- function lt(e) {
1426
+ function Je(e) {
2063
1427
  const t = [];
2064
- let n = e;
2065
- for (; n && (typeof n == "function" || typeof n == "object") && !t.includes(n); ) {
2066
- t.push(n);
2067
- const r = n.$$typeof;
2068
- if (r === kn) n = n.type;
2069
- else if (r === Sn) n = n.render;
1428
+ let o = e;
1429
+ for (; o && (typeof o == "function" || typeof o == "object") && !t.includes(o); ) {
1430
+ t.push(o);
1431
+ const r = o.$$typeof;
1432
+ if (r === sn) o = o.type;
1433
+ else if (r === an) o = o.render;
2070
1434
  else break;
2071
1435
  }
2072
1436
  return t;
2073
1437
  }
2074
- function Cn(e) {
1438
+ function cn(e) {
2075
1439
  const t = /* @__PURE__ */ new Map();
2076
- for (const n of e) {
2077
- const r = Array.isArray(n.implementation) ? n.implementation : n.implementation === void 0 ? [] : [n.implementation];
1440
+ for (const o of e) {
1441
+ const r = Array.isArray(o.implementation) ? o.implementation : o.implementation === void 0 ? [] : [o.implementation];
2078
1442
  for (const s of r)
2079
- for (const a of lt(s)) {
2080
- const c = t.get(a) ?? [];
2081
- c.includes(n.id) || c.push(n.id), t.set(a, c);
1443
+ for (const a of Je(s)) {
1444
+ const i = t.get(a) ?? [];
1445
+ i.includes(o.id) || i.push(o.id), t.set(a, i);
2082
1446
  }
2083
1447
  }
2084
1448
  return t;
2085
1449
  }
2086
- function yn(e, t) {
2087
- const n = [];
1450
+ function ln(e, t) {
1451
+ const o = [];
2088
1452
  for (const r of [e.type, e.elementType])
2089
- for (const s of lt(r))
2090
- for (const a of t.get(s) ?? []) n.includes(a) || n.push(a);
2091
- return n;
1453
+ for (const s of Je(r))
1454
+ for (const a of t.get(s) ?? []) o.includes(a) || o.push(a);
1455
+ return o;
2092
1456
  }
2093
- function xn(e) {
1457
+ function dn(e) {
2094
1458
  return !!e && e.nodeType === 1;
2095
1459
  }
2096
- function dt(e) {
2097
- return typeof e.type == "string" && xn(e.stateNode);
1460
+ function et(e) {
1461
+ return typeof e.type == "string" && dn(e.stateNode);
2098
1462
  }
2099
- function Te(e) {
1463
+ function ye(e) {
2100
1464
  if (!e || typeof e != "object" || !("child" in e) || !("sibling" in e) || !("stateNode" in e))
2101
- throw new ct("fiber sem child, sibling ou stateNode");
1465
+ throw new Xe("fiber sem child, sibling ou stateNode");
2102
1466
  }
2103
- function ut(e, t) {
2104
- for (let n = e.child; n; n = n.sibling)
2105
- Te(n), dt(n) ? t.push(n.stateNode) : ut(n, t);
1467
+ function tt(e, t) {
1468
+ for (let o = e.child; o; o = o.sibling)
1469
+ ye(o), et(o) ? t.push(o.stateNode) : tt(o, t);
2106
1470
  }
2107
- function Nn(e, t) {
2108
- const n = [];
2109
- if (t.size === 0) return n;
1471
+ function hn(e, t) {
1472
+ const o = [];
1473
+ if (t.size === 0) return o;
2110
1474
  for (const r of e) {
2111
1475
  const s = r?.current;
2112
- if (Te(s), s.stateNode !== r) throw new ct("raiz sem `current.stateNode` de volta");
1476
+ if (ye(s), s.stateNode !== r) throw new Xe("raiz sem `current.stateNode` de volta");
2113
1477
  const a = s.child ? [s.child] : [];
2114
1478
  for (; a.length > 0; ) {
2115
- const c = a.pop();
2116
- if (Te(c), c.sibling && a.push(c.sibling), c.child && a.push(c.child), dt(c)) continue;
2117
- const l = yn(c, t);
2118
- if (l.length === 0) continue;
2119
- const h = [];
2120
- ut(c, h), h.length > 0 && n.push({ ids: l, elements: h });
1479
+ const i = a.pop();
1480
+ if (ye(i), i.sibling && a.push(i.sibling), i.child && a.push(i.child), et(i)) continue;
1481
+ const d = ln(i, t);
1482
+ if (d.length === 0) continue;
1483
+ const l = [];
1484
+ tt(i, l), l.length > 0 && o.push({ ids: d, elements: l });
2121
1485
  }
2122
1486
  }
2123
- return n;
1487
+ return o;
2124
1488
  }
2125
- let He = !1;
2126
- function We(e) {
2127
- He || (He = !0, console.warn(`[design-space] ${e}`));
1489
+ let $e = !1;
1490
+ function ze(e) {
1491
+ $e || ($e = !0, console.warn(`[design-space] ${e}`));
2128
1492
  }
2129
- function $n(e, t) {
1493
+ function un(e, t) {
2130
1494
  if (e.size === 0) return [];
2131
- const n = Ot(t);
2132
- if (!n)
2133
- return We(
2134
- `Destacar componentes: o React carregou antes do gancho do DevTools, então só a marcação \`${fe}\` é contornada. Importe "@brucesantos/design-space/devtools-hook" na primeira linha do ponto de entrada, antes de qualquer import de React.`
1495
+ const o = Et(t);
1496
+ if (!o)
1497
+ return ze(
1498
+ `Destacar componentes: o React carregou antes do gancho do DevTools, então só a marcação \`${de}\` é contornada. Importe "@brucesantos/design-space/devtools-hook" na primeira linha do ponto de entrada, antes de qualquer import de React.`
2135
1499
  ), [];
2136
1500
  try {
2137
- return Nn(n, e);
1501
+ return hn(o, e);
2138
1502
  } catch (r) {
2139
- return We(
2140
- "Destacar componentes: a árvore do React não tem a forma esperada, então só a marcação " + `\`${fe}\` é contornada. ${r instanceof Error ? r.message : ""}`.trim()
1503
+ return ze(
1504
+ "Destacar componentes: a árvore do React não tem a forma esperada, então só a marcação " + `\`${de}\` é contornada. ${r instanceof Error ? r.message : ""}`.trim()
2141
1505
  ), [];
2142
1506
  }
2143
1507
  }
2144
- function Mn(e, t = /* @__PURE__ */ new Map()) {
2145
- const n = e.defaultView ?? window, r = $n(t, n);
2146
- e.querySelectorAll(`[${fe}]`).forEach((l) => {
2147
- r.push({ ids: [l.getAttribute(fe) ?? ""], elements: [l] });
1508
+ function mn(e, t = /* @__PURE__ */ new Map()) {
1509
+ const o = e.defaultView ?? window, r = un(t, o);
1510
+ e.querySelectorAll(`[${de}]`).forEach((d) => {
1511
+ r.push({ ids: [d.getAttribute(de) ?? ""], elements: [d] });
2148
1512
  });
2149
1513
  const s = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
2150
- for (const l of r) {
2151
- const h = l.elements.filter((i) => i.isConnected && !i.closest(".ds-highlight"));
2152
- if (h.length === 0) continue;
2153
- const p = h.map((i) => (s.has(i) || s.set(i, s.size), s.get(i))).join(","), u = a.get(p) ?? { ids: [], elements: h };
2154
- for (const i of l.ids) u.ids.includes(i) || u.ids.push(i);
2155
- a.set(p, u);
1514
+ for (const d of r) {
1515
+ const l = d.elements.filter((u) => u.isConnected && !u.closest(".ds-highlight"));
1516
+ if (l.length === 0) continue;
1517
+ const c = l.map((u) => (s.has(u) || s.set(u, s.size), s.get(u))).join(","), h = a.get(c) ?? { ids: [], elements: l };
1518
+ for (const u of d.ids) h.ids.includes(u) || h.ids.push(u);
1519
+ a.set(c, h);
2156
1520
  }
2157
- const c = [];
2158
- for (const [l, { ids: h, elements: p }] of a) {
2159
- let u = 1 / 0, i = 1 / 0, f = -1 / 0, S = -1 / 0;
2160
- for (const N of p) {
2161
- const $ = N.getBoundingClientRect();
2162
- $.width === 0 && $.height === 0 || (u = Math.min(u, $.top), i = Math.min(i, $.left), f = Math.max(f, $.right), S = Math.max(S, $.bottom));
1521
+ const i = [];
1522
+ for (const [d, { ids: l, elements: c }] of a) {
1523
+ let h = 1 / 0, u = 1 / 0, p = -1 / 0, S = -1 / 0;
1524
+ for (const C of c) {
1525
+ const k = C.getBoundingClientRect();
1526
+ k.width === 0 && k.height === 0 || (h = Math.min(h, k.top), u = Math.min(u, k.left), p = Math.max(p, k.right), S = Math.max(S, k.bottom));
2163
1527
  }
2164
- u !== 1 / 0 && c.push({ key: l, ids: h, top: u, left: i, width: f - i, height: S - u });
1528
+ h !== 1 / 0 && i.push({ key: d, ids: l, top: h, left: u, width: p - u, height: S - h });
2165
1529
  }
2166
- return c;
1530
+ return i;
2167
1531
  }
2168
- function En(e, t) {
2169
- return e.length === t.length && e.every((n, r) => {
1532
+ function fn(e, t) {
1533
+ return e.length === t.length && e.every((o, r) => {
2170
1534
  const s = t[r];
2171
- return n.key === s.key && n.top === s.top && n.left === s.left && n.width === s.width && n.height === s.height && n.ids.join(`
1535
+ return o.key === s.key && o.top === s.top && o.left === s.left && o.width === s.width && o.height === s.height && o.ids.join(`
2172
1536
  `) === s.ids.join(`
2173
1537
  `);
2174
1538
  });
2175
1539
  }
2176
- const Ln = 16;
2177
- function Tn({ registry: e }) {
2178
- const t = J(), n = A(() => Cn(e.componentsFor()), [e]), [r, s] = D([]);
2179
- return V(() => {
2180
- zt(window);
1540
+ const pn = 16;
1541
+ function wn({ registry: e }) {
1542
+ const t = X(), o = $(() => cn(e.componentsFor()), [e]), [r, s] = z([]);
1543
+ return I(() => {
1544
+ Lt(window);
2181
1545
  let a = 0;
2182
- const c = () => {
1546
+ const i = () => {
2183
1547
  a || (a = window.requestAnimationFrame(() => {
2184
1548
  a = 0;
2185
- const p = Mn(document, n);
2186
- s((u) => En(u, p) ? u : p);
1549
+ const c = mn(document, o);
1550
+ s((h) => fn(h, c) ? h : c);
2187
1551
  }));
2188
- }, l = new MutationObserver((p) => {
2189
- p.some((i) => !(i.target instanceof Element ? i.target : i.target.parentElement)?.closest(".ds-highlight")) && c();
1552
+ }, d = new MutationObserver((c) => {
1553
+ c.some((u) => !(u.target instanceof Element ? u.target : u.target.parentElement)?.closest(".ds-highlight")) && i();
2190
1554
  });
2191
- l.observe(document.body, { subtree: !0, childList: !0, attributes: !0, characterData: !0 }), window.addEventListener("scroll", c, !0), window.addEventListener("resize", c), document.addEventListener("transitionend", c, !0), document.addEventListener("animationend", c, !0);
2192
- const h = At(c, window);
2193
- return c(), () => {
2194
- a && window.cancelAnimationFrame(a), l.disconnect(), window.removeEventListener("scroll", c, !0), window.removeEventListener("resize", c), document.removeEventListener("transitionend", c, !0), document.removeEventListener("animationend", c, !0), h();
1555
+ d.observe(document.body, { subtree: !0, childList: !0, attributes: !0, characterData: !0 }), window.addEventListener("scroll", i, !0), window.addEventListener("resize", i), document.addEventListener("transitionend", i, !0), document.addEventListener("animationend", i, !0);
1556
+ const l = _t(i, window);
1557
+ return i(), () => {
1558
+ a && window.cancelAnimationFrame(a), d.disconnect(), window.removeEventListener("scroll", i, !0), window.removeEventListener("resize", i), document.removeEventListener("transitionend", i, !0), document.removeEventListener("animationend", i, !0), l();
2195
1559
  };
2196
- }, [n]), Ft(
2197
- /* @__PURE__ */ o("div", { className: "ds-highlight", "aria-hidden": "true", children: r.map((a) => {
2198
- const c = a.ids.map((l) => ({ id: l, known: e.component(l) }));
2199
- return /* @__PURE__ */ o(
1560
+ }, [o]), Mt(
1561
+ /* @__PURE__ */ n("div", { className: "ds-highlight", "aria-hidden": "true", children: r.map((a) => {
1562
+ const i = a.ids.map((d) => ({ id: d, known: e.component(d) }));
1563
+ return /* @__PURE__ */ n(
2200
1564
  "div",
2201
1565
  {
2202
1566
  className: "ds-highlight__box",
2203
- "data-known": c.every((l) => l.known) ? "true" : "false",
2204
- "data-label": a.top < Ln ? "inside" : "above",
1567
+ "data-known": i.every((d) => d.known) ? "true" : "false",
1568
+ "data-label": a.top < pn ? "inside" : "above",
2205
1569
  style: { top: a.top, left: a.left, width: a.width, height: a.height },
2206
- children: /* @__PURE__ */ o("span", { className: "ds-highlight__label", children: c.map((l) => l.known ? l.known.name : t.highlight.notInCatalog(l.id)).join(" · ") })
1570
+ children: /* @__PURE__ */ n("span", { className: "ds-highlight__label", children: i.map((d) => d.known ? d.known.name : t.highlight.notInCatalog(d.id)).join(" · ") })
2207
1571
  },
2208
1572
  a.key
2209
1573
  );
@@ -2211,109 +1575,109 @@ function Tn({ registry: e }) {
2211
1575
  document.body
2212
1576
  );
2213
1577
  }
2214
- function Pn({ product: e, registry: t }) {
2215
- const n = J(), { location: r, controls: s, viewport: a, navigate: c, openScenario: l, setScreenControls: h } = et(
1578
+ function bn({ product: e, registry: t }) {
1579
+ const o = X(), { location: r, controls: s, viewport: a, navigate: i, openScenario: d, setScreenControls: l } = je(
2216
1580
  t,
2217
1581
  { frame: !0 }
2218
- ), p = q(null);
2219
- V(() => {
2220
- const P = (z) => {
2221
- if (z.defaultPrevented || z.button !== 0 || z.metaKey || z.ctrlKey || z.shiftKey || z.altKey) return;
2222
- const U = z.target?.closest?.("a[href]");
2223
- if (!(U instanceof HTMLAnchorElement) || U.target && U.target !== "_self" || U.hasAttribute("download")) return;
2224
- const Z = U.getAttribute("href") ?? "";
1582
+ ), c = j(null);
1583
+ I(() => {
1584
+ const x = (R) => {
1585
+ if (R.defaultPrevented || R.button !== 0 || R.metaKey || R.ctrlKey || R.shiftKey || R.altKey) return;
1586
+ const K = R.target?.closest?.("a[href]");
1587
+ if (!(K instanceof HTMLAnchorElement) || K.target && K.target !== "_self" || K.hasAttribute("download")) return;
1588
+ const Z = K.getAttribute("href") ?? "";
2225
1589
  if (Z.startsWith("#")) return;
2226
- let B;
1590
+ let q;
2227
1591
  try {
2228
- B = new URL(Z, window.location.href);
1592
+ q = new URL(Z, window.location.href);
2229
1593
  } catch {
2230
1594
  return;
2231
1595
  }
2232
- B.origin === window.location.origin && (z.preventDefault(), c(`${B.pathname}${B.search}`));
1596
+ q.origin === window.location.origin && (R.preventDefault(), i(`${q.pathname}${q.search}`));
2233
1597
  };
2234
- return document.addEventListener("click", P), () => document.removeEventListener("click", P);
2235
- }, [c]), V(() => {
2236
- const P = (z) => {
1598
+ return document.addEventListener("click", x), () => document.removeEventListener("click", x);
1599
+ }, [i]), I(() => {
1600
+ const x = (R) => {
2237
1601
  if (window.parent === window) return;
2238
- const U = Rn(z);
2239
- if (!U) return;
2240
- const Z = z.target;
2241
- U === "C" && Z?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (z.preventDefault(), se(window.parent, { ds: 1, type: "shortcut", key: U }, window.location.origin));
1602
+ const K = gn(R);
1603
+ if (!K) return;
1604
+ const Z = R.target;
1605
+ K === "C" && Z?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (R.preventDefault(), ne(window.parent, { ds: 1, type: "shortcut", key: K }, window.location.origin));
2242
1606
  };
2243
- return window.addEventListener("keydown", P), () => window.removeEventListener("keydown", P);
2244
- }, []), V(() => {
2245
- const P = p.current;
2246
- if (!P || !s.handoff) return;
2247
- const z = () => {
2248
- for (const Z of P.querySelectorAll("a[href]")) {
2249
- const B = Z.getAttribute("href");
2250
- if (!B || B.startsWith("#")) continue;
1607
+ return window.addEventListener("keydown", x), () => window.removeEventListener("keydown", x);
1608
+ }, []), I(() => {
1609
+ const x = c.current;
1610
+ if (!x || !s.handoff) return;
1611
+ const R = () => {
1612
+ for (const Z of x.querySelectorAll("a[href]")) {
1613
+ const q = Z.getAttribute("href");
1614
+ if (!q || q.startsWith("#")) continue;
2251
1615
  let Y;
2252
1616
  try {
2253
- Y = new URL(B, window.location.href);
1617
+ Y = new URL(q, window.location.href);
2254
1618
  } catch {
2255
1619
  continue;
2256
1620
  }
2257
1621
  if (Y.origin !== window.location.origin) continue;
2258
- Pe(Y.searchParams, s.handoff);
2259
- const ce = `${Y.pathname}${Y.search}${Y.hash}`;
2260
- B !== ce && Z.setAttribute("href", ce);
1622
+ Ce(Y.searchParams, s.handoff);
1623
+ const se = `${Y.pathname}${Y.search}${Y.hash}`;
1624
+ q !== se && Z.setAttribute("href", se);
2261
1625
  }
2262
1626
  };
2263
- z();
2264
- const U = new MutationObserver(z);
2265
- return U.observe(P, { subtree: !0, childList: !0, attributes: !0, attributeFilter: ["href"] }), () => U.disconnect();
1627
+ R();
1628
+ const K = new MutationObserver(R);
1629
+ return K.observe(x, { subtree: !0, childList: !0, attributes: !0, attributeFilter: ["href"] }), () => K.disconnect();
2266
1630
  }, [s.handoff]);
2267
- const u = t.scenario(s.scenario), i = t.component(s.component), f = A(() => {
2268
- const P = new URLSearchParams(r.search);
1631
+ const h = t.scenario(s.scenario), u = t.component(s.component), p = $(() => {
1632
+ const x = new URLSearchParams(r.search);
2269
1633
  return {
2270
- scenario: P.get(M.scenario) ?? void 0,
2271
- component: P.get(M.component) ?? void 0
1634
+ scenario: x.get(y.scenario) ?? void 0,
1635
+ component: x.get(y.component) ?? void 0
2272
1636
  };
2273
- }, [r.search]), S = !!(s.handoff && (f.scenario && !re(s.handoff, f.scenario) || f.component && !be(s.handoff, f.component) || !f.component && !Ge(s.handoff, r.path, e.scenarios))), N = A(
2274
- () => t.resolveComponentFixture(i?.id, i ? s.fixture : void 0),
2275
- [i, s.fixture, t]
2276
- ), $ = A(() => {
2277
- const P = N.fixture?.data;
2278
- return typeof P == "function" ? P() : P;
2279
- }, [N.fixture]), _ = t.persona(s.persona ?? u?.persona), v = t.fixture(s.fixture ?? u?.fixture), L = A(() => {
2280
- const P = s.dataSource ?? "fixtures";
2281
- return P === "fixtures" ? Le : e.dataSources?.adapters?.find((z) => z.id === P) ?? Le;
2282
- }, [s.dataSource, e.dataSources?.adapters]), { data: b, isLoading: m, error: w } = bn({
2283
- scenario: u,
1637
+ }, [r.search]), S = !!(s.handoff && (p.scenario && !Ne(s.handoff, p.scenario) || p.component && !Se(s.handoff, p.component) || !p.component && !gt(s.handoff, r.path, e.scenarios))), C = $(
1638
+ () => t.resolveComponentFixture(u?.id, u ? s.fixture : void 0),
1639
+ [u, s.fixture, t]
1640
+ ), k = $(() => {
1641
+ const x = C.fixture?.data;
1642
+ return typeof x == "function" ? x() : x;
1643
+ }, [C.fixture]), E = t.persona(s.persona ?? h?.persona), v = t.fixture(s.fixture ?? h?.fixture), _ = $(() => {
1644
+ const x = s.dataSource ?? "fixtures";
1645
+ return x === "fixtures" ? ke : e.dataSources?.adapters?.find((R) => R.id === x) ?? ke;
1646
+ }, [s.dataSource, e.dataSources?.adapters]), { data: f, isLoading: m, error: w } = rn({
1647
+ scenario: h,
2284
1648
  fixture: v,
2285
1649
  network: s.network,
2286
- adapter: L,
1650
+ adapter: _,
2287
1651
  screen: r.path
2288
- }), k = A(() => u ? s.persona && s.persona !== (u.persona ?? t.defaultPersona) ? t.persona(s.persona)?.permissions ?? [] : t.permissionsOf(u) : t.persona(s.persona)?.permissions ?? [], [s.persona, t, u]), x = s.screenControls, T = A(() => x ?? {}, [x]), d = K(
2289
- (P, z) => h({ [P]: z }),
2290
- [h]
2291
- ), g = A(
1652
+ }), g = $(() => h ? s.persona && s.persona !== (h.persona ?? t.defaultPersona) ? t.persona(s.persona)?.permissions ?? [] : t.permissionsOf(h) : t.persona(s.persona)?.permissions ?? [], [s.persona, t, h]), N = s.screenControls, T = $(() => N ?? {}, [N]), L = W(
1653
+ (x, R) => l({ [x]: R }),
1654
+ [l]
1655
+ ), P = $(
2292
1656
  () => ({
2293
- scenario: u,
2294
- persona: _,
2295
- permissions: k,
2296
- can: (P) => k.includes(P),
2297
- data: b,
1657
+ scenario: h,
1658
+ persona: E,
1659
+ permissions: g,
1660
+ can: (x) => g.includes(x),
1661
+ data: f,
2298
1662
  fixture: v,
2299
1663
  network: s.network,
2300
1664
  isLoading: m,
2301
1665
  error: w,
2302
- rules: t.rulesOf(u),
1666
+ rules: t.rulesOf(h),
2303
1667
  viewport: a,
2304
1668
  themeMode: s.themeMode,
2305
1669
  locale: s.locale,
2306
- navigate: c,
2307
- openScenario: l,
1670
+ navigate: i,
1671
+ openScenario: d,
2308
1672
  controls: T,
2309
- setControl: d,
2310
- setControls: h
1673
+ setControl: L,
1674
+ setControls: l
2311
1675
  }),
2312
1676
  [
2313
- u,
2314
- _,
2315
- k,
2316
- b,
1677
+ h,
1678
+ E,
1679
+ g,
1680
+ f,
2317
1681
  v,
2318
1682
  s.network,
2319
1683
  s.themeMode,
@@ -2322,36 +1686,36 @@ function Pn({ product: e, registry: t }) {
2322
1686
  w,
2323
1687
  t,
2324
1688
  a,
2325
- c,
2326
- l,
2327
- T,
1689
+ i,
2328
1690
  d,
2329
- h
1691
+ T,
1692
+ L,
1693
+ l
2330
1694
  ]
2331
- ), C = Ne(e.routes ?? [], r.path), E = e.wrapper, F = e.notFound, O = i?.preview, I = S ? /* @__PURE__ */ o(Ke, { title: n.shell.outsideHandoff, children: /* @__PURE__ */ o("p", { children: n.shell.outsideHandoffHint }) }) : O ? /* @__PURE__ */ o(
2332
- O,
1695
+ ), A = vt(e.routes ?? [], r.path), O = e.wrapper, G = e.notFound, F = u?.preview, D = S ? /* @__PURE__ */ n(Oe, { title: o.shell.outsideHandoff, children: /* @__PURE__ */ n("p", { children: o.shell.outsideHandoffHint }) }) : F ? /* @__PURE__ */ n(
1696
+ F,
2333
1697
  {
2334
- fixture: N.fixture,
2335
- data: $,
1698
+ fixture: C.fixture,
1699
+ data: k,
2336
1700
  viewport: a,
2337
1701
  themeMode: s.themeMode ?? "default",
2338
1702
  locale: s.locale ?? "default"
2339
1703
  }
2340
- ) : C ? /* @__PURE__ */ o(C.definition.screen, { params: C.params, context: g }) : F ? /* @__PURE__ */ o(F, { path: r.path }) : /* @__PURE__ */ o(Ke, { title: n.shell.noRoute, children: /* @__PURE__ */ y("p", { children: [
2341
- /* @__PURE__ */ o("code", { children: r.path }),
1704
+ ) : A ? /* @__PURE__ */ n(A.definition.screen, { params: A.params, context: P }) : G ? /* @__PURE__ */ n(G, { path: r.path }) : /* @__PURE__ */ n(Oe, { title: o.shell.noRoute, children: /* @__PURE__ */ b("p", { children: [
1705
+ /* @__PURE__ */ n("code", { children: r.path }),
2342
1706
  " ",
2343
- n.shell.noRouteHint
1707
+ o.shell.noRouteHint
2344
1708
  ] }) });
2345
1709
  return (
2346
1710
  // `display: contents` deixa o layout do produto como se este nó não
2347
1711
  // existisse: ele só serve de raiz para observar os links.
2348
- /* @__PURE__ */ y("div", { ref: p, style: { display: "contents" }, children: [
2349
- E && !S ? /* @__PURE__ */ o(E, { context: g, children: I }) : I,
2350
- s.highlight && !S && /* @__PURE__ */ o(Tn, { registry: t })
1712
+ /* @__PURE__ */ b("div", { ref: c, style: { display: "contents" }, children: [
1713
+ O && !S ? /* @__PURE__ */ n(O, { context: P, children: D }) : D,
1714
+ s.highlight && !S && /* @__PURE__ */ n(wn, { registry: t })
2351
1715
  ] })
2352
1716
  );
2353
1717
  }
2354
- function Rn(e) {
1718
+ function gn(e) {
2355
1719
  if (!e.altKey) {
2356
1720
  if (e.shiftKey && !e.metaKey && !e.ctrlKey && e.key === "C") return "C";
2357
1721
  if ((e.metaKey || e.ctrlKey) && !e.shiftKey) {
@@ -2361,49 +1725,49 @@ function Rn(e) {
2361
1725
  }
2362
1726
  }
2363
1727
  }
2364
- const pe = {
1728
+ const le = {
2365
1729
  leftWidth: "ds:left-width",
2366
1730
  rightWidth: "ds:right-width",
2367
1731
  appearance: "ds:appearance"
2368
1732
  };
2369
- function ht(e) {
1733
+ function nt(e) {
2370
1734
  try {
2371
1735
  return window.localStorage.getItem(e) ?? void 0;
2372
1736
  } catch {
2373
1737
  return;
2374
1738
  }
2375
1739
  }
2376
- function pt(e, t) {
1740
+ function ot(e, t) {
2377
1741
  try {
2378
1742
  window.localStorage.setItem(e, t);
2379
1743
  } catch {
2380
1744
  }
2381
1745
  }
2382
- function Be(e, t, n) {
2383
- return Math.round(Math.min(n, Math.max(t, e)));
2384
- }
2385
- function je(e, t, n, r) {
2386
- const [s, a] = D(() => {
2387
- const l = Number.parseInt(ht(e) ?? "", 10);
2388
- return Number.isFinite(l) ? Be(l, n, r) : t;
2389
- }), c = K(
2390
- (l) => {
2391
- const h = Be(l, n, r);
2392
- a(h), pt(e, String(h));
1746
+ function De(e, t, o) {
1747
+ return Math.round(Math.min(o, Math.max(t, e)));
1748
+ }
1749
+ function Ke(e, t, o, r) {
1750
+ const [s, a] = z(() => {
1751
+ const d = Number.parseInt(nt(e) ?? "", 10);
1752
+ return Number.isFinite(d) ? De(d, o, r) : t;
1753
+ }), i = W(
1754
+ (d) => {
1755
+ const l = De(d, o, r);
1756
+ a(l), ot(e, String(l));
2393
1757
  },
2394
- [e, r, n]
1758
+ [e, r, o]
2395
1759
  );
2396
- return [s, c];
1760
+ return [s, i];
2397
1761
  }
2398
- function _n() {
1762
+ function vn() {
2399
1763
  const e = "(prefers-color-scheme: dark)", t = () => {
2400
1764
  try {
2401
1765
  return window.matchMedia(e).matches ? "dark" : "light";
2402
1766
  } catch {
2403
1767
  return "light";
2404
1768
  }
2405
- }, [n, r] = D(t);
2406
- return V(() => {
1769
+ }, [o, r] = z(t);
1770
+ return I(() => {
2407
1771
  let s;
2408
1772
  try {
2409
1773
  s = window.matchMedia(e);
@@ -2412,256 +1776,254 @@ function _n() {
2412
1776
  }
2413
1777
  const a = () => r(s?.matches ? "dark" : "light");
2414
1778
  return s.addEventListener?.("change", a), () => s?.removeEventListener?.("change", a);
2415
- }, []), n;
1779
+ }, []), o;
2416
1780
  }
2417
- function Fn() {
2418
- const e = ht(pe.appearance);
1781
+ function kn() {
1782
+ const e = nt(le.appearance);
2419
1783
  return e === "dark" || e === "light" ? e : void 0;
2420
1784
  }
2421
- function Wn({ product: e }) {
2422
- const t = A(() => Dt(e), [e]), n = A(() => Xt(e.theme?.labels), [e.theme?.labels]), [r] = D(() => Tt());
2423
- return /* @__PURE__ */ o(ot.Provider, { value: n, children: r ? /* @__PURE__ */ o(Pn, { product: e, registry: t }) : /* @__PURE__ */ o(On, { product: e, registry: t }) });
2424
- }
2425
- const ye = { initial: 290, min: 200, max: 480 }, xe = { initial: 320, min: 260, max: 560 };
2426
- function On({ product: e, registry: t }) {
2427
- const n = J(), r = A(() => Pt(e.deploy), [e.deploy]), { location: s, controls: a, viewport: c, setControls: l, openScenario: h, openComponent: p, openScreen: u, go: i } = et(t), f = q(s);
2428
- f.current = s;
2429
- const S = q(null), N = _n(), [$, _] = D(() => Fn()), v = a.chromeTheme ?? $ ?? N, [L, b] = je(
2430
- pe.leftWidth,
2431
- ye.initial,
2432
- ye.min,
2433
- ye.max
2434
- ), [m, w] = je(
2435
- pe.rightWidth,
2436
- xe.initial,
2437
- xe.min,
2438
- xe.max
2439
- ), [k, x] = D(!1), T = a.handoff, d = t.component(a.component), g = t.scenario(a.scenario), C = d ? void 0 : t.screensFor({ handoff: T }).find((R) => R.id === t.screenForPath(s.path)?.id), E = C && g && C.variations.some((R) => R.id === g.id) ? g : void 0, F = A(
2440
- () => t.resolveComponentFixture(d?.id, d ? a.fixture : void 0),
2441
- [d, a.fixture, t]
2442
- ), O = A(() => {
2443
- if (!C || C.controls.length === 0) return t.issues;
2444
- const { invalid: R } = t.resolveControls(C, {
2445
- scenario: E,
2446
- requested: Ze(s.search)
1785
+ function Tn({ product: e }) {
1786
+ const t = $(() => mt(e), [e]), o = $(() => ft(e.theme?.labels), [e.theme?.labels]), [r] = z(() => Nt());
1787
+ return /* @__PURE__ */ n(pt.Provider, { value: o, children: r ? /* @__PURE__ */ n(bn, { product: e, registry: t }) : /* @__PURE__ */ n(yn, { product: e, registry: t }) });
1788
+ }
1789
+ const we = { initial: 290, min: 200, max: 480 }, be = { initial: 320, min: 260, max: 560 };
1790
+ function yn({ product: e, registry: t }) {
1791
+ const o = X(), r = $(() => kt(e.deploy), [e.deploy]), { location: s, controls: a, viewport: i, setControls: d, openScenario: l, openComponent: c, openScreen: h, go: u } = je(t), p = j(s);
1792
+ p.current = s;
1793
+ const S = j(null), C = vn(), [k, E] = z(() => kn()), v = a.chromeTheme ?? k ?? C, [_, f] = Ke(
1794
+ le.leftWidth,
1795
+ we.initial,
1796
+ we.min,
1797
+ we.max
1798
+ ), [m, w] = Ke(
1799
+ le.rightWidth,
1800
+ be.initial,
1801
+ be.min,
1802
+ be.max
1803
+ ), [g, N] = z(!1), T = a.handoff, L = t.component(a.component), P = t.scenario(a.scenario), A = L ? void 0 : t.screensFor({ handoff: T }).find((M) => M.id === t.screenForPath(s.path)?.id), O = A && P && A.variations.some((M) => M.id === P.id) ? P : void 0, G = $(
1804
+ () => t.resolveComponentFixture(L?.id, L ? a.fixture : void 0),
1805
+ [L, a.fixture, t]
1806
+ ), F = $(() => {
1807
+ if (!A || A.controls.length === 0) return t.issues;
1808
+ const { invalid: M } = t.resolveControls(A, {
1809
+ scenario: O,
1810
+ requested: Ue(s.search)
2447
1811
  });
2448
- return R.length === 0 ? t.issues : [...R.map((Q) => ({
1812
+ return M.length === 0 ? t.issues : [...M.map((Q) => ({
2449
1813
  level: "warning",
2450
- where: `url:${ke}${Q.id}`,
2451
- message: Q.reason === "invalid-value" ? n.diagnostics.invalidControl(Q.id, Q.value, Q.fallback ?? "") : n.diagnostics.unknownControl(Q.id, Q.value)
1814
+ where: `url:${me}${Q.id}`,
1815
+ message: Q.reason === "invalid-value" ? o.diagnostics.invalidControl(Q.id, Q.value, Q.fallback ?? "") : o.diagnostics.unknownControl(Q.id, Q.value)
2452
1816
  })), ...t.issues];
2453
- }, [n, s.search, t, C, E]), I = t.screensFor({ handoff: T })[0], P = t.componentsFor(T)[0], z = !I && !P, U = A(() => {
2454
- const R = new URLSearchParams(s.search);
2455
- return R.has(M.scenario) || R.has(M.component);
2456
- }, [s.search]), Z = s.path === "/" && !U && !t.screenForPath("/") && !z;
2457
- V(() => {
2458
- Z && (I ? u(I.id, { replace: !0 }) : P && p(P.id, { replace: !0 }));
2459
- }, [P, I, p, u, Z]);
2460
- const B = K(
2461
- () => l({ chrome: !a.chrome }),
2462
- [a.chrome, l]
2463
- ), Y = K(
2464
- (R) => {
2465
- if (R === "C") {
2466
- B();
1817
+ }, [o, s.search, t, A, O]), D = t.screensFor({ handoff: T })[0], x = t.componentsFor(T)[0], R = !D && !x, K = $(() => {
1818
+ const M = new URLSearchParams(s.search);
1819
+ return M.has(y.scenario) || M.has(y.component);
1820
+ }, [s.search]), Z = s.path === "/" && !K && !t.screenForPath("/") && !R;
1821
+ I(() => {
1822
+ Z && (D ? h(D.id, { replace: !0 }) : x && c(x.id, { replace: !0 }));
1823
+ }, [x, D, c, h, Z]);
1824
+ const q = W(
1825
+ () => d({ chrome: !a.chrome }),
1826
+ [a.chrome, d]
1827
+ ), Y = W(
1828
+ (M) => {
1829
+ if (M === "C") {
1830
+ q();
2467
1831
  return;
2468
1832
  }
2469
- window.dispatchEvent(new KeyboardEvent("keydown", { key: R.toLowerCase(), metaKey: !0 }));
1833
+ window.dispatchEvent(new KeyboardEvent("keydown", { key: M.toLowerCase(), metaKey: !0 }));
2470
1834
  },
2471
- [B]
1835
+ [q]
2472
1836
  );
2473
- V(() => {
2474
- const R = (j) => {
2475
- !j.shiftKey || j.metaKey || j.ctrlKey || j.altKey || j.key !== "C" || j.target?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (j.preventDefault(), Y(j.key));
1837
+ I(() => {
1838
+ const M = (B) => {
1839
+ !B.shiftKey || B.metaKey || B.ctrlKey || B.altKey || B.key !== "C" || B.target?.closest?.("input, textarea, select, [contenteditable='true'], [contenteditable='']") || (B.preventDefault(), Y(B.key));
2476
1840
  };
2477
- return window.addEventListener("keydown", R), () => window.removeEventListener("keydown", R);
1841
+ return window.addEventListener("keydown", M), () => window.removeEventListener("keydown", M);
2478
1842
  }, [Y]);
2479
- const ce = K(
2480
- (R, j) => {
2481
- const { path: Q, search: kt } = he(R);
2482
- i(Q, Rt(kt, f.current.search), { replace: j });
1843
+ const se = W(
1844
+ (M, B) => {
1845
+ const { path: Q, search: dt } = ce(M);
1846
+ u(Q, Ct(dt, p.current.search), { replace: B });
2483
1847
  },
2484
- [i]
2485
- ), mt = () => {
2486
- let R;
1848
+ [u]
1849
+ ), rt = () => {
1850
+ let M;
2487
1851
  try {
2488
- R = S.current?.contentWindow?.location.href;
1852
+ M = S.current?.contentWindow?.location.href;
2489
1853
  } catch {
2490
1854
  }
2491
- const j = _t(R, window.location.origin, f.current);
2492
- window.open(j, "_blank", "noopener");
2493
- }, ft = () => {
2494
- const R = v === "dark" ? "light" : "dark";
2495
- pt(pe.appearance, R), _(R), l({ chromeTheme: R });
2496
- }, te = (R) => l(R), wt = `${r.origin}${s.path}${s.search}`, gt = a.panelTab ?? "variations", Oe = a.zoom ?? 100, [vt, bt] = D(Oe);
2497
- return /* @__PURE__ */ y(
1855
+ const B = xt(M, window.location.origin, p.current);
1856
+ window.open(B, "_blank", "noopener");
1857
+ }, st = () => {
1858
+ const M = v === "dark" ? "light" : "dark";
1859
+ ot(le.appearance, M), E(M), d({ chromeTheme: M });
1860
+ }, ee = (M) => d(M), at = `${r.origin}${s.path}${s.search}`, it = a.panelTab ?? "variations", Le = a.zoom ?? 100, [ct, lt] = z(Le);
1861
+ return /* @__PURE__ */ b(
2498
1862
  "div",
2499
1863
  {
2500
1864
  className: "ds-root",
2501
1865
  "data-appearance": v,
2502
1866
  "data-chrome": a.chrome ? "visible" : "hidden",
2503
- "data-resizing": k ? "true" : void 0,
2504
- "data-viewport": c.id,
1867
+ "data-resizing": g ? "true" : void 0,
1868
+ "data-viewport": i.id,
2505
1869
  children: [
2506
- a.chrome && /* @__PURE__ */ o(
2507
- en,
1870
+ a.chrome && /* @__PURE__ */ n(
1871
+ Ut,
2508
1872
  {
2509
1873
  productName: e.name,
2510
1874
  deploy: r,
2511
1875
  viewportId: a.viewport,
2512
- viewport: c,
2513
- zoom: vt,
1876
+ viewport: i,
1877
+ zoom: ct,
2514
1878
  rotated: !!a.rotated,
2515
1879
  highlight: !!a.highlight,
2516
1880
  theme: v,
2517
- issues: O,
2518
- linkUrl: wt,
2519
- onViewport: (R) => te({ viewport: R }),
2520
- onRotate: () => te({ rotated: !a.rotated }),
2521
- onHighlight: () => te({ highlight: !a.highlight }),
2522
- onZoom: (R) => te({ zoom: R }),
2523
- onCleanReview: B,
2524
- onOpenFrame: mt,
2525
- onToggleTheme: ft
1881
+ issues: F,
1882
+ linkUrl: at,
1883
+ onViewport: (M) => ee({ viewport: M }),
1884
+ onRotate: () => ee({ rotated: !a.rotated }),
1885
+ onHighlight: () => ee({ highlight: !a.highlight }),
1886
+ onZoom: (M) => ee({ zoom: M }),
1887
+ onCleanReview: q,
1888
+ onOpenFrame: rt,
1889
+ onToggleTheme: st
2526
1890
  }
2527
1891
  ),
2528
- /* @__PURE__ */ y("div", { className: "ds-body", children: [
2529
- a.chrome && /* @__PURE__ */ o(
2530
- on,
1892
+ /* @__PURE__ */ b("div", { className: "ds-body", children: [
1893
+ a.chrome && /* @__PURE__ */ n(
1894
+ Bt,
2531
1895
  {
2532
1896
  registry: t,
2533
1897
  handoff: T,
2534
- activeScreen: C?.id,
2535
- activeComponent: d?.id,
2536
- onOpenScreen: (R) => u(R),
2537
- onOpenComponent: (R) => p(R),
2538
- width: L,
2539
- onResize: b,
2540
- onResizeStart: () => x(!0),
2541
- onResizeEnd: () => x(!1)
1898
+ activeScreen: A?.id,
1899
+ activeComponent: L?.id,
1900
+ onOpenScreen: (M) => h(M),
1901
+ onOpenComponent: (M) => c(M),
1902
+ width: _,
1903
+ onResize: f,
1904
+ onResizeStart: () => N(!0),
1905
+ onResizeEnd: () => N(!1)
2542
1906
  }
2543
1907
  ),
2544
- /* @__PURE__ */ o("main", { className: "ds-main", children: z ? /* @__PURE__ */ y("div", { className: "ds-chrome-empty", children: [
2545
- /* @__PURE__ */ o("h1", { className: "ds-chrome-empty__title", children: n.shell.empty }),
2546
- /* @__PURE__ */ o("p", { className: "ds-muted", children: n.shell.emptyHint })
2547
- ] }) : Z ? null : /* @__PURE__ */ o(
2548
- wn,
1908
+ /* @__PURE__ */ n("main", { className: "ds-main", children: R ? /* @__PURE__ */ b("div", { className: "ds-chrome-empty", children: [
1909
+ /* @__PURE__ */ n("h1", { className: "ds-chrome-empty__title", children: o.shell.empty }),
1910
+ /* @__PURE__ */ n("p", { className: "ds-muted", children: o.shell.emptyHint })
1911
+ ] }) : Z ? null : /* @__PURE__ */ n(
1912
+ tn,
2549
1913
  {
2550
1914
  location: s,
2551
- viewport: c,
2552
- zoom: Oe,
2553
- onEffectiveZoom: bt,
2554
- title: n.shell.frameTitle(e.name),
2555
- resizing: k,
2556
- onFrameNavigate: ce,
1915
+ viewport: i,
1916
+ zoom: Le,
1917
+ onEffectiveZoom: lt,
1918
+ title: o.shell.frameTitle(e.name),
1919
+ resizing: g,
1920
+ onFrameNavigate: se,
2557
1921
  onShortcut: Y,
2558
1922
  frameRef: S
2559
1923
  }
2560
1924
  ) }),
2561
- a.chrome && /* @__PURE__ */ o(
2562
- dn,
1925
+ a.chrome && /* @__PURE__ */ n(
1926
+ Zt,
2563
1927
  {
2564
1928
  registry: t,
2565
1929
  controls: a,
2566
- deploy: r,
2567
- location: s,
2568
- screen: C,
2569
- variation: E,
2570
- component: d,
2571
- componentFixture: F,
2572
- tab: gt,
2573
- onTab: (R) => te({ panelTab: R }),
2574
- onOpenScenario: h,
2575
- onOpenComponent: (R) => p(R),
2576
- onOpenScreen: (R) => u(R),
2577
- onChange: te,
1930
+ screen: A,
1931
+ variation: O,
1932
+ component: L,
1933
+ componentFixture: G,
1934
+ tab: it,
1935
+ onTab: (M) => ee({ panelTab: M }),
1936
+ onOpenScenario: l,
1937
+ onOpenComponent: (M) => c(M),
1938
+ onOpenScreen: (M) => h(M),
1939
+ onChange: ee,
2578
1940
  width: m,
2579
1941
  onResize: w,
2580
- onResizeStart: () => x(!0),
2581
- onResizeEnd: () => x(!1)
1942
+ onResizeStart: () => N(!0),
1943
+ onResizeEnd: () => N(!1)
2582
1944
  }
2583
1945
  )
2584
1946
  ] }),
2585
- !a.chrome && /* @__PURE__ */ o(
1947
+ !a.chrome && /* @__PURE__ */ n(
2586
1948
  "button",
2587
1949
  {
2588
1950
  type: "button",
2589
1951
  className: "ds-restore",
2590
- "aria-label": n.shell.restoreChrome,
2591
- title: n.shell.restoreChrome,
2592
- onClick: B,
2593
- children: /* @__PURE__ */ o("span", { className: "ds-restore__dot", "aria-hidden": "true" })
1952
+ "aria-label": o.shell.restoreChrome,
1953
+ title: o.shell.restoreChrome,
1954
+ onClick: q,
1955
+ children: /* @__PURE__ */ n("span", { className: "ds-restore__dot", "aria-hidden": "true" })
2594
1956
  }
2595
1957
  )
2596
1958
  ]
2597
1959
  }
2598
1960
  );
2599
1961
  }
2600
- function ve(e) {
1962
+ function ue(e) {
2601
1963
  return new Date(e.length === 10 ? `${e}T00:00:00` : e);
2602
1964
  }
2603
- function Bn(e, t) {
2604
- const n = ve(e), r = ve(t);
2605
- let s = r.getFullYear() - n.getFullYear();
2606
- const a = r.getMonth() - n.getMonth();
2607
- return (a < 0 || a === 0 && r.getDate() < n.getDate()) && (s -= 1), s;
1965
+ function Rn(e, t) {
1966
+ const o = ue(e), r = ue(t);
1967
+ let s = r.getFullYear() - o.getFullYear();
1968
+ const a = r.getMonth() - o.getMonth();
1969
+ return (a < 0 || a === 0 && r.getDate() < o.getDate()) && (s -= 1), s;
2608
1970
  }
2609
- function jn(e, t) {
2610
- const n = ve(e), r = ve(t);
2611
- return Math.floor((r.getTime() - n.getTime()) / 864e5);
1971
+ function Pn(e, t) {
1972
+ const o = ue(e), r = ue(t);
1973
+ return Math.floor((r.getTime() - o.getTime()) / 864e5);
2612
1974
  }
2613
1975
  export {
2614
- fe as COMPONENT_ATTRIBUTE,
2615
- ke as CONTROL_PARAM_PREFIX,
2616
- oe as DEFAULT_LABELS,
2617
- Wn as DesignSpace,
2618
- Vn as EN_US_LABELS,
2619
- Lt as FRAME_ATTRIBUTE,
2620
- $t as FRAME_PARAM,
2621
- Zn as HANDOFF_PARAM,
2622
- Kn as NETWORK_LABELS,
2623
- Ye as NETWORK_STATES,
2624
- M as PARAM,
2625
- at as SLOW_NETWORK_DELAY_MS,
2626
- it as SimulatedNetworkError,
2627
- Ke as StageEmpty,
2628
- Vt as VIEWPORTS,
2629
- we as ZOOM_DEFAULT,
2630
- Fe as ZOOM_MAX,
2631
- _e as ZOOM_MIN,
2632
- Bn as ageInYears,
2633
- Pe as applyHandoffScope,
2634
- $e as applyOverrides,
2635
- nt as clampZoom,
2636
- Yn as commitUrl,
2637
- Qn as componentUrl,
2638
- Hn as createHttpAdapter,
2639
- Dt as createRegistry,
2640
- jn as daysBetween,
2641
- Le as fixtureAdapter,
2642
- Xn as formatIssues,
2643
- Pt as getDeployContext,
2644
- be as handoffAllowsComponent,
2645
- Ge as handoffAllowsPath,
2646
- re as handoffAllowsScenario,
2647
- Jn as hasErrors,
2648
- eo as matchPath,
2649
- to as normalizeHandoffScope,
2650
- X as normalizeSearch,
2651
- Me as parseControls,
2652
- Nt as parseHandoffScope,
2653
- ve as parseIsoDate,
2654
- Ee as resolveFixture,
2655
- Xt as resolveLabels,
2656
- Ne as resolveRoute,
2657
- Bt as resolveViewport,
2658
- me as scenarioUrl,
2659
- ae as serializeControls,
2660
- no as serializeValue,
2661
- et as useDesignSpaceState,
2662
- J as useLabels,
2663
- bn as useScenarioData,
2664
- xt as validateProduct,
2665
- oo as validateScenario
1976
+ de as COMPONENT_ATTRIBUTE,
1977
+ me as CONTROL_PARAM_PREFIX,
1978
+ On as DEFAULT_LABELS,
1979
+ Tn as DesignSpace,
1980
+ $n as EN_US_LABELS,
1981
+ St as FRAME_ATTRIBUTE,
1982
+ yt as FRAME_PARAM,
1983
+ Kn as HANDOFF_PARAM,
1984
+ zn as NETWORK_LABELS,
1985
+ He as NETWORK_STATES,
1986
+ y as PARAM,
1987
+ Ye as SLOW_NETWORK_DELAY_MS,
1988
+ Qe as SimulatedNetworkError,
1989
+ Oe as StageEmpty,
1990
+ Tt as VIEWPORTS,
1991
+ he as ZOOM_DEFAULT,
1992
+ Ee as ZOOM_MAX,
1993
+ Me as ZOOM_MIN,
1994
+ Rn as ageInYears,
1995
+ Ce as applyHandoffScope,
1996
+ In as applyOverrides,
1997
+ Ge as clampZoom,
1998
+ Wn as commitUrl,
1999
+ Un as componentUrl,
2000
+ _n as createHttpAdapter,
2001
+ mt as createRegistry,
2002
+ Pn as daysBetween,
2003
+ ke as fixtureAdapter,
2004
+ Hn as formatIssues,
2005
+ kt as getDeployContext,
2006
+ Se as handoffAllowsComponent,
2007
+ gt as handoffAllowsPath,
2008
+ Ne as handoffAllowsScenario,
2009
+ qn as hasErrors,
2010
+ Bn as matchPath,
2011
+ jn as normalizeHandoffScope,
2012
+ fe as normalizeSearch,
2013
+ ge as parseControls,
2014
+ wt as parseHandoffScope,
2015
+ ue as parseIsoDate,
2016
+ ve as resolveFixture,
2017
+ ft as resolveLabels,
2018
+ vt as resolveRoute,
2019
+ At as resolveViewport,
2020
+ Vn as scenarioUrl,
2021
+ oe as serializeControls,
2022
+ Gn as serializeValue,
2023
+ je as useDesignSpaceState,
2024
+ X as useLabels,
2025
+ rn as useScenarioData,
2026
+ Zn as validateProduct,
2027
+ Yn as validateScenario
2666
2028
  };
2667
2029
  //# sourceMappingURL=index.js.map