@pygmalionjs/pygmalion 0.2.32 → 0.2.34
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/README.ko.md +4 -0
- package/README.md +5 -0
- package/dist-lib/{App-BiKMlsWh.js → App-DVnjCYV2.js} +5563 -4917
- package/dist-lib/pygmalion.js +1050 -1040
- package/dist-lib/style.css +1 -1
- package/dist-lib/testing.js +1 -1
- package/node/inspect-plugin.mjs +79 -5
- package/package.json +1 -1
- package/types.d.ts +51 -0
package/dist-lib/pygmalion.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { b as
|
|
3
|
-
import {
|
|
4
|
-
import { createElement as
|
|
1
|
+
import { jsxs as $, jsx as v } from "react/jsx-runtime";
|
|
2
|
+
import { b as ee, m as Le, i as Xe, g as Ye, e as J, c as Ze, a as et, d as tt, f as nt, h as rt, j as ot, k as st, l as it, n as at, o as ge, p as Re, q as Ne, r as ct, t as lt, u as dt, v as ut, w as ft, x as ht, y as Ae, z as ye, A as ae, B as ce, C as $e, S as mt, D as pt, E as Oe, G as gt, H as Me, I as yt, J as wt, K as bt, L as vt, M as St, O as ke } from "./App-DVnjCYV2.js";
|
|
3
|
+
import { P as In, Q as xn, R as Pn, T as En, U as Cn, V as Rn, W as Nn, X as An, Y as $n, Z as On, _ as Mn, $ as kn, a0 as Fn, a1 as Tn, a2 as Dn, a3 as zn, a4 as jn, a5 as _n, a6 as Bn, a7 as Un, a8 as Hn, a9 as qn, aa as Kn, ab as Gn, ac as Jn, ad as Vn, ae as Wn, af as Qn, ag as Ln, ah as Xn, ai as Yn } from "./App-DVnjCYV2.js";
|
|
4
|
+
import { createElement as Fe, useMemo as de, useState as re, useRef as ve, useCallback as Z, useEffect as oe } from "react";
|
|
5
5
|
function Se(e, t = /* @__PURE__ */ new Set()) {
|
|
6
6
|
if (e == null || typeof e == "string" || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e))
|
|
7
7
|
return e;
|
|
8
8
|
if (Array.isArray(e))
|
|
9
|
-
return e.map((
|
|
9
|
+
return e.map((n) => Se(n, t));
|
|
10
10
|
if (typeof e != "object") return null;
|
|
11
11
|
if (t.has(e))
|
|
12
12
|
throw new Error("A storyboard recipe cannot contain circular references.");
|
|
13
13
|
t.add(e);
|
|
14
|
-
const
|
|
15
|
-
for (const
|
|
16
|
-
const
|
|
17
|
-
|
|
14
|
+
const s = {};
|
|
15
|
+
for (const n of Object.keys(e).sort()) {
|
|
16
|
+
const r = e[n];
|
|
17
|
+
r !== void 0 && (s[n] = Se(r, t));
|
|
18
18
|
}
|
|
19
|
-
return t.delete(e),
|
|
19
|
+
return t.delete(e), s;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function It(e) {
|
|
22
22
|
return JSON.stringify(
|
|
23
23
|
Se({
|
|
24
24
|
version: 1,
|
|
@@ -39,34 +39,34 @@ function St(e) {
|
|
|
39
39
|
})
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
return [...new Set([...e].map((t) => t == null ? void 0 : t.trim()).filter(Boolean))].sort((t,
|
|
42
|
+
function B(e) {
|
|
43
|
+
return [...new Set([...e].map((t) => t == null ? void 0 : t.trim()).filter(Boolean))].sort((t, s) => t.localeCompare(s));
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
var
|
|
47
|
-
return ((
|
|
45
|
+
function xt(e, t) {
|
|
46
|
+
var n;
|
|
47
|
+
return ((n = e.id) == null ? void 0 : n.trim()) || `edge:${t + 1}`;
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
const t = [...e.screens].sort((
|
|
49
|
+
function Pt(e) {
|
|
50
|
+
const t = [...e.screens].sort((n, r) => n.id.localeCompare(r.id)), s = t[0].id;
|
|
51
51
|
return {
|
|
52
|
-
id: `story:${
|
|
53
|
-
canonicalScreenId:
|
|
54
|
-
screenIds: t.map((
|
|
55
|
-
names:
|
|
52
|
+
id: `story:${s}`,
|
|
53
|
+
canonicalScreenId: s,
|
|
54
|
+
screenIds: t.map((n) => n.id),
|
|
55
|
+
names: B(t.map((n) => n.name)),
|
|
56
56
|
recipeKey: e.recipeKey,
|
|
57
|
-
routes:
|
|
58
|
-
scenarioIds:
|
|
59
|
-
t.flatMap((
|
|
60
|
-
|
|
61
|
-
...
|
|
57
|
+
routes: B(t.map((n) => n.route)),
|
|
58
|
+
scenarioIds: B(
|
|
59
|
+
t.flatMap((n) => [
|
|
60
|
+
n.scenarioId,
|
|
61
|
+
...n.scenarioIds ?? []
|
|
62
62
|
])
|
|
63
63
|
),
|
|
64
|
-
sourceKeys:
|
|
65
|
-
flows:
|
|
66
|
-
states:
|
|
64
|
+
sourceKeys: B(t.map((n) => n.sourcePath)),
|
|
65
|
+
flows: B(t.map((n) => n.flow)),
|
|
66
|
+
states: B(t.map((n) => n.state))
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function Te(e) {
|
|
70
70
|
return [
|
|
71
71
|
e.code,
|
|
72
72
|
e.edgeId,
|
|
@@ -75,12 +75,12 @@ function Fe(e) {
|
|
|
75
75
|
e.scenarioId
|
|
76
76
|
].join(":");
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
var
|
|
80
|
-
const t = [],
|
|
78
|
+
function Et(e) {
|
|
79
|
+
var x, q;
|
|
80
|
+
const t = [], s = [], n = /* @__PURE__ */ new Map();
|
|
81
81
|
for (const i of e.screens) {
|
|
82
82
|
const d = i.id.trim();
|
|
83
|
-
if (!d ||
|
|
83
|
+
if (!d || n.has(d)) {
|
|
84
84
|
t.push({
|
|
85
85
|
code: "duplicate-screen-id",
|
|
86
86
|
severity: "error",
|
|
@@ -90,58 +90,58 @@ function xt(e) {
|
|
|
90
90
|
continue;
|
|
91
91
|
}
|
|
92
92
|
const l = d === i.id ? i : { ...i, id: d };
|
|
93
|
-
|
|
93
|
+
n.set(d, l), s.push(l);
|
|
94
94
|
}
|
|
95
|
-
const
|
|
96
|
-
for (const i of
|
|
95
|
+
const r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set();
|
|
96
|
+
for (const i of s) {
|
|
97
97
|
let d;
|
|
98
98
|
try {
|
|
99
|
-
if (d = (e.recipeKey ??
|
|
99
|
+
if (d = (e.recipeKey ?? It)(i), !d.trim()) throw new Error("Recipe keys cannot be empty.");
|
|
100
100
|
} catch (f) {
|
|
101
|
-
|
|
101
|
+
o.add(i.id), t.push({
|
|
102
102
|
code: "invalid-recipe",
|
|
103
103
|
severity: "error",
|
|
104
104
|
message: f instanceof Error ? f.message : "Storyboard recipe identity could not be created.",
|
|
105
105
|
screenId: i.id
|
|
106
106
|
}), d = `invalid:${i.id}`;
|
|
107
107
|
}
|
|
108
|
-
const l =
|
|
109
|
-
l ? l.screens.push(i) :
|
|
108
|
+
const l = r.get(d);
|
|
109
|
+
l ? l.screens.push(i) : r.set(d, { recipeKey: d, screens: [i] });
|
|
110
110
|
}
|
|
111
|
-
const a = [...
|
|
111
|
+
const a = [...r.values()].map(Pt).sort((i, d) => i.id.localeCompare(d.id)), c = {};
|
|
112
112
|
for (const i of a)
|
|
113
113
|
for (const d of i.screenIds) c[d] = i.id;
|
|
114
|
-
const u = new Map(a.map((i) => [i.id, i])),
|
|
114
|
+
const u = new Map(a.map((i) => [i.id, i])), g = /* @__PURE__ */ new Map();
|
|
115
115
|
for (const i of e.assets ?? []) {
|
|
116
|
-
const d =
|
|
117
|
-
d ? d.push(i) :
|
|
116
|
+
const d = g.get(i.pageId);
|
|
117
|
+
d ? d.push(i) : g.set(i.pageId, [i]);
|
|
118
118
|
}
|
|
119
119
|
const h = a.map((i) => {
|
|
120
120
|
const d = i.screenIds.flatMap(
|
|
121
|
-
(l) =>
|
|
121
|
+
(l) => g.get(l) ?? []
|
|
122
122
|
);
|
|
123
123
|
return {
|
|
124
124
|
...i,
|
|
125
|
-
scenarioIds:
|
|
125
|
+
scenarioIds: B([
|
|
126
126
|
...i.scenarioIds,
|
|
127
127
|
...d.map((l) => l.scenarioId)
|
|
128
128
|
]),
|
|
129
|
-
sourceKeys:
|
|
129
|
+
sourceKeys: B([
|
|
130
130
|
...i.sourceKeys,
|
|
131
131
|
...d.map((l) => l.sourcePath)
|
|
132
132
|
])
|
|
133
133
|
};
|
|
134
|
-
}),
|
|
134
|
+
}), w = /* @__PURE__ */ new Map();
|
|
135
135
|
for (const i of h)
|
|
136
136
|
for (const d of i.routes) {
|
|
137
|
-
const l =
|
|
138
|
-
l ? l.push(i.id) :
|
|
137
|
+
const l = w.get(d);
|
|
138
|
+
l ? l.push(i.id) : w.set(d, [i.id]);
|
|
139
139
|
}
|
|
140
|
-
const
|
|
140
|
+
const y = (i, d, l) => {
|
|
141
141
|
const f = i.trim(), E = c[f] ?? (u.has(f) ? f : null);
|
|
142
142
|
if (E) return E;
|
|
143
|
-
const
|
|
144
|
-
return
|
|
143
|
+
const C = B(w.get(f) ?? []);
|
|
144
|
+
return C.length === 1 ? C[0] : C.length > 1 ? (t.push({
|
|
145
145
|
code: l === "source" ? "ambiguous-edge-source" : "ambiguous-edge-target",
|
|
146
146
|
severity: "error",
|
|
147
147
|
message: `Storyboard edge "${d}" references an ambiguous ${l} route.`,
|
|
@@ -154,55 +154,55 @@ function xt(e) {
|
|
|
154
154
|
edgeId: d,
|
|
155
155
|
screenId: f || void 0
|
|
156
156
|
}), null);
|
|
157
|
-
},
|
|
157
|
+
}, I = [], b = /* @__PURE__ */ new Map(), A = [
|
|
158
158
|
["explicit", e.explicitEdges ?? []],
|
|
159
159
|
["inferred", e.inferredEdges ?? []]
|
|
160
160
|
];
|
|
161
|
-
let
|
|
161
|
+
let m = 0;
|
|
162
162
|
for (const [i, d] of A)
|
|
163
163
|
for (const l of d) {
|
|
164
|
-
const f =
|
|
165
|
-
|
|
166
|
-
const E =
|
|
167
|
-
if (!E || !
|
|
168
|
-
const
|
|
169
|
-
if (
|
|
170
|
-
if (!
|
|
171
|
-
const
|
|
172
|
-
...
|
|
173
|
-
sourceEdgeIds:
|
|
174
|
-
...
|
|
164
|
+
const f = xt(l, m);
|
|
165
|
+
m += 1;
|
|
166
|
+
const E = y(l.from, f, "source"), C = y(l.to, f, "target");
|
|
167
|
+
if (!E || !C || E === C) continue;
|
|
168
|
+
const P = `${E}\0${C}`, p = b.get(P);
|
|
169
|
+
if (p) {
|
|
170
|
+
if (!p.sourceEdgeIds.includes(f)) {
|
|
171
|
+
const O = {
|
|
172
|
+
...p,
|
|
173
|
+
sourceEdgeIds: B([
|
|
174
|
+
...p.sourceEdgeIds,
|
|
175
175
|
f
|
|
176
176
|
])
|
|
177
177
|
};
|
|
178
|
-
b.set(
|
|
179
|
-
const
|
|
180
|
-
|
|
178
|
+
b.set(P, O);
|
|
179
|
+
const F = I.indexOf(p);
|
|
180
|
+
F >= 0 && (I[F] = O);
|
|
181
181
|
}
|
|
182
182
|
continue;
|
|
183
183
|
}
|
|
184
|
-
const
|
|
184
|
+
const N = {
|
|
185
185
|
id: f,
|
|
186
186
|
from: E,
|
|
187
|
-
to:
|
|
188
|
-
kind: ((
|
|
189
|
-
label: ((
|
|
187
|
+
to: C,
|
|
188
|
+
kind: ((x = l.kind) == null ? void 0 : x.trim()) || void 0,
|
|
189
|
+
label: ((q = l.label) == null ? void 0 : q.trim()) || void 0,
|
|
190
190
|
origin: i,
|
|
191
191
|
sourceEdgeIds: [f]
|
|
192
192
|
};
|
|
193
|
-
b.set(
|
|
193
|
+
b.set(P, N), I.push(N);
|
|
194
194
|
}
|
|
195
|
-
|
|
195
|
+
I.sort(
|
|
196
196
|
(i, d) => `${i.from}:${i.to}:${i.id}`.localeCompare(`${d.from}:${d.to}:${d.id}`)
|
|
197
197
|
);
|
|
198
|
-
const k = /* @__PURE__ */ new Map(),
|
|
199
|
-
for (const i of
|
|
200
|
-
const d =
|
|
201
|
-
d ? d.push(i) :
|
|
198
|
+
const k = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map();
|
|
199
|
+
for (const i of I) {
|
|
200
|
+
const d = M.get(i.from);
|
|
201
|
+
d ? d.push(i) : M.set(i.from, [i]);
|
|
202
202
|
const l = k.get(i.to);
|
|
203
203
|
l ? l.push(i) : k.set(i.to, [i]);
|
|
204
204
|
}
|
|
205
|
-
const
|
|
205
|
+
const D = [];
|
|
206
206
|
for (const i of e.startScreenIds ?? []) {
|
|
207
207
|
const d = i.trim(), l = c[d] ?? (u.has(d) ? d : null);
|
|
208
208
|
if (!l) {
|
|
@@ -214,28 +214,28 @@ function xt(e) {
|
|
|
214
214
|
});
|
|
215
215
|
continue;
|
|
216
216
|
}
|
|
217
|
-
|
|
217
|
+
D.push(l);
|
|
218
218
|
}
|
|
219
|
-
const
|
|
220
|
-
let
|
|
221
|
-
|
|
219
|
+
const z = new Set(D);
|
|
220
|
+
let j = B(D);
|
|
221
|
+
j.length || (j = h.filter((i) => {
|
|
222
222
|
var d;
|
|
223
223
|
return (((d = k.get(i.id)) == null ? void 0 : d.length) ?? 0) === 0;
|
|
224
|
-
}).map((i) => i.id).sort((i, d) => i.localeCompare(d))), !
|
|
225
|
-
const
|
|
226
|
-
for (;
|
|
227
|
-
const i =
|
|
228
|
-
if (!
|
|
229
|
-
|
|
230
|
-
for (const d of
|
|
224
|
+
}).map((i) => i.id).sort((i, d) => i.localeCompare(d))), !j.length && h.length && (j = [h[0].id]);
|
|
225
|
+
const S = /* @__PURE__ */ new Set(), R = [...j];
|
|
226
|
+
for (; R.length; ) {
|
|
227
|
+
const i = R.shift();
|
|
228
|
+
if (!S.has(i)) {
|
|
229
|
+
S.add(i);
|
|
230
|
+
for (const d of M.get(i) ?? []) R.push(d.to);
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
|
-
const
|
|
233
|
+
const T = h.filter((i) => {
|
|
234
234
|
var l, f;
|
|
235
|
-
const d = (((l = k.get(i.id)) == null ? void 0 : l.length) ?? 0) === 0 && (((f =
|
|
236
|
-
return !
|
|
235
|
+
const d = (((l = k.get(i.id)) == null ? void 0 : l.length) ?? 0) === 0 && (((f = M.get(i.id)) == null ? void 0 : f.length) ?? 0) === 0 && !z.has(i.id);
|
|
236
|
+
return !S.has(i.id) || d && h.length > 1;
|
|
237
237
|
});
|
|
238
|
-
for (const i of
|
|
238
|
+
for (const i of T)
|
|
239
239
|
for (const d of i.screenIds)
|
|
240
240
|
t.push({
|
|
241
241
|
code: "disconnected-screen",
|
|
@@ -244,41 +244,41 @@ function xt(e) {
|
|
|
244
244
|
screenId: d,
|
|
245
245
|
nodeId: i.id
|
|
246
246
|
});
|
|
247
|
-
const
|
|
247
|
+
const H = /* @__PURE__ */ new Map();
|
|
248
248
|
for (const i of h)
|
|
249
249
|
for (const d of i.sourceKeys) {
|
|
250
|
-
const l =
|
|
250
|
+
const l = H.get(d) ?? {
|
|
251
251
|
nodeIds: /* @__PURE__ */ new Set(),
|
|
252
252
|
screenIds: /* @__PURE__ */ new Set()
|
|
253
253
|
};
|
|
254
254
|
l.nodeIds.add(i.id);
|
|
255
255
|
for (const f of i.screenIds) l.screenIds.add(f);
|
|
256
|
-
|
|
256
|
+
H.set(d, l);
|
|
257
257
|
}
|
|
258
|
-
const
|
|
258
|
+
const te = [...H.entries()].map(([i, d]) => ({
|
|
259
259
|
sourceKey: i,
|
|
260
260
|
nodeIds: [...d.nodeIds].sort((l, f) => l.localeCompare(f)),
|
|
261
261
|
screenIds: [...d.screenIds].sort((l, f) => l.localeCompare(f)),
|
|
262
262
|
shared: d.nodeIds.size > 1
|
|
263
|
-
})).sort((i, d) => i.sourceKey.localeCompare(d.sourceKey)),
|
|
264
|
-
const d = [...
|
|
263
|
+
})).sort((i, d) => i.sourceKey.localeCompare(d.sourceKey)), ne = h.map((i) => {
|
|
264
|
+
const d = [...M.get(i.id) ?? []].sort(
|
|
265
265
|
(l, f) => l.id.localeCompare(f.id)
|
|
266
266
|
);
|
|
267
267
|
return {
|
|
268
268
|
nodeId: i.id,
|
|
269
269
|
edgeIds: d.map((l) => l.id),
|
|
270
|
-
targetNodeIds:
|
|
270
|
+
targetNodeIds: B(d.map((l) => l.to))
|
|
271
271
|
};
|
|
272
|
-
}).filter((i) => i.targetNodeIds.length > 1).sort((i, d) => i.nodeId.localeCompare(d.nodeId)),
|
|
272
|
+
}).filter((i) => i.targetNodeIds.length > 1).sort((i, d) => i.nodeId.localeCompare(d.nodeId)), Y = new Set(
|
|
273
273
|
h.flatMap((i) => i.scenarioIds)
|
|
274
|
-
),
|
|
274
|
+
), Q = new Set(
|
|
275
275
|
(e.nonVisualScenarioIds ?? []).map((i) => i.trim())
|
|
276
|
-
),
|
|
276
|
+
), L = B(
|
|
277
277
|
(e.scenarios ?? []).map((i) => i.id)
|
|
278
|
-
),
|
|
279
|
-
(i) => !
|
|
278
|
+
), V = L.filter(
|
|
279
|
+
(i) => !Y.has(i) && !Q.has(i)
|
|
280
280
|
);
|
|
281
|
-
for (const i of
|
|
281
|
+
for (const i of V)
|
|
282
282
|
t.push({
|
|
283
283
|
code: "missing-code-scenario",
|
|
284
284
|
severity: "warning",
|
|
@@ -286,143 +286,143 @@ function xt(e) {
|
|
|
286
286
|
scenarioId: i
|
|
287
287
|
});
|
|
288
288
|
t.sort(
|
|
289
|
-
(i, d) =>
|
|
289
|
+
(i, d) => Te(i).localeCompare(Te(d))
|
|
290
290
|
);
|
|
291
|
-
const
|
|
292
|
-
|
|
293
|
-
),
|
|
294
|
-
screens:
|
|
291
|
+
const _ = B(
|
|
292
|
+
T.flatMap((i) => i.screenIds)
|
|
293
|
+
), X = {
|
|
294
|
+
screens: s.length,
|
|
295
295
|
canonicalNodes: h.length,
|
|
296
|
-
mergedScreens: Math.max(0,
|
|
297
|
-
edges:
|
|
298
|
-
connectedNodes: h.length -
|
|
299
|
-
disconnectedScreens:
|
|
300
|
-
codeScenarios:
|
|
301
|
-
representedScenarios:
|
|
302
|
-
(i) =>
|
|
296
|
+
mergedScreens: Math.max(0, s.length - h.length),
|
|
297
|
+
edges: I.length,
|
|
298
|
+
connectedNodes: h.length - T.length,
|
|
299
|
+
disconnectedScreens: _,
|
|
300
|
+
codeScenarios: L.length,
|
|
301
|
+
representedScenarios: L.filter(
|
|
302
|
+
(i) => Y.has(i)
|
|
303
303
|
).length,
|
|
304
|
-
missingScenarios:
|
|
305
|
-
complete:
|
|
304
|
+
missingScenarios: V,
|
|
305
|
+
complete: _.length === 0 && V.length === 0 && !t.some((i) => i.severity === "error") && o.size === 0
|
|
306
306
|
};
|
|
307
307
|
return {
|
|
308
308
|
version: 1,
|
|
309
309
|
nodes: h,
|
|
310
|
-
edges:
|
|
310
|
+
edges: I,
|
|
311
311
|
aliases: Object.fromEntries(
|
|
312
312
|
Object.entries(c).sort(([i], [d]) => i.localeCompare(d))
|
|
313
313
|
),
|
|
314
|
-
sourceGroups:
|
|
315
|
-
startNodeIds:
|
|
316
|
-
branches:
|
|
314
|
+
sourceGroups: te,
|
|
315
|
+
startNodeIds: j,
|
|
316
|
+
branches: ne,
|
|
317
317
|
warnings: t,
|
|
318
|
-
coverage:
|
|
318
|
+
coverage: X
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
|
-
function
|
|
321
|
+
function Ct(e) {
|
|
322
322
|
return e ? JSON.parse(JSON.stringify(e)) : void 0;
|
|
323
323
|
}
|
|
324
|
-
function
|
|
325
|
-
if (Array.isArray(e)) return e.map(
|
|
324
|
+
function ue(e) {
|
|
325
|
+
if (Array.isArray(e)) return e.map(ue);
|
|
326
326
|
if (e && typeof e == "object") {
|
|
327
|
-
const t = Object.entries(e).filter(([,
|
|
327
|
+
const t = Object.entries(e).filter(([, s]) => s !== void 0).sort(([s], [n]) => s.localeCompare(n)).map(([s, n]) => [s, ue(n)]).filter(([, s]) => s !== void 0);
|
|
328
328
|
return t.length ? Object.fromEntries(t) : void 0;
|
|
329
329
|
}
|
|
330
330
|
return e;
|
|
331
331
|
}
|
|
332
|
-
function
|
|
333
|
-
return JSON.stringify(
|
|
332
|
+
function De(e) {
|
|
333
|
+
return JSON.stringify(ue(e ?? null));
|
|
334
334
|
}
|
|
335
|
-
function
|
|
335
|
+
function Rt(e) {
|
|
336
336
|
return !!(e && typeof e == "object" && !Array.isArray(e));
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function G(e) {
|
|
339
339
|
const t = e == null ? void 0 : e.trim();
|
|
340
340
|
if (!t) return null;
|
|
341
|
-
let
|
|
341
|
+
let s = t;
|
|
342
342
|
try {
|
|
343
|
-
/^[a-z][a-z\d+.-]*:\/\//i.test(t) && (
|
|
343
|
+
/^[a-z][a-z\d+.-]*:\/\//i.test(t) && (s = new URL(t).pathname);
|
|
344
344
|
} catch {
|
|
345
345
|
return null;
|
|
346
346
|
}
|
|
347
|
-
return
|
|
347
|
+
return s = s.split(/[?#]/, 1)[0].replace(/\/{2,}/g, "/"), s.startsWith("/") || (s = `/${s}`), s.length > 1 && (s = s.replace(/\/+$/, "")), s || "/";
|
|
348
348
|
}
|
|
349
|
-
function
|
|
349
|
+
function qe(e) {
|
|
350
350
|
return `source-route:${encodeURIComponent(e)}`;
|
|
351
351
|
}
|
|
352
|
-
function
|
|
353
|
-
const
|
|
354
|
-
let
|
|
355
|
-
for (let
|
|
356
|
-
const a = o
|
|
352
|
+
function Pe(e, t) {
|
|
353
|
+
const s = e.split("/").filter(Boolean), n = t.split("/").filter(Boolean);
|
|
354
|
+
let r = 0;
|
|
355
|
+
for (let o = 0; o < s.length; o += 1) {
|
|
356
|
+
const a = s[o];
|
|
357
357
|
if (a === "*" || a.startsWith("*")) return !0;
|
|
358
|
-
const c = r
|
|
358
|
+
const c = n[r];
|
|
359
359
|
if (!(a.endsWith("?") && c == null)) {
|
|
360
360
|
if (c == null || !a.startsWith(":") && a !== c) return !1;
|
|
361
|
-
|
|
361
|
+
r += 1;
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
|
-
return
|
|
364
|
+
return r === n.length;
|
|
365
365
|
}
|
|
366
|
-
function
|
|
367
|
-
const
|
|
368
|
-
if (!
|
|
369
|
-
const
|
|
370
|
-
return
|
|
366
|
+
function ze(e, t) {
|
|
367
|
+
const s = G(e);
|
|
368
|
+
if (!s) return [];
|
|
369
|
+
const n = t.get(s);
|
|
370
|
+
return n && !/[:*]/.test(s) ? [n] : [
|
|
371
371
|
...new Set(
|
|
372
|
-
[...t.entries()].filter(([
|
|
372
|
+
[...t.entries()].filter(([r]) => Pe(s, r)).map(([, r]) => r)
|
|
373
373
|
)
|
|
374
|
-
].sort((
|
|
374
|
+
].sort((r, o) => r.localeCompare(o));
|
|
375
375
|
}
|
|
376
|
-
function
|
|
377
|
-
var
|
|
376
|
+
function Nt(e) {
|
|
377
|
+
var s;
|
|
378
378
|
const t = /* @__PURE__ */ new Map();
|
|
379
|
-
for (const
|
|
380
|
-
const
|
|
381
|
-
!
|
|
382
|
-
id:
|
|
383
|
-
name:
|
|
379
|
+
for (const n of e ?? []) {
|
|
380
|
+
const r = G(n.path);
|
|
381
|
+
!r || t.has(r) || t.set(r, {
|
|
382
|
+
id: qe(r),
|
|
383
|
+
name: r,
|
|
384
384
|
section: "Source routes",
|
|
385
|
-
codeName: ((
|
|
385
|
+
codeName: ((s = n.id) == null ? void 0 : s.trim()) || void 0
|
|
386
386
|
});
|
|
387
387
|
}
|
|
388
|
-
return [...t.values()].sort((
|
|
389
|
-
}
|
|
390
|
-
function
|
|
391
|
-
return (e ?? []).flatMap((
|
|
392
|
-
var h,
|
|
393
|
-
const
|
|
394
|
-
if (!
|
|
395
|
-
const c =
|
|
388
|
+
return [...t.values()].sort((n, r) => n.id.localeCompare(r.id));
|
|
389
|
+
}
|
|
390
|
+
function At(e, t, s) {
|
|
391
|
+
return (e ?? []).flatMap((n, r) => {
|
|
392
|
+
var h, w, y;
|
|
393
|
+
const o = (h = n.from) == null ? void 0 : h.trim(), a = (w = n.to) == null ? void 0 : w.trim();
|
|
394
|
+
if (!o || !a || n.unresolvedTarget) return [];
|
|
395
|
+
const c = s.has(o) ? [o] : ze(o, t), u = s.has(a) ? [a] : ze(a, t);
|
|
396
396
|
if (!c.length || !u.length) return [];
|
|
397
|
-
const
|
|
397
|
+
const g = ((y = n.id) == null ? void 0 : y.trim()) || `discovery-edge:${r + 1}`;
|
|
398
398
|
return c.flatMap(
|
|
399
|
-
(
|
|
400
|
-
var k,
|
|
399
|
+
(I, b) => u.map((A, m) => {
|
|
400
|
+
var k, M;
|
|
401
401
|
return {
|
|
402
|
-
id: c.length === 1 && u.length === 1 ?
|
|
403
|
-
from:
|
|
402
|
+
id: c.length === 1 && u.length === 1 ? g : `${g}:${b + 1}:${m + 1}`,
|
|
403
|
+
from: I,
|
|
404
404
|
to: A,
|
|
405
|
-
kind: ((k =
|
|
406
|
-
label: ((
|
|
405
|
+
kind: ((k = n.kind) == null ? void 0 : k.trim()) || void 0,
|
|
406
|
+
label: ((M = n.label) == null ? void 0 : M.trim()) || void 0
|
|
407
407
|
};
|
|
408
408
|
})
|
|
409
409
|
);
|
|
410
410
|
});
|
|
411
411
|
}
|
|
412
|
-
function
|
|
413
|
-
const
|
|
414
|
-
if (!
|
|
415
|
-
const
|
|
412
|
+
function $t(e, t, s) {
|
|
413
|
+
const n = G(e.route);
|
|
414
|
+
if (!n) return [];
|
|
415
|
+
const r = t.filter(
|
|
416
416
|
(c) => {
|
|
417
|
-
const u =
|
|
418
|
-
return u ?
|
|
417
|
+
const u = G(c.route);
|
|
418
|
+
return u ? Pe(u, n) : !1;
|
|
419
419
|
}
|
|
420
420
|
);
|
|
421
|
-
if (!
|
|
422
|
-
const
|
|
423
|
-
|
|
424
|
-
), a =
|
|
425
|
-
(c) =>
|
|
421
|
+
if (!r.length) return [];
|
|
422
|
+
const o = De(
|
|
423
|
+
Le(s, e.environment)
|
|
424
|
+
), a = r.filter(
|
|
425
|
+
(c) => De(c.environment) === o
|
|
426
426
|
);
|
|
427
427
|
return [
|
|
428
428
|
...new Set(
|
|
@@ -433,63 +433,63 @@ function Nt(e, t, o) {
|
|
|
433
433
|
)
|
|
434
434
|
].sort((c, u) => c.localeCompare(u));
|
|
435
435
|
}
|
|
436
|
-
function
|
|
437
|
-
const
|
|
436
|
+
function Ot(e, t) {
|
|
437
|
+
const s = e.some((o) => o.importKind != null), n = t.candidates ?? [], r = Ge(t);
|
|
438
438
|
return e.filter(
|
|
439
|
-
(
|
|
440
|
-
).map((
|
|
441
|
-
id:
|
|
442
|
-
name:
|
|
443
|
-
section:
|
|
444
|
-
componentName:
|
|
445
|
-
gallery:
|
|
446
|
-
route:
|
|
447
|
-
path:
|
|
448
|
-
publish:
|
|
449
|
-
width:
|
|
450
|
-
height:
|
|
451
|
-
frameSizeMode:
|
|
452
|
-
heightMode:
|
|
453
|
-
maxHeight:
|
|
454
|
-
flow:
|
|
455
|
-
scenario:
|
|
456
|
-
state:
|
|
457
|
-
scenarioId:
|
|
458
|
-
scenarioIds:
|
|
459
|
-
interactions:
|
|
460
|
-
environment:
|
|
461
|
-
preset:
|
|
462
|
-
assertions:
|
|
463
|
-
sourcePath: [...
|
|
439
|
+
(o) => s ? o.importKind === "screens" : !!o.route
|
|
440
|
+
).map((o) => ({
|
|
441
|
+
id: o.id,
|
|
442
|
+
name: o.name,
|
|
443
|
+
section: o.section ?? o.canvas ?? "Screens",
|
|
444
|
+
componentName: o.componentName,
|
|
445
|
+
gallery: o.gallery,
|
|
446
|
+
route: o.route,
|
|
447
|
+
path: o.path,
|
|
448
|
+
publish: o.publish,
|
|
449
|
+
width: o.width,
|
|
450
|
+
height: o.height,
|
|
451
|
+
frameSizeMode: o.frameSizeMode,
|
|
452
|
+
heightMode: o.heightMode,
|
|
453
|
+
maxHeight: o.maxHeight,
|
|
454
|
+
flow: o.flow,
|
|
455
|
+
scenario: o.scenario,
|
|
456
|
+
state: o.state,
|
|
457
|
+
scenarioId: o.scenarioId,
|
|
458
|
+
scenarioIds: $t(o, n, r),
|
|
459
|
+
interactions: o.interactions,
|
|
460
|
+
environment: o.environment,
|
|
461
|
+
preset: o.preset,
|
|
462
|
+
assertions: o.assertions,
|
|
463
|
+
sourcePath: [...o.sourcePaths ?? []].filter(Boolean).sort((a, c) => a.localeCompare(c))[0]
|
|
464
464
|
}));
|
|
465
465
|
}
|
|
466
466
|
function pe(e, t) {
|
|
467
|
-
var c, u,
|
|
468
|
-
const
|
|
469
|
-
if (
|
|
470
|
-
const
|
|
471
|
-
if (
|
|
472
|
-
const
|
|
473
|
-
return
|
|
474
|
-
}
|
|
475
|
-
function
|
|
467
|
+
var c, u, g, h;
|
|
468
|
+
const s = (((c = e.interactions) == null ? void 0 : c.length) ?? 0) - (((u = t.interactions) == null ? void 0 : u.length) ?? 0);
|
|
469
|
+
if (s !== 0) return s;
|
|
470
|
+
const n = (g = e.scenarioIds) != null && g.includes("environment:baseline") ? 0 : 1, r = (h = t.scenarioIds) != null && h.includes("environment:baseline") ? 0 : 1;
|
|
471
|
+
if (n !== r) return n - r;
|
|
472
|
+
const o = !e.environment && !e.preset ? 0 : 1, a = !t.environment && !t.preset ? 0 : 1;
|
|
473
|
+
return o !== a ? o - a : e.id.localeCompare(t.id);
|
|
474
|
+
}
|
|
475
|
+
function Mt(e) {
|
|
476
476
|
const t = /* @__PURE__ */ new Map();
|
|
477
|
-
for (const
|
|
478
|
-
const
|
|
479
|
-
if (!
|
|
480
|
-
const
|
|
481
|
-
|
|
477
|
+
for (const s of e) {
|
|
478
|
+
const n = G(s.route);
|
|
479
|
+
if (!n) continue;
|
|
480
|
+
const r = t.get(n);
|
|
481
|
+
r ? r.push(s) : t.set(n, [s]);
|
|
482
482
|
}
|
|
483
483
|
return new Map(
|
|
484
|
-
[...t.entries()].map(([
|
|
485
|
-
const
|
|
486
|
-
return [
|
|
484
|
+
[...t.entries()].map(([s, n]) => {
|
|
485
|
+
const r = [...n].sort(pe);
|
|
486
|
+
return [s, r[0].id];
|
|
487
487
|
})
|
|
488
488
|
);
|
|
489
489
|
}
|
|
490
|
-
function
|
|
490
|
+
function kt(e) {
|
|
491
491
|
return e.action === "wait" ? null : JSON.stringify(
|
|
492
|
-
|
|
492
|
+
ue({
|
|
493
493
|
action: e.action,
|
|
494
494
|
selector: e.selector,
|
|
495
495
|
text: e.text,
|
|
@@ -503,24 +503,24 @@ function Ot(e) {
|
|
|
503
503
|
})
|
|
504
504
|
);
|
|
505
505
|
}
|
|
506
|
-
function
|
|
507
|
-
return (e.interactions ?? []).map(
|
|
506
|
+
function Ke(e) {
|
|
507
|
+
return (e.interactions ?? []).map(kt).filter((t) => t != null);
|
|
508
508
|
}
|
|
509
|
-
function
|
|
510
|
-
return e.length < t.length && e.every((
|
|
509
|
+
function Ft(e, t) {
|
|
510
|
+
return e.length < t.length && e.every((s, n) => s === t[n]);
|
|
511
511
|
}
|
|
512
|
-
function
|
|
513
|
-
const
|
|
514
|
-
for (const
|
|
515
|
-
const
|
|
516
|
-
if (!
|
|
517
|
-
const
|
|
518
|
-
a ? a.push(
|
|
512
|
+
function Tt(e, t) {
|
|
513
|
+
const s = /* @__PURE__ */ new Map();
|
|
514
|
+
for (const n of e) {
|
|
515
|
+
const r = G(n.route);
|
|
516
|
+
if (!r) continue;
|
|
517
|
+
const o = `${r}\0${Ke(n).join("")}`, a = s.get(o);
|
|
518
|
+
a ? a.push(n) : s.set(o, [n]);
|
|
519
519
|
}
|
|
520
|
-
return [...
|
|
521
|
-
if (
|
|
522
|
-
const
|
|
523
|
-
return
|
|
520
|
+
return [...s.values()].flatMap((n) => {
|
|
521
|
+
if (n.length < 2) return [];
|
|
522
|
+
const r = G(n[0].route), o = t.get(r), a = n.find((c) => c.id === o) ?? [...n].sort(pe)[0];
|
|
523
|
+
return n.filter((c) => c.id !== a.id).sort((c, u) => c.id.localeCompare(u.id)).map((c) => ({
|
|
524
524
|
id: `discovery-variant:${encodeURIComponent(a.id)}:${encodeURIComponent(c.id)}`,
|
|
525
525
|
from: a.id,
|
|
526
526
|
to: c.id,
|
|
@@ -528,46 +528,46 @@ function kt(e, t) {
|
|
|
528
528
|
}));
|
|
529
529
|
});
|
|
530
530
|
}
|
|
531
|
-
function
|
|
532
|
-
const
|
|
533
|
-
for (const
|
|
534
|
-
const
|
|
535
|
-
if (!
|
|
536
|
-
const
|
|
537
|
-
|
|
531
|
+
function Dt(e, t) {
|
|
532
|
+
const s = /* @__PURE__ */ new Map();
|
|
533
|
+
for (const n of e) {
|
|
534
|
+
const r = G(n.route);
|
|
535
|
+
if (!r) continue;
|
|
536
|
+
const o = s.get(r);
|
|
537
|
+
o ? o.push(n) : s.set(r, [n]);
|
|
538
538
|
}
|
|
539
|
-
return [...
|
|
540
|
-
const
|
|
541
|
-
|
|
542
|
-
), a = t.get(
|
|
539
|
+
return [...s.entries()].flatMap(([n, r]) => {
|
|
540
|
+
const o = new Map(
|
|
541
|
+
r.map((u) => [u.id, Ke(u)])
|
|
542
|
+
), a = t.get(n), c = r.find(
|
|
543
543
|
(u) => u.id === a
|
|
544
544
|
);
|
|
545
|
-
return
|
|
546
|
-
const
|
|
547
|
-
if (!
|
|
548
|
-
const
|
|
549
|
-
(
|
|
550
|
-
|
|
551
|
-
|
|
545
|
+
return r.flatMap((u) => {
|
|
546
|
+
const g = o.get(u.id);
|
|
547
|
+
if (!g.length) return [];
|
|
548
|
+
const w = r.filter(
|
|
549
|
+
(y) => Ft(
|
|
550
|
+
o.get(y.id),
|
|
551
|
+
g
|
|
552
552
|
)
|
|
553
|
-
).sort((
|
|
554
|
-
const b =
|
|
553
|
+
).sort((y, I) => {
|
|
554
|
+
const b = o.get(I.id).length - o.get(y.id).length;
|
|
555
555
|
if (b !== 0) return b;
|
|
556
|
-
const A =
|
|
557
|
-
if (A !==
|
|
558
|
-
const k =
|
|
559
|
-
if (k !==
|
|
560
|
-
const
|
|
561
|
-
return
|
|
556
|
+
const A = y.flow && y.flow === u.flow ? 0 : 1, m = I.flow && I.flow === u.flow ? 0 : 1;
|
|
557
|
+
if (A !== m) return A - m;
|
|
558
|
+
const k = y.section && y.section === u.section ? 0 : 1, M = I.section && I.section === u.section ? 0 : 1;
|
|
559
|
+
if (k !== M) return k - M;
|
|
560
|
+
const D = y.id === a ? 0 : 1, z = I.id === a ? 0 : 1;
|
|
561
|
+
return D !== z ? D - z : pe(y, I);
|
|
562
562
|
})[0];
|
|
563
|
-
return
|
|
563
|
+
return w ? [
|
|
564
564
|
{
|
|
565
|
-
id: `discovery-recipe:${encodeURIComponent(
|
|
566
|
-
from:
|
|
565
|
+
id: `discovery-recipe:${encodeURIComponent(w.id)}:${encodeURIComponent(u.id)}`,
|
|
566
|
+
from: w.id,
|
|
567
567
|
to: u.id,
|
|
568
568
|
kind: "recipe-step"
|
|
569
569
|
}
|
|
570
|
-
] : c && c.id !== u.id &&
|
|
570
|
+
] : c && c.id !== u.id && o.get(c.id).join("") !== g.join("") ? [
|
|
571
571
|
{
|
|
572
572
|
id: `discovery-route-case:${encodeURIComponent(c.id)}:${encodeURIComponent(u.id)}`,
|
|
573
573
|
from: c.id,
|
|
@@ -578,31 +578,31 @@ function Ft(e, t) {
|
|
|
578
578
|
});
|
|
579
579
|
});
|
|
580
580
|
}
|
|
581
|
-
function
|
|
582
|
-
var
|
|
581
|
+
function zt(e) {
|
|
582
|
+
var s;
|
|
583
583
|
const t = /* @__PURE__ */ new Map();
|
|
584
|
-
for (const
|
|
585
|
-
const
|
|
586
|
-
if (!
|
|
587
|
-
const
|
|
588
|
-
|
|
584
|
+
for (const n of e) {
|
|
585
|
+
const r = (s = n.flow) == null ? void 0 : s.trim();
|
|
586
|
+
if (!r) continue;
|
|
587
|
+
const o = t.get(r);
|
|
588
|
+
o ? o.push(n) : t.set(r, [n]);
|
|
589
589
|
}
|
|
590
|
-
return [...t.values()].flatMap((
|
|
591
|
-
const
|
|
592
|
-
for (const a of
|
|
593
|
-
const c =
|
|
590
|
+
return [...t.values()].flatMap((n) => {
|
|
591
|
+
const r = n[0], o = /* @__PURE__ */ new Map();
|
|
592
|
+
for (const a of n) {
|
|
593
|
+
const c = G(a.route);
|
|
594
594
|
if (!c) continue;
|
|
595
|
-
const u =
|
|
596
|
-
u ? u.push(a) :
|
|
595
|
+
const u = o.get(c);
|
|
596
|
+
u ? u.push(a) : o.set(c, [a]);
|
|
597
597
|
}
|
|
598
|
-
return
|
|
598
|
+
return o.size < 2 ? [] : [...o.values()].flatMap((a) => {
|
|
599
599
|
const c = [...a].sort(
|
|
600
600
|
pe
|
|
601
601
|
)[0];
|
|
602
|
-
return c.id ===
|
|
602
|
+
return c.id === r.id ? [] : [
|
|
603
603
|
{
|
|
604
|
-
id: `discovery-flow-route:${encodeURIComponent(
|
|
605
|
-
from:
|
|
604
|
+
id: `discovery-flow-route:${encodeURIComponent(r.id)}:${encodeURIComponent(c.id)}`,
|
|
605
|
+
from: r.id,
|
|
606
606
|
to: c.id,
|
|
607
607
|
kind: "flow-route"
|
|
608
608
|
}
|
|
@@ -610,159 +610,159 @@ function Tt(e) {
|
|
|
610
610
|
});
|
|
611
611
|
});
|
|
612
612
|
}
|
|
613
|
-
function
|
|
614
|
-
const
|
|
615
|
-
(t.routes ?? []).map((
|
|
613
|
+
function jt(e, t, s) {
|
|
614
|
+
const n = new Set(
|
|
615
|
+
(t.routes ?? []).map((r) => G(r.path)).filter((r) => !!r)
|
|
616
616
|
);
|
|
617
|
-
return e.map((
|
|
618
|
-
const
|
|
619
|
-
if (!
|
|
620
|
-
return
|
|
621
|
-
const a = [...
|
|
622
|
-
(c) =>
|
|
617
|
+
return e.map((r) => {
|
|
618
|
+
const o = G(r.route);
|
|
619
|
+
if (!o || s.get(o) !== r.id)
|
|
620
|
+
return r;
|
|
621
|
+
const a = [...n].filter(
|
|
622
|
+
(c) => Pe(c, o)
|
|
623
623
|
);
|
|
624
624
|
return a.length ? {
|
|
625
|
-
...
|
|
625
|
+
...r,
|
|
626
626
|
scenarioIds: [
|
|
627
627
|
.../* @__PURE__ */ new Set([
|
|
628
|
-
...
|
|
629
|
-
...a.map(
|
|
628
|
+
...r.scenarioIds ?? [],
|
|
629
|
+
...a.map(qe)
|
|
630
630
|
])
|
|
631
631
|
].sort((c, u) => c.localeCompare(u))
|
|
632
|
-
} :
|
|
632
|
+
} : r;
|
|
633
633
|
});
|
|
634
634
|
}
|
|
635
|
-
function
|
|
636
|
-
var
|
|
637
|
-
const
|
|
635
|
+
function _t(e, t) {
|
|
636
|
+
var g, h, w, y, I;
|
|
637
|
+
const s = new Set(e.map((b) => b.id)), n = new Map(
|
|
638
638
|
e.map((b, A) => [b.id, A])
|
|
639
|
-
),
|
|
640
|
-
for (const b of
|
|
641
|
-
|
|
639
|
+
), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
|
|
640
|
+
for (const b of s)
|
|
641
|
+
r.set(b, /* @__PURE__ */ new Set()), o.set(b, /* @__PURE__ */ new Set()), a.set(b, /* @__PURE__ */ new Set());
|
|
642
642
|
for (const b of t)
|
|
643
|
-
!
|
|
643
|
+
!s.has(b.from) || !s.has(b.to) || ((g = r.get(b.to)) == null || g.add(b.from), (h = o.get(b.from)) == null || h.add(b.to), (w = a.get(b.from)) == null || w.add(b.to), (y = a.get(b.to)) == null || y.add(b.from));
|
|
644
644
|
const c = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
|
|
645
|
-
for (const b of
|
|
645
|
+
for (const b of s) {
|
|
646
646
|
if (u.has(b)) continue;
|
|
647
|
-
const A = [],
|
|
648
|
-
for (;
|
|
649
|
-
const
|
|
650
|
-
if (!u.has(
|
|
651
|
-
u.add(
|
|
652
|
-
for (const
|
|
653
|
-
u.has(
|
|
647
|
+
const A = [], m = [b];
|
|
648
|
+
for (; m.length; ) {
|
|
649
|
+
const S = m.shift();
|
|
650
|
+
if (!u.has(S)) {
|
|
651
|
+
u.add(S), A.push(S);
|
|
652
|
+
for (const R of a.get(S) ?? [])
|
|
653
|
+
u.has(R) || m.push(R);
|
|
654
654
|
}
|
|
655
655
|
}
|
|
656
|
-
if (A.length === 1 && (((
|
|
656
|
+
if (A.length === 1 && (((I = a.get(A[0])) == null ? void 0 : I.size) ?? 0) === 0)
|
|
657
657
|
continue;
|
|
658
|
-
const k = A.filter((
|
|
659
|
-
var
|
|
660
|
-
return (((
|
|
658
|
+
const k = A.filter((S) => {
|
|
659
|
+
var R;
|
|
660
|
+
return (((R = r.get(S)) == null ? void 0 : R.size) ?? 0) === 0;
|
|
661
661
|
}).sort(
|
|
662
|
-
(
|
|
663
|
-
),
|
|
664
|
-
(
|
|
662
|
+
(S, R) => (n.get(S) ?? Number.MAX_SAFE_INTEGER) - (n.get(R) ?? Number.MAX_SAFE_INTEGER) || S.localeCompare(R)
|
|
663
|
+
), M = [...A].sort(
|
|
664
|
+
(S, R) => (n.get(S) ?? Number.MAX_SAFE_INTEGER) - (n.get(R) ?? Number.MAX_SAFE_INTEGER) || S.localeCompare(R)
|
|
665
665
|
)[0];
|
|
666
|
-
if (!
|
|
667
|
-
const
|
|
668
|
-
const
|
|
669
|
-
for (;
|
|
670
|
-
const
|
|
671
|
-
if (!
|
|
672
|
-
|
|
673
|
-
for (const
|
|
674
|
-
|
|
666
|
+
if (!M) continue;
|
|
667
|
+
const D = [M], z = /* @__PURE__ */ new Set(), j = (S) => {
|
|
668
|
+
const R = [S];
|
|
669
|
+
for (; R.length; ) {
|
|
670
|
+
const T = R.shift();
|
|
671
|
+
if (!z.has(T)) {
|
|
672
|
+
z.add(T);
|
|
673
|
+
for (const H of o.get(T) ?? [])
|
|
674
|
+
z.has(H) || R.push(H);
|
|
675
675
|
}
|
|
676
676
|
}
|
|
677
677
|
};
|
|
678
|
-
|
|
679
|
-
for (const
|
|
680
|
-
|
|
681
|
-
for (const
|
|
682
|
-
c.add(
|
|
678
|
+
j(M);
|
|
679
|
+
for (const S of k)
|
|
680
|
+
z.has(S) || (D.push(S), j(S));
|
|
681
|
+
for (const S of D)
|
|
682
|
+
c.add(S);
|
|
683
683
|
}
|
|
684
684
|
return [...c].sort(
|
|
685
|
-
(b, A) => (
|
|
685
|
+
(b, A) => (n.get(b) ?? Number.MAX_SAFE_INTEGER) - (n.get(A) ?? Number.MAX_SAFE_INTEGER) || b.localeCompare(A)
|
|
686
686
|
);
|
|
687
687
|
}
|
|
688
|
-
function
|
|
689
|
-
var t,
|
|
690
|
-
return
|
|
691
|
-
(
|
|
692
|
-
(
|
|
693
|
-
)) == null ? void 0 :
|
|
688
|
+
function Ge(e) {
|
|
689
|
+
var t, s;
|
|
690
|
+
return Ct(
|
|
691
|
+
(s = (t = e.scenarios) == null ? void 0 : t.find(
|
|
692
|
+
(n) => n.id === "environment:baseline"
|
|
693
|
+
)) == null ? void 0 : s.environment
|
|
694
694
|
);
|
|
695
695
|
}
|
|
696
|
-
function
|
|
697
|
-
const t =
|
|
696
|
+
function Bt(e) {
|
|
697
|
+
const t = Ot(
|
|
698
698
|
e.pages,
|
|
699
699
|
e.manifest
|
|
700
|
-
),
|
|
700
|
+
), s = Mt(t), n = jt(
|
|
701
701
|
t,
|
|
702
702
|
e.manifest,
|
|
703
|
-
|
|
704
|
-
),
|
|
705
|
-
...
|
|
703
|
+
s
|
|
704
|
+
), o = [
|
|
705
|
+
...At(
|
|
706
706
|
e.manifest.edges,
|
|
707
|
-
|
|
708
|
-
new Set(
|
|
707
|
+
s,
|
|
708
|
+
new Set(n.map((a) => a.id))
|
|
709
709
|
),
|
|
710
|
-
...
|
|
711
|
-
...
|
|
712
|
-
...
|
|
710
|
+
...Tt(n, s),
|
|
711
|
+
...Dt(n, s),
|
|
712
|
+
...zt(n)
|
|
713
713
|
];
|
|
714
|
-
return
|
|
715
|
-
screens:
|
|
714
|
+
return Et({
|
|
715
|
+
screens: n,
|
|
716
716
|
assets: e.assets,
|
|
717
|
-
scenarios:
|
|
718
|
-
inferredEdges:
|
|
719
|
-
startScreenIds:
|
|
717
|
+
scenarios: Nt(e.manifest.routes),
|
|
718
|
+
inferredEdges: o,
|
|
719
|
+
startScreenIds: _t(n, o)
|
|
720
720
|
});
|
|
721
721
|
}
|
|
722
|
-
async function
|
|
723
|
-
const
|
|
722
|
+
async function Je(e) {
|
|
723
|
+
const s = await (e.fetcher ?? ((r, o) => fetch(r, o)))(e.endpoint, {
|
|
724
724
|
headers: { accept: "application/json" },
|
|
725
725
|
cache: "no-store",
|
|
726
726
|
signal: e.signal
|
|
727
727
|
});
|
|
728
|
-
if (!
|
|
729
|
-
throw new Error(`Storyboard discovery failed (${
|
|
730
|
-
const
|
|
731
|
-
if (!
|
|
728
|
+
if (!s.ok)
|
|
729
|
+
throw new Error(`Storyboard discovery failed (${s.status})`);
|
|
730
|
+
const n = await s.json();
|
|
731
|
+
if (!Rt(n))
|
|
732
732
|
throw new Error("Storyboard discovery returned an invalid manifest.");
|
|
733
733
|
return {
|
|
734
|
-
manifest:
|
|
735
|
-
baselineEnvironment:
|
|
736
|
-
graph:
|
|
737
|
-
manifest:
|
|
734
|
+
manifest: n,
|
|
735
|
+
baselineEnvironment: Ge(n),
|
|
736
|
+
graph: Bt({
|
|
737
|
+
manifest: n,
|
|
738
738
|
pages: e.pages,
|
|
739
739
|
assets: e.assets
|
|
740
740
|
})
|
|
741
741
|
};
|
|
742
742
|
}
|
|
743
|
-
async function
|
|
744
|
-
|
|
743
|
+
async function an(e) {
|
|
744
|
+
ee(null);
|
|
745
745
|
try {
|
|
746
|
-
const t = await
|
|
747
|
-
return
|
|
746
|
+
const t = await Je(e);
|
|
747
|
+
return ee(t.graph), t;
|
|
748
748
|
} catch (t) {
|
|
749
|
-
throw
|
|
749
|
+
throw ee(null), t;
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
|
-
const
|
|
753
|
-
function
|
|
752
|
+
const fe = "var(--pygmalion-catalog-surface, #ffffff)", he = "var(--pygmalion-catalog-canvas, #f5f5f5)", Ie = "var(--pygmalion-catalog-border, #e5e7eb)", me = "var(--pygmalion-catalog-text, #202124)", U = "var(--pygmalion-catalog-muted, #6b7280)", Ut = "var(--pygmalion-catalog-header, #11182f)", Ht = "var(--pygmalion-catalog-accent, #7c6cf2)";
|
|
753
|
+
function cn({
|
|
754
754
|
title: e,
|
|
755
755
|
eyebrow: t,
|
|
756
|
-
description:
|
|
757
|
-
version:
|
|
758
|
-
meta:
|
|
759
|
-
children:
|
|
760
|
-
headerBackground: a =
|
|
756
|
+
description: s,
|
|
757
|
+
version: n,
|
|
758
|
+
meta: r,
|
|
759
|
+
children: o,
|
|
760
|
+
headerBackground: a = Ut,
|
|
761
761
|
headerColor: c = "#ffffff",
|
|
762
|
-
bodyBackground: u =
|
|
763
|
-
bodyGap:
|
|
762
|
+
bodyBackground: u = fe,
|
|
763
|
+
bodyGap: g = 40
|
|
764
764
|
}) {
|
|
765
|
-
return /* @__PURE__ */
|
|
765
|
+
return /* @__PURE__ */ $(
|
|
766
766
|
"section",
|
|
767
767
|
{
|
|
768
768
|
"data-pygmalion-catalog-document": "",
|
|
@@ -774,12 +774,12 @@ function sn({
|
|
|
774
774
|
maxWidth: "none",
|
|
775
775
|
flexDirection: "column",
|
|
776
776
|
overflow: "visible",
|
|
777
|
-
color:
|
|
777
|
+
color: me,
|
|
778
778
|
background: u,
|
|
779
779
|
fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
|
|
780
780
|
},
|
|
781
781
|
children: [
|
|
782
|
-
/* @__PURE__ */
|
|
782
|
+
/* @__PURE__ */ $(
|
|
783
783
|
"header",
|
|
784
784
|
{
|
|
785
785
|
style: {
|
|
@@ -793,8 +793,8 @@ function sn({
|
|
|
793
793
|
background: a
|
|
794
794
|
},
|
|
795
795
|
children: [
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
-
t ? /* @__PURE__ */
|
|
796
|
+
/* @__PURE__ */ $("div", { style: { display: "flex", flexDirection: "column", gap: 10 }, children: [
|
|
797
|
+
t ? /* @__PURE__ */ v(
|
|
798
798
|
"div",
|
|
799
799
|
{
|
|
800
800
|
style: {
|
|
@@ -807,7 +807,7 @@ function sn({
|
|
|
807
807
|
children: t
|
|
808
808
|
}
|
|
809
809
|
) : null,
|
|
810
|
-
/* @__PURE__ */
|
|
810
|
+
/* @__PURE__ */ v(
|
|
811
811
|
"h1",
|
|
812
812
|
{
|
|
813
813
|
style: {
|
|
@@ -821,7 +821,7 @@ function sn({
|
|
|
821
821
|
children: e
|
|
822
822
|
}
|
|
823
823
|
),
|
|
824
|
-
|
|
824
|
+
s ? /* @__PURE__ */ v(
|
|
825
825
|
"div",
|
|
826
826
|
{
|
|
827
827
|
style: {
|
|
@@ -830,11 +830,11 @@ function sn({
|
|
|
830
830
|
fontSize: 13,
|
|
831
831
|
lineHeight: 1.55
|
|
832
832
|
},
|
|
833
|
-
children:
|
|
833
|
+
children: s
|
|
834
834
|
}
|
|
835
835
|
) : null
|
|
836
836
|
] }),
|
|
837
|
-
|
|
837
|
+
n || r ? /* @__PURE__ */ $(
|
|
838
838
|
"div",
|
|
839
839
|
{
|
|
840
840
|
style: {
|
|
@@ -846,15 +846,15 @@ function sn({
|
|
|
846
846
|
whiteSpace: "nowrap"
|
|
847
847
|
},
|
|
848
848
|
children: [
|
|
849
|
-
|
|
850
|
-
|
|
849
|
+
n ? /* @__PURE__ */ v("span", { children: n }) : null,
|
|
850
|
+
r ? /* @__PURE__ */ v("span", { children: r }) : null
|
|
851
851
|
]
|
|
852
852
|
}
|
|
853
853
|
) : null
|
|
854
854
|
]
|
|
855
855
|
}
|
|
856
856
|
),
|
|
857
|
-
/* @__PURE__ */
|
|
857
|
+
/* @__PURE__ */ v(
|
|
858
858
|
"div",
|
|
859
859
|
{
|
|
860
860
|
"data-pygmalion-catalog-document-body": "",
|
|
@@ -863,28 +863,30 @@ function sn({
|
|
|
863
863
|
display: "inline-flex",
|
|
864
864
|
flexDirection: "column",
|
|
865
865
|
alignItems: "flex-start",
|
|
866
|
-
gap:
|
|
866
|
+
gap: g,
|
|
867
867
|
padding: 48,
|
|
868
868
|
background: u
|
|
869
869
|
},
|
|
870
|
-
children:
|
|
870
|
+
children: o
|
|
871
871
|
}
|
|
872
872
|
)
|
|
873
873
|
]
|
|
874
874
|
}
|
|
875
875
|
);
|
|
876
876
|
}
|
|
877
|
-
function
|
|
877
|
+
function ln({
|
|
878
878
|
title: e,
|
|
879
|
-
|
|
880
|
-
|
|
879
|
+
itemId: t,
|
|
880
|
+
count: s,
|
|
881
|
+
description: n,
|
|
881
882
|
children: r,
|
|
882
|
-
tone:
|
|
883
|
+
tone: o = "tinted"
|
|
883
884
|
}) {
|
|
884
|
-
return /* @__PURE__ */
|
|
885
|
+
return /* @__PURE__ */ $(
|
|
885
886
|
"section",
|
|
886
887
|
{
|
|
887
888
|
"data-pygmalion-catalog-section": "",
|
|
889
|
+
"data-pygmalion-catalog-item": t,
|
|
888
890
|
style: {
|
|
889
891
|
boxSizing: "border-box",
|
|
890
892
|
display: "inline-flex",
|
|
@@ -892,12 +894,12 @@ function an({
|
|
|
892
894
|
flexDirection: "column",
|
|
893
895
|
alignItems: "flex-start",
|
|
894
896
|
gap: 18,
|
|
895
|
-
padding:
|
|
896
|
-
background:
|
|
897
|
+
padding: o === "tinted" ? 24 : 0,
|
|
898
|
+
background: o === "tinted" ? he : "transparent"
|
|
897
899
|
},
|
|
898
900
|
children: [
|
|
899
|
-
/* @__PURE__ */
|
|
900
|
-
/* @__PURE__ */
|
|
901
|
+
/* @__PURE__ */ $("header", { style: { display: "flex", alignItems: "baseline", gap: 8 }, children: [
|
|
902
|
+
/* @__PURE__ */ v(
|
|
901
903
|
"h2",
|
|
902
904
|
{
|
|
903
905
|
style: {
|
|
@@ -909,25 +911,25 @@ function an({
|
|
|
909
911
|
children: e
|
|
910
912
|
}
|
|
911
913
|
),
|
|
912
|
-
typeof
|
|
914
|
+
typeof s == "number" ? /* @__PURE__ */ v("span", { style: { color: U, fontSize: 11 }, children: s }) : null
|
|
913
915
|
] }),
|
|
914
|
-
|
|
916
|
+
n ? /* @__PURE__ */ v("div", { style: { marginTop: -10, color: U, fontSize: 11 }, children: n }) : null,
|
|
915
917
|
r
|
|
916
918
|
]
|
|
917
919
|
}
|
|
918
920
|
);
|
|
919
921
|
}
|
|
920
|
-
function
|
|
922
|
+
function dn({
|
|
921
923
|
rows: e,
|
|
922
924
|
columns: t,
|
|
923
|
-
cornerLabel:
|
|
924
|
-
renderCell:
|
|
925
|
-
renderRowLabel:
|
|
926
|
-
renderColumnLabel:
|
|
925
|
+
cornerLabel: s,
|
|
926
|
+
renderCell: n,
|
|
927
|
+
renderRowLabel: r = (u) => u,
|
|
928
|
+
renderColumnLabel: o = (u) => u,
|
|
927
929
|
boundary: a = !0,
|
|
928
930
|
cellStyle: c
|
|
929
931
|
}) {
|
|
930
|
-
return /* @__PURE__ */
|
|
932
|
+
return /* @__PURE__ */ v(
|
|
931
933
|
"div",
|
|
932
934
|
{
|
|
933
935
|
"data-pygmalion-catalog-matrix": "",
|
|
@@ -936,10 +938,10 @@ function cn({
|
|
|
936
938
|
display: "inline-block",
|
|
937
939
|
width: "max-content",
|
|
938
940
|
padding: a ? 16 : 0,
|
|
939
|
-
border: a ? `1px dashed ${
|
|
941
|
+
border: a ? `1px dashed ${Ht}` : void 0,
|
|
940
942
|
borderRadius: a ? 4 : void 0
|
|
941
943
|
},
|
|
942
|
-
children: /* @__PURE__ */
|
|
944
|
+
children: /* @__PURE__ */ $(
|
|
943
945
|
"table",
|
|
944
946
|
{
|
|
945
947
|
style: {
|
|
@@ -948,53 +950,53 @@ function cn({
|
|
|
948
950
|
borderSpacing: 0
|
|
949
951
|
},
|
|
950
952
|
children: [
|
|
951
|
-
/* @__PURE__ */
|
|
952
|
-
/* @__PURE__ */
|
|
953
|
+
/* @__PURE__ */ v("thead", { children: /* @__PURE__ */ $("tr", { children: [
|
|
954
|
+
/* @__PURE__ */ v(
|
|
953
955
|
"th",
|
|
954
956
|
{
|
|
955
957
|
style: {
|
|
956
958
|
padding: "0 16px 12px 0",
|
|
957
|
-
color:
|
|
959
|
+
color: U,
|
|
958
960
|
fontSize: 10,
|
|
959
961
|
fontWeight: 600,
|
|
960
962
|
textAlign: "left",
|
|
961
963
|
whiteSpace: "nowrap"
|
|
962
964
|
},
|
|
963
|
-
children:
|
|
965
|
+
children: s
|
|
964
966
|
}
|
|
965
967
|
),
|
|
966
|
-
t.map((u) => /* @__PURE__ */
|
|
968
|
+
t.map((u) => /* @__PURE__ */ v(
|
|
967
969
|
"th",
|
|
968
970
|
{
|
|
969
971
|
style: {
|
|
970
972
|
padding: "0 16px 12px",
|
|
971
|
-
color:
|
|
973
|
+
color: U,
|
|
972
974
|
fontSize: 10,
|
|
973
975
|
fontWeight: 600,
|
|
974
976
|
textAlign: "center",
|
|
975
977
|
whiteSpace: "nowrap"
|
|
976
978
|
},
|
|
977
|
-
children:
|
|
979
|
+
children: o(u)
|
|
978
980
|
},
|
|
979
981
|
u
|
|
980
982
|
))
|
|
981
983
|
] }) }),
|
|
982
|
-
/* @__PURE__ */
|
|
983
|
-
/* @__PURE__ */
|
|
984
|
+
/* @__PURE__ */ v("tbody", { children: e.map((u) => /* @__PURE__ */ $("tr", { children: [
|
|
985
|
+
/* @__PURE__ */ v(
|
|
984
986
|
"th",
|
|
985
987
|
{
|
|
986
988
|
style: {
|
|
987
989
|
padding: "12px 16px 12px 0",
|
|
988
|
-
color:
|
|
990
|
+
color: U,
|
|
989
991
|
fontSize: 10,
|
|
990
992
|
fontWeight: 600,
|
|
991
993
|
textAlign: "left",
|
|
992
994
|
whiteSpace: "nowrap"
|
|
993
995
|
},
|
|
994
|
-
children:
|
|
996
|
+
children: r(u)
|
|
995
997
|
}
|
|
996
998
|
),
|
|
997
|
-
t.map((
|
|
999
|
+
t.map((g) => /* @__PURE__ */ v(
|
|
998
1000
|
"td",
|
|
999
1001
|
{
|
|
1000
1002
|
style: {
|
|
@@ -1003,9 +1005,9 @@ function cn({
|
|
|
1003
1005
|
verticalAlign: "middle",
|
|
1004
1006
|
...c
|
|
1005
1007
|
},
|
|
1006
|
-
children:
|
|
1008
|
+
children: n(u, g)
|
|
1007
1009
|
},
|
|
1008
|
-
|
|
1010
|
+
g
|
|
1009
1011
|
))
|
|
1010
1012
|
] }, u)) })
|
|
1011
1013
|
]
|
|
@@ -1014,12 +1016,12 @@ function cn({
|
|
|
1014
1016
|
}
|
|
1015
1017
|
);
|
|
1016
1018
|
}
|
|
1017
|
-
function
|
|
1019
|
+
function qt(e) {
|
|
1018
1020
|
return e.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^\p{L}\p{N}]+/gu, "-").replace(/^-+|-+$/g, "").toLowerCase() || "page";
|
|
1019
1021
|
}
|
|
1020
|
-
function
|
|
1021
|
-
const
|
|
1022
|
-
return `${
|
|
1022
|
+
function Ve(e, t, s = "PygmalionCatalog") {
|
|
1023
|
+
const n = (r) => qt(r).replace(/-/g, "_");
|
|
1024
|
+
return `${s}_${n(e)}_${n(t)}`;
|
|
1023
1025
|
}
|
|
1024
1026
|
function We(e, t) {
|
|
1025
1027
|
return {
|
|
@@ -1032,25 +1034,25 @@ function We(e, t) {
|
|
|
1032
1034
|
description: e.description
|
|
1033
1035
|
};
|
|
1034
1036
|
}
|
|
1035
|
-
function
|
|
1037
|
+
function Qe(e) {
|
|
1036
1038
|
const t = /* @__PURE__ */ new Set();
|
|
1037
|
-
for (const
|
|
1038
|
-
if (t.has(
|
|
1039
|
-
throw new Error(`Duplicate design catalog item id: ${
|
|
1040
|
-
t.add(
|
|
1039
|
+
for (const s of e) {
|
|
1040
|
+
if (t.has(s.id))
|
|
1041
|
+
throw new Error(`Duplicate design catalog item id: ${s.id}`);
|
|
1042
|
+
t.add(s.id);
|
|
1041
1043
|
}
|
|
1042
1044
|
}
|
|
1043
|
-
function
|
|
1044
|
-
return typeof e == "function" ? e(t,
|
|
1045
|
+
function Kt(e, t, s) {
|
|
1046
|
+
return typeof e == "function" ? e(t, s) : e;
|
|
1045
1047
|
}
|
|
1046
|
-
function
|
|
1048
|
+
function Gt({
|
|
1047
1049
|
page: e,
|
|
1048
1050
|
items: t,
|
|
1049
|
-
renderPreview:
|
|
1050
|
-
secondaryLabel:
|
|
1051
|
-
minimumColumnWidth:
|
|
1051
|
+
renderPreview: s,
|
|
1052
|
+
secondaryLabel: n,
|
|
1053
|
+
minimumColumnWidth: r
|
|
1052
1054
|
}) {
|
|
1053
|
-
return /* @__PURE__ */
|
|
1055
|
+
return /* @__PURE__ */ $(
|
|
1054
1056
|
"section",
|
|
1055
1057
|
{
|
|
1056
1058
|
"data-pygmalion-catalog-page": e.id,
|
|
@@ -1060,19 +1062,19 @@ function qt({
|
|
|
1060
1062
|
display: "inline-block",
|
|
1061
1063
|
width: "max-content",
|
|
1062
1064
|
padding: 32,
|
|
1063
|
-
color:
|
|
1064
|
-
background:
|
|
1065
|
+
color: me,
|
|
1066
|
+
background: he,
|
|
1065
1067
|
fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
|
|
1066
1068
|
},
|
|
1067
1069
|
children: [
|
|
1068
|
-
/* @__PURE__ */
|
|
1069
|
-
/* @__PURE__ */
|
|
1070
|
-
/* @__PURE__ */
|
|
1070
|
+
/* @__PURE__ */ $("header", { style: { marginBottom: 24 }, children: [
|
|
1071
|
+
/* @__PURE__ */ v("h1", { style: { margin: 0, fontSize: 24, lineHeight: 1.35 }, children: e.name }),
|
|
1072
|
+
/* @__PURE__ */ $("p", { style: { margin: "6px 0 0", color: U, fontSize: 13 }, children: [
|
|
1071
1073
|
t.length,
|
|
1072
1074
|
" assets"
|
|
1073
1075
|
] })
|
|
1074
1076
|
] }),
|
|
1075
|
-
/* @__PURE__ */
|
|
1077
|
+
/* @__PURE__ */ v(
|
|
1076
1078
|
"div",
|
|
1077
1079
|
{
|
|
1078
1080
|
style: {
|
|
@@ -1080,20 +1082,20 @@ function qt({
|
|
|
1080
1082
|
gridTemplateColumns: "repeat(6, max-content)",
|
|
1081
1083
|
gap: 16
|
|
1082
1084
|
},
|
|
1083
|
-
children: t.map((
|
|
1085
|
+
children: t.map((o) => /* @__PURE__ */ $(
|
|
1084
1086
|
"article",
|
|
1085
1087
|
{
|
|
1086
|
-
"data-pygmalion-catalog-item":
|
|
1088
|
+
"data-pygmalion-catalog-item": o.id,
|
|
1087
1089
|
style: {
|
|
1088
|
-
minWidth:
|
|
1089
|
-
width:
|
|
1090
|
+
minWidth: r,
|
|
1091
|
+
width: r,
|
|
1090
1092
|
padding: 16,
|
|
1091
|
-
border: `1px solid ${
|
|
1093
|
+
border: `1px solid ${Ie}`,
|
|
1092
1094
|
borderRadius: 12,
|
|
1093
|
-
background:
|
|
1095
|
+
background: fe
|
|
1094
1096
|
},
|
|
1095
1097
|
children: [
|
|
1096
|
-
/* @__PURE__ */
|
|
1098
|
+
/* @__PURE__ */ v(
|
|
1097
1099
|
"div",
|
|
1098
1100
|
{
|
|
1099
1101
|
style: {
|
|
@@ -1103,10 +1105,10 @@ function qt({
|
|
|
1103
1105
|
justifyContent: "center",
|
|
1104
1106
|
overflow: "hidden"
|
|
1105
1107
|
},
|
|
1106
|
-
children: o
|
|
1108
|
+
children: s(o)
|
|
1107
1109
|
}
|
|
1108
1110
|
),
|
|
1109
|
-
/* @__PURE__ */
|
|
1111
|
+
/* @__PURE__ */ v(
|
|
1110
1112
|
"div",
|
|
1111
1113
|
{
|
|
1112
1114
|
style: {
|
|
@@ -1117,29 +1119,29 @@ function qt({
|
|
|
1117
1119
|
textOverflow: "ellipsis",
|
|
1118
1120
|
whiteSpace: "nowrap"
|
|
1119
1121
|
},
|
|
1120
|
-
title:
|
|
1121
|
-
children:
|
|
1122
|
+
title: o.name,
|
|
1123
|
+
children: o.name
|
|
1122
1124
|
}
|
|
1123
1125
|
),
|
|
1124
|
-
|
|
1126
|
+
n ? /* @__PURE__ */ v("div", { style: { marginTop: 4, color: U, fontSize: 11, lineHeight: 1.45 }, children: n(o) }) : o.codeName ? /* @__PURE__ */ v(
|
|
1125
1127
|
"div",
|
|
1126
1128
|
{
|
|
1127
1129
|
style: {
|
|
1128
1130
|
marginTop: 4,
|
|
1129
1131
|
overflow: "hidden",
|
|
1130
|
-
color:
|
|
1132
|
+
color: U,
|
|
1131
1133
|
fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
1132
1134
|
fontSize: 11,
|
|
1133
1135
|
textOverflow: "ellipsis",
|
|
1134
1136
|
whiteSpace: "nowrap"
|
|
1135
1137
|
},
|
|
1136
|
-
title:
|
|
1137
|
-
children:
|
|
1138
|
+
title: o.codeName,
|
|
1139
|
+
children: o.codeName
|
|
1138
1140
|
}
|
|
1139
1141
|
) : null
|
|
1140
1142
|
]
|
|
1141
1143
|
},
|
|
1142
|
-
|
|
1144
|
+
o.id
|
|
1143
1145
|
))
|
|
1144
1146
|
}
|
|
1145
1147
|
)
|
|
@@ -1147,86 +1149,86 @@ function qt({
|
|
|
1147
1149
|
}
|
|
1148
1150
|
);
|
|
1149
1151
|
}
|
|
1150
|
-
function
|
|
1151
|
-
|
|
1152
|
+
function un(e) {
|
|
1153
|
+
Qe(e.items);
|
|
1152
1154
|
const t = /* @__PURE__ */ new Map();
|
|
1153
|
-
for (const
|
|
1154
|
-
const
|
|
1155
|
+
for (const r of e.items) {
|
|
1156
|
+
const o = e.pageFor(r), a = t.get(o.id);
|
|
1155
1157
|
if (a) {
|
|
1156
|
-
if (a.page.name !==
|
|
1157
|
-
throw new Error(`Conflicting design catalog page descriptor: ${
|
|
1158
|
-
a.items.push(
|
|
1158
|
+
if (a.page.name !== o.name || a.page.section !== o.section)
|
|
1159
|
+
throw new Error(`Conflicting design catalog page descriptor: ${o.id}`);
|
|
1160
|
+
a.items.push(r);
|
|
1159
1161
|
continue;
|
|
1160
1162
|
}
|
|
1161
|
-
t.set(
|
|
1162
|
-
page:
|
|
1163
|
-
items: [
|
|
1164
|
-
registryName:
|
|
1163
|
+
t.set(o.id, {
|
|
1164
|
+
page: o,
|
|
1165
|
+
items: [r],
|
|
1166
|
+
registryName: Ve(
|
|
1165
1167
|
e.kind,
|
|
1166
|
-
|
|
1168
|
+
o.id,
|
|
1167
1169
|
e.registryPrefix
|
|
1168
1170
|
)
|
|
1169
1171
|
});
|
|
1170
1172
|
}
|
|
1171
|
-
const
|
|
1172
|
-
for (const
|
|
1173
|
-
const
|
|
1174
|
-
|
|
1173
|
+
const s = {}, n = [];
|
|
1174
|
+
for (const r of t.values()) {
|
|
1175
|
+
const o = () => /* @__PURE__ */ v(
|
|
1176
|
+
Gt,
|
|
1175
1177
|
{
|
|
1176
|
-
page:
|
|
1177
|
-
items:
|
|
1178
|
+
page: r.page,
|
|
1179
|
+
items: r.items,
|
|
1178
1180
|
renderPreview: e.renderPreview,
|
|
1179
1181
|
secondaryLabel: e.secondaryLabel,
|
|
1180
1182
|
minimumColumnWidth: e.minimumColumnWidth ?? 152
|
|
1181
1183
|
}
|
|
1182
1184
|
);
|
|
1183
|
-
|
|
1184
|
-
component:
|
|
1185
|
+
s[r.registryName] = {
|
|
1186
|
+
component: o,
|
|
1185
1187
|
children: "none"
|
|
1186
1188
|
};
|
|
1187
|
-
const a =
|
|
1188
|
-
|
|
1189
|
-
...
|
|
1190
|
-
componentName:
|
|
1189
|
+
const a = Kt(e.frame, r.page, r.items);
|
|
1190
|
+
n.push({
|
|
1191
|
+
...r.page,
|
|
1192
|
+
componentName: r.registryName,
|
|
1191
1193
|
width: (a == null ? void 0 : a.width) ?? 1,
|
|
1192
1194
|
height: (a == null ? void 0 : a.height) ?? 1,
|
|
1193
1195
|
frameSizeMode: a ? "fixed" : "content"
|
|
1194
1196
|
});
|
|
1195
1197
|
}
|
|
1196
1198
|
return {
|
|
1197
|
-
registry:
|
|
1199
|
+
registry: s,
|
|
1198
1200
|
collection: {
|
|
1199
1201
|
expectedCount: e.expectedCount ?? e.items.length,
|
|
1200
|
-
assets: e.items.map((
|
|
1201
|
-
pages:
|
|
1202
|
+
assets: e.items.map((r) => We(r, e.pageFor(r).id)),
|
|
1203
|
+
pages: n
|
|
1202
1204
|
}
|
|
1203
1205
|
};
|
|
1204
1206
|
}
|
|
1205
|
-
function
|
|
1206
|
-
const
|
|
1207
|
+
function Jt(e, t = 60) {
|
|
1208
|
+
const s = Object.entries((e == null ? void 0 : e.props) ?? {}).filter(([, c]) => c.length > 0).sort(([c, u], [g, h]) => h.length - u.length || c.localeCompare(g)), n = s[0], r = s[1], o = Math.max(1, (n == null ? void 0 : n[1].length) ?? 1), a = r == null ? void 0 : r[1].slice(0, Math.max(1, Math.floor(t / o)));
|
|
1207
1209
|
return {
|
|
1208
|
-
row:
|
|
1209
|
-
column:
|
|
1210
|
-
fixed:
|
|
1211
|
-
additional:
|
|
1210
|
+
row: n,
|
|
1211
|
+
column: r ? [r[0], a ?? []] : void 0,
|
|
1212
|
+
fixed: s.slice(2).map(([c, u]) => [c, u[0]]),
|
|
1213
|
+
additional: s.slice(2)
|
|
1212
1214
|
};
|
|
1213
1215
|
}
|
|
1214
|
-
function
|
|
1216
|
+
function Vt(e, t, s, n) {
|
|
1215
1217
|
return {
|
|
1216
1218
|
...e.defaultProps,
|
|
1217
1219
|
...Object.fromEntries(t.fixed),
|
|
1218
|
-
...t.row &&
|
|
1219
|
-
...t.column &&
|
|
1220
|
+
...t.row && s ? { [t.row[0]]: s } : {},
|
|
1221
|
+
...t.column && n ? { [t.column[0]]: n } : {}
|
|
1220
1222
|
};
|
|
1221
1223
|
}
|
|
1222
|
-
function
|
|
1224
|
+
function Wt({
|
|
1223
1225
|
item: e,
|
|
1224
1226
|
entry: t,
|
|
1225
|
-
maxVariantCells:
|
|
1227
|
+
maxVariantCells: s
|
|
1226
1228
|
}) {
|
|
1227
1229
|
var c, u;
|
|
1228
1230
|
if (!t)
|
|
1229
|
-
return /* @__PURE__ */
|
|
1231
|
+
return /* @__PURE__ */ $(
|
|
1230
1232
|
"section",
|
|
1231
1233
|
{
|
|
1232
1234
|
"data-pygmalion-catalog-component": e.id,
|
|
@@ -1236,17 +1238,17 @@ function Jt({
|
|
|
1236
1238
|
display: "inline-block",
|
|
1237
1239
|
width: "max-content",
|
|
1238
1240
|
padding: 32,
|
|
1239
|
-
color:
|
|
1240
|
-
background:
|
|
1241
|
+
color: me,
|
|
1242
|
+
background: he
|
|
1241
1243
|
},
|
|
1242
1244
|
children: [
|
|
1243
|
-
/* @__PURE__ */
|
|
1244
|
-
/* @__PURE__ */
|
|
1245
|
+
/* @__PURE__ */ v("strong", { children: e.name }),
|
|
1246
|
+
/* @__PURE__ */ v("p", { style: { color: U }, children: "The component is not registered." })
|
|
1245
1247
|
]
|
|
1246
1248
|
}
|
|
1247
1249
|
);
|
|
1248
|
-
const
|
|
1249
|
-
return /* @__PURE__ */
|
|
1250
|
+
const n = Jt(t, s), r = ((c = n.row) == null ? void 0 : c[1]) ?? [void 0], o = ((u = n.column) == null ? void 0 : u[1]) ?? [void 0], a = t.component;
|
|
1251
|
+
return /* @__PURE__ */ $(
|
|
1250
1252
|
"section",
|
|
1251
1253
|
{
|
|
1252
1254
|
"data-pygmalion-catalog-component": e.id,
|
|
@@ -1256,261 +1258,261 @@ function Jt({
|
|
|
1256
1258
|
display: "inline-block",
|
|
1257
1259
|
width: "max-content",
|
|
1258
1260
|
padding: 32,
|
|
1259
|
-
color:
|
|
1260
|
-
background:
|
|
1261
|
+
color: me,
|
|
1262
|
+
background: he,
|
|
1261
1263
|
fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif"
|
|
1262
1264
|
},
|
|
1263
1265
|
children: [
|
|
1264
|
-
/* @__PURE__ */
|
|
1265
|
-
/* @__PURE__ */
|
|
1266
|
-
e.sourcePath ? /* @__PURE__ */
|
|
1266
|
+
/* @__PURE__ */ $("header", { style: { marginBottom: 24 }, children: [
|
|
1267
|
+
/* @__PURE__ */ v("h1", { style: { margin: 0, fontSize: 24 }, children: e.name }),
|
|
1268
|
+
e.sourcePath ? /* @__PURE__ */ v("p", { style: { margin: "6px 0 0", color: U, fontSize: 12 }, children: e.sourcePath }) : null
|
|
1267
1269
|
] }),
|
|
1268
|
-
/* @__PURE__ */
|
|
1270
|
+
/* @__PURE__ */ v(
|
|
1269
1271
|
"div",
|
|
1270
1272
|
{
|
|
1271
1273
|
style: {
|
|
1272
1274
|
display: "inline-grid",
|
|
1273
|
-
gridTemplateColumns: `repeat(${
|
|
1275
|
+
gridTemplateColumns: `repeat(${o.length}, max-content)`,
|
|
1274
1276
|
gap: 12
|
|
1275
1277
|
},
|
|
1276
|
-
children:
|
|
1277
|
-
(
|
|
1278
|
-
const
|
|
1279
|
-
|
|
1280
|
-
|
|
1278
|
+
children: r.flatMap(
|
|
1279
|
+
(g) => o.map((h) => {
|
|
1280
|
+
const w = Vt(t, n, g, h), y = [
|
|
1281
|
+
n.row && g ? `${n.row[0]}=${g}` : "",
|
|
1282
|
+
n.column && h ? `${n.column[0]}=${h}` : ""
|
|
1281
1283
|
].filter(Boolean).join(" · ");
|
|
1282
|
-
return /* @__PURE__ */
|
|
1284
|
+
return /* @__PURE__ */ $(
|
|
1283
1285
|
"article",
|
|
1284
1286
|
{
|
|
1285
1287
|
style: {
|
|
1286
1288
|
width: "max-content",
|
|
1287
1289
|
padding: 16,
|
|
1288
|
-
border: `1px solid ${
|
|
1290
|
+
border: `1px solid ${Ie}`,
|
|
1289
1291
|
borderRadius: 10,
|
|
1290
|
-
background:
|
|
1292
|
+
background: fe
|
|
1291
1293
|
},
|
|
1292
1294
|
children: [
|
|
1293
|
-
|
|
1294
|
-
/* @__PURE__ */
|
|
1295
|
+
y ? /* @__PURE__ */ v("div", { style: { marginBottom: 12, color: U, fontSize: 11 }, children: y }) : null,
|
|
1296
|
+
/* @__PURE__ */ v("div", { style: { display: "flex", minHeight: 44, alignItems: "center" }, children: Fe(
|
|
1295
1297
|
a,
|
|
1296
|
-
|
|
1298
|
+
w,
|
|
1297
1299
|
t.children === "text" ? t.defaultChildren ?? e.name : void 0
|
|
1298
1300
|
) })
|
|
1299
1301
|
]
|
|
1300
1302
|
},
|
|
1301
|
-
`${
|
|
1303
|
+
`${g ?? "default"}:${h ?? "default"}`
|
|
1302
1304
|
);
|
|
1303
1305
|
})
|
|
1304
1306
|
)
|
|
1305
1307
|
}
|
|
1306
1308
|
),
|
|
1307
|
-
|
|
1308
|
-
/* @__PURE__ */
|
|
1309
|
-
/* @__PURE__ */
|
|
1309
|
+
n.additional.map(([g, h]) => /* @__PURE__ */ $("section", { style: { marginTop: 20 }, children: [
|
|
1310
|
+
/* @__PURE__ */ v("h2", { style: { margin: "0 0 10px", color: U, fontSize: 12 }, children: g }),
|
|
1311
|
+
/* @__PURE__ */ v("div", { style: { display: "flex", flexWrap: "wrap", gap: 12 }, children: h.map((w) => /* @__PURE__ */ $(
|
|
1310
1312
|
"article",
|
|
1311
1313
|
{
|
|
1312
1314
|
style: {
|
|
1313
1315
|
padding: 16,
|
|
1314
|
-
border: `1px solid ${
|
|
1316
|
+
border: `1px solid ${Ie}`,
|
|
1315
1317
|
borderRadius: 10,
|
|
1316
|
-
background:
|
|
1318
|
+
background: fe
|
|
1317
1319
|
},
|
|
1318
1320
|
children: [
|
|
1319
|
-
/* @__PURE__ */
|
|
1320
|
-
|
|
1321
|
+
/* @__PURE__ */ v("div", { style: { marginBottom: 12, color: U, fontSize: 11 }, children: w }),
|
|
1322
|
+
Fe(
|
|
1321
1323
|
a,
|
|
1322
|
-
{ ...t.defaultProps, [
|
|
1324
|
+
{ ...t.defaultProps, [g]: w },
|
|
1323
1325
|
t.children === "text" ? t.defaultChildren ?? e.name : void 0
|
|
1324
1326
|
)
|
|
1325
1327
|
]
|
|
1326
1328
|
},
|
|
1327
|
-
|
|
1329
|
+
w
|
|
1328
1330
|
)) })
|
|
1329
|
-
] },
|
|
1331
|
+
] }, g))
|
|
1330
1332
|
]
|
|
1331
1333
|
}
|
|
1332
1334
|
);
|
|
1333
1335
|
}
|
|
1334
|
-
function
|
|
1335
|
-
|
|
1336
|
-
const t = {},
|
|
1337
|
-
for (const
|
|
1338
|
-
const a =
|
|
1336
|
+
function fn(e) {
|
|
1337
|
+
Qe(e.items);
|
|
1338
|
+
const t = {}, s = [], n = [], r = e.maxVariantCells ?? 60;
|
|
1339
|
+
for (const o of e.items) {
|
|
1340
|
+
const a = Ve(
|
|
1339
1341
|
e.kind,
|
|
1340
|
-
|
|
1342
|
+
o.id,
|
|
1341
1343
|
e.registryPrefix
|
|
1342
|
-
), c = e.registry[
|
|
1343
|
-
|
|
1344
|
+
), c = e.registry[o.name], u = () => /* @__PURE__ */ v(
|
|
1345
|
+
Wt,
|
|
1344
1346
|
{
|
|
1345
|
-
item:
|
|
1347
|
+
item: o,
|
|
1346
1348
|
entry: c,
|
|
1347
|
-
maxVariantCells:
|
|
1349
|
+
maxVariantCells: r
|
|
1348
1350
|
}
|
|
1349
1351
|
);
|
|
1350
|
-
t[a] = { component: u, children: "none" },
|
|
1351
|
-
id:
|
|
1352
|
-
name:
|
|
1353
|
-
section:
|
|
1352
|
+
t[a] = { component: u, children: "none" }, s.push({
|
|
1353
|
+
id: o.id,
|
|
1354
|
+
name: o.name,
|
|
1355
|
+
section: o.section,
|
|
1354
1356
|
componentName: a,
|
|
1355
1357
|
// The seed exists only long enough to mount the intrinsic max-content
|
|
1356
1358
|
// catalog root. The editor replaces it with actual rendered DOM bounds.
|
|
1357
1359
|
width: 1,
|
|
1358
1360
|
height: 1,
|
|
1359
1361
|
frameSizeMode: "content"
|
|
1360
|
-
}),
|
|
1362
|
+
}), n.push(We(o, o.id));
|
|
1361
1363
|
}
|
|
1362
1364
|
return {
|
|
1363
1365
|
registry: t,
|
|
1364
1366
|
collection: {
|
|
1365
1367
|
expectedCount: e.expectedCount ?? e.items.length,
|
|
1366
|
-
assets:
|
|
1367
|
-
pages:
|
|
1368
|
+
assets: n,
|
|
1369
|
+
pages: s
|
|
1368
1370
|
}
|
|
1369
1371
|
};
|
|
1370
1372
|
}
|
|
1371
|
-
const
|
|
1372
|
-
function
|
|
1373
|
-
return typeof e == "string" &&
|
|
1373
|
+
const je = /^[a-f0-9]{64}$/, Qt = /^\/__pygmalion-qa\/artifacts\/[A-Za-z0-9_-]{8,120}\.png$/, Lt = /^p\d+$/;
|
|
1374
|
+
function xe(e) {
|
|
1375
|
+
return typeof e == "string" && Qt.test(e) ? e : void 0;
|
|
1374
1376
|
}
|
|
1375
|
-
function
|
|
1376
|
-
const
|
|
1377
|
-
return
|
|
1377
|
+
function _e(e, t) {
|
|
1378
|
+
const s = new URL(e, t);
|
|
1379
|
+
return s.search = "", s.hash = "", s.pathname.endsWith("/") || (s.pathname = `${s.pathname}/`), s.href;
|
|
1378
1380
|
}
|
|
1379
|
-
function
|
|
1381
|
+
function we(e) {
|
|
1380
1382
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1381
1383
|
const t = e;
|
|
1382
|
-
return typeof t.domStructureHash != "string" || !
|
|
1384
|
+
return typeof t.domStructureHash != "string" || !je.test(t.domStructureHash) || typeof t.screenshotHash != "string" || !je.test(t.screenshotHash) ? null : {
|
|
1383
1385
|
domStructureHash: t.domStructureHash,
|
|
1384
1386
|
screenshotHash: t.screenshotHash,
|
|
1385
|
-
...
|
|
1387
|
+
...xe(t.screenshotUrl) ? { screenshotUrl: xe(t.screenshotUrl) } : {}
|
|
1386
1388
|
};
|
|
1387
1389
|
}
|
|
1388
|
-
function
|
|
1390
|
+
function Be(e) {
|
|
1389
1391
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1390
1392
|
const t = e;
|
|
1391
1393
|
return !Number.isSafeInteger(t.width) || !Number.isSafeInteger(t.height) || Number(t.width) < 1 || Number(t.height) < 1 || Number(t.width) > 65536 || Number(t.height) > 65536 ? null : { width: Number(t.width), height: Number(t.height) };
|
|
1392
1394
|
}
|
|
1393
|
-
function
|
|
1395
|
+
function Xt(e) {
|
|
1394
1396
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1395
|
-
const t = e,
|
|
1396
|
-
if (!
|
|
1397
|
+
const t = e, s = Be(t.before), n = Be(t.after);
|
|
1398
|
+
if (!s || !n || !Number.isSafeInteger(t.changedPixels) || !Number.isSafeInteger(t.totalPixels) || Number(t.changedPixels) < 0 || Number(t.totalPixels) < 1 || Number(t.changedPixels) > Number(t.totalPixels) || typeof t.threshold != "number" || !Number.isFinite(t.threshold) || t.threshold < 0 || t.threshold > 1)
|
|
1397
1399
|
return null;
|
|
1398
|
-
const
|
|
1400
|
+
const r = t.heatmapUrl == null ? null : xe(t.heatmapUrl) ?? null;
|
|
1399
1401
|
return {
|
|
1400
|
-
before:
|
|
1401
|
-
after:
|
|
1402
|
-
dimensionsMatch:
|
|
1402
|
+
before: s,
|
|
1403
|
+
after: n,
|
|
1404
|
+
dimensionsMatch: s.width === n.width && s.height === n.height,
|
|
1403
1405
|
changedPixels: Number(t.changedPixels),
|
|
1404
1406
|
totalPixels: Number(t.totalPixels),
|
|
1405
1407
|
diffRatio: Number(t.changedPixels) / Number(t.totalPixels),
|
|
1406
1408
|
threshold: t.threshold,
|
|
1407
|
-
heatmapUrl:
|
|
1409
|
+
heatmapUrl: r
|
|
1408
1410
|
};
|
|
1409
1411
|
}
|
|
1410
|
-
function
|
|
1412
|
+
function Yt(e, t) {
|
|
1411
1413
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1412
|
-
const
|
|
1413
|
-
if (typeof
|
|
1414
|
-
const
|
|
1415
|
-
if (!
|
|
1416
|
-
const
|
|
1417
|
-
if (t === "changed" && !
|
|
1418
|
-
const a =
|
|
1414
|
+
const s = e;
|
|
1415
|
+
if (typeof s.id != "string" || !s.id) return null;
|
|
1416
|
+
const n = we(s), r = we(s.before) ?? n;
|
|
1417
|
+
if (!r) return null;
|
|
1418
|
+
const o = we(s.after);
|
|
1419
|
+
if (t === "changed" && !o) return null;
|
|
1420
|
+
const a = o ? Xt(s.pixelDiff) : null;
|
|
1419
1421
|
return {
|
|
1420
|
-
id:
|
|
1421
|
-
before:
|
|
1422
|
-
...
|
|
1423
|
-
...
|
|
1424
|
-
domChanged:
|
|
1425
|
-
screenshotChanged:
|
|
1422
|
+
id: s.id,
|
|
1423
|
+
before: r,
|
|
1424
|
+
...o ? { after: o } : {},
|
|
1425
|
+
...o ? {
|
|
1426
|
+
domChanged: r.domStructureHash !== o.domStructureHash,
|
|
1427
|
+
screenshotChanged: r.screenshotHash !== o.screenshotHash
|
|
1426
1428
|
} : {},
|
|
1427
1429
|
...a ? { pixelDiff: a } : {}
|
|
1428
1430
|
};
|
|
1429
1431
|
}
|
|
1430
|
-
function
|
|
1431
|
-
const
|
|
1432
|
+
function Zt(e, t = []) {
|
|
1433
|
+
const s = new Set(t), n = s.size > 0, r = /* @__PURE__ */ new Set(), o = [
|
|
1432
1434
|
...e.styles.map((a) => a.affectedFrames ?? []),
|
|
1433
1435
|
...e.texts.map((a) => a.affectedFrames ?? []),
|
|
1434
1436
|
...e.operations.map((a) => a.affectedFrames ?? [])
|
|
1435
1437
|
];
|
|
1436
|
-
for (const a of
|
|
1438
|
+
for (const a of o)
|
|
1437
1439
|
for (const c of a) {
|
|
1438
|
-
if (
|
|
1440
|
+
if (n && Lt.test(c.id) && !s.has(c.id))
|
|
1439
1441
|
throw new Error(
|
|
1440
1442
|
`"Impact Screen"${c.name}"This internal editor ID (${c.id}) is used. A canonical screen ID is required.`
|
|
1441
1443
|
);
|
|
1442
|
-
!c.id ||
|
|
1444
|
+
!c.id || n && !s.has(c.id) || r.add(c.id);
|
|
1443
1445
|
}
|
|
1444
|
-
return [...
|
|
1446
|
+
return [...r].sort();
|
|
1445
1447
|
}
|
|
1446
|
-
async function
|
|
1447
|
-
const
|
|
1448
|
+
async function Ue(e, t, s) {
|
|
1449
|
+
const n = await e(`${t.replace(/\/$/, "")}/capture`, {
|
|
1448
1450
|
method: "POST",
|
|
1449
1451
|
headers: { "content-type": "application/json" },
|
|
1450
|
-
body: JSON.stringify(
|
|
1451
|
-
}),
|
|
1452
|
-
if (!
|
|
1452
|
+
body: JSON.stringify(s)
|
|
1453
|
+
}), r = await n.json();
|
|
1454
|
+
if (!n.ok || r.ok === !1)
|
|
1453
1455
|
throw new Error(
|
|
1454
|
-
typeof
|
|
1456
|
+
typeof r.error == "string" ? r.error : `Pygmalion visual QA capture failed (${n.status})`
|
|
1455
1457
|
);
|
|
1456
|
-
if (typeof
|
|
1458
|
+
if (typeof r.baselineId != "string" || !r.baselineId)
|
|
1457
1459
|
throw new Error("Pygmalion visual QA response has no baselineId");
|
|
1458
|
-
const
|
|
1460
|
+
const o = Array.isArray(r.frames) ? r.frames.map((h) => Yt(h, s.phase)).filter((h) => h != null) : [], a = Array.isArray(r.failures) ? r.failures.map((h) => {
|
|
1459
1461
|
if (!h || typeof h != "object" || Array.isArray(h)) return null;
|
|
1460
|
-
const
|
|
1461
|
-
return typeof
|
|
1462
|
-
}).filter((h) => h != null) : [], c = new Set(
|
|
1462
|
+
const w = h;
|
|
1463
|
+
return typeof w.id == "string" && typeof w.error == "string" ? { id: w.id, error: w.error } : null;
|
|
1464
|
+
}).filter((h) => h != null) : [], c = new Set(s.frameIds), g = new Set(o.map((h) => h.id)).size === o.length && o.every((h) => c.has(h.id)) && a.every((h) => c.has(h.id));
|
|
1463
1465
|
return {
|
|
1464
|
-
phase:
|
|
1465
|
-
baselineId:
|
|
1466
|
-
complete:
|
|
1467
|
-
frames:
|
|
1466
|
+
phase: s.phase,
|
|
1467
|
+
baselineId: r.baselineId,
|
|
1468
|
+
complete: r.complete !== !1 && g && a.length === 0 && o.length === s.frameIds.length,
|
|
1469
|
+
frames: o,
|
|
1468
1470
|
failures: a
|
|
1469
1471
|
};
|
|
1470
1472
|
}
|
|
1471
|
-
const
|
|
1473
|
+
const be = {
|
|
1472
1474
|
mirror: "/__pygmalion-dev-control",
|
|
1473
1475
|
sessions: "/__pygmalion-design-session",
|
|
1474
1476
|
inspect: "/__pygmalion-inspect"
|
|
1475
|
-
},
|
|
1476
|
-
function
|
|
1477
|
+
}, en = "pygmalion.designSessionId", tn = "/__pygmalion-qa", le = /* @__PURE__ */ new Map();
|
|
1478
|
+
function He() {
|
|
1477
1479
|
var e;
|
|
1478
1480
|
return typeof window < "u" && ((e = window.crypto) != null && e.randomUUID) ? window.crypto.randomUUID() : `pygmalion-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
1479
1481
|
}
|
|
1480
|
-
function
|
|
1482
|
+
function nn(e, t) {
|
|
1481
1483
|
if (e) return e;
|
|
1482
|
-
const
|
|
1483
|
-
if (
|
|
1484
|
+
const s = le.get(t);
|
|
1485
|
+
if (s) return s;
|
|
1484
1486
|
try {
|
|
1485
|
-
const
|
|
1486
|
-
if (
|
|
1487
|
-
return
|
|
1488
|
-
const
|
|
1489
|
-
return window.localStorage.setItem(t,
|
|
1487
|
+
const n = window.localStorage.getItem(t);
|
|
1488
|
+
if (n)
|
|
1489
|
+
return le.set(t, n), n;
|
|
1490
|
+
const r = He();
|
|
1491
|
+
return window.localStorage.setItem(t, r), le.set(t, r), r;
|
|
1490
1492
|
} catch {
|
|
1491
|
-
const
|
|
1492
|
-
return
|
|
1493
|
+
const n = He();
|
|
1494
|
+
return le.set(t, n), n;
|
|
1493
1495
|
}
|
|
1494
1496
|
}
|
|
1495
|
-
async function
|
|
1497
|
+
async function W(e) {
|
|
1496
1498
|
const t = await e.json();
|
|
1497
1499
|
if (!e.ok) throw new Error(t.error ?? `Pygmalion request failed (${e.status})`);
|
|
1498
1500
|
return t;
|
|
1499
1501
|
}
|
|
1500
|
-
function
|
|
1501
|
-
var
|
|
1502
|
+
function hn(e = {}) {
|
|
1503
|
+
var X, x, q, i, d;
|
|
1502
1504
|
const {
|
|
1503
1505
|
sessionId: t,
|
|
1504
|
-
sessionStorageKey:
|
|
1505
|
-
autoStart:
|
|
1506
|
-
fetcher:
|
|
1507
|
-
formatApplyMessage:
|
|
1508
|
-
} = e, a = ((
|
|
1509
|
-
() => JSON.parse(
|
|
1510
|
-
[
|
|
1511
|
-
),
|
|
1512
|
-
() =>
|
|
1513
|
-
[t,
|
|
1506
|
+
sessionStorageKey: s = en,
|
|
1507
|
+
autoStart: n = !0,
|
|
1508
|
+
fetcher: r = fetch,
|
|
1509
|
+
formatApplyMessage: o
|
|
1510
|
+
} = e, a = ((X = e.endpoints) == null ? void 0 : X.mirror) ?? be.mirror, c = ((x = e.endpoints) == null ? void 0 : x.sessions) ?? be.sessions, u = ((q = e.endpoints) == null ? void 0 : q.inspect) ?? be.inspect, g = e.visualQa != null, h = ((i = e.visualQa) == null ? void 0 : i.endpoint) ?? tn, w = JSON.stringify(((d = e.visualQa) == null ? void 0 : d.eligibleFrameIds) ?? []), y = de(
|
|
1511
|
+
() => JSON.parse(w),
|
|
1512
|
+
[w]
|
|
1513
|
+
), I = de(
|
|
1514
|
+
() => nn(t, s),
|
|
1515
|
+
[t, s]
|
|
1514
1516
|
), [b, A] = re({
|
|
1515
1517
|
state: "idle",
|
|
1516
1518
|
commit: null,
|
|
@@ -1521,106 +1523,106 @@ function un(e = {}) {
|
|
|
1521
1523
|
warning: null,
|
|
1522
1524
|
error: null,
|
|
1523
1525
|
appOrigin: null
|
|
1524
|
-
}), [
|
|
1526
|
+
}), [m, k] = re(null), [M, D] = re(null), [z, j] = re({
|
|
1525
1527
|
refs: [],
|
|
1526
1528
|
defaultRef: null,
|
|
1527
1529
|
worktreeRef: null
|
|
1528
|
-
}),
|
|
1530
|
+
}), S = ve(null), R = ve(null), T = Z(
|
|
1529
1531
|
async (l = !0, f) => {
|
|
1530
|
-
if (f != null &&
|
|
1531
|
-
}),
|
|
1532
|
+
if (f != null && S.current && await S.current.catch(() => {
|
|
1533
|
+
}), S.current) return S.current;
|
|
1532
1534
|
const E = (async () => {
|
|
1533
|
-
A((
|
|
1535
|
+
A((C) => ({ ...C, state: "syncing", error: null }));
|
|
1534
1536
|
try {
|
|
1535
|
-
const
|
|
1536
|
-
let
|
|
1537
|
-
method: l ||
|
|
1538
|
-
...
|
|
1537
|
+
const C = f != null;
|
|
1538
|
+
let P = await r(`${a}/${l || C ? "refresh" : "status"}`, {
|
|
1539
|
+
method: l || C ? "POST" : "GET",
|
|
1540
|
+
...C ? {
|
|
1539
1541
|
headers: { "content-type": "application/json" },
|
|
1540
1542
|
body: JSON.stringify({ ref: f })
|
|
1541
1543
|
} : {}
|
|
1542
|
-
}),
|
|
1543
|
-
const
|
|
1544
|
-
for (; !l &&
|
|
1545
|
-
await new Promise((
|
|
1546
|
-
if (
|
|
1547
|
-
throw new Error(
|
|
1548
|
-
const
|
|
1549
|
-
await
|
|
1544
|
+
}), p = await W(P);
|
|
1545
|
+
const N = Date.now();
|
|
1546
|
+
for (; !l && p.state === "syncing" && Date.now() - N < 12e4; )
|
|
1547
|
+
await new Promise((K) => window.setTimeout(K, 500)), P = await r(`${a}/status`), p = await W(P);
|
|
1548
|
+
if (p.state !== "ready" || !p.appOrigin || !p.commit)
|
|
1549
|
+
throw new Error(p.error ?? "Pygmalion could not prepare the source preview");
|
|
1550
|
+
const O = await W(
|
|
1551
|
+
await r(`${c}/open`, {
|
|
1550
1552
|
method: "POST",
|
|
1551
1553
|
headers: { "content-type": "application/json" },
|
|
1552
|
-
body: JSON.stringify({ sessionId:
|
|
1554
|
+
body: JSON.stringify({ sessionId: I, baseDevSha: p.commit })
|
|
1553
1555
|
})
|
|
1554
1556
|
);
|
|
1555
|
-
if (!
|
|
1556
|
-
throw new Error(
|
|
1557
|
-
let
|
|
1558
|
-
if (
|
|
1559
|
-
const
|
|
1560
|
-
await
|
|
1557
|
+
if (!O.ok || !O.session)
|
|
1558
|
+
throw new Error(O.error ?? "Pygmalion could not open the design session");
|
|
1559
|
+
let F = O.session;
|
|
1560
|
+
if (F.branchName) {
|
|
1561
|
+
const K = await W(
|
|
1562
|
+
await r(`${c}/check`, {
|
|
1561
1563
|
method: "POST",
|
|
1562
1564
|
headers: { "content-type": "application/json" },
|
|
1563
|
-
body: JSON.stringify({ sessionId:
|
|
1565
|
+
body: JSON.stringify({ sessionId: F.id })
|
|
1564
1566
|
})
|
|
1565
1567
|
);
|
|
1566
|
-
if (!
|
|
1567
|
-
throw new Error(
|
|
1568
|
-
|
|
1568
|
+
if (!K.ok || !K.session)
|
|
1569
|
+
throw new Error(K.error ?? "Pygmalion could not check the design session");
|
|
1570
|
+
F = K.session;
|
|
1569
1571
|
}
|
|
1570
|
-
A(
|
|
1571
|
-
} catch (
|
|
1572
|
-
A((
|
|
1573
|
-
...
|
|
1572
|
+
A(p), k(F), D(F.appOrigin ?? p.appOrigin);
|
|
1573
|
+
} catch (C) {
|
|
1574
|
+
A((P) => ({
|
|
1575
|
+
...P,
|
|
1574
1576
|
state: "error",
|
|
1575
|
-
error:
|
|
1577
|
+
error: C instanceof Error ? C.message : String(C)
|
|
1576
1578
|
}));
|
|
1577
1579
|
}
|
|
1578
1580
|
})();
|
|
1579
|
-
|
|
1581
|
+
S.current = E;
|
|
1580
1582
|
try {
|
|
1581
1583
|
await E;
|
|
1582
1584
|
} finally {
|
|
1583
|
-
|
|
1585
|
+
S.current === E && (S.current = null);
|
|
1584
1586
|
}
|
|
1585
1587
|
},
|
|
1586
|
-
[
|
|
1587
|
-
),
|
|
1588
|
+
[r, a, c, I]
|
|
1589
|
+
), H = Z(async () => {
|
|
1588
1590
|
try {
|
|
1589
|
-
const l = await
|
|
1590
|
-
await
|
|
1591
|
+
const l = await W(
|
|
1592
|
+
await r(`${a}/refs`)
|
|
1591
1593
|
), f = {
|
|
1592
1594
|
refs: l.refs ?? [],
|
|
1593
1595
|
defaultRef: l.defaultRef ?? null,
|
|
1594
1596
|
worktreeRef: l.worktreeRef ?? null
|
|
1595
1597
|
};
|
|
1596
|
-
return
|
|
1598
|
+
return j(f), f;
|
|
1597
1599
|
} catch {
|
|
1598
|
-
return
|
|
1600
|
+
return z;
|
|
1599
1601
|
}
|
|
1600
|
-
}, [
|
|
1602
|
+
}, [r, a, z]), te = Z(
|
|
1601
1603
|
async (l, f) => {
|
|
1602
|
-
if (
|
|
1604
|
+
if (m != null && m.branchName && !(f != null && f.discardEdits))
|
|
1603
1605
|
throw new Error(
|
|
1604
1606
|
"This design session has unapplied edits against the current source. Apply or revert them, or pass discardEdits to switch anyway."
|
|
1605
1607
|
);
|
|
1606
|
-
await
|
|
1608
|
+
await T(!0, l);
|
|
1607
1609
|
},
|
|
1608
|
-
[
|
|
1609
|
-
),
|
|
1610
|
+
[T, m == null ? void 0 : m.branchName]
|
|
1611
|
+
), ne = Z(
|
|
1610
1612
|
async (l) => {
|
|
1611
|
-
var
|
|
1612
|
-
if (!
|
|
1613
|
-
const f =
|
|
1614
|
-
if (f && (f.sessionId !==
|
|
1613
|
+
var p;
|
|
1614
|
+
if (!m) throw new Error("Pygmalion design session is not ready");
|
|
1615
|
+
const f = R.current;
|
|
1616
|
+
if (f && (f.sessionId !== m.id || f.baseDevSha !== m.baseDevSha || f.revision !== m.revision || f.fingerprint !== JSON.stringify(l)))
|
|
1615
1617
|
throw new Error("The code diff you checked is out of date. Please check the diff for the current changes again.");
|
|
1616
|
-
const E = await
|
|
1617
|
-
await
|
|
1618
|
+
const E = await W(
|
|
1619
|
+
await r(`${c}/apply-visual`, {
|
|
1618
1620
|
method: "POST",
|
|
1619
1621
|
headers: { "content-type": "application/json" },
|
|
1620
1622
|
body: JSON.stringify({
|
|
1621
|
-
sessionId:
|
|
1622
|
-
baseDevSha:
|
|
1623
|
-
expectedRevision:
|
|
1623
|
+
sessionId: m.id,
|
|
1624
|
+
baseDevSha: m.baseDevSha,
|
|
1625
|
+
expectedRevision: m.revision,
|
|
1624
1626
|
...f ? { previewRevision: f.revision } : {},
|
|
1625
1627
|
changes: l
|
|
1626
1628
|
})
|
|
@@ -1628,97 +1630,97 @@ function un(e = {}) {
|
|
|
1628
1630
|
);
|
|
1629
1631
|
if (!E.ok || !E.session)
|
|
1630
1632
|
throw new Error(E.error ?? "Pygmalion could not apply the visual changes");
|
|
1631
|
-
k(E.session), E.session.appOrigin &&
|
|
1632
|
-
const
|
|
1633
|
-
let
|
|
1634
|
-
if (f != null && f.qaBaselineId && ((
|
|
1633
|
+
k(E.session), E.session.appOrigin && D(E.session.appOrigin);
|
|
1634
|
+
const C = E.applied ?? l.styles.length + l.texts.length + l.operations.length;
|
|
1635
|
+
let P;
|
|
1636
|
+
if (f != null && f.qaBaselineId && ((p = f.qaFrameIds) != null && p.length) && E.session.appOrigin)
|
|
1635
1637
|
try {
|
|
1636
|
-
|
|
1638
|
+
P = await Ue(r, h, {
|
|
1637
1639
|
phase: "changed",
|
|
1638
1640
|
baselineId: f.qaBaselineId,
|
|
1639
|
-
basePath:
|
|
1641
|
+
basePath: _e(E.session.appOrigin, window.location.origin),
|
|
1640
1642
|
frameIds: f.qaFrameIds
|
|
1641
1643
|
});
|
|
1642
|
-
} catch (
|
|
1643
|
-
const
|
|
1644
|
-
|
|
1644
|
+
} catch (N) {
|
|
1645
|
+
const O = N instanceof Error ? N.message : String(N);
|
|
1646
|
+
P = {
|
|
1645
1647
|
phase: "changed",
|
|
1646
1648
|
baselineId: f.qaBaselineId,
|
|
1647
1649
|
complete: !1,
|
|
1648
1650
|
frames: [],
|
|
1649
|
-
failures: f.qaFrameIds.map((
|
|
1651
|
+
failures: f.qaFrameIds.map((F) => ({ id: F, error: O }))
|
|
1650
1652
|
};
|
|
1651
1653
|
}
|
|
1652
|
-
return
|
|
1653
|
-
applied:
|
|
1654
|
+
return R.current = null, {
|
|
1655
|
+
applied: C,
|
|
1654
1656
|
branch: E.session.branchName ?? void 0,
|
|
1655
1657
|
integration: E.session.integration.state,
|
|
1656
|
-
message:
|
|
1657
|
-
...
|
|
1658
|
+
message: o == null ? void 0 : o(E.session, C),
|
|
1659
|
+
...P ? { qa: P } : {}
|
|
1658
1660
|
};
|
|
1659
1661
|
},
|
|
1660
|
-
[
|
|
1661
|
-
),
|
|
1662
|
+
[r, o, h, m, c]
|
|
1663
|
+
), Y = Z(
|
|
1662
1664
|
async (l) => {
|
|
1663
|
-
var
|
|
1664
|
-
if (!
|
|
1665
|
-
|
|
1666
|
-
const f = await
|
|
1667
|
-
await
|
|
1665
|
+
var p;
|
|
1666
|
+
if (!m) throw new Error("Pygmalion design session is not ready");
|
|
1667
|
+
R.current = null;
|
|
1668
|
+
const f = await W(
|
|
1669
|
+
await r(`${c}/preview-visual`, {
|
|
1668
1670
|
method: "POST",
|
|
1669
1671
|
headers: { "content-type": "application/json" },
|
|
1670
1672
|
body: JSON.stringify({
|
|
1671
|
-
sessionId:
|
|
1672
|
-
baseDevSha:
|
|
1673
|
-
expectedRevision:
|
|
1673
|
+
sessionId: m.id,
|
|
1674
|
+
baseDevSha: m.baseDevSha,
|
|
1675
|
+
expectedRevision: m.revision,
|
|
1674
1676
|
changes: l
|
|
1675
1677
|
})
|
|
1676
1678
|
})
|
|
1677
1679
|
);
|
|
1678
1680
|
if (!f.ok || !Number.isSafeInteger(f.revision))
|
|
1679
1681
|
throw new Error(f.error ?? "Pygmalion could not preview the visual changes");
|
|
1680
|
-
const E =
|
|
1681
|
-
let
|
|
1682
|
-
const
|
|
1682
|
+
const E = g ? Zt(l, y) : [];
|
|
1683
|
+
let C;
|
|
1684
|
+
const P = m.appOrigin ?? b.appOrigin;
|
|
1683
1685
|
if (E.length > 0) {
|
|
1684
|
-
if (!
|
|
1686
|
+
if (!P)
|
|
1685
1687
|
throw new Error("Impact screen QA baseline preview not ready");
|
|
1686
|
-
if (
|
|
1688
|
+
if (C = await Ue(r, h, {
|
|
1687
1689
|
phase: "baseline",
|
|
1688
|
-
basePath:
|
|
1690
|
+
basePath: _e(P, window.location.origin),
|
|
1689
1691
|
frameIds: E
|
|
1690
|
-
}), !
|
|
1692
|
+
}), !C.complete)
|
|
1691
1693
|
throw new Error(
|
|
1692
|
-
((
|
|
1694
|
+
((p = C.failures[0]) == null ? void 0 : p.error) ?? `Failed to capture ${E.length - C.frames.length} affected frames`
|
|
1693
1695
|
);
|
|
1694
1696
|
}
|
|
1695
|
-
return
|
|
1696
|
-
sessionId:
|
|
1697
|
-
baseDevSha:
|
|
1697
|
+
return R.current = {
|
|
1698
|
+
sessionId: m.id,
|
|
1699
|
+
baseDevSha: m.baseDevSha,
|
|
1698
1700
|
revision: f.revision,
|
|
1699
1701
|
fingerprint: JSON.stringify(l),
|
|
1700
|
-
...
|
|
1702
|
+
...C ? { qaBaselineId: C.baselineId, qaFrameIds: E } : {}
|
|
1701
1703
|
}, {
|
|
1702
1704
|
revision: f.revision,
|
|
1703
1705
|
files: Array.isArray(f.files) ? f.files : [],
|
|
1704
1706
|
affectedFiles: Array.isArray(f.affectedFiles) ? f.affectedFiles : [],
|
|
1705
|
-
...
|
|
1707
|
+
...C ? { qa: C } : {}
|
|
1706
1708
|
};
|
|
1707
1709
|
},
|
|
1708
1710
|
[
|
|
1709
|
-
|
|
1711
|
+
r,
|
|
1710
1712
|
b.appOrigin,
|
|
1711
|
-
|
|
1713
|
+
y,
|
|
1712
1714
|
h,
|
|
1713
|
-
|
|
1715
|
+
m,
|
|
1714
1716
|
c,
|
|
1715
|
-
|
|
1717
|
+
g
|
|
1716
1718
|
]
|
|
1717
|
-
),
|
|
1719
|
+
), Q = Z(
|
|
1718
1720
|
async (l) => {
|
|
1719
1721
|
if (l.length === 0) return { files: [] };
|
|
1720
|
-
const f = await
|
|
1721
|
-
await
|
|
1722
|
+
const f = await W(
|
|
1723
|
+
await r(`${u}/impact`, {
|
|
1722
1724
|
method: "POST",
|
|
1723
1725
|
headers: { "content-type": "application/json" },
|
|
1724
1726
|
body: JSON.stringify({ componentFiles: l })
|
|
@@ -1728,93 +1730,93 @@ function un(e = {}) {
|
|
|
1728
1730
|
throw new Error(f.error ?? "Pygmalion could not calculate source impact");
|
|
1729
1731
|
return { files: Array.isArray(f.files) ? f.files : [] };
|
|
1730
1732
|
},
|
|
1731
|
-
[
|
|
1732
|
-
),
|
|
1733
|
-
if (!(
|
|
1733
|
+
[r, u]
|
|
1734
|
+
), L = Z(async () => {
|
|
1735
|
+
if (!(m != null && m.canRevert) || !m.headSha)
|
|
1734
1736
|
throw new Error("There are no reversible changes applied");
|
|
1735
|
-
const l = await
|
|
1736
|
-
await
|
|
1737
|
+
const l = await W(
|
|
1738
|
+
await r(`${c}/revert-visual`, {
|
|
1737
1739
|
method: "POST",
|
|
1738
1740
|
headers: { "content-type": "application/json" },
|
|
1739
1741
|
body: JSON.stringify({
|
|
1740
|
-
sessionId:
|
|
1741
|
-
baseDevSha:
|
|
1742
|
-
expectedRevision:
|
|
1743
|
-
expectedHeadSha:
|
|
1742
|
+
sessionId: m.id,
|
|
1743
|
+
baseDevSha: m.baseDevSha,
|
|
1744
|
+
expectedRevision: m.revision,
|
|
1745
|
+
expectedHeadSha: m.headSha
|
|
1744
1746
|
})
|
|
1745
1747
|
})
|
|
1746
1748
|
);
|
|
1747
1749
|
if (!l.ok || l.reverted !== !0 || !l.operation || l.operation.kind !== "visual-revert" || !l.session)
|
|
1748
1750
|
throw new Error(l.error ?? "Pygmalion could not revert the last visual change");
|
|
1749
|
-
return
|
|
1751
|
+
return R.current = null, k(l.session), l.session.appOrigin && D(l.session.appOrigin), {
|
|
1750
1752
|
reverted: !0,
|
|
1751
1753
|
operation: l.operation,
|
|
1752
1754
|
session: l.session
|
|
1753
1755
|
};
|
|
1754
|
-
}, [
|
|
1756
|
+
}, [r, m, c]);
|
|
1755
1757
|
oe(() => {
|
|
1756
|
-
|
|
1757
|
-
}, [
|
|
1758
|
-
|
|
1759
|
-
}, [
|
|
1760
|
-
const
|
|
1758
|
+
n && T(!1);
|
|
1759
|
+
}, [n, T]), oe(() => {
|
|
1760
|
+
n && H();
|
|
1761
|
+
}, [n]);
|
|
1762
|
+
const V = (m == null ? void 0 : m.appOrigin) ?? b.appOrigin ?? M, _ = (m == null ? void 0 : m.headSha) ?? (m == null ? void 0 : m.baseDevSha) ?? b.commit ?? "pending";
|
|
1761
1763
|
return {
|
|
1762
1764
|
mirror: b,
|
|
1763
|
-
session:
|
|
1764
|
-
ready:
|
|
1765
|
-
appOrigin:
|
|
1766
|
-
previewRevision: `${
|
|
1767
|
-
previewSourceRevision:
|
|
1768
|
-
refresh:
|
|
1769
|
-
switchSource:
|
|
1770
|
-
sourceRefs:
|
|
1771
|
-
loadSourceRefs:
|
|
1772
|
-
previewVisual:
|
|
1773
|
-
inspectImpact:
|
|
1774
|
-
applyVisual:
|
|
1775
|
-
revertLastVisual:
|
|
1765
|
+
session: m,
|
|
1766
|
+
ready: M != null,
|
|
1767
|
+
appOrigin: V,
|
|
1768
|
+
previewRevision: `${_}:${(m == null ? void 0 : m.revision) ?? 0}`,
|
|
1769
|
+
previewSourceRevision: _,
|
|
1770
|
+
refresh: T,
|
|
1771
|
+
switchSource: te,
|
|
1772
|
+
sourceRefs: z,
|
|
1773
|
+
loadSourceRefs: H,
|
|
1774
|
+
previewVisual: Y,
|
|
1775
|
+
inspectImpact: Q,
|
|
1776
|
+
applyVisual: ne,
|
|
1777
|
+
revertLastVisual: L
|
|
1776
1778
|
};
|
|
1777
1779
|
}
|
|
1778
|
-
function
|
|
1780
|
+
function mn({
|
|
1779
1781
|
value: e,
|
|
1780
1782
|
refs: t,
|
|
1781
|
-
onChange:
|
|
1782
|
-
busy:
|
|
1783
|
-
defaultRef:
|
|
1784
|
-
worktreeRef:
|
|
1783
|
+
onChange: s,
|
|
1784
|
+
busy: n = !1,
|
|
1785
|
+
defaultRef: r = null,
|
|
1786
|
+
worktreeRef: o = null,
|
|
1785
1787
|
label: a = "Source revision",
|
|
1786
1788
|
children: c,
|
|
1787
1789
|
className: u
|
|
1788
1790
|
}) {
|
|
1789
|
-
const
|
|
1791
|
+
const g = de(
|
|
1790
1792
|
() => ({
|
|
1791
|
-
local: t.filter((
|
|
1792
|
-
remote: t.filter((
|
|
1793
|
+
local: t.filter((y) => y.kind === "local"),
|
|
1794
|
+
remote: t.filter((y) => y.kind === "remote")
|
|
1793
1795
|
}),
|
|
1794
1796
|
[t]
|
|
1795
|
-
), h =
|
|
1796
|
-
const
|
|
1797
|
-
return
|
|
1798
|
-
}, [
|
|
1799
|
-
return /* @__PURE__ */
|
|
1797
|
+
), h = de(() => {
|
|
1798
|
+
const y = new Set(t.map((I) => I.name));
|
|
1799
|
+
return r && y.add(r), o && y.add(o), y;
|
|
1800
|
+
}, [r, t, o]), w = e ?? r ?? "";
|
|
1801
|
+
return /* @__PURE__ */ $(
|
|
1800
1802
|
"span",
|
|
1801
1803
|
{
|
|
1802
1804
|
className: u,
|
|
1803
1805
|
"data-pygmalion-source-ref": "",
|
|
1804
|
-
"data-busy":
|
|
1806
|
+
"data-busy": n ? "" : void 0,
|
|
1805
1807
|
style: { position: "relative", display: "inline-flex", alignItems: "center" },
|
|
1806
1808
|
children: [
|
|
1807
|
-
c ?? /* @__PURE__ */
|
|
1808
|
-
/* @__PURE__ */
|
|
1809
|
+
c ?? /* @__PURE__ */ v("span", { "data-pygmalion-source-ref-value": "", children: w || a }),
|
|
1810
|
+
/* @__PURE__ */ $(
|
|
1809
1811
|
"select",
|
|
1810
1812
|
{
|
|
1811
|
-
value:
|
|
1812
|
-
disabled:
|
|
1813
|
+
value: w,
|
|
1814
|
+
disabled: n,
|
|
1813
1815
|
"aria-label": a,
|
|
1814
1816
|
"data-pygmalion-source-ref-select": "",
|
|
1815
|
-
onChange: (
|
|
1816
|
-
const
|
|
1817
|
-
|
|
1817
|
+
onChange: (y) => {
|
|
1818
|
+
const I = y.target.value;
|
|
1819
|
+
I && I !== w && s(I);
|
|
1818
1820
|
},
|
|
1819
1821
|
style: {
|
|
1820
1822
|
position: "absolute",
|
|
@@ -1822,7 +1824,7 @@ function fn({
|
|
|
1822
1824
|
width: "100%",
|
|
1823
1825
|
height: "100%",
|
|
1824
1826
|
opacity: 0,
|
|
1825
|
-
cursor:
|
|
1827
|
+
cursor: n ? "default" : "pointer",
|
|
1826
1828
|
// The native menu stays reachable; only the painted trigger is the host's.
|
|
1827
1829
|
appearance: "none",
|
|
1828
1830
|
border: 0,
|
|
@@ -1830,21 +1832,21 @@ function fn({
|
|
|
1830
1832
|
margin: 0
|
|
1831
1833
|
},
|
|
1832
1834
|
children: [
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1835
|
+
w && !h.has(w) ? /* @__PURE__ */ v("option", { value: w, children: w }) : null,
|
|
1836
|
+
o ? /* @__PURE__ */ $("option", { value: o, children: [
|
|
1837
|
+
o,
|
|
1836
1838
|
" · uncommitted work"
|
|
1837
1839
|
] }) : null,
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
+
g.local.length > 0 ? /* @__PURE__ */ v("optgroup", { label: "local", children: g.local.map((y) => /* @__PURE__ */ $("option", { value: y.name, children: [
|
|
1841
|
+
y.name,
|
|
1840
1842
|
" · ",
|
|
1841
|
-
|
|
1842
|
-
] },
|
|
1843
|
-
|
|
1844
|
-
|
|
1843
|
+
y.commit
|
|
1844
|
+
] }, y.fullName)) }) : null,
|
|
1845
|
+
g.remote.length > 0 ? /* @__PURE__ */ v("optgroup", { label: "remote", children: g.remote.map((y) => /* @__PURE__ */ $("option", { value: y.name, children: [
|
|
1846
|
+
y.name,
|
|
1845
1847
|
" · ",
|
|
1846
|
-
|
|
1847
|
-
] },
|
|
1848
|
+
y.commit
|
|
1849
|
+
] }, y.fullName)) }) : null
|
|
1848
1850
|
]
|
|
1849
1851
|
}
|
|
1850
1852
|
)
|
|
@@ -1852,263 +1854,264 @@ function fn({
|
|
|
1852
1854
|
}
|
|
1853
1855
|
);
|
|
1854
1856
|
}
|
|
1855
|
-
const
|
|
1856
|
-
editor:
|
|
1857
|
-
getObserverTree:
|
|
1858
|
-
isObservableProp:
|
|
1857
|
+
const pn = {
|
|
1858
|
+
editor: J,
|
|
1859
|
+
getObserverTree: Ye,
|
|
1860
|
+
isObservableProp: Xe
|
|
1859
1861
|
};
|
|
1860
|
-
function
|
|
1861
|
-
|
|
1862
|
+
function gn(e) {
|
|
1863
|
+
J.navigateToPageByName(e);
|
|
1862
1864
|
}
|
|
1863
|
-
function
|
|
1864
|
-
|
|
1865
|
+
function yn() {
|
|
1866
|
+
J.openPreview();
|
|
1865
1867
|
}
|
|
1866
|
-
function
|
|
1867
|
-
const e =
|
|
1868
|
-
return e &&
|
|
1868
|
+
function wn() {
|
|
1869
|
+
const e = Oe.entries.length > 0;
|
|
1870
|
+
return e && Oe.discardPending(), J.resetCurrentEdits() || e;
|
|
1869
1871
|
}
|
|
1870
|
-
function
|
|
1872
|
+
function bn({
|
|
1871
1873
|
registry: e,
|
|
1872
1874
|
tokens: t,
|
|
1873
|
-
initialPages:
|
|
1874
|
-
viewportPresets:
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1875
|
+
initialPages: s,
|
|
1876
|
+
viewportPresets: n,
|
|
1877
|
+
previewEnvironmentControls: r,
|
|
1878
|
+
designImport: o,
|
|
1879
|
+
onTokensChange: a,
|
|
1880
|
+
appOrigin: c,
|
|
1881
|
+
previewRevision: u,
|
|
1882
|
+
previewCacheNamespace: g,
|
|
1883
|
+
previewArtifacts: h,
|
|
1884
|
+
previewArtifactEndpoint: w,
|
|
1885
|
+
previewConcurrency: y,
|
|
1886
|
+
previewOpen: I,
|
|
1887
|
+
onPreviewOpenChange: b,
|
|
1888
|
+
flowCanvas: A,
|
|
1889
|
+
onApply: m,
|
|
1890
|
+
onDesignChange: k,
|
|
1891
|
+
onInspectApply: M,
|
|
1892
|
+
onInspectPreview: D,
|
|
1890
1893
|
onInspectImpact: z,
|
|
1891
|
-
storyboardDiscovery:
|
|
1892
|
-
storyboardDiscoveryEndpoint:
|
|
1894
|
+
storyboardDiscovery: j = !0,
|
|
1895
|
+
storyboardDiscoveryEndpoint: S = mt
|
|
1893
1896
|
}) {
|
|
1894
|
-
const [
|
|
1895
|
-
|
|
1896
|
-
const
|
|
1897
|
-
|
|
1898
|
-
const
|
|
1899
|
-
(
|
|
1897
|
+
const [R, T] = re(!j), [H, te] = re();
|
|
1898
|
+
o && (o.assertComplete(), Ze(o));
|
|
1899
|
+
const ne = e ?? (o == null ? void 0 : o.getRegistry()), Y = t ?? (o == null ? void 0 : o.getTokens()), Q = s ?? (o == null ? void 0 : o.getInitialPages());
|
|
1900
|
+
ne && et(ne), Y && tt(Y), n && nt(n), rt(r ?? []), yt(a ?? null), c != null && ot(c), u != null && st(u), it(g);
|
|
1901
|
+
const L = H ?? h, V = (Q ?? []).flatMap(
|
|
1902
|
+
(x) => x.route && x.importPageId ? [
|
|
1900
1903
|
{
|
|
1901
|
-
canonicalId:
|
|
1902
|
-
route:
|
|
1903
|
-
width:
|
|
1904
|
-
height:
|
|
1905
|
-
environment:
|
|
1906
|
-
preset:
|
|
1907
|
-
interactions:
|
|
1908
|
-
assertions:
|
|
1904
|
+
canonicalId: x.importPageId,
|
|
1905
|
+
route: x.route,
|
|
1906
|
+
width: x.width,
|
|
1907
|
+
height: x.height,
|
|
1908
|
+
environment: x.environment,
|
|
1909
|
+
preset: x.preset,
|
|
1910
|
+
interactions: x.interactions,
|
|
1911
|
+
assertions: x.assertions
|
|
1909
1912
|
}
|
|
1910
1913
|
] : []
|
|
1911
|
-
),
|
|
1912
|
-
id:
|
|
1913
|
-
fingerprint:
|
|
1914
|
-
|
|
1914
|
+
), _ = ve([]), X = V.map((x) => ({
|
|
1915
|
+
id: x.canonicalId,
|
|
1916
|
+
fingerprint: at(
|
|
1917
|
+
x,
|
|
1915
1918
|
Re(),
|
|
1916
1919
|
ge()
|
|
1917
1920
|
)
|
|
1918
1921
|
}));
|
|
1919
|
-
return
|
|
1920
|
-
namespace:
|
|
1922
|
+
return _.current = X, L && Q && R && Ne(L, {
|
|
1923
|
+
namespace: g ?? "",
|
|
1921
1924
|
previewRevision: Re(),
|
|
1922
|
-
appOrigin:
|
|
1925
|
+
appOrigin: Me(),
|
|
1923
1926
|
baselineEnvironment: ge(),
|
|
1924
|
-
allowStaleIdentity: !!
|
|
1925
|
-
allowMatchingFrameIdentity:
|
|
1926
|
-
pages:
|
|
1927
|
-
var
|
|
1927
|
+
allowStaleIdentity: !!w,
|
|
1928
|
+
allowMatchingFrameIdentity: H != null,
|
|
1929
|
+
pages: V.map((x, q) => {
|
|
1930
|
+
var i;
|
|
1928
1931
|
return {
|
|
1929
|
-
...
|
|
1930
|
-
fingerprint: (
|
|
1932
|
+
...x,
|
|
1933
|
+
fingerprint: (i = X[q]) == null ? void 0 : i.fingerprint
|
|
1931
1934
|
};
|
|
1932
1935
|
})
|
|
1933
|
-
}),
|
|
1934
|
-
|
|
1935
|
-
const
|
|
1936
|
+
}), y != null && ct(y), wt(b ?? null), A != null && lt(A), bt(m ?? null), vt(M ?? null), dt(D ?? null), St(z ?? null), Q && J.initPagesFromComponents(Q), oe(() => {
|
|
1937
|
+
ke(k ?? null);
|
|
1938
|
+
const x = ut(J);
|
|
1936
1939
|
return () => {
|
|
1937
|
-
|
|
1940
|
+
x(), ke(null);
|
|
1938
1941
|
};
|
|
1939
|
-
}, [
|
|
1940
|
-
if (
|
|
1942
|
+
}, [k]), oe(() => {
|
|
1943
|
+
if (te(void 0), !R || !w || !(g != null && g.trim()) || !(u != null && u.trim()))
|
|
1941
1944
|
return;
|
|
1942
|
-
const
|
|
1943
|
-
endpoint:
|
|
1944
|
-
captureBaseUrl:
|
|
1945
|
-
}),
|
|
1946
|
-
|
|
1947
|
-
namespace:
|
|
1948
|
-
previewRevision:
|
|
1949
|
-
appOrigin:
|
|
1945
|
+
const x = new AbortController(), q = ft({
|
|
1946
|
+
endpoint: w,
|
|
1947
|
+
captureBaseUrl: c
|
|
1948
|
+
}), i = ht(u), d = (P) => {
|
|
1949
|
+
Ne(P, {
|
|
1950
|
+
namespace: g,
|
|
1951
|
+
previewRevision: u,
|
|
1952
|
+
appOrigin: Me(),
|
|
1950
1953
|
baselineEnvironment: ge(),
|
|
1951
1954
|
allowStaleIdentity: !0,
|
|
1952
1955
|
allowMatchingFrameIdentity: !0,
|
|
1953
|
-
pages:
|
|
1954
|
-
var
|
|
1956
|
+
pages: V.map((p, N) => {
|
|
1957
|
+
var O;
|
|
1955
1958
|
return {
|
|
1956
|
-
...
|
|
1957
|
-
fingerprint: (
|
|
1959
|
+
...p,
|
|
1960
|
+
fingerprint: (O = X[N]) == null ? void 0 : O.fingerprint
|
|
1958
1961
|
};
|
|
1959
1962
|
})
|
|
1960
|
-
}),
|
|
1961
|
-
},
|
|
1962
|
-
namespace:
|
|
1963
|
-
sourceRevision:
|
|
1964
|
-
transport:
|
|
1965
|
-
signal:
|
|
1966
|
-
...
|
|
1967
|
-
...
|
|
1968
|
-
}),
|
|
1969
|
-
const
|
|
1970
|
-
return
|
|
1971
|
-
},
|
|
1972
|
-
if (
|
|
1973
|
-
var
|
|
1974
|
-
const
|
|
1975
|
-
if (
|
|
1976
|
-
|
|
1977
|
-
const
|
|
1978
|
-
if (
|
|
1963
|
+
}), te(P);
|
|
1964
|
+
}, l = (P, p, N) => gt({
|
|
1965
|
+
namespace: g,
|
|
1966
|
+
sourceRevision: i,
|
|
1967
|
+
transport: q,
|
|
1968
|
+
signal: N,
|
|
1969
|
+
...P.length ? { frames: P } : {},
|
|
1970
|
+
...p ? {} : { generate: !1 }
|
|
1971
|
+
}), f = (P, p) => {
|
|
1972
|
+
const N = new Set(p);
|
|
1973
|
+
return P.filter((O) => N.has(O.id));
|
|
1974
|
+
}, E = (P, p) => P instanceof Error && P.message ? P.message : p, C = new AbortController();
|
|
1975
|
+
if (Ae(async (P) => {
|
|
1976
|
+
var N, O, F;
|
|
1977
|
+
const p = await l(P, !0, C.signal);
|
|
1978
|
+
if (p.status === "accepted") {
|
|
1979
|
+
d(p.artifact);
|
|
1980
|
+
const K = new Set(((N = p.frameResolution) == null ? void 0 : N.exact) ?? []);
|
|
1981
|
+
if (P.every((ie) => K.has(ie.id)))
|
|
1979
1982
|
return { status: "accepted" };
|
|
1980
|
-
const
|
|
1981
|
-
...((
|
|
1982
|
-
...((F =
|
|
1983
|
+
const se = [
|
|
1984
|
+
...((O = p.frameResolution) == null ? void 0 : O.missing) ?? [],
|
|
1985
|
+
...((F = p.frameResolution) == null ? void 0 : F.stale) ?? []
|
|
1983
1986
|
];
|
|
1984
1987
|
return {
|
|
1985
1988
|
status: "unavailable",
|
|
1986
|
-
message:
|
|
1989
|
+
message: se.length ? `The exact preview endpoint did not return a current capture for ${se.join(", ")}.` : "The exact preview endpoint returned no current capture."
|
|
1987
1990
|
};
|
|
1988
1991
|
}
|
|
1989
|
-
return
|
|
1992
|
+
return p.status === "rejected" ? {
|
|
1990
1993
|
status: "rejected",
|
|
1991
|
-
message:
|
|
1994
|
+
message: p.errors.join(" ") || "The preview artifact was rejected."
|
|
1992
1995
|
} : {
|
|
1993
1996
|
status: "unavailable",
|
|
1994
|
-
message:
|
|
1995
|
-
|
|
1997
|
+
message: E(
|
|
1998
|
+
p.error,
|
|
1996
1999
|
"The exact preview endpoint is unavailable."
|
|
1997
2000
|
)
|
|
1998
2001
|
};
|
|
1999
|
-
}),
|
|
2000
|
-
const
|
|
2001
|
-
const
|
|
2002
|
-
|
|
2003
|
-
|
|
2002
|
+
}), _.current.length) {
|
|
2003
|
+
const P = _.current.filter((p) => {
|
|
2004
|
+
const N = ye(
|
|
2005
|
+
p.id,
|
|
2006
|
+
p.fingerprint
|
|
2004
2007
|
).status;
|
|
2005
|
-
return
|
|
2008
|
+
return N !== "exact" && N !== "generating";
|
|
2006
2009
|
});
|
|
2007
|
-
|
|
2008
|
-
|
|
2010
|
+
ae(P, { status: "checking" }), l(
|
|
2011
|
+
_.current,
|
|
2009
2012
|
!1,
|
|
2010
|
-
|
|
2011
|
-
).then((
|
|
2012
|
-
var F,
|
|
2013
|
-
if (
|
|
2014
|
-
const
|
|
2015
|
-
const
|
|
2016
|
-
|
|
2017
|
-
|
|
2013
|
+
x.signal
|
|
2014
|
+
).then((p) => {
|
|
2015
|
+
var F, K, se;
|
|
2016
|
+
if (x.signal.aborted) return;
|
|
2017
|
+
const N = (ie) => ie.filter((Ee) => {
|
|
2018
|
+
const Ce = ye(
|
|
2019
|
+
Ee.id,
|
|
2020
|
+
Ee.fingerprint
|
|
2018
2021
|
).status;
|
|
2019
|
-
return
|
|
2022
|
+
return Ce !== "generating" && Ce !== "exact";
|
|
2020
2023
|
});
|
|
2021
|
-
if (
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
((F =
|
|
2024
|
+
if (p.status === "accepted") {
|
|
2025
|
+
d(p.artifact), ae(
|
|
2026
|
+
f(
|
|
2027
|
+
_.current,
|
|
2028
|
+
((F = p.frameResolution) == null ? void 0 : F.exact) ?? []
|
|
2026
2029
|
),
|
|
2027
2030
|
{ status: "exact" }
|
|
2028
2031
|
);
|
|
2029
|
-
const
|
|
2030
|
-
...((
|
|
2031
|
-
...((
|
|
2032
|
+
const ie = f(_.current, [
|
|
2033
|
+
...((K = p.frameResolution) == null ? void 0 : K.missing) ?? [],
|
|
2034
|
+
...((se = p.frameResolution) == null ? void 0 : se.stale) ?? []
|
|
2032
2035
|
]);
|
|
2033
|
-
|
|
2036
|
+
ae(N(ie), {
|
|
2034
2037
|
status: "outdated",
|
|
2035
2038
|
message: "Select this frame to generate the exact preview."
|
|
2036
2039
|
});
|
|
2037
2040
|
return;
|
|
2038
2041
|
}
|
|
2039
|
-
const
|
|
2040
|
-
|
|
2042
|
+
const O = p.status === "rejected" ? p.errors.join(" ") || "The preview artifact was rejected." : E(
|
|
2043
|
+
p.error,
|
|
2041
2044
|
"The exact preview endpoint is unavailable."
|
|
2042
2045
|
);
|
|
2043
|
-
|
|
2044
|
-
|
|
2046
|
+
ae(
|
|
2047
|
+
N(_.current),
|
|
2045
2048
|
{
|
|
2046
2049
|
status: "error",
|
|
2047
|
-
reason:
|
|
2048
|
-
message:
|
|
2050
|
+
reason: p.status === "rejected" ? "rejected" : "unavailable",
|
|
2051
|
+
message: O
|
|
2049
2052
|
}
|
|
2050
2053
|
);
|
|
2051
|
-
}).catch((
|
|
2052
|
-
if (
|
|
2053
|
-
const
|
|
2054
|
-
const F =
|
|
2055
|
-
|
|
2056
|
-
|
|
2054
|
+
}).catch((p) => {
|
|
2055
|
+
if (x.signal.aborted) return;
|
|
2056
|
+
const N = _.current.filter((O) => {
|
|
2057
|
+
const F = ye(
|
|
2058
|
+
O.id,
|
|
2059
|
+
O.fingerprint
|
|
2057
2060
|
).status;
|
|
2058
2061
|
return F !== "generating" && F !== "exact";
|
|
2059
2062
|
});
|
|
2060
|
-
|
|
2063
|
+
ae(N, {
|
|
2061
2064
|
status: "error",
|
|
2062
2065
|
reason: "unavailable",
|
|
2063
|
-
message:
|
|
2064
|
-
|
|
2066
|
+
message: E(
|
|
2067
|
+
p,
|
|
2065
2068
|
"The exact preview endpoint is unavailable."
|
|
2066
2069
|
)
|
|
2067
2070
|
});
|
|
2068
2071
|
});
|
|
2069
2072
|
}
|
|
2070
2073
|
return () => {
|
|
2071
|
-
|
|
2074
|
+
Ae(null), C.abort(), x.abort();
|
|
2072
2075
|
};
|
|
2073
2076
|
}, [
|
|
2074
|
-
|
|
2077
|
+
w,
|
|
2078
|
+
g,
|
|
2075
2079
|
u,
|
|
2076
2080
|
c,
|
|
2077
|
-
|
|
2078
|
-
x
|
|
2081
|
+
R
|
|
2079
2082
|
]), oe(() => {
|
|
2080
|
-
let
|
|
2081
|
-
if (!
|
|
2082
|
-
return
|
|
2083
|
-
|
|
2083
|
+
let x = !0;
|
|
2084
|
+
if (!j)
|
|
2085
|
+
return ce(void 0), T(!0), () => {
|
|
2086
|
+
x = !1;
|
|
2084
2087
|
};
|
|
2085
|
-
const
|
|
2086
|
-
return
|
|
2087
|
-
endpoint:
|
|
2088
|
-
signal:
|
|
2089
|
-
pages:
|
|
2090
|
-
...
|
|
2091
|
-
id:
|
|
2092
|
-
importKind:
|
|
2088
|
+
const q = new AbortController();
|
|
2089
|
+
return T(!1), ce(void 0), ee(null), Je({
|
|
2090
|
+
endpoint: S,
|
|
2091
|
+
signal: q.signal,
|
|
2092
|
+
pages: J.pages.map((i) => ({
|
|
2093
|
+
...i,
|
|
2094
|
+
id: i.importPageId ?? i.id,
|
|
2095
|
+
importKind: i.importKind
|
|
2093
2096
|
})),
|
|
2094
|
-
assets: (
|
|
2095
|
-
}).then((
|
|
2096
|
-
|
|
2097
|
+
assets: (o == null ? void 0 : o.getAssets("screens")) ?? []
|
|
2098
|
+
}).then((i) => {
|
|
2099
|
+
x && (ce(i.baselineEnvironment), $e(i.manifest.routes ?? null), ee(i.graph));
|
|
2097
2100
|
}).catch(() => {
|
|
2098
|
-
|
|
2101
|
+
x && (ce(void 0), $e(null), ee(null));
|
|
2099
2102
|
}).finally(() => {
|
|
2100
|
-
|
|
2103
|
+
x && T(!0);
|
|
2101
2104
|
}), () => {
|
|
2102
|
-
|
|
2105
|
+
x = !1, q.abort(), ce(void 0), ee(null);
|
|
2103
2106
|
};
|
|
2104
2107
|
}, [
|
|
2105
|
-
n,
|
|
2106
2108
|
o,
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
+
s,
|
|
2110
|
+
j,
|
|
2111
|
+
S
|
|
2109
2112
|
]), oe(() => {
|
|
2110
|
-
|
|
2111
|
-
}, [
|
|
2113
|
+
I == null || I === J.previewOpen || (I ? J.openPreview({ notifyHost: !1 }) : J.closePreview({ notifyHost: !1 }));
|
|
2114
|
+
}, [I]), R ? /* @__PURE__ */ v(pt, {}) : /* @__PURE__ */ v(
|
|
2112
2115
|
"div",
|
|
2113
2116
|
{
|
|
2114
2117
|
"data-pygmalion-storyboard-loading": "",
|
|
@@ -2127,64 +2130,71 @@ function yn({
|
|
|
2127
2130
|
);
|
|
2128
2131
|
}
|
|
2129
2132
|
export {
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2133
|
+
In as DESIGN_IMPORT_KINDS,
|
|
2134
|
+
cn as PygmalionCatalogDocument,
|
|
2135
|
+
dn as PygmalionCatalogMatrix,
|
|
2136
|
+
ln as PygmalionCatalogSection,
|
|
2137
|
+
bn as PygmalionEditor,
|
|
2138
|
+
mt as STORYBOARD_ENVIRONMENT_CONTROL,
|
|
2139
|
+
xn as STORYBOARD_ENVIRONMENT_QUERY,
|
|
2140
|
+
mn as SourceRefControl,
|
|
2141
|
+
pn as __debug,
|
|
2142
|
+
Pn as applyTokenOverride,
|
|
2143
|
+
gt as bootstrapPreviewArtifact,
|
|
2144
|
+
En as clearPreviewEnvironmentControlValues,
|
|
2145
|
+
Cn as clearPygmalionPreviewCache,
|
|
2146
|
+
fn as createDesignComponentCatalog,
|
|
2147
|
+
Jt as createDesignComponentVariantMatrix,
|
|
2148
|
+
un as createDesignGalleryCatalog,
|
|
2149
|
+
Rn as createDesignImportController,
|
|
2150
|
+
Nn as createDesignScreenCollection,
|
|
2151
|
+
ft as createPreviewArtifactHttpTransport,
|
|
2152
|
+
An as createPreviewCacheNamespace,
|
|
2153
|
+
$n as createPreviewFrameFingerprint,
|
|
2154
|
+
On as createPreviewRecipeFingerprint,
|
|
2155
|
+
Mn as createStoryboardCaptureRecipeIdentity,
|
|
2156
|
+
Et as createStoryboardGraph,
|
|
2157
|
+
Bt as createStoryboardGraphFromDiscovery,
|
|
2158
|
+
kn as createStoryboardGraphViewModel,
|
|
2159
|
+
Fn as createStoryboardRouteUrl,
|
|
2160
|
+
qt as designCatalogKey,
|
|
2161
|
+
Ve as designCatalogRegistryName,
|
|
2162
|
+
Tn as expandDesignScreenCasesViewports,
|
|
2163
|
+
Dn as expandDesignScreenCollectionViewports,
|
|
2164
|
+
zn as getPreviewEnvironmentControlValue,
|
|
2165
|
+
jn as getPreviewEnvironmentControls,
|
|
2166
|
+
_n as getPreviewEnvironmentOverride,
|
|
2167
|
+
Bn as getRecommendedPygmalionPreviewConcurrency,
|
|
2161
2168
|
ge as getStoryboardBaselineEnvironment,
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2169
|
+
Ge as getStoryboardDiscoveryBaselineEnvironment,
|
|
2170
|
+
Un as getStoryboardGraph,
|
|
2171
|
+
Hn as getViewportPresets,
|
|
2172
|
+
Je as loadStoryboardDiscovery,
|
|
2173
|
+
qn as mergeScreenPresets,
|
|
2174
|
+
Le as mergeStoryboardEnvironment,
|
|
2175
|
+
an as publishStoryboardDiscovery,
|
|
2176
|
+
gn as pygmalionNavigate,
|
|
2177
|
+
yn as pygmalionOpenPreview,
|
|
2178
|
+
wn as pygmalionResetCurrentEdits,
|
|
2179
|
+
Kn as reconstructRoutePreviewArtifactScreenshotV3,
|
|
2180
|
+
Gn as reconstructRoutePreviewArtifactSnapshotV3,
|
|
2181
|
+
Jn as resetTokenOverrides,
|
|
2182
|
+
Vn as resolvePreviewArtifactFrames,
|
|
2183
|
+
Ot as resolveStoryboardScreenCases,
|
|
2184
|
+
et as setComponentRegistry,
|
|
2185
|
+
Wn as setPreviewEnvironmentControlValue,
|
|
2186
|
+
rt as setPreviewEnvironmentControls,
|
|
2187
|
+
ot as setPygmalionAppOrigin,
|
|
2188
|
+
ct as setPygmalionPreviewConcurrency,
|
|
2189
|
+
st as setPygmalionPreviewRevision,
|
|
2190
|
+
ce as setStoryboardBaselineEnvironment,
|
|
2191
|
+
ee as setStoryboardGraph,
|
|
2192
|
+
tt as setTokens,
|
|
2193
|
+
nt as setViewportPresets,
|
|
2194
|
+
It as storyboardScreenRecipeKey,
|
|
2195
|
+
Qn as subscribePreviewEnvironmentControls,
|
|
2196
|
+
Ln as subscribeStoryboardGraph,
|
|
2197
|
+
hn as usePygmalionProject,
|
|
2198
|
+
Xn as validatePreviewArtifactBundle,
|
|
2199
|
+
Yn as validateRoutePreviewArtifactV3Browser
|
|
2190
2200
|
};
|