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