@popcorn245/cornfield-components 0.48.0 → 0.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/_corn-default-tokens-BpIL6q5N.js +4110 -0
- package/dist/chunks/corn-map-CMNEW1lH.js +2703 -0
- package/dist/chunks/rolldown-runtime-CGnMp29N.js +10 -0
- package/dist/chunks/runtime-DFu6W5g-.js +2186 -0
- package/dist/chunks/scope-CmIkJ1qf.js +847 -0
- package/dist/corn-map.js +1 -1
- package/dist/corn-scope.js +83 -0
- package/dist/index.js +4 -3
- package/dist/manifest.json +42 -17
- package/dist/tokens.css +4 -2
- package/dist/types/components.d.ts +78 -0
- package/dist/types/corn-scope.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/version.json +1 -1
- package/package.json +5 -1
- package/dist/chunks/corn-map-D6uJOnYp.js +0 -6391
- package/dist/chunks/runtime-D89gVy_w.js +0 -2192
|
@@ -0,0 +1,4110 @@
|
|
|
1
|
+
// ../explorer/instance-state.js
|
|
2
|
+
function e() {
|
|
3
|
+
return {
|
|
4
|
+
canvas: null,
|
|
5
|
+
ctx: null,
|
|
6
|
+
labelCanvas: null,
|
|
7
|
+
width: 0,
|
|
8
|
+
height: 0,
|
|
9
|
+
coveredBottom: 0,
|
|
10
|
+
nodes: [],
|
|
11
|
+
edges: [],
|
|
12
|
+
view: "orbit",
|
|
13
|
+
flow: null,
|
|
14
|
+
rings: {
|
|
15
|
+
rings: [],
|
|
16
|
+
clusters: []
|
|
17
|
+
},
|
|
18
|
+
theme: "dark",
|
|
19
|
+
camera: {
|
|
20
|
+
x: 0,
|
|
21
|
+
y: 0,
|
|
22
|
+
zoom: 1
|
|
23
|
+
},
|
|
24
|
+
selectedNode: null,
|
|
25
|
+
throughChildren: !1,
|
|
26
|
+
selectedKind: null,
|
|
27
|
+
forge: null,
|
|
28
|
+
searchQuery: "",
|
|
29
|
+
searchCurrent: null,
|
|
30
|
+
hoverNodeId: null,
|
|
31
|
+
isFreeform: !1,
|
|
32
|
+
freeformPositions: {},
|
|
33
|
+
activeLayers: {
|
|
34
|
+
app: !0,
|
|
35
|
+
pkg: !0,
|
|
36
|
+
page: !0,
|
|
37
|
+
atom: !0,
|
|
38
|
+
molecule: !0,
|
|
39
|
+
token: !0,
|
|
40
|
+
tool: !0,
|
|
41
|
+
flow: !0,
|
|
42
|
+
table: !0,
|
|
43
|
+
rom: !0,
|
|
44
|
+
service: !0,
|
|
45
|
+
cloud: !0,
|
|
46
|
+
web: !0,
|
|
47
|
+
stack: !1,
|
|
48
|
+
machine: !1,
|
|
49
|
+
container: !1,
|
|
50
|
+
device: !1,
|
|
51
|
+
house: !1,
|
|
52
|
+
persona: !1
|
|
53
|
+
},
|
|
54
|
+
projectLayers: [],
|
|
55
|
+
layerOrder: [],
|
|
56
|
+
layerDefaults: {},
|
|
57
|
+
review: null,
|
|
58
|
+
mapNodes: [],
|
|
59
|
+
mapEdges: [],
|
|
60
|
+
live: null,
|
|
61
|
+
house: null,
|
|
62
|
+
baseNodes: [],
|
|
63
|
+
baseEdges: [],
|
|
64
|
+
proposal: null,
|
|
65
|
+
proposalView: "diff",
|
|
66
|
+
proposalSource: null,
|
|
67
|
+
proposalSha256: null,
|
|
68
|
+
proposalSlug: null,
|
|
69
|
+
proposalErrors: [],
|
|
70
|
+
mockupStates: {},
|
|
71
|
+
effectiveProposal: null,
|
|
72
|
+
whatIf: {
|
|
73
|
+
edits: [],
|
|
74
|
+
undone: []
|
|
75
|
+
},
|
|
76
|
+
whatIfOff: !1,
|
|
77
|
+
selectedEdge: null,
|
|
78
|
+
scenario: null,
|
|
79
|
+
forgeLit: null,
|
|
80
|
+
runsMap: null,
|
|
81
|
+
threadIndex: null,
|
|
82
|
+
sceneVersion: 0
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
// ../explorer/instance.js
|
|
86
|
+
var t = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
|
|
87
|
+
function n({ root: n = null, base: r = "", fetch: i, strings: a = {}, state: o } = {}) {
|
|
88
|
+
let s = n, c = s ? s.nodeType === 9 ? s : s.ownerDocument : null, l = c ? c.defaultView : null, u = /* @__PURE__ */ new Map(), d = [], f = /* @__PURE__ */ new Map(), p = !1, m = i, h = s, g = null, _ = (e, t) => {
|
|
89
|
+
let n = u.get(e);
|
|
90
|
+
return n || u.set(e, n = /* @__PURE__ */ new Set()), n.add(t), () => n.delete(t);
|
|
91
|
+
}, v = (e) => {
|
|
92
|
+
let n = String(e);
|
|
93
|
+
if (!r || t.test(n)) return n;
|
|
94
|
+
let i = new URL(r), a = i.pathname.replace(/\/+$/, "");
|
|
95
|
+
return new URL(a && n.startsWith("/") ? a + n : n, i).href;
|
|
96
|
+
}, y = () => s ? s.nodeType === 9 ? s.documentElement : s.nodeType === 11 ? s.host : s : null, b = o || e(), x = b.selectedNode || null, S = b.selectedEdge || null, C = {
|
|
97
|
+
node: x,
|
|
98
|
+
edge: S
|
|
99
|
+
}, w = [], T = !1, ee = (e, t) => (e.node ? e.node.id : null) !== (t.node ? t.node.id : null) || e.edge !== t.edge, E = (e) => {
|
|
100
|
+
if (w.push(e), !T) {
|
|
101
|
+
T = !0;
|
|
102
|
+
try {
|
|
103
|
+
for (; w.length;) {
|
|
104
|
+
let e = w.shift(), t = {
|
|
105
|
+
node: x,
|
|
106
|
+
edge: S
|
|
107
|
+
};
|
|
108
|
+
if (p || !ee(C, t)) continue;
|
|
109
|
+
let n = C;
|
|
110
|
+
C = t, O.emit("selection", {
|
|
111
|
+
...t,
|
|
112
|
+
previous: n,
|
|
113
|
+
source: e
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
} finally {
|
|
117
|
+
T = !1;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}, D = (e, t, n, r) => {
|
|
121
|
+
let i = {
|
|
122
|
+
node: x,
|
|
123
|
+
edge: S
|
|
124
|
+
};
|
|
125
|
+
x = e || null, S = t || null;
|
|
126
|
+
let a = ee(i, {
|
|
127
|
+
node: x,
|
|
128
|
+
edge: S
|
|
129
|
+
}), o = !1, s = () => {
|
|
130
|
+
o || (o = !0, a && E(n));
|
|
131
|
+
};
|
|
132
|
+
return r || s(), {
|
|
133
|
+
changed: a,
|
|
134
|
+
previous: i,
|
|
135
|
+
announce: s
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
Object.defineProperty(b, "selectedNode", {
|
|
139
|
+
enumerable: !0,
|
|
140
|
+
configurable: !0,
|
|
141
|
+
get: () => x,
|
|
142
|
+
set: (e) => {
|
|
143
|
+
D(e, S, "state", !1);
|
|
144
|
+
}
|
|
145
|
+
}), Object.defineProperty(b, "selectedEdge", {
|
|
146
|
+
enumerable: !0,
|
|
147
|
+
configurable: !0,
|
|
148
|
+
get: () => S,
|
|
149
|
+
set: (e) => {
|
|
150
|
+
D(x, e, "state", !1);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
let O = {
|
|
154
|
+
root: s,
|
|
155
|
+
doc: c,
|
|
156
|
+
win: l,
|
|
157
|
+
base: r,
|
|
158
|
+
strings: { ...a },
|
|
159
|
+
state: b,
|
|
160
|
+
url: v,
|
|
161
|
+
fetch(e, t) {
|
|
162
|
+
return (m || globalThis.fetch)(typeof e == "string" ? v(e) : e, t);
|
|
163
|
+
},
|
|
164
|
+
touchScene() {
|
|
165
|
+
O.state.sceneVersion++;
|
|
166
|
+
let e = u.get("scene");
|
|
167
|
+
e && e.forEach((e) => e());
|
|
168
|
+
},
|
|
169
|
+
onSceneTouch: (e) => _("scene", e),
|
|
170
|
+
on: _,
|
|
171
|
+
emit(e, t) {
|
|
172
|
+
let n = u.get(e);
|
|
173
|
+
n && [...n].forEach((e) => e(t));
|
|
174
|
+
},
|
|
175
|
+
ask(e, t) {
|
|
176
|
+
let n = u.get(e);
|
|
177
|
+
if (n) for (let e of [...n]) {
|
|
178
|
+
let n = e(t);
|
|
179
|
+
if (n !== void 0) return n;
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
setSelection: (e, t = null, { source: n = "api", quiet: r = !1 } = {}) => D(e, t, n, r),
|
|
183
|
+
el: (e) => s ? s.querySelector(`[id="${String(e).replace(/["\\]/g, "\\$&")}"]`) : null,
|
|
184
|
+
attach(e) {
|
|
185
|
+
if (g) throw Error("This instance already has a map");
|
|
186
|
+
g = e, s = e, O.root = e;
|
|
187
|
+
let t = () => {
|
|
188
|
+
g === e && (g = null, s = h, O.root = h, O.release(t), p || O.emit("attach:released"));
|
|
189
|
+
};
|
|
190
|
+
return d.push(t), t;
|
|
191
|
+
},
|
|
192
|
+
active: () => {
|
|
193
|
+
if (!s || !c) return null;
|
|
194
|
+
if (s.nodeType !== 1) return s.activeElement || null;
|
|
195
|
+
let e = typeof s.getRootNode == "function" ? s.getRootNode() : c, t = e && e.activeElement !== void 0 ? e.activeElement : c.activeElement;
|
|
196
|
+
return t && s.contains(t) ? t : null;
|
|
197
|
+
},
|
|
198
|
+
tokenReader() {
|
|
199
|
+
let e = y();
|
|
200
|
+
if (!e || !l || !l.getComputedStyle) return null;
|
|
201
|
+
let t = l.getComputedStyle(e);
|
|
202
|
+
return (e) => t.getPropertyValue(e);
|
|
203
|
+
},
|
|
204
|
+
tokenElement: y,
|
|
205
|
+
reducedMotion: !!(l && l.matchMedia && l.matchMedia("(prefers-reduced-motion: reduce)").matches),
|
|
206
|
+
dpr: () => l && l.devicePixelRatio || 1,
|
|
207
|
+
hidden: () => !(!c || !c.hidden && c.visibilityState !== "hidden"),
|
|
208
|
+
onShown(e) {
|
|
209
|
+
return c ? O.listen(c, "visibilitychange", () => {
|
|
210
|
+
O.hidden() || e();
|
|
211
|
+
}) : () => {};
|
|
212
|
+
},
|
|
213
|
+
offline: () => !!(l && l.navigator && l.navigator.onLine === !1),
|
|
214
|
+
onNetwork(e) {
|
|
215
|
+
if (!l) return () => {};
|
|
216
|
+
let t = [O.listen(l, "offline", () => e(!0)), O.listen(l, "online", () => e(!1))];
|
|
217
|
+
return () => t.forEach((e) => e());
|
|
218
|
+
},
|
|
219
|
+
onWindowFocus: (e) => l ? O.listen(l, "focus", () => e()) : () => {},
|
|
220
|
+
onPageHide: (e) => l ? O.listen(l, "pagehide", () => e()) : () => {},
|
|
221
|
+
onHide(e) {
|
|
222
|
+
return c ? O.listen(c, "visibilitychange", () => {
|
|
223
|
+
O.hidden() && e();
|
|
224
|
+
}) : () => {};
|
|
225
|
+
},
|
|
226
|
+
store: {
|
|
227
|
+
get(e) {
|
|
228
|
+
try {
|
|
229
|
+
return l && l.localStorage ? l.localStorage.getItem(e) : null;
|
|
230
|
+
} catch {
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
set(e, t) {
|
|
235
|
+
try {
|
|
236
|
+
l && l.localStorage && l.localStorage.setItem(e, t);
|
|
237
|
+
} catch {}
|
|
238
|
+
},
|
|
239
|
+
remove(e) {
|
|
240
|
+
try {
|
|
241
|
+
l && l.localStorage && l.localStorage.removeItem(e);
|
|
242
|
+
} catch {}
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
listen(e, t, n, r) {
|
|
246
|
+
e.addEventListener(t, n, r);
|
|
247
|
+
let i = () => {
|
|
248
|
+
e.removeEventListener(t, n, r), O.release(i);
|
|
249
|
+
};
|
|
250
|
+
return d.push(i), i;
|
|
251
|
+
},
|
|
252
|
+
own(e) {
|
|
253
|
+
return d.push(e), e;
|
|
254
|
+
},
|
|
255
|
+
release(e) {
|
|
256
|
+
let t = d.lastIndexOf(e);
|
|
257
|
+
t >= 0 && d.splice(t, 1);
|
|
258
|
+
},
|
|
259
|
+
slot(e, t) {
|
|
260
|
+
return f.has(e) || f.set(e, t(O)), f.get(e);
|
|
261
|
+
},
|
|
262
|
+
get ended() {
|
|
263
|
+
return p;
|
|
264
|
+
},
|
|
265
|
+
destroy() {
|
|
266
|
+
if (!p) {
|
|
267
|
+
for (p = !0; d.length;) try {
|
|
268
|
+
d.pop()();
|
|
269
|
+
} catch (e) {
|
|
270
|
+
console.error("An instance clean-up failed", e);
|
|
271
|
+
}
|
|
272
|
+
u.clear(), f.clear();
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
viewEdges: () => O.state.view === "dataflow" && O.state.flow ? O.state.flow.edges : O.state.edges
|
|
276
|
+
};
|
|
277
|
+
return O;
|
|
278
|
+
}
|
|
279
|
+
// ../explorer/flow-style.js
|
|
280
|
+
var r = {
|
|
281
|
+
outbox: {
|
|
282
|
+
color: "#f59e0b",
|
|
283
|
+
label: "Outbox → API (writes)"
|
|
284
|
+
},
|
|
285
|
+
changes: {
|
|
286
|
+
color: "#22d3ee",
|
|
287
|
+
label: "Change stream (reads back)"
|
|
288
|
+
},
|
|
289
|
+
trigger: {
|
|
290
|
+
color: "#a3e635",
|
|
291
|
+
label: "Trigger → audit_log (seq)"
|
|
292
|
+
},
|
|
293
|
+
sync: {
|
|
294
|
+
color: "#fb7185",
|
|
295
|
+
label: "Background sync (external)"
|
|
296
|
+
},
|
|
297
|
+
model: {
|
|
298
|
+
color: "#c084fc",
|
|
299
|
+
label: "Model classes feed a tier"
|
|
300
|
+
},
|
|
301
|
+
rom: {
|
|
302
|
+
color: "#f0abfc",
|
|
303
|
+
label: "ROM: change → re-bake → serve"
|
|
304
|
+
},
|
|
305
|
+
read: {
|
|
306
|
+
color: "#93c5fd",
|
|
307
|
+
label: "Server reads rows over HTTP"
|
|
308
|
+
},
|
|
309
|
+
api: {
|
|
310
|
+
color: "#38bdf8",
|
|
311
|
+
label: "App calls the API (derived from its code)"
|
|
312
|
+
},
|
|
313
|
+
build: {
|
|
314
|
+
color: "#d6d3d1",
|
|
315
|
+
label: "Build script writes files"
|
|
316
|
+
},
|
|
317
|
+
reads: {
|
|
318
|
+
color: "#fde047",
|
|
319
|
+
label: "Table → page (render reads)"
|
|
320
|
+
},
|
|
321
|
+
writes: {
|
|
322
|
+
color: "#f87171",
|
|
323
|
+
label: "Page → table (form / action)"
|
|
324
|
+
},
|
|
325
|
+
uses: {
|
|
326
|
+
color: "#f472b6",
|
|
327
|
+
label: "Stylesheet uses design tokens"
|
|
328
|
+
},
|
|
329
|
+
extends: {
|
|
330
|
+
color: "#5eead4",
|
|
331
|
+
label: "Component extends a base class"
|
|
332
|
+
},
|
|
333
|
+
calls: {
|
|
334
|
+
color: "#fb7185",
|
|
335
|
+
label: "Calls (service → service, outside system)"
|
|
336
|
+
},
|
|
337
|
+
triggers: {
|
|
338
|
+
color: "#a3e635",
|
|
339
|
+
label: "Triggers (cron, webhook, store change)"
|
|
340
|
+
},
|
|
341
|
+
delivers: {
|
|
342
|
+
color: "#94a3b8",
|
|
343
|
+
label: "Outside system → webhook endpoint"
|
|
344
|
+
},
|
|
345
|
+
"runs-on": {
|
|
346
|
+
color: "#a8a29e",
|
|
347
|
+
label: "App → the stack that serves its domain"
|
|
348
|
+
}
|
|
349
|
+
}, i = (e) => r[e.kind === "flow" ? e.flow : e.kind] || r.sync, a = {
|
|
350
|
+
"&": "&",
|
|
351
|
+
"<": "<",
|
|
352
|
+
">": ">",
|
|
353
|
+
"\"": """,
|
|
354
|
+
"'": "'"
|
|
355
|
+
};
|
|
356
|
+
function o(e) {
|
|
357
|
+
return String(e ?? "").replace(/[&<>"']/g, (e) => a[e]);
|
|
358
|
+
}
|
|
359
|
+
Object.freeze([
|
|
360
|
+
"open",
|
|
361
|
+
"merged",
|
|
362
|
+
"closed",
|
|
363
|
+
"draft",
|
|
364
|
+
"queued",
|
|
365
|
+
"running",
|
|
366
|
+
"requested",
|
|
367
|
+
"claimed",
|
|
368
|
+
"working",
|
|
369
|
+
"waiting",
|
|
370
|
+
"done",
|
|
371
|
+
"failed",
|
|
372
|
+
"stopped",
|
|
373
|
+
"success",
|
|
374
|
+
"failure",
|
|
375
|
+
"added",
|
|
376
|
+
"changed",
|
|
377
|
+
"removed",
|
|
378
|
+
"edit",
|
|
379
|
+
"sent-back"
|
|
380
|
+
]), Object.freeze([
|
|
381
|
+
"added",
|
|
382
|
+
"changed",
|
|
383
|
+
"removed",
|
|
384
|
+
"edit"
|
|
385
|
+
]), Object.freeze([
|
|
386
|
+
"requested",
|
|
387
|
+
"claimed",
|
|
388
|
+
"working",
|
|
389
|
+
"waiting",
|
|
390
|
+
"done",
|
|
391
|
+
"failed",
|
|
392
|
+
"stopped"
|
|
393
|
+
]), Object.freeze({
|
|
394
|
+
quiet: "waiting",
|
|
395
|
+
"stop-requested": "stopped",
|
|
396
|
+
neutral: "done",
|
|
397
|
+
skipped: "done",
|
|
398
|
+
cancelled: "stopped",
|
|
399
|
+
approved: "success",
|
|
400
|
+
unreviewed: "waiting",
|
|
401
|
+
changed: "waiting",
|
|
402
|
+
missing: "failure",
|
|
403
|
+
allowed: "success",
|
|
404
|
+
refused: "failure",
|
|
405
|
+
mismatch: "failure",
|
|
406
|
+
pending: "running",
|
|
407
|
+
ok: "success",
|
|
408
|
+
bad: "failure",
|
|
409
|
+
stale: "waiting",
|
|
410
|
+
off: "stopped",
|
|
411
|
+
error: "failure",
|
|
412
|
+
idle: "running"
|
|
413
|
+
}), Object.freeze({
|
|
414
|
+
requested: "<circle cx=\"6\" cy=\"6\" r=\"4.2\" stroke-dasharray=\"2 1.8\"/>",
|
|
415
|
+
queued: "<circle cx=\"6\" cy=\"6\" r=\"4.2\" stroke-dasharray=\"2 1.8\"/>",
|
|
416
|
+
claimed: "<circle cx=\"6\" cy=\"6\" r=\"4.2\"/><circle cx=\"6\" cy=\"6\" r=\"1.4\" fill=\"currentColor\" stroke=\"none\"/>",
|
|
417
|
+
working: "<path class=\"hx-state-spin\" d=\"M6 1.8a4.2 4.2 0 1 1-4.2 4.2\"/>",
|
|
418
|
+
running: "<path class=\"hx-state-spin\" d=\"M6 1.8a4.2 4.2 0 1 1-4.2 4.2\"/>",
|
|
419
|
+
waiting: "<path d=\"M6 1.2L11 10.4H1Z\" stroke-linejoin=\"round\"/><path d=\"M6 4.6v2.7M6 8.6v.1\"/>",
|
|
420
|
+
done: "<path d=\"M2 6.4l2.6 2.6L10 3.4\"/>",
|
|
421
|
+
success: "<path d=\"M2 6.4l2.6 2.6L10 3.4\"/>",
|
|
422
|
+
failed: "<path d=\"M2.6 2.6l6.8 6.8M9.4 2.6L2.6 9.4\"/>",
|
|
423
|
+
failure: "<path d=\"M2.6 2.6l6.8 6.8M9.4 2.6L2.6 9.4\"/>",
|
|
424
|
+
stopped: "<rect x=\"2.4\" y=\"2.4\" width=\"7.2\" height=\"7.2\" rx=\"1\" fill=\"currentColor\"/>",
|
|
425
|
+
neutral: "<path d=\"M2.4 6h7.2\"/>",
|
|
426
|
+
skipped: "<path d=\"M2.4 6h7.2\"/>",
|
|
427
|
+
cancelled: "<circle cx=\"6\" cy=\"6\" r=\"4.2\"/><path d=\"M3 9L9 3\"/>",
|
|
428
|
+
"sent-back": "<path d=\"M4.6 2.2L2 4.8l2.6 2.6\"/><path d=\"M2.2 4.8H7a2.8 2.8 0 0 1 0 5.6H4.6\"/>"
|
|
429
|
+
}), Object.freeze([
|
|
430
|
+
["code", "Code: a branch and a pull request"],
|
|
431
|
+
["summary", "Summary of the conversation"],
|
|
432
|
+
["brief", "A brief for another run"],
|
|
433
|
+
["proposal", "A proposal drafted from the thread"]
|
|
434
|
+
]), Object.freeze({
|
|
435
|
+
merged: "done",
|
|
436
|
+
closed: "stopped",
|
|
437
|
+
quiet: "waiting",
|
|
438
|
+
"stop-requested": "stopped"
|
|
439
|
+
}), Object.freeze([
|
|
440
|
+
"minutes",
|
|
441
|
+
"turns",
|
|
442
|
+
"cost",
|
|
443
|
+
"tokens"
|
|
444
|
+
]);
|
|
445
|
+
// ../core/strings.js
|
|
446
|
+
var s = Object.freeze({
|
|
447
|
+
layers: "Layers",
|
|
448
|
+
layersAll: "All",
|
|
449
|
+
layersNone: "None",
|
|
450
|
+
overlays: "Overlays",
|
|
451
|
+
dataFlow: "Flow",
|
|
452
|
+
house: "House",
|
|
453
|
+
proposals: "Proposals",
|
|
454
|
+
issuesAndPrs: "Work",
|
|
455
|
+
searchPlaceholder: "Search...",
|
|
456
|
+
searchNoMatch: "No match for",
|
|
457
|
+
signOut: "Sign out",
|
|
458
|
+
poweredBy: "powered by cornfield",
|
|
459
|
+
before: "Before",
|
|
460
|
+
diff: "Diff",
|
|
461
|
+
after: "After",
|
|
462
|
+
closeProposal: "Close",
|
|
463
|
+
approve: "Approve",
|
|
464
|
+
sendBack: "Send back",
|
|
465
|
+
sendBackWithNote: "Send back with this note",
|
|
466
|
+
approveAnyway: "Approve anyway",
|
|
467
|
+
sendBackAnyway: "Send back anyway",
|
|
468
|
+
undo: "Undo",
|
|
469
|
+
approved: "Approved",
|
|
470
|
+
myEdits: "My edits",
|
|
471
|
+
showWholeMap: "Show the whole map",
|
|
472
|
+
wholeMap: "Whole map",
|
|
473
|
+
hiddenWhileReviewing: "hidden while reviewing",
|
|
474
|
+
yourEdits: "Your edits",
|
|
475
|
+
cancelLanding: "Cancel landing",
|
|
476
|
+
queueIt: "Queue it",
|
|
477
|
+
reviewNoteLabel: "Note for the drafting agent",
|
|
478
|
+
reviewNotePlaceholder: "What should change?",
|
|
479
|
+
openSpecsList: "Open the Specs list",
|
|
480
|
+
changes: "Changes",
|
|
481
|
+
personasAndScenarios: "Personas and scenarios",
|
|
482
|
+
scenarios: "Scenarios",
|
|
483
|
+
anyone: "Anyone",
|
|
484
|
+
notInAnyScenario: "Not in any scenario",
|
|
485
|
+
steps: "Steps",
|
|
486
|
+
previousStep: "Previous",
|
|
487
|
+
nextStep: "Next",
|
|
488
|
+
pause: "Pause",
|
|
489
|
+
play: "Play",
|
|
490
|
+
playAgain: "Play again",
|
|
491
|
+
nextScenario: "Next scenario",
|
|
492
|
+
notChecked: "Not checked",
|
|
493
|
+
tabSpecs: "Specs",
|
|
494
|
+
tabPulls: "PRs",
|
|
495
|
+
tabIssues: "Issues",
|
|
496
|
+
tabThreads: "Threads",
|
|
497
|
+
tabRuns: "Runs",
|
|
498
|
+
tabDeploys: "Deploys",
|
|
499
|
+
waitingOnYou: "waiting on you",
|
|
500
|
+
toDecide: "To decide",
|
|
501
|
+
withAgent: "With the agent",
|
|
502
|
+
approvedGroup: "Approved",
|
|
503
|
+
drafts: "Drafts",
|
|
504
|
+
needsYou: "Needs you",
|
|
505
|
+
inMotion: "In motion",
|
|
506
|
+
finished: "Finished",
|
|
507
|
+
answer: "Answer",
|
|
508
|
+
newIdea: "New idea",
|
|
509
|
+
landIt: "Land it",
|
|
510
|
+
startAgent: "Start an agent",
|
|
511
|
+
askRunner: "Ask the runner",
|
|
512
|
+
startAgain: "Start again",
|
|
513
|
+
stop: "Stop",
|
|
514
|
+
continueRun: "Continue",
|
|
515
|
+
reply: "Reply",
|
|
516
|
+
openFile: "Open file",
|
|
517
|
+
openRoute: "Open route",
|
|
518
|
+
startRun: "Start a run",
|
|
519
|
+
copySpec: "Copy Spec",
|
|
520
|
+
frame: "Frame them",
|
|
521
|
+
throughChildren: "Include its children's lines",
|
|
522
|
+
hintInspect: "Click a node to see what it is",
|
|
523
|
+
hintInspectTouch: "Tap a node to see what it is",
|
|
524
|
+
hintDrag: "Drag nodes to move • Double-click to inspect",
|
|
525
|
+
hintDragTouch: "Drag nodes to move • Double-tap to inspect",
|
|
526
|
+
hintDataFlow: "Data flow: browser → servers → API → tables → services → outside",
|
|
527
|
+
loading: "Loading topology.json …",
|
|
528
|
+
errorTitle: "The map could not be loaded",
|
|
529
|
+
retry: "Retry",
|
|
530
|
+
sourceLoading: "Loading the map …",
|
|
531
|
+
sourceSignedOut: "You are not signed in to cornfield",
|
|
532
|
+
sourceSignInText: "This map is behind cornfield's sign-in.",
|
|
533
|
+
sourceNotMaintainer: "This map is for the project's maintainers",
|
|
534
|
+
sourceNotMaintainerText: "You are signed in to cornfield, but not as a maintainer.",
|
|
535
|
+
sourceSignIn: "Sign in to cornfield",
|
|
536
|
+
sourceNotListed: "This page is not listed by that cornfield",
|
|
537
|
+
sourceNotListedHint: "Add this origin to embed.origins on the server:",
|
|
538
|
+
sourceOffline: "The map cannot be reached",
|
|
539
|
+
sourceOfflineText: "Check the connection, then try again.",
|
|
540
|
+
sourceBadAddress: "That is not the address of a cornfield server",
|
|
541
|
+
sourceVersion: "This map and its server are different versions",
|
|
542
|
+
sourceSecondMap: "This scope already has a map"
|
|
543
|
+
}), c = (e) => typeof e == "string" && Object.hasOwn(s, e), l = /* @__PURE__ */ RegExp("[\\u0000-\\u001f\\u007f-\\u009f\\u2028\\u2029]");
|
|
544
|
+
function u(e) {
|
|
545
|
+
return typeof e == "string" ? e.trim() ? l.test(e) ? "is one line of plain text (no line break or control character)" : [...e].length > 80 ? "is at most 80 characters" : null : "is empty (leave the key out to keep the default)" : "is text";
|
|
546
|
+
}
|
|
547
|
+
// ../explorer/engine/strings.js
|
|
548
|
+
var d = (e, t) => c(t) && Object.hasOwn(e.strings, t) && !u(e.strings[t]);
|
|
549
|
+
function f(e, t) {
|
|
550
|
+
for (let t of Object.keys(e.strings)) delete e.strings[t];
|
|
551
|
+
if (t && typeof t == "object" && !Array.isArray(t)) for (let [n, r] of Object.entries(t)) c(n) && !u(r) && (e.strings[n] = r);
|
|
552
|
+
}
|
|
553
|
+
function p(e, t) {
|
|
554
|
+
return d(e, t) ? e.strings[t] : c(t) ? s[t] : String(t);
|
|
555
|
+
}
|
|
556
|
+
var m = [
|
|
557
|
+
["data-corn-string", (e, t) => {
|
|
558
|
+
e.textContent = t;
|
|
559
|
+
}],
|
|
560
|
+
["data-corn-string-aria-label", (e, t) => e.setAttribute("aria-label", t)],
|
|
561
|
+
["data-corn-string-placeholder", (e, t) => e.setAttribute("placeholder", t)]
|
|
562
|
+
];
|
|
563
|
+
function h(e, t = e.root) {
|
|
564
|
+
if (t && typeof t.querySelectorAll == "function") for (let [n, r] of m) for (let i of t.querySelectorAll(`[${n}]`)) {
|
|
565
|
+
let t = i.getAttribute(n);
|
|
566
|
+
d(e, t) && r(i, e.strings[t]);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
Object.freeze([
|
|
570
|
+
{
|
|
571
|
+
key: "decide",
|
|
572
|
+
title: "toDecide"
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
key: "agent",
|
|
576
|
+
title: "withAgent"
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
key: "approved",
|
|
580
|
+
title: "approvedGroup"
|
|
581
|
+
},
|
|
582
|
+
{
|
|
583
|
+
key: "drafts",
|
|
584
|
+
title: "drafts"
|
|
585
|
+
}
|
|
586
|
+
]), Object.freeze([
|
|
587
|
+
{
|
|
588
|
+
key: "needs",
|
|
589
|
+
title: "needsYou"
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
key: "motion",
|
|
593
|
+
title: "inMotion"
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
key: "finished",
|
|
597
|
+
title: "finished"
|
|
598
|
+
}
|
|
599
|
+
]), Object.freeze([
|
|
600
|
+
"to-decide",
|
|
601
|
+
"changed",
|
|
602
|
+
"sent-back",
|
|
603
|
+
"approved",
|
|
604
|
+
"draft-pr",
|
|
605
|
+
"local",
|
|
606
|
+
"unknown"
|
|
607
|
+
]), Object.freeze({
|
|
608
|
+
"to-decide": "To decide",
|
|
609
|
+
changed: "Changed since approved",
|
|
610
|
+
"sent-back": "Sent back",
|
|
611
|
+
approved: "Approved",
|
|
612
|
+
"draft-pr": "Draft PR",
|
|
613
|
+
local: "Local",
|
|
614
|
+
unknown: "Review state unknown"
|
|
615
|
+
}), Object.freeze({
|
|
616
|
+
"to-decide": "waiting",
|
|
617
|
+
changed: "waiting",
|
|
618
|
+
"sent-back": "sent-back",
|
|
619
|
+
approved: "success",
|
|
620
|
+
"draft-pr": "draft",
|
|
621
|
+
local: "draft",
|
|
622
|
+
unknown: "failure"
|
|
623
|
+
});
|
|
624
|
+
// ../explorer/proposal-model.js
|
|
625
|
+
var g = (e) => !!e && !!e.mark && e.mark !== "none", _ = (e) => e.mark === "edit" ? e.editOp || "none" : e.mark || "none";
|
|
626
|
+
function v(e, t) {
|
|
627
|
+
return e === "before" ? _(t) !== "added" : e !== "after" || _(t) !== "removed";
|
|
628
|
+
}
|
|
629
|
+
function y(e, t) {
|
|
630
|
+
return v(e, t);
|
|
631
|
+
}
|
|
632
|
+
function b(e, t) {
|
|
633
|
+
let n = t.mark || "none";
|
|
634
|
+
return n === "edit" ? "edit" : e === "diff" ? n : "none";
|
|
635
|
+
}
|
|
636
|
+
function x(e) {
|
|
637
|
+
if (e.mark !== "changed" || !e.before) return e;
|
|
638
|
+
let t = { ...e };
|
|
639
|
+
for (let [n, r] of Object.entries(e.before)) r === null ? delete t[n] : t[n] = r;
|
|
640
|
+
return t;
|
|
641
|
+
}
|
|
642
|
+
function S(e, t) {
|
|
643
|
+
let n = /* @__PURE__ */ new Set();
|
|
644
|
+
for (let t of e) g(t) && n.add(t.id);
|
|
645
|
+
for (let e of t) g(e) && (n.add(e.from), n.add(e.to));
|
|
646
|
+
let r = new Set(n);
|
|
647
|
+
for (let e of t) {
|
|
648
|
+
let t = !e.kind && !e.dashed;
|
|
649
|
+
n.has(e.from) && (!t || n.has(e.to)) && r.add(e.to), n.has(e.to) && r.add(e.from);
|
|
650
|
+
}
|
|
651
|
+
return {
|
|
652
|
+
touched: n,
|
|
653
|
+
near: r
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
var C = (e) => !e.kind && !e.dashed;
|
|
657
|
+
function w(e, t, { gap: n = 74 } = {}) {
|
|
658
|
+
let r = new Map(e.map((e) => [e.id, e])), i = e.filter((e) => _(e) !== "added"), a = e.filter((e) => _(e) === "added");
|
|
659
|
+
if (!a.length) return;
|
|
660
|
+
let o = new Set(i.map((e) => e.id)), s = (e) => {
|
|
661
|
+
let n = t.find((t) => C(t) && t.to === e.id && r.has(t.from));
|
|
662
|
+
if (n) return n.from;
|
|
663
|
+
let i = t.find((t) => t.from === e.id && r.has(t.to) || t.to === e.id && r.has(t.from));
|
|
664
|
+
return i ? i.from === e.id ? i.to : i.from : null;
|
|
665
|
+
}, c = (e, t) => i.every((r) => Math.hypot(r.x - e, r.y - t) >= n), l = (e, t, r) => {
|
|
666
|
+
let i = t === 0 && r === 0 ? -Math.PI / 2 : Math.atan2(r, t) || -Math.PI / 2, a = null;
|
|
667
|
+
for (let o = 96; o <= 576; o += 40) {
|
|
668
|
+
let s = Math.max(8, Math.round(2 * Math.PI * o / n));
|
|
669
|
+
for (let n = 0; n < s; n++) {
|
|
670
|
+
let l = Math.ceil(n / 2) * (n % 2 ? 1 : -1) * (2 * Math.PI / s), u = t + Math.cos(i + l) * o, d = r + Math.sin(i + l) * o;
|
|
671
|
+
if (a ||= {
|
|
672
|
+
x: u,
|
|
673
|
+
y: d
|
|
674
|
+
}, c(u, d)) {
|
|
675
|
+
e.x = u, e.y = d;
|
|
676
|
+
return;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
e.x = a.x, e.y = a.y;
|
|
681
|
+
}, u = a.slice();
|
|
682
|
+
for (let e = 0; e <= a.length && u.length; e++) {
|
|
683
|
+
let e = [];
|
|
684
|
+
for (let t of u) {
|
|
685
|
+
let n = r.get(s(t));
|
|
686
|
+
n && o.has(n.id) ? (l(t, n.x, n.y), i.push(t), o.add(t.id)) : e.push(t);
|
|
687
|
+
}
|
|
688
|
+
if (e.length === u.length) break;
|
|
689
|
+
u = e;
|
|
690
|
+
}
|
|
691
|
+
for (let e of u) l(e, 0, 0), i.push(e);
|
|
692
|
+
}
|
|
693
|
+
var T = 50;
|
|
694
|
+
function ee(e, t) {
|
|
695
|
+
let n = new Map(t.tiers.map((e) => [e.key, e]));
|
|
696
|
+
if (e.tiers.some((e) => e.nodes.length && !n.get(e.key)?.nodes.length)) return !1;
|
|
697
|
+
let r = new Map(t.tiers.filter((e) => e.nodes.length).map((e, n) => [e.key, t.headers[n]])), i = new Map(t.tiers.flatMap((e) => e.nodes).map((e) => [e.id, e]));
|
|
698
|
+
e.headers = t.headers.map((e) => ({ ...e }));
|
|
699
|
+
let a = t.top;
|
|
700
|
+
for (let t of e.tiers) {
|
|
701
|
+
if (!t.nodes.length) continue;
|
|
702
|
+
let e = t.nodes.filter((e) => i.has(e.id)), n = t.nodes.filter((e) => !i.has(e.id));
|
|
703
|
+
for (let t of e) {
|
|
704
|
+
let e = i.get(t.id);
|
|
705
|
+
t.x = e.x, t.y = e.y, t.r = e.r;
|
|
706
|
+
}
|
|
707
|
+
if (!n.length) continue;
|
|
708
|
+
let o = r.get(t.key).rows, s = Math.max(...e.map((e) => e.x)), c = (e) => (e - (o - 1) / 2) * T, l = new Set(e.filter((e) => e.x === s).map((e) => Math.round(e.y))), u = 0;
|
|
709
|
+
for (let e of n) {
|
|
710
|
+
for (; l.has(Math.round(c(u)));) u++;
|
|
711
|
+
e.x = s, e.y = c(u), l.add(Math.round(e.y)), a = Math.min(a, -(e.y + 40));
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
return e.top = a, !0;
|
|
715
|
+
}
|
|
716
|
+
// ../core/schema.js
|
|
717
|
+
var E = {
|
|
718
|
+
root: {
|
|
719
|
+
color: "#f59e0b",
|
|
720
|
+
r: 28
|
|
721
|
+
},
|
|
722
|
+
app: {
|
|
723
|
+
color: "#5168ec",
|
|
724
|
+
r: 24
|
|
725
|
+
},
|
|
726
|
+
page: {
|
|
727
|
+
color: "#38bdf8",
|
|
728
|
+
r: 18
|
|
729
|
+
},
|
|
730
|
+
pkg: {
|
|
731
|
+
color: "#0f8293",
|
|
732
|
+
r: 24
|
|
733
|
+
},
|
|
734
|
+
core: {
|
|
735
|
+
color: "#14b8a6",
|
|
736
|
+
r: 20
|
|
737
|
+
},
|
|
738
|
+
token: {
|
|
739
|
+
color: "#ef409b",
|
|
740
|
+
r: 20
|
|
741
|
+
},
|
|
742
|
+
atom: {
|
|
743
|
+
color: "#108d4e",
|
|
744
|
+
r: 19
|
|
745
|
+
},
|
|
746
|
+
molecule: {
|
|
747
|
+
color: "#a855f7",
|
|
748
|
+
r: 21
|
|
749
|
+
},
|
|
750
|
+
tool: {
|
|
751
|
+
color: "#f43f5e",
|
|
752
|
+
r: 19
|
|
753
|
+
},
|
|
754
|
+
store: {
|
|
755
|
+
color: "#fb923c",
|
|
756
|
+
r: 20
|
|
757
|
+
},
|
|
758
|
+
table: {
|
|
759
|
+
color: "#fde047",
|
|
760
|
+
r: 18
|
|
761
|
+
},
|
|
762
|
+
rom: {
|
|
763
|
+
color: "#c398c6",
|
|
764
|
+
r: 19
|
|
765
|
+
},
|
|
766
|
+
service: {
|
|
767
|
+
color: "#84cc16",
|
|
768
|
+
r: 20
|
|
769
|
+
},
|
|
770
|
+
external: {
|
|
771
|
+
color: "#94a3b8",
|
|
772
|
+
r: 21
|
|
773
|
+
},
|
|
774
|
+
stack: {
|
|
775
|
+
color: "#b49fa0",
|
|
776
|
+
r: 22
|
|
777
|
+
},
|
|
778
|
+
machine: {
|
|
779
|
+
color: "#78716c",
|
|
780
|
+
r: 26
|
|
781
|
+
},
|
|
782
|
+
container: {
|
|
783
|
+
color: "#d6d3d1",
|
|
784
|
+
r: 12
|
|
785
|
+
},
|
|
786
|
+
persona: {
|
|
787
|
+
color: "#fb7185",
|
|
788
|
+
r: 22
|
|
789
|
+
},
|
|
790
|
+
device: {
|
|
791
|
+
color: "#2dd4bf",
|
|
792
|
+
r: 14
|
|
793
|
+
},
|
|
794
|
+
floor: {
|
|
795
|
+
color: "#a3e635",
|
|
796
|
+
r: 20
|
|
797
|
+
},
|
|
798
|
+
room: {
|
|
799
|
+
color: "#f7ed81",
|
|
800
|
+
r: 16
|
|
801
|
+
}
|
|
802
|
+
}, D = Object.freeze({
|
|
803
|
+
root: "circle",
|
|
804
|
+
app: "circle",
|
|
805
|
+
page: "circle",
|
|
806
|
+
pkg: "circle",
|
|
807
|
+
core: "circle",
|
|
808
|
+
token: "circle",
|
|
809
|
+
atom: "circle",
|
|
810
|
+
molecule: "circle",
|
|
811
|
+
tool: "circle",
|
|
812
|
+
rom: "circle",
|
|
813
|
+
service: "circle",
|
|
814
|
+
store: "rounded-square",
|
|
815
|
+
table: "rounded-square",
|
|
816
|
+
external: "hexagon",
|
|
817
|
+
stack: "square",
|
|
818
|
+
machine: "square",
|
|
819
|
+
container: "square",
|
|
820
|
+
device: "square",
|
|
821
|
+
floor: "square",
|
|
822
|
+
room: "square",
|
|
823
|
+
persona: "diamond"
|
|
824
|
+
}), O = Object.freeze([
|
|
825
|
+
"circle",
|
|
826
|
+
"rounded-square",
|
|
827
|
+
"hexagon",
|
|
828
|
+
"square",
|
|
829
|
+
"diamond"
|
|
830
|
+
]), te = (e) => typeof e == "string" && Object.hasOwn(D, e) ? D[e] : "circle", ne = ["reads", "writes"], re = [
|
|
831
|
+
"calls",
|
|
832
|
+
"triggers",
|
|
833
|
+
"delivers"
|
|
834
|
+
], ie = ["runs-on"];
|
|
835
|
+
[
|
|
836
|
+
...ne,
|
|
837
|
+
...re,
|
|
838
|
+
...ie
|
|
839
|
+
];
|
|
840
|
+
// ../explorer/cloud-model.js
|
|
841
|
+
var k = {
|
|
842
|
+
run: {
|
|
843
|
+
title: "Breaks now",
|
|
844
|
+
legend: "No tick: breaks as soon as it is down",
|
|
845
|
+
ticks: 0,
|
|
846
|
+
color: "#f87171"
|
|
847
|
+
},
|
|
848
|
+
deploy: {
|
|
849
|
+
title: "Breaks at the next deploy",
|
|
850
|
+
legend: "One tick: breaks at the next deploy, rebuild or first run",
|
|
851
|
+
ticks: 1,
|
|
852
|
+
color: "#fbbf24"
|
|
853
|
+
},
|
|
854
|
+
renew: {
|
|
855
|
+
title: "Breaks at the next certificate renewal",
|
|
856
|
+
legend: "Two ticks: breaks at the next certificate renewal",
|
|
857
|
+
ticks: 2,
|
|
858
|
+
color: "#a78bfa"
|
|
859
|
+
}
|
|
860
|
+
}, ae = (e) => e && Object.hasOwn(k, e.when) ? e.when : "run", oe = (e) => e && e.kind === "calls" ? k[ae(e)].ticks : 0, se = (e) => e && e.kind === "web" ? "web" : "cloud", A = Object.keys(k), ce = Object.fromEntries(A.map((e, t) => [e, t])), le = /* @__PURE__ */ new Set([
|
|
861
|
+
"persona",
|
|
862
|
+
"room",
|
|
863
|
+
"floor"
|
|
864
|
+
]), ue = [
|
|
865
|
+
"external",
|
|
866
|
+
"machine",
|
|
867
|
+
"container",
|
|
868
|
+
"service",
|
|
869
|
+
"page",
|
|
870
|
+
"app"
|
|
871
|
+
], de = (e) => {
|
|
872
|
+
let t = ue.indexOf(e);
|
|
873
|
+
return t < 0 ? ue.length : t;
|
|
874
|
+
}, fe = {
|
|
875
|
+
color: "#050608",
|
|
876
|
+
halo: "child"
|
|
877
|
+
}, pe = {
|
|
878
|
+
alpha: .92,
|
|
879
|
+
glow: 10,
|
|
880
|
+
edgeAlpha: .9,
|
|
881
|
+
edgeWidth: 2.2
|
|
882
|
+
}, me = (e, t) => `${e}->${t}`;
|
|
883
|
+
function he(e, t, n) {
|
|
884
|
+
let r = new Map(t.map((e) => [e.id, e])), i = [...new Set(Array.isArray(e) ? e : [])].filter((e) => r.has(e)), a = new Set(i), o = /* @__PURE__ */ new Map(), s = (e, t) => {
|
|
885
|
+
o.has(e) || o.set(e, []), o.get(e).push(t);
|
|
886
|
+
}, c = /* @__PURE__ */ new Map();
|
|
887
|
+
for (let e of n) if (e && e.from && e.to) {
|
|
888
|
+
if (e.kind === "calls") s(e.to, {
|
|
889
|
+
from: e.from,
|
|
890
|
+
rank: ce[ae(e)],
|
|
891
|
+
browser: e.side === "browser",
|
|
892
|
+
key: me(e.from, e.to)
|
|
893
|
+
});
|
|
894
|
+
else if (e.kind === "triggers" && (r.get(e.from) || {}).type === "page" && (r.get(e.to) || {}).type === "service") s(e.to, {
|
|
895
|
+
from: e.from,
|
|
896
|
+
rank: 0,
|
|
897
|
+
browser: !1,
|
|
898
|
+
key: me(e.from, e.to)
|
|
899
|
+
});
|
|
900
|
+
else if (e.kind === "runs-on" && Array.isArray(e.mappings)) for (let t of e.mappings) {
|
|
901
|
+
if (!t || !t.service) continue;
|
|
902
|
+
let n = `${e.to}|${t.service}`;
|
|
903
|
+
c.has(n) || c.set(n, /* @__PURE__ */ new Set()), c.get(n).add(e.from);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
let l = (e) => {
|
|
907
|
+
let t = o.get(e) || [], n = r.get(e);
|
|
908
|
+
if (!n || n.type !== "container" || !n.stack || !n.service) return t;
|
|
909
|
+
let i = [...c.get(`stack-${n.stack}|${n.service}`) || []].map((e) => ({
|
|
910
|
+
from: e,
|
|
911
|
+
rank: 0,
|
|
912
|
+
browser: !1,
|
|
913
|
+
key: null
|
|
914
|
+
}));
|
|
915
|
+
return i.length ? [...t, ...i] : t;
|
|
916
|
+
}, u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), f = A.map(() => []);
|
|
917
|
+
i.forEach((e) => f[0].push({
|
|
918
|
+
id: e,
|
|
919
|
+
rank: 0,
|
|
920
|
+
browser: !1
|
|
921
|
+
}));
|
|
922
|
+
for (let e = 0; e < f.length; e++) for (let t = 0; t < f[e].length; t++) {
|
|
923
|
+
let { id: n, rank: i, browser: o } = f[e][t], s = u.get(n);
|
|
924
|
+
if (!(s && (s.rank < i || s.rank === i && s.browser !== o))) for (let e of l(n)) {
|
|
925
|
+
let t = r.get(e.from);
|
|
926
|
+
if (!t || a.has(e.from) || le.has(t.type)) continue;
|
|
927
|
+
let n = Math.max(i, e.rank), s = o || e.browser;
|
|
928
|
+
e.key && (!d.has(e.key) || ce[d.get(e.key)] > n) && d.set(e.key, A[n]);
|
|
929
|
+
let c = u.get(e.from);
|
|
930
|
+
c && (c.rank < n || c.rank === n && (!c.browser || s)) || (u.set(e.from, {
|
|
931
|
+
rank: n,
|
|
932
|
+
when: A[n],
|
|
933
|
+
browser: s
|
|
934
|
+
}), f[n].push({
|
|
935
|
+
id: e.from,
|
|
936
|
+
rank: n,
|
|
937
|
+
browser: s
|
|
938
|
+
}));
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
let p = new Map([...u].map(([e, t]) => [e, {
|
|
942
|
+
when: t.when,
|
|
943
|
+
browser: t.browser
|
|
944
|
+
}])), m = (e) => String(r.get(e).label || e);
|
|
945
|
+
return {
|
|
946
|
+
down: i,
|
|
947
|
+
hits: p,
|
|
948
|
+
edges: d,
|
|
949
|
+
groups: A.map((e) => {
|
|
950
|
+
let t = [...p].filter(([, t]) => t.when === e).map(([e]) => e).sort((e, t) => de(r.get(e).type) - de(r.get(t).type) || m(e).localeCompare(m(t))), { title: n, color: i } = k[e];
|
|
951
|
+
return {
|
|
952
|
+
when: e,
|
|
953
|
+
title: n,
|
|
954
|
+
color: i,
|
|
955
|
+
ids: t
|
|
956
|
+
};
|
|
957
|
+
}).filter((e) => e.ids.length)
|
|
958
|
+
};
|
|
959
|
+
}
|
|
960
|
+
var j = null;
|
|
961
|
+
function ge(e, t, n) {
|
|
962
|
+
let r = e && Array.isArray(e.down) ? e.down : [];
|
|
963
|
+
if (!r.length) return null;
|
|
964
|
+
let i = r.join("\0");
|
|
965
|
+
return j && j.key === i && j.nodes === t && j.edges === n || (j = {
|
|
966
|
+
key: i,
|
|
967
|
+
nodes: t,
|
|
968
|
+
edges: n,
|
|
969
|
+
radius: he(r, t, n)
|
|
970
|
+
}), j.radius;
|
|
971
|
+
}
|
|
972
|
+
function _e(e, t) {
|
|
973
|
+
if (!t) return;
|
|
974
|
+
let n = new Set(t.down);
|
|
975
|
+
for (let r of e.nodes) {
|
|
976
|
+
if (n.has(r.id)) {
|
|
977
|
+
Object.assign(r, {
|
|
978
|
+
color: fe.color,
|
|
979
|
+
alpha: 1,
|
|
980
|
+
labelAlpha: 1,
|
|
981
|
+
labelColor: "#f8fafc",
|
|
982
|
+
labelKeep: !0,
|
|
983
|
+
labelStrike: !0,
|
|
984
|
+
connected: !0,
|
|
985
|
+
glow: 0
|
|
986
|
+
}), r.halo === "none" && (r.halo = fe.halo);
|
|
987
|
+
continue;
|
|
988
|
+
}
|
|
989
|
+
let e = t.hits.get(r.id);
|
|
990
|
+
if (!e) continue;
|
|
991
|
+
let i = Math.max(r.alpha, pe.alpha);
|
|
992
|
+
Object.assign(r, {
|
|
993
|
+
color: k[e.when].color,
|
|
994
|
+
alpha: i,
|
|
995
|
+
labelAlpha: i,
|
|
996
|
+
labelColor: "#f8fafc",
|
|
997
|
+
labelKeep: !0,
|
|
998
|
+
connected: !0,
|
|
999
|
+
glow: Math.max(r.glow || 0, pe.glow)
|
|
1000
|
+
});
|
|
1001
|
+
}
|
|
1002
|
+
for (let n of e.edges) {
|
|
1003
|
+
let e = t.edges.get(me(n.from, n.to));
|
|
1004
|
+
if (!e) continue;
|
|
1005
|
+
let r = k[e].color;
|
|
1006
|
+
n.color = r, n.glow && (n.glowColor = r), n.alpha = Math.max(n.alpha, pe.edgeAlpha), n.width = Math.max(n.width, pe.edgeWidth), n.packet &&= {
|
|
1007
|
+
...n.packet,
|
|
1008
|
+
glowColor: r
|
|
1009
|
+
};
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
// ../explorer/house-model.js
|
|
1013
|
+
var ve = /* @__PURE__ */ new Set([
|
|
1014
|
+
"container",
|
|
1015
|
+
"stack",
|
|
1016
|
+
"machine"
|
|
1017
|
+
]);
|
|
1018
|
+
function ye(e, t) {
|
|
1019
|
+
return !!(e.house && e.house.shown && e.house.shown.has(t.id));
|
|
1020
|
+
}
|
|
1021
|
+
var M = null;
|
|
1022
|
+
function be(e) {
|
|
1023
|
+
let t = e.house && e.house.cloudLines;
|
|
1024
|
+
return !t || !t.length ? e.edges : (M && M.edges === e.edges && M.lines === t || (M = {
|
|
1025
|
+
edges: e.edges,
|
|
1026
|
+
lines: t,
|
|
1027
|
+
all: [...e.edges, ...t]
|
|
1028
|
+
}), M.all);
|
|
1029
|
+
}
|
|
1030
|
+
function xe(e, t, n) {
|
|
1031
|
+
return e.kind === "runs-on" || e.kind === "delivers" ? "flow" : e.kind === "calls" && n && n.type === "external" ? e.rolled || !(t && ve.has(t.type)) ? "flow" : null : !e.kind && !e.dashed && t && t.type === "persona" && n && n.type === "device" || !e.kind && e.dashed && t && (t.type === "container" || t.type === "external") && n && n.type === "device" ? "link" : null;
|
|
1032
|
+
}
|
|
1033
|
+
var Se = [
|
|
1034
|
+
"persona",
|
|
1035
|
+
"machine",
|
|
1036
|
+
"stack",
|
|
1037
|
+
"floor",
|
|
1038
|
+
"external"
|
|
1039
|
+
];
|
|
1040
|
+
function Ce(e, t) {
|
|
1041
|
+
let n = t.house;
|
|
1042
|
+
e.decor.rings = [], e.decor.lanes = n && n.lanes ? n.lanes : [];
|
|
1043
|
+
for (let t of e.nodes) t.type === "room" ? (t.label = "", t.labelKeep = !1) : Se.includes(t.type) && (t.labelKeep = !0);
|
|
1044
|
+
return n && n.cloudIds && n.cloudIds.size && Oe(e, t), e;
|
|
1045
|
+
}
|
|
1046
|
+
var we = {
|
|
1047
|
+
run: .9,
|
|
1048
|
+
deploy: .25,
|
|
1049
|
+
renew: .9
|
|
1050
|
+
}, Te = {
|
|
1051
|
+
alpha: .9,
|
|
1052
|
+
width: 2.2
|
|
1053
|
+
}, Ee = Object.keys(k), De = (e) => Ee.find((t) => k[t].ticks === (e.ticks || 0)) || "run";
|
|
1054
|
+
function Oe(e, t) {
|
|
1055
|
+
let n = t.house, r = t.scenario ? ge(t.scenario, t.nodes, t.edges) : null, i = !t.scenario && !!t.selectedNode, a = new Map((n.cloudLines || []).map((e) => [`${e.from}->${e.to}|${e.when}`, e])), o = r ? new Set(r.down) : null;
|
|
1056
|
+
e.edges = e.edges.filter((e) => {
|
|
1057
|
+
if (e.kind !== "calls" || !n.cloudIds.has(e.to)) return !0;
|
|
1058
|
+
let t = De(e);
|
|
1059
|
+
if (r) {
|
|
1060
|
+
let i = a.get(`${e.from}->${e.to}|${t}`), s = o.has(e.to) ? "run" : r.hits.has(e.to) ? r.hits.get(e.to).when : null;
|
|
1061
|
+
if (i && s) {
|
|
1062
|
+
let n = Ee[Math.max(Ee.indexOf(s), Ee.indexOf(t))];
|
|
1063
|
+
return Object.assign(e, {
|
|
1064
|
+
color: k[n].color,
|
|
1065
|
+
alpha: Math.max(e.alpha, Te.alpha),
|
|
1066
|
+
width: Math.max(e.width, Te.width)
|
|
1067
|
+
}), e.glow && (e.glowColor = e.color), !0;
|
|
1068
|
+
}
|
|
1069
|
+
return !n.phone || r.edges.has(`${e.from}->${e.to}`);
|
|
1070
|
+
}
|
|
1071
|
+
return i ? !n.phone || e.alpha >= .5 : !n.phone && (e.alpha = we[t], !0);
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1074
|
+
// ../explorer/check-model.js
|
|
1075
|
+
var ke = {
|
|
1076
|
+
allowed: "#4ade80",
|
|
1077
|
+
refused: "#ff2d55",
|
|
1078
|
+
mismatch: "#fbbf24"
|
|
1079
|
+
}, Ae = 18, je = 4.5;
|
|
1080
|
+
function Me(e, t) {
|
|
1081
|
+
return e.from !== t.from || e.to !== t.to ? !1 : t.kind ? e.kind === t.kind && (!t.flow || e.key.split("|")[2] === t.flow) : e.kind === "ownership" || e.kind === "usage";
|
|
1082
|
+
}
|
|
1083
|
+
function Ne(e, t) {
|
|
1084
|
+
let n = t && t.verdict;
|
|
1085
|
+
if (!n || t.done) return;
|
|
1086
|
+
let r = n.mismatch ? ke.mismatch : ke[n.state];
|
|
1087
|
+
if (!r) return;
|
|
1088
|
+
let { node: i, edge: a } = t.current;
|
|
1089
|
+
if (i !== void 0) {
|
|
1090
|
+
let t = e.nodes.find((e) => e.id === i);
|
|
1091
|
+
t && (t.color = r, t.glow = Math.max(t.glow || 0, Ae));
|
|
1092
|
+
} else a && e.edges.forEach((e) => {
|
|
1093
|
+
Me(e, a) && (e.color = r, e.glowColor = r, e.glow = Math.max(e.glow || 0, Ae), e.width = Math.max(e.width || 0, je), e.packet &&= n.state === "refused" && !n.mismatch ? {
|
|
1094
|
+
...e.packet,
|
|
1095
|
+
color: r,
|
|
1096
|
+
glowColor: r,
|
|
1097
|
+
speed: 0,
|
|
1098
|
+
phase: .5
|
|
1099
|
+
} : {
|
|
1100
|
+
...e.packet,
|
|
1101
|
+
glowColor: r
|
|
1102
|
+
});
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
// ../core/layers.js
|
|
1106
|
+
var Pe = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/, Fe = Object.freeze([
|
|
1107
|
+
"key",
|
|
1108
|
+
"label",
|
|
1109
|
+
"desc",
|
|
1110
|
+
"match"
|
|
1111
|
+
]), N = Object.freeze([
|
|
1112
|
+
"type",
|
|
1113
|
+
"kind",
|
|
1114
|
+
"parent",
|
|
1115
|
+
"field"
|
|
1116
|
+
]), Ie = Object.freeze([
|
|
1117
|
+
"add",
|
|
1118
|
+
"off",
|
|
1119
|
+
"order"
|
|
1120
|
+
]), Le = /^[A-Za-z][A-Za-z0-9_]*$/, Re = Object.freeze([
|
|
1121
|
+
"root",
|
|
1122
|
+
"external",
|
|
1123
|
+
"floor",
|
|
1124
|
+
"room"
|
|
1125
|
+
]), ze = Object.freeze([
|
|
1126
|
+
{
|
|
1127
|
+
key: "app",
|
|
1128
|
+
label: "Apps",
|
|
1129
|
+
desc: "Subdomains",
|
|
1130
|
+
match: { type: "app" }
|
|
1131
|
+
},
|
|
1132
|
+
{
|
|
1133
|
+
key: "pkg",
|
|
1134
|
+
label: "Packages",
|
|
1135
|
+
desc: "Libraries",
|
|
1136
|
+
match: { type: "pkg" }
|
|
1137
|
+
},
|
|
1138
|
+
{
|
|
1139
|
+
key: "page",
|
|
1140
|
+
label: "Pages & Routes",
|
|
1141
|
+
desc: "Routes",
|
|
1142
|
+
match: { type: "page" }
|
|
1143
|
+
},
|
|
1144
|
+
{
|
|
1145
|
+
key: "atom",
|
|
1146
|
+
label: "Atoms",
|
|
1147
|
+
desc: "Base Components",
|
|
1148
|
+
match: { type: "atom" }
|
|
1149
|
+
},
|
|
1150
|
+
{
|
|
1151
|
+
key: "molecule",
|
|
1152
|
+
label: "Molecules",
|
|
1153
|
+
desc: "Composites",
|
|
1154
|
+
match: { type: "molecule" }
|
|
1155
|
+
},
|
|
1156
|
+
{
|
|
1157
|
+
key: "token",
|
|
1158
|
+
label: "Design Tokens",
|
|
1159
|
+
desc: "Pollen CSS",
|
|
1160
|
+
match: { type: "token" }
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
key: "tool",
|
|
1164
|
+
label: "Dev Tools",
|
|
1165
|
+
desc: "Utilities",
|
|
1166
|
+
match: { type: "tool" }
|
|
1167
|
+
},
|
|
1168
|
+
{
|
|
1169
|
+
key: "flow",
|
|
1170
|
+
label: "Data Flow",
|
|
1171
|
+
desc: "Tiers & sync",
|
|
1172
|
+
match: null
|
|
1173
|
+
},
|
|
1174
|
+
{
|
|
1175
|
+
key: "core",
|
|
1176
|
+
label: "Core",
|
|
1177
|
+
desc: "The shared core: what the apps and packages are built on. Shows with Packages or Atoms",
|
|
1178
|
+
match: { type: "core" }
|
|
1179
|
+
},
|
|
1180
|
+
{
|
|
1181
|
+
key: "store",
|
|
1182
|
+
label: "Stores",
|
|
1183
|
+
desc: "Storage tiers and the ends of the data flows. Shows with Data Flow",
|
|
1184
|
+
match: { type: "store" }
|
|
1185
|
+
},
|
|
1186
|
+
{
|
|
1187
|
+
key: "table",
|
|
1188
|
+
label: "Tables",
|
|
1189
|
+
desc: "SQLite tables, reads & writes",
|
|
1190
|
+
match: { type: "table" }
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
key: "rom",
|
|
1194
|
+
label: "ROM",
|
|
1195
|
+
desc: "Render on Mutation",
|
|
1196
|
+
match: { type: "rom" }
|
|
1197
|
+
},
|
|
1198
|
+
{
|
|
1199
|
+
key: "service",
|
|
1200
|
+
label: "Services",
|
|
1201
|
+
desc: "API jobs, webhooks and hooks",
|
|
1202
|
+
match: { type: "service" }
|
|
1203
|
+
},
|
|
1204
|
+
{
|
|
1205
|
+
key: "cloud",
|
|
1206
|
+
label: "Cloud",
|
|
1207
|
+
desc: "Services outside the house that we do not control: what runs, where software comes from, accounts (topology.cloud.json)",
|
|
1208
|
+
match: {
|
|
1209
|
+
type: "external",
|
|
1210
|
+
kind: "cloud"
|
|
1211
|
+
}
|
|
1212
|
+
},
|
|
1213
|
+
{
|
|
1214
|
+
key: "web",
|
|
1215
|
+
label: "Public web",
|
|
1216
|
+
desc: "Any public page or picture a person points us at: not cloud",
|
|
1217
|
+
match: {
|
|
1218
|
+
type: "external",
|
|
1219
|
+
kind: "web"
|
|
1220
|
+
}
|
|
1221
|
+
},
|
|
1222
|
+
{
|
|
1223
|
+
key: "stack",
|
|
1224
|
+
label: "Infra",
|
|
1225
|
+
desc: "Compose stacks and the domains they serve",
|
|
1226
|
+
match: { type: "stack" }
|
|
1227
|
+
},
|
|
1228
|
+
{
|
|
1229
|
+
key: "machine",
|
|
1230
|
+
label: "Machines",
|
|
1231
|
+
desc: "The computers the code runs on, placed in their room from the inventory (live)",
|
|
1232
|
+
match: { type: "machine" },
|
|
1233
|
+
live: !0
|
|
1234
|
+
},
|
|
1235
|
+
{
|
|
1236
|
+
key: "container",
|
|
1237
|
+
label: "Containers",
|
|
1238
|
+
desc: "One service of a stack, from its compose file",
|
|
1239
|
+
match: { type: "container" }
|
|
1240
|
+
},
|
|
1241
|
+
{
|
|
1242
|
+
key: "device",
|
|
1243
|
+
label: "Devices",
|
|
1244
|
+
desc: "Cameras, and live: phones, NFC tags, Home Assistant devices",
|
|
1245
|
+
match: { type: "device" },
|
|
1246
|
+
live: !0
|
|
1247
|
+
},
|
|
1248
|
+
{
|
|
1249
|
+
key: "house",
|
|
1250
|
+
label: "House",
|
|
1251
|
+
desc: "Floors and rooms (live)",
|
|
1252
|
+
match: { type: ["floor", "room"] },
|
|
1253
|
+
live: !0
|
|
1254
|
+
},
|
|
1255
|
+
{
|
|
1256
|
+
key: "runs",
|
|
1257
|
+
label: "Runs in flight",
|
|
1258
|
+
desc: "A pulsing ring on the nodes an open agent run is changing; a dashed ring and a warning where two runs change the same node",
|
|
1259
|
+
match: null,
|
|
1260
|
+
overlay: !0
|
|
1261
|
+
},
|
|
1262
|
+
{
|
|
1263
|
+
key: "persona",
|
|
1264
|
+
label: "People",
|
|
1265
|
+
desc: "Personas, with a live count of their accounts (never a name)",
|
|
1266
|
+
match: { type: "persona" },
|
|
1267
|
+
live: !0
|
|
1268
|
+
}
|
|
1269
|
+
]), Be = Object.freeze(ze.map((e) => e.key)), Ve = new Set(Be), He = Object.keys(E), P = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ue = /* @__PURE__ */ RegExp("[\\u0000-\\u001f\\u007f-\\u009f\\u2028\\u2029]"), F = (e) => typeof e == "string" ? `"${e.length > 40 ? `${e.slice(0, 40)}…` : e}"` : typeof e == "number" || typeof e == "boolean" ? String(e) : Array.isArray(e) ? "a list" : e === null ? "null" : typeof e, We = (e) => typeof e == "string" && e.length > 0 && e.length <= 80 && !Ue.test(e) || typeof e == "number" && Number.isFinite(e) || typeof e == "boolean", Ge = /^[a-z0-9]+(-[a-z0-9]+)*$/, Ke = new Set(He), qe = (e, t) => Ke.has(e) && typeof t == "string" && t.length <= 32 && Ge.test(t) ? `--corn-map-kind-${e}-${t}` : null, Je = (e) => typeof e == "string" && e.length <= 32 && Pe.test(e) ? `--corn-map-group-${e}` : null, Ye = ({ type: e, kind: t, layer: n, group: r }) => [
|
|
1270
|
+
qe(e, t),
|
|
1271
|
+
n ? Je(n) : null,
|
|
1272
|
+
`--corn-map-node-${e}`,
|
|
1273
|
+
`--corn-map-group-${r || e}`
|
|
1274
|
+
].filter(Boolean);
|
|
1275
|
+
function Xe(e) {
|
|
1276
|
+
if (typeof e != "string") return null;
|
|
1277
|
+
if (Ke.has(e)) return { type: e };
|
|
1278
|
+
let t = e.indexOf(":");
|
|
1279
|
+
if (t < 0) return null;
|
|
1280
|
+
let n = e.slice(0, t), r = e.slice(t + 1);
|
|
1281
|
+
return n === "layer" ? Pe.test(r) && r.length <= 32 ? { layer: r } : null : Ke.has(n) && Ge.test(r) && r.length <= 32 ? {
|
|
1282
|
+
type: n,
|
|
1283
|
+
kind: r
|
|
1284
|
+
} : null;
|
|
1285
|
+
}
|
|
1286
|
+
function Ze(e, t, n) {
|
|
1287
|
+
let r = [];
|
|
1288
|
+
return typeof t == "string" && Ge.test(t) && t.length <= 32 && r.push(`${e}:${t}`), n && r.push(`layer:${n}`), r.push(e), r;
|
|
1289
|
+
}
|
|
1290
|
+
var Qe = /* @__PURE__ */ new WeakMap();
|
|
1291
|
+
function $e(e) {
|
|
1292
|
+
let t = Qe.get(e);
|
|
1293
|
+
if (t && t.length === e.length) return t.map;
|
|
1294
|
+
let n = /* @__PURE__ */ new Map();
|
|
1295
|
+
for (let t of e) t && !t.dashed && !t.kind && t.from && t.to && t.from !== t.to && !n.has(t.to) && n.set(t.to, t.from);
|
|
1296
|
+
return Qe.set(e, {
|
|
1297
|
+
length: e.length,
|
|
1298
|
+
map: n
|
|
1299
|
+
}), n;
|
|
1300
|
+
}
|
|
1301
|
+
var I = (e, t) => Array.isArray(e) ? e.includes(t) : e === t;
|
|
1302
|
+
function et(e, t, n) {
|
|
1303
|
+
if (!P(e)) return !1;
|
|
1304
|
+
let r = !1;
|
|
1305
|
+
if (e.type !== void 0 && (r = !0, !I(e.type, t.type)) || e.kind !== void 0 && (r = !0, !I(e.kind, t.kind)) || e.parent !== void 0 && (r = !0, !n || !I(e.parent, n(t)))) return !1;
|
|
1306
|
+
if (e.field !== void 0) {
|
|
1307
|
+
r = !0;
|
|
1308
|
+
for (let n of Object.keys(e.field)) {
|
|
1309
|
+
if (!Object.hasOwn(t, n)) return !1;
|
|
1310
|
+
let r = t[n], i = e.field[n];
|
|
1311
|
+
if (!(Array.isArray(r) ? r.some((e) => I(i, e)) : I(i, r))) return !1;
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
return r;
|
|
1315
|
+
}
|
|
1316
|
+
var tt = [...ze.filter((e) => e.match)].sort((e, t) => Number("kind" in t.match) - Number("kind" in e.match));
|
|
1317
|
+
function nt(e) {
|
|
1318
|
+
if (e.type === "root") return null;
|
|
1319
|
+
if (e.type === "external") return e.kind === "web" ? "web" : "cloud";
|
|
1320
|
+
for (let t of tt) if (et(t.match, e)) return t.key;
|
|
1321
|
+
return e.type;
|
|
1322
|
+
}
|
|
1323
|
+
function rt(e, t, n) {
|
|
1324
|
+
if (!e || !e.length || t.type === "root") return null;
|
|
1325
|
+
for (let r of e) if (et(r.match, t, n)) return r.key;
|
|
1326
|
+
return null;
|
|
1327
|
+
}
|
|
1328
|
+
var it = (e, t, n) => rt(e, t, n) || nt(t), at = `${He.slice(0, 5).join(", ")}, …`, ot = (e) => {
|
|
1329
|
+
let t = (Array.isArray(e) ? e : []).map((e) => P(e) && typeof e.key == "string" ? e.key : null).filter((e) => e && Pe.test(e));
|
|
1330
|
+
return `${Be.slice(0, 3).join(", ")}, …${t.length ? `, ${t[t.length - 1]}` : ""}`;
|
|
1331
|
+
};
|
|
1332
|
+
function st(e, t, n, r) {
|
|
1333
|
+
return Array.isArray(n) ? (n.length ? n.length > 20 && r.push(`${e}.${t} has ${n.length} values: at most 20.`) : r.push(`${e}.${t} is an empty list: give at least one value, or leave the key out.`), n.length <= 20 ? n : []) : [n];
|
|
1334
|
+
}
|
|
1335
|
+
function ct(e, t, n) {
|
|
1336
|
+
if (!P(t)) n.push(`${e}.match is { type, kind, parent, field }: say at least one of them.`);
|
|
1337
|
+
else {
|
|
1338
|
+
for (let r of Object.keys(t)) N.includes(r) || n.push(`${e}.match has unknown key "${r}": known: ${N.join(", ")}. A match is data: no pattern, no function.`);
|
|
1339
|
+
if (!Object.keys(t).some((e) => N.includes(e))) Object.keys(t).length || n.push(`${e}.match is empty: say at least one of ${N.join(", ")}.`);
|
|
1340
|
+
else {
|
|
1341
|
+
if ("type" in t) for (let r of st(`${e}.match`, "type", t.type, n)) typeof r == "string" && He.includes(r) || n.push(`${e}.match.type ${F(r)} is not a node type (${at}).`);
|
|
1342
|
+
if ("kind" in t) for (let r of st(`${e}.match`, "kind", t.kind, n)) (typeof r != "string" || !r || r.length > 80 || Ue.test(r)) && n.push(`${e}.match.kind ${F(r)}: a kind is text, one line, at most 80 characters.`);
|
|
1343
|
+
if ("parent" in t) for (let r of st(`${e}.match`, "parent", t.parent, n)) (typeof r != "string" || !r || r.length > 200 || Ue.test(r)) && n.push(`${e}.match.parent ${F(r)}: a parent is a node id (text), like "pkg-core".`);
|
|
1344
|
+
if ("field" in t) {
|
|
1345
|
+
let r = t.field;
|
|
1346
|
+
if (!P(r)) {
|
|
1347
|
+
n.push(`${e}.match.field is { name: value }: a node field and the value (or list of values) it must have.`);
|
|
1348
|
+
return;
|
|
1349
|
+
}
|
|
1350
|
+
let i = Object.keys(r);
|
|
1351
|
+
i.length || n.push(`${e}.match.field is empty: name a field, like { audience: 'household' }.`), i.length > 4 && n.push(`${e}.match.field names ${i.length} fields: at most 4.`);
|
|
1352
|
+
for (let t of i.slice(0, 20)) {
|
|
1353
|
+
if (!Le.test(t) || t.length > 40) {
|
|
1354
|
+
n.push(`${e}.match.field "${t.slice(0, 40)}": a field name is letters, digits and "_", starting with a letter.`);
|
|
1355
|
+
continue;
|
|
1356
|
+
}
|
|
1357
|
+
if ([
|
|
1358
|
+
"type",
|
|
1359
|
+
"kind",
|
|
1360
|
+
"parent"
|
|
1361
|
+
].includes(t)) {
|
|
1362
|
+
n.push(`${e}.match.field.${t}: use the match key "${t}" itself, not a field.`);
|
|
1363
|
+
continue;
|
|
1364
|
+
}
|
|
1365
|
+
let i = Array.isArray(r[t]) ? r[t] : [r[t]];
|
|
1366
|
+
Array.isArray(r[t]) && (!i.length || i.length > 20) ? n.push(`${e}.match.field.${t} is a list of ${i.length}: one to 20 values.`) : i.every(We) || n.push(`${e}.match.field.${t}: a value is text, a number, true or false, or a list of them.`);
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
function lt(e) {
|
|
1373
|
+
if (e === void 0) return [];
|
|
1374
|
+
if (!P(e)) return ["\"layers\" is an object: { add: [{ key, label, match }], off: [keys], order: [keys] }."];
|
|
1375
|
+
let t = [];
|
|
1376
|
+
for (let n of Object.keys(e)) Ie.includes(n) || t.push(`layers has unknown key "${n}": known: ${Ie.join(", ")}.`);
|
|
1377
|
+
let n = e.add;
|
|
1378
|
+
n !== void 0 && !Array.isArray(n) && t.push("layers.add is a list of project layers: [{ key, label, desc?, match }].");
|
|
1379
|
+
let r = Array.isArray(n) ? n : [];
|
|
1380
|
+
r.length > 24 && t.push(`layers.add has ${r.length} layers: at most 24.`);
|
|
1381
|
+
let i = /* @__PURE__ */ new Map();
|
|
1382
|
+
r.slice(0, 100).forEach((e, n) => {
|
|
1383
|
+
let r = `layers.add[${n}]`;
|
|
1384
|
+
if (!P(e)) {
|
|
1385
|
+
t.push(`${r} is { key, label, desc?, match }.`);
|
|
1386
|
+
return;
|
|
1387
|
+
}
|
|
1388
|
+
for (let n of Object.keys(e)) {
|
|
1389
|
+
if (Fe.includes(n)) continue;
|
|
1390
|
+
let e = /^colou?r$|^icon$|^fill$/i.test(n) ? " Colours and icons are the theme's." : n === "on" || n === "hide" ? " Whether a layer starts off is layers.off." : "";
|
|
1391
|
+
t.push(`${r} has unknown key "${n}": known: ${Fe.join(", ")}.${e}`);
|
|
1392
|
+
}
|
|
1393
|
+
let a = e.key;
|
|
1394
|
+
typeof a == "string" ? Ve.has(a) ? t.push(`${r}.key ${F(a)} is a starting layer: pick another key.`) : Re.includes(a) ? t.push(`${r}.key ${F(a)} is reserved (a node type): pick another key.`) : !Pe.test(a) || a.length > 32 ? t.push(`${r}.key ${F(a)}: lower-case words joined by "-", like "edge-stack"${a.length > 32 ? ", at most 32 characters" : ""}.`) : i.has(a) ? t.push(`${r}.key ${F(a)} is also layers.add[${i.get(a)}].key: a key is used once.`) : i.set(a, n) : t.push(`${r}.key is required: lower-case words joined by "-", like "edge-stack".`);
|
|
1395
|
+
let o = (n, i, a) => {
|
|
1396
|
+
let o = e[n];
|
|
1397
|
+
o === void 0 ? a && t.push(`${r}.${n} is required: plain text, one line, at most ${i} characters.`) : typeof o != "string" || !o.trim() ? t.push(`${r}.${n} ${F(o)}: plain text, one line, at most ${i} characters.`) : Ue.test(o) ? t.push(`${r}.${n}: one line of plain text (no line break or control character).`) : [...o].length > i && t.push(`${r}.${n} is ${[...o].length} characters: at most ${i}.`);
|
|
1398
|
+
};
|
|
1399
|
+
o("label", 40, !0), o("desc", 120, !1), e.match === void 0 ? t.push(`${r}.match is required: say at least one of ${N.join(", ")}.`) : ct(r, e.match, t);
|
|
1400
|
+
});
|
|
1401
|
+
let a = /* @__PURE__ */ new Set([...Be, ...r.map((e) => P(e) && typeof e.key == "string" ? e.key : null).filter(Boolean)]);
|
|
1402
|
+
for (let r of ["off", "order"]) {
|
|
1403
|
+
let i = e[r];
|
|
1404
|
+
if (i === void 0) continue;
|
|
1405
|
+
if (!Array.isArray(i)) {
|
|
1406
|
+
t.push(`layers.${r} is a list of layer keys: ['${r === "off" ? "timers" : "app"}', …].`);
|
|
1407
|
+
continue;
|
|
1408
|
+
}
|
|
1409
|
+
let o = /* @__PURE__ */ new Set();
|
|
1410
|
+
i.forEach((e) => {
|
|
1411
|
+
typeof e != "string" || !a.has(e) ? t.push(`layers.${r} ${F(e)} is not a layer (${ot(n)}).`) : o.has(e) && t.push(`layers.${r} ${F(e)} is listed twice.`), o.add(e);
|
|
1412
|
+
});
|
|
1413
|
+
}
|
|
1414
|
+
return t;
|
|
1415
|
+
}
|
|
1416
|
+
function ut(e) {
|
|
1417
|
+
let t = {
|
|
1418
|
+
add: [],
|
|
1419
|
+
off: [],
|
|
1420
|
+
order: []
|
|
1421
|
+
};
|
|
1422
|
+
if (!P(e) || lt(e).length) return t;
|
|
1423
|
+
let n = (e) => Array.isArray(e) ? e.slice(0, 20) : e;
|
|
1424
|
+
return {
|
|
1425
|
+
add: (e.add || []).map((e) => {
|
|
1426
|
+
let t = e.match, r = {};
|
|
1427
|
+
t.type !== void 0 && (r.type = n(t.type)), t.kind !== void 0 && (r.kind = n(t.kind)), t.parent !== void 0 && (r.parent = n(t.parent)), t.field !== void 0 && (r.field = Object.fromEntries(Object.keys(t.field).map((e) => [e, n(t.field[e])])));
|
|
1428
|
+
let i = {
|
|
1429
|
+
key: e.key,
|
|
1430
|
+
label: e.label.trim(),
|
|
1431
|
+
match: r
|
|
1432
|
+
};
|
|
1433
|
+
return typeof e.desc == "string" && e.desc.trim() && (i.desc = e.desc.trim()), i;
|
|
1434
|
+
}),
|
|
1435
|
+
off: [...e.off || []],
|
|
1436
|
+
order: [...e.order || []]
|
|
1437
|
+
};
|
|
1438
|
+
}
|
|
1439
|
+
function dt(e) {
|
|
1440
|
+
let t = /* @__PURE__ */ new Map();
|
|
1441
|
+
for (let n of e) typeof n.kind == "string" && n.kind && (t.has(n.type) || t.set(n.type, /* @__PURE__ */ new Set()), t.get(n.type).add(n.kind));
|
|
1442
|
+
let n = /* @__PURE__ */ new Map();
|
|
1443
|
+
for (let [e, r] of t) {
|
|
1444
|
+
let t = [...r].sort(), i = t.map((e) => [...e.slice(0, 4).toLowerCase()].slice(0, 2)), a = /* @__PURE__ */ new Map();
|
|
1445
|
+
t.forEach((e, t) => {
|
|
1446
|
+
let n = i[t][0], r = i.some((e, r) => r !== t && e[0] === n);
|
|
1447
|
+
a.set(e, r ? i[t].join("") : n);
|
|
1448
|
+
}), n.set(e, a);
|
|
1449
|
+
}
|
|
1450
|
+
return n;
|
|
1451
|
+
}
|
|
1452
|
+
// ../explorer/layer-model.js
|
|
1453
|
+
var ft = (e) => (e.projectLayers || []).some((e) => e.match && e.match.parent !== void 0) ? (t) => $e(e.edges || []).get(t.id) : void 0;
|
|
1454
|
+
function pt(e, t) {
|
|
1455
|
+
let n = e.projectLayers;
|
|
1456
|
+
return !n || !n.length ? null : rt(n, t, ft(e));
|
|
1457
|
+
}
|
|
1458
|
+
var mt = (e, t) => it(e.projectLayers || [], t, ft(e)), ht = /* @__PURE__ */ new WeakMap();
|
|
1459
|
+
function gt(e) {
|
|
1460
|
+
let t = e.edges || [], n = ht.get(e.nodes);
|
|
1461
|
+
if (n && n.edges === t && n.n === e.nodes.length && n.e === t.length) return n.touched;
|
|
1462
|
+
let r = S(e.nodes, t).touched;
|
|
1463
|
+
return ht.set(e.nodes, {
|
|
1464
|
+
edges: t,
|
|
1465
|
+
n: e.nodes.length,
|
|
1466
|
+
e: t.length,
|
|
1467
|
+
touched: r
|
|
1468
|
+
}), r;
|
|
1469
|
+
}
|
|
1470
|
+
var _t = (e, t) => !!e.proposal && gt(e).has(t.id), vt = /* @__PURE__ */ new WeakMap();
|
|
1471
|
+
function yt(e, t) {
|
|
1472
|
+
if (typeof t.kind != "string" || !t.kind || t.type === "external") return "";
|
|
1473
|
+
let n = vt.get(e.nodes);
|
|
1474
|
+
n && n.n === e.nodes.length || (n = {
|
|
1475
|
+
n: e.nodes.length,
|
|
1476
|
+
map: dt(e.nodes)
|
|
1477
|
+
}, vt.set(e.nodes, n));
|
|
1478
|
+
let r = n.map.get(t.type);
|
|
1479
|
+
return r && r.get(t.kind) || "";
|
|
1480
|
+
}
|
|
1481
|
+
var bt = Object.freeze({
|
|
1482
|
+
core: ["pkg"],
|
|
1483
|
+
store: ["flow"],
|
|
1484
|
+
rom: ["flow"]
|
|
1485
|
+
}), xt = (e) => !!e && !!e.mark && e.mark !== "none";
|
|
1486
|
+
function St({ nodes: e, edges: t, rowOf: n, flight: r = null }) {
|
|
1487
|
+
let { touched: i } = S(e, t), a = /* @__PURE__ */ new Set();
|
|
1488
|
+
for (let t of e) {
|
|
1489
|
+
if (!i.has(t.id)) continue;
|
|
1490
|
+
let e = n(t);
|
|
1491
|
+
if (e) {
|
|
1492
|
+
a.add(e);
|
|
1493
|
+
for (let t of bt[e] || []) a.add(t);
|
|
1494
|
+
}
|
|
1495
|
+
r && r.has(t.id) && a.add("runs");
|
|
1496
|
+
}
|
|
1497
|
+
for (let e of t) xt(e) && e.kind === "flow" && a.add("flow");
|
|
1498
|
+
return a;
|
|
1499
|
+
}
|
|
1500
|
+
function Ct({ active: e, touched: t, universe: n, review: r }) {
|
|
1501
|
+
let i = { ...e };
|
|
1502
|
+
if (!r.whole && t.size) for (let e of n) i[e] = t.has(e);
|
|
1503
|
+
return Object.assign(i, r.manual || {}, r.step || {}), i;
|
|
1504
|
+
}
|
|
1505
|
+
var wt = /* @__PURE__ */ new WeakMap();
|
|
1506
|
+
function Tt(e) {
|
|
1507
|
+
let t = e.nodes, n = e.edges || [], r = e.runsMap ? e.runsMap.flight : null, i = wt.get(t);
|
|
1508
|
+
if (i && i.edges === n && i.n === t.length && i.e === n.length && i.flight === r && i.project === e.projectLayers) return i;
|
|
1509
|
+
let a = St({
|
|
1510
|
+
nodes: t,
|
|
1511
|
+
edges: n,
|
|
1512
|
+
rowOf: (t) => mt(e, t),
|
|
1513
|
+
flight: r
|
|
1514
|
+
}), o = /* @__PURE__ */ new Set([
|
|
1515
|
+
...ze.map((e) => e.key),
|
|
1516
|
+
...(e.projectLayers || []).map((e) => e.key),
|
|
1517
|
+
...t.map((t) => mt(e, t)).filter(Boolean)
|
|
1518
|
+
]), s = {
|
|
1519
|
+
edges: n,
|
|
1520
|
+
n: t.length,
|
|
1521
|
+
e: n.length,
|
|
1522
|
+
flight: r,
|
|
1523
|
+
project: e.projectLayers,
|
|
1524
|
+
touched: a,
|
|
1525
|
+
universe: o
|
|
1526
|
+
};
|
|
1527
|
+
return wt.set(t, s), s;
|
|
1528
|
+
}
|
|
1529
|
+
var Et = /* @__PURE__ */ new WeakMap();
|
|
1530
|
+
function Dt(e) {
|
|
1531
|
+
let t = e.review;
|
|
1532
|
+
if (!t || !e.proposal) return e.activeLayers;
|
|
1533
|
+
let n = Et.get(t);
|
|
1534
|
+
if (n && n.rev === t.rev && n.version === e.sceneVersion && n.active === e.activeLayers && n.nodes === e.nodes) return n.out;
|
|
1535
|
+
let { touched: r, universe: i } = Tt(e), a = Ct({
|
|
1536
|
+
active: e.activeLayers,
|
|
1537
|
+
touched: r,
|
|
1538
|
+
universe: i,
|
|
1539
|
+
review: t
|
|
1540
|
+
});
|
|
1541
|
+
return Et.set(t, {
|
|
1542
|
+
rev: t.rev,
|
|
1543
|
+
version: e.sceneVersion,
|
|
1544
|
+
active: e.activeLayers,
|
|
1545
|
+
nodes: e.nodes,
|
|
1546
|
+
out: a
|
|
1547
|
+
}), a;
|
|
1548
|
+
}
|
|
1549
|
+
var Ot = (e) => !!e.review && !!e.proposal && !e.review.whole && gt(e).size > 0, kt = Object.freeze({
|
|
1550
|
+
aliceblue: "#f0f8ff",
|
|
1551
|
+
antiquewhite: "#faebd7",
|
|
1552
|
+
aqua: "#00ffff",
|
|
1553
|
+
aquamarine: "#7fffd4",
|
|
1554
|
+
azure: "#f0ffff",
|
|
1555
|
+
beige: "#f5f5dc",
|
|
1556
|
+
bisque: "#ffe4c4",
|
|
1557
|
+
black: "#000000",
|
|
1558
|
+
blanchedalmond: "#ffebcd",
|
|
1559
|
+
blue: "#0000ff",
|
|
1560
|
+
blueviolet: "#8a2be2",
|
|
1561
|
+
brown: "#a52a2a",
|
|
1562
|
+
burlywood: "#deb887",
|
|
1563
|
+
cadetblue: "#5f9ea0",
|
|
1564
|
+
chartreuse: "#7fff00",
|
|
1565
|
+
chocolate: "#d2691e",
|
|
1566
|
+
coral: "#ff7f50",
|
|
1567
|
+
cornflowerblue: "#6495ed",
|
|
1568
|
+
cornsilk: "#fff8dc",
|
|
1569
|
+
crimson: "#dc143c",
|
|
1570
|
+
cyan: "#00ffff",
|
|
1571
|
+
darkblue: "#00008b",
|
|
1572
|
+
darkcyan: "#008b8b",
|
|
1573
|
+
darkgoldenrod: "#b8860b",
|
|
1574
|
+
darkgray: "#a9a9a9",
|
|
1575
|
+
darkgreen: "#006400",
|
|
1576
|
+
darkgrey: "#a9a9a9",
|
|
1577
|
+
darkkhaki: "#bdb76b",
|
|
1578
|
+
darkmagenta: "#8b008b",
|
|
1579
|
+
darkolivegreen: "#556b2f",
|
|
1580
|
+
darkorange: "#ff8c00",
|
|
1581
|
+
darkorchid: "#9932cc",
|
|
1582
|
+
darkred: "#8b0000",
|
|
1583
|
+
darksalmon: "#e9967a",
|
|
1584
|
+
darkseagreen: "#8fbc8f",
|
|
1585
|
+
darkslateblue: "#483d8b",
|
|
1586
|
+
darkslategray: "#2f4f4f",
|
|
1587
|
+
darkslategrey: "#2f4f4f",
|
|
1588
|
+
darkturquoise: "#00ced1",
|
|
1589
|
+
darkviolet: "#9400d3",
|
|
1590
|
+
deeppink: "#ff1493",
|
|
1591
|
+
deepskyblue: "#00bfff",
|
|
1592
|
+
dimgray: "#696969",
|
|
1593
|
+
dimgrey: "#696969",
|
|
1594
|
+
dodgerblue: "#1e90ff",
|
|
1595
|
+
firebrick: "#b22222",
|
|
1596
|
+
floralwhite: "#fffaf0",
|
|
1597
|
+
forestgreen: "#228b22",
|
|
1598
|
+
fuchsia: "#ff00ff",
|
|
1599
|
+
gainsboro: "#dcdcdc",
|
|
1600
|
+
ghostwhite: "#f8f8ff",
|
|
1601
|
+
gold: "#ffd700",
|
|
1602
|
+
goldenrod: "#daa520",
|
|
1603
|
+
gray: "#808080",
|
|
1604
|
+
green: "#008000",
|
|
1605
|
+
greenyellow: "#adff2f",
|
|
1606
|
+
grey: "#808080",
|
|
1607
|
+
honeydew: "#f0fff0",
|
|
1608
|
+
hotpink: "#ff69b4",
|
|
1609
|
+
indianred: "#cd5c5c",
|
|
1610
|
+
indigo: "#4b0082",
|
|
1611
|
+
ivory: "#fffff0",
|
|
1612
|
+
khaki: "#f0e68c",
|
|
1613
|
+
lavender: "#e6e6fa",
|
|
1614
|
+
lavenderblush: "#fff0f5",
|
|
1615
|
+
lawngreen: "#7cfc00",
|
|
1616
|
+
lemonchiffon: "#fffacd",
|
|
1617
|
+
lightblue: "#add8e6",
|
|
1618
|
+
lightcoral: "#f08080",
|
|
1619
|
+
lightcyan: "#e0ffff",
|
|
1620
|
+
lightgoldenrodyellow: "#fafad2",
|
|
1621
|
+
lightgray: "#d3d3d3",
|
|
1622
|
+
lightgreen: "#90ee90",
|
|
1623
|
+
lightgrey: "#d3d3d3",
|
|
1624
|
+
lightpink: "#ffb6c1",
|
|
1625
|
+
lightsalmon: "#ffa07a",
|
|
1626
|
+
lightseagreen: "#20b2aa",
|
|
1627
|
+
lightskyblue: "#87cefa",
|
|
1628
|
+
lightslategray: "#778899",
|
|
1629
|
+
lightslategrey: "#778899",
|
|
1630
|
+
lightsteelblue: "#b0c4de",
|
|
1631
|
+
lightyellow: "#ffffe0",
|
|
1632
|
+
lime: "#00ff00",
|
|
1633
|
+
limegreen: "#32cd32",
|
|
1634
|
+
linen: "#faf0e6",
|
|
1635
|
+
magenta: "#ff00ff",
|
|
1636
|
+
maroon: "#800000",
|
|
1637
|
+
mediumaquamarine: "#66cdaa",
|
|
1638
|
+
mediumblue: "#0000cd",
|
|
1639
|
+
mediumorchid: "#ba55d3",
|
|
1640
|
+
mediumpurple: "#9370db",
|
|
1641
|
+
mediumseagreen: "#3cb371",
|
|
1642
|
+
mediumslateblue: "#7b68ee",
|
|
1643
|
+
mediumspringgreen: "#00fa9a",
|
|
1644
|
+
mediumturquoise: "#48d1cc",
|
|
1645
|
+
mediumvioletred: "#c71585",
|
|
1646
|
+
midnightblue: "#191970",
|
|
1647
|
+
mintcream: "#f5fffa",
|
|
1648
|
+
mistyrose: "#ffe4e1",
|
|
1649
|
+
moccasin: "#ffe4b5",
|
|
1650
|
+
navajowhite: "#ffdead",
|
|
1651
|
+
navy: "#000080",
|
|
1652
|
+
oldlace: "#fdf5e6",
|
|
1653
|
+
olive: "#808000",
|
|
1654
|
+
olivedrab: "#6b8e23",
|
|
1655
|
+
orange: "#ffa500",
|
|
1656
|
+
orangered: "#ff4500",
|
|
1657
|
+
orchid: "#da70d6",
|
|
1658
|
+
palegoldenrod: "#eee8aa",
|
|
1659
|
+
palegreen: "#98fb98",
|
|
1660
|
+
paleturquoise: "#afeeee",
|
|
1661
|
+
palevioletred: "#db7093",
|
|
1662
|
+
papayawhip: "#ffefd5",
|
|
1663
|
+
peachpuff: "#ffdab9",
|
|
1664
|
+
peru: "#cd853f",
|
|
1665
|
+
pink: "#ffc0cb",
|
|
1666
|
+
plum: "#dda0dd",
|
|
1667
|
+
powderblue: "#b0e0e6",
|
|
1668
|
+
purple: "#800080",
|
|
1669
|
+
rebeccapurple: "#663399",
|
|
1670
|
+
red: "#ff0000",
|
|
1671
|
+
rosybrown: "#bc8f8f",
|
|
1672
|
+
royalblue: "#4169e1",
|
|
1673
|
+
saddlebrown: "#8b4513",
|
|
1674
|
+
salmon: "#fa8072",
|
|
1675
|
+
sandybrown: "#f4a460",
|
|
1676
|
+
seagreen: "#2e8b57",
|
|
1677
|
+
seashell: "#fff5ee",
|
|
1678
|
+
sienna: "#a0522d",
|
|
1679
|
+
silver: "#c0c0c0",
|
|
1680
|
+
skyblue: "#87ceeb",
|
|
1681
|
+
slateblue: "#6a5acd",
|
|
1682
|
+
slategray: "#708090",
|
|
1683
|
+
slategrey: "#708090",
|
|
1684
|
+
snow: "#fffafa",
|
|
1685
|
+
springgreen: "#00ff7f",
|
|
1686
|
+
steelblue: "#4682b4",
|
|
1687
|
+
tan: "#d2b48c",
|
|
1688
|
+
teal: "#008080",
|
|
1689
|
+
thistle: "#d8bfd8",
|
|
1690
|
+
tomato: "#ff6347",
|
|
1691
|
+
turquoise: "#40e0d0",
|
|
1692
|
+
violet: "#ee82ee",
|
|
1693
|
+
wheat: "#f5deb3",
|
|
1694
|
+
white: "#ffffff",
|
|
1695
|
+
whitesmoke: "#f5f5f5",
|
|
1696
|
+
yellow: "#ffff00",
|
|
1697
|
+
yellowgreen: "#9acd32"
|
|
1698
|
+
}), At = "[+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[+-]?\\d+)?", jt = (e, t, n) => Math.min(n, Math.max(t, e));
|
|
1699
|
+
function Mt(e, t) {
|
|
1700
|
+
let n = RegExp(`^${t}\\(`, "i").exec(e);
|
|
1701
|
+
if (!n || !e.endsWith(")")) return null;
|
|
1702
|
+
let r = 0;
|
|
1703
|
+
for (let t = n[0].length - 1; t < e.length; t++) if (e[t] === "(") r++;
|
|
1704
|
+
else if (e[t] === ")" && --r === 0 && t !== e.length - 1) return null;
|
|
1705
|
+
return r === 0 ? e.slice(n[0].length, -1) : null;
|
|
1706
|
+
}
|
|
1707
|
+
function Nt(e, t) {
|
|
1708
|
+
let n = [], r = 0, i = 0;
|
|
1709
|
+
for (let a = 0; a < e.length; a++) e[a] === "(" ? r++ : e[a] === ")" ? r-- : e[a] === t && r === 0 && (n.push(e.slice(i, a)), i = a + 1);
|
|
1710
|
+
return n.push(e.slice(i)), n;
|
|
1711
|
+
}
|
|
1712
|
+
var Pt = (e, t) => {
|
|
1713
|
+
let n = RegExp(`^(${At})(%?)$`, "i").exec(e);
|
|
1714
|
+
return n ? n[2] ? Number(n[1]) / 100 * t : Number(n[1]) : null;
|
|
1715
|
+
}, Ft = (e) => e === void 0 ? 1 : (() => {
|
|
1716
|
+
let t = Pt(e, 1);
|
|
1717
|
+
return t === null ? null : jt(t, 0, 1);
|
|
1718
|
+
})();
|
|
1719
|
+
function It(e, t, n) {
|
|
1720
|
+
let r = (t) => (t + e / 30) % 12, i = t * Math.min(n, 1 - n), a = (e) => n - i * Math.max(-1, Math.min(r(e) - 3, Math.min(9 - r(e), 1)));
|
|
1721
|
+
return [
|
|
1722
|
+
a(0) * 255,
|
|
1723
|
+
a(8) * 255,
|
|
1724
|
+
a(4) * 255
|
|
1725
|
+
];
|
|
1726
|
+
}
|
|
1727
|
+
function Lt(e) {
|
|
1728
|
+
let t = e.trim();
|
|
1729
|
+
if (t.includes(",")) {
|
|
1730
|
+
let e = t.split(/\s*,\s*/);
|
|
1731
|
+
return (e.length === 3 || e.length === 4) && e.every((e) => e && !/[\s/]/.test(e)) ? e : null;
|
|
1732
|
+
}
|
|
1733
|
+
let n = /^(\S+)\s+(\S+)\s+([^\s/]+)(?:\s*\/\s*(\S+))?$/.exec(t);
|
|
1734
|
+
return n && !n.slice(1, 4).some((e) => e.includes("/")) ? n.slice(1, n[4] === void 0 ? 4 : 5) : null;
|
|
1735
|
+
}
|
|
1736
|
+
function Rt(e, t = 0) {
|
|
1737
|
+
let n = String(e).trim().toLowerCase();
|
|
1738
|
+
if (n === "transparent") return [
|
|
1739
|
+
0,
|
|
1740
|
+
0,
|
|
1741
|
+
0,
|
|
1742
|
+
0
|
|
1743
|
+
];
|
|
1744
|
+
if (kt[n]) return Rt(kt[n], t);
|
|
1745
|
+
let r = /^#([0-9a-f]{3,4})$/.exec(n);
|
|
1746
|
+
if (r) {
|
|
1747
|
+
let e = [...r[1]].map((e) => parseInt(e + e, 16));
|
|
1748
|
+
return [
|
|
1749
|
+
e[0],
|
|
1750
|
+
e[1],
|
|
1751
|
+
e[2],
|
|
1752
|
+
e.length === 4 ? e[3] / 255 : 1
|
|
1753
|
+
];
|
|
1754
|
+
}
|
|
1755
|
+
if (r = /^#([0-9a-f]{6}|[0-9a-f]{8})$/.exec(n), r) {
|
|
1756
|
+
let e = r[1];
|
|
1757
|
+
return [
|
|
1758
|
+
parseInt(e.slice(0, 2), 16),
|
|
1759
|
+
parseInt(e.slice(2, 4), 16),
|
|
1760
|
+
parseInt(e.slice(4, 6), 16),
|
|
1761
|
+
e.length === 8 ? parseInt(e.slice(6, 8), 16) / 255 : 1
|
|
1762
|
+
];
|
|
1763
|
+
}
|
|
1764
|
+
let i = Mt(n, "rgba?");
|
|
1765
|
+
if (i !== null) {
|
|
1766
|
+
let e = Lt(i);
|
|
1767
|
+
if (!e) return null;
|
|
1768
|
+
let t = e.slice(0, 3).map((e) => Pt(e, 255)), n = Ft(e[3]);
|
|
1769
|
+
return t.some((e) => e === null) || n === null ? null : [...t.map((e) => jt(e, 0, 255)), n];
|
|
1770
|
+
}
|
|
1771
|
+
let a = Mt(n, "hsla?");
|
|
1772
|
+
if (a !== null) {
|
|
1773
|
+
let e = Lt(a);
|
|
1774
|
+
if (!e) return null;
|
|
1775
|
+
let t = RegExp(`^(${At})(?:deg)?$`).exec(e[0]), n = /%$/.test(e[1]) ? Pt(e[1], 1) : null, r = /%$/.test(e[2]) ? Pt(e[2], 1) : null, i = Ft(e[3]);
|
|
1776
|
+
return !t || n === null || r === null || i === null ? null : [...It((Number(t[1]) % 360 + 360) % 360, jt(n, 0, 1), jt(r, 0, 1)), i];
|
|
1777
|
+
}
|
|
1778
|
+
let o = t < 8 ? Mt(n, "color-mix") : null;
|
|
1779
|
+
if (o !== null) {
|
|
1780
|
+
let e = Nt(o, ",").map((e) => e.trim());
|
|
1781
|
+
if (e.length !== 3 || !/^in\s+srgb$/.test(e[0])) return null;
|
|
1782
|
+
let n = (e) => {
|
|
1783
|
+
let n = /^(\d*\.?\d+)%\s+(.+)$/.exec(e), r = /^(.+?)\s+(\d*\.?\d+)%$/.exec(e), [i, a] = n ? [n[2], n[1]] : r ? [r[1], r[2]] : [e, null], o = Rt(i, t + 1);
|
|
1784
|
+
return o && {
|
|
1785
|
+
c: o,
|
|
1786
|
+
p: a === null ? null : Number(a) / 100
|
|
1787
|
+
};
|
|
1788
|
+
}, r = n(e[1]), i = n(e[2]);
|
|
1789
|
+
if (!r || !i || r.p !== null && (r.p < 0 || r.p > 1) || i.p !== null && (i.p < 0 || i.p > 1)) return null;
|
|
1790
|
+
let a = r.p ?? (i.p === null ? .5 : 1 - i.p), s = i.p ?? 1 - a;
|
|
1791
|
+
return a + s <= 0 ? null : Bt(r.c, a, i.c, s);
|
|
1792
|
+
}
|
|
1793
|
+
return null;
|
|
1794
|
+
}
|
|
1795
|
+
function zt(e) {
|
|
1796
|
+
if (String(e).length > 4096) return null;
|
|
1797
|
+
try {
|
|
1798
|
+
return Rt(e);
|
|
1799
|
+
} catch {
|
|
1800
|
+
return null;
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
function L(e) {
|
|
1804
|
+
return zt(e) ?? [
|
|
1805
|
+
0,
|
|
1806
|
+
0,
|
|
1807
|
+
0,
|
|
1808
|
+
0
|
|
1809
|
+
];
|
|
1810
|
+
}
|
|
1811
|
+
function Bt(e, t, n, r) {
|
|
1812
|
+
let i = t + r, [a, o] = [t / i, r / i], s = e[3] * a + n[3] * o, c = (t) => s === 0 ? 0 : (e[t] * e[3] * a + n[t] * n[3] * o) / s;
|
|
1813
|
+
return [
|
|
1814
|
+
c(0),
|
|
1815
|
+
c(1),
|
|
1816
|
+
c(2),
|
|
1817
|
+
s * Math.min(1, i)
|
|
1818
|
+
];
|
|
1819
|
+
}
|
|
1820
|
+
var Vt = (e) => {
|
|
1821
|
+
let t = e / 255;
|
|
1822
|
+
return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
1823
|
+
}, Ht = ([e, t, n]) => .2126 * Vt(e) + .7152 * Vt(t) + .0722 * Vt(n), Ut = (e, t) => (Math.max(e, t) + .05) / (Math.min(e, t) + .05), R = Object.freeze({
|
|
1824
|
+
dark: Object.freeze({
|
|
1825
|
+
added: "#2dd4bf",
|
|
1826
|
+
changed: "#fbbf24",
|
|
1827
|
+
removed: "#fa9292",
|
|
1828
|
+
edit: "#b49cfb"
|
|
1829
|
+
}),
|
|
1830
|
+
light: Object.freeze({
|
|
1831
|
+
added: "#197c6f",
|
|
1832
|
+
changed: "#8f6703",
|
|
1833
|
+
removed: "#e20b0b",
|
|
1834
|
+
edit: "#6839f6"
|
|
1835
|
+
})
|
|
1836
|
+
}), Wt = .85, Gt = .9, Kt = .6, qt = .45, Jt = Object.freeze({
|
|
1837
|
+
light: Kt,
|
|
1838
|
+
dark: .5
|
|
1839
|
+
}), Yt = Object.freeze({
|
|
1840
|
+
added: Object.freeze({
|
|
1841
|
+
ringDash: Object.freeze([5, 4]),
|
|
1842
|
+
edgeDash: Object.freeze([7, 5]),
|
|
1843
|
+
strike: !1
|
|
1844
|
+
}),
|
|
1845
|
+
changed: Object.freeze({
|
|
1846
|
+
ringDash: null,
|
|
1847
|
+
edgeDash: null,
|
|
1848
|
+
strike: !1
|
|
1849
|
+
}),
|
|
1850
|
+
removed: Object.freeze({
|
|
1851
|
+
ringDash: null,
|
|
1852
|
+
edgeDash: Object.freeze([3, 4]),
|
|
1853
|
+
strike: !0
|
|
1854
|
+
}),
|
|
1855
|
+
edit: Object.freeze({
|
|
1856
|
+
ringDash: Object.freeze([2, 5]),
|
|
1857
|
+
edgeDash: Object.freeze([12, 4]),
|
|
1858
|
+
strike: !1
|
|
1859
|
+
})
|
|
1860
|
+
}), Xt = "#f4f6fa", Zt = {
|
|
1861
|
+
mark: 3.2,
|
|
1862
|
+
text: 4.8
|
|
1863
|
+
}, Qt = .16, $t = 1.35, en = .11;
|
|
1864
|
+
function tn(e, t) {
|
|
1865
|
+
return e === "light" || e === "dark" ? e : t ? "light" : "dark";
|
|
1866
|
+
}
|
|
1867
|
+
function nn([e, t, n]) {
|
|
1868
|
+
let r = e / 255, i = t / 255, a = n / 255, o = Math.max(r, i, a), s = Math.min(r, i, a), c = (o + s) / 2;
|
|
1869
|
+
if (o === s) return [
|
|
1870
|
+
0,
|
|
1871
|
+
0,
|
|
1872
|
+
c
|
|
1873
|
+
];
|
|
1874
|
+
let l = o - s, u = c > .5 ? l / (2 - o - s) : l / (o + s);
|
|
1875
|
+
return [
|
|
1876
|
+
(o === r ? (i - a) / l + (i < a ? 6 : 0) : o === i ? (a - r) / l + 2 : (r - i) / l + 4) * 60,
|
|
1877
|
+
u,
|
|
1878
|
+
c
|
|
1879
|
+
];
|
|
1880
|
+
}
|
|
1881
|
+
function rn([e, t, n]) {
|
|
1882
|
+
let r = (t) => (t + e / 30) % 12, i = t * Math.min(n, 1 - n), a = (e) => n - i * Math.max(-1, Math.min(r(e) - 3, 9 - r(e), 1));
|
|
1883
|
+
return [
|
|
1884
|
+
a(0),
|
|
1885
|
+
a(8),
|
|
1886
|
+
a(4)
|
|
1887
|
+
].map((e) => Math.round(e * 255));
|
|
1888
|
+
}
|
|
1889
|
+
var an = (e) => `#${e.map((e) => e.toString(16).padStart(2, "0")).join("")}`, on = (e, t) => t >= 1 ? an(e) : `rgba(${e.join(", ")}, ${+t.toFixed(3)})`, sn = Ht(L(Xt)), cn = /* @__PURE__ */ new Map();
|
|
1890
|
+
function z(e, t = "mark") {
|
|
1891
|
+
let n = `${t}|${e}`, r = cn.get(n);
|
|
1892
|
+
if (r !== void 0) return r;
|
|
1893
|
+
let i = ln(e, t);
|
|
1894
|
+
return cn.set(n, i), i;
|
|
1895
|
+
}
|
|
1896
|
+
function ln(e, t) {
|
|
1897
|
+
if (typeof e != "string") return e;
|
|
1898
|
+
let [n, r, i, a] = L(e);
|
|
1899
|
+
if (a === 0) return e;
|
|
1900
|
+
let [o, s, c] = nn([
|
|
1901
|
+
n,
|
|
1902
|
+
r,
|
|
1903
|
+
i
|
|
1904
|
+
]);
|
|
1905
|
+
if ((Math.max(n, r, i) - Math.min(n, r, i)) / 255 < Qt && c > .5) return on(rn([
|
|
1906
|
+
o,
|
|
1907
|
+
s,
|
|
1908
|
+
Math.max(en, 1 - c)
|
|
1909
|
+
]), a);
|
|
1910
|
+
let l = Zt[t] || Zt.mark;
|
|
1911
|
+
if (Ut(Ht([
|
|
1912
|
+
n,
|
|
1913
|
+
r,
|
|
1914
|
+
i
|
|
1915
|
+
]), sn) >= l) return e;
|
|
1916
|
+
let u = 0, d = c;
|
|
1917
|
+
for (let e = 0; e < 20; e++) {
|
|
1918
|
+
let e = (u + d) / 2;
|
|
1919
|
+
Ut(Ht(rn([
|
|
1920
|
+
o,
|
|
1921
|
+
s,
|
|
1922
|
+
e
|
|
1923
|
+
])), sn) >= l ? u = e : d = e;
|
|
1924
|
+
}
|
|
1925
|
+
return on(rn([
|
|
1926
|
+
o,
|
|
1927
|
+
s,
|
|
1928
|
+
u
|
|
1929
|
+
]), a);
|
|
1930
|
+
}
|
|
1931
|
+
var un = (e) => {
|
|
1932
|
+
e && (e.color = z(e.color, "text"));
|
|
1933
|
+
};
|
|
1934
|
+
function dn(e) {
|
|
1935
|
+
e.theme = "light";
|
|
1936
|
+
for (let t of e.nodes) t.color = z(t.color), t.labelColor = z(t.labelColor, "text");
|
|
1937
|
+
for (let t of e.edges) {
|
|
1938
|
+
if (t.mark && t.mark !== "none") t.color = R.dark[t.mark] === t.color ? R.light[t.mark] : z(t.color);
|
|
1939
|
+
else {
|
|
1940
|
+
t.alpha < 1 && (t.alpha = Math.min(1, t.alpha * $t)), t.color = z(t.color);
|
|
1941
|
+
let [e, n, r, i] = L(t.color);
|
|
1942
|
+
i > 0 && i < 1 && (t.color = on([
|
|
1943
|
+
e,
|
|
1944
|
+
n,
|
|
1945
|
+
r
|
|
1946
|
+
], Math.min(1, i * $t)));
|
|
1947
|
+
}
|
|
1948
|
+
t.glowColor &&= z(t.glowColor), t.label &&= {
|
|
1949
|
+
...t.label,
|
|
1950
|
+
color: z(t.label.color, "text")
|
|
1951
|
+
}, t.packet &&= {
|
|
1952
|
+
...t.packet,
|
|
1953
|
+
color: z(t.packet.color),
|
|
1954
|
+
glowColor: z(t.packet.glowColor)
|
|
1955
|
+
};
|
|
1956
|
+
}
|
|
1957
|
+
let { decor: t } = e;
|
|
1958
|
+
return t.grid &&= {
|
|
1959
|
+
...t.grid,
|
|
1960
|
+
color: z(t.grid.color)
|
|
1961
|
+
}, t.rings = t.rings.map((e) => ({
|
|
1962
|
+
...e,
|
|
1963
|
+
color: z(e.color)
|
|
1964
|
+
})), t.lanes = t.lanes.map((e) => {
|
|
1965
|
+
let t = {
|
|
1966
|
+
...e,
|
|
1967
|
+
fill: z(e.fill),
|
|
1968
|
+
stroke: z(e.stroke)
|
|
1969
|
+
};
|
|
1970
|
+
for (let e of [
|
|
1971
|
+
"title",
|
|
1972
|
+
"note",
|
|
1973
|
+
"arrow"
|
|
1974
|
+
]) t[e] && (t[e] = { ...t[e] }, un(t[e]));
|
|
1975
|
+
return t;
|
|
1976
|
+
}), e;
|
|
1977
|
+
}
|
|
1978
|
+
var fn = 1.2, B = 96, pn = 24, mn = "glyph:", hn = "#ffffff", gn = "#0b1220";
|
|
1979
|
+
Object.freeze(Object.keys(E));
|
|
1980
|
+
var _n = (e) => typeof e == "string" && Object.hasOwn(E, e), vn = (e, t) => `${mn}${e}|${t}`, yn = (e) => typeof e == "string" && e.startsWith(mn);
|
|
1981
|
+
function bn(e) {
|
|
1982
|
+
let t = e.slice(6), n = t.indexOf("|");
|
|
1983
|
+
return {
|
|
1984
|
+
type: t.slice(0, n),
|
|
1985
|
+
ink: t.slice(n + 1)
|
|
1986
|
+
};
|
|
1987
|
+
}
|
|
1988
|
+
var xn = ([e, t, n]) => {
|
|
1989
|
+
let r = (e) => {
|
|
1990
|
+
let t = e / 255;
|
|
1991
|
+
return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
1992
|
+
};
|
|
1993
|
+
return .2126 * r(e) + .7152 * r(t) + .0722 * r(n);
|
|
1994
|
+
}, Sn = (e, t) => {
|
|
1995
|
+
let [n, r] = e > t ? [e, t] : [t, e];
|
|
1996
|
+
return (n + .05) / (r + .05);
|
|
1997
|
+
};
|
|
1998
|
+
function Cn(e) {
|
|
1999
|
+
let t = xn(L(e));
|
|
2000
|
+
return Sn(1, t) >= Sn(xn(L("#0b1220")), t) ? hn : gn;
|
|
2001
|
+
}
|
|
2002
|
+
var wn = (e, t) => t && t.values && t.values["--corn-map-glyph"] || Cn(e.color), Tn = (e, t) => !!e.glyph && !e.icon && !e.letters && e.r * 2 * t >= 14, En = {
|
|
2003
|
+
root: (e) => {
|
|
2004
|
+
Dn(e, 12, 12, 8), H(e, 12, 12, 3.2);
|
|
2005
|
+
},
|
|
2006
|
+
app: (e) => {
|
|
2007
|
+
e.beginPath(), e.rect(3.5, 5, 17, 14), e.stroke(), V(e, 3.5, 9.5, 20.5, 9.5);
|
|
2008
|
+
},
|
|
2009
|
+
page: (e) => {
|
|
2010
|
+
e.beginPath(), e.rect(6, 3.5, 12, 17), e.stroke(), V(e, 9, 9, 15, 9), V(e, 9, 12.5, 15, 12.5), V(e, 9, 16, 13, 16);
|
|
2011
|
+
},
|
|
2012
|
+
pkg: (e) => {
|
|
2013
|
+
e.beginPath(), e.rect(4, 7, 16, 13), e.stroke(), V(e, 4, 12, 20, 12), V(e, 12, 7, 12, 12);
|
|
2014
|
+
},
|
|
2015
|
+
core: (e) => {
|
|
2016
|
+
Dn(e, 12, 12, 8.2), H(e, 12, 12, 4);
|
|
2017
|
+
},
|
|
2018
|
+
token: (e) => {
|
|
2019
|
+
for (let [t, n] of [
|
|
2020
|
+
[5, 5],
|
|
2021
|
+
[13, 5],
|
|
2022
|
+
[5, 13],
|
|
2023
|
+
[13, 13]
|
|
2024
|
+
]) e.fillRect(t, n, 6, 6);
|
|
2025
|
+
},
|
|
2026
|
+
atom: (e) => {
|
|
2027
|
+
e.beginPath(), e.ellipse(12, 12, 9.5, 4, -.5, 0, Math.PI * 2), e.stroke(), H(e, 12, 12, 3);
|
|
2028
|
+
},
|
|
2029
|
+
molecule: (e) => {
|
|
2030
|
+
V(e, 7, 16, 17, 8), H(e, 7, 16, 4), H(e, 17, 8, 4);
|
|
2031
|
+
},
|
|
2032
|
+
tool: (e) => {
|
|
2033
|
+
V(e, 12, 4, 12, 20), V(e, 4, 12, 20, 12);
|
|
2034
|
+
},
|
|
2035
|
+
rom: (e) => {
|
|
2036
|
+
e.beginPath(), e.arc(12, 12, 7.5, .4, Math.PI * 1.6), e.stroke(), e.beginPath(), e.moveTo(14.5, 2.5), e.lineTo(20, 5.5), e.lineTo(14, 8.5), e.closePath(), e.fill();
|
|
2037
|
+
},
|
|
2038
|
+
service: (e) => {
|
|
2039
|
+
e.beginPath(), e.moveTo(13.5, 2.5), e.lineTo(6, 13.5), e.lineTo(11.5, 13.5), e.lineTo(10, 21.5), e.lineTo(18, 9.5), e.lineTo(12.5, 9.5), e.closePath(), e.fill();
|
|
2040
|
+
},
|
|
2041
|
+
store: (e) => {
|
|
2042
|
+
e.beginPath(), e.ellipse(12, 6.5, 7.5, 3, 0, 0, Math.PI * 2), e.stroke(), V(e, 4.5, 6.5, 4.5, 17.5), V(e, 19.5, 6.5, 19.5, 17.5), e.beginPath(), e.ellipse(12, 17.5, 7.5, 3, 0, 0, Math.PI), e.stroke();
|
|
2043
|
+
},
|
|
2044
|
+
table: (e) => {
|
|
2045
|
+
e.beginPath(), e.rect(4, 5, 16, 14), e.stroke(), V(e, 4, 10, 20, 10), V(e, 12, 10, 12, 19);
|
|
2046
|
+
},
|
|
2047
|
+
external: (e) => {
|
|
2048
|
+
V(e, 7, 17, 17, 7), e.beginPath(), e.moveTo(9.5, 6.5), e.lineTo(17.5, 6.5), e.lineTo(17.5, 14.5), e.stroke();
|
|
2049
|
+
},
|
|
2050
|
+
stack: (e) => {
|
|
2051
|
+
for (let t of [
|
|
2052
|
+
4.5,
|
|
2053
|
+
10.5,
|
|
2054
|
+
16.5
|
|
2055
|
+
]) e.fillRect(4, t, 16, 3.5);
|
|
2056
|
+
},
|
|
2057
|
+
machine: (e) => {
|
|
2058
|
+
e.beginPath(), e.rect(3.5, 4.5, 17, 11), e.stroke(), V(e, 12, 15.5, 12, 19.5), V(e, 7.5, 19.5, 16.5, 19.5);
|
|
2059
|
+
},
|
|
2060
|
+
container: (e) => {
|
|
2061
|
+
e.beginPath(), e.rect(4, 4, 16, 16), e.stroke(), e.fillRect(8.5, 8.5, 7, 7);
|
|
2062
|
+
},
|
|
2063
|
+
device: (e) => {
|
|
2064
|
+
e.beginPath(), e.rect(7.5, 3, 9, 18), e.stroke(), H(e, 12, 17.5, 1.3);
|
|
2065
|
+
},
|
|
2066
|
+
floor: (e) => {
|
|
2067
|
+
e.beginPath(), e.moveTo(3.5, 20.5), e.lineTo(3.5, 15.5), e.lineTo(9, 15.5), e.lineTo(9, 10.5), e.lineTo(14.5, 10.5), e.lineTo(14.5, 5.5), e.lineTo(20.5, 5.5), e.stroke();
|
|
2068
|
+
},
|
|
2069
|
+
room: (e) => {
|
|
2070
|
+
e.beginPath(), e.rect(6.5, 3.5, 11, 17), e.stroke(), H(e, 14.5, 12.5, 1.4);
|
|
2071
|
+
},
|
|
2072
|
+
persona: (e) => {
|
|
2073
|
+
H(e, 12, 8, 3.8), e.beginPath(), e.arc(12, 21, 8, Math.PI * 1.15, Math.PI * 1.85), e.stroke();
|
|
2074
|
+
}
|
|
2075
|
+
};
|
|
2076
|
+
function V(e, t, n, r, i) {
|
|
2077
|
+
e.beginPath(), e.moveTo(t, n), e.lineTo(r, i), e.stroke();
|
|
2078
|
+
}
|
|
2079
|
+
function Dn(e, t, n, r) {
|
|
2080
|
+
e.beginPath(), e.arc(t, n, r, 0, Math.PI * 2), e.stroke();
|
|
2081
|
+
}
|
|
2082
|
+
function H(e, t, n, r) {
|
|
2083
|
+
e.beginPath(), e.arc(t, n, r, 0, Math.PI * 2), e.fill();
|
|
2084
|
+
}
|
|
2085
|
+
function On(e, t, n, r) {
|
|
2086
|
+
let i = En[t];
|
|
2087
|
+
if (!i) return;
|
|
2088
|
+
let a = n / pn;
|
|
2089
|
+
e.save(), e.scale(a, a), e.lineWidth = 2.4, e.lineCap = "round", e.lineJoin = "round", e.strokeStyle = r, e.fillStyle = r, i(e), e.restore();
|
|
2090
|
+
}
|
|
2091
|
+
var kn = /* @__PURE__ */ new Map();
|
|
2092
|
+
function An(e, t) {
|
|
2093
|
+
if (!_n(e) || typeof t != "string") return null;
|
|
2094
|
+
let n = vn(e, t);
|
|
2095
|
+
if (kn.has(n)) return kn.get(n);
|
|
2096
|
+
if (kn.size >= 64) return null;
|
|
2097
|
+
let r = null;
|
|
2098
|
+
try {
|
|
2099
|
+
let n = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(B, B) : typeof document < "u" ? Object.assign(document.createElement("canvas"), {
|
|
2100
|
+
width: B,
|
|
2101
|
+
height: B
|
|
2102
|
+
}) : null, i = n && n.getContext && n.getContext("2d");
|
|
2103
|
+
i && i.stroke && (On(i, e, B, t), r = n);
|
|
2104
|
+
} catch {
|
|
2105
|
+
r = null;
|
|
2106
|
+
}
|
|
2107
|
+
return kn.set(n, r), r;
|
|
2108
|
+
}
|
|
2109
|
+
Object.freeze([
|
|
2110
|
+
"pulls",
|
|
2111
|
+
"issues",
|
|
2112
|
+
"threads",
|
|
2113
|
+
"deploys",
|
|
2114
|
+
"notes"
|
|
2115
|
+
]), Object.freeze({
|
|
2116
|
+
pulls: [
|
|
2117
|
+
["open", "Open"],
|
|
2118
|
+
["merged", "Merged"],
|
|
2119
|
+
["closed", "Closed"],
|
|
2120
|
+
["all", "All"]
|
|
2121
|
+
],
|
|
2122
|
+
issues: [
|
|
2123
|
+
["open", "Open"],
|
|
2124
|
+
["closed", "Closed"],
|
|
2125
|
+
["all", "All"]
|
|
2126
|
+
],
|
|
2127
|
+
threads: [
|
|
2128
|
+
["open", "Open"],
|
|
2129
|
+
["closed", "Closed"],
|
|
2130
|
+
["all", "All"]
|
|
2131
|
+
],
|
|
2132
|
+
deploys: [
|
|
2133
|
+
["all", "All"],
|
|
2134
|
+
["success", "Succeeded"],
|
|
2135
|
+
["failure", "Failed"],
|
|
2136
|
+
["running", "Running or waiting"],
|
|
2137
|
+
["other", "Cancelled or skipped"]
|
|
2138
|
+
]
|
|
2139
|
+
});
|
|
2140
|
+
var jn = .2, Mn = "#f87171";
|
|
2141
|
+
function Nn(e, t) {
|
|
2142
|
+
if (!t || !t.changed.size && !t.failing.size) return;
|
|
2143
|
+
let n = (e) => t.changed.has(e) || t.failing.has(e);
|
|
2144
|
+
for (let r of e.nodes) n(r.id) ? (r.alpha = 1, r.labelAlpha = 1, r.glow = Math.max(r.glow, 14), r.labelKeep = !0, r.halo !== "selected" && (r.halo = "match"), t.failing.has(r.id) && (r.color = Mn)) : (r.alpha = Math.min(r.alpha, jn), r.labelAlpha = r.alpha, r.glow = 0);
|
|
2145
|
+
for (let t of e.edges) !n(t.from) && !n(t.to) && (t.alpha = Math.min(t.alpha, jn / 2));
|
|
2146
|
+
}
|
|
2147
|
+
// ../explorer/search-model.js
|
|
2148
|
+
var U = Object.freeze({
|
|
2149
|
+
labelStart: 0,
|
|
2150
|
+
wordStart: 1,
|
|
2151
|
+
label: 2,
|
|
2152
|
+
idOrFile: 3,
|
|
2153
|
+
typeOrKind: 4
|
|
2154
|
+
}), Pn = Object.freeze({
|
|
2155
|
+
root: "Root",
|
|
2156
|
+
app: "Apps",
|
|
2157
|
+
pkg: "Packages",
|
|
2158
|
+
page: "Pages & Routes",
|
|
2159
|
+
atom: "Atoms",
|
|
2160
|
+
molecule: "Molecules",
|
|
2161
|
+
token: "Design Tokens",
|
|
2162
|
+
tool: "Dev Tools",
|
|
2163
|
+
core: "Core",
|
|
2164
|
+
store: "Stores",
|
|
2165
|
+
table: "Tables",
|
|
2166
|
+
rom: "ROM",
|
|
2167
|
+
service: "Services",
|
|
2168
|
+
external: "Cloud",
|
|
2169
|
+
stack: "Infra",
|
|
2170
|
+
machine: "Machines",
|
|
2171
|
+
container: "Containers",
|
|
2172
|
+
device: "Devices",
|
|
2173
|
+
floor: "House",
|
|
2174
|
+
room: "House",
|
|
2175
|
+
persona: "People"
|
|
2176
|
+
}), Fn = (e) => e && e.charAt(0).toUpperCase() + e.slice(1), In = (e) => Pn[e.type] || Fn(String(e.type || "")), W = (e) => typeof e == "string" ? e.toLowerCase() : "", Ln = /[^\p{L}\p{N}]+/u;
|
|
2177
|
+
function Rn(e, t) {
|
|
2178
|
+
let n = String(t || "").toLowerCase();
|
|
2179
|
+
if (!n) return -1;
|
|
2180
|
+
let r = W(e.label);
|
|
2181
|
+
return r.startsWith(n) ? U.labelStart : r.split(Ln).some((e) => e && e.startsWith(n)) ? U.wordStart : r.includes(n) ? U.label : W(e.id).includes(n) || W(e.file).includes(n) ? U.idOrFile : W(e.type).includes(n) || W(In(e)).includes(n) || W(e.kind).includes(n) ? U.typeOrKind : -1;
|
|
2182
|
+
}
|
|
2183
|
+
function zn(e, t) {
|
|
2184
|
+
let n = String(t || "").trim().toLowerCase(), r = /* @__PURE__ */ new Set();
|
|
2185
|
+
if (!n) return r;
|
|
2186
|
+
for (let t of e) Rn(t, n) >= 0 && r.add(t.id);
|
|
2187
|
+
return r;
|
|
2188
|
+
}
|
|
2189
|
+
// ../explorer/css-color.js
|
|
2190
|
+
var G, Bn = /* @__PURE__ */ new Map();
|
|
2191
|
+
function Vn() {
|
|
2192
|
+
if (G !== void 0) return G;
|
|
2193
|
+
G = null;
|
|
2194
|
+
try {
|
|
2195
|
+
typeof document < "u" && (G = document.createElement("canvas").getContext("2d", { willReadFrequently: !0 }) || null);
|
|
2196
|
+
} catch {
|
|
2197
|
+
G = null;
|
|
2198
|
+
}
|
|
2199
|
+
return G;
|
|
2200
|
+
}
|
|
2201
|
+
function Hn(e) {
|
|
2202
|
+
let t = typeof e == "string" ? e.trim() : "";
|
|
2203
|
+
if (!t || t.toLowerCase() === "auto") return null;
|
|
2204
|
+
if (Wn(t)) return t;
|
|
2205
|
+
if (/^transparent$/i.test(t)) return "rgba(0, 0, 0, 0)";
|
|
2206
|
+
if (Bn.has(t)) return Bn.get(t);
|
|
2207
|
+
let n = null, r = Un(t) && !/currentcolor/i.test(t) ? Vn() : null;
|
|
2208
|
+
if (r) try {
|
|
2209
|
+
let e = (e) => (r.fillStyle = e, r.fillStyle = t, String(r.fillStyle)), i = e("#010203"), a = i === "#010203" && e("#040506") === "#040506" ? null : i;
|
|
2210
|
+
n = a === null ? null : Kn(a) ? a : qn(r, t);
|
|
2211
|
+
} catch {
|
|
2212
|
+
n = null;
|
|
2213
|
+
}
|
|
2214
|
+
return Bn.set(t, n), n;
|
|
2215
|
+
}
|
|
2216
|
+
function Un(e) {
|
|
2217
|
+
try {
|
|
2218
|
+
return typeof CSS > "u" || typeof CSS.supports != "function" || CSS.supports("color", e);
|
|
2219
|
+
} catch {
|
|
2220
|
+
return !1;
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
function Wn(e) {
|
|
2224
|
+
if (!Kn(e)) return !1;
|
|
2225
|
+
let t = /^rgba?\(/i.test(e.trim()) ? e.slice(e.indexOf("(") + 1, e.lastIndexOf(")")).split(",").map(Number) : null;
|
|
2226
|
+
if (t && (t.slice(0, 3).some((e) => !(e >= 0 && e <= 255)) || t.length > 3 && !(t[3] > 0 && t[3] <= 1))) return !1;
|
|
2227
|
+
let [n, r, i, a] = L(e);
|
|
2228
|
+
return [
|
|
2229
|
+
n,
|
|
2230
|
+
r,
|
|
2231
|
+
i
|
|
2232
|
+
].every((e) => Number.isFinite(e) && e >= 0 && e <= 255) && Number.isFinite(a) && a > 0 && a <= 1;
|
|
2233
|
+
}
|
|
2234
|
+
var Gn = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$|^rgba?\(\s*[\d.]+\s*,\s*[\d.]+\s*,\s*[\d.]+\s*(?:,\s*[\d.]+\s*)?\)$/i, Kn = (e) => Gn.test(e.trim());
|
|
2235
|
+
function qn(e, t) {
|
|
2236
|
+
if (!e.getImageData || !e.fillRect) return null;
|
|
2237
|
+
e.clearRect(0, 0, 1, 1), e.fillStyle = t, e.fillRect(0, 0, 1, 1);
|
|
2238
|
+
let [n, r, i, a] = e.getImageData(0, 0, 1, 1).data;
|
|
2239
|
+
return Jn(n, r, i, a / 255);
|
|
2240
|
+
}
|
|
2241
|
+
var Jn = (e, t, n, r) => `rgba(${e}, ${t}, ${n}, ${+r.toFixed(3)})`;
|
|
2242
|
+
function Yn(e) {
|
|
2243
|
+
if (typeof e != "string" || e.length > 200) return null;
|
|
2244
|
+
let t = e.trim();
|
|
2245
|
+
return !t || /^(?:auto|currentcolor)$/i.test(t) ? null : Hn(t) || (Vn() === null && zt(t) ? t : null);
|
|
2246
|
+
}
|
|
2247
|
+
// ../explorer/camera.js
|
|
2248
|
+
var K = .25, Xn = .005, Zn = (e, t = K) => Math.max(Math.max(Xn, Math.min(t, K)), Math.min(3, e)), Qn = (e, t, n) => t < e ? Math.min(e, Zn(t, n)) : Zn(t, n);
|
|
2249
|
+
function $n(e, t, n, r, i = K) {
|
|
2250
|
+
let a = Qn(e.zoom, e.zoom * t, i), o = (n - e.x) / e.zoom, s = (r - e.y) / e.zoom;
|
|
2251
|
+
return {
|
|
2252
|
+
x: n - o * a,
|
|
2253
|
+
y: r - s * a,
|
|
2254
|
+
zoom: a
|
|
2255
|
+
};
|
|
2256
|
+
}
|
|
2257
|
+
var er = (e, t, n) => ({
|
|
2258
|
+
x: e.x,
|
|
2259
|
+
y: e.y,
|
|
2260
|
+
zoom: e.zoom,
|
|
2261
|
+
dist: t,
|
|
2262
|
+
mid: {
|
|
2263
|
+
x: n.x,
|
|
2264
|
+
y: n.y
|
|
2265
|
+
}
|
|
2266
|
+
});
|
|
2267
|
+
function tr(e, t, n, r = K) {
|
|
2268
|
+
let i = Qn(e.zoom, e.zoom * (t / e.dist), r), a = (e.mid.x - e.x) / e.zoom, o = (e.mid.y - e.y) / e.zoom;
|
|
2269
|
+
return {
|
|
2270
|
+
x: n.x - a * i,
|
|
2271
|
+
y: n.y - o * i,
|
|
2272
|
+
zoom: i
|
|
2273
|
+
};
|
|
2274
|
+
}
|
|
2275
|
+
function nr(e, t, n = {}, r = 120) {
|
|
2276
|
+
let i = (e, t = 0, n = 0) => {
|
|
2277
|
+
let i = Math.max(0, t), a = Math.max(0, n), o = Math.max(0, e - r), s = i + a > o && i + a > 0 ? o / (i + a) : 1;
|
|
2278
|
+
return [i * s, a * s];
|
|
2279
|
+
}, [a, o] = i(t, n.top, n.bottom), [s, c] = i(e, n.left, n.right);
|
|
2280
|
+
return {
|
|
2281
|
+
x: s,
|
|
2282
|
+
y: a,
|
|
2283
|
+
width: Math.max(0, e - s - c),
|
|
2284
|
+
height: Math.max(0, t - a - o)
|
|
2285
|
+
};
|
|
2286
|
+
}
|
|
2287
|
+
var rr = (e) => {
|
|
2288
|
+
let t = e.r || 18;
|
|
2289
|
+
return {
|
|
2290
|
+
left: e.x - t - 25,
|
|
2291
|
+
right: e.x + t + 25,
|
|
2292
|
+
top: e.y - t - 25,
|
|
2293
|
+
bottom: e.y + t + 35
|
|
2294
|
+
};
|
|
2295
|
+
}, ir = (e, t) => Math.min(e, t.width / 4, t.height / 4);
|
|
2296
|
+
function ar(e, t, { padding: n = 40, maxZoom: r = 1, minZoom: i = K } = {}) {
|
|
2297
|
+
if (!e.length) return null;
|
|
2298
|
+
let a = Infinity, o = -Infinity, s = Infinity, c = -Infinity;
|
|
2299
|
+
for (let t of e) {
|
|
2300
|
+
let e = rr(t);
|
|
2301
|
+
a = Math.min(a, e.left), o = Math.max(o, e.right), s = Math.min(s, e.top), c = Math.max(c, e.bottom);
|
|
2302
|
+
}
|
|
2303
|
+
let l = ir(n, t), u = Math.min((t.width - l * 2) / (o - a), (t.height - l * 2) / (c - s)), d = Math.max(i, Math.min(r, u));
|
|
2304
|
+
return {
|
|
2305
|
+
x: t.x + t.width / 2 - (a + o) / 2 * d,
|
|
2306
|
+
y: t.y + t.height / 2 - (s + c) / 2 * d,
|
|
2307
|
+
zoom: d
|
|
2308
|
+
};
|
|
2309
|
+
}
|
|
2310
|
+
// ../explorer/selection-model.js
|
|
2311
|
+
var or = Object.freeze({
|
|
2312
|
+
ownership: {
|
|
2313
|
+
panel: "Owns",
|
|
2314
|
+
edge: "owns"
|
|
2315
|
+
},
|
|
2316
|
+
usage: {
|
|
2317
|
+
panel: "Links",
|
|
2318
|
+
edge: "links"
|
|
2319
|
+
},
|
|
2320
|
+
flow: {
|
|
2321
|
+
panel: "Flows",
|
|
2322
|
+
edge: "flow"
|
|
2323
|
+
},
|
|
2324
|
+
reads: {
|
|
2325
|
+
panel: "Reads",
|
|
2326
|
+
edge: "reads"
|
|
2327
|
+
},
|
|
2328
|
+
writes: {
|
|
2329
|
+
panel: "Writes",
|
|
2330
|
+
edge: "writes"
|
|
2331
|
+
},
|
|
2332
|
+
calls: {
|
|
2333
|
+
panel: "Calls",
|
|
2334
|
+
edge: "calls"
|
|
2335
|
+
},
|
|
2336
|
+
triggers: {
|
|
2337
|
+
panel: "Triggers",
|
|
2338
|
+
edge: "triggers"
|
|
2339
|
+
},
|
|
2340
|
+
delivers: {
|
|
2341
|
+
panel: "Delivers",
|
|
2342
|
+
edge: "delivers"
|
|
2343
|
+
},
|
|
2344
|
+
"runs-on": {
|
|
2345
|
+
panel: "Runs on",
|
|
2346
|
+
edge: "runs on"
|
|
2347
|
+
},
|
|
2348
|
+
uses: {
|
|
2349
|
+
panel: "Uses",
|
|
2350
|
+
edge: "uses"
|
|
2351
|
+
},
|
|
2352
|
+
extends: {
|
|
2353
|
+
panel: "Extends",
|
|
2354
|
+
edge: "extends"
|
|
2355
|
+
}
|
|
2356
|
+
}), sr = (e) => e.kind || (e.dashed ? "usage" : "ownership"), cr = (e) => `${e.from}->${e.to}`, lr = (e) => Object.hasOwn(or, e) ? or[e].edge : String(e);
|
|
2357
|
+
function ur(e, t, { throughChildren: n = !1, kind: r = null } = {}) {
|
|
2358
|
+
if (!e) return null;
|
|
2359
|
+
let i = e.id, a = /* @__PURE__ */ new Set();
|
|
2360
|
+
for (let e of t) !e.kind && !e.dashed && e.from === i && a.add(e.to);
|
|
2361
|
+
let o = n ? /* @__PURE__ */ new Set([i, ...a]) : null, s = [];
|
|
2362
|
+
for (let e of t) (o ? o.has(e.from) || o.has(e.to) : e.from === i || e.to === i) && s.push(e);
|
|
2363
|
+
let c = /* @__PURE__ */ new Map();
|
|
2364
|
+
for (let e of s) {
|
|
2365
|
+
let t = sr(e);
|
|
2366
|
+
c.set(t, (c.get(t) || 0) + 1);
|
|
2367
|
+
}
|
|
2368
|
+
let l = r && c.has(r) ? r : null, u = l ? s.filter((e) => sr(e) === l) : s, d = /* @__PURE__ */ new Set([i]), f = /* @__PURE__ */ new Set();
|
|
2369
|
+
for (let e of u) d.add(e.from), d.add(e.to), f.add(cr(e));
|
|
2370
|
+
return {
|
|
2371
|
+
connectedNodeIds: d,
|
|
2372
|
+
connectedEdgeKeys: f,
|
|
2373
|
+
childIds: a,
|
|
2374
|
+
selectedId: i,
|
|
2375
|
+
edges: u,
|
|
2376
|
+
kinds: c,
|
|
2377
|
+
kind: l,
|
|
2378
|
+
throughChildren: n
|
|
2379
|
+
};
|
|
2380
|
+
}
|
|
2381
|
+
function dr(e, t, n, { padding: r = 40 } = {}) {
|
|
2382
|
+
let i = ar(t.length ? t : [e], n, {
|
|
2383
|
+
padding: r,
|
|
2384
|
+
maxZoom: 1,
|
|
2385
|
+
minZoom: 1e-4
|
|
2386
|
+
});
|
|
2387
|
+
return i && i.zoom >= .5 ? {
|
|
2388
|
+
...i,
|
|
2389
|
+
framed: !0
|
|
2390
|
+
} : {
|
|
2391
|
+
x: n.x + n.width / 2 - e.x * 1,
|
|
2392
|
+
y: n.y + n.height / 2 - e.y * 1,
|
|
2393
|
+
zoom: 1,
|
|
2394
|
+
framed: !1
|
|
2395
|
+
};
|
|
2396
|
+
}
|
|
2397
|
+
// ../explorer/scene.js
|
|
2398
|
+
var fr = [
|
|
2399
|
+
"root",
|
|
2400
|
+
"app",
|
|
2401
|
+
"pkg",
|
|
2402
|
+
"tool",
|
|
2403
|
+
"store",
|
|
2404
|
+
"rom",
|
|
2405
|
+
"floor"
|
|
2406
|
+
], pr = "\"Segoe UI\", -apple-system, BlinkMacSystemFont, Roboto, sans-serif", mr = "\"Segoe UI\", -apple-system, sans-serif", hr = .32, gr = "#ffffff", _r = .07, vr = {
|
|
2407
|
+
node: {
|
|
2408
|
+
color: "rgba(9, 13, 22, 0.85)",
|
|
2409
|
+
width: 3.5
|
|
2410
|
+
},
|
|
2411
|
+
edge: {
|
|
2412
|
+
color: "rgba(9, 13, 22, 0.9)",
|
|
2413
|
+
width: 3
|
|
2414
|
+
}
|
|
2415
|
+
}, yr = {
|
|
2416
|
+
length: 9,
|
|
2417
|
+
spread: .45
|
|
2418
|
+
}, br = Object.freeze({
|
|
2419
|
+
flow: "chevron",
|
|
2420
|
+
reads: "chevron",
|
|
2421
|
+
writes: "chevron",
|
|
2422
|
+
calls: "triangle",
|
|
2423
|
+
triggers: "triangle",
|
|
2424
|
+
delivers: "triangle",
|
|
2425
|
+
"runs-on": "bar",
|
|
2426
|
+
uses: "diamond",
|
|
2427
|
+
extends: "diamond"
|
|
2428
|
+
}), xr = Object.freeze({
|
|
2429
|
+
strokeWidth: 1.8,
|
|
2430
|
+
barHalf: 5,
|
|
2431
|
+
diamondHalf: 6,
|
|
2432
|
+
diamondAcross: 4.5,
|
|
2433
|
+
tickHalf: 4,
|
|
2434
|
+
tickWidth: 1.6,
|
|
2435
|
+
tickGap: 6
|
|
2436
|
+
}), q = Object.freeze({
|
|
2437
|
+
roundedHalf: .9,
|
|
2438
|
+
roundedCorner: .3,
|
|
2439
|
+
hexInradius: .9,
|
|
2440
|
+
squareHalf: .86,
|
|
2441
|
+
squareCorner: .12,
|
|
2442
|
+
diamondHalf: 1.15
|
|
2443
|
+
}), Sr = Object.freeze({
|
|
2444
|
+
circle: 1,
|
|
2445
|
+
"rounded-square": (q.roundedHalf - q.roundedCorner) * Math.SQRT2 + q.roundedCorner,
|
|
2446
|
+
hexagon: q.hexInradius / Math.cos(Math.PI / 6),
|
|
2447
|
+
square: (q.squareHalf - q.squareCorner) * Math.SQRT2 + q.squareCorner,
|
|
2448
|
+
diamond: q.diamondHalf
|
|
2449
|
+
}), Cr = Object.freeze([7, 5]), wr = Object.freeze([1.5, 4]), Tr = {
|
|
2450
|
+
selected: {
|
|
2451
|
+
fill: "rgba(99, 102, 241, 0.55)",
|
|
2452
|
+
fillR: 8,
|
|
2453
|
+
ring: "#818cf8",
|
|
2454
|
+
ringR: 13,
|
|
2455
|
+
ringWidth: 1.5
|
|
2456
|
+
},
|
|
2457
|
+
match: {
|
|
2458
|
+
fill: "rgba(245, 158, 11, 0.4)",
|
|
2459
|
+
fillR: 8,
|
|
2460
|
+
ring: "#f59e0b",
|
|
2461
|
+
ringR: 13,
|
|
2462
|
+
ringWidth: 1.5
|
|
2463
|
+
},
|
|
2464
|
+
child: {
|
|
2465
|
+
fill: null,
|
|
2466
|
+
fillR: 0,
|
|
2467
|
+
ring: "rgba(255, 255, 255, 0.28)",
|
|
2468
|
+
ringR: 5,
|
|
2469
|
+
ringWidth: 1.2
|
|
2470
|
+
}
|
|
2471
|
+
}, Er = {
|
|
2472
|
+
halfLength: 7,
|
|
2473
|
+
width: 2
|
|
2474
|
+
}, Dr = {
|
|
2475
|
+
color: "#ffffff",
|
|
2476
|
+
radius: 3.5,
|
|
2477
|
+
glow: 10,
|
|
2478
|
+
cycleMs: 2600
|
|
2479
|
+
}, J = {
|
|
2480
|
+
added: {
|
|
2481
|
+
...Yt.added,
|
|
2482
|
+
color: R.dark.added,
|
|
2483
|
+
ringR: 9,
|
|
2484
|
+
ringWidth: 2,
|
|
2485
|
+
edgeWidth: 2.2,
|
|
2486
|
+
alpha: 1
|
|
2487
|
+
},
|
|
2488
|
+
changed: {
|
|
2489
|
+
...Yt.changed,
|
|
2490
|
+
color: R.dark.changed,
|
|
2491
|
+
ringR: 9,
|
|
2492
|
+
ringWidth: 2.5,
|
|
2493
|
+
edgeWidth: 2.4,
|
|
2494
|
+
alpha: 1
|
|
2495
|
+
},
|
|
2496
|
+
removed: {
|
|
2497
|
+
...Yt.removed,
|
|
2498
|
+
color: R.dark.removed,
|
|
2499
|
+
ringR: 9,
|
|
2500
|
+
ringWidth: 2,
|
|
2501
|
+
edgeWidth: 2,
|
|
2502
|
+
alpha: Wt
|
|
2503
|
+
},
|
|
2504
|
+
edit: {
|
|
2505
|
+
...Yt.edit,
|
|
2506
|
+
color: R.dark.edit,
|
|
2507
|
+
ringR: 9,
|
|
2508
|
+
ringWidth: 3,
|
|
2509
|
+
edgeWidth: 2.4,
|
|
2510
|
+
alpha: 1
|
|
2511
|
+
}
|
|
2512
|
+
};
|
|
2513
|
+
function Or(e) {
|
|
2514
|
+
return e === "light" ? jr : Ar;
|
|
2515
|
+
}
|
|
2516
|
+
var kr = (e) => {
|
|
2517
|
+
let t = { ...e };
|
|
2518
|
+
for (let e of [
|
|
2519
|
+
"fill",
|
|
2520
|
+
"ring",
|
|
2521
|
+
"color"
|
|
2522
|
+
]) typeof t[e] == "string" && (t[e] = z(t[e]));
|
|
2523
|
+
return t;
|
|
2524
|
+
}, Ar = Object.freeze({
|
|
2525
|
+
halo: Tr,
|
|
2526
|
+
mark: J,
|
|
2527
|
+
core: gr,
|
|
2528
|
+
labelOutline: vr
|
|
2529
|
+
}), jr = Object.freeze({
|
|
2530
|
+
halo: Object.fromEntries(Object.entries(Tr).map(([e, t]) => [e, kr(t)])),
|
|
2531
|
+
mark: Object.fromEntries(Object.entries(J).map(([e, t]) => [e, {
|
|
2532
|
+
...t,
|
|
2533
|
+
color: R.light[e]
|
|
2534
|
+
}])),
|
|
2535
|
+
core: gr,
|
|
2536
|
+
labelOutline: {
|
|
2537
|
+
node: {
|
|
2538
|
+
color: "rgba(244, 246, 250, 0.9)",
|
|
2539
|
+
width: 3.5
|
|
2540
|
+
},
|
|
2541
|
+
edge: {
|
|
2542
|
+
color: "rgba(244, 246, 250, 0.92)",
|
|
2543
|
+
width: 3
|
|
2544
|
+
}
|
|
2545
|
+
}
|
|
2546
|
+
}), Mr = {
|
|
2547
|
+
ring: 1.8,
|
|
2548
|
+
edge: 1.6,
|
|
2549
|
+
gap: 4
|
|
2550
|
+
}, Nr = .28;
|
|
2551
|
+
function Y(e, t, { viewer: n = !1 } = {}) {
|
|
2552
|
+
return e.proposal && !v(e.proposalView || "diff", t) ? !1 : e.view === "dataflow" ? !!e.flow && e.flow.ids.has(t.id) : e.view === "house" ? ye(e, t) : t.type === "root" || Pr(e, t, n ? e.activeLayers : Dt(e)) || _t(e, t);
|
|
2553
|
+
}
|
|
2554
|
+
function Pr(e, t, n = Dt(e)) {
|
|
2555
|
+
let r = pt(e, t);
|
|
2556
|
+
return r ? n[r] !== !1 : t.type === "core" ? (n.pkg || n.atom) && n.core !== !1 : t.type === "store" ? n.flow !== !1 && n.store !== !1 : t.type === "rom" ? n.rom !== !1 && n.flow !== !1 : t.type === "floor" || t.type === "room" ? n.house !== !1 : t.type === "external" ? n[se(t)] !== !1 : n[t.type] !== !1;
|
|
2557
|
+
}
|
|
2558
|
+
var Fr = (e) => e.view === "dataflow" && e.flow ? e.flow.edges : e.view === "house" ? be(e) : e.edges;
|
|
2559
|
+
function Ir(e, t, n) {
|
|
2560
|
+
return ur(e, t, n);
|
|
2561
|
+
}
|
|
2562
|
+
function Lr(e) {
|
|
2563
|
+
let t = e.scenario, n = new Set(t.visited.nodes), r = new Set(t.visited.edgeList.map(X));
|
|
2564
|
+
t.linkNodes && e.edges.forEach((e) => {
|
|
2565
|
+
n.has(e.from) && n.has(e.to) && r.add(X(e));
|
|
2566
|
+
});
|
|
2567
|
+
let i = ge(t, e.nodes, e.edges);
|
|
2568
|
+
i && (i.down.forEach((e) => n.add(e)), i.hits.forEach((e, t) => n.add(t)), i.edges.forEach((e, t) => r.add(t)));
|
|
2569
|
+
let { node: a, edge: o } = t.current, s = a === void 0 ? o ? o.kind === "writes" ? o.from : o.to : void 0 : a;
|
|
2570
|
+
return {
|
|
2571
|
+
connectedNodeIds: n,
|
|
2572
|
+
connectedEdgeKeys: r,
|
|
2573
|
+
childIds: /* @__PURE__ */ new Set(),
|
|
2574
|
+
selectedId: s
|
|
2575
|
+
};
|
|
2576
|
+
}
|
|
2577
|
+
function Rr(e, t, n) {
|
|
2578
|
+
let r = n.x - t.x, i = n.y - t.y, a = Math.hypot(r, i) || 1, o = e.bend === void 0 ? .18 : e.bend, s = {
|
|
2579
|
+
x: (t.x + n.x) / 2 + -i / a * a * o,
|
|
2580
|
+
y: (t.y + n.y) / 2 + r / a * a * o
|
|
2581
|
+
}, c = (e, t, n) => {
|
|
2582
|
+
let r = t.x - e.x, i = t.y - e.y, a = Math.hypot(r, i) || 1;
|
|
2583
|
+
return {
|
|
2584
|
+
x: e.x + r / a * n,
|
|
2585
|
+
y: e.y + i / a * n
|
|
2586
|
+
};
|
|
2587
|
+
};
|
|
2588
|
+
return {
|
|
2589
|
+
a: c(t, s, (t.r || 18) + 3),
|
|
2590
|
+
b: c(n, s, (n.r || 18) + 9),
|
|
2591
|
+
c: s
|
|
2592
|
+
};
|
|
2593
|
+
}
|
|
2594
|
+
function zr(e, t, n, r) {
|
|
2595
|
+
let i = 1 - r;
|
|
2596
|
+
return {
|
|
2597
|
+
x: i * i * e.x + 2 * i * r * t.x + r * r * n.x,
|
|
2598
|
+
y: i * i * e.y + 2 * i * r * t.y + r * r * n.y
|
|
2599
|
+
};
|
|
2600
|
+
}
|
|
2601
|
+
function Br(e, t) {
|
|
2602
|
+
let n = {
|
|
2603
|
+
x: e.x1,
|
|
2604
|
+
y: e.y1
|
|
2605
|
+
}, r = {
|
|
2606
|
+
x: e.x2,
|
|
2607
|
+
y: e.y2
|
|
2608
|
+
};
|
|
2609
|
+
return zr(n, e.curve ? {
|
|
2610
|
+
x: e.curve.cx,
|
|
2611
|
+
y: e.curve.cy
|
|
2612
|
+
} : {
|
|
2613
|
+
x: (n.x + r.x) / 2,
|
|
2614
|
+
y: (n.y + r.y) / 2
|
|
2615
|
+
}, r, t);
|
|
2616
|
+
}
|
|
2617
|
+
function Vr(e, t) {
|
|
2618
|
+
return Br(e, (t / 1e3 * e.packet.speed + e.packet.phase) % 1);
|
|
2619
|
+
}
|
|
2620
|
+
var Hr = (e) => e.kind || (e.dashed ? "usage" : "ownership"), Ur = (e) => `${e.from}->${e.to}${e.kind ? `|${e.kind}` : e.dashed ? "|dashed" : ""}${e.kind === "flow" && e.flow ? `|${e.flow}` : ""}`, X = (e) => `${e.from}->${e.to}`;
|
|
2621
|
+
function Wr(e, t, n, r, a, o) {
|
|
2622
|
+
let s = e.kind === "reads" || e.kind === "writes", c = i(e), l = !r || r.connectedEdgeKeys.has(X(e)), u = e.status !== "live", { a: d, b: f, c: p } = Rr(e, t, n), m = !!r && l, h = Hr(e), g = null;
|
|
2623
|
+
if (r && l) {
|
|
2624
|
+
let t = zr(d, p, f, .5);
|
|
2625
|
+
g = {
|
|
2626
|
+
text: e.count !== void 0 && e.label ? e.label : lr(h),
|
|
2627
|
+
x: t.x,
|
|
2628
|
+
y: t.y,
|
|
2629
|
+
color: c.color,
|
|
2630
|
+
italic: u
|
|
2631
|
+
};
|
|
2632
|
+
}
|
|
2633
|
+
let _ = null;
|
|
2634
|
+
if ((r ? l : a) && !o) {
|
|
2635
|
+
let t = e.phase === void 0 ? (e.from.length * 7 + e.to.length * 13) % 10 / 10 : e.phase;
|
|
2636
|
+
_ = {
|
|
2637
|
+
color: Dr.color,
|
|
2638
|
+
glowColor: c.color,
|
|
2639
|
+
radius: Dr.radius,
|
|
2640
|
+
glow: Dr.glow,
|
|
2641
|
+
speed: 1e3 / Dr.cycleMs,
|
|
2642
|
+
phase: t
|
|
2643
|
+
};
|
|
2644
|
+
}
|
|
2645
|
+
return {
|
|
2646
|
+
key: Ur(e),
|
|
2647
|
+
from: e.from,
|
|
2648
|
+
to: e.to,
|
|
2649
|
+
kind: Hr(e),
|
|
2650
|
+
x1: d.x,
|
|
2651
|
+
y1: d.y,
|
|
2652
|
+
x2: f.x,
|
|
2653
|
+
y2: f.y,
|
|
2654
|
+
r1: t.r,
|
|
2655
|
+
r2: n.r,
|
|
2656
|
+
color: c.color,
|
|
2657
|
+
width: m ? 2.4 : a && !s ? 2 : 1.6,
|
|
2658
|
+
alpha: r ? l ? 1 : .04 : a ? s ? .2 : .65 : s ? .12 : .45,
|
|
2659
|
+
dash: u ? Cr : null,
|
|
2660
|
+
ticks: oe(e),
|
|
2661
|
+
curve: {
|
|
2662
|
+
cx: p.x,
|
|
2663
|
+
cy: p.y
|
|
2664
|
+
},
|
|
2665
|
+
arrow: !0,
|
|
2666
|
+
end: Object.hasOwn(br, h) ? br[h] : "triangle",
|
|
2667
|
+
glow: m ? 8 : 0,
|
|
2668
|
+
glowColor: m ? c.color : null,
|
|
2669
|
+
label: g,
|
|
2670
|
+
packet: _,
|
|
2671
|
+
mark: "none",
|
|
2672
|
+
live: !!e.live
|
|
2673
|
+
};
|
|
2674
|
+
}
|
|
2675
|
+
function Gr(e, t, n, r) {
|
|
2676
|
+
let i = !r || r.connectedEdgeKeys.has(X(e)), a, o, s = null, c = 0, l = null;
|
|
2677
|
+
return r ? i ? e.dashed ? (a = "#818cf8", o = 2, c = 8, l = "rgba(129, 140, 248, 0.7)", s = wr) : (a = "#ffffff", o = 2.4, c = 10, l = "rgba(255, 255, 255, 0.8)") : (a = "rgba(255, 255, 255, 0.02)", o = .8, s = e.dashed ? wr : null) : e.dashed ? (a = "rgba(129, 140, 248, 0.35)", o = 1.2, s = wr) : (a = "rgba(255, 255, 255, 0.16)", o = 1.4), {
|
|
2678
|
+
key: Ur(e),
|
|
2679
|
+
from: e.from,
|
|
2680
|
+
to: e.to,
|
|
2681
|
+
kind: Hr(e),
|
|
2682
|
+
x1: t.x,
|
|
2683
|
+
y1: t.y,
|
|
2684
|
+
x2: n.x,
|
|
2685
|
+
y2: n.y,
|
|
2686
|
+
r1: t.r,
|
|
2687
|
+
r2: n.r,
|
|
2688
|
+
color: a,
|
|
2689
|
+
width: o,
|
|
2690
|
+
alpha: 1,
|
|
2691
|
+
dash: s,
|
|
2692
|
+
ticks: 0,
|
|
2693
|
+
curve: null,
|
|
2694
|
+
arrow: !1,
|
|
2695
|
+
end: null,
|
|
2696
|
+
glow: c,
|
|
2697
|
+
glowColor: l,
|
|
2698
|
+
label: null,
|
|
2699
|
+
packet: null,
|
|
2700
|
+
mark: "none",
|
|
2701
|
+
live: !!e.live
|
|
2702
|
+
};
|
|
2703
|
+
}
|
|
2704
|
+
var Kr = [
|
|
2705
|
+
"flow",
|
|
2706
|
+
"reads",
|
|
2707
|
+
"writes",
|
|
2708
|
+
"runs-on",
|
|
2709
|
+
"calls",
|
|
2710
|
+
"triggers",
|
|
2711
|
+
"delivers",
|
|
2712
|
+
"uses",
|
|
2713
|
+
"extends"
|
|
2714
|
+
], qr = (e) => e.proposal ? e.proposalView || "diff" : null;
|
|
2715
|
+
function Jr(e, t, n, r = !1, i = !1) {
|
|
2716
|
+
if (e.mark = t, t === "none") {
|
|
2717
|
+
(n === "diff" || i) && (e.alpha *= Nr, e.glow = 0, e.packet = null), i && (e.greyed = !0);
|
|
2718
|
+
return;
|
|
2719
|
+
}
|
|
2720
|
+
let a = J[t];
|
|
2721
|
+
e.color = a.color, e.dash = r ? J.removed.edgeDash : a.edgeDash, e.width = Math.max(e.width, a.edgeWidth), e.alpha >= .1 && (e.alpha = Math.max(e.alpha, Gt) * (r ? J.removed.alpha : a.alpha)), e.glow && (e.glowColor = a.color);
|
|
2722
|
+
}
|
|
2723
|
+
function Yr(e, t, n) {
|
|
2724
|
+
let { nodes: r } = e, i = Dt(e), a = Ot(e), o = new Map(r.map((e) => [e.id, e])), s = e.view === "dataflow", c = [], l = (e) => !!t && t.connectedEdgeKeys.has(X(e)), u = (e, r, i) => c.push(Wr(e, r, i, t, s, n)), d = qr(e), f = (n) => {
|
|
2725
|
+
let r = o.get(n.from), a = o.get(n.to);
|
|
2726
|
+
if (r && a && Y(e, r) && Y(e, a)) {
|
|
2727
|
+
if (s) return u(n, r, a);
|
|
2728
|
+
if (e.view === "house") {
|
|
2729
|
+
let e = xe(n, r, a);
|
|
2730
|
+
e === "flow" ? u(n, r, a) : e === "link" && c.push(Gr(n, r, a, t));
|
|
2731
|
+
} else n.kind === "flow" ? i.flow !== !1 && u(n, r, a) : n.kind === "reads" || n.kind === "writes" ? i.table !== !1 && u(n, r, a) : n.kind === "runs-on" ? (i.stack !== !1 || a.type === "machine") && u(n, r, a) : n.kind === "calls" || n.kind === "triggers" || n.kind === "delivers" ? (r.type !== "page" || n.kind !== "calls" || l(n)) && u(n, r, a) : n.kind === "uses" || n.kind === "extends" ? l(n) && u(n, r, a) : c.push(Gr(n, r, a, t));
|
|
2732
|
+
}
|
|
2733
|
+
};
|
|
2734
|
+
return Fr(e).forEach((n) => {
|
|
2735
|
+
if (d && !y(d, n)) return;
|
|
2736
|
+
let r = d === "before" ? x(n) : n, i = d ? b(d, n) : "none", l = c.length;
|
|
2737
|
+
if (i === "none") f(r);
|
|
2738
|
+
else {
|
|
2739
|
+
let n = o.get(r.from), i = o.get(r.to);
|
|
2740
|
+
if (!n || !i || !Y(e, n) || !Y(e, i)) return;
|
|
2741
|
+
s || Kr.includes(r.kind) ? u(r, n, i) : c.push(Gr(r, n, i, t));
|
|
2742
|
+
}
|
|
2743
|
+
for (let e = l; e < c.length; e++) Jr(c[e], i, d, i === "edit" && n.editOp === "removed", a);
|
|
2744
|
+
}), c;
|
|
2745
|
+
}
|
|
2746
|
+
var Xr = (e) => e.type === "floor" || e.type === "room" ? "house" : e.type === "external" ? se(e) : e.type, Zr = (e) => Yn(e.color) ?? (E[e.type] || E.external).color;
|
|
2747
|
+
function Qr(e, t) {
|
|
2748
|
+
let { nodes: n, selectedNode: r, searchQuery: i } = e, a = i ? zn(n, i) : null, o = !!a && n.some((t) => a.has(t.id) && Y(e, t)), s = [], c = qr(e), l = Ot(e), u = c === "diff" || c && l ? S(n, Fr(e)) : null;
|
|
2749
|
+
return n.forEach((n) => {
|
|
2750
|
+
if (!Y(e, n)) return;
|
|
2751
|
+
let i = c === "before" ? x(n) : n, d = !!a && a.has(n.id), f = d && e.searchCurrent === n.id, p = !!r && r.id === n.id, m = !t || t.connectedNodeIds.has(n.id), h = t && t.childIds ? t.childIds.has(n.id) : !1, g = c ? b(c, n) : "none", _ = J[g], v = g === "edit" && n.editOp === "removed", y = t && !m && !(o && d) ? _r : 1;
|
|
2752
|
+
o && !d && !p && !(t && m) && (y = _r);
|
|
2753
|
+
let S = l && !!u && !u.touched.has(n.id);
|
|
2754
|
+
u && !u.touched.has(n.id) && (y = Math.min(y, S ? qt : Nr)), _ && (y *= v ? J.removed.alpha : _.alpha);
|
|
2755
|
+
let C = i.type === "root" || i.type === "app", w = yt(e, i), T = pt(e, i);
|
|
2756
|
+
s.push({
|
|
2757
|
+
id: n.id,
|
|
2758
|
+
type: i.type,
|
|
2759
|
+
group: Xr(i),
|
|
2760
|
+
...typeof i.kind == "string" && i.kind ? { kind: i.kind } : {},
|
|
2761
|
+
...w ? { letters: w } : {},
|
|
2762
|
+
shape: te(i.type),
|
|
2763
|
+
hitR: i.r * Sr[te(i.type)],
|
|
2764
|
+
..._n(i.type) ? { glyph: i.type } : {},
|
|
2765
|
+
...T ? { layer: T } : {},
|
|
2766
|
+
x: n.x,
|
|
2767
|
+
y: n.y,
|
|
2768
|
+
r: i.r,
|
|
2769
|
+
color: Zr(i),
|
|
2770
|
+
alpha: y,
|
|
2771
|
+
glow: m && y >= .5 ? C ? 15 : 9 : 0,
|
|
2772
|
+
halo: d ? "match" : p ? "selected" : h ? "child" : "none",
|
|
2773
|
+
mark: g,
|
|
2774
|
+
...S ? { greyed: !0 } : {},
|
|
2775
|
+
selected: p,
|
|
2776
|
+
match: d,
|
|
2777
|
+
current: f,
|
|
2778
|
+
connected: m,
|
|
2779
|
+
degree: n.degree || 0,
|
|
2780
|
+
label: i.label,
|
|
2781
|
+
labelSize: C && !S ? 12 : 11,
|
|
2782
|
+
labelBold: C && !S,
|
|
2783
|
+
labelAlpha: S && (!t || m) ? Jt[e.theme === "light" ? "light" : "dark"] : u && !u.touched.has(n.id) && (!t || m) ? Math.max(y, Kt) : y,
|
|
2784
|
+
labelColor: m ? "#f8fafc" : "rgba(255, 255, 255, 0.3)",
|
|
2785
|
+
labelKeep: fr.includes(i.type) && !S || p || d || g !== "none" || !!(t && m),
|
|
2786
|
+
labelStrike: !!_ && (_.strike || v),
|
|
2787
|
+
live: !!n.live,
|
|
2788
|
+
box: n.box || null
|
|
2789
|
+
});
|
|
2790
|
+
}), s;
|
|
2791
|
+
}
|
|
2792
|
+
function $r(e) {
|
|
2793
|
+
let { rings: t, selectedNode: n } = e, r = {
|
|
2794
|
+
color: n ? "rgba(66, 153, 225, 0.04)" : "rgba(66, 153, 225, 0.14)",
|
|
2795
|
+
width: 1,
|
|
2796
|
+
dash: [4, 6]
|
|
2797
|
+
}, i = {
|
|
2798
|
+
color: n ? "rgba(66, 153, 225, 0.03)" : "rgba(66, 153, 225, 0.08)",
|
|
2799
|
+
width: 1,
|
|
2800
|
+
dash: [4, 6]
|
|
2801
|
+
};
|
|
2802
|
+
return [...t.rings.map(({ x: e, y: t, r: n }) => ({
|
|
2803
|
+
x: e,
|
|
2804
|
+
y: t,
|
|
2805
|
+
r: n,
|
|
2806
|
+
...r
|
|
2807
|
+
})), ...t.clusters.flatMap(({ x: e, y: t, radii: n }) => n.map((n) => ({
|
|
2808
|
+
x: e,
|
|
2809
|
+
y: t,
|
|
2810
|
+
r: n,
|
|
2811
|
+
...i
|
|
2812
|
+
})))];
|
|
2813
|
+
}
|
|
2814
|
+
function ei(e) {
|
|
2815
|
+
let t = -e.top + 40;
|
|
2816
|
+
return e.headers.map((n, r) => {
|
|
2817
|
+
let i = e.headers[r + 1];
|
|
2818
|
+
return {
|
|
2819
|
+
x: n.left - 12,
|
|
2820
|
+
y: e.top + 30,
|
|
2821
|
+
w: n.right - n.left + 24,
|
|
2822
|
+
h: t - e.top - 30,
|
|
2823
|
+
radius: 14,
|
|
2824
|
+
fill: "rgba(66, 153, 225, 0.05)",
|
|
2825
|
+
stroke: "rgba(66, 153, 225, 0.18)",
|
|
2826
|
+
strokeWidth: 1,
|
|
2827
|
+
title: {
|
|
2828
|
+
text: n.title,
|
|
2829
|
+
x: n.x,
|
|
2830
|
+
y: e.top + 4,
|
|
2831
|
+
size: 15,
|
|
2832
|
+
bold: !0,
|
|
2833
|
+
color: "#e2e8f0"
|
|
2834
|
+
},
|
|
2835
|
+
note: {
|
|
2836
|
+
text: n.note,
|
|
2837
|
+
x: n.x,
|
|
2838
|
+
y: e.top + 22,
|
|
2839
|
+
size: 11,
|
|
2840
|
+
bold: !1,
|
|
2841
|
+
color: "#94a3b8"
|
|
2842
|
+
},
|
|
2843
|
+
arrow: i ? {
|
|
2844
|
+
text: "→",
|
|
2845
|
+
x: (n.right + i.left) / 2,
|
|
2846
|
+
y: e.top + 8,
|
|
2847
|
+
size: 18,
|
|
2848
|
+
bold: !0,
|
|
2849
|
+
color: "rgba(148, 163, 184, 0.5)"
|
|
2850
|
+
} : null
|
|
2851
|
+
};
|
|
2852
|
+
});
|
|
2853
|
+
}
|
|
2854
|
+
var ti = .55, ni = .5, ri = {
|
|
2855
|
+
color: "#ffffff",
|
|
2856
|
+
radius: 4.5,
|
|
2857
|
+
glow: 12
|
|
2858
|
+
}, ii = {
|
|
2859
|
+
width: 3.6,
|
|
2860
|
+
glow: 14
|
|
2861
|
+
};
|
|
2862
|
+
function ai(e, t) {
|
|
2863
|
+
return e.from !== t.from || e.to !== t.to ? !1 : t.kind ? e.kind === t.kind && (!t.flow || e.key.split("|")[2] === t.flow) : e.kind === "ownership" || e.kind === "usage";
|
|
2864
|
+
}
|
|
2865
|
+
function oi(e, t, n = {}) {
|
|
2866
|
+
if (t.done) return;
|
|
2867
|
+
let { node: r, edge: i, at: a } = t.current, o = new Set(r === void 0 ? i ? [i.from, i.to] : [] : [r]);
|
|
2868
|
+
a !== void 0 && o.add(a), e.nodes.forEach((e) => {
|
|
2869
|
+
e.connected && (o.has(e.id) ? (r !== void 0 || e.id === a) && e.halo !== "match" && (e.halo = "selected") : (e.alpha = ti, e.labelAlpha = ti));
|
|
2870
|
+
});
|
|
2871
|
+
let s = new Set(t.visited.edgeList.map(X)), c = (e) => s.has(X(e)) || t.linkNodes && t.visited.nodes.has(e.from) && t.visited.nodes.has(e.to);
|
|
2872
|
+
e.edges.forEach((e) => {
|
|
2873
|
+
if (i && ai(e, i)) {
|
|
2874
|
+
e.alpha = 1, e.width = Math.max(e.width, ii.width), e.glow = ii.glow, e.glowColor = e.glowColor || e.color;
|
|
2875
|
+
let r = 1e3 / t.stepMs, i = t.stepStartMs == null ? 0 : (-t.stepStartMs / 1e3 * r % 1 + 1) % 1;
|
|
2876
|
+
e.packet = n.reduceMotion ? null : {
|
|
2877
|
+
...ri,
|
|
2878
|
+
glowColor: e.color,
|
|
2879
|
+
speed: r,
|
|
2880
|
+
phase: i
|
|
2881
|
+
};
|
|
2882
|
+
} else c(e) && (e.alpha = ni, e.packet = null);
|
|
2883
|
+
});
|
|
2884
|
+
}
|
|
2885
|
+
function si(e, t = {}) {
|
|
2886
|
+
let n = e.view === "dataflow", r = e.scenario ? Lr(e) : e.selectedNode ? Ir(e.selectedNode, Fr(e), {
|
|
2887
|
+
throughChildren: !!e.throughChildren,
|
|
2888
|
+
kind: e.selectedKind || null
|
|
2889
|
+
}) : null, i = n && e.flow ? ei(e.flow) : [], a = !(n && e.flow) && !e.isFreeform ? $r(e) : [], o = {
|
|
2890
|
+
nodes: Qr(e, r),
|
|
2891
|
+
edges: Yr(e, r, !!t.reduceMotion),
|
|
2892
|
+
decor: {
|
|
2893
|
+
grid: {
|
|
2894
|
+
size: 48,
|
|
2895
|
+
color: "rgba(255, 255, 255, 0.035)",
|
|
2896
|
+
width: .5,
|
|
2897
|
+
margin: 200
|
|
2898
|
+
},
|
|
2899
|
+
rings: a,
|
|
2900
|
+
lanes: i
|
|
2901
|
+
},
|
|
2902
|
+
painted: {
|
|
2903
|
+
nodes: /* @__PURE__ */ new Set(),
|
|
2904
|
+
edges: /* @__PURE__ */ new Set()
|
|
2905
|
+
},
|
|
2906
|
+
preset: n,
|
|
2907
|
+
theme: "dark",
|
|
2908
|
+
version: e.sceneVersion || 0
|
|
2909
|
+
};
|
|
2910
|
+
e.view === "house" && Ce(o, e), e.scenario && oi(o, e.scenario, t), o.greying = o.nodes.some((e) => e.greyed) || o.edges.some((e) => e.greyed);
|
|
2911
|
+
let s = {
|
|
2912
|
+
nodes: o.nodes.map((e) => e.color),
|
|
2913
|
+
edges: o.edges.map((e) => e.color)
|
|
2914
|
+
};
|
|
2915
|
+
return e.scenario && _e(o, ge(e.scenario, e.nodes, e.edges)), e.scenario && Ne(o, e.scenario), e.forgeLit && Nn(o, e.forgeLit), o.nodes.forEach((e, t) => {
|
|
2916
|
+
s.nodes.length === o.nodes.length && e.color !== s.nodes[t] && o.painted.nodes.add(e.id);
|
|
2917
|
+
}), o.edges.forEach((e, t) => {
|
|
2918
|
+
s.edges.length === o.edges.length && e.color !== s.edges[t] && o.painted.edges.add(e.key);
|
|
2919
|
+
}), e.theme === "light" && dn(o), o;
|
|
2920
|
+
}
|
|
2921
|
+
function ci(e = si) {
|
|
2922
|
+
let t = null, n, r = {
|
|
2923
|
+
builds: 0,
|
|
2924
|
+
get(i) {
|
|
2925
|
+
return t && n === i.sceneVersion || (t = e(i), n = i.sceneVersion, r.builds++), t;
|
|
2926
|
+
}
|
|
2927
|
+
};
|
|
2928
|
+
return r;
|
|
2929
|
+
}
|
|
2930
|
+
// ../explorer/engine/map-style.js
|
|
2931
|
+
var li = Object.freeze(Object.keys(E)), ui = Object.freeze([
|
|
2932
|
+
"app",
|
|
2933
|
+
"pkg",
|
|
2934
|
+
"page",
|
|
2935
|
+
"atom",
|
|
2936
|
+
"molecule",
|
|
2937
|
+
"token",
|
|
2938
|
+
"tool",
|
|
2939
|
+
"table",
|
|
2940
|
+
"rom",
|
|
2941
|
+
"service",
|
|
2942
|
+
"cloud",
|
|
2943
|
+
"web",
|
|
2944
|
+
"stack",
|
|
2945
|
+
"machine",
|
|
2946
|
+
"container",
|
|
2947
|
+
"device",
|
|
2948
|
+
"house",
|
|
2949
|
+
"persona"
|
|
2950
|
+
]), di = Object.freeze([
|
|
2951
|
+
"ownership",
|
|
2952
|
+
"usage",
|
|
2953
|
+
"flow",
|
|
2954
|
+
"reads",
|
|
2955
|
+
"writes",
|
|
2956
|
+
"calls",
|
|
2957
|
+
"triggers",
|
|
2958
|
+
"delivers",
|
|
2959
|
+
"runs-on",
|
|
2960
|
+
"uses",
|
|
2961
|
+
"extends"
|
|
2962
|
+
]), fi = Object.freeze([
|
|
2963
|
+
"added",
|
|
2964
|
+
"changed",
|
|
2965
|
+
"removed",
|
|
2966
|
+
"edit"
|
|
2967
|
+
]), pi = Object.freeze([
|
|
2968
|
+
"selected",
|
|
2969
|
+
"match",
|
|
2970
|
+
"lit"
|
|
2971
|
+
]), mi = "--corn-map-stroke", hi = "--corn-map-label", gi = "--corn-map-label-halo", _i = "--corn-map-font", vi = "--corn-map-edge-width", yi = "--corn-map-glow", bi = "--corn-map-label-min", xi = "--corn-map-grey", Si = "--corn-map-grey-alpha", Ci = "--corn-map-glyph", wi = 1.6, Ti = 1.5, Ei = 1.2, Di = (e) => `--corn-map-node-${e}`, Oi = (e) => `--corn-map-group-${e}`, ki = (e) => `--corn-map-edge-${e}`, Z = (e) => `--corn-map-${e}`, Ai = Object.freeze([
|
|
2972
|
+
...li.map(Di),
|
|
2973
|
+
...ui.map(Oi),
|
|
2974
|
+
mi,
|
|
2975
|
+
hi,
|
|
2976
|
+
gi,
|
|
2977
|
+
Ci,
|
|
2978
|
+
xi,
|
|
2979
|
+
...di.map(ki),
|
|
2980
|
+
...fi.map(Z),
|
|
2981
|
+
...pi.map(Z)
|
|
2982
|
+
]);
|
|
2983
|
+
function Q(e, t) {
|
|
2984
|
+
let [n, r, i, a] = L(e), o = L(t)[3];
|
|
2985
|
+
return o >= 1 ? e : Jn(n, r, i, a * o);
|
|
2986
|
+
}
|
|
2987
|
+
var ji = /^(?:serif|sans-serif|monospace|cursive|fantasy|system-ui|ui-serif|ui-sans-serif|ui-monospace|ui-rounded|emoji|math|fangsong)$/i, Mi = /^(?:-apple-system|BlinkMacSystemFont)$/;
|
|
2988
|
+
function Ni(e) {
|
|
2989
|
+
let t = typeof e == "string" ? e.trim() : "";
|
|
2990
|
+
if (!t || t.length > 200 || t.toLowerCase() === "auto" || /[();:{}<>@\\/\u0000-\u001f\u007f]|\burl\b|\bvar\b|\bexpression\b|\bimport\b/i.test(t)) return null;
|
|
2991
|
+
let n = t.split(",").map((e) => e.trim());
|
|
2992
|
+
if (n.length > 8) return null;
|
|
2993
|
+
let r = [];
|
|
2994
|
+
for (let e of n) {
|
|
2995
|
+
let t = /^"([A-Za-z0-9 ._+-]{1,60})"$|^'([A-Za-z0-9 ._+-]{1,60})'$/.exec(e), n = t ? (t[1] ?? t[2]).trim() : /^-?[A-Za-z][A-Za-z0-9 _-]{0,59}$/.test(e) ? e.replace(/\s+/g, " ") : null;
|
|
2996
|
+
if (!n) return null;
|
|
2997
|
+
r.push(ji.test(n) ? n.toLowerCase() : Mi.test(n) ? n : `"${n}"`);
|
|
2998
|
+
}
|
|
2999
|
+
return r.join(", ");
|
|
3000
|
+
}
|
|
3001
|
+
function Pi(e, t) {
|
|
3002
|
+
let n = /^\s*(\d*\.?\d+)(?:px)?\s*$/i.exec(String(e ?? "")), r = n ? parseFloat(n[1]) : NaN;
|
|
3003
|
+
return Number.isFinite(r) && r > 0 && r <= t ? r : null;
|
|
3004
|
+
}
|
|
3005
|
+
function Fi(e) {
|
|
3006
|
+
let t = Pi(e, 24);
|
|
3007
|
+
return t !== null && t >= 9 ? t : null;
|
|
3008
|
+
}
|
|
3009
|
+
function Ii(e) {
|
|
3010
|
+
let t = /^\s*(\d*\.?\d+)(px)?\s*$/i.exec(String(e ?? ""));
|
|
3011
|
+
if (!t) return null;
|
|
3012
|
+
let n = parseFloat(t[1]);
|
|
3013
|
+
return t[2] && n !== 0 ? null : Number.isFinite(n) && n >= 0 && n <= 4 ? n : null;
|
|
3014
|
+
}
|
|
3015
|
+
function Li(e) {
|
|
3016
|
+
let t = /^\s*(\d*\.?\d+)\s*$/.exec(String(e ?? "")), n = t ? parseFloat(t[1]) : NaN;
|
|
3017
|
+
return Number.isFinite(n) && n >= .1 && n <= 1 ? n : null;
|
|
3018
|
+
}
|
|
3019
|
+
function Ri(e, t = []) {
|
|
3020
|
+
let n = {};
|
|
3021
|
+
for (let r of [...Ai, ...t]) {
|
|
3022
|
+
let t = Hn(e(r));
|
|
3023
|
+
t && (n[r] = t);
|
|
3024
|
+
}
|
|
3025
|
+
let r = parseFloat(String(e("--corn-map-stroke-width") ?? ""));
|
|
3026
|
+
return {
|
|
3027
|
+
values: n,
|
|
3028
|
+
strokeWidth: Number.isFinite(r) && r >= 0 ? r : Ti,
|
|
3029
|
+
font: Ni(e(_i)),
|
|
3030
|
+
edgeWidth: Pi(e(vi), 12),
|
|
3031
|
+
glow: Ii(e(yi)),
|
|
3032
|
+
labelMin: Fi(e(bi)),
|
|
3033
|
+
greyAlpha: Li(e(Si))
|
|
3034
|
+
};
|
|
3035
|
+
}
|
|
3036
|
+
function zi(e, t = "") {
|
|
3037
|
+
return new Promise((n, r) => {
|
|
3038
|
+
if (typeof Image > "u") {
|
|
3039
|
+
r(/* @__PURE__ */ Error("no Image"));
|
|
3040
|
+
return;
|
|
3041
|
+
}
|
|
3042
|
+
let i = new Image();
|
|
3043
|
+
t && (i.crossOrigin = t), i.onload = () => i.naturalWidth > 0 && i.naturalHeight > 0 ? n(i) : r(/* @__PURE__ */ Error(`${e} has no size`)), i.onerror = () => r(/* @__PURE__ */ Error(`${e} did not load`)), i.src = e;
|
|
3044
|
+
});
|
|
3045
|
+
}
|
|
3046
|
+
function Bi(e, { load: t = zi, onChange: n = () => {}, warn: r = (e) => console.warn(e) } = {}) {
|
|
3047
|
+
let i = /* @__PURE__ */ new Map(), a = 0;
|
|
3048
|
+
for (let [o, s] of Object.entries(e || {})) {
|
|
3049
|
+
if (!Xe(o) || typeof s != "string" || !s.startsWith("/cornfield/theme/assets/") || s.includes("..")) continue;
|
|
3050
|
+
let e = {
|
|
3051
|
+
status: "loading",
|
|
3052
|
+
image: null
|
|
3053
|
+
};
|
|
3054
|
+
i.set(o, e), Promise.resolve().then(() => t(s)).then((t) => {
|
|
3055
|
+
e.status = "ready", e.image = t, a++, n();
|
|
3056
|
+
}, (t) => {
|
|
3057
|
+
e.status = "failed", r(`Map icon for "${o}" not drawn: ${t && t.message ? t.message : t}`);
|
|
3058
|
+
});
|
|
3059
|
+
}
|
|
3060
|
+
return {
|
|
3061
|
+
kinds: [...i.keys()],
|
|
3062
|
+
get: (e) => {
|
|
3063
|
+
let t = i.get(e);
|
|
3064
|
+
return t && t.status === "ready" ? t.image : null;
|
|
3065
|
+
},
|
|
3066
|
+
status: (e) => i.has(e) ? i.get(e).status : "none",
|
|
3067
|
+
anyReady: () => a > 0
|
|
3068
|
+
};
|
|
3069
|
+
}
|
|
3070
|
+
var Vi = {
|
|
3071
|
+
values: {},
|
|
3072
|
+
strokeWidth: Ti,
|
|
3073
|
+
font: null,
|
|
3074
|
+
edgeWidth: null,
|
|
3075
|
+
glow: null,
|
|
3076
|
+
labelMin: null,
|
|
3077
|
+
greyAlpha: null
|
|
3078
|
+
}, Hi = Object.freeze({
|
|
3079
|
+
version: 0,
|
|
3080
|
+
values: Object.freeze({}),
|
|
3081
|
+
strokeWidth: Ti,
|
|
3082
|
+
font: null,
|
|
3083
|
+
edgeWidth: null,
|
|
3084
|
+
glow: null,
|
|
3085
|
+
labelMin: null,
|
|
3086
|
+
greyAlpha: null,
|
|
3087
|
+
icons: null,
|
|
3088
|
+
pixelated: !1,
|
|
3089
|
+
plain: !0
|
|
3090
|
+
}), Ui = 500;
|
|
3091
|
+
function Wi(e) {
|
|
3092
|
+
let t = Vi, n = null, r = !1, i = 0, a = [], o = /* @__PURE__ */ new Set(), s = () => {
|
|
3093
|
+
let e = !Object.keys(t.values).length && !(n && n.anyReady()) && t.font === null && t.edgeWidth === null && t.glow === null && t.labelMin === null && t.greyAlpha === null;
|
|
3094
|
+
return Object.freeze({
|
|
3095
|
+
version: i,
|
|
3096
|
+
values: t.values,
|
|
3097
|
+
strokeWidth: t.strokeWidth,
|
|
3098
|
+
font: t.font,
|
|
3099
|
+
edgeWidth: t.edgeWidth,
|
|
3100
|
+
glow: t.glow,
|
|
3101
|
+
labelMin: t.labelMin,
|
|
3102
|
+
greyAlpha: t.greyAlpha,
|
|
3103
|
+
icons: n,
|
|
3104
|
+
pixelated: r,
|
|
3105
|
+
plain: e
|
|
3106
|
+
});
|
|
3107
|
+
}, c = s(), l = !1;
|
|
3108
|
+
e.own(() => {
|
|
3109
|
+
l = !0, o.clear();
|
|
3110
|
+
});
|
|
3111
|
+
let u = () => {
|
|
3112
|
+
l || (i++, c = s(), o.forEach((e) => e(c)));
|
|
3113
|
+
}, d = {
|
|
3114
|
+
get: () => c,
|
|
3115
|
+
onChange(e) {
|
|
3116
|
+
return o.add(e), () => o.delete(e);
|
|
3117
|
+
},
|
|
3118
|
+
setSubjects({ kinds: e = [], layers: t = [] } = {}) {
|
|
3119
|
+
let n = [...new Set([...e.map(([e, t]) => qe(e, t)), ...t.map((e) => Je(e))].filter(Boolean))].sort().slice(0, Ui);
|
|
3120
|
+
return n.length === a.length && n.every((e, t) => e === a[t]) ? !1 : (a = n, d.refresh());
|
|
3121
|
+
},
|
|
3122
|
+
refresh(n = e.tokenReader()) {
|
|
3123
|
+
if (!n) return !1;
|
|
3124
|
+
let r = Ri(n, a);
|
|
3125
|
+
if (r.strokeWidth === t.strokeWidth && r.font === t.font && r.edgeWidth === t.edgeWidth && r.glow === t.glow && r.labelMin === t.labelMin && Object.keys(r.values).length === Object.keys(t.values).length && Object.entries(r.values).every(([e, n]) => t.values[e] === n)) return !1;
|
|
3126
|
+
t = r, u();
|
|
3127
|
+
try {
|
|
3128
|
+
let t = e.doc && e.doc.fonts;
|
|
3129
|
+
r.font && t && t.load && t.load(`12px ${r.font}`).catch(() => {});
|
|
3130
|
+
} catch {}
|
|
3131
|
+
return !0;
|
|
3132
|
+
},
|
|
3133
|
+
setIcons(t, i = {}) {
|
|
3134
|
+
let a = t && t.icons && typeof t.icons == "object" ? t.icons : {};
|
|
3135
|
+
r = !!(t && t.pixelated === !0);
|
|
3136
|
+
let o = e.base ? "anonymous" : "", s = i.load || ((t) => zi(e.url(t), o));
|
|
3137
|
+
return n = Object.keys(a).length ? Bi(a, {
|
|
3138
|
+
...i,
|
|
3139
|
+
load: s,
|
|
3140
|
+
onChange: () => {
|
|
3141
|
+
u(), i.onChange && i.onChange();
|
|
3142
|
+
}
|
|
3143
|
+
}) : null, u(), n;
|
|
3144
|
+
},
|
|
3145
|
+
applyTheme(t, n = {}) {
|
|
3146
|
+
let r = e.tokenElement();
|
|
3147
|
+
return r && r.setAttribute && (t && t.pixelated === !0 ? r.setAttribute("data-pixelated", "") : r.removeAttribute("data-pixelated")), d.setIcons(t, n);
|
|
3148
|
+
},
|
|
3149
|
+
reset() {
|
|
3150
|
+
t = Vi, n = null, r = !1, a = [], u();
|
|
3151
|
+
},
|
|
3152
|
+
watch() {
|
|
3153
|
+
let n = () => {
|
|
3154
|
+
d.refresh();
|
|
3155
|
+
}, r = [], i = e.tokenElement();
|
|
3156
|
+
if (i && e.win && e.win.MutationObserver) {
|
|
3157
|
+
let t = new e.win.MutationObserver(n);
|
|
3158
|
+
t.observe(i, {
|
|
3159
|
+
attributes: !0,
|
|
3160
|
+
attributeFilter: [
|
|
3161
|
+
"data-theme",
|
|
3162
|
+
"data-theme-name",
|
|
3163
|
+
"class"
|
|
3164
|
+
]
|
|
3165
|
+
}), r.push(() => t.disconnect());
|
|
3166
|
+
}
|
|
3167
|
+
e.root && r.push(e.listen(e.root, "load", (e) => {
|
|
3168
|
+
e.target && e.target.tagName === "LINK" && n();
|
|
3169
|
+
}, !0));
|
|
3170
|
+
let a = e.win && e.win.matchMedia ? e.win.matchMedia("(prefers-color-scheme: light)") : null;
|
|
3171
|
+
a && (a.addEventListener ? (a.addEventListener("change", n), r.push(() => a.removeEventListener("change", n))) : a.addListener && (a.addListener(n), r.push(() => a.removeListener(n))));
|
|
3172
|
+
let o = e.doc && e.doc.fonts;
|
|
3173
|
+
if (o && o.addEventListener) {
|
|
3174
|
+
let e = () => {
|
|
3175
|
+
t.font && u();
|
|
3176
|
+
};
|
|
3177
|
+
o.addEventListener("loadingdone", e), r.push(() => o.removeEventListener("loadingdone", e));
|
|
3178
|
+
}
|
|
3179
|
+
n();
|
|
3180
|
+
let s = () => {
|
|
3181
|
+
for (; r.length;) r.pop()();
|
|
3182
|
+
};
|
|
3183
|
+
return e.own(s), s;
|
|
3184
|
+
}
|
|
3185
|
+
};
|
|
3186
|
+
return d;
|
|
3187
|
+
}
|
|
3188
|
+
var Gi = (e) => e.slot("map-style", Wi), Ki = (e, t) => {
|
|
3189
|
+
for (let n of t) if (e[n]) return e[n];
|
|
3190
|
+
return null;
|
|
3191
|
+
}, qi = Ye, Ji = (e, t) => Ki(e, qi(t));
|
|
3192
|
+
function Yi(e, t) {
|
|
3193
|
+
let n = t.edgeWidth == null ? 1 : t.edgeWidth / wi, r = t.glow == null ? 1 : t.glow;
|
|
3194
|
+
if (n === 1 && r === 1) return e;
|
|
3195
|
+
let i = {
|
|
3196
|
+
...e,
|
|
3197
|
+
width: e.width * n,
|
|
3198
|
+
glow: e.glow * r
|
|
3199
|
+
};
|
|
3200
|
+
return e.packet && (i.packet = {
|
|
3201
|
+
...e.packet,
|
|
3202
|
+
glow: e.packet.glow * r
|
|
3203
|
+
}), i;
|
|
3204
|
+
}
|
|
3205
|
+
function Xi(e, t, n) {
|
|
3206
|
+
let { values: r } = t;
|
|
3207
|
+
if (e.mark && e.mark !== "none") {
|
|
3208
|
+
let n = r[Z(e.mark)];
|
|
3209
|
+
return Yi(n ? {
|
|
3210
|
+
...e,
|
|
3211
|
+
color: n,
|
|
3212
|
+
glowColor: e.glowColor ? n : e.glowColor
|
|
3213
|
+
} : e, t);
|
|
3214
|
+
}
|
|
3215
|
+
if (n.has(e.key)) return Yi(e, t);
|
|
3216
|
+
let i = !e.curve && e.glow > 0 && !e.arrow && r[Z("lit")] || r[ki(e.kind)];
|
|
3217
|
+
if (!i) return Yi(e, t);
|
|
3218
|
+
let a = {
|
|
3219
|
+
...e,
|
|
3220
|
+
color: Q(i, e.color)
|
|
3221
|
+
};
|
|
3222
|
+
return e.glowColor && (a.glowColor = Q(i, e.glowColor)), e.packet && (a.packet = {
|
|
3223
|
+
...e.packet,
|
|
3224
|
+
glowColor: Q(i, e.packet.glowColor)
|
|
3225
|
+
}), Yi(a, t);
|
|
3226
|
+
}
|
|
3227
|
+
function Zi(e) {
|
|
3228
|
+
let [t, n, r, i] = L(e), a = Math.round(.2126 * t + .7152 * n + .0722 * r);
|
|
3229
|
+
return i >= 1 ? `rgb(${a}, ${a}, ${a})` : Jn(a, a, a, i);
|
|
3230
|
+
}
|
|
3231
|
+
function Qi(e, t) {
|
|
3232
|
+
let { values: n } = t, r = n[xi], i = t.greyAlpha == null ? 1 : t.greyAlpha / qt, a = (e) => r ? Q(r, e) : Zi(e), o = n[hi], s = n[mi], c = e.painted || {
|
|
3233
|
+
nodes: /* @__PURE__ */ new Set(),
|
|
3234
|
+
edges: /* @__PURE__ */ new Set()
|
|
3235
|
+
}, l = e.nodes.map((e) => {
|
|
3236
|
+
let r = !c.nodes.has(e.id) && Ji(n, e), l = t.icons && Ze(e.type, e.kind, e.layer).find((e) => t.icons.get(e)) || null, u = t.glow != null && t.glow !== 1 && e.glow > 0, d = !!e.greyed && !c.nodes.has(e.id);
|
|
3237
|
+
if (!r && !o && !s && !l && !u && !d) return e;
|
|
3238
|
+
let f = { ...e };
|
|
3239
|
+
return u && (f.glow = e.glow * t.glow), r && (f.color = r), o && (f.labelColor = Q(o, e.labelColor)), s && t.strokeWidth > 0 && (f.stroke = {
|
|
3240
|
+
color: d ? a(s) : s,
|
|
3241
|
+
width: t.strokeWidth
|
|
3242
|
+
}), l && !d && (f.icon = l), d && (f.color = a(f.color), f.alpha = Math.min(1, e.alpha * i)), f;
|
|
3243
|
+
}), u = e.edges.map((e) => {
|
|
3244
|
+
let n = Xi(e, t, c.edges);
|
|
3245
|
+
return !e.greyed || c.edges.has(e.key) ? n : {
|
|
3246
|
+
...n,
|
|
3247
|
+
color: a(n.color),
|
|
3248
|
+
glowColor: null,
|
|
3249
|
+
alpha: Math.min(1, n.alpha * i)
|
|
3250
|
+
};
|
|
3251
|
+
}), d = {
|
|
3252
|
+
...e,
|
|
3253
|
+
nodes: l,
|
|
3254
|
+
edges: u
|
|
3255
|
+
};
|
|
3256
|
+
t.font && (d.labelFont = t.font), t.labelMin != null && (d.labelMin = t.labelMin);
|
|
3257
|
+
let f = n[gi];
|
|
3258
|
+
if (f) {
|
|
3259
|
+
let { node: t, edge: n } = Or(e.theme).labelOutline;
|
|
3260
|
+
d.labelOutline = {
|
|
3261
|
+
node: {
|
|
3262
|
+
...t,
|
|
3263
|
+
color: f
|
|
3264
|
+
},
|
|
3265
|
+
edge: {
|
|
3266
|
+
...n,
|
|
3267
|
+
color: f
|
|
3268
|
+
}
|
|
3269
|
+
};
|
|
3270
|
+
}
|
|
3271
|
+
return d;
|
|
3272
|
+
}
|
|
3273
|
+
var $i = /* @__PURE__ */ new WeakMap();
|
|
3274
|
+
function ea(e, t) {
|
|
3275
|
+
if (!t || t.plain && !e.greying) return e;
|
|
3276
|
+
let n = $i.get(e);
|
|
3277
|
+
if (n && n.style === t) return n.out;
|
|
3278
|
+
let r = Qi(e, t);
|
|
3279
|
+
return $i.set(e, {
|
|
3280
|
+
style: t,
|
|
3281
|
+
out: r
|
|
3282
|
+
}), r;
|
|
3283
|
+
}
|
|
3284
|
+
var ta = /* @__PURE__ */ new WeakMap();
|
|
3285
|
+
function na(e, t) {
|
|
3286
|
+
if (!t || t.plain) return e;
|
|
3287
|
+
let n = ta.get(e);
|
|
3288
|
+
if (n && n.style === t) return n.out;
|
|
3289
|
+
let { values: r } = t, i = { ...e.halo };
|
|
3290
|
+
for (let e of ["selected", "match"]) {
|
|
3291
|
+
let t = r[Z(e)];
|
|
3292
|
+
t && (i[e] = {
|
|
3293
|
+
...i[e],
|
|
3294
|
+
ring: t,
|
|
3295
|
+
fill: i[e].fill ? Q(t, i[e].fill) : i[e].fill
|
|
3296
|
+
});
|
|
3297
|
+
}
|
|
3298
|
+
let a = { ...e.mark };
|
|
3299
|
+
for (let e of fi) {
|
|
3300
|
+
let t = r[Z(e)];
|
|
3301
|
+
t && (a[e] = {
|
|
3302
|
+
...a[e],
|
|
3303
|
+
color: t
|
|
3304
|
+
});
|
|
3305
|
+
}
|
|
3306
|
+
let o = {
|
|
3307
|
+
...e,
|
|
3308
|
+
halo: i,
|
|
3309
|
+
mark: a
|
|
3310
|
+
};
|
|
3311
|
+
return ta.set(e, {
|
|
3312
|
+
style: t,
|
|
3313
|
+
out: o
|
|
3314
|
+
}), o;
|
|
3315
|
+
}
|
|
3316
|
+
// ../explorer/engine/layout.js
|
|
3317
|
+
function ra(e) {
|
|
3318
|
+
let { state: t } = e;
|
|
3319
|
+
e.touchScene();
|
|
3320
|
+
let n = {};
|
|
3321
|
+
t.nodes.forEach((e) => {
|
|
3322
|
+
n[e.id] = 0, e.baseR === void 0 && (e.baseR = e.r);
|
|
3323
|
+
}), t.edges.forEach((e) => {
|
|
3324
|
+
n[e.from] !== void 0 && n[e.from]++, n[e.to] !== void 0 && n[e.to]++;
|
|
3325
|
+
}), t.nodes.forEach((e) => {
|
|
3326
|
+
let t = n[e.id] || 0;
|
|
3327
|
+
e.degree = t;
|
|
3328
|
+
let r = Math.max(-3, Math.min(7, (Math.sqrt(t) - 1.4) * 2.2));
|
|
3329
|
+
e.r = Math.max(12, Math.round(e.baseR + r)), e.scaleDelta = r;
|
|
3330
|
+
});
|
|
3331
|
+
}
|
|
3332
|
+
var ia = "\"Segoe UI\", -apple-system, sans-serif";
|
|
3333
|
+
function aa(e, t) {
|
|
3334
|
+
let { ctx: n } = e.state;
|
|
3335
|
+
n.save(), n.font = `${t.type === "root" || t.type === "app" ? "bold 12px" : "11px"} ${ia}`;
|
|
3336
|
+
let r = n.measureText(t.label || "").width;
|
|
3337
|
+
return n.restore(), r;
|
|
3338
|
+
}
|
|
3339
|
+
var oa = [
|
|
3340
|
+
"store",
|
|
3341
|
+
"table",
|
|
3342
|
+
"rom"
|
|
3343
|
+
], sa = [
|
|
3344
|
+
"core",
|
|
3345
|
+
"atom",
|
|
3346
|
+
"molecule",
|
|
3347
|
+
"token",
|
|
3348
|
+
"page",
|
|
3349
|
+
"service",
|
|
3350
|
+
"external",
|
|
3351
|
+
"stack",
|
|
3352
|
+
"table",
|
|
3353
|
+
"store",
|
|
3354
|
+
"tool",
|
|
3355
|
+
"app",
|
|
3356
|
+
"pkg"
|
|
3357
|
+
], ca = 64;
|
|
3358
|
+
function la(e, { first: t = 110, gap: n = 76, spacing: r = 90 } = {}) {
|
|
3359
|
+
let i = [], a = [], o = 0, s = 0;
|
|
3360
|
+
for (; o < e.length;) {
|
|
3361
|
+
let c = t + s * n, l = Math.max(1, Math.floor(2 * Math.PI * c / r)), u = Math.min(l, e.length - o), d = (e) => Array.from({ length: u }, (t, n) => -Math.PI / 2 + e + n / u * Math.PI * 2).some((e) => Math.abs(Math.atan2(Math.sin(e - Math.PI / 2), Math.cos(e - Math.PI / 2))) < .35), f = s % 2 ? Math.PI / u : 0;
|
|
3362
|
+
d(f) && (f += Math.PI / u);
|
|
3363
|
+
for (let e = 0; e < u; e++) {
|
|
3364
|
+
let t = -Math.PI / 2 + f + e / u * Math.PI * 2;
|
|
3365
|
+
i.push({
|
|
3366
|
+
x: Math.cos(t) * c,
|
|
3367
|
+
y: Math.sin(t) * c
|
|
3368
|
+
});
|
|
3369
|
+
}
|
|
3370
|
+
a.push(c), o += u, s++;
|
|
3371
|
+
}
|
|
3372
|
+
return {
|
|
3373
|
+
offsets: i,
|
|
3374
|
+
radii: a
|
|
3375
|
+
};
|
|
3376
|
+
}
|
|
3377
|
+
function ua(e, t, n, r, i = /* @__PURE__ */ new Set(), a = 0) {
|
|
3378
|
+
let o = [], s = [];
|
|
3379
|
+
e.forEach((e) => {
|
|
3380
|
+
let c = i.has(e.id) || a >= ca ? [] : t(e);
|
|
3381
|
+
if (!c.length) {
|
|
3382
|
+
s.push(e);
|
|
3383
|
+
return;
|
|
3384
|
+
}
|
|
3385
|
+
i.add(e.id);
|
|
3386
|
+
let l = ua(c.sort(r), t, n, r, i, a + 1);
|
|
3387
|
+
o.push({
|
|
3388
|
+
c: e,
|
|
3389
|
+
sub: l,
|
|
3390
|
+
fp: l.extent
|
|
3391
|
+
});
|
|
3392
|
+
}), o.sort((e, t) => t.fp - e.fp);
|
|
3393
|
+
let c = la(s, { spacing: n(e) }), l = {
|
|
3394
|
+
children: [...s],
|
|
3395
|
+
offsets: [...c.offsets],
|
|
3396
|
+
radii: c.radii,
|
|
3397
|
+
subs: s.map(() => null),
|
|
3398
|
+
extent: c.radii.length ? c.radii[c.radii.length - 1] + 40 : 0
|
|
3399
|
+
};
|
|
3400
|
+
if (o.length) {
|
|
3401
|
+
let e = c.radii.length ? c.radii[c.radii.length - 1] : 0, t = o[0].fp, n = o.reduce((e, t) => e + 2 * t.fp + 30, 0), r = [], i = -Math.PI / 2;
|
|
3402
|
+
o.forEach((e) => {
|
|
3403
|
+
let t = (2 * e.fp + 30) / n * Math.PI * 2;
|
|
3404
|
+
r.push(i + t / 2), i += t;
|
|
3405
|
+
});
|
|
3406
|
+
let a = Math.max(110, e + t + 40, n / (2 * Math.PI));
|
|
3407
|
+
for (let e = 0; e < o.length; e++) for (let t = e + 1; t < o.length; t++) {
|
|
3408
|
+
let n = Math.sin(Math.abs(r[t] - r[e]) / 2);
|
|
3409
|
+
n > 1e-6 && (a = Math.max(a, (o[e].fp + o[t].fp + 30) / (2 * n)));
|
|
3410
|
+
}
|
|
3411
|
+
o.forEach((e, t) => {
|
|
3412
|
+
l.children.push(e.c), l.offsets.push({
|
|
3413
|
+
x: Math.cos(r[t]) * a,
|
|
3414
|
+
y: Math.sin(r[t]) * a
|
|
3415
|
+
}), l.subs.push(e.sub);
|
|
3416
|
+
}), l.bigRadius = a, l.extent = Math.max(l.extent, a + t);
|
|
3417
|
+
}
|
|
3418
|
+
return l;
|
|
3419
|
+
}
|
|
3420
|
+
function da(e, t, n, r) {
|
|
3421
|
+
e.children.forEach((i, a) => {
|
|
3422
|
+
i.x = t + e.offsets[a].x, i.y = n + e.offsets[a].y;
|
|
3423
|
+
let o = e.subs[a];
|
|
3424
|
+
o && (r.push({
|
|
3425
|
+
x: i.x,
|
|
3426
|
+
y: i.y,
|
|
3427
|
+
radii: o.radii
|
|
3428
|
+
}), da(o, i.x, i.y, r));
|
|
3429
|
+
});
|
|
3430
|
+
}
|
|
3431
|
+
var fa = 2;
|
|
3432
|
+
function pa(e, t) {
|
|
3433
|
+
let n = null;
|
|
3434
|
+
for (let r = 0; r < 360; r += fa) {
|
|
3435
|
+
let i = -Math.PI / 2 + r * Math.PI / 180, a = Math.cos(i), o = Math.sin(i), s = [];
|
|
3436
|
+
for (let n of e) {
|
|
3437
|
+
let e = a * n.x + o * n.y, r = n.r + t, i = e * e - (n.x * n.x + n.y * n.y) + r * r;
|
|
3438
|
+
i > 0 && s.push([e - Math.sqrt(i), e + Math.sqrt(i)]);
|
|
3439
|
+
}
|
|
3440
|
+
s.sort((e, t) => e[0] - t[0]);
|
|
3441
|
+
let c = 0;
|
|
3442
|
+
for (let [e, t] of s) e < c + 1e-9 && t > c && (c = t);
|
|
3443
|
+
(!n || c < n.at - 1e-6) && (n = {
|
|
3444
|
+
at: c,
|
|
3445
|
+
x: a * c,
|
|
3446
|
+
y: o * c
|
|
3447
|
+
});
|
|
3448
|
+
}
|
|
3449
|
+
return n;
|
|
3450
|
+
}
|
|
3451
|
+
function ma(e) {
|
|
3452
|
+
let { state: t } = e;
|
|
3453
|
+
e.touchScene();
|
|
3454
|
+
let { nodes: n, edges: r } = t;
|
|
3455
|
+
if (n.length === 0) return;
|
|
3456
|
+
t.rings = {
|
|
3457
|
+
rings: [],
|
|
3458
|
+
clusters: []
|
|
3459
|
+
};
|
|
3460
|
+
let i = t.rings, a = new Set(n.map((e) => e.id)), o = {};
|
|
3461
|
+
r.forEach((e) => {
|
|
3462
|
+
!e.dashed && !e.kind && e.from && e.to && a.has(e.from) && e.from !== e.to && !o[e.to] && (o[e.to] = e.from);
|
|
3463
|
+
}), n.forEach((e) => {
|
|
3464
|
+
let t = /* @__PURE__ */ new Set([e.id]);
|
|
3465
|
+
for (let n = o[e.id]; n; n = o[n]) {
|
|
3466
|
+
if (t.has(n)) {
|
|
3467
|
+
delete o[n];
|
|
3468
|
+
break;
|
|
3469
|
+
}
|
|
3470
|
+
t.add(n);
|
|
3471
|
+
}
|
|
3472
|
+
}), n.forEach((e) => {
|
|
3473
|
+
e.x = 0, e.y = 0;
|
|
3474
|
+
});
|
|
3475
|
+
let s = n.find((e) => e.id === "root");
|
|
3476
|
+
s && (s.x = 0, s.y = 0);
|
|
3477
|
+
let c = (e) => oa.includes(e.type), l = new Set(Object.values(o)), u = new Set(n.filter((e) => o[e.id] && !c(e)).map((e) => o[e.id])), d = new Set(n.filter((e) => e.id !== "root" && (c(e) ? l.has(e.id) && (!o[e.id] || o[e.id] === "root") && (e.type === "store" || u.has(e.id)) : o[e.id] === "root" || !o[e.id] && (l.has(e.id) || [
|
|
3478
|
+
"app",
|
|
3479
|
+
"pkg",
|
|
3480
|
+
"tool",
|
|
3481
|
+
"external",
|
|
3482
|
+
"stack"
|
|
3483
|
+
].includes(e.type)))).map((e) => e.id)), f = n.filter((e) => d.has(e.id) || e.id !== "root" && c(e) && u.has(e.id) && !d.has(o[e.id])), p = new Set(f.map((e) => e.id)), m = (e) => {
|
|
3484
|
+
let t = sa.indexOf(e.type);
|
|
3485
|
+
return t < 0 ? 99 : t;
|
|
3486
|
+
}, h = (e, t) => m(e) - m(t) || String(e.label).localeCompare(String(t.label)), g = n.filter((e) => c(e) && !p.has(e.id) && !p.has(o[e.id])).sort((e, t) => oa.indexOf(e.type) - oa.indexOf(t.type) || String(e.label).localeCompare(String(t.label))), _ = Math.max(110, ...g.map((t) => aa(e, t) + 24)), v = Math.max(150, g.length * _ / (2 * Math.PI));
|
|
3487
|
+
g.forEach((e, t) => {
|
|
3488
|
+
let n = -Math.PI / 2 + t / Math.max(1, g.length) * Math.PI * 2;
|
|
3489
|
+
e.x = Math.cos(n) * v, e.y = Math.sin(n) * v;
|
|
3490
|
+
});
|
|
3491
|
+
let y = g.length ? v + 50 : 60;
|
|
3492
|
+
g.length && i.rings.push({
|
|
3493
|
+
x: 0,
|
|
3494
|
+
y: 0,
|
|
3495
|
+
r: v
|
|
3496
|
+
});
|
|
3497
|
+
let b = (e) => e.id === "root" ? [] : n.filter((t) => o[t.id] === e.id && !p.has(t.id) && !c(t) && t.id !== "root"), x = (t) => Math.min(170, Math.max(84, ...t.map((t) => aa(e, t) * .8 + 26))), S = /* @__PURE__ */ new Map();
|
|
3498
|
+
f.forEach((e) => {
|
|
3499
|
+
let t = n.filter((t) => o[t.id] === e.id && !p.has(t.id)).sort(h);
|
|
3500
|
+
t.length && S.set(e.id, ua(t, b, x, h, /* @__PURE__ */ new Set([e.id])));
|
|
3501
|
+
});
|
|
3502
|
+
let C = f.filter((e) => S.has(e.id)).sort((e, t) => S.get(t.id).extent - S.get(e.id).extent || String(e.label).localeCompare(String(t.label))), w = [{
|
|
3503
|
+
x: 0,
|
|
3504
|
+
y: 0,
|
|
3505
|
+
r: y
|
|
3506
|
+
}], T = y;
|
|
3507
|
+
C.forEach((e) => {
|
|
3508
|
+
let t = S.get(e.id), n = pa(w, t.extent + 35);
|
|
3509
|
+
e.x = n.x, e.y = n.y, w.push({
|
|
3510
|
+
x: e.x,
|
|
3511
|
+
y: e.y,
|
|
3512
|
+
r: t.extent + 35
|
|
3513
|
+
}), T = Math.max(T, Math.hypot(e.x, e.y) + t.extent), i.clusters.push({
|
|
3514
|
+
x: e.x,
|
|
3515
|
+
y: e.y,
|
|
3516
|
+
radii: t.radii
|
|
3517
|
+
}), da(t, e.x, e.y, i.clusters);
|
|
3518
|
+
});
|
|
3519
|
+
let ee = n.filter((e) => e.id !== "root" && !o[e.id] && !c(e) && !p.has(e.id)), E = [...f.filter((e) => !S.has(e.id)), ...ee].sort(h), D = Math.max(120, ...E.map((t) => aa(e, t) + 30)), O = Math.max(T + 90, E.length * D / (2 * Math.PI));
|
|
3520
|
+
E.forEach((e, t) => {
|
|
3521
|
+
let n = -Math.PI / 2 + t / Math.max(1, E.length) * Math.PI * 2;
|
|
3522
|
+
e.x = Math.cos(n) * O, e.y = Math.sin(n) * O;
|
|
3523
|
+
}), E.length && i.rings.push({
|
|
3524
|
+
x: 0,
|
|
3525
|
+
y: 0,
|
|
3526
|
+
r: O
|
|
3527
|
+
});
|
|
3528
|
+
let te = (e) => e.id === "root" || e.x !== 0 || e.y !== 0, ne = /* @__PURE__ */ new Map();
|
|
3529
|
+
n.forEach((e) => {
|
|
3530
|
+
let t = o[e.id];
|
|
3531
|
+
!te(e) && t && (ne.get(t) || ne.set(t, []).get(t)).push(e);
|
|
3532
|
+
});
|
|
3533
|
+
let re = new Map(n.map((e) => [e.id, e]));
|
|
3534
|
+
ne.forEach((e, t) => {
|
|
3535
|
+
let n = re.get(t);
|
|
3536
|
+
if (!n || !te(n) || e.every(te)) return;
|
|
3537
|
+
let r = ua(e.sort(h), b, x, h, /* @__PURE__ */ new Set([t]));
|
|
3538
|
+
i.clusters.push({
|
|
3539
|
+
x: n.x,
|
|
3540
|
+
y: n.y,
|
|
3541
|
+
radii: r.radii
|
|
3542
|
+
}), da(r, n.x, n.y, i.clusters);
|
|
3543
|
+
});
|
|
3544
|
+
}
|
|
3545
|
+
var ha = 50, ga = 110, _a = 15;
|
|
3546
|
+
function va(e, t) {
|
|
3547
|
+
e.touchScene();
|
|
3548
|
+
let n = 0;
|
|
3549
|
+
t.headers = [];
|
|
3550
|
+
let r = [];
|
|
3551
|
+
t.tiers.forEach((i) => {
|
|
3552
|
+
if (!i.nodes.length) return;
|
|
3553
|
+
let a = Math.ceil(i.nodes.length / _a), o = Math.ceil(i.nodes.length / a), s = Math.max(70, ...i.nodes.map((t) => aa(e, t) + 30)), c = n;
|
|
3554
|
+
i.nodes.forEach((e, t) => {
|
|
3555
|
+
let n = Math.floor(t / o), i = t % o;
|
|
3556
|
+
e.x = c + n * s + s / 2, e.y = (i - (o - 1) / 2) * ha, r.push(e);
|
|
3557
|
+
});
|
|
3558
|
+
let l = a * s;
|
|
3559
|
+
t.headers.push({
|
|
3560
|
+
title: i.title,
|
|
3561
|
+
note: i.note,
|
|
3562
|
+
x: c + l / 2,
|
|
3563
|
+
left: c,
|
|
3564
|
+
right: c + l,
|
|
3565
|
+
rows: o
|
|
3566
|
+
}), n += l + ga;
|
|
3567
|
+
}), t.top = -((Math.max(1, ...t.headers.map((e) => e.rows)) - 1) / 2) * ha - 70;
|
|
3568
|
+
let i = (n - ga) / 2;
|
|
3569
|
+
r.forEach((e) => {
|
|
3570
|
+
e.x -= i;
|
|
3571
|
+
}), t.headers.forEach((e) => {
|
|
3572
|
+
e.x -= i, e.left -= i, e.right -= i;
|
|
3573
|
+
});
|
|
3574
|
+
}
|
|
3575
|
+
var ya = "cornfield-freeform-positions";
|
|
3576
|
+
function ba(e) {
|
|
3577
|
+
e.store.set(ya, JSON.stringify(e.state.freeformPositions));
|
|
3578
|
+
}
|
|
3579
|
+
function xa(e) {
|
|
3580
|
+
let { state: t } = e;
|
|
3581
|
+
e.touchScene();
|
|
3582
|
+
let n = 0;
|
|
3583
|
+
return t.nodes.forEach((e) => {
|
|
3584
|
+
let r = t.freeformPositions[e.id];
|
|
3585
|
+
r && (e.x = r.x, e.y = r.y, n++);
|
|
3586
|
+
}), n > 0;
|
|
3587
|
+
}
|
|
3588
|
+
function Sa(e) {
|
|
3589
|
+
ma(e), e.state.isFreeform && xa(e);
|
|
3590
|
+
}
|
|
3591
|
+
// ../explorer/engine/hint.js
|
|
3592
|
+
var Ca = "cornfield:hint-done";
|
|
3593
|
+
function wa(e) {
|
|
3594
|
+
try {
|
|
3595
|
+
return !!(e && e.matchMedia && e.matchMedia("(pointer: coarse)").matches);
|
|
3596
|
+
} catch {
|
|
3597
|
+
return !1;
|
|
3598
|
+
}
|
|
3599
|
+
}
|
|
3600
|
+
function Ta(e, t, n) {
|
|
3601
|
+
return n && (t.set || !e.set) ? t.text : e.text;
|
|
3602
|
+
}
|
|
3603
|
+
function Ea(e, t = wa(e.win)) {
|
|
3604
|
+
let { state: n } = e;
|
|
3605
|
+
return n.view === "dataflow" ? p(e, "hintDataFlow") : n.isFreeform ? Ta({
|
|
3606
|
+
text: p(e, "hintDrag"),
|
|
3607
|
+
set: d(e, "hintDrag")
|
|
3608
|
+
}, {
|
|
3609
|
+
text: p(e, "hintDragTouch"),
|
|
3610
|
+
set: d(e, "hintDragTouch")
|
|
3611
|
+
}, t) : Ta({
|
|
3612
|
+
text: p(e, "hintInspect"),
|
|
3613
|
+
set: d(e, "hintInspect")
|
|
3614
|
+
}, {
|
|
3615
|
+
text: p(e, "hintInspectTouch"),
|
|
3616
|
+
set: d(e, "hintInspectTouch")
|
|
3617
|
+
}, t);
|
|
3618
|
+
}
|
|
3619
|
+
var Da = (e) => {
|
|
3620
|
+
try {
|
|
3621
|
+
return e.win ? e.win.sessionStorage : null;
|
|
3622
|
+
} catch {
|
|
3623
|
+
return null;
|
|
3624
|
+
}
|
|
3625
|
+
}, Oa = (e) => e.slot("hint", () => {
|
|
3626
|
+
let t = { dismissed: !1 };
|
|
3627
|
+
try {
|
|
3628
|
+
let n = Da(e);
|
|
3629
|
+
t.dismissed = !!n && n.getItem("cornfield:hint-done") === "1";
|
|
3630
|
+
} catch {
|
|
3631
|
+
t.dismissed = !1;
|
|
3632
|
+
}
|
|
3633
|
+
return t;
|
|
3634
|
+
});
|
|
3635
|
+
function ka(e) {
|
|
3636
|
+
let t = Oa(e);
|
|
3637
|
+
if (!t.dismissed && (t.dismissed = !0, e.el("instruction-badge-text"))) {
|
|
3638
|
+
try {
|
|
3639
|
+
let t = Da(e);
|
|
3640
|
+
t && t.setItem(Ca, "1");
|
|
3641
|
+
} catch {}
|
|
3642
|
+
ja(e);
|
|
3643
|
+
}
|
|
3644
|
+
}
|
|
3645
|
+
function Aa(e) {
|
|
3646
|
+
let t = (t) => e.el(t), n = t("proposal-bar");
|
|
3647
|
+
if (n && !n.hidden) return !0;
|
|
3648
|
+
let r = t("spec-drawer");
|
|
3649
|
+
if (r && r.classList.contains("drawer-open")) return !0;
|
|
3650
|
+
let i = t("forge-panel");
|
|
3651
|
+
return i && i.classList.contains("forge-open") ? !0 : !!(e.root && e.root.querySelector("[data-corn=\"scenario-player\"]"));
|
|
3652
|
+
}
|
|
3653
|
+
function ja(e) {
|
|
3654
|
+
let t = e.el("instruction-badge-text"), n = Ea(e);
|
|
3655
|
+
t && t.textContent !== n && (t.textContent = n);
|
|
3656
|
+
let r = t && t.closest("[data-corn=\"hint\"]");
|
|
3657
|
+
if (!r) return;
|
|
3658
|
+
let i = Aa(e) || Oa(e).dismissed && e.state.view !== "dataflow";
|
|
3659
|
+
r.hidden !== i && (r.hidden = i);
|
|
3660
|
+
}
|
|
3661
|
+
// ../explorer/sheet-model.js
|
|
3662
|
+
var Ma = Object.freeze({
|
|
3663
|
+
proposal: "review",
|
|
3664
|
+
player: "review",
|
|
3665
|
+
forge: "other",
|
|
3666
|
+
drawer: "other"
|
|
3667
|
+
}), Na = /* @__PURE__ */ new Set(["other"]);
|
|
3668
|
+
function Pa(e = Ma) {
|
|
3669
|
+
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = null, i = (t) => e[t] || t;
|
|
3670
|
+
return {
|
|
3671
|
+
add: (e) => {
|
|
3672
|
+
t.add(e), n.add(e);
|
|
3673
|
+
},
|
|
3674
|
+
remove: (e) => {
|
|
3675
|
+
t.delete(e), n.delete(e), r === e && (r = null);
|
|
3676
|
+
},
|
|
3677
|
+
has: (e) => t.has(e),
|
|
3678
|
+
show(e) {
|
|
3679
|
+
if (!t.has(e) || (n.add(e), !Na.has(i(e)))) return [];
|
|
3680
|
+
let a = [...n].filter((t) => t !== e && i(t) === i(e));
|
|
3681
|
+
for (let e of a) n.delete(e), r === e && (r = null);
|
|
3682
|
+
return a;
|
|
3683
|
+
},
|
|
3684
|
+
hide(e) {
|
|
3685
|
+
n.delete(e), r === e && (r = null);
|
|
3686
|
+
},
|
|
3687
|
+
isShown: (e) => n.has(e),
|
|
3688
|
+
shown: () => [...n],
|
|
3689
|
+
expand(e) {
|
|
3690
|
+
return !t.has(e) || !n.has(e) || r === e ? !1 : (r = e, !0);
|
|
3691
|
+
},
|
|
3692
|
+
collapse(e) {
|
|
3693
|
+
return r === e && (r = null, !0);
|
|
3694
|
+
},
|
|
3695
|
+
collapseAll() {
|
|
3696
|
+
return r !== null && (r = null, !0);
|
|
3697
|
+
},
|
|
3698
|
+
toggle(e) {
|
|
3699
|
+
return !t.has(e) || !n.has(e) ? !1 : (r = r === e ? null : e, !0);
|
|
3700
|
+
},
|
|
3701
|
+
isExpanded: (e) => r === e,
|
|
3702
|
+
expanded: () => r,
|
|
3703
|
+
stateOf(e) {
|
|
3704
|
+
if (t.has(e)) return n.has(e) ? r === e ? "expanded" : r !== null && i(r) !== i(e) ? "stub" : "peek" : "hidden";
|
|
3705
|
+
},
|
|
3706
|
+
stubs() {
|
|
3707
|
+
return [...n].filter((e) => r !== null && e !== r && i(e) !== i(r)).length;
|
|
3708
|
+
},
|
|
3709
|
+
ids: () => [...t]
|
|
3710
|
+
};
|
|
3711
|
+
}
|
|
3712
|
+
function Fa(e) {
|
|
3713
|
+
return e.slot("sheets", () => ({
|
|
3714
|
+
model: Pa(),
|
|
3715
|
+
elements: /* @__PURE__ */ new Map(),
|
|
3716
|
+
options: /* @__PURE__ */ new Map(),
|
|
3717
|
+
offs: /* @__PURE__ */ new Map(),
|
|
3718
|
+
away: /* @__PURE__ */ new Set(),
|
|
3719
|
+
listeners: /* @__PURE__ */ new Set(),
|
|
3720
|
+
dock: null,
|
|
3721
|
+
box: null,
|
|
3722
|
+
lastCovered: 0,
|
|
3723
|
+
observers: [],
|
|
3724
|
+
wiredDock: null,
|
|
3725
|
+
documentWired: !1
|
|
3726
|
+
}));
|
|
3727
|
+
}
|
|
3728
|
+
var Ia = 768, La = (e) => {
|
|
3729
|
+
let { box: t } = Fa(e);
|
|
3730
|
+
return t ? t.isConnected && t.clientWidth > 0 && t.clientWidth < Ia : !!(e.win && typeof e.win.matchMedia == "function" && e.win.matchMedia("(max-width: 767px)").matches);
|
|
3731
|
+
}, Ra = (e, t) => t.dock && t.dock.parentElement || (e.state.canvas ? e.state.canvas.parentElement : null);
|
|
3732
|
+
function za(e) {
|
|
3733
|
+
let t = Fa(e), { state: n } = e;
|
|
3734
|
+
if (!t.dock || !t.dock.isConnected) return n.coveredBottom || 0;
|
|
3735
|
+
let r = La(e) ? Math.round(t.dock.offsetHeight || 0) : 0;
|
|
3736
|
+
n.coveredBottom = r;
|
|
3737
|
+
let i = Ra(e, t);
|
|
3738
|
+
return i && i.style.setProperty("--hx-covered", `${r}px`), r !== t.lastCovered && (t.lastCovered = r, t.listeners.forEach((e) => e())), r;
|
|
3739
|
+
}
|
|
3740
|
+
function Ba(e) {
|
|
3741
|
+
let { state: t } = e, n = {
|
|
3742
|
+
top: 0,
|
|
3743
|
+
bottom: 0,
|
|
3744
|
+
left: 0,
|
|
3745
|
+
right: 0
|
|
3746
|
+
}, r = t.canvas, i = (e) => !!e && !e.hidden && e.isConnected;
|
|
3747
|
+
if (La(e)) n.bottom = za(e) + 8;
|
|
3748
|
+
else if (r && typeof r.getBoundingClientRect == "function") {
|
|
3749
|
+
let t = r.getBoundingClientRect(), a = e.el("proposal-bar");
|
|
3750
|
+
i(a) && (n.top = Math.max(0, a.getBoundingClientRect().bottom - t.top) + 8);
|
|
3751
|
+
let o = e.el("spec-drawer");
|
|
3752
|
+
i(o) && o.classList.contains("drawer-open") && (n.right = o.offsetWidth);
|
|
3753
|
+
let s = e.el("forge-panel");
|
|
3754
|
+
i(s) && s.classList.contains("forge-open") && (n.left = s.offsetWidth);
|
|
3755
|
+
let c = e.el("review-column");
|
|
3756
|
+
i(c) && (n.left = Math.max(n.left, Math.max(0, c.getBoundingClientRect().right - t.left) + 8));
|
|
3757
|
+
let l = e.root ? e.root.querySelector(".hx-player") : null;
|
|
3758
|
+
i(l) && (n.bottom = Math.max(0, t.bottom - l.getBoundingClientRect().top) + 8);
|
|
3759
|
+
}
|
|
3760
|
+
return nr(t.width || 0, t.height || 0, n);
|
|
3761
|
+
}
|
|
3762
|
+
function Va(e) {
|
|
3763
|
+
return e.slot("fly", () => {
|
|
3764
|
+
let t = { glide: null };
|
|
3765
|
+
return t.tick = (n) => {
|
|
3766
|
+
if (!t.glide) return;
|
|
3767
|
+
let r = t.glide.last === null ? 16 : Math.min(n - t.glide.last, 100);
|
|
3768
|
+
t.glide.last = n;
|
|
3769
|
+
let i = 1 - Math.exp(-r / 120), a = e.state.camera;
|
|
3770
|
+
a.x += (t.glide.to.x - a.x) * i, a.y += (t.glide.to.y - a.y) * i, a.zoom += (t.glide.to.zoom - a.zoom) * i, Math.abs(t.glide.to.x - a.x) < .5 && Math.abs(t.glide.to.y - a.y) < .5 && Math.abs(t.glide.to.zoom - a.zoom) < .002 && (Object.assign(a, t.glide.to), t.glide = null);
|
|
3771
|
+
}, t.off = e.map ? e.map.addFrameClient({
|
|
3772
|
+
wants: () => !!t.glide,
|
|
3773
|
+
tick: t.tick
|
|
3774
|
+
}) : null, t.off && e.own(t.off), t;
|
|
3775
|
+
});
|
|
3776
|
+
}
|
|
3777
|
+
function Ha(e, t) {
|
|
3778
|
+
if (!t) return;
|
|
3779
|
+
let n = Va(e), { state: r } = e;
|
|
3780
|
+
e.reducedMotion || !r.width ? (Object.assign(r.camera, t), n.glide = null, e.map.render()) : (n.glide = {
|
|
3781
|
+
to: { ...t },
|
|
3782
|
+
last: null
|
|
3783
|
+
}, e.map.ensureFlowLoop());
|
|
3784
|
+
}
|
|
3785
|
+
function Ua(e) {
|
|
3786
|
+
Va(e).glide = null;
|
|
3787
|
+
}
|
|
3788
|
+
// ../explorer/selection-view.js
|
|
3789
|
+
function Wa(e) {
|
|
3790
|
+
return !e.state.selectedNode || e.state.scenario ? [] : e.map.getScene().nodes.filter((e) => e.connected);
|
|
3791
|
+
}
|
|
3792
|
+
function Ga(e) {
|
|
3793
|
+
let t = e.state.selectedNode;
|
|
3794
|
+
if (!t) return null;
|
|
3795
|
+
let n = dr(t, Wa(e), Ba(e), { padding: e.map.fitPadding() });
|
|
3796
|
+
return Ha(e, {
|
|
3797
|
+
x: n.x,
|
|
3798
|
+
y: n.y,
|
|
3799
|
+
zoom: n.zoom
|
|
3800
|
+
}), n;
|
|
3801
|
+
}
|
|
3802
|
+
// ../explorer/engine/selection.js
|
|
3803
|
+
function Ka(e, t, { frame: n = !1, source: r = "api" } = {}) {
|
|
3804
|
+
if (!t) return;
|
|
3805
|
+
let { state: i } = e;
|
|
3806
|
+
e.emit("scenario:clear"), ka(e), i.selectedNode && i.selectedNode.id === t.id || (i.selectedKind = null);
|
|
3807
|
+
let a = e.setSelection(t, null, {
|
|
3808
|
+
source: r,
|
|
3809
|
+
quiet: !0
|
|
3810
|
+
});
|
|
3811
|
+
e.touchScene(), e.map.render(), a.announce(), e.emit("node:show", {
|
|
3812
|
+
node: t,
|
|
3813
|
+
frame: n
|
|
3814
|
+
}), n && Ga(e);
|
|
3815
|
+
}
|
|
3816
|
+
function qa(e, { source: t = "api" } = {}) {
|
|
3817
|
+
e.emit("scenario:clear");
|
|
3818
|
+
let n = e.setSelection(null, null, {
|
|
3819
|
+
source: t,
|
|
3820
|
+
quiet: !0
|
|
3821
|
+
});
|
|
3822
|
+
e.touchScene(), e.map.render(), e.emit("node:close"), n.announce();
|
|
3823
|
+
}
|
|
3824
|
+
var Ja = 1.25, Ya = {
|
|
3825
|
+
ArrowLeft: [-1, 0],
|
|
3826
|
+
ArrowRight: [1, 0],
|
|
3827
|
+
ArrowUp: [0, -1],
|
|
3828
|
+
ArrowDown: [0, 1]
|
|
3829
|
+
};
|
|
3830
|
+
function Xa(e, t = {}) {
|
|
3831
|
+
let { shift: n = !1, alt: r = !1, ctrl: i = !1, meta: a = !1, scenario: o = !1, freeform: s = !1, selected: c = !1 } = t;
|
|
3832
|
+
if (i || a) return null;
|
|
3833
|
+
let l = Ya[e];
|
|
3834
|
+
if (l) {
|
|
3835
|
+
if (r) return s && c ? {
|
|
3836
|
+
type: "move",
|
|
3837
|
+
dx: l[0] * (n ? 80 : 20),
|
|
3838
|
+
dy: l[1] * (n ? 80 : 20)
|
|
3839
|
+
} : null;
|
|
3840
|
+
if (o && l[1] === 0) return null;
|
|
3841
|
+
let e = n ? 240 : 60;
|
|
3842
|
+
return {
|
|
3843
|
+
type: "pan",
|
|
3844
|
+
dx: -l[0] * e,
|
|
3845
|
+
dy: -l[1] * e
|
|
3846
|
+
};
|
|
3847
|
+
}
|
|
3848
|
+
if (r) return null;
|
|
3849
|
+
switch (e) {
|
|
3850
|
+
case "+":
|
|
3851
|
+
case "=": return {
|
|
3852
|
+
type: "zoom",
|
|
3853
|
+
factor: Ja
|
|
3854
|
+
};
|
|
3855
|
+
case "-":
|
|
3856
|
+
case "_": return {
|
|
3857
|
+
type: "zoom",
|
|
3858
|
+
factor: 1 / Ja
|
|
3859
|
+
};
|
|
3860
|
+
case "0": return { type: "fit" };
|
|
3861
|
+
case "n":
|
|
3862
|
+
case "N":
|
|
3863
|
+
case "]": return {
|
|
3864
|
+
type: "step",
|
|
3865
|
+
by: 1
|
|
3866
|
+
};
|
|
3867
|
+
case "p":
|
|
3868
|
+
case "P":
|
|
3869
|
+
case "[": return {
|
|
3870
|
+
type: "step",
|
|
3871
|
+
by: -1
|
|
3872
|
+
};
|
|
3873
|
+
case "f":
|
|
3874
|
+
case "F": return c ? { type: "frame" } : null;
|
|
3875
|
+
case "Home": return { type: "first" };
|
|
3876
|
+
case "End": return { type: "last" };
|
|
3877
|
+
case "Enter": return c ? { type: "open" } : null;
|
|
3878
|
+
case "Escape": return c ? { type: "close" } : null;
|
|
3879
|
+
default: return null;
|
|
3880
|
+
}
|
|
3881
|
+
}
|
|
3882
|
+
function Za(e) {
|
|
3883
|
+
return [...e].sort((e, t) => Math.floor(e.y / 40) - Math.floor(t.y / 40) || e.x - t.x || (e.id < t.id ? -1 : +(e.id > t.id)));
|
|
3884
|
+
}
|
|
3885
|
+
function Qa(e, t, n) {
|
|
3886
|
+
if (!e.length) return null;
|
|
3887
|
+
let r = t == null ? -1 : e.findIndex((e) => e.id === t);
|
|
3888
|
+
if (r < 0) return n >= 0 ? e[0] : e[e.length - 1];
|
|
3889
|
+
let i = e.length;
|
|
3890
|
+
return e[((r + n) % i + i) % i];
|
|
3891
|
+
}
|
|
3892
|
+
function $a(e, t, n) {
|
|
3893
|
+
let r = e.type === "external" ? "outside service" : e.type, i = Number.isFinite(e.degree) ? `, ${e.degree} ${e.degree === 1 ? "connection" : "connections"}` : "", a = Number.isFinite(t) && Number.isFinite(n) ? `, ${n + 1} of ${t}` : "";
|
|
3894
|
+
return `${e.label}, ${r}${i}${a}`;
|
|
3895
|
+
}
|
|
3896
|
+
var eo = (e) => `Zoom ${Math.round(e * 100)} percent`;
|
|
3897
|
+
// ../explorer/engine/keyboard.js
|
|
3898
|
+
function $(e, t) {
|
|
3899
|
+
let n = e.slot("announce", () => {
|
|
3900
|
+
let t = { timer: null };
|
|
3901
|
+
return e.own(() => clearTimeout(t.timer)), t;
|
|
3902
|
+
});
|
|
3903
|
+
e.emit("announce", t);
|
|
3904
|
+
let r = e.el("map-announcer");
|
|
3905
|
+
r && (r.textContent = "", clearTimeout(n.timer), n.timer = setTimeout(() => {
|
|
3906
|
+
r.textContent = t;
|
|
3907
|
+
}, 30));
|
|
3908
|
+
}
|
|
3909
|
+
var to = (e) => Za(e.state.nodes.filter((t) => e.map.isNodeVisible(t)));
|
|
3910
|
+
function no(e, t, n) {
|
|
3911
|
+
t ? (Ka(e, t, {
|
|
3912
|
+
frame: !0,
|
|
3913
|
+
source: "keyboard"
|
|
3914
|
+
}), $(e, $a(t, n.length, n.indexOf(t)))) : $(e, e.el("legend-dropdown") ? "No nodes are shown. Turn a layer on in the Layers menu." : "No nodes are shown.");
|
|
3915
|
+
}
|
|
3916
|
+
function ro(e) {
|
|
3917
|
+
let { state: t } = e;
|
|
3918
|
+
if (!t.selectedNode) return;
|
|
3919
|
+
let n = Ga(e);
|
|
3920
|
+
if (!n) return;
|
|
3921
|
+
let r = Math.max(0, Wa(e).length - 1);
|
|
3922
|
+
$(e, n.framed ? `Framed ${t.selectedNode.label} and ${r} connected` : `${t.selectedNode.label} centred: ${r} connected, too spread out to frame together`);
|
|
3923
|
+
}
|
|
3924
|
+
function io(e, t, n) {
|
|
3925
|
+
let { state: r } = e, i = r.selectedNode;
|
|
3926
|
+
i && (i.x += t, i.y += n, r.freeformPositions[i.id] = {
|
|
3927
|
+
x: i.x,
|
|
3928
|
+
y: i.y
|
|
3929
|
+
}, e.touchScene(), ba(e), e.map.render(), $(e, `Moved ${i.label}`));
|
|
3930
|
+
}
|
|
3931
|
+
function ao(e, t) {
|
|
3932
|
+
let { state: n, map: r } = e;
|
|
3933
|
+
if (t.target !== n.canvas || t.defaultPrevented) return;
|
|
3934
|
+
let i = Xa(t.key, {
|
|
3935
|
+
shift: t.shiftKey,
|
|
3936
|
+
alt: t.altKey,
|
|
3937
|
+
ctrl: t.ctrlKey,
|
|
3938
|
+
meta: t.metaKey,
|
|
3939
|
+
scenario: !!n.scenario,
|
|
3940
|
+
freeform: n.isFreeform && n.view === "orbit",
|
|
3941
|
+
selected: !!n.selectedNode
|
|
3942
|
+
});
|
|
3943
|
+
if (!i) return;
|
|
3944
|
+
t.preventDefault();
|
|
3945
|
+
let { camera: a, width: o, height: s } = n;
|
|
3946
|
+
switch (i.type) {
|
|
3947
|
+
case "pan":
|
|
3948
|
+
a.x += i.dx, a.y += i.dy, r.render();
|
|
3949
|
+
break;
|
|
3950
|
+
case "zoom":
|
|
3951
|
+
Object.assign(a, $n(a, i.factor, o / 2, s / 2, r.getMinZoom())), r.render(), $(e, eo(a.zoom));
|
|
3952
|
+
break;
|
|
3953
|
+
case "fit":
|
|
3954
|
+
r.fitGraphToViewport(r.fitPadding()), $(e, `The whole map. ${eo(a.zoom)}`);
|
|
3955
|
+
break;
|
|
3956
|
+
case "step": {
|
|
3957
|
+
if (e.ask("search:active") && e.ask("search:step", i.by)) break;
|
|
3958
|
+
let t = to(e);
|
|
3959
|
+
no(e, Qa(t, n.selectedNode && n.selectedNode.id, i.by), t);
|
|
3960
|
+
break;
|
|
3961
|
+
}
|
|
3962
|
+
case "first":
|
|
3963
|
+
case "last": {
|
|
3964
|
+
let t = to(e);
|
|
3965
|
+
no(e, i.type === "first" ? t[0] : t[t.length - 1], t);
|
|
3966
|
+
break;
|
|
3967
|
+
}
|
|
3968
|
+
case "frame":
|
|
3969
|
+
ro(e);
|
|
3970
|
+
break;
|
|
3971
|
+
case "open":
|
|
3972
|
+
e.emit("node:focus");
|
|
3973
|
+
break;
|
|
3974
|
+
case "close":
|
|
3975
|
+
qa(e, { source: "keyboard" }), $(e, e.el("spec-drawer") ? "Panel closed" : "Selection cleared");
|
|
3976
|
+
break;
|
|
3977
|
+
case "move": io(e, i.dx, i.dy);
|
|
3978
|
+
}
|
|
3979
|
+
}
|
|
3980
|
+
function oo(e) {
|
|
3981
|
+
let t = e.slot("keyboard", () => ({ off: null }));
|
|
3982
|
+
!t.off && e.state.canvas && (t.off = e.listen(e.state.canvas, "keydown", (t) => ao(e, t)));
|
|
3983
|
+
}
|
|
3984
|
+
function so(e) {
|
|
3985
|
+
let t = e.slot("keyboard", () => ({ off: null }));
|
|
3986
|
+
t.off && t.off(), t.off = null;
|
|
3987
|
+
}
|
|
3988
|
+
// ../explorer/engine/piece.js
|
|
3989
|
+
var co = /* @__PURE__ */ RegExp("\\sdata-corn=\\\"([^\\\"]+)\\\"");
|
|
3990
|
+
function lo(e) {
|
|
3991
|
+
return String(e).replace(/<[a-zA-Z][^<>]*>/g, (e) => /\spart=/.test(e) ? e : e.replace(co, (e, t) => ` data-corn=\"${t}\" part=\"${t}\"`));
|
|
3992
|
+
}
|
|
3993
|
+
function uo(e) {
|
|
3994
|
+
for (let t of e.querySelectorAll("[data-corn]:not([part])")) t.setAttribute("part", t.getAttribute("data-corn"));
|
|
3995
|
+
}
|
|
3996
|
+
function fo(e) {
|
|
3997
|
+
let t = [], n = !1, r = {
|
|
3998
|
+
listen(n, r, i, a) {
|
|
3999
|
+
let o = e.listen(n, r, i, a);
|
|
4000
|
+
return t.push(o), o;
|
|
4001
|
+
},
|
|
4002
|
+
on(n, r) {
|
|
4003
|
+
let i = e.on(n, r);
|
|
4004
|
+
return t.push(i), i;
|
|
4005
|
+
},
|
|
4006
|
+
own(e) {
|
|
4007
|
+
return t.push(e), e;
|
|
4008
|
+
},
|
|
4009
|
+
timeout(e, n) {
|
|
4010
|
+
let r = setTimeout(() => {
|
|
4011
|
+
e();
|
|
4012
|
+
}, n);
|
|
4013
|
+
return t.push(() => clearTimeout(r)), r;
|
|
4014
|
+
},
|
|
4015
|
+
keepParts(...n) {
|
|
4016
|
+
let r = e.win && e.win.MutationObserver;
|
|
4017
|
+
if (!r) return;
|
|
4018
|
+
let i = new r((e) => {
|
|
4019
|
+
for (let t of e) for (let e of t.addedNodes) e.nodeType === 1 && (e.hasAttribute("data-corn") && !e.hasAttribute("part") && e.setAttribute("part", e.getAttribute("data-corn")), uo(e));
|
|
4020
|
+
});
|
|
4021
|
+
for (let e of n) i.observe(e, {
|
|
4022
|
+
childList: !0,
|
|
4023
|
+
subtree: !0
|
|
4024
|
+
});
|
|
4025
|
+
t.push(() => i.disconnect());
|
|
4026
|
+
},
|
|
4027
|
+
destroy() {
|
|
4028
|
+
if (!n) for (n = !0, e.release(r.destroy); t.length;) try {
|
|
4029
|
+
t.pop()();
|
|
4030
|
+
} catch (e) {
|
|
4031
|
+
console.error("A piece clean-up failed", e);
|
|
4032
|
+
}
|
|
4033
|
+
}
|
|
4034
|
+
};
|
|
4035
|
+
return e.own(r.destroy), r;
|
|
4036
|
+
}
|
|
4037
|
+
function po(e, t, n, r, i) {
|
|
4038
|
+
let a = e.doc.createElement("template");
|
|
4039
|
+
a.innerHTML = lo(n), h(e, a.content);
|
|
4040
|
+
let o = [...a.content.children], s = r && i ? r[i] : null;
|
|
4041
|
+
if (s && s.parentNode) {
|
|
4042
|
+
let t = mo(s);
|
|
4043
|
+
s.parentNode.insertBefore(a.content, s), t && ho(e, t, o);
|
|
4044
|
+
} else t.append(a.content);
|
|
4045
|
+
return o;
|
|
4046
|
+
}
|
|
4047
|
+
function mo(e) {
|
|
4048
|
+
let t = [], n = `corn-placeholder:${String(e.data || "").replace(/^corn-piece:/, "")}`;
|
|
4049
|
+
for (let r = e.previousSibling; r; r = r.previousSibling) if (t.push(r), r.nodeType === 8 && r.data === n) return t;
|
|
4050
|
+
return null;
|
|
4051
|
+
}
|
|
4052
|
+
function ho(e, t, n) {
|
|
4053
|
+
let r = (e) => e.flatMap((e) => e.nodeType === 1 ? [...e.matches("button, input") ? [e] : [], ...e.querySelectorAll("button, input")] : []), i = r(t.slice().reverse()), a = r(n), o = e.active();
|
|
4054
|
+
i.forEach((e, t) => {
|
|
4055
|
+
let n = a[t];
|
|
4056
|
+
n && n.tagName === e.tagName && (e.tagName === "INPUT" && e.value && (n.value = e.value), e === o && n.focus());
|
|
4057
|
+
}), t.forEach((e) => e.remove());
|
|
4058
|
+
}
|
|
4059
|
+
// ../explorer/pieces/adopt-tokens.js
|
|
4060
|
+
var go = Symbol.for("cornfield.default-tokens"), _o = "data-corn-default-tokens";
|
|
4061
|
+
function vo(e, t) {
|
|
4062
|
+
if (!e || !t) return !1;
|
|
4063
|
+
let n = e.nodeType === 9 ? e : e.ownerDocument, r = e.adoptedStyleSheets;
|
|
4064
|
+
if (Array.isArray(r) && n && n.defaultView && typeof n.defaultView.CSSStyleSheet == "function" && "replaceSync" in n.defaultView.CSSStyleSheet.prototype) {
|
|
4065
|
+
if (r.some((e) => e && e[go])) return !1;
|
|
4066
|
+
let i = new n.defaultView.CSSStyleSheet();
|
|
4067
|
+
return i.replaceSync(t), i[go] = !0, e.adoptedStyleSheets = [...r, i], !0;
|
|
4068
|
+
}
|
|
4069
|
+
let i = e.nodeType === 9 ? e.head : e;
|
|
4070
|
+
if (!i || i.querySelector(`style[${_o}]`)) return !1;
|
|
4071
|
+
let a = n.createElement("style");
|
|
4072
|
+
return a.setAttribute(_o, ""), a.textContent = t, i.prepend(a), !0;
|
|
4073
|
+
}
|
|
4074
|
+
// ../explorer/pieces/scope-link.js
|
|
4075
|
+
var yo = "corn-scope-request", bo = "corn-scope-changed", xo = (e) => e.slot("scope", () => ({
|
|
4076
|
+
theme: "auto",
|
|
4077
|
+
serverTheme: null,
|
|
4078
|
+
host: null,
|
|
4079
|
+
source: null,
|
|
4080
|
+
mountStatus: null
|
|
4081
|
+
})), So = (e) => {
|
|
4082
|
+
let t = xo(e);
|
|
4083
|
+
return t.host ? t : null;
|
|
4084
|
+
};
|
|
4085
|
+
function Co(e, t) {
|
|
4086
|
+
let n = null;
|
|
4087
|
+
e.dispatchEvent(new CustomEvent(yo, {
|
|
4088
|
+
bubbles: !0,
|
|
4089
|
+
composed: !0,
|
|
4090
|
+
detail: {
|
|
4091
|
+
el: e,
|
|
4092
|
+
claim: (e) => {
|
|
4093
|
+
n = e;
|
|
4094
|
+
}
|
|
4095
|
+
}
|
|
4096
|
+
}));
|
|
4097
|
+
let r = () => t();
|
|
4098
|
+
e.addEventListener(bo, r);
|
|
4099
|
+
let i = !1;
|
|
4100
|
+
return {
|
|
4101
|
+
inst: n ? n.inst : null,
|
|
4102
|
+
scope: n ? n.scope : null,
|
|
4103
|
+
leave() {
|
|
4104
|
+
i || (i = !0, e.removeEventListener(bo, r), n && n.release());
|
|
4105
|
+
}
|
|
4106
|
+
};
|
|
4107
|
+
}
|
|
4108
|
+
// \0corn-default-tokens
|
|
4109
|
+
var wo = "/* cornfield's default design tokens, generated from explorer/tokens.css by components/scripts/tokens.mjs: do not edit.\n Every selector is :where(...), at zero specificity: any ordinary rule of yours (on :root, or on one element) overrides it. */\n\n:where(:root) {\n --corn-ground: #090d16;\n --corn-ground-image: radial-gradient(circle at 14% 18%, rgba(66, 153, 225, 0.2) 0%, transparent 45%),\n radial-gradient(circle at 86% 82%, rgba(229, 62, 62, 0.16) 0%, transparent 45%),\n radial-gradient(circle at 50% 50%, rgba(66, 153, 225, 0.10) 0%, transparent 60%);\n --corn-surface-1: rgba(26, 34, 52, 0.72);\n --corn-surface-2: rgba(30, 41, 59, 0.8);\n --corn-surface-3: rgba(51, 65, 85, 0.8);\n --corn-line: rgba(255, 255, 255, 0.12);\n --corn-line-soft: rgba(255, 255, 255, 0.07);\n --corn-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45);\n --corn-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);\n --corn-shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);\n --corn-shadow-color: rgba(0, 0, 0, 0.5);\n --corn-glow: 8px;\n --corn-scrim: rgba(0, 0, 0, 0.6);\n --corn-shadow-sheet: 0 -8px 24px color-mix(in srgb, var(--corn-shadow-color) 70%, transparent);\n --corn-blur: 16px;\n --corn-text: #f8fafc;\n --corn-text-2: #cbd5e1;\n --corn-text-3: #9aa9bc;\n --corn-text-on-accent: #fff;\n --corn-mockup-ground: #fff;\n --corn-accent: #4f46e5;\n --corn-accent-hover: #6265f1;\n --corn-accent-text: #98a1fa;\n --corn-accent-soft: color-mix(in srgb, var(--corn-accent-hover) 20%, transparent);\n --corn-focus: #818cf8;\n --corn-brand-gradient: linear-gradient(135deg, #4299e1 0%, #818cf8 50%, #e53e3e 100%);\n --corn-ok: #34d399;\n --corn-warn: #fcd34d;\n --corn-bad: #fca5a5;\n --corn-info: #7dd3fc;\n --corn-ok-soft: color-mix(in srgb, var(--corn-ok) 15%, transparent);\n --corn-run-requested: var(--corn-text-3);\n --corn-run-claimed: var(--corn-info);\n --corn-run-working: var(--corn-info);\n --corn-run-waiting: var(--corn-warn);\n --corn-run-waiting-ink: var(--corn-ground);\n --corn-run-done: var(--corn-ok);\n --corn-run-failed: var(--corn-bad);\n --corn-run-stopped: var(--corn-text-2);\n --corn-added: #2dd4bf;\n --corn-changed: #fbbf24;\n --corn-removed: #fa9292;\n --corn-edit: #b49cfb;\n --corn-added-text: color-mix(in srgb, var(--corn-added) 60%, var(--corn-text));\n --corn-edit-text: color-mix(in srgb, var(--corn-edit) 60%, var(--corn-text));\n --corn-hue-orange: #fb923c;\n --corn-hue-fuchsia: #e879f9;\n --corn-hue-pink: #f472b6;\n --corn-hue-lime: #a3e635;\n --corn-hue-orange-text: var(--corn-hue-orange);\n --corn-hue-orange-soft: color-mix(in srgb, var(--corn-hue-orange) 12%, transparent);\n --corn-font: system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n --corn-font-display: var(--corn-font);\n --corn-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, \"Liberation Mono\", monospace;\n --corn-font-num: var(--corn-font);\n --corn-text-2xs: 10px;\n --corn-text-xs: 11px;\n --corn-text-sm: 12px;\n --corn-text-md: 13px;\n --corn-text-base: 14px;\n --corn-text-lg: 15px;\n --corn-text-xl: 20px;\n --corn-radius-xs: 3px;\n --corn-radius-sm: 6px;\n --corn-radius: 10px;\n --corn-radius-lg: 14px;\n --corn-radius-pill: 999px;\n --corn-border: 1px;\n --corn-border-strong: 2px;\n --corn-focus-width: 2px;\n --corn-focus-offset: 2px;\n --corn-space: 4px;\n --corn-space-1: var(--corn-space);\n --corn-space-2: 6px;\n --corn-space-3: 8px;\n --corn-space-4: 12px;\n --corn-space-5: 16px;\n --corn-space-6: 24px;\n --corn-control-height: 32px;\n --corn-panel-pad: calc(var(--corn-space-5) + var(--corn-space-1));\n --corn-panel-head-height: calc(var(--corn-control-height) + var(--corn-space-3));\n --corn-house-line: color-mix(in srgb, var(--corn-hue-lime) 18%, transparent);\n --corn-house-room: color-mix(in srgb, var(--corn-hue-lime) 45%, transparent);\n --corn-glyph-mix: 100%;\n color-scheme: dark;\n --corn-map-stroke: auto;\n --corn-map-stroke-width: 1.5px;\n --corn-map-label: auto;\n --corn-map-label-halo: auto;\n --corn-map-collision: var(--corn-warn);\n --corn-map-font: auto;\n --corn-map-edge-width: auto;\n --corn-map-glow: auto;\n --corn-map-label-min: auto;\n --corn-map-glyph: auto;\n --corn-map-grey: auto;\n --corn-map-grey-alpha: auto;\n --corn-map-added: auto;\n --corn-map-changed: auto;\n --corn-map-removed: auto;\n --corn-map-edit: auto;\n --corn-map-selected: auto;\n --corn-map-match: auto;\n --corn-map-lit: auto;\n --corn-map-edge-ownership: auto;\n --corn-map-edge-usage: auto;\n --corn-map-edge-flow: auto;\n --corn-map-edge-reads: auto;\n --corn-map-edge-writes: auto;\n --corn-map-edge-calls: auto;\n --corn-map-edge-triggers: auto;\n --corn-map-edge-delivers: auto;\n --corn-map-edge-runs-on: auto;\n --corn-map-edge-uses: auto;\n --corn-map-edge-extends: auto;\n --corn-map-node-root: auto;\n --corn-map-node-app: auto;\n --corn-map-node-page: auto;\n --corn-map-node-pkg: auto;\n --corn-map-node-core: auto;\n --corn-map-node-token: auto;\n --corn-map-node-atom: auto;\n --corn-map-node-molecule: auto;\n --corn-map-node-tool: auto;\n --corn-map-node-store: auto;\n --corn-map-node-table: auto;\n --corn-map-node-rom: auto;\n --corn-map-node-service: auto;\n --corn-map-node-external: auto;\n --corn-map-node-stack: auto;\n --corn-map-node-machine: auto;\n --corn-map-node-container: auto;\n --corn-map-node-persona: auto;\n --corn-map-node-device: auto;\n --corn-map-node-floor: auto;\n --corn-map-node-room: auto;\n --corn-map-group-app: auto;\n --corn-map-group-pkg: auto;\n --corn-map-group-page: auto;\n --corn-map-group-atom: auto;\n --corn-map-group-molecule: auto;\n --corn-map-group-token: auto;\n --corn-map-group-tool: auto;\n --corn-map-group-table: auto;\n --corn-map-group-rom: auto;\n --corn-map-group-service: auto;\n --corn-map-group-cloud: auto;\n --corn-map-group-web: auto;\n --corn-map-group-stack: auto;\n --corn-map-group-machine: auto;\n --corn-map-group-container: auto;\n --corn-map-group-device: auto;\n --corn-map-group-house: auto;\n --corn-map-group-persona: auto;\n}\n\n@media (prefers-color-scheme: light) {\n :where(:root:not([data-theme=\"dark\"])) {\n --corn-ground: #f4f6fa;\n --corn-ground-image: radial-gradient(circle at 14% 18%, rgba(66, 153, 225, 0.06) 0%, transparent 45%),\n radial-gradient(circle at 86% 82%, rgba(229, 62, 62, 0.04) 0%, transparent 45%);\n --corn-surface-1: rgba(255, 255, 255, 0.8);\n --corn-surface-2: rgba(241, 245, 249, 0.92);\n --corn-surface-3: rgba(226, 232, 240, 0.95);\n --corn-line: rgba(15, 23, 42, 0.12);\n --corn-line-soft: rgba(15, 23, 42, 0.07);\n --corn-shadow: 0 8px 28px 0 rgba(15, 23, 42, 0.12);\n --corn-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.25);\n --corn-shadow-lg: 0 10px 30px -12px rgba(15, 23, 42, 0.18);\n --corn-shadow-color: rgba(15, 23, 42, 0.25);\n --corn-glow: 0px;\n --corn-scrim: rgba(15, 23, 42, 0.35);\n --corn-text: #0f172a;\n --corn-text-2: #334155;\n --corn-text-3: #475569;\n --corn-accent-text: #4f46e5;\n --corn-focus: #4f46e5;\n --corn-brand-gradient: linear-gradient(135deg, #2563eb 0%, #4f46e5 50%, #dc2626 100%);\n --corn-ok: #046f51;\n --corn-warn: #854d0e;\n --corn-bad: #b91c1c;\n --corn-info: #03679e;\n --corn-added: #197c6f;\n --corn-changed: #8f6703;\n --corn-removed: #e20b0b;\n --corn-edit: #6839f6;\n --corn-hue-orange: #c2410c;\n --corn-hue-fuchsia: #a21caf;\n --corn-hue-pink: #be185d;\n --corn-hue-lime: #4c7b0f;\n --corn-hue-orange-text: #9a3412;\n --corn-house-line: color-mix(in srgb, var(--corn-hue-lime) 30%, transparent);\n --corn-house-room: color-mix(in srgb, var(--corn-hue-lime) 55%, transparent);\n --corn-glyph-mix: 45%;\n color-scheme: light;\n }\n}\n\n:where(:root[data-theme=\"light\"]) {\n --corn-ground: #f4f6fa;\n --corn-ground-image: radial-gradient(circle at 14% 18%, rgba(66, 153, 225, 0.06) 0%, transparent 45%),\n radial-gradient(circle at 86% 82%, rgba(229, 62, 62, 0.04) 0%, transparent 45%);\n --corn-surface-1: rgba(255, 255, 255, 0.8);\n --corn-surface-2: rgba(241, 245, 249, 0.92);\n --corn-surface-3: rgba(226, 232, 240, 0.95);\n --corn-line: rgba(15, 23, 42, 0.12);\n --corn-line-soft: rgba(15, 23, 42, 0.07);\n --corn-shadow: 0 8px 28px 0 rgba(15, 23, 42, 0.12);\n --corn-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.25);\n --corn-shadow-lg: 0 10px 30px -12px rgba(15, 23, 42, 0.18);\n --corn-shadow-color: rgba(15, 23, 42, 0.25);\n --corn-glow: 0px;\n --corn-scrim: rgba(15, 23, 42, 0.35);\n --corn-text: #0f172a;\n --corn-text-2: #334155;\n --corn-text-3: #475569;\n --corn-accent-text: #4f46e5;\n --corn-focus: #4f46e5;\n --corn-brand-gradient: linear-gradient(135deg, #2563eb 0%, #4f46e5 50%, #dc2626 100%);\n --corn-ok: #046f51;\n --corn-warn: #854d0e;\n --corn-bad: #b91c1c;\n --corn-info: #03679e;\n --corn-added: #197c6f;\n --corn-changed: #8f6703;\n --corn-removed: #e20b0b;\n --corn-edit: #6839f6;\n --corn-hue-orange: #c2410c;\n --corn-hue-fuchsia: #a21caf;\n --corn-hue-pink: #be185d;\n --corn-hue-lime: #4c7b0f;\n --corn-hue-orange-text: #9a3412;\n --corn-house-line: color-mix(in srgb, var(--corn-hue-lime) 30%, transparent);\n --corn-house-room: color-mix(in srgb, var(--corn-hue-lime) 55%, transparent);\n --corn-glyph-mix: 45%;\n color-scheme: light;\n}\n\n@media (max-width: 767px) {\n :where(:root) {\n --corn-control-height: 44px;\n }\n}\n\n@media (max-width: 639px) {\n :where(:root) {\n --corn-panel-pad: var(--corn-space-5);\n }\n}\n\n:where(:root) {\n --hx-bg: var(--corn-ground);\n --hx-text: var(--corn-text);\n --hx-ink: var(--corn-text);\n --hx-text-1: var(--corn-text);\n --hx-text-2: var(--corn-text-2);\n --hx-slate-300: var(--corn-text-2);\n --hx-slate-400: var(--corn-text-3);\n --hx-slate-500: var(--corn-text-3);\n --hx-slate-600: var(--corn-text-3);\n --hx-slate-700: var(--corn-surface-3);\n --hx-slate-800: var(--corn-surface-2);\n --hx-slate-900: var(--corn-ground);\n --hx-slate-950: var(--corn-ground);\n --hx-indigo: var(--corn-accent-text);\n --hx-indigo-strong: var(--corn-accent);\n --hx-emerald: var(--corn-ok);\n --hx-amber: var(--corn-warn);\n --hx-sky: var(--corn-info);\n --hx-pink: var(--corn-hue-pink);\n --hx-fuchsia: var(--corn-hue-fuchsia);\n --hx-fuchsia-strong: var(--corn-hue-fuchsia);\n --hx-red: var(--corn-bad);\n --hx-code: var(--corn-warn);\n --hx-orange-text: var(--corn-hue-orange);\n --hx-orange-strong: var(--corn-hue-orange);\n --hx-teal-text: var(--corn-added-text);\n --hx-teal-strong: var(--corn-added-text);\n --hx-violet-text: var(--corn-edit-text);\n --hx-green-text: var(--corn-ok);\n --hx-lime-text: var(--corn-hue-lime);\n --hx-mark-added: var(--corn-added);\n --hx-mark-changed: var(--corn-changed);\n --hx-mark-removed: var(--corn-removed);\n --hx-mark-edit: var(--corn-edit);\n --hx-control: var(--corn-surface-2);\n --hx-control-hover: var(--corn-surface-3);\n --hx-control-off: color-mix(in srgb, var(--corn-ground) 40%, transparent);\n --hx-well: color-mix(in srgb, var(--corn-ground) 80%, transparent);\n --hx-well-soft: color-mix(in srgb, var(--corn-ground) 55%, transparent);\n --hx-line: var(--corn-line);\n --hx-line-soft: var(--corn-line-soft);\n --hx-scroll: color-mix(in srgb, var(--corn-text) 18%, transparent);\n --hx-scroll-hover: color-mix(in srgb, var(--corn-text) 28%, transparent);\n --hx-swatch-solid: color-mix(in srgb, var(--corn-text) 55%, transparent);\n --hx-backdrop: var(--corn-scrim);\n --hx-glyph-mix: var(--corn-glyph-mix);\n --surface-glass: var(--corn-surface-1);\n --surface-glass-header: color-mix(in srgb, var(--corn-ground) 88%, transparent);\n --border-glass: var(--corn-line);\n --border-subtle: var(--corn-line-soft);\n --glass-blur: blur(var(--corn-blur));\n --glass-shadow: var(--corn-shadow);\n --gradient-primary: var(--corn-brand-gradient);\n --bg-gradient: var(--corn-ground-image), var(--corn-ground);\n --pop-font-body: var(--corn-font);\n --pop-font-mono: var(--corn-mono);\n}\n\n/* theme=\"light\" on an element: this mode's tokens, on the element itself */\n:where(corn-map[theme=\"light\"]),\n:where(corn-scope[theme=\"light\"]) {\n --corn-ground: #f4f6fa;\n --corn-ground-image: radial-gradient(circle at 14% 18%, rgba(66, 153, 225, 0.06) 0%, transparent 45%),\n radial-gradient(circle at 86% 82%, rgba(229, 62, 62, 0.04) 0%, transparent 45%);\n --corn-surface-1: rgba(255, 255, 255, 0.8);\n --corn-surface-2: rgba(241, 245, 249, 0.92);\n --corn-surface-3: rgba(226, 232, 240, 0.95);\n --corn-line: rgba(15, 23, 42, 0.12);\n --corn-line-soft: rgba(15, 23, 42, 0.07);\n --corn-shadow: 0 8px 28px 0 rgba(15, 23, 42, 0.12);\n --corn-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.25);\n --corn-shadow-lg: 0 10px 30px -12px rgba(15, 23, 42, 0.18);\n --corn-shadow-color: rgba(15, 23, 42, 0.25);\n --corn-glow: 0px;\n --corn-scrim: rgba(15, 23, 42, 0.35);\n --corn-text: #0f172a;\n --corn-text-2: #334155;\n --corn-text-3: #475569;\n --corn-accent-text: #4f46e5;\n --corn-focus: #4f46e5;\n --corn-brand-gradient: linear-gradient(135deg, #2563eb 0%, #4f46e5 50%, #dc2626 100%);\n --corn-ok: #046f51;\n --corn-warn: #854d0e;\n --corn-bad: #b91c1c;\n --corn-info: #03679e;\n --corn-added: #197c6f;\n --corn-changed: #8f6703;\n --corn-removed: #e20b0b;\n --corn-edit: #6839f6;\n --corn-hue-orange: #c2410c;\n --corn-hue-fuchsia: #a21caf;\n --corn-hue-pink: #be185d;\n --corn-hue-lime: #4c7b0f;\n --corn-hue-orange-text: #9a3412;\n --corn-house-line: color-mix(in srgb, var(--corn-hue-lime) 30%, transparent);\n --corn-house-room: color-mix(in srgb, var(--corn-hue-lime) 55%, transparent);\n --corn-glyph-mix: 45%;\n color-scheme: light;\n --corn-shadow-sheet: 0 -8px 24px color-mix(in srgb, var(--corn-shadow-color) 70%, transparent);\n --corn-accent-soft: color-mix(in srgb, var(--corn-accent-hover) 20%, transparent);\n --corn-ok-soft: color-mix(in srgb, var(--corn-ok) 15%, transparent);\n --corn-run-requested: var(--corn-text-3);\n --corn-run-claimed: var(--corn-info);\n --corn-run-working: var(--corn-info);\n --corn-run-waiting: var(--corn-warn);\n --corn-run-waiting-ink: var(--corn-ground);\n --corn-run-done: var(--corn-ok);\n --corn-run-failed: var(--corn-bad);\n --corn-run-stopped: var(--corn-text-2);\n --corn-added-text: color-mix(in srgb, var(--corn-added) 60%, var(--corn-text));\n --corn-edit-text: color-mix(in srgb, var(--corn-edit) 60%, var(--corn-text));\n --corn-hue-orange-soft: color-mix(in srgb, var(--corn-hue-orange) 12%, transparent);\n --corn-font-display: var(--corn-font);\n --corn-font-num: var(--corn-font);\n --corn-space-1: var(--corn-space);\n --corn-panel-pad: calc(var(--corn-space-5) + var(--corn-space-1));\n --corn-panel-head-height: calc(var(--corn-control-height) + var(--corn-space-3));\n --corn-map-collision: var(--corn-warn);\n --hx-bg: var(--corn-ground);\n --hx-text: var(--corn-text);\n --hx-ink: var(--corn-text);\n --hx-text-1: var(--corn-text);\n --hx-text-2: var(--corn-text-2);\n --hx-slate-300: var(--corn-text-2);\n --hx-slate-400: var(--corn-text-3);\n --hx-slate-500: var(--corn-text-3);\n --hx-slate-600: var(--corn-text-3);\n --hx-slate-700: var(--corn-surface-3);\n --hx-slate-800: var(--corn-surface-2);\n --hx-slate-900: var(--corn-ground);\n --hx-slate-950: var(--corn-ground);\n --hx-indigo: var(--corn-accent-text);\n --hx-indigo-strong: var(--corn-accent);\n --hx-emerald: var(--corn-ok);\n --hx-amber: var(--corn-warn);\n --hx-sky: var(--corn-info);\n --hx-pink: var(--corn-hue-pink);\n --hx-fuchsia: var(--corn-hue-fuchsia);\n --hx-fuchsia-strong: var(--corn-hue-fuchsia);\n --hx-red: var(--corn-bad);\n --hx-code: var(--corn-warn);\n --hx-orange-text: var(--corn-hue-orange);\n --hx-orange-strong: var(--corn-hue-orange);\n --hx-teal-text: var(--corn-added-text);\n --hx-teal-strong: var(--corn-added-text);\n --hx-violet-text: var(--corn-edit-text);\n --hx-green-text: var(--corn-ok);\n --hx-lime-text: var(--corn-hue-lime);\n --hx-mark-added: var(--corn-added);\n --hx-mark-changed: var(--corn-changed);\n --hx-mark-removed: var(--corn-removed);\n --hx-mark-edit: var(--corn-edit);\n --hx-control: var(--corn-surface-2);\n --hx-control-hover: var(--corn-surface-3);\n --hx-control-off: color-mix(in srgb, var(--corn-ground) 40%, transparent);\n --hx-well: color-mix(in srgb, var(--corn-ground) 80%, transparent);\n --hx-well-soft: color-mix(in srgb, var(--corn-ground) 55%, transparent);\n --hx-line: var(--corn-line);\n --hx-line-soft: var(--corn-line-soft);\n --hx-scroll: color-mix(in srgb, var(--corn-text) 18%, transparent);\n --hx-scroll-hover: color-mix(in srgb, var(--corn-text) 28%, transparent);\n --hx-swatch-solid: color-mix(in srgb, var(--corn-text) 55%, transparent);\n --hx-backdrop: var(--corn-scrim);\n --hx-glyph-mix: var(--corn-glyph-mix);\n --surface-glass: var(--corn-surface-1);\n --surface-glass-header: color-mix(in srgb, var(--corn-ground) 88%, transparent);\n --border-glass: var(--corn-line);\n --border-subtle: var(--corn-line-soft);\n --glass-blur: blur(var(--corn-blur));\n --glass-shadow: var(--corn-shadow);\n --gradient-primary: var(--corn-brand-gradient);\n --bg-gradient: var(--corn-ground-image), var(--corn-ground);\n --pop-font-body: var(--corn-font);\n --pop-font-mono: var(--corn-mono);\n}\n\n/* theme=\"dark\" on an element: this mode's tokens, on the element itself */\n:where(corn-map[theme=\"dark\"]),\n:where(corn-scope[theme=\"dark\"]) {\n --corn-ground: #090d16;\n --corn-ground-image: radial-gradient(circle at 14% 18%, rgba(66, 153, 225, 0.2) 0%, transparent 45%),\n radial-gradient(circle at 86% 82%, rgba(229, 62, 62, 0.16) 0%, transparent 45%),\n radial-gradient(circle at 50% 50%, rgba(66, 153, 225, 0.10) 0%, transparent 60%);\n --corn-surface-1: rgba(26, 34, 52, 0.72);\n --corn-surface-2: rgba(30, 41, 59, 0.8);\n --corn-surface-3: rgba(51, 65, 85, 0.8);\n --corn-line: rgba(255, 255, 255, 0.12);\n --corn-line-soft: rgba(255, 255, 255, 0.07);\n --corn-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45);\n --corn-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);\n --corn-shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);\n --corn-shadow-color: rgba(0, 0, 0, 0.5);\n --corn-glow: 8px;\n --corn-scrim: rgba(0, 0, 0, 0.6);\n --corn-text: #f8fafc;\n --corn-text-2: #cbd5e1;\n --corn-text-3: #9aa9bc;\n --corn-accent-text: #98a1fa;\n --corn-focus: #818cf8;\n --corn-brand-gradient: linear-gradient(135deg, #4299e1 0%, #818cf8 50%, #e53e3e 100%);\n --corn-ok: #34d399;\n --corn-warn: #fcd34d;\n --corn-bad: #fca5a5;\n --corn-info: #7dd3fc;\n --corn-added: #2dd4bf;\n --corn-changed: #fbbf24;\n --corn-removed: #fa9292;\n --corn-edit: #b49cfb;\n --corn-hue-orange: #fb923c;\n --corn-hue-fuchsia: #e879f9;\n --corn-hue-pink: #f472b6;\n --corn-hue-lime: #a3e635;\n --corn-hue-orange-text: var(--corn-hue-orange);\n --corn-house-line: color-mix(in srgb, var(--corn-hue-lime) 18%, transparent);\n --corn-house-room: color-mix(in srgb, var(--corn-hue-lime) 45%, transparent);\n --corn-glyph-mix: 100%;\n color-scheme: dark;\n --corn-shadow-sheet: 0 -8px 24px color-mix(in srgb, var(--corn-shadow-color) 70%, transparent);\n --corn-accent-soft: color-mix(in srgb, var(--corn-accent-hover) 20%, transparent);\n --corn-ok-soft: color-mix(in srgb, var(--corn-ok) 15%, transparent);\n --corn-run-requested: var(--corn-text-3);\n --corn-run-claimed: var(--corn-info);\n --corn-run-working: var(--corn-info);\n --corn-run-waiting: var(--corn-warn);\n --corn-run-waiting-ink: var(--corn-ground);\n --corn-run-done: var(--corn-ok);\n --corn-run-failed: var(--corn-bad);\n --corn-run-stopped: var(--corn-text-2);\n --corn-added-text: color-mix(in srgb, var(--corn-added) 60%, var(--corn-text));\n --corn-edit-text: color-mix(in srgb, var(--corn-edit) 60%, var(--corn-text));\n --corn-hue-orange-soft: color-mix(in srgb, var(--corn-hue-orange) 12%, transparent);\n --corn-font-display: var(--corn-font);\n --corn-font-num: var(--corn-font);\n --corn-space-1: var(--corn-space);\n --corn-panel-pad: calc(var(--corn-space-5) + var(--corn-space-1));\n --corn-panel-head-height: calc(var(--corn-control-height) + var(--corn-space-3));\n --corn-map-collision: var(--corn-warn);\n --hx-bg: var(--corn-ground);\n --hx-text: var(--corn-text);\n --hx-ink: var(--corn-text);\n --hx-text-1: var(--corn-text);\n --hx-text-2: var(--corn-text-2);\n --hx-slate-300: var(--corn-text-2);\n --hx-slate-400: var(--corn-text-3);\n --hx-slate-500: var(--corn-text-3);\n --hx-slate-600: var(--corn-text-3);\n --hx-slate-700: var(--corn-surface-3);\n --hx-slate-800: var(--corn-surface-2);\n --hx-slate-900: var(--corn-ground);\n --hx-slate-950: var(--corn-ground);\n --hx-indigo: var(--corn-accent-text);\n --hx-indigo-strong: var(--corn-accent);\n --hx-emerald: var(--corn-ok);\n --hx-amber: var(--corn-warn);\n --hx-sky: var(--corn-info);\n --hx-pink: var(--corn-hue-pink);\n --hx-fuchsia: var(--corn-hue-fuchsia);\n --hx-fuchsia-strong: var(--corn-hue-fuchsia);\n --hx-red: var(--corn-bad);\n --hx-code: var(--corn-warn);\n --hx-orange-text: var(--corn-hue-orange);\n --hx-orange-strong: var(--corn-hue-orange);\n --hx-teal-text: var(--corn-added-text);\n --hx-teal-strong: var(--corn-added-text);\n --hx-violet-text: var(--corn-edit-text);\n --hx-green-text: var(--corn-ok);\n --hx-lime-text: var(--corn-hue-lime);\n --hx-mark-added: var(--corn-added);\n --hx-mark-changed: var(--corn-changed);\n --hx-mark-removed: var(--corn-removed);\n --hx-mark-edit: var(--corn-edit);\n --hx-control: var(--corn-surface-2);\n --hx-control-hover: var(--corn-surface-3);\n --hx-control-off: color-mix(in srgb, var(--corn-ground) 40%, transparent);\n --hx-well: color-mix(in srgb, var(--corn-ground) 80%, transparent);\n --hx-well-soft: color-mix(in srgb, var(--corn-ground) 55%, transparent);\n --hx-line: var(--corn-line);\n --hx-line-soft: var(--corn-line-soft);\n --hx-scroll: color-mix(in srgb, var(--corn-text) 18%, transparent);\n --hx-scroll-hover: color-mix(in srgb, var(--corn-text) 28%, transparent);\n --hx-swatch-solid: color-mix(in srgb, var(--corn-text) 55%, transparent);\n --hx-backdrop: var(--corn-scrim);\n --hx-glyph-mix: var(--corn-glyph-mix);\n --surface-glass: var(--corn-surface-1);\n --surface-glass-header: color-mix(in srgb, var(--corn-ground) 88%, transparent);\n --border-glass: var(--corn-line);\n --border-subtle: var(--corn-line-soft);\n --glass-blur: blur(var(--corn-blur));\n --glass-shadow: var(--corn-shadow);\n --gradient-primary: var(--corn-brand-gradient);\n --bg-gradient: var(--corn-ground-image), var(--corn-ground);\n --pop-font-body: var(--corn-font);\n --pop-font-mono: var(--corn-mono);\n}\n";
|
|
4110
|
+
export { bn as $, mr as A, Or as B, na as C, hr as D, yr as E, si as F, er as G, Xn as H, ci as I, gn as J, $n as K, Br as L, fr as M, Mr as N, Er as O, q as P, vn as Q, Ir as R, Hi as S, ea as T, K as U, Vr as V, tr as W, An as X, hn as Y, wn as Z, va as _, Co as a, ze as at, Ci as b, po as c, O as ct, oo as d, f as dt, Cn as et, so as f, p as ft, ra as g, Ua as h, xo as i, L as it, pr as j, xr as k, fo as l, ee as lt, Ka as m, n as mt, bo as n, Tn as nt, So as o, ut as ot, qa as p, o as pt, fn as q, yo as r, tn as rt, vo as s, E as st, wo as t, yn as tt, lo as u, w as ut, Sa as v, Gi as w, Ei as x, ba as y, Y as z };
|