@milaboratories/pl-middle-layer 1.23.19 → 1.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,103 +1,103 @@
1
1
  var ys = Object.defineProperty;
2
2
  var ws = (s, e, t) => e in s ? ys(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
3
  var S = (s, e, t) => ws(s, typeof e != "symbol" ? e + "" : e, t);
4
- import { mapValueInVOE as Fr, executePSpecPredicate as Ss, mapPObjectData as le, mapPTableDef as pt, JsRenderInternal as bs, extractConfig as Tr, isConfigLambda as Ar, DefaultNavigationState as Rs, extractAllColumns as Es } from "@platforma-sdk/model";
4
+ import { mapValueInVOE as Tr, executePSpecPredicate as Ss, mapPObjectData as le, mapPTableDef as ht, JsRenderInternal as bs, extractConfig as Ar, isConfigLambda as Lr, DefaultNavigationState as Cs, extractAllColumns as Rs } from "@platforma-sdk/model";
5
5
  export * from "@platforma-sdk/model";
6
- import { AnyChannel as ke, StableChannel as ne, blockPackIdToString as Jt, blockPackIdEquals as Gt } from "@milaboratories/pl-model-middle-layer";
6
+ import { AnyChannel as we, StableChannel as ie, InitialBlockSettings as Gt, blockPackIdToString as Es } from "@milaboratories/pl-model-middle-layer";
7
7
  export * from "@milaboratories/pl-model-middle-layer";
8
- import { request as ie, RetryAgent as Cs } from "undici";
9
- import { RegistryV1 as ue, tryLoadPackDescription as ht, BlockPackMetaEmbedAbsoluteBytes as ks, RegistryV2Reader as Ps, folderReaderByUrl as Os, loadPackDescription as Mt } from "@platforma-sdk/block-tools";
10
- import q from "node:fs";
8
+ import { request as ae, RetryAgent as ks } from "undici";
9
+ import { RegistryV1 as ue, tryLoadPackDescription as ft, BlockPackMetaEmbedAbsoluteBytes as Ps, RegistryV2Reader as Os, folderReaderByUrl as $s, loadPackDescription as Mt } from "@platforma-sdk/block-tools";
10
+ import z from "node:fs";
11
11
  import H from "node:path";
12
- import $s from "yaml";
13
- import { assertNever as J, notEmpty as B, ConsoleLoggerAdapter as Is, ConcurrencyLimitingExecutor as Fs, HmacSha256Signer as Lr } from "@milaboratories/ts-helpers";
14
- import * as Nr from "node:fs/promises";
15
- import { tryResolve as Ts } from "@milaboratories/resolve-helper";
16
- import { resourceTypesEqual as ae, field as j, Pl as T, PlClient as As, isNullResourceId as _e, ensureResourceIdNotNull as ft, isResource as Ls, isResourceRef as Ns, isNotNullResourceId as _t, resourceType as Le, resourceTypeToString as Ds, resourceIdToString as Dr, isNotFoundError as Bs, isTimeoutOrCancelError as js, toGlobalResourceId as xs, plAddressToConfig as Vs, UnauthenticatedPlClient as Kt } from "@milaboratories/pl-client";
12
+ import Is from "yaml";
13
+ import { assertNever as G, notEmpty as B, ConsoleLoggerAdapter as Fs, ConcurrencyLimitingExecutor as Ts, HmacSha256Signer as Nr } from "@milaboratories/ts-helpers";
14
+ import * as Dr from "node:fs/promises";
15
+ import { tryResolve as As } from "@milaboratories/resolve-helper";
16
+ import { resourceTypesEqual as ce, field as j, Pl as L, PlClient as Ls, isNullResourceId as Ke, ensureResourceIdNotNull as gt, isResource as Ns, isResourceRef as Ds, isNotNullResourceId as _t, resourceType as Le, resourceTypeToString as Bs, resourceIdToString as Br, isNotFoundError as js, isTimeoutOrCancelError as xs, toGlobalResourceId as Vs, plAddressToConfig as Us, UnauthenticatedPlClient as Kt } from "@milaboratories/pl-client";
17
17
  export * from "@milaboratories/pl-client";
18
- import { SynchronizedTreeState as Br, PlError as Us, isPlTreeNodeAccessor as Js } from "@milaboratories/pl-tree";
19
- import { Computable as V, ChangeSource as Ht, PollComputablePool as Gs, WatchableValue as Ms } from "@milaboratories/computable";
18
+ import { SynchronizedTreeState as jr, PlError as Js, isPlTreeNodeAccessor as Gs } from "@milaboratories/pl-tree";
19
+ import { Computable as V, ChangeSource as Ht, PollComputablePool as Ms, WatchableValue as _s } from "@milaboratories/computable";
20
20
  import { randomUUID as Fe, createHash as Ne } from "node:crypto";
21
- import { parseTemplate as _s, PlTemplateV1 as ce, PlTemplateOverrideV1 as Pe, PlTemplateLibV1 as Be, PlTemplateSoftwareV1 as Se } from "@milaboratories/pl-model-backend";
22
- import jr from "denque";
23
- import { Templates as Ks } from "@platforma-sdk/workflow-tengo";
24
- import ye from "canonicalize";
25
- import Hs from "node:assert";
26
- import { Scope as gt, getQuickJS as Ws } from "quickjs-emscripten";
27
- import { setTimeout as xr } from "node:timers/promises";
28
- import { createDownloadClient as zs, createLogsClient as Xs, createUploadBlobClient as qs, createUploadProgressClient as Ys, DownloadDriver as Qs, UploadDriver as Zs, LogsStreamDriver as eo, LogsDriver as to, LsDriver as ro, DownloadUrlDriver as so } from "@milaboratories/pl-drivers";
29
- import { PFrame as oo } from "@milaboratories/pframes-node";
30
- import { LRUCache as no } from "lru-cache";
31
- import { channel as io } from "node:diagnostics_channel";
21
+ import { parseTemplate as Ks, PlTemplateV1 as ne, PlTemplateOverrideV1 as Pe, PlTemplateLibV1 as Be, PlTemplateSoftwareV1 as be } from "@milaboratories/pl-model-backend";
22
+ import xr from "denque";
23
+ import { Templates as Hs } from "@platforma-sdk/workflow-tengo";
24
+ import re from "canonicalize";
25
+ import Ws from "node:assert";
26
+ import { Scope as mt, getQuickJS as qs } from "quickjs-emscripten";
27
+ import { setTimeout as Vr } from "node:timers/promises";
28
+ import { createDownloadClient as Xs, createLogsClient as zs, createUploadBlobClient as Ys, createUploadProgressClient as Qs, DownloadDriver as Zs, UploadDriver as eo, LogsStreamDriver as to, LogsDriver as ro, LsDriver as so, DownloadUrlDriver as oo } from "@milaboratories/pl-drivers";
29
+ import { PFrame as no } from "@milaboratories/pframes-node";
30
+ import { LRUCache as io } from "lru-cache";
31
+ import { channel as ao } from "node:diagnostics_channel";
32
32
  async function Wt(s) {
33
33
  try {
34
- return await Nr.stat(s, { bigint: !0 });
34
+ return await Dr.stat(s, { bigint: !0 });
35
35
  } catch (e) {
36
36
  if (e.code === "ENOENT")
37
37
  return;
38
38
  throw e;
39
39
  }
40
40
  }
41
- const ao = [ue.PlPackageYamlConfigFile], co = [ue.PlPackageJsonConfigFile], kt = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], Pt = ["config", "dist", "config.json"], Vr = ["frontend", "dist"], zt = "block-model/dist/config.json", lo = "block-ui/package.json", uo = [
42
- kt,
41
+ const co = [ue.PlPackageYamlConfigFile], lo = [ue.PlPackageJsonConfigFile], Pt = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], Ot = ["config", "dist", "config.json"], Ur = ["frontend", "dist"], qt = "block-model/dist/config.json", uo = "block-ui/package.json", po = [
43
42
  Pt,
44
- ao,
43
+ Ot,
45
44
  co,
46
- Vr
45
+ lo,
46
+ Ur
47
47
  ];
48
- async function po(s) {
49
- return await Wt(H.join(s, ...Pt)) !== void 0 || await Wt(H.join(s, ...kt)) !== void 0;
48
+ async function ho(s) {
49
+ return await Wt(H.join(s, ...Ot)) !== void 0 || await Wt(H.join(s, ...Pt)) !== void 0;
50
50
  }
51
- function rt(s, e) {
52
- const t = Ts(s, e);
51
+ function st(s, e) {
52
+ const t = As(s, e);
53
53
  if (t === void 0) throw new Error(`Can't resolve ${e} against ${s}`);
54
54
  return t;
55
55
  }
56
56
  async function Xt(s, e) {
57
- if (H.isAbsolute(s) || (s = H.resolve(s)), await po(s))
57
+ if (H.isAbsolute(s) || (s = H.resolve(s)), await ho(s))
58
58
  return {
59
- workflow: H.join(s, ...kt),
60
- config: H.join(s, ...Pt),
61
- ui: H.join(s, ...Vr)
59
+ workflow: H.join(s, ...Pt),
60
+ config: H.join(s, ...Ot),
61
+ ui: H.join(s, ...Ur)
62
62
  };
63
63
  {
64
- const t = rt(s, zt), r = rt(s, zt), o = rt(s, lo);
64
+ const t = st(s, qt), r = st(s, qt), o = st(s, uo);
65
65
  return { workflow: t, config: r, ui: H.resolve(o, "..", "dist") };
66
66
  }
67
67
  }
68
- async function ho(s) {
68
+ async function fo(s) {
69
69
  try {
70
- return await q.promises.readFile(s, "utf8");
70
+ return await z.promises.readFile(s, "utf8");
71
71
  } catch (e) {
72
72
  if (e.code === "ENOENT")
73
73
  return;
74
74
  throw e;
75
75
  }
76
76
  }
77
- async function fo(s) {
77
+ async function go(s) {
78
78
  try {
79
- return await q.promises.stat(s, { bigint: !0 });
79
+ return await z.promises.stat(s, { bigint: !0 });
80
80
  } catch (e) {
81
81
  if (e.code === "ENOENT")
82
82
  return;
83
83
  throw e;
84
84
  }
85
85
  }
86
- async function Ur(s) {
86
+ async function Jr(s) {
87
87
  let e = 0n;
88
- for (const t of uo) {
89
- const r = H.join(s, ...t), o = await fo(r);
88
+ for (const t of po) {
89
+ const r = H.join(s, ...t), o = await go(r);
90
90
  o !== void 0 && e < o.mtimeNs && (e = o.mtimeNs);
91
91
  }
92
92
  return e.toString();
93
93
  }
94
- async function Ot(s) {
95
- const e = await q.promises.stat(s.components.workflow.main.file, {
94
+ async function $t(s) {
95
+ const e = await z.promises.stat(s.components.workflow.main.file, {
96
96
  bigint: !0
97
- }), t = await q.promises.stat(s.components.model.file, { bigint: !0 });
97
+ }), t = await z.promises.stat(s.components.model.file, { bigint: !0 });
98
98
  return (e.mtimeNs > t.mtimeNs ? e.mtimeNs : t.mtimeNs).toString();
99
99
  }
100
- class Vl {
100
+ class Ul {
101
101
  constructor(e, t, r) {
102
102
  this.v2Provider = e, this.registries = t, this.http = r;
103
103
  }
@@ -105,17 +105,17 @@ class Vl {
105
105
  const t = [], r = e.spec;
106
106
  switch (r.type) {
107
107
  case "remote-v1":
108
- const o = this.http !== void 0 ? { dispatcher: this.http } : {}, i = await (await ie(
108
+ const o = this.http !== void 0 ? { dispatcher: this.http } : {}, i = await (await ae(
109
109
  `${r.url}/${ue.GlobalOverviewPath}`,
110
110
  o
111
111
  )).body.json();
112
112
  for (const c of i) {
113
- const { organization: a, package: l, latestMeta: u, latestVersion: d } = c, m = {
113
+ const { organization: a, package: l, latestMeta: u, latestVersion: d } = c, f = {
114
114
  organization: a,
115
115
  name: l,
116
116
  version: d
117
117
  }, h = {
118
- id: m,
118
+ id: f,
119
119
  meta: {
120
120
  title: u.title ?? "No title",
121
121
  description: u.description ?? "No Description",
@@ -126,48 +126,48 @@ class Vl {
126
126
  },
127
127
  spec: {
128
128
  type: "from-registry-v1",
129
- id: m,
129
+ id: f,
130
130
  registryUrl: r.url
131
131
  }
132
132
  };
133
133
  t.push({
134
134
  registryId: e.id,
135
- id: m,
135
+ id: f,
136
136
  latestByChannel: {
137
- [ke]: h,
138
- [ne]: h
137
+ [we]: h,
138
+ [ie]: h
139
139
  },
140
- allVersions: c.allVersions.map((f) => ({ version: f, channels: [] }))
140
+ allVersions: c.allVersions.map((g) => ({ version: g, channels: [] }))
141
141
  });
142
142
  }
143
143
  return t;
144
144
  case "remote-v2":
145
145
  return (await this.v2Provider.getRegistry(r.url).listBlockPacks()).map(
146
- (c) => c.latestByChannel[ne] ? {
146
+ (c) => c.latestByChannel[ie] ? {
147
147
  ...c,
148
148
  registryId: e.id
149
149
  } : {
150
150
  ...c,
151
151
  latestByChannel: {
152
152
  ...c.latestByChannel,
153
- [ne]: ((a) => a.spec.type === "from-registry-v2" ? { ...a, spec: { ...a.spec, channel: ne } } : a)(c.latestByChannel[ke])
153
+ [ie]: ((a) => a.spec.type === "from-registry-v2" ? { ...a, spec: { ...a.spec, channel: ie } } : a)(c.latestByChannel[we])
154
154
  },
155
155
  registryId: e.id
156
156
  }
157
157
  );
158
158
  case "local-dev":
159
- for (const c of await q.promises.readdir(r.path, { withFileTypes: !0 })) {
159
+ for (const c of await z.promises.readdir(r.path, { withFileTypes: !0 })) {
160
160
  if (!c.isDirectory()) continue;
161
- const a = H.join(r.path, c.name), l = await ho(
161
+ const a = H.join(r.path, c.name), l = await fo(
162
162
  H.join(a, ue.PlPackageYamlConfigFile)
163
163
  );
164
164
  if (l !== void 0) {
165
- const u = ue.PlPackageConfigData.parse($s.parse(l)), d = await Ur(a), m = {
165
+ const u = ue.PlPackageConfigData.parse(Is.parse(l)), d = await Jr(a), f = {
166
166
  organization: u.organization,
167
167
  name: u.package,
168
168
  version: "DEV"
169
169
  }, h = {
170
- id: m,
170
+ id: f,
171
171
  meta: {
172
172
  title: u.meta.title ?? "No title",
173
173
  description: u.meta.description ?? "No Description",
@@ -184,35 +184,35 @@ class Vl {
184
184
  };
185
185
  t.push({
186
186
  registryId: e.id,
187
- id: m,
187
+ id: f,
188
188
  latestByChannel: {
189
- [ke]: h,
190
- [ne]: h
189
+ [we]: h,
190
+ [ie]: h
191
191
  },
192
192
  allVersions: []
193
193
  });
194
194
  } else {
195
- let u = a, d = await ht(u);
195
+ let u = a, d = await ft(u);
196
196
  if (d === void 0) {
197
- for (const m of ["block", "meta"])
198
- if (u = H.join(a, m), d = await ht(u), d !== void 0) break;
197
+ for (const f of ["block", "meta"])
198
+ if (u = H.join(a, f), d = await ft(u), d !== void 0) break;
199
199
  }
200
200
  if (d !== void 0) {
201
- const m = await Ot(d), h = {
201
+ const f = await $t(d), h = {
202
202
  id: d.id,
203
- meta: await ks.parseAsync(d.meta),
203
+ meta: await Ps.parseAsync(d.meta),
204
204
  spec: {
205
205
  type: "dev-v2",
206
206
  folder: u,
207
- mtime: m
207
+ mtime: f
208
208
  }
209
209
  };
210
210
  t.push({
211
211
  registryId: e.id,
212
212
  id: d.id,
213
213
  latestByChannel: {
214
- [ke]: h,
215
- [ne]: h
214
+ [we]: h,
215
+ [ie]: h
216
216
  },
217
217
  allVersions: []
218
218
  });
@@ -221,7 +221,7 @@ class Vl {
221
221
  }
222
222
  return t;
223
223
  default:
224
- return J(r);
224
+ return G(r);
225
225
  }
226
226
  }
227
227
  async listBlockPacks() {
@@ -241,7 +241,7 @@ class Vl {
241
241
  return await this.v2Provider.getRegistry(o.url).getSpecificOverview(t, r);
242
242
  }
243
243
  }
244
- class go {
244
+ class mo {
245
245
  constructor(e) {
246
246
  S(this, "registries", /* @__PURE__ */ new Map());
247
247
  this.http = e;
@@ -249,62 +249,62 @@ class go {
249
249
  getRegistry(e) {
250
250
  const t = this.registries.get(e);
251
251
  if (t) return t;
252
- const r = new Ps(Os(e, this.http));
252
+ const r = new Os($s(e, this.http));
253
253
  return this.registries.set(e, r), r;
254
254
  }
255
255
  }
256
- const Ul = {
256
+ const Jl = {
257
257
  type: "remote-v2",
258
258
  url: "https://blocks.pl-open.science/"
259
- }, Jl = {
259
+ }, Gl = {
260
260
  type: "remote-v1",
261
261
  url: "https://block.registry.platforma.bio/releases"
262
- }, Gl = {
262
+ }, Ml = {
263
263
  type: "remote-v1",
264
264
  url: "https://block.registry.platforma.bio/dev"
265
- }, mo = {
266
- groups: [{ id: "default", label: "Default", blocks: [] }]
267
265
  }, vo = {
266
+ groups: [{ id: "default", label: "Default", blocks: [] }]
267
+ }, yo = {
268
268
  stagingRefreshTimestamp: 0,
269
269
  blocksInLimbo: []
270
- }, yo = {
270
+ }, wo = {
271
271
  label: "New Project"
272
- }, wo = { name: "UserProject", version: "2" }, Jr = "SchemaVersion", Gr = "1", $t = "ProjectCreated", Te = "ProjectLastModified", Ae = "ProjectMeta", de = "ProjectStructure", Ke = "BlockRenderingState", So = "BlockFrontendState/", bo = /^BlockFrontendState\/(?<blockid>.*)$/;
273
- function mt(s) {
274
- return `${So}${s}`;
272
+ }, So = { name: "UserProject", version: "2" }, Gr = "SchemaVersion", Mr = "1", It = "ProjectCreated", Te = "ProjectLastModified", Ae = "ProjectMeta", de = "ProjectStructure", He = "BlockRenderingState", bo = "BlockFrontendState/", Co = /^BlockFrontendState\/(?<blockid>.*)$/;
273
+ function vt(s) {
274
+ return `${bo}${s}`;
275
275
  }
276
276
  const Ro = "BlockArgsAuthor/";
277
- function vt(s) {
277
+ function yt(s) {
278
278
  return `${Ro}${s}`;
279
279
  }
280
- const yt = "ProjectStructureAuthor";
280
+ const wt = "ProjectStructureAuthor";
281
281
  function Eo(s) {
282
- const e = s.match(bo);
282
+ const e = s.match(Co);
283
283
  if (e !== null)
284
284
  return e.groups.blockid;
285
285
  }
286
- const Co = "__serviceTemplate_";
287
- function wt(s) {
288
- return `${Co}${s}`;
286
+ const ko = "__serviceTemplate_";
287
+ function St(s) {
288
+ return `${ko}${s}`;
289
289
  }
290
290
  function U(s, e) {
291
291
  return `${s}-${e}`;
292
292
  }
293
- const ko = /^(?<blockId>.*)-(?<fieldName>blockPack|prodArgs|currentArgs|prodCtx|prodUiCtx|prodOutput|prodCtxPrevious|prodUiCtxPrevious|prodOutputPrevious|stagingCtx|stagingUiCtx|stagingOutput|stagingCtxPrevious|stagingUiCtxPrevious|stagingOutputPrevious)$/;
294
- function Po(s) {
295
- const e = s.match(ko);
293
+ const Po = /^(?<blockId>.*)-(?<fieldName>blockPack|blockSettings|prodArgs|currentArgs|prodCtx|prodUiCtx|prodOutput|prodCtxPrevious|prodUiCtxPrevious|prodOutputPrevious|stagingCtx|stagingUiCtx|stagingOutput|stagingCtxPrevious|stagingUiCtxPrevious|stagingOutputPrevious)$/;
294
+ function Oo(s) {
295
+ const e = s.match(Po);
296
296
  if (e === null) return;
297
297
  const { blockId: t, fieldName: r } = e.groups;
298
298
  return { blockId: t, fieldName: r };
299
299
  }
300
- const Oo = "projects", Mr = { name: "Projects", version: "1" }, $o = (s) => ae(s.type, Mr) ? s.fields : [];
301
- async function Io(s, e, t, r) {
302
- const o = await Br.init(
300
+ const $o = "projects", _r = { name: "Projects", version: "1" }, Io = (s) => ce(s.type, _r) ? s.fields : [];
301
+ async function Fo(s, e, t, r) {
302
+ const o = await jr.init(
303
303
  s,
304
304
  e,
305
305
  {
306
306
  ...r.ops.defaultTreeOptions,
307
- pruning: $o
307
+ pruning: Io
308
308
  },
309
309
  r.logger
310
310
  );
@@ -315,58 +315,58 @@ async function Io(s, e, t, r) {
315
315
  for (const u of c.listDynamicFields()) {
316
316
  const d = c.traverse(u);
317
317
  if (d === void 0) continue;
318
- const m = B(d.getKeyValueAsJson(Ae)), h = B(d.getKeyValueAsJson($t)), f = B(d.getKeyValueAsJson(Te));
318
+ const f = B(d.getKeyValueAsJson(Ae)), h = B(d.getKeyValueAsJson(It)), g = B(d.getKeyValueAsJson(Te));
319
319
  l.push({
320
320
  id: u,
321
321
  rid: d.id,
322
322
  created: new Date(h),
323
- lastModified: new Date(f),
323
+ lastModified: new Date(g),
324
324
  opened: a.indexOf(d.id) >= 0,
325
- meta: m
325
+ meta: f
326
326
  });
327
327
  }
328
328
  return l.sort((u) => -u.lastModified.valueOf()), l;
329
329
  }).withStableType(), tree: o };
330
330
  }
331
- const Fo = {
331
+ const To = {
332
332
  name: "EphRenderTemplate",
333
333
  version: "1"
334
- }, To = {
334
+ }, Ao = {
335
335
  name: "RenderTemplate",
336
336
  version: "1"
337
337
  };
338
- function _r(s, e, t, r, o) {
338
+ function Kr(s, e, t, r, o) {
339
339
  if (o.length === 0) throw new Error("Zero output names provided");
340
- const n = t ? s.createEphemeral(Fo) : s.createStruct(To), i = j(n, "template"), c = j(n, "inputs");
341
- return s.createField(i, "Input", e), s.createField(c, "Input", T.createPlMap(s, r, t)), s.lockInputs(n), T.futureRecord(s, n, o, "Output", "outputs/");
340
+ const n = t ? s.createEphemeral(To) : s.createStruct(Ao), i = j(n, "template"), c = j(n, "inputs");
341
+ return s.createField(i, "Input", e), s.createField(c, "Input", L.createPlMap(s, r, t)), s.lockInputs(n), L.futureRecord(s, n, o, "Output", "outputs/");
342
342
  }
343
- const Ao = { name: "BContextEnd", version: "1" }, Lo = { name: "BContext", version: "1" }, No = "id", Do = "parent/", Bo = ["context", "result"];
344
- function qt(s, e, t) {
345
- return _r(s, e, !0, t, Bo);
343
+ const Lo = { name: "BContextEnd", version: "1" }, No = { name: "BContext", version: "1" }, Do = "id", Bo = "parent/", jo = ["context", "result"];
344
+ function zt(s, e, t) {
345
+ return Kr(s, e, !0, t, jo);
346
346
  }
347
- function jo(s) {
348
- const e = s.createEphemeral(Ao);
347
+ function xo(s) {
348
+ const e = s.createEphemeral(Lo);
349
349
  return s.lock(e), e;
350
350
  }
351
- function xo(s, e) {
352
- if (e.length === 0) return jo(s);
351
+ function Vo(s, e) {
352
+ if (e.length === 0) return xo(s);
353
353
  if (e.length === 1) return e[0];
354
- const t = s.createEphemeral(Lo);
355
- s.createField(j(t, No), "Input", T.createPlString(s, Fe()));
354
+ const t = s.createEphemeral(No);
355
+ s.createField(j(t, Do), "Input", L.createPlString(s, Fe()));
356
356
  for (let r = 0; r < e.length; r++)
357
- s.createField(j(t, `${Do}${r}`), "Input", e[r]);
357
+ s.createField(j(t, `${Bo}${r}`), "Input", e[r]);
358
358
  return s.lock(t), t;
359
359
  }
360
- function Vo(s, e) {
361
- const t = _s(e.content), r = t.type;
360
+ function Uo(s, e) {
361
+ const t = Ks(e.content), r = t.type;
362
362
  switch (r) {
363
363
  case "pl.tengo-template.v2":
364
- return Hr(s, t);
364
+ return Go(s, t);
365
365
  default:
366
- J(r);
366
+ G(r);
367
367
  }
368
368
  }
369
- const Kr = {
369
+ const Yt = {
370
370
  hash(s, e) {
371
371
  e.update(Be.type.name).update(Be.type.version).update(s.name).update(s.version).update(s.src);
372
372
  },
@@ -376,114 +376,113 @@ const Kr = {
376
376
  JSON.stringify(Be.fromV2Data(s).data)
377
377
  );
378
378
  }
379
- }, He = {
379
+ }, je = {
380
380
  hash(s, e) {
381
- e.update(Se.type.name).update(Se.type.version).update(s.name).update(s.version).update(s.src);
381
+ e.update(be.type.name).update(be.type.version).update(s.name).update(s.version).update(s.src);
382
382
  },
383
383
  render(s, e, t) {
384
- const r = Se.fromV2Data(s), o = e.createStruct(Se.type, r.data);
385
- return e.setKValue(o, Se.metaNameKey, JSON.stringify(r.name)), e.lock(o), o;
384
+ const r = be.fromV2Data(s), o = e.createStruct(be.type, r.data);
385
+ return e.setKValue(o, be.metaNameKey, JSON.stringify(r.name)), e.lock(o), o;
386
386
  }
387
- }, Uo = {
387
+ }, Jo = {
388
388
  hash(s, e) {
389
- e.update(ce.type.name).update(ce.type.version).update(s.hashOverride ?? "").update(s.name).update(s.version).update(s.src);
390
- const t = (r) => (r.sort((o, n) => o[0] === n[0] ? 0 : o[0] < n[0] ? -1 : 1), r);
391
- for (const [r, o] of t(Object.entries(s.libs ?? {})))
392
- e.update("lib:" + r), Kr.hash(o, e);
393
- for (const [r, o] of t(Object.entries(s.software ?? {})))
394
- e.update("soft:" + r), He.hash(o, e);
395
- for (const [r, o] of t(Object.entries(s.assets ?? {})))
396
- e.update("asset:" + r), He.hash(o, e);
397
- for (const [r, o] of t(Object.entries(s.templates ?? {})))
398
- e.update("tpl:" + r), this.hash(o, e);
389
+ e.update(Pe.type.name).update(Pe.type.version).update(s.hashOverride ?? "");
399
390
  },
400
391
  render(s, e, t) {
401
392
  return e.createStruct(
402
- ce.type,
403
- JSON.stringify(ce.fromV2Data(s).data)
393
+ Pe.type,
394
+ JSON.stringify(Pe.fromV2Data(s))
404
395
  );
405
396
  }
406
- }, Jo = {
397
+ }, Hr = {
407
398
  hash(s, e) {
408
- e.update(Pe.type.name).update(Pe.type.version).update(s.hashOverride ?? "");
399
+ e.update(ne.type.name).update(ne.type.version).update(s.hashOverride ?? "").update(s.name).update(s.version).update(s.src);
400
+ const t = (r) => (r.sort((o, n) => o[0] === n[0] ? 0 : o[0] < n[0] ? -1 : 1), r);
401
+ for (const [r, o] of t(Object.entries(s.libs ?? {})))
402
+ e.update("lib:" + r), Yt.hash(o, e);
403
+ for (const [r, o] of t(Object.entries(s.software ?? {})))
404
+ e.update("soft:" + r), je.hash(o, e);
405
+ for (const [r, o] of t(Object.entries(s.assets ?? {})))
406
+ e.update("asset:" + r), je.hash(o, e);
407
+ for (const [r, o] of t(Object.entries(s.templates ?? {})))
408
+ e.update("tpl:" + r), this.hash(o, e);
409
409
  },
410
410
  render(s, e, t) {
411
- return e.createStruct(
412
- Pe.type,
413
- JSON.stringify(Pe.fromV2Data(s))
411
+ const r = e.createStruct(
412
+ ne.type,
413
+ JSON.stringify(ne.fromV2Data(s).data)
414
414
  );
415
+ for (const [i, c] of Object.entries(s.libs ?? {})) {
416
+ const a = ne.libField(r, i);
417
+ e.createField(a, "Input"), e.setField(a, t(c, Yt));
418
+ }
419
+ for (const [i, c] of Object.entries(s.software ?? {})) {
420
+ const a = ne.swField(r, i);
421
+ e.createField(a, "Input"), e.setField(a, t(c, je));
422
+ }
423
+ for (const [i, c] of Object.entries(s.assets ?? {})) {
424
+ const a = ne.swField(r, i);
425
+ e.createField(a, "Input"), e.setField(a, t(c, je));
426
+ }
427
+ for (const [i, c] of Object.entries(s.templates ?? {})) {
428
+ const a = ne.tplField(r, i);
429
+ e.createField(a, "Input"), e.setField(a, t(c, Hr));
430
+ }
431
+ if (e.lock(r), !s.hashOverride) return r;
432
+ const o = t(s, Jo), n = Pe.tplField(o);
433
+ return e.createField(n, "Service"), e.setField(n, r), e.lock(r), o;
415
434
  }
416
435
  };
417
- function Hr(s, e, t) {
418
- t || (t = /* @__PURE__ */ new Map());
419
- const r = (c, a) => {
420
- const l = Ne("sha256");
421
- a.hash(c, l);
422
- const u = l.digest("hex");
423
- if (!t.has(u)) {
424
- const d = a.render(c, s, r);
425
- t.set(u, d);
436
+ function Go(s, e) {
437
+ const t = /* @__PURE__ */ new Map(), r = (o, n) => {
438
+ const i = Ne("sha256");
439
+ n.hash(o, i);
440
+ const c = i.digest("hex");
441
+ if (!t.has(c)) {
442
+ const a = n.render(o, s, r);
443
+ t.set(c, a);
426
444
  }
427
- return t.get(u);
428
- }, o = r(e, Uo);
429
- for (const [c, a] of Object.entries(e.libs ?? {})) {
430
- const l = ce.libField(o, c);
431
- s.createField(l, "Input"), s.setField(l, r(a, Kr));
432
- }
433
- for (const [c, a] of Object.entries(e.software ?? {})) {
434
- const l = ce.swField(o, c);
435
- s.createField(l, "Input"), s.setField(l, r(a, He));
436
- }
437
- for (const [c, a] of Object.entries(e.assets ?? {})) {
438
- const l = ce.swField(o, c);
439
- s.createField(l, "Input"), s.setField(l, r(a, He));
440
- }
441
- for (const [c, a] of Object.entries(e.templates ?? {})) {
442
- const l = ce.tplField(o, c);
443
- s.createField(l, "Input"), s.setField(l, Hr(s, a, t));
444
- }
445
- if (s.lock(o), !e.hashOverride)
446
- return o;
447
- const n = r(e, Jo), i = Pe.tplField(n);
448
- return s.createField(i, "Service"), s.setField(i, o), s.lock(o), n;
445
+ return t.get(c);
446
+ };
447
+ return r(e, Hr);
449
448
  }
450
- const Go = { name: "TengoTemplateGet", version: "1" }, Mo = "registry", _o = "templateURI", Ko = "template", Ml = { name: "TengoTemplatePack", version: "1" }, _l = {
449
+ const Mo = { name: "TengoTemplateGet", version: "1" }, _o = "registry", Ko = "templateURI", Ho = "template", _l = { name: "TengoTemplatePack", version: "1" }, Kl = {
451
450
  name: "TengoTemplatePackConvert",
452
451
  version: "1"
453
- }, Kl = "templatePack", Hl = "template";
454
- async function Ho(s) {
452
+ }, Hl = "templatePack", Wl = "template";
453
+ async function Wo(s) {
455
454
  switch (s.type) {
456
455
  case "from-file":
457
456
  return {
458
457
  type: "explicit",
459
- content: await q.promises.readFile(s.path)
458
+ content: await z.promises.readFile(s.path)
460
459
  };
461
460
  case "from-registry":
462
461
  case "explicit":
463
462
  return s;
464
463
  default:
465
- return J(s);
464
+ return G(s);
466
465
  }
467
466
  }
468
- function Wo(s, e) {
469
- const t = s.createStruct(Go), r = j(t, Mo), o = j(t, _o), n = j(t, Ko);
470
- return s.setField(r, s.createValue(T.JsonString, Buffer.from(JSON.stringify(e.registry)))), s.setField(o, s.createValue(T.JsonString, Buffer.from(JSON.stringify(e.path)))), n;
467
+ function qo(s, e) {
468
+ const t = s.createStruct(Mo), r = j(t, _o), o = j(t, Ko), n = j(t, Ho);
469
+ return s.setField(r, s.createValue(L.JsonString, Buffer.from(JSON.stringify(e.registry)))), s.setField(o, s.createValue(L.JsonString, Buffer.from(JSON.stringify(e.path)))), n;
471
470
  }
472
- function It(s, e) {
471
+ function Ft(s, e) {
473
472
  switch (e.type) {
474
473
  case "from-registry":
475
- return Wo(s, e);
474
+ return qo(s, e);
476
475
  case "explicit":
477
- return Vo(s, e);
476
+ return Uo(s, e);
478
477
  default:
479
- return J(e);
478
+ return G(e);
480
479
  }
481
480
  }
482
- const Wr = { name: "Frontend/FromUrl", version: "1" }, zr = {
481
+ const Wr = { name: "Frontend/FromUrl", version: "1" }, qr = {
483
482
  name: "Frontend/FromFolder",
484
483
  version: "1"
485
484
  };
486
- function zo(s, e) {
485
+ function Xo(s, e) {
487
486
  switch (e.type) {
488
487
  case "url":
489
488
  return s.createValue(
@@ -492,21 +491,21 @@ function zo(s, e) {
492
491
  );
493
492
  case "local":
494
493
  return s.createValue(
495
- zr,
494
+ qr,
496
495
  JSON.stringify({
497
496
  path: e.path,
498
497
  signature: e.signature
499
498
  })
500
499
  );
501
500
  default:
502
- return J(e);
501
+ return G(e);
503
502
  }
504
503
  }
505
- const Xo = { name: "BlockPackCustom", version: "1" }, Xr = "template", qr = "frontend";
506
- function Yt(s) {
504
+ const zo = { name: "BlockPackCustom", version: "1" }, Xr = "template", zr = "frontend";
505
+ function Qt(s) {
507
506
  return s.endsWith("/") ? s : `${s}/`;
508
507
  }
509
- class qo {
508
+ class Yo {
510
509
  constructor(e, t, r) {
511
510
  this.v2RegistryProvider = e, this.signer = t, this.http = r;
512
511
  }
@@ -515,25 +514,25 @@ class qo {
515
514
  case "explicit":
516
515
  return e.config;
517
516
  case "dev-v1": {
518
- const t = await Xt(e.folder), r = await q.promises.readFile(t.config, { encoding: "utf-8" });
517
+ const t = await Xt(e.folder), r = await z.promises.readFile(t.config, { encoding: "utf-8" });
519
518
  return JSON.parse(r);
520
519
  }
521
520
  case "dev-v2": {
522
- const t = await Mt(e.folder), r = await q.promises.readFile(t.components.model.file, {
521
+ const t = await Mt(e.folder), r = await z.promises.readFile(t.components.model.file, {
523
522
  encoding: "utf-8"
524
523
  });
525
524
  return JSON.parse(r);
526
525
  }
527
526
  case "from-registry-v1": {
528
- const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${Yt(e.registryUrl)}${ue.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`;
529
- return await (await ie(`${r}/config.json`, t)).body.json();
527
+ const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${Qt(e.registryUrl)}${ue.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`;
528
+ return await (await ae(`${r}/config.json`, t)).body.json();
530
529
  }
531
530
  case "from-registry-v2": {
532
531
  const t = this.http !== void 0 ? { dispatcher: this.http } : {}, o = await this.v2RegistryProvider.getRegistry(e.registryUrl).getComponents(e.id);
533
- return await (await ie(o.model.url, t)).body.json();
532
+ return await (await ae(o.model.url, t)).body.json();
534
533
  }
535
534
  default:
536
- return J(e);
535
+ return G(e);
537
536
  }
538
537
  }
539
538
  async prepare(e) {
@@ -541,8 +540,8 @@ class qo {
541
540
  case "explicit":
542
541
  return e;
543
542
  case "dev-v1": {
544
- const t = await Xt(e.folder), r = await q.promises.readFile(t.workflow), o = JSON.parse(
545
- await q.promises.readFile(t.config, "utf-8")
543
+ const t = await Xt(e.folder), r = await z.promises.readFile(t.workflow), o = JSON.parse(
544
+ await z.promises.readFile(t.config, "utf-8")
546
545
  ), n = t.ui;
547
546
  return {
548
547
  type: "explicit",
@@ -561,13 +560,13 @@ class qo {
561
560
  }
562
561
  case "dev-v2": {
563
562
  const t = await Mt(e.folder), r = JSON.parse(
564
- await q.promises.readFile(t.components.model.file, {
563
+ await z.promises.readFile(t.components.model.file, {
565
564
  encoding: "utf-8"
566
565
  })
567
- ), o = await q.promises.readFile(
566
+ ), o = await z.promises.readFile(
568
567
  t.components.workflow.main.file
569
568
  ), n = t.components.ui.folder, i = { ...e };
570
- return e.mtime === void 0 && (i.mtime = await Ot(t)), {
569
+ return e.mtime === void 0 && (i.mtime = await $t(t)), {
571
570
  type: "explicit",
572
571
  template: {
573
572
  type: "explicit",
@@ -583,12 +582,12 @@ class qo {
583
582
  };
584
583
  }
585
584
  case "from-registry-v1": {
586
- const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${Yt(e.registryUrl)}${ue.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, o = `${r}/template.plj.gz`, n = await ie(o, t);
585
+ const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${Qt(e.registryUrl)}${ue.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, o = `${r}/template.plj.gz`, n = await ae(o, t);
587
586
  if (n.statusCode !== 200)
588
587
  throw new Error(
589
588
  `Block not found in registry (url = ${o} ; code = ${n.statusCode}): ` + JSON.stringify(e)
590
589
  );
591
- const i = new Uint8Array(await n.body.arrayBuffer()), a = await (await ie(`${r}/config.json`, t)).body.json();
590
+ const i = new Uint8Array(await n.body.arrayBuffer()), a = await (await ae(`${r}/config.json`, t)).body.json();
592
591
  return {
593
592
  type: "explicit",
594
593
  template: {
@@ -604,7 +603,7 @@ class qo {
604
603
  };
605
604
  }
606
605
  case "from-registry-v2": {
607
- const t = this.http !== void 0 ? { dispatcher: this.http } : {}, o = await this.v2RegistryProvider.getRegistry(e.registryUrl).getComponents(e.id), n = async () => await (await ie(o.model.url, t)).body.json(), i = async () => await (await ie(o.workflow.main.url, t)).body.arrayBuffer(), [c, a] = await Promise.all([n(), i()]);
606
+ const t = this.http !== void 0 ? { dispatcher: this.http } : {}, o = await this.v2RegistryProvider.getRegistry(e.registryUrl).getComponents(e.id), n = async () => await (await ae(o.model.url, t)).body.json(), i = async () => await (await ae(o.workflow.main.url, t)).body.arrayBuffer(), [c, a] = await Promise.all([n(), i()]);
608
607
  return {
609
608
  type: "explicit",
610
609
  template: {
@@ -620,29 +619,29 @@ class qo {
620
619
  };
621
620
  }
622
621
  default:
623
- return J(e);
622
+ return G(e);
624
623
  }
625
624
  }
626
625
  }
627
- function Yo(s, e) {
628
- const t = { config: e.config, source: e.source }, r = s.createStruct(Xo, JSON.stringify(t));
629
- return s.createField(j(r, Xr), "Input", It(s, e.template)), s.createField(j(r, qr), "Input", zo(s, e.frontend)), s.lock(r), r;
626
+ function Qo(s, e) {
627
+ const t = { config: e.config, source: e.source }, r = s.createStruct(zo, JSON.stringify(t));
628
+ return s.createField(j(r, Xr), "Input", Ft(s, e.template)), s.createField(j(r, zr), "Input", Xo(s, e.frontend)), s.lock(r), r;
630
629
  }
631
- function Qt(s, e) {
630
+ function Zt(s, e) {
632
631
  switch (e.type) {
633
632
  case "explicit":
634
- return Yo(s, e);
633
+ return Qo(s, e);
635
634
  default:
636
- return J(e.type);
635
+ return G(e.type);
637
636
  }
638
637
  }
639
- function je(s, e) {
638
+ function xe(s, e) {
640
639
  return { __isRef: !0, blockId: s, name: e };
641
640
  }
642
- function Qo(s) {
641
+ function Zo(s) {
643
642
  return typeof s == "object" && s !== null && s.__isRef === !0 && "blockId" in s && "name" in s;
644
643
  }
645
- function St(s, e, t) {
644
+ function bt(s, e, t) {
646
645
  const r = typeof e;
647
646
  switch (r) {
648
647
  case "function":
@@ -655,21 +654,21 @@ function St(s, e, t) {
655
654
  return;
656
655
  case "object":
657
656
  if (e === null) return;
658
- if (Qo(e))
657
+ if (Zo(e))
659
658
  t === void 0 || t.has(e.blockId) ? s.upstreams.add(e.blockId) : s.missingReferences = !0;
660
659
  else if (Array.isArray(e))
661
- for (const o of e) St(s, o, t);
660
+ for (const o of e) bt(s, o, t);
662
661
  else
663
662
  for (const [, o] of Object.entries(e))
664
- St(s, o, t);
663
+ bt(s, o, t);
665
664
  return;
666
665
  default:
667
- J(r);
666
+ G(r);
668
667
  }
669
668
  }
670
- function Zo(s, e) {
669
+ function en(s, e) {
671
670
  const t = { upstreams: /* @__PURE__ */ new Set(), missingReferences: !1 };
672
- return St(t, s, e), t;
671
+ return bt(t, s, e), t;
673
672
  }
674
673
  function te(s) {
675
674
  return {
@@ -708,7 +707,7 @@ class Yr {
708
707
  }
709
708
  }
710
709
  }
711
- function bt(s) {
710
+ function Ct(s) {
712
711
  const e = /* @__PURE__ */ new Map();
713
712
  let t;
714
713
  for (const { id: r } of te(s)) {
@@ -720,12 +719,12 @@ function bt(s) {
720
719
  }
721
720
  return t !== void 0 && (t.downstream = /* @__PURE__ */ new Set()), new Yr(e);
722
721
  }
723
- function Me(s, e) {
722
+ function _e(s, e) {
724
723
  const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
725
724
  for (const { id: o } of te(s)) {
726
725
  const n = e(o);
727
726
  if (n === void 0) continue;
728
- const i = Zo(n, r), c = {
727
+ const i = en(n, r), c = {
729
728
  id: o,
730
729
  missingReferences: i.missingReferences,
731
730
  upstream: i.upstreams,
@@ -736,7 +735,7 @@ function Me(s, e) {
736
735
  }
737
736
  return new Yr(t);
738
737
  }
739
- function en(s, e) {
738
+ function tn(s, e) {
740
739
  if (s.size !== e.size) return !1;
741
740
  for (const t of s) if (!e.has(t)) return !1;
742
741
  return !0;
@@ -746,29 +745,29 @@ function Rt(s, e) {
746
745
  for (const t of s) if (e.has(t)) return !0;
747
746
  return !1;
748
747
  }
749
- function Zt(s, e) {
748
+ function er(s, e) {
750
749
  const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
751
750
  return s.nodes.forEach((n) => {
752
751
  const i = e.nodes.get(n.id);
753
- i === void 0 ? t.add(n.id) : (!en(n.upstream, i.upstream) || Rt(n.upstream, o)) && o.add(n.id);
752
+ i === void 0 ? t.add(n.id) : (!tn(n.upstream, i.upstream) || Rt(n.upstream, o)) && o.add(n.id);
754
753
  }), e.nodes.forEach((n) => {
755
754
  s.nodes.has(n.id) ? Rt(n.upstream, o) && o.add(n.id) : r.add(n.id);
756
755
  }), { onlyInA: t, onlyInB: r, different: o };
757
756
  }
758
- let st;
757
+ let ot;
759
758
  async function Qr() {
760
- if (st === void 0) {
761
- const s = await Ho(Ks["pframes.export-pframe"]);
759
+ if (ot === void 0) {
760
+ const s = await Wo(Hs["pframes.export-pframe"]);
762
761
  if (s.type !== "explicit") throw new Error("Unexpected prepared template type.");
763
762
  const e = Ne("sha256").update(s.content).digest("hex");
764
- st = { spec: s, hash: e };
763
+ ot = { spec: s, hash: e };
765
764
  }
766
- return st;
765
+ return ot;
767
766
  }
768
- function tn(s, e, t) {
769
- return _r(s, e, !0, { pf: t }, ["result"]).result;
767
+ function rn(s, e, t) {
768
+ return Kr(s, e, !0, { pf: t }, ["result"]).result;
770
769
  }
771
- function ot(s, e) {
770
+ function nt(s, e) {
772
771
  let t = !1, r, o;
773
772
  return () => {
774
773
  if (!t)
@@ -777,13 +776,13 @@ function ot(s, e) {
777
776
  return r !== n && (r = n, o = e()), e();
778
777
  };
779
778
  }
780
- class er {
779
+ class tr {
781
780
  constructor(e, t) {
782
- S(this, "currentInputsC", ot(
781
+ S(this, "currentInputsC", nt(
783
782
  () => this.fields.currentArgs.modCount,
784
783
  () => JSON.parse(Buffer.from(this.fields.currentArgs.value).toString())
785
784
  ));
786
- S(this, "actualProductionInputsC", ot(
785
+ S(this, "actualProductionInputsC", nt(
787
786
  () => {
788
787
  var e;
789
788
  return (e = this.fields.prodArgs) == null ? void 0 : e.modCount;
@@ -795,7 +794,7 @@ class er {
795
794
  return JSON.parse(Buffer.from(e).toString());
796
795
  }
797
796
  ));
798
- S(this, "productionStaleC", ot(
797
+ S(this, "productionStaleC", nt(
799
798
  () => {
800
799
  var e;
801
800
  return `${this.fields.currentArgs.modCount}_${(e = this.fields.prodArgs) == null ? void 0 : e.modCount}`;
@@ -840,17 +839,17 @@ class er {
840
839
  }
841
840
  getTemplate(e) {
842
841
  return e.getFutureFieldValue(
843
- T.unwrapHolder(e, this.fields.blockPack.ref),
842
+ L.unwrapHolder(e, this.fields.blockPack.ref),
844
843
  Xr,
845
844
  "Input"
846
845
  );
847
846
  }
848
847
  }
849
- const rn = (s) => {
848
+ const sn = (s) => {
850
849
  throw new Error(`No new block info for ${s}`);
851
850
  };
852
851
  class We {
853
- constructor(e, t, r, o, n, i, c, a, l, u, d, m) {
852
+ constructor(e, t, r, o, n, i, c, a, l, u, d, f) {
854
853
  S(this, "globalModCount", 0);
855
854
  S(this, "fieldsChanged", !1);
856
855
  //
@@ -869,11 +868,15 @@ class We {
869
868
  S(this, "stagingGraph");
870
869
  S(this, "pendingProductionGraph");
871
870
  S(this, "actualProductionGraph");
872
- this.rid = e, this.tx = t, this.author = r, this.schema = o, this.lastModified = n, this.meta = i, this.struct = c, this.renderingState = a, this.blocksInLimbo = l, this.blockInfos = u, this.blockFrontendStates = d, this.ctxExportTplHolder = m;
871
+ this.rid = e, this.tx = t, this.author = r, this.schema = o, this.lastModified = n, this.meta = i, this.struct = c, this.renderingState = a, this.blocksInLimbo = l, this.blockInfos = u, this.blockFrontendStates = d, this.ctxExportTplHolder = f;
873
872
  }
874
- fixProblems() {
875
- this.blockInfos.forEach((e) => {
876
- (e.fields.prodArgs === void 0 || e.fields.prodOutput === void 0 || e.fields.prodCtx === void 0) && this.deleteBlockFields(e.id, "prodArgs", "prodOutput", "prodCtx");
873
+ fixProblemsAndMigrate() {
874
+ this.blockInfos.forEach((t) => {
875
+ (t.fields.prodArgs === void 0 || t.fields.prodOutput === void 0 || t.fields.prodCtx === void 0) && this.deleteBlockFields(t.id, "prodArgs", "prodOutput", "prodCtx");
876
+ });
877
+ let e;
878
+ this.blockInfos.forEach((t) => {
879
+ t.fields.blockSettings === void 0 && (e === void 0 && (e = this.createJsonFieldValue(Gt)), this.setBlockFieldObj(t.id, "blockSettings", e));
877
880
  });
878
881
  }
879
882
  get wasModified() {
@@ -883,16 +886,16 @@ class We {
883
886
  return JSON.parse(JSON.stringify(this.struct));
884
887
  }
885
888
  getStagingGraph() {
886
- return this.stagingGraph === void 0 && (this.stagingGraph = bt(this.struct)), this.stagingGraph;
889
+ return this.stagingGraph === void 0 && (this.stagingGraph = Ct(this.struct)), this.stagingGraph;
887
890
  }
888
891
  getPendingProductionGraph() {
889
- return this.pendingProductionGraph === void 0 && (this.pendingProductionGraph = Me(
892
+ return this.pendingProductionGraph === void 0 && (this.pendingProductionGraph = _e(
890
893
  this.struct,
891
894
  (e) => this.getBlockInfo(e).currentInputs
892
895
  )), this.pendingProductionGraph;
893
896
  }
894
897
  getActualProductionGraph() {
895
- return this.actualProductionGraph === void 0 && (this.actualProductionGraph = Me(
898
+ return this.actualProductionGraph === void 0 && (this.actualProductionGraph = _e(
896
899
  this.struct,
897
900
  (e) => this.getBlockInfo(e).actualProductionInputs
898
901
  )), this.actualProductionGraph;
@@ -901,7 +904,16 @@ class We {
901
904
  // Generic helpers to interact with project state
902
905
  //
903
906
  getBlockInfo(e) {
904
- return B(this.blockInfos.get(e));
907
+ const t = this.blockInfos.get(e);
908
+ if (t === void 0) throw new Error(`No such block: ${e}`);
909
+ return t;
910
+ }
911
+ createJsonFieldValueByContent(e) {
912
+ const t = Buffer.from(e);
913
+ return { ref: this.tx.createValue(L.JsonObject, t), value: t, status: "Ready" };
914
+ }
915
+ createJsonFieldValue(e) {
916
+ return this.createJsonFieldValueByContent(JSON.stringify(e));
905
917
  }
906
918
  getBlock(e) {
907
919
  for (const t of te(this.struct)) if (t.id === e) return t;
@@ -961,7 +973,7 @@ class We {
961
973
  JSON.parse(o);
962
974
  const i = Buffer.from(o);
963
975
  if (Buffer.compare(n.fields.currentArgs.value, i) === 0) continue;
964
- const c = this.tx.createValue(T.JsonObject, i);
976
+ const c = this.tx.createValue(L.JsonObject, i);
965
977
  this.setBlockField(r, "currentArgs", c, "Ready", i), this.blocksWithChangedInputs.add(r), t.push(r);
966
978
  }
967
979
  this.getStagingGraph().traverse("downstream", t, ({ id: r }) => this.resetStaging(r)), t.length > 0 && this.updateLastModified();
@@ -970,6 +982,9 @@ class We {
970
982
  if (this.blockInfos.get(e) === void 0) throw new Error("no such block");
971
983
  this.blockFrontendStates.get(e) !== t && (t === void 0 ? this.blockFrontendStates.delete(e) : this.blockFrontendStates.set(e, t), this.changedBlockFrontendStates.add(e), this.blocksWithChangedInputs.add(e), this.updateLastModified());
972
984
  }
985
+ setBlockSettings(e, t) {
986
+ this.setBlockFieldObj(e, "blockSettings", this.createJsonFieldValue(t)), this.updateLastModified();
987
+ }
973
988
  /** Update block label */
974
989
  // public setBlockLabel(blockId: string, label: string): void {
975
990
  // const newStructure = this.structure;
@@ -990,26 +1005,26 @@ class We {
990
1005
  const n = this.getBlockInfo(o);
991
1006
  if (n.fields[t] === void 0 || n.fields[t].ref === void 0)
992
1007
  throw new Error("One of the upstreams staging is not rendered.");
993
- r.push(T.unwrapHolder(this.tx, n.fields[t].ref));
994
- }), xo(this.tx, r);
1008
+ r.push(L.unwrapHolder(this.tx, n.fields[t].ref));
1009
+ }), Vo(this.tx, r);
995
1010
  }
996
1011
  exportCtx(e) {
997
- return tn(this.tx, T.unwrapHolder(this.tx, this.ctxExportTplHolder), e);
1012
+ return rn(this.tx, L.unwrapHolder(this.tx, this.ctxExportTplHolder), e);
998
1013
  }
999
1014
  renderStagingFor(e) {
1000
1015
  this.resetStaging(e);
1001
1016
  const t = this.getBlockInfo(e), r = this.createCtx(this.getStagingGraph().nodes.get(e).upstream, "stagingCtx");
1002
1017
  if (this.getBlock(e).renderingMode !== "Heavy") throw new Error("not supported yet");
1003
- const o = t.getTemplate(this.tx), n = qt(this.tx, o, {
1018
+ const o = t.getTemplate(this.tx), n = zt(this.tx, o, {
1004
1019
  args: t.fields.currentArgs.ref,
1005
- blockId: this.tx.createValue(T.JsonString, JSON.stringify(e)),
1006
- isProduction: this.tx.createValue(T.JsonBool, JSON.stringify(!1)),
1020
+ blockId: this.tx.createValue(L.JsonString, JSON.stringify(e)),
1021
+ isProduction: this.tx.createValue(L.JsonBool, JSON.stringify(!1)),
1007
1022
  context: r
1008
1023
  });
1009
1024
  this.setBlockField(
1010
1025
  e,
1011
1026
  "stagingCtx",
1012
- T.wrapInEphHolder(this.tx, n.context),
1027
+ L.wrapInEphHolder(this.tx, n.context),
1013
1028
  "NotReady"
1014
1029
  ), this.setBlockField(e, "stagingUiCtx", this.exportCtx(n.context), "NotReady"), this.setBlockField(e, "stagingOutput", n.result, "NotReady");
1015
1030
  }
@@ -1021,16 +1036,16 @@ class We {
1021
1036
  );
1022
1037
  if (this.getBlock(e).renderingMode === "Light")
1023
1038
  throw new Error("Can't render production for light block.");
1024
- const o = t.getTemplate(this.tx), n = qt(this.tx, o, {
1039
+ const o = t.getTemplate(this.tx), n = zt(this.tx, o, {
1025
1040
  args: t.fields.currentArgs.ref,
1026
- blockId: this.tx.createValue(T.JsonString, JSON.stringify(e)),
1027
- isProduction: this.tx.createValue(T.JsonBool, JSON.stringify(!0)),
1041
+ blockId: this.tx.createValue(L.JsonString, JSON.stringify(e)),
1042
+ isProduction: this.tx.createValue(L.JsonBool, JSON.stringify(!0)),
1028
1043
  context: r
1029
1044
  });
1030
1045
  this.setBlockField(
1031
1046
  e,
1032
1047
  "prodCtx",
1033
- T.wrapInEphHolder(this.tx, n.context),
1048
+ L.wrapInEphHolder(this.tx, n.context),
1034
1049
  "NotReady"
1035
1050
  ), this.setBlockField(e, "prodUiCtx", this.exportCtx(n.context), "NotReady"), this.setBlockField(e, "prodOutput", n.result, "NotReady"), this.setBlockFieldObj(e, "prodArgs", t.fields.currentArgs), this.blocksInLimbo.delete(e) && (this.renderingStateChanged = !0);
1036
1051
  }
@@ -1038,25 +1053,27 @@ class We {
1038
1053
  // Structure changes
1039
1054
  //
1040
1055
  /** Very generic method, better check for more specialized case-specific methods first. */
1041
- updateStructure(e, t = rn) {
1042
- const r = this.getStagingGraph(), o = this.getActualProductionGraph(), n = bt(e), i = Me(
1056
+ updateStructure(e, t = sn) {
1057
+ const r = this.getStagingGraph(), o = this.getActualProductionGraph(), n = Ct(e), i = _e(
1043
1058
  e,
1044
1059
  (l) => {
1045
1060
  var u;
1046
1061
  return (u = this.blockInfos.get(l)) == null ? void 0 : u.actualProductionInputs;
1047
1062
  }
1048
- ), c = Zt(r, n), a = Zt(o, i);
1063
+ ), c = er(r, n), a = er(o, i);
1049
1064
  for (const l of c.onlyInA) {
1050
1065
  const { fields: u } = this.getBlockInfo(l);
1051
1066
  this.deleteBlockFields(l, ...Object.keys(u)), this.blockInfos.delete(l), this.blocksInLimbo.delete(l) && (this.renderingStateChanged = !0), this.blockFrontendStates.delete(l) && this.changedBlockFrontendStates.add(l);
1052
1067
  }
1053
1068
  for (const l of c.onlyInB) {
1054
- const u = new er(l, {});
1069
+ const u = new tr(l, {});
1055
1070
  this.blockInfos.set(l, u);
1056
- const d = t(l), m = Qt(this.tx, d.blockPack);
1057
- this.setBlockField(l, "blockPack", T.wrapInHolder(this.tx, m), "NotReady");
1058
- const h = Buffer.from(d.args), f = this.tx.createValue(T.JsonObject, h);
1059
- this.setBlockField(l, "currentArgs", f, "Ready", h), d.uiState && (this.blockFrontendStates.set(l, d.uiState), this.changedBlockFrontendStates.add(l)), u.check();
1071
+ const d = t(l), f = Zt(this.tx, d.blockPack);
1072
+ this.setBlockField(l, "blockPack", L.wrapInHolder(this.tx, f), "NotReady"), this.setBlockFieldObj(
1073
+ l,
1074
+ "blockSettings",
1075
+ this.createJsonFieldValue(Gt)
1076
+ ), this.setBlockFieldObj(l, "currentArgs", this.createJsonFieldValueByContent(d.args)), d.uiState && (this.blockFrontendStates.set(l, d.uiState), this.changedBlockFrontendStates.add(l)), u.check();
1060
1077
  }
1061
1078
  for (const l of c.different) this.resetStaging(l);
1062
1079
  o.traverse("downstream", [...a.different], (l) => {
@@ -1107,7 +1124,7 @@ class We {
1107
1124
  this.setBlockField(
1108
1125
  e,
1109
1126
  "blockPack",
1110
- T.wrapInHolder(this.tx, Qt(this.tx, t)),
1127
+ L.wrapInHolder(this.tx, Zt(this.tx, t)),
1111
1128
  "NotReady"
1112
1129
  ), r !== void 0 ? (this.setArgs([{ blockId: e, args: r }]), this.setUiState(e, void 0)) : this.getStagingGraph().traverse("downstream", [e], ({ id: n }) => this.resetStaging(n)), o.productionRendered && this.getActualProductionGraph().traverse(
1113
1130
  "downstream",
@@ -1153,7 +1170,7 @@ class We {
1153
1170
  * accordingly */
1154
1171
  stopProduction(...e) {
1155
1172
  var i, c;
1156
- const t = this.getActualProductionGraph(), r = new jr(e), o = new Set(e), n = [];
1173
+ const t = this.getActualProductionGraph(), r = new xr(e), o = new Set(e), n = [];
1157
1174
  for (; !r.isEmpty(); ) {
1158
1175
  const a = r.shift(), l = this.getBlockInfo(a).fields;
1159
1176
  if (!(((i = l.prodOutput) == null ? void 0 : i.status) === "Ready" && ((c = l.prodCtx) == null ? void 0 : c.status) === "Ready") && this.deleteBlockFields(a, "prodOutput", "prodCtx", "prodUiCtx", "prodArgs")) {
@@ -1213,14 +1230,14 @@ class We {
1213
1230
  assignAuthorMarkers() {
1214
1231
  const e = this.author ? JSON.stringify(this.author) : void 0;
1215
1232
  for (const t of this.blocksWithChangedInputs)
1216
- e === void 0 ? this.tx.deleteKValue(this.rid, vt(t)) : this.tx.setKValue(this.rid, vt(t), e);
1217
- (this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid, yt) : this.tx.setKValue(this.rid, yt, e));
1233
+ e === void 0 ? this.tx.deleteKValue(this.rid, yt(t)) : this.tx.setKValue(this.rid, yt(t), e);
1234
+ (this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid, wt) : this.tx.setKValue(this.rid, wt, e));
1218
1235
  }
1219
1236
  save() {
1220
1237
  if (this.wasModified) {
1221
1238
  this.lastModifiedChanged && this.tx.setKValue(this.rid, Te, JSON.stringify(this.lastModified)), this.structureChanged && this.tx.setKValue(this.rid, de, JSON.stringify(this.struct)), this.renderingStateChanged && this.tx.setKValue(
1222
1239
  this.rid,
1223
- Ke,
1240
+ He,
1224
1241
  JSON.stringify({
1225
1242
  ...this.renderingState,
1226
1243
  blocksInLimbo: [...this.blocksInLimbo]
@@ -1228,19 +1245,19 @@ class We {
1228
1245
  ), this.metaChanged && this.tx.setKValue(this.rid, Ae, JSON.stringify(this.meta));
1229
1246
  for (const e of this.changedBlockFrontendStates) {
1230
1247
  const t = this.blockFrontendStates.get(e);
1231
- t === void 0 ? this.tx.deleteKValue(this.rid, mt(e)) : this.tx.setKValue(this.rid, mt(e), t);
1248
+ t === void 0 ? this.tx.deleteKValue(this.rid, vt(e)) : this.tx.setKValue(this.rid, vt(e), t);
1232
1249
  }
1233
1250
  this.assignAuthorMarkers();
1234
1251
  }
1235
1252
  }
1236
1253
  static async load(e, t, r) {
1237
- const o = e.getResourceData(t, !0), n = e.getKValueJson(t, Jr), i = e.getKValueJson(t, Te), c = e.getKValueJson(t, Ae), a = e.getKValueJson(t, de), l = e.getKValueJson(t, Ke), u = e.listKeyValuesString(t), [
1254
+ const o = e.getResourceData(t, !0), n = e.getKValueJson(t, Gr), i = e.getKValueJson(t, Te), c = e.getKValueJson(t, Ae), a = e.getKValueJson(t, de), l = e.getKValueJson(t, He), u = e.listKeyValuesString(t), [
1238
1255
  d,
1239
- m,
1240
- h,
1241
1256
  f,
1242
- I,
1243
- { stagingRefreshTimestamp: F, blocksInLimbo: D },
1257
+ h,
1258
+ g,
1259
+ E,
1260
+ { stagingRefreshTimestamp: F, blocksInLimbo: N },
1244
1261
  _
1245
1262
  ] = await Promise.all([
1246
1263
  o,
@@ -1251,51 +1268,51 @@ class We {
1251
1268
  l,
1252
1269
  u
1253
1270
  ]);
1254
- if (m !== Gr)
1271
+ if (f !== Mr)
1255
1272
  throw new Error(
1256
- `Can't act on this project resource because it has a wrong schema version: ${m}`
1273
+ `Can't act on this project resource because it has a wrong schema version: ${f}`
1257
1274
  );
1258
- const k = /* @__PURE__ */ new Map();
1275
+ const P = /* @__PURE__ */ new Map();
1259
1276
  for (const p of d.fields) {
1260
- const y = Po(p.name);
1277
+ const y = Oo(p.name);
1261
1278
  if (y === void 0) continue;
1262
- let g = k.get(y.blockId);
1263
- g === void 0 && (g = {
1279
+ let m = P.get(y.blockId);
1280
+ m === void 0 && (m = {
1264
1281
  id: y.blockId,
1265
1282
  fields: {}
1266
- }, k.set(y.blockId, g)), g.fields[y.fieldName] = _e(p.value) ? { modCount: 0 } : { modCount: 0, ref: p.value };
1283
+ }, P.set(y.blockId, m)), m.fields[y.fieldName] = Ke(p.value) ? { modCount: 0 } : { modCount: 0, ref: p.value };
1267
1284
  }
1268
- const se = await Qr(), pe = wt(se.hash), A = d.fields.find(
1285
+ const se = await Qr(), pe = St(se.hash), A = d.fields.find(
1269
1286
  (p) => p.name === pe
1270
1287
  );
1271
- let z;
1272
- A !== void 0 ? z = ft(A.value) : (z = T.wrapInHolder(e, It(e, se.spec)), e.createField(
1273
- j(t, wt(se.hash)),
1288
+ let q;
1289
+ A !== void 0 ? q = gt(A.value) : (q = L.wrapInHolder(e, Ft(e, se.spec)), e.createField(
1290
+ j(t, St(se.hash)),
1274
1291
  "Dynamic",
1275
- z
1292
+ q
1276
1293
  ));
1277
- const oe = { stagingRefreshTimestamp: F }, K = new Set(D), G = /* @__PURE__ */ new Map();
1294
+ const oe = { stagingRefreshTimestamp: F }, K = new Set(N), J = /* @__PURE__ */ new Map();
1278
1295
  for (const p of _) {
1279
1296
  const y = Eo(p.key);
1280
- y !== void 0 && G.set(y, p.value);
1297
+ y !== void 0 && J.set(y, p.value);
1281
1298
  }
1282
1299
  const x = [];
1283
- k.forEach(({ id: p, fields: y }) => {
1284
- for (const [, g] of Object.entries(y))
1285
- if (g.ref !== void 0) {
1286
- if (!Ls(g.ref) || Ns(g.ref))
1300
+ P.forEach(({ id: p, fields: y }) => {
1301
+ for (const [, m] of Object.entries(y))
1302
+ if (m.ref !== void 0) {
1303
+ if (!Ns(m.ref) || Ds(m.ref))
1287
1304
  throw new Error("unexpected behaviour");
1288
- x.push([g, e.getResourceData(g.ref, !1)]);
1305
+ x.push([m, e.getResourceData(m.ref, !1)]);
1289
1306
  }
1290
1307
  });
1291
1308
  for (const [p, y] of x) {
1292
- const g = await y;
1293
- p.value = g.data, _t(g.error) ? p.status = "Error" : g.resourceReady || _t(g.originalResourceId) ? p.status = "Ready" : p.status = "NotReady";
1309
+ const m = await y;
1310
+ p.value = m.data, _t(m.error) ? p.status = "Error" : m.resourceReady || _t(m.originalResourceId) ? p.status = "Ready" : p.status = "NotReady";
1294
1311
  }
1295
1312
  const X = /* @__PURE__ */ new Map();
1296
- k.forEach(({ id: p, fields: y }) => X.set(p, new er(p, y)));
1313
+ P.forEach(({ id: p, fields: y }) => X.set(p, new tr(p, y)));
1297
1314
  const he = /* @__PURE__ */ new Set();
1298
- for (const p of te(I)) {
1315
+ for (const p of te(E)) {
1299
1316
  if (!X.has(p.id))
1300
1317
  throw new Error(`Inconsistent project structure: no inputs for ${p.id}`);
1301
1318
  he.add(p.id);
@@ -1309,36 +1326,36 @@ class We {
1309
1326
  t,
1310
1327
  e,
1311
1328
  r,
1312
- m,
1313
- h,
1314
1329
  f,
1315
- I,
1330
+ h,
1331
+ g,
1332
+ E,
1316
1333
  oe,
1317
1334
  K,
1318
1335
  X,
1319
- G,
1320
- z
1336
+ J,
1337
+ q
1321
1338
  );
1322
- return v.fixProblems(), v;
1339
+ return v.fixProblemsAndMigrate(), v;
1323
1340
  }
1324
1341
  }
1325
- async function sn(s, e = yo) {
1326
- const t = s.createEphemeral(wo);
1342
+ async function on(s, e = wo) {
1343
+ const t = s.createEphemeral(So);
1327
1344
  s.lock(t);
1328
1345
  const r = String(Date.now());
1329
- s.setKValue(t, Jr, JSON.stringify(Gr)), s.setKValue(t, $t, r), s.setKValue(t, Te, r), s.setKValue(t, Ae, JSON.stringify(e)), s.setKValue(t, de, JSON.stringify(mo)), s.setKValue(t, Ke, JSON.stringify(vo));
1346
+ s.setKValue(t, Gr, JSON.stringify(Mr)), s.setKValue(t, It, r), s.setKValue(t, Te, r), s.setKValue(t, Ae, JSON.stringify(e)), s.setKValue(t, de, JSON.stringify(vo)), s.setKValue(t, He, JSON.stringify(yo));
1330
1347
  const o = await Qr();
1331
1348
  return s.createField(
1332
- j(t, wt(o.hash)),
1349
+ j(t, St(o.hash)),
1333
1350
  "Dynamic",
1334
- T.wrapInHolder(s, It(s, o.spec))
1351
+ L.wrapInHolder(s, Ft(s, o.spec))
1335
1352
  ), t;
1336
1353
  }
1337
- async function nt(s, e, t) {
1338
- return ee(s, e, void 0, t);
1354
+ async function it(s, e, t) {
1355
+ return Y(s, e, void 0, t);
1339
1356
  }
1340
- async function ee(s, e, t, r) {
1341
- if (s instanceof As)
1357
+ async function Y(s, e, t, r) {
1358
+ if (s instanceof Ls)
1342
1359
  return await s.withWriteTx("ProjectAction", async (o) => {
1343
1360
  const n = await We.load(o, e, t), i = await r(n);
1344
1361
  return n.wasModified && (n.save(), await o.commit()), i;
@@ -1348,7 +1365,7 @@ async function ee(s, e, t, r) {
1348
1365
  return o.save(), n;
1349
1366
  }
1350
1367
  }
1351
- function* on(s) {
1368
+ function* nn(s) {
1352
1369
  switch (s.type) {
1353
1370
  case "Json":
1354
1371
  return;
@@ -1360,52 +1377,52 @@ function* on(s) {
1360
1377
  yield e, yield t;
1361
1378
  return;
1362
1379
  default:
1363
- J(s);
1380
+ G(s);
1364
1381
  }
1365
1382
  }
1366
- function tr(s, e) {
1383
+ function rr(s, e) {
1367
1384
  return Object.fromEntries(
1368
1385
  Object.entries(s).map(([t, r]) => [t, e(r, t)])
1369
1386
  );
1370
1387
  }
1371
- function nn(s, e) {
1388
+ function an(s, e) {
1372
1389
  switch (s.type) {
1373
1390
  case "Json":
1374
1391
  return { ...s };
1375
1392
  case "JsonPartitioned":
1376
- return { ...s, parts: tr(s.parts, e) };
1393
+ return { ...s, parts: rr(s.parts, e) };
1377
1394
  case "BinaryPartitioned":
1378
1395
  return {
1379
1396
  ...s,
1380
- parts: tr(s.parts, (t) => ({
1397
+ parts: rr(s.parts, (t) => ({
1381
1398
  index: e(t.index),
1382
1399
  values: e(t.values)
1383
1400
  }))
1384
1401
  };
1385
1402
  default:
1386
- J(s);
1403
+ G(s);
1387
1404
  }
1388
1405
  }
1389
- const an = Le("PColumnData/JsonPartitioned", "1"), cn = Le(
1406
+ const cn = Le("PColumnData/JsonPartitioned", "1"), ln = Le(
1390
1407
  "PColumnData/Partitioned/JsonPartitioned",
1391
1408
  "1"
1392
- ), ln = Le("PColumnData/BinaryPartitioned", "1"), un = Le(
1409
+ ), un = Le("PColumnData/BinaryPartitioned", "1"), dn = Le(
1393
1410
  "PColumnData/Partitioned/BinaryPartitioned",
1394
1411
  "1"
1395
- ), dn = Le("PColumnData/Json", "1");
1396
- function pn(s) {
1412
+ ), pn = Le("PColumnData/Json", "1");
1413
+ function hn(s) {
1397
1414
  if (!s.getIsReadyOrError()) throw new Error("Data not ready.");
1398
1415
  const e = s.getDataAsJson();
1399
1416
  if (e === void 0)
1400
1417
  throw new Error("unexpected data info structure, no resource data");
1401
- if (ae(s.resourceType, dn)) {
1418
+ if (ce(s.resourceType, pn)) {
1402
1419
  const t = e;
1403
1420
  return {
1404
1421
  type: "Json",
1405
1422
  keyLength: t.keyLength,
1406
1423
  data: t.data
1407
1424
  };
1408
- } else if (ae(s.resourceType, an)) {
1425
+ } else if (ce(s.resourceType, cn)) {
1409
1426
  const t = e, r = Object.fromEntries(
1410
1427
  s.listInputFields().map((o) => [o, s.traverse({ field: o, errorIfFieldNotSet: !0 }).resourceInfo])
1411
1428
  );
@@ -1414,7 +1431,7 @@ function pn(s) {
1414
1431
  partitionKeyLength: t.partitionKeyLength,
1415
1432
  parts: r
1416
1433
  };
1417
- } else if (ae(s.resourceType, cn)) {
1434
+ } else if (ce(s.resourceType, ln)) {
1418
1435
  const t = e, r = {};
1419
1436
  for (const o of s.listInputFields()) {
1420
1437
  const n = s.traverse({ field: o, errorIfFieldNotSet: !0 }), i = n.listInputFields();
@@ -1429,7 +1446,7 @@ function pn(s) {
1429
1446
  partitionKeyLength: t.superPartitionKeyLength + t.partitionKeyLength,
1430
1447
  parts: r
1431
1448
  };
1432
- } else if (ae(s.resourceType, ln)) {
1449
+ } else if (ce(s.resourceType, un)) {
1433
1450
  const t = e, r = {};
1434
1451
  for (const o of s.listInputFields())
1435
1452
  if (o.endsWith(".index")) {
@@ -1450,7 +1467,7 @@ function pn(s) {
1450
1467
  partitionKeyLength: t.partitionKeyLength,
1451
1468
  parts: r
1452
1469
  };
1453
- } else if (ae(s.resourceType, un)) {
1470
+ } else if (ce(s.resourceType, dn)) {
1454
1471
  const t = e, r = {};
1455
1472
  for (const o of s.listInputFields()) {
1456
1473
  const n = s.traverse({ field: o, errorIfFieldNotSet: !0 }), i = n.listInputFields();
@@ -1478,9 +1495,9 @@ function pn(s) {
1478
1495
  parts: r
1479
1496
  };
1480
1497
  }
1481
- throw new Error(`unsupported resource type: ${Ds(s.resourceType)}`);
1498
+ throw new Error(`unsupported resource type: ${Bs(s.resourceType)}`);
1482
1499
  }
1483
- function hn(s, e) {
1500
+ function fn(s, e) {
1484
1501
  const t = s.axesSpec.length, r = {};
1485
1502
  for (const { key: o, val: n } of e) {
1486
1503
  if (o.length !== t)
@@ -1493,15 +1510,15 @@ function hn(s, e) {
1493
1510
  data: r
1494
1511
  };
1495
1512
  }
1496
- function fn(s, e) {
1513
+ function gn(s, e) {
1497
1514
  const t = Ne("sha256");
1498
- return t.update(ye(s)), t.update(String(_e(e.originalId) ? e.id : e.originalId)), t.digest().toString("hex");
1515
+ return t.update(re(s)), t.update(String(Ke(e.originalId) ? e.id : e.originalId)), t.digest().toString("hex");
1499
1516
  }
1500
- function rr(s, e) {
1501
- return ye({ __isRef: !0, blockId: s, name: e });
1517
+ function sr(s, e) {
1518
+ return re({ __isRef: !0, blockId: s, name: e });
1502
1519
  }
1503
- function gn(s, e) {
1504
- return ye({ resolvePath: s, name: e });
1520
+ function mn(s, e) {
1521
+ return re({ resolvePath: s, name: e });
1505
1522
  }
1506
1523
  function Zr(s, e = !0, t = !1, r = "") {
1507
1524
  var c, a, l;
@@ -1512,24 +1529,24 @@ function Zr(s, e = !0, t = !1, r = "") {
1512
1529
  if (e) throw new Error(`unexpected field name ${u}`);
1513
1530
  continue;
1514
1531
  }
1515
- let m = B((c = d.groups) == null ? void 0 : c.name);
1516
- if (!m.startsWith(r)) {
1532
+ let f = B((c = d.groups) == null ? void 0 : c.name);
1533
+ if (!f.startsWith(r)) {
1517
1534
  if (e) throw new Error(`unexpected field name ${u}`);
1518
1535
  continue;
1519
1536
  }
1520
- m = m.slice(r.length);
1537
+ f = f.slice(r.length);
1521
1538
  const h = B((a = d.groups) == null ? void 0 : a.type);
1522
- let f = n.get(m);
1523
- switch (f === void 0 && (f = {}, n.set(m, f)), h) {
1539
+ let g = n.get(f);
1540
+ switch (g === void 0 && (g = {}, n.set(f, g)), h) {
1524
1541
  case "spec":
1525
- f.spec = (l = s.traverse({
1542
+ g.spec = (l = s.traverse({
1526
1543
  field: u,
1527
1544
  ignoreError: t,
1528
1545
  pureFieldErrorToUndefined: t
1529
1546
  })) == null ? void 0 : l.getDataAsJson();
1530
1547
  break;
1531
1548
  case "data":
1532
- f.hasData = !0, f.data = () => s.traverseOrError({
1549
+ g.hasData = !0, g.data = () => s.traverseOrError({
1533
1550
  field: u,
1534
1551
  ignoreError: t
1535
1552
  });
@@ -1542,10 +1559,10 @@ function Zr(s, e = !0, t = !1, r = "") {
1542
1559
  for (const [, u] of n) u.data === void 0 && (u.hasData = !1);
1543
1560
  return { locked: i, results: n };
1544
1561
  }
1545
- function mn(s, e = !0, t = "", r) {
1562
+ function vn(s, e = !0, t = "", r) {
1546
1563
  if (!s.getIsReadyOrError()) throw new Error("resource is not ready");
1547
1564
  const o = Zr(s, e, !1, t);
1548
- Hs(o.locked);
1565
+ Ws(o.locked);
1549
1566
  const n = {};
1550
1567
  for (const [i, c] of o.results) {
1551
1568
  if (c.spec === void 0) throw new Error(`no spec for key ${i}`);
@@ -1553,16 +1570,16 @@ function mn(s, e = !0, t = "", r) {
1553
1570
  throw new Error(`no data for key ${i}`);
1554
1571
  const a = c.data();
1555
1572
  if (a === void 0) throw new Error(`no data for key ${i}`);
1556
- if (!a.ok) throw new Us(a.error);
1573
+ if (!a.ok) throw new Js(a.error);
1557
1574
  n[i] = {
1558
- id: r.length === 0 ? fn(c.spec, a.value) : gn(r, i),
1575
+ id: r.length === 0 ? gn(c.spec, a.value) : mn(r, i),
1559
1576
  spec: c.spec,
1560
1577
  data: a.value
1561
1578
  };
1562
1579
  }
1563
1580
  return n;
1564
1581
  }
1565
- class Ft {
1582
+ class Tt {
1566
1583
  constructor(e, t) {
1567
1584
  S(this, "allSpecsAvailable");
1568
1585
  this.ctx = e, this.blocks = t;
@@ -1596,8 +1613,8 @@ class Ft {
1596
1613
  if (r === void 0) return;
1597
1614
  let o = (c = (i = r.prod) == null ? void 0 : i.results) == null ? void 0 : c.get(t), n = (a = o == null ? void 0 : o.data) == null ? void 0 : a.call(o);
1598
1615
  if (o !== void 0 && o.spec !== void 0 && n !== void 0)
1599
- return Fr(n, (l) => ({
1600
- id: rr(e, t),
1616
+ return Tr(n, (l) => ({
1617
+ id: sr(e, t),
1601
1618
  spec: o.spec,
1602
1619
  data: l
1603
1620
  }));
@@ -1634,9 +1651,9 @@ class Ft {
1634
1651
  if (a.spec !== void 0 && a.hasData === !0 && a.data !== void 0) {
1635
1652
  const l = a.data();
1636
1653
  l !== void 0 ? e.push({
1637
- ref: je(i, c),
1654
+ ref: xe(i, c),
1638
1655
  obj: {
1639
- id: l.ok ? rr(i, c) : void 0,
1656
+ id: l.ok ? sr(i, c) : void 0,
1640
1657
  spec: a.spec,
1641
1658
  data: l
1642
1659
  }
@@ -1670,7 +1687,7 @@ class Ft {
1670
1687
  i.staging.locked || o(`staging_not_locked:${n}`);
1671
1688
  for (const [a, l] of i.staging.results)
1672
1689
  l.spec !== void 0 && (e.push({
1673
- ref: je(n, a),
1690
+ ref: xe(n, a),
1674
1691
  obj: l.spec
1675
1692
  }), c.add(a));
1676
1693
  } else o(`staging_not_rendered:${n}`);
@@ -1678,7 +1695,7 @@ class Ft {
1678
1695
  i.prod.locked || o(`prod_not_locked:${n}`);
1679
1696
  for (const [a, l] of i.prod.results)
1680
1697
  c.has(a) || l.spec !== void 0 && e.push({
1681
- ref: je(n, a),
1698
+ ref: xe(n, a),
1682
1699
  obj: l.spec
1683
1700
  });
1684
1701
  }
@@ -1692,7 +1709,7 @@ class Ft {
1692
1709
  for (const [c, a] of i.results)
1693
1710
  o.has(c) || a.spec === void 0 || (o.add(c), Ss(e, a.spec) && t.push({
1694
1711
  label: r.info.label + " / " + c,
1695
- ref: je(r.info.id, c),
1712
+ ref: xe(r.info.id, c),
1696
1713
  spec: a.spec
1697
1714
  }));
1698
1715
  };
@@ -1701,10 +1718,10 @@ class Ft {
1701
1718
  return t;
1702
1719
  }
1703
1720
  static create(e, t, r) {
1704
- const o = e.accessor(t).node(), n = B(o.getKeyValueAsJson(de)), c = bt(n).traverseIds("upstream", r), a = /* @__PURE__ */ new Map();
1721
+ const o = e.accessor(t).node(), n = B(o.getKeyValueAsJson(de)), c = Ct(n).traverseIds("upstream", r), a = /* @__PURE__ */ new Map();
1705
1722
  for (const l of te(n)) {
1706
1723
  if (!c.has(l.id)) continue;
1707
- const u = sr(
1724
+ const u = or(
1708
1725
  o.traverse({
1709
1726
  field: U(l.id, "prodCtx"),
1710
1727
  ignoreError: !0,
@@ -1715,7 +1732,7 @@ class Ft {
1715
1732
  field: U(l.id, "prodUiCtx"),
1716
1733
  stableIfNotFound: !0
1717
1734
  })
1718
- ), d = sr(
1735
+ ), d = or(
1719
1736
  o.traverse({
1720
1737
  field: U(l.id, "stagingCtx"),
1721
1738
  ignoreError: !0,
@@ -1727,15 +1744,15 @@ class Ft {
1727
1744
  );
1728
1745
  a.set(l.id, { info: l, prod: u, staging: d });
1729
1746
  }
1730
- return new Ft(e, a);
1747
+ return new Tt(e, a);
1731
1748
  }
1732
1749
  }
1733
- function sr(s, e) {
1750
+ function or(s, e) {
1734
1751
  if (e === void 0)
1735
1752
  return s ? { locked: !1, results: /* @__PURE__ */ new Map() } : void 0;
1736
1753
  if (e.ok) return Zr(e.value, !1, !0);
1737
1754
  }
1738
- function Tt(s, e) {
1755
+ function At(s, e) {
1739
1756
  return {
1740
1757
  blockId: e,
1741
1758
  args: (o) => B(
@@ -1744,7 +1761,7 @@ function Tt(s, e) {
1744
1761
  errorIfFieldNotSet: !0
1745
1762
  }).getDataAsString()
1746
1763
  ),
1747
- uiState: (o) => o.accessor(s).node().getKeyValueAsString(mt(e)),
1764
+ uiState: (o) => o.accessor(s).node().getKeyValueAsString(vt(e)),
1748
1765
  blockMeta: (o) => {
1749
1766
  const n = o.accessor(s).node(), i = B(n.getKeyValueAsJson(de)), c = /* @__PURE__ */ new Map();
1750
1767
  for (const a of te(i)) c.set(a.id, a);
@@ -1754,7 +1771,7 @@ function Tt(s, e) {
1754
1771
  }
1755
1772
  function es(s, e) {
1756
1773
  return {
1757
- ...Tt(s, e),
1774
+ ...At(s, e),
1758
1775
  prod: (t) => {
1759
1776
  var r;
1760
1777
  return (r = t.accessor(s).node({ ignoreError: !0 }).traverse({
@@ -1771,7 +1788,7 @@ function es(s, e) {
1771
1788
  })) == null ? void 0 : o.persist();
1772
1789
  return r === void 0 && t.markUnstable("staging_not_rendered"), r;
1773
1790
  },
1774
- getResultsPool: (t) => Ft.create(t, s, e)
1791
+ getResultsPool: (t) => Tt.create(t, s, e)
1775
1792
  };
1776
1793
  }
1777
1794
  function* W(s, e) {
@@ -1821,10 +1838,10 @@ function* W(s, e) {
1821
1838
  yield* W(s.operand1), yield* W(s.operand2);
1822
1839
  return;
1823
1840
  default:
1824
- J(s);
1841
+ G(s);
1825
1842
  }
1826
1843
  }
1827
- function vn(s, e) {
1844
+ function yn(s, e) {
1828
1845
  const t = {};
1829
1846
  for (const [r, o] of Object.entries(s)) t[r] = e(o);
1830
1847
  return t;
@@ -1832,7 +1849,7 @@ function vn(s, e) {
1832
1849
  function Oe(s, e) {
1833
1850
  return s === void 0 ? void 0 : e(s);
1834
1851
  }
1835
- function yn(s) {
1852
+ function wn(s) {
1836
1853
  switch (s.type) {
1837
1854
  case "GetImportProgress":
1838
1855
  return !0;
@@ -1840,8 +1857,8 @@ function yn(s) {
1840
1857
  return !1;
1841
1858
  }
1842
1859
  }
1843
- function wn(s) {
1844
- for (const e of W(s)) if (yn(e)) return !0;
1860
+ function Sn(s) {
1861
+ for (const e of W(s)) if (wn(e)) return !0;
1845
1862
  return !1;
1846
1863
  }
1847
1864
  function Xe(s) {
@@ -1850,23 +1867,23 @@ function Xe(s) {
1850
1867
  result: s
1851
1868
  };
1852
1869
  }
1853
- function C(s) {
1870
+ function k(s) {
1854
1871
  return () => Xe(s);
1855
1872
  }
1856
- const Sn = (s) => {
1873
+ const bn = (s) => {
1857
1874
  const e = {};
1858
1875
  for (const [t, r] of Object.entries(s)) e[t] = r;
1859
- return C(e);
1860
- }, bn = (s) => {
1876
+ return k(e);
1877
+ }, Cn = (s) => {
1861
1878
  const e = s.source;
1862
- if (e === void 0) return C(void 0);
1879
+ if (e === void 0) return k(void 0);
1863
1880
  const t = [];
1864
1881
  for (const r of e)
1865
1882
  r instanceof Array ? t.push(...r) : t.push(r);
1866
- return C(t);
1883
+ return k(t);
1867
1884
  }, Rn = (s) => {
1868
1885
  const e = s.source, t = s.field;
1869
- return e === void 0 || t === void 0 ? C(void 0) : ({ cCtx: r }) => {
1886
+ return e === void 0 || t === void 0 ? k(void 0) : ({ cCtx: r }) => {
1870
1887
  var o;
1871
1888
  return Xe((o = r.accessor(e).node().traverse(t)) == null ? void 0 : o.persist());
1872
1889
  };
@@ -1879,10 +1896,10 @@ function ts(s, e) {
1879
1896
  function En(s, e) {
1880
1897
  return (t) => {
1881
1898
  const r = t.source;
1882
- return r === void 0 ? C(void 0) : () => ({
1899
+ return r === void 0 ? k(void 0) : () => ({
1883
1900
  type: "ScheduleSubroutine",
1884
1901
  subroutine: rs(r.length),
1885
- args: ts(r, (o) => O({ ...s, [e.itVar]: o }, e.mapping))
1902
+ args: ts(r, (o) => $({ ...s, [e.itVar]: o }, e.mapping))
1886
1903
  });
1887
1904
  };
1888
1905
  }
@@ -1890,71 +1907,71 @@ function rs(s) {
1890
1907
  return (e) => {
1891
1908
  const t = [];
1892
1909
  for (let r = 0; r < s; r++) t.push(e[String(r)]);
1893
- return C(t);
1910
+ return k(t);
1894
1911
  };
1895
1912
  }
1896
- function Cn(s, e) {
1913
+ function kn(s, e) {
1897
1914
  return (t) => {
1898
1915
  const r = t.source;
1899
- if (r === void 0) return C(void 0);
1916
+ if (r === void 0) return k(void 0);
1900
1917
  const o = {};
1901
1918
  for (const [n, i] of Object.entries(r)) {
1902
1919
  const c = { ...s, [e.itVar]: i };
1903
- o[n] = O(c, e.mapping);
1920
+ o[n] = $(c, e.mapping);
1904
1921
  }
1905
1922
  return () => ({
1906
1923
  type: "ScheduleSubroutine",
1907
- subroutine: kn,
1924
+ subroutine: Pn,
1908
1925
  args: o
1909
1926
  });
1910
1927
  };
1911
1928
  }
1912
- const kn = (s) => C(s), Pn = (s) => {
1929
+ const Pn = (s) => k(s), On = (s) => {
1913
1930
  const e = s.arg;
1914
- return C(e === void 0 ? void 0 : e.length === 0);
1915
- }, On = (s) => {
1916
- const e = s.operand;
1917
- return C(e === void 0 ? void 0 : !e);
1931
+ return k(e === void 0 ? void 0 : e.length === 0);
1918
1932
  }, $n = (s) => {
1919
- const e = s.operand1, t = s.operand2;
1920
- return C(e === void 0 || t === void 0 ? void 0 : e && t);
1933
+ const e = s.operand;
1934
+ return k(e === void 0 ? void 0 : !e);
1921
1935
  }, In = (s) => {
1922
1936
  const e = s.operand1, t = s.operand2;
1923
- return C(e === void 0 || t === void 0 ? void 0 : e || t);
1937
+ return k(e === void 0 || t === void 0 ? void 0 : e && t);
1924
1938
  }, Fn = (s) => {
1939
+ const e = s.operand1, t = s.operand2;
1940
+ return k(e === void 0 || t === void 0 ? void 0 : e || t);
1941
+ }, Tn = (s) => {
1925
1942
  const e = s.source;
1926
- return e === void 0 ? C(void 0) : ({ cCtx: t }) => {
1943
+ return e === void 0 ? k(void 0) : ({ cCtx: t }) => {
1927
1944
  var r;
1928
1945
  return Xe((r = t.accessor(e).node()) == null ? void 0 : r.getDataAsJson());
1929
1946
  };
1930
- }, Tn = (s) => {
1947
+ }, An = (s) => {
1931
1948
  const e = s.source, t = s.field;
1932
- return C(e === void 0 || t === void 0 ? void 0 : e[t]);
1949
+ return k(e === void 0 || t === void 0 ? void 0 : e[t]);
1933
1950
  };
1934
- function An(s, e) {
1951
+ function Ln(s, e) {
1935
1952
  return (t) => {
1936
1953
  const r = t.source;
1937
- return r === void 0 ? C(void 0) : ({ cCtx: o }) => {
1954
+ return r === void 0 ? k(void 0) : ({ cCtx: o }) => {
1938
1955
  const n = o.accessor(r).node(), i = {};
1939
1956
  for (const c of n.listInputFields()) {
1940
1957
  const a = n.traverse(c);
1941
- if (a === void 0) i[c] = C(void 0);
1958
+ if (a === void 0) i[c] = k(void 0);
1942
1959
  else {
1943
1960
  const l = { ...s, [e.itVar]: a.persist() };
1944
- i[c] = O(l, e.mapping);
1961
+ i[c] = $(l, e.mapping);
1945
1962
  }
1946
1963
  }
1947
1964
  return {
1948
1965
  type: "ScheduleSubroutine",
1949
- subroutine: Ln,
1966
+ subroutine: Nn,
1950
1967
  args: i
1951
1968
  };
1952
1969
  };
1953
1970
  };
1954
1971
  }
1955
- const Ln = (s) => C(s), Nn = (s) => {
1972
+ const Nn = (s) => k(s), Dn = (s) => {
1956
1973
  const e = s.source;
1957
- return e === void 0 ? C(void 0) : ({ drivers: t }) => ({
1974
+ return e === void 0 ? k(void 0) : ({ drivers: t }) => ({
1958
1975
  type: "ScheduleComputable",
1959
1976
  computable: V.make(
1960
1977
  (r) => t.blobDriver.getDownloadedBlob(r.accessor(e).node().resourceInfo),
@@ -1966,9 +1983,9 @@ const Ln = (s) => C(s), Nn = (s) => {
1966
1983
  }
1967
1984
  )
1968
1985
  });
1969
- }, Dn = (s) => {
1986
+ }, Bn = (s) => {
1970
1987
  const e = s.source;
1971
- return e === void 0 ? C(void 0) : ({ cCtx: t, drivers: r }) => {
1988
+ return e === void 0 ? k(void 0) : ({ cCtx: t, drivers: r }) => {
1972
1989
  const o = t.accessor(e).node().resourceInfo;
1973
1990
  return {
1974
1991
  type: "ScheduleComputable",
@@ -1977,9 +1994,9 @@ const Ln = (s) => C(s), Nn = (s) => {
1977
1994
  })
1978
1995
  };
1979
1996
  };
1980
- }, Bn = (s) => {
1997
+ }, jn = (s) => {
1981
1998
  const e = s.source;
1982
- return e === void 0 ? C(void 0) : ({ drivers: t }) => ({
1999
+ return e === void 0 ? k(void 0) : ({ drivers: t }) => ({
1983
2000
  type: "ScheduleComputable",
1984
2001
  computable: V.make(
1985
2002
  (r) => t.blobDriver.getDownloadedBlob(r.accessor(e).node().resourceInfo),
@@ -1993,62 +2010,62 @@ const Ln = (s) => C(s), Nn = (s) => {
1993
2010
  }
1994
2011
  )
1995
2012
  });
1996
- }, jn = (s) => {
2013
+ }, xn = (s) => {
1997
2014
  const e = s.source;
1998
- return e === void 0 ? C(void 0) : ({ drivers: t }) => ({
2015
+ return e === void 0 ? k(void 0) : ({ drivers: t }) => ({
1999
2016
  type: "ScheduleComputable",
2000
2017
  computable: t.blobDriver.getDownloadedBlob(e)
2001
2018
  });
2002
- }, xn = (s) => {
2019
+ }, Vn = (s) => {
2003
2020
  const e = s.source;
2004
- return e === void 0 ? C(void 0) : ({ drivers: t }) => ({
2021
+ return e === void 0 ? k(void 0) : ({ drivers: t }) => ({
2005
2022
  type: "ScheduleComputable",
2006
2023
  computable: t.blobDriver.getOnDemandBlob(e)
2007
2024
  });
2008
- }, Vn = (s) => {
2025
+ }, Un = (s) => {
2009
2026
  const e = s.source;
2010
- return e === void 0 ? C(void 0) : ({ drivers: t }) => ({
2027
+ return e === void 0 ? k(void 0) : ({ drivers: t }) => ({
2011
2028
  type: "ScheduleComputable",
2012
2029
  computable: t.uploadDriver.getProgressId(e)
2013
2030
  });
2014
- }, Un = (s) => (e) => {
2031
+ }, Jn = (s) => (e) => {
2015
2032
  const t = e.source;
2016
- return t === void 0 ? C(void 0) : ({ drivers: r }) => ({
2033
+ return t === void 0 ? k(void 0) : ({ drivers: r }) => ({
2017
2034
  type: "ScheduleComputable",
2018
2035
  computable: r.logDriver.getLastLogs(t, s)
2019
2036
  });
2020
- }, Jn = (s) => (e) => {
2037
+ }, Gn = (s) => (e) => {
2021
2038
  const t = e.source;
2022
- return t === void 0 ? C(void 0) : ({ drivers: r }) => ({
2039
+ return t === void 0 ? k(void 0) : ({ drivers: r }) => ({
2023
2040
  type: "ScheduleComputable",
2024
2041
  computable: r.logDriver.getProgressLog(t, s)
2025
2042
  });
2026
- }, Gn = (s) => {
2043
+ }, Mn = (s) => {
2027
2044
  const e = s.source;
2028
- return e === void 0 ? C(void 0) : ({ drivers: t }) => ({
2045
+ return e === void 0 ? k(void 0) : ({ drivers: t }) => ({
2029
2046
  type: "ScheduleComputable",
2030
2047
  computable: t.logDriver.getLogHandle(e)
2031
2048
  });
2032
2049
  };
2033
- function O(s, e) {
2050
+ function $(s, e) {
2034
2051
  switch (e.type) {
2035
2052
  case "GetFromCtx":
2036
2053
  const t = s[e.variable];
2037
- return typeof t == "function" ? (r) => Xe(t(r.cCtx)) : C(t);
2054
+ return typeof t == "function" ? (r) => Xe(t(r.cCtx)) : k(t);
2038
2055
  case "Isolate":
2039
2056
  return ({ drivers: r }) => ({
2040
2057
  type: "ScheduleComputable",
2041
2058
  computable: ns(r, s, e.cfg)
2042
2059
  });
2043
2060
  case "Immediate":
2044
- return C(e.value);
2061
+ return k(e.value);
2045
2062
  case "GetJsonField":
2046
2063
  return () => ({
2047
2064
  type: "ScheduleSubroutine",
2048
- subroutine: Tn,
2065
+ subroutine: An,
2049
2066
  args: {
2050
- source: O(s, e.source),
2051
- field: O(s, e.field)
2067
+ source: $(s, e.source),
2068
+ field: $(s, e.field)
2052
2069
  }
2053
2070
  });
2054
2071
  case "MapArrayValues":
@@ -2056,77 +2073,77 @@ function O(s, e) {
2056
2073
  type: "ScheduleSubroutine",
2057
2074
  subroutine: En(s, e),
2058
2075
  args: {
2059
- source: O(s, e.source)
2076
+ source: $(s, e.source)
2060
2077
  }
2061
2078
  });
2062
2079
  case "MapRecordValues":
2063
2080
  return () => ({
2064
2081
  type: "ScheduleSubroutine",
2065
- subroutine: Cn(s, e),
2082
+ subroutine: kn(s, e),
2066
2083
  args: {
2067
- source: O(s, e.source)
2084
+ source: $(s, e.source)
2068
2085
  }
2069
2086
  });
2070
2087
  case "MakeObject":
2071
2088
  return () => ({
2072
2089
  type: "ScheduleSubroutine",
2073
- subroutine: Sn,
2074
- args: vn(e.template, (r) => O(s, r))
2090
+ subroutine: bn,
2091
+ args: yn(e.template, (r) => $(s, r))
2075
2092
  });
2076
2093
  case "MakeArray":
2077
2094
  return () => ({
2078
2095
  type: "ScheduleSubroutine",
2079
2096
  subroutine: rs(e.template.length),
2080
- args: ts(e.template, (r) => O(s, r))
2097
+ args: ts(e.template, (r) => $(s, r))
2081
2098
  });
2082
2099
  case "Flatten":
2083
2100
  return () => ({
2084
2101
  type: "ScheduleSubroutine",
2085
- subroutine: bn,
2102
+ subroutine: Cn,
2086
2103
  args: {
2087
- source: O(s, e.source)
2104
+ source: $(s, e.source)
2088
2105
  }
2089
2106
  });
2090
2107
  case "IsEmpty":
2091
2108
  return () => ({
2092
2109
  type: "ScheduleSubroutine",
2093
- subroutine: Pn,
2110
+ subroutine: On,
2094
2111
  args: {
2095
- arg: O(s, e.arg)
2112
+ arg: $(s, e.arg)
2096
2113
  }
2097
2114
  });
2098
2115
  case "Not":
2099
2116
  return () => ({
2100
2117
  type: "ScheduleSubroutine",
2101
- subroutine: On,
2118
+ subroutine: $n,
2102
2119
  args: {
2103
- operand: O(s, e.operand)
2120
+ operand: $(s, e.operand)
2104
2121
  }
2105
2122
  });
2106
2123
  case "And":
2107
2124
  return () => ({
2108
2125
  type: "ScheduleSubroutine",
2109
- subroutine: $n,
2126
+ subroutine: In,
2110
2127
  args: {
2111
- operand1: O(s, e.operand1),
2112
- operand2: O(s, e.operand2)
2128
+ operand1: $(s, e.operand1),
2129
+ operand2: $(s, e.operand2)
2113
2130
  }
2114
2131
  });
2115
2132
  case "Or":
2116
2133
  return () => ({
2117
2134
  type: "ScheduleSubroutine",
2118
- subroutine: In,
2135
+ subroutine: Fn,
2119
2136
  args: {
2120
- operand1: O(s, e.operand1),
2121
- operand2: O(s, e.operand2)
2137
+ operand1: $(s, e.operand1),
2138
+ operand2: $(s, e.operand2)
2122
2139
  }
2123
2140
  });
2124
2141
  case "MapResourceFields":
2125
2142
  return () => ({
2126
2143
  type: "ScheduleSubroutine",
2127
- subroutine: An(s, e),
2144
+ subroutine: Ln(s, e),
2128
2145
  args: {
2129
- source: O(s, e.source)
2146
+ source: $(s, e.source)
2130
2147
  }
2131
2148
  });
2132
2149
  case "GetResourceField":
@@ -2134,96 +2151,96 @@ function O(s, e) {
2134
2151
  type: "ScheduleSubroutine",
2135
2152
  subroutine: Rn,
2136
2153
  args: {
2137
- source: O(s, e.source),
2138
- field: O(s, e.field)
2154
+ source: $(s, e.source),
2155
+ field: $(s, e.field)
2139
2156
  }
2140
2157
  });
2141
2158
  case "GetResourceValueAsJson":
2142
2159
  return () => ({
2143
2160
  type: "ScheduleSubroutine",
2144
- subroutine: Fn,
2161
+ subroutine: Tn,
2145
2162
  args: {
2146
- source: O(s, e.source)
2163
+ source: $(s, e.source)
2147
2164
  }
2148
2165
  });
2149
2166
  case "GetBlobContent":
2150
2167
  return () => ({
2151
2168
  type: "ScheduleSubroutine",
2152
- subroutine: Nn,
2169
+ subroutine: Dn,
2153
2170
  args: {
2154
- source: O(s, e.source)
2171
+ source: $(s, e.source)
2155
2172
  }
2156
2173
  });
2157
2174
  case "GetBlobContentAsString":
2158
2175
  return () => ({
2159
2176
  type: "ScheduleSubroutine",
2160
- subroutine: Dn,
2177
+ subroutine: Bn,
2161
2178
  args: {
2162
- source: O(s, e.source)
2179
+ source: $(s, e.source)
2163
2180
  }
2164
2181
  });
2165
2182
  case "GetBlobContentAsJson":
2166
2183
  return () => ({
2167
2184
  type: "ScheduleSubroutine",
2168
- subroutine: Bn,
2185
+ subroutine: jn,
2169
2186
  args: {
2170
- source: O(s, e.source)
2187
+ source: $(s, e.source)
2171
2188
  }
2172
2189
  });
2173
2190
  case "GetDownloadedBlobContent":
2174
2191
  return () => ({
2175
2192
  type: "ScheduleSubroutine",
2176
- subroutine: jn,
2193
+ subroutine: xn,
2177
2194
  args: {
2178
- source: O(s, e.source)
2195
+ source: $(s, e.source)
2179
2196
  }
2180
2197
  });
2181
2198
  case "GetOnDemandBlobContent":
2182
2199
  return () => ({
2183
2200
  type: "ScheduleSubroutine",
2184
- subroutine: xn,
2201
+ subroutine: Vn,
2185
2202
  args: {
2186
- source: O(s, e.source)
2203
+ source: $(s, e.source)
2187
2204
  }
2188
2205
  });
2189
2206
  case "GetImportProgress":
2190
2207
  return () => ({
2191
2208
  type: "ScheduleSubroutine",
2192
- subroutine: Vn,
2209
+ subroutine: Un,
2193
2210
  args: {
2194
- source: O(s, e.source)
2211
+ source: $(s, e.source)
2195
2212
  }
2196
2213
  });
2197
2214
  case "GetLastLogs":
2198
2215
  return () => ({
2199
2216
  type: "ScheduleSubroutine",
2200
- subroutine: Un(e.lines),
2217
+ subroutine: Jn(e.lines),
2201
2218
  args: {
2202
- source: O(s, e.source)
2219
+ source: $(s, e.source)
2203
2220
  }
2204
2221
  });
2205
2222
  case "GetProgressLog":
2206
2223
  return () => ({
2207
2224
  type: "ScheduleSubroutine",
2208
- subroutine: Jn(e.patternToSearch),
2225
+ subroutine: Gn(e.patternToSearch),
2209
2226
  args: {
2210
- source: O(s, e.source)
2227
+ source: $(s, e.source)
2211
2228
  }
2212
2229
  });
2213
2230
  case "GetLogHandle":
2214
2231
  return () => ({
2215
2232
  type: "ScheduleSubroutine",
2216
- subroutine: Gn,
2233
+ subroutine: Mn,
2217
2234
  args: {
2218
- source: O(s, e.source)
2235
+ source: $(s, e.source)
2219
2236
  }
2220
2237
  });
2221
2238
  default:
2222
- return J(e);
2239
+ return G(e);
2223
2240
  }
2224
2241
  }
2225
- const Mn = ["$prod", "$staging"];
2226
- function _n(s) {
2242
+ const _n = ["$prod", "$staging"];
2243
+ function Kn(s) {
2227
2244
  return {
2228
2245
  $blockId: s.blockId,
2229
2246
  $args: (e) => JSON.parse(s.args(e)),
@@ -2235,16 +2252,16 @@ function _n(s) {
2235
2252
  $staging: s.staging
2236
2253
  };
2237
2254
  }
2238
- const ss = Symbol(), os = "return", Kn = { op: ss, arg: os };
2239
- function Hn(s) {
2255
+ const ss = Symbol(), os = "return", Hn = { op: ss, arg: os };
2256
+ function Wn(s) {
2240
2257
  return s.op == ss && s.arg == os;
2241
2258
  }
2242
- function Wn() {
2259
+ function qn() {
2243
2260
  return { pendingSubroutines: /* @__PURE__ */ new Map() };
2244
2261
  }
2245
- function or(s, e, t, r) {
2246
- const o = new jr(t), n = (c, a) => {
2247
- if (Hn(c))
2262
+ function nr(s, e, t, r) {
2263
+ const o = new xr(t), n = (c, a) => {
2264
+ if (Wn(c))
2248
2265
  return e.result = a, !1;
2249
2266
  const l = B(e.pendingSubroutines.get(c.op));
2250
2267
  if (c.arg in l.args) throw new Error("argument already set");
@@ -2267,9 +2284,9 @@ function or(s, e, t, r) {
2267
2284
  operation: a.subroutine({})
2268
2285
  });
2269
2286
  else {
2270
- for (const [m, h] of u)
2287
+ for (const [f, h] of u)
2271
2288
  o.push({
2272
- destination: { op: l, arg: m },
2289
+ destination: { op: l, arg: f },
2273
2290
  operation: h
2274
2291
  });
2275
2292
  e.pendingSubroutines.set(l, {
@@ -2289,53 +2306,53 @@ function or(s, e, t, r) {
2289
2306
  });
2290
2307
  break;
2291
2308
  default:
2292
- J(a);
2309
+ G(a);
2293
2310
  }
2294
2311
  }
2295
2312
  return i;
2296
2313
  }
2297
- function zn(s, e, t, r = {}) {
2298
- return ns(s, _n(e), t, r);
2314
+ function Xn(s, e, t, r = {}) {
2315
+ return ns(s, Kn(e), t, r);
2299
2316
  }
2300
2317
  function ns(s, e, t, r = {}) {
2301
- const o = `${e.blockId}#` + ye({
2318
+ const o = `${e.blockId}#` + re({
2302
2319
  ctx: Object.fromEntries(
2303
- Object.entries(e).filter(([n]) => Mn.indexOf(n) === -1)
2320
+ Object.entries(e).filter(([n]) => _n.indexOf(n) === -1)
2304
2321
  ),
2305
2322
  cfg: t
2306
2323
  });
2307
2324
  return V.makeRaw(
2308
2325
  (n) => {
2309
- const i = { drivers: s, cCtx: n }, c = Wn();
2326
+ const i = { drivers: s, cCtx: n }, c = qn();
2310
2327
  return {
2311
- ir: or(
2328
+ ir: nr(
2312
2329
  i,
2313
2330
  c,
2314
2331
  [
2315
2332
  {
2316
- destination: Kn,
2317
- operation: O(e, t)
2333
+ destination: Hn,
2334
+ operation: $(e, t)
2318
2335
  }
2319
2336
  ],
2320
2337
  !0
2321
2338
  ),
2322
2339
  async postprocessValue(l) {
2323
2340
  const u = [];
2324
- for (const f of l)
2325
- u.push({ destination: f.destination, operation: C(f.computable) });
2341
+ for (const g of l)
2342
+ u.push({ destination: g.destination, operation: k(g.computable) });
2326
2343
  const d = {
2327
2344
  drivers: s,
2328
2345
  get cCtx() {
2329
2346
  throw new Error("asynchronous operations are forbidden in this context");
2330
2347
  }
2331
- }, m = /* @__PURE__ */ new Map();
2332
- for (const [f, I] of c.pendingSubroutines)
2333
- m.set(f, { ...I, args: { ...I.args } });
2348
+ }, f = /* @__PURE__ */ new Map();
2349
+ for (const [g, E] of c.pendingSubroutines)
2350
+ f.set(g, { ...E, args: { ...E.args } });
2334
2351
  const h = {
2335
2352
  result: c.result,
2336
- pendingSubroutines: m
2353
+ pendingSubroutines: f
2337
2354
  };
2338
- if (or(d, h, u, !1), !("result" in h))
2355
+ if (nr(d, h, u, !1), !("result" in h))
2339
2356
  throw new Error("illegal cfg rendering stack state, no result");
2340
2357
  return h.result;
2341
2358
  }
@@ -2344,13 +2361,13 @@ function ns(s, e, t, r = {}) {
2344
2361
  { ...r, key: o }
2345
2362
  );
2346
2363
  }
2347
- function Xn(s) {
2364
+ function zn(s) {
2348
2365
  return s instanceof ArrayBuffer || ArrayBuffer.isView(s);
2349
2366
  }
2350
- function nr(s) {
2367
+ function ir(s) {
2351
2368
  return s !== void 0 ? Buffer.from(s).toString("base64") : void 0;
2352
2369
  }
2353
- class ze {
2370
+ class qe {
2354
2371
  constructor(e, t, r, o, n) {
2355
2372
  S(this, "callbackRegistry");
2356
2373
  S(this, "fnJSONStringify");
@@ -2382,12 +2399,12 @@ class ze {
2382
2399
  try {
2383
2400
  this.vm.unwrapResult(this.vm.evalCode(e, "bundle.js", { type: "global" })).dispose();
2384
2401
  } catch (t) {
2385
- throw ze.cleanErrorContext(t), t;
2402
+ throw qe.cleanErrorContext(t), t;
2386
2403
  }
2387
2404
  }
2388
2405
  runCallback(e, ...t) {
2389
2406
  try {
2390
- return gt.withScope((r) => {
2407
+ return mt.withScope((r) => {
2391
2408
  const o = r.manage(this.vm.getProp(this.callbackRegistry, e));
2392
2409
  if (this.vm.typeof(o) !== "function")
2393
2410
  throw new Error(`No such callback: ${e}`);
@@ -2402,7 +2419,7 @@ class ze {
2402
2419
  );
2403
2420
  });
2404
2421
  } catch (r) {
2405
- throw ze.cleanErrorContext(r), r;
2422
+ throw qe.cleanErrorContext(r), r;
2406
2423
  }
2407
2424
  }
2408
2425
  //
@@ -2457,13 +2474,13 @@ class ze {
2457
2474
  return this.getAccessor(e).listDynamicFields();
2458
2475
  }
2459
2476
  getKeyValueBase64(e, t) {
2460
- return nr(this.getAccessor(e).getKeyValue(t));
2477
+ return ir(this.getAccessor(e).getKeyValue(t));
2461
2478
  }
2462
2479
  getKeyValueAsString(e, t) {
2463
2480
  return this.getAccessor(e).getKeyValueAsString(t);
2464
2481
  }
2465
2482
  getDataBase64(e) {
2466
- return nr(this.getAccessor(e).getData());
2483
+ return ir(this.getAccessor(e).getData());
2467
2484
  }
2468
2485
  getDataAsString(e) {
2469
2486
  return this.getAccessor(e).getDataAsString();
@@ -2474,7 +2491,7 @@ class ze {
2474
2491
  parsePObjectCollection(e, t, r, ...o) {
2475
2492
  const n = this.getAccessor(e);
2476
2493
  if (!n.getIsReadyOrError()) return;
2477
- const i = mn(n, t, r, o), c = {};
2494
+ const i = vn(n, t, r, o), c = {};
2478
2495
  for (const [a, l] of Object.entries(i))
2479
2496
  c[a] = le(l, (u) => this.wrapAccessor(u));
2480
2497
  return c;
@@ -2605,7 +2622,7 @@ class ze {
2605
2622
  obj: {
2606
2623
  id: t.obj.id,
2607
2624
  spec: t.obj.spec,
2608
- data: Fr(t.obj.data, (r) => this.wrapAccessor(r))
2625
+ data: Tr(t.obj.data, (r) => this.wrapAccessor(r))
2609
2626
  }
2610
2627
  }))
2611
2628
  };
@@ -2645,7 +2662,7 @@ class ze {
2645
2662
  "can't instantiate PTable from this context (most porbably called from the future mapper)"
2646
2663
  );
2647
2664
  return this.env.driverKit.pFrameDriver.createPTable(
2648
- pt(e, (t) => le(
2665
+ ht(e, (t) => le(
2649
2666
  t,
2650
2667
  (r) => typeof r == "string" ? this.getAccessor(r) : r
2651
2668
  )),
@@ -2701,7 +2718,7 @@ class ze {
2701
2718
  r = this.vm.null;
2702
2719
  break;
2703
2720
  }
2704
- if (Xn(e)) {
2721
+ if (zn(e)) {
2705
2722
  r = this.vm.newArrayBuffer(e), o = !0;
2706
2723
  break;
2707
2724
  }
@@ -2737,7 +2754,7 @@ class ze {
2737
2754
  return JSON.parse(t);
2738
2755
  }
2739
2756
  injectCtx() {
2740
- gt.withScope((e) => {
2757
+ mt.withScope((e) => {
2741
2758
  const t = e.manage(this.vm.newObject()), r = this.blockCtx.args(this.computableCtx), o = this.blockCtx.uiState(this.computableCtx);
2742
2759
  this.vm.setProp(t, "args", e.manage(this.vm.newString(r))), o !== void 0 && this.vm.setProp(t, "uiState", e.manage(this.vm.newString(o))), this.vm.setProp(t, "callbackRegistry", this.callbackRegistry), this.vm.setProp(
2743
2760
  t,
@@ -2820,7 +2837,7 @@ class ze {
2820
2837
  });
2821
2838
  }
2822
2839
  }
2823
- function qe(s, e) {
2840
+ function ze(s, e) {
2824
2841
  return Oe(
2825
2842
  s.traverse(
2826
2843
  {
@@ -2828,57 +2845,57 @@ function qe(s, e) {
2828
2845
  assertFieldType: "Dynamic",
2829
2846
  errorIfFieldNotSet: !0
2830
2847
  },
2831
- { field: T.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 }
2848
+ { field: L.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 }
2832
2849
  ),
2833
2850
  (t) => {
2834
- const r = t.getDataAsJson(), o = Tr(r.config);
2851
+ const r = t.getDataAsJson(), o = Ar(r.config);
2835
2852
  return { bpId: t.resourceInfo.id.toString(), info: r, cfg: o };
2836
2853
  }
2837
2854
  );
2838
2855
  }
2839
- const xe = process.env.MI_LOG_OUTPUT_STATUS;
2840
- function qn(s, e, t, r, o, n = {}) {
2856
+ const Ve = process.env.MI_LOG_OUTPUT_STATUS;
2857
+ function Yn(s, e, t, r, o, n = {}) {
2841
2858
  const i = `${e.blockId}#lambda#${o}#${t.handle}`;
2842
2859
  return n = { ...n, key: i }, n.mode === void 0 && t.retentive === !0 && (n.mode = "StableOnlyRetentive"), V.makeRaw((c) => {
2843
- const a = new gt();
2860
+ const a = new mt();
2844
2861
  c.addOnDestroy(() => a.dispose());
2845
2862
  const l = a.manage(s.quickJs.newRuntime());
2846
2863
  l.setMemoryLimit(1024 * 640), l.setMaxStackSize(1024 * 320);
2847
- const u = a.manage(l.newContext()), d = new ze(a, u, e, s, c);
2864
+ const u = a.manage(l.newContext()), d = new qe(a, u, e, s, c);
2848
2865
  d.evaluateBundle(r.content);
2849
- const m = d.runCallback(t.handle);
2866
+ const f = d.runCallback(t.handle);
2850
2867
  d.resetComputableCtx();
2851
2868
  let h = 0;
2852
- return xe && xe !== "unstable-only" && console.log(`Output ${t.handle} scaffold calculated.`), {
2869
+ return Ve && Ve !== "unstable-only" && console.log(`Output ${t.handle} scaffold calculated.`), {
2853
2870
  ir: d.computablesToResolve,
2854
- postprocessValue: async (f, { unstableMarker: I, stable: F }) => {
2855
- for (const [_, k] of Object.entries(f)) d.runCallback(_, k);
2856
- const D = d.importObjectUniversal(m);
2857
- return h++, xe && (xe !== "unstable-only" || !F) && console.log(
2858
- F ? `Stable output ${t.handle} calculated ${D !== void 0 ? "defined" : "undefined"}; (#${h})` : `Unstable output ${t.handle}; marker = ${I}; ${D !== void 0 ? "defined" : "undefined"} (#${h})`
2859
- ), D;
2871
+ postprocessValue: async (g, { unstableMarker: E, stable: F }) => {
2872
+ for (const [_, P] of Object.entries(g)) d.runCallback(_, P);
2873
+ const N = d.importObjectUniversal(f);
2874
+ return h++, Ve && (Ve !== "unstable-only" || !F) && console.log(
2875
+ F ? `Stable output ${t.handle} calculated ${N !== void 0 ? "defined" : "undefined"}; (#${h})` : `Unstable output ${t.handle}; marker = ${E}; ${N !== void 0 ? "defined" : "undefined"} (#${h})`
2876
+ ), N;
2860
2877
  }
2861
2878
  };
2862
2879
  }, n);
2863
2880
  }
2864
- function Yn(s) {
2865
- return Ar(s) ? s.isActive === !0 : wn(s);
2881
+ function Qn(s) {
2882
+ return Lr(s) ? s.isActive === !0 : Sn(s);
2866
2883
  }
2867
2884
  function $e(s, e, t, r, o, n = {}) {
2868
- if (Ar(t)) {
2885
+ if (Lr(t)) {
2869
2886
  if (r === void 0) throw new Error("No code bundle.");
2870
- return qn(s, e, t, r, o, n);
2871
- } else return zn(s.driverKit, e, t, n);
2887
+ return Yn(s, e, t, r, o, n);
2888
+ } else return Xn(s.driverKit, e, t, n);
2872
2889
  }
2873
- function Qn(s, e, t) {
2890
+ function Zn(s, e, t) {
2874
2891
  return V.make(
2875
2892
  (r) => {
2876
- var f, I, F, D, _, k, se, pe;
2877
- const o = r.accessor(s).node(), n = B(o.getKeyValueAsJson($t)), i = B(o.getKeyValueAsJson(Te)), c = B(o.getKeyValueAsJson(Ae)), a = B(o.getKeyValueAsJson(de)), l = B(
2878
- o.getKeyValueAsJson(Ke)
2893
+ var g, E, F, N, _, P, se, pe;
2894
+ const o = r.accessor(s).node(), n = B(o.getKeyValueAsJson(It)), i = B(o.getKeyValueAsJson(Te)), c = B(o.getKeyValueAsJson(Ae)), a = B(o.getKeyValueAsJson(de)), l = B(
2895
+ o.getKeyValueAsJson(He)
2879
2896
  ), u = /* @__PURE__ */ new Map();
2880
2897
  for (const { id: A } of te(a)) {
2881
- const z = o.traverse({
2898
+ const q = o.traverse({
2882
2899
  field: U(A, "currentArgs"),
2883
2900
  assertFieldType: "Dynamic",
2884
2901
  errorIfFieldNotSet: !0
@@ -2890,7 +2907,7 @@ function Qn(s, e, t) {
2890
2907
  stableIfNotFound: !0
2891
2908
  });
2892
2909
  if (K !== void 0) {
2893
- const G = o.getField({
2910
+ const J = o.getField({
2894
2911
  field: U(A, "prodOutput"),
2895
2912
  assertFieldType: "Dynamic",
2896
2913
  errorIfFieldNotFound: !0
@@ -2901,70 +2918,76 @@ function Qn(s, e, t) {
2901
2918
  });
2902
2919
  oe = {
2903
2920
  arguments: K.getDataAsJson(),
2904
- stale: z.id !== K.id,
2905
- outputError: G.error !== void 0 || x.error !== void 0 || ((f = G.value) == null ? void 0 : f.getError()) !== void 0 || ((I = x.value) == null ? void 0 : I.getError()) !== void 0,
2906
- outputsError: ((F = G.error) == null ? void 0 : F.getDataAsString()) ?? ((_ = (D = G.value) == null ? void 0 : D.getError()) == null ? void 0 : _.getDataAsString()),
2907
- exportsError: ((k = x.error) == null ? void 0 : k.getDataAsString()) ?? ((pe = (se = x.value) == null ? void 0 : se.getError()) == null ? void 0 : pe.getDataAsString()),
2908
- finished: (G.value !== void 0 && G.value.getIsReadyOrError() || G.error !== void 0 && G.error.getIsReadyOrError()) && (x.value !== void 0 && x.value.getIsReadyOrError() || x.error !== void 0 && x.error.getIsReadyOrError())
2921
+ stale: q.id !== K.id,
2922
+ outputError: J.error !== void 0 || x.error !== void 0 || ((g = J.value) == null ? void 0 : g.getError()) !== void 0 || ((E = x.value) == null ? void 0 : E.getError()) !== void 0,
2923
+ outputsError: ((F = J.error) == null ? void 0 : F.getDataAsString()) ?? ((_ = (N = J.value) == null ? void 0 : N.getError()) == null ? void 0 : _.getDataAsString()),
2924
+ exportsError: ((P = x.error) == null ? void 0 : P.getDataAsString()) ?? ((pe = (se = x.value) == null ? void 0 : se.getError()) == null ? void 0 : pe.getDataAsString()),
2925
+ finished: (J.value !== void 0 && J.value.getIsReadyOrError() || J.error !== void 0 && J.error.getIsReadyOrError()) && (x.value !== void 0 && x.value.getIsReadyOrError() || x.error !== void 0 && x.error.getIsReadyOrError())
2909
2926
  };
2910
2927
  }
2911
- u.set(A, { currentArguments: z.getDataAsJson(), prod: oe });
2928
+ u.set(A, { currentArguments: q.getDataAsJson(), prod: oe });
2912
2929
  }
2913
- const d = Me(a, (A) => u.get(A).currentArguments), m = new Set(l.blocksInLimbo), h = [...te(a)].map(({ id: A, label: z, renderingMode: oe }) => {
2914
- var b, w, R, P, E;
2915
- const K = B(u.get(A)), G = B(d.nodes.get(A));
2930
+ const d = _e(a, (A) => u.get(A).currentArguments), f = new Set(l.blocksInLimbo), h = [...te(a)].map(({ id: A, label: q, renderingMode: oe }) => {
2931
+ var w, C, O, R, T;
2932
+ const K = B(u.get(A)), J = B(d.nodes.get(A));
2916
2933
  let x = "NotCalculated";
2917
- K.prod !== void 0 && (m.has(A) ? x = "Limbo" : x = K.prod.finished ? "Done" : "Running");
2918
- const X = qe(o, A), { sections: he, title: v, inputsValid: p, sdkVersion: y } = Oe(X, ({ bpId: $, cfg: L, info: N }) => {
2919
- const re = Tt(s, A);
2934
+ K.prod !== void 0 && (f.has(A) ? x = "Limbo" : x = K.prod.finished ? "Done" : "Running");
2935
+ const X = ze(o, A), { sections: he, title: v, inputsValid: p, sdkVersion: y } = Oe(X, ({ bpId: D, cfg: I, info: fe }) => {
2936
+ const rt = At(s, A);
2920
2937
  return {
2921
2938
  sections: $e(
2922
2939
  t,
2923
- re,
2924
- L.sections,
2925
- L.code,
2926
- $
2940
+ rt,
2941
+ I.sections,
2942
+ I.code,
2943
+ D
2927
2944
  ),
2928
2945
  title: Oe(
2929
- L.title,
2946
+ I.title,
2930
2947
  (vs) => $e(
2931
2948
  t,
2932
- re,
2949
+ rt,
2933
2950
  vs,
2934
- L.code,
2935
- $
2951
+ I.code,
2952
+ D
2936
2953
  )
2937
2954
  ),
2938
2955
  inputsValid: $e(
2939
2956
  t,
2940
- re,
2941
- L.inputsValid,
2942
- L.code,
2943
- $
2957
+ rt,
2958
+ I.inputsValid,
2959
+ I.code,
2960
+ D
2944
2961
  ),
2945
- sdkVersion: L.sdkVersion
2962
+ sdkVersion: I.sdkVersion
2946
2963
  };
2947
- }) || {}, g = Oe(
2964
+ }) || {}, m = o.traverse({
2965
+ field: U(A, "blockSettings"),
2966
+ assertFieldType: "Dynamic",
2967
+ errorIfFieldNotSet: !0
2968
+ }).getDataAsJson(), b = Oe(
2948
2969
  X,
2949
- ({ info: $ }) => t.blockUpdateWatcher.get($.source)
2970
+ ({ info: D }) => t.blockUpdateWatcher.get({ currentSpec: D.source, settings: m })
2950
2971
  );
2951
2972
  return {
2952
2973
  id: A,
2953
- label: v ?? z,
2954
- title: v ?? z,
2974
+ label: v ?? q,
2975
+ title: v ?? q,
2955
2976
  renderingMode: oe,
2956
- stale: ((b = K.prod) == null ? void 0 : b.stale) !== !1 || x === "Limbo",
2957
- missingReference: G.missingReferences,
2977
+ stale: ((w = K.prod) == null ? void 0 : w.stale) !== !1 || x === "Limbo",
2978
+ missingReference: J.missingReferences,
2958
2979
  upstreams: [...d.traverseIdsExcludingRoots("upstream", A)],
2959
2980
  downstreams: [...d.traverseIdsExcludingRoots("downstream", A)],
2960
2981
  calculationStatus: x,
2961
- outputErrors: ((w = K.prod) == null ? void 0 : w.outputError) === !0,
2962
- outputsError: (R = K.prod) == null ? void 0 : R.outputsError,
2963
- exportsError: (P = K.prod) == null ? void 0 : P.exportsError,
2982
+ outputErrors: ((C = K.prod) == null ? void 0 : C.outputError) === !0,
2983
+ outputsError: (O = K.prod) == null ? void 0 : O.outputsError,
2984
+ exportsError: (R = K.prod) == null ? void 0 : R.exportsError,
2985
+ settings: m,
2964
2986
  sections: he,
2965
2987
  inputsValid: p,
2966
- currentBlockPack: (E = X == null ? void 0 : X.info) == null ? void 0 : E.source,
2967
- updatedBlockPack: g,
2988
+ updateInfo: {},
2989
+ currentBlockPack: (T = X == null ? void 0 : X.info) == null ? void 0 : T.source,
2990
+ updates: b,
2968
2991
  sdkVersion: y,
2969
2992
  navigationState: e.getState(A)
2970
2993
  };
@@ -2973,7 +2996,7 @@ function Qn(s, e, t) {
2973
2996
  meta: c,
2974
2997
  created: new Date(n),
2975
2998
  lastModified: new Date(i),
2976
- authorMarker: o.getKeyValueAsJson(yt),
2999
+ authorMarker: o.getKeyValueAsJson(wt),
2977
3000
  blocks: h
2978
3001
  };
2979
3002
  },
@@ -2983,22 +3006,29 @@ function Qn(s, e, t) {
2983
3006
  return {
2984
3007
  ...r,
2985
3008
  blocks: r.blocks.map((i) => {
3009
+ var u, d;
2986
3010
  i.inputsValid || o.add(i.id), i.stale && n.add(i.id);
2987
- const c = i.stale || i.upstreams.findIndex((l) => n.has(l)) !== -1, a = (c || i.outputErrors) && !!i.inputsValid && !i.missingReference && i.upstreams.findIndex((l) => o.has(l)) === -1;
2988
- return { ...i, canRun: a, stale: c };
3011
+ const c = i.stale || i.upstreams.findIndex((f) => n.has(f)) !== -1, a = (c || i.outputErrors) && !!i.inputsValid && !i.missingReference && i.upstreams.findIndex((f) => o.has(f)) === -1, l = {
3012
+ ...i,
3013
+ canRun: a,
3014
+ stale: c,
3015
+ updateSuggestions: ((u = i.updates) == null ? void 0 : u.suggestions) ?? [],
3016
+ updatedBlockPack: (d = i.updates) == null ? void 0 : d.mainSuggestion
3017
+ };
3018
+ return delete l.updates, l;
2989
3019
  })
2990
3020
  };
2991
3021
  }
2992
3022
  }
2993
3023
  ).withStableType();
2994
3024
  }
2995
- function Zn(s, e) {
3025
+ function ei(s, e) {
2996
3026
  const t = s.node();
2997
- if (ae(t.resourceType, Wr)) {
3027
+ if (ce(t.resourceType, Wr)) {
2998
3028
  const r = t.getDataAsJson();
2999
3029
  if (r === void 0) throw new Error("No resource data.");
3000
3030
  return e.frontendDownloadDriver.getPath(new URL(r.url)).withStableType();
3001
- } else if (ae(t.resourceType, zr)) {
3031
+ } else if (ce(t.resourceType, qr)) {
3002
3032
  const r = t.getDataAsJson();
3003
3033
  if (r === void 0) throw new Error("No resource data.");
3004
3034
  return e.signer.verify(
@@ -3009,10 +3039,10 @@ function Zn(s, e) {
3009
3039
  } else
3010
3040
  throw new Error(`Unsupported resource type: ${JSON.stringify(t.resourceType)}`);
3011
3041
  }
3012
- function ei(s, e) {
3042
+ function ti(s, e) {
3013
3043
  if (s !== void 0)
3014
3044
  return V.make(
3015
- (t) => Zn(t.accessor(s), e),
3045
+ (t) => ei(t.accessor(s), e),
3016
3046
  {
3017
3047
  postprocessValue: (t) => {
3018
3048
  if (t !== void 0) {
@@ -3024,20 +3054,20 @@ function ei(s, e) {
3024
3054
  }
3025
3055
  ).withStableType();
3026
3056
  }
3027
- function ti(s, e, t) {
3057
+ function ri(s, e, t) {
3028
3058
  return V.make(
3029
3059
  (r) => {
3030
3060
  var c;
3031
- const o = r.accessor(s).node(), n = qe(o, e), i = (c = o.traverse(
3061
+ const o = r.accessor(s).node(), n = ze(o, e), i = (c = o.traverse(
3032
3062
  {
3033
3063
  field: U(e, "blockPack"),
3034
3064
  assertFieldType: "Dynamic"
3035
3065
  },
3036
- { field: T.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 },
3037
- { field: qr, assertFieldType: "Input" }
3066
+ { field: L.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 },
3067
+ { field: zr, assertFieldType: "Input" }
3038
3068
  )) == null ? void 0 : c.persist();
3039
3069
  return {
3040
- path: ei(i, t),
3070
+ path: ti(i, t),
3041
3071
  sdkVersion: n == null ? void 0 : n.cfg.sdkVersion
3042
3072
  };
3043
3073
  },
@@ -3047,20 +3077,20 @@ function ti(s, e, t) {
3047
3077
  function is(s, e, t) {
3048
3078
  if (t === void 0)
3049
3079
  return V.make((i) => is(s, e, i), {
3050
- key: `inputs#${Dr(s.rid)}#${e}`
3080
+ key: `inputs#${Br(s.rid)}#${e}`
3051
3081
  });
3052
- const r = t.accessor(s).node(), o = Tt(s, e), n = o.uiState(t);
3082
+ const r = t.accessor(s).node(), o = At(s, e), n = o.uiState(t);
3053
3083
  return {
3054
- author: r.getKeyValueAsJson(vt(e)),
3084
+ author: r.getKeyValueAsJson(yt(e)),
3055
3085
  args: JSON.parse(o.args(t)),
3056
3086
  ui: n !== void 0 ? JSON.parse(n) : void 0
3057
3087
  };
3058
3088
  }
3059
- function ri(s, e, t) {
3089
+ function si(s, e, t) {
3060
3090
  return V.make(
3061
3091
  (r) => {
3062
3092
  const o = r.accessor(s).node(), n = es(s, e);
3063
- return Oe(qe(o, e), ({ cfg: i, bpId: c }) => {
3093
+ return Oe(ze(o, e), ({ cfg: i, bpId: c }) => {
3064
3094
  const a = {};
3065
3095
  for (const [l, u] of Object.entries(i.outputs)) {
3066
3096
  const d = $e(t, n, u, i.code, c);
@@ -3069,16 +3099,16 @@ function ri(s, e, t) {
3069
3099
  return a;
3070
3100
  });
3071
3101
  },
3072
- { key: "outputs#" + Dr(s.rid) + "#" + e }
3102
+ { key: "outputs#" + Br(s.rid) + "#" + e }
3073
3103
  ).withStableType();
3074
3104
  }
3075
- function si(s, e) {
3105
+ function oi(s, e) {
3076
3106
  return V.make((t) => {
3077
3107
  const r = t.accessor(s).node(), o = B(r.getKeyValueAsJson(de)), n = [];
3078
3108
  for (const { id: i, renderingMode: c } of te(o)) {
3079
- const a = qe(r, i);
3109
+ const a = ze(r, i);
3080
3110
  if (a === void 0) continue;
3081
- const l = Object.entries(a.cfg.outputs).map(([, d]) => d).filter((d) => Yn(d)).map((d) => d);
3111
+ const l = Object.entries(a.cfg.outputs).map(([, d]) => d).filter((d) => Qn(d)).map((d) => d);
3082
3112
  if (l.length === 0) continue;
3083
3113
  const u = es(r.persist(), i);
3084
3114
  for (const d of l)
@@ -3089,7 +3119,7 @@ function si(s, e) {
3089
3119
  return n;
3090
3120
  });
3091
3121
  }
3092
- class oi {
3122
+ class ni {
3093
3123
  constructor() {
3094
3124
  S(this, "states", /* @__PURE__ */ new Map());
3095
3125
  }
@@ -3103,7 +3133,7 @@ class oi {
3103
3133
  }
3104
3134
  readState(e, t) {
3105
3135
  let r = this.states.get(t);
3106
- return r === void 0 && (r = { state: { ...Rs }, change: new Ht() }, this.states.set(t, r)), r.change.attachWatcher(e.watcher), r.state;
3136
+ return r === void 0 && (r = { state: { ...Cs }, change: new Ht() }, this.states.set(t, r)), r.change.attachWatcher(e.watcher), r.state;
3107
3137
  }
3108
3138
  getState(e) {
3109
3139
  return V.make(
@@ -3116,38 +3146,38 @@ class oi {
3116
3146
  t !== void 0 && (this.states.delete(e), t.change.markChanged());
3117
3147
  }
3118
3148
  }
3119
- class At {
3149
+ class Lt {
3120
3150
  constructor(e, t, r) {
3121
3151
  /** Underlying pl resource id */
3122
3152
  S(this, "rid");
3123
3153
  /** Data for the left panel, contain basic information about block status. */
3124
3154
  S(this, "overview");
3125
- S(this, "navigationStates", new oi());
3155
+ S(this, "navigationStates", new ni());
3126
3156
  S(this, "blockComputables", /* @__PURE__ */ new Map());
3127
3157
  S(this, "blockFrontends", /* @__PURE__ */ new Map());
3128
3158
  S(this, "activeConfigs");
3129
3159
  S(this, "refreshLoopResult");
3130
3160
  S(this, "abortController", new AbortController());
3131
3161
  S(this, "destroyed", !1);
3132
- this.env = e, this.projectTree = r, this.overview = Qn(
3162
+ this.env = e, this.projectTree = r, this.overview = Zn(
3133
3163
  r.entry(),
3134
3164
  this.navigationStates,
3135
3165
  e
3136
- ).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs = si(r.entry(), e);
3166
+ ).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs = oi(r.entry(), e);
3137
3167
  }
3138
3168
  async refreshLoop() {
3139
3169
  for (; !this.destroyed; )
3140
3170
  try {
3141
- await nt(this.env.pl, this.rid, (e) => {
3171
+ await it(this.env.pl, this.rid, (e) => {
3142
3172
  e.doRefresh(this.env.ops.stagingRenderingRate);
3143
- }), await this.activeConfigs.getValue(), await xr(this.env.ops.projectRefreshInterval, this.abortController.signal);
3173
+ }), await this.activeConfigs.getValue(), await Vr(this.env.ops.projectRefreshInterval, this.abortController.signal);
3144
3174
  } catch (e) {
3145
- if (Bs(e)) {
3175
+ if (js(e)) {
3146
3176
  console.warn(
3147
3177
  "project refresh routine terminated, because project was externally deleted"
3148
3178
  );
3149
3179
  break;
3150
- } else if (!js(e))
3180
+ } else if (!xs(e))
3151
3181
  throw new Error("Unexpected exception", { cause: e });
3152
3182
  }
3153
3183
  }
@@ -3163,8 +3193,8 @@ class At {
3163
3193
  * @return returns newly created block id
3164
3194
  * */
3165
3195
  async addBlock(e, t, r, o = void 0, n = Fe()) {
3166
- const i = await this.env.bpPreparer.prepare(t), c = await this.env.bpPreparer.getBlockConfigContainer(t), a = Tr(c);
3167
- return await ee(
3196
+ const i = await this.env.bpPreparer.prepare(t), c = await this.env.bpPreparer.getBlockConfigContainer(t), a = Ar(c);
3197
+ return await Y(
3168
3198
  this.env.pl,
3169
3199
  this.rid,
3170
3200
  o,
@@ -3189,7 +3219,7 @@ class At {
3189
3219
  * */
3190
3220
  async updateBlockPack(e, t, r = !1, o) {
3191
3221
  const n = await this.env.bpPreparer.prepare(t), i = await this.env.bpPreparer.getBlockConfigContainer(t);
3192
- await ee(
3222
+ await Y(
3193
3223
  this.env.pl,
3194
3224
  this.rid,
3195
3225
  o,
@@ -3202,7 +3232,7 @@ class At {
3202
3232
  }
3203
3233
  /** Deletes a block with all associated data. */
3204
3234
  async deleteBlock(e, t) {
3205
- await ee(this.env.pl, this.rid, t, (r) => r.deleteBlock(e)), this.navigationStates.deleteBlock(e), await this.projectTree.refreshState();
3235
+ await Y(this.env.pl, this.rid, t, (r) => r.deleteBlock(e)), this.navigationStates.deleteBlock(e), await this.projectTree.refreshState();
3206
3236
  }
3207
3237
  /**
3208
3238
  * Updates block order according to the given array of block ids.
@@ -3211,7 +3241,7 @@ class At {
3211
3241
  * an error will be thrown instead.
3212
3242
  */
3213
3243
  async reorderBlocks(e, t) {
3214
- await ee(this.env.pl, this.rid, t, (r) => {
3244
+ await Y(this.env.pl, this.rid, t, (r) => {
3215
3245
  const o = r.structure;
3216
3246
  if (o.groups.length !== 1)
3217
3247
  throw new Error("Unexpected project structure, non-sinular block group");
@@ -3241,7 +3271,7 @@ class At {
3241
3271
  * stale state.
3242
3272
  * */
3243
3273
  async runBlock(e) {
3244
- await nt(this.env.pl, this.rid, (t) => t.renderProduction([e], !0)), await this.projectTree.refreshState();
3274
+ await it(this.env.pl, this.rid, (t) => t.renderProduction([e], !0)), await this.projectTree.refreshState();
3245
3275
  }
3246
3276
  /**
3247
3277
  * Stops the block if it is running by destroying its production state. All
@@ -3249,7 +3279,7 @@ class At {
3249
3279
  * calculated.
3250
3280
  * */
3251
3281
  async stopBlock(e) {
3252
- await nt(this.env.pl, this.rid, (t) => t.stopProduction(e)), await this.projectTree.refreshState();
3282
+ await it(this.env.pl, this.rid, (t) => t.stopProduction(e)), await this.projectTree.refreshState();
3253
3283
  }
3254
3284
  // /** Update block label. */
3255
3285
  // public async setBlockLabel(blockId: string, label: string, author?: AuthorMarker) {
@@ -3265,7 +3295,7 @@ class At {
3265
3295
  * in collaborative editing scenario.
3266
3296
  * */
3267
3297
  async setBlockArgs(e, t, r) {
3268
- await ee(
3298
+ await Y(
3269
3299
  this.env.pl,
3270
3300
  this.rid,
3271
3301
  r,
@@ -3279,7 +3309,7 @@ class At {
3279
3309
  * in collaborative editing scenario.
3280
3310
  * */
3281
3311
  async setUiState(e, t, r) {
3282
- await ee(
3312
+ await Y(
3283
3313
  this.env.pl,
3284
3314
  this.rid,
3285
3315
  r,
@@ -3299,21 +3329,27 @@ class At {
3299
3329
  * in collaborative editing scenario.
3300
3330
  * */
3301
3331
  async setBlockArgsAndUiState(e, t, r, o) {
3302
- await ee(this.env.pl, this.rid, o, (n) => {
3332
+ await Y(this.env.pl, this.rid, o, (n) => {
3303
3333
  n.setArgs([{ blockId: e, args: JSON.stringify(t) }]), n.setUiState(e, JSON.stringify(r));
3304
3334
  }), await this.projectTree.refreshState();
3305
3335
  }
3336
+ /** Update block settings */
3337
+ async setBlockSettings(e, t) {
3338
+ await Y(this.env.pl, this.rid, void 0, (r) => {
3339
+ r.setBlockSettings(e, t);
3340
+ }), await this.projectTree.refreshState();
3341
+ }
3306
3342
  /** Resets arguments and ui state of the block to initial state */
3307
3343
  async resetBlockArgsAndUiState(e, t) {
3308
3344
  await this.env.pl.withWriteTx("BlockInputsReset", async (r) => {
3309
- const o = ft(
3345
+ const o = gt(
3310
3346
  (await r.getField(j(this.rid, U(e, "blockPack")))).value
3311
- ), n = ft(
3312
- (await r.getField(j(o, T.HolderRefField))).value
3347
+ ), n = gt(
3348
+ (await r.getField(j(o, L.HolderRefField))).value
3313
3349
  ), i = await r.getResourceData(n, !1), c = JSON.parse(
3314
3350
  Buffer.from(B(i.data)).toString("utf-8")
3315
3351
  );
3316
- await ee(r, this.rid, t, (a) => {
3352
+ await Y(r, this.rid, t, (a) => {
3317
3353
  a.setArgs([{ blockId: e, args: JSON.stringify(c.config.initialArgs) }]), a.setUiState(e, void 0);
3318
3354
  }), await r.commit();
3319
3355
  }), await this.projectTree.refreshState();
@@ -3321,7 +3357,7 @@ class At {
3321
3357
  getBlockComputables(e) {
3322
3358
  const t = this.blockComputables.get(e);
3323
3359
  if (t === void 0) {
3324
- const r = ri(this.projectTree.entry(), e, this.env), n = {
3360
+ const r = si(this.projectTree.entry(), e, this.env), n = {
3325
3361
  fullState: V.make(
3326
3362
  (i) => ({
3327
3363
  argsAndUiState: is(this.projectTree.entry(), e, i),
@@ -3355,7 +3391,7 @@ class At {
3355
3391
  getBlockFrontend(e) {
3356
3392
  const t = this.blockFrontends.get(e);
3357
3393
  if (t === void 0) {
3358
- const r = ti(
3394
+ const r = ri(
3359
3395
  this.projectTree.entry(),
3360
3396
  e,
3361
3397
  this.env
@@ -3375,19 +3411,19 @@ class At {
3375
3411
  await this.destroy();
3376
3412
  }
3377
3413
  static async init(e, t) {
3378
- const r = await Br.init(
3414
+ const r = await jr.init(
3379
3415
  e.pl,
3380
3416
  t,
3381
3417
  {
3382
3418
  ...e.ops.defaultTreeOptions,
3383
- pruning: ni
3419
+ pruning: ii
3384
3420
  },
3385
3421
  e.logger
3386
3422
  );
3387
- return new At(e, t, r);
3423
+ return new Lt(e, t, r);
3388
3424
  }
3389
3425
  }
3390
- function ni(s) {
3426
+ function ii(s) {
3391
3427
  switch (s.type.name) {
3392
3428
  case "BlockPackCustom":
3393
3429
  return s.fields.filter((e) => e.name !== "template");
@@ -3400,7 +3436,7 @@ function ni(s) {
3400
3436
  }
3401
3437
  }
3402
3438
  const as = {
3403
- logger: new Is(),
3439
+ logger: new Fs(),
3404
3440
  blobDriverOps: {
3405
3441
  cacheSoftSizeBytes: 100 * 1024 * 1024,
3406
3442
  // 100MB
@@ -3423,7 +3459,7 @@ function cs(s) {
3423
3459
  blobDownloadPath: H.join(s, "download")
3424
3460
  };
3425
3461
  }
3426
- const ii = {
3462
+ const ai = {
3427
3463
  ...as,
3428
3464
  defaultTreeOptions: {
3429
3465
  pollingInterval: 350,
@@ -3433,18 +3469,18 @@ const ii = {
3433
3469
  projectRefreshInterval: 700,
3434
3470
  stagingRenderingRate: 5
3435
3471
  };
3436
- function ai(s) {
3472
+ function ci(s) {
3437
3473
  return {
3438
3474
  ...cs(s),
3439
3475
  frontendDownloadPath: H.join(s, "frontend")
3440
3476
  };
3441
3477
  }
3442
- function ci(s) {
3478
+ function li(s) {
3443
3479
  return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
3444
3480
  }
3445
3481
  var Et = { exports: {} };
3446
- const li = "2.0.0", ls = 256, ui = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
3447
- 9007199254740991, di = 16, pi = ls - 6, hi = [
3482
+ const ui = "2.0.0", ls = 256, di = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
3483
+ 9007199254740991, pi = 16, hi = ls - 6, fi = [
3448
3484
  "major",
3449
3485
  "premajor",
3450
3486
  "minor",
@@ -3455,17 +3491,17 @@ const li = "2.0.0", ls = 256, ui = Number.MAX_SAFE_INTEGER || /* istanbul ignore
3455
3491
  ];
3456
3492
  var Ye = {
3457
3493
  MAX_LENGTH: ls,
3458
- MAX_SAFE_COMPONENT_LENGTH: di,
3459
- MAX_SAFE_BUILD_LENGTH: pi,
3460
- MAX_SAFE_INTEGER: ui,
3461
- RELEASE_TYPES: hi,
3462
- SEMVER_SPEC_VERSION: li,
3494
+ MAX_SAFE_COMPONENT_LENGTH: pi,
3495
+ MAX_SAFE_BUILD_LENGTH: hi,
3496
+ MAX_SAFE_INTEGER: di,
3497
+ RELEASE_TYPES: fi,
3498
+ SEMVER_SPEC_VERSION: ui,
3463
3499
  FLAG_INCLUDE_PRERELEASE: 1,
3464
3500
  FLAG_LOOSE: 2
3465
3501
  };
3466
- const fi = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...s) => console.error("SEMVER", ...s) : () => {
3502
+ const gi = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...s) => console.error("SEMVER", ...s) : () => {
3467
3503
  };
3468
- var Qe = fi;
3504
+ var Qe = gi;
3469
3505
  (function(s, e) {
3470
3506
  const {
3471
3507
  MAX_SAFE_COMPONENT_LENGTH: t,
@@ -3475,58 +3511,58 @@ var Qe = fi;
3475
3511
  e = s.exports = {};
3476
3512
  const i = e.re = [], c = e.safeRe = [], a = e.src = [], l = e.t = {};
3477
3513
  let u = 0;
3478
- const d = "[a-zA-Z0-9-]", m = [
3514
+ const d = "[a-zA-Z0-9-]", f = [
3479
3515
  ["\\s", 1],
3480
3516
  ["\\d", o],
3481
3517
  [d, r]
3482
- ], h = (I) => {
3483
- for (const [F, D] of m)
3484
- I = I.split(`${F}*`).join(`${F}{0,${D}}`).split(`${F}+`).join(`${F}{1,${D}}`);
3485
- return I;
3486
- }, f = (I, F, D) => {
3487
- const _ = h(F), k = u++;
3488
- n(I, k, F), l[I] = k, a[k] = F, i[k] = new RegExp(F, D ? "g" : void 0), c[k] = new RegExp(_, D ? "g" : void 0);
3518
+ ], h = (E) => {
3519
+ for (const [F, N] of f)
3520
+ E = E.split(`${F}*`).join(`${F}{0,${N}}`).split(`${F}+`).join(`${F}{1,${N}}`);
3521
+ return E;
3522
+ }, g = (E, F, N) => {
3523
+ const _ = h(F), P = u++;
3524
+ n(E, P, F), l[E] = P, a[P] = F, i[P] = new RegExp(F, N ? "g" : void 0), c[P] = new RegExp(_, N ? "g" : void 0);
3489
3525
  };
3490
- f("NUMERICIDENTIFIER", "0|[1-9]\\d*"), f("NUMERICIDENTIFIERLOOSE", "\\d+"), f("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${d}*`), f("MAINVERSION", `(${a[l.NUMERICIDENTIFIER]})\\.(${a[l.NUMERICIDENTIFIER]})\\.(${a[l.NUMERICIDENTIFIER]})`), f("MAINVERSIONLOOSE", `(${a[l.NUMERICIDENTIFIERLOOSE]})\\.(${a[l.NUMERICIDENTIFIERLOOSE]})\\.(${a[l.NUMERICIDENTIFIERLOOSE]})`), f("PRERELEASEIDENTIFIER", `(?:${a[l.NUMERICIDENTIFIER]}|${a[l.NONNUMERICIDENTIFIER]})`), f("PRERELEASEIDENTIFIERLOOSE", `(?:${a[l.NUMERICIDENTIFIERLOOSE]}|${a[l.NONNUMERICIDENTIFIER]})`), f("PRERELEASE", `(?:-(${a[l.PRERELEASEIDENTIFIER]}(?:\\.${a[l.PRERELEASEIDENTIFIER]})*))`), f("PRERELEASELOOSE", `(?:-?(${a[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[l.PRERELEASEIDENTIFIERLOOSE]})*))`), f("BUILDIDENTIFIER", `${d}+`), f("BUILD", `(?:\\+(${a[l.BUILDIDENTIFIER]}(?:\\.${a[l.BUILDIDENTIFIER]})*))`), f("FULLPLAIN", `v?${a[l.MAINVERSION]}${a[l.PRERELEASE]}?${a[l.BUILD]}?`), f("FULL", `^${a[l.FULLPLAIN]}$`), f("LOOSEPLAIN", `[v=\\s]*${a[l.MAINVERSIONLOOSE]}${a[l.PRERELEASELOOSE]}?${a[l.BUILD]}?`), f("LOOSE", `^${a[l.LOOSEPLAIN]}$`), f("GTLT", "((?:<|>)?=?)"), f("XRANGEIDENTIFIERLOOSE", `${a[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), f("XRANGEIDENTIFIER", `${a[l.NUMERICIDENTIFIER]}|x|X|\\*`), f("XRANGEPLAIN", `[v=\\s]*(${a[l.XRANGEIDENTIFIER]})(?:\\.(${a[l.XRANGEIDENTIFIER]})(?:\\.(${a[l.XRANGEIDENTIFIER]})(?:${a[l.PRERELEASE]})?${a[l.BUILD]}?)?)?`), f("XRANGEPLAINLOOSE", `[v=\\s]*(${a[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[l.XRANGEIDENTIFIERLOOSE]})(?:${a[l.PRERELEASELOOSE]})?${a[l.BUILD]}?)?)?`), f("XRANGE", `^${a[l.GTLT]}\\s*${a[l.XRANGEPLAIN]}$`), f("XRANGELOOSE", `^${a[l.GTLT]}\\s*${a[l.XRANGEPLAINLOOSE]}$`), f("COERCEPLAIN", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`), f("COERCE", `${a[l.COERCEPLAIN]}(?:$|[^\\d])`), f("COERCEFULL", a[l.COERCEPLAIN] + `(?:${a[l.PRERELEASE]})?(?:${a[l.BUILD]})?(?:$|[^\\d])`), f("COERCERTL", a[l.COERCE], !0), f("COERCERTLFULL", a[l.COERCEFULL], !0), f("LONETILDE", "(?:~>?)"), f("TILDETRIM", `(\\s*)${a[l.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", f("TILDE", `^${a[l.LONETILDE]}${a[l.XRANGEPLAIN]}$`), f("TILDELOOSE", `^${a[l.LONETILDE]}${a[l.XRANGEPLAINLOOSE]}$`), f("LONECARET", "(?:\\^)"), f("CARETTRIM", `(\\s*)${a[l.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", f("CARET", `^${a[l.LONECARET]}${a[l.XRANGEPLAIN]}$`), f("CARETLOOSE", `^${a[l.LONECARET]}${a[l.XRANGEPLAINLOOSE]}$`), f("COMPARATORLOOSE", `^${a[l.GTLT]}\\s*(${a[l.LOOSEPLAIN]})$|^$`), f("COMPARATOR", `^${a[l.GTLT]}\\s*(${a[l.FULLPLAIN]})$|^$`), f("COMPARATORTRIM", `(\\s*)${a[l.GTLT]}\\s*(${a[l.LOOSEPLAIN]}|${a[l.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", f("HYPHENRANGE", `^\\s*(${a[l.XRANGEPLAIN]})\\s+-\\s+(${a[l.XRANGEPLAIN]})\\s*$`), f("HYPHENRANGELOOSE", `^\\s*(${a[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[l.XRANGEPLAINLOOSE]})\\s*$`), f("STAR", "(<|>)?=?\\s*\\*"), f("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), f("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
3526
+ g("NUMERICIDENTIFIER", "0|[1-9]\\d*"), g("NUMERICIDENTIFIERLOOSE", "\\d+"), g("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${d}*`), g("MAINVERSION", `(${a[l.NUMERICIDENTIFIER]})\\.(${a[l.NUMERICIDENTIFIER]})\\.(${a[l.NUMERICIDENTIFIER]})`), g("MAINVERSIONLOOSE", `(${a[l.NUMERICIDENTIFIERLOOSE]})\\.(${a[l.NUMERICIDENTIFIERLOOSE]})\\.(${a[l.NUMERICIDENTIFIERLOOSE]})`), g("PRERELEASEIDENTIFIER", `(?:${a[l.NUMERICIDENTIFIER]}|${a[l.NONNUMERICIDENTIFIER]})`), g("PRERELEASEIDENTIFIERLOOSE", `(?:${a[l.NUMERICIDENTIFIERLOOSE]}|${a[l.NONNUMERICIDENTIFIER]})`), g("PRERELEASE", `(?:-(${a[l.PRERELEASEIDENTIFIER]}(?:\\.${a[l.PRERELEASEIDENTIFIER]})*))`), g("PRERELEASELOOSE", `(?:-?(${a[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[l.PRERELEASEIDENTIFIERLOOSE]})*))`), g("BUILDIDENTIFIER", `${d}+`), g("BUILD", `(?:\\+(${a[l.BUILDIDENTIFIER]}(?:\\.${a[l.BUILDIDENTIFIER]})*))`), g("FULLPLAIN", `v?${a[l.MAINVERSION]}${a[l.PRERELEASE]}?${a[l.BUILD]}?`), g("FULL", `^${a[l.FULLPLAIN]}$`), g("LOOSEPLAIN", `[v=\\s]*${a[l.MAINVERSIONLOOSE]}${a[l.PRERELEASELOOSE]}?${a[l.BUILD]}?`), g("LOOSE", `^${a[l.LOOSEPLAIN]}$`), g("GTLT", "((?:<|>)?=?)"), g("XRANGEIDENTIFIERLOOSE", `${a[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), g("XRANGEIDENTIFIER", `${a[l.NUMERICIDENTIFIER]}|x|X|\\*`), g("XRANGEPLAIN", `[v=\\s]*(${a[l.XRANGEIDENTIFIER]})(?:\\.(${a[l.XRANGEIDENTIFIER]})(?:\\.(${a[l.XRANGEIDENTIFIER]})(?:${a[l.PRERELEASE]})?${a[l.BUILD]}?)?)?`), g("XRANGEPLAINLOOSE", `[v=\\s]*(${a[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[l.XRANGEIDENTIFIERLOOSE]})(?:${a[l.PRERELEASELOOSE]})?${a[l.BUILD]}?)?)?`), g("XRANGE", `^${a[l.GTLT]}\\s*${a[l.XRANGEPLAIN]}$`), g("XRANGELOOSE", `^${a[l.GTLT]}\\s*${a[l.XRANGEPLAINLOOSE]}$`), g("COERCEPLAIN", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`), g("COERCE", `${a[l.COERCEPLAIN]}(?:$|[^\\d])`), g("COERCEFULL", a[l.COERCEPLAIN] + `(?:${a[l.PRERELEASE]})?(?:${a[l.BUILD]})?(?:$|[^\\d])`), g("COERCERTL", a[l.COERCE], !0), g("COERCERTLFULL", a[l.COERCEFULL], !0), g("LONETILDE", "(?:~>?)"), g("TILDETRIM", `(\\s*)${a[l.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", g("TILDE", `^${a[l.LONETILDE]}${a[l.XRANGEPLAIN]}$`), g("TILDELOOSE", `^${a[l.LONETILDE]}${a[l.XRANGEPLAINLOOSE]}$`), g("LONECARET", "(?:\\^)"), g("CARETTRIM", `(\\s*)${a[l.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", g("CARET", `^${a[l.LONECARET]}${a[l.XRANGEPLAIN]}$`), g("CARETLOOSE", `^${a[l.LONECARET]}${a[l.XRANGEPLAINLOOSE]}$`), g("COMPARATORLOOSE", `^${a[l.GTLT]}\\s*(${a[l.LOOSEPLAIN]})$|^$`), g("COMPARATOR", `^${a[l.GTLT]}\\s*(${a[l.FULLPLAIN]})$|^$`), g("COMPARATORTRIM", `(\\s*)${a[l.GTLT]}\\s*(${a[l.LOOSEPLAIN]}|${a[l.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", g("HYPHENRANGE", `^\\s*(${a[l.XRANGEPLAIN]})\\s+-\\s+(${a[l.XRANGEPLAIN]})\\s*$`), g("HYPHENRANGELOOSE", `^\\s*(${a[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[l.XRANGEPLAINLOOSE]})\\s*$`), g("STAR", "(<|>)?=?\\s*\\*"), g("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), g("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
3491
3527
  })(Et, Et.exports);
3492
3528
  var De = Et.exports;
3493
- const gi = Object.freeze({ loose: !0 }), mi = Object.freeze({}), vi = (s) => s ? typeof s != "object" ? gi : s : mi;
3494
- var Lt = vi;
3495
- const ir = /^[0-9]+$/, us = (s, e) => {
3496
- const t = ir.test(s), r = ir.test(e);
3529
+ const mi = Object.freeze({ loose: !0 }), vi = Object.freeze({}), yi = (s) => s ? typeof s != "object" ? mi : s : vi;
3530
+ var Nt = yi;
3531
+ const ar = /^[0-9]+$/, us = (s, e) => {
3532
+ const t = ar.test(s), r = ar.test(e);
3497
3533
  return t && r && (s = +s, e = +e), s === e ? 0 : t && !r ? -1 : r && !t ? 1 : s < e ? -1 : 1;
3498
- }, yi = (s, e) => us(e, s);
3534
+ }, wi = (s, e) => us(e, s);
3499
3535
  var ds = {
3500
3536
  compareIdentifiers: us,
3501
- rcompareIdentifiers: yi
3537
+ rcompareIdentifiers: wi
3502
3538
  };
3503
- const Ve = Qe, { MAX_LENGTH: ar, MAX_SAFE_INTEGER: Ue } = Ye, { safeRe: cr, t: lr } = De, wi = Lt, { compareIdentifiers: fe } = ds;
3504
- let Si = class Z {
3539
+ const Ue = Qe, { MAX_LENGTH: cr, MAX_SAFE_INTEGER: Je } = Ye, { safeRe: lr, t: ur } = De, Si = Nt, { compareIdentifiers: ge } = ds;
3540
+ let bi = class ee {
3505
3541
  constructor(e, t) {
3506
- if (t = wi(t), e instanceof Z) {
3542
+ if (t = Si(t), e instanceof ee) {
3507
3543
  if (e.loose === !!t.loose && e.includePrerelease === !!t.includePrerelease)
3508
3544
  return e;
3509
3545
  e = e.version;
3510
3546
  } else if (typeof e != "string")
3511
3547
  throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);
3512
- if (e.length > ar)
3548
+ if (e.length > cr)
3513
3549
  throw new TypeError(
3514
- `version is longer than ${ar} characters`
3550
+ `version is longer than ${cr} characters`
3515
3551
  );
3516
- Ve("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
3517
- const r = e.trim().match(t.loose ? cr[lr.LOOSE] : cr[lr.FULL]);
3552
+ Ue("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
3553
+ const r = e.trim().match(t.loose ? lr[ur.LOOSE] : lr[ur.FULL]);
3518
3554
  if (!r)
3519
3555
  throw new TypeError(`Invalid Version: ${e}`);
3520
- if (this.raw = e, this.major = +r[1], this.minor = +r[2], this.patch = +r[3], this.major > Ue || this.major < 0)
3556
+ if (this.raw = e, this.major = +r[1], this.minor = +r[2], this.patch = +r[3], this.major > Je || this.major < 0)
3521
3557
  throw new TypeError("Invalid major version");
3522
- if (this.minor > Ue || this.minor < 0)
3558
+ if (this.minor > Je || this.minor < 0)
3523
3559
  throw new TypeError("Invalid minor version");
3524
- if (this.patch > Ue || this.patch < 0)
3560
+ if (this.patch > Je || this.patch < 0)
3525
3561
  throw new TypeError("Invalid patch version");
3526
3562
  r[4] ? this.prerelease = r[4].split(".").map((o) => {
3527
3563
  if (/^[0-9]+$/.test(o)) {
3528
3564
  const n = +o;
3529
- if (n >= 0 && n < Ue)
3565
+ if (n >= 0 && n < Je)
3530
3566
  return n;
3531
3567
  }
3532
3568
  return o;
@@ -3539,18 +3575,18 @@ let Si = class Z {
3539
3575
  return this.version;
3540
3576
  }
3541
3577
  compare(e) {
3542
- if (Ve("SemVer.compare", this.version, this.options, e), !(e instanceof Z)) {
3578
+ if (Ue("SemVer.compare", this.version, this.options, e), !(e instanceof ee)) {
3543
3579
  if (typeof e == "string" && e === this.version)
3544
3580
  return 0;
3545
- e = new Z(e, this.options);
3581
+ e = new ee(e, this.options);
3546
3582
  }
3547
3583
  return e.version === this.version ? 0 : this.compareMain(e) || this.comparePre(e);
3548
3584
  }
3549
3585
  compareMain(e) {
3550
- return e instanceof Z || (e = new Z(e, this.options)), fe(this.major, e.major) || fe(this.minor, e.minor) || fe(this.patch, e.patch);
3586
+ return e instanceof ee || (e = new ee(e, this.options)), ge(this.major, e.major) || ge(this.minor, e.minor) || ge(this.patch, e.patch);
3551
3587
  }
3552
3588
  comparePre(e) {
3553
- if (e instanceof Z || (e = new Z(e, this.options)), this.prerelease.length && !e.prerelease.length)
3589
+ if (e instanceof ee || (e = new ee(e, this.options)), this.prerelease.length && !e.prerelease.length)
3554
3590
  return -1;
3555
3591
  if (!this.prerelease.length && e.prerelease.length)
3556
3592
  return 1;
@@ -3559,7 +3595,7 @@ let Si = class Z {
3559
3595
  let t = 0;
3560
3596
  do {
3561
3597
  const r = this.prerelease[t], o = e.prerelease[t];
3562
- if (Ve("prerelease compare", t, r, o), r === void 0 && o === void 0)
3598
+ if (Ue("prerelease compare", t, r, o), r === void 0 && o === void 0)
3563
3599
  return 0;
3564
3600
  if (o === void 0)
3565
3601
  return 1;
@@ -3567,15 +3603,15 @@ let Si = class Z {
3567
3603
  return -1;
3568
3604
  if (r === o)
3569
3605
  continue;
3570
- return fe(r, o);
3606
+ return ge(r, o);
3571
3607
  } while (++t);
3572
3608
  }
3573
3609
  compareBuild(e) {
3574
- e instanceof Z || (e = new Z(e, this.options));
3610
+ e instanceof ee || (e = new ee(e, this.options));
3575
3611
  let t = 0;
3576
3612
  do {
3577
3613
  const r = this.build[t], o = e.build[t];
3578
- if (Ve("build compare", t, r, o), r === void 0 && o === void 0)
3614
+ if (Ue("build compare", t, r, o), r === void 0 && o === void 0)
3579
3615
  return 0;
3580
3616
  if (o === void 0)
3581
3617
  return 1;
@@ -3583,7 +3619,7 @@ let Si = class Z {
3583
3619
  return -1;
3584
3620
  if (r === o)
3585
3621
  continue;
3586
- return fe(r, o);
3622
+ return ge(r, o);
3587
3623
  } while (++t);
3588
3624
  }
3589
3625
  // preminor will bump the version up to the next minor release, and immediately
@@ -3629,7 +3665,7 @@ let Si = class Z {
3629
3665
  }
3630
3666
  if (t) {
3631
3667
  let n = [t, o];
3632
- r === !1 && (n = [t]), fe(this.prerelease[0], t) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = n) : this.prerelease = n;
3668
+ r === !1 && (n = [t]), ge(this.prerelease[0], t) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = n) : this.prerelease = n;
3633
3669
  }
3634
3670
  break;
3635
3671
  }
@@ -3639,43 +3675,43 @@ let Si = class Z {
3639
3675
  return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
3640
3676
  }
3641
3677
  };
3642
- var M = Si;
3643
- const ur = M, bi = (s, e, t = !1) => {
3644
- if (s instanceof ur)
3678
+ var M = bi;
3679
+ const dr = M, Ci = (s, e, t = !1) => {
3680
+ if (s instanceof dr)
3645
3681
  return s;
3646
3682
  try {
3647
- return new ur(s, e);
3683
+ return new dr(s, e);
3648
3684
  } catch (r) {
3649
3685
  if (!t)
3650
3686
  return null;
3651
3687
  throw r;
3652
3688
  }
3653
3689
  };
3654
- var we = bi;
3655
- const Ri = we, Ei = (s, e) => {
3690
+ var Se = Ci;
3691
+ const Ri = Se, Ei = (s, e) => {
3656
3692
  const t = Ri(s, e);
3657
3693
  return t ? t.version : null;
3658
3694
  };
3659
- var Ci = Ei;
3660
- const ki = we, Pi = (s, e) => {
3661
- const t = ki(s.trim().replace(/^[=v]+/, ""), e);
3695
+ var ki = Ei;
3696
+ const Pi = Se, Oi = (s, e) => {
3697
+ const t = Pi(s.trim().replace(/^[=v]+/, ""), e);
3662
3698
  return t ? t.version : null;
3663
3699
  };
3664
- var Oi = Pi;
3665
- const dr = M, $i = (s, e, t, r, o) => {
3700
+ var $i = Oi;
3701
+ const pr = M, Ii = (s, e, t, r, o) => {
3666
3702
  typeof t == "string" && (o = r, r = t, t = void 0);
3667
3703
  try {
3668
- return new dr(
3669
- s instanceof dr ? s.version : s,
3704
+ return new pr(
3705
+ s instanceof pr ? s.version : s,
3670
3706
  t
3671
3707
  ).inc(e, r, o).version;
3672
3708
  } catch {
3673
3709
  return null;
3674
3710
  }
3675
3711
  };
3676
- var Ii = $i;
3677
- const pr = we, Fi = (s, e) => {
3678
- const t = pr(s, null, !0), r = pr(e, null, !0), o = t.compare(r);
3712
+ var Fi = Ii;
3713
+ const hr = Se, Ti = (s, e) => {
3714
+ const t = hr(s, null, !0), r = hr(e, null, !0), o = t.compare(r);
3679
3715
  if (o === 0)
3680
3716
  return null;
3681
3717
  const n = o > 0, i = n ? t : r, c = n ? r : t, a = !!i.prerelease.length;
@@ -3684,46 +3720,46 @@ const pr = we, Fi = (s, e) => {
3684
3720
  const u = a ? "pre" : "";
3685
3721
  return t.major !== r.major ? u + "major" : t.minor !== r.minor ? u + "minor" : t.patch !== r.patch ? u + "patch" : "prerelease";
3686
3722
  };
3687
- var Ti = Fi;
3688
- const Ai = M, Li = (s, e) => new Ai(s, e).major;
3689
- var Ni = Li;
3690
- const Di = M, Bi = (s, e) => new Di(s, e).minor;
3691
- var ji = Bi;
3692
- const xi = M, Vi = (s, e) => new xi(s, e).patch;
3693
- var Ui = Vi;
3694
- const Ji = we, Gi = (s, e) => {
3695
- const t = Ji(s, e);
3723
+ var Ai = Ti;
3724
+ const Li = M, Ni = (s, e) => new Li(s, e).major;
3725
+ var Di = Ni;
3726
+ const Bi = M, ji = (s, e) => new Bi(s, e).minor;
3727
+ var xi = ji;
3728
+ const Vi = M, Ui = (s, e) => new Vi(s, e).patch;
3729
+ var Ji = Ui;
3730
+ const Gi = Se, Mi = (s, e) => {
3731
+ const t = Gi(s, e);
3696
3732
  return t && t.prerelease.length ? t.prerelease : null;
3697
3733
  };
3698
- var Mi = Gi;
3699
- const hr = M, _i = (s, e, t) => new hr(s, t).compare(new hr(e, t));
3700
- var Y = _i;
3701
- const Ki = Y, Hi = (s, e, t) => Ki(e, s, t);
3702
- var Wi = Hi;
3703
- const zi = Y, Xi = (s, e) => zi(s, e, !0);
3704
- var qi = Xi;
3705
- const fr = M, Yi = (s, e, t) => {
3706
- const r = new fr(s, t), o = new fr(e, t);
3734
+ var _i = Mi;
3735
+ const fr = M, Ki = (s, e, t) => new fr(s, t).compare(new fr(e, t));
3736
+ var Q = Ki;
3737
+ const Hi = Q, Wi = (s, e, t) => Hi(e, s, t);
3738
+ var qi = Wi;
3739
+ const Xi = Q, zi = (s, e) => Xi(s, e, !0);
3740
+ var Yi = zi;
3741
+ const gr = M, Qi = (s, e, t) => {
3742
+ const r = new gr(s, t), o = new gr(e, t);
3707
3743
  return r.compare(o) || r.compareBuild(o);
3708
3744
  };
3709
- var Nt = Yi;
3710
- const Qi = Nt, Zi = (s, e) => s.sort((t, r) => Qi(t, r, e));
3711
- var ea = Zi;
3712
- const ta = Nt, ra = (s, e) => s.sort((t, r) => ta(r, t, e));
3713
- var sa = ra;
3714
- const oa = Y, na = (s, e, t) => oa(s, e, t) > 0;
3715
- var Ze = na;
3716
- const ia = Y, aa = (s, e, t) => ia(s, e, t) < 0;
3717
- var Dt = aa;
3718
- const ca = Y, la = (s, e, t) => ca(s, e, t) === 0;
3719
- var ps = la;
3720
- const ua = Y, da = (s, e, t) => ua(s, e, t) !== 0;
3721
- var hs = da;
3722
- const pa = Y, ha = (s, e, t) => pa(s, e, t) >= 0;
3723
- var Bt = ha;
3724
- const fa = Y, ga = (s, e, t) => fa(s, e, t) <= 0;
3725
- var jt = ga;
3726
- const ma = ps, va = hs, ya = Ze, wa = Bt, Sa = Dt, ba = jt, Ra = (s, e, t, r) => {
3745
+ var Dt = Qi;
3746
+ const Zi = Dt, ea = (s, e) => s.sort((t, r) => Zi(t, r, e));
3747
+ var ta = ea;
3748
+ const ra = Dt, sa = (s, e) => s.sort((t, r) => ra(r, t, e));
3749
+ var oa = sa;
3750
+ const na = Q, ia = (s, e, t) => na(s, e, t) > 0;
3751
+ var Ze = ia;
3752
+ const aa = Q, ca = (s, e, t) => aa(s, e, t) < 0;
3753
+ var Bt = ca;
3754
+ const la = Q, ua = (s, e, t) => la(s, e, t) === 0;
3755
+ var ps = ua;
3756
+ const da = Q, pa = (s, e, t) => da(s, e, t) !== 0;
3757
+ var hs = pa;
3758
+ const ha = Q, fa = (s, e, t) => ha(s, e, t) >= 0;
3759
+ var jt = fa;
3760
+ const ga = Q, ma = (s, e, t) => ga(s, e, t) <= 0;
3761
+ var xt = ma;
3762
+ const va = ps, ya = hs, wa = Ze, Sa = jt, ba = Bt, Ca = xt, Ra = (s, e, t, r) => {
3727
3763
  switch (e) {
3728
3764
  case "===":
3729
3765
  return typeof s == "object" && (s = s.version), typeof t == "object" && (t = t.version), s === t;
@@ -3732,23 +3768,23 @@ const ma = ps, va = hs, ya = Ze, wa = Bt, Sa = Dt, ba = jt, Ra = (s, e, t, r) =>
3732
3768
  case "":
3733
3769
  case "=":
3734
3770
  case "==":
3735
- return ma(s, t, r);
3736
- case "!=":
3737
3771
  return va(s, t, r);
3738
- case ">":
3772
+ case "!=":
3739
3773
  return ya(s, t, r);
3740
- case ">=":
3774
+ case ">":
3741
3775
  return wa(s, t, r);
3742
- case "<":
3776
+ case ">=":
3743
3777
  return Sa(s, t, r);
3744
- case "<=":
3778
+ case "<":
3745
3779
  return ba(s, t, r);
3780
+ case "<=":
3781
+ return Ca(s, t, r);
3746
3782
  default:
3747
3783
  throw new TypeError(`Invalid operator: ${e}`);
3748
3784
  }
3749
3785
  };
3750
3786
  var fs = Ra;
3751
- const Ea = M, Ca = we, { safeRe: Je, t: Ge } = De, ka = (s, e) => {
3787
+ const Ea = M, ka = Se, { safeRe: Ge, t: Me } = De, Pa = (s, e) => {
3752
3788
  if (s instanceof Ea)
3753
3789
  return s;
3754
3790
  if (typeof s == "number" && (s = String(s)), typeof s != "string")
@@ -3756,9 +3792,9 @@ const Ea = M, Ca = we, { safeRe: Je, t: Ge } = De, ka = (s, e) => {
3756
3792
  e = e || {};
3757
3793
  let t = null;
3758
3794
  if (!e.rtl)
3759
- t = s.match(e.includePrerelease ? Je[Ge.COERCEFULL] : Je[Ge.COERCE]);
3795
+ t = s.match(e.includePrerelease ? Ge[Me.COERCEFULL] : Ge[Me.COERCE]);
3760
3796
  else {
3761
- const a = e.includePrerelease ? Je[Ge.COERCERTLFULL] : Je[Ge.COERCERTL];
3797
+ const a = e.includePrerelease ? Ge[Me.COERCERTLFULL] : Ge[Me.COERCERTL];
3762
3798
  let l;
3763
3799
  for (; (l = a.exec(s)) && (!t || t.index + t[0].length !== s.length); )
3764
3800
  (!t || l.index + l[0].length !== t.index + t[0].length) && (t = l), a.lastIndex = l.index + l[1].length + l[2].length;
@@ -3767,10 +3803,10 @@ const Ea = M, Ca = we, { safeRe: Je, t: Ge } = De, ka = (s, e) => {
3767
3803
  if (t === null)
3768
3804
  return null;
3769
3805
  const r = t[2], o = t[3] || "0", n = t[4] || "0", i = e.includePrerelease && t[5] ? `-${t[5]}` : "", c = e.includePrerelease && t[6] ? `+${t[6]}` : "";
3770
- return Ca(`${r}.${o}.${n}${i}${c}`, e);
3806
+ return ka(`${r}.${o}.${n}${i}${c}`, e);
3771
3807
  };
3772
- var Pa = ka;
3773
- class Oa {
3808
+ var Oa = Pa;
3809
+ class $a {
3774
3810
  constructor() {
3775
3811
  this.max = 1e3, this.map = /* @__PURE__ */ new Map();
3776
3812
  }
@@ -3793,10 +3829,10 @@ class Oa {
3793
3829
  return this;
3794
3830
  }
3795
3831
  }
3796
- var $a = Oa, it, gr;
3797
- function Q() {
3798
- if (gr) return it;
3799
- gr = 1;
3832
+ var Ia = $a, at, mr;
3833
+ function Z() {
3834
+ if (mr) return at;
3835
+ mr = 1;
3800
3836
  const s = /\s+/g;
3801
3837
  class e {
3802
3838
  constructor(p, y) {
@@ -3804,12 +3840,12 @@ function Q() {
3804
3840
  return p.loose === !!y.loose && p.includePrerelease === !!y.includePrerelease ? p : new e(p.raw, y);
3805
3841
  if (p instanceof n)
3806
3842
  return this.raw = p.value, this.set = [[p]], this.formatted = void 0, this;
3807
- if (this.options = y, this.loose = !!y.loose, this.includePrerelease = !!y.includePrerelease, this.raw = p.trim().replace(s, " "), this.set = this.raw.split("||").map((g) => this.parseRange(g.trim())).filter((g) => g.length), !this.set.length)
3843
+ if (this.options = y, this.loose = !!y.loose, this.includePrerelease = !!y.includePrerelease, this.raw = p.trim().replace(s, " "), this.set = this.raw.split("||").map((m) => this.parseRange(m.trim())).filter((m) => m.length), !this.set.length)
3808
3844
  throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
3809
3845
  if (this.set.length > 1) {
3810
- const g = this.set[0];
3811
- if (this.set = this.set.filter((b) => !I(b[0])), this.set.length === 0)
3812
- this.set = [g];
3846
+ const m = this.set[0];
3847
+ if (this.set = this.set.filter((b) => !E(b[0])), this.set.length === 0)
3848
+ this.set = [m];
3813
3849
  else if (this.set.length > 1) {
3814
3850
  for (const b of this.set)
3815
3851
  if (b.length === 1 && F(b[0])) {
@@ -3826,8 +3862,8 @@ function Q() {
3826
3862
  for (let p = 0; p < this.set.length; p++) {
3827
3863
  p > 0 && (this.formatted += "||");
3828
3864
  const y = this.set[p];
3829
- for (let g = 0; g < y.length; g++)
3830
- g > 0 && (this.formatted += " "), this.formatted += y[g].toString().trim();
3865
+ for (let m = 0; m < y.length; m++)
3866
+ m > 0 && (this.formatted += " "), this.formatted += y[m].toString().trim();
3831
3867
  }
3832
3868
  }
3833
3869
  return this.formatted;
@@ -3839,27 +3875,27 @@ function Q() {
3839
3875
  return this.range;
3840
3876
  }
3841
3877
  parseRange(p) {
3842
- const g = ((this.options.includePrerelease && h) | (this.options.loose && f)) + ":" + p, b = r.get(g);
3878
+ const m = ((this.options.includePrerelease && h) | (this.options.loose && g)) + ":" + p, b = r.get(m);
3843
3879
  if (b)
3844
3880
  return b;
3845
- const w = this.options.loose, R = w ? a[l.HYPHENRANGELOOSE] : a[l.HYPHENRANGE];
3846
- p = p.replace(R, X(this.options.includePrerelease)), i("hyphen replace", p), p = p.replace(a[l.COMPARATORTRIM], u), i("comparator trim", p), p = p.replace(a[l.TILDETRIM], d), i("tilde trim", p), p = p.replace(a[l.CARETTRIM], m), i("caret trim", p);
3847
- let P = p.split(" ").map((N) => _(N, this.options)).join(" ").split(/\s+/).map((N) => x(N, this.options));
3848
- w && (P = P.filter((N) => (i("loose invalid filter", N, this.options), !!N.match(a[l.COMPARATORLOOSE])))), i("range list", P);
3849
- const E = /* @__PURE__ */ new Map(), $ = P.map((N) => new n(N, this.options));
3850
- for (const N of $) {
3851
- if (I(N))
3852
- return [N];
3853
- E.set(N.value, N);
3881
+ const w = this.options.loose, C = w ? a[l.HYPHENRANGELOOSE] : a[l.HYPHENRANGE];
3882
+ p = p.replace(C, X(this.options.includePrerelease)), i("hyphen replace", p), p = p.replace(a[l.COMPARATORTRIM], u), i("comparator trim", p), p = p.replace(a[l.TILDETRIM], d), i("tilde trim", p), p = p.replace(a[l.CARETTRIM], f), i("caret trim", p);
3883
+ let O = p.split(" ").map((I) => _(I, this.options)).join(" ").split(/\s+/).map((I) => x(I, this.options));
3884
+ w && (O = O.filter((I) => (i("loose invalid filter", I, this.options), !!I.match(a[l.COMPARATORLOOSE])))), i("range list", O);
3885
+ const R = /* @__PURE__ */ new Map(), T = O.map((I) => new n(I, this.options));
3886
+ for (const I of T) {
3887
+ if (E(I))
3888
+ return [I];
3889
+ R.set(I.value, I);
3854
3890
  }
3855
- E.size > 1 && E.has("") && E.delete("");
3856
- const L = [...E.values()];
3857
- return r.set(g, L), L;
3891
+ R.size > 1 && R.has("") && R.delete("");
3892
+ const D = [...R.values()];
3893
+ return r.set(m, D), D;
3858
3894
  }
3859
3895
  intersects(p, y) {
3860
3896
  if (!(p instanceof e))
3861
3897
  throw new TypeError("a Range is required");
3862
- return this.set.some((g) => D(g, y) && p.set.some((b) => D(b, y) && g.every((w) => b.every((R) => w.intersects(R, y)))));
3898
+ return this.set.some((m) => N(m, y) && p.set.some((b) => N(b, y) && m.every((w) => b.every((C) => w.intersects(C, y)))));
3863
3899
  }
3864
3900
  // if ANY of the sets match ALL of its comparators, then pass
3865
3901
  test(p) {
@@ -3877,51 +3913,51 @@ function Q() {
3877
3913
  return !1;
3878
3914
  }
3879
3915
  }
3880
- it = e;
3881
- const t = $a, r = new t(), o = Lt, n = et(), i = Qe, c = M, {
3916
+ at = e;
3917
+ const t = Ia, r = new t(), o = Nt, n = et(), i = Qe, c = M, {
3882
3918
  safeRe: a,
3883
3919
  t: l,
3884
3920
  comparatorTrimReplace: u,
3885
3921
  tildeTrimReplace: d,
3886
- caretTrimReplace: m
3887
- } = De, { FLAG_INCLUDE_PRERELEASE: h, FLAG_LOOSE: f } = Ye, I = (v) => v.value === "<0.0.0-0", F = (v) => v.value === "", D = (v, p) => {
3922
+ caretTrimReplace: f
3923
+ } = De, { FLAG_INCLUDE_PRERELEASE: h, FLAG_LOOSE: g } = Ye, E = (v) => v.value === "<0.0.0-0", F = (v) => v.value === "", N = (v, p) => {
3888
3924
  let y = !0;
3889
- const g = v.slice();
3890
- let b = g.pop();
3891
- for (; y && g.length; )
3892
- y = g.every((w) => b.intersects(w, p)), b = g.pop();
3925
+ const m = v.slice();
3926
+ let b = m.pop();
3927
+ for (; y && m.length; )
3928
+ y = m.every((w) => b.intersects(w, p)), b = m.pop();
3893
3929
  return y;
3894
- }, _ = (v, p) => (i("comp", v, p), v = A(v, p), i("caret", v), v = se(v, p), i("tildes", v), v = oe(v, p), i("xrange", v), v = G(v, p), i("stars", v), v), k = (v) => !v || v.toLowerCase() === "x" || v === "*", se = (v, p) => v.trim().split(/\s+/).map((y) => pe(y, p)).join(" "), pe = (v, p) => {
3930
+ }, _ = (v, p) => (i("comp", v, p), v = A(v, p), i("caret", v), v = se(v, p), i("tildes", v), v = oe(v, p), i("xrange", v), v = J(v, p), i("stars", v), v), P = (v) => !v || v.toLowerCase() === "x" || v === "*", se = (v, p) => v.trim().split(/\s+/).map((y) => pe(y, p)).join(" "), pe = (v, p) => {
3895
3931
  const y = p.loose ? a[l.TILDELOOSE] : a[l.TILDE];
3896
- return v.replace(y, (g, b, w, R, P) => {
3897
- i("tilde", v, g, b, w, R, P);
3898
- let E;
3899
- return k(b) ? E = "" : k(w) ? E = `>=${b}.0.0 <${+b + 1}.0.0-0` : k(R) ? E = `>=${b}.${w}.0 <${b}.${+w + 1}.0-0` : P ? (i("replaceTilde pr", P), E = `>=${b}.${w}.${R}-${P} <${b}.${+w + 1}.0-0`) : E = `>=${b}.${w}.${R} <${b}.${+w + 1}.0-0`, i("tilde return", E), E;
3932
+ return v.replace(y, (m, b, w, C, O) => {
3933
+ i("tilde", v, m, b, w, C, O);
3934
+ let R;
3935
+ return P(b) ? R = "" : P(w) ? R = `>=${b}.0.0 <${+b + 1}.0.0-0` : P(C) ? R = `>=${b}.${w}.0 <${b}.${+w + 1}.0-0` : O ? (i("replaceTilde pr", O), R = `>=${b}.${w}.${C}-${O} <${b}.${+w + 1}.0-0`) : R = `>=${b}.${w}.${C} <${b}.${+w + 1}.0-0`, i("tilde return", R), R;
3900
3936
  });
3901
- }, A = (v, p) => v.trim().split(/\s+/).map((y) => z(y, p)).join(" "), z = (v, p) => {
3937
+ }, A = (v, p) => v.trim().split(/\s+/).map((y) => q(y, p)).join(" "), q = (v, p) => {
3902
3938
  i("caret", v, p);
3903
- const y = p.loose ? a[l.CARETLOOSE] : a[l.CARET], g = p.includePrerelease ? "-0" : "";
3904
- return v.replace(y, (b, w, R, P, E) => {
3905
- i("caret", v, b, w, R, P, E);
3906
- let $;
3907
- return k(w) ? $ = "" : k(R) ? $ = `>=${w}.0.0${g} <${+w + 1}.0.0-0` : k(P) ? w === "0" ? $ = `>=${w}.${R}.0${g} <${w}.${+R + 1}.0-0` : $ = `>=${w}.${R}.0${g} <${+w + 1}.0.0-0` : E ? (i("replaceCaret pr", E), w === "0" ? R === "0" ? $ = `>=${w}.${R}.${P}-${E} <${w}.${R}.${+P + 1}-0` : $ = `>=${w}.${R}.${P}-${E} <${w}.${+R + 1}.0-0` : $ = `>=${w}.${R}.${P}-${E} <${+w + 1}.0.0-0`) : (i("no pr"), w === "0" ? R === "0" ? $ = `>=${w}.${R}.${P}${g} <${w}.${R}.${+P + 1}-0` : $ = `>=${w}.${R}.${P}${g} <${w}.${+R + 1}.0-0` : $ = `>=${w}.${R}.${P} <${+w + 1}.0.0-0`), i("caret return", $), $;
3939
+ const y = p.loose ? a[l.CARETLOOSE] : a[l.CARET], m = p.includePrerelease ? "-0" : "";
3940
+ return v.replace(y, (b, w, C, O, R) => {
3941
+ i("caret", v, b, w, C, O, R);
3942
+ let T;
3943
+ return P(w) ? T = "" : P(C) ? T = `>=${w}.0.0${m} <${+w + 1}.0.0-0` : P(O) ? w === "0" ? T = `>=${w}.${C}.0${m} <${w}.${+C + 1}.0-0` : T = `>=${w}.${C}.0${m} <${+w + 1}.0.0-0` : R ? (i("replaceCaret pr", R), w === "0" ? C === "0" ? T = `>=${w}.${C}.${O}-${R} <${w}.${C}.${+O + 1}-0` : T = `>=${w}.${C}.${O}-${R} <${w}.${+C + 1}.0-0` : T = `>=${w}.${C}.${O}-${R} <${+w + 1}.0.0-0`) : (i("no pr"), w === "0" ? C === "0" ? T = `>=${w}.${C}.${O}${m} <${w}.${C}.${+O + 1}-0` : T = `>=${w}.${C}.${O}${m} <${w}.${+C + 1}.0-0` : T = `>=${w}.${C}.${O} <${+w + 1}.0.0-0`), i("caret return", T), T;
3908
3944
  });
3909
3945
  }, oe = (v, p) => (i("replaceXRanges", v, p), v.split(/\s+/).map((y) => K(y, p)).join(" ")), K = (v, p) => {
3910
3946
  v = v.trim();
3911
3947
  const y = p.loose ? a[l.XRANGELOOSE] : a[l.XRANGE];
3912
- return v.replace(y, (g, b, w, R, P, E) => {
3913
- i("xRange", v, g, b, w, R, P, E);
3914
- const $ = k(w), L = $ || k(R), N = L || k(P), re = N;
3915
- return b === "=" && re && (b = ""), E = p.includePrerelease ? "-0" : "", $ ? b === ">" || b === "<" ? g = "<0.0.0-0" : g = "*" : b && re ? (L && (R = 0), P = 0, b === ">" ? (b = ">=", L ? (w = +w + 1, R = 0, P = 0) : (R = +R + 1, P = 0)) : b === "<=" && (b = "<", L ? w = +w + 1 : R = +R + 1), b === "<" && (E = "-0"), g = `${b + w}.${R}.${P}${E}`) : L ? g = `>=${w}.0.0${E} <${+w + 1}.0.0-0` : N && (g = `>=${w}.${R}.0${E} <${w}.${+R + 1}.0-0`), i("xRange return", g), g;
3948
+ return v.replace(y, (m, b, w, C, O, R) => {
3949
+ i("xRange", v, m, b, w, C, O, R);
3950
+ const T = P(w), D = T || P(C), I = D || P(O), fe = I;
3951
+ return b === "=" && fe && (b = ""), R = p.includePrerelease ? "-0" : "", T ? b === ">" || b === "<" ? m = "<0.0.0-0" : m = "*" : b && fe ? (D && (C = 0), O = 0, b === ">" ? (b = ">=", D ? (w = +w + 1, C = 0, O = 0) : (C = +C + 1, O = 0)) : b === "<=" && (b = "<", D ? w = +w + 1 : C = +C + 1), b === "<" && (R = "-0"), m = `${b + w}.${C}.${O}${R}`) : D ? m = `>=${w}.0.0${R} <${+w + 1}.0.0-0` : I && (m = `>=${w}.${C}.0${R} <${w}.${+C + 1}.0-0`), i("xRange return", m), m;
3916
3952
  });
3917
- }, G = (v, p) => (i("replaceStars", v, p), v.trim().replace(a[l.STAR], "")), x = (v, p) => (i("replaceGTE0", v, p), v.trim().replace(a[p.includePrerelease ? l.GTE0PRE : l.GTE0], "")), X = (v) => (p, y, g, b, w, R, P, E, $, L, N, re) => (k(g) ? y = "" : k(b) ? y = `>=${g}.0.0${v ? "-0" : ""}` : k(w) ? y = `>=${g}.${b}.0${v ? "-0" : ""}` : R ? y = `>=${y}` : y = `>=${y}${v ? "-0" : ""}`, k($) ? E = "" : k(L) ? E = `<${+$ + 1}.0.0-0` : k(N) ? E = `<${$}.${+L + 1}.0-0` : re ? E = `<=${$}.${L}.${N}-${re}` : v ? E = `<${$}.${L}.${+N + 1}-0` : E = `<=${E}`, `${y} ${E}`.trim()), he = (v, p, y) => {
3918
- for (let g = 0; g < v.length; g++)
3919
- if (!v[g].test(p))
3953
+ }, J = (v, p) => (i("replaceStars", v, p), v.trim().replace(a[l.STAR], "")), x = (v, p) => (i("replaceGTE0", v, p), v.trim().replace(a[p.includePrerelease ? l.GTE0PRE : l.GTE0], "")), X = (v) => (p, y, m, b, w, C, O, R, T, D, I, fe) => (P(m) ? y = "" : P(b) ? y = `>=${m}.0.0${v ? "-0" : ""}` : P(w) ? y = `>=${m}.${b}.0${v ? "-0" : ""}` : C ? y = `>=${y}` : y = `>=${y}${v ? "-0" : ""}`, P(T) ? R = "" : P(D) ? R = `<${+T + 1}.0.0-0` : P(I) ? R = `<${T}.${+D + 1}.0-0` : fe ? R = `<=${T}.${D}.${I}-${fe}` : v ? R = `<${T}.${D}.${+I + 1}-0` : R = `<=${R}`, `${y} ${R}`.trim()), he = (v, p, y) => {
3954
+ for (let m = 0; m < v.length; m++)
3955
+ if (!v[m].test(p))
3920
3956
  return !1;
3921
3957
  if (p.prerelease.length && !y.includePrerelease) {
3922
- for (let g = 0; g < v.length; g++)
3923
- if (i(v[g].semver), v[g].semver !== n.ANY && v[g].semver.prerelease.length > 0) {
3924
- const b = v[g].semver;
3958
+ for (let m = 0; m < v.length; m++)
3959
+ if (i(v[m].semver), v[m].semver !== n.ANY && v[m].semver.prerelease.length > 0) {
3960
+ const b = v[m].semver;
3925
3961
  if (b.major === p.major && b.minor === p.minor && b.patch === p.patch)
3926
3962
  return !0;
3927
3963
  }
@@ -3929,12 +3965,12 @@ function Q() {
3929
3965
  }
3930
3966
  return !0;
3931
3967
  };
3932
- return it;
3968
+ return at;
3933
3969
  }
3934
- var at, mr;
3970
+ var ct, vr;
3935
3971
  function et() {
3936
- if (mr) return at;
3937
- mr = 1;
3972
+ if (vr) return ct;
3973
+ vr = 1;
3938
3974
  const s = Symbol("SemVer ANY");
3939
3975
  class e {
3940
3976
  static get ANY() {
@@ -3949,10 +3985,10 @@ function et() {
3949
3985
  u = u.trim().split(/\s+/).join(" "), i("comparator", u, d), this.options = d, this.loose = !!d.loose, this.parse(u), this.semver === s ? this.value = "" : this.value = this.operator + this.semver.version, i("comp", this);
3950
3986
  }
3951
3987
  parse(u) {
3952
- const d = this.options.loose ? r[o.COMPARATORLOOSE] : r[o.COMPARATOR], m = u.match(d);
3953
- if (!m)
3988
+ const d = this.options.loose ? r[o.COMPARATORLOOSE] : r[o.COMPARATOR], f = u.match(d);
3989
+ if (!f)
3954
3990
  throw new TypeError(`Invalid comparator: ${u}`);
3955
- this.operator = m[1] !== void 0 ? m[1] : "", this.operator === "=" && (this.operator = ""), m[2] ? this.semver = new c(m[2], this.options.loose) : this.semver = s;
3991
+ this.operator = f[1] !== void 0 ? f[1] : "", this.operator === "=" && (this.operator = ""), f[2] ? this.semver = new c(f[2], this.options.loose) : this.semver = s;
3956
3992
  }
3957
3993
  toString() {
3958
3994
  return this.value;
@@ -3974,62 +4010,62 @@ function et() {
3974
4010
  return this.operator === "" ? this.value === "" ? !0 : new a(u.value, d).test(this.value) : u.operator === "" ? u.value === "" ? !0 : new a(this.value, d).test(u.semver) : (d = t(d), d.includePrerelease && (this.value === "<0.0.0-0" || u.value === "<0.0.0-0") || !d.includePrerelease && (this.value.startsWith("<0.0.0") || u.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && u.operator.startsWith(">") || this.operator.startsWith("<") && u.operator.startsWith("<") || this.semver.version === u.semver.version && this.operator.includes("=") && u.operator.includes("=") || n(this.semver, "<", u.semver, d) && this.operator.startsWith(">") && u.operator.startsWith("<") || n(this.semver, ">", u.semver, d) && this.operator.startsWith("<") && u.operator.startsWith(">")));
3975
4011
  }
3976
4012
  }
3977
- at = e;
3978
- const t = Lt, { safeRe: r, t: o } = De, n = fs, i = Qe, c = M, a = Q();
3979
- return at;
4013
+ ct = e;
4014
+ const t = Nt, { safeRe: r, t: o } = De, n = fs, i = Qe, c = M, a = Z();
4015
+ return ct;
3980
4016
  }
3981
- const Ia = Q(), Fa = (s, e, t) => {
4017
+ const Fa = Z(), Ta = (s, e, t) => {
3982
4018
  try {
3983
- e = new Ia(e, t);
4019
+ e = new Fa(e, t);
3984
4020
  } catch {
3985
4021
  return !1;
3986
4022
  }
3987
4023
  return e.test(s);
3988
4024
  };
3989
- var tt = Fa;
3990
- const Ta = Q(), Aa = (s, e) => new Ta(s, e).set.map((t) => t.map((r) => r.value).join(" ").trim().split(" "));
3991
- var La = Aa;
3992
- const Na = M, Da = Q(), Ba = (s, e, t) => {
4025
+ var tt = Ta;
4026
+ const Aa = Z(), La = (s, e) => new Aa(s, e).set.map((t) => t.map((r) => r.value).join(" ").trim().split(" "));
4027
+ var Na = La;
4028
+ const Da = M, Ba = Z(), ja = (s, e, t) => {
3993
4029
  let r = null, o = null, n = null;
3994
4030
  try {
3995
- n = new Da(e, t);
4031
+ n = new Ba(e, t);
3996
4032
  } catch {
3997
4033
  return null;
3998
4034
  }
3999
4035
  return s.forEach((i) => {
4000
- n.test(i) && (!r || o.compare(i) === -1) && (r = i, o = new Na(r, t));
4036
+ n.test(i) && (!r || o.compare(i) === -1) && (r = i, o = new Da(r, t));
4001
4037
  }), r;
4002
4038
  };
4003
- var ja = Ba;
4004
- const xa = M, Va = Q(), Ua = (s, e, t) => {
4039
+ var xa = ja;
4040
+ const Va = M, Ua = Z(), Ja = (s, e, t) => {
4005
4041
  let r = null, o = null, n = null;
4006
4042
  try {
4007
- n = new Va(e, t);
4043
+ n = new Ua(e, t);
4008
4044
  } catch {
4009
4045
  return null;
4010
4046
  }
4011
4047
  return s.forEach((i) => {
4012
- n.test(i) && (!r || o.compare(i) === 1) && (r = i, o = new xa(r, t));
4048
+ n.test(i) && (!r || o.compare(i) === 1) && (r = i, o = new Va(r, t));
4013
4049
  }), r;
4014
4050
  };
4015
- var Ja = Ua;
4016
- const ct = M, Ga = Q(), vr = Ze, Ma = (s, e) => {
4017
- s = new Ga(s, e);
4018
- let t = new ct("0.0.0");
4019
- if (s.test(t) || (t = new ct("0.0.0-0"), s.test(t)))
4051
+ var Ga = Ja;
4052
+ const lt = M, Ma = Z(), yr = Ze, _a = (s, e) => {
4053
+ s = new Ma(s, e);
4054
+ let t = new lt("0.0.0");
4055
+ if (s.test(t) || (t = new lt("0.0.0-0"), s.test(t)))
4020
4056
  return t;
4021
4057
  t = null;
4022
4058
  for (let r = 0; r < s.set.length; ++r) {
4023
4059
  const o = s.set[r];
4024
4060
  let n = null;
4025
4061
  o.forEach((i) => {
4026
- const c = new ct(i.semver.version);
4062
+ const c = new lt(i.semver.version);
4027
4063
  switch (i.operator) {
4028
4064
  case ">":
4029
4065
  c.prerelease.length === 0 ? c.patch++ : c.prerelease.push(0), c.raw = c.format();
4030
4066
  case "":
4031
4067
  case ">=":
4032
- (!n || vr(c, n)) && (n = c);
4068
+ (!n || yr(c, n)) && (n = c);
4033
4069
  break;
4034
4070
  case "<":
4035
4071
  case "<=":
@@ -4037,60 +4073,60 @@ const ct = M, Ga = Q(), vr = Ze, Ma = (s, e) => {
4037
4073
  default:
4038
4074
  throw new Error(`Unexpected operation: ${i.operator}`);
4039
4075
  }
4040
- }), n && (!t || vr(t, n)) && (t = n);
4076
+ }), n && (!t || yr(t, n)) && (t = n);
4041
4077
  }
4042
4078
  return t && s.test(t) ? t : null;
4043
4079
  };
4044
- var _a = Ma;
4045
- const Ka = Q(), Ha = (s, e) => {
4080
+ var Ka = _a;
4081
+ const Ha = Z(), Wa = (s, e) => {
4046
4082
  try {
4047
- return new Ka(s, e).range || "*";
4083
+ return new Ha(s, e).range || "*";
4048
4084
  } catch {
4049
4085
  return null;
4050
4086
  }
4051
4087
  };
4052
- var Wa = Ha;
4053
- const za = M, gs = et(), { ANY: Xa } = gs, qa = Q(), Ya = tt, yr = Ze, wr = Dt, Qa = jt, Za = Bt, ec = (s, e, t, r) => {
4054
- s = new za(s, r), e = new qa(e, r);
4088
+ var qa = Wa;
4089
+ const Xa = M, gs = et(), { ANY: za } = gs, Ya = Z(), Qa = tt, wr = Ze, Sr = Bt, Za = xt, ec = jt, tc = (s, e, t, r) => {
4090
+ s = new Xa(s, r), e = new Ya(e, r);
4055
4091
  let o, n, i, c, a;
4056
4092
  switch (t) {
4057
4093
  case ">":
4058
- o = yr, n = Qa, i = wr, c = ">", a = ">=";
4094
+ o = wr, n = Za, i = Sr, c = ">", a = ">=";
4059
4095
  break;
4060
4096
  case "<":
4061
- o = wr, n = Za, i = yr, c = "<", a = "<=";
4097
+ o = Sr, n = ec, i = wr, c = "<", a = "<=";
4062
4098
  break;
4063
4099
  default:
4064
4100
  throw new TypeError('Must provide a hilo val of "<" or ">"');
4065
4101
  }
4066
- if (Ya(s, e, r))
4102
+ if (Qa(s, e, r))
4067
4103
  return !1;
4068
4104
  for (let l = 0; l < e.set.length; ++l) {
4069
4105
  const u = e.set[l];
4070
- let d = null, m = null;
4106
+ let d = null, f = null;
4071
4107
  if (u.forEach((h) => {
4072
- h.semver === Xa && (h = new gs(">=0.0.0")), d = d || h, m = m || h, o(h.semver, d.semver, r) ? d = h : i(h.semver, m.semver, r) && (m = h);
4073
- }), d.operator === c || d.operator === a || (!m.operator || m.operator === c) && n(s, m.semver))
4108
+ h.semver === za && (h = new gs(">=0.0.0")), d = d || h, f = f || h, o(h.semver, d.semver, r) ? d = h : i(h.semver, f.semver, r) && (f = h);
4109
+ }), d.operator === c || d.operator === a || (!f.operator || f.operator === c) && n(s, f.semver))
4074
4110
  return !1;
4075
- if (m.operator === a && i(s, m.semver))
4111
+ if (f.operator === a && i(s, f.semver))
4076
4112
  return !1;
4077
4113
  }
4078
4114
  return !0;
4079
4115
  };
4080
- var xt = ec;
4081
- const tc = xt, rc = (s, e, t) => tc(s, e, ">", t);
4082
- var sc = rc;
4083
- const oc = xt, nc = (s, e, t) => oc(s, e, "<", t);
4084
- var ic = nc;
4085
- const Sr = Q(), ac = (s, e, t) => (s = new Sr(s, t), e = new Sr(e, t), s.intersects(e, t));
4086
- var cc = ac;
4087
- const lc = tt, uc = Y;
4088
- var dc = (s, e, t) => {
4116
+ var Vt = tc;
4117
+ const rc = Vt, sc = (s, e, t) => rc(s, e, ">", t);
4118
+ var oc = sc;
4119
+ const nc = Vt, ic = (s, e, t) => nc(s, e, "<", t);
4120
+ var ac = ic;
4121
+ const br = Z(), cc = (s, e, t) => (s = new br(s, t), e = new br(e, t), s.intersects(e, t));
4122
+ var lc = cc;
4123
+ const uc = tt, dc = Q;
4124
+ var pc = (s, e, t) => {
4089
4125
  const r = [];
4090
4126
  let o = null, n = null;
4091
- const i = s.sort((u, d) => uc(u, d, t));
4127
+ const i = s.sort((u, d) => dc(u, d, t));
4092
4128
  for (const u of i)
4093
- lc(u, e, t) ? (n = u, o || (o = u)) : (n && r.push([o, n]), n = null, o = null);
4129
+ uc(u, e, t) ? (n = u, o || (o = u)) : (n && r.push([o, n]), n = null, o = null);
4094
4130
  o && r.push([o, null]);
4095
4131
  const c = [];
4096
4132
  for (const [u, d] of r)
@@ -4098,14 +4134,14 @@ var dc = (s, e, t) => {
4098
4134
  const a = c.join(" || "), l = typeof e.raw == "string" ? e.raw : String(e);
4099
4135
  return a.length < l.length ? a : e;
4100
4136
  };
4101
- const br = Q(), Vt = et(), { ANY: lt } = Vt, be = tt, Ut = Y, pc = (s, e, t = {}) => {
4137
+ const Cr = Z(), Ut = et(), { ANY: ut } = Ut, Ce = tt, Jt = Q, hc = (s, e, t = {}) => {
4102
4138
  if (s === e)
4103
4139
  return !0;
4104
- s = new br(s, t), e = new br(e, t);
4140
+ s = new Cr(s, t), e = new Cr(e, t);
4105
4141
  let r = !1;
4106
4142
  e: for (const o of s.set) {
4107
4143
  for (const n of e.set) {
4108
- const i = fc(o, n, t);
4144
+ const i = gc(o, n, t);
4109
4145
  if (r = r || i !== null, i)
4110
4146
  continue e;
4111
4147
  }
@@ -4113,15 +4149,15 @@ const br = Q(), Vt = et(), { ANY: lt } = Vt, be = tt, Ut = Y, pc = (s, e, t = {}
4113
4149
  return !1;
4114
4150
  }
4115
4151
  return !0;
4116
- }, hc = [new Vt(">=0.0.0-0")], Rr = [new Vt(">=0.0.0")], fc = (s, e, t) => {
4152
+ }, fc = [new Ut(">=0.0.0-0")], Rr = [new Ut(">=0.0.0")], gc = (s, e, t) => {
4117
4153
  if (s === e)
4118
4154
  return !0;
4119
- if (s.length === 1 && s[0].semver === lt) {
4120
- if (e.length === 1 && e[0].semver === lt)
4155
+ if (s.length === 1 && s[0].semver === ut) {
4156
+ if (e.length === 1 && e[0].semver === ut)
4121
4157
  return !0;
4122
- t.includePrerelease ? s = hc : s = Rr;
4158
+ t.includePrerelease ? s = fc : s = Rr;
4123
4159
  }
4124
- if (e.length === 1 && e[0].semver === lt) {
4160
+ if (e.length === 1 && e[0].semver === ut) {
4125
4161
  if (t.includePrerelease)
4126
4162
  return !0;
4127
4163
  e = Rr;
@@ -4129,211 +4165,210 @@ const br = Q(), Vt = et(), { ANY: lt } = Vt, be = tt, Ut = Y, pc = (s, e, t = {}
4129
4165
  const r = /* @__PURE__ */ new Set();
4130
4166
  let o, n;
4131
4167
  for (const h of s)
4132
- h.operator === ">" || h.operator === ">=" ? o = Er(o, h, t) : h.operator === "<" || h.operator === "<=" ? n = Cr(n, h, t) : r.add(h.semver);
4168
+ h.operator === ">" || h.operator === ">=" ? o = Er(o, h, t) : h.operator === "<" || h.operator === "<=" ? n = kr(n, h, t) : r.add(h.semver);
4133
4169
  if (r.size > 1)
4134
4170
  return null;
4135
4171
  let i;
4136
4172
  if (o && n) {
4137
- if (i = Ut(o.semver, n.semver, t), i > 0)
4173
+ if (i = Jt(o.semver, n.semver, t), i > 0)
4138
4174
  return null;
4139
4175
  if (i === 0 && (o.operator !== ">=" || n.operator !== "<="))
4140
4176
  return null;
4141
4177
  }
4142
4178
  for (const h of r) {
4143
- if (o && !be(h, String(o), t) || n && !be(h, String(n), t))
4179
+ if (o && !Ce(h, String(o), t) || n && !Ce(h, String(n), t))
4144
4180
  return null;
4145
- for (const f of e)
4146
- if (!be(h, String(f), t))
4181
+ for (const g of e)
4182
+ if (!Ce(h, String(g), t))
4147
4183
  return !1;
4148
4184
  return !0;
4149
4185
  }
4150
- let c, a, l, u, d = n && !t.includePrerelease && n.semver.prerelease.length ? n.semver : !1, m = o && !t.includePrerelease && o.semver.prerelease.length ? o.semver : !1;
4186
+ let c, a, l, u, d = n && !t.includePrerelease && n.semver.prerelease.length ? n.semver : !1, f = o && !t.includePrerelease && o.semver.prerelease.length ? o.semver : !1;
4151
4187
  d && d.prerelease.length === 1 && n.operator === "<" && d.prerelease[0] === 0 && (d = !1);
4152
4188
  for (const h of e) {
4153
4189
  if (u = u || h.operator === ">" || h.operator === ">=", l = l || h.operator === "<" || h.operator === "<=", o) {
4154
- if (m && h.semver.prerelease && h.semver.prerelease.length && h.semver.major === m.major && h.semver.minor === m.minor && h.semver.patch === m.patch && (m = !1), h.operator === ">" || h.operator === ">=") {
4190
+ if (f && h.semver.prerelease && h.semver.prerelease.length && h.semver.major === f.major && h.semver.minor === f.minor && h.semver.patch === f.patch && (f = !1), h.operator === ">" || h.operator === ">=") {
4155
4191
  if (c = Er(o, h, t), c === h && c !== o)
4156
4192
  return !1;
4157
- } else if (o.operator === ">=" && !be(o.semver, String(h), t))
4193
+ } else if (o.operator === ">=" && !Ce(o.semver, String(h), t))
4158
4194
  return !1;
4159
4195
  }
4160
4196
  if (n) {
4161
4197
  if (d && h.semver.prerelease && h.semver.prerelease.length && h.semver.major === d.major && h.semver.minor === d.minor && h.semver.patch === d.patch && (d = !1), h.operator === "<" || h.operator === "<=") {
4162
- if (a = Cr(n, h, t), a === h && a !== n)
4198
+ if (a = kr(n, h, t), a === h && a !== n)
4163
4199
  return !1;
4164
- } else if (n.operator === "<=" && !be(n.semver, String(h), t))
4200
+ } else if (n.operator === "<=" && !Ce(n.semver, String(h), t))
4165
4201
  return !1;
4166
4202
  }
4167
4203
  if (!h.operator && (n || o) && i !== 0)
4168
4204
  return !1;
4169
4205
  }
4170
- return !(o && l && !n && i !== 0 || n && u && !o && i !== 0 || m || d);
4206
+ return !(o && l && !n && i !== 0 || n && u && !o && i !== 0 || f || d);
4171
4207
  }, Er = (s, e, t) => {
4172
4208
  if (!s)
4173
4209
  return e;
4174
- const r = Ut(s.semver, e.semver, t);
4210
+ const r = Jt(s.semver, e.semver, t);
4175
4211
  return r > 0 ? s : r < 0 || e.operator === ">" && s.operator === ">=" ? e : s;
4176
- }, Cr = (s, e, t) => {
4212
+ }, kr = (s, e, t) => {
4177
4213
  if (!s)
4178
4214
  return e;
4179
- const r = Ut(s.semver, e.semver, t);
4215
+ const r = Jt(s.semver, e.semver, t);
4180
4216
  return r < 0 ? s : r > 0 || e.operator === "<" && s.operator === "<=" ? e : s;
4181
4217
  };
4182
- var gc = pc;
4183
- const ut = De, kr = Ye, mc = M, Pr = ds, vc = we, yc = Ci, wc = Oi, Sc = Ii, bc = Ti, Rc = Ni, Ec = ji, Cc = Ui, kc = Mi, Pc = Y, Oc = Wi, $c = qi, Ic = Nt, Fc = ea, Tc = sa, Ac = Ze, Lc = Dt, Nc = ps, Dc = hs, Bc = Bt, jc = jt, xc = fs, Vc = Pa, Uc = et(), Jc = Q(), Gc = tt, Mc = La, _c = ja, Kc = Ja, Hc = _a, Wc = Wa, zc = xt, Xc = sc, qc = ic, Yc = cc, Qc = dc, Zc = gc;
4184
- var el = {
4185
- parse: vc,
4186
- valid: yc,
4187
- clean: wc,
4188
- inc: Sc,
4189
- diff: bc,
4218
+ var mc = hc;
4219
+ const dt = De, Pr = Ye, vc = M, Or = ds, yc = Se, wc = ki, Sc = $i, bc = Fi, Cc = Ai, Rc = Di, Ec = xi, kc = Ji, Pc = _i, Oc = Q, $c = qi, Ic = Yi, Fc = Dt, Tc = ta, Ac = oa, Lc = Ze, Nc = Bt, Dc = ps, Bc = hs, jc = jt, xc = xt, Vc = fs, Uc = Oa, Jc = et(), Gc = Z(), Mc = tt, _c = Na, Kc = xa, Hc = Ga, Wc = Ka, qc = qa, Xc = Vt, zc = oc, Yc = ac, Qc = lc, Zc = pc, el = mc;
4220
+ var tl = {
4221
+ parse: yc,
4222
+ valid: wc,
4223
+ clean: Sc,
4224
+ inc: bc,
4225
+ diff: Cc,
4190
4226
  major: Rc,
4191
4227
  minor: Ec,
4192
- patch: Cc,
4193
- prerelease: kc,
4194
- compare: Pc,
4195
- rcompare: Oc,
4196
- compareLoose: $c,
4197
- compareBuild: Ic,
4198
- sort: Fc,
4199
- rsort: Tc,
4200
- gt: Ac,
4201
- lt: Lc,
4202
- eq: Nc,
4203
- neq: Dc,
4204
- gte: Bc,
4205
- lte: jc,
4206
- cmp: xc,
4207
- coerce: Vc,
4208
- Comparator: Uc,
4209
- Range: Jc,
4210
- satisfies: Gc,
4211
- toComparators: Mc,
4212
- maxSatisfying: _c,
4213
- minSatisfying: Kc,
4214
- minVersion: Hc,
4215
- validRange: Wc,
4216
- outside: zc,
4217
- gtr: Xc,
4218
- ltr: qc,
4219
- intersects: Yc,
4220
- simplifyRange: Qc,
4221
- subset: Zc,
4222
- SemVer: mc,
4223
- re: ut.re,
4224
- src: ut.src,
4225
- tokens: ut.t,
4226
- SEMVER_SPEC_VERSION: kr.SEMVER_SPEC_VERSION,
4227
- RELEASE_TYPES: kr.RELEASE_TYPES,
4228
- compareIdentifiers: Pr.compareIdentifiers,
4229
- rcompareIdentifiers: Pr.rcompareIdentifiers
4228
+ patch: kc,
4229
+ prerelease: Pc,
4230
+ compare: Oc,
4231
+ rcompare: $c,
4232
+ compareLoose: Ic,
4233
+ compareBuild: Fc,
4234
+ sort: Tc,
4235
+ rsort: Ac,
4236
+ gt: Lc,
4237
+ lt: Nc,
4238
+ eq: Dc,
4239
+ neq: Bc,
4240
+ gte: jc,
4241
+ lte: xc,
4242
+ cmp: Vc,
4243
+ coerce: Uc,
4244
+ Comparator: Jc,
4245
+ Range: Gc,
4246
+ satisfies: Mc,
4247
+ toComparators: _c,
4248
+ maxSatisfying: Kc,
4249
+ minSatisfying: Hc,
4250
+ minVersion: Wc,
4251
+ validRange: qc,
4252
+ outside: Xc,
4253
+ gtr: zc,
4254
+ ltr: Yc,
4255
+ intersects: Qc,
4256
+ simplifyRange: Zc,
4257
+ subset: el,
4258
+ SemVer: vc,
4259
+ re: dt.re,
4260
+ src: dt.src,
4261
+ tokens: dt.t,
4262
+ SEMVER_SPEC_VERSION: Pr.SEMVER_SPEC_VERSION,
4263
+ RELEASE_TYPES: Pr.RELEASE_TYPES,
4264
+ compareIdentifiers: Or.compareIdentifiers,
4265
+ rcompareIdentifiers: Or.rcompareIdentifiers
4230
4266
  };
4231
- const tl = /* @__PURE__ */ ci(el), rl = {
4267
+ const rl = /* @__PURE__ */ li(tl), sl = {
4232
4268
  minDelay: 1500
4233
- }, sl = "__no_updates__";
4234
- class ol extends Gs {
4269
+ }, ol = "__no_updates__";
4270
+ class nl extends Ms {
4235
4271
  constructor(t, r, o = {}) {
4236
- super({ ...o, ...rl }, r);
4272
+ super({ ...o, ...sl }, r);
4237
4273
  S(this, "http");
4238
4274
  S(this, "preferredUpdateChannel");
4239
4275
  this.registryProvider = t, this.http = o.http, this.preferredUpdateChannel = o.preferredUpdateChannel;
4240
4276
  }
4241
4277
  getKey(t) {
4242
- switch (t.type) {
4278
+ switch (t.currentSpec.type) {
4243
4279
  case "dev-v1":
4244
- return `dev_1_${t.folder}_${t.mtime}`;
4280
+ return `dev_1_${t.currentSpec.folder}_${t.currentSpec.mtime}`;
4245
4281
  case "dev-v2":
4246
- return `dev_2_${t.folder}_${t.mtime}`;
4282
+ return `dev_2_${t.currentSpec.folder}_${t.currentSpec.mtime}`;
4247
4283
  case "from-registry-v2":
4248
- return `from_registry_v2_${t.registryUrl}_${t.id.organization}_${t.id.name}_${t.id.version}`;
4284
+ return `from_registry_v2_${re(t)}`;
4249
4285
  default:
4250
- return sl;
4286
+ return ol;
4251
4287
  }
4252
4288
  }
4253
4289
  async readValue(t) {
4290
+ var r, o;
4254
4291
  try {
4255
- switch (t.type) {
4292
+ const n = t.currentSpec;
4293
+ switch (n.type) {
4256
4294
  case "dev-v1":
4257
4295
  try {
4258
- const r = await Ur(t.folder);
4259
- return r === t.mtime ? void 0 : { ...t, mtime: r };
4260
- } catch (r) {
4261
- this.logger.warn(r);
4262
- return;
4296
+ const i = await Jr(n.folder);
4297
+ return i === n.mtime ? { suggestions: [] } : { mainSuggestion: { ...n, mtime: i }, suggestions: [] };
4298
+ } catch (i) {
4299
+ return this.logger.warn(i), { suggestions: [] };
4263
4300
  }
4264
4301
  case "dev-v2":
4265
4302
  try {
4266
- const r = await ht(t.folder, this.logger);
4267
- if (r === void 0) return;
4268
- const o = await Ot(r);
4269
- return o === t.mtime ? void 0 : { ...t, mtime: o };
4270
- } catch (r) {
4271
- this.logger.warn(r);
4272
- return;
4303
+ const i = await ft(n.folder, this.logger);
4304
+ if (i === void 0) return { suggestions: [] };
4305
+ const c = await $t(i);
4306
+ return c === n.mtime ? { suggestions: [] } : { mainSuggestion: { ...n, mtime: c }, suggestions: [] };
4307
+ } catch (i) {
4308
+ return this.logger.warn(i), { suggestions: [] };
4273
4309
  }
4274
4310
  case "from-registry-v2":
4275
4311
  try {
4276
- const r = this.registryProvider.getRegistry(t.registryUrl);
4277
- let o;
4278
- if (t.channel === void 0) {
4279
- const n = await r.getLatestOverview(t.id, ne);
4280
- if (n) o = n.spec;
4281
- else {
4282
- const i = await r.getLatestOverview(t.id, ke);
4283
- if (i === void 0) {
4284
- this.logger.error(`No "any" channel record for ${Jt(t.id)}`);
4285
- return;
4286
- }
4287
- o = { ...i.spec, channel: ne };
4288
- }
4289
- } else {
4290
- const n = this.preferredUpdateChannel ?? t.channel, i = await r.getLatestOverview(t.id, n);
4291
- if (i) o = i.spec;
4312
+ const { versionLock: i, skipVersion: c } = t.settings;
4313
+ if (i === "patch") return { suggestions: [] };
4314
+ const a = this.registryProvider.getRegistry(n.registryUrl);
4315
+ let l, u;
4316
+ if (n.channel === void 0)
4317
+ if (await a.getLatestOverview(n.id, ie)) u = ie;
4292
4318
  else {
4293
- this.logger.error(
4294
- `Can't find update for ${Jt(t.id)} in channel "${n}"`
4295
- );
4296
- return;
4319
+ if (await a.getLatestOverview(n.id, we) === void 0)
4320
+ return this.logger.error(`No "any" channel record for ${Es(n.id)}`), { suggestions: [] };
4321
+ u = we;
4297
4322
  }
4323
+ else u = n.channel;
4324
+ const d = await a.getUpdateSuggestions(n.id, u);
4325
+ if (d === void 0 || d.length === 0) return { suggestions: [] };
4326
+ d.reverse();
4327
+ let f;
4328
+ switch (i) {
4329
+ case void 0:
4330
+ f = d[0].update;
4331
+ break;
4332
+ case "major":
4333
+ f = (r = d.find((E) => E.type !== "major")) == null ? void 0 : r.update;
4334
+ break;
4335
+ case "minor":
4336
+ f = (o = d.find((E) => E.type === "patch")) == null ? void 0 : o.update;
4337
+ break;
4298
4338
  }
4299
- if (o.type !== "from-registry-v2") throw new Error(`Unexpected spec type ${o}.`);
4300
- return tl.compare(o.id.version, t.id.version) <= 0 ? void 0 : ((async () => {
4339
+ const h = d.map(({ type: E, update: F }) => ({
4340
+ type: E,
4341
+ update: { ...n, id: { ...n.id, version: F } }
4342
+ }));
4343
+ if (f === void 0) return { suggestions: h };
4344
+ if (c !== void 0 && rl.lte(f, c))
4345
+ return { suggestions: h };
4346
+ const g = {
4347
+ ...n,
4348
+ id: { ...n.id, version: f }
4349
+ };
4350
+ return (async () => {
4301
4351
  try {
4302
- await r.getComponents(o.id);
4303
- } catch (n) {
4304
- this.logger.warn(n);
4352
+ await a.getComponents(g.id);
4353
+ } catch (E) {
4354
+ this.logger.warn(E);
4305
4355
  }
4306
- })(), o);
4307
- } catch (r) {
4308
- this.logger.warn(r);
4309
- return;
4356
+ })(), { suggestions: h, mainSuggestion: g };
4357
+ } catch (i) {
4358
+ return this.logger.warn(i), { suggestions: [] };
4310
4359
  }
4311
4360
  default:
4312
- return;
4361
+ return { suggestions: [] };
4313
4362
  }
4314
- } catch (r) {
4315
- this.logger.warn(r);
4316
- return;
4363
+ } catch (n) {
4364
+ return this.logger.warn(n), { suggestions: [] };
4317
4365
  }
4318
4366
  }
4319
4367
  resultsEqual(t, r) {
4320
- if (t === void 0 && r === void 0) return !0;
4321
- if (t === void 0 || r === void 0 || t.type !== r.type) return !1;
4322
- switch (t.type) {
4323
- case "from-registry-v1":
4324
- return r.type !== "from-registry-v1" ? !1 : t.registryUrl === r.registryUrl && Gt(t.id, r.id);
4325
- case "from-registry-v2":
4326
- return r.type !== "from-registry-v2" ? !1 : t.registryUrl === r.registryUrl && Gt(t.id, r.id);
4327
- case "dev-v1":
4328
- return r.type !== "dev-v1" ? !1 : t.folder === r.folder && t.mtime === r.mtime;
4329
- case "dev-v2":
4330
- return r.type !== "dev-v2" ? !1 : t.folder === r.folder && t.mtime === r.mtime;
4331
- default:
4332
- J(t);
4333
- }
4368
+ return re(t) === re(r);
4334
4369
  }
4335
4370
  }
4336
- class Or {
4371
+ class $r {
4337
4372
  constructor() {
4338
4373
  S(this, "resources", /* @__PURE__ */ new Map());
4339
4374
  }
@@ -4369,16 +4404,16 @@ class Or {
4369
4404
  }
4370
4405
  }
4371
4406
  let Re;
4372
- function ve() {
4407
+ function ye() {
4373
4408
  return Re || (Re = {
4374
4409
  logPFrameRequests: process.env.MI_LOG_PFRAMES !== void 0
4375
4410
  }, process.env.MI_LOG_TREE_STAT && (Re.logTreeStats = process.env.MI_LOG_TREE_STAT === "cumulative" ? "cumulative" : "per-request"), Re);
4376
4411
  }
4377
- function $r(s) {
4412
+ function Ir(s) {
4378
4413
  return String(s.id);
4379
4414
  }
4380
- const nl = ["Int", "Long", "Float", "Double", "String", "Bytes"];
4381
- function dt(s) {
4415
+ const il = ["Int", "Long", "Float", "Double", "String", "Bytes"];
4416
+ function pt(s) {
4382
4417
  const e = [], t = [];
4383
4418
  for (const r of s)
4384
4419
  r.type === "bySingleColumn" ? (e.push(r), t.push({
@@ -4394,7 +4429,7 @@ function dt(s) {
4394
4429
  return s;
4395
4430
  }
4396
4431
  const Ee = (s, e) => typeof e == "bigint" ? e.toString() : e;
4397
- class il {
4432
+ class al {
4398
4433
  constructor(e, t, r, o) {
4399
4434
  S(this, "pFrame");
4400
4435
  S(this, "blobIdToResource", /* @__PURE__ */ new Map());
@@ -4416,7 +4451,7 @@ class il {
4416
4451
  throw console.log(`resolveBlobContent catched error: ${r}`), t;
4417
4452
  }
4418
4453
  });
4419
- this.blobDriver = e, this.logger = t, this.blobContentCache = r, this.columns = o, this.pFrame = new oo(
4454
+ this.blobDriver = e, this.logger = t, this.blobContentCache = r, this.columns = o, this.pFrame = new no(
4420
4455
  (n, i) => {
4421
4456
  switch (n) {
4422
4457
  default:
@@ -4430,8 +4465,8 @@ class il {
4430
4465
  }
4431
4466
  ), this.pFrame.setDataSource(this);
4432
4467
  for (const n of o) {
4433
- for (const c of on(n.data)) this.blobIdToResource.set($r(c), c);
4434
- const i = nn(n.data, $r);
4468
+ for (const c of nn(n.data)) this.blobIdToResource.set(Ir(c), c);
4469
+ const i = an(n.data, Ir);
4435
4470
  try {
4436
4471
  this.pFrame.addColumnSpec(n.id, n.spec), this.pFrame.setColumnData(n.id, i);
4437
4472
  } catch (c) {
@@ -4453,7 +4488,7 @@ class il {
4453
4488
  this.pFrame.dispose();
4454
4489
  }
4455
4490
  }
4456
- class al {
4491
+ class cl {
4457
4492
  constructor(e, t) {
4458
4493
  S(this, "pFrames");
4459
4494
  S(this, "pTables");
@@ -4461,39 +4496,39 @@ class al {
4461
4496
  /** Limits concurrent requests to PFrame API to prevent deadlock with Node's IO threads */
4462
4497
  S(this, "concurrencyLimiter");
4463
4498
  this.blobDriver = e, this.logger = t;
4464
- const r = new no({
4499
+ const r = new io({
4465
4500
  maxSize: 1e9,
4466
4501
  // 1Gb
4467
- fetchMethod: async (n) => await Nr.readFile(n),
4502
+ fetchMethod: async (n) => await Dr.readFile(n),
4468
4503
  sizeCalculation: (n) => n.length
4469
- }), o = new Fs(1);
4470
- this.blobContentCache = r, this.concurrencyLimiter = o, this.pFrames = new class extends Or {
4504
+ }), o = new Ts(1);
4505
+ this.blobContentCache = r, this.concurrencyLimiter = o, this.pFrames = new class extends $r {
4471
4506
  constructor(n, i) {
4472
4507
  super(), this.blobDriver = n, this.logger = i;
4473
4508
  }
4474
4509
  createNewResource(n) {
4475
- return ve().logPFrameRequests && t.info(
4510
+ return ye().logPFrameRequests && t.info(
4476
4511
  `PFrame creation (pFrameHandle = ${this.calculateParamsKey(n)}): ${JSON.stringify(n, Ee)}`
4477
- ), new il(this.blobDriver, this.logger, r, n);
4512
+ ), new al(this.blobDriver, this.logger, r, n);
4478
4513
  }
4479
4514
  calculateParamsKey(n) {
4480
- return ll(n);
4515
+ return ul(n);
4481
4516
  }
4482
- }(this.blobDriver, this.logger), this.pTables = new class extends Or {
4517
+ }(this.blobDriver, this.logger), this.pTables = new class extends $r {
4483
4518
  constructor(n) {
4484
4519
  super(), this.pFrames = n;
4485
4520
  }
4486
4521
  async createNewResource(n) {
4487
- const i = this.pFrames.getByKey(n.pFrameHandle), c = await o.run(async () => (ve().logPFrameRequests && t.info(
4522
+ const i = this.pFrames.getByKey(n.pFrameHandle), c = await o.run(async () => (ye().logPFrameRequests && t.info(
4488
4523
  `PTable creation (pTableHandle = ${this.calculateParamsKey(n)}): ${JSON.stringify(n, Ee)}`
4489
4524
  ), await i.pFrame.createTable({
4490
4525
  src: Ie(n.def.src),
4491
- filters: dt(n.def.filters)
4526
+ filters: pt(n.def.filters)
4492
4527
  })));
4493
4528
  return n.def.sorting.length !== 0 ? c.sort(n.def.sorting) : c;
4494
4529
  }
4495
4530
  calculateParamsKey(n) {
4496
- return cl(n);
4531
+ return ll(n);
4497
4532
  }
4498
4533
  }(this.pFrames);
4499
4534
  }
@@ -4501,19 +4536,19 @@ class al {
4501
4536
  // Internal / Config API Methods
4502
4537
  //
4503
4538
  createPFrame(e, t) {
4504
- const r = e.filter((n) => nl.find((i) => i === n.spec.valueType)).map(
4539
+ const r = e.filter((n) => il.find((i) => i === n.spec.valueType)).map(
4505
4540
  (n) => le(
4506
4541
  n,
4507
- (i) => Js(i) ? pn(i) : hn(n.spec, i)
4542
+ (i) => Gs(i) ? hn(i) : fn(n.spec, i)
4508
4543
  )
4509
4544
  ), o = this.pFrames.acquire(r);
4510
4545
  return t.addOnDestroy(o.unref), o.key;
4511
4546
  }
4512
4547
  createPTable(e, t) {
4513
- const r = this.createPFrame(Es(e.src), t), o = pt(e, (i) => i.id), n = this.pTables.acquire({ def: o, pFrameHandle: r });
4514
- return ve().logPFrameRequests && this.logger.info(
4548
+ const r = this.createPFrame(Rs(e.src), t), o = ht(e, (i) => i.id), n = this.pTables.acquire({ def: o, pFrameHandle: r });
4549
+ return ye().logPFrameRequests && this.logger.info(
4515
4550
  `Create PTable call (pFrameHandle = ${r}; pTableHandle = ${JSON.stringify(n)}): ${JSON.stringify(
4516
- pt(e, (i) => i.spec),
4551
+ ht(e, (i) => i.spec),
4517
4552
  Ee
4518
4553
  )}`
4519
4554
  ), t.addOnDestroy(n.unref), n.key;
@@ -4546,11 +4581,11 @@ class al {
4546
4581
  );
4547
4582
  }
4548
4583
  async calculateTableData(e, t) {
4549
- let r = await this.concurrencyLimiter.run(async () => (ve().logPFrameRequests && this.logger.info(
4584
+ let r = await this.concurrencyLimiter.run(async () => (ye().logPFrameRequests && this.logger.info(
4550
4585
  `Call calculateTableData, handle = ${e}, request = ${JSON.stringify(t, Ee)}`
4551
4586
  ), await this.pFrames.getByKey(e).pFrame.createTable({
4552
4587
  src: Ie(t.src),
4553
- filters: dt(t.filters)
4588
+ filters: pt(t.filters)
4554
4589
  })));
4555
4590
  if (t.sorting.length > 0) {
4556
4591
  const i = await this.concurrencyLimiter.run(
@@ -4567,11 +4602,11 @@ class al {
4567
4602
  }));
4568
4603
  }
4569
4604
  async getUniqueValues(e, t) {
4570
- return await this.concurrencyLimiter.run(async () => (ve().logPFrameRequests && this.logger.info(
4605
+ return await this.concurrencyLimiter.run(async () => (ye().logPFrameRequests && this.logger.info(
4571
4606
  `Call getUniqueValues, handle = ${e}, request = ${JSON.stringify(t, Ee)}`
4572
4607
  ), await this.pFrames.getByKey(e).pFrame.getUniqueValues({
4573
4608
  ...t,
4574
- filters: dt(t.filters)
4609
+ filters: pt(t.filters)
4575
4610
  })));
4576
4611
  }
4577
4612
  //
@@ -4611,14 +4646,14 @@ function Ie(s) {
4611
4646
  secondary: s.secondary.map((e) => Ie(e))
4612
4647
  };
4613
4648
  default:
4614
- J(s);
4649
+ G(s);
4615
4650
  }
4616
4651
  }
4617
- function cl(s) {
4652
+ function ll(s) {
4618
4653
  const e = Ne("sha256");
4619
- return e.update(ye(s)), e.digest().toString("hex");
4654
+ return e.update(re(s)), e.digest().toString("hex");
4620
4655
  }
4621
- function ll(s) {
4656
+ function ul(s) {
4622
4657
  const e = [...s].map(
4623
4658
  (r) => le(r, (o) => {
4624
4659
  let n;
@@ -4662,41 +4697,41 @@ function ll(s) {
4662
4697
  );
4663
4698
  e.sort((r, o) => r.id.localeCompare(o.id));
4664
4699
  const t = Ne("sha256");
4665
- return t.update(ye(e)), t.digest().toString("hex");
4700
+ return t.update(re(e)), t.digest().toString("hex");
4666
4701
  }
4667
- async function ul(s, e, t) {
4702
+ async function dl(s, e, t) {
4668
4703
  const r = {
4669
4704
  ...as,
4670
4705
  ...cs(e),
4671
4706
  ...t
4672
- }, o = new Lr(r.localSecret), n = zs(r.logger, s, r.localProjections), i = Xs(s, r.logger), c = qs(s, r.logger), a = Ys(s, r.logger), l = new Qs(
4707
+ }, o = new Nr(r.localSecret), n = Xs(r.logger, s, r.localProjections), i = zs(s, r.logger), c = Ys(s, r.logger), a = Qs(s, r.logger), l = new Zs(
4673
4708
  r.logger,
4674
4709
  n,
4675
4710
  i,
4676
4711
  r.blobDownloadPath,
4677
4712
  o,
4678
4713
  r.blobDriverOps
4679
- ), u = new Zs(
4714
+ ), u = new eo(
4680
4715
  r.logger,
4681
4716
  o,
4682
4717
  c,
4683
4718
  a,
4684
4719
  r.uploadDriverOps
4685
- ), d = new eo(r.logger, i, r.logStreamDriverOps), m = new to(r.logger, d, l), h = await ro.init(
4720
+ ), d = new to(r.logger, i, r.logStreamDriverOps), f = new ro(r.logger, d, l), h = await so.init(
4686
4721
  r.logger,
4687
4722
  s,
4688
4723
  o,
4689
4724
  r.localProjections,
4690
4725
  r.openFileDialogCallback,
4691
4726
  r.virtualLocalStoragesOverride
4692
- ), f = new al(l, r.logger);
4727
+ ), g = new cl(l, r.logger);
4693
4728
  return {
4694
4729
  blobDriver: l,
4695
- logDriver: m,
4730
+ logDriver: f,
4696
4731
  lsDriver: h,
4697
4732
  signer: o,
4698
4733
  uploadDriver: u,
4699
- pFrameDriver: f
4734
+ pFrameDriver: g
4700
4735
  };
4701
4736
  }
4702
4737
  class ms {
@@ -4720,14 +4755,14 @@ class ms {
4720
4755
  /** Creates a project with initial state and adds it to project list. */
4721
4756
  async createProject(e, t = Fe()) {
4722
4757
  const r = await this.pl.withWriteTx("MLCreateProject", async (o) => {
4723
- const n = await sn(o, e);
4724
- return o.createField(j(this.projectListResourceId, t), "Dynamic", n), await o.commit(), await xs(n);
4758
+ const n = await on(o, e);
4759
+ return o.createField(j(this.projectListResourceId, t), "Dynamic", n), await o.commit(), await Vs(n);
4725
4760
  });
4726
4761
  return await this.projectListTree.refreshState(), r;
4727
4762
  }
4728
4763
  /** Updates project metadata */
4729
4764
  async setProjectMeta(e, t, r) {
4730
- await ee(this.pl, e, r, async (o) => {
4765
+ await Y(this.pl, e, r, async (o) => {
4731
4766
  o.setMeta(t);
4732
4767
  }), await this.projectListTree.refreshState();
4733
4768
  }
@@ -4741,7 +4776,7 @@ class ms {
4741
4776
  async projectIdToResourceId(e) {
4742
4777
  return await this.pl.withReadTx("Project id to resource id", async (t) => {
4743
4778
  const r = (await t.getField(j(this.projectListResourceId, e))).value;
4744
- if (_e(r)) throw new Error("Unexpected project list structure.");
4779
+ if (Ke(r)) throw new Error("Unexpected project list structure.");
4745
4780
  return r;
4746
4781
  });
4747
4782
  }
@@ -4752,7 +4787,7 @@ class ms {
4752
4787
  async openProject(e) {
4753
4788
  const t = await this.ensureProjectRid(e);
4754
4789
  if (this.openedProjectsByRid.has(t)) throw new Error(`Project ${t} already opened`);
4755
- this.openedProjectsByRid.set(t, await At.init(this.env, t)), this.openedProjectsList.setValue([...this.openedProjectsByRid.keys()]);
4790
+ this.openedProjectsByRid.set(t, await Lt.init(this.env, t)), this.openedProjectsList.setValue([...this.openedProjectsByRid.keys()]);
4756
4791
  }
4757
4792
  /** Closes the project, and deallocate all corresponding resources. */
4758
4793
  async closeProject(e) {
@@ -4780,37 +4815,37 @@ class ms {
4780
4815
  /** Generates sufficiently random string to be used as local secret for the
4781
4816
  * middle layer */
4782
4817
  static generateLocalSecret() {
4783
- return Lr.generateSecret();
4818
+ return Nr.generateSecret();
4784
4819
  }
4785
4820
  /** Initialize middle layer */
4786
4821
  static async init(e, t, r) {
4787
4822
  const o = {
4788
- ...ii,
4789
- ...ai(t),
4823
+ ...ai,
4824
+ ...ci(t),
4790
4825
  ...r
4791
4826
  };
4792
- o.defaultTreeOptions.logStat = ve().logTreeStats;
4793
- const n = await e.withWriteTx("MLInitialization", async (I) => {
4794
- const F = j(I.clientRoot, Oo);
4795
- I.createField(F, "Dynamic");
4796
- const D = await I.getField(F);
4797
- if (_e(D.value)) {
4798
- const _ = I.createEphemeral(Mr);
4799
- return I.lock(_), I.setField(F, _), await I.commit(), await _.globalId;
4827
+ o.defaultTreeOptions.logStat = ye().logTreeStats;
4828
+ const n = await e.withWriteTx("MLInitialization", async (E) => {
4829
+ const F = j(E.clientRoot, $o);
4830
+ E.createField(F, "Dynamic");
4831
+ const N = await E.getField(F);
4832
+ if (Ke(N.value)) {
4833
+ const _ = E.createEphemeral(_r);
4834
+ return E.lock(_), E.setField(F, _), await E.commit(), await _.globalId;
4800
4835
  } else
4801
- return D.value;
4802
- }), i = o.logger, c = await ul(e, t, o), a = new Cs(e.httpDispatcher, {
4836
+ return N.value;
4837
+ }), i = o.logger, c = await dl(e, t, o), a = new ks(e.httpDispatcher, {
4803
4838
  minTimeout: 250,
4804
4839
  maxRetries: 4
4805
- }), l = new go(a), u = new qo(
4840
+ }), l = new mo(a), u = new Yo(
4806
4841
  l,
4807
4842
  c.signer,
4808
4843
  a
4809
- ), d = new so(
4844
+ ), d = new oo(
4810
4845
  i,
4811
4846
  e.httpDispatcher,
4812
4847
  o.frontendDownloadPath
4813
- ), m = {
4848
+ ), f = {
4814
4849
  pl: e,
4815
4850
  signer: c.signer,
4816
4851
  logger: i,
@@ -4820,26 +4855,26 @@ class ms {
4820
4855
  bpPreparer: u,
4821
4856
  frontendDownloadDriver: d,
4822
4857
  driverKit: c,
4823
- blockUpdateWatcher: new ol(l, i, {
4858
+ blockUpdateWatcher: new nl(l, i, {
4824
4859
  minDelay: o.devBlockUpdateRecheckInterval,
4825
4860
  http: a,
4826
4861
  preferredUpdateChannel: o.preferredUpdateChannel
4827
4862
  }),
4828
- quickJs: await Ws()
4829
- }, h = new Ms([]), f = await Io(e, n, h, m);
4863
+ quickJs: await qs()
4864
+ }, h = new _s([]), g = await Fo(e, n, h, f);
4830
4865
  return new ms(
4831
- m,
4866
+ f,
4832
4867
  c,
4833
4868
  c.signer,
4834
4869
  n,
4835
4870
  h,
4836
- f.tree,
4871
+ g.tree,
4837
4872
  l,
4838
- f.computable
4873
+ g.computable
4839
4874
  );
4840
4875
  }
4841
4876
  }
4842
- const dl = [
4877
+ const pl = [
4843
4878
  "undici:request:create",
4844
4879
  // When a new request is created
4845
4880
  "undici:request:bodySent",
@@ -4877,7 +4912,7 @@ const dl = [
4877
4912
  "undici:dispatcher:retry"
4878
4913
  // When a dispatcher retries a request
4879
4914
  ];
4880
- async function Wl(s, e = {}) {
4915
+ async function ql(s, e = {}) {
4881
4916
  const t = {
4882
4917
  pingCheckDurationMs: 1e4,
4883
4918
  pingTimeoutMs: 3e3,
@@ -4895,11 +4930,11 @@ async function Wl(s, e = {}) {
4895
4930
  bodyLimit: 300,
4896
4931
  ...e
4897
4932
  }, r = [];
4898
- dl.forEach((a) => {
4899
- io(a).subscribe((u) => {
4900
- var m;
4933
+ pl.forEach((a) => {
4934
+ ao(a).subscribe((u) => {
4935
+ var f;
4901
4936
  const d = (/* @__PURE__ */ new Date()).toISOString();
4902
- (m = u == null ? void 0 : u.response) != null && m.headers && (u.response.headers = u.response.headers.map((h) => h.toString())), r.push(
4937
+ (f = u == null ? void 0 : u.response) != null && f.headers && (u.response.headers = u.response.headers.map((h) => h.toString())), r.push(
4903
4938
  JSON.stringify({
4904
4939
  timestamp: d,
4905
4940
  event: a,
@@ -4915,56 +4950,56 @@ async function Wl(s, e = {}) {
4915
4950
  blockRegistryUiChecks: [],
4916
4951
  blockGARegistryUiChecks: [],
4917
4952
  autoUpdateCdnChecks: []
4918
- }, n = Vs(s, { defaultRequestTimeout: t.pingTimeoutMs });
4919
- o.plPings = await ge(t.pingCheckDurationMs, t.maxPingsPerSecond, async () => {
4953
+ }, n = Us(s, { defaultRequestTimeout: t.pingTimeoutMs });
4954
+ o.plPings = await me(t.pingCheckDurationMs, t.maxPingsPerSecond, async () => {
4920
4955
  const l = await new Kt(n).ping();
4921
4956
  return JSON.stringify(l).slice(0, t.bodyLimit) + "...";
4922
4957
  });
4923
4958
  const c = new Kt(n).ll.httpDispatcher;
4924
- return o.blockRegistryOverviewChecks = await ge(
4959
+ return o.blockRegistryOverviewChecks = await me(
4925
4960
  t.blockRegistryDurationMs,
4926
4961
  t.maxRegistryChecksPerSecond,
4927
- async () => await Ce(new URL(t.blockOverviewPath, t.blockRegistryUrl), t, c)
4928
- ), o.blockGARegistryOverviewChecks = await ge(
4962
+ async () => await ke(new URL(t.blockOverviewPath, t.blockRegistryUrl), t, c)
4963
+ ), o.blockGARegistryOverviewChecks = await me(
4929
4964
  t.blockRegistryDurationMs,
4930
4965
  t.maxRegistryChecksPerSecond,
4931
- async () => await Ce(new URL(t.blockOverviewPath, t.blockGARegistryUrl), t, c)
4932
- ), o.blockRegistryUiChecks = await ge(
4966
+ async () => await ke(new URL(t.blockOverviewPath, t.blockGARegistryUrl), t, c)
4967
+ ), o.blockRegistryUiChecks = await me(
4933
4968
  t.blockRegistryDurationMs,
4934
4969
  t.maxRegistryChecksPerSecond,
4935
- async () => await Ce(new URL(t.blockUiPath, t.blockRegistryUrl), t, c)
4936
- ), o.blockGARegistryUiChecks = await ge(
4970
+ async () => await ke(new URL(t.blockUiPath, t.blockRegistryUrl), t, c)
4971
+ ), o.blockGARegistryUiChecks = await me(
4937
4972
  t.blockRegistryDurationMs,
4938
4973
  t.maxRegistryChecksPerSecond,
4939
- async () => await Ce(new URL(t.blockUiPath, t.blockGARegistryUrl), t, c)
4940
- ), o.autoUpdateCdnChecks = await ge(
4974
+ async () => await ke(new URL(t.blockUiPath, t.blockGARegistryUrl), t, c)
4975
+ ), o.autoUpdateCdnChecks = await me(
4941
4976
  t.autoUpdateCdnDurationMs,
4942
4977
  t.maxAutoUpdateCdnChecksPerSecond,
4943
- async () => await Ce(t.autoUpdateCdnUrl, t, c)
4944
- ), pl(o, s, t, r);
4978
+ async () => await ke(t.autoUpdateCdnUrl, t, c)
4979
+ ), hl(o, s, t, r);
4945
4980
  }
4946
- async function ge(s, e, t) {
4947
- const r = Ct(), o = [];
4948
- for (; Ir(r) < s; ) {
4949
- const n = Ct();
4981
+ async function me(s, e, t) {
4982
+ const r = kt(), o = [];
4983
+ for (; Fr(r) < s; ) {
4984
+ const n = kt();
4950
4985
  let i;
4951
4986
  try {
4952
4987
  i = { ok: !0, value: await t() };
4953
4988
  } catch (l) {
4954
4989
  i = { ok: !1, error: l };
4955
4990
  }
4956
- const c = Ir(n);
4991
+ const c = Fr(n);
4957
4992
  o.push({
4958
4993
  elapsedMs: c,
4959
4994
  response: i
4960
4995
  });
4961
4996
  const a = 1e3 / e - c;
4962
- a > 0 && await xr(a);
4997
+ a > 0 && await Vr(a);
4963
4998
  }
4964
4999
  return o;
4965
5000
  }
4966
- async function Ce(s, e, t) {
4967
- const { body: r, statusCode: o } = await ie(s, {
5001
+ async function ke(s, e, t) {
5002
+ const { body: r, statusCode: o } = await ae(s, {
4968
5003
  dispatcher: t,
4969
5004
  headersTimeout: e.httpTimeoutMs,
4970
5005
  bodyTimeout: e.httpTimeoutMs
@@ -4974,7 +5009,7 @@ async function Ce(s, e, t) {
4974
5009
  beginningOfBody: n.slice(0, e.bodyLimit) + "..."
4975
5010
  };
4976
5011
  }
4977
- function pl(s, e, t, r) {
5012
+ function hl(s, e, t, r) {
4978
5013
  const o = s.plPings.filter((c) => c.response.ok), n = s.plPings.filter((c) => !c.response.ok), i = [
4979
5014
  ...new Set(o.map((c) => JSON.stringify(c.response.value)))
4980
5015
  ];
@@ -4983,17 +5018,17 @@ Network report:
4983
5018
  pl endpoint: ${e};
4984
5019
  options: ${JSON.stringify(t, null, 2)}.
4985
5020
 
4986
- Platforma pings: ${me(s.plPings)}
5021
+ Platforma pings: ${ve(s.plPings)}
4987
5022
 
4988
- Block registry overview responses: ${me(s.blockRegistryOverviewChecks)}
5023
+ Block registry overview responses: ${ve(s.blockRegistryOverviewChecks)}
4989
5024
 
4990
- Block ga registry overview responses: ${me(s.blockGARegistryOverviewChecks)}
5025
+ Block ga registry overview responses: ${ve(s.blockGARegistryOverviewChecks)}
4991
5026
 
4992
- Block registry ui responses: ${me(s.blockRegistryUiChecks)}
5027
+ Block registry ui responses: ${ve(s.blockRegistryUiChecks)}
4993
5028
 
4994
- Block ga registry ui responses: ${me(s.blockGARegistryUiChecks)}
5029
+ Block ga registry ui responses: ${ve(s.blockGARegistryUiChecks)}
4995
5030
 
4996
- Auto-update CDN responses: ${me(s.autoUpdateCdnChecks)}
5031
+ Auto-update CDN responses: ${ve(s.autoUpdateCdnChecks)}
4997
5032
 
4998
5033
  Block registry overview dumps:
4999
5034
  ${JSON.stringify(s.blockRegistryOverviewChecks, null, 2)}
@@ -5021,8 +5056,8 @@ ${r.join(`
5021
5056
  `)}
5022
5057
  `;
5023
5058
  }
5024
- function me(s) {
5025
- const e = s.filter((o) => o.response.ok), { mean: t, median: r } = hl(s);
5059
+ function ve(s) {
5060
+ const e = s.filter((o) => o.response.ok), { mean: t, median: r } = fl(s);
5026
5061
  return `
5027
5062
  total: ${s.length};
5028
5063
  successes: ${e.length};
@@ -5031,7 +5066,7 @@ mean in ms: ${t};
5031
5066
  median in ms: ${r};
5032
5067
  `;
5033
5068
  }
5034
- function hl(s) {
5069
+ function fl(s) {
5035
5070
  const e = s.map((o) => o.elapsedMs), t = e.reduce((o, n) => o + n) / e.length;
5036
5071
  let r;
5037
5072
  if (e.length > 0) {
@@ -5040,40 +5075,40 @@ function hl(s) {
5040
5075
  }
5041
5076
  return { mean: t, median: r };
5042
5077
  }
5043
- function Ct() {
5078
+ function kt() {
5044
5079
  return Date.now();
5045
5080
  }
5046
- function Ir(s) {
5047
- return Ct() - s;
5081
+ function Fr(s) {
5082
+ return kt() - s;
5048
5083
  }
5049
5084
  export {
5050
- Vl as BlockPackRegistry,
5051
- Ul as CentralBlockRegistry,
5085
+ Ul as BlockPackRegistry,
5086
+ Jl as CentralBlockRegistry,
5052
5087
  cs as DefaultDriverKitOpsPaths,
5053
5088
  as as DefaultDriverKitOpsSettings,
5054
- ai as DefaultMiddleLayerOpsPaths,
5055
- ii as DefaultMiddleLayerOpsSettings,
5056
- zr as FrontendFromFolderResourceType,
5089
+ ci as DefaultMiddleLayerOpsPaths,
5090
+ ai as DefaultMiddleLayerOpsSettings,
5091
+ qr as FrontendFromFolderResourceType,
5057
5092
  Wr as FrontendFromUrlResourceType,
5058
5093
  ms as MiddleLayer,
5059
- At as Project,
5060
- Go as TengoTemplateGet,
5061
- Mo as TengoTemplateGetRegistry,
5062
- Ko as TengoTemplateGetTemplate,
5063
- _o as TengoTemplateGetTemplateURI,
5064
- Ml as TengoTemplatePack,
5065
- _l as TengoTemplatePackConvert,
5066
- Hl as TengoTemplatePackConvertTemplate,
5067
- Kl as TengoTemplatePackConvertTemplatePack,
5068
- Gl as V1CentralDevSnapshotRegistry,
5069
- Jl as V1CentralRegistry,
5070
- go as V2RegistryProvider,
5071
- Wl as checkNetwork,
5072
- _r as createRenderTemplate,
5073
- Ur as getDevV1PacketMtime,
5074
- Ot as getDevV2PacketMtime,
5075
- ul as initDriverKit,
5076
- It as loadTemplate,
5077
- Ho as prepareTemplateSpec
5094
+ Lt as Project,
5095
+ Mo as TengoTemplateGet,
5096
+ _o as TengoTemplateGetRegistry,
5097
+ Ho as TengoTemplateGetTemplate,
5098
+ Ko as TengoTemplateGetTemplateURI,
5099
+ _l as TengoTemplatePack,
5100
+ Kl as TengoTemplatePackConvert,
5101
+ Wl as TengoTemplatePackConvertTemplate,
5102
+ Hl as TengoTemplatePackConvertTemplatePack,
5103
+ Ml as V1CentralDevSnapshotRegistry,
5104
+ Gl as V1CentralRegistry,
5105
+ mo as V2RegistryProvider,
5106
+ ql as checkNetwork,
5107
+ Kr as createRenderTemplate,
5108
+ Jr as getDevV1PacketMtime,
5109
+ $t as getDevV2PacketMtime,
5110
+ dl as initDriverKit,
5111
+ Ft as loadTemplate,
5112
+ Wo as prepareTemplateSpec
5078
5113
  };
5079
5114
  //# sourceMappingURL=index.mjs.map