@brucesantos/design-space 0.10.0 → 0.12.0

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