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