@zerops/web-components 0.0.1 → 0.2.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.
@@ -0,0 +1,1744 @@
1
+ var Ce = (t) => {
2
+ throw TypeError(t);
3
+ };
4
+ var ee = (t, e, n) => e.has(t) || Ce("Cannot " + n);
5
+ var d = (t, e, n) => (ee(t, e, "read from private field"), n ? n.call(t) : e.get(t)), $ = (t, e, n) => e.has(t) ? Ce("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), f = (t, e, n, o) => (ee(t, e, "write to private field"), o ? o.call(t, n) : e.set(t, n), n), C = (t, e, n) => (ee(t, e, "access private method"), n);
6
+ var ye = (t, e, n, o) => ({
7
+ set _(i) {
8
+ f(t, e, i, n);
9
+ },
10
+ get _() {
11
+ return d(t, e, o);
12
+ }
13
+ });
14
+ import { aa as k, at as j, r as Xn, bl as Be, au as Fe, av as je, ax as W, aA as V, ba as qe, bb as kn, aw as m, aC as N, ay as h, aB as P, az as c, aD as pn, bh as R, bN as Q, bi as L, aF as Pe, a3 as u, ao as T, B as xn, l as Ln, b0 as Oe, bA as Yn, n as Te, F as $e, b7 as Ge, b9 as We, bL as qn, bm as re, ak as en, bt as Ve, bs as Ze, bZ as Se, b_ as He, bq as Ue, j as Je, bT as Ye, J as Qe, bW as Xe, bU as Ke, bV as nt, bX as et, bY as tt } from "./chunks/recipe-fetch-D2IpKMVr.js";
15
+ const ze = {
16
+ endpoint: "https://my-app.com",
17
+ infrastructure: {
18
+ ctrl: { active: 1, standby: 1 },
19
+ stats: { active: 1, standby: 0 },
20
+ logger: { active: 1, standby: 0 }
21
+ },
22
+ routing: {
23
+ containers: { active: 2, standby: 0 }
24
+ },
25
+ services: [
26
+ {
27
+ id: "app",
28
+ label: "app:3000",
29
+ category: "http-runtime",
30
+ containers: { active: 3, standby: 0 },
31
+ techIcon: "nodejs"
32
+ },
33
+ {
34
+ id: "worker",
35
+ label: "worker:5432",
36
+ category: "side-runtime",
37
+ containers: { active: 2, standby: 0 },
38
+ techIcon: "python"
39
+ },
40
+ {
41
+ id: "cache",
42
+ label: "cache:6379",
43
+ category: "managed",
44
+ containers: { active: 3, standby: 0 },
45
+ techIcon: "valkey"
46
+ },
47
+ {
48
+ id: "db",
49
+ label: "db:3000",
50
+ category: "managed",
51
+ containers: { active: 3, standby: 0 },
52
+ techIcon: "postgresql",
53
+ hasLoadBalancer: !0,
54
+ loadBalancer: {
55
+ containers: { active: 2, standby: 0 }
56
+ }
57
+ },
58
+ {
59
+ id: "nats",
60
+ label: "nats:4222",
61
+ category: "managed",
62
+ containers: { active: 3, standby: 0 },
63
+ techIcon: "nats"
64
+ }
65
+ ],
66
+ storage: {
67
+ label: "Object storage",
68
+ sublabel: "storage:6379"
69
+ }
70
+ };
71
+ function ot(t, e) {
72
+ if (t & 1 && (m(0, "div", 0)(1, "span", 7), N(2), h()()), t & 2) {
73
+ const n = P();
74
+ c(2), pn(n.label());
75
+ }
76
+ }
77
+ function it(t, e) {
78
+ if (t & 1 && u(0, "zui-bar-icon", 9), t & 2) {
79
+ const n = P(2);
80
+ T("color", n.barColor())("active", !0);
81
+ }
82
+ }
83
+ function at(t, e) {
84
+ if (t & 1 && u(0, "zui-bar-icon", 9), t & 2) {
85
+ const n = P(2);
86
+ T("color", n.barColor())("active", !1);
87
+ }
88
+ }
89
+ function rt(t, e) {
90
+ if (t & 1 && u(0, "mat-icon", 12), t & 2) {
91
+ const n = e.$implicit;
92
+ T("svgIcon", n);
93
+ }
94
+ }
95
+ function st(t, e) {
96
+ if (t & 1 && R(0, rt, 1, 1, "mat-icon", 12, Q), t & 2) {
97
+ const n = P(2);
98
+ L(n.techIcons());
99
+ }
100
+ }
101
+ function ct(t, e) {
102
+ if (t & 1 && u(0, "mat-icon", 12), t & 2) {
103
+ const n = P(2);
104
+ T("svgIcon", n.techIcon());
105
+ }
106
+ }
107
+ function lt(t, e) {
108
+ if (t & 1 && (m(0, "div", 1)(1, "div", 8), R(2, it, 1, 2, "zui-bar-icon", 9, Q), R(4, at, 1, 2, "zui-bar-icon", 9, Q), h(), m(6, "span", 10), N(7), h(), m(8, "div", 11), W(9, st, 2, 0)(10, ct, 1, 1, "mat-icon", 12), h()()), t & 2) {
109
+ let n;
110
+ const o = P();
111
+ c(2), L(o.activeRange()), c(2), L(o.inactiveRange()), c(3), pn(o.label()), c(2), V((n = o.techIcons()) != null && n.length ? 9 : o.techIcon() ? 10 : -1);
112
+ }
113
+ }
114
+ function dt(t, e) {
115
+ if (t & 1 && u(0, "zui-bar-icon", 9), t & 2) {
116
+ const n = P(2);
117
+ T("color", n.barColor())("active", !0);
118
+ }
119
+ }
120
+ function ht(t, e) {
121
+ if (t & 1 && u(0, "mat-icon", 16), t & 2) {
122
+ const n = P(2);
123
+ T("svgIcon", n.techIcon());
124
+ }
125
+ }
126
+ function gt(t, e) {
127
+ if (t & 1 && (m(0, "div", 2)(1, "div", 13), R(2, dt, 1, 2, "zui-bar-icon", 9, Q), h(), m(4, "div", 14)(5, "span", 15), N(6), h(), W(7, ht, 1, 1, "mat-icon", 16), h()()), t & 2) {
128
+ const n = P();
129
+ c(2), L(n.activeRange()), c(4), pn(n.formatLabel(n.label())), c(), V(n.techIcon() ? 7 : -1);
130
+ }
131
+ }
132
+ function _t(t, e) {
133
+ if (t & 1 && u(0, "zui-bar-icon", 9), t & 2) {
134
+ const n = P(2);
135
+ T("color", n.barColor())("active", !0);
136
+ }
137
+ }
138
+ function pt(t, e) {
139
+ if (t & 1 && u(0, "zui-bar-icon", 9), t & 2) {
140
+ const n = P(2);
141
+ T("color", n.barColor())("active", !1);
142
+ }
143
+ }
144
+ function ft(t, e) {
145
+ if (t & 1 && u(0, "mat-icon", 20), t & 2) {
146
+ const n = P(2);
147
+ T("svgIcon", n.techIcon());
148
+ }
149
+ }
150
+ function ut(t, e) {
151
+ if (t & 1 && (m(0, "div", 3)(1, "div", 17), R(2, _t, 1, 2, "zui-bar-icon", 9, Q), R(4, pt, 1, 2, "zui-bar-icon", 9, Q), h(), m(6, "div", 18)(7, "span", 19), N(8), h(), W(9, ft, 1, 1, "mat-icon", 20), h()()), t & 2) {
152
+ const n = P();
153
+ c(2), L(n.activeRange()), c(2), L(n.inactiveRange()), c(4), pn(n.label()), c(), V(n.techIcon() ? 9 : -1);
154
+ }
155
+ }
156
+ function mt(t, e) {
157
+ if (t & 1 && u(0, "zui-bar-icon", 9), t & 2) {
158
+ const n = P(2);
159
+ T("color", n.barColor())("active", !0);
160
+ }
161
+ }
162
+ function vt(t, e) {
163
+ if (t & 1 && u(0, "zui-bar-icon", 9), t & 2) {
164
+ const n = P(2);
165
+ T("color", n.barColor())("active", !1);
166
+ }
167
+ }
168
+ function bt(t, e) {
169
+ if (t & 1 && u(0, "mat-icon", 12), t & 2) {
170
+ const n = P(2);
171
+ T("svgIcon", n.techIcon());
172
+ }
173
+ }
174
+ function xt(t, e) {
175
+ if (t & 1 && (m(0, "div", 4)(1, "div", 21), R(2, mt, 1, 2, "zui-bar-icon", 9, Q), R(4, vt, 1, 2, "zui-bar-icon", 9, Q), h(), m(6, "div", 22)(7, "span", 23), N(8), h(), W(9, bt, 1, 1, "mat-icon", 12), h()()), t & 2) {
176
+ const n = P();
177
+ c(2), L(n.activeRange()), c(2), L(n.inactiveRange()), c(4), pn(n.formatLabel(n.label())), c(), V(n.techIcon() ? 9 : -1);
178
+ }
179
+ }
180
+ function wt(t, e) {
181
+ if (t & 1 && u(0, "zui-bar-icon", 9), t & 2) {
182
+ const n = P(2);
183
+ T("color", n.barColor())("active", !0);
184
+ }
185
+ }
186
+ function Ct(t, e) {
187
+ if (t & 1 && u(0, "zui-bar-icon", 9), t & 2) {
188
+ const n = P(2);
189
+ T("color", n.barColor())("active", !1);
190
+ }
191
+ }
192
+ function yt(t, e) {
193
+ if (t & 1 && (m(0, "div", 5)(1, "div", 21), R(2, wt, 1, 2, "zui-bar-icon", 9, Q), R(4, Ct, 1, 2, "zui-bar-icon", 9, Q), h(), m(6, "span", 19), N(7), h()()), t & 2) {
194
+ const n = P();
195
+ c(2), L(n.activeRange()), c(2), L(n.inactiveRange()), c(3), pn(n.label());
196
+ }
197
+ }
198
+ function Mt(t, e) {
199
+ if (t & 1 && (m(0, "div", 26)(1, "span", 27), N(2), h()()), t & 2) {
200
+ const n = P(2);
201
+ c(2), pn(n.sublabel());
202
+ }
203
+ }
204
+ function It(t, e) {
205
+ if (t & 1 && (m(0, "div", 6)(1, "div", 24)(2, "span", 25), N(3), h()(), W(4, Mt, 3, 1, "div", 26), h()), t & 2) {
206
+ const n = P();
207
+ c(3), Pe("", n.label(), `
208
+ External`), c(), V(n.sublabel() ? 4 : -1);
209
+ }
210
+ }
211
+ const un = class un {
212
+ constructor() {
213
+ this.variant = k.required(), this.label = k.required(), this.sublabel = k(), this.containers = k(), this.barColor = k("orange"), this.techIcon = k(), this.techIcons = k(), this.highlighted = k(!1), this.activeRange = j(() => {
214
+ const e = this.containers();
215
+ return e ? Array.from({ length: e.active }, (n, o) => o) : [];
216
+ }), this.inactiveRange = j(() => {
217
+ const e = this.containers();
218
+ return e ? Array.from({ length: e.standby }, (n, o) => o) : [];
219
+ });
220
+ }
221
+ formatLabel(e) {
222
+ return e.replace(/\n/g, " ");
223
+ }
224
+ };
225
+ un.ɵfac = function(n) {
226
+ return new (n || un)();
227
+ }, un.ɵcmp = /* @__PURE__ */ Xn({ type: un, selectors: [["zw-diagram-node"]], hostVars: 4, hostBindings: function(n, o) {
228
+ n & 2 && (qe("__node __node--" + o.variant()), kn("__node--highlighted", o.highlighted()));
229
+ }, inputs: { variant: [1, "variant"], label: [1, "label"], sublabel: [1, "sublabel"], containers: [1, "containers"], barColor: [1, "barColor"], techIcon: [1, "techIcon"], techIcons: [1, "techIcons"], highlighted: [1, "highlighted"] }, decls: 7, vars: 1, consts: [[1, "__endpoint-pill"], [1, "__infra-core-box"], [1, "__infra-side-box"], [1, "__balancer-box"], [1, "__service-box"], [1, "__service-highlighted-box"], [1, "__external-box"], [1, "__endpoint-label"], [1, "__bar-row", "__bar-row--infra"], [3, "color", "active"], [1, "__node-label", "__node-label--mono-core", "__node-label--multiline"], [1, "__tech-icons-row"], [1, "__tech-icon", 3, "svgIcon"], [1, "__bar-col"], [1, "__side-bottom"], [1, "__node-label", "__node-label--mono", "__node-label--side"], [1, "__tech-icon", "__tech-icon--side", 3, "svgIcon"], [1, "__bar-row", "__bar-row--balancer"], [1, "__balancer-label-area"], [1, "__node-label", "__node-label--mono", "__node-label--multiline"], [1, "__tech-icon", "__tech-icon--sm", 3, "svgIcon"], [1, "__bar-row"], [1, "__label-block"], [1, "__node-label", "__node-label--mono"], [1, "__ext-inner-card"], [1, "__node-label", "__node-label--mono", "__node-label--ext-text"], [1, "__ext-sublabel-frame"], [1, "__node-label", "__node-label--mono", "__node-label--sub"]], template: function(n, o) {
230
+ if (n & 1 && W(0, ot, 3, 1, "div", 0)(1, lt, 11, 2, "div", 1)(2, gt, 8, 2, "div", 2)(3, ut, 10, 2, "div", 3)(4, xt, 10, 2, "div", 4)(5, yt, 8, 1, "div", 5)(6, It, 5, 2, "div", 6), n & 2) {
231
+ let i;
232
+ V((i = o.variant()) === "endpoint" ? 0 : i === "infra-core" ? 1 : i === "infra-side" ? 2 : i === "balancer" ? 3 : i === "service" ? 4 : i === "service-highlighted" ? 5 : i === "external" ? 6 : -1);
233
+ }
234
+ }, dependencies: [Be, Fe, je], styles: [`[_nghost-%COMP%] {
235
+ display: block;
236
+ position: relative;
237
+ contain: layout style;
238
+ }
239
+
240
+ .__node-label[_ngcontent-%COMP%] {
241
+ font-family: var(--font-family-brand);
242
+ font-weight: 600;
243
+ font-size: 11px;
244
+ line-height: 14px;
245
+ letter-spacing: 0.12em;
246
+ text-transform: uppercase;
247
+ color: #254E4A;
248
+ white-space: nowrap;
249
+ font-variation-settings: "CRSV" 0, "SHRP" 100, "slnt" 0;
250
+ }
251
+
252
+ .__node-label--mono[_ngcontent-%COMP%] {
253
+ font-family: "Roboto Mono", "JetBrains Mono", ui-monospace, monospace;
254
+ font-weight: 500;
255
+ font-size: 10px;
256
+ line-height: 12px;
257
+ letter-spacing: 0.02em;
258
+ text-transform: none;
259
+ color: #464646;
260
+ text-align: center;
261
+ padding: 0 8px;
262
+ }
263
+
264
+ .__node-label--mono-core[_ngcontent-%COMP%] {
265
+ font-family: "Roboto Mono", "JetBrains Mono", ui-monospace, monospace;
266
+ font-weight: 500;
267
+ font-size: 10px;
268
+ line-height: 12px;
269
+ letter-spacing: 0.02em;
270
+ text-transform: none;
271
+ color: #254E4A;
272
+ text-align: center;
273
+ }
274
+
275
+ .__node-label--side[_ngcontent-%COMP%] {
276
+ color: #464646;
277
+ }
278
+
279
+ .__node-label--sub[_ngcontent-%COMP%] {
280
+ margin: 0 auto;
281
+ }
282
+
283
+ .__node-label--multiline[_ngcontent-%COMP%] {
284
+ white-space: pre-line;
285
+ }
286
+
287
+ .__node-label--ext-text[_ngcontent-%COMP%] {
288
+ white-space: pre-line;
289
+ text-align: center;
290
+ font-size: 9px;
291
+ line-height: 12px;
292
+ }
293
+
294
+ .__bar-row[_ngcontent-%COMP%] {
295
+ display: flex;
296
+ gap: 5px;
297
+ align-items: flex-end;
298
+ }
299
+
300
+ .__bar-row--infra[_ngcontent-%COMP%] {
301
+ gap: 9px;
302
+ }
303
+
304
+ .__bar-row--balancer[_ngcontent-%COMP%] {
305
+ gap: 5px;
306
+ }
307
+
308
+ .__bar-col[_ngcontent-%COMP%] {
309
+ display: flex;
310
+ flex-direction: column;
311
+ gap: 4px;
312
+ }
313
+
314
+ .__label-block[_ngcontent-%COMP%] {
315
+ display: flex;
316
+ flex-direction: column;
317
+ align-items: center;
318
+ gap: 5px;
319
+ }
320
+
321
+ .__tech-icon[_ngcontent-%COMP%] {
322
+ width: 16px !important;
323
+ height: 16px !important;
324
+ font-size: 16px !important;
325
+ line-height: 16px !important;
326
+ opacity: 1;
327
+ filter: grayscale(1);
328
+ }
329
+
330
+ .__service-box[_ngcontent-%COMP%] .__tech-icon[_ngcontent-%COMP%] {
331
+ width: 25px !important;
332
+ height: 25px !important;
333
+ font-size: 25px !important;
334
+ line-height: 25px !important;
335
+ position: absolute;
336
+ flex-shrink: 0;
337
+ left: -5px;
338
+ bottom: -5px;
339
+ }
340
+
341
+ .__tech-icons-row[_ngcontent-%COMP%] {
342
+ display: flex;
343
+ align-items: center;
344
+ gap: 6px;
345
+ }
346
+
347
+ .__endpoint-pill[_ngcontent-%COMP%] {
348
+ display: flex;
349
+ align-items: center;
350
+ justify-content: center;
351
+ width: 278px;
352
+ height: 51px;
353
+ padding: 22px;
354
+ background: #fff;
355
+ border-radius: 8px;
356
+ box-shadow: 0px 38px 15px rgba(0, 0, 0, 0.01), 0px 21px 13px rgba(0, 0, 0, 0.02), 0px 10px 10px rgba(0, 0, 0, 0.03), 0px 2px 5px rgba(0, 0, 0, 0.03);
357
+ }
358
+
359
+ .__endpoint-label[_ngcontent-%COMP%] {
360
+ font-family: var(--font-family-brand);
361
+ font-weight: 600;
362
+ font-size: 11px;
363
+ line-height: 14px;
364
+ letter-spacing: 0.12em;
365
+ text-transform: uppercase;
366
+ color: #464646;
367
+ text-align: center;
368
+ font-variation-settings: "CRSV" 0, "SHRP" 100, "slnt" 0;
369
+ }
370
+
371
+ .__infra-core-box[_ngcontent-%COMP%] {
372
+ display: flex;
373
+ flex-direction: column;
374
+ align-items: center;
375
+ gap: 11px;
376
+ width: var(--diagram-node-infra-core-width, 89px);
377
+ min-height: 97px;
378
+ }
379
+
380
+ .__infra-side-box[_ngcontent-%COMP%] {
381
+ display: flex;
382
+ flex-direction: column;
383
+ align-items: center;
384
+ min-height: 97px;
385
+ gap: 11px;
386
+ }
387
+
388
+ .__side-bottom[_ngcontent-%COMP%] {
389
+ display: flex;
390
+ flex-direction: column;
391
+ align-items: center;
392
+ gap: 5px;
393
+ }
394
+
395
+ .__balancer-box[_ngcontent-%COMP%] {
396
+ display: flex;
397
+ flex-direction: column;
398
+ align-items: center;
399
+ gap: 11px;
400
+ padding: 11px;
401
+ background: var(--alt-card-banner-bg);
402
+ background-blend-mode: multiply;
403
+ border-radius: 8px;
404
+ width: 85px;
405
+ height: 108px;
406
+ overflow: hidden;
407
+ }
408
+
409
+ .__balancer-label-area[_ngcontent-%COMP%] {
410
+ display: flex;
411
+ flex-direction: column;
412
+ align-items: center;
413
+ gap: 5px;
414
+ }
415
+
416
+ .__service-box[_ngcontent-%COMP%] {
417
+ position: relative;
418
+ overflow: hidden;
419
+ display: flex;
420
+ flex-direction: column;
421
+ align-items: center;
422
+ gap: 11px;
423
+ padding: 5px 5px 11px;
424
+ padding-bottom: 20px;
425
+ background: var(--service-bg, #D8D7D7);
426
+ border-radius: 8px;
427
+ }
428
+
429
+ .__services-row--top[_nghost-%COMP%] .__service-box[_ngcontent-%COMP%], .__services-row--top [_nghost-%COMP%] .__service-box[_ngcontent-%COMP%] {
430
+ padding: 5px;
431
+ padding-bottom: 20px;
432
+ }
433
+
434
+ .__compound[_nghost-%COMP%], .__compound [_nghost-%COMP%] {
435
+ position: static;
436
+ contain: style;
437
+ overflow: visible;
438
+ }
439
+
440
+ .__compound[_nghost-%COMP%] .__service-box[_ngcontent-%COMP%], .__compound [_nghost-%COMP%] .__service-box[_ngcontent-%COMP%] {
441
+ background: none;
442
+ border-radius: 0;
443
+ padding: 0;
444
+ position: static;
445
+ overflow: visible;
446
+ }
447
+
448
+ .__service-highlighted-box[_ngcontent-%COMP%] {
449
+ display: flex;
450
+ flex-direction: column;
451
+ align-items: center;
452
+ padding: 5px 5px 11px;
453
+ gap: 9px;
454
+ background: var(--alt-card-banner-bg);
455
+ background-blend-mode: multiply;
456
+ border-radius: 5px;
457
+ }
458
+
459
+ .__external-box[_ngcontent-%COMP%] {
460
+ display: flex;
461
+ flex-direction: column;
462
+ align-items: flex-start;
463
+ gap: 5px;
464
+ padding: 5px;
465
+ background: #D8D7D7;
466
+ border-radius: 8px;
467
+ width: 115px;
468
+ height: 74px;
469
+ justify-content: center;
470
+ }
471
+
472
+ .__ext-inner-card[_ngcontent-%COMP%] {
473
+ display: flex;
474
+ flex-direction: column;
475
+ align-items: center;
476
+ gap: 14px;
477
+ padding: 11px;
478
+ background: #fff;
479
+ border-radius: 5px;
480
+ width: 104px;
481
+ height: 41px;
482
+ justify-content: center;
483
+ box-shadow: 0px 38px 15px rgba(0, 0, 0, 0.01), 0px 21px 13px rgba(0, 0, 0, 0.02), 0px 10px 10px rgba(0, 0, 0, 0.03), 0px 2px 5px rgba(0, 0, 0, 0.03);
484
+ }
485
+
486
+ .__ext-sublabel-frame[_ngcontent-%COMP%] {
487
+ display: flex;
488
+ align-items: center;
489
+ justify-content: center;
490
+ width: 104px;
491
+ height: 18px;
492
+ padding: 5px;
493
+ background: #E8E7E7;
494
+ border-radius: 3px;
495
+ }`], changeDetection: 0 });
496
+ let Qn = un;
497
+ const Pt = ["*"];
498
+ function Ot(t, e) {
499
+ if (t & 1 && (qn(), u(0, "path", 28)), t & 2) {
500
+ const n = e.$implicit;
501
+ en("d", n);
502
+ }
503
+ }
504
+ const te = {
505
+ ctrl: { active: 1, standby: 1 },
506
+ stats: { active: 1, standby: 0 },
507
+ logger: { active: 1, standby: 0 }
508
+ }, Tt = {
509
+ containers: { active: 2, standby: 0 }
510
+ };
511
+ var wn, An, Cn, yn, ln, dn, En;
512
+ const mn = class mn {
513
+ // ─── Lifecycle ──────────────────────────────────────────
514
+ constructor() {
515
+ $(this, dn);
516
+ $(this, wn);
517
+ $(this, An);
518
+ $(this, Cn);
519
+ $(this, yn);
520
+ $(this, ln);
521
+ this.config = k({}), this.lightweight = k(!1), this.showPaths = k(!0), this.internalPaths = xn([]), this.pathsVisible = xn(!0), f(this, wn, Ln(Te)), f(this, An, Ln($e)), f(this, yn, !1), this.resolvedInfra = {
522
+ ctrl: {
523
+ id: "ctrl",
524
+ label: `Project ctrl
525
+ & L3 balancer
526
+ + firewall`,
527
+ containers: te.ctrl,
528
+ techIcons: ["go"],
529
+ highlighted: !0
530
+ },
531
+ stats: {
532
+ id: "stats",
533
+ label: "Stats",
534
+ containers: te.stats,
535
+ techIcon: "sqlite",
536
+ highlighted: !1
537
+ },
538
+ logger: {
539
+ id: "logger",
540
+ label: "Logger",
541
+ containers: te.logger,
542
+ techIcon: "victorialogs",
543
+ highlighted: !1
544
+ }
545
+ }, this.resolvedLightweightNode = {
546
+ id: "ctrl",
547
+ label: `Project ctrl
548
+ & L3/L7 balancer
549
+ + firewall + stats
550
+ + logger`,
551
+ containers: { active: 1, standby: 0 },
552
+ techIcons: ["go", "sqlite", "victorialogs"],
553
+ highlighted: !0
554
+ }, this.resolvedRoutingDisplay = {
555
+ id: "l7",
556
+ label: `L7 HTTP
557
+ balancer`,
558
+ containers: Tt.containers,
559
+ techIcon: "nginx",
560
+ highlighted: !0
561
+ }, Oe(() => {
562
+ f(this, yn, !0), f(this, ln, this.lightweight()), f(this, Cn, new ResizeObserver(() => C(this, dn, En).call(this))), d(this, Cn).observe(d(this, wn).nativeElement), d(this, An).onDestroy(() => d(this, Cn)?.disconnect()), requestAnimationFrame(() => {
563
+ requestAnimationFrame(() => C(this, dn, En).call(this));
564
+ });
565
+ }), Yn(() => {
566
+ this.config();
567
+ const e = this.lightweight();
568
+ if (!d(this, yn))
569
+ return;
570
+ const n = d(this, ln) !== void 0 && d(this, ln) !== e;
571
+ f(this, ln, e), n ? (this.pathsVisible.set(!1), setTimeout(() => {
572
+ requestAnimationFrame(() => {
573
+ requestAnimationFrame(() => {
574
+ C(this, dn, En).call(this), this.pathsVisible.set(!0);
575
+ });
576
+ });
577
+ }, 200)) : requestAnimationFrame(() => {
578
+ requestAnimationFrame(() => C(this, dn, En).call(this));
579
+ });
580
+ });
581
+ }
582
+ };
583
+ wn = new WeakMap(), An = new WeakMap(), Cn = new WeakMap(), yn = new WeakMap(), ln = new WeakMap(), dn = new WeakSet(), // ─── Internal path computation ──────────────────────────
584
+ En = function() {
585
+ if (!this.showPaths()) {
586
+ this.internalPaths.set([]);
587
+ return;
588
+ }
589
+ const n = d(this, wn).nativeElement.querySelector(".__project");
590
+ if (!n)
591
+ return;
592
+ const o = n.getBoundingClientRect();
593
+ if (o.width === 0)
594
+ return;
595
+ const i = (x) => Math.round(x * 10) / 10, O = (x) => {
596
+ const b = x.getBoundingClientRect();
597
+ return [
598
+ i(b.left - o.left + b.width / 2),
599
+ i(b.top - o.top + b.height)
600
+ ];
601
+ }, v = (x) => {
602
+ const b = x.getBoundingClientRect();
603
+ return [
604
+ i(b.left - o.left + b.width / 2),
605
+ i(b.top - o.top)
606
+ ];
607
+ }, s = [], D = 16, q = 27, G = (x, b, w) => {
608
+ const [z, S] = x, [A, X] = b, tn = A - z;
609
+ if (Math.abs(tn) < 3) {
610
+ const K = i((z + A) / 2);
611
+ return `M${K},${i(S)}L${K},${i(X)}`;
612
+ }
613
+ const H = Math.min(D, Math.abs(tn) / 2, Math.abs(w - S) / 2, Math.abs(X - w) / 2), B = Math.sign(tn), U = Math.sign(X - w) || 1;
614
+ return [
615
+ `M${i(z)},${i(S)}`,
616
+ `L${i(z)},${i(w - H)}`,
617
+ `Q${i(z)},${i(w)},${i(z + H * B)},${i(w)}`,
618
+ `L${i(A - H * B)},${i(w)}`,
619
+ `Q${i(A)},${i(w)},${i(A)},${i(w + H * U)}`,
620
+ `L${i(A)},${i(X)}`
621
+ ].join("");
622
+ }, E = n.querySelector(".__zone--services");
623
+ if (this.lightweight()) {
624
+ const x = n.querySelector('[data-mode="lw"]');
625
+ if (x && E) {
626
+ const b = x.querySelector(".__infra-group");
627
+ if (b) {
628
+ const [w, z] = O(b), S = v(E)[1];
629
+ s.push(`M${i(w)},${i(z)}L${i(w)},${i(S)}`);
630
+ }
631
+ }
632
+ } else {
633
+ const x = n.querySelector('[data-mode="hw"]');
634
+ if (!x) {
635
+ this.internalPaths.set(s);
636
+ return;
637
+ }
638
+ const b = x.querySelector(".__infra-group"), w = x.querySelector('[data-node-id="ctrl"]'), z = x.querySelector('[data-node-id="l7"]');
639
+ if (b && w && z) {
640
+ const S = O(w)[0], A = O(b)[1], X = [S, A], tn = Array.from(z.querySelectorAll("zui-bar-icon")), H = this.resolvedRoutingDisplay.containers.active;
641
+ for (let B = 0; B < tn.length; B++) {
642
+ if (B >= H)
643
+ continue;
644
+ const U = v(tn[B]), K = U[1] - q;
645
+ s.push(G(X, U, K));
646
+ }
647
+ if (E) {
648
+ const [B, U] = O(z), K = v(E)[1];
649
+ s.push(`M${i(B)},${i(U)}L${i(B)},${i(K)}`);
650
+ }
651
+ }
652
+ }
653
+ this.internalPaths.set(s);
654
+ }, mn.ɵfac = function(n) {
655
+ return new (n || mn)();
656
+ }, mn.ɵcmp = /* @__PURE__ */ Xn({ type: mn, selectors: [["zw-project-shell"]], inputs: { config: [1, "config"], lightweight: [1, "lightweight"], showPaths: [1, "showPaths"] }, ngContentSelectors: Pt, decls: 48, vars: 28, consts: [[1, "__project"], [1, "__project-header"], [1, "__project-title"], [1, "__vxlan-label"], [1, "__infra-stack"], ["data-mode", "lw", 1, "__infra-mode"], [1, "__infra-mode-inner"], [1, "__zone", "__zone--infra", "__zone--infra-lightweight"], [1, "__zone-label"], [1, "__infra-content", "__infra-content--lightweight"], [1, "__infra-group"], ["data-node-id", "core-lw"], ["variant", "infra-core", "barColor", "orange", 3, "label", "containers", "techIcons", "highlighted"], ["data-mode", "hw", 1, "__infra-mode"], [1, "__zone", "__zone--infra"], [1, "__infra-content"], ["data-node-id", "ctrl"], [1, "__infra-side-nodes"], ["data-node-id", "stats"], ["variant", "infra-side", "barColor", "orange", 3, "label", "containers", "techIcon", "highlighted"], ["data-node-id", "logger"], [1, "__zone-spacer", "__zone-spacer--infra-to-routing"], [1, "__zone", "__zone--routing"], [1, "__routing-content"], ["data-node-id", "l7"], ["variant", "balancer", "barColor", "orange", 3, "label", "containers", "techIcon", "highlighted"], ["data-spacer", "routing-services", 1, "__zone-spacer", "__zone-spacer--routing-to-services"], [1, "__svg-layer"], [1, "__path-base"]], template: function(n, o) {
657
+ n & 1 && (Ge(), m(0, "div", 0)(1, "div", 1)(2, "span", 2), N(3, "Project"), h(), m(4, "span", 3), N(5, "Private VXLAN network"), h()(), m(6, "div", 4)(7, "div", 5)(8, "div", 6)(9, "div", 7)(10, "span", 8), N(11, "Dedicated"), u(12, "br"), N(13, "infrastructure"), u(14, "br"), N(15, "core with routing"), u(16, "br"), N(17, "and balancing"), h(), m(18, "div", 9)(19, "div", 10)(20, "div", 11), u(21, "zw-diagram-node", 12), h()()()()()(), m(22, "div", 13)(23, "div", 6)(24, "div", 14)(25, "span", 8), N(26, "Dedicated infrastructure core"), h(), m(27, "div", 15)(28, "div", 10)(29, "div", 16), u(30, "zw-diagram-node", 12), h(), m(31, "div", 17)(32, "div", 18), u(33, "zw-diagram-node", 19), h(), m(34, "div", 20), u(35, "zw-diagram-node", 19), h()()()()(), u(36, "div", 21), m(37, "div", 22)(38, "span", 8), N(39, "Dedicated routing and balancing"), h(), m(40, "div", 23)(41, "div", 24), u(42, "zw-diagram-node", 25), h()()()()()(), u(43, "div", 26), We(44), qn(), m(45, "svg", 27), R(46, Ot, 1, 1, ":svg:path", 28, re), h()()), n & 2 && (kn("__project--lightweight", o.lightweight()), c(7), kn("__infra-mode--active", o.lightweight()), c(14), T("label", o.resolvedLightweightNode.label)("containers", o.resolvedLightweightNode.containers)("techIcons", o.resolvedLightweightNode.techIcons)("highlighted", o.resolvedLightweightNode.highlighted), c(), kn("__infra-mode--active", !o.lightweight()), c(8), T("label", o.resolvedInfra.ctrl.label)("containers", o.resolvedInfra.ctrl.containers)("techIcons", o.resolvedInfra.ctrl.techIcons)("highlighted", o.resolvedInfra.ctrl.highlighted), c(3), T("label", o.resolvedInfra.stats.label)("containers", o.resolvedInfra.stats.containers)("techIcon", o.resolvedInfra.stats.techIcon)("highlighted", o.resolvedInfra.stats.highlighted), c(2), T("label", o.resolvedInfra.logger.label)("containers", o.resolvedInfra.logger.containers)("techIcon", o.resolvedInfra.logger.techIcon)("highlighted", o.resolvedInfra.logger.highlighted), c(7), T("label", o.resolvedRoutingDisplay.label)("containers", o.resolvedRoutingDisplay.containers)("techIcon", o.resolvedRoutingDisplay.techIcon)("highlighted", o.resolvedRoutingDisplay.highlighted), c(3), kn("__svg-layer--visible", o.pathsVisible()), c(), L(o.internalPaths()));
658
+ }, dependencies: [Qn], styles: [`[_nghost-%COMP%] {
659
+ display: block;
660
+ position: relative;
661
+ }
662
+
663
+ .__project[_ngcontent-%COMP%] {
664
+ position: relative;
665
+ width: 100%;
666
+ border: 1px solid #D8D7D7;
667
+ border-left-width: var(--project-shell-side-border, 1px);
668
+ border-right-width: var(--project-shell-side-border, 1px);
669
+ border-radius: var(--project-shell-border-radius, 16px);
670
+ background: #F0F0F0;
671
+ padding: var(--project-shell-padding, 88px 9px 11px);
672
+ display: flex;
673
+ flex-direction: column;
674
+ gap: 0;
675
+ }
676
+
677
+ .__project-header[_ngcontent-%COMP%] {
678
+ position: absolute;
679
+ top: var(--project-shell-header-top, 31px);
680
+ left: var(--project-shell-header-left, 31px);
681
+ display: flex;
682
+ flex-direction: column;
683
+ gap: 3px;
684
+ }
685
+
686
+ .__project-title[_ngcontent-%COMP%] {
687
+ font-family: var(--font-family-brand);
688
+ font-weight: 600;
689
+ font-size: 11px;
690
+ line-height: 14px;
691
+ letter-spacing: 0.12em;
692
+ text-transform: uppercase;
693
+ color: #254E4A;
694
+ font-variation-settings: "CRSV" 0, "SHRP" 100, "slnt" 0;
695
+ }
696
+
697
+ .__vxlan-label[_ngcontent-%COMP%] {
698
+ font-family: "Roboto Mono", "JetBrains Mono", ui-monospace, monospace;
699
+ font-weight: 400;
700
+ font-size: 9px;
701
+ line-height: 12px;
702
+ letter-spacing: 0.02em;
703
+ color: #254E4A;
704
+ }
705
+
706
+ .__infra-stack[_ngcontent-%COMP%] {
707
+ display: grid;
708
+ }
709
+
710
+ .__infra-mode[_ngcontent-%COMP%] {
711
+ grid-row: 1;
712
+ grid-column: 1;
713
+ display: grid;
714
+ grid-template-rows: 0fr;
715
+ opacity: 0;
716
+ pointer-events: none;
717
+ transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0s, grid-template-rows 0.25s cubic-bezier(0.4, 0, 0.2, 1) 0.12s;
718
+ }
719
+ .__infra-mode--active[_ngcontent-%COMP%] {
720
+ grid-template-rows: 1fr;
721
+ opacity: 1;
722
+ pointer-events: auto;
723
+ transition: grid-template-rows 0.25s cubic-bezier(0.4, 0, 0.2, 1) 0s, opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
724
+ }
725
+
726
+ .__infra-mode-inner[_ngcontent-%COMP%] {
727
+ min-height: 0;
728
+ overflow: hidden;
729
+ }
730
+
731
+ .__zone[_ngcontent-%COMP%] {
732
+ position: relative;
733
+ border-radius: 8px;
734
+ background: rgba(232, 231, 231, 0.5);
735
+ padding: 20px 14px;
736
+ }
737
+
738
+ .__zone-label[_ngcontent-%COMP%] {
739
+ position: absolute;
740
+ top: var(--project-shell-zone-label-top, 23px);
741
+ left: var(--project-shell-zone-label-left, 23px);
742
+ font-family: var(--font-family-brand);
743
+ font-weight: 600;
744
+ font-size: 11px;
745
+ line-height: 14px;
746
+ letter-spacing: 0.12em;
747
+ text-transform: uppercase;
748
+ color: #254E4A;
749
+ opacity: 0.6;
750
+ font-variation-settings: "CRSV" 0, "SHRP" 100, "slnt" 0;
751
+ }
752
+
753
+ .__zone--infra[_ngcontent-%COMP%] > .__zone-label[_ngcontent-%COMP%] {
754
+ top: 28px;
755
+ max-width: 119px;
756
+ }
757
+
758
+ .__zone--infra-lightweight[_ngcontent-%COMP%] > .__zone-label[_ngcontent-%COMP%] {
759
+ max-width: 180px;
760
+ }
761
+
762
+ .__zone--routing[_ngcontent-%COMP%] > .__zone-label[_ngcontent-%COMP%] {
763
+ max-width: 139px;
764
+ }
765
+
766
+ .__zone-spacer[_ngcontent-%COMP%] {
767
+ flex-shrink: 0;
768
+ }
769
+
770
+ .__zone-spacer--infra-to-routing[_ngcontent-%COMP%] {
771
+ height: 9px;
772
+ }
773
+
774
+ .__zone-spacer--routing-to-services[_ngcontent-%COMP%] {
775
+ height: 34px;
776
+ }
777
+
778
+ .__infra-content[_ngcontent-%COMP%] {
779
+ display: flex;
780
+ justify-content: center;
781
+ padding-left: var(--project-shell-infra-pad-left, 122px);
782
+ }
783
+
784
+ .__infra-content--lightweight[_ngcontent-%COMP%] {
785
+ padding-left: 0;
786
+ --diagram-node-infra-core-width: 120px;
787
+ }
788
+
789
+ .__infra-group[_ngcontent-%COMP%] {
790
+ display: flex;
791
+ flex-direction: row;
792
+ align-items: flex-start;
793
+ gap: 18px;
794
+ padding: 11px;
795
+ background: var(--alt-card-banner-bg);
796
+ background-blend-mode: multiply;
797
+ border-radius: 8px;
798
+ }
799
+
800
+ .__infra-side-nodes[_ngcontent-%COMP%] {
801
+ display: flex;
802
+ gap: 3px;
803
+ align-items: flex-start;
804
+ }
805
+
806
+ .__routing-content[_ngcontent-%COMP%] {
807
+ display: flex;
808
+ justify-content: center;
809
+ }
810
+
811
+ .__svg-layer[_ngcontent-%COMP%] {
812
+ position: absolute;
813
+ inset: 0;
814
+ pointer-events: none;
815
+ overflow: visible;
816
+ opacity: 0;
817
+ transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);
818
+ }
819
+ .__svg-layer--visible[_ngcontent-%COMP%] {
820
+ opacity: 1;
821
+ }
822
+
823
+ .__path-base[_ngcontent-%COMP%] {
824
+ fill: none;
825
+ stroke: #C4C3C3;
826
+ stroke-width: 2;
827
+ stroke-linecap: round;
828
+ stroke-linejoin: round;
829
+ }`], changeDetection: 0 });
830
+ let se = mn;
831
+ const ce = (t, e) => e.service.id;
832
+ function $t(t, e) {
833
+ if (t & 1 && (m(0, "div"), u(1, "zw-diagram-node", 13), h()), t & 2) {
834
+ const n = e.$implicit;
835
+ en("data-node-id", n.service.id), c(), T("label", n.service.label)("containers", n.service.containers)("barColor", n.barColor)("techIcon", n.service.techIcon);
836
+ }
837
+ }
838
+ function St(t, e) {
839
+ if (t & 1 && (m(0, "div"), u(1, "zw-diagram-node", 13), h()), t & 2) {
840
+ const n = e.$implicit;
841
+ en("data-node-id", n.service.id), c(), T("label", n.service.label)("containers", n.service.containers)("barColor", n.barColor)("techIcon", n.service.techIcon);
842
+ }
843
+ }
844
+ function zt(t, e) {
845
+ if (t & 1 && (m(0, "div", 8), R(1, St, 2, 5, "div", null, ce), h()), t & 2) {
846
+ const n = P();
847
+ c(), L(n.row1SideServices());
848
+ }
849
+ }
850
+ function Dt(t, e) {
851
+ t & 1 && u(0, "div");
852
+ }
853
+ function Nt(t, e) {
854
+ if (t & 1 && (m(0, "div", 14)(1, "div", 15), u(2, "zw-diagram-node", 16), h(), m(3, "div", 17), u(4, "zw-diagram-node", 13), h()()), t & 2) {
855
+ const n = e, o = P().$implicit;
856
+ en("data-node-id", o.service.id + "-compound"), c(), en("data-node-id", n.id), c(), T("label", n.label)("containers", n.containers)("barColor", n.barColor)("highlighted", !0), c(), en("data-node-id", o.service.id), c(), T("label", o.service.label)("containers", o.service.containers)("barColor", o.barColor)("techIcon", o.service.techIcon);
857
+ }
858
+ }
859
+ function kt(t, e) {
860
+ if (t & 1 && (m(0, "div"), u(1, "zw-diagram-node", 13), h()), t & 2) {
861
+ const n = P().$implicit;
862
+ en("data-node-id", n.service.id), c(), T("label", n.service.label)("containers", n.service.containers)("barColor", n.barColor)("techIcon", n.service.techIcon);
863
+ }
864
+ }
865
+ function Et(t, e) {
866
+ if (t & 1 && W(0, Nt, 5, 11, "div", 14)(1, kt, 2, 5, "div"), t & 2) {
867
+ let n;
868
+ const o = e.$implicit;
869
+ V((n = o.loadBalancer) ? 0 : 1, n);
870
+ }
871
+ }
872
+ function Rt(t, e) {
873
+ if (t & 1 && (m(0, "div", 11), u(1, "zw-diagram-node", 18), h()), t & 2) {
874
+ const n = e;
875
+ c(), T("label", n.label)("sublabel", n.sublabel);
876
+ }
877
+ }
878
+ function Lt(t, e) {
879
+ if (t & 1 && (qn(), u(0, "path", 19)), t & 2) {
880
+ const n = P().$implicit;
881
+ en("d", n.d);
882
+ }
883
+ }
884
+ function At(t, e) {
885
+ if (t & 1 && W(0, Lt, 1, 1, ":svg:path", 19), t & 2) {
886
+ const n = e.$implicit;
887
+ V(n.renderMode !== "glow-only" ? 0 : -1);
888
+ }
889
+ }
890
+ function Bt(t, e) {
891
+ if (t & 1 && (qn(), u(0, "path", 20)), t & 2) {
892
+ const n = P(), o = n.$implicit, i = n.$index;
893
+ en("d", o.d)("data-path-idx", i);
894
+ }
895
+ }
896
+ function Ft(t, e) {
897
+ if (t & 1 && W(0, Bt, 1, 2, ":svg:path", 20), t & 2) {
898
+ const n = e.$implicit;
899
+ V(n.renderMode !== "base-only" ? 0 : -1);
900
+ }
901
+ }
902
+ const jt = 660, oe = {
903
+ ctrl: { active: 1, standby: 1 },
904
+ stats: { active: 1, standby: 0 },
905
+ logger: { active: 1, standby: 0 }
906
+ }, qt = {
907
+ containers: { active: 2, standby: 0 }
908
+ }, Dn = 600, Nn = 1050, ie = 525, ae = 900, Gt = 3300, Wt = 900, Me = 2250, Vt = 2e3, Zt = 400;
909
+ var nn, Mn, In, Pn, On, Z, Bn, hn, gn, _n, on, an, rn, g, Rn, De, Ne, Hn, ke, de, he, Ee, Re, Le, Ae, Un, Jn, ge;
910
+ const vn = class vn {
911
+ // ─── Lifecycle ──────────────────────────────────────────
912
+ constructor() {
913
+ $(this, g);
914
+ $(this, nn);
915
+ $(this, Mn);
916
+ $(this, In);
917
+ $(this, Pn);
918
+ $(this, On);
919
+ $(this, Z);
920
+ // rAF id for coalesced recomputation
921
+ // ─── Trace orchestrator state ──────────────────────────
922
+ $(this, Bn);
923
+ $(this, hn);
924
+ $(this, gn);
925
+ $(this, _n);
926
+ $(this, on);
927
+ $(this, an);
928
+ $(this, rn);
929
+ this.config = k(ze), this.lightweight = k(!1), this.annotatedPaths = xn([]), f(this, nn, Ln(Te)), f(this, Mn, Ln($e)), f(this, Pn, 1), f(this, On, !1), f(this, Z, 0), f(this, Bn, 0), f(this, hn, 0), f(this, gn, 0), f(this, _n, !1), f(this, on, !1), f(this, an, /* @__PURE__ */ new Map()), f(this, rn, /* @__PURE__ */ new Map()), this.shellConfig = j(() => ({
930
+ infrastructure: this.config().infrastructure,
931
+ routing: this.config().routing
932
+ })), this.resolvedInfra = j(() => {
933
+ const e = this.config().infrastructure ?? {};
934
+ return {
935
+ ctrl: {
936
+ id: "ctrl",
937
+ label: `Project ctrl
938
+ & L3 balancer
939
+ + firewall`,
940
+ containers: e.ctrl ?? oe.ctrl,
941
+ techIcons: ["go"],
942
+ highlighted: !0
943
+ },
944
+ stats: {
945
+ id: "stats",
946
+ label: "Stats",
947
+ containers: e.stats ?? oe.stats,
948
+ techIcon: "sqlite",
949
+ highlighted: !1
950
+ },
951
+ logger: {
952
+ id: "logger",
953
+ label: "Logger",
954
+ containers: e.logger ?? oe.logger,
955
+ techIcon: "victorialogs",
956
+ highlighted: !1
957
+ }
958
+ };
959
+ }), this.resolvedRouting = j(() => {
960
+ const e = this.config().routing;
961
+ return e ? {
962
+ id: "l7",
963
+ label: `L7 HTTP
964
+ balancer`,
965
+ containers: e.containers ?? qt.containers,
966
+ techIcon: "nginx",
967
+ highlighted: !0
968
+ } : null;
969
+ }), this.row1MainServices = j(() => this.config().services.filter((e) => e.category === "http-runtime").map((e) => C(this, g, Hn).call(this, e))), this.row1SideServices = j(() => this.config().services.filter((e) => e.category === "side-runtime").map((e) => C(this, g, Hn).call(this, e))), this.row1Services = j(() => [...this.row1MainServices()]), this.row2Services = j(() => this.config().services.filter((e) => e.category !== "http-runtime" && e.category !== "side-runtime").map((e) => C(this, g, Hn).call(this, e))), this.resolvedStorage = j(() => {
970
+ const e = this.config().storage;
971
+ return e ? {
972
+ label: e.label ?? "Object storage",
973
+ sublabel: e.sublabel ?? "storage:6379"
974
+ } : null;
975
+ }), Oe(() => {
976
+ f(this, On, !0), f(this, In, new ResizeObserver(() => {
977
+ C(this, g, Rn).call(this);
978
+ })), d(this, In).observe(d(this, nn).nativeElement), d(this, Mn).onDestroy(() => {
979
+ d(this, In)?.disconnect(), C(this, g, de).call(this), d(this, Z) && cancelAnimationFrame(d(this, Z));
980
+ }), C(this, g, Rn).call(this);
981
+ const e = new IntersectionObserver(([n]) => {
982
+ n.isIntersecting ? C(this, g, ke).call(this) : C(this, g, de).call(this);
983
+ }, { rootMargin: "200px 0px" });
984
+ e.observe(d(this, nn).nativeElement), d(this, Mn).onDestroy(() => e.disconnect());
985
+ }), Yn(() => {
986
+ this.config(), this.lightweight(), d(this, On) && (C(this, g, Rn).call(this), setTimeout(() => C(this, g, Rn).call(this), 350));
987
+ });
988
+ }
989
+ };
990
+ nn = new WeakMap(), Mn = new WeakMap(), In = new WeakMap(), Pn = new WeakMap(), On = new WeakMap(), Z = new WeakMap(), Bn = new WeakMap(), hn = new WeakMap(), gn = new WeakMap(), _n = new WeakMap(), on = new WeakMap(), an = new WeakMap(), rn = new WeakMap(), g = new WeakSet(), // ─── Private ────────────────────────────────────────────
991
+ /**
992
+ * Coalesces all path recomputation requests through a single double-rAF.
993
+ * Prevents stale DOM measurements when ResizeObserver fires before Angular
994
+ * has flushed template changes from a config update.
995
+ */
996
+ Rn = function() {
997
+ d(this, Z) && cancelAnimationFrame(d(this, Z)), f(this, Z, requestAnimationFrame(() => {
998
+ f(this, Z, requestAnimationFrame(() => {
999
+ f(this, Z, 0), C(this, g, he).call(this), C(this, g, De).call(this), C(this, g, Ne).call(this);
1000
+ }));
1001
+ }));
1002
+ }, De = function() {
1003
+ const e = d(this, nn).nativeElement, o = e.clientWidth / jt;
1004
+ f(this, Pn, o), e.style.setProperty("--diagram-scale", String(o));
1005
+ const i = e.querySelector(".__canvas");
1006
+ i && (e.style.height = `${i.scrollHeight * o}px`);
1007
+ }, Ne = function() {
1008
+ const e = d(this, nn).nativeElement, n = e.querySelector(".__canvas");
1009
+ if (!n)
1010
+ return;
1011
+ const o = n.getBoundingClientRect();
1012
+ if (o.width === 0)
1013
+ return;
1014
+ const i = d(this, Pn), O = (r) => {
1015
+ const l = r.getBoundingClientRect();
1016
+ return {
1017
+ x: (l.left - o.left) / i,
1018
+ y: (l.top - o.top) / i,
1019
+ w: l.width / i,
1020
+ h: l.height / i
1021
+ };
1022
+ }, v = (r) => {
1023
+ const l = O(r);
1024
+ return [l.x + l.w / 2, l.y];
1025
+ }, s = (r) => {
1026
+ const l = O(r);
1027
+ return [l.x + l.w / 2, l.y + l.h];
1028
+ }, D = (r) => n.querySelector(`[data-node-id="${r}"]`), q = (r, l) => {
1029
+ const _ = D(r);
1030
+ return _ ? Array.from(_.querySelectorAll("zui-bar-icon")).map((p, M) => ({
1031
+ point: v(p),
1032
+ barIndex: M,
1033
+ active: l !== void 0 ? M < l : !0
1034
+ })) : [];
1035
+ }, G = 16, E = 27, a = (r) => Math.round(r * 10) / 10, x = (r, l, _) => {
1036
+ const [p, M] = r, [y, I] = l, sn = y - p;
1037
+ if (Math.abs(sn) < 3) {
1038
+ const cn = a((p + y) / 2);
1039
+ return `M${cn},${a(M)}L${cn},${a(I)}`;
1040
+ }
1041
+ const F = Math.min(G, Math.abs(sn) / 2, Math.abs(_ - M) / 2, Math.abs(I - _) / 2), J = Math.sign(sn), Vn = Math.sign(I - _) || 1;
1042
+ return [
1043
+ `M${a(p)},${a(M)}`,
1044
+ `L${a(p)},${a(_ - F)}`,
1045
+ `Q${a(p)},${a(_)},${a(p + F * J)},${a(_)}`,
1046
+ `L${a(y - F * J)},${a(_)}`,
1047
+ `Q${a(y)},${a(_)},${a(y)},${a(_ + F * Vn)}`,
1048
+ `L${a(y)},${a(I)}`
1049
+ ].join("");
1050
+ }, b = [], w = this.lightweight(), z = w ? "core-lw" : "ctrl", S = w ? 2 : 3, A = w ? 3 : 4, X = D("endpoint"), tn = this.resolvedInfra(), H = q(z, w ? void 0 : tn.ctrl.containers.active);
1051
+ if (X && H.length) {
1052
+ const r = s(X), _ = Math.min(...H.map((p) => p.point[1])) - E;
1053
+ for (const p of H)
1054
+ b.push({
1055
+ d: x(r, p.point, _),
1056
+ depth: 0,
1057
+ sourceNodeId: "endpoint",
1058
+ targetNodeId: z,
1059
+ targetBarIndex: p.barIndex,
1060
+ active: p.active
1061
+ });
1062
+ }
1063
+ const B = n.querySelector(".__infra-mode--active .__infra-group"), U = D("l7"), K = D("ctrl"), pe = this.resolvedRouting();
1064
+ if (!w && K && U && B && pe) {
1065
+ const r = q("l7", pe.containers.active);
1066
+ if (r.length) {
1067
+ const l = s(K)[0], _ = s(B)[1], p = [l, _], y = Math.min(...r.map((I) => I.point[1])) - E;
1068
+ for (const I of r)
1069
+ b.push({
1070
+ d: x(p, I.point, y),
1071
+ depth: 1,
1072
+ sourceNodeId: "ctrl",
1073
+ targetNodeId: "l7",
1074
+ targetBarIndex: I.barIndex,
1075
+ active: I.active
1076
+ });
1077
+ }
1078
+ }
1079
+ let Gn = null;
1080
+ if (w) {
1081
+ const r = D(z);
1082
+ r && B && (Gn = [s(r)[0], s(B)[1]]);
1083
+ } else U && (Gn = s(U));
1084
+ if (Gn) {
1085
+ const r = w ? z : "l7";
1086
+ for (const l of this.row1Services()) {
1087
+ const _ = q(l.service.id, l.service.containers.active);
1088
+ if (_.length) {
1089
+ const p = Gn, M = Math.min(..._.map((I) => I.point[1])), y = (p[1] + M) / 2;
1090
+ for (const I of _)
1091
+ b.push({
1092
+ d: x(p, I.point, y),
1093
+ depth: w ? 1 : 2,
1094
+ sourceNodeId: r,
1095
+ targetNodeId: l.service.id,
1096
+ targetBarIndex: I.barIndex,
1097
+ active: I.active
1098
+ });
1099
+ }
1100
+ }
1101
+ }
1102
+ const fe = 19, Kn = 11, Sn = [], zn = [];
1103
+ for (const r of this.row2Services())
1104
+ if (r.loadBalancer)
1105
+ for (const l of q(r.loadBalancer.id, r.loadBalancer.containers.active))
1106
+ zn.push({ ...l, nodeId: r.loadBalancer.id });
1107
+ else
1108
+ for (const l of q(r.service.id, r.service.containers.active))
1109
+ Sn.push({ ...l, nodeId: r.service.id });
1110
+ const ue = D("storage"), Wn = ue ? v(ue) : null;
1111
+ let fn = 0, me = 0;
1112
+ for (const r of this.row1Services()) {
1113
+ const l = D(r.service.id);
1114
+ if (!l)
1115
+ continue;
1116
+ const _ = s(l);
1117
+ me = _[0];
1118
+ const p = Sn.length ? Math.min(...Sn.map((y) => y.point[1])) : zn.length ? Math.min(...zn.map((y) => y.point[1])) : 0, M = Math.max(_[1] + G, p - E);
1119
+ fn = M, Wn && b.push({
1120
+ d: x(_, Wn, M - fe),
1121
+ depth: S,
1122
+ sourceNodeId: r.service.id,
1123
+ targetNodeId: "storage",
1124
+ targetBarIndex: -1,
1125
+ active: !0
1126
+ });
1127
+ for (const y of Sn)
1128
+ b.push({
1129
+ d: x(_, y.point, M),
1130
+ depth: S,
1131
+ sourceNodeId: r.service.id,
1132
+ targetNodeId: y.nodeId,
1133
+ targetBarIndex: y.barIndex,
1134
+ active: y.active
1135
+ });
1136
+ for (const y of zn)
1137
+ b.push({
1138
+ d: x(_, y.point, M + Kn),
1139
+ depth: S,
1140
+ sourceNodeId: r.service.id,
1141
+ targetNodeId: y.nodeId,
1142
+ targetBarIndex: y.barIndex,
1143
+ active: y.active
1144
+ });
1145
+ }
1146
+ for (const r of this.row1SideServices()) {
1147
+ const l = D(r.service.id);
1148
+ if (!l || !fn)
1149
+ continue;
1150
+ const _ = s(l);
1151
+ b.push({
1152
+ d: `M${a(_[0])},${a(_[1])}L${a(_[0])},${a(fn)}`,
1153
+ depth: S,
1154
+ sourceNodeId: r.service.id,
1155
+ targetNodeId: "bus-rail",
1156
+ targetBarIndex: -1,
1157
+ active: !0,
1158
+ renderMode: "base-only"
1159
+ }), Wn && b.push({
1160
+ d: x(_, Wn, fn - fe),
1161
+ depth: S,
1162
+ sourceNodeId: r.service.id,
1163
+ targetNodeId: "storage",
1164
+ targetBarIndex: -1,
1165
+ active: !0,
1166
+ renderMode: "glow-only"
1167
+ });
1168
+ for (const p of Sn)
1169
+ b.push({
1170
+ d: x(_, p.point, fn),
1171
+ depth: S,
1172
+ sourceNodeId: r.service.id,
1173
+ targetNodeId: p.nodeId,
1174
+ targetBarIndex: p.barIndex,
1175
+ active: p.active,
1176
+ renderMode: "glow-only"
1177
+ });
1178
+ for (const p of zn) {
1179
+ const [M, y] = _, [I, sn] = p.point, F = fn, J = me, Vn = J - M, cn = Math.min(G, Math.abs(Vn) / 2, Math.abs(F - y) / 2), ve = Math.sign(Vn), Zn = I - J;
1180
+ let ne;
1181
+ if (Math.abs(Zn) < 3) {
1182
+ const Y = a((J + I) / 2);
1183
+ ne = [
1184
+ `M${a(M)},${a(y)}`,
1185
+ `L${a(M)},${a(F - cn)}`,
1186
+ `Q${a(M)},${a(F)},${a(M + cn * ve)},${a(F)}`,
1187
+ `L${a(Y)},${a(F)}`,
1188
+ `L${a(Y)},${a(sn)}`
1189
+ ].join("");
1190
+ } else {
1191
+ const Y = F + Kn, be = Math.sign(Zn), xe = Math.min(G, Kn / 2, Math.abs(Zn) / 2), we = Math.min(G, Math.abs(Zn) / 2, Math.abs(sn - Y) / 2);
1192
+ ne = [
1193
+ `M${a(M)},${a(y)}`,
1194
+ `L${a(M)},${a(F - cn)}`,
1195
+ `Q${a(M)},${a(F)},${a(M + cn * ve)},${a(F)}`,
1196
+ `L${a(J)},${a(F)}`,
1197
+ `L${a(J)},${a(Y - xe)}`,
1198
+ `Q${a(J)},${a(Y)},${a(J + xe * be)},${a(Y)}`,
1199
+ `L${a(I - we * be)},${a(Y)}`,
1200
+ `Q${a(I)},${a(Y)},${a(I)},${a(Y + we)}`,
1201
+ `L${a(I)},${a(sn)}`
1202
+ ].join("");
1203
+ }
1204
+ b.push({
1205
+ d: ne,
1206
+ depth: S,
1207
+ sourceNodeId: r.service.id,
1208
+ targetNodeId: p.nodeId,
1209
+ targetBarIndex: p.barIndex,
1210
+ active: p.active,
1211
+ renderMode: "glow-only"
1212
+ });
1213
+ }
1214
+ }
1215
+ for (const r of this.row2Services())
1216
+ if (r.loadBalancer) {
1217
+ const l = D(r.loadBalancer.id), _ = q(r.service.id, r.service.containers.active);
1218
+ if (l && _.length) {
1219
+ const p = s(l), M = Math.min(..._.map((I) => I.point[1])), y = (p[1] + M) / 2;
1220
+ for (const I of _)
1221
+ b.push({
1222
+ d: x(p, I.point, y),
1223
+ depth: A,
1224
+ sourceNodeId: r.loadBalancer.id,
1225
+ targetNodeId: r.service.id,
1226
+ targetBarIndex: I.barIndex,
1227
+ active: I.active
1228
+ });
1229
+ }
1230
+ }
1231
+ this.annotatedPaths.set(b), requestAnimationFrame(() => {
1232
+ const r = e.querySelector(".__canvas > .__svg-layer");
1233
+ if (!r)
1234
+ return;
1235
+ const l = this.annotatedPaths();
1236
+ let _ = !1;
1237
+ for (let p = 0; p < l.length; p++) {
1238
+ if (l[p].cachedLength != null)
1239
+ continue;
1240
+ const M = r.querySelector(`[data-path-idx="${p}"]`);
1241
+ M && (l[p].cachedLength = Math.ceil(M.getTotalLength()), _ = !0);
1242
+ }
1243
+ _ && this.annotatedPaths.set([...l]);
1244
+ });
1245
+ }, Hn = function(e) {
1246
+ const n = e.category === "managed" ? "orange" : "cyan";
1247
+ let o;
1248
+ if (e.hasLoadBalancer) {
1249
+ const i = e.loadBalancer ?? {};
1250
+ o = {
1251
+ id: `${e.id}-lb`,
1252
+ label: i.label ?? `load
1253
+ balancers`,
1254
+ containers: i.containers ?? { active: 2, standby: 0 },
1255
+ barColor: "orange",
1256
+ highlighted: !0
1257
+ };
1258
+ }
1259
+ return { service: e, barColor: n, loadBalancer: o };
1260
+ }, // ─── Trace orchestrator ────────────────────────────────
1261
+ ke = function() {
1262
+ if (d(this, _n) || typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches)
1263
+ return;
1264
+ f(this, _n, !0);
1265
+ const e = () => {
1266
+ C(this, g, Ee).call(this), f(this, hn, window.setTimeout(e, Gt + Math.random() * Wt));
1267
+ };
1268
+ f(this, hn, window.setTimeout(e, Me));
1269
+ const n = () => {
1270
+ C(this, g, Re).call(this), f(this, gn, window.setTimeout(n, Vt + Math.random() * Zt));
1271
+ };
1272
+ this.row1SideServices().length && f(this, gn, window.setTimeout(n, Me + 600));
1273
+ }, de = function() {
1274
+ f(this, _n, !1), clearTimeout(d(this, hn)), clearTimeout(d(this, gn)), C(this, g, he).call(this);
1275
+ }, he = function() {
1276
+ d(this, an).forEach((e) => e()), d(this, an).clear(), d(this, rn).clear(), f(this, on, !1);
1277
+ }, Ee = function() {
1278
+ const e = this.annotatedPaths();
1279
+ if (!e.length)
1280
+ return;
1281
+ const n = C(this, g, Ae).call(this, e);
1282
+ n.length && C(this, g, ge).call(this, n);
1283
+ }, Re = function() {
1284
+ if (d(this, on))
1285
+ return;
1286
+ const e = this.annotatedPaths();
1287
+ if (!e.length)
1288
+ return;
1289
+ const n = this.row1SideServices();
1290
+ if (!n.length)
1291
+ return;
1292
+ const o = n[Math.floor(Math.random() * n.length)], i = C(this, g, Le).call(this, e, o.service.id);
1293
+ if (i.length) {
1294
+ f(this, on, !0), C(this, g, ge).call(this, i);
1295
+ const O = i.length * ie + Dn + Nn + ae + 100;
1296
+ setTimeout(() => {
1297
+ f(this, on, !1);
1298
+ }, O);
1299
+ }
1300
+ }, /**
1301
+ * Pick a route starting from a side service (worker).
1302
+ * Uses worker's own glow-only depth-3 paths (invisible base, full path to target).
1303
+ * Optionally continues with depth-4 (LB → managed service).
1304
+ */
1305
+ Le = function(e, n) {
1306
+ const o = [], i = e.filter((s) => s.sourceNodeId === n && s.renderMode === "glow-only" && s.active);
1307
+ if (!i.length)
1308
+ return o;
1309
+ const O = C(this, g, Un).call(this, i);
1310
+ o.push(e.indexOf(O));
1311
+ const v = e.filter((s) => s.depth === O.depth + 1 && s.sourceNodeId === O.targetNodeId && s.active);
1312
+ if (v.length) {
1313
+ const s = C(this, g, Un).call(this, v);
1314
+ o.push(e.indexOf(s));
1315
+ }
1316
+ return o;
1317
+ }, Ae = function(e) {
1318
+ const n = [];
1319
+ let o = "endpoint";
1320
+ for (let i = 0; i <= 4; i++) {
1321
+ const O = e.filter((s) => s.depth === i && s.sourceNodeId === o && s.active);
1322
+ if (!O.length)
1323
+ break;
1324
+ const v = C(this, g, Un).call(this, O);
1325
+ n.push(e.indexOf(v)), o = v.targetNodeId;
1326
+ }
1327
+ return n;
1328
+ }, Un = function(e) {
1329
+ if (e.length === 1)
1330
+ return C(this, g, Jn).call(this, e[0]), e[0];
1331
+ const n = e.map((v) => {
1332
+ const s = `${v.targetNodeId}:${v.targetBarIndex}`;
1333
+ return 1 / ((d(this, rn).get(s) ?? 0) + 1);
1334
+ }), o = n.reduce((v, s) => v + s, 0);
1335
+ let i = Math.random() * o;
1336
+ for (let v = 0; v < e.length; v++)
1337
+ if (i -= n[v], i <= 0)
1338
+ return C(this, g, Jn).call(this, e[v]), e[v];
1339
+ const O = e.at(-1);
1340
+ return C(this, g, Jn).call(this, O), O;
1341
+ }, Jn = function(e) {
1342
+ const n = `${e.targetNodeId}:${e.targetBarIndex}`;
1343
+ d(this, rn).set(n, (d(this, rn).get(n) ?? 0) + 1);
1344
+ }, ge = function(e) {
1345
+ const n = this.annotatedPaths(), i = d(this, nn).nativeElement.querySelector(".__canvas"), O = i?.querySelector(":scope > .__svg-layer");
1346
+ if (!i || !O)
1347
+ return;
1348
+ const v = [], s = ++ye(this, Bn)._, D = [];
1349
+ e.forEach((E, a) => {
1350
+ const x = n[E], b = a * ie, w = O.querySelector(`[data-path-idx="${E}"]`);
1351
+ if (w) {
1352
+ const S = x.cachedLength ?? Math.ceil(w.getTotalLength());
1353
+ w.style.setProperty("--path-len", String(S)), D.push({
1354
+ el: w,
1355
+ classes: ["__path-glow--active", "__path-glow--decay"]
1356
+ }), v.push(setTimeout(() => {
1357
+ w.classList.add("__path-glow--active");
1358
+ }, b)), v.push(setTimeout(() => {
1359
+ w.classList.remove("__path-glow--active"), w.classList.add("__path-glow--decay");
1360
+ }, b + Dn + Nn)), v.push(setTimeout(() => {
1361
+ w.classList.remove("__path-glow--decay");
1362
+ }, b + Dn + Nn + ae));
1363
+ }
1364
+ const z = b + Dn * 0.85;
1365
+ if (x.targetBarIndex >= 0) {
1366
+ const A = i.querySelector(`[data-node-id="${x.targetNodeId}"]`)?.querySelectorAll("zui-bar-icon")[x.targetBarIndex];
1367
+ A && v.push(setTimeout(() => A.dispatchEvent(new CustomEvent("trace-pulse")), z));
1368
+ } else if (x.targetNodeId === "storage") {
1369
+ const S = i.querySelector('[data-node-id="storage"]');
1370
+ if (S) {
1371
+ const A = z + Nn;
1372
+ D.push({ el: S, classes: ["--pulse"] }), v.push(setTimeout(() => S.classList.add("--pulse"), z)), v.push(setTimeout(() => S.classList.remove("--pulse"), A));
1373
+ }
1374
+ }
1375
+ });
1376
+ const q = () => {
1377
+ v.forEach((E) => clearTimeout(E)), D.forEach(({ el: E, classes: a }) => E.classList.remove(...a));
1378
+ };
1379
+ d(this, an).set(s, q);
1380
+ const G = e.length * ie + Dn + Nn + ae + 100;
1381
+ v.push(setTimeout(() => {
1382
+ d(this, an).delete(s);
1383
+ }, G));
1384
+ }, vn.ɵfac = function(n) {
1385
+ return new (n || vn)();
1386
+ }, vn.ɵcmp = /* @__PURE__ */ Xn({ type: vn, selectors: [["zw-network-diagram"]], inputs: { config: [1, "config"], lightweight: [1, "lightweight"] }, decls: 26, vars: 6, consts: [[1, "__canvas"], ["data-node-id", "endpoint", 1, "__endpoint-row"], ["variant", "endpoint", 3, "label"], [3, "config", "showPaths", "lightweight"], [1, "__zone", "__zone--services"], [1, "__zone-label"], [1, "__services-content"], [1, "__services-row", "__services-row--top"], [1, "__services-side-nodes"], [1, "__services-spacer"], [1, "__services-row", "__services-row--bottom"], ["data-node-id", "storage", 1, "__external-node"], [1, "__svg-layer"], ["variant", "service", 3, "label", "containers", "barColor", "techIcon"], [1, "__compound"], [1, "__compound-lb"], ["variant", "service-highlighted", 3, "label", "containers", "barColor", "highlighted"], [1, "__compound-service"], ["variant", "external", 3, "label", "sublabel"], [1, "__path-base"], [1, "__path-glow"]], template: function(n, o) {
1387
+ if (n & 1 && (m(0, "div", 0)(1, "div", 1), u(2, "zw-diagram-node", 2), h(), m(3, "zw-project-shell", 3)(4, "div", 4)(5, "span", 5), N(6, "Your services"), u(7, "br"), N(8, "with system containers"), h(), m(9, "div", 6)(10, "div", 7), u(11, "div"), R(12, $t, 2, 5, "div", null, ce), W(14, zt, 3, 0, "div", 8)(15, Dt, 1, 0, "div"), h(), u(16, "div", 9), m(17, "div", 10), R(18, Et, 2, 1, null, null, ce), h()()()(), W(20, Rt, 2, 2, "div", 11), qn(), m(21, "svg", 12), R(22, At, 1, 1, null, null, re), R(24, Ft, 1, 1, null, null, re), h()()), n & 2) {
1388
+ let i;
1389
+ c(2), T("label", o.config().endpoint), c(), T("config", o.shellConfig())("showPaths", !1)("lightweight", o.lightweight()), c(9), L(o.row1MainServices()), c(2), V(o.row1SideServices().length ? 14 : 15), c(4), L(o.row2Services()), c(2), V((i = o.resolvedStorage()) ? 20 : -1, i), c(2), L(o.annotatedPaths()), c(2), L(o.annotatedPaths());
1390
+ }
1391
+ }, dependencies: [Qn, se], styles: [`[_nghost-%COMP%] {
1392
+ display: block;
1393
+ position: relative;
1394
+ width: 100%;
1395
+ overflow: visible;
1396
+ }
1397
+
1398
+ .__svg-layer[_ngcontent-%COMP%] {
1399
+ position: absolute;
1400
+ inset: 0;
1401
+ pointer-events: none;
1402
+ overflow: visible;
1403
+ contain: layout style;
1404
+ will-change: transform;
1405
+ }
1406
+
1407
+ .__path-base[_ngcontent-%COMP%] {
1408
+ fill: none;
1409
+ stroke: #C4C3C3;
1410
+ stroke-width: 2;
1411
+ stroke-linecap: round;
1412
+ stroke-linejoin: round;
1413
+ }
1414
+
1415
+ .__canvas[_ngcontent-%COMP%] {
1416
+ position: relative;
1417
+ z-index: 1;
1418
+ width: 680px;
1419
+ margin: 0 auto;
1420
+ transform: scale(var(--diagram-scale, 1));
1421
+ transform-origin: top center;
1422
+ display: flex;
1423
+ flex-direction: column;
1424
+ align-items: center;
1425
+ gap: 51px;
1426
+ overflow: visible;
1427
+ }
1428
+ @media (max-width: 1099px) {
1429
+ .__canvas[_ngcontent-%COMP%] {
1430
+ transform-origin: top left;
1431
+ margin-left: calc(50% - 340px * var(--diagram-scale, 1));
1432
+ margin-right: 0;
1433
+ }
1434
+ }
1435
+ @media (min-width: 1100px) and (max-width: 1439px) {
1436
+ .__canvas[_ngcontent-%COMP%] {
1437
+ transform-origin: top left;
1438
+ margin: 0;
1439
+ }
1440
+ }
1441
+
1442
+ .__endpoint-row[_ngcontent-%COMP%] {
1443
+ display: flex;
1444
+ justify-content: center;
1445
+ width: 100%;
1446
+ }
1447
+
1448
+ zw-project-shell[_ngcontent-%COMP%] {
1449
+ width: 100%;
1450
+ }
1451
+
1452
+ .__zone[_ngcontent-%COMP%] {
1453
+ position: relative;
1454
+ border-radius: 8px;
1455
+ background: rgba(232, 231, 231, 0.5);
1456
+ padding: 20px 14px;
1457
+ }
1458
+
1459
+ .__zone-label[_ngcontent-%COMP%] {
1460
+ position: absolute;
1461
+ top: 23px;
1462
+ left: 23px;
1463
+ font-family: var(--font-family-brand);
1464
+ font-weight: 600;
1465
+ font-size: 11px;
1466
+ line-height: 14px;
1467
+ letter-spacing: 0.12em;
1468
+ text-transform: uppercase;
1469
+ color: #254E4A;
1470
+ opacity: 0.6;
1471
+ font-variation-settings: "CRSV" 0, "SHRP" 100, "slnt" 0;
1472
+ }
1473
+
1474
+ .__zone--services[_ngcontent-%COMP%] > .__zone-label[_ngcontent-%COMP%] {
1475
+ max-width: 108px;
1476
+ }
1477
+
1478
+ .__services-content[_ngcontent-%COMP%] {
1479
+ display: flex;
1480
+ flex-direction: column;
1481
+ align-items: center;
1482
+ gap: 0;
1483
+ }
1484
+
1485
+ .__services-row[_ngcontent-%COMP%] {
1486
+ display: flex;
1487
+ justify-content: center;
1488
+ width: 100%;
1489
+ }
1490
+
1491
+ .__services-row--top[_ngcontent-%COMP%] {
1492
+ display: grid;
1493
+ grid-template-columns: 1fr auto 1fr;
1494
+ align-items: start;
1495
+ }
1496
+ .__services-row--top[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:last-child {
1497
+ justify-self: start;
1498
+ }
1499
+
1500
+ .__services-row--bottom[_ngcontent-%COMP%] {
1501
+ display: grid;
1502
+ grid-template-columns: 1fr auto 1fr;
1503
+ gap: 11px;
1504
+ align-items: start;
1505
+ justify-content: center;
1506
+ }
1507
+ .__services-row--bottom[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:first-child {
1508
+ justify-self: end;
1509
+ }
1510
+ .__services-row--bottom[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:last-child {
1511
+ justify-self: start;
1512
+ }
1513
+
1514
+ .__services-side-nodes[_ngcontent-%COMP%] {
1515
+ display: flex;
1516
+ gap: 19px;
1517
+ align-items: flex-start;
1518
+ margin-left: 38px;
1519
+ }
1520
+
1521
+ .__services-spacer[_ngcontent-%COMP%] {
1522
+ height: 51px;
1523
+ flex-shrink: 0;
1524
+ }
1525
+
1526
+ .__compound[_ngcontent-%COMP%] {
1527
+ position: relative;
1528
+ overflow: hidden;
1529
+ display: flex;
1530
+ flex-direction: column;
1531
+ align-items: center;
1532
+ background: #D8D7D7;
1533
+ border-radius: 8px;
1534
+ padding: 5px;
1535
+ padding-bottom: 20px;
1536
+ gap: 40px;
1537
+ min-width: 111px;
1538
+ }
1539
+
1540
+ .__external-node[_ngcontent-%COMP%] {
1541
+ position: absolute;
1542
+ right: -40px;
1543
+ top: 708px;
1544
+ }
1545
+
1546
+ .__path-glow[_ngcontent-%COMP%] {
1547
+ fill: none;
1548
+ stroke: var(--mat-sys-primary);
1549
+ stroke-width: 3;
1550
+ stroke-linecap: round;
1551
+ stroke-linejoin: round;
1552
+ opacity: 0;
1553
+ stroke-dasharray: var(--path-len, 300);
1554
+ stroke-dashoffset: var(--path-len, 300);
1555
+ pointer-events: none;
1556
+ }
1557
+
1558
+ .__path-glow--active[_ngcontent-%COMP%] {
1559
+ opacity: 0.55;
1560
+ stroke-dashoffset: 0;
1561
+ filter: drop-shadow(0 0 3px rgba(0, 164, 154, 0.3));
1562
+ transition: opacity 0.2s ease, stroke-dashoffset 600ms cubic-bezier(0.25, 0.1, 0.25, 1);
1563
+ }
1564
+ @media (max-width: 767px) {
1565
+ .__path-glow--active[_ngcontent-%COMP%] {
1566
+ filter: none;
1567
+ }
1568
+ }
1569
+
1570
+ .__path-glow--decay[_ngcontent-%COMP%] {
1571
+ opacity: 0;
1572
+ stroke-dashoffset: 0;
1573
+ filter: none;
1574
+ transition: opacity 0.9s ease-out;
1575
+ }
1576
+
1577
+ .__external-node.--pulse[_ngcontent-%COMP%] zw-diagram-node[_ngcontent-%COMP%] {
1578
+ filter: drop-shadow(0 0 6px rgba(0, 164, 154, 0.2));
1579
+ transition: filter 0.5s ease;
1580
+ }
1581
+ @media (max-width: 767px) {
1582
+ .__external-node.--pulse[_ngcontent-%COMP%] zw-diagram-node[_ngcontent-%COMP%] {
1583
+ filter: none;
1584
+ }
1585
+ }
1586
+
1587
+ .__external-node[_ngcontent-%COMP%]:not(.--pulse) zw-diagram-node[_ngcontent-%COMP%] {
1588
+ filter: none;
1589
+ transition: filter 0.6s ease-out;
1590
+ }
1591
+
1592
+ @media (prefers-reduced-motion: reduce) {
1593
+ .__path-glow[_ngcontent-%COMP%] {
1594
+ display: none;
1595
+ }
1596
+ }`], changeDetection: 0 });
1597
+ let le = vn;
1598
+ function Ie(t) {
1599
+ const e = t.hostname || t.name, n = t.ports?.[0]?.port;
1600
+ return n ? `${e}:${n}` : e;
1601
+ }
1602
+ function Ht(t) {
1603
+ return t ? Se[t]?.horizontal === !0 : !1;
1604
+ }
1605
+ const Ut = /* @__PURE__ */ new Set(["postgresql", "mariadb", "mongodb", "clickhouse"]);
1606
+ function Jt(t) {
1607
+ const e = t.findIndex((O) => O.techIcon && Ut.has(O.techIcon));
1608
+ if (e < 0)
1609
+ return t;
1610
+ const n = Math.floor(t.length / 2);
1611
+ if (e === n)
1612
+ return t;
1613
+ const o = [...t], [i] = o.splice(e, 1);
1614
+ return o.splice(n, 0, i), o;
1615
+ }
1616
+ function Yt(t) {
1617
+ const e = t._servicesExtended ?? t.services ?? [];
1618
+ let n = !1;
1619
+ const o = [], i = [];
1620
+ let O = !1, v;
1621
+ for (const s of e) {
1622
+ if (s.category === "CORE")
1623
+ continue;
1624
+ if (s.category === "OBJECT_STORAGE") {
1625
+ O = !0, v = s;
1626
+ continue;
1627
+ }
1628
+ const D = Ve(s), q = Ze(s.typeId, D, s.autoscaling?.horizontalAutoscaling?.minContainerCount || 1), G = s.typeId ? Se[s.typeId]?.HAContainers : void 0, E = D === "HA" && (G?.freeContainers ?? 0) > 0, a = {
1629
+ id: s.hostname || s.name,
1630
+ label: Ie(s),
1631
+ containers: { active: q, standby: 0 },
1632
+ techIcon: s.typeId,
1633
+ ...E ? {
1634
+ hasLoadBalancer: !0,
1635
+ loadBalancer: {
1636
+ containers: { active: G.freeContainers, standby: 0 }
1637
+ }
1638
+ } : {}
1639
+ };
1640
+ if (Ht(s.typeId)) {
1641
+ const x = n ? "side-runtime" : "http-runtime";
1642
+ n || (n = !0), o.push({ ...a, category: x });
1643
+ } else
1644
+ i.push({ ...a, category: "managed" });
1645
+ }
1646
+ return {
1647
+ ...ze,
1648
+ services: [...o, ...Jt(i)],
1649
+ ...O && v ? {
1650
+ storage: {
1651
+ label: "Object storage",
1652
+ sublabel: Ie(v)
1653
+ }
1654
+ } : {}
1655
+ };
1656
+ }
1657
+ function Qt(t, e) {
1658
+ t & 1 && u(0, "div", 1);
1659
+ }
1660
+ function Xt(t, e) {
1661
+ if (t & 1 && (m(0, "div", 2), N(1), h()), t & 2) {
1662
+ const n = P();
1663
+ c(), Pe("Could not load recipe “", n.slug() || "unknown", "”.");
1664
+ }
1665
+ }
1666
+ function Kt(t, e) {
1667
+ if (t & 1 && u(0, "zw-network-diagram", 3), t & 2) {
1668
+ const n = P();
1669
+ T("config", e)("lightweight", n.lightweight());
1670
+ }
1671
+ }
1672
+ var Fn, Tn, $n, jn;
1673
+ const bn = class bn {
1674
+ constructor() {
1675
+ $(this, Fn);
1676
+ $(this, Tn);
1677
+ $(this, $n);
1678
+ $(this, jn);
1679
+ this.slug = k(), this.recipeData = k(void 0, { transform: (e) => {
1680
+ if (typeof e != "string")
1681
+ return e ?? void 0;
1682
+ if (e.trim())
1683
+ try {
1684
+ return JSON.parse(e);
1685
+ } catch {
1686
+ return;
1687
+ }
1688
+ } }), this.environment = k("highly-available-production"), this.mode = k("auto"), this.apiBase = k("https://api.zerops.io"), f(this, Fn, Ln(Ke)), this.recipe = xn(null), this.loading = xn(!0), this.error = xn(!1), f(this, Tn, j(() => {
1689
+ const e = this.recipe();
1690
+ if (!e)
1691
+ return;
1692
+ const n = e._environmentsExtended || [];
1693
+ return n.find((o) => o._key === this.environment()) ?? He(n) ?? void 0;
1694
+ })), this.diagramConfig = j(() => {
1695
+ const e = d(this, Tn).call(this);
1696
+ return e ? Yt(e) : void 0;
1697
+ }), this.lightweight = j(() => {
1698
+ const e = this.mode();
1699
+ if (e === "lightweight")
1700
+ return !0;
1701
+ if (e === "serious")
1702
+ return !1;
1703
+ const n = d(this, Tn).call(this);
1704
+ return n ? Ue(n._servicesExtended) === "LIGHT" : !1;
1705
+ }), f(this, $n, new Je()), f(this, jn, Ye(d(this, $n).pipe(Qe((e) => nt(d(this, Fn), this.apiBase(), e))))), Yn(() => {
1706
+ const e = this.recipeData(), n = this.slug();
1707
+ if (e) {
1708
+ const o = Xe(e);
1709
+ this.loading.set(!1), this.error.set(o.error), this.recipe.set(o.recipe);
1710
+ } else n && (this.loading.set(!0), this.error.set(!1), this.recipe.set(null), d(this, $n).next(n));
1711
+ }), Yn(() => {
1712
+ const e = d(this, jn).call(this);
1713
+ e && (this.loading.set(!1), this.error.set(e.error), this.recipe.set(e.recipe));
1714
+ });
1715
+ }
1716
+ };
1717
+ Fn = new WeakMap(), Tn = new WeakMap(), $n = new WeakMap(), jn = new WeakMap(), bn.ɵfac = function(n) {
1718
+ return new (n || bn)();
1719
+ }, bn.ɵcmp = /* @__PURE__ */ Xn({ type: bn, selectors: [["zwe-network-diagram-element"]], inputs: { slug: [1, "slug"], recipeData: [1, "recipeData"], environment: [1, "environment"], mode: [1, "mode"], apiBase: [1, "apiBase"] }, decls: 4, vars: 1, consts: [[1, "zerops"], ["aria-hidden", "true", 1, "__skeleton"], [1, "__error"], [3, "config", "lightweight"]], template: function(n, o) {
1720
+ if (n & 1 && (m(0, "div", 0), W(1, Qt, 1, 0, "div", 1)(2, Xt, 2, 1, "div", 2)(3, Kt, 1, 2, "zw-network-diagram", 3), h()), n & 2) {
1721
+ let i;
1722
+ c(), V(o.loading() ? 1 : o.error() ? 2 : (i = o.diagramConfig()) ? 3 : -1, i);
1723
+ }
1724
+ }, dependencies: [le], styles: [`[_nghost-%COMP%] { display: block; }
1725
+
1726
+ .__skeleton[_ngcontent-%COMP%] {
1727
+ height: 420px;
1728
+ border-radius: 12px;
1729
+ background: var(--mat-sys-surface-container);
1730
+ animation: _ngcontent-%COMP%_zwe-nd-pulse 1.4s ease-in-out infinite;
1731
+ }
1732
+ @keyframes _ngcontent-%COMP%_zwe-nd-pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 0.3; } }
1733
+
1734
+ .__error[_ngcontent-%COMP%] {
1735
+ padding: 16px 20px;
1736
+ border-radius: 12px;
1737
+ background: var(--mat-sys-error-container);
1738
+ color: var(--mat-sys-on-error-container);
1739
+ font-size: 14px;
1740
+ }`], changeDetection: 0 });
1741
+ let _e = bn;
1742
+ et().then((t) => {
1743
+ customElements.get("zerops-network-diagram") || customElements.define("zerops-network-diagram", tt(_e, { injector: t.injector }));
1744
+ });