@floegence/floe-webapp-core 0.101.43 → 0.101.44

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.
@@ -11,25 +11,25 @@ function Kr() {
11
11
  a.exports = b();
12
12
  })(function() {
13
13
  return (/* @__PURE__ */ (function() {
14
- function b(o, u, I) {
15
- function _(U, l) {
16
- if (!u[U]) {
17
- if (!o[U]) {
18
- var k = typeof Ke == "function" && Ke;
19
- if (!l && k) return k(U, !0);
20
- if (P) return P(U, !0);
21
- var w = new Error("Cannot find module '" + U + "'");
14
+ function b(o, u, C) {
15
+ function _(N, l) {
16
+ if (!u[N]) {
17
+ if (!o[N]) {
18
+ var S = typeof Ke == "function" && Ke;
19
+ if (!l && S) return S(N, !0);
20
+ if (R) return R(N, !0);
21
+ var w = new Error("Cannot find module '" + N + "'");
22
22
  throw w.code = "MODULE_NOT_FOUND", w;
23
23
  }
24
- var S = u[U] = { exports: {} };
25
- o[U][0].call(S.exports, function(v) {
26
- var y = o[U][1][v];
27
- return _(y || v);
28
- }, S, S.exports, b, o, u, I);
24
+ var M = u[N] = { exports: {} };
25
+ o[N][0].call(M.exports, function(v) {
26
+ var I = o[N][1][v];
27
+ return _(I || v);
28
+ }, M, M.exports, b, o, u, C);
29
29
  }
30
- return u[U].exports;
30
+ return u[N].exports;
31
31
  }
32
- for (var P = typeof Ke == "function" && Ke, R = 0; R < I.length; R++) _(I[R]);
32
+ for (var R = typeof Ke == "function" && Ke, F = 0; F < C.length; F++) _(C[F]);
33
33
  return _;
34
34
  }
35
35
  return b;
@@ -37,70 +37,70 @@ function Kr() {
37
37
  Object.defineProperty(u, "__esModule", {
38
38
  value: !0
39
39
  }), u.default = void 0;
40
- function I(w) {
40
+ function C(w) {
41
41
  "@babel/helpers - typeof";
42
- return I = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(S) {
43
- return typeof S;
44
- } : function(S) {
45
- return S && typeof Symbol == "function" && S.constructor === Symbol && S !== Symbol.prototype ? "symbol" : typeof S;
46
- }, I(w);
42
+ return C = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(M) {
43
+ return typeof M;
44
+ } : function(M) {
45
+ return M && typeof Symbol == "function" && M.constructor === Symbol && M !== Symbol.prototype ? "symbol" : typeof M;
46
+ }, C(w);
47
47
  }
48
- function _(w, S) {
49
- if (!(w instanceof S)) throw new TypeError("Cannot call a class as a function");
48
+ function _(w, M) {
49
+ if (!(w instanceof M)) throw new TypeError("Cannot call a class as a function");
50
50
  }
51
- function P(w, S) {
52
- for (var v = 0; v < S.length; v++) {
53
- var y = S[v];
54
- y.enumerable = y.enumerable || !1, y.configurable = !0, "value" in y && (y.writable = !0), Object.defineProperty(w, U(y.key), y);
51
+ function R(w, M) {
52
+ for (var v = 0; v < M.length; v++) {
53
+ var I = M[v];
54
+ I.enumerable = I.enumerable || !1, I.configurable = !0, "value" in I && (I.writable = !0), Object.defineProperty(w, N(I.key), I);
55
55
  }
56
56
  }
57
- function R(w, S, v) {
58
- return S && P(w.prototype, S), Object.defineProperty(w, "prototype", { writable: !1 }), w;
57
+ function F(w, M, v) {
58
+ return M && R(w.prototype, M), Object.defineProperty(w, "prototype", { writable: !1 }), w;
59
59
  }
60
- function U(w) {
61
- var S = l(w, "string");
62
- return I(S) == "symbol" ? S : S + "";
60
+ function N(w) {
61
+ var M = l(w, "string");
62
+ return C(M) == "symbol" ? M : M + "";
63
63
  }
64
- function l(w, S) {
65
- if (I(w) != "object" || !w) return w;
64
+ function l(w, M) {
65
+ if (C(w) != "object" || !w) return w;
66
66
  var v = w[Symbol.toPrimitive];
67
67
  if (v !== void 0) {
68
- var y = v.call(w, S);
69
- if (I(y) != "object") return y;
68
+ var I = v.call(w, M);
69
+ if (C(I) != "object") return I;
70
70
  throw new TypeError("@@toPrimitive must return a primitive value.");
71
71
  }
72
72
  return String(w);
73
73
  }
74
74
  u.default = /* @__PURE__ */ (function() {
75
75
  function w() {
76
- var S = this, v = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, y = v.defaultLayoutOptions, g = y === void 0 ? {} : y, m = v.algorithms, h = m === void 0 ? ["layered", "stress", "mrtree", "radial", "force", "disco", "sporeOverlap", "sporeCompaction", "rectpacking"] : m, M = v.workerFactory, F = v.workerUrl;
77
- if (_(this, w), this.defaultLayoutOptions = g, this.initialized = !1, typeof F > "u" && typeof M > "u")
76
+ var M = this, v = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, I = v.defaultLayoutOptions, f = I === void 0 ? {} : I, y = v.algorithms, d = y === void 0 ? ["layered", "stress", "mrtree", "radial", "force", "disco", "sporeOverlap", "sporeCompaction", "rectpacking"] : y, x = v.workerFactory, P = v.workerUrl;
77
+ if (_(this, w), this.defaultLayoutOptions = f, this.initialized = !1, typeof P > "u" && typeof x > "u")
78
78
  throw new Error("Cannot construct an ELK without both 'workerUrl' and 'workerFactory'.");
79
- var L = M;
80
- typeof F < "u" && typeof M > "u" && (L = function($) {
81
- return new Worker($);
79
+ var j = x;
80
+ typeof P < "u" && typeof x > "u" && (j = function(k) {
81
+ return new Worker(k);
82
82
  });
83
- var T = L(F);
84
- if (typeof T.postMessage != "function")
83
+ var m = j(P);
84
+ if (typeof m.postMessage != "function")
85
85
  throw new TypeError("Created worker does not provide the required 'postMessage' function.");
86
- this.worker = new k(T), this.worker.postMessage({
86
+ this.worker = new S(m), this.worker.postMessage({
87
87
  cmd: "register",
88
- algorithms: h
88
+ algorithms: d
89
89
  }).then(function(c) {
90
- return S.initialized = !0;
90
+ return M.initialized = !0;
91
91
  }).catch(console.err);
92
92
  }
93
- return R(w, [{
93
+ return F(w, [{
94
94
  key: "layout",
95
95
  value: function(v) {
96
- var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, g = y.layoutOptions, m = g === void 0 ? this.defaultLayoutOptions : g, h = y.logging, M = h === void 0 ? !1 : h, F = y.measureExecutionTime, L = F === void 0 ? !1 : F;
96
+ var I = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, f = I.layoutOptions, y = f === void 0 ? this.defaultLayoutOptions : f, d = I.logging, x = d === void 0 ? !1 : d, P = I.measureExecutionTime, j = P === void 0 ? !1 : P;
97
97
  return v ? this.worker.postMessage({
98
98
  cmd: "layout",
99
99
  graph: v,
100
- layoutOptions: m,
100
+ layoutOptions: y,
101
101
  options: {
102
- logging: M,
103
- measureExecutionTime: L
102
+ logging: x,
103
+ measureExecutionTime: j
104
104
  }
105
105
  }) : Promise.reject(new Error("Missing mandatory parameter 'graph'."));
106
106
  }
@@ -132,34 +132,34 @@ function Kr() {
132
132
  }
133
133
  }]);
134
134
  })();
135
- var k = /* @__PURE__ */ (function() {
136
- function w(S) {
135
+ var S = /* @__PURE__ */ (function() {
136
+ function w(M) {
137
137
  var v = this;
138
- if (_(this, w), S === void 0)
138
+ if (_(this, w), M === void 0)
139
139
  throw new Error("Missing mandatory parameter 'worker'.");
140
- this.resolvers = {}, this.worker = S, this.worker.onmessage = function(y) {
140
+ this.resolvers = {}, this.worker = M, this.worker.onmessage = function(I) {
141
141
  setTimeout(function() {
142
- v.receive(v, y);
142
+ v.receive(v, I);
143
143
  }, 0);
144
144
  };
145
145
  }
146
- return R(w, [{
146
+ return F(w, [{
147
147
  key: "postMessage",
148
148
  value: function(v) {
149
- var y = this.id || 0;
150
- this.id = y + 1, v.id = y;
151
- var g = this;
152
- return new Promise(function(m, h) {
153
- g.resolvers[y] = function(M, F) {
154
- M ? (g.convertGwtStyleError(M), h(M)) : m(F);
155
- }, g.worker.postMessage(v);
149
+ var I = this.id || 0;
150
+ this.id = I + 1, v.id = I;
151
+ var f = this;
152
+ return new Promise(function(y, d) {
153
+ f.resolvers[I] = function(x, P) {
154
+ x ? (f.convertGwtStyleError(x), d(x)) : y(P);
155
+ }, f.worker.postMessage(v);
156
156
  });
157
157
  }
158
158
  }, {
159
159
  key: "receive",
160
- value: function(v, y) {
161
- var g = y.data, m = v.resolvers[g.id];
162
- m && (delete v.resolvers[g.id], g.error ? m(g.error) : m(null, g.data));
160
+ value: function(v, I) {
161
+ var f = I.data, y = v.resolvers[f.id];
162
+ y && (delete v.resolvers[f.id], f.error ? y(f.error) : y(null, f.data));
163
163
  }
164
164
  }, {
165
165
  key: "terminate",
@@ -170,17 +170,17 @@ function Kr() {
170
170
  key: "convertGwtStyleError",
171
171
  value: function(v) {
172
172
  if (v) {
173
- var y = v.__java$exception;
174
- y && (y.cause && y.cause.backingJsObject && (v.cause = y.cause.backingJsObject, this.convertGwtStyleError(v.cause)), delete v.__java$exception);
173
+ var I = v.__java$exception;
174
+ I && (I.cause && I.cause.backingJsObject && (v.cause = I.cause.backingJsObject, this.convertGwtStyleError(v.cause)), delete v.__java$exception);
175
175
  }
176
176
  }
177
177
  }]);
178
178
  })();
179
179
  }, {}], 2: [function(b, o, u) {
180
- var I = b("./elk-api.js").default;
180
+ var C = b("./elk-api.js").default;
181
181
  Object.defineProperty(o.exports, "__esModule", {
182
182
  value: !0
183
- }), o.exports = I, I.default = I;
183
+ }), o.exports = C, C.default = C;
184
184
  }, { "./elk-api.js": 1 }] }, {}, [2])(2);
185
185
  });
186
186
  })(pt)), pt.exports;
@@ -199,33 +199,33 @@ var Xr = Kr(), Zr = /* @__PURE__ */ qr(Xr), Qr = (a) => ({ avoidLib: void 0, asy
199
199
  } }), en = (() => {
200
200
  var a = import.meta.url;
201
201
  return async function(s = {}) {
202
- var b, o = s, u, I, _ = new Promise((e, t) => {
203
- u = e, I = t;
204
- }), P = "./this.program", R = "", U;
205
- if (typeof document < "u" && document.currentScript && (R = document.currentScript.src), a && (R = a), R.startsWith("blob:") ? R = "" : R = R.slice(0, R.replace(/[?#].*/, "").lastIndexOf("/") + 1), typeof window != "object" && typeof WorkerGlobalScope > "u") throw Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
206
- U = async (e) => {
207
- if (g(!j(e), "readAsync does not work with file:// URLs"), e = await fetch(e, { credentials: "same-origin" }), e.ok) return e.arrayBuffer();
202
+ var b, o = s, u, C, _ = new Promise((e, t) => {
203
+ u = e, C = t;
204
+ }), R = "./this.program", F = "", N;
205
+ if (typeof document < "u" && document.currentScript && (F = document.currentScript.src), a && (F = a), F.startsWith("blob:") ? F = "" : F = F.slice(0, F.replace(/[?#].*/, "").lastIndexOf("/") + 1), typeof window != "object" && typeof WorkerGlobalScope > "u") throw Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
206
+ N = async (e) => {
207
+ if (f(!U(e), "readAsync does not work with file:// URLs"), e = await fetch(e, { credentials: "same-origin" }), e.ok) return e.arrayBuffer();
208
208
  throw Error(e.status + " : " + e.url);
209
209
  };
210
- var l = console.log.bind(console), k = console.error.bind(console);
211
- g(!0, "worker environment detected but not enabled at build time. Add `worker` to `-sENVIRONMENT` to enable."), g(!0, "node environment detected but not enabled at build time. Add `node` to `-sENVIRONMENT` to enable."), g(!0, "shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable.");
210
+ var l = console.log.bind(console), S = console.error.bind(console);
211
+ f(!0, "worker environment detected but not enabled at build time. Add `worker` to `-sENVIRONMENT` to enable."), f(!0, "node environment detected but not enabled at build time. Add `node` to `-sENVIRONMENT` to enable."), f(!0, "shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable.");
212
212
  var w;
213
- typeof WebAssembly != "object" && k("no native wasm support detected");
214
- var S, v = !1, y;
215
- function g(e, t) {
213
+ typeof WebAssembly != "object" && S("no native wasm support detected");
214
+ var M, v = !1, I;
215
+ function f(e, t) {
216
216
  e || X("Assertion failed" + (t ? ": " + t : ""));
217
217
  }
218
- var m, h, M, F, L, T, c, $, G, x, C = !1, N = !1, j = (e) => e.startsWith("file://");
218
+ var y, d, x, P, j, m, c, k, G, T, A = !1, L = !1, U = (e) => e.startsWith("file://");
219
219
  function H() {
220
220
  var e = Jt();
221
- g((e & 3) == 0), e == 0 && (e += 4), T[e >> 2] = 34821223, T[e + 4 >> 2] = 2310721022, T[0] = 1668509029;
221
+ f((e & 3) == 0), e == 0 && (e += 4), m[e >> 2] = 34821223, m[e + 4 >> 2] = 2310721022, m[0] = 1668509029;
222
222
  }
223
223
  function D() {
224
224
  if (!v) {
225
225
  var e = Jt();
226
226
  e == 0 && (e += 4);
227
- var t = T[e >> 2], r = T[e + 4 >> 2];
228
- t == 34821223 && r == 2310721022 || X(`Stack overflow! Stack cookie has been overwritten at ${ke(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${ke(r)} ${ke(t)}`), T[0] != 1668509029 && X("Runtime error: The application has corrupted its heap memory area (address zero)!");
227
+ var t = m[e >> 2], r = m[e + 4 >> 2];
228
+ t == 34821223 && r == 2310721022 || X(`Stack overflow! Stack cookie has been overwritten at ${ke(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${ke(r)} ${ke(t)}`), m[0] != 1668509029 && X("Runtime error: The application has corrupted its heap memory area (address zero)!");
229
229
  }
230
230
  }
231
231
  var z = new Int16Array(1), Z = new Int8Array(z.buffer);
@@ -256,32 +256,32 @@ var Xr = Kr(), Zr = /* @__PURE__ */ qr(Xr), Qr = (a) => ({ avoidLib: void 0, asy
256
256
  } });
257
257
  }
258
258
  function he() {
259
- var e = S.buffer;
260
- m = new Int8Array(e), M = new Int16Array(e), h = new Uint8Array(e), F = new Uint16Array(e), L = new Int32Array(e), T = new Uint32Array(e), c = new Float32Array(e), x = new Float64Array(e), $ = new BigInt64Array(e), G = new BigUint64Array(e);
259
+ var e = M.buffer;
260
+ y = new Int8Array(e), x = new Int16Array(e), d = new Uint8Array(e), P = new Uint16Array(e), j = new Int32Array(e), m = new Uint32Array(e), c = new Float32Array(e), T = new Float64Array(e), k = new BigInt64Array(e), G = new BigUint64Array(e);
261
261
  }
262
- g(typeof Int32Array < "u" && typeof Float64Array < "u" && Int32Array.prototype.subarray != null && Int32Array.prototype.set != null, "JS engine does not provide full typed array support");
262
+ f(typeof Int32Array < "u" && typeof Float64Array < "u" && Int32Array.prototype.subarray != null && Int32Array.prototype.set != null, "JS engine does not provide full typed array support");
263
263
  var K = 0, se = null, Q = {}, ee = null;
264
264
  function ve() {
265
- K++, o.monitorRunDependencies?.(K), g(!Q["wasm-instantiate"]), Q["wasm-instantiate"] = 1, ee === null && typeof setInterval < "u" && (ee = setInterval(() => {
265
+ K++, o.monitorRunDependencies?.(K), f(!Q["wasm-instantiate"]), Q["wasm-instantiate"] = 1, ee === null && typeof setInterval < "u" && (ee = setInterval(() => {
266
266
  if (v) clearInterval(ee), ee = null;
267
267
  else {
268
268
  var e = !1, t;
269
- for (t in Q) e || (e = !0, k("still waiting on run dependencies:")), k(`dependency: ${t}`);
270
- e && k("(end of list)");
269
+ for (t in Q) e || (e = !0, S("still waiting on run dependencies:")), S(`dependency: ${t}`);
270
+ e && S("(end of list)");
271
271
  }
272
272
  }, 1e4));
273
273
  }
274
274
  function X(e) {
275
- throw o.onAbort?.(e), e = "Aborted(" + e + ")", k(e), v = !0, C && Gr(), e = new WebAssembly.RuntimeError(e), I(e), e;
275
+ throw o.onAbort?.(e), e = "Aborted(" + e + ")", S(e), v = !0, A && Gr(), e = new WebAssembly.RuntimeError(e), C(e), e;
276
276
  }
277
277
  function re() {
278
278
  X("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM");
279
279
  }
280
280
  function te(e, t) {
281
281
  return (...r) => {
282
- g(C, `native function \`${e}\` called before runtime initialization`), g(!N, `native function \`${e}\` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)`);
282
+ f(A, `native function \`${e}\` called before runtime initialization`), f(!L, `native function \`${e}\` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)`);
283
283
  var n = ie[e];
284
- return g(n, `exported native function \`${e}\` not found`), g(r.length <= t, `native function \`${e}\` called with ${r.length} args but expects ${t}`), n(...r);
284
+ return f(n, `exported native function \`${e}\` not found`), f(r.length <= t, `native function \`${e}\` called with ${r.length} args but expects ${t}`), n(...r);
285
285
  };
286
286
  }
287
287
  var Me = 0;
@@ -309,7 +309,7 @@ var Xr = Kr(), Zr = /* @__PURE__ */ qr(Xr), Qr = (a) => ({ avoidLib: void 0, asy
309
309
  var Le;
310
310
  async function ur(e) {
311
311
  if (!w) try {
312
- var t = await U(e);
312
+ var t = await N(e);
313
313
  return new Uint8Array(t);
314
314
  } catch {
315
315
  }
@@ -322,7 +322,7 @@ var Xr = Kr(), Zr = /* @__PURE__ */ qr(Xr), Qr = (a) => ({ avoidLib: void 0, asy
322
322
  var r = await ur(e);
323
323
  return await WebAssembly.instantiate(r, t);
324
324
  } catch (n) {
325
- k(`failed to asynchronously prepare wasm: ${n}`), j(Le) && k(`warning: Loading from a file URI (${Le}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`), X(n);
325
+ S(`failed to asynchronously prepare wasm: ${n}`), U(Le) && S(`warning: Loading from a file URI (${Le}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`), X(n);
326
326
  }
327
327
  }
328
328
  async function dr(e) {
@@ -331,7 +331,7 @@ var Xr = Kr(), Zr = /* @__PURE__ */ qr(Xr), Qr = (a) => ({ avoidLib: void 0, asy
331
331
  var r = fetch(t, { credentials: "same-origin" });
332
332
  return await WebAssembly.instantiateStreaming(r, e);
333
333
  } catch (n) {
334
- k(`wasm streaming compile failed: ${n}`), k("falling back to ArrayBuffer instantiation");
334
+ S(`wasm streaming compile failed: ${n}`), S("falling back to ArrayBuffer instantiation");
335
335
  }
336
336
  return lr(t, e);
337
337
  }
@@ -346,8 +346,8 @@ var Xr = Kr(), Zr = /* @__PURE__ */ qr(Xr), Qr = (a) => ({ avoidLib: void 0, asy
346
346
  }, _t = [], xt = [], hr = () => {
347
347
  var e = o.preRun.shift();
348
348
  xt.push(e);
349
- }, Se = !1, ke = (e) => (g(typeof e == "number"), "0x" + (e >>> 0).toString(16).padStart(8, "0")), me = (e) => {
350
- me.M || (me.M = {}), me.M[e] || (me.M[e] = 1, k(e));
349
+ }, Se = !1, ke = (e) => (f(typeof e == "number"), "0x" + (e >>> 0).toString(16).padStart(8, "0")), me = (e) => {
350
+ me.M || (me.M = {}), me.M[e] || (me.M[e] = 1, S(e));
351
351
  }, be, Tt = typeof TextDecoder < "u" ? new TextDecoder() : void 0, Et = (e, t = 0, r = NaN) => {
352
352
  var n = t + r;
353
353
  for (r = t; e[r] && !(r >= n); ) ++r;
@@ -355,20 +355,20 @@ var Xr = Kr(), Zr = /* @__PURE__ */ qr(Xr), Qr = (a) => ({ avoidLib: void 0, asy
355
355
  for (n = ""; t < r; ) {
356
356
  var i = e[t++];
357
357
  if (i & 128) {
358
- var d = e[t++] & 63;
359
- if ((i & 224) == 192) n += String.fromCharCode((i & 31) << 6 | d);
358
+ var h = e[t++] & 63;
359
+ if ((i & 224) == 192) n += String.fromCharCode((i & 31) << 6 | h);
360
360
  else {
361
- var f = e[t++] & 63;
362
- (i & 240) == 224 ? i = (i & 15) << 12 | d << 6 | f : ((i & 248) != 240 && me("Invalid UTF-8 leading byte " + ke(i) + " encountered when deserializing a UTF-8 string in wasm memory to a JS string!"), i = (i & 7) << 18 | d << 12 | f << 6 | e[t++] & 63), 65536 > i ? n += String.fromCharCode(i) : (i -= 65536, n += String.fromCharCode(55296 | i >> 10, 56320 | i & 1023));
361
+ var g = e[t++] & 63;
362
+ (i & 240) == 224 ? i = (i & 15) << 12 | h << 6 | g : ((i & 248) != 240 && me("Invalid UTF-8 leading byte " + ke(i) + " encountered when deserializing a UTF-8 string in wasm memory to a JS string!"), i = (i & 7) << 18 | h << 12 | g << 6 | e[t++] & 63), 65536 > i ? n += String.fromCharCode(i) : (i -= 65536, n += String.fromCharCode(55296 | i >> 10, 56320 | i & 1023));
363
363
  }
364
364
  } else n += String.fromCharCode(i);
365
365
  }
366
366
  return n;
367
- }, Ie = (e, t) => (g(typeof e == "number", `UTF8ToString expects a number (got ${typeof e})`), e ? Et(h, e, t) : ""), Ze = (e) => (e = e.getArg(ie.__cpp_exception, 0), Jr(e)), Mt = (e) => {
367
+ }, Ie = (e, t) => (f(typeof e == "number", `UTF8ToString expects a number (got ${typeof e})`), e ? Et(d, e, t) : ""), Ze = (e) => (e = e.getArg(ie.__cpp_exception, 0), Jr(e)), Mt = (e) => {
368
368
  var t = Ze(e);
369
369
  e = qt();
370
370
  var r = Yt(4), n = Yt(4);
371
- if (Yr(t, r, n), t = T[r >> 2], n = T[n >> 2], r = Ie(t), pe(t), n) {
371
+ if (Yr(t, r, n), t = m[r >> 2], n = m[n >> 2], r = Ie(t), pe(t), n) {
372
372
  var i = Ie(n);
373
373
  pe(n);
374
374
  }
@@ -378,7 +378,7 @@ var Xr = Kr(), Zr = /* @__PURE__ */ qr(Xr), Qr = (a) => ({ avoidLib: void 0, asy
378
378
  var t = typeof e;
379
379
  return t === "object" || t === "array" || t === "function" ? e.toString() : "" + e;
380
380
  }, St, ne = (e) => {
381
- for (var t = ""; h[e]; ) t += St[h[e++]];
381
+ for (var t = ""; d[e]; ) t += St[d[e++]];
382
382
  return t;
383
383
  }, Ce = {}, _e = {}, je = {}, W = o.BindingError = class extends Error {
384
384
  constructor(e) {
@@ -403,13 +403,13 @@ var Xr = Kr(), Zr = /* @__PURE__ */ qr(Xr), Qr = (a) => ({ avoidLib: void 0, asy
403
403
  var kt = (e, t, r) => {
404
404
  switch (t) {
405
405
  case 1:
406
- return r ? (n) => m[n] : (n) => h[n];
406
+ return r ? (n) => y[n] : (n) => d[n];
407
407
  case 2:
408
- return r ? (n) => M[n >> 1] : (n) => F[n >> 1];
408
+ return r ? (n) => x[n >> 1] : (n) => P[n >> 1];
409
409
  case 4:
410
- return r ? (n) => L[n >> 2] : (n) => T[n >> 2];
410
+ return r ? (n) => j[n >> 2] : (n) => m[n >> 2];
411
411
  case 8:
412
- return r ? (n) => $[n >> 3] : (n) => G[n >> 3];
412
+ return r ? (n) => k[n >> 3] : (n) => G[n >> 3];
413
413
  default:
414
414
  throw new TypeError(`invalid integer width (${t}): ${e}`);
415
415
  }
@@ -471,12 +471,12 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
471
471
  if (o.hasOwnProperty(e)) throw new W(`Cannot register public name '${e}' twice`);
472
472
  o[e] = t, o[e].C = void 0;
473
473
  }, yr = (e) => {
474
- g(typeof e == "string"), e = e.replace(/[^a-zA-Z0-9_]/g, "$");
474
+ f(typeof e == "string"), e = e.replace(/[^a-zA-Z0-9_]/g, "$");
475
475
  var t = e.charCodeAt(0);
476
476
  return 48 <= t && 57 >= t ? `_${e}` : e;
477
477
  };
478
- function wr(e, t, r, n, i, d, f, p) {
479
- this.name = e, this.constructor = t, this.A = r, this.B = n, this.m = i, this.T = d, this.H = f, this.R = p, this.Z = [];
478
+ function wr(e, t, r, n, i, h, g, p) {
479
+ this.name = e, this.constructor = t, this.A = r, this.B = n, this.m = i, this.T = h, this.H = g, this.R = p, this.Z = [];
480
480
  }
481
481
  var Be = (e, t, r) => {
482
482
  for (; t !== r; ) {
@@ -540,16 +540,16 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
540
540
  return Be(t.g.i, t.g.j.h, this.h);
541
541
  }
542
542
  function ze(e) {
543
- return this.fromWireType(T[e >> 2]);
543
+ return this.fromWireType(m[e >> 2]);
544
544
  }
545
- function Ve(e, t, r, n, i, d, f, p, A, O, E) {
546
- this.name = e, this.h = t, this.L = r, this.J = n, this.K = i, this.Y = d, this.ba = f, this.O = p, this.$ = A, this.aa = O, this.B = E, i || t.m !== void 0 ? this.toWireType = br : (this.toWireType = n ? vr : _r, this.s = null);
545
+ function Ve(e, t, r, n, i, h, g, p, O, $, E) {
546
+ this.name = e, this.h = t, this.L = r, this.J = n, this.K = i, this.Y = h, this.ba = g, this.O = p, this.$ = O, this.aa = $, this.B = E, i || t.m !== void 0 ? this.toWireType = br : (this.toWireType = n ? vr : _r, this.s = null);
547
547
  }
548
548
  var xr = (e, t) => {
549
549
  if (!o.hasOwnProperty(e)) throw new We("Replacing nonexistent public symbol");
550
550
  o[e] = t, o[e].C = void 0;
551
551
  }, $t = [], fe = (e, t, r = !1) => {
552
- if (g(!r, "Async bindings are only supported with JSPI."), e = ne(e), (r = $t[t]) || ($t[t] = r = be.get(t)), g(be.get(t) == r, "JavaScript-side Wasm function table mirror is out of date!"), typeof r != "function") throw new W(`unknown function pointer with signature ${e}: ${t}`);
552
+ if (f(!r, "Async bindings are only supported with JSPI."), e = ne(e), (r = $t[t]) || ($t[t] = r = be.get(t)), f(be.get(t) == r, "JavaScript-side Wasm function table mirror is out of date!"), typeof r != "function") throw new W(`unknown function pointer with signature ${e}: ${t}`);
553
553
  return r;
554
554
  };
555
555
  class Tr extends Error {
@@ -559,23 +559,23 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
559
559
  var t = ne(e);
560
560
  return pe(e), t;
561
561
  }, Ae = (e, t) => {
562
- function r(d) {
563
- i[d] || _e[d] || (je[d] ? je[d].forEach(r) : (n.push(d), i[d] = !0));
562
+ function r(h) {
563
+ i[h] || _e[h] || (je[h] ? je[h].forEach(r) : (n.push(h), i[h] = !0));
564
564
  }
565
565
  var n = [], i = {};
566
566
  throw t.forEach(r), new Tr(`${e}: ` + n.map(Ft).join([", "]));
567
567
  }, ge = (e, t, r) => {
568
568
  function n(p) {
569
569
  if (p = r(p), p.length !== e.length) throw new We("Mismatched type converter count");
570
- for (var A = 0; A < e.length; ++A) ce(e[A], p[A]);
570
+ for (var O = 0; O < e.length; ++O) ce(e[O], p[O]);
571
571
  }
572
572
  e.forEach((p) => je[p] = t);
573
- var i = Array(t.length), d = [], f = 0;
574
- t.forEach((p, A) => {
575
- _e.hasOwnProperty(p) ? i[A] = _e[p] : (d.push(p), Ce.hasOwnProperty(p) || (Ce[p] = []), Ce[p].push(() => {
576
- i[A] = _e[p], ++f, f === d.length && n(i);
573
+ var i = Array(t.length), h = [], g = 0;
574
+ t.forEach((p, O) => {
575
+ _e.hasOwnProperty(p) ? i[O] = _e[p] : (h.push(p), Ce.hasOwnProperty(p) || (Ce[p] = []), Ce[p].push(() => {
576
+ i[O] = _e[p], ++g, g === h.length && n(i);
577
577
  }));
578
- }), d.length === 0 && n(i);
578
+ }), h.length === 0 && n(i);
579
579
  }, tt = (e) => {
580
580
  for (; e.length; ) {
581
581
  var t = e.pop();
@@ -589,29 +589,29 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
589
589
  function Er(e, t, r, n, i) {
590
590
  (e < t || e > r) && i(`function ${n} called with ${e} arguments, expected ${t == r ? t : `${t} to ${r}`}`);
591
591
  }
592
- function rt(e, t, r, n, i, d) {
593
- var f = t.length;
594
- if (2 > f) throw new W("argTypes array size mismatch! Must at least get return value and 'this' types!");
595
- g(!d, "Async bindings are only supported with JSPI.");
596
- var p = t[1] !== null && r !== null, A = Lt(t);
592
+ function rt(e, t, r, n, i, h) {
593
+ var g = t.length;
594
+ if (2 > g) throw new W("argTypes array size mismatch! Must at least get return value and 'this' types!");
595
+ f(!h, "Async bindings are only supported with JSPI.");
596
+ var p = t[1] !== null && r !== null, O = Lt(t);
597
597
  r = t[0].name !== "void";
598
- for (var O = f - 2, E = t.length - 2, B = t.length - 1; 2 <= B && t[B].optional; --B) E--;
599
- for (n = [e, fr, n, i, tt, t[0], t[1]], i = 0; i < f - 2; ++i) n.push(t[i + 2]);
600
- if (!A) for (i = p ? 1 : 2; i < t.length; ++i) t[i].s !== null && n.push(t[i].s);
601
- for (n.push(Er, E, O), A = Lt(t), O = t.length - 2, E = [], i = ["fn"], p && i.push("thisWired"), f = 0; f < O; ++f) E.push(`arg${f}`), i.push(`arg${f}Wired`);
598
+ for (var $ = g - 2, E = t.length - 2, B = t.length - 1; 2 <= B && t[B].optional; --B) E--;
599
+ for (n = [e, fr, n, i, tt, t[0], t[1]], i = 0; i < g - 2; ++i) n.push(t[i + 2]);
600
+ if (!O) for (i = p ? 1 : 2; i < t.length; ++i) t[i].s !== null && n.push(t[i].s);
601
+ for (n.push(Er, E, $), O = Lt(t), $ = t.length - 2, E = [], i = ["fn"], p && i.push("thisWired"), g = 0; g < $; ++g) E.push(`arg${g}`), i.push(`arg${g}Wired`);
602
602
  E = E.join(","), i = i.join(","), E = `return function (${E}) {
603
603
  checkArgCount(arguments.length, minArgs, maxArgs, humanName, throwBindingError);
604
- `, A && (E += `var destructors = [];
604
+ `, O && (E += `var destructors = [];
605
605
  `);
606
- var J = A ? "destructors" : "null";
606
+ var J = O ? "destructors" : "null";
607
607
  for (B = "humanName throwBindingError invoker fn runDestructors retType classParam".split(" "), p && (E += `var thisWired = classParam['toWireType'](${J}, this);
608
- `), f = 0; f < O; ++f) E += `var arg${f}Wired = argType${f}['toWireType'](${J}, arg${f});
609
- `, B.push(`argType${f}`);
610
- if (E += (r || d ? "var rv = " : "") + `invoker(${i});
611
- `, A) E += `runDestructors(destructors);
608
+ `), g = 0; g < $; ++g) E += `var arg${g}Wired = argType${g}['toWireType'](${J}, arg${g});
609
+ `, B.push(`argType${g}`);
610
+ if (E += (r || h ? "var rv = " : "") + `invoker(${i});
611
+ `, O) E += `runDestructors(destructors);
612
612
  `;
613
- else for (f = p ? 1 : 2; f < t.length; ++f) d = f === 1 ? "thisWired" : "arg" + (f - 2) + "Wired", t[f].s !== null && (E += `${d}_dtor(${d});
614
- `, B.push(`${d}_dtor`));
613
+ else for (g = p ? 1 : 2; g < t.length; ++g) h = g === 1 ? "thisWired" : "arg" + (g - 2) + "Wired", t[g].s !== null && (E += `${h}_dtor(${h});
614
+ `, B.push(`${h}_dtor`));
615
615
  r && (E += `var ret = retType['fromWireType'](rv);
616
616
  return ret;
617
617
  `), E += `}
@@ -621,22 +621,22 @@ ${E}`;
621
621
  return t = new Function(...Y, q)(...n), He(e, t);
622
622
  }
623
623
  for (var nt = (e, t) => {
624
- for (var r = [], n = 0; n < e; n++) r.push(T[t + 4 * n >> 2]);
624
+ for (var r = [], n = 0; n < e; n++) r.push(m[t + 4 * n >> 2]);
625
625
  return r;
626
626
  }, Nt = (e) => {
627
627
  e = e.trim();
628
628
  let t = e.indexOf("(");
629
- return t === -1 ? e : (g(e.endsWith(")"), "Parentheses for argument names should match."), e.slice(0, t));
629
+ return t === -1 ? e : (f(e.endsWith(")"), "Parentheses for argument names should match."), e.slice(0, t));
630
630
  }, Ut = (e, t, r) => {
631
631
  if (!(e instanceof Object)) throw new W(`${r} with invalid "this": ${e}`);
632
632
  if (!(e instanceof t.h.constructor)) throw new W(`${r} incompatible with "this" of type ${e.constructor.name}`);
633
633
  if (!e.g.i) throw new W(`cannot call emscripten binding method ${r} on deleted object`);
634
634
  return Be(e.g.i, e.g.j.h, t.h);
635
635
  }, it = [], ue = [], ot = (e) => {
636
- 9 < e && --ue[e + 1] === 0 && (g(ue[e] !== void 0, "Decref for unallocated handle."), ue[e] = void 0, it.push(e));
636
+ 9 < e && --ue[e + 1] === 0 && (f(ue[e] !== void 0, "Decref for unallocated handle."), ue[e] = void 0, it.push(e));
637
637
  }, at = (e) => {
638
638
  if (!e) throw new W(`Cannot use deleted val. handle = ${e}`);
639
- return g(e === 2 || ue[e] !== void 0 && e % 2 === 0, `invalid handle: ${e}`), ue[e];
639
+ return f(e === 2 || ue[e] !== void 0 && e % 2 === 0, `invalid handle: ${e}`), ue[e];
640
640
  }, Je = (e) => {
641
641
  switch (e) {
642
642
  case void 0:
@@ -658,21 +658,21 @@ ${E}`;
658
658
  switch (t) {
659
659
  case 1:
660
660
  return r ? function(n) {
661
- return this.fromWireType(m[n]);
661
+ return this.fromWireType(y[n]);
662
662
  } : function(n) {
663
- return this.fromWireType(h[n]);
663
+ return this.fromWireType(d[n]);
664
664
  };
665
665
  case 2:
666
666
  return r ? function(n) {
667
- return this.fromWireType(M[n >> 1]);
667
+ return this.fromWireType(x[n >> 1]);
668
668
  } : function(n) {
669
- return this.fromWireType(F[n >> 1]);
669
+ return this.fromWireType(P[n >> 1]);
670
670
  };
671
671
  case 4:
672
672
  return r ? function(n) {
673
- return this.fromWireType(L[n >> 2]);
673
+ return this.fromWireType(j[n >> 2]);
674
674
  } : function(n) {
675
- return this.fromWireType(T[n >> 2]);
675
+ return this.fromWireType(m[n >> 2]);
676
676
  };
677
677
  default:
678
678
  throw new TypeError(`invalid integer width (${t}): ${e}`);
@@ -689,41 +689,41 @@ ${E}`;
689
689
  };
690
690
  case 8:
691
691
  return function(r) {
692
- return this.fromWireType(x[r >> 3]);
692
+ return this.fromWireType(T[r >> 3]);
693
693
  };
694
694
  default:
695
695
  throw new TypeError(`invalid float width (${t}): ${e}`);
696
696
  }
697
697
  }, kr = Object.assign({ optional: !0 }, jt), Pe = (e, t, r) => {
698
- g(typeof r == "number", "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");
699
- var n = h;
700
- if (g(typeof e == "string", `stringToUTF8Array expects a string (got ${typeof e})`), 0 < r) {
698
+ f(typeof r == "number", "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");
699
+ var n = d;
700
+ if (f(typeof e == "string", `stringToUTF8Array expects a string (got ${typeof e})`), 0 < r) {
701
701
  var i = t;
702
702
  r = t + r - 1;
703
- for (var d = 0; d < e.length; ++d) {
704
- var f = e.charCodeAt(d);
705
- if (55296 <= f && 57343 >= f) {
706
- var p = e.charCodeAt(++d);
707
- f = 65536 + ((f & 1023) << 10) | p & 1023;
703
+ for (var h = 0; h < e.length; ++h) {
704
+ var g = e.charCodeAt(h);
705
+ if (55296 <= g && 57343 >= g) {
706
+ var p = e.charCodeAt(++h);
707
+ g = 65536 + ((g & 1023) << 10) | p & 1023;
708
708
  }
709
- if (127 >= f) {
709
+ if (127 >= g) {
710
710
  if (t >= r) break;
711
- n[t++] = f;
711
+ n[t++] = g;
712
712
  } else {
713
- if (2047 >= f) {
713
+ if (2047 >= g) {
714
714
  if (t + 1 >= r) break;
715
- n[t++] = 192 | f >> 6;
715
+ n[t++] = 192 | g >> 6;
716
716
  } else {
717
- if (65535 >= f) {
717
+ if (65535 >= g) {
718
718
  if (t + 2 >= r) break;
719
- n[t++] = 224 | f >> 12;
719
+ n[t++] = 224 | g >> 12;
720
720
  } else {
721
721
  if (t + 3 >= r) break;
722
- 1114111 < f && me("Invalid Unicode code point " + ke(f) + " encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."), n[t++] = 240 | f >> 18, n[t++] = 128 | f >> 12 & 63;
722
+ 1114111 < g && me("Invalid Unicode code point " + ke(g) + " encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."), n[t++] = 240 | g >> 18, n[t++] = 128 | g >> 12 & 63;
723
723
  }
724
- n[t++] = 128 | f >> 6 & 63;
724
+ n[t++] = 128 | g >> 6 & 63;
725
725
  }
726
- n[t++] = 128 | f & 63;
726
+ n[t++] = 128 | g & 63;
727
727
  }
728
728
  }
729
729
  n[t] = 0, e = t - i;
@@ -736,43 +736,43 @@ ${E}`;
736
736
  }
737
737
  return t;
738
738
  }, Wt = typeof TextDecoder < "u" ? new TextDecoder("utf-16le") : void 0, Ir = (e, t) => {
739
- g(e % 2 == 0, "Pointer passed to UTF16ToString must be aligned to two bytes!");
740
- for (var r = e >> 1, n = r + t / 2; !(r >= n) && F[r]; ) ++r;
741
- if (r <<= 1, 32 < r - e && Wt) return Wt.decode(h.subarray(e, r));
739
+ f(e % 2 == 0, "Pointer passed to UTF16ToString must be aligned to two bytes!");
740
+ for (var r = e >> 1, n = r + t / 2; !(r >= n) && P[r]; ) ++r;
741
+ if (r <<= 1, 32 < r - e && Wt) return Wt.decode(d.subarray(e, r));
742
742
  for (r = "", n = 0; !(n >= t / 2); ++n) {
743
- var i = M[e + 2 * n >> 1];
743
+ var i = x[e + 2 * n >> 1];
744
744
  if (i == 0) break;
745
745
  r += String.fromCharCode(i);
746
746
  }
747
747
  return r;
748
748
  }, Cr = (e, t, r) => {
749
- if (g(t % 2 == 0, "Pointer passed to stringToUTF16 must be aligned to two bytes!"), g(typeof r == "number", "stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"), r ??= 2147483647, 2 > r) return 0;
749
+ if (f(t % 2 == 0, "Pointer passed to stringToUTF16 must be aligned to two bytes!"), f(typeof r == "number", "stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"), r ??= 2147483647, 2 > r) return 0;
750
750
  r -= 2;
751
751
  var n = t;
752
752
  r = r < 2 * e.length ? r / 2 : e.length;
753
- for (var i = 0; i < r; ++i) M[t >> 1] = e.charCodeAt(i), t += 2;
754
- return M[t >> 1] = 0, t - n;
753
+ for (var i = 0; i < r; ++i) x[t >> 1] = e.charCodeAt(i), t += 2;
754
+ return x[t >> 1] = 0, t - n;
755
755
  }, Ar = (e) => 2 * e.length, Pr = (e, t) => {
756
- g(e % 4 == 0, "Pointer passed to UTF32ToString must be aligned to four bytes!");
756
+ f(e % 4 == 0, "Pointer passed to UTF32ToString must be aligned to four bytes!");
757
757
  for (var r = 0, n = ""; !(r >= t / 4); ) {
758
- var i = L[e + 4 * r >> 2];
758
+ var i = j[e + 4 * r >> 2];
759
759
  if (i == 0) break;
760
760
  ++r, 65536 <= i ? (i -= 65536, n += String.fromCharCode(55296 | i >> 10, 56320 | i & 1023)) : n += String.fromCharCode(i);
761
761
  }
762
762
  return n;
763
763
  }, Or = (e, t, r) => {
764
- if (g(t % 4 == 0, "Pointer passed to stringToUTF32 must be aligned to four bytes!"), g(typeof r == "number", "stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"), r ??= 2147483647, 4 > r) return 0;
764
+ if (f(t % 4 == 0, "Pointer passed to stringToUTF32 must be aligned to four bytes!"), f(typeof r == "number", "stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"), r ??= 2147483647, 4 > r) return 0;
765
765
  var n = t;
766
766
  r = n + r - 4;
767
767
  for (var i = 0; i < e.length; ++i) {
768
- var d = e.charCodeAt(i);
769
- if (55296 <= d && 57343 >= d) {
770
- var f = e.charCodeAt(++i);
771
- d = 65536 + ((d & 1023) << 10) | f & 1023;
768
+ var h = e.charCodeAt(i);
769
+ if (55296 <= h && 57343 >= h) {
770
+ var g = e.charCodeAt(++i);
771
+ h = 65536 + ((h & 1023) << 10) | g & 1023;
772
772
  }
773
- if (L[t >> 2] = d, t += 4, t + 4 > r) break;
773
+ if (j[t >> 2] = h, t += 4, t + 4 > r) break;
774
774
  }
775
- return L[t >> 2] = 0, t - n;
775
+ return j[t >> 2] = 0, t - n;
776
776
  }, Rr = (e) => {
777
777
  for (var t = 0, r = 0; r < e.length; ++r) {
778
778
  var n = e.charCodeAt(r);
@@ -783,22 +783,22 @@ ${E}`;
783
783
  var t = ct.length;
784
784
  return ct.push(e), t;
785
785
  }, Fr = (e, t) => {
786
- for (var r = Array(e), n = 0; n < e; ++n) r[n] = st(T[t + 4 * n >> 2], `parameter ${n}`);
786
+ for (var r = Array(e), n = 0; n < e; ++n) r[n] = st(m[t + 4 * n >> 2], `parameter ${n}`);
787
787
  return r;
788
788
  }, Lr = (e, t, r) => {
789
789
  var n = [];
790
- return e = e.toWireType(n, r), n.length && (T[t >> 2] = Je(n)), e;
790
+ return e = e.toWireType(n, r), n.length && (m[t >> 2] = Je(n)), e;
791
791
  }, Re = {}, Dt = (e) => {
792
- if (!(e instanceof vt || e == "unwind")) throw D(), e instanceof WebAssembly.RuntimeError && 0 >= qt() && k("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 65536)"), e;
792
+ if (!(e instanceof vt || e == "unwind")) throw D(), e instanceof WebAssembly.RuntimeError && 0 >= qt() && S("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 65536)"), e;
793
793
  }, Gt = (e) => {
794
- throw y = e, Se || 0 < Oe || (o.onExit?.(e), v = !0), new vt(e);
794
+ throw I = e, Se || 0 < Oe || (o.onExit?.(e), v = !0), new vt(e);
795
795
  }, Nr = (e) => {
796
- if (N || v) k("user callback triggered after runtime exited or application aborted. Ignoring.");
796
+ if (L || v) S("user callback triggered after runtime exited or application aborted. Ignoring.");
797
797
  else try {
798
- if (e(), !(N || Se || 0 < Oe)) try {
799
- if (y = e = y, Se || 0 < Oe || (g(!N), D(), Wr(), jr(0), dt[1].length && ht(1, 10), dt[2].length && ht(2, 10), N = !0), Se || 0 < Oe) {
798
+ if (e(), !(L || Se || 0 < Oe)) try {
799
+ if (I = e = I, Se || 0 < Oe || (f(!L), D(), Wr(), jr(0), dt[1].length && ht(1, 10), dt[2].length && ht(2, 10), L = !0), Se || 0 < Oe) {
800
800
  var t = `program exited (with status: ${e}), but keepRuntimeAlive() is set (counter=${Oe}) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)`;
801
- I(t), k(t);
801
+ C(t), S(t);
802
802
  }
803
803
  Gt(e);
804
804
  } catch (r) {
@@ -809,7 +809,7 @@ ${E}`;
809
809
  }
810
810
  }, ut = {}, Ht = () => {
811
811
  if (!lt) {
812
- var e = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", _: P || "./this.program" }, t;
812
+ var e = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", _: R || "./this.program" }, t;
813
813
  for (t in ut) ut[t] === void 0 ? delete e[t] : e[t] = ut[t];
814
814
  var r = [];
815
815
  for (t in e) r.push(`${t}=${e[t]}`);
@@ -818,7 +818,7 @@ ${E}`;
818
818
  return lt;
819
819
  }, lt, dt = [null, [], []], ht = (e, t) => {
820
820
  var r = dt[e];
821
- g(r), t === 0 || t === 10 ? ((e === 1 ? l : k)(Et(r)), r.length = 0) : r.push(t);
821
+ f(r), t === 0 || t === 10 ? ((e === 1 ? l : S)(Et(r)), r.length = 0) : r.push(t);
822
822
  }, Bt = Array(256), qe = 0; 256 > qe; ++qe) Bt[qe] = String.fromCharCode(qe);
823
823
  St = Bt, (() => {
824
824
  let e = Ge.prototype;
@@ -826,14 +826,14 @@ ${E}`;
826
826
  if (!(this instanceof Ge && r instanceof Ge)) return !1;
827
827
  var n = this.g.j.h, i = this.g.i;
828
828
  r.g = r.g;
829
- var d = r.g.j.h;
829
+ var h = r.g.j.h;
830
830
  for (r = r.g.i; n.m; ) i = n.H(i), n = n.m;
831
- for (; d.m; ) r = d.H(r), d = d.m;
832
- return n === d && i === r;
831
+ for (; h.m; ) r = h.H(r), h = h.m;
832
+ return n === h && i === r;
833
833
  }, clone: function() {
834
834
  if (this.g.i || Qe(this), this.g.G) return this.g.count.value += 1, this;
835
- var r = Ne, n = Object, i = n.create, d = Object.getPrototypeOf(this), f = this.g;
836
- return r = r(i.call(n, d, { g: { value: { count: f.count, F: f.F, G: f.G, i: f.i, j: f.j, l: f.l, v: f.v } } })), r.g.count.value += 1, r.g.F = !1, r;
835
+ var r = Ne, n = Object, i = n.create, h = Object.getPrototypeOf(this), g = this.g;
836
+ return r = r(i.call(n, h, { g: { value: { count: g.count, F: g.F, G: g.G, i: g.i, j: g.j, l: g.l, v: g.v } } })), r.g.count.value += 1, r.g.F = !1, r;
837
837
  }, delete() {
838
838
  if (this.g.i || Qe(this), this.g.F && !this.g.G) throw new W("Object already scheduled for deletion");
839
839
  It(this);
@@ -851,11 +851,11 @@ ${E}`;
851
851
  return this.O && (e = this.O(e)), e;
852
852
  }, N(e) {
853
853
  this.B?.(e);
854
- }, o: 8, readValueFromPointer: ze, fromWireType: Pt }), ue.push(0, 1, void 0, 1, null, 1, !0, 1, !1, 1), g(ue.length === 10), o.count_emval_handles = () => ue.length / 2 - 5 - it.length, o.noExitRuntime && (Se = o.noExitRuntime), o.print && (l = o.print), o.printErr && (k = o.printErr), o.wasmBinary && (w = o.wasmBinary), o.FS_createDataFile = function() {
854
+ }, o: 8, readValueFromPointer: ze, fromWireType: Pt }), ue.push(0, 1, void 0, 1, null, 1, !0, 1, !1, 1), f(ue.length === 10), o.count_emval_handles = () => ue.length / 2 - 5 - it.length, o.noExitRuntime && (Se = o.noExitRuntime), o.print && (l = o.print), o.printErr && (S = o.printErr), o.wasmBinary && (w = o.wasmBinary), o.FS_createDataFile = function() {
855
855
  re();
856
856
  }, o.FS_createPreloadedFile = function() {
857
857
  re();
858
- }, Object.getOwnPropertyDescriptor(o, "fetchSettings") && X("`Module.fetchSettings` was supplied but `fetchSettings` not included in INCOMING_MODULE_JS_API"), o.thisProgram && (P = o.thisProgram), g(typeof o.memoryInitializerPrefixURL > "u", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"), g(typeof o.pthreadMainPrefixURL > "u", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"), g(typeof o.cdInitializerPrefixURL > "u", "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"), g(typeof o.filePackagePrefixURL > "u", "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"), g(typeof o.read > "u", "Module.read option was removed"), g(typeof o.readAsync > "u", "Module.readAsync option was removed (modify readAsync in JS)"), g(typeof o.readBinary > "u", "Module.readBinary option was removed (modify readBinary in JS)"), g(typeof o.setWindowTitle > "u", "Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"), g(typeof o.TOTAL_MEMORY > "u", "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"), g(typeof o.ENVIRONMENT > "u", "Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)"), g(typeof o.STACK_SIZE > "u", "STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"), g(typeof o.wasmMemory > "u", "Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"), g(typeof o.INITIAL_MEMORY > "u", "Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically"), "writeI53ToI64 writeI53ToI64Clamped writeI53ToI64Signaling writeI53ToU64Clamped writeI53ToU64Signaling readI53FromI64 readI53FromU64 convertI32PairToI53 convertI32PairToI53Checked convertU32PairToI53 getTempRet0 setTempRet0 zeroMemory strError inetPton4 inetNtop4 inetPton6 inetNtop6 readSockaddr writeSockaddr emscriptenLog readEmAsmArgs jstoi_q listenOnce autoResumeAudioContext getDynCaller dynCall runtimeKeepalivePush runtimeKeepalivePop asmjsMangle asyncLoad mmapAlloc HandleAllocator getNativeTypeSize addOnInit addOnPostCtor addOnPreMain addOnExit STACK_SIZE STACK_ALIGN POINTER_SIZE ASSERTIONS getCFunc ccall cwrap uleb128Encode sigToWasmTypes generateFuncType convertJsFunctionToWasm getEmptyTableSlot updateTableMap getFunctionAddress addFunction removeFunction reallyNegative unSign strLen reSign formatString intArrayFromString intArrayToString AsciiToString stringToAscii stringToNewUTF8 stringToUTF8OnStack writeArrayToMemory registerKeyEventCallback maybeCStringToJsString findEventTarget getBoundingClientRect fillMouseEventData registerMouseEventCallback registerWheelEventCallback registerUiEventCallback registerFocusEventCallback fillDeviceOrientationEventData registerDeviceOrientationEventCallback fillDeviceMotionEventData registerDeviceMotionEventCallback screenOrientation fillOrientationChangeEventData registerOrientationChangeEventCallback fillFullscreenChangeEventData registerFullscreenChangeEventCallback JSEvents_requestFullscreen JSEvents_resizeCanvasForFullscreen registerRestoreOldStyle hideEverythingExceptGivenElement restoreHiddenElements setLetterbox softFullscreenResizeWebGLRenderTarget doRequestFullscreen fillPointerlockChangeEventData registerPointerlockChangeEventCallback registerPointerlockErrorEventCallback requestPointerLock fillVisibilityChangeEventData registerVisibilityChangeEventCallback registerTouchEventCallback fillGamepadEventData registerGamepadEventCallback registerBeforeUnloadEventCallback fillBatteryEventData battery registerBatteryEventCallback setCanvasElementSize getCanvasElementSize jsStackTrace getCallstack convertPCtoSourceLocation wasiRightsToMuslOFlags wasiOFlagsToMuslOFlags initRandomFill randomFill safeSetTimeout setImmediateWrapped safeRequestAnimationFrame clearImmediateWrapped registerPostMainLoop registerPreMainLoop getPromise makePromise idsToPromises makePromiseCallback Browser_asyncPrepareDataCounter isLeapYear ydayFromDate arraySum addDays getSocketFromFD getSocketAddress heapObjectForWebGLType toTypedArrayIndex webgl_enable_ANGLE_instanced_arrays webgl_enable_OES_vertex_array_object webgl_enable_WEBGL_draw_buffers webgl_enable_WEBGL_multi_draw webgl_enable_EXT_polygon_offset_clamp webgl_enable_EXT_clip_control webgl_enable_WEBGL_polygon_mode emscriptenWebGLGet computeUnpackAlignedImageSize colorChannelsInGlTextureFormat emscriptenWebGLGetTexPixelData emscriptenWebGLGetUniform webglGetUniformLocation webglPrepareUniformLocationsBeforeFirstUse webglGetLeftBracePos emscriptenWebGLGetVertexAttrib __glGetActiveAttribOrUniform writeGLArray registerWebGlEventCallback runAndAbortIfError ALLOC_NORMAL ALLOC_STACK allocate writeStringToMemory writeAsciiToMemory demangle stackTrace getFunctionArgsName createJsInvokerSignature PureVirtualError registerInheritedInstance unregisterInheritedInstance getInheritedInstanceCount getLiveInheritedInstances setDelayFunction getStringOrSymbol emval_get_global".split(" ").forEach(function(e) {
858
+ }, Object.getOwnPropertyDescriptor(o, "fetchSettings") && X("`Module.fetchSettings` was supplied but `fetchSettings` not included in INCOMING_MODULE_JS_API"), o.thisProgram && (R = o.thisProgram), f(typeof o.memoryInitializerPrefixURL > "u", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"), f(typeof o.pthreadMainPrefixURL > "u", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"), f(typeof o.cdInitializerPrefixURL > "u", "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"), f(typeof o.filePackagePrefixURL > "u", "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"), f(typeof o.read > "u", "Module.read option was removed"), f(typeof o.readAsync > "u", "Module.readAsync option was removed (modify readAsync in JS)"), f(typeof o.readBinary > "u", "Module.readBinary option was removed (modify readBinary in JS)"), f(typeof o.setWindowTitle > "u", "Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"), f(typeof o.TOTAL_MEMORY > "u", "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"), f(typeof o.ENVIRONMENT > "u", "Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)"), f(typeof o.STACK_SIZE > "u", "STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"), f(typeof o.wasmMemory > "u", "Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"), f(typeof o.INITIAL_MEMORY > "u", "Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically"), "writeI53ToI64 writeI53ToI64Clamped writeI53ToI64Signaling writeI53ToU64Clamped writeI53ToU64Signaling readI53FromI64 readI53FromU64 convertI32PairToI53 convertI32PairToI53Checked convertU32PairToI53 getTempRet0 setTempRet0 zeroMemory strError inetPton4 inetNtop4 inetPton6 inetNtop6 readSockaddr writeSockaddr emscriptenLog readEmAsmArgs jstoi_q listenOnce autoResumeAudioContext getDynCaller dynCall runtimeKeepalivePush runtimeKeepalivePop asmjsMangle asyncLoad mmapAlloc HandleAllocator getNativeTypeSize addOnInit addOnPostCtor addOnPreMain addOnExit STACK_SIZE STACK_ALIGN POINTER_SIZE ASSERTIONS getCFunc ccall cwrap uleb128Encode sigToWasmTypes generateFuncType convertJsFunctionToWasm getEmptyTableSlot updateTableMap getFunctionAddress addFunction removeFunction reallyNegative unSign strLen reSign formatString intArrayFromString intArrayToString AsciiToString stringToAscii stringToNewUTF8 stringToUTF8OnStack writeArrayToMemory registerKeyEventCallback maybeCStringToJsString findEventTarget getBoundingClientRect fillMouseEventData registerMouseEventCallback registerWheelEventCallback registerUiEventCallback registerFocusEventCallback fillDeviceOrientationEventData registerDeviceOrientationEventCallback fillDeviceMotionEventData registerDeviceMotionEventCallback screenOrientation fillOrientationChangeEventData registerOrientationChangeEventCallback fillFullscreenChangeEventData registerFullscreenChangeEventCallback JSEvents_requestFullscreen JSEvents_resizeCanvasForFullscreen registerRestoreOldStyle hideEverythingExceptGivenElement restoreHiddenElements setLetterbox softFullscreenResizeWebGLRenderTarget doRequestFullscreen fillPointerlockChangeEventData registerPointerlockChangeEventCallback registerPointerlockErrorEventCallback requestPointerLock fillVisibilityChangeEventData registerVisibilityChangeEventCallback registerTouchEventCallback fillGamepadEventData registerGamepadEventCallback registerBeforeUnloadEventCallback fillBatteryEventData battery registerBatteryEventCallback setCanvasElementSize getCanvasElementSize jsStackTrace getCallstack convertPCtoSourceLocation wasiRightsToMuslOFlags wasiOFlagsToMuslOFlags initRandomFill randomFill safeSetTimeout setImmediateWrapped safeRequestAnimationFrame clearImmediateWrapped registerPostMainLoop registerPreMainLoop getPromise makePromise idsToPromises makePromiseCallback Browser_asyncPrepareDataCounter isLeapYear ydayFromDate arraySum addDays getSocketFromFD getSocketAddress heapObjectForWebGLType toTypedArrayIndex webgl_enable_ANGLE_instanced_arrays webgl_enable_OES_vertex_array_object webgl_enable_WEBGL_draw_buffers webgl_enable_WEBGL_multi_draw webgl_enable_EXT_polygon_offset_clamp webgl_enable_EXT_clip_control webgl_enable_WEBGL_polygon_mode emscriptenWebGLGet computeUnpackAlignedImageSize colorChannelsInGlTextureFormat emscriptenWebGLGetTexPixelData emscriptenWebGLGetUniform webglGetUniformLocation webglPrepareUniformLocationsBeforeFirstUse webglGetLeftBracePos emscriptenWebGLGetVertexAttrib __glGetActiveAttribOrUniform writeGLArray registerWebGlEventCallback runAndAbortIfError ALLOC_NORMAL ALLOC_STACK allocate writeStringToMemory writeAsciiToMemory demangle stackTrace getFunctionArgsName createJsInvokerSignature PureVirtualError registerInheritedInstance unregisterInheritedInstance getInheritedInstanceCount getLiveInheritedInstances setDelayFunction getStringOrSymbol emval_get_global".split(" ").forEach(function(e) {
859
859
  Fe(e, () => {
860
860
  var t = `\`${e}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`, r = e;
861
861
  r.startsWith("_") || (r = "$" + e), t += ` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${r}')`, $e(e) && (t += ". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"), me(t);
@@ -869,22 +869,22 @@ ${E}`;
869
869
  throw e = new WebAssembly.Exception(ie.__cpp_exception, [e], { traceStack: !0 }), e.message = Mt(e), e;
870
870
  }, _abort_js: () => X("native code called abort()"), _embind_register_bigint: (e, t, r, n, i) => {
871
871
  t = ne(t);
872
- var d = t.indexOf("u") != -1;
873
- d && (i = (1n << 64n) - 1n), ce(e, { name: t, fromWireType: (f) => f, toWireType: function(f, p) {
872
+ var h = t.indexOf("u") != -1;
873
+ h && (i = (1n << 64n) - 1n), ce(e, { name: t, fromWireType: (g) => g, toWireType: function(g, p) {
874
874
  if (typeof p != "bigint" && typeof p != "number") throw new TypeError(`Cannot convert "${ye(p)}" to ${this.name}`);
875
875
  if (typeof p == "number" && (p = BigInt(p)), p < n || p > i) throw new TypeError(`Passing a number "${ye(p)}" from JS side to C/C++ side to an argument of type "${t}", which is outside the valid range [${n}, ${i}]!`);
876
876
  return p;
877
- }, o: 8, readValueFromPointer: kt(t, r, !d), s: null });
877
+ }, o: 8, readValueFromPointer: kt(t, r, !h), s: null });
878
878
  }, _embind_register_bool: (e, t, r, n) => {
879
879
  t = ne(t), ce(e, { name: t, fromWireType: function(i) {
880
880
  return !!i;
881
- }, toWireType: function(i, d) {
882
- return d ? r : n;
881
+ }, toWireType: function(i, h) {
882
+ return h ? r : n;
883
883
  }, o: 8, readValueFromPointer: function(i) {
884
- return this.fromWireType(h[i]);
884
+ return this.fromWireType(d[i]);
885
885
  }, s: null });
886
- }, _embind_register_class: (e, t, r, n, i, d, f, p, A, O, E, B, J) => {
887
- E = ne(E), d = fe(i, d), p &&= fe(f, p), O &&= fe(A, O), J = fe(B, J);
886
+ }, _embind_register_class: (e, t, r, n, i, h, g, p, O, $, E, B, J) => {
887
+ E = ne(E), h = fe(i, h), p &&= fe(g, p), $ &&= fe(O, $), J = fe(B, J);
888
888
  var Y = yr(E);
889
889
  Rt(Y, function() {
890
890
  Ae(`Cannot construct ${E} due to unbound types`, [n]);
@@ -900,70 +900,70 @@ ${E}`;
900
900
  });
901
901
  var Te = Object.create(xe, { constructor: { value: q } });
902
902
  q.prototype = Te;
903
- var le = new wr(E, q, Te, J, ae, d, p, O);
903
+ var le = new wr(E, q, Te, J, ae, h, p, $);
904
904
  if (le.m) {
905
905
  var we;
906
906
  (we = le.m).I ?? (we.I = []), le.m.I.push(le);
907
907
  }
908
908
  return ae = new Ve(E, le, !0, !1, !1), we = new Ve(E + "*", le, !1, !1, !1), xe = new Ve(E + " const*", le, !1, !0, !1), At[e] = { pointerType: we, P: xe }, xr(Y, q), [ae, we, xe];
909
909
  });
910
- }, _embind_register_class_class_function: (e, t, r, n, i, d, f, p) => {
911
- var A = nt(r, n);
912
- t = ne(t), t = Nt(t), d = fe(i, d, p), ge([], [e], (O) => {
910
+ }, _embind_register_class_class_function: (e, t, r, n, i, h, g, p) => {
911
+ var O = nt(r, n);
912
+ t = ne(t), t = Nt(t), h = fe(i, h, p), ge([], [e], ($) => {
913
913
  function E() {
914
- Ae(`Cannot call ${B} due to unbound types`, A);
914
+ Ae(`Cannot call ${B} due to unbound types`, O);
915
915
  }
916
- O = O[0];
917
- var B = `${O.name}.${t}`;
916
+ $ = $[0];
917
+ var B = `${$.name}.${t}`;
918
918
  t.startsWith("@@") && (t = Symbol[t.substring(2)]);
919
- var J = O.h.constructor;
920
- return J[t] === void 0 ? (E.C = r - 1, J[t] = E) : (Ot(J, t, B), J[t].u[r - 1] = E), ge([], A, (Y) => {
921
- if (Y = rt(B, [Y[0], null].concat(Y.slice(1)), null, d, f, p), J[t].u === void 0 ? (Y.C = r - 1, J[t] = Y) : J[t].u[r - 1] = Y, O.h.I) for (let q of O.h.I) q.constructor.hasOwnProperty(t) || (q.constructor[t] = Y);
919
+ var J = $.h.constructor;
920
+ return J[t] === void 0 ? (E.C = r - 1, J[t] = E) : (Ot(J, t, B), J[t].u[r - 1] = E), ge([], O, (Y) => {
921
+ if (Y = rt(B, [Y[0], null].concat(Y.slice(1)), null, h, g, p), J[t].u === void 0 ? (Y.C = r - 1, J[t] = Y) : J[t].u[r - 1] = Y, $.h.I) for (let q of $.h.I) q.constructor.hasOwnProperty(t) || (q.constructor[t] = Y);
922
922
  return [];
923
923
  }), [];
924
924
  });
925
- }, _embind_register_class_constructor: (e, t, r, n, i, d) => {
926
- g(0 < t);
927
- var f = nt(t, r);
925
+ }, _embind_register_class_constructor: (e, t, r, n, i, h) => {
926
+ f(0 < t);
927
+ var g = nt(t, r);
928
928
  i = fe(n, i), ge([], [e], (p) => {
929
929
  p = p[0];
930
- var A = `constructor ${p.name}`;
930
+ var O = `constructor ${p.name}`;
931
931
  if (p.h.D === void 0 && (p.h.D = []), p.h.D[t - 1] !== void 0) throw new W(`Cannot register multiple constructors with identical number of parameters (${t - 1}) for class '${p.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);
932
932
  return p.h.D[t - 1] = () => {
933
- Ae(`Cannot construct ${p.name} due to unbound types`, f);
934
- }, ge([], f, (O) => (O.splice(1, 0, null), p.h.D[t - 1] = rt(A, O, null, i, d), [])), [];
933
+ Ae(`Cannot construct ${p.name} due to unbound types`, g);
934
+ }, ge([], g, ($) => ($.splice(1, 0, null), p.h.D[t - 1] = rt(O, $, null, i, h), [])), [];
935
935
  });
936
- }, _embind_register_class_function: (e, t, r, n, i, d, f, p, A) => {
937
- var O = nt(r, n);
938
- t = ne(t), t = Nt(t), d = fe(i, d, A), ge([], [e], (E) => {
936
+ }, _embind_register_class_function: (e, t, r, n, i, h, g, p, O) => {
937
+ var $ = nt(r, n);
938
+ t = ne(t), t = Nt(t), h = fe(i, h, O), ge([], [e], (E) => {
939
939
  function B() {
940
- Ae(`Cannot call ${J} due to unbound types`, O);
940
+ Ae(`Cannot call ${J} due to unbound types`, $);
941
941
  }
942
942
  E = E[0];
943
943
  var J = `${E.name}.${t}`;
944
944
  t.startsWith("@@") && (t = Symbol[t.substring(2)]), p && E.h.Z.push(t);
945
945
  var Y = E.h.A, q = Y[t];
946
- return q === void 0 || q.u === void 0 && q.className !== E.name && q.C === r - 2 ? (B.C = r - 2, B.className = E.name, Y[t] = B) : (Ot(Y, t, J), Y[t].u[r - 2] = B), ge([], O, (ae) => (ae = rt(J, ae, E, d, f, A), Y[t].u === void 0 ? (ae.C = r - 2, Y[t] = ae) : Y[t].u[r - 2] = ae, [])), [];
946
+ return q === void 0 || q.u === void 0 && q.className !== E.name && q.C === r - 2 ? (B.C = r - 2, B.className = E.name, Y[t] = B) : (Ot(Y, t, J), Y[t].u[r - 2] = B), ge([], $, (ae) => (ae = rt(J, ae, E, h, g, O), Y[t].u === void 0 ? (ae.C = r - 2, Y[t] = ae) : Y[t].u[r - 2] = ae, [])), [];
947
947
  });
948
- }, _embind_register_class_property: (e, t, r, n, i, d, f, p, A, O) => {
948
+ }, _embind_register_class_property: (e, t, r, n, i, h, g, p, O, $) => {
949
949
  t = ne(t), i = fe(n, i), ge([], [e], (E) => {
950
950
  E = E[0];
951
951
  var B = `${E.name}.${t}`, J = { get() {
952
- Ae(`Cannot access ${B} due to unbound types`, [r, f]);
952
+ Ae(`Cannot access ${B} due to unbound types`, [r, g]);
953
953
  }, enumerable: !0, configurable: !0 };
954
- return J.set = A ? () => Ae(`Cannot access ${B} due to unbound types`, [r, f]) : () => {
954
+ return J.set = O ? () => Ae(`Cannot access ${B} due to unbound types`, [r, g]) : () => {
955
955
  throw new W(B + " is a read-only property");
956
- }, Object.defineProperty(E.h.A, t, J), ge([], A ? [r, f] : [r], (Y) => {
956
+ }, Object.defineProperty(E.h.A, t, J), ge([], O ? [r, g] : [r], (Y) => {
957
957
  var q = Y[0], ae = { get() {
958
958
  var Te = Ut(this, E, B + " getter");
959
- return q.fromWireType(i(d, Te));
959
+ return q.fromWireType(i(h, Te));
960
960
  }, enumerable: !0 };
961
- if (A) {
962
- A = fe(p, A);
961
+ if (O) {
962
+ O = fe(p, O);
963
963
  var xe = Y[1];
964
964
  ae.set = function(Te) {
965
965
  var le = Ut(this, E, B + " setter"), we = [];
966
- A(O, le, xe.toWireType(we, Te)), tt(we);
966
+ O($, le, xe.toWireType(we, Te)), tt(we);
967
967
  };
968
968
  }
969
969
  return Object.defineProperty(E.h.A, t, ae), [];
@@ -972,9 +972,9 @@ ${E}`;
972
972
  }, _embind_register_emval: (e) => ce(e, jt), _embind_register_enum: (e, t, r, n) => {
973
973
  function i() {
974
974
  }
975
- t = ne(t), i.values = {}, ce(e, { name: t, constructor: i, fromWireType: function(d) {
976
- return this.constructor.values[d];
977
- }, toWireType: (d, f) => f.value, o: 8, readValueFromPointer: Mr(t, r, n), s: null }), Rt(t, i);
975
+ t = ne(t), i.values = {}, ce(e, { name: t, constructor: i, fromWireType: function(h) {
976
+ return this.constructor.values[h];
977
+ }, toWireType: (h, g) => g.value, o: 8, readValueFromPointer: Mr(t, r, n), s: null }), Rt(t, i);
978
978
  }, _embind_register_enum_value: (e, t, r) => {
979
979
  var n = st(e, "enum");
980
980
  t = ne(t), e = n.constructor, n = Object.create(n.constructor.prototype, { value: { value: r }, constructor: { value: He(`${n.name}_${t}`, function() {
@@ -986,23 +986,23 @@ ${E}`;
986
986
  }, o: 8, readValueFromPointer: Sr(t, r), s: null });
987
987
  }, _embind_register_integer: (e, t, r, n, i) => {
988
988
  t = ne(t), i === -1 && (i = 4294967295);
989
- var d = (O) => O;
989
+ var h = ($) => $;
990
990
  if (n === 0) {
991
- var f = 32 - 8 * r;
992
- d = (O) => O << f >>> f;
991
+ var g = 32 - 8 * r;
992
+ h = ($) => $ << g >>> g;
993
993
  }
994
- var p = (O, E) => {
995
- if (typeof O != "number" && typeof O != "boolean") throw new TypeError(`Cannot convert "${ye(O)}" to ${E}`);
996
- if (O < n || O > i) throw new TypeError(`Passing a number "${ye(O)}" from JS side to C/C++ side to an argument of type "${t}", which is outside the valid range [${n}, ${i}]!`);
997
- }, A = t.includes("unsigned") ? function(O, E) {
994
+ var p = ($, E) => {
995
+ if (typeof $ != "number" && typeof $ != "boolean") throw new TypeError(`Cannot convert "${ye($)}" to ${E}`);
996
+ if ($ < n || $ > i) throw new TypeError(`Passing a number "${ye($)}" from JS side to C/C++ side to an argument of type "${t}", which is outside the valid range [${n}, ${i}]!`);
997
+ }, O = t.includes("unsigned") ? function($, E) {
998
998
  return p(E, this.name), E >>> 0;
999
- } : function(O, E) {
999
+ } : function($, E) {
1000
1000
  return p(E, this.name), E;
1001
1001
  };
1002
- ce(e, { name: t, fromWireType: d, toWireType: A, o: 8, readValueFromPointer: kt(t, r, n !== 0), s: null });
1002
+ ce(e, { name: t, fromWireType: h, toWireType: O, o: 8, readValueFromPointer: kt(t, r, n !== 0), s: null });
1003
1003
  }, _embind_register_memory_view: (e, t, r) => {
1004
- function n(d) {
1005
- return new i(m.buffer, T[d + 4 >> 2], T[d >> 2]);
1004
+ function n(h) {
1005
+ return new i(y.buffer, m[h + 4 >> 2], m[h >> 2]);
1006
1006
  }
1007
1007
  var i = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, BigInt64Array, BigUint64Array][t];
1008
1008
  r = ne(r), ce(e, { name: r, fromWireType: n, o: 8, readValueFromPointer: n }, { V: !0 });
@@ -1010,33 +1010,33 @@ ${E}`;
1010
1010
  ce(e, kr);
1011
1011
  }, _embind_register_std_string: (e, t) => {
1012
1012
  t = ne(t), ce(e, { name: t, fromWireType: function(r) {
1013
- for (var n = T[r >> 2], i = r + 4, d, f = i, p = 0; p <= n; ++p) {
1014
- var A = i + p;
1015
- (p == n || h[A] == 0) && (f = Ie(f, A - f), d === void 0 ? d = f : (d += "\0", d += f), f = A + 1);
1013
+ for (var n = m[r >> 2], i = r + 4, h, g = i, p = 0; p <= n; ++p) {
1014
+ var O = i + p;
1015
+ (p == n || d[O] == 0) && (g = Ie(g, O - g), h === void 0 ? h = g : (h += "\0", h += g), g = O + 1);
1016
1016
  }
1017
- return pe(r), d;
1017
+ return pe(r), h;
1018
1018
  }, toWireType: function(r, n) {
1019
1019
  n instanceof ArrayBuffer && (n = new Uint8Array(n));
1020
1020
  var i = typeof n == "string";
1021
1021
  if (!(i || ArrayBuffer.isView(n) && n.BYTES_PER_ELEMENT == 1)) throw new W("Cannot pass non-string to std::string");
1022
- var d = i ? Ye(n) : n.length, f = Vt(4 + d + 1), p = f + 4;
1023
- return T[f >> 2] = d, i ? Pe(n, p, d + 1) : h.set(n, p), r !== null && r.push(pe, f), f;
1022
+ var h = i ? Ye(n) : n.length, g = Vt(4 + h + 1), p = g + 4;
1023
+ return m[g >> 2] = h, i ? Pe(n, p, h + 1) : d.set(n, p), r !== null && r.push(pe, g), g;
1024
1024
  }, o: 8, readValueFromPointer: ze, s(r) {
1025
1025
  pe(r);
1026
1026
  } });
1027
1027
  }, _embind_register_std_wstring: (e, t, r) => {
1028
- if (r = ne(r), t === 2) var n = Ir, i = Cr, d = Ar, f = (p) => F[p >> 1];
1029
- else t === 4 && (n = Pr, i = Or, d = Rr, f = (p) => T[p >> 2]);
1028
+ if (r = ne(r), t === 2) var n = Ir, i = Cr, h = Ar, g = (p) => P[p >> 1];
1029
+ else t === 4 && (n = Pr, i = Or, h = Rr, g = (p) => m[p >> 2]);
1030
1030
  ce(e, { name: r, fromWireType: (p) => {
1031
- for (var A = T[p >> 2], O, E = p + 4, B = 0; B <= A; ++B) {
1031
+ for (var O = m[p >> 2], $, E = p + 4, B = 0; B <= O; ++B) {
1032
1032
  var J = p + 4 + B * t;
1033
- (B == A || f(J) == 0) && (E = n(E, J - E), O === void 0 ? O = E : (O += "\0", O += E), E = J + t);
1033
+ (B == O || g(J) == 0) && (E = n(E, J - E), $ === void 0 ? $ = E : ($ += "\0", $ += E), E = J + t);
1034
1034
  }
1035
- return pe(p), O;
1036
- }, toWireType: (p, A) => {
1037
- if (typeof A != "string") throw new W(`Cannot pass non-string to C++ string type ${r}`);
1038
- var O = d(A), E = Vt(4 + O + t);
1039
- return T[E >> 2] = O / t, i(A, E + 4, O + t), p !== null && p.push(pe, E), E;
1035
+ return pe(p), $;
1036
+ }, toWireType: (p, O) => {
1037
+ if (typeof O != "string") throw new W(`Cannot pass non-string to C++ string type ${r}`);
1038
+ var $ = h(O), E = Vt(4 + $ + t);
1039
+ return m[E >> 2] = $ / t, i(O, E + 4, $ + t), p !== null && p.push(pe, E), E;
1040
1040
  }, o: 8, readValueFromPointer: ze, s(p) {
1041
1041
  pe(p);
1042
1042
  } });
@@ -1051,14 +1051,14 @@ ${E}`;
1051
1051
  var n = t.shift();
1052
1052
  e--;
1053
1053
  var i = `return function (obj, func, destructorsRef, args) {
1054
- `, d = 0, f = [];
1055
- r === 0 && f.push("obj");
1056
- for (var p = ["retType"], A = [n], O = 0; O < e; ++O) f.push(`arg${O}`), p.push(`argType${O}`), A.push(t[O]), i += ` var arg${O} = argType${O}.readValueFromPointer(args${d ? "+" + d : ""});
1057
- `, d += t[O].o;
1058
- return i += ` var rv = ${r === 1 ? "new func" : "func.call"}(${f.join(", ")});
1059
- `, n.W || (p.push("emval_returnValue"), A.push(Lr), i += ` return emval_returnValue(retType, destructorsRef, rv);
1054
+ `, h = 0, g = [];
1055
+ r === 0 && g.push("obj");
1056
+ for (var p = ["retType"], O = [n], $ = 0; $ < e; ++$) g.push(`arg${$}`), p.push(`argType${$}`), O.push(t[$]), i += ` var arg${$} = argType${$}.readValueFromPointer(args${h ? "+" + h : ""});
1057
+ `, h += t[$].o;
1058
+ return i += ` var rv = ${r === 1 ? "new func" : "func.call"}(${g.join(", ")});
1059
+ `, n.W || (p.push("emval_returnValue"), O.push(Lr), i += ` return emval_returnValue(retType, destructorsRef, rv);
1060
1060
  `), e = new Function(...p, i + `};
1061
- `)(...A), r = `methodCaller<(${t.map((E) => E.name).join(", ")}) => ${n.name}>`, $r(He(r, e));
1061
+ `)(...O), r = `methodCaller<(${t.map((E) => E.name).join(", ")}) => ${n.name}>`, $r(He(r, e));
1062
1062
  }, _emval_incref: (e) => {
1063
1063
  9 < e && (ue[e + 1] += 1);
1064
1064
  }, _emval_run_destructors: (e) => {
@@ -1067,104 +1067,104 @@ ${E}`;
1067
1067
  }, _emval_take_value: (e, t) => (e = st(e, "_emval_take_value"), e = e.readValueFromPointer(t), Je(e)), _setitimer_js: (e, t) => {
1068
1068
  if (Re[e] && (clearTimeout(Re[e].id), delete Re[e]), !t) return 0;
1069
1069
  var r = setTimeout(() => {
1070
- g(e in Re), delete Re[e], Nr(() => Dr(e, performance.now()));
1070
+ f(e in Re), delete Re[e], Nr(() => Dr(e, performance.now()));
1071
1071
  }, t);
1072
1072
  return Re[e] = { id: r, da: t }, 0;
1073
1073
  }, _tzset_js: (e, t, r, n) => {
1074
- var i = (/* @__PURE__ */ new Date()).getFullYear(), d = new Date(i, 0, 1).getTimezoneOffset();
1075
- i = new Date(i, 6, 1).getTimezoneOffset(), T[e >> 2] = 60 * Math.max(d, i), L[t >> 2] = +(d != i), t = (f) => {
1076
- var p = Math.abs(f);
1077
- return `UTC${0 <= f ? "-" : "+"}${String(Math.floor(p / 60)).padStart(2, "0")}${String(p % 60).padStart(2, "0")}`;
1078
- }, e = t(d), t = t(i), g(e), g(t), g(16 >= Ye(e), `timezone name truncated to fit in TZNAME_MAX (${e})`), g(16 >= Ye(t), `timezone name truncated to fit in TZNAME_MAX (${t})`), i < d ? (Pe(e, r, 17), Pe(t, n, 17)) : (Pe(e, n, 17), Pe(t, r, 17));
1074
+ var i = (/* @__PURE__ */ new Date()).getFullYear(), h = new Date(i, 0, 1).getTimezoneOffset();
1075
+ i = new Date(i, 6, 1).getTimezoneOffset(), m[e >> 2] = 60 * Math.max(h, i), j[t >> 2] = +(h != i), t = (g) => {
1076
+ var p = Math.abs(g);
1077
+ return `UTC${0 <= g ? "-" : "+"}${String(Math.floor(p / 60)).padStart(2, "0")}${String(p % 60).padStart(2, "0")}`;
1078
+ }, e = t(h), t = t(i), f(e), f(t), f(16 >= Ye(e), `timezone name truncated to fit in TZNAME_MAX (${e})`), f(16 >= Ye(t), `timezone name truncated to fit in TZNAME_MAX (${t})`), i < h ? (Pe(e, r, 17), Pe(t, n, 17)) : (Pe(e, n, 17), Pe(t, r, 17));
1079
1079
  }, clock_time_get: function(e, t, r) {
1080
- return 0 <= e && 3 >= e ? ($[r >> 3] = BigInt(Math.round(1e6 * (e === 0 ? Date.now() : performance.now()))), 0) : 28;
1080
+ return 0 <= e && 3 >= e ? (k[r >> 3] = BigInt(Math.round(1e6 * (e === 0 ? Date.now() : performance.now()))), 0) : 28;
1081
1081
  }, emscripten_resize_heap: (e) => {
1082
- var t = h.length;
1083
- if (e >>>= 0, g(e > t), 2147483648 < e) return k(`Cannot enlarge memory, requested ${e} bytes, but the limit is ${2147483648} bytes!`), !1;
1082
+ var t = d.length;
1083
+ if (e >>>= 0, f(e > t), 2147483648 < e) return S(`Cannot enlarge memory, requested ${e} bytes, but the limit is ${2147483648} bytes!`), !1;
1084
1084
  for (var r = 1; 4 >= r; r *= 2) {
1085
1085
  var n = t * (1 + 0.2 / r);
1086
1086
  n = Math.min(n, e + 100663296);
1087
- var i = Math, d = i.min;
1088
- n = Math.max(e, n), g(65536, "alignment argument is required"), i = d.call(i, 2147483648, 65536 * Math.ceil(n / 65536));
1087
+ var i = Math, h = i.min;
1088
+ n = Math.max(e, n), f(65536, "alignment argument is required"), i = h.call(i, 2147483648, 65536 * Math.ceil(n / 65536));
1089
1089
  e: {
1090
- d = i, n = S.buffer;
1091
- var f = (d - n.byteLength + 65535) / 65536 | 0;
1090
+ h = i, n = M.buffer;
1091
+ var g = (h - n.byteLength + 65535) / 65536 | 0;
1092
1092
  try {
1093
- S.grow(f), he();
1093
+ M.grow(g), he();
1094
1094
  var p = 1;
1095
1095
  break e;
1096
- } catch (A) {
1097
- k(`growMemory: Attempted to grow heap from ${n.byteLength} bytes to ${d} bytes, but got error: ${A}`);
1096
+ } catch (O) {
1097
+ S(`growMemory: Attempted to grow heap from ${n.byteLength} bytes to ${h} bytes, but got error: ${O}`);
1098
1098
  }
1099
1099
  p = void 0;
1100
1100
  }
1101
1101
  if (p) return !0;
1102
1102
  }
1103
- return k(`Failed to grow the heap from ${t} bytes to ${i} bytes, not enough memory!`), !1;
1103
+ return S(`Failed to grow the heap from ${t} bytes to ${i} bytes, not enough memory!`), !1;
1104
1104
  }, environ_get: (e, t) => {
1105
1105
  var r = 0, n = 0, i;
1106
1106
  for (i of Ht()) {
1107
- var d = t + r;
1108
- T[e + n >> 2] = d, r += Pe(i, d, 1 / 0) + 1, n += 4;
1107
+ var h = t + r;
1108
+ m[e + n >> 2] = h, r += Pe(i, h, 1 / 0) + 1, n += 4;
1109
1109
  }
1110
1110
  return 0;
1111
1111
  }, environ_sizes_get: (e, t) => {
1112
1112
  var r = Ht();
1113
- T[e >> 2] = r.length, e = 0;
1113
+ m[e >> 2] = r.length, e = 0;
1114
1114
  for (var n of r) e += Ye(n) + 1;
1115
- return T[t >> 2] = e, 0;
1115
+ return m[t >> 2] = e, 0;
1116
1116
  }, fd_close: () => {
1117
1117
  X("fd_close called without SYSCALLS_REQUIRE_FILESYSTEM");
1118
1118
  }, fd_seek: function() {
1119
1119
  return 70;
1120
1120
  }, fd_write: (e, t, r, n) => {
1121
- for (var i = 0, d = 0; d < r; d++) {
1122
- var f = T[t >> 2], p = T[t + 4 >> 2];
1121
+ for (var i = 0, h = 0; h < r; h++) {
1122
+ var g = m[t >> 2], p = m[t + 4 >> 2];
1123
1123
  t += 8;
1124
- for (var A = 0; A < p; A++) ht(e, h[f + A]);
1124
+ for (var O = 0; O < p; O++) ht(e, d[g + O]);
1125
1125
  i += p;
1126
1126
  }
1127
- return T[n >> 2] = i, 0;
1127
+ return m[n >> 2] = i, 0;
1128
1128
  }, proc_exit: Gt }, ie = await (async function() {
1129
- function e(d) {
1130
- d = ie = d.exports;
1131
- var f = {};
1132
- for (A in d) {
1133
- var p = d[A];
1134
- f[A] = typeof p == "function" ? wt(p) : p;
1129
+ function e(h) {
1130
+ h = ie = h.exports;
1131
+ var g = {};
1132
+ for (O in h) {
1133
+ var p = h[O];
1134
+ g[O] = typeof p == "function" ? wt(p) : p;
1135
1135
  }
1136
- if (ie = f, S = ie.memory, g(S, "memory not found in wasm exports"), he(), be = ie.__indirect_function_table, g(be, "table not found in wasm exports"), cr(), K--, o.monitorRunDependencies?.(K), g(Q["wasm-instantiate"]), delete Q["wasm-instantiate"], K == 0 && (ee !== null && (clearInterval(ee), ee = null), se)) {
1137
- var A = se;
1138
- se = null, A();
1136
+ if (ie = g, M = ie.memory, f(M, "memory not found in wasm exports"), he(), be = ie.__indirect_function_table, f(be, "table not found in wasm exports"), cr(), K--, o.monitorRunDependencies?.(K), f(Q["wasm-instantiate"]), delete Q["wasm-instantiate"], K == 0 && (ee !== null && (clearInterval(ee), ee = null), se)) {
1137
+ var O = se;
1138
+ se = null, O();
1139
1139
  }
1140
1140
  return ie;
1141
1141
  }
1142
- function t(d) {
1143
- return g(o === r, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"), r = null, e(d.instance);
1142
+ function t(h) {
1143
+ return f(o === r, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"), r = null, e(h.instance);
1144
1144
  }
1145
1145
  ve();
1146
1146
  var r = o, n = { env: zt, wasi_snapshot_preview1: zt };
1147
- if (o.instantiateWasm) return new Promise((d, f) => {
1147
+ if (o.instantiateWasm) return new Promise((h, g) => {
1148
1148
  try {
1149
- o.instantiateWasm(n, (p, A) => {
1150
- d(e(p, A));
1149
+ o.instantiateWasm(n, (p, O) => {
1150
+ h(e(p, O));
1151
1151
  });
1152
1152
  } catch (p) {
1153
- k(`Module.instantiateWasm callback failed with error: ${p}`), f(p);
1153
+ S(`Module.instantiateWasm callback failed with error: ${p}`), g(p);
1154
1154
  }
1155
1155
  });
1156
- Le ??= o.locateFile ? o.locateFile ? o.locateFile("libavoid.wasm", R) : R + "libavoid.wasm" : new URL("" + new URL("../libavoid.wasm?no-inline", import.meta.url).href, import.meta.url).href;
1156
+ Le ??= o.locateFile ? o.locateFile ? o.locateFile("libavoid.wasm", F) : F + "libavoid.wasm" : new URL("" + new URL("../libavoid.wasm?no-inline", import.meta.url).href, import.meta.url).href;
1157
1157
  try {
1158
1158
  var i = await dr(n);
1159
1159
  return t(i);
1160
- } catch (d) {
1161
- return I(d), Promise.reject(d);
1160
+ } catch (h) {
1161
+ return C(h), Promise.reject(h);
1162
1162
  }
1163
1163
  })(), Ur = te("__getTypeName", 1), Vt = te("malloc", 1), pe = te("free", 1), jr = te("fflush", 1), Wr = te("__funcs_on_exit", 0), Jt = ie.emscripten_stack_get_end, Dr = te("_emscripten_timeout", 2), Gr = ie.__trap, Hr = ie.emscripten_stack_init, Br = ie._emscripten_stack_restore, Yt = ie._emscripten_stack_alloc, qt = ie.emscripten_stack_get_current, zr = te("__cxa_decrement_exception_refcount", 1), Vr = te("__cxa_increment_exception_refcount", 1), Jr = te("__thrown_object_from_unwind_exception", 1), Yr = te("__get_exception_message", 3), Kt;
1164
1164
  function ft() {
1165
1165
  function e() {
1166
- if (g(!Kt), Kt = !0, o.calledRun = !0, !v) {
1167
- if (g(!C), C = !0, D(), ie.__wasm_call_ctors(), u(o), o.onRuntimeInitialized?.(), oe("onRuntimeInitialized"), g(!o._main, 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'), D(), o.postRun) for (typeof o.postRun == "function" && (o.postRun = [o.postRun]); o.postRun.length; ) {
1166
+ if (f(!Kt), Kt = !0, o.calledRun = !0, !v) {
1167
+ if (f(!A), A = !0, D(), ie.__wasm_call_ctors(), u(o), o.onRuntimeInitialized?.(), oe("onRuntimeInitialized"), f(!o._main, 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'), D(), o.postRun) for (typeof o.postRun == "function" && (o.postRun = [o.postRun]); o.postRun.length; ) {
1168
1168
  var t = o.postRun.shift();
1169
1169
  _t.push(t);
1170
1170
  }
@@ -1205,75 +1205,75 @@ async function Xe(a, s = {}) {
1205
1205
  await (er ??= Qt.load(rn).catch((l) => {
1206
1206
  throw er = void 0, l;
1207
1207
  }));
1208
- const u = Qt.getInstance(), I = new Map(a.nodes.map((l) => [l.id, l])), _ = (l) => {
1209
- const k = [];
1210
- for (let w = I.get(l).parentId; w; w = I.get(w).parentId)
1211
- k.push(w);
1212
- return k;
1213
- }, P = /* @__PURE__ */ new Map();
1208
+ const u = Qt.getInstance(), C = new Map(a.nodes.map((l) => [l.id, l])), _ = (l) => {
1209
+ const S = [];
1210
+ for (let w = C.get(l).parentId; w; w = C.get(w).parentId)
1211
+ S.push(w);
1212
+ return S;
1213
+ }, R = /* @__PURE__ */ new Map();
1214
1214
  for (const l of a.edges) {
1215
- const k = /* @__PURE__ */ new Set([..._(l.source), ..._(l.target)]), w = JSON.stringify([...k].sort()), S = P.get(w) ?? { open: k, edges: [] };
1216
- S.edges.push(l), P.set(w, S);
1215
+ const S = /* @__PURE__ */ new Set([..._(l.source), ..._(l.target)]), w = JSON.stringify([...S].sort()), M = R.get(w) ?? { open: S, edges: [] };
1216
+ M.edges.push(l), R.set(w, M);
1217
1217
  }
1218
- const R = /* @__PURE__ */ new Map();
1219
- for (const { open: l, edges: k } of P.values()) {
1218
+ const F = /* @__PURE__ */ new Map();
1219
+ for (const { open: l, edges: S } of R.values()) {
1220
1220
  const w = new u.Router(2);
1221
1221
  try {
1222
1222
  w.setRoutingParameter(u.RoutingParameter.shapeBufferDistance, b), w.setRoutingParameter(u.RoutingParameter.idealNudgingDistance, 8), w.setRoutingParameter(u.RoutingParameter.crossingPenalty, 80), w.setRoutingParameter(u.RoutingParameter.fixedSharedPathPenalty, 120), w.setRoutingParameter(u.RoutingParameter.portDirectionPenalty, 0), w.setRoutingOption(
1223
1223
  u.RoutingOption.nudgeOrthogonalSegmentsConnectedToShapes,
1224
- s.edgeAnchorInset === void 0 && !k.some((c) => c.sourcePort || c.targetPort || c.source === c.target)
1224
+ s.edgeAnchorInset === void 0 && !S.some((c) => c.sourcePort || c.targetPort || c.source === c.target)
1225
1225
  ), w.setRoutingOption(u.RoutingOption.nudgeSharedPathsWithCommonEndPoint, !0);
1226
- const S = new Map(
1227
- a.nodes.filter((c) => !l.has(c.id) && _(c.id).every(($) => l.has($))).map((c) => {
1228
- const $ = new u.Point(c.x, c.y), G = new u.Point(c.x + c.width, c.y + c.height), x = new u.Rectangle($, G), C = new u.ShapeRef(w, x);
1229
- return de($), de(G), de(x), [c.id, C];
1226
+ const M = new Map(
1227
+ a.nodes.filter((c) => !l.has(c.id) && _(c.id).every((k) => l.has(k))).map((c) => {
1228
+ const k = new u.Point(c.x, c.y), G = new u.Point(c.x + c.width, c.y + c.height), T = new u.Rectangle(k, G), A = new u.ShapeRef(w, T);
1229
+ return de(k), de(G), de(T), [c.id, A];
1230
1230
  })
1231
- ), v = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map();
1232
- for (const c of k) {
1233
- const $ = [c.source, c.target].sort().join("\0"), G = v.get($) ?? 0;
1234
- v.set($, G + 1), y.set(c.id, G % 2 === 0 ? -6 : 6);
1231
+ ), v = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map();
1232
+ for (const c of S) {
1233
+ const k = [c.source, c.target].sort().join("\0"), G = v.get(k) ?? 0;
1234
+ v.set(k, G + 1), I.set(c.id, G % 2 === 0 ? -6 : 6);
1235
1235
  }
1236
- let g = Ee.length + 2;
1237
- const m = /* @__PURE__ */ new Map(), h = (c, $) => Math.max(0, Math.min(1, c / $));
1236
+ let f = Ee.length + 2;
1237
+ const y = /* @__PURE__ */ new Map(), d = (c, k) => Math.max(0, Math.min(1, c / k));
1238
1238
  for (const c of a.nodes) {
1239
- const $ = S.get(c.id);
1240
- if (!$) continue;
1241
- const G = (x, C, N, j, H) => {
1239
+ const k = M.get(c.id);
1240
+ if (!k) continue;
1241
+ const G = (T, A, L, U, H) => {
1242
1242
  const D = new u.ShapeConnectionPin(
1243
- $,
1244
- x,
1245
- h(C, c.width),
1246
- h(N, c.height),
1243
+ k,
1244
+ T,
1245
+ d(A, c.width),
1246
+ d(L, c.height),
1247
1247
  !0,
1248
1248
  0,
1249
- j
1249
+ U
1250
1250
  );
1251
1251
  D.setExclusive(H), D.setConnectionCost(
1252
- c.width / 2 + c.height / 2 - Math.abs(C - c.width / 2) - Math.abs(N - c.height / 2)
1252
+ c.width / 2 + c.height / 2 - Math.abs(A - c.width / 2) - Math.abs(L - c.height / 2)
1253
1253
  );
1254
1254
  };
1255
- for (const x of new Set(c.ports?.map((C) => C.side))) {
1256
- const { x: C, y: N } = rr(c, x), j = Ee.indexOf(x) + 2;
1257
- G(j, C - c.x, N - c.y, tr[x], !1), m.set(
1255
+ for (const T of new Set(c.ports?.map((A) => A.side))) {
1256
+ const { x: A, y: L } = rr(c, T), U = Ee.indexOf(T) + 2;
1257
+ G(U, A - c.x, L - c.y, tr[T], !1), y.set(
1258
1258
  JSON.stringify([
1259
1259
  c.id,
1260
- h(C - c.x, c.width),
1261
- h(N - c.y, c.height),
1262
- x
1260
+ d(A - c.x, c.width),
1261
+ d(L - c.y, c.height),
1262
+ T
1263
1263
  ]),
1264
- j
1264
+ U
1265
1265
  );
1266
1266
  }
1267
1267
  }
1268
- const M = a.nodes.filter((c) => S.has(c.id)), F = (c, $, G, x, C, N = !1) => {
1269
- const j = b + 8, H = {
1270
- left: Math.min(c.x, $.x) - j,
1271
- right: Math.max(c.x + c.width, $.x + $.width) + j,
1272
- top: Math.min(c.y, $.y) - j,
1273
- bottom: Math.max(c.y + c.height, $.y + $.height) + j
1274
- }, D = M.filter(
1268
+ const x = a.nodes.filter((c) => M.has(c.id)), P = (c, k, G, T, A, L = !1) => {
1269
+ const U = b + 8, H = {
1270
+ left: Math.min(c.x, k.x) - U,
1271
+ right: Math.max(c.x + c.width, k.x + k.width) + U,
1272
+ top: Math.min(c.y, k.y) - U,
1273
+ bottom: Math.max(c.y + c.height, k.y + k.height) + U
1274
+ }, D = x.filter(
1275
1275
  (V) => V.x <= H.right && V.x + V.width >= H.left && V.y <= H.bottom && V.y + V.height >= H.top
1276
- ), z = S.get(c.id);
1276
+ ), z = M.get(c.id);
1277
1277
  if (z && G)
1278
1278
  return new u.ConnEnd(
1279
1279
  z,
@@ -1284,9 +1284,9 @@ async function Xe(a, s = {}) {
1284
1284
  side: c.ports.find((V) => V.id === G).side,
1285
1285
  position: rr(c, c.ports.find((V) => V.id === G).side)
1286
1286
  }
1287
- ] : C ? [{ side: "EAST", position: C }] : (N ? [nr(c, $).source] : Ee).flatMap((V) => {
1288
- const he = nn(c, V, $, x, o);
1289
- if (N) return [{ side: V, position: he }];
1287
+ ] : A ? [{ side: "EAST", position: A }] : (L ? [nr(c, k).source] : Ee).flatMap((V) => {
1288
+ const he = nn(c, V, k, T, o);
1289
+ if (L) return [{ side: V, position: he }];
1290
1290
  const K = V === "NORTH" || V === "SOUTH", se = K ? c.x : c.y, Q = K ? c.width : c.height, ee = se + Math.min(o, Q / 4), ve = se + Q - Math.min(o, Q / 4), X = [
1291
1291
  K ? he.x : he.y,
1292
1292
  ee,
@@ -1304,23 +1304,23 @@ async function Xe(a, s = {}) {
1304
1304
  if (z) {
1305
1305
  const V = (Q, ee) => JSON.stringify([
1306
1306
  c.id,
1307
- h(ee.x - c.x, c.width),
1308
- h(ee.y - c.y, c.height),
1307
+ d(ee.x - c.x, c.width),
1308
+ d(ee.y - c.y, c.height),
1309
1309
  Q
1310
- ]), K = !!(G || C || N) || Z.every(
1311
- (Q) => m.has(V(Q.side, Q.position))
1312
- ) ? m.get(V(Z[0].side, Z[0].position)) : void 0;
1310
+ ]), K = !!(G || A || L) || Z.every(
1311
+ (Q) => y.has(V(Q.side, Q.position))
1312
+ ) ? y.get(V(Z[0].side, Z[0].position)) : void 0;
1313
1313
  if (K !== void 0) return new u.ConnEnd(z, K);
1314
- const se = K ?? g++;
1314
+ const se = K ?? f++;
1315
1315
  for (const { side: Q, position: ee } of Z) {
1316
1316
  const ve = V(Q, ee);
1317
- if (m.has(ve)) continue;
1318
- m.set(ve, se);
1317
+ if (y.has(ve)) continue;
1318
+ y.set(ve, se);
1319
1319
  const X = ee.x - c.x, re = ee.y - c.y, te = new u.ShapeConnectionPin(
1320
1320
  z,
1321
1321
  se,
1322
- h(X, c.width),
1323
- h(re, c.height),
1322
+ d(X, c.width),
1323
+ d(re, c.height),
1324
1324
  !0,
1325
1325
  0,
1326
1326
  tr[Q]
@@ -1331,35 +1331,35 @@ async function Xe(a, s = {}) {
1331
1331
  }
1332
1332
  return new u.ConnEnd(z, se);
1333
1333
  }
1334
- const oe = nr(c, $).source, $e = Z.find((V) => V.side === oe)?.position ?? Z[0].position, Fe = new u.Point($e.x, $e.y), Ue = new u.ConnEnd(Fe);
1334
+ const oe = nr(c, k).source, $e = Z.find((V) => V.side === oe)?.position ?? Z[0].position, Fe = new u.Point($e.x, $e.y), Ue = new u.ConnEnd(Fe);
1335
1335
  return de(Fe), Ue;
1336
- }, L = (c) => +!!(c.sourcePort || c.targetPort || c.source === c.target || v.get([c.source, c.target].sort().join("\0")) > 1), T = [...k].sort((c, $) => L($) - L(c)).map((c) => {
1337
- const $ = I.get(c.source), G = I.get(c.target), x = c.source === c.target, C = v.get([c.source, c.target].sort().join("\0")) > 1, N = F(
1338
- $,
1336
+ }, j = (c) => +!!(c.sourcePort || c.targetPort || c.source === c.target || v.get([c.source, c.target].sort().join("\0")) > 1), m = [...S].sort((c, k) => j(k) - j(c)).map((c) => {
1337
+ const k = C.get(c.source), G = C.get(c.target), T = c.source === c.target, A = v.get([c.source, c.target].sort().join("\0")) > 1, L = P(
1338
+ k,
1339
1339
  G,
1340
1340
  c.sourcePort,
1341
- y.get(c.id),
1342
- x ? { x: $.x + $.width, y: $.y + $.height / 3 } : void 0,
1343
- C
1344
- ), j = F(
1341
+ I.get(c.id),
1342
+ T ? { x: k.x + k.width, y: k.y + k.height / 3 } : void 0,
1343
+ A
1344
+ ), U = P(
1345
1345
  G,
1346
- $,
1346
+ k,
1347
1347
  c.targetPort,
1348
- y.get(c.id),
1349
- x ? {
1348
+ I.get(c.id),
1349
+ T ? {
1350
1350
  x: G.x + G.width,
1351
1351
  y: G.y + G.height * 2 / 3
1352
1352
  } : void 0,
1353
- C
1354
- ), H = new u.ConnRef(w, N, j);
1355
- if (de(N), de(j), x) {
1353
+ A
1354
+ ), H = new u.ConnRef(w, L, U);
1355
+ if (de(L), de(U), T) {
1356
1356
  const D = new u.CheckpointVector();
1357
1357
  for (const z of [
1358
- $.y + $.height / 3,
1359
- $.y + $.height * 2 / 3
1358
+ k.y + k.height / 3,
1359
+ k.y + k.height * 2 / 3
1360
1360
  ]) {
1361
1361
  const Z = new u.Point(
1362
- $.x + $.width + Math.max(24, b + 4),
1362
+ k.x + k.width + Math.max(24, b + 4),
1363
1363
  z
1364
1364
  ), oe = new u.Checkpoint(Z);
1365
1365
  D.push_back(oe), de(Z), de(oe);
@@ -1369,23 +1369,23 @@ async function Xe(a, s = {}) {
1369
1369
  return { edge: c, connection: H };
1370
1370
  });
1371
1371
  w.processTransaction();
1372
- for (const { edge: c, connection: $ } of T) {
1373
- const G = $.displayRoute(), x = Array.from({ length: G.size() }, (C, N) => {
1374
- const j = G.at(N), H = { x: j.x, y: j.y };
1375
- return de(j), H;
1372
+ for (const { edge: c, connection: k } of m) {
1373
+ const G = k.displayRoute(), T = Array.from({ length: G.size() }, (A, L) => {
1374
+ const U = G.at(L), H = { x: U.x, y: U.y };
1375
+ return de(U), H;
1376
1376
  });
1377
- if (de(G), !$.hasValidRoute() || x.length < 2 || x.some((C) => !Number.isFinite(C.x) || !Number.isFinite(C.y)) || x.some((C, N) => N > 0 && C.x !== x[N - 1].x && C.y !== x[N - 1].y))
1377
+ if (de(G), !k.hasValidRoute() || T.length < 2 || T.some((A) => !Number.isFinite(A.x) || !Number.isFinite(A.y)) || T.some((A, L) => L > 0 && A.x !== T[L - 1].x && A.y !== T[L - 1].y))
1378
1378
  throw new Error(`Graph edge cannot be routed: ${c.id}`);
1379
- R.set(c.id, x);
1379
+ F.set(c.id, T);
1380
1380
  }
1381
1381
  } finally {
1382
1382
  w.delete();
1383
1383
  }
1384
1384
  }
1385
- const U = a.edges.map((l) => ({ ...l, sections: [R.get(l.id)] }));
1385
+ const N = a.edges.map((l) => ({ ...l, sections: [F.get(l.id)] }));
1386
1386
  return mt({
1387
1387
  nodes: a.nodes,
1388
- edges: U,
1388
+ edges: N,
1389
1389
  bounds: a.bounds
1390
1390
  });
1391
1391
  }
@@ -1417,33 +1417,33 @@ function rr(a, s) {
1417
1417
  };
1418
1418
  }
1419
1419
  function nr(a, s) {
1420
- const b = (l, k) => k.x >= l.x && k.y >= l.y && k.x + k.width <= l.x + l.width && k.y + k.height <= l.y + l.height, o = b(a, s) ? a : b(s, a) ? s : void 0;
1420
+ const b = (l, S) => S.x >= l.x && S.y >= l.y && S.x + S.width <= l.x + l.width && S.y + S.height <= l.y + l.height, o = b(a, s) ? a : b(s, a) ? s : void 0;
1421
1421
  if (o) {
1422
- const l = o === a ? s : a, k = {
1422
+ const l = o === a ? s : a, S = {
1423
1423
  NORTH: l.y - o.y,
1424
1424
  EAST: o.x + o.width - l.x - l.width,
1425
1425
  SOUTH: o.y + o.height - l.y - l.height,
1426
1426
  WEST: l.x - o.x
1427
- }, w = [...Ee].sort((S, v) => k[S] - k[v])[0];
1427
+ }, w = [...Ee].sort((M, v) => S[M] - S[v])[0];
1428
1428
  return { source: w, target: w };
1429
1429
  }
1430
- const u = s.x + s.width / 2 - (a.x + a.width / 2), I = s.y + s.height / 2 - (a.y + a.height / 2), _ = Math.max(a.x - (s.x + s.width), s.x - (a.x + a.width), 0), P = Math.max(
1430
+ const u = s.x + s.width / 2 - (a.x + a.width / 2), C = s.y + s.height / 2 - (a.y + a.height / 2), _ = Math.max(a.x - (s.x + s.width), s.x - (a.x + a.width), 0), R = Math.max(
1431
1431
  a.y - (s.y + s.height),
1432
1432
  s.y - (a.y + a.height),
1433
1433
  0
1434
- ), U = (P === 0 && _ > 0 ? !0 : _ === 0 && P > 0 ? !1 : _ === 0 && P === 0 ? Math.abs(u) >= Math.abs(I) : _ <= P) ? u >= 0 ? "EAST" : "WEST" : I >= 0 ? "SOUTH" : "NORTH";
1435
- return { source: U, target: Ee[(Ee.indexOf(U) + 2) % 4] };
1434
+ ), N = (R === 0 && _ > 0 ? !0 : _ === 0 && R > 0 ? !1 : _ === 0 && R === 0 ? Math.abs(u) >= Math.abs(C) : _ <= R) ? u >= 0 ? "EAST" : "WEST" : C >= 0 ? "SOUTH" : "NORTH";
1435
+ return { source: N, target: Ee[(Ee.indexOf(N) + 2) % 4] };
1436
1436
  }
1437
1437
  function nn(a, s, b, o = 0, u = 8) {
1438
- const I = (l) => Math.min(u, l / 4), _ = (l, k, w) => Math.max(k + I(w), Math.min(k + w - I(w), l)), P = (l, k, w, S) => {
1439
- const v = Math.max(l, w), y = Math.min(l + k, w + S);
1440
- return v < y ? (v + y) / 2 + o : void 0;
1441
- }, R = b.x + b.width / 2, U = b.y + b.height / 2;
1438
+ const C = (l) => Math.min(u, l / 4), _ = (l, S, w) => Math.max(S + C(w), Math.min(S + w - C(w), l)), R = (l, S, w, M) => {
1439
+ const v = Math.max(l, w), I = Math.min(l + S, w + M);
1440
+ return v < I ? (v + I) / 2 + o : void 0;
1441
+ }, F = b.x + b.width / 2, N = b.y + b.height / 2;
1442
1442
  switch (s) {
1443
1443
  case "NORTH":
1444
1444
  return {
1445
1445
  x: _(
1446
- P(a.x, a.width, b.x, b.width) ?? R + o,
1446
+ R(a.x, a.width, b.x, b.width) ?? F + o,
1447
1447
  a.x,
1448
1448
  a.width
1449
1449
  ),
@@ -1453,7 +1453,7 @@ function nn(a, s, b, o = 0, u = 8) {
1453
1453
  return {
1454
1454
  x: a.x + a.width,
1455
1455
  y: _(
1456
- P(a.y, a.height, b.y, b.height) ?? U + o,
1456
+ R(a.y, a.height, b.y, b.height) ?? N + o,
1457
1457
  a.y,
1458
1458
  a.height
1459
1459
  )
@@ -1461,7 +1461,7 @@ function nn(a, s, b, o = 0, u = 8) {
1461
1461
  case "SOUTH":
1462
1462
  return {
1463
1463
  x: _(
1464
- P(a.x, a.width, b.x, b.width) ?? R + o,
1464
+ R(a.x, a.width, b.x, b.width) ?? F + o,
1465
1465
  a.x,
1466
1466
  a.width
1467
1467
  ),
@@ -1471,30 +1471,30 @@ function nn(a, s, b, o = 0, u = 8) {
1471
1471
  return {
1472
1472
  x: a.x,
1473
1473
  y: _(
1474
- P(a.y, a.height, b.y, b.height) ?? U + o,
1474
+ R(a.y, a.height, b.y, b.height) ?? N + o,
1475
1475
  a.y,
1476
1476
  a.height
1477
1477
  )
1478
1478
  };
1479
1479
  }
1480
1480
  }
1481
- function or(a, s, b, o, u, I = { x: 0, y: 0 }) {
1482
- const _ = s.flow === "row", P = s.maxPerLine ?? Math.max(1, a.length);
1483
- let R = 0, U = 0;
1484
- for (let l = 0; l < a.length; l += P) {
1485
- const k = a.slice(l, l + P);
1486
- let w = 0, S = 0;
1487
- for (const v of k)
1481
+ function or(a, s, b, o, u, C = { x: 0, y: 0 }) {
1482
+ const _ = s.flow === "row", R = s.maxPerLine ?? Math.max(1, a.length);
1483
+ let F = 0, N = 0;
1484
+ for (let l = 0; l < a.length; l += R) {
1485
+ const S = a.slice(l, l + R);
1486
+ let w = 0, M = 0;
1487
+ for (const v of S)
1488
1488
  u(
1489
1489
  v,
1490
- I.x + b.left + (_ ? w : R) - v.x,
1491
- I.y + b.top + (_ ? R : w) - v.y
1492
- ), w += (_ ? v.width : v.height) + o, S = Math.max(S, _ ? v.height : v.width);
1493
- U = Math.max(U, w - o), R += S + o;
1490
+ C.x + b.left + (_ ? w : F) - v.x,
1491
+ C.y + b.top + (_ ? F : w) - v.y
1492
+ ), w += (_ ? v.width : v.height) + o, M = Math.max(M, _ ? v.height : v.width);
1493
+ N = Math.max(N, w - o), F += M + o;
1494
1494
  }
1495
- return R = Math.max(0, R - o), {
1496
- width: b.left + (_ ? U : R) + b.right,
1497
- height: b.top + (_ ? R : U) + b.bottom
1495
+ return F = Math.max(0, F - o), {
1496
+ width: b.left + (_ ? N : F) + b.right,
1497
+ height: b.top + (_ ? F : N) + b.bottom
1498
1498
  };
1499
1499
  }
1500
1500
  function ar(a, s, b) {
@@ -1506,134 +1506,144 @@ function ar(a, s, b) {
1506
1506
  throw new Error(`Invalid graph position: ${l.nodeId}`);
1507
1507
  u.set(l.nodeId, l);
1508
1508
  }
1509
- const I = /* @__PURE__ */ new Map();
1509
+ const C = /* @__PURE__ */ new Map();
1510
1510
  for (const l of o.values())
1511
1511
  if (l.parentId) {
1512
- const k = I.get(l.parentId) ?? [];
1513
- k.push(l), I.set(l.parentId, k);
1512
+ const S = C.get(l.parentId) ?? [];
1513
+ S.push(l), C.set(l.parentId, S);
1514
1514
  }
1515
- const _ = s.groupPadding ?? { top: 64, left: 28, right: 28, bottom: 28 }, P = s.positionMode === "preferred", R = new Map(b.map((l) => [l.id, l])), U = (l, k, w) => {
1516
- const S = { x: l.x, y: l.y }, v = u.get(l.id);
1517
- l.x = v?.x ?? l.x + k, l.y = v?.y ?? l.y + w;
1518
- const y = I.get(l.id) ?? [];
1519
- for (const F of y) U(F, l.x - S.x, l.y - S.y);
1520
- if (!y.length || P) return;
1521
- const g = Math.min(...y.map((F) => F.x)) - _.left, m = Math.min(...y.map((F) => F.y)) - _.top;
1522
- if (v && (g < l.x || m < l.y))
1515
+ const _ = s.groupPadding ?? { top: 64, left: 28, right: 28, bottom: 28 }, R = s.positionMode === "preferred" || s.positionMode === "compressed", F = new Map(b.map((l) => [l.id, l])), N = (l, S, w) => {
1516
+ const M = { x: l.x, y: l.y }, v = u.get(l.id);
1517
+ l.x = v?.x ?? l.x + S, l.y = v?.y ?? l.y + w;
1518
+ const I = C.get(l.id) ?? [];
1519
+ for (const P of I) N(P, l.x - M.x, l.y - M.y);
1520
+ if (!I.length || R) return;
1521
+ const f = Math.min(...I.map((P) => P.x)) - _.left, y = Math.min(...I.map((P) => P.y)) - _.top;
1522
+ if (v && (f < l.x || y < l.y))
1523
1523
  throw new Error(`Pinned child lies outside group content: ${l.id}`);
1524
- const h = Math.max(
1524
+ const d = Math.max(
1525
1525
  l.x + l.width,
1526
- ...y.map((F) => F.x + F.width + _.right)
1527
- ), M = Math.max(
1526
+ ...I.map((P) => P.x + P.width + _.right)
1527
+ ), x = Math.max(
1528
1528
  l.y + l.height,
1529
- ...y.map((F) => F.y + F.height + _.bottom)
1529
+ ...I.map((P) => P.y + P.height + _.bottom)
1530
1530
  );
1531
- v || (l.x = Math.min(l.x, g), l.y = Math.min(l.y, m)), l.width = h - l.x, l.height = M - l.y;
1531
+ v || (l.x = Math.min(l.x, f), l.y = Math.min(l.y, y)), l.width = d - l.x, l.height = x - l.y;
1532
1532
  };
1533
- for (const l of o.values()) l.parentId || U(l, 0, 0);
1534
- if (P) {
1535
- const l = Math.max(16, s.spacing ?? 64), k = (y, g, m) => {
1536
- y.x += g, y.y += m;
1537
- for (const h of I.get(y.id) ?? []) k(h, g, m);
1538
- }, w = (y) => {
1539
- const g = [];
1540
- for (const m of [...y].sort(
1541
- (h, M) => h.y - M.y || h.x - M.x || h.id.localeCompare(M.id)
1533
+ for (const l of o.values()) l.parentId || N(l, 0, 0);
1534
+ if (R) {
1535
+ const l = Math.max(16, s.spacing ?? 64), S = (f, y, d) => {
1536
+ f.x += y, f.y += d;
1537
+ for (const x of C.get(f.id) ?? []) S(x, y, d);
1538
+ }, w = (f) => {
1539
+ if (s.positionMode === "compressed")
1540
+ for (const y of ["x", "y"]) {
1541
+ const d = y === "x" ? "width" : "height";
1542
+ let x = -1 / 0, P = 0;
1543
+ for (const j of [...f].sort((m, c) => m[y] - c[y])) {
1544
+ const m = j[y];
1545
+ Number.isFinite(x) && (P += Math.max(0, m - x - l)), x = Math.max(x, m + j[d]), S(j, y === "x" ? -P : 0, y === "y" ? -P : 0);
1546
+ }
1547
+ }
1548
+ }, M = (f) => {
1549
+ const y = [];
1550
+ for (const d of [...f].sort(
1551
+ (x, P) => x.y - P.y || x.x - P.x || x.id.localeCompare(P.id)
1542
1552
  )) {
1543
- const h = { x: m.x, y: m.y };
1544
- for (const L of [...g].sort((T, c) => T.x - c.x))
1545
- m.y < L.y + L.height + l && m.y + m.height + l > L.y && h.x < L.x + L.width + l && h.x + m.width + l > L.x && (h.x = L.x + L.width + l);
1546
- const M = { x: m.x, y: m.y };
1547
- for (const L of [...g].sort((T, c) => T.y - c.y))
1548
- m.x < L.x + L.width + l && m.x + m.width + l > L.x && M.y < L.y + L.height + l && M.y + m.height + l > L.y && (M.y = L.y + L.height + l);
1549
- const F = h.x - m.x < M.y - m.y ? h : M;
1550
- k(m, F.x - m.x, F.y - m.y), g.push(m);
1553
+ const x = { x: d.x, y: d.y };
1554
+ for (const m of [...y].sort((c, k) => c.x - k.x))
1555
+ d.y < m.y + m.height + l && d.y + d.height + l > m.y && x.x < m.x + m.width + l && x.x + d.width + l > m.x && (x.x = m.x + m.width + l);
1556
+ const P = { x: d.x, y: d.y };
1557
+ for (const m of [...y].sort((c, k) => c.y - k.y))
1558
+ d.x < m.x + m.width + l && d.x + d.width + l > m.x && P.y < m.y + m.height + l && P.y + d.height + l > m.y && (P.y = m.y + m.height + l);
1559
+ const j = x.x - d.x < P.y - d.y ? x : P;
1560
+ S(d, j.x - d.x, j.y - d.y), y.push(d);
1551
1561
  }
1552
- }, S = (y) => {
1553
- const g = I.get(y.id) ?? [];
1554
- if (!g.length) return;
1555
- for (const c of g) S(c);
1556
- const m = s.groupLayouts?.[y.id];
1557
- if (m) {
1558
- const c = or(
1559
- g,
1560
- m,
1562
+ }, v = (f) => {
1563
+ const y = C.get(f.id) ?? [];
1564
+ if (!y.length) return;
1565
+ for (const k of y) v(k);
1566
+ const d = s.groupLayouts?.[f.id];
1567
+ if (d) {
1568
+ const k = or(
1569
+ y,
1570
+ d,
1561
1571
  _,
1562
1572
  s.spacing ?? 64,
1563
- k,
1564
- y
1573
+ S,
1574
+ f
1565
1575
  );
1566
- y.width = Math.max(R.get(y.id).width, c.width), y.height = Math.max(R.get(y.id).height, c.height);
1576
+ f.width = Math.max(F.get(f.id).width, k.width), f.height = Math.max(F.get(f.id).height, k.height);
1567
1577
  return;
1568
1578
  }
1569
- w(g);
1570
- const h = Math.max(12, _.left), M = Math.max(12, _.top), F = Math.max(12, _.right), L = Math.max(12, _.bottom), T = u.get(y.id);
1571
- y.x = Math.min(T?.x ?? 1 / 0, Math.min(...g.map((c) => c.x)) - h), y.y = Math.min(T?.y ?? 1 / 0, Math.min(...g.map((c) => c.y)) - M), y.width = Math.max(
1572
- R.get(y.id).width,
1573
- Math.max(...g.map((c) => c.x + c.width)) + F - y.x
1574
- ), y.height = Math.max(
1575
- R.get(y.id).height,
1576
- Math.max(...g.map((c) => c.y + c.height)) + L - y.y
1579
+ M(y), w(y);
1580
+ const x = Math.max(12, _.left), P = Math.max(12, _.top), j = Math.max(12, _.right), m = Math.max(12, _.bottom), c = u.get(f.id);
1581
+ f.x = Math.min(c?.x ?? 1 / 0, Math.min(...y.map((k) => k.x)) - x), f.y = Math.min(c?.y ?? 1 / 0, Math.min(...y.map((k) => k.y)) - P), f.width = Math.max(
1582
+ F.get(f.id).width,
1583
+ Math.max(...y.map((k) => k.x + k.width)) + j - f.x
1584
+ ), f.height = Math.max(
1585
+ F.get(f.id).height,
1586
+ Math.max(...y.map((k) => k.y + k.height)) + m - f.y
1577
1587
  );
1578
- }, v = [...o.values()].filter((y) => !y.parentId);
1579
- for (const y of v) S(y);
1580
- w(v);
1588
+ }, I = [...o.values()].filter((f) => !f.parentId);
1589
+ for (const f of I) v(f);
1590
+ M(I), w(I);
1581
1591
  }
1582
1592
  return Xe({ ...a, nodes: [...o.values()] }, s);
1583
1593
  }
1584
1594
  async function on(a, s, b) {
1585
- const o = new Map(a.nodes.map((m) => [m.id, { ...m, x: 0, y: 0 }])), u = new Map(a.nodes.map((m, h) => [m.id, h])), I = /* @__PURE__ */ new Map();
1586
- for (const m of o.values()) {
1587
- const h = I.get(m.parentId) ?? [];
1588
- h.push(m), I.set(m.parentId, h);
1595
+ const o = new Map(a.nodes.map((y) => [y.id, { ...y, x: 0, y: 0 }])), u = new Map(a.nodes.map((y, d) => [y.id, d])), C = /* @__PURE__ */ new Map();
1596
+ for (const y of o.values()) {
1597
+ const d = C.get(y.parentId) ?? [];
1598
+ d.push(y), C.set(y.parentId, d);
1589
1599
  }
1590
1600
  const _ = /* @__PURE__ */ new Set([
1591
- ...a.nodes.flatMap((m) => [m.id, ...(m.ports ?? []).map((h) => h.id)]),
1592
- ...a.edges.map((m) => m.id)
1601
+ ...a.nodes.flatMap((y) => [y.id, ...(y.ports ?? []).map((d) => d.id)]),
1602
+ ...a.edges.map((y) => y.id)
1593
1603
  ]);
1594
- let P = "$packed";
1595
- for (; _.has(P); ) P += "$";
1596
- const R = s.groupPadding ?? { top: 64, right: 28, bottom: 28, left: 28 }, U = s.direction ?? "RIGHT", l = new Map(
1597
- (s.positions ?? []).map((m) => [
1598
- m.nodeId,
1599
- U === "RIGHT" || U === "LEFT" ? m.y : m.x
1604
+ let R = "$packed";
1605
+ for (; _.has(R); ) R += "$";
1606
+ const F = s.groupPadding ?? { top: 64, right: 28, bottom: 28, left: 28 }, N = s.direction ?? "RIGHT", l = new Map(
1607
+ (s.positions ?? []).map((y) => [
1608
+ y.nodeId,
1609
+ N === "RIGHT" || N === "LEFT" ? y.y : y.x
1600
1610
  ])
1601
- ), k = (m, h, M) => {
1602
- m.x += h, m.y += M;
1603
- for (const F of I.get(m.id) ?? []) k(F, h, M);
1604
- }, w = (m, h) => {
1605
- let M = o.get(m);
1606
- for (; M && M.parentId !== h; )
1607
- M = M.parentId ? o.get(M.parentId) : void 0;
1608
- return M;
1609
- }, S = async (m) => {
1610
- const h = [...I.get(m) ?? []], M = m === void 0 ? void 0 : s.groupLayouts?.[m];
1611
- !M && (m !== void 0 || !s.layers) && h.sort(
1612
- (T, c) => (l.get(T.id) ?? 1 / 0) - (l.get(c.id) ?? 1 / 0) || u.get(T.id) - u.get(c.id)
1611
+ ), S = (y, d, x) => {
1612
+ y.x += d, y.y += x;
1613
+ for (const P of C.get(y.id) ?? []) S(P, d, x);
1614
+ }, w = (y, d) => {
1615
+ let x = o.get(y);
1616
+ for (; x && x.parentId !== d; )
1617
+ x = x.parentId ? o.get(x.parentId) : void 0;
1618
+ return x;
1619
+ }, M = async (y) => {
1620
+ const d = [...C.get(y) ?? []], x = y === void 0 ? void 0 : s.groupLayouts?.[y];
1621
+ !x && (y !== void 0 || !s.layers) && d.sort(
1622
+ (m, c) => (l.get(m.id) ?? 1 / 0) - (l.get(c.id) ?? 1 / 0) || u.get(m.id) - u.get(c.id)
1613
1623
  );
1614
- for (const T of h) {
1615
- if (!I.has(T.id)) continue;
1616
- const c = await S(T.id);
1617
- T.width = Math.max(T.width, c.width), T.height = Math.max(T.height, c.height);
1624
+ for (const m of d) {
1625
+ if (!C.has(m.id)) continue;
1626
+ const c = await M(m.id);
1627
+ m.width = Math.max(m.width, c.width), m.height = Math.max(m.height, c.height);
1618
1628
  }
1619
- if (!h.length) return { width: 0, height: 0 };
1620
- if (M) return or(h, M, R, s.spacing ?? 64, k);
1621
- if (m === void 0 && s.layers)
1622
- return an(h, a, s, w, k);
1623
- const F = /* @__PURE__ */ new Map();
1624
- for (const T of a.edges) {
1625
- const c = w(T.source, m), $ = w(T.target, m);
1626
- if (!c || !$ || c.id === $.id) continue;
1627
- const G = JSON.stringify([c.id, $.id]);
1628
- F.has(G) || F.set(G, { id: T.id, sources: [c.id], targets: [$.id] });
1629
+ if (!d.length) return { width: 0, height: 0 };
1630
+ if (x) return or(d, x, F, s.spacing ?? 64, S);
1631
+ if (y === void 0 && s.layers)
1632
+ return an(d, a, s, w, S);
1633
+ const P = /* @__PURE__ */ new Map();
1634
+ for (const m of a.edges) {
1635
+ const c = w(m.source, y), k = w(m.target, y);
1636
+ if (!c || !k || c.id === k.id) continue;
1637
+ const G = JSON.stringify([c.id, k.id]);
1638
+ P.has(G) || P.set(G, { id: m.id, sources: [c.id], targets: [k.id] });
1629
1639
  }
1630
- const L = await b.layout({
1631
- id: m ?? P,
1632
- children: h.map((T) => ({ id: T.id, width: T.width, height: T.height })),
1633
- edges: [...F.values()],
1640
+ const j = await b.layout({
1641
+ id: y ?? R,
1642
+ children: d.map((m) => ({ id: m.id, width: m.width, height: m.height })),
1643
+ edges: [...P.values()],
1634
1644
  layoutOptions: {
1635
- "elk.algorithm": F.size ? "layered" : "rectpacking",
1636
- "elk.direction": U,
1645
+ "elk.algorithm": P.size ? "layered" : "rectpacking",
1646
+ "elk.direction": N,
1637
1647
  "elk.edgeRouting": "ORTHOGONAL",
1638
1648
  "elk.separateConnectedComponents": "true",
1639
1649
  ...s.aspectRatio !== void 0 ? { "elk.aspectRatio": String(s.aspectRatio) } : {},
@@ -1641,99 +1651,99 @@ async function on(a, s, b) {
1641
1651
  "elk.spacing.nodeNode": String(s.spacing ?? 64),
1642
1652
  "elk.layered.spacing.nodeNodeBetweenLayers": String(s.spacing ?? 64),
1643
1653
  "elk.layered.considerModelOrder.strategy": "NODES",
1644
- "elk.padding": m ? `[top=${R.top},left=${R.left},bottom=${R.bottom},right=${R.right}]` : "[top=12,left=12,bottom=12,right=12]",
1654
+ "elk.padding": y ? `[top=${F.top},left=${F.left},bottom=${F.bottom},right=${F.right}]` : "[top=12,left=12,bottom=12,right=12]",
1645
1655
  "elk.randomSeed": "1"
1646
1656
  }
1647
1657
  });
1648
- for (const T of L.children ?? []) {
1649
- const c = o.get(T.id);
1650
- k(c, (T.x ?? 0) - c.x, (T.y ?? 0) - c.y);
1658
+ for (const m of j.children ?? []) {
1659
+ const c = o.get(m.id);
1660
+ S(c, (m.x ?? 0) - c.x, (m.y ?? 0) - c.y);
1651
1661
  }
1652
- return { width: L.width ?? 0, height: L.height ?? 0 };
1653
- }, v = await S(), y = (!s.positions?.length || s.positionMode === "compact" || s.layers) && s.anchor && o.get(s.anchor.nodeId);
1654
- if (y) {
1655
- const m = s.anchor.position.x - y.x, h = s.anchor.position.y - y.y;
1656
- for (const M of I.get(void 0) ?? []) k(M, m, h);
1662
+ return { width: j.width ?? 0, height: j.height ?? 0 };
1663
+ }, v = await M(), I = (!s.positions?.length || s.positionMode === "compact" || s.layers) && s.anchor && o.get(s.anchor.nodeId);
1664
+ if (I) {
1665
+ const y = s.anchor.position.x - I.x, d = s.anchor.position.y - I.y;
1666
+ for (const x of C.get(void 0) ?? []) S(x, y, d);
1657
1667
  }
1658
- const g = {
1668
+ const f = {
1659
1669
  nodes: [...o.values()],
1660
- edges: a.edges.map((m) => ({ ...m, sections: [] })),
1670
+ edges: a.edges.map((y) => ({ ...y, sections: [] })),
1661
1671
  bounds: { x: 0, y: 0, ...v }
1662
1672
  };
1663
- return s.positions?.length && s.positionMode !== "compact" && !s.layers ? ar(g, s, a.nodes) : Xe(g, s);
1673
+ return s.positions?.length && s.positionMode !== "compact" && !s.layers ? ar(f, s, a.nodes) : Xe(f, s);
1664
1674
  }
1665
1675
  function an(a, s, b, o, u) {
1666
- const I = b.direction ?? "RIGHT", _ = I === "RIGHT" || I === "LEFT", P = I === "RIGHT" || I === "DOWN", R = new Map(a.map((x, C) => [x.id, C])), U = new Map(
1667
- (b.positions ?? []).filter((x) => R.has(x.nodeId)).map((x) => [x.nodeId, _ ? x.y : x.x])
1668
- ), l = (x, C) => R.get(x) - R.get(C) || x.localeCompare(C), k = (x, C) => (U.get(x) ?? 1 / 0) - (U.get(C) ?? 1 / 0) || l(x, C), w = new Map(a.map((x) => [x.id, /* @__PURE__ */ new Set()]));
1669
- for (const x of s.edges) {
1670
- const C = o(x.source, void 0)?.id, N = o(x.target, void 0)?.id;
1671
- C && N && C !== N && (w.get(C)?.add(N), w.get(N)?.add(C));
1676
+ const C = b.direction ?? "RIGHT", _ = C === "RIGHT" || C === "LEFT", R = C === "RIGHT" || C === "DOWN", F = new Map(a.map((T, A) => [T.id, A])), N = new Map(
1677
+ (b.positions ?? []).filter((T) => F.has(T.nodeId)).map((T) => [T.nodeId, _ ? T.y : T.x])
1678
+ ), l = (T, A) => F.get(T) - F.get(A) || T.localeCompare(A), S = (T, A) => (N.get(T) ?? 1 / 0) - (N.get(A) ?? 1 / 0) || l(T, A), w = new Map(a.map((T) => [T.id, /* @__PURE__ */ new Set()]));
1679
+ for (const T of s.edges) {
1680
+ const A = o(T.source, void 0)?.id, L = o(T.target, void 0)?.id;
1681
+ A && L && A !== L && (w.get(A)?.add(L), w.get(L)?.add(A));
1672
1682
  }
1673
- const S = b.layers ?? [], v = /* @__PURE__ */ new Map();
1674
- S.forEach((x, C) => x.forEach((N) => v.set(N, C)));
1675
- const y = new Set(a.map((x) => x.id)), g = [];
1676
- for (const x of [...y].sort(l)) {
1677
- if (!y.has(x)) continue;
1678
- const C = [], N = [x];
1679
- y.delete(x);
1680
- for (let j = 0; j < N.length; j++) {
1681
- const H = N[j];
1682
- C.push(H);
1683
+ const M = b.layers ?? [], v = /* @__PURE__ */ new Map();
1684
+ M.forEach((T, A) => T.forEach((L) => v.set(L, A)));
1685
+ const I = new Set(a.map((T) => T.id)), f = [];
1686
+ for (const T of [...I].sort(l)) {
1687
+ if (!I.has(T)) continue;
1688
+ const A = [], L = [T];
1689
+ I.delete(T);
1690
+ for (let U = 0; U < L.length; U++) {
1691
+ const H = L[U];
1692
+ A.push(H);
1683
1693
  for (const D of [...w.get(H)].sort(l))
1684
- y.delete(D) && N.push(D);
1694
+ I.delete(D) && L.push(D);
1685
1695
  }
1686
- g.push(C);
1696
+ f.push(A);
1687
1697
  }
1688
- let m = S.length;
1689
- for (const x of g) {
1690
- const C = x.filter((H) => v.has(H));
1691
- if (!C.length) {
1692
- x.sort(l).forEach((H) => v.set(H, m)), m++;
1698
+ let y = M.length;
1699
+ for (const T of f) {
1700
+ const A = T.filter((H) => v.has(H));
1701
+ if (!A.length) {
1702
+ T.sort(l).forEach((H) => v.set(H, y)), y++;
1693
1703
  continue;
1694
1704
  }
1695
- const N = /* @__PURE__ */ new Map(), j = [...C].sort((H, D) => v.get(H) - v.get(D) || l(H, D));
1696
- for (const H of j) N.set(H, 0);
1697
- for (let H = 0; H < j.length; H++) {
1698
- const D = j[H];
1705
+ const L = /* @__PURE__ */ new Map(), U = [...A].sort((H, D) => v.get(H) - v.get(D) || l(H, D));
1706
+ for (const H of U) L.set(H, 0);
1707
+ for (let H = 0; H < U.length; H++) {
1708
+ const D = U[H];
1699
1709
  for (const z of [...w.get(D)].sort(l))
1700
- N.has(z) || (N.set(z, N.get(D) + 1), v.set(z, v.get(D)), j.push(z));
1710
+ L.has(z) || (L.set(z, L.get(D) + 1), v.set(z, v.get(D)), U.push(z));
1701
1711
  }
1702
1712
  }
1703
- const h = Math.max(S.length, m), M = Array.from({ length: h }, () => []);
1704
- for (const x of a) M[v.get(x.id)].push(x);
1705
- for (const x of M) x.sort((C, N) => k(C.id, N.id));
1706
- const F = (x, C) => {
1707
- const N = new Map(M[C].map((D, z) => [D.id, z])), j = new Map(M[x].map((D, z) => [D.id, z])), H = (D) => {
1713
+ const d = Math.max(M.length, y), x = Array.from({ length: d }, () => []);
1714
+ for (const T of a) x[v.get(T.id)].push(T);
1715
+ for (const T of x) T.sort((A, L) => S(A.id, L.id));
1716
+ const P = (T, A) => {
1717
+ const L = new Map(x[A].map((D, z) => [D.id, z])), U = new Map(x[T].map((D, z) => [D.id, z])), H = (D) => {
1708
1718
  const z = [...w.get(D) ?? []].flatMap((Z) => {
1709
- const oe = N.get(Z);
1710
- return v.get(Z) === C && oe !== void 0 ? [oe] : [];
1719
+ const oe = L.get(Z);
1720
+ return v.get(Z) === A && oe !== void 0 ? [oe] : [];
1711
1721
  });
1712
- return z.length ? z.reduce((Z, oe) => Z + oe, 0) / z.length : j.get(D);
1722
+ return z.length ? z.reduce((Z, oe) => Z + oe, 0) / z.length : U.get(D);
1713
1723
  };
1714
- M[x].sort((D, z) => H(D.id) - H(z.id) || k(D.id, z.id));
1724
+ x[T].sort((D, z) => H(D.id) - H(z.id) || S(D.id, z.id));
1715
1725
  };
1716
- for (let x = 1; x < M.length; x++) F(x, x - 1);
1717
- for (let x = M.length - 2; x >= 0; x--) F(x, x + 1);
1718
- const L = b.spacing ?? 64;
1719
- let T = 0, c = 0;
1720
- const $ = [], G = [];
1721
- for (const x of M) {
1722
- let C = 0;
1723
- const N = Math.max(0, ...x.map((j) => _ ? j.width : j.height));
1724
- $.push(T), G.push(N);
1725
- for (const j of x) {
1726
- const H = T + (N - (_ ? j.width : j.height)) / 2, D = _ ? H : C, z = _ ? C : H;
1727
- u(j, D - j.x, z - j.y), C += (_ ? j.height : j.width) + L;
1726
+ for (let T = 1; T < x.length; T++) P(T, T - 1);
1727
+ for (let T = x.length - 2; T >= 0; T--) P(T, T + 1);
1728
+ const j = b.spacing ?? 64;
1729
+ let m = 0, c = 0;
1730
+ const k = [], G = [];
1731
+ for (const T of x) {
1732
+ let A = 0;
1733
+ const L = Math.max(0, ...T.map((U) => _ ? U.width : U.height));
1734
+ k.push(m), G.push(L);
1735
+ for (const U of T) {
1736
+ const H = m + (L - (_ ? U.width : U.height)) / 2, D = _ ? H : A, z = _ ? A : H;
1737
+ u(U, D - U.x, z - U.y), A += (_ ? U.height : U.width) + j;
1728
1738
  }
1729
- c = Math.max(c, Math.max(0, C - L)), T += N + L;
1739
+ c = Math.max(c, Math.max(0, A - j)), m += L + j;
1730
1740
  }
1731
- if (T = Math.max(0, T - L), !P)
1732
- for (const x of a) {
1733
- const C = v.get(x.id), j = T - $[C] - G[C] + (G[C] - (_ ? x.width : x.height)) / 2;
1734
- u(x, _ ? j - x.x : 0, _ ? 0 : j - x.y);
1741
+ if (m = Math.max(0, m - j), !R)
1742
+ for (const T of a) {
1743
+ const A = v.get(T.id), U = m - k[A] - G[A] + (G[A] - (_ ? T.width : T.height)) / 2;
1744
+ u(T, _ ? U - T.x : 0, _ ? 0 : U - T.y);
1735
1745
  }
1736
- return _ ? { width: T, height: c } : { width: c, height: T };
1746
+ return _ ? { width: m, height: c } : { width: c, height: m };
1737
1747
  }
1738
1748
  function sr(a) {
1739
1749
  const s = /* @__PURE__ */ new Set(), b = (u) => {
@@ -1741,27 +1751,27 @@ function sr(a) {
1741
1751
  s.add(u);
1742
1752
  }, o = new Map(a.nodes.map((u) => [u.id, u]));
1743
1753
  for (const u of a.nodes) {
1744
- if (b(u.id), ![u.width, u.height].every((P) => Number.isFinite(P) && P > 0))
1754
+ if (b(u.id), ![u.width, u.height].every((R) => Number.isFinite(R) && R > 0))
1745
1755
  throw new Error(`Invalid dimensions for graph node: ${u.id}`);
1746
- for (const P of u.ports ?? []) b(P.id);
1747
- const I = /* @__PURE__ */ new Set([u.id]);
1756
+ for (const R of u.ports ?? []) b(R.id);
1757
+ const C = /* @__PURE__ */ new Set([u.id]);
1748
1758
  let _ = u.parentId;
1749
1759
  for (; _ !== void 0; ) {
1750
- const P = o.get(_);
1751
- if (!P || P.kind !== "group")
1760
+ const R = o.get(_);
1761
+ if (!R || R.kind !== "group")
1752
1762
  throw new Error(`Invalid parent for graph node: ${u.id}`);
1753
- if (I.has(_)) throw new Error(`Cyclic graph containment: ${u.id}`);
1754
- I.add(_), _ = P.parentId;
1763
+ if (C.has(_)) throw new Error(`Cyclic graph containment: ${u.id}`);
1764
+ C.add(_), _ = R.parentId;
1755
1765
  }
1756
1766
  }
1757
1767
  for (const u of a.edges) {
1758
1768
  b(u.id);
1759
- for (const [I, _] of [
1769
+ for (const [C, _] of [
1760
1770
  [u.source, u.sourcePort],
1761
1771
  [u.target, u.targetPort]
1762
1772
  ]) {
1763
- const P = o.get(I);
1764
- if (!P || _ !== void 0 && !P.ports?.some((R) => R.id === _))
1773
+ const R = o.get(C);
1774
+ if (!R || _ !== void 0 && !R.ports?.some((F) => F.id === _))
1765
1775
  throw new Error(`Invalid endpoint for graph edge: ${u.id}`);
1766
1776
  }
1767
1777
  }
@@ -1777,24 +1787,24 @@ async function sn(a, s, b) {
1777
1787
  if (s.aspectRatio !== void 0 && (!Number.isFinite(s.aspectRatio) || s.aspectRatio <= 0))
1778
1788
  throw new Error("Graph layout aspect ratio must be finite and positive");
1779
1789
  const u = s.groupPadding ?? { top: 64, right: 28, bottom: 28, left: 28 };
1780
- if (![...Object.values(u), s.spacing ?? 64].every((h) => Number.isFinite(h) && h >= 0))
1790
+ if (![...Object.values(u), s.spacing ?? 64].every((d) => Number.isFinite(d) && d >= 0))
1781
1791
  throw new Error("Graph layout spacing must be finite and nonnegative");
1782
1792
  if (s.layers && (dn(a, s.layers), s.positionMode === "fixed" && s.positions?.length))
1783
1793
  throw new Error("Fixed positions cannot be combined with graph layers");
1784
1794
  if (s.aspectRatio !== void 0 || s.layers || Object.keys(s.groupLayouts ?? {}).length)
1785
1795
  return on(o, s, b);
1786
- const I = /* @__PURE__ */ new Map();
1787
- for (const h of o.nodes)
1788
- I.set(h.id, {
1789
- id: h.id,
1790
- width: h.width,
1791
- height: h.height,
1792
- ...h.kind === "group" ? { children: [] } : {},
1793
- ports: h.ports?.map((M) => ({
1794
- id: M.id,
1796
+ const C = /* @__PURE__ */ new Map();
1797
+ for (const d of o.nodes)
1798
+ C.set(d.id, {
1799
+ id: d.id,
1800
+ width: d.width,
1801
+ height: d.height,
1802
+ ...d.kind === "group" ? { children: [] } : {},
1803
+ ports: d.ports?.map((x) => ({
1804
+ id: x.id,
1795
1805
  width: 1,
1796
1806
  height: 1,
1797
- layoutOptions: { "elk.port.side": M.side }
1807
+ layoutOptions: { "elk.port.side": x.side }
1798
1808
  })),
1799
1809
  layoutOptions: {
1800
1810
  "elk.portConstraints": "FIXED_ORDER",
@@ -1802,21 +1812,21 @@ async function sn(a, s, b) {
1802
1812
  }
1803
1813
  });
1804
1814
  const _ = [];
1805
- for (const h of o.nodes)
1806
- (h.parentId ? I.get(h.parentId).children : _).push(I.get(h.id));
1807
- const P = /* @__PURE__ */ new Set([
1808
- ...o.nodes.flatMap((h) => [h.id, ...(h.ports ?? []).map((M) => M.id)]),
1809
- ...o.edges.map((h) => h.id)
1815
+ for (const d of o.nodes)
1816
+ (d.parentId ? C.get(d.parentId).children : _).push(C.get(d.id));
1817
+ const R = /* @__PURE__ */ new Set([
1818
+ ...o.nodes.flatMap((d) => [d.id, ...(d.ports ?? []).map((x) => x.id)]),
1819
+ ...o.edges.map((d) => d.id)
1810
1820
  ]);
1811
- let R = "$graph";
1812
- for (; P.has(R); ) R += "$";
1813
- const U = await b.layout({
1814
- id: R,
1821
+ let F = "$graph";
1822
+ for (; R.has(F); ) F += "$";
1823
+ const N = await b.layout({
1824
+ id: F,
1815
1825
  children: _,
1816
- edges: o.edges.map((h) => ({
1817
- id: h.id,
1818
- sources: [h.sourcePort ?? h.source],
1819
- targets: [h.targetPort ?? h.target]
1826
+ edges: o.edges.map((d) => ({
1827
+ id: d.id,
1828
+ sources: [d.sourcePort ?? d.source],
1829
+ targets: [d.targetPort ?? d.target]
1820
1830
  })),
1821
1831
  layoutOptions: {
1822
1832
  "elk.algorithm": "layered",
@@ -1828,41 +1838,41 @@ async function sn(a, s, b) {
1828
1838
  "elk.layered.considerModelOrder.strategy": "NODES",
1829
1839
  "elk.randomSeed": "1"
1830
1840
  }
1831
- }), l = /* @__PURE__ */ new Map(), k = /* @__PURE__ */ new Map(), w = (h) => {
1832
- for (const M of h.edges ?? []) {
1833
- const F = M.container ?? h.id, L = l.get(F) ?? { x: 0, y: 0 };
1834
- k.set(
1835
- M.id,
1836
- (M.sections ?? []).map(
1837
- (T) => [T.startPoint, ...T.bendPoints ?? [], T.endPoint].map((c) => ({
1838
- x: c.x + L.x,
1839
- y: c.y + L.y
1841
+ }), l = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), w = (d) => {
1842
+ for (const x of d.edges ?? []) {
1843
+ const P = x.container ?? d.id, j = l.get(P) ?? { x: 0, y: 0 };
1844
+ S.set(
1845
+ x.id,
1846
+ (x.sections ?? []).map(
1847
+ (m) => [m.startPoint, ...m.bendPoints ?? [], m.endPoint].map((c) => ({
1848
+ x: c.x + j.x,
1849
+ y: c.y + j.y
1840
1850
  }))
1841
1851
  )
1842
1852
  );
1843
1853
  }
1844
- for (const M of h.children ?? []) w(M);
1845
- }, S = (h, M, F) => {
1846
- const L = M + (h.x ?? 0), T = F + (h.y ?? 0);
1847
- l.set(h.id, { x: L, y: T, width: h.width ?? 0, height: h.height ?? 0 });
1848
- for (const c of h.children ?? []) S(c, L, T);
1854
+ for (const x of d.children ?? []) w(x);
1855
+ }, M = (d, x, P) => {
1856
+ const j = x + (d.x ?? 0), m = P + (d.y ?? 0);
1857
+ l.set(d.id, { x: j, y: m, width: d.width ?? 0, height: d.height ?? 0 });
1858
+ for (const c of d.children ?? []) M(c, j, m);
1849
1859
  };
1850
- for (const h of U.children ?? []) S(h, 0, 0);
1851
- w(U);
1852
- const v = (!s.positions?.length || s.positionMode === "compact") && s.anchor && l.get(s.anchor.nodeId), y = v ? s.anchor.position.x - v.x : 0, g = v ? s.anchor.position.y - v.y : 0, m = o.nodes.map((h) => {
1853
- const M = l.get(h.id);
1854
- return { ...h, ...M, x: M.x + y, y: M.y + g };
1860
+ for (const d of N.children ?? []) M(d, 0, 0);
1861
+ w(N);
1862
+ const v = (!s.positions?.length || s.positionMode === "compact") && s.anchor && l.get(s.anchor.nodeId), I = v ? s.anchor.position.x - v.x : 0, f = v ? s.anchor.position.y - v.y : 0, y = o.nodes.map((d) => {
1863
+ const x = l.get(d.id);
1864
+ return { ...d, ...x, x: x.x + I, y: x.y + f };
1855
1865
  });
1856
1866
  return ar(
1857
1867
  {
1858
- nodes: m,
1859
- edges: o.edges.map((h) => ({
1860
- ...h,
1861
- sections: (k.get(h.id) ?? []).map(
1862
- (M) => M.map((F) => ({ x: F.x + y, y: F.y + g }))
1868
+ nodes: y,
1869
+ edges: o.edges.map((d) => ({
1870
+ ...d,
1871
+ sections: (S.get(d.id) ?? []).map(
1872
+ (x) => x.map((P) => ({ x: P.x + I, y: P.y + f }))
1863
1873
  )
1864
1874
  })),
1865
- bounds: { x: y, y: g, width: U.width ?? 0, height: U.height ?? 0 }
1875
+ bounds: { x: I, y: f, width: N.width ?? 0, height: N.height ?? 0 }
1866
1876
  },
1867
1877
  s,
1868
1878
  o.nodes
@@ -1888,10 +1898,10 @@ function un(a, s) {
1888
1898
  _.nodeId,
1889
1899
  b === "RIGHT" || b === "LEFT" ? _.y : _.x
1890
1900
  ])
1891
- ), u = new Map(a.nodes.map((_, P) => [_.id, P]));
1892
- return { nodes: [...a.nodes].sort((_, P) => {
1893
- const R = (_.parentId ?? "").localeCompare(P.parentId ?? ""), U = s.layers && !_.parentId && !P.parentId || _.parentId === P.parentId && _.parentId && s.groupLayouts?.[_.parentId] ? 0 : (o.get(_.id) ?? 1 / 0) - (o.get(P.id) ?? 1 / 0);
1894
- return R || U || u.get(_.id) - u.get(P.id);
1901
+ ), u = new Map(a.nodes.map((_, R) => [_.id, R]));
1902
+ return { nodes: [...a.nodes].sort((_, R) => {
1903
+ const F = (_.parentId ?? "").localeCompare(R.parentId ?? ""), N = s.layers && !_.parentId && !R.parentId || _.parentId === R.parentId && _.parentId && s.groupLayouts?.[_.parentId] ? 0 : (o.get(_.id) ?? 1 / 0) - (o.get(R.id) ?? 1 / 0);
1904
+ return F || N || u.get(_.id) - u.get(R.id);
1895
1905
  }), edges: a.edges };
1896
1906
  }
1897
1907
  function ln(a, s) {
@@ -1910,11 +1920,11 @@ function ln(a, s) {
1910
1920
  }
1911
1921
  function dn(a, s) {
1912
1922
  const b = new Map(a.nodes.map((u) => [u.id, u])), o = /* @__PURE__ */ new Set();
1913
- for (const [u, I] of s.entries()) {
1914
- if (!I.length) throw new Error(`Graph layer must not be empty: ${u}`);
1915
- for (const _ of I) {
1916
- const P = b.get(_);
1917
- if (!P || P.parentId) throw new Error(`Graph layer object must be a root node: ${_}`);
1923
+ for (const [u, C] of s.entries()) {
1924
+ if (!C.length) throw new Error(`Graph layer must not be empty: ${u}`);
1925
+ for (const _ of C) {
1926
+ const R = b.get(_);
1927
+ if (!R || R.parentId) throw new Error(`Graph layer object must be a root node: ${_}`);
1918
1928
  if (o.has(_)) throw new Error(`Graph object appears in multiple layers: ${_}`);
1919
1929
  o.add(_);
1920
1930
  }