@milaboratories/pl-middle-layer 1.10.23 → 1.10.25

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,79 +1,79 @@
1
1
  var Kt = Object.defineProperty;
2
2
  var Mt = (o, e, t) => e in o ? Kt(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
3
  var d = (o, e, t) => Mt(o, typeof e != "symbol" ? e + "" : e, t);
4
- import { executePSpecPredicate as $t, mapPObjectData as z, mapValueInVOE as Ut, mapPTableDef as ct, isFunctionHandle as ut, normalizeBlockConfig as xe, DefaultNavigationState as Gt } from "@platforma-sdk/model";
4
+ import { executePSpecPredicate as Ut, mapPObjectData as q, mapValueInVOE as $t, mapPTableDef as ct, isFunctionHandle as ut, normalizeBlockConfig as xe, DefaultNavigationState as Gt } from "@platforma-sdk/model";
5
5
  export * from "@platforma-sdk/model";
6
6
  export * from "@milaboratories/pl-model-middle-layer";
7
- import { request as ne } from "undici";
8
- import { RegistryV1 as U, tryLoadPackDescription as lt, BlockPackMetaEmbedAbsoluteBytes as Ht, loadPackDescription as He } from "@platforma-sdk/block-tools";
9
- import j from "node:fs";
10
- import I from "node:path";
11
- import _t from "yaml";
12
- import { assertNever as D, notEmpty as w, HmacSha256Signer as dt, ConsoleLoggerAdapter as Wt } from "@milaboratories/ts-helpers";
13
- import * as zt from "node:fs/promises";
14
- import { tryResolve as qt } from "@milaboratories/resolve-helper";
15
- import { resourceTypesEqual as K, field as S, Pl as y, PlClient as Yt, isNullResourceId as ce, ensureResourceIdNotNull as we, isResource as Qt, isResourceRef as Zt, isNotNullResourceId as _e, resourceType as X, resourceTypeToString as Xt, resourceIdToString as pt, isNotFoundError as er, isTimeoutOrCancelError as tr, toGlobalResourceId as rr } from "@milaboratories/pl-client";
7
+ import { request as $ } from "undici";
8
+ import { RegistryV1 as G, tryLoadPackDescription as lt, BlockPackMetaEmbedAbsoluteBytes as Ht, RegistryV2Reader as Wt, folderReaderByUrl as _t, loadPackDescription as He } from "@platforma-sdk/block-tools";
9
+ import T from "node:fs";
10
+ import V from "node:path";
11
+ import zt from "yaml";
12
+ import { assertNever as D, notEmpty as w, HmacSha256Signer as dt, ConsoleLoggerAdapter as qt } from "@milaboratories/ts-helpers";
13
+ import * as Yt from "node:fs/promises";
14
+ import { tryResolve as Qt } from "@milaboratories/resolve-helper";
15
+ import { resourceTypesEqual as M, field as S, Pl as b, PlClient as Zt, isNullResourceId as ce, ensureResourceIdNotNull as we, isResource as Xt, isResourceRef as er, isNotNullResourceId as We, resourceType as ee, resourceTypeToString as tr, resourceIdToString as pt, isNotFoundError as rr, isTimeoutOrCancelError as or, toGlobalResourceId as sr } from "@milaboratories/pl-client";
16
16
  export * from "@milaboratories/pl-client";
17
- import { SynchronizedTreeState as ht, PlError as or } from "@milaboratories/pl-tree";
18
- import { Computable as P, ChangeSource as We, PollComputablePool as sr, WatchableValue as nr } from "@milaboratories/computable";
19
- import { randomUUID as Y, createHash as he } from "node:crypto";
17
+ import { SynchronizedTreeState as ht, PlError as nr } from "@milaboratories/pl-tree";
18
+ import { Computable as P, ChangeSource as _e, PollComputablePool as ir, WatchableValue as ar } from "@milaboratories/computable";
19
+ import { randomUUID as Q, createHash as he } from "node:crypto";
20
20
  import ft from "denque";
21
- import { Templates as ir } from "@platforma-sdk/workflow-tengo";
22
- import Ee from "canonicalize";
23
- import ar from "node:assert";
24
- import { Scope as Se, getQuickJS as cr } from "quickjs-emscripten";
25
- import { setTimeout as ur } from "node:timers/promises";
21
+ import { Templates as cr } from "@platforma-sdk/workflow-tengo";
22
+ import je from "canonicalize";
23
+ import ur from "node:assert";
24
+ import { Scope as Se, getQuickJS as lr } from "quickjs-emscripten";
25
+ import { setTimeout as dr } from "node:timers/promises";
26
26
  import * as gt from "node:os";
27
- import { createDownloadClient as lr, createLogsClient as dr, createUploadBlobClient as pr, createUploadProgressClient as hr, createLsFilesClient as fr, DownloadDriver as gr, UploadDriver as mr, LogsStreamDriver as vr, LogsDriver as yr, LsDriver as br, DownloadUrlDriver as wr } from "@milaboratories/pl-drivers";
28
- import { PFrame as Sr } from "@milaboratories/pframes-node";
27
+ import { createDownloadClient as pr, createLogsClient as hr, createUploadBlobClient as fr, createUploadProgressClient as gr, createLsFilesClient as mr, DownloadDriver as vr, UploadDriver as yr, LogsStreamDriver as br, LogsDriver as wr, LsDriver as Sr, DownloadUrlDriver as kr } from "@milaboratories/pl-drivers";
28
+ import { PFrame as Cr } from "@milaboratories/pframes-node";
29
29
  async function ze(o) {
30
30
  try {
31
- return await zt.stat(o, { bigint: !0 });
31
+ return await Yt.stat(o, { bigint: !0 });
32
32
  } catch (e) {
33
33
  if (e.code === "ENOENT")
34
34
  return;
35
35
  throw e;
36
36
  }
37
37
  }
38
- const kr = [U.PlPackageYamlConfigFile], Cr = [U.PlPackageJsonConfigFile], Te = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], je = ["config", "dist", "config.json"], mt = ["frontend", "dist"], qe = "block-model/dist/config.json", Pr = "block-ui/package.json", Fr = [
38
+ const Pr = [G.PlPackageYamlConfigFile], Fr = [G.PlPackageJsonConfigFile], Ee = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], Te = ["config", "dist", "config.json"], mt = ["frontend", "dist"], qe = "block-model/dist/config.json", Br = "block-ui/package.json", Rr = [
39
+ Ee,
39
40
  Te,
40
- je,
41
- kr,
42
- Cr,
41
+ Pr,
42
+ Fr,
43
43
  mt
44
44
  ];
45
- async function Br(o) {
46
- return await ze(I.join(o, ...je)) !== void 0 || await ze(I.join(o, ...Te)) !== void 0;
45
+ async function Or(o) {
46
+ return await ze(V.join(o, ...Te)) !== void 0 || await ze(V.join(o, ...Ee)) !== void 0;
47
47
  }
48
48
  function me(o, e) {
49
- const t = qt(o, e);
49
+ const t = Qt(o, e);
50
50
  if (t === void 0) throw new Error(`Can't resolve ${e} against ${o}`);
51
51
  return t;
52
52
  }
53
53
  async function Ye(o, e) {
54
- if (I.isAbsolute(o) || (o = I.resolve(o)), await Br(o))
54
+ if (V.isAbsolute(o) || (o = V.resolve(o)), await Or(o))
55
55
  return {
56
- workflow: I.join(o, ...Te),
57
- config: I.join(o, ...je),
58
- ui: I.join(o, ...mt)
56
+ workflow: V.join(o, ...Ee),
57
+ config: V.join(o, ...Te),
58
+ ui: V.join(o, ...mt)
59
59
  };
60
60
  {
61
- const t = me(o, qe), r = me(o, qe), s = me(o, Pr);
62
- return { workflow: t, config: r, ui: I.resolve(s, "..", "dist") };
61
+ const t = me(o, qe), r = me(o, qe), s = me(o, Br);
62
+ return { workflow: t, config: r, ui: V.resolve(s, "..", "dist") };
63
63
  }
64
64
  }
65
- async function Rr(o) {
65
+ async function Dr(o) {
66
66
  try {
67
- return await j.promises.readFile(o, "utf8");
67
+ return await T.promises.readFile(o, "utf8");
68
68
  } catch (e) {
69
69
  if (e.code === "ENOENT")
70
70
  return;
71
71
  throw e;
72
72
  }
73
73
  }
74
- async function Or(o) {
74
+ async function xr(o) {
75
75
  try {
76
- return await j.promises.stat(o, { bigint: !0 });
76
+ return await T.promises.stat(o, { bigint: !0 });
77
77
  } catch (e) {
78
78
  if (e.code === "ENOENT")
79
79
  return;
@@ -82,19 +82,19 @@ async function Or(o) {
82
82
  }
83
83
  async function vt(o) {
84
84
  let e = 0n;
85
- for (const t of Fr) {
86
- const r = I.join(o, ...t), s = await Or(r);
85
+ for (const t of Rr) {
86
+ const r = V.join(o, ...t), s = await xr(r);
87
87
  s !== void 0 && e < s.mtimeNs && (e = s.mtimeNs);
88
88
  }
89
89
  return e.toString();
90
90
  }
91
91
  async function Ae(o) {
92
- const e = await j.promises.stat(o.components.workflow.main.file, {
92
+ const e = await T.promises.stat(o.components.workflow.main.file, {
93
93
  bigint: !0
94
- }), t = await j.promises.stat(o.components.model.file, { bigint: !0 });
94
+ }), t = await T.promises.stat(o.components.model.file, { bigint: !0 });
95
95
  return (e.mtimeNs > t.mtimeNs ? e.mtimeNs : t.mtimeNs).toString();
96
96
  }
97
- class zs {
97
+ class Qs {
98
98
  constructor(e, t, r) {
99
99
  this.v2Provider = e, this.registries = t, this.http = r;
100
100
  }
@@ -102,30 +102,30 @@ class zs {
102
102
  const t = [], r = e.spec;
103
103
  switch (r.type) {
104
104
  case "remote-v1":
105
- const s = this.http !== void 0 ? { dispatcher: this.http } : {}, i = await (await ne(
106
- `${r.url}/${U.GlobalOverviewPath}`,
105
+ const s = this.http !== void 0 ? { dispatcher: this.http } : {}, i = await (await $(
106
+ `${r.url}/${G.GlobalOverviewPath}`,
107
107
  s
108
108
  )).body.json();
109
109
  for (const a of i) {
110
- const { organization: u, package: c, latestMeta: l, latestVersion: p } = a, h = {
111
- organization: u,
112
- name: c,
110
+ const { organization: c, package: u, latestMeta: l, latestVersion: p } = a, f = {
111
+ organization: c,
112
+ name: u,
113
113
  version: p
114
114
  };
115
115
  t.push({
116
116
  registryId: e.id,
117
- id: h,
117
+ id: f,
118
118
  meta: {
119
119
  title: l.title ?? "No title",
120
120
  description: l.description ?? "No Description",
121
121
  organization: {
122
- name: u,
122
+ name: c,
123
123
  url: "https://unknown.com"
124
124
  }
125
125
  },
126
126
  spec: {
127
127
  type: "from-registry-v1",
128
- id: h,
128
+ id: f,
129
129
  registryUrl: r.url
130
130
  },
131
131
  otherVersions: a.allVersions
@@ -138,20 +138,20 @@ class zs {
138
138
  registryId: e.id
139
139
  }));
140
140
  case "local-dev":
141
- for (const a of await j.promises.readdir(r.path, { withFileTypes: !0 })) {
141
+ for (const a of await T.promises.readdir(r.path, { withFileTypes: !0 })) {
142
142
  if (!a.isDirectory()) continue;
143
- const u = I.join(r.path, a.name), c = await Rr(
144
- I.join(u, U.PlPackageYamlConfigFile)
143
+ const c = V.join(r.path, a.name), u = await Dr(
144
+ V.join(c, G.PlPackageYamlConfigFile)
145
145
  );
146
- if (c !== void 0) {
147
- const l = U.PlPackageConfigData.parse(_t.parse(c)), p = await vt(u), h = {
146
+ if (u !== void 0) {
147
+ const l = G.PlPackageConfigData.parse(zt.parse(u)), p = await vt(c), f = {
148
148
  organization: l.organization,
149
149
  name: l.package,
150
150
  version: "DEV"
151
151
  };
152
152
  t.push({
153
153
  registryId: e.id,
154
- id: h,
154
+ id: f,
155
155
  meta: {
156
156
  title: l.meta.title ?? "No title",
157
157
  description: l.meta.description ?? "No Description",
@@ -162,13 +162,13 @@ class zs {
162
162
  },
163
163
  spec: {
164
164
  type: "dev-v2",
165
- folder: u,
165
+ folder: c,
166
166
  mtime: p
167
167
  },
168
168
  otherVersions: []
169
169
  });
170
170
  } else {
171
- const l = await lt(u);
171
+ const l = await lt(c);
172
172
  if (l !== void 0) {
173
173
  const p = await Ae(l);
174
174
  t.push({
@@ -177,7 +177,7 @@ class zs {
177
177
  meta: await Ht.parseAsync(l.meta),
178
178
  spec: {
179
179
  type: "dev-v2",
180
- folder: u,
180
+ folder: c,
181
181
  mtime: p
182
182
  },
183
183
  otherVersions: []
@@ -197,115 +197,127 @@ class zs {
197
197
  return { registries: t, blockPacks: e };
198
198
  }
199
199
  }
200
- const qs = {
200
+ class jr {
201
+ constructor(e) {
202
+ d(this, "registries", /* @__PURE__ */ new Map());
203
+ this.http = e;
204
+ }
205
+ getRegistry(e) {
206
+ const t = this.registries.get(e);
207
+ if (t) return t;
208
+ const r = new Wt(_t(e, this.http));
209
+ return this.registries.set(e, r), r;
210
+ }
211
+ }
212
+ const Zs = {
201
213
  type: "remote-v2",
202
- url: "https://blocks.pl-open.science/releases"
203
- }, Ys = {
214
+ url: "https://blocks.pl-open.science/"
215
+ }, Xs = {
204
216
  type: "remote-v1",
205
217
  url: "https://block.registry.platforma.bio/releases"
206
- }, Qs = {
218
+ }, en = {
207
219
  type: "remote-v1",
208
220
  url: "https://block.registry.platforma.bio/dev"
209
- }, Dr = {
221
+ }, Er = {
210
222
  groups: [{ id: "default", label: "Default", blocks: [] }]
211
- }, xr = {
223
+ }, Tr = {
212
224
  stagingRefreshTimestamp: 0,
213
225
  blocksInLimbo: []
214
- }, Er = {
226
+ }, Ar = {
215
227
  label: "New Project"
216
- }, Tr = { name: "UserProject", version: "2" }, yt = "SchemaVersion", bt = "1", Ie = "ProjectCreated", Q = "ProjectLastModified", Z = "ProjectMeta", G = "ProjectStructure", ue = "BlockRenderingState", jr = "BlockFrontendState/", Ar = /^BlockFrontendState\/(?<blockid>.*)$/;
228
+ }, Ir = { name: "UserProject", version: "2" }, yt = "SchemaVersion", bt = "1", Ie = "ProjectCreated", Z = "ProjectLastModified", X = "ProjectMeta", H = "ProjectStructure", ue = "BlockRenderingState", Vr = "BlockFrontendState/", Nr = /^BlockFrontendState\/(?<blockid>.*)$/;
217
229
  function ke(o) {
218
- return `${jr}${o}`;
230
+ return `${Vr}${o}`;
219
231
  }
220
- const Ir = "BlockArgsAuthor/";
232
+ const Lr = "BlockArgsAuthor/";
221
233
  function Ce(o) {
222
- return `${Ir}${o}`;
234
+ return `${Lr}${o}`;
223
235
  }
224
236
  const Pe = "ProjectStructureAuthor";
225
- function Vr(o) {
226
- const e = o.match(Ar);
237
+ function Jr(o) {
238
+ const e = o.match(Nr);
227
239
  if (e !== null)
228
240
  return e.groups.blockid;
229
241
  }
230
- const Nr = "__serviceTemplate_";
242
+ const Kr = "__serviceTemplate_";
231
243
  function Fe(o) {
232
- return `${Nr}${o}`;
244
+ return `${Kr}${o}`;
233
245
  }
234
246
  function C(o, e) {
235
247
  return `${o}-${e}`;
236
248
  }
237
- const Lr = /^(?<blockId>.*)-(?<fieldName>blockPack|prodArgs|currentArgs|prodCtx|prodUiCtx|prodOutput|prodCtxPrevious|prodUiCtxPrevious|prodOutputPrevious|stagingCtx|stagingUiCtx|stagingOutput|stagingCtxPrevious|stagingUiCtxPrevious|stagingOutputPrevious)$/;
238
- function Jr(o) {
239
- const e = o.match(Lr);
249
+ const Mr = /^(?<blockId>.*)-(?<fieldName>blockPack|prodArgs|currentArgs|prodCtx|prodUiCtx|prodOutput|prodCtxPrevious|prodUiCtxPrevious|prodOutputPrevious|stagingCtx|stagingUiCtx|stagingOutput|stagingCtxPrevious|stagingUiCtxPrevious|stagingOutputPrevious)$/;
250
+ function Ur(o) {
251
+ const e = o.match(Mr);
240
252
  if (e === null) return;
241
253
  const { blockId: t, fieldName: r } = e.groups;
242
254
  return { blockId: t, fieldName: r };
243
255
  }
244
- const Kr = "projects", wt = { name: "Projects", version: "1" }, Mr = (o) => K(o.type, wt) ? o.fields : [];
245
- async function $r(o, e, t, r) {
256
+ const $r = "projects", wt = { name: "Projects", version: "1" }, Gr = (o) => M(o.type, wt) ? o.fields : [];
257
+ async function Hr(o, e, t, r) {
246
258
  const s = await ht.init(o, e, {
247
259
  ...r.ops.defaultTreeOptions,
248
- pruning: Mr
260
+ pruning: Gr
249
261
  });
250
262
  return { computable: P.make((i) => {
251
- const a = i.accessor(s.entry()).node(), u = t.getValue(i);
263
+ const a = i.accessor(s.entry()).node(), c = t.getValue(i);
252
264
  if (a === void 0) return;
253
- const c = [];
265
+ const u = [];
254
266
  for (const l of a.listDynamicFields()) {
255
267
  const p = a.traverse(l);
256
268
  if (p === void 0) continue;
257
- const h = w(p.getKeyValueAsJson(Z)), g = w(p.getKeyValueAsJson(Ie)), b = w(p.getKeyValueAsJson(Q));
258
- c.push({
269
+ const f = w(p.getKeyValueAsJson(X)), h = w(p.getKeyValueAsJson(Ie)), y = w(p.getKeyValueAsJson(Z));
270
+ u.push({
259
271
  id: l,
260
272
  rid: p.id,
261
- created: new Date(g),
262
- lastModified: new Date(b),
263
- opened: u.indexOf(p.id) >= 0,
264
- meta: h
273
+ created: new Date(h),
274
+ lastModified: new Date(y),
275
+ opened: c.indexOf(p.id) >= 0,
276
+ meta: f
265
277
  });
266
278
  }
267
- return c.sort((l) => -l.lastModified.valueOf()), c;
279
+ return u.sort((l) => -l.lastModified.valueOf()), u;
268
280
  }).withStableType(), tree: s };
269
281
  }
270
- const Ur = {
282
+ const Wr = {
271
283
  name: "EphRenderTemplate",
272
284
  version: "1"
273
- }, Gr = {
285
+ }, _r = {
274
286
  name: "RenderTemplate",
275
287
  version: "1"
276
288
  };
277
289
  function St(o, e, t, r, s) {
278
290
  if (s.length === 0) throw new Error("Zero output names provided");
279
- const n = t ? o.createEphemeral(Ur) : o.createStruct(Gr), i = S(n, "template"), a = S(n, "inputs");
280
- return o.createField(i, "Input", e), o.createField(a, "Input", y.createPlMap(o, r, t)), o.lockInputs(n), y.futureRecord(o, n, s, "Output", "outputs/");
291
+ const n = t ? o.createEphemeral(Wr) : o.createStruct(_r), i = S(n, "template"), a = S(n, "inputs");
292
+ return o.createField(i, "Input", e), o.createField(a, "Input", b.createPlMap(o, r, t)), o.lockInputs(n), b.futureRecord(o, n, s, "Output", "outputs/");
281
293
  }
282
- const Hr = { name: "BContextEnd", version: "1" }, _r = { name: "BContext", version: "1" }, Wr = "id", zr = "parent/", qr = ["context", "result"];
294
+ const zr = { name: "BContextEnd", version: "1" }, qr = { name: "BContext", version: "1" }, Yr = "id", Qr = "parent/", Zr = ["context", "result"];
283
295
  function Qe(o, e, t) {
284
- return St(o, e, !0, t, qr);
296
+ return St(o, e, !0, t, Zr);
285
297
  }
286
- function Yr(o) {
287
- const e = o.createEphemeral(Hr);
298
+ function Xr(o) {
299
+ const e = o.createEphemeral(zr);
288
300
  return o.lock(e), e;
289
301
  }
290
- function Qr(o, e) {
291
- if (e.length === 0) return Yr(o);
302
+ function eo(o, e) {
303
+ if (e.length === 0) return Xr(o);
292
304
  if (e.length === 1) return e[0];
293
- const t = o.createEphemeral(_r);
294
- o.createField(S(t, Wr), "Input", y.createPlString(o, Y()));
305
+ const t = o.createEphemeral(qr);
306
+ o.createField(S(t, Yr), "Input", b.createPlString(o, Q()));
295
307
  for (let r = 0; r < e.length; r++)
296
- o.createField(S(t, `${zr}${r}`), "Input", e[r]);
308
+ o.createField(S(t, `${Qr}${r}`), "Input", e[r]);
297
309
  return o.lock(t), t;
298
310
  }
299
- const Zr = { name: "TengoTemplateGet", version: "1" }, Xr = "registry", eo = "templateURI", to = "template", ro = { name: "TengoTemplatePack", version: "1" }, oo = {
311
+ const to = { name: "TengoTemplateGet", version: "1" }, ro = "registry", oo = "templateURI", so = "template", no = { name: "TengoTemplatePack", version: "1" }, io = {
300
312
  name: "TengoTemplatePackConvert",
301
313
  version: "1"
302
- }, so = "templatePack", no = "template";
303
- async function io(o) {
314
+ }, ao = "templatePack", co = "template";
315
+ async function uo(o) {
304
316
  switch (o.type) {
305
317
  case "from-file":
306
318
  return {
307
319
  type: "explicit",
308
- content: await j.promises.readFile(o.path)
320
+ content: await T.promises.readFile(o.path)
309
321
  };
310
322
  case "from-registry":
311
323
  case "explicit":
@@ -314,20 +326,20 @@ async function io(o) {
314
326
  return D(o);
315
327
  }
316
328
  }
317
- function ao(o, e) {
318
- const t = o.createStruct(Zr), r = S(t, Xr), s = S(t, eo), n = S(t, to);
319
- return o.setField(r, o.createValue(y.JsonString, Buffer.from(JSON.stringify(e.registry)))), o.setField(s, o.createValue(y.JsonString, Buffer.from(JSON.stringify(e.path)))), n;
329
+ function lo(o, e) {
330
+ const t = o.createStruct(to), r = S(t, ro), s = S(t, oo), n = S(t, so);
331
+ return o.setField(r, o.createValue(b.JsonString, Buffer.from(JSON.stringify(e.registry)))), o.setField(s, o.createValue(b.JsonString, Buffer.from(JSON.stringify(e.path)))), n;
320
332
  }
321
- function co(o, e) {
322
- const t = o.createValue(ro, e.content), r = o.createStruct(oo), s = S(r, so), n = S(r, no);
333
+ function po(o, e) {
334
+ const t = o.createValue(no, e.content), r = o.createStruct(io), s = S(r, ao), n = S(r, co);
323
335
  return o.setField(s, t), n;
324
336
  }
325
337
  function Ve(o, e) {
326
338
  switch (e.type) {
327
339
  case "from-registry":
328
- return ao(o, e);
340
+ return lo(o, e);
329
341
  case "explicit":
330
- return co(o, e);
342
+ return po(o, e);
331
343
  default:
332
344
  return D(e);
333
345
  }
@@ -336,7 +348,7 @@ const kt = { name: "Frontend/FromUrl", version: "1" }, Ct = {
336
348
  name: "Frontend/FromFolder",
337
349
  version: "1"
338
350
  };
339
- function uo(o, e) {
351
+ function ho(o, e) {
340
352
  switch (e.type) {
341
353
  case "url":
342
354
  return o.createValue(
@@ -355,34 +367,36 @@ function uo(o, e) {
355
367
  return D(e);
356
368
  }
357
369
  }
358
- const lo = { name: "BlockPackCustom", version: "1" }, Pt = "template", Ft = "frontend";
370
+ const fo = { name: "BlockPackCustom", version: "1" }, Pt = "template", Ft = "frontend";
359
371
  function Ze(o) {
360
372
  return o.endsWith("/") ? o : `${o}/`;
361
373
  }
362
- class po {
363
- constructor(e, t) {
364
- this.signer = e, this.http = t;
374
+ class go {
375
+ constructor(e, t, r) {
376
+ this.v2RegistryProvider = e, this.signer = t, this.http = r;
365
377
  }
366
378
  async getBlockConfig(e) {
367
379
  switch (e.type) {
368
380
  case "explicit":
369
381
  return e.config;
370
382
  case "dev-v1": {
371
- const t = await Ye(e.folder), r = await j.promises.readFile(t.config, { encoding: "utf-8" });
383
+ const t = await Ye(e.folder), r = await T.promises.readFile(t.config, { encoding: "utf-8" });
372
384
  return JSON.parse(r);
373
385
  }
374
386
  case "dev-v2": {
375
- const t = await He(e.folder), r = await j.promises.readFile(t.components.model.file, {
387
+ const t = await He(e.folder), r = await T.promises.readFile(t.components.model.file, {
376
388
  encoding: "utf-8"
377
389
  });
378
390
  return JSON.parse(r);
379
391
  }
380
392
  case "from-registry-v1": {
381
- const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${Ze(e.registryUrl)}${U.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`;
382
- return await (await ne(`${r}/config.json`, t)).body.json();
393
+ const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${Ze(e.registryUrl)}${G.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`;
394
+ return await (await $(`${r}/config.json`, t)).body.json();
395
+ }
396
+ case "from-registry-v2": {
397
+ const t = this.http !== void 0 ? { dispatcher: this.http } : {}, s = await this.v2RegistryProvider.getRegistry(e.registryUrl).getComponents(e.id);
398
+ return await (await $(s.model.url, t)).body.json();
383
399
  }
384
- case "from-registry-v2":
385
- throw new Error("NOT YET SUPPORTED!");
386
400
  default:
387
401
  return D(e);
388
402
  }
@@ -392,8 +406,8 @@ class po {
392
406
  case "explicit":
393
407
  return e;
394
408
  case "dev-v1": {
395
- const t = await Ye(e.folder), r = await j.promises.readFile(t.workflow), s = JSON.parse(
396
- await j.promises.readFile(t.config, "utf-8")
409
+ const t = await Ye(e.folder), r = await T.promises.readFile(t.workflow), s = JSON.parse(
410
+ await T.promises.readFile(t.config, "utf-8")
397
411
  ), n = t.ui;
398
412
  return {
399
413
  type: "explicit",
@@ -412,10 +426,10 @@ class po {
412
426
  }
413
427
  case "dev-v2": {
414
428
  const t = await He(e.folder), r = JSON.parse(
415
- await j.promises.readFile(t.components.model.file, {
429
+ await T.promises.readFile(t.components.model.file, {
416
430
  encoding: "utf-8"
417
431
  })
418
- ), s = await j.promises.readFile(
432
+ ), s = await T.promises.readFile(
419
433
  t.components.workflow.main.file
420
434
  ), n = t.components.ui.folder, i = { ...e };
421
435
  return e.mtime === void 0 && (i.mtime = await Ae(t)), {
@@ -434,19 +448,19 @@ class po {
434
448
  };
435
449
  }
436
450
  case "from-registry-v1": {
437
- const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${Ze(e.registryUrl)}${U.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, s = `${r}/template.plj.gz`, n = await ne(s, t);
451
+ const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${Ze(e.registryUrl)}${G.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, s = `${r}/template.plj.gz`, n = await $(s, t);
438
452
  if (n.statusCode !== 200)
439
453
  throw new Error(
440
454
  `Block not found in registry (url = ${s} ; code = ${n.statusCode}): ` + JSON.stringify(e)
441
455
  );
442
- const i = new Uint8Array(await n.body.arrayBuffer()), u = await (await ne(`${r}/config.json`, t)).body.json();
456
+ const i = new Uint8Array(await n.body.arrayBuffer()), c = await (await $(`${r}/config.json`, t)).body.json();
443
457
  return {
444
458
  type: "explicit",
445
459
  template: {
446
460
  type: "explicit",
447
461
  content: i
448
462
  },
449
- config: u,
463
+ config: c,
450
464
  frontend: {
451
465
  type: "url",
452
466
  url: `${r}/frontend.tgz`
@@ -454,29 +468,43 @@ class po {
454
468
  source: e
455
469
  };
456
470
  }
457
- case "from-registry-v2":
458
- throw new Error("NOT YET SUPPORTED!");
471
+ case "from-registry-v2": {
472
+ const t = this.http !== void 0 ? { dispatcher: this.http } : {}, s = await this.v2RegistryProvider.getRegistry(e.registryUrl).getComponents(e.id), n = async () => await (await $(s.model.url, t)).body.json(), i = async () => await (await $(s.workflow.main.url, t)).body.arrayBuffer(), [a, c] = await Promise.all([n(), i()]);
473
+ return {
474
+ type: "explicit",
475
+ template: {
476
+ type: "explicit",
477
+ content: Buffer.from(c)
478
+ },
479
+ config: a,
480
+ frontend: {
481
+ type: "url",
482
+ url: s.ui.url
483
+ },
484
+ source: e
485
+ };
486
+ }
459
487
  default:
460
488
  return D(e);
461
489
  }
462
490
  }
463
491
  }
464
- function ho(o, e) {
465
- const t = { config: e.config, source: e.source }, r = o.createStruct(lo, JSON.stringify(t));
466
- return o.createField(S(r, Pt), "Input", Ve(o, e.template)), o.createField(S(r, Ft), "Input", uo(o, e.frontend)), o.lock(r), r;
492
+ function mo(o, e) {
493
+ const t = { config: e.config, source: e.source }, r = o.createStruct(fo, JSON.stringify(t));
494
+ return o.createField(S(r, Pt), "Input", Ve(o, e.template)), o.createField(S(r, Ft), "Input", ho(o, e.frontend)), o.lock(r), r;
467
495
  }
468
496
  function Xe(o, e) {
469
497
  switch (e.type) {
470
498
  case "explicit":
471
- return ho(o, e);
499
+ return mo(o, e);
472
500
  default:
473
501
  return D(e.type);
474
502
  }
475
503
  }
476
- function se(o, e) {
504
+ function ne(o, e) {
477
505
  return { __isRef: !0, blockId: o, name: e };
478
506
  }
479
- function fo(o) {
507
+ function vo(o) {
480
508
  return typeof o == "object" && o !== null && o.__isRef === !0 && "blockId" in o && "name" in o;
481
509
  }
482
510
  function Be(o, e, t) {
@@ -492,7 +520,7 @@ function Be(o, e, t) {
492
520
  return;
493
521
  case "object":
494
522
  if (e === null) return;
495
- if (fo(e))
523
+ if (vo(e))
496
524
  t === void 0 || t.has(e.blockId) ? o.upstreams.add(e.blockId) : o.missingReferences = !0;
497
525
  else if (Array.isArray(e))
498
526
  for (const s of e) Be(o, s, t);
@@ -504,11 +532,11 @@ function Be(o, e, t) {
504
532
  D(r);
505
533
  }
506
534
  }
507
- function go(o, e) {
535
+ function yo(o, e) {
508
536
  const t = { upstreams: /* @__PURE__ */ new Set(), missingReferences: !1 };
509
537
  return Be(t, o, e), t;
510
538
  }
511
- function V(o) {
539
+ function N(o) {
512
540
  return {
513
541
  *[Symbol.iterator]() {
514
542
  for (const e of o.groups) for (const t of e.blocks) yield t;
@@ -536,9 +564,9 @@ class Bt {
536
564
  for (; s.length > 0; ) {
537
565
  let i = [];
538
566
  for (const a of s) {
539
- const u = this.nodes.get(a);
540
- r(u), u[e].forEach((c) => {
541
- n.has(c) || (n.add(c), i.push(c));
567
+ const c = this.nodes.get(a);
568
+ r(c), c[e].forEach((u) => {
569
+ n.has(u) || (n.add(u), i.push(u));
542
570
  });
543
571
  }
544
572
  s = i;
@@ -548,7 +576,7 @@ class Bt {
548
576
  function Re(o) {
549
577
  const e = /* @__PURE__ */ new Map();
550
578
  let t;
551
- for (const { id: r } of V(o)) {
579
+ for (const { id: r } of N(o)) {
552
580
  const s = {
553
581
  id: r,
554
582
  missingReferences: !1
@@ -559,21 +587,21 @@ function Re(o) {
559
587
  }
560
588
  function ie(o, e) {
561
589
  const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
562
- for (const { id: s } of V(o)) {
590
+ for (const { id: s } of N(o)) {
563
591
  const n = e(s);
564
592
  if (n === void 0) continue;
565
- const i = go(n, r), a = {
593
+ const i = yo(n, r), a = {
566
594
  id: s,
567
595
  missingReferences: i.missingReferences,
568
596
  upstream: i.upstreams,
569
597
  downstream: /* @__PURE__ */ new Set()
570
598
  // will be populated from downstream blocks
571
599
  };
572
- t.set(s, a), i.upstreams.forEach((u) => t.get(u).downstream.add(s)), r.add(s);
600
+ t.set(s, a), i.upstreams.forEach((c) => t.get(c).downstream.add(s)), r.add(s);
573
601
  }
574
602
  return new Bt(t);
575
603
  }
576
- function mo(o, e) {
604
+ function bo(o, e) {
577
605
  if (o.size !== e.size) return !1;
578
606
  for (const t of o) if (!e.has(t)) return !1;
579
607
  return !0;
@@ -587,7 +615,7 @@ function et(o, e) {
587
615
  const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
588
616
  return o.nodes.forEach((n) => {
589
617
  const i = e.nodes.get(n.id);
590
- i === void 0 ? t.add(n.id) : (!mo(n.upstream, i.upstream) || Oe(n.upstream, s)) && s.add(n.id);
618
+ i === void 0 ? t.add(n.id) : (!bo(n.upstream, i.upstream) || Oe(n.upstream, s)) && s.add(n.id);
591
619
  }), e.nodes.forEach((n) => {
592
620
  o.nodes.has(n.id) ? Oe(n.upstream, s) && s.add(n.id) : r.add(n.id);
593
621
  }), { onlyInA: t, onlyInB: r, different: s };
@@ -595,14 +623,14 @@ function et(o, e) {
595
623
  let ve;
596
624
  async function Rt() {
597
625
  if (ve === void 0) {
598
- const o = await io(ir["pframes.export-pframe"]);
626
+ const o = await uo(cr["pframes.export-pframe"]);
599
627
  if (o.type !== "explicit") throw new Error("Unexpected prepared template type.");
600
628
  const e = he("sha256").update(o.content).digest("hex");
601
629
  ve = { spec: o, hash: e };
602
630
  }
603
631
  return ve;
604
632
  }
605
- function vo(o, e, t) {
633
+ function wo(o, e, t) {
606
634
  return St(o, e, !0, { pf: t }, ["result"]).result;
607
635
  }
608
636
  function ye(o, e) {
@@ -673,17 +701,17 @@ class tt {
673
701
  }
674
702
  getTemplate(e) {
675
703
  return e.getFutureFieldValue(
676
- y.unwrapHolder(e, this.fields.blockPack.ref),
704
+ b.unwrapHolder(e, this.fields.blockPack.ref),
677
705
  Pt,
678
706
  "Input"
679
707
  );
680
708
  }
681
709
  }
682
- const yo = (o) => {
710
+ const So = (o) => {
683
711
  throw new Error(`No new block info for ${o}`);
684
712
  };
685
713
  class le {
686
- constructor(e, t, r, s, n, i, a, u, c, l, p, h) {
714
+ constructor(e, t, r, s, n, i, a, c, u, l, p, f) {
687
715
  d(this, "globalModCount", 0);
688
716
  d(this, "fieldsChanged", !1);
689
717
  //
@@ -702,7 +730,7 @@ class le {
702
730
  d(this, "stagingGraph");
703
731
  d(this, "pendingProductionGraph");
704
732
  d(this, "actualProductionGraph");
705
- this.rid = e, this.tx = t, this.author = r, this.schema = s, this.lastModified = n, this.meta = i, this.struct = a, this.renderingState = u, this.blocksInLimbo = c, this.blockInfos = l, this.blockFrontendStates = p, this.ctxExportTplHolder = h;
733
+ this.rid = e, this.tx = t, this.author = r, this.schema = s, this.lastModified = n, this.meta = i, this.struct = a, this.renderingState = c, this.blocksInLimbo = u, this.blockInfos = l, this.blockFrontendStates = p, this.ctxExportTplHolder = f;
706
734
  }
707
735
  fixProblems() {
708
736
  this.blockInfos.forEach((e) => {
@@ -737,7 +765,7 @@ class le {
737
765
  return w(this.blockInfos.get(e));
738
766
  }
739
767
  getBlock(e) {
740
- for (const t of V(this.struct)) if (t.id === e) return t;
768
+ for (const t of N(this.struct)) if (t.id === e) return t;
741
769
  throw new Error("block not found");
742
770
  }
743
771
  setBlockFieldObj(e, t, r) {
@@ -794,7 +822,7 @@ class le {
794
822
  JSON.parse(s);
795
823
  const i = Buffer.from(s);
796
824
  if (Buffer.compare(n.fields.currentArgs.value, i) === 0) continue;
797
- const a = this.tx.createValue(y.JsonObject, i);
825
+ const a = this.tx.createValue(b.JsonObject, i);
798
826
  this.setBlockField(r, "currentArgs", a, "Ready", i), this.blocksWithChangedInputs.add(r), t.push(r);
799
827
  }
800
828
  this.getStagingGraph().traverse("downstream", t, ({ id: r }) => this.resetStaging(r)), t.length > 0 && this.updateLastModified();
@@ -807,7 +835,7 @@ class le {
807
835
  setBlockLabel(e, t) {
808
836
  const r = this.structure;
809
837
  let s = !1;
810
- for (const n of V(r))
838
+ for (const n of N(r))
811
839
  if (n.id === e) {
812
840
  n.label = t, s = !0;
813
841
  break;
@@ -821,11 +849,11 @@ class le {
821
849
  const n = this.getBlockInfo(s);
822
850
  if (n.fields[t] === void 0 || n.fields[t].ref === void 0)
823
851
  throw new Error("One of the upstreams staging is not rendered.");
824
- r.push(y.unwrapHolder(this.tx, n.fields[t].ref));
825
- }), Qr(this.tx, r);
852
+ r.push(b.unwrapHolder(this.tx, n.fields[t].ref));
853
+ }), eo(this.tx, r);
826
854
  }
827
855
  exportCtx(e) {
828
- return vo(this.tx, y.unwrapHolder(this.tx, this.ctxExportTplHolder), e);
856
+ return wo(this.tx, b.unwrapHolder(this.tx, this.ctxExportTplHolder), e);
829
857
  }
830
858
  renderStagingFor(e) {
831
859
  this.resetStaging(e);
@@ -833,14 +861,14 @@ class le {
833
861
  if (this.getBlock(e).renderingMode !== "Heavy") throw new Error("not supported yet");
834
862
  const s = t.getTemplate(this.tx), n = Qe(this.tx, s, {
835
863
  args: t.fields.currentArgs.ref,
836
- blockId: this.tx.createValue(y.JsonString, JSON.stringify(e)),
837
- isProduction: this.tx.createValue(y.JsonBool, JSON.stringify(!1)),
864
+ blockId: this.tx.createValue(b.JsonString, JSON.stringify(e)),
865
+ isProduction: this.tx.createValue(b.JsonBool, JSON.stringify(!1)),
838
866
  context: r
839
867
  });
840
868
  this.setBlockField(
841
869
  e,
842
870
  "stagingCtx",
843
- y.wrapInEphHolder(this.tx, n.context),
871
+ b.wrapInEphHolder(this.tx, n.context),
844
872
  "NotReady"
845
873
  ), this.setBlockField(e, "stagingUiCtx", this.exportCtx(n.context), "NotReady"), this.setBlockField(e, "stagingOutput", n.result, "NotReady");
846
874
  }
@@ -854,14 +882,14 @@ class le {
854
882
  throw new Error("Can't render production for light block.");
855
883
  const s = t.getTemplate(this.tx), n = Qe(this.tx, s, {
856
884
  args: t.fields.currentArgs.ref,
857
- blockId: this.tx.createValue(y.JsonString, JSON.stringify(e)),
858
- isProduction: this.tx.createValue(y.JsonBool, JSON.stringify(!0)),
885
+ blockId: this.tx.createValue(b.JsonString, JSON.stringify(e)),
886
+ isProduction: this.tx.createValue(b.JsonBool, JSON.stringify(!0)),
859
887
  context: r
860
888
  });
861
889
  this.setBlockField(
862
890
  e,
863
891
  "prodCtx",
864
- y.wrapInEphHolder(this.tx, n.context),
892
+ b.wrapInEphHolder(this.tx, n.context),
865
893
  "NotReady"
866
894
  ), 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);
867
895
  }
@@ -869,29 +897,29 @@ class le {
869
897
  // Structure changes
870
898
  //
871
899
  /** Very generic method, better check for more specialized case-specific methods first. */
872
- updateStructure(e, t = yo) {
900
+ updateStructure(e, t = So) {
873
901
  const r = this.getStagingGraph(), s = this.getActualProductionGraph(), n = Re(e), i = ie(
874
902
  e,
875
- (c) => {
903
+ (u) => {
876
904
  var l;
877
- return (l = this.blockInfos.get(c)) == null ? void 0 : l.actualProductionInputs;
905
+ return (l = this.blockInfos.get(u)) == null ? void 0 : l.actualProductionInputs;
878
906
  }
879
- ), a = et(r, n), u = et(s, i);
880
- for (const c of a.onlyInA) {
881
- const { fields: l } = this.getBlockInfo(c);
882
- this.deleteBlockFields(c, ...Object.keys(l)), this.blockInfos.delete(c), this.blocksInLimbo.delete(c) && (this.renderingStateChanged = !0), this.blockFrontendStates.delete(c) && this.changedBlockFrontendStates.add(c);
907
+ ), a = et(r, n), c = et(s, i);
908
+ for (const u of a.onlyInA) {
909
+ const { fields: l } = this.getBlockInfo(u);
910
+ this.deleteBlockFields(u, ...Object.keys(l)), this.blockInfos.delete(u), this.blocksInLimbo.delete(u) && (this.renderingStateChanged = !0), this.blockFrontendStates.delete(u) && this.changedBlockFrontendStates.add(u);
883
911
  }
884
- for (const c of a.onlyInB) {
885
- const l = new tt(c, {});
886
- this.blockInfos.set(c, l);
887
- const p = t(c), h = Xe(this.tx, p.blockPack);
888
- this.setBlockField(c, "blockPack", y.wrapInHolder(this.tx, h), "NotReady");
889
- const g = Buffer.from(p.args), b = this.tx.createValue(y.JsonObject, g);
890
- this.setBlockField(c, "currentArgs", b, "Ready", g), l.check();
912
+ for (const u of a.onlyInB) {
913
+ const l = new tt(u, {});
914
+ this.blockInfos.set(u, l);
915
+ const p = t(u), f = Xe(this.tx, p.blockPack);
916
+ this.setBlockField(u, "blockPack", b.wrapInHolder(this.tx, f), "NotReady");
917
+ const h = Buffer.from(p.args), y = this.tx.createValue(b.JsonObject, h);
918
+ this.setBlockField(u, "currentArgs", y, "Ready", h), l.check();
891
919
  }
892
- for (const c of a.different) this.resetStaging(c);
893
- s.traverse("downstream", [...u.different], (c) => {
894
- this.resetOrLimboProduction(c.id);
920
+ for (const u of a.different) this.resetStaging(u);
921
+ s.traverse("downstream", [...c.different], (u) => {
922
+ this.resetOrLimboProduction(u.id);
895
923
  }), (a.onlyInB.size > 0 || a.onlyInA.size > 0 || a.different.size > 0) && this.resetStagingRefreshTimestamp(), this.struct = e, this.structureChanged = !0, this.stagingGraph = void 0, this.pendingProductionGraph = void 0, this.actualProductionGraph = void 0, this.updateLastModified();
896
924
  }
897
925
  //
@@ -904,7 +932,7 @@ class le {
904
932
  else {
905
933
  let n = !1;
906
934
  for (const i of s.groups) {
907
- const a = i.blocks.findIndex((u) => u.id === r);
935
+ const a = i.blocks.findIndex((c) => c.id === r);
908
936
  if (!(a < 0)) {
909
937
  i.blocks.splice(a, 0, e), n = !0;
910
938
  break;
@@ -938,7 +966,7 @@ class le {
938
966
  this.setBlockField(
939
967
  e,
940
968
  "blockPack",
941
- y.wrapInHolder(this.tx, Xe(this.tx, t)),
969
+ b.wrapInHolder(this.tx, Xe(this.tx, t)),
942
970
  "NotReady"
943
971
  ), r !== void 0 ? (this.setArgs([{ blockId: e, args: r }]), this.setUiState(e, void 0)) : this.getStagingGraph().traverse("downstream", [e], ({ id: n }) => this.resetStaging(n)), s.productionRendered && this.getActualProductionGraph().traverse(
944
972
  "downstream",
@@ -959,17 +987,17 @@ class le {
959
987
  for (const i of r) {
960
988
  const a = s.nodes.get(i);
961
989
  if (a === void 0) throw new Error(`Can't find block with id: ${i}`);
962
- for (const u of a.upstream)
963
- if (!r.has(u))
990
+ for (const c of a.upstream)
991
+ if (!r.has(c))
964
992
  throw new Error("Can't render blocks not including all upstreams.");
965
993
  }
966
994
  const n = /* @__PURE__ */ new Set();
967
- for (const i of V(this.structure)) {
995
+ for (const i of N(this.structure)) {
968
996
  if (!r.has(i.id)) continue;
969
997
  let a = this.getBlockInfo(i.id).requireProductionRendering || this.blocksInLimbo.has(i.id);
970
998
  if (!a) {
971
- for (const u of s.nodes.get(i.id).upstream)
972
- if (n.has(u)) {
999
+ for (const c of s.nodes.get(i.id).upstream)
1000
+ if (n.has(c)) {
973
1001
  a = !0;
974
1002
  break;
975
1003
  }
@@ -986,23 +1014,23 @@ class le {
986
1014
  var i, a;
987
1015
  const t = this.getActualProductionGraph(), r = new ft(e), s = new Set(e), n = [];
988
1016
  for (; !r.isEmpty(); ) {
989
- const u = r.shift(), c = this.getBlockInfo(u).fields;
990
- if (!(((i = c.prodOutput) == null ? void 0 : i.status) === "Ready" && ((a = c.prodCtx) == null ? void 0 : a.status) === "Ready") && this.deleteBlockFields(u, "prodOutput", "prodCtx", "prodUiCtx", "prodArgs")) {
991
- n.push(u);
992
- for (const l of t.traverseIdsExcludingRoots("downstream", u))
1017
+ const c = r.shift(), u = this.getBlockInfo(c).fields;
1018
+ if (!(((i = u.prodOutput) == null ? void 0 : i.status) === "Ready" && ((a = u.prodCtx) == null ? void 0 : a.status) === "Ready") && this.deleteBlockFields(c, "prodOutput", "prodCtx", "prodUiCtx", "prodArgs")) {
1019
+ n.push(c);
1020
+ for (const l of t.traverseIdsExcludingRoots("downstream", c))
993
1021
  s.has(l) || (r.push(l), s.add(l));
994
1022
  }
995
1023
  }
996
- for (const u of t.traverseIdsExcludingRoots("downstream", ...n))
997
- this.resetOrLimboProduction(u);
1024
+ for (const c of t.traverseIdsExcludingRoots("downstream", ...n))
1025
+ this.resetOrLimboProduction(c);
998
1026
  }
999
1027
  traverseWithStagingLag(e) {
1000
1028
  const t = /* @__PURE__ */ new Map();
1001
1029
  this.getStagingGraph().nodes.forEach((s) => {
1002
1030
  let i = this.getBlockInfo(s.id).stagingRendered ? 0 : 1;
1003
1031
  s.upstream.forEach((a) => {
1004
- const u = t.get(a);
1005
- u !== 0 && (i = Math.max(u + 1, i));
1032
+ const c = t.get(a);
1033
+ c !== 0 && (i = Math.max(c + 1, i));
1006
1034
  }), e(s.id, i), t.set(s.id, i);
1007
1035
  });
1008
1036
  }
@@ -1049,14 +1077,14 @@ class le {
1049
1077
  }
1050
1078
  save() {
1051
1079
  if (this.wasModified) {
1052
- this.lastModifiedChanged && this.tx.setKValue(this.rid, Q, JSON.stringify(this.lastModified)), this.structureChanged && this.tx.setKValue(this.rid, G, JSON.stringify(this.struct)), this.renderingStateChanged && this.tx.setKValue(
1080
+ this.lastModifiedChanged && this.tx.setKValue(this.rid, Z, JSON.stringify(this.lastModified)), this.structureChanged && this.tx.setKValue(this.rid, H, JSON.stringify(this.struct)), this.renderingStateChanged && this.tx.setKValue(
1053
1081
  this.rid,
1054
1082
  ue,
1055
1083
  JSON.stringify({
1056
1084
  ...this.renderingState,
1057
1085
  blocksInLimbo: [...this.blocksInLimbo]
1058
1086
  })
1059
- ), this.metaChanged && this.tx.setKValue(this.rid, Z, JSON.stringify(this.meta));
1087
+ ), this.metaChanged && this.tx.setKValue(this.rid, X, JSON.stringify(this.meta));
1060
1088
  for (const e of this.changedBlockFrontendStates) {
1061
1089
  const t = this.blockFrontendStates.get(e);
1062
1090
  t === void 0 ? this.tx.deleteKValue(this.rid, ke(e)) : this.tx.setKValue(this.rid, ke(e), t);
@@ -1065,111 +1093,111 @@ class le {
1065
1093
  }
1066
1094
  }
1067
1095
  static async load(e, t, r) {
1068
- const s = e.getResourceData(t, !0), n = e.getKValueJson(t, yt), i = e.getKValueJson(t, Q), a = e.getKValueJson(t, Z), u = e.getKValueJson(t, G), c = e.getKValueJson(t, ue), l = e.listKeyValuesString(t), [
1096
+ const s = e.getResourceData(t, !0), n = e.getKValueJson(t, yt), i = e.getKValueJson(t, Z), a = e.getKValueJson(t, X), c = e.getKValueJson(t, H), u = e.getKValueJson(t, ue), l = e.listKeyValuesString(t), [
1069
1097
  p,
1098
+ f,
1070
1099
  h,
1071
- g,
1072
- b,
1073
- B,
1074
- { stagingRefreshTimestamp: M, blocksInLimbo: ee },
1075
- te
1100
+ y,
1101
+ O,
1102
+ { stagingRefreshTimestamp: A, blocksInLimbo: te },
1103
+ re
1076
1104
  ] = await Promise.all([
1077
1105
  s,
1078
1106
  n,
1079
1107
  i,
1080
1108
  a,
1081
- u,
1082
1109
  c,
1110
+ u,
1083
1111
  l
1084
1112
  ]);
1085
- if (h !== bt)
1113
+ if (f !== bt)
1086
1114
  throw new Error(
1087
- `Can't act on this project resource because it has a wrong schema version: ${h}`
1115
+ `Can't act on this project resource because it has a wrong schema version: ${f}`
1088
1116
  );
1089
- const $ = /* @__PURE__ */ new Map();
1117
+ const U = /* @__PURE__ */ new Map();
1090
1118
  for (const v of p.fields) {
1091
- const O = Jr(v.name);
1092
- if (O === void 0) continue;
1093
- let F = $.get(O.blockId);
1119
+ const R = Ur(v.name);
1120
+ if (R === void 0) continue;
1121
+ let F = U.get(R.blockId);
1094
1122
  F === void 0 && (F = {
1095
- id: O.blockId,
1123
+ id: R.blockId,
1096
1124
  fields: {}
1097
- }, $.set(O.blockId, F)), F.fields[O.fieldName] = ce(v.value) ? { modCount: 0 } : { modCount: 0, ref: v.value };
1125
+ }, U.set(R.blockId, F)), F.fields[R.fieldName] = ce(v.value) ? { modCount: 0 } : { modCount: 0, ref: v.value };
1098
1126
  }
1099
- const H = await Rt(), re = Fe(H.hash), k = p.fields.find(
1100
- (v) => v.name === re
1127
+ const W = await Rt(), oe = Fe(W.hash), k = p.fields.find(
1128
+ (v) => v.name === oe
1101
1129
  );
1102
- let L;
1103
- k !== void 0 ? L = we(k.value) : (L = y.wrapInHolder(e, Ve(e, H.spec)), e.createField(
1104
- S(t, Fe(H.hash)),
1130
+ let J;
1131
+ k !== void 0 ? J = we(k.value) : (J = b.wrapInHolder(e, Ve(e, W.spec)), e.createField(
1132
+ S(t, Fe(W.hash)),
1105
1133
  "Dynamic",
1106
- L
1134
+ J
1107
1135
  ));
1108
- const _ = { stagingRefreshTimestamp: M }, T = new Set(ee), x = /* @__PURE__ */ new Map();
1109
- for (const v of te) {
1110
- const O = Vr(v.key);
1111
- O !== void 0 && x.set(O, v.value);
1136
+ const _ = { stagingRefreshTimestamp: A }, E = new Set(te), x = /* @__PURE__ */ new Map();
1137
+ for (const v of re) {
1138
+ const R = Jr(v.key);
1139
+ R !== void 0 && x.set(R, v.value);
1112
1140
  }
1113
- const R = [];
1114
- $.forEach(({ id: v, fields: O }) => {
1115
- for (const [, F] of Object.entries(O))
1141
+ const B = [];
1142
+ U.forEach(({ id: v, fields: R }) => {
1143
+ for (const [, F] of Object.entries(R))
1116
1144
  if (F.ref !== void 0) {
1117
- if (!Qt(F.ref) || Zt(F.ref))
1145
+ if (!Xt(F.ref) || er(F.ref))
1118
1146
  throw new Error("unexpected behaviour");
1119
- R.push([F, e.getResourceData(F.ref, !1)]);
1147
+ B.push([F, e.getResourceData(F.ref, !1)]);
1120
1148
  }
1121
1149
  });
1122
- for (const [v, O] of R) {
1123
- const F = await O;
1124
- v.value = F.data, _e(F.error) ? v.status = "Error" : F.resourceReady || _e(F.originalResourceId) ? v.status = "Ready" : v.status = "NotReady";
1150
+ for (const [v, R] of B) {
1151
+ const F = await R;
1152
+ v.value = F.data, We(F.error) ? v.status = "Error" : F.resourceReady || We(F.originalResourceId) ? v.status = "Ready" : v.status = "NotReady";
1125
1153
  }
1126
- const J = /* @__PURE__ */ new Map();
1127
- $.forEach(({ id: v, fields: O }) => J.set(v, new tt(v, O)));
1128
- const N = /* @__PURE__ */ new Set();
1129
- for (const v of V(B)) {
1130
- if (!J.has(v.id))
1154
+ const K = /* @__PURE__ */ new Map();
1155
+ U.forEach(({ id: v, fields: R }) => K.set(v, new tt(v, R)));
1156
+ const L = /* @__PURE__ */ new Set();
1157
+ for (const v of N(O)) {
1158
+ if (!K.has(v.id))
1131
1159
  throw new Error(`Inconsistent project structure: no inputs for ${v.id}`);
1132
- N.add(v.id);
1160
+ L.add(v.id);
1133
1161
  }
1134
- J.forEach((v) => {
1135
- if (!N.has(v.id))
1162
+ K.forEach((v) => {
1163
+ if (!L.has(v.id))
1136
1164
  throw new Error(`Inconsistent project structure: no structure entry for ${v.id}`);
1137
1165
  v.check();
1138
1166
  });
1139
- const oe = new le(
1167
+ const se = new le(
1140
1168
  t,
1141
1169
  e,
1142
1170
  r,
1171
+ f,
1143
1172
  h,
1144
- g,
1145
- b,
1146
- B,
1173
+ y,
1174
+ O,
1147
1175
  _,
1148
- T,
1149
- J,
1176
+ E,
1177
+ K,
1150
1178
  x,
1151
- L
1179
+ J
1152
1180
  );
1153
- return oe.fixProblems(), oe;
1181
+ return se.fixProblems(), se;
1154
1182
  }
1155
1183
  }
1156
- async function bo(o, e = Er) {
1157
- const t = o.createEphemeral(Tr);
1184
+ async function ko(o, e = Ar) {
1185
+ const t = o.createEphemeral(Ir);
1158
1186
  o.lock(t);
1159
1187
  const r = String(Date.now());
1160
- o.setKValue(t, yt, JSON.stringify(bt)), o.setKValue(t, Ie, r), o.setKValue(t, Q, r), o.setKValue(t, Z, JSON.stringify(e)), o.setKValue(t, G, JSON.stringify(Dr)), o.setKValue(t, ue, JSON.stringify(xr));
1188
+ o.setKValue(t, yt, JSON.stringify(bt)), o.setKValue(t, Ie, r), o.setKValue(t, Z, r), o.setKValue(t, X, JSON.stringify(e)), o.setKValue(t, H, JSON.stringify(Er)), o.setKValue(t, ue, JSON.stringify(Tr));
1161
1189
  const s = await Rt();
1162
1190
  return o.createField(
1163
1191
  S(t, Fe(s.hash)),
1164
1192
  "Dynamic",
1165
- y.wrapInHolder(o, Ve(o, s.spec))
1193
+ b.wrapInHolder(o, Ve(o, s.spec))
1166
1194
  ), t;
1167
1195
  }
1168
1196
  async function be(o, e, t) {
1169
- return A(o, e, void 0, t);
1197
+ return I(o, e, void 0, t);
1170
1198
  }
1171
- async function A(o, e, t, r) {
1172
- if (o instanceof Yt)
1199
+ async function I(o, e, t, r) {
1200
+ if (o instanceof Zt)
1173
1201
  return await o.withWriteTx("ProjectAction", async (s) => {
1174
1202
  const n = await le.load(s, e, t), i = await r(n);
1175
1203
  return n.wasModified && (n.save(), await s.commit()), i;
@@ -1179,7 +1207,7 @@ async function A(o, e, t, r) {
1179
1207
  return s.save(), n;
1180
1208
  }
1181
1209
  }
1182
- function* wo(o) {
1210
+ function* Co(o) {
1183
1211
  switch (o.type) {
1184
1212
  case "Json":
1185
1213
  return;
@@ -1199,7 +1227,7 @@ function rt(o, e) {
1199
1227
  Object.entries(o).map(([t, r]) => [t, e(r, t)])
1200
1228
  );
1201
1229
  }
1202
- function So(o, e) {
1230
+ function Po(o, e) {
1203
1231
  switch (o.type) {
1204
1232
  case "Json":
1205
1233
  return { ...o };
@@ -1217,26 +1245,26 @@ function So(o, e) {
1217
1245
  D(o);
1218
1246
  }
1219
1247
  }
1220
- const ko = X("PColumnData/JsonPartitioned", "1"), Co = X(
1248
+ const Fo = ee("PColumnData/JsonPartitioned", "1"), Bo = ee(
1221
1249
  "PColumnData/Partitioned/JsonPartitioned",
1222
1250
  "1"
1223
- ), Po = X("PColumnData/BinaryPartitioned", "1"), Fo = X(
1251
+ ), Ro = ee("PColumnData/BinaryPartitioned", "1"), Oo = ee(
1224
1252
  "PColumnData/Partitioned/BinaryPartitioned",
1225
1253
  "1"
1226
- ), Bo = X("PColumnData/Json", "1");
1227
- function Ro(o) {
1254
+ ), Do = ee("PColumnData/Json", "1");
1255
+ function xo(o) {
1228
1256
  if (!o.getIsReadyOrError()) throw new Error("Data not ready.");
1229
1257
  const e = o.getDataAsJson();
1230
1258
  if (e === void 0)
1231
1259
  throw new Error("unexpected data info structure, no resource data");
1232
- if (K(o.resourceType, Bo)) {
1260
+ if (M(o.resourceType, Do)) {
1233
1261
  const t = e;
1234
1262
  return {
1235
1263
  type: "Json",
1236
1264
  keyLength: t.keyLength,
1237
1265
  data: t.data
1238
1266
  };
1239
- } else if (K(o.resourceType, ko)) {
1267
+ } else if (M(o.resourceType, Fo)) {
1240
1268
  const t = e, r = Object.fromEntries(
1241
1269
  o.listInputFields().map((s) => [s, o.traverse({ field: s, errorIfFieldNotSet: !0 }).resourceInfo])
1242
1270
  );
@@ -1245,14 +1273,14 @@ function Ro(o) {
1245
1273
  partitionKeyLength: t.partitionKeyLength,
1246
1274
  parts: r
1247
1275
  };
1248
- } else if (K(o.resourceType, Co)) {
1276
+ } else if (M(o.resourceType, Bo)) {
1249
1277
  const t = e, r = {};
1250
1278
  for (const s of o.listInputFields()) {
1251
1279
  const n = o.traverse({ field: s, errorIfFieldNotSet: !0 }), i = n.listInputFields();
1252
1280
  if (i === void 0) throw new Error(`no partition keys for super key ${s}`);
1253
1281
  for (const a of i) {
1254
- const u = s.slice(0, s.length - 1) + "," + a.slice(1, a.length);
1255
- r[u] = n.traverse({ field: a, errorIfFieldNotSet: !0 }).resourceInfo;
1282
+ const c = s.slice(0, s.length - 1) + "," + a.slice(1, a.length);
1283
+ r[c] = n.traverse({ field: a, errorIfFieldNotSet: !0 }).resourceInfo;
1256
1284
  }
1257
1285
  }
1258
1286
  return {
@@ -1260,7 +1288,7 @@ function Ro(o) {
1260
1288
  partitionKeyLength: t.superPartitionKeyLength + t.partitionKeyLength,
1261
1289
  parts: r
1262
1290
  };
1263
- } else if (K(o.resourceType, Po)) {
1291
+ } else if (M(o.resourceType, Ro)) {
1264
1292
  const t = e, r = {};
1265
1293
  for (const s of o.listInputFields())
1266
1294
  if (s.endsWith(".index")) {
@@ -1281,23 +1309,23 @@ function Ro(o) {
1281
1309
  partitionKeyLength: t.partitionKeyLength,
1282
1310
  parts: r
1283
1311
  };
1284
- } else if (K(o.resourceType, Fo)) {
1312
+ } else if (M(o.resourceType, Oo)) {
1285
1313
  const t = e, r = {};
1286
1314
  for (const s of o.listInputFields()) {
1287
1315
  const n = o.traverse({ field: s, errorIfFieldNotSet: !0 }), i = n.listInputFields();
1288
1316
  if (i === void 0) throw new Error(`no partition keys for super key ${s}`);
1289
1317
  for (const a of i)
1290
1318
  if (a.endsWith(".index")) {
1291
- const u = a.slice(0, a.length - 6), c = s.slice(0, s.length - 1) + "," + u.slice(1, u.length);
1292
- let l = r[c];
1293
- l === void 0 && (l = {}, r[c] = l), r[c].index = n.traverse({
1319
+ const c = a.slice(0, a.length - 6), u = s.slice(0, s.length - 1) + "," + c.slice(1, c.length);
1320
+ let l = r[u];
1321
+ l === void 0 && (l = {}, r[u] = l), r[u].index = n.traverse({
1294
1322
  field: a,
1295
1323
  errorIfFieldNotSet: !0
1296
1324
  }).resourceInfo;
1297
1325
  } else if (a.endsWith(".values")) {
1298
- const u = a.slice(0, a.length - 7), c = s.slice(0, s.length - 1) + "," + u.slice(1, u.length);
1299
- let l = r[c];
1300
- l === void 0 && (l = {}, r[c] = l), r[c].values = n.traverse({
1326
+ const c = a.slice(0, a.length - 7), u = s.slice(0, s.length - 1) + "," + c.slice(1, c.length);
1327
+ let l = r[u];
1328
+ l === void 0 && (l = {}, r[u] = l), r[u].values = n.traverse({
1301
1329
  field: a,
1302
1330
  errorIfFieldNotSet: !0
1303
1331
  }).resourceInfo;
@@ -1309,14 +1337,14 @@ function Ro(o) {
1309
1337
  parts: r
1310
1338
  };
1311
1339
  }
1312
- throw new Error(`unsupported resource type: ${Xt(o.resourceType)}`);
1340
+ throw new Error(`unsupported resource type: ${tr(o.resourceType)}`);
1313
1341
  }
1314
1342
  function Ot(o, e) {
1315
1343
  const t = he("sha256");
1316
- return t.update(Ee(o)), t.update(String(ce(e.originalId) ? e.id : e.originalId)), t.digest().toString("hex");
1344
+ return t.update(je(o)), t.update(String(ce(e.originalId) ? e.id : e.originalId)), t.digest().toString("hex");
1317
1345
  }
1318
1346
  function Dt(o, e = !0, t = !1, r = "") {
1319
- var a, u, c;
1347
+ var a, c, u;
1320
1348
  const s = /^(?<name>.*)\.(?<type>spec|data)$/, n = /* @__PURE__ */ new Map();
1321
1349
  for (const l of o.listInputFields()) {
1322
1350
  const p = l.match(s);
@@ -1324,24 +1352,24 @@ function Dt(o, e = !0, t = !1, r = "") {
1324
1352
  if (e) throw new Error(`unexpected field name ${l}`);
1325
1353
  continue;
1326
1354
  }
1327
- let h = w((a = p.groups) == null ? void 0 : a.name);
1328
- if (!h.startsWith(r)) {
1355
+ let f = w((a = p.groups) == null ? void 0 : a.name);
1356
+ if (!f.startsWith(r)) {
1329
1357
  if (e) throw new Error(`unexpected field name ${l}`);
1330
1358
  continue;
1331
1359
  }
1332
- h = h.slice(r.length);
1333
- const g = w((u = p.groups) == null ? void 0 : u.type);
1334
- let b = n.get(h);
1335
- switch (b === void 0 && (b = {}, n.set(h, b)), g) {
1360
+ f = f.slice(r.length);
1361
+ const h = w((c = p.groups) == null ? void 0 : c.type);
1362
+ let y = n.get(f);
1363
+ switch (y === void 0 && (y = {}, n.set(f, y)), h) {
1336
1364
  case "spec":
1337
- b.spec = (c = o.traverse({
1365
+ y.spec = (u = o.traverse({
1338
1366
  field: l,
1339
1367
  ignoreError: t,
1340
1368
  pureFieldErrorToUndefined: t
1341
- })) == null ? void 0 : c.getDataAsJson();
1369
+ })) == null ? void 0 : u.getDataAsJson();
1342
1370
  break;
1343
1371
  case "data":
1344
- b.hasData = !0, b.data = () => o.traverseOrError({
1372
+ y.hasData = !0, y.data = () => o.traverseOrError({
1345
1373
  field: l,
1346
1374
  ignoreError: t
1347
1375
  });
@@ -1354,10 +1382,10 @@ function Dt(o, e = !0, t = !1, r = "") {
1354
1382
  for (const [, l] of n) l.data === void 0 && (l.hasData = !1);
1355
1383
  return { locked: i, results: n };
1356
1384
  }
1357
- function Oo(o, e = !0, t = "") {
1385
+ function jo(o, e = !0, t = "") {
1358
1386
  if (!o.getIsReadyOrError()) throw new Error("resource is not ready");
1359
1387
  const r = Dt(o, e, !1, t);
1360
- ar(r.locked);
1388
+ ur(r.locked);
1361
1389
  const s = {};
1362
1390
  for (const [n, i] of r.results) {
1363
1391
  if (i.spec === void 0) throw new Error(`no spec for key ${n}`);
@@ -1365,7 +1393,7 @@ function Oo(o, e = !0, t = "") {
1365
1393
  throw new Error(`no data for key ${n}`);
1366
1394
  const a = i.data();
1367
1395
  if (a === void 0) throw new Error(`no data for key ${n}`);
1368
- if (!a.ok) throw new or(a.error);
1396
+ if (!a.ok) throw new nr(a.error);
1369
1397
  s[n] = {
1370
1398
  id: Ot(i.spec, a.value),
1371
1399
  spec: i.spec,
@@ -1420,30 +1448,30 @@ class Ne {
1420
1448
  let t = !0, r;
1421
1449
  const s = (i) => {
1422
1450
  r === void 0 && (r = i), t = !1;
1423
- }, n = (i, a, u) => {
1424
- if (u.spec !== void 0 && u.hasData === !0 && u.data !== void 0) {
1425
- const c = u.data();
1426
- c !== void 0 ? e.push({
1427
- ref: se(i, a),
1451
+ }, n = (i, a, c) => {
1452
+ if (c.spec !== void 0 && c.hasData === !0 && c.data !== void 0) {
1453
+ const u = c.data();
1454
+ u !== void 0 ? e.push({
1455
+ ref: ne(i, a),
1428
1456
  obj: {
1429
- id: c.ok ? Ot(u.spec, c.value) : void 0,
1430
- spec: u.spec,
1431
- data: c
1457
+ id: u.ok ? Ot(c.spec, u.value) : void 0,
1458
+ spec: c.spec,
1459
+ data: u
1432
1460
  }
1433
1461
  }) : s(`no_data:${i}:${a}`);
1434
1462
  }
1435
1463
  };
1436
1464
  for (const [i, a] of this.blocks) {
1437
- const u = /* @__PURE__ */ new Set();
1465
+ const c = /* @__PURE__ */ new Set();
1438
1466
  if (a.prod !== void 0) {
1439
1467
  a.prod.locked || s(`prod_not_locked:${i}`);
1440
- for (const [c, l] of a.prod.results)
1441
- u.add(c), n(i, c, l);
1468
+ for (const [u, l] of a.prod.results)
1469
+ c.add(u), n(i, u, l);
1442
1470
  }
1443
1471
  if (a.staging !== void 0) {
1444
1472
  a.staging.locked || s(`staging_not_locked:${i}`);
1445
- for (const [c, l] of a.staging.results)
1446
- u.has(c) || n(i, c, l);
1473
+ for (const [u, l] of a.staging.results)
1474
+ c.has(u) || n(i, u, l);
1447
1475
  }
1448
1476
  }
1449
1477
  return { entries: e, isComplete: t, instabilityMarker: r };
@@ -1458,18 +1486,18 @@ class Ne {
1458
1486
  const a = /* @__PURE__ */ new Set();
1459
1487
  if (i.staging !== void 0) {
1460
1488
  i.staging.locked || s(`staging_not_locked:${n}`);
1461
- for (const [u, c] of i.staging.results)
1462
- c.spec !== void 0 && (e.push({
1463
- ref: se(n, u),
1464
- obj: c.spec
1465
- }), a.add(u));
1489
+ for (const [c, u] of i.staging.results)
1490
+ u.spec !== void 0 && (e.push({
1491
+ ref: ne(n, c),
1492
+ obj: u.spec
1493
+ }), a.add(c));
1466
1494
  } else s(`staging_not_rendered:${n}`);
1467
1495
  if (i.prod !== void 0) {
1468
1496
  i.prod.locked || s(`prod_not_locked:${n}`);
1469
- for (const [u, c] of i.prod.results)
1470
- a.has(u) || c.spec !== void 0 && e.push({
1471
- ref: se(n, u),
1472
- obj: c.spec
1497
+ for (const [c, u] of i.prod.results)
1498
+ a.has(c) || u.spec !== void 0 && e.push({
1499
+ ref: ne(n, c),
1500
+ obj: u.spec
1473
1501
  });
1474
1502
  }
1475
1503
  }
@@ -1479,11 +1507,11 @@ class Ne {
1479
1507
  const t = [];
1480
1508
  for (const r of this.blocks.values()) {
1481
1509
  const s = /* @__PURE__ */ new Set(), n = (i) => {
1482
- for (const [a, u] of i.results)
1483
- s.has(a) || u.spec === void 0 || (s.add(a), $t(e, u.spec) && t.push({
1510
+ for (const [a, c] of i.results)
1511
+ s.has(a) || c.spec === void 0 || (s.add(a), Ut(e, c.spec) && t.push({
1484
1512
  label: r.info.label + " / " + a,
1485
- ref: se(r.info.id, a),
1486
- spec: u.spec
1513
+ ref: ne(r.info.id, a),
1514
+ spec: c.spec
1487
1515
  }));
1488
1516
  };
1489
1517
  r.staging !== void 0 && n(r.staging), r.prod !== void 0 && n(r.prod);
@@ -1491,33 +1519,33 @@ class Ne {
1491
1519
  return t;
1492
1520
  }
1493
1521
  static create(e, t, r) {
1494
- const s = e.accessor(t).node(), n = w(s.getKeyValueAsJson(G)), a = Re(n).traverseIds("upstream", r), u = /* @__PURE__ */ new Map();
1495
- for (const c of V(n)) {
1496
- if (!a.has(c.id)) continue;
1522
+ const s = e.accessor(t).node(), n = w(s.getKeyValueAsJson(H)), a = Re(n).traverseIds("upstream", r), c = /* @__PURE__ */ new Map();
1523
+ for (const u of N(n)) {
1524
+ if (!a.has(u.id)) continue;
1497
1525
  const l = ot(
1498
1526
  s.traverse({
1499
- field: C(c.id, "prodCtx"),
1527
+ field: C(u.id, "prodCtx"),
1500
1528
  ignoreError: !0,
1501
1529
  pureFieldErrorToUndefined: !0,
1502
1530
  stableIfNotFound: !0
1503
1531
  }) !== void 0,
1504
1532
  s.traverseOrError({
1505
- field: C(c.id, "prodUiCtx"),
1533
+ field: C(u.id, "prodUiCtx"),
1506
1534
  stableIfNotFound: !0
1507
1535
  })
1508
1536
  ), p = ot(
1509
1537
  s.traverse({
1510
- field: C(c.id, "stagingCtx"),
1538
+ field: C(u.id, "stagingCtx"),
1511
1539
  ignoreError: !0,
1512
1540
  pureFieldErrorToUndefined: !0
1513
1541
  }) !== void 0,
1514
1542
  s.traverseOrError({
1515
- field: C(c.id, "stagingUiCtx")
1543
+ field: C(u.id, "stagingUiCtx")
1516
1544
  })
1517
1545
  );
1518
- u.set(c.id, { info: c, prod: l, staging: p });
1546
+ c.set(u.id, { info: u, prod: l, staging: p });
1519
1547
  }
1520
- return new Ne(e, u);
1548
+ return new Ne(e, c);
1521
1549
  }
1522
1550
  }
1523
1551
  function ot(o, e) {
@@ -1537,9 +1565,9 @@ function Le(o, e) {
1537
1565
  args: r,
1538
1566
  uiState: s,
1539
1567
  blockMeta: (n) => {
1540
- const i = n.accessor(t).node(), a = w(i.getKeyValueAsJson(G)), u = /* @__PURE__ */ new Map();
1541
- for (const c of V(a)) u.set(c.id, c);
1542
- return u;
1568
+ const i = n.accessor(t).node(), a = w(i.getKeyValueAsJson(H)), c = /* @__PURE__ */ new Map();
1569
+ for (const u of N(a)) c.set(u.id, u);
1570
+ return c;
1543
1571
  }
1544
1572
  };
1545
1573
  }
@@ -1566,28 +1594,28 @@ function xt(o, e) {
1566
1594
  getResultsPool: (r) => Ne.create(r, t, e)
1567
1595
  };
1568
1596
  }
1569
- function* E(o, e) {
1597
+ function* j(o, e) {
1570
1598
  switch (yield o, o.type) {
1571
1599
  case "GetFromCtx":
1572
1600
  case "Immediate":
1573
1601
  return;
1574
1602
  case "Isolate":
1575
- yield* E(o.cfg);
1603
+ yield* j(o.cfg);
1576
1604
  return;
1577
1605
  case "MakeObject":
1578
- for (const [, t] of Object.entries(o.template)) yield* E(t);
1606
+ for (const [, t] of Object.entries(o.template)) yield* j(t);
1579
1607
  return;
1580
1608
  case "MakeArray":
1581
- for (const t of o.template) yield* E(t);
1609
+ for (const t of o.template) yield* j(t);
1582
1610
  return;
1583
1611
  case "GetJsonField":
1584
1612
  case "GetResourceField":
1585
- yield* E(o.source), yield* E(o.field);
1613
+ yield* j(o.source), yield* j(o.field);
1586
1614
  return;
1587
1615
  case "MapRecordValues":
1588
1616
  case "MapArrayValues":
1589
1617
  case "MapResourceFields":
1590
- yield* E(o.source), yield* E(o.mapping);
1618
+ yield* j(o.source), yield* j(o.mapping);
1591
1619
  return;
1592
1620
  case "Flatten":
1593
1621
  case "GetResourceValueAsJson":
@@ -1600,23 +1628,23 @@ function* E(o, e) {
1600
1628
  case "GetLastLogs":
1601
1629
  case "GetProgressLog":
1602
1630
  case "GetLogHandle":
1603
- yield* E(o.source);
1631
+ yield* j(o.source);
1604
1632
  return;
1605
1633
  case "IsEmpty":
1606
- yield* E(o.arg);
1634
+ yield* j(o.arg);
1607
1635
  return;
1608
1636
  case "Not":
1609
- yield* E(o.operand);
1637
+ yield* j(o.operand);
1610
1638
  return;
1611
1639
  case "And":
1612
1640
  case "Or":
1613
- yield* E(o.operand1), yield* E(o.operand2);
1641
+ yield* j(o.operand1), yield* j(o.operand2);
1614
1642
  return;
1615
1643
  default:
1616
1644
  D(o);
1617
1645
  }
1618
1646
  }
1619
- function Do(o, e) {
1647
+ function Eo(o, e) {
1620
1648
  const t = {};
1621
1649
  for (const [r, s] of Object.entries(o)) t[r] = e(s);
1622
1650
  return t;
@@ -1624,7 +1652,7 @@ function Do(o, e) {
1624
1652
  function de(o, e) {
1625
1653
  return o === void 0 ? void 0 : e(o);
1626
1654
  }
1627
- function xo(o) {
1655
+ function To(o) {
1628
1656
  switch (o.type) {
1629
1657
  case "GetImportProgress":
1630
1658
  return !0;
@@ -1632,8 +1660,8 @@ function xo(o) {
1632
1660
  return !1;
1633
1661
  }
1634
1662
  }
1635
- function Eo(o) {
1636
- for (const e of E(o)) if (xo(e)) return !0;
1663
+ function Ao(o) {
1664
+ for (const e of j(o)) if (To(e)) return !0;
1637
1665
  return !1;
1638
1666
  }
1639
1667
  function fe(o) {
@@ -1642,53 +1670,53 @@ function fe(o) {
1642
1670
  result: o
1643
1671
  };
1644
1672
  }
1645
- function f(o) {
1673
+ function g(o) {
1646
1674
  return () => fe(o);
1647
1675
  }
1648
- const To = (o) => {
1676
+ const Io = (o) => {
1649
1677
  const e = {};
1650
1678
  for (const [t, r] of Object.entries(o)) e[t] = r;
1651
- return f(e);
1652
- }, jo = (o) => {
1679
+ return g(e);
1680
+ }, Vo = (o) => {
1653
1681
  const e = o.source;
1654
- if (e === void 0) return f(void 0);
1682
+ if (e === void 0) return g(void 0);
1655
1683
  const t = [];
1656
1684
  for (const r of e)
1657
1685
  r instanceof Array ? t.push(...r) : t.push(r);
1658
- return f(t);
1659
- }, Ao = (o) => {
1686
+ return g(t);
1687
+ }, No = (o) => {
1660
1688
  const e = o.source, t = o.field;
1661
- return e === void 0 || t === void 0 ? f(void 0) : ({ cCtx: r }) => {
1689
+ return e === void 0 || t === void 0 ? g(void 0) : ({ cCtx: r }) => {
1662
1690
  var s;
1663
1691
  return fe((s = r.accessor(e).node().traverse(t)) == null ? void 0 : s.persist());
1664
1692
  };
1665
1693
  };
1666
- function Et(o, e) {
1694
+ function jt(o, e) {
1667
1695
  const t = {}, r = o.length;
1668
1696
  for (let s = 0; s < r; s++) t[String(s)] = e(o[s]);
1669
1697
  return t;
1670
1698
  }
1671
- function Io(o, e) {
1699
+ function Lo(o, e) {
1672
1700
  return (t) => {
1673
1701
  const r = t.source;
1674
- return r === void 0 ? f(void 0) : () => ({
1702
+ return r === void 0 ? g(void 0) : () => ({
1675
1703
  type: "ScheduleSubroutine",
1676
- subroutine: Tt(r.length),
1677
- args: Et(r, (s) => m({ ...o, [e.itVar]: s }, e.mapping))
1704
+ subroutine: Et(r.length),
1705
+ args: jt(r, (s) => m({ ...o, [e.itVar]: s }, e.mapping))
1678
1706
  });
1679
1707
  };
1680
1708
  }
1681
- function Tt(o) {
1709
+ function Et(o) {
1682
1710
  return (e) => {
1683
1711
  const t = [];
1684
1712
  for (let r = 0; r < o; r++) t.push(e[String(r)]);
1685
- return f(t);
1713
+ return g(t);
1686
1714
  };
1687
1715
  }
1688
- function Vo(o, e) {
1716
+ function Jo(o, e) {
1689
1717
  return (t) => {
1690
1718
  const r = t.source;
1691
- if (r === void 0) return f(void 0);
1719
+ if (r === void 0) return g(void 0);
1692
1720
  const s = {};
1693
1721
  for (const [n, i] of Object.entries(r)) {
1694
1722
  const a = { ...o, [e.itVar]: i };
@@ -1696,57 +1724,57 @@ function Vo(o, e) {
1696
1724
  }
1697
1725
  return () => ({
1698
1726
  type: "ScheduleSubroutine",
1699
- subroutine: No,
1727
+ subroutine: Ko,
1700
1728
  args: s
1701
1729
  });
1702
1730
  };
1703
1731
  }
1704
- const No = (o) => f(o), Lo = (o) => {
1732
+ const Ko = (o) => g(o), Mo = (o) => {
1705
1733
  const e = o.arg;
1706
- return f(e === void 0 ? void 0 : e.length === 0);
1707
- }, Jo = (o) => {
1734
+ return g(e === void 0 ? void 0 : e.length === 0);
1735
+ }, Uo = (o) => {
1708
1736
  const e = o.operand;
1709
- return f(e === void 0 ? void 0 : !e);
1710
- }, Ko = (o) => {
1737
+ return g(e === void 0 ? void 0 : !e);
1738
+ }, $o = (o) => {
1711
1739
  const e = o.operand1, t = o.operand2;
1712
- return f(e === void 0 || t === void 0 ? void 0 : e && t);
1713
- }, Mo = (o) => {
1740
+ return g(e === void 0 || t === void 0 ? void 0 : e && t);
1741
+ }, Go = (o) => {
1714
1742
  const e = o.operand1, t = o.operand2;
1715
- return f(e === void 0 || t === void 0 ? void 0 : e || t);
1716
- }, $o = (o) => {
1743
+ return g(e === void 0 || t === void 0 ? void 0 : e || t);
1744
+ }, Ho = (o) => {
1717
1745
  const e = o.source;
1718
- return e === void 0 ? f(void 0) : ({ cCtx: t }) => {
1746
+ return e === void 0 ? g(void 0) : ({ cCtx: t }) => {
1719
1747
  var r;
1720
1748
  return fe((r = t.accessor(e).node()) == null ? void 0 : r.getDataAsJson());
1721
1749
  };
1722
- }, Uo = (o) => {
1750
+ }, Wo = (o) => {
1723
1751
  const e = o.source, t = o.field;
1724
- return f(e === void 0 || t === void 0 ? void 0 : e[t]);
1752
+ return g(e === void 0 || t === void 0 ? void 0 : e[t]);
1725
1753
  };
1726
- function Go(o, e) {
1754
+ function _o(o, e) {
1727
1755
  return (t) => {
1728
1756
  const r = t.source;
1729
- return r === void 0 ? f(void 0) : ({ cCtx: s }) => {
1757
+ return r === void 0 ? g(void 0) : ({ cCtx: s }) => {
1730
1758
  const n = s.accessor(r).node(), i = {};
1731
1759
  for (const a of n.listInputFields()) {
1732
- const u = n.traverse(a);
1733
- if (u === void 0) i[a] = f(void 0);
1760
+ const c = n.traverse(a);
1761
+ if (c === void 0) i[a] = g(void 0);
1734
1762
  else {
1735
- const c = { ...o, [e.itVar]: u.persist() };
1736
- i[a] = m(c, e.mapping);
1763
+ const u = { ...o, [e.itVar]: c.persist() };
1764
+ i[a] = m(u, e.mapping);
1737
1765
  }
1738
1766
  }
1739
1767
  return {
1740
1768
  type: "ScheduleSubroutine",
1741
- subroutine: Ho,
1769
+ subroutine: zo,
1742
1770
  args: i
1743
1771
  };
1744
1772
  };
1745
1773
  };
1746
1774
  }
1747
- const Ho = (o) => f(o), _o = (o) => {
1775
+ const zo = (o) => g(o), qo = (o) => {
1748
1776
  const e = o.source;
1749
- return e === void 0 ? f(void 0) : ({ drivers: t }) => ({
1777
+ return e === void 0 ? g(void 0) : ({ drivers: t }) => ({
1750
1778
  type: "ScheduleComputable",
1751
1779
  computable: P.make(
1752
1780
  (r) => t.blobDriver.getDownloadedBlob(r.accessor(e).node().resourceInfo),
@@ -1758,9 +1786,9 @@ const Ho = (o) => f(o), _o = (o) => {
1758
1786
  }
1759
1787
  )
1760
1788
  });
1761
- }, Wo = (o) => {
1789
+ }, Yo = (o) => {
1762
1790
  const e = o.source;
1763
- return e === void 0 ? f(void 0) : ({ cCtx: t, drivers: r }) => {
1791
+ return e === void 0 ? g(void 0) : ({ cCtx: t, drivers: r }) => {
1764
1792
  const s = t.accessor(e).node().resourceInfo;
1765
1793
  return {
1766
1794
  type: "ScheduleComputable",
@@ -1769,9 +1797,9 @@ const Ho = (o) => f(o), _o = (o) => {
1769
1797
  })
1770
1798
  };
1771
1799
  };
1772
- }, zo = (o) => {
1800
+ }, Qo = (o) => {
1773
1801
  const e = o.source;
1774
- return e === void 0 ? f(void 0) : ({ drivers: t }) => ({
1802
+ return e === void 0 ? g(void 0) : ({ drivers: t }) => ({
1775
1803
  type: "ScheduleComputable",
1776
1804
  computable: P.make(
1777
1805
  (r) => t.blobDriver.getDownloadedBlob(r.accessor(e).node().resourceInfo),
@@ -1785,39 +1813,39 @@ const Ho = (o) => f(o), _o = (o) => {
1785
1813
  }
1786
1814
  )
1787
1815
  });
1788
- }, qo = (o) => {
1816
+ }, Zo = (o) => {
1789
1817
  const e = o.source;
1790
- return e === void 0 ? f(void 0) : ({ drivers: t }) => ({
1818
+ return e === void 0 ? g(void 0) : ({ drivers: t }) => ({
1791
1819
  type: "ScheduleComputable",
1792
1820
  computable: t.blobDriver.getDownloadedBlob(e)
1793
1821
  });
1794
- }, Yo = (o) => {
1822
+ }, Xo = (o) => {
1795
1823
  const e = o.source;
1796
- return e === void 0 ? f(void 0) : ({ drivers: t }) => ({
1824
+ return e === void 0 ? g(void 0) : ({ drivers: t }) => ({
1797
1825
  type: "ScheduleComputable",
1798
1826
  computable: t.blobDriver.getOnDemandBlob(e)
1799
1827
  });
1800
- }, Qo = (o) => {
1828
+ }, es = (o) => {
1801
1829
  const e = o.source;
1802
- return e === void 0 ? f(void 0) : ({ drivers: t }) => ({
1830
+ return e === void 0 ? g(void 0) : ({ drivers: t }) => ({
1803
1831
  type: "ScheduleComputable",
1804
1832
  computable: t.uploadDriver.getProgressId(e)
1805
1833
  });
1806
- }, Zo = (o) => (e) => {
1834
+ }, ts = (o) => (e) => {
1807
1835
  const t = e.source;
1808
- return t === void 0 ? f(void 0) : ({ drivers: r }) => ({
1836
+ return t === void 0 ? g(void 0) : ({ drivers: r }) => ({
1809
1837
  type: "ScheduleComputable",
1810
1838
  computable: r.logDriver.getLastLogs(t, o)
1811
1839
  });
1812
- }, Xo = (o) => (e) => {
1840
+ }, rs = (o) => (e) => {
1813
1841
  const t = e.source;
1814
- return t === void 0 ? f(void 0) : ({ drivers: r }) => ({
1842
+ return t === void 0 ? g(void 0) : ({ drivers: r }) => ({
1815
1843
  type: "ScheduleComputable",
1816
1844
  computable: r.logDriver.getProgressLog(t, o)
1817
1845
  });
1818
- }, es = (o) => {
1846
+ }, os = (o) => {
1819
1847
  const e = o.source;
1820
- return e === void 0 ? f(void 0) : ({ drivers: t }) => ({
1848
+ return e === void 0 ? g(void 0) : ({ drivers: t }) => ({
1821
1849
  type: "ScheduleComputable",
1822
1850
  computable: t.logDriver.getLogHandle(e)
1823
1851
  });
@@ -1826,18 +1854,18 @@ function m(o, e) {
1826
1854
  switch (e.type) {
1827
1855
  case "GetFromCtx":
1828
1856
  const t = o[e.variable];
1829
- return typeof t == "function" ? (r) => fe(t(r.cCtx)) : (t === void 0 && console.log("asdasd"), f(t));
1857
+ return typeof t == "function" ? (r) => fe(t(r.cCtx)) : (t === void 0 && console.log("asdasd"), g(t));
1830
1858
  case "Isolate":
1831
1859
  return ({ drivers: r }) => ({
1832
1860
  type: "ScheduleComputable",
1833
1861
  computable: Vt(r, o, e.cfg)
1834
1862
  });
1835
1863
  case "Immediate":
1836
- return f(e.value);
1864
+ return g(e.value);
1837
1865
  case "GetJsonField":
1838
1866
  return () => ({
1839
1867
  type: "ScheduleSubroutine",
1840
- subroutine: Uo,
1868
+ subroutine: Wo,
1841
1869
  args: {
1842
1870
  source: m(o, e.source),
1843
1871
  field: m(o, e.field)
@@ -1846,7 +1874,7 @@ function m(o, e) {
1846
1874
  case "MapArrayValues":
1847
1875
  return () => ({
1848
1876
  type: "ScheduleSubroutine",
1849
- subroutine: Io(o, e),
1877
+ subroutine: Lo(o, e),
1850
1878
  args: {
1851
1879
  source: m(o, e.source)
1852
1880
  }
@@ -1854,7 +1882,7 @@ function m(o, e) {
1854
1882
  case "MapRecordValues":
1855
1883
  return () => ({
1856
1884
  type: "ScheduleSubroutine",
1857
- subroutine: Vo(o, e),
1885
+ subroutine: Jo(o, e),
1858
1886
  args: {
1859
1887
  source: m(o, e.source)
1860
1888
  }
@@ -1862,19 +1890,19 @@ function m(o, e) {
1862
1890
  case "MakeObject":
1863
1891
  return () => ({
1864
1892
  type: "ScheduleSubroutine",
1865
- subroutine: To,
1866
- args: Do(e.template, (r) => m(o, r))
1893
+ subroutine: Io,
1894
+ args: Eo(e.template, (r) => m(o, r))
1867
1895
  });
1868
1896
  case "MakeArray":
1869
1897
  return () => ({
1870
1898
  type: "ScheduleSubroutine",
1871
- subroutine: Tt(e.template.length),
1872
- args: Et(e.template, (r) => m(o, r))
1899
+ subroutine: Et(e.template.length),
1900
+ args: jt(e.template, (r) => m(o, r))
1873
1901
  });
1874
1902
  case "Flatten":
1875
1903
  return () => ({
1876
1904
  type: "ScheduleSubroutine",
1877
- subroutine: jo,
1905
+ subroutine: Vo,
1878
1906
  args: {
1879
1907
  source: m(o, e.source)
1880
1908
  }
@@ -1882,7 +1910,7 @@ function m(o, e) {
1882
1910
  case "IsEmpty":
1883
1911
  return () => ({
1884
1912
  type: "ScheduleSubroutine",
1885
- subroutine: Lo,
1913
+ subroutine: Mo,
1886
1914
  args: {
1887
1915
  arg: m(o, e.arg)
1888
1916
  }
@@ -1890,7 +1918,7 @@ function m(o, e) {
1890
1918
  case "Not":
1891
1919
  return () => ({
1892
1920
  type: "ScheduleSubroutine",
1893
- subroutine: Jo,
1921
+ subroutine: Uo,
1894
1922
  args: {
1895
1923
  operand: m(o, e.operand)
1896
1924
  }
@@ -1898,7 +1926,7 @@ function m(o, e) {
1898
1926
  case "And":
1899
1927
  return () => ({
1900
1928
  type: "ScheduleSubroutine",
1901
- subroutine: Ko,
1929
+ subroutine: $o,
1902
1930
  args: {
1903
1931
  operand1: m(o, e.operand1),
1904
1932
  operand2: m(o, e.operand2)
@@ -1907,7 +1935,7 @@ function m(o, e) {
1907
1935
  case "Or":
1908
1936
  return () => ({
1909
1937
  type: "ScheduleSubroutine",
1910
- subroutine: Mo,
1938
+ subroutine: Go,
1911
1939
  args: {
1912
1940
  operand1: m(o, e.operand1),
1913
1941
  operand2: m(o, e.operand2)
@@ -1916,7 +1944,7 @@ function m(o, e) {
1916
1944
  case "MapResourceFields":
1917
1945
  return () => ({
1918
1946
  type: "ScheduleSubroutine",
1919
- subroutine: Go(o, e),
1947
+ subroutine: _o(o, e),
1920
1948
  args: {
1921
1949
  source: m(o, e.source)
1922
1950
  }
@@ -1924,7 +1952,7 @@ function m(o, e) {
1924
1952
  case "GetResourceField":
1925
1953
  return () => ({
1926
1954
  type: "ScheduleSubroutine",
1927
- subroutine: Ao,
1955
+ subroutine: No,
1928
1956
  args: {
1929
1957
  source: m(o, e.source),
1930
1958
  field: m(o, e.field)
@@ -1933,7 +1961,7 @@ function m(o, e) {
1933
1961
  case "GetResourceValueAsJson":
1934
1962
  return () => ({
1935
1963
  type: "ScheduleSubroutine",
1936
- subroutine: $o,
1964
+ subroutine: Ho,
1937
1965
  args: {
1938
1966
  source: m(o, e.source)
1939
1967
  }
@@ -1941,7 +1969,7 @@ function m(o, e) {
1941
1969
  case "GetBlobContent":
1942
1970
  return () => ({
1943
1971
  type: "ScheduleSubroutine",
1944
- subroutine: _o,
1972
+ subroutine: qo,
1945
1973
  args: {
1946
1974
  source: m(o, e.source)
1947
1975
  }
@@ -1949,7 +1977,7 @@ function m(o, e) {
1949
1977
  case "GetBlobContentAsString":
1950
1978
  return () => ({
1951
1979
  type: "ScheduleSubroutine",
1952
- subroutine: Wo,
1980
+ subroutine: Yo,
1953
1981
  args: {
1954
1982
  source: m(o, e.source)
1955
1983
  }
@@ -1957,7 +1985,7 @@ function m(o, e) {
1957
1985
  case "GetBlobContentAsJson":
1958
1986
  return () => ({
1959
1987
  type: "ScheduleSubroutine",
1960
- subroutine: zo,
1988
+ subroutine: Qo,
1961
1989
  args: {
1962
1990
  source: m(o, e.source)
1963
1991
  }
@@ -1965,7 +1993,7 @@ function m(o, e) {
1965
1993
  case "GetDownloadedBlobContent":
1966
1994
  return () => ({
1967
1995
  type: "ScheduleSubroutine",
1968
- subroutine: qo,
1996
+ subroutine: Zo,
1969
1997
  args: {
1970
1998
  source: m(o, e.source)
1971
1999
  }
@@ -1973,7 +2001,7 @@ function m(o, e) {
1973
2001
  case "GetOnDemandBlobContent":
1974
2002
  return () => ({
1975
2003
  type: "ScheduleSubroutine",
1976
- subroutine: Yo,
2004
+ subroutine: Xo,
1977
2005
  args: {
1978
2006
  source: m(o, e.source)
1979
2007
  }
@@ -1981,7 +2009,7 @@ function m(o, e) {
1981
2009
  case "GetImportProgress":
1982
2010
  return () => ({
1983
2011
  type: "ScheduleSubroutine",
1984
- subroutine: Qo,
2012
+ subroutine: es,
1985
2013
  args: {
1986
2014
  source: m(o, e.source)
1987
2015
  }
@@ -1989,7 +2017,7 @@ function m(o, e) {
1989
2017
  case "GetLastLogs":
1990
2018
  return () => ({
1991
2019
  type: "ScheduleSubroutine",
1992
- subroutine: Zo(e.lines),
2020
+ subroutine: ts(e.lines),
1993
2021
  args: {
1994
2022
  source: m(o, e.source)
1995
2023
  }
@@ -1997,7 +2025,7 @@ function m(o, e) {
1997
2025
  case "GetProgressLog":
1998
2026
  return () => ({
1999
2027
  type: "ScheduleSubroutine",
2000
- subroutine: Xo(e.patternToSearch),
2028
+ subroutine: rs(e.patternToSearch),
2001
2029
  args: {
2002
2030
  source: m(o, e.source)
2003
2031
  }
@@ -2005,7 +2033,7 @@ function m(o, e) {
2005
2033
  case "GetLogHandle":
2006
2034
  return () => ({
2007
2035
  type: "ScheduleSubroutine",
2008
- subroutine: es,
2036
+ subroutine: os,
2009
2037
  args: {
2010
2038
  source: m(o, e.source)
2011
2039
  }
@@ -2014,8 +2042,8 @@ function m(o, e) {
2014
2042
  return D(e);
2015
2043
  }
2016
2044
  }
2017
- const ts = ["$prod", "$staging"];
2018
- function rs(o) {
2045
+ const ss = ["$prod", "$staging"];
2046
+ function ns(o) {
2019
2047
  return {
2020
2048
  $blockId: o.blockId,
2021
2049
  $args: JSON.parse(o.args),
@@ -2024,47 +2052,47 @@ function rs(o) {
2024
2052
  $staging: o.staging
2025
2053
  };
2026
2054
  }
2027
- const jt = Symbol(), At = "return", os = { op: jt, arg: At };
2028
- function ss(o) {
2029
- return o.op == jt && o.arg == At;
2055
+ const Tt = Symbol(), At = "return", is = { op: Tt, arg: At };
2056
+ function as(o) {
2057
+ return o.op == Tt && o.arg == At;
2030
2058
  }
2031
- function ns() {
2059
+ function cs() {
2032
2060
  return { pendingSubroutines: /* @__PURE__ */ new Map() };
2033
2061
  }
2034
2062
  function st(o, e, t, r) {
2035
- const s = new ft(t), n = (a, u) => {
2036
- if (ss(a))
2037
- return e.result = u, !1;
2038
- const c = w(e.pendingSubroutines.get(a.op));
2039
- if (a.arg in c.args) throw new Error("argument already set");
2040
- return c.args[a.arg] = u, c.argCounter--, c.argCounter === 0 && (e.pendingSubroutines.delete(a.op), s.push({
2041
- destination: c.destination,
2042
- operation: c.subroutine(c.args)
2063
+ const s = new ft(t), n = (a, c) => {
2064
+ if (as(a))
2065
+ return e.result = c, !1;
2066
+ const u = w(e.pendingSubroutines.get(a.op));
2067
+ if (a.arg in u.args) throw new Error("argument already set");
2068
+ return u.args[a.arg] = c, u.argCounter--, u.argCounter === 0 && (e.pendingSubroutines.delete(a.op), s.push({
2069
+ destination: u.destination,
2070
+ operation: u.subroutine(u.args)
2043
2071
  })), !0;
2044
2072
  }, i = [];
2045
2073
  e: for (; s.length > 0; ) {
2046
- const a = s.shift(), u = a.operation(o);
2047
- switch (u.type) {
2074
+ const a = s.shift(), c = a.operation(o);
2075
+ switch (c.type) {
2048
2076
  case "ReturnResult":
2049
- if (!n(a.destination, u.result)) break e;
2077
+ if (!n(a.destination, c.result)) break e;
2050
2078
  break;
2051
2079
  case "ScheduleSubroutine":
2052
- const c = Symbol(), l = Object.entries(u.args), p = l.length;
2080
+ const u = Symbol(), l = Object.entries(c.args), p = l.length;
2053
2081
  if (p === 0)
2054
2082
  s.push({
2055
2083
  destination: a.destination,
2056
- operation: u.subroutine({})
2084
+ operation: c.subroutine({})
2057
2085
  });
2058
2086
  else {
2059
- for (const [h, g] of l)
2087
+ for (const [f, h] of l)
2060
2088
  s.push({
2061
- destination: { op: c, arg: h },
2062
- operation: g
2089
+ destination: { op: u, arg: f },
2090
+ operation: h
2063
2091
  });
2064
- e.pendingSubroutines.set(c, {
2092
+ e.pendingSubroutines.set(u, {
2065
2093
  argCounter: p,
2066
2094
  args: {},
2067
- subroutine: u.subroutine,
2095
+ subroutine: c.subroutine,
2068
2096
  destination: a.destination
2069
2097
  });
2070
2098
  }
@@ -2074,64 +2102,64 @@ function st(o, e, t, r) {
2074
2102
  throw new Error("asynchronous operations are forbidden in this context");
2075
2103
  i.push({
2076
2104
  destination: a.destination,
2077
- computable: u.computable
2105
+ computable: c.computable
2078
2106
  });
2079
2107
  break;
2080
2108
  default:
2081
- D(u);
2109
+ D(c);
2082
2110
  }
2083
2111
  }
2084
2112
  return i;
2085
2113
  }
2086
2114
  function It(o, e, t, r = {}) {
2087
- return Vt(o, rs(e), t, r);
2115
+ return Vt(o, ns(e), t, r);
2088
2116
  }
2089
2117
  function Vt(o, e, t, r = {}) {
2090
- const s = Ee({
2091
- ctx: Object.fromEntries(Object.entries(e).filter(([n]) => ts.indexOf(n) === -1)),
2118
+ const s = je({
2119
+ ctx: Object.fromEntries(Object.entries(e).filter(([n]) => ss.indexOf(n) === -1)),
2092
2120
  cfg: t
2093
2121
  });
2094
2122
  return P.makeRaw(
2095
2123
  (n) => {
2096
- const i = { drivers: o, cCtx: n }, a = ns();
2124
+ const i = { drivers: o, cCtx: n }, a = cs();
2097
2125
  return {
2098
2126
  ir: st(
2099
2127
  i,
2100
2128
  a,
2101
2129
  [
2102
2130
  {
2103
- destination: os,
2131
+ destination: is,
2104
2132
  operation: m(e, t)
2105
2133
  }
2106
2134
  ],
2107
2135
  !0
2108
2136
  ),
2109
- async postprocessValue(c, l) {
2137
+ async postprocessValue(u, l) {
2110
2138
  const p = [];
2111
- for (const B of c)
2112
- p.push({ destination: B.destination, operation: f(B.computable) });
2113
- const h = {
2139
+ for (const O of u)
2140
+ p.push({ destination: O.destination, operation: g(O.computable) });
2141
+ const f = {
2114
2142
  drivers: o,
2115
2143
  get cCtx() {
2116
2144
  throw new Error("asynchronous operations are forbidden in this context");
2117
2145
  }
2118
- }, g = /* @__PURE__ */ new Map();
2119
- for (const [B, M] of a.pendingSubroutines)
2120
- g.set(B, { ...M, args: { ...M.args } });
2121
- const b = {
2146
+ }, h = /* @__PURE__ */ new Map();
2147
+ for (const [O, A] of a.pendingSubroutines)
2148
+ h.set(O, { ...A, args: { ...A.args } });
2149
+ const y = {
2122
2150
  result: a.result,
2123
- pendingSubroutines: g
2151
+ pendingSubroutines: h
2124
2152
  };
2125
- if (st(h, b, p, !1), !("result" in b))
2153
+ if (st(f, y, p, !1), !("result" in y))
2126
2154
  throw new Error("illegal cfg rendering stack state, no result");
2127
- return b.result;
2155
+ return y.result;
2128
2156
  }
2129
2157
  };
2130
2158
  },
2131
2159
  { ...r, key: s }
2132
2160
  );
2133
2161
  }
2134
- function is(o) {
2162
+ function us(o) {
2135
2163
  return o instanceof ArrayBuffer || ArrayBuffer.isView(o);
2136
2164
  }
2137
2165
  function nt(o) {
@@ -2261,16 +2289,16 @@ class pe {
2261
2289
  parsePObjectCollection(e, t, r) {
2262
2290
  const s = this.getAccessor(e);
2263
2291
  if (!s.getIsReadyOrError()) return;
2264
- const n = Oo(s, t, r), i = {};
2265
- for (const [a, u] of Object.entries(n))
2266
- i[a] = z(u, (c) => this.wrapAccessor(c));
2292
+ const n = jo(s, t, r), i = {};
2293
+ for (const [a, c] of Object.entries(n))
2294
+ i[a] = q(c, (u) => this.wrapAccessor(u));
2267
2295
  return i;
2268
2296
  }
2269
2297
  //
2270
2298
  // Blobs
2271
2299
  //
2272
2300
  registerComputable(e, t) {
2273
- const r = `${e}_${Y()}`;
2301
+ const r = `${e}_${Q()}`;
2274
2302
  return this.computablesToResolve[r] = t, r;
2275
2303
  }
2276
2304
  getBlobContentAsString(e) {
@@ -2379,7 +2407,7 @@ class pe {
2379
2407
  isComplete: e.isComplete,
2380
2408
  entries: e.entries.map((t) => ({
2381
2409
  ref: t.ref,
2382
- obj: z(t.obj, (r) => this.wrapAccessor(r))
2410
+ obj: q(t.obj, (r) => this.wrapAccessor(r))
2383
2411
  }))
2384
2412
  };
2385
2413
  }
@@ -2392,7 +2420,7 @@ class pe {
2392
2420
  obj: {
2393
2421
  id: t.obj.id,
2394
2422
  spec: t.obj.spec,
2395
- data: Ut(t.obj.data, (r) => this.wrapAccessor(r))
2423
+ data: $t(t.obj.data, (r) => this.wrapAccessor(r))
2396
2424
  }
2397
2425
  }))
2398
2426
  };
@@ -2410,7 +2438,7 @@ class pe {
2410
2438
  "can't instantiate PFrames from this context (most porbably called from the future mapper)"
2411
2439
  );
2412
2440
  return this.env.driverKit.pFrameDriver.createPFrame(
2413
- e.map((t) => z(t, (r) => this.getAccessor(r))),
2441
+ e.map((t) => q(t, (r) => this.getAccessor(r))),
2414
2442
  this.computableCtx
2415
2443
  );
2416
2444
  }
@@ -2420,7 +2448,7 @@ class pe {
2420
2448
  "can't instantiate PTable from this context (most porbably called from the future mapper)"
2421
2449
  );
2422
2450
  return this.env.driverKit.pFrameDriver.createPTable(
2423
- ct(e, (t) => z(t, (r) => this.getAccessor(r))),
2451
+ ct(e, (t) => q(t, (r) => this.getAccessor(r))),
2424
2452
  this.computableCtx
2425
2453
  );
2426
2454
  }
@@ -2434,7 +2462,7 @@ class pe {
2434
2462
  }
2435
2463
  wrapAccessor(e) {
2436
2464
  if (e !== void 0) {
2437
- const t = Y();
2465
+ const t = Q();
2438
2466
  return this.accessors.set(t, e), t;
2439
2467
  }
2440
2468
  }
@@ -2466,7 +2494,7 @@ class pe {
2466
2494
  r = this.vm.null;
2467
2495
  break;
2468
2496
  }
2469
- if (is(e)) {
2497
+ if (us(e)) {
2470
2498
  r = this.vm.newArrayBuffer(e), s = !0;
2471
2499
  break;
2472
2500
  }
@@ -2568,20 +2596,20 @@ class pe {
2568
2596
  });
2569
2597
  }
2570
2598
  }
2571
- function as(o, e, t, r, s = {}) {
2599
+ function ls(o, e, t, r, s = {}) {
2572
2600
  return P.makeRaw((n) => {
2573
2601
  const i = new Se();
2574
2602
  n.addOnDestroy(() => i.dispose());
2575
2603
  const a = i.manage(o.quickJs.newRuntime());
2576
2604
  a.setMemoryLimit(1024 * 640), a.setMaxStackSize(1024 * 320);
2577
- const u = i.manage(a.newContext()), c = new pe(i, u, e, o, n);
2578
- c.evaluateBundle(r.content);
2579
- const l = c.runCallback(t);
2580
- return c.resetComputableCtx(), {
2581
- ir: c.computablesToResolve,
2605
+ const c = i.manage(a.newContext()), u = new pe(i, c, e, o, n);
2606
+ u.evaluateBundle(r.content);
2607
+ const l = u.runCallback(t);
2608
+ return u.resetComputableCtx(), {
2609
+ ir: u.computablesToResolve,
2582
2610
  postprocessValue: async (p) => {
2583
- for (const [h, g] of Object.entries(p)) c.runCallback(h, g);
2584
- return c.importObjectUniversal(l);
2611
+ for (const [f, h] of Object.entries(p)) u.runCallback(f, h);
2612
+ return u.importObjectUniversal(l);
2585
2613
  }
2586
2614
  };
2587
2615
  }, s);
@@ -2589,99 +2617,99 @@ function as(o, e, t, r, s = {}) {
2589
2617
  function De(o, e, t, r, s = {}) {
2590
2618
  if (ut(t)) {
2591
2619
  if (r === void 0) throw new Error("No code bundle.");
2592
- return as(o, e, t, r, s);
2620
+ return ls(o, e, t, r, s);
2593
2621
  } else return It(o.driverKit, e, t, s);
2594
2622
  }
2595
- function cs(o, e, t) {
2623
+ function ds(o, e, t) {
2596
2624
  return P.make(
2597
2625
  (r) => {
2598
- var b, B, M, ee, te, $, H, re;
2599
- const s = r.accessor(o).node(), n = w(s.getKeyValueAsJson(Ie)), i = w(s.getKeyValueAsJson(Q)), a = w(s.getKeyValueAsJson(Z)), u = w(s.getKeyValueAsJson(G)), c = w(
2626
+ var y, O, A, te, re, U, W, oe;
2627
+ const s = r.accessor(o).node(), n = w(s.getKeyValueAsJson(Ie)), i = w(s.getKeyValueAsJson(Z)), a = w(s.getKeyValueAsJson(X)), c = w(s.getKeyValueAsJson(H)), u = w(
2600
2628
  s.getKeyValueAsJson(ue)
2601
2629
  ), l = /* @__PURE__ */ new Map();
2602
- for (const { id: k } of V(u)) {
2603
- const L = s.traverse({
2630
+ for (const { id: k } of N(c)) {
2631
+ const J = s.traverse({
2604
2632
  field: C(k, "currentArgs"),
2605
2633
  assertFieldType: "Dynamic",
2606
2634
  errorIfFieldNotSet: !0
2607
2635
  });
2608
2636
  let _;
2609
- const T = s.traverse({
2637
+ const E = s.traverse({
2610
2638
  field: C(k, "prodArgs"),
2611
2639
  assertFieldType: "Dynamic",
2612
2640
  stableIfNotFound: !0
2613
2641
  });
2614
- if (T !== void 0) {
2642
+ if (E !== void 0) {
2615
2643
  const x = s.getField({
2616
2644
  field: C(k, "prodOutput"),
2617
2645
  assertFieldType: "Dynamic",
2618
2646
  errorIfFieldNotFound: !0
2619
- }), R = s.getField({
2647
+ }), B = s.getField({
2620
2648
  field: C(k, "prodUiCtx"),
2621
2649
  assertFieldType: "Dynamic",
2622
2650
  errorIfFieldNotFound: !0
2623
2651
  });
2624
2652
  _ = {
2625
- arguments: T.getDataAsJson(),
2626
- stale: L.id !== T.id,
2627
- outputError: x.error !== void 0 || R.error !== void 0 || ((b = x.value) == null ? void 0 : b.getError()) !== void 0 || ((B = R.value) == null ? void 0 : B.getError()) !== void 0,
2628
- outputsError: ((M = x.error) == null ? void 0 : M.getDataAsString()) ?? ((te = (ee = x.value) == null ? void 0 : ee.getError()) == null ? void 0 : te.getDataAsString()),
2629
- exportsError: (($ = R.error) == null ? void 0 : $.getDataAsString()) ?? ((re = (H = R.value) == null ? void 0 : H.getError()) == null ? void 0 : re.getDataAsString()),
2630
- finished: (x.value !== void 0 && x.value.getIsReadyOrError() || x.error !== void 0 && x.error.getIsReadyOrError()) && (R.value !== void 0 && R.value.getIsReadyOrError() || R.error !== void 0 && R.error.getIsReadyOrError())
2653
+ arguments: E.getDataAsJson(),
2654
+ stale: J.id !== E.id,
2655
+ outputError: x.error !== void 0 || B.error !== void 0 || ((y = x.value) == null ? void 0 : y.getError()) !== void 0 || ((O = B.value) == null ? void 0 : O.getError()) !== void 0,
2656
+ outputsError: ((A = x.error) == null ? void 0 : A.getDataAsString()) ?? ((re = (te = x.value) == null ? void 0 : te.getError()) == null ? void 0 : re.getDataAsString()),
2657
+ exportsError: ((U = B.error) == null ? void 0 : U.getDataAsString()) ?? ((oe = (W = B.value) == null ? void 0 : W.getError()) == null ? void 0 : oe.getDataAsString()),
2658
+ finished: (x.value !== void 0 && x.value.getIsReadyOrError() || x.error !== void 0 && x.error.getIsReadyOrError()) && (B.value !== void 0 && B.value.getIsReadyOrError() || B.error !== void 0 && B.error.getIsReadyOrError())
2631
2659
  };
2632
2660
  }
2633
- l.set(k, { currentArguments: L.getDataAsJson(), prod: _ });
2661
+ l.set(k, { currentArguments: J.getDataAsJson(), prod: _ });
2634
2662
  }
2635
- const p = ie(u, (k) => l.get(k).currentArguments), h = new Set(c.blocksInLimbo), g = [...V(u)].map(({ id: k, label: L, renderingMode: _ }) => {
2636
- var Ke, Me, $e, Ue;
2637
- const T = w(l.get(k)), x = w(p.nodes.get(k));
2638
- let R = "NotCalculated";
2639
- T.prod !== void 0 && (h.has(k) ? R = "Limbo" : R = T.prod.finished ? "Done" : "Running");
2640
- const J = s.traverse(
2663
+ const p = ie(c, (k) => l.get(k).currentArguments), f = new Set(u.blocksInLimbo), h = [...N(c)].map(({ id: k, label: J, renderingMode: _ }) => {
2664
+ var Ke, Me, Ue, $e;
2665
+ const E = w(l.get(k)), x = w(p.nodes.get(k));
2666
+ let B = "NotCalculated";
2667
+ E.prod !== void 0 && (f.has(k) ? B = "Limbo" : B = E.prod.finished ? "Done" : "Running");
2668
+ const K = s.traverse(
2641
2669
  {
2642
2670
  field: C(k, "blockPack"),
2643
2671
  assertFieldType: "Dynamic",
2644
2672
  errorIfFieldNotSet: !0
2645
2673
  },
2646
- { field: y.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 }
2647
- ), N = J == null ? void 0 : J.getDataAsJson(), { sections: oe, inputsValid: v, sdkVersion: O } = de(N == null ? void 0 : N.config, (ge) => {
2648
- const W = xe(ge), Ge = Le(s, k);
2674
+ { field: b.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 }
2675
+ ), L = K == null ? void 0 : K.getDataAsJson(), { sections: se, inputsValid: v, sdkVersion: R } = de(L == null ? void 0 : L.config, (ge) => {
2676
+ const z = xe(ge), Ge = Le(s, k);
2649
2677
  return {
2650
2678
  sections: De(
2651
2679
  t,
2652
2680
  Ge,
2653
- W.sections,
2654
- W.code
2681
+ z.sections,
2682
+ z.code
2655
2683
  ),
2656
2684
  inputsValid: De(
2657
2685
  t,
2658
2686
  Ge,
2659
- W.inputsValid,
2660
- W.code
2687
+ z.inputsValid,
2688
+ z.code
2661
2689
  ),
2662
- sdkVersion: W.sdkVersion
2690
+ sdkVersion: z.sdkVersion
2663
2691
  };
2664
2692
  }) || {}, F = de(
2665
- N,
2693
+ L,
2666
2694
  (ge) => t.blockUpdateWatcher.get(ge.source, r)
2667
2695
  );
2668
2696
  return {
2669
2697
  id: k,
2670
- label: L,
2698
+ label: J,
2671
2699
  renderingMode: _,
2672
- stale: ((Ke = T.prod) == null ? void 0 : Ke.stale) !== !1 || R === "Limbo",
2700
+ stale: ((Ke = E.prod) == null ? void 0 : Ke.stale) !== !1 || B === "Limbo",
2673
2701
  missingReference: x.missingReferences,
2674
2702
  upstreams: [...p.traverseIdsExcludingRoots("upstream", k)],
2675
2703
  downstreams: [...p.traverseIdsExcludingRoots("downstream", k)],
2676
- calculationStatus: R,
2677
- outputErrors: ((Me = T.prod) == null ? void 0 : Me.outputError) === !0,
2678
- outputsError: ($e = T.prod) == null ? void 0 : $e.outputsError,
2679
- exportsError: (Ue = T.prod) == null ? void 0 : Ue.exportsError,
2680
- sections: oe,
2704
+ calculationStatus: B,
2705
+ outputErrors: ((Me = E.prod) == null ? void 0 : Me.outputError) === !0,
2706
+ outputsError: (Ue = E.prod) == null ? void 0 : Ue.outputsError,
2707
+ exportsError: ($e = E.prod) == null ? void 0 : $e.exportsError,
2708
+ sections: se,
2681
2709
  inputsValid: v,
2682
- currentBlockPack: N == null ? void 0 : N.source,
2710
+ currentBlockPack: L == null ? void 0 : L.source,
2683
2711
  updatedBlockPack: F,
2684
- sdkVersion: O,
2712
+ sdkVersion: R,
2685
2713
  navigationState: e.getState(k)
2686
2714
  };
2687
2715
  });
@@ -2690,7 +2718,7 @@ function cs(o, e, t) {
2690
2718
  created: new Date(n),
2691
2719
  lastModified: new Date(i),
2692
2720
  authorMarker: s.getKeyValueAsJson(Pe),
2693
- blocks: g
2721
+ blocks: h
2694
2722
  };
2695
2723
  },
2696
2724
  {
@@ -2700,8 +2728,8 @@ function cs(o, e, t) {
2700
2728
  ...r,
2701
2729
  blocks: r.blocks.map((i) => {
2702
2730
  i.inputsValid || s.add(i.id), i.stale && n.add(i.id);
2703
- const a = i.stale || i.upstreams.findIndex((c) => n.has(c)) !== -1, u = a && !!i.inputsValid && !i.missingReference && i.upstreams.findIndex((c) => s.has(c)) === -1;
2704
- return { ...i, canRun: u, stale: a };
2731
+ const a = i.stale || i.upstreams.findIndex((u) => n.has(u)) !== -1, c = a && !!i.inputsValid && !i.missingReference && i.upstreams.findIndex((u) => s.has(u)) === -1;
2732
+ return { ...i, canRun: c, stale: a };
2705
2733
  })
2706
2734
  };
2707
2735
  }
@@ -2717,18 +2745,18 @@ function Nt(o, e) {
2717
2745
  assertFieldType: "Dynamic",
2718
2746
  errorIfFieldNotSet: !0
2719
2747
  },
2720
- { field: y.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 }
2748
+ { field: b.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 }
2721
2749
  )) == null ? void 0 : t.getDataAsJson()) == null ? void 0 : r.config,
2722
2750
  (s) => xe(s)
2723
2751
  );
2724
2752
  }
2725
- function us(o, e) {
2753
+ function ps(o, e) {
2726
2754
  const t = o.node();
2727
- if (K(t.resourceType, kt)) {
2755
+ if (M(t.resourceType, kt)) {
2728
2756
  const r = t.getDataAsJson();
2729
2757
  if (r === void 0) throw new Error("No resource data.");
2730
2758
  return e.frontendDownloadDriver.getPath(new URL(r.url)).withStableType();
2731
- } else if (K(t.resourceType, Ct)) {
2759
+ } else if (M(t.resourceType, Ct)) {
2732
2760
  const r = t.getDataAsJson();
2733
2761
  if (r === void 0) throw new Error("No resource data.");
2734
2762
  return e.signer.verify(
@@ -2739,10 +2767,10 @@ function us(o, e) {
2739
2767
  } else
2740
2768
  throw new Error(`Unsupported resource type: ${JSON.stringify(t.resourceType)}`);
2741
2769
  }
2742
- function ls(o, e) {
2770
+ function hs(o, e) {
2743
2771
  if (o !== void 0)
2744
2772
  return P.make(
2745
- (t) => us(t.accessor(o), e),
2773
+ (t) => ps(t.accessor(o), e),
2746
2774
  {
2747
2775
  postprocessValue: (t) => {
2748
2776
  if (t !== void 0) {
@@ -2754,7 +2782,7 @@ function ls(o, e) {
2754
2782
  }
2755
2783
  ).withStableType();
2756
2784
  }
2757
- function ds(o, e, t) {
2785
+ function fs(o, e, t) {
2758
2786
  return P.make(
2759
2787
  (r) => {
2760
2788
  var a;
@@ -2763,15 +2791,15 @@ function ds(o, e, t) {
2763
2791
  field: C(e, "blockPack"),
2764
2792
  assertFieldType: "Dynamic"
2765
2793
  },
2766
- { field: y.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 },
2794
+ { field: b.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 },
2767
2795
  { field: Ft, assertFieldType: "Input" }
2768
2796
  )) == null ? void 0 : a.persist();
2769
- return { path: ls(i, t), sdkVersion: n == null ? void 0 : n.sdkVersion };
2797
+ return { path: hs(i, t), sdkVersion: n == null ? void 0 : n.sdkVersion };
2770
2798
  },
2771
2799
  { mode: "StableOnlyLive" }
2772
2800
  );
2773
2801
  }
2774
- function ps(o, e, t) {
2802
+ function gs(o, e, t) {
2775
2803
  return P.make(
2776
2804
  (r) => {
2777
2805
  const s = r.accessor(o).node(), n = Le(s, e);
@@ -2784,59 +2812,59 @@ function ps(o, e, t) {
2784
2812
  { key: "inputs#" + pt(o.rid) + e }
2785
2813
  );
2786
2814
  }
2787
- function hs(o, e, t) {
2815
+ function ms(o, e, t) {
2788
2816
  return P.make(
2789
2817
  (r) => {
2790
2818
  const s = r.accessor(o).node(), n = xt(s, e), i = Nt(s, e);
2791
2819
  return de(i, (a) => {
2792
- const u = {};
2793
- for (const [c, l] of Object.entries(a.outputs))
2794
- u[c] = P.wrapError(
2820
+ const c = {};
2821
+ for (const [u, l] of Object.entries(a.outputs))
2822
+ c[u] = P.wrapError(
2795
2823
  De(t, n, l, a.code)
2796
2824
  );
2797
- return u;
2825
+ return c;
2798
2826
  });
2799
2827
  },
2800
2828
  { key: "outputs#" + pt(o.rid) + e }
2801
2829
  ).withStableType();
2802
2830
  }
2803
- function fs(o, e) {
2831
+ function vs(o, e) {
2804
2832
  return P.make((t) => {
2805
- const r = t.accessor(o).node(), s = w(r.getKeyValueAsJson(G)), n = [];
2806
- for (const { id: i, renderingMode: a } of V(s)) {
2807
- const u = r.traverse(
2833
+ const r = t.accessor(o).node(), s = w(r.getKeyValueAsJson(H)), n = [];
2834
+ for (const { id: i, renderingMode: a } of N(s)) {
2835
+ const c = r.traverse(
2808
2836
  {
2809
2837
  field: C(i, "blockPack"),
2810
2838
  assertFieldType: "Dynamic",
2811
2839
  errorIfFieldNotSet: !0
2812
2840
  },
2813
- { field: y.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 }
2814
- ), c = u == null ? void 0 : u.getDataAsJson();
2815
- if ((c == null ? void 0 : c.config) === void 0) continue;
2816
- const l = xe(c.config), p = Object.entries(l.outputs).map(([, g]) => g).filter((g) => !ut(g) && Eo(g)).map((g) => g);
2841
+ { field: b.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 }
2842
+ ), u = c == null ? void 0 : c.getDataAsJson();
2843
+ if ((u == null ? void 0 : u.config) === void 0) continue;
2844
+ const l = xe(u.config), p = Object.entries(l.outputs).map(([, h]) => h).filter((h) => !ut(h) && Ao(h)).map((h) => h);
2817
2845
  if (p.length === 0) continue;
2818
- const h = xt(r, i);
2819
- for (const g of p)
2820
- n.push(P.wrapError(It(e.driverKit, h, g)));
2846
+ const f = xt(r, i);
2847
+ for (const h of p)
2848
+ n.push(P.wrapError(It(e.driverKit, f, h)));
2821
2849
  }
2822
2850
  return n;
2823
2851
  });
2824
2852
  }
2825
- class gs {
2853
+ class ys {
2826
2854
  constructor() {
2827
2855
  d(this, "states", /* @__PURE__ */ new Map());
2828
2856
  }
2829
2857
  setState(e, t) {
2830
2858
  const r = this.states.get(e);
2831
2859
  if (r === void 0) {
2832
- this.states.set(e, { state: t, change: new We() });
2860
+ this.states.set(e, { state: t, change: new _e() });
2833
2861
  return;
2834
2862
  }
2835
2863
  r.state = { ...t }, r.change.markChanged();
2836
2864
  }
2837
2865
  readState(e, t) {
2838
2866
  let r = this.states.get(t);
2839
- return r === void 0 && (r = { state: { ...Gt }, change: new We() }, this.states.set(t, r)), r.change.attachWatcher(e.watcher), r.state;
2867
+ return r === void 0 && (r = { state: { ...Gt }, change: new _e() }, this.states.set(t, r)), r.change.attachWatcher(e.watcher), r.state;
2840
2868
  }
2841
2869
  getState(e) {
2842
2870
  return P.make(
@@ -2855,32 +2883,32 @@ class Je {
2855
2883
  d(this, "rid");
2856
2884
  /** Data for the left panel, contain basic information about block status. */
2857
2885
  d(this, "overview");
2858
- d(this, "navigationStates", new gs());
2886
+ d(this, "navigationStates", new ys());
2859
2887
  d(this, "blockComputables", /* @__PURE__ */ new Map());
2860
2888
  d(this, "blockFrontends", /* @__PURE__ */ new Map());
2861
2889
  d(this, "activeConfigs");
2862
2890
  d(this, "refreshLoopResult");
2863
2891
  d(this, "abortController", new AbortController());
2864
2892
  d(this, "destroyed", !1);
2865
- this.env = e, this.projectTree = r, this.overview = cs(
2893
+ this.env = e, this.projectTree = r, this.overview = ds(
2866
2894
  r.entry(),
2867
2895
  this.navigationStates,
2868
2896
  e
2869
- ).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs = fs(r.entry(), e);
2897
+ ).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs = vs(r.entry(), e);
2870
2898
  }
2871
2899
  async refreshLoop() {
2872
2900
  for (; !this.destroyed; )
2873
2901
  try {
2874
2902
  await be(this.env.pl, this.rid, (e) => {
2875
2903
  e.doRefresh(this.env.ops.stagingRenderingRate);
2876
- }), await this.activeConfigs.getValue(), await ur(this.env.ops.projectRefreshInterval, this.abortController.signal);
2904
+ }), await this.activeConfigs.getValue(), await dr(this.env.ops.projectRefreshInterval, this.abortController.signal);
2877
2905
  } catch (e) {
2878
- if (er(e)) {
2906
+ if (rr(e)) {
2879
2907
  console.warn(
2880
2908
  "project refresh routine terminated, because project was externally deleted"
2881
2909
  );
2882
2910
  break;
2883
- } else if (!tr(e))
2911
+ } else if (!or(e))
2884
2912
  throw new Error("Unexpected exception", { cause: e });
2885
2913
  }
2886
2914
  }
@@ -2895,13 +2923,13 @@ class Je {
2895
2923
  *
2896
2924
  * @return returns newly created block id
2897
2925
  * */
2898
- async addBlock(e, t, r, s = void 0, n = Y()) {
2926
+ async addBlock(e, t, r, s = void 0, n = Q()) {
2899
2927
  const i = await this.env.bpPreparer.prepare(t), a = await this.env.bpPreparer.getBlockConfig(t);
2900
- return await A(
2928
+ return await I(
2901
2929
  this.env.pl,
2902
2930
  this.rid,
2903
2931
  s,
2904
- (u) => u.addBlock(
2932
+ (c) => c.addBlock(
2905
2933
  {
2906
2934
  id: n,
2907
2935
  label: e,
@@ -2921,7 +2949,7 @@ class Je {
2921
2949
  * */
2922
2950
  async updateBlockPack(e, t, r = !1, s) {
2923
2951
  const n = await this.env.bpPreparer.prepare(t), i = await this.env.bpPreparer.getBlockConfig(t);
2924
- await A(
2952
+ await I(
2925
2953
  this.env.pl,
2926
2954
  this.rid,
2927
2955
  s,
@@ -2934,7 +2962,7 @@ class Je {
2934
2962
  }
2935
2963
  /** Deletes a block with all associated data. */
2936
2964
  async deleteBlock(e, t) {
2937
- await A(this.env.pl, this.rid, t, (r) => r.deleteBlock(e)), this.navigationStates.deleteBlock(e), await this.projectTree.refreshState();
2965
+ await I(this.env.pl, this.rid, t, (r) => r.deleteBlock(e)), this.navigationStates.deleteBlock(e), await this.projectTree.refreshState();
2938
2966
  }
2939
2967
  /**
2940
2968
  * Updates block order according to the given array of block ids.
@@ -2943,7 +2971,7 @@ class Je {
2943
2971
  * an error will be thrown instead.
2944
2972
  */
2945
2973
  async reorderBlocks(e, t) {
2946
- await A(this.env.pl, this.rid, t, (r) => {
2974
+ await I(this.env.pl, this.rid, t, (r) => {
2947
2975
  const s = r.structure;
2948
2976
  if (s.groups.length !== 1)
2949
2977
  throw new Error("Unexpected project structure, non-sinular block group");
@@ -2957,9 +2985,9 @@ class Je {
2957
2985
  id: n.id,
2958
2986
  label: n.label,
2959
2987
  blocks: e.map((a) => {
2960
- const u = n.blocks.find((c) => c.id === a);
2961
- if (u === void 0) throw new Error(`Can't find block: ${a}`);
2962
- return u;
2988
+ const c = n.blocks.find((u) => u.id === a);
2989
+ if (c === void 0) throw new Error(`Can't find block: ${a}`);
2990
+ return c;
2963
2991
  })
2964
2992
  }
2965
2993
  ]
@@ -2985,7 +3013,7 @@ class Je {
2985
3013
  }
2986
3014
  /** Update block label. */
2987
3015
  async setBlockLabel(e, t, r) {
2988
- await A(this.env.pl, this.rid, r, (s) => {
3016
+ await I(this.env.pl, this.rid, r, (s) => {
2989
3017
  s.setBlockLabel(e, t);
2990
3018
  }), await this.projectTree.refreshState();
2991
3019
  }
@@ -2996,7 +3024,7 @@ class Je {
2996
3024
  * in collaborative editing scenario.
2997
3025
  * */
2998
3026
  async setBlockArgs(e, t, r) {
2999
- await A(
3027
+ await I(
3000
3028
  this.env.pl,
3001
3029
  this.rid,
3002
3030
  r,
@@ -3010,7 +3038,7 @@ class Je {
3010
3038
  * in collaborative editing scenario.
3011
3039
  * */
3012
3040
  async setUiState(e, t, r) {
3013
- await A(
3041
+ await I(
3014
3042
  this.env.pl,
3015
3043
  this.rid,
3016
3044
  r,
@@ -3030,7 +3058,7 @@ class Je {
3030
3058
  * in collaborative editing scenario.
3031
3059
  * */
3032
3060
  async setBlockArgsAndUiState(e, t, r, s) {
3033
- await A(this.env.pl, this.rid, s, (n) => {
3061
+ await I(this.env.pl, this.rid, s, (n) => {
3034
3062
  n.setArgs([{ blockId: e, args: JSON.stringify(t) }]), n.setUiState(e, JSON.stringify(r));
3035
3063
  }), await this.projectTree.refreshState();
3036
3064
  }
@@ -3040,22 +3068,22 @@ class Je {
3040
3068
  const s = we(
3041
3069
  (await r.getField(S(this.rid, C(e, "blockPack")))).value
3042
3070
  ), n = we(
3043
- (await r.getField(S(s, y.HolderRefField))).value
3071
+ (await r.getField(S(s, b.HolderRefField))).value
3044
3072
  ), i = await r.getResourceData(n, !1), a = JSON.parse(
3045
3073
  Buffer.from(w(i.data)).toString("utf-8")
3046
3074
  );
3047
- await A(r, this.rid, t, (u) => {
3048
- u.setArgs([{ blockId: e, args: JSON.stringify(a.config.initialArgs) }]), u.setUiState(e, void 0);
3075
+ await I(r, this.rid, t, (c) => {
3076
+ c.setArgs([{ blockId: e, args: JSON.stringify(a.config.initialArgs) }]), c.setUiState(e, void 0);
3049
3077
  }), await r.commit();
3050
3078
  }), await this.projectTree.refreshState();
3051
3079
  }
3052
3080
  getBlockComputables(e) {
3053
3081
  const t = this.blockComputables.get(e);
3054
3082
  if (t === void 0) {
3055
- const r = hs(this.projectTree.entry(), e, this.env), n = {
3083
+ const r = ms(this.projectTree.entry(), e, this.env), n = {
3056
3084
  fullState: P.make(
3057
3085
  (i) => ({
3058
- argsAndUiState: ps(this.projectTree.entry(), e),
3086
+ argsAndUiState: gs(this.projectTree.entry(), e),
3059
3087
  outputs: r,
3060
3088
  navigationState: this.navigationStates.getState(e)
3061
3089
  }),
@@ -3086,7 +3114,7 @@ class Je {
3086
3114
  getBlockFrontend(e) {
3087
3115
  const t = this.blockFrontends.get(e);
3088
3116
  if (t === void 0) {
3089
- const r = ds(
3117
+ const r = fs(
3090
3118
  this.projectTree.entry(),
3091
3119
  e,
3092
3120
  this.env
@@ -3129,7 +3157,7 @@ const Lt = {
3129
3157
  pollingInterval: 1e3,
3130
3158
  stopPollingDelay: 1e3
3131
3159
  }
3132
- }, ms = {
3160
+ }, bs = {
3133
3161
  ...Lt,
3134
3162
  defaultTreeOptions: {
3135
3163
  pollingInterval: 350,
@@ -3138,12 +3166,12 @@ const Lt = {
3138
3166
  devBlockUpdateRecheckInterval: 1e3,
3139
3167
  projectRefreshInterval: 700,
3140
3168
  stagingRenderingRate: 5
3141
- }, vs = {
3169
+ }, ws = {
3142
3170
  minDelay: 1500
3143
- }, ys = "__no_updates__";
3144
- class bs extends sr {
3171
+ }, Ss = "__no_updates__";
3172
+ class ks extends ir {
3145
3173
  constructor(t = {}) {
3146
- super({ ...t, ...vs });
3174
+ super({ ...t, ...ws });
3147
3175
  d(this, "http");
3148
3176
  this.http = t.http;
3149
3177
  }
@@ -3154,7 +3182,7 @@ class bs extends sr {
3154
3182
  case "dev-v2":
3155
3183
  return `dev_2_${t.folder}_${t.mtime}`;
3156
3184
  default:
3157
- return ys;
3185
+ return Ss;
3158
3186
  }
3159
3187
  }
3160
3188
  async readValue(t) {
@@ -3223,9 +3251,9 @@ class it {
3223
3251
  function at(o) {
3224
3252
  return String(o.id);
3225
3253
  }
3226
- class ws {
3254
+ class Cs {
3227
3255
  constructor(e, t) {
3228
- d(this, "pFrame", new Sr());
3256
+ d(this, "pFrame", new Cr());
3229
3257
  d(this, "blobIdToResource", /* @__PURE__ */ new Map());
3230
3258
  d(this, "blobHandleComputables", /* @__PURE__ */ new Map());
3231
3259
  d(this, "preloadBlob", async (e) => {
@@ -3238,8 +3266,8 @@ class ws {
3238
3266
  });
3239
3267
  this.blobDriver = e, this.columns = t, this.pFrame.setDataSource(this);
3240
3268
  for (const r of t) {
3241
- for (const n of wo(r.data)) this.blobIdToResource.set(at(n), n);
3242
- const s = So(r.data, at);
3269
+ for (const n of Co(r.data)) this.blobIdToResource.set(at(n), n);
3270
+ const s = Po(r.data, at);
3243
3271
  try {
3244
3272
  this.pFrame.addColumnSpec(r.id, r.spec), this.pFrame.setColumnData(r.id, s);
3245
3273
  } catch (n) {
@@ -3261,7 +3289,7 @@ class ws {
3261
3289
  this.pFrame.dispose();
3262
3290
  }
3263
3291
  }
3264
- class Ss {
3292
+ class Ps {
3265
3293
  constructor(e) {
3266
3294
  d(this, "pFrames");
3267
3295
  d(this, "pTables");
@@ -3270,10 +3298,10 @@ class Ss {
3270
3298
  super(), this.blobDriver = t;
3271
3299
  }
3272
3300
  createNewResource(t) {
3273
- return new ws(this.blobDriver, t);
3301
+ return new Cs(this.blobDriver, t);
3274
3302
  }
3275
3303
  calculateParamsKey(t) {
3276
- return Cs(t);
3304
+ return Bs(t);
3277
3305
  }
3278
3306
  }(this.blobDriver), this.pTables = new class extends it {
3279
3307
  constructor(t) {
@@ -3281,13 +3309,13 @@ class Ss {
3281
3309
  }
3282
3310
  async createNewResource(t) {
3283
3311
  const s = await this.pFrames.getByKey(t.pFrameHandle).pFrame.createTable({
3284
- src: q(t.def.src),
3312
+ src: Y(t.def.src),
3285
3313
  filters: t.def.filters
3286
3314
  });
3287
3315
  return t.def.sorting.length !== 0 ? s.sort(t.def.sorting) : s;
3288
3316
  }
3289
3317
  calculateParamsKey(t) {
3290
- return ks(t);
3318
+ return Fs(t);
3291
3319
  }
3292
3320
  }(this.pFrames);
3293
3321
  }
@@ -3295,11 +3323,11 @@ class Ss {
3295
3323
  // Internal / Config API Methods
3296
3324
  //
3297
3325
  createPFrame(e, t) {
3298
- const r = e.map((n) => z(n, (i) => Ro(i))), s = this.pFrames.acquire(r);
3326
+ const r = e.map((n) => q(n, (i) => xo(i))), s = this.pFrames.acquire(r);
3299
3327
  return t.addOnDestroy(s.unref), s.key;
3300
3328
  }
3301
3329
  createPTable(e, t) {
3302
- const r = this.createPFrame(Ps(e.src), t), s = ct(e, (i) => i.id), n = this.pTables.acquire({ def: s, pFrameHandle: r });
3330
+ const r = this.createPFrame(Rs(e.src), t), s = ct(e, (i) => i.id), n = this.pTables.acquire({ def: s, pFrameHandle: r });
3303
3331
  return t.addOnDestroy(n.unref), n.key;
3304
3332
  }
3305
3333
  //
@@ -3324,7 +3352,7 @@ class Ss {
3324
3352
  }
3325
3353
  async calculateTableData(e, t) {
3326
3354
  let r = await this.pFrames.getByKey(e).pFrame.createTable({
3327
- src: q(t.src),
3355
+ src: Y(t.src),
3328
3356
  filters: t.filters
3329
3357
  });
3330
3358
  if (t.sorting.length > 0) {
@@ -3353,7 +3381,7 @@ class Ss {
3353
3381
  return (await this.pTables.getByKey(e)).getData(t, r);
3354
3382
  }
3355
3383
  }
3356
- function q(o) {
3384
+ function Y(o) {
3357
3385
  switch (o.type) {
3358
3386
  case "column":
3359
3387
  return {
@@ -3365,30 +3393,30 @@ function q(o) {
3365
3393
  case "full":
3366
3394
  return {
3367
3395
  type: o.type,
3368
- entries: o.entries.map((e) => q(e))
3396
+ entries: o.entries.map((e) => Y(e))
3369
3397
  };
3370
3398
  case "outer":
3371
3399
  return {
3372
3400
  type: "outer",
3373
- primary: q(o.primary),
3374
- secondary: o.secondary.map((e) => q(e))
3401
+ primary: Y(o.primary),
3402
+ secondary: o.secondary.map((e) => Y(e))
3375
3403
  };
3376
3404
  default:
3377
3405
  D(o);
3378
3406
  }
3379
3407
  }
3380
- function ks(o) {
3408
+ function Fs(o) {
3381
3409
  const e = he("sha256");
3382
- return e.update(o.pFrameHandle), e.update(Ee(o.def)), e.digest().toString("hex");
3410
+ return e.update(o.pFrameHandle), e.update(je(o.def)), e.digest().toString("hex");
3383
3411
  }
3384
- function Cs(o) {
3412
+ function Bs(o) {
3385
3413
  const e = o.map((s) => s.id).sort(), t = he("sha256");
3386
3414
  let r = "";
3387
3415
  for (const s of e)
3388
3416
  r !== s && (t.update(s), r = s);
3389
3417
  return t.digest().toString("hex");
3390
3418
  }
3391
- function Ps(o) {
3419
+ function Rs(o) {
3392
3420
  const e = /* @__PURE__ */ new Map();
3393
3421
  return ae(o, e), [...e.values()];
3394
3422
  }
@@ -3409,33 +3437,33 @@ function ae(o, e) {
3409
3437
  D(o);
3410
3438
  }
3411
3439
  }
3412
- async function Fs(o, e, t) {
3440
+ async function Os(o, e, t) {
3413
3441
  const r = { ...Lt, ...t };
3414
- Bs(e, r);
3415
- const s = new dt(r.localSecret), n = lr(e, o, r.platformLocalStorageNameToPath), i = dr(o, e), a = pr(o, e), u = hr(o, e), c = fr(o, e), l = new gr(
3442
+ Ds(e, r);
3443
+ const s = new dt(r.localSecret), n = pr(e, o, r.platformLocalStorageNameToPath), i = hr(o, e), a = fr(o, e), c = gr(o, e), u = mr(o, e), l = new vr(
3416
3444
  e,
3417
3445
  n,
3418
3446
  i,
3419
3447
  r.blobDownloadPath,
3420
3448
  s,
3421
3449
  r.blobDriverOps
3422
- ), p = new mr(
3450
+ ), p = new yr(
3423
3451
  e,
3424
3452
  s,
3425
3453
  a,
3426
- u,
3454
+ c,
3427
3455
  r.uploadDriverOps
3428
- ), h = new vr(i, r.logStreamDriverOps), g = new yr(h, l), b = new br(e, c, o, s, r.localStorageNameToPath), B = new Ss(l);
3456
+ ), f = new br(i, r.logStreamDriverOps), h = new wr(f, l), y = new Sr(e, u, o, s, r.localStorageNameToPath), O = new Ps(l);
3429
3457
  return {
3430
3458
  blobDriver: l,
3431
- logDriver: g,
3432
- lsDriver: b,
3459
+ logDriver: h,
3460
+ lsDriver: y,
3433
3461
  signer: s,
3434
3462
  uploadDriver: p,
3435
- pFrameDriver: B
3463
+ pFrameDriver: O
3436
3464
  };
3437
3465
  }
3438
- function Bs(o, e) {
3466
+ function Ds(o, e) {
3439
3467
  e.localStorageNameToPath.local != gt.homedir() && o.warn(`'local' storage with homedir was overwrote: ${e.localStorageNameToPath.local}`);
3440
3468
  const t = Object.keys(e.platformLocalStorageNameToPath), r = Object.keys(e.localStorageNameToPath).find(
3441
3469
  (s) => t.includes(s)
@@ -3464,16 +3492,16 @@ class Jt {
3464
3492
  // Project List Manipulation
3465
3493
  //
3466
3494
  /** Creates a project with initial state and adds it to project list. */
3467
- async createProject(e, t = Y()) {
3495
+ async createProject(e, t = Q()) {
3468
3496
  const r = await this.pl.withWriteTx("MLCreateProject", async (s) => {
3469
- const n = await bo(s, e);
3470
- return s.createField(S(this.projectListResourceId, t), "Dynamic", n), await s.commit(), await rr(n);
3497
+ const n = await ko(s, e);
3498
+ return s.createField(S(this.projectListResourceId, t), "Dynamic", n), await s.commit(), await sr(n);
3471
3499
  });
3472
3500
  return await this.projectListTree.refreshState(), r;
3473
3501
  }
3474
3502
  /** Updates project metadata */
3475
3503
  async setProjectMeta(e, t, r) {
3476
- await A(this.pl, e, r, async (s) => {
3504
+ await I(this.pl, e, r, async (s) => {
3477
3505
  s.setMeta(t);
3478
3506
  }), await this.projectListTree.refreshState();
3479
3507
  }
@@ -3530,67 +3558,72 @@ class Jt {
3530
3558
  }
3531
3559
  /** Initialize middle layer */
3532
3560
  static async init(e, t) {
3533
- const r = { ...ms, ...t }, s = await e.withWriteTx("MLInitialization", async (h) => {
3534
- const g = S(h.clientRoot, Kr);
3535
- h.createField(g, "Dynamic");
3536
- const b = await h.getField(g);
3537
- if (ce(b.value)) {
3538
- const B = h.createEphemeral(wt);
3539
- return h.lock(B), h.setField(g, B), await h.commit(), await B.globalId;
3561
+ const r = { ...bs, ...t }, s = await e.withWriteTx("MLInitialization", async (h) => {
3562
+ const y = S(h.clientRoot, $r);
3563
+ h.createField(y, "Dynamic");
3564
+ const O = await h.getField(y);
3565
+ if (ce(O.value)) {
3566
+ const A = h.createEphemeral(wt);
3567
+ return h.lock(A), h.setField(y, A), await h.commit(), await A.globalId;
3540
3568
  } else
3541
- return b.value;
3542
- }), n = new Wt(console), i = await Fs(e, n, r), a = new po(i.signer), u = new wr(
3569
+ return O.value;
3570
+ }), n = new qt(console), i = await Os(e, n, r), a = new jr(e.httpDispatcher), c = new go(
3571
+ a,
3572
+ i.signer,
3573
+ e.httpDispatcher
3574
+ ), u = new kr(
3543
3575
  n,
3544
3576
  e.httpDispatcher,
3545
3577
  r.frontendDownloadPath
3546
- ), c = {
3578
+ ), l = {
3547
3579
  pl: e,
3548
3580
  signer: i.signer,
3549
3581
  ops: r,
3550
- bpPreparer: a,
3582
+ bpPreparer: c,
3551
3583
  frontendDownloadDriver: u,
3552
3584
  driverKit: i,
3553
- blockUpdateWatcher: new bs({
3585
+ blockUpdateWatcher: new ks({
3554
3586
  minDelay: r.devBlockUpdateRecheckInterval,
3555
3587
  http: e.httpDispatcher
3556
3588
  }),
3557
- quickJs: await cr()
3558
- }, l = new nr([]), p = await $r(e, s, l, c);
3589
+ quickJs: await lr()
3590
+ }, p = new ar([]), f = await Hr(e, s, p, l);
3559
3591
  return new Jt(
3560
- c,
3592
+ l,
3561
3593
  i,
3562
3594
  i.signer,
3563
3595
  s,
3564
- l,
3565
- p.tree,
3566
- p.computable
3596
+ p,
3597
+ f.tree,
3598
+ f.computable
3567
3599
  );
3568
3600
  }
3569
3601
  }
3570
3602
  export {
3571
- zs as BlockPackRegistry,
3572
- qs as CentralBlockRegistry,
3603
+ Qs as BlockPackRegistry,
3604
+ Zs as CentralBlockRegistry,
3573
3605
  Lt as DefaultDriverKitOps,
3574
- ms as DefaultMiddleLayerOps,
3606
+ bs as DefaultMiddleLayerOps,
3575
3607
  Ct as FrontendFromFolderResourceType,
3576
3608
  kt as FrontendFromUrlResourceType,
3577
3609
  Jt as MiddleLayer,
3578
3610
  Je as Project,
3579
- Zr as TengoTemplateGet,
3580
- Xr as TengoTemplateGetRegistry,
3581
- to as TengoTemplateGetTemplate,
3582
- eo as TengoTemplateGetTemplateURI,
3583
- ro as TengoTemplatePack,
3584
- oo as TengoTemplatePackConvert,
3585
- no as TengoTemplatePackConvertTemplate,
3586
- so as TengoTemplatePackConvertTemplatePack,
3587
- Qs as V1CentralDevSnapshotRegistry,
3588
- Ys as V1CentralRegistry,
3611
+ to as TengoTemplateGet,
3612
+ ro as TengoTemplateGetRegistry,
3613
+ so as TengoTemplateGetTemplate,
3614
+ oo as TengoTemplateGetTemplateURI,
3615
+ no as TengoTemplatePack,
3616
+ io as TengoTemplatePackConvert,
3617
+ co as TengoTemplatePackConvertTemplate,
3618
+ ao as TengoTemplatePackConvertTemplatePack,
3619
+ en as V1CentralDevSnapshotRegistry,
3620
+ Xs as V1CentralRegistry,
3621
+ jr as V2RegistryProvider,
3589
3622
  St as createRenderTemplate,
3590
3623
  vt as getDevV1PacketMtime,
3591
3624
  Ae as getDevV2PacketMtime,
3592
- Fs as initDriverKit,
3625
+ Os as initDriverKit,
3593
3626
  Ve as loadTemplate,
3594
- io as prepareTemplateSpec
3627
+ uo as prepareTemplateSpec
3595
3628
  };
3596
3629
  //# sourceMappingURL=index.mjs.map