@platforma-sdk/model 1.20.6 → 1.20.24

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,29 +1,29 @@
1
- var pt = Object.defineProperty;
2
- var dt = (e, t, n) => t in e ? pt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var w = (e, t, n) => dt(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { isPColumn as H, mapPObjectData as L, mapValueInVOE as ft, ensurePColumn as ht, isPColumnSpec as Y, extractAllColumns as gt, mapPTableDef as mt, getAxisId as X, matchAxisId as yt } from "@milaboratories/pl-model-common";
1
+ var dt = Object.defineProperty;
2
+ var pt = (e, t, n) => t in e ? dt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var S = (e, t, n) => pt(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { isPColumn as W, mapPObjectData as x, mapValueInVOE as ft, ensurePColumn as ht, isPColumnSpec as X, extractAllColumns as gt, mapPTableDef as mt, getAxisId as Q, matchAxisId as yt } from "@milaboratories/pl-model-common";
5
5
  export * from "@milaboratories/pl-model-common";
6
- import { z as A } from "zod";
6
+ import { z as I } from "zod";
7
7
  class bt extends Error {
8
8
  constructor(t, n) {
9
9
  super(`${t.length}${n ? "+" : ""} errors, first error: ` + t[0]), this.errors = t, this.moreErrors = n;
10
10
  }
11
11
  }
12
- function _t(e) {
12
+ function vt(e) {
13
13
  if (!e.ok) throw new bt(e.errors, e.moreErrors);
14
14
  return e.value;
15
15
  }
16
- function Bt(e) {
16
+ function Nt(e) {
17
17
  return new Proxy(e, {
18
18
  get(t, n) {
19
- return _t(t[n]);
19
+ return vt(t[n]);
20
20
  }
21
21
  });
22
22
  }
23
- function d(e) {
24
- return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null ? D(e) : e;
23
+ function f(e) {
24
+ return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null ? L(e) : e;
25
25
  }
26
- function R(e) {
26
+ function T(e) {
27
27
  return { type: "GetFromCtx", variable: e };
28
28
  }
29
29
  function Mt(e) {
@@ -32,13 +32,13 @@ function Mt(e) {
32
32
  cfg: e
33
33
  };
34
34
  }
35
- const Ut = R("$args"), Jt = R("$it"), $t = R("$prod"), Kt = R("$staging"), Gt = R("$ui");
36
- function D(e) {
35
+ const Ut = T("$args"), Jt = T("$it"), $t = T("$prod"), Kt = T("$staging"), Gt = T("$ui");
36
+ function L(e) {
37
37
  return { type: "Immediate", value: e };
38
38
  }
39
- function rt(e) {
39
+ function st(e) {
40
40
  const t = {};
41
- for (const [n, r] of Object.entries(e)) t[n] = d(r);
41
+ for (const [n, s] of Object.entries(e)) t[n] = f(s);
42
42
  return {
43
43
  type: "MakeObject",
44
44
  template: t
@@ -46,17 +46,17 @@ function rt(e) {
46
46
  }
47
47
  function Ht(...e) {
48
48
  const t = [];
49
- for (const n of e) t.push(d(n));
49
+ for (const n of e) t.push(f(n));
50
50
  return {
51
51
  type: "MakeArray",
52
52
  template: t
53
53
  };
54
54
  }
55
- function x(e, t) {
55
+ function E(e, t) {
56
56
  return {
57
57
  type: "GetJsonField",
58
- source: d(e),
59
- field: d(t)
58
+ source: f(e),
59
+ field: f(t)
60
60
  };
61
61
  }
62
62
  function Wt(e, t, n = "$it") {
@@ -110,15 +110,15 @@ function Zt(e, t) {
110
110
  function te(e, t) {
111
111
  return {
112
112
  type: "GetResourceField",
113
- source: d(e),
114
- field: d(t)
113
+ source: f(e),
114
+ field: f(t)
115
115
  };
116
116
  }
117
117
  function ee() {
118
118
  return function(e) {
119
119
  return {
120
120
  type: "GetResourceValueAsJson",
121
- source: d(e)
121
+ source: f(e)
122
122
  };
123
123
  };
124
124
  }
@@ -130,68 +130,68 @@ function ne(e, t, n = "$it") {
130
130
  itVar: n
131
131
  };
132
132
  }
133
- function re(e) {
133
+ function se(e) {
134
134
  return {
135
135
  type: "GetBlobContent",
136
- source: d(e)
136
+ source: f(e)
137
137
  };
138
138
  }
139
- function se(e) {
139
+ function ie(e) {
140
140
  return {
141
141
  type: "GetBlobContentAsString",
142
- source: d(e)
142
+ source: f(e)
143
143
  };
144
144
  }
145
- function ie() {
145
+ function re() {
146
146
  return function(e) {
147
147
  return {
148
148
  type: "GetBlobContentAsJson",
149
- source: d(e)
149
+ source: f(e)
150
150
  };
151
151
  };
152
152
  }
153
153
  function oe(e) {
154
154
  return {
155
155
  type: "GetDownloadedBlobContent",
156
- source: d(e)
156
+ source: f(e)
157
157
  };
158
158
  }
159
159
  function ae(e) {
160
160
  return {
161
161
  type: "GetOnDemandBlobContent",
162
- source: d(e)
162
+ source: f(e)
163
163
  };
164
164
  }
165
165
  function le(e) {
166
166
  return {
167
167
  type: "GetImportProgress",
168
- source: d(e)
168
+ source: f(e)
169
169
  };
170
170
  }
171
171
  function ue(e, t) {
172
172
  return {
173
173
  type: "GetLastLogs",
174
- source: d(e),
174
+ source: f(e),
175
175
  lines: t
176
176
  };
177
177
  }
178
178
  function ce(e, t) {
179
179
  return {
180
180
  type: "GetProgressLog",
181
- source: d(e),
181
+ source: f(e),
182
182
  patternToSearch: t
183
183
  };
184
184
  }
185
- function pe(e) {
185
+ function de(e) {
186
186
  return {
187
187
  type: "GetLogHandle",
188
- source: d(e)
188
+ source: f(e)
189
189
  };
190
190
  }
191
- function vt() {
191
+ function _t() {
192
192
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
193
193
  }
194
- function st(e) {
194
+ function it(e) {
195
195
  if (e && typeof globalThis.getPlatforma == "function")
196
196
  return globalThis.getPlatforma(e);
197
197
  if (typeof globalThis.platforma < "u") return globalThis.platforma;
@@ -204,70 +204,70 @@ function u() {
204
204
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
205
205
  throw new Error("Not in config rendering context");
206
206
  }
207
- function O(e, t) {
207
+ function k(e, t) {
208
208
  const n = wt();
209
209
  if (n === void 0) return !1;
210
210
  if (e in n.callbackRegistry) throw new Error(`Callback with key ${e} already registered.`);
211
211
  return n.callbackRegistry[e] = t, !0;
212
212
  }
213
- const N = /* @__PURE__ */ new Map();
213
+ const B = /* @__PURE__ */ new Map();
214
214
  function St(e, t) {
215
215
  e in u().callbackRegistry || (u().callbackRegistry[e] = (n) => {
216
- for (const r of N.get(e))
217
- r(n);
218
- }, N.set(e, [])), N.get(e).push(t);
216
+ for (const s of B.get(e))
217
+ s(n);
218
+ }, B.set(e, [])), B.get(e).push(t);
219
219
  }
220
- class g {
221
- constructor(t, n = (r) => r) {
222
- w(this, "isResolved", !1);
223
- w(this, "resolvedValue");
224
- this.handle = t, this.postProcess = n, St(t, (r) => {
225
- this.resolvedValue = n(r), this.isResolved = !0;
220
+ class v {
221
+ constructor(t, n = (s) => s) {
222
+ S(this, "isResolved", !1);
223
+ S(this, "resolvedValue");
224
+ this.handle = t, this.postProcess = n, St(t, (s) => {
225
+ this.resolvedValue = n(s), this.isResolved = !0;
226
226
  });
227
227
  }
228
228
  map(t) {
229
- return new g(this.handle, (n) => t(this.postProcess(n)));
229
+ return new v(this.handle, (n) => t(this.postProcess(n)));
230
230
  }
231
231
  mapDefined(t) {
232
- return new g(this.handle, (n) => {
233
- const r = this.postProcess(n);
234
- return r ? t(r) : void 0;
232
+ return new v(this.handle, (n) => {
233
+ const s = this.postProcess(n);
234
+ return s ? t(s) : void 0;
235
235
  });
236
236
  }
237
237
  toJSON() {
238
238
  return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
239
239
  }
240
240
  }
241
- function Q(e) {
242
- return e === void 0 ? void 0 : new _(e);
241
+ function J(e, t) {
242
+ return e === void 0 ? void 0 : t(e);
243
243
  }
244
244
  class _ {
245
- constructor(t) {
246
- this.handle = t;
245
+ constructor(t, n) {
246
+ this.handle = t, this.resolvePath = n;
247
247
  }
248
248
  resolve(...t) {
249
249
  const n = t.map(
250
- (r) => ({
250
+ (s) => ({
251
251
  assertFieldType: "Input",
252
- ...typeof r == "string" ? { field: r } : r
252
+ ...typeof s == "string" ? { field: s } : s
253
253
  })
254
254
  );
255
255
  return this.resolveWithCommon({}, ...n);
256
256
  }
257
257
  resolveOutput(...t) {
258
258
  const n = t.map(
259
- (r) => ({
259
+ (s) => ({
260
260
  assertFieldType: "Output",
261
- ...typeof r == "string" ? { field: r } : r
261
+ ...typeof s == "string" ? { field: s } : s
262
262
  })
263
263
  );
264
264
  return this.resolveWithCommon({}, ...n);
265
265
  }
266
266
  resolveInput(...t) {
267
267
  const n = t.map(
268
- (r) => ({
268
+ (s) => ({
269
269
  assertFieldType: "Input",
270
- ...typeof r == "string" ? { field: r } : r
270
+ ...typeof s == "string" ? { field: s } : s
271
271
  })
272
272
  );
273
273
  return this.resolveWithCommon({}, ...n);
@@ -276,7 +276,14 @@ class _ {
276
276
  return this.resolveWithCommon({}, ...t);
277
277
  }
278
278
  resolveWithCommon(t, ...n) {
279
- return Q(u().resolveWithCommon(this.handle, t, ...n));
279
+ const s = [
280
+ ...this.resolvePath,
281
+ ...n.map((i) => typeof i == "string" ? i : i.field)
282
+ ];
283
+ return J(
284
+ u().resolveWithCommon(this.handle, t, ...n),
285
+ (i) => new _(i, s)
286
+ );
280
287
  }
281
288
  get resourceType() {
282
289
  return u().getResourceType(this.handle);
@@ -294,7 +301,11 @@ class _ {
294
301
  return u().getIsFinal(this.handle);
295
302
  }
296
303
  getError() {
297
- return Q(u().getError(this.handle));
304
+ const t = [...this.resolvePath, "error"];
305
+ return J(
306
+ u().getError(this.handle),
307
+ (n) => new _(n, t)
308
+ );
298
309
  }
299
310
  listInputFields() {
300
311
  return u().listInputFields(this.handle);
@@ -331,35 +342,38 @@ class _ {
331
342
  *
332
343
  */
333
344
  getPColumns(t = !1, n = "") {
334
- const r = this.parsePObjectCollection(t, n);
335
- return r === void 0 ? void 0 : Object.entries(r).map(([, i]) => {
336
- if (!H(i)) throw new Error(`not a PColumn (kind = ${i.spec.kind})`);
337
- return i;
345
+ const s = this.parsePObjectCollection(t, n);
346
+ return s === void 0 ? void 0 : Object.entries(s).map(([, r]) => {
347
+ if (!W(r)) throw new Error(`not a PColumn (kind = ${r.spec.kind})`);
348
+ return r;
338
349
  });
339
350
  }
340
351
  /**
341
352
  *
342
353
  */
343
354
  parsePObjectCollection(t = !1, n = "") {
344
- const r = u().parsePObjectCollection(
355
+ const s = u().parsePObjectCollection(
345
356
  this.handle,
346
357
  t,
347
- n
358
+ n,
359
+ ...this.resolvePath
348
360
  );
349
- if (r === void 0) return;
350
- const s = {};
351
- for (const [i, o] of Object.entries(r))
352
- s[i] = L(o, (l) => new _(l));
353
- return s;
361
+ if (s === void 0) return;
362
+ const i = {};
363
+ for (const [r, o] of Object.entries(s)) {
364
+ const l = [...this.resolvePath, r];
365
+ i[r] = x(o, (d) => new _(d, l));
366
+ }
367
+ return i;
354
368
  }
355
369
  getFileContentAsBase64() {
356
- return new g(u().getBlobContentAsBase64(this.handle));
370
+ return new v(u().getBlobContentAsBase64(this.handle));
357
371
  }
358
372
  getFileContentAsString() {
359
- return new g(u().getBlobContentAsString(this.handle));
373
+ return new v(u().getBlobContentAsString(this.handle));
360
374
  }
361
375
  getFileContentAsJson() {
362
- return new g(
376
+ return new v(
363
377
  u().getBlobContentAsString(this.handle)
364
378
  ).mapDefined((t) => JSON.parse(t));
365
379
  }
@@ -379,7 +393,7 @@ class _ {
379
393
  * @returns downloaded file handle
380
394
  */
381
395
  getFileHandle() {
382
- return new g(u().getDownloadedBlobContentHandle(this.handle));
396
+ return new v(u().getDownloadedBlobContentHandle(this.handle));
383
397
  }
384
398
  /**
385
399
  * @deprecated use getFileHandle
@@ -391,7 +405,7 @@ class _ {
391
405
  * @returns downloaded file handle
392
406
  */
393
407
  getRemoteFileHandle() {
394
- return new g(u().getOnDemandBlobContentHandle(this.handle));
408
+ return new v(u().getOnDemandBlobContentHandle(this.handle));
395
409
  }
396
410
  /**
397
411
  * @deprecated use getRemoteFileHandle
@@ -400,16 +414,16 @@ class _ {
400
414
  return this.getRemoteFileHandle();
401
415
  }
402
416
  getImportProgress() {
403
- return new g(u().getImportProgress(this.handle));
417
+ return new v(u().getImportProgress(this.handle));
404
418
  }
405
419
  getLastLogs(t) {
406
- return new g(u().getLastLogs(this.handle, t));
420
+ return new v(u().getLastLogs(this.handle, t));
407
421
  }
408
422
  getProgressLog(t) {
409
- return new g(u().getProgressLog(this.handle, t));
423
+ return new v(u().getProgressLog(this.handle, t));
410
424
  }
411
425
  getLogHandle() {
412
- return new g(u().getLogHandle(this.handle));
426
+ return new v(u().getLogHandle(this.handle));
413
427
  }
414
428
  allFieldsResolved(t = "Input") {
415
429
  switch (t) {
@@ -424,113 +438,113 @@ class _ {
424
438
  }
425
439
  }
426
440
  mapFields(t, n) {
427
- const { fieldType: r, requireLocked: s, skipUnresolved: i } = {
441
+ const { fieldType: s, requireLocked: i, skipUnresolved: r } = {
428
442
  fieldType: "Input",
429
443
  requireLocked: !0,
430
444
  skipUnresolved: !1,
431
445
  ...n
432
446
  }, o = t;
433
- if (s && (r === "Input" && !this.getInputsLocked() || r === "Output" && !this.getOutputsLocked()))
447
+ if (i && (s === "Input" && !this.getInputsLocked() || s === "Output" && !this.getOutputsLocked()))
434
448
  return;
435
- let a = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
436
- (c) => [c, this.resolve({ field: c, assertFieldType: r })]
449
+ let d = (s === "Input" ? this.listInputFields() : s === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
450
+ (a) => [a, this.resolve({ field: a, assertFieldType: s })]
437
451
  );
438
- return i && (a = a.filter((c) => c[1] !== void 0)), a.map(([c, f]) => o(c, f));
452
+ return r && (d = d.filter((a) => a[1] !== void 0)), d.map(([a, p]) => o(a, p));
439
453
  }
440
454
  }
441
- const it = "staging", ot = "main", Ct = {
455
+ const rt = "staging", ot = "main", Pt = {
442
456
  inlineColumnsSupport: !0
443
457
  };
444
458
  function at(e) {
445
459
  return typeof e == "object" && e !== null && "__awaited_futures__" in e;
446
460
  }
447
- function J(e, t, n) {
461
+ function $(e, t, n) {
448
462
  if (t.has(n)) return;
449
463
  if (t.add(n), typeof n === "object")
450
- if (at(n)) n.__awaited_futures__.forEach((s) => e.add(s));
464
+ if (at(n)) n.__awaited_futures__.forEach((i) => e.add(i));
451
465
  else if (Array.isArray(n))
452
- for (const s of n) J(e, t, s);
466
+ for (const i of n) $(e, t, i);
453
467
  else
454
- for (const [, s] of Object.entries(n))
455
- s !== n && J(e, t, s);
468
+ for (const [, i] of Object.entries(n))
469
+ i !== n && $(e, t, i);
456
470
  }
457
- function At(e) {
471
+ function Ct(e) {
458
472
  const t = /* @__PURE__ */ new Set();
459
- return J(t, /* @__PURE__ */ new Set(), e), t;
473
+ return $(t, /* @__PURE__ */ new Set(), e), t;
460
474
  }
461
- const de = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
475
+ const pe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
462
476
  __proto__: null,
463
- GlobalCfgRenderCtxFeatureFlags: Ct,
477
+ GlobalCfgRenderCtxFeatureFlags: Pt,
464
478
  MainAccessorName: ot,
465
- StagingAccessorName: it,
466
- getAllFutureAwaits: At,
479
+ StagingAccessorName: rt,
480
+ getAllFutureAwaits: Ct,
467
481
  isFutureAwait: at
468
- }, Symbol.toStringTag, { value: "Module" })), It = "pl7.app/label", Pt = "pl7.app/trace", Rt = A.object({
469
- type: A.string(),
470
- importance: A.number().optional(),
471
- id: A.string().optional(),
472
- label: A.string()
473
- }), Ft = A.array(Rt), Tt = 1e-3, Ot = "__LABEL__", Z = "__LABEL__@1";
482
+ }, Symbol.toStringTag, { value: "Module" })), At = "pl7.app/label", It = "pl7.app/trace", Rt = I.object({
483
+ type: I.string(),
484
+ importance: I.number().optional(),
485
+ id: I.string().optional(),
486
+ label: I.string()
487
+ }), Ft = I.array(Rt), Tt = 1e-3, Ot = "__LABEL__", Z = "__LABEL__@1";
474
488
  function kt(e, t, n = {}) {
475
- const r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i = e.map((p) => {
476
- var q, z;
477
- const m = t(p), y = (q = m.annotations) == null ? void 0 : q[It], T = (z = m.annotations) == null ? void 0 : z[Pt], b = (T ? Ft.safeParse(JSON.parse(T)).data : void 0) ?? [];
478
- if (y) {
479
- const v = { label: y, type: Ot, importance: -2 };
480
- n.addLabelAsSuffix ? b.push(v) : b.splice(0, 0, v);
489
+ const s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), r = e.map((c) => {
490
+ var z, Y;
491
+ const m = t(c), h = (z = m.annotations) == null ? void 0 : z[At], P = (Y = m.annotations) == null ? void 0 : Y[It], y = (P ? Ft.safeParse(JSON.parse(P)).data : void 0) ?? [];
492
+ if (h) {
493
+ const w = { label: h, type: Ot, importance: -2 };
494
+ n.addLabelAsSuffix ? y.push(w) : y.splice(0, 0, w);
481
495
  }
482
- const E = [], W = /* @__PURE__ */ new Map();
483
- for (let v = b.length - 1; v >= 0; --v) {
484
- const { type: V } = b[v], ct = b[v].importance ?? 0, j = (W.get(V) ?? 0) + 1;
485
- W.set(V, j);
486
- const I = `${V}@${j}`;
487
- s.set(I, (s.get(I) ?? 0) + 1), r.set(
488
- I,
496
+ const C = [], q = /* @__PURE__ */ new Map();
497
+ for (let w = y.length - 1; w >= 0; --w) {
498
+ const { type: V } = y[w], ct = y[w].importance ?? 0, j = (q.get(V) ?? 0) + 1;
499
+ q.set(V, j);
500
+ const R = `${V}@${j}`;
501
+ i.set(R, (i.get(R) ?? 0) + 1), s.set(
502
+ R,
489
503
  Math.max(
490
- r.get(I) ?? Number.NEGATIVE_INFINITY,
491
- ct - (b.length - v) * Tt
504
+ s.get(R) ?? Number.NEGATIVE_INFINITY,
505
+ ct - (y.length - w) * Tt
492
506
  )
493
- ), E.push({ ...b[v], fullType: I, occurenceIndex: j });
507
+ ), C.push({ ...y[w], fullType: R, occurenceIndex: j });
494
508
  }
495
- return E.reverse(), {
496
- value: p,
509
+ return C.reverse(), {
510
+ value: c,
497
511
  spec: m,
498
- label: y,
499
- fullTrace: E
512
+ label: h,
513
+ fullTrace: C
500
514
  };
501
- }), o = [], l = [], a = [...r];
502
- a.sort(([, p], [, m]) => m - p);
503
- for (const [p] of a)
504
- p.endsWith("@1") || s.get(p) === e.length ? o.push(p) : l.push(p);
505
- const c = (p) => i.map((m) => {
506
- const y = m.fullTrace.filter((b) => p.has(b.fullType)).map((b) => b.label), T = n.separator ?? " / ";
515
+ }), o = [], l = [], d = [...s];
516
+ d.sort(([, c], [, m]) => m - c);
517
+ for (const [c] of d)
518
+ c.endsWith("@1") || i.get(c) === e.length ? o.push(c) : l.push(c);
519
+ const a = (c) => r.map((m) => {
520
+ const h = m.fullTrace.filter((y) => c.has(y.fullType)).map((y) => y.label), P = n.separator ?? " / ";
507
521
  return {
508
- label: y.join(T),
522
+ label: h.join(P),
509
523
  value: m.value
510
524
  };
511
525
  });
512
526
  if (o.length === 0) {
513
527
  if (l.length !== 0) throw new Error("Assertion error.");
514
- return c(new Set(Z));
515
- }
516
- let f = 0, S = 0;
517
- for (; f < o.length; ) {
518
- const p = /* @__PURE__ */ new Set();
519
- n.includeNativeLabel && p.add(Z);
520
- for (let y = 0; y < f; ++y) p.add(o[y]);
521
- p.add(o[S]);
522
- const m = c(p);
523
- if (new Set(m.map((y) => y.label)).size === e.length) return m;
524
- S++, S == o.length && (f++, S = f);
525
- }
526
- return c(/* @__PURE__ */ new Set([...o, ...l]));
528
+ return a(new Set(Z));
529
+ }
530
+ let p = 0, g = 0;
531
+ for (; p < o.length; ) {
532
+ const c = /* @__PURE__ */ new Set();
533
+ n.includeNativeLabel && c.add(Z);
534
+ for (let h = 0; h < p; ++h) c.add(o[h]);
535
+ c.add(o[g]);
536
+ const m = a(c);
537
+ if (new Set(m.map((h) => h.label)).size === e.length) return m;
538
+ g++, g == o.length && (p++, g = p);
539
+ }
540
+ return a(/* @__PURE__ */ new Set([...o, ...l]));
527
541
  }
528
542
  class Dt {
529
543
  constructor() {
530
- w(this, "ctx", u());
531
- w(this, "defaultLabelFn", (t, n) => {
532
- var r;
533
- return ((r = t.annotations) == null ? void 0 : r["pl7.app/label"]) ?? "Unlabelled";
544
+ S(this, "ctx", u());
545
+ S(this, "defaultLabelFn", (t, n) => {
546
+ var s;
547
+ return ((s = t.annotations) == null ? void 0 : s["pl7.app/label"]) ?? "Unlabelled";
534
548
  });
535
549
  }
536
550
  /**
@@ -540,13 +554,13 @@ class Dt {
540
554
  return this.ctx.calculateOptions(t);
541
555
  }
542
556
  getOptions(t, n) {
543
- const r = this.getSpecs().entries.filter((s) => t(s.obj));
544
- return typeof n == "object" || typeof n > "u" ? kt(r, (s) => s.obj, n ?? {}).map(({ value: { ref: s }, label: i }) => ({
545
- ref: s,
546
- label: i
547
- })) : r.map((s) => ({
548
- ref: s.ref,
549
- label: n(s.obj, s.ref)
557
+ const s = this.getSpecs().entries.filter((i) => t(i.obj));
558
+ return typeof n == "object" || typeof n > "u" ? kt(s, (i) => i.obj, n ?? {}).map(({ value: { ref: i }, label: r }) => ({
559
+ ref: i,
560
+ label: r
561
+ })) : s.map((i) => ({
562
+ ref: i.ref,
563
+ label: n(i.obj, i.ref)
550
564
  }));
551
565
  }
552
566
  /**
@@ -563,7 +577,7 @@ class Dt {
563
577
  ref: n.ref,
564
578
  obj: {
565
579
  ...n.obj,
566
- data: new _(n.obj.data)
580
+ data: new _(n.obj.data, [n.ref.blockId, n.ref.name])
567
581
  }
568
582
  }))
569
583
  };
@@ -582,7 +596,10 @@ class Dt {
582
596
  ref: n.ref,
583
597
  obj: {
584
598
  ...n.obj,
585
- data: ft(n.obj.data, (r) => new _(r))
599
+ data: ft(
600
+ n.obj.data,
601
+ (s) => new _(s, [n.ref.blockId, n.ref.name])
602
+ )
586
603
  }
587
604
  }))
588
605
  };
@@ -603,10 +620,10 @@ class Dt {
603
620
  getDataByRef(t) {
604
621
  var n;
605
622
  return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (n = this.getData().entries.find(
606
- (r) => r.ref.blockId === t.blockId && r.ref.name === t.name
607
- )) == null ? void 0 : n.obj : L(
623
+ (s) => s.ref.blockId === t.blockId && s.ref.name === t.name
624
+ )) == null ? void 0 : n.obj : x(
608
625
  this.ctx.getDataFromResultPoolByRef(t.blockId, t.name),
609
- (r) => new _(r)
626
+ (s) => new _(s, [t.blockId, t.name])
610
627
  );
611
628
  }
612
629
  /**
@@ -627,7 +644,7 @@ class Dt {
627
644
  getPColumnSpecByRef(t) {
628
645
  const n = this.getSpecByRef(t);
629
646
  if (n) {
630
- if (!Y(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
647
+ if (!X(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
631
648
  return n;
632
649
  }
633
650
  }
@@ -638,7 +655,7 @@ class Dt {
638
655
  getSpecByRef(t) {
639
656
  var n;
640
657
  return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (n = this.getSpecs().entries.find(
641
- (r) => r.ref.blockId === t.blockId && r.ref.name === t.name
658
+ (s) => s.ref.blockId === t.blockId && s.ref.name === t.name
642
659
  )) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(t.blockId, t.name);
643
660
  }
644
661
  /**
@@ -648,43 +665,45 @@ class Dt {
648
665
  */
649
666
  findDataWithCompatibleSpec(t) {
650
667
  const n = [];
651
- t: for (const r of this.getData().entries) {
652
- if (!Y(r.obj.spec))
668
+ t: for (const s of this.getData().entries) {
669
+ if (!X(s.obj.spec))
653
670
  continue;
654
- const s = r.obj.spec;
655
- if (t.name === s.name && t.valueType === s.valueType && t.axesSpec.length === s.axesSpec.length && $(t.domain, s.domain)) {
656
- for (let i = 0; i < t.axesSpec.length; ++i) {
657
- const o = t.axesSpec[i], l = s.axesSpec[i];
658
- if (o.name !== l.name || o.type !== l.type || !$(o.domain, l.domain))
671
+ const i = s.obj.spec;
672
+ if (t.name === i.name && t.valueType === i.valueType && t.axesSpec.length === i.axesSpec.length && K(t.domain, i.domain)) {
673
+ for (let r = 0; r < t.axesSpec.length; ++r) {
674
+ const o = t.axesSpec[r], l = i.axesSpec[r];
675
+ if (o.name !== l.name || o.type !== l.type || !K(o.domain, l.domain))
659
676
  continue t;
660
677
  }
661
- n.push(r.obj);
678
+ n.push(s.obj);
662
679
  }
663
680
  }
664
681
  return n;
665
682
  }
666
683
  }
667
- function $(e, t) {
684
+ function K(e, t) {
668
685
  if (e === void 0) return t === void 0;
669
686
  if (t === void 0) return !0;
670
687
  for (const n in t)
671
688
  if (e[n] !== t[n]) return !1;
672
689
  return !0;
673
690
  }
674
- class k {
691
+ class D {
675
692
  constructor() {
676
- w(this, "ctx");
677
- w(this, "args");
678
- w(this, "uiState");
679
- w(this, "resultPool", new Dt());
693
+ S(this, "ctx");
694
+ S(this, "args");
695
+ S(this, "uiState");
696
+ S(this, "resultPool", new Dt());
680
697
  this.ctx = u(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : void 0;
681
698
  }
682
699
  getNamedAccessor(t) {
683
- const n = this.ctx.getAccessorHandleByName(t);
684
- return n ? new _(n) : void 0;
700
+ return J(
701
+ this.ctx.getAccessorHandleByName(t),
702
+ (n) => new _(n, [t])
703
+ );
685
704
  }
686
705
  get prerun() {
687
- return this.getNamedAccessor(it);
706
+ return this.getNamedAccessor(rt);
688
707
  }
689
708
  /**
690
709
  * @deprecated use prerun
@@ -713,29 +732,29 @@ class k {
713
732
  */
714
733
  findLabels(t) {
715
734
  const n = this.resultPool.getData();
716
- for (const r of n.entries) {
717
- if (!H(r.obj)) continue;
718
- const s = r.obj.spec;
719
- if (s.name === "pl7.app/label" && s.axesSpec.length === 1 && s.axesSpec[0].name === t.name && s.axesSpec[0].type === t.type && $(t.domain, s.axesSpec[0].domain)) {
720
- if (r.obj.data.resourceType.name !== "PColumnData/Json")
721
- throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
735
+ for (const s of n.entries) {
736
+ if (!W(s.obj)) continue;
737
+ const i = s.obj.spec;
738
+ if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === t.name && i.axesSpec[0].type === t.type && K(t.domain, i.axesSpec[0].domain)) {
739
+ if (s.obj.data.resourceType.name !== "PColumnData/Json")
740
+ throw Error(`Expected JSON column for labels, got: ${s.obj.data.resourceType.name}`);
722
741
  return Object.fromEntries(
723
742
  Object.entries(
724
- r.obj.data.getDataAsJson().data
743
+ s.obj.data.getDataAsJson().data
725
744
  ).map((o) => [JSON.parse(o[0])[0], o[1]])
726
745
  );
727
746
  }
728
747
  }
729
748
  }
730
749
  verifyInlineColumnsSupport(t) {
731
- var s;
732
- const n = t.some((i) => !(i.data instanceof _)), r = ((s = this.ctx.featureFlags) == null ? void 0 : s.inlineColumnsSupport) === !0;
733
- if (n && !r) throw Error("inline columns not supported");
750
+ var i;
751
+ const n = t.some((r) => !(r.data instanceof _)), s = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
752
+ if (n && !s) throw Error("inline columns not supported");
734
753
  }
735
754
  createPFrame(t) {
736
- return this.verifyInlineColumnsSupport(t), this.ctx.createPFrame(t.map((n) => L(
755
+ return this.verifyInlineColumnsSupport(t), this.ctx.createPFrame(t.map((n) => x(
737
756
  n,
738
- (r) => r instanceof _ ? r.handle : r
757
+ (s) => s instanceof _ ? s.handle : s
739
758
  )));
740
759
  }
741
760
  createPTable(t) {
@@ -743,13 +762,13 @@ class k {
743
762
  return "columns" in t ? n = {
744
763
  src: {
745
764
  type: "full",
746
- entries: t.columns.map((r) => ({ type: "column", column: r }))
765
+ entries: t.columns.map((s) => ({ type: "column", column: s }))
747
766
  },
748
767
  filters: t.filters ?? [],
749
768
  sorting: t.sorting ?? []
750
- } : n = t, this.verifyInlineColumnsSupport(gt(n.src)), this.ctx.createPTable(mt(n, (r) => L(
751
- r,
752
- (s) => s instanceof _ ? s.handle : s
769
+ } : n = t, this.verifyInlineColumnsSupport(gt(n.src)), this.ctx.createPTable(mt(n, (s) => x(
770
+ s,
771
+ (i) => i instanceof _ ? i.handle : i
753
772
  )));
754
773
  }
755
774
  /** @deprecated scheduled for removal from SDK */
@@ -761,43 +780,43 @@ class k {
761
780
  return this.ctx.getCurrentUnstableMarker();
762
781
  }
763
782
  }
764
- const F = "PColumnData/", K = F + "ResourceMap", G = F + "Partitioned/ResourceMap", tt = F + "JsonPartitioned", B = F + "BinaryPartitioned", lt = F + "Partitioned/", et = lt + "JsonPartitioned", M = lt + "BinaryPartitioned";
765
- function ut(e, t, n, r = [], s) {
783
+ const O = "PColumnData/", G = O + "ResourceMap", H = O + "Partitioned/ResourceMap", tt = O + "JsonPartitioned", N = O + "BinaryPartitioned", lt = O + "Partitioned/", et = lt + "JsonPartitioned", M = lt + "BinaryPartitioned";
784
+ function ut(e, t, n, s = [], i) {
766
785
  if (e === void 0) return !1;
767
786
  switch (e.resourceType.name) {
768
- case K: {
769
- let i = e.getInputsLocked();
787
+ case G: {
788
+ let r = e.getInputsLocked();
770
789
  for (const o of e.listInputFields()) {
771
- const l = e.resolve({ field: o, assertFieldType: "Input" }), a = [...r, ...JSON.parse(o)], c = l === void 0 ? void 0 : t(l);
772
- c === void 0 && (i = !1), (c !== void 0 || s) && n.push({ key: a, value: c });
790
+ const l = e.resolve({ field: o, assertFieldType: "Input" }), d = [...s, ...JSON.parse(o)], a = l === void 0 ? void 0 : t(l);
791
+ a === void 0 && (r = !1), (a !== void 0 || i) && n.push({ key: d, value: a });
773
792
  }
774
- return i;
793
+ return r;
775
794
  }
776
- case G: {
777
- let i = e.getInputsLocked();
795
+ case H: {
796
+ let r = e.getInputsLocked();
778
797
  for (const o of e.listInputFields()) {
779
798
  const l = e.resolve({ field: o, assertFieldType: "Input" });
780
- if (l === void 0) i = !1;
799
+ if (l === void 0) r = !1;
781
800
  else {
782
- const a = [...r, ...JSON.parse(o)], c = ut(
801
+ const d = [...s, ...JSON.parse(o)], a = ut(
783
802
  l,
784
803
  t,
785
804
  n,
786
- a,
787
- s
805
+ d,
806
+ i
788
807
  );
789
- i = i && c;
808
+ r = r && a;
790
809
  }
791
810
  }
792
- return i;
811
+ return r;
793
812
  }
794
813
  default:
795
814
  throw new Error(`Unknown resource type: ${e.resourceType.name}`);
796
815
  }
797
816
  }
798
817
  function fe(e, t, n = !1) {
799
- const r = [];
800
- return { isComplete: ut(e, t, r, [], n), data: r };
818
+ const s = [];
819
+ return { isComplete: ut(e, t, s, [], n), data: s };
801
820
  }
802
821
  const nt = (e) => {
803
822
  if (!e.endsWith(".index")) {
@@ -808,73 +827,73 @@ const nt = (e) => {
808
827
  };
809
828
  function Lt(e) {
810
829
  if (!e) return;
811
- const t = e.resourceType.name, n = e.getDataAsJson(), r = [];
812
- let s = 0;
830
+ const t = e.resourceType.name, n = e.getDataAsJson(), s = [];
831
+ let i = 0;
813
832
  switch (t) {
814
- case K:
815
- s = n.keyLength;
816
- break;
817
833
  case G:
818
- s = n.partitionKeyLength + n.keyLength;
834
+ i = n.keyLength;
835
+ break;
836
+ case H:
837
+ i = n.partitionKeyLength + n.keyLength;
819
838
  break;
820
839
  case tt:
821
- case B:
822
- s = n.partitionKeyLength;
840
+ case N:
841
+ i = n.partitionKeyLength;
823
842
  break;
824
843
  case M:
825
844
  case et:
826
- s = n.superPartitionKeyLength + n.partitionKeyLength;
845
+ i = n.superPartitionKeyLength + n.partitionKeyLength;
827
846
  break;
828
847
  }
829
848
  switch (t) {
830
- case K:
849
+ case G:
831
850
  case tt:
832
- case B:
833
- for (let i of e.listInputFields()) {
834
- if (t === B) {
835
- const l = nt(i);
836
- if (l) i = l;
851
+ case N:
852
+ for (let r of e.listInputFields()) {
853
+ if (t === N) {
854
+ const l = nt(r);
855
+ if (l) r = l;
837
856
  else continue;
838
857
  }
839
- const o = [...JSON.parse(i)];
840
- r.push(o);
858
+ const o = [...JSON.parse(r)];
859
+ s.push(o);
841
860
  }
842
861
  break;
843
- case G:
862
+ case H:
844
863
  case M:
845
864
  case et:
846
- for (const i of e.listInputFields()) {
847
- const o = [...JSON.parse(i)], l = e.resolve({ field: i, assertFieldType: "Input" });
865
+ for (const r of e.listInputFields()) {
866
+ const o = [...JSON.parse(r)], l = e.resolve({ field: r, assertFieldType: "Input" });
848
867
  if (l !== void 0)
849
- for (let a of l.listInputFields()) {
868
+ for (let d of l.listInputFields()) {
850
869
  if (t === M) {
851
- const f = nt(a);
852
- if (f) a = f;
870
+ const p = nt(d);
871
+ if (p) d = p;
853
872
  else continue;
854
873
  }
855
- const c = [...o, ...JSON.parse(a)];
856
- r.push(c);
874
+ const a = [...o, ...JSON.parse(d)];
875
+ s.push(a);
857
876
  }
858
877
  }
859
878
  break;
860
879
  }
861
- return { data: r, keyLength: s };
880
+ return { data: s, keyLength: i };
862
881
  }
863
882
  function he(e) {
864
883
  const t = Lt(e);
865
884
  if (!t) return;
866
- const { data: n, keyLength: r } = t, s = [];
867
- for (let i = 0; i < r; ++i)
868
- s.push(/* @__PURE__ */ new Set());
869
- for (const i of n) {
870
- if (i.length !== r)
885
+ const { data: n, keyLength: s } = t, i = [];
886
+ for (let r = 0; r < s; ++r)
887
+ i.push(/* @__PURE__ */ new Set());
888
+ for (const r of n) {
889
+ if (r.length !== s)
871
890
  throw new Error("key length does not match partition length");
872
- for (let o = 0; o < r; ++o)
873
- s[o].add(i[o]);
891
+ for (let o = 0; o < s; ++o)
892
+ i[o].add(r[o]);
874
893
  }
875
- return s.map((i) => Array.from(i.values()));
894
+ return i.map((r) => Array.from(r.values()));
876
895
  }
877
- const P = "1.20.6";
896
+ const F = "1.20.24";
878
897
  function xt(e) {
879
898
  return e.__renderLambda === !0;
880
899
  }
@@ -882,7 +901,7 @@ function U(e) {
882
901
  if (e !== void 0)
883
902
  return xt(e) ? e.handle : e;
884
903
  }
885
- function C(e) {
904
+ function A(e) {
886
905
  if (e !== void 0)
887
906
  return typeof e == "string" ? { __renderLambda: !0, handle: e, retentive: !1 } : e;
888
907
  }
@@ -891,57 +910,57 @@ function ge(e) {
891
910
  const {
892
911
  initialArgs: t,
893
912
  initialUiState: n,
894
- inputsValid: r,
895
- outputs: s,
896
- renderingMode: i,
913
+ inputsValid: s,
914
+ outputs: i,
915
+ renderingMode: r,
897
916
  sdkVersion: o,
898
917
  sections: l,
899
- title: a
900
- } = e.v3, { code: c } = e;
918
+ title: d
919
+ } = e.v3, { code: a } = e;
901
920
  return {
902
921
  initialArgs: t,
903
922
  initialUiState: n,
904
- inputsValid: r,
905
- outputs: s,
906
- renderingMode: i,
923
+ inputsValid: s,
924
+ outputs: i,
925
+ renderingMode: r,
907
926
  sdkVersion: o,
908
927
  sections: l,
909
- title: a,
910
- code: c
928
+ title: d,
929
+ code: a
911
930
  };
912
931
  } else if (e.inputsValid !== void 0) {
913
- const { sdkVersion: t, renderingMode: n, outputs: r, inputsValid: s, sections: i, initialArgs: o, code: l } = e, a = Object.keys(e);
914
- if (t === void 0 || n === void 0 || r === void 0 || s === void 0 || i === void 0 || o === void 0)
932
+ const { sdkVersion: t, renderingMode: n, outputs: s, inputsValid: i, sections: r, initialArgs: o, code: l } = e, d = Object.keys(e);
933
+ if (t === void 0 || n === void 0 || s === void 0 || i === void 0 || r === void 0 || o === void 0)
915
934
  throw new Error(
916
- `Malformed config v2. SDK version ${t}; Fields = ${a.join(", ")}`
935
+ `Malformed config v2. SDK version ${t}; Fields = ${d.join(", ")}`
917
936
  );
918
937
  return {
919
938
  sdkVersion: t,
920
939
  renderingMode: n,
921
940
  initialArgs: o,
922
941
  outputs: Object.fromEntries(
923
- Object.entries(r).map(([c, f]) => [c, C(f)])
942
+ Object.entries(s).map(([a, p]) => [a, A(p)])
924
943
  ),
925
- inputsValid: C(s),
926
- sections: C(i),
944
+ inputsValid: A(i),
945
+ sections: A(r),
927
946
  initialUiState: void 0,
928
947
  code: l
929
948
  };
930
949
  } else if (e.renderingMode !== void 0) {
931
- const { sdkVersion: t, canRun: n, renderingMode: r, outputs: s, sections: i, initialArgs: o, code: l } = e, a = Object.keys(e);
932
- if (r === void 0 || s === void 0 || n === void 0 || i === void 0 || o === void 0)
950
+ const { sdkVersion: t, canRun: n, renderingMode: s, outputs: i, sections: r, initialArgs: o, code: l } = e, d = Object.keys(e);
951
+ if (s === void 0 || i === void 0 || n === void 0 || r === void 0 || o === void 0)
933
952
  throw new Error(
934
- `Malformed config v1. SDK version ${t}; Fields = ${a.join(", ")}`
953
+ `Malformed config v1. SDK version ${t}; Fields = ${d.join(", ")}`
935
954
  );
936
955
  return {
937
956
  sdkVersion: t ?? "unknown",
938
- renderingMode: r,
957
+ renderingMode: s,
939
958
  initialArgs: o,
940
959
  outputs: Object.fromEntries(
941
- Object.entries(s).map(([c, f]) => [c, C(f)])
960
+ Object.entries(i).map(([a, p]) => [a, A(p)])
942
961
  ),
943
- inputsValid: C(n),
944
- sections: C(i),
962
+ inputsValid: A(n),
963
+ sections: A(r),
945
964
  initialUiState: void 0,
946
965
  code: l
947
966
  };
@@ -952,25 +971,25 @@ function ge(e) {
952
971
  );
953
972
  }
954
973
  }
955
- class h {
956
- constructor(t, n, r, s, i, o, l) {
957
- this._renderingMode = t, this._initialArgs = n, this._initialUiState = r, this._outputs = s, this._inputsValid = i, this._sections = o, this._title = l;
974
+ class b {
975
+ constructor(t, n, s, i, r, o, l) {
976
+ this._renderingMode = t, this._initialArgs = n, this._initialUiState = s, this._outputs = i, this._inputsValid = r, this._sections = o, this._title = l;
958
977
  }
959
978
  static create(t = "Heavy") {
960
- return new h(
979
+ return new b(
961
980
  t,
962
981
  void 0,
963
982
  {},
964
983
  {},
965
- D(!0),
966
- D([]),
984
+ L(!0),
985
+ L([]),
967
986
  void 0
968
987
  );
969
988
  }
970
- output(t, n, r = {}) {
989
+ output(t, n, s = {}) {
971
990
  if (typeof n == "function") {
972
- const s = `output#${t}`;
973
- return O(s, () => n(new k())), new h(
991
+ const i = `output#${t}`;
992
+ return k(i, () => n(new D())), new b(
974
993
  this._renderingMode,
975
994
  this._initialArgs,
976
995
  this._initialUiState,
@@ -978,8 +997,8 @@ class h {
978
997
  ...this._outputs,
979
998
  [t]: {
980
999
  __renderLambda: !0,
981
- handle: s,
982
- ...r
1000
+ handle: i,
1001
+ ...s
983
1002
  }
984
1003
  },
985
1004
  this._inputsValid,
@@ -987,7 +1006,7 @@ class h {
987
1006
  this._title
988
1007
  );
989
1008
  } else
990
- return new h(
1009
+ return new b(
991
1010
  this._renderingMode,
992
1011
  this._initialArgs,
993
1012
  this._initialUiState,
@@ -1009,7 +1028,7 @@ class h {
1009
1028
  return this.inputsValid(t);
1010
1029
  }
1011
1030
  argsValid(t) {
1012
- return typeof t == "function" ? (O("inputsValid", () => t(new k())), new h(
1031
+ return typeof t == "function" ? (k("inputsValid", () => t(new D())), new b(
1013
1032
  this._renderingMode,
1014
1033
  this._initialArgs,
1015
1034
  this._initialUiState,
@@ -1020,7 +1039,7 @@ class h {
1020
1039
  },
1021
1040
  this._sections,
1022
1041
  this._title
1023
- )) : new h(
1042
+ )) : new b(
1024
1043
  this._renderingMode,
1025
1044
  this._initialArgs,
1026
1045
  this._initialUiState,
@@ -1034,7 +1053,7 @@ class h {
1034
1053
  return this.argsValid(t);
1035
1054
  }
1036
1055
  sections(t) {
1037
- return Array.isArray(t) ? this.sections(D(t)) : typeof t == "function" ? (O("sections", () => t(new k())), new h(
1056
+ return Array.isArray(t) ? this.sections(L(t)) : typeof t == "function" ? (k("sections", () => t(new D())), new b(
1038
1057
  this._renderingMode,
1039
1058
  this._initialArgs,
1040
1059
  this._initialUiState,
@@ -1042,7 +1061,7 @@ class h {
1042
1061
  this._inputsValid,
1043
1062
  { __renderLambda: !0, handle: "sections" },
1044
1063
  this._title
1045
- )) : new h(
1064
+ )) : new b(
1046
1065
  this._renderingMode,
1047
1066
  this._initialArgs,
1048
1067
  this._initialUiState,
@@ -1053,7 +1072,7 @@ class h {
1053
1072
  );
1054
1073
  }
1055
1074
  title(t) {
1056
- return O("title", () => t(new k())), new h(
1075
+ return k("title", () => t(new D())), new b(
1057
1076
  this._renderingMode,
1058
1077
  this._initialArgs,
1059
1078
  this._initialUiState,
@@ -1068,7 +1087,7 @@ class h {
1068
1087
  * @deprecated use {@link withArgs}
1069
1088
  * */
1070
1089
  initialArgs(t) {
1071
- return new h(
1090
+ return new b(
1072
1091
  this._renderingMode,
1073
1092
  t,
1074
1093
  this._initialUiState,
@@ -1080,7 +1099,7 @@ class h {
1080
1099
  }
1081
1100
  /** Sets initial args for the block, this value must be specified. */
1082
1101
  withArgs(t) {
1083
- return new h(
1102
+ return new b(
1084
1103
  this._renderingMode,
1085
1104
  t,
1086
1105
  this._initialUiState,
@@ -1092,7 +1111,7 @@ class h {
1092
1111
  }
1093
1112
  /** Defines type and sets initial value for block UiState. */
1094
1113
  withUiState(t) {
1095
- return new h(
1114
+ return new b(
1096
1115
  this._renderingMode,
1097
1116
  this._initialArgs,
1098
1117
  t,
@@ -1109,7 +1128,7 @@ class h {
1109
1128
  if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
1110
1129
  const t = {
1111
1130
  v3: {
1112
- sdkVersion: P,
1131
+ sdkVersion: F,
1113
1132
  renderingMode: this._renderingMode,
1114
1133
  initialArgs: this._initialArgs,
1115
1134
  initialUiState: this._initialUiState,
@@ -1119,28 +1138,50 @@ class h {
1119
1138
  outputs: this._outputs
1120
1139
  },
1121
1140
  // fields below are added to allow previous desktop versions read generated configs
1122
- sdkVersion: P,
1141
+ sdkVersion: F,
1123
1142
  renderingMode: this._renderingMode,
1124
1143
  initialArgs: this._initialArgs,
1125
1144
  inputsValid: U(this._inputsValid),
1126
1145
  sections: U(this._sections),
1127
1146
  outputs: Object.fromEntries(
1128
- Object.entries(this._outputs).map(([n, r]) => [n, U(r)])
1147
+ Object.entries(this._outputs).map(([n, s]) => [n, U(s)])
1129
1148
  )
1130
1149
  };
1131
- return vt() ? st({ sdkVersion: P }) : { config: t };
1150
+ return _t() ? it({ sdkVersion: F }) : { config: t };
1132
1151
  }
1133
1152
  }
1134
- function me(e, t, n, r) {
1135
- var o, l;
1136
- const s = e.resultPool.getData().entries.map((a) => a.obj).filter(H).filter((a) => a.spec.name === "pl7.app/label" && a.spec.axesSpec.length === 1), i = /* @__PURE__ */ new Map();
1153
+ function me(e, t, n, s) {
1154
+ var l, d;
1155
+ const i = e.resultPool.getData().entries.map((a) => a.obj).filter(W).filter((a) => a.spec.name === "pl7.app/label" && a.spec.axesSpec.length === 1), r = (a, p) => {
1156
+ let g = a.toString();
1157
+ if (p)
1158
+ for (const c in p)
1159
+ g += c, g += p[c];
1160
+ return g;
1161
+ }, o = /* @__PURE__ */ new Map();
1137
1162
  for (const a of t)
1138
- for (const c of a.spec.axesSpec) {
1139
- const f = X(c);
1140
- for (const S of s)
1141
- yt(f, X(S.spec.axesSpec[0])) && i.set(S.id, S);
1163
+ for (const p of a.spec.axesSpec) {
1164
+ const g = Q(p);
1165
+ for (const c of i) {
1166
+ const m = c.spec.axesSpec[0], h = Q(c.spec.axesSpec[0]);
1167
+ if (yt(g, h)) {
1168
+ const P = Object.keys(g.domain ?? {}).length, y = Object.keys(h.domain ?? {}).length;
1169
+ if (P > y) {
1170
+ const C = r(c.id, g.domain);
1171
+ o.set(C, {
1172
+ id: C,
1173
+ spec: {
1174
+ ...c.spec,
1175
+ axesSpec: [{ ...g, annotations: m.annotations }]
1176
+ },
1177
+ data: c.data
1178
+ });
1179
+ } else
1180
+ o.set(r(c.id), c);
1181
+ }
1182
+ }
1142
1183
  }
1143
- if (![...t, ...i.values()].some(
1184
+ if (![...t, ...o.values()].some(
1144
1185
  (a) => a.data instanceof _ && !a.data.getIsReadyOrError()
1145
1186
  ))
1146
1187
  return e.createPTable({
@@ -1150,19 +1191,19 @@ function me(e, t, n, r) {
1150
1191
  type: "full",
1151
1192
  entries: t.map((a) => ({ type: "column", column: a }))
1152
1193
  },
1153
- secondary: [...i.values()].map((a) => ({ type: "column", column: a }))
1194
+ secondary: [...o.values()].map((a) => ({ type: "column", column: a }))
1154
1195
  },
1155
- filters: [...((o = n == null ? void 0 : n.pTableParams) == null ? void 0 : o.filters) ?? [], ...r ?? []],
1156
- sorting: ((l = n == null ? void 0 : n.pTableParams) == null ? void 0 : l.sorting) ?? []
1196
+ filters: [...((l = n == null ? void 0 : n.pTableParams) == null ? void 0 : l.filters) ?? [], ...s ?? []],
1197
+ sorting: ((d = n == null ? void 0 : n.pTableParams) == null ? void 0 : d.sorting) ?? []
1157
1198
  });
1158
1199
  }
1159
1200
  function ye(e, t, n) {
1160
- const r = e.findLabels(t);
1201
+ const s = e.findLabels(t);
1161
1202
  return {
1162
1203
  axis: t,
1163
- options: n.map((s) => ({
1164
- value: s,
1165
- label: (r == null ? void 0 : r[s]) ?? s.toString()
1204
+ options: n.map((i) => ({
1205
+ value: i,
1206
+ label: (s == null ? void 0 : s[i]) ?? i.toString()
1166
1207
  })),
1167
1208
  defaultValue: n[0]
1168
1209
  };
@@ -1188,23 +1229,23 @@ class be {
1188
1229
  }
1189
1230
  }
1190
1231
  function Et(e) {
1191
- return rt({
1232
+ return st({
1192
1233
  __isRef: !0,
1193
- blockId: x(e, "blockId"),
1194
- name: x(e, "name")
1234
+ blockId: E(e, "blockId"),
1235
+ name: E(e, "name")
1195
1236
  });
1196
1237
  }
1197
- function _e(e) {
1198
- return rt({
1199
- ref: Et(x(e, "ref")),
1200
- label: x(e, "label")
1238
+ function ve(e) {
1239
+ return st({
1240
+ ref: Et(E(e, "ref")),
1241
+ label: E(e, "label")
1201
1242
  });
1202
1243
  }
1203
- const ve = {
1204
- sdkVersion: P
1244
+ const _e = {
1245
+ sdkVersion: F
1205
1246
  };
1206
1247
  function we() {
1207
- return st({ sdkVersion: P });
1248
+ return it({ sdkVersion: F });
1208
1249
  }
1209
1250
  function Se(e) {
1210
1251
  if (typeof globalThis.getEnvironmentValue == "function")
@@ -1212,23 +1253,23 @@ function Se(e) {
1212
1253
  }
1213
1254
  export {
1214
1255
  Ut as Args,
1215
- h as BlockModel,
1216
- ve as CurrentSdkInfo,
1217
- g as FutureRef,
1256
+ b as BlockModel,
1257
+ _e as CurrentSdkInfo,
1258
+ v as FutureRef,
1218
1259
  Jt as It,
1219
- de as JsRenderInternal,
1260
+ pe as JsRenderInternal,
1220
1261
  $t as MainOutputs,
1221
1262
  bt as OutputError,
1222
- It as PAnnotationLabel,
1223
- Pt as PAnnotationTrace,
1263
+ At as PAnnotationLabel,
1264
+ It as PAnnotationTrace,
1224
1265
  be as PFrameImpl,
1225
- B as RT_BINARY_PARTITIONED,
1266
+ N as RT_BINARY_PARTITIONED,
1226
1267
  M as RT_BINARY_SUPER_PARTITIONED,
1227
1268
  tt as RT_JSON_PARTITIONED,
1228
1269
  et as RT_JSON_SUPER_PARTITIONED,
1229
- K as RT_RESOURCE_MAP,
1230
- G as RT_RESOURCE_MAP_PARTITIONED,
1231
- k as RenderCtx,
1270
+ G as RT_RESOURCE_MAP,
1271
+ H as RT_RESOURCE_MAP_PARTITIONED,
1272
+ D as RenderCtx,
1232
1273
  Dt as ResultPool,
1233
1274
  Kt as StagingOutputs,
1234
1275
  Ft as Trace,
@@ -1242,19 +1283,19 @@ export {
1242
1283
  U as downgradeCfgOrLambda,
1243
1284
  ge as extractConfig,
1244
1285
  zt as flatten,
1245
- _e as fromPlOption,
1286
+ ve as fromPlOption,
1246
1287
  Et as fromPlRef,
1247
- re as getBlobContent,
1248
- ie as getBlobContentAsJson,
1249
- se as getBlobContentAsString,
1288
+ se as getBlobContent,
1289
+ re as getBlobContentAsJson,
1290
+ ie as getBlobContentAsString,
1250
1291
  oe as getDownloadedBlobContent,
1251
1292
  Se as getEnvironmentValue,
1252
- R as getFromCfg,
1253
- D as getImmediate,
1293
+ T as getFromCfg,
1294
+ L as getImmediate,
1254
1295
  le as getImportProgress,
1255
- x as getJsonField,
1296
+ E as getJsonField,
1256
1297
  ue as getLastLogs,
1257
- pe as getLogHandle,
1298
+ de as getLogHandle,
1258
1299
  ae as getOnDemandBlobContent,
1259
1300
  Lt as getPartitionKeysList,
1260
1301
  ce as getProgressLog,
@@ -1262,18 +1303,19 @@ export {
1262
1303
  te as getResourceField,
1263
1304
  ee as getResourceValueAsJson,
1264
1305
  he as getUniquePartitionKeys,
1306
+ J as ifDef,
1265
1307
  xt as isConfigLambda,
1266
1308
  Yt as isEmpty,
1267
1309
  Mt as isolate,
1268
1310
  Ht as makeArray,
1269
- rt as makeObject,
1311
+ st as makeObject,
1270
1312
  qt as mapArrayValues,
1271
1313
  Wt as mapRecordValues,
1272
1314
  ne as mapResourceFields,
1273
1315
  Xt as not,
1274
1316
  Zt as or,
1275
1317
  fe as parseResourceMap,
1276
- _t as readOutput,
1277
- Bt as wrapOutputs
1318
+ vt as readOutput,
1319
+ Nt as wrapOutputs
1278
1320
  };
1279
1321
  //# sourceMappingURL=index.mjs.map