@arach/arc-iso 0.4.4

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,709 @@
1
+ import yt, { useState as ot, useEffect as $t } from "react";
2
+ const ht = 30 * (Math.PI / 180), kt = Math.cos(ht), vt = Math.sin(ht);
3
+ function l(e, s, a = 0) {
4
+ return {
5
+ screenX: (e - s) * kt,
6
+ screenY: -(e + s) * vt - a
7
+ // Negated so +X,+Y go UP on screen
8
+ };
9
+ }
10
+ function K(e, s, a, f = 0, o = 0, x = 0) {
11
+ const y = {
12
+ // Bottom face
13
+ frontBottom: l(e, 0, 0),
14
+ rightBottom: l(e, s, 0),
15
+ backBottom: l(0, s, 0),
16
+ leftBottom: l(0, 0, 0),
17
+ // Top face
18
+ frontTop: l(e, 0, a),
19
+ rightTop: l(e, s, a),
20
+ backTop: l(0, s, a),
21
+ leftTop: l(0, 0, a)
22
+ }, _ = (g) => ({
23
+ x: g.screenX + f,
24
+ y: g.screenY + o
25
+ }), k = Object.fromEntries(
26
+ Object.entries(y).map(([g, j]) => [g, _(j)])
27
+ ), A = (g, j, S, b) => {
28
+ if (b <= 0) {
29
+ const $ = l(0, 0, S), i = l(g, 0, S), u = l(g, j, S), C = l(0, j, S);
30
+ return `M ${$.screenX + f},${$.screenY + o} L ${i.screenX + f},${i.screenY + o} L ${u.screenX + f},${u.screenY + o} L ${C.screenX + f},${C.screenY + o} Z`;
31
+ }
32
+ const L = Math.min(g, j) / 2, M = Math.min(b, L), v = 8, E = [], X = ($, i, u, C) => {
33
+ for (let P = 0; P <= v; P++) {
34
+ const z = u + (C - u) * (P / v), V = $ + M * Math.cos(z), t = i + M * Math.sin(z), c = l(V, t, S);
35
+ E.push(`${c.screenX + f},${c.screenY + o}`);
36
+ }
37
+ };
38
+ return X(M, M, Math.PI, Math.PI * 1.5), X(g - M, M, Math.PI * 1.5, Math.PI * 2), X(g - M, j - M, 0, Math.PI * 0.5), X(M, j - M, Math.PI * 0.5, Math.PI), `M ${E[0]} L ${E.slice(1).join(" L ")} Z`;
39
+ }, h = (g) => `M ${g.map((j) => `${j.x},${j.y}`).join(" L ")} Z`, I = (g, j, S, b, L, M) => {
40
+ const E = [];
41
+ for (let u = 0; u < 6; u++) {
42
+ const C = L + (M - L) * (u / 6), P = L + (M - L) * ((u + 1) / 6), z = (C + P) / 2, V = Math.cos(z), t = Math.sin(z), T = V * -0.577 + t * -0.577 + 0 * 0.577, H = 0.3 + Math.max(0, T + 0.4) * 0.5, G = l(g + S * Math.cos(C), j + S * Math.sin(C), 0), R = l(g + S * Math.cos(P), j + S * Math.sin(P), 0), p = l(g + S * Math.cos(C), j + S * Math.sin(C), b), Y = l(g + S * Math.cos(P), j + S * Math.sin(P), b), Q = `M ${G.screenX + f},${G.screenY + o} L ${R.screenX + f},${R.screenY + o} L ${Y.screenX + f},${Y.screenY + o} L ${p.screenX + f},${p.screenY + o} Z`;
43
+ E.push({ path: Q, intensity: H });
44
+ }
45
+ return E;
46
+ }, d = Math.min(x, Math.min(e, s) / 2), n = A(e, s, a, d);
47
+ let m, w, N, F, Z, B;
48
+ if (d > 0) {
49
+ const g = [
50
+ { x: l(0, d, 0).screenX + f, y: l(0, d, 0).screenY + o },
51
+ { x: l(0, s - d, 0).screenX + f, y: l(0, s - d, 0).screenY + o },
52
+ { x: l(0, s - d, a).screenX + f, y: l(0, s - d, a).screenY + o },
53
+ { x: l(0, d, a).screenX + f, y: l(0, d, a).screenY + o }
54
+ ];
55
+ m = h(g);
56
+ const j = [
57
+ { x: l(d, 0, 0).screenX + f, y: l(d, 0, 0).screenY + o },
58
+ { x: l(e - d, 0, 0).screenX + f, y: l(e - d, 0, 0).screenY + o },
59
+ { x: l(e - d, 0, a).screenX + f, y: l(e - d, 0, a).screenY + o },
60
+ { x: l(d, 0, a).screenX + f, y: l(d, 0, a).screenY + o }
61
+ ];
62
+ w = h(j), N = I(d, d, d, a, Math.PI, Math.PI * 1.5), F = I(e - d, d, d, a, Math.PI * 1.5, Math.PI * 2), Z = I(d, s - d, d, a, Math.PI * 0.5, Math.PI), B = I(e - d, s - d, d, a, 0, Math.PI * 0.5);
63
+ } else {
64
+ const g = [k.leftBottom, k.backBottom, k.backTop, k.leftTop], j = [k.leftBottom, k.frontBottom, k.frontTop, k.leftTop];
65
+ m = h(g), w = h(j), N = [], F = [], Z = [], B = [];
66
+ }
67
+ const q = `M ${k.leftBottom.x},${k.leftBottom.y} L ${k.frontBottom.x},${k.frontBottom.y} L ${k.rightBottom.x},${k.rightBottom.y} L ${k.backBottom.x},${k.backBottom.y} Z`;
68
+ return {
69
+ top: n,
70
+ left: m,
71
+ right: w,
72
+ cornerFrontLeft: N,
73
+ cornerFrontRight: F,
74
+ cornerBackLeft: Z,
75
+ cornerBackRight: B,
76
+ outline: q
77
+ };
78
+ }
79
+ function gt(e, s = 60, a = 50) {
80
+ return {
81
+ top: `hsl(${e}, ${s}%, ${Math.min(a + 15, 95)}%)`,
82
+ right: `hsl(${e}, ${s}%, ${a}%)`,
83
+ left: `hsl(${e}, ${s}%, ${Math.max(a - 15, 15)}%)`
84
+ };
85
+ }
86
+ const it = {
87
+ violet: { hue: 270, saturation: 60, lightness: 55 },
88
+ blue: { hue: 220, saturation: 70, lightness: 50 },
89
+ cyan: { hue: 190, saturation: 80, lightness: 45 },
90
+ emerald: { hue: 155, saturation: 65, lightness: 45 },
91
+ amber: { hue: 40, saturation: 90, lightness: 50 },
92
+ rose: { hue: 350, saturation: 70, lightness: 55 },
93
+ slate: { hue: 220, saturation: 15, lightness: 50 },
94
+ zinc: { hue: 240, saturation: 5, lightness: 50 }
95
+ };
96
+ function At(e) {
97
+ const s = it[e] || it.slate;
98
+ return gt(s.hue, s.saturation, s.lightness);
99
+ }
100
+ var rt = { exports: {} }, tt = {};
101
+ var ft;
102
+ function jt() {
103
+ if (ft) return tt;
104
+ ft = 1;
105
+ var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), s = /* @__PURE__ */ Symbol.for("react.fragment");
106
+ function a(f, o, x) {
107
+ var y = null;
108
+ if (x !== void 0 && (y = "" + x), o.key !== void 0 && (y = "" + o.key), "key" in o) {
109
+ x = {};
110
+ for (var _ in o)
111
+ _ !== "key" && (x[_] = o[_]);
112
+ } else x = o;
113
+ return o = x.ref, {
114
+ $$typeof: e,
115
+ type: f,
116
+ key: y,
117
+ ref: o !== void 0 ? o : null,
118
+ props: x
119
+ };
120
+ }
121
+ return tt.Fragment = s, tt.jsx = a, tt.jsxs = a, tt;
122
+ }
123
+ var et = {};
124
+ var dt;
125
+ function _t() {
126
+ return dt || (dt = 1, process.env.NODE_ENV !== "production" && (function() {
127
+ function e(t) {
128
+ if (t == null) return null;
129
+ if (typeof t == "function")
130
+ return t.$$typeof === v ? null : t.displayName || t.name || null;
131
+ if (typeof t == "string") return t;
132
+ switch (t) {
133
+ case N:
134
+ return "Fragment";
135
+ case Z:
136
+ return "Profiler";
137
+ case F:
138
+ return "StrictMode";
139
+ case j:
140
+ return "Suspense";
141
+ case S:
142
+ return "SuspenseList";
143
+ case M:
144
+ return "Activity";
145
+ }
146
+ if (typeof t == "object")
147
+ switch (typeof t.tag == "number" && console.error(
148
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
149
+ ), t.$$typeof) {
150
+ case w:
151
+ return "Portal";
152
+ case q:
153
+ return t.displayName || "Context";
154
+ case B:
155
+ return (t._context.displayName || "Context") + ".Consumer";
156
+ case g:
157
+ var c = t.render;
158
+ return t = t.displayName, t || (t = c.displayName || c.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
159
+ case b:
160
+ return c = t.displayName || null, c !== null ? c : e(t.type) || "Memo";
161
+ case L:
162
+ c = t._payload, t = t._init;
163
+ try {
164
+ return e(t(c));
165
+ } catch {
166
+ }
167
+ }
168
+ return null;
169
+ }
170
+ function s(t) {
171
+ return "" + t;
172
+ }
173
+ function a(t) {
174
+ try {
175
+ s(t);
176
+ var c = !1;
177
+ } catch {
178
+ c = !0;
179
+ }
180
+ if (c) {
181
+ c = console;
182
+ var T = c.error, O = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
183
+ return T.call(
184
+ c,
185
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
186
+ O
187
+ ), s(t);
188
+ }
189
+ }
190
+ function f(t) {
191
+ if (t === N) return "<>";
192
+ if (typeof t == "object" && t !== null && t.$$typeof === L)
193
+ return "<...>";
194
+ try {
195
+ var c = e(t);
196
+ return c ? "<" + c + ">" : "<...>";
197
+ } catch {
198
+ return "<...>";
199
+ }
200
+ }
201
+ function o() {
202
+ var t = E.A;
203
+ return t === null ? null : t.getOwner();
204
+ }
205
+ function x() {
206
+ return Error("react-stack-top-frame");
207
+ }
208
+ function y(t) {
209
+ if (X.call(t, "key")) {
210
+ var c = Object.getOwnPropertyDescriptor(t, "key").get;
211
+ if (c && c.isReactWarning) return !1;
212
+ }
213
+ return t.key !== void 0;
214
+ }
215
+ function _(t, c) {
216
+ function T() {
217
+ u || (u = !0, console.error(
218
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
219
+ c
220
+ ));
221
+ }
222
+ T.isReactWarning = !0, Object.defineProperty(t, "key", {
223
+ get: T,
224
+ configurable: !0
225
+ });
226
+ }
227
+ function k() {
228
+ var t = e(this.type);
229
+ return C[t] || (C[t] = !0, console.error(
230
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
231
+ )), t = this.props.ref, t !== void 0 ? t : null;
232
+ }
233
+ function A(t, c, T, O, H, G) {
234
+ var R = T.ref;
235
+ return t = {
236
+ $$typeof: m,
237
+ type: t,
238
+ key: c,
239
+ props: T,
240
+ _owner: O
241
+ }, (R !== void 0 ? R : null) !== null ? Object.defineProperty(t, "ref", {
242
+ enumerable: !1,
243
+ get: k
244
+ }) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
245
+ configurable: !1,
246
+ enumerable: !1,
247
+ writable: !0,
248
+ value: 0
249
+ }), Object.defineProperty(t, "_debugInfo", {
250
+ configurable: !1,
251
+ enumerable: !1,
252
+ writable: !0,
253
+ value: null
254
+ }), Object.defineProperty(t, "_debugStack", {
255
+ configurable: !1,
256
+ enumerable: !1,
257
+ writable: !0,
258
+ value: H
259
+ }), Object.defineProperty(t, "_debugTask", {
260
+ configurable: !1,
261
+ enumerable: !1,
262
+ writable: !0,
263
+ value: G
264
+ }), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
265
+ }
266
+ function h(t, c, T, O, H, G) {
267
+ var R = c.children;
268
+ if (R !== void 0)
269
+ if (O)
270
+ if ($(R)) {
271
+ for (O = 0; O < R.length; O++)
272
+ I(R[O]);
273
+ Object.freeze && Object.freeze(R);
274
+ } else
275
+ console.error(
276
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
277
+ );
278
+ else I(R);
279
+ if (X.call(c, "key")) {
280
+ R = e(t);
281
+ var p = Object.keys(c).filter(function(Q) {
282
+ return Q !== "key";
283
+ });
284
+ O = 0 < p.length ? "{key: someKey, " + p.join(": ..., ") + ": ...}" : "{key: someKey}", V[R + O] || (p = 0 < p.length ? "{" + p.join(": ..., ") + ": ...}" : "{}", console.error(
285
+ `A props object containing a "key" prop is being spread into JSX:
286
+ let props = %s;
287
+ <%s {...props} />
288
+ React keys must be passed directly to JSX without using spread:
289
+ let props = %s;
290
+ <%s key={someKey} {...props} />`,
291
+ O,
292
+ R,
293
+ p,
294
+ R
295
+ ), V[R + O] = !0);
296
+ }
297
+ if (R = null, T !== void 0 && (a(T), R = "" + T), y(c) && (a(c.key), R = "" + c.key), "key" in c) {
298
+ T = {};
299
+ for (var Y in c)
300
+ Y !== "key" && (T[Y] = c[Y]);
301
+ } else T = c;
302
+ return R && _(
303
+ T,
304
+ typeof t == "function" ? t.displayName || t.name || "Unknown" : t
305
+ ), A(
306
+ t,
307
+ R,
308
+ T,
309
+ o(),
310
+ H,
311
+ G
312
+ );
313
+ }
314
+ function I(t) {
315
+ d(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === L && (t._payload.status === "fulfilled" ? d(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
316
+ }
317
+ function d(t) {
318
+ return typeof t == "object" && t !== null && t.$$typeof === m;
319
+ }
320
+ var n = yt, m = /* @__PURE__ */ Symbol.for("react.transitional.element"), w = /* @__PURE__ */ Symbol.for("react.portal"), N = /* @__PURE__ */ Symbol.for("react.fragment"), F = /* @__PURE__ */ Symbol.for("react.strict_mode"), Z = /* @__PURE__ */ Symbol.for("react.profiler"), B = /* @__PURE__ */ Symbol.for("react.consumer"), q = /* @__PURE__ */ Symbol.for("react.context"), g = /* @__PURE__ */ Symbol.for("react.forward_ref"), j = /* @__PURE__ */ Symbol.for("react.suspense"), S = /* @__PURE__ */ Symbol.for("react.suspense_list"), b = /* @__PURE__ */ Symbol.for("react.memo"), L = /* @__PURE__ */ Symbol.for("react.lazy"), M = /* @__PURE__ */ Symbol.for("react.activity"), v = /* @__PURE__ */ Symbol.for("react.client.reference"), E = n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, X = Object.prototype.hasOwnProperty, $ = Array.isArray, i = console.createTask ? console.createTask : function() {
321
+ return null;
322
+ };
323
+ n = {
324
+ react_stack_bottom_frame: function(t) {
325
+ return t();
326
+ }
327
+ };
328
+ var u, C = {}, P = n.react_stack_bottom_frame.bind(
329
+ n,
330
+ x
331
+ )(), z = i(f(x)), V = {};
332
+ et.Fragment = N, et.jsx = function(t, c, T) {
333
+ var O = 1e4 > E.recentlyCreatedOwnerStacks++;
334
+ return h(
335
+ t,
336
+ c,
337
+ T,
338
+ !1,
339
+ O ? Error("react-stack-top-frame") : P,
340
+ O ? i(f(t)) : z
341
+ );
342
+ }, et.jsxs = function(t, c, T) {
343
+ var O = 1e4 > E.recentlyCreatedOwnerStacks++;
344
+ return h(
345
+ t,
346
+ c,
347
+ T,
348
+ !0,
349
+ O ? Error("react-stack-top-frame") : P,
350
+ O ? i(f(t)) : z
351
+ );
352
+ };
353
+ })()), et;
354
+ }
355
+ var pt;
356
+ function Et() {
357
+ return pt || (pt = 1, process.env.NODE_ENV === "production" ? rt.exports = jt() : rt.exports = _t()), rt.exports;
358
+ }
359
+ var r = Et();
360
+ const bt = '"JetBrains Mono", "Fira Code", "SF Mono", Consolas, monospace', Tt = {
361
+ blue: { top: "#3b82f6", side: "#2563eb", front: "#1d4ed8" },
362
+ violet: { top: "#8b5cf6", side: "#7c3aed", front: "#6d28d9" },
363
+ cyan: { top: "#06b6d4", side: "#0891b2", front: "#0e7490" },
364
+ emerald: { top: "#10b981", side: "#059669", front: "#047857" },
365
+ amber: { top: "#f59e0b", side: "#d97706", front: "#b45309" },
366
+ rose: { top: "#f43f5e", side: "#e11d48", front: "#be123c" },
367
+ slate: { top: "#475569", side: "#334155", front: "#1e293b" }
368
+ }, Rt = {
369
+ blue: { top: "#93c5fd", side: "#60a5fa", front: "#3b82f6" },
370
+ violet: { top: "#c4b5fd", side: "#a78bfa", front: "#8b5cf6" },
371
+ cyan: { top: "#67e8f9", side: "#22d3ee", front: "#06b6d4" },
372
+ emerald: { top: "#6ee7b7", side: "#34d399", front: "#10b981" },
373
+ amber: { top: "#fcd34d", side: "#fbbf24", front: "#f59e0b" },
374
+ rose: { top: "#fda4af", side: "#fb7185", front: "#f43f5e" },
375
+ slate: { top: "#e2e8f0", side: "#cbd5e1", front: "#94a3b8" }
376
+ };
377
+ function st(e, s, a) {
378
+ const f = (A) => {
379
+ const h = A.replace("#", "");
380
+ return {
381
+ r: parseInt(h.substring(0, 2), 16),
382
+ g: parseInt(h.substring(2, 4), 16),
383
+ b: parseInt(h.substring(4, 6), 16)
384
+ };
385
+ }, o = f(e), x = f(s), y = Math.round(o.r + (x.r - o.r) * a), _ = Math.round(o.g + (x.g - o.g) * a), k = Math.round(o.b + (x.b - o.b) * a);
386
+ return `rgb(${y},${_},${k})`;
387
+ }
388
+ function wt({ x: e, y: s, z: a, children: f, fontSize: o = 8, color: x = "#1e293b", shadow: y }) {
389
+ const _ = l(e, s, a);
390
+ return /* @__PURE__ */ r.jsx("g", { transform: `translate(${_.screenX}, ${_.screenY})`, filter: y, children: /* @__PURE__ */ r.jsx("g", { transform: "matrix(0.866, -0.5, 0.866, 0.5, 0, 0)", children: /* @__PURE__ */ r.jsx(
391
+ "text",
392
+ {
393
+ x: 0,
394
+ y: 0,
395
+ textAnchor: "middle",
396
+ fill: x,
397
+ fontSize: o,
398
+ fontWeight: 600,
399
+ fontFamily: bt,
400
+ style: { textTransform: "uppercase", letterSpacing: "0.06em" },
401
+ children: f
402
+ }
403
+ ) }) });
404
+ }
405
+ function Ot({ width: e, depth: s, elevation: a, color: f, opacity: o, borderColor: x, theme: y, isGround: _ }) {
406
+ const A = K(e, s, _ ? 8 : 2, 0, 0), h = l(0, 0, a);
407
+ return /* @__PURE__ */ r.jsxs("g", { transform: `translate(${h.screenX}, ${h.screenY})`, children: [
408
+ _ && /* @__PURE__ */ r.jsx("g", { transform: "translate(4, 4)", opacity: 0.2, children: /* @__PURE__ */ r.jsx("path", { d: A.top, fill: "#000" }) }),
409
+ /* @__PURE__ */ r.jsx("path", { d: A.top, fill: f, opacity: o }),
410
+ _ && /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
411
+ /* @__PURE__ */ r.jsx("path", { d: A.left, fill: y === "dark" ? "#0f172a" : "#cbd5e1", opacity: 0.8 }),
412
+ /* @__PURE__ */ r.jsx("path", { d: A.right, fill: y === "dark" ? "#1e293b" : "#94a3b8", opacity: 0.8 })
413
+ ] }),
414
+ /* @__PURE__ */ r.jsx(
415
+ "path",
416
+ {
417
+ d: A.top,
418
+ fill: "none",
419
+ stroke: x || (y === "dark" ? "#475569" : "#94a3b8"),
420
+ strokeWidth: _ ? 1.5 : 0.75,
421
+ opacity: _ ? 1 : 0.6
422
+ }
423
+ )
424
+ ] });
425
+ }
426
+ function Lt({ config: e, options: s = {}, className: a, style: f, onNodeClick: o, onLayerClick: x }) {
427
+ const { interactive: y = !0, animate: _ = !0, showLabels: k = !0, expandOnHover: A = !0 } = s, { theme: h, canvas: I, origin: d, tiers: n, floorSize: m, nodes: w, cornerRadius: N = 0 } = e, F = h === "dark" ? Tt : Rt, Z = h === "dark" ? "#0f172a" : "#fafafa", B = h === "dark" ? "#e2e8f0" : "#1e293b", q = h === "dark" ? "#64748b" : "#94a3b8", [g, j] = ot(/* @__PURE__ */ new Set());
428
+ $t(() => {
429
+ _ ? (j(/* @__PURE__ */ new Set()), n.forEach(($, i) => {
430
+ setTimeout(() => {
431
+ j((u) => /* @__PURE__ */ new Set([...u, i]));
432
+ }, i * 150 + 100);
433
+ })) : j(new Set(n.map(($, i) => i)));
434
+ }, [e.id, _, n.length]);
435
+ const [S, b] = ot(null), [L, M] = ot(null), [v, E] = ot(null), X = [...w].sort(($, i) => {
436
+ const u = n[$.tier]?.elevation || 0, C = n[i.tier]?.elevation || 0;
437
+ if (u !== C) return u - C;
438
+ const P = $.x + $.width + ($.y + $.depth);
439
+ return i.x + i.width + (i.y + i.depth) - P;
440
+ });
441
+ return /* @__PURE__ */ r.jsx("div", { className: a, style: { display: "inline-block", ...f }, children: /* @__PURE__ */ r.jsxs(
442
+ "svg",
443
+ {
444
+ width: I.width,
445
+ height: I.height,
446
+ style: { backgroundColor: Z },
447
+ onClick: () => {
448
+ y && (E(null), M(null));
449
+ },
450
+ children: [
451
+ /* @__PURE__ */ r.jsxs("defs", { children: [
452
+ /* @__PURE__ */ r.jsx("pattern", { id: `grid-${e.id}`, width: "24", height: "24", patternUnits: "userSpaceOnUse", children: /* @__PURE__ */ r.jsx("circle", { cx: "12", cy: "12", r: "0.5", fill: h === "dark" ? "#1e293b" : "#e2e8f0" }) }),
453
+ /* @__PURE__ */ r.jsx("filter", { id: `glow-${e.id}`, x: "-20%", y: "-20%", width: "140%", height: "140%", children: /* @__PURE__ */ r.jsx(
454
+ "feDropShadow",
455
+ {
456
+ dx: "0",
457
+ dy: "4",
458
+ stdDeviation: "8",
459
+ floodColor: h === "dark" ? "#60a5fa" : "#3b82f6",
460
+ floodOpacity: "0.3"
461
+ }
462
+ ) }),
463
+ /* @__PURE__ */ r.jsxs("radialGradient", { id: `bg-${e.id}`, cx: "48%", cy: "34%", r: "82%", children: [
464
+ /* @__PURE__ */ r.jsx("stop", { offset: "0%", stopColor: h === "dark" ? "#16203a" : "#ffffff" }),
465
+ /* @__PURE__ */ r.jsx("stop", { offset: "55%", stopColor: h === "dark" ? "#0e1526" : "#f2f5f9" }),
466
+ /* @__PURE__ */ r.jsx("stop", { offset: "100%", stopColor: h === "dark" ? "#080d18" : "#e7ecf2" })
467
+ ] }),
468
+ /* @__PURE__ */ r.jsx("filter", { id: `contact-${e.id}`, x: "-60%", y: "-60%", width: "220%", height: "220%", children: /* @__PURE__ */ r.jsx("feGaussianBlur", { stdDeviation: "5" }) }),
469
+ /* @__PURE__ */ r.jsxs("linearGradient", { id: `sheen-${e.id}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
470
+ /* @__PURE__ */ r.jsx("stop", { offset: "0%", stopColor: "#ffffff", stopOpacity: "0.18" }),
471
+ /* @__PURE__ */ r.jsx("stop", { offset: "55%", stopColor: "#ffffff", stopOpacity: "0.04" }),
472
+ /* @__PURE__ */ r.jsx("stop", { offset: "100%", stopColor: "#ffffff", stopOpacity: "0" })
473
+ ] }),
474
+ /* @__PURE__ */ r.jsxs("linearGradient", { id: `shade-${e.id}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
475
+ /* @__PURE__ */ r.jsx("stop", { offset: "0%", stopColor: "#000000", stopOpacity: "0" }),
476
+ /* @__PURE__ */ r.jsx("stop", { offset: "100%", stopColor: "#000000", stopOpacity: "0.24" })
477
+ ] }),
478
+ /* @__PURE__ */ r.jsx("filter", { id: `label-${e.id}`, x: "-40%", y: "-40%", width: "180%", height: "180%", children: /* @__PURE__ */ r.jsx("feDropShadow", { dx: "0", dy: "0.5", stdDeviation: "0.7", floodColor: "#000000", floodOpacity: "0.7" }) })
479
+ ] }),
480
+ /* @__PURE__ */ r.jsx("rect", { width: "100%", height: "100%", fill: `url(#bg-${e.id})` }),
481
+ /* @__PURE__ */ r.jsx("rect", { width: "100%", height: "100%", fill: `url(#grid-${e.id})`, opacity: "0.5" }),
482
+ /* @__PURE__ */ r.jsx("g", { transform: `translate(${d.x}, ${d.y})`, children: n.map(($, i) => {
483
+ const u = X.filter((p) => p.tier === i), C = g.has(i), P = y && (L === i || L === null && v === null && S === i), z = y && (L !== null || S !== null || v !== null), V = v?.tier === i, t = z && !P && !V, c = C ? 0 : 60, T = C ? 1 : 0, O = P && A ? { x: 10, y: -34 } : { x: 0, y: 0 }, H = P ? 1.03 : 1, G = l(m.width / 2, m.depth / 2, $.elevation), R = $.offset || { x: 0, y: 0 };
484
+ return /* @__PURE__ */ r.jsxs(
485
+ "g",
486
+ {
487
+ "data-tier": i,
488
+ onMouseEnter: () => y && b(i),
489
+ onMouseLeave: () => y && b(null),
490
+ onClick: (p) => {
491
+ y && (p.stopPropagation(), E(null), M((Y) => Y === i ? null : i), x?.(i));
492
+ },
493
+ style: {
494
+ transform: `translate(${R.x + O.x}px, ${R.y + O.y}px) translate(${G.screenX}px, ${G.screenY + c}px) scale(${H}) translate(${-G.screenX}px, ${-G.screenY}px)`,
495
+ transition: "transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease-out",
496
+ opacity: T * (t ? 0.35 : 1),
497
+ filter: P ? `url(#glow-${e.id})` : "none",
498
+ cursor: y ? "pointer" : "default"
499
+ },
500
+ children: [
501
+ /* @__PURE__ */ r.jsx(
502
+ Ot,
503
+ {
504
+ width: m.width,
505
+ depth: m.depth,
506
+ elevation: i === 0 ? -2 : $.elevation,
507
+ color: $.floorColor || (h === "dark" ? "#0f172a" : "#f8fafc"),
508
+ opacity: $.floorOpacity || (i === 0 ? 0.95 : 0.5),
509
+ borderColor: $.borderColor,
510
+ theme: h,
511
+ isGround: i === 0
512
+ }
513
+ ),
514
+ u.map((p, Y) => {
515
+ const Q = $.elevation + 5, lt = l(p.x, p.y, Q), W = K(p.width, p.depth, p.height, lt.screenX, lt.screenY, N), U = F[p.color] || F.slate, at = v?.tier === i && v?.index === Y, mt = y && v !== null && !at, ct = l(p.x - 3, p.y - 3, $.elevation), xt = K(p.width + 6, p.depth + 6, 0, ct.screenX, ct.screenY, N).top;
516
+ return /* @__PURE__ */ r.jsxs(
517
+ "g",
518
+ {
519
+ "data-node": `${i}-${Y}`,
520
+ opacity: (p.opacity ?? 1) * (mt ? 0.3 : 1),
521
+ onClick: y ? (D) => {
522
+ if (D.stopPropagation(), M(null), E((J) => J && J.tier === i && J.index === Y ? null : { tier: i, index: Y }), o?.(p, { tier: i, index: Y }), p.link)
523
+ try {
524
+ window.open(p.link, "_blank");
525
+ } catch {
526
+ }
527
+ } : void 0,
528
+ style: { cursor: y ? "pointer" : "default", transition: "opacity 0.3s ease-out" },
529
+ children: [
530
+ /* @__PURE__ */ r.jsx("path", { d: xt, fill: "#000000", opacity: 0.3, filter: `url(#contact-${e.id})` }),
531
+ W.cornerBackRight?.map((D, J) => /* @__PURE__ */ r.jsx(
532
+ "path",
533
+ {
534
+ d: D.path,
535
+ fill: st(U.front, U.side, D.intensity)
536
+ },
537
+ `cbr-${J}`
538
+ )),
539
+ W.cornerBackLeft?.map((D, J) => /* @__PURE__ */ r.jsx(
540
+ "path",
541
+ {
542
+ d: D.path,
543
+ fill: st(U.side, U.front, D.intensity)
544
+ },
545
+ `cbl-${J}`
546
+ )),
547
+ /* @__PURE__ */ r.jsx("path", { d: W.left, fill: U.side }),
548
+ /* @__PURE__ */ r.jsx("path", { d: W.left, fill: `url(#shade-${e.id})` }),
549
+ /* @__PURE__ */ r.jsx("path", { d: W.right, fill: U.front }),
550
+ /* @__PURE__ */ r.jsx("path", { d: W.right, fill: `url(#shade-${e.id})` }),
551
+ W.cornerFrontRight?.map((D, J) => /* @__PURE__ */ r.jsx(
552
+ "path",
553
+ {
554
+ d: D.path,
555
+ fill: st(U.front, U.side, D.intensity)
556
+ },
557
+ `cfr-${J}`
558
+ )),
559
+ W.cornerFrontLeft?.map((D, J) => /* @__PURE__ */ r.jsx(
560
+ "path",
561
+ {
562
+ d: D.path,
563
+ fill: st(U.front, U.side, D.intensity)
564
+ },
565
+ `cfl-${J}`
566
+ )),
567
+ /* @__PURE__ */ r.jsx("path", { d: W.top, fill: U.top }),
568
+ /* @__PURE__ */ r.jsx("path", { d: W.top, fill: `url(#sheen-${e.id})` }),
569
+ /* @__PURE__ */ r.jsx(
570
+ "path",
571
+ {
572
+ d: W.top,
573
+ fill: "none",
574
+ stroke: at ? "#ffffff" : "rgba(255,255,255,0.28)",
575
+ strokeWidth: at ? 1.4 : 0.75,
576
+ strokeLinejoin: "round"
577
+ }
578
+ ),
579
+ k && p.label && /* @__PURE__ */ r.jsx(
580
+ wt,
581
+ {
582
+ x: p.x + p.width / 2,
583
+ y: p.y + p.depth / 2,
584
+ z: Q + p.height + 2,
585
+ fontSize: p.width > 70 ? 9 : 8,
586
+ color: B,
587
+ shadow: `url(#label-${e.id})`,
588
+ children: p.label
589
+ }
590
+ )
591
+ ]
592
+ },
593
+ Y
594
+ );
595
+ }),
596
+ k && /* @__PURE__ */ r.jsx(
597
+ "text",
598
+ {
599
+ x: l(-25, m.depth / 2, $.elevation + 15).screenX - 35,
600
+ y: l(-25, m.depth / 2, $.elevation + 15).screenY,
601
+ fill: q,
602
+ fontSize: 9,
603
+ fontWeight: 500,
604
+ fontFamily: bt,
605
+ opacity: 0.6,
606
+ style: { letterSpacing: "0.05em" },
607
+ children: $.name
608
+ }
609
+ )
610
+ ]
611
+ },
612
+ i
613
+ );
614
+ }) })
615
+ ]
616
+ }
617
+ ) });
618
+ }
619
+ const ut = '"JetBrains Mono", "Fira Code", "SF Mono", Consolas, monospace', St = {
620
+ blue: { top: "#3b82f6", side: "#2563eb", front: "#1d4ed8" },
621
+ violet: { top: "#8b5cf6", side: "#7c3aed", front: "#6d28d9" },
622
+ cyan: { top: "#06b6d4", side: "#0891b2", front: "#0e7490" },
623
+ emerald: { top: "#10b981", side: "#059669", front: "#047857" },
624
+ amber: { top: "#f59e0b", side: "#d97706", front: "#b45309" },
625
+ rose: { top: "#f43f5e", side: "#e11d48", front: "#be123c" },
626
+ slate: { top: "#475569", side: "#334155", front: "#1e293b" }
627
+ }, Mt = {
628
+ blue: { top: "#93c5fd", side: "#60a5fa", front: "#3b82f6" },
629
+ violet: { top: "#c4b5fd", side: "#a78bfa", front: "#8b5cf6" },
630
+ cyan: { top: "#67e8f9", side: "#22d3ee", front: "#06b6d4" },
631
+ emerald: { top: "#6ee7b7", side: "#34d399", front: "#10b981" },
632
+ amber: { top: "#fcd34d", side: "#fbbf24", front: "#f59e0b" },
633
+ rose: { top: "#fda4af", side: "#fb7185", front: "#f43f5e" },
634
+ slate: { top: "#e2e8f0", side: "#cbd5e1", front: "#94a3b8" }
635
+ };
636
+ function nt(e, s, a) {
637
+ const f = (A) => {
638
+ const h = A.replace("#", "");
639
+ return {
640
+ r: parseInt(h.substring(0, 2), 16),
641
+ g: parseInt(h.substring(2, 4), 16),
642
+ b: parseInt(h.substring(4, 6), 16)
643
+ };
644
+ }, o = f(e), x = f(s), y = Math.round(o.r + (x.r - o.r) * a), _ = Math.round(o.g + (x.g - o.g) * a), k = Math.round(o.b + (x.b - o.b) * a);
645
+ return `rgb(${y},${_},${k})`;
646
+ }
647
+ function Ct(e) {
648
+ const { theme: s, canvas: a, origin: f, tiers: o, floorSize: x, nodes: y, cornerRadius: _ = 0 } = e, k = s === "dark" ? St : Mt, A = s === "dark" ? "#0f172a" : "#fafafa", h = s === "dark" ? "#e2e8f0" : "#1e293b", I = s === "dark" ? "#64748b" : "#94a3b8", d = [...y].sort((m, w) => {
649
+ const N = o[m.tier]?.elevation || 0, F = o[w.tier]?.elevation || 0;
650
+ return N !== F ? N - F : w.x + w.width + (w.y + w.depth) - (m.x + m.width + (m.y + m.depth));
651
+ });
652
+ let n = `<svg xmlns="http://www.w3.org/2000/svg" width="${a.width}" height="${a.height}" style="background:${A}">`;
653
+ n += `<defs>
654
+ <pattern id="grid" width="24" height="24" patternUnits="userSpaceOnUse">
655
+ <circle cx="12" cy="12" r="0.5" fill="${s === "dark" ? "#1e293b" : "#e2e8f0"}"/>
656
+ </pattern>
657
+ <radialGradient id="bg" cx="48%" cy="34%" r="82%">
658
+ <stop offset="0%" stop-color="${s === "dark" ? "#16203a" : "#ffffff"}"/>
659
+ <stop offset="55%" stop-color="${s === "dark" ? "#0e1526" : "#f2f5f9"}"/>
660
+ <stop offset="100%" stop-color="${s === "dark" ? "#080d18" : "#e7ecf2"}"/>
661
+ </radialGradient>
662
+ <filter id="contact" x="-60%" y="-60%" width="220%" height="220%"><feGaussianBlur stdDeviation="5"/></filter>
663
+ <linearGradient id="sheen" x1="0" y1="0" x2="0" y2="1"><stop offset="0%" stop-color="#ffffff" stop-opacity="0.18"/><stop offset="55%" stop-color="#ffffff" stop-opacity="0.04"/><stop offset="100%" stop-color="#ffffff" stop-opacity="0"/></linearGradient>
664
+ <linearGradient id="shade" x1="0" y1="0" x2="0" y2="1"><stop offset="0%" stop-color="#000000" stop-opacity="0"/><stop offset="100%" stop-color="#000000" stop-opacity="0.24"/></linearGradient>
665
+ <filter id="labelshadow" x="-40%" y="-40%" width="180%" height="180%"><feDropShadow dx="0" dy="0.5" stdDeviation="0.7" flood-color="#000000" flood-opacity="0.7"/></filter>
666
+ </defs>`, n += '<rect width="100%" height="100%" fill="url(#bg)"/>', n += '<rect width="100%" height="100%" fill="url(#grid)" opacity="0.5"/>', n += `<g transform="translate(${f.x},${f.y})">`;
667
+ for (let m = 0; m < o.length; m++) {
668
+ const w = o[m], N = d.filter((b) => b.tier === m), F = w.offset || { x: 0, y: 0 };
669
+ n += `<g transform="translate(${F.x},${F.y})">`;
670
+ const Z = m === 0 ? 8 : 2, B = K(x.width, x.depth, Z, 0, 0), q = l(0, 0, m === 0 ? -2 : w.elevation), g = w.floorColor || (s === "dark" ? "#0f172a" : "#f8fafc"), j = w.floorOpacity || (m === 0 ? 0.95 : 0.5);
671
+ n += `<g transform="translate(${q.screenX},${q.screenY})">`, m === 0 && (n += `<g transform="translate(4,4)" opacity="0.2"><path d="${B.top}" fill="#000"/></g>`), n += `<path d="${B.top}" fill="${g}" opacity="${j}"/>`, m === 0 && (n += `<path d="${B.left}" fill="${s === "dark" ? "#0f172a" : "#cbd5e1"}" opacity="0.8"/>`, n += `<path d="${B.right}" fill="${s === "dark" ? "#1e293b" : "#94a3b8"}" opacity="0.8"/>`), n += `<path d="${B.top}" fill="none" stroke="${w.borderColor || (s === "dark" ? "#475569" : "#94a3b8")}" stroke-width="${m === 0 ? 1.5 : 0.75}" opacity="${m === 0 ? 1 : 0.6}"/>`, n += "</g>";
672
+ for (const b of N) {
673
+ const L = w.elevation + 5, M = l(b.x, b.y, L), v = K(b.width, b.depth, b.height, M.screenX, M.screenY, _), E = k[b.color] || k.slate, X = b.opacity ?? 1;
674
+ n += `<g opacity="${X}">`;
675
+ const $ = l(b.x - 3, b.y - 3, w.elevation), i = K(b.width + 6, b.depth + 6, 0, $.screenX, $.screenY, _).top;
676
+ if (n += `<path d="${i}" fill="#000000" opacity="0.3" filter="url(#contact)"/>`, v.cornerBackRight)
677
+ for (const u of v.cornerBackRight)
678
+ n += `<path d="${u.path}" fill="${nt(E.front, E.side, u.intensity)}"/>`;
679
+ if (v.cornerBackLeft)
680
+ for (const u of v.cornerBackLeft)
681
+ n += `<path d="${u.path}" fill="${nt(E.side, E.front, u.intensity)}"/>`;
682
+ if (n += `<path d="${v.left}" fill="${E.side}"/>`, n += `<path d="${v.left}" fill="url(#shade)"/>`, n += `<path d="${v.right}" fill="${E.front}"/>`, n += `<path d="${v.right}" fill="url(#shade)"/>`, v.cornerFrontRight)
683
+ for (const u of v.cornerFrontRight)
684
+ n += `<path d="${u.path}" fill="${nt(E.front, E.side, u.intensity)}"/>`;
685
+ if (v.cornerFrontLeft)
686
+ for (const u of v.cornerFrontLeft)
687
+ n += `<path d="${u.path}" fill="${nt(E.front, E.side, u.intensity)}"/>`;
688
+ if (n += `<path d="${v.top}" fill="${E.top}"/>`, n += `<path d="${v.top}" fill="url(#sheen)"/>`, n += `<path d="${v.top}" fill="none" stroke="rgba(255,255,255,0.28)" stroke-width="0.75" stroke-linejoin="round"/>`, b.label) {
689
+ const u = l(b.x + b.width / 2, b.y + b.depth / 2, L + b.height + 2), C = b.width > 70 ? 9 : 8;
690
+ n += `<g transform="translate(${u.screenX},${u.screenY})" filter="url(#labelshadow)">`, n += '<g transform="matrix(0.866,-0.5,0.866,0.5,0,0)">', n += `<text x="0" y="0" text-anchor="middle" fill="${h}" font-size="${C}" font-weight="600" font-family='${ut}' style="text-transform:uppercase;letter-spacing:0.06em">${b.label}</text>`, n += "</g></g>";
691
+ }
692
+ n += "</g>";
693
+ }
694
+ const S = l(-25, x.depth / 2, w.elevation + 15);
695
+ n += `<text x="${S.screenX - 35}" y="${S.screenY}" fill="${I}" font-size="9" font-weight="500" font-family='${ut}' opacity="0.6" style="letter-spacing:0.05em">${w.name}</text>`, n += "</g>";
696
+ }
697
+ return n += "</g></svg>", n;
698
+ }
699
+ function Nt(e, s) {
700
+ e.innerHTML = Ct(s);
701
+ }
702
+ export {
703
+ Lt as ArcDiagram,
704
+ At as getColorShading,
705
+ K as isoBox,
706
+ l as isoToScreen,
707
+ Nt as renderToElement,
708
+ Ct as renderToString
709
+ };