@platforma-sdk/model 1.39.7 → 1.39.18

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,44 +1,44 @@
1
- var ze = Object.defineProperty;
2
- var Ye = (t, e, n) => e in t ? ze(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var k = (t, e, n) => Ye(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { isPColumn as De, mapPObjectData as ve, isDataInfoEntries as Oe, isDataInfo as Se, dataInfoToEntries as Xe, selectorsToPredicate as Y, resolveAnchors as Ce, deriveNativeId as Qe, isPColumnSpec as te, isPartitionedDataInfoEntries as Ze, getAxisId as O, entriesToDataInfo as et, canonicalizeAxisId as tt, withEnrichments as we, AnchoredIdDeriver as Ae, isPlRef as nt, mapValueInVOE as rt, ensurePColumn as it, extractAllColumns as st, mapPTableDef as ot, mapDataInfo as at, extractConfigGeneric as lt, matchAxisId as N, getColumnIdAndSpec as Pe, canonicalizeJson as R, parseJson as xe, isPTableAbsent as ut, uniquePlId as ct, PTableNA as pt } from "@milaboratories/pl-model-common";
1
+ var Xe = Object.defineProperty;
2
+ var Qe = (t, e, n) => e in t ? Xe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var k = (t, e, n) => Qe(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { isPColumn as Oe, mapPObjectData as Se, isDataInfoEntries as Ke, isDataInfo as ue, dataInfoToEntries as Ze, selectorsToPredicate as Y, resolveAnchors as we, deriveNativeId as et, isPColumnSpec as re, isPartitionedDataInfoEntries as tt, getAxisId as D, entriesToDataInfo as nt, canonicalizeAxisId as rt, withEnrichments as Ae, AnchoredIdDeriver as Pe, isPlRef as it, mapValueInVOE as st, ensurePColumn as ot, extractAllColumns as at, mapPTableDef as lt, mapDataInfo as ut, extractConfigGeneric as ct, matchAxisId as N, getColumnIdAndSpec as xe, canonicalizeJson as O, parseJson as _e, visitDataInfo as pt, isPTableAbsent as dt, uniquePlId as ft, PTableNA as ht } from "@milaboratories/pl-model-common";
5
5
  export * from "@milaboratories/pl-model-common";
6
- import Re from "canonicalize";
6
+ import Ne from "canonicalize";
7
7
  import { z as $ } from "zod";
8
8
  export * from "@milaboratories/pl-error-like";
9
- class dt extends Error {
9
+ class gt extends Error {
10
10
  constructor(e, n) {
11
11
  super(`${e.length}${n ? "+" : ""} errors, first error: ` + e[0].message), this.errors = e, this.moreErrors = n;
12
12
  }
13
13
  }
14
- function ft(t) {
15
- if (!t.ok) throw new dt(t.errors, t.moreErrors);
14
+ function mt(t) {
15
+ if (!t.ok) throw new gt(t.errors, t.moreErrors);
16
16
  return t.value;
17
17
  }
18
- function on(t) {
18
+ function un(t) {
19
19
  return new Proxy(t, {
20
20
  get(e, n) {
21
- return ft(e[n]);
21
+ return mt(e[n]);
22
22
  }
23
23
  });
24
24
  }
25
25
  function P(t) {
26
- return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? ne(t) : t;
26
+ return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? ie(t) : t;
27
27
  }
28
- function X(t) {
28
+ function Q(t) {
29
29
  return { type: "GetFromCtx", variable: t };
30
30
  }
31
- function an(t) {
31
+ function cn(t) {
32
32
  return {
33
33
  type: "Isolate",
34
34
  cfg: t
35
35
  };
36
36
  }
37
- const ln = X("$args"), un = X("$it"), cn = X("$prod"), pn = X("$staging"), dn = X("$ui");
38
- function ne(t) {
37
+ const pn = Q("$args"), dn = Q("$it"), fn = Q("$prod"), hn = Q("$staging"), gn = Q("$ui");
38
+ function ie(t) {
39
39
  return { type: "Immediate", value: t };
40
40
  }
41
- function Ke(t) {
41
+ function Ve(t) {
42
42
  const e = {};
43
43
  for (const [n, r] of Object.entries(t)) e[n] = P(r);
44
44
  return {
@@ -46,7 +46,7 @@ function Ke(t) {
46
46
  template: e
47
47
  };
48
48
  }
49
- function fn(...t) {
49
+ function mn(...t) {
50
50
  const e = [];
51
51
  for (const n of t) e.push(P(n));
52
52
  return {
@@ -54,14 +54,14 @@ function fn(...t) {
54
54
  template: e
55
55
  };
56
56
  }
57
- function re(t, e) {
57
+ function se(t, e) {
58
58
  return {
59
59
  type: "GetJsonField",
60
60
  source: P(t),
61
61
  field: P(e)
62
62
  };
63
63
  }
64
- function hn(t, e, n = "$it") {
64
+ function yn(t, e, n = "$it") {
65
65
  return {
66
66
  type: "MapRecordValues",
67
67
  source: t,
@@ -69,7 +69,7 @@ function hn(t, e, n = "$it") {
69
69
  itVar: n
70
70
  };
71
71
  }
72
- function gn(t, e, n = "$it") {
72
+ function bn(t, e, n = "$it") {
73
73
  return {
74
74
  type: "MapArrayValues",
75
75
  source: t,
@@ -77,46 +77,46 @@ function gn(t, e, n = "$it") {
77
77
  itVar: n
78
78
  };
79
79
  }
80
- function mn(t) {
80
+ function vn(t) {
81
81
  return {
82
82
  type: "Flatten",
83
83
  source: t
84
84
  };
85
85
  }
86
- function yn(t) {
86
+ function Cn(t) {
87
87
  return {
88
88
  type: "IsEmpty",
89
89
  arg: t
90
90
  };
91
91
  }
92
- function bn(t) {
92
+ function Sn(t) {
93
93
  return {
94
94
  type: "Not",
95
95
  operand: t
96
96
  };
97
97
  }
98
- function vn(t, e) {
98
+ function wn(t, e) {
99
99
  return {
100
100
  type: "And",
101
101
  operand1: t,
102
102
  operand2: e
103
103
  };
104
104
  }
105
- function Sn(t, e) {
105
+ function An(t, e) {
106
106
  return {
107
107
  type: "Or",
108
108
  operand1: t,
109
109
  operand2: e
110
110
  };
111
111
  }
112
- function Cn(t, e) {
112
+ function Pn(t, e) {
113
113
  return {
114
114
  type: "GetResourceField",
115
115
  source: P(t),
116
116
  field: P(e)
117
117
  };
118
118
  }
119
- function wn() {
119
+ function xn() {
120
120
  return function(t) {
121
121
  return {
122
122
  type: "GetResourceValueAsJson",
@@ -124,7 +124,7 @@ function wn() {
124
124
  };
125
125
  };
126
126
  }
127
- function An(t, e, n = "$it") {
127
+ function _n(t, e, n = "$it") {
128
128
  return {
129
129
  type: "MapResourceFields",
130
130
  source: t,
@@ -132,21 +132,21 @@ function An(t, e, n = "$it") {
132
132
  itVar: n
133
133
  };
134
134
  }
135
- function Pn(t, e) {
135
+ function In(t, e) {
136
136
  return {
137
137
  type: "GetBlobContent",
138
138
  range: e,
139
139
  source: P(t)
140
140
  };
141
141
  }
142
- function xn(t, e) {
142
+ function Tn(t, e) {
143
143
  return {
144
144
  type: "GetBlobContentAsString",
145
145
  range: e,
146
146
  source: P(t)
147
147
  };
148
148
  }
149
- function _n() {
149
+ function Ln() {
150
150
  return function(t, e) {
151
151
  return {
152
152
  type: "GetBlobContentAsJson",
@@ -155,68 +155,68 @@ function _n() {
155
155
  };
156
156
  };
157
157
  }
158
- function In(t) {
158
+ function Fn(t) {
159
159
  return {
160
160
  type: "GetDownloadedBlobContent",
161
161
  source: P(t)
162
162
  };
163
163
  }
164
- function Tn(t) {
164
+ function En(t) {
165
165
  return {
166
166
  type: "GetOnDemandBlobContent",
167
167
  source: P(t)
168
168
  };
169
169
  }
170
- function Ln(t, e) {
170
+ function kn(t, e) {
171
171
  return {
172
172
  type: "ExtractArchiveAndGetURL",
173
173
  format: e,
174
174
  source: P(t)
175
175
  };
176
176
  }
177
- function Fn(t) {
177
+ function Dn(t) {
178
178
  return {
179
179
  type: "GetImportProgress",
180
180
  source: P(t)
181
181
  };
182
182
  }
183
- function En(t, e) {
183
+ function Rn(t, e) {
184
184
  return {
185
185
  type: "GetLastLogs",
186
186
  source: P(t),
187
187
  lines: e
188
188
  };
189
189
  }
190
- function kn(t, e) {
190
+ function On(t, e) {
191
191
  return {
192
192
  type: "GetProgressLog",
193
193
  source: P(t),
194
194
  patternToSearch: e
195
195
  };
196
196
  }
197
- function Dn(t, e) {
197
+ function Kn(t, e) {
198
198
  return {
199
199
  type: "GetProgressLogWithInfo",
200
200
  source: P(t),
201
201
  patternToSearch: e
202
202
  };
203
203
  }
204
- function On(t) {
204
+ function Nn(t) {
205
205
  return {
206
206
  type: "GetLogHandle",
207
207
  source: P(t)
208
208
  };
209
209
  }
210
- function ht() {
210
+ function yt() {
211
211
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
212
212
  }
213
- function Ne(t) {
213
+ function Me(t) {
214
214
  if (t && typeof globalThis.getPlatforma == "function")
215
215
  return globalThis.getPlatforma(t);
216
216
  if (typeof globalThis.platforma < "u") return globalThis.platforma;
217
217
  throw new Error("Can't get platforma instance.");
218
218
  }
219
- function gt() {
219
+ function bt() {
220
220
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
221
221
  }
222
222
  function v() {
@@ -224,23 +224,23 @@ function v() {
224
224
  throw new Error("Not in config rendering context");
225
225
  }
226
226
  function G(t, e) {
227
- const n = gt();
227
+ const n = bt();
228
228
  if (n === void 0) return !1;
229
229
  if (t in n.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
230
230
  return n.callbackRegistry[t] = e, !0;
231
231
  }
232
- const ue = /* @__PURE__ */ new Map();
233
- function mt(t, e) {
232
+ const pe = /* @__PURE__ */ new Map();
233
+ function vt(t, e) {
234
234
  t in v().callbackRegistry || (v().callbackRegistry[t] = (n) => {
235
- for (const r of ue.get(t))
235
+ for (const r of pe.get(t))
236
236
  r(n);
237
- }, ue.set(t, [])), ue.get(t).push(e);
237
+ }, pe.set(t, [])), pe.get(t).push(e);
238
238
  }
239
239
  class F {
240
240
  constructor(e, n = (r) => r) {
241
241
  k(this, "isResolved", !1);
242
242
  k(this, "resolvedValue");
243
- this.handle = e, this.postProcess = n, mt(e, (r) => {
243
+ this.handle = e, this.postProcess = n, vt(e, (r) => {
244
244
  this.resolvedValue = n(r), this.isResolved = !0;
245
245
  });
246
246
  }
@@ -257,10 +257,10 @@ class F {
257
257
  return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
258
258
  }
259
259
  }
260
- function fe(t, e) {
260
+ function ge(t, e) {
261
261
  return t === void 0 ? void 0 : e(t);
262
262
  }
263
- class D {
263
+ class R {
264
264
  constructor(e, n) {
265
265
  this.handle = e, this.resolvePath = n;
266
266
  }
@@ -299,9 +299,9 @@ class D {
299
299
  ...this.resolvePath,
300
300
  ...n.map((i) => typeof i == "string" ? i : i.field)
301
301
  ];
302
- return fe(
302
+ return ge(
303
303
  v().resolveWithCommon(this.handle, e, ...n),
304
- (i) => new D(i, r)
304
+ (i) => new R(i, r)
305
305
  );
306
306
  }
307
307
  get resourceType() {
@@ -321,9 +321,9 @@ class D {
321
321
  }
322
322
  getError() {
323
323
  const e = [...this.resolvePath, "error"];
324
- return fe(
324
+ return ge(
325
325
  v().getError(this.handle),
326
- (n) => new D(n, e)
326
+ (n) => new R(n, e)
327
327
  );
328
328
  }
329
329
  listInputFields() {
@@ -363,7 +363,7 @@ class D {
363
363
  getPColumns(e = !1, n = "") {
364
364
  const r = this.parsePObjectCollection(e, n);
365
365
  return r === void 0 ? void 0 : Object.entries(r).map(([, s]) => {
366
- if (!De(s)) throw new Error(`not a PColumn (kind = ${s.spec.kind})`);
366
+ if (!Oe(s)) throw new Error(`not a PColumn (kind = ${s.spec.kind})`);
367
367
  return s;
368
368
  });
369
369
  }
@@ -381,7 +381,7 @@ class D {
381
381
  const i = {};
382
382
  for (const [s, o] of Object.entries(r)) {
383
383
  const a = [...this.resolvePath, s];
384
- i[s] = ve(o, (l) => new D(l, a));
384
+ i[s] = Se(o, (l) => new R(l, a));
385
385
  }
386
386
  return i;
387
387
  }
@@ -480,121 +480,121 @@ class D {
480
480
  return s && (l = l.filter((u) => u[1] !== void 0)), l.map(([u, h]) => o(u, h));
481
481
  }
482
482
  }
483
- const Ve = "staging", je = "main", yt = {
483
+ const je = "staging", Je = "main", Ct = {
484
484
  explicitColumnsSupport: !0,
485
485
  inlineColumnsSupport: !0,
486
486
  activeArgs: !0,
487
487
  pTablePartitionFiltersSupport: !0,
488
488
  pFrameInSetFilterSupport: !0
489
489
  };
490
- function Je(t) {
490
+ function $e(t) {
491
491
  return typeof t == "object" && t !== null && "__awaited_futures__" in t;
492
492
  }
493
- function he(t, e, n) {
493
+ function me(t, e, n) {
494
494
  if (e.has(n)) return;
495
495
  if (e.add(n), typeof n === "object")
496
- if (Je(n)) n.__awaited_futures__.forEach((i) => t.add(i));
496
+ if ($e(n)) n.__awaited_futures__.forEach((i) => t.add(i));
497
497
  else if (Array.isArray(n))
498
- for (const i of n) he(t, e, i);
498
+ for (const i of n) me(t, e, i);
499
499
  else
500
500
  for (const [, i] of Object.entries(n))
501
- i !== n && he(t, e, i);
501
+ i !== n && me(t, e, i);
502
502
  }
503
- function bt(t) {
503
+ function St(t) {
504
504
  const e = /* @__PURE__ */ new Set();
505
- return he(e, /* @__PURE__ */ new Set(), t), e;
505
+ return me(e, /* @__PURE__ */ new Set(), t), e;
506
506
  }
507
- const Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
507
+ const Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
508
508
  __proto__: null,
509
- GlobalCfgRenderCtxFeatureFlags: yt,
510
- MainAccessorName: je,
511
- StagingAccessorName: Ve,
512
- getAllFutureAwaits: bt,
513
- isFutureAwait: Je
514
- }, Symbol.toStringTag, { value: "Module" })), vt = "pl7.app/label", St = "pl7.app/trace", Ct = $.object({
509
+ GlobalCfgRenderCtxFeatureFlags: Ct,
510
+ MainAccessorName: Je,
511
+ StagingAccessorName: je,
512
+ getAllFutureAwaits: St,
513
+ isFutureAwait: $e
514
+ }, Symbol.toStringTag, { value: "Module" })), wt = "pl7.app/label", At = "pl7.app/trace", Pt = $.object({
515
515
  type: $.string(),
516
516
  importance: $.number().optional(),
517
517
  id: $.string().optional(),
518
518
  label: $.string()
519
- }), wt = $.array(Ct), At = 1e-3, Pt = "__LABEL__", _e = "__LABEL__@1";
520
- function Me(t, e, n = {}) {
521
- const r = /* @__PURE__ */ new Map(), i = n.forceTraceElements !== void 0 && n.forceTraceElements.length > 0 ? new Set(n.forceTraceElements) : void 0, s = /* @__PURE__ */ new Map(), o = t.map((p) => {
522
- var c, m;
523
- const b = e(p);
524
- let d, y, S;
525
- "spec" in b && typeof b.spec == "object" ? (d = b.spec, y = b.prefixTrace, S = b.suffixTrace) : d = b;
526
- const E = (c = d.annotations) == null ? void 0 : c[vt], _ = (m = d.annotations) == null ? void 0 : m[St], w = (_ ? wt.safeParse(JSON.parse(_)).data : void 0) ?? [], A = [
527
- ...y ?? [],
519
+ }), xt = $.array(Pt), _t = 1e-3, It = "__LABEL__", Ie = "__LABEL__@1";
520
+ function Be(t, e, n = {}) {
521
+ const r = /* @__PURE__ */ new Map(), i = n.forceTraceElements !== void 0 && n.forceTraceElements.length > 0 ? new Set(n.forceTraceElements) : void 0, s = /* @__PURE__ */ new Map(), o = t.map((d) => {
522
+ var c, b;
523
+ const y = e(d);
524
+ let p, m, C;
525
+ "spec" in y && typeof y.spec == "object" ? (p = y.spec, m = y.prefixTrace, C = y.suffixTrace) : p = y;
526
+ const E = (c = p.annotations) == null ? void 0 : c[wt], _ = (b = p.annotations) == null ? void 0 : b[At], w = (_ ? xt.safeParse(JSON.parse(_)).data : void 0) ?? [], A = [
527
+ ...m ?? [],
528
528
  ...w,
529
- ...S ?? []
529
+ ...C ?? []
530
530
  ];
531
531
  if (E !== void 0) {
532
- const T = { label: E, type: Pt, importance: -2 };
532
+ const T = { label: E, type: It, importance: -2 };
533
533
  n.addLabelAsSuffix ? A.push(T) : A.splice(0, 0, T);
534
534
  }
535
- const C = [], I = /* @__PURE__ */ new Map();
535
+ const S = [], I = /* @__PURE__ */ new Map();
536
536
  for (let T = A.length - 1; T >= 0; --T) {
537
- const { type: U } = A[T], V = A[T].importance ?? 0, J = (I.get(U) ?? 0) + 1;
538
- I.set(U, J);
539
- const K = `${U}@${J}`;
537
+ const { type: U } = A[T], V = A[T].importance ?? 0, j = (I.get(U) ?? 0) + 1;
538
+ I.set(U, j);
539
+ const K = `${U}@${j}`;
540
540
  s.set(K, (s.get(K) ?? 0) + 1), r.set(
541
541
  K,
542
542
  Math.max(
543
543
  r.get(K) ?? Number.NEGATIVE_INFINITY,
544
- V - (A.length - T) * At
544
+ V - (A.length - T) * _t
545
545
  )
546
- ), C.push({ ...A[T], fullType: K, occurrenceIndex: J });
546
+ ), S.push({ ...A[T], fullType: K, occurrenceIndex: j });
547
547
  }
548
- return C.reverse(), {
549
- value: p,
550
- spec: d,
548
+ return S.reverse(), {
549
+ value: d,
550
+ spec: p,
551
551
  label: E,
552
- fullTrace: C
552
+ fullTrace: S
553
553
  };
554
554
  }), a = [], l = [], u = [...r];
555
- u.sort(([, p], [, b]) => b - p);
556
- for (const [p] of u)
557
- p.endsWith("@1") || s.get(p) === t.length ? a.push(p) : l.push(p);
558
- const h = (p, b = !1) => {
559
- const d = [];
560
- for (let y = 0; y < o.length; y++) {
561
- const S = o[y], E = S.fullTrace.filter((A) => p.has(A.fullType) || i && i.has(A.type));
555
+ u.sort(([, d], [, y]) => y - d);
556
+ for (const [d] of u)
557
+ d.endsWith("@1") || s.get(d) === t.length ? a.push(d) : l.push(d);
558
+ const h = (d, y = !1) => {
559
+ const p = [];
560
+ for (let m = 0; m < o.length; m++) {
561
+ const C = o[m], E = C.fullTrace.filter((A) => d.has(A.fullType) || i && i.has(A.type));
562
562
  if (E.length === 0)
563
- if (b)
564
- d.push({
563
+ if (y)
564
+ p.push({
565
565
  label: "Unlabeled",
566
- value: S.value
566
+ value: C.value
567
567
  });
568
568
  else return;
569
569
  const _ = E.map((A) => A.label), w = n.separator ?? " / ";
570
- d.push({
570
+ p.push({
571
571
  label: _.join(w),
572
- value: S.value
572
+ value: C.value
573
573
  });
574
574
  }
575
- return d;
575
+ return p;
576
576
  };
577
577
  if (a.length === 0) {
578
578
  if (l.length !== 0) throw new Error("Non-empty secondary types list while main types list is empty.");
579
- return h(new Set(_e), !0);
579
+ return h(new Set(Ie), !0);
580
580
  }
581
581
  let f = 0, g = -1;
582
582
  for (; f < a.length; ) {
583
- const p = /* @__PURE__ */ new Set();
584
- n.includeNativeLabel && p.add(_e);
585
- for (let d = 0; d < f; ++d) p.add(a[d]);
586
- g >= 0 && p.add(a[g]);
587
- const b = h(p);
588
- if (b !== void 0 && new Set(b.map((d) => d.label)).size === t.length) return b;
583
+ const d = /* @__PURE__ */ new Set();
584
+ n.includeNativeLabel && d.add(Ie);
585
+ for (let p = 0; p < f; ++p) d.add(a[p]);
586
+ g >= 0 && d.add(a[g]);
587
+ const y = h(d);
588
+ if (y !== void 0 && new Set(y.map((p) => p.label)).size === t.length) return y;
589
589
  g++, g >= a.length && (f++, g = f);
590
590
  }
591
591
  return h(/* @__PURE__ */ new Set([...a, ...l]), !0);
592
592
  }
593
- const Q = "PColumnData/", ie = Q + "ResourceMap", se = Q + "Partitioned/ResourceMap", H = Q + "JsonPartitioned", B = Q + "BinaryPartitioned", $e = Q + "Partitioned/", oe = $e + "JsonPartitioned", q = $e + "BinaryPartitioned";
594
- function Be(t, e, n, r = [], i) {
593
+ const Z = "PColumnData/", oe = Z + "ResourceMap", ae = Z + "Partitioned/ResourceMap", H = Z + "JsonPartitioned", B = Z + "BinaryPartitioned", Ue = Z + "Partitioned/", le = Ue + "JsonPartitioned", q = Ue + "BinaryPartitioned";
594
+ function We(t, e, n, r = [], i) {
595
595
  if (t === void 0) return !1;
596
596
  switch (t.resourceType.name) {
597
- case ie: {
597
+ case oe: {
598
598
  let s = t.getInputsLocked();
599
599
  for (const o of t.listInputFields()) {
600
600
  const a = t.resolve({ field: o, assertFieldType: "Input" }), l = [...r, ...JSON.parse(o)], u = a === void 0 ? void 0 : e(a);
@@ -602,13 +602,13 @@ function Be(t, e, n, r = [], i) {
602
602
  }
603
603
  return s;
604
604
  }
605
- case se: {
605
+ case ae: {
606
606
  let s = t.getInputsLocked();
607
607
  for (const o of t.listInputFields()) {
608
608
  const a = t.resolve({ field: o, assertFieldType: "Input" });
609
609
  if (a === void 0) s = !1;
610
610
  else {
611
- const l = [...r, ...JSON.parse(o)], u = Be(
611
+ const l = [...r, ...JSON.parse(o)], u = We(
612
612
  a,
613
613
  e,
614
614
  n,
@@ -624,26 +624,26 @@ function Be(t, e, n, r = [], i) {
624
624
  throw new Error(`Unknown resource type: ${t.resourceType.name}`);
625
625
  }
626
626
  }
627
- function Kn(t, e, n = !1) {
627
+ function Mn(t, e, n = !1) {
628
628
  const r = [];
629
- return { isComplete: Be(t, e, r, [], n), data: r };
629
+ return { isComplete: We(t, e, r, [], n), data: r };
630
630
  }
631
- const ge = (t) => {
631
+ const ye = (t) => {
632
632
  if (t.endsWith(".index"))
633
633
  return { baseKey: t.substring(0, t.length - 6), type: "index" };
634
634
  if (t.endsWith(".values"))
635
635
  return { baseKey: t.substring(0, t.length - 7), type: "values" };
636
636
  throw new Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
637
637
  };
638
- function xt(t) {
638
+ function Tt(t) {
639
639
  if (!t) return;
640
640
  const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
641
641
  let i = 0;
642
642
  switch (e) {
643
- case ie:
643
+ case oe:
644
644
  i = n.keyLength;
645
645
  break;
646
- case se:
646
+ case ae:
647
647
  i = n.partitionKeyLength + n.keyLength;
648
648
  break;
649
649
  case H:
@@ -651,28 +651,28 @@ function xt(t) {
651
651
  i = n.partitionKeyLength;
652
652
  break;
653
653
  case q:
654
- case oe:
654
+ case le:
655
655
  i = n.superPartitionKeyLength + n.partitionKeyLength;
656
656
  break;
657
657
  }
658
658
  switch (e) {
659
- case ie:
659
+ case oe:
660
660
  case H:
661
661
  case B:
662
662
  for (let s of t.listInputFields()) {
663
- e === B && (s = ge(s).baseKey);
663
+ e === B && (s = ye(s).baseKey);
664
664
  const o = [...JSON.parse(s)];
665
665
  r.push(o);
666
666
  }
667
667
  break;
668
- case se:
668
+ case ae:
669
669
  case q:
670
- case oe:
670
+ case le:
671
671
  for (const s of t.listInputFields()) {
672
672
  const o = [...JSON.parse(s)], a = t.resolve({ field: s, assertFieldType: "Input" });
673
673
  if (a !== void 0)
674
674
  for (let l of a.listInputFields()) {
675
- e === q && (l = ge(l).baseKey);
675
+ e === q && (l = ye(l).baseKey);
676
676
  const u = [...o, ...JSON.parse(l)];
677
677
  r.push(u);
678
678
  }
@@ -681,7 +681,7 @@ function xt(t) {
681
681
  }
682
682
  return { data: r, keyLength: i };
683
683
  }
684
- function _t(t) {
684
+ function Lt(t) {
685
685
  if (t.type !== "JsonPartitioned" && t.type !== "BinaryPartitioned")
686
686
  throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${t.type}`);
687
687
  const { parts: e, partitionKeyLength: n } = t, r = [];
@@ -700,11 +700,11 @@ function _t(t) {
700
700
  }
701
701
  return r.map((i) => Array.from(i.values()));
702
702
  }
703
- function It(t) {
703
+ function Ft(t) {
704
704
  if (t === void 0) return;
705
- if (Oe(t))
706
- return _t(t);
707
- const e = xt(t);
705
+ if (Ke(t))
706
+ return Lt(t);
707
+ const e = Tt(t);
708
708
  if (!e) return;
709
709
  const { data: n, keyLength: r } = e, i = [];
710
710
  for (let s = 0; s < r; ++s)
@@ -717,14 +717,14 @@ function It(t) {
717
717
  }
718
718
  return i.map((s) => Array.from(s.values()));
719
719
  }
720
- function me(t, e = []) {
720
+ function be(t, e = []) {
721
721
  if (t === void 0 || !t.getIsReadyOrError()) return;
722
722
  const n = t.resourceType.name, r = t.getDataAsJson();
723
- if (e.length > 0 && (n === oe || n === q))
723
+ if (e.length > 0 && (n === le || n === q))
724
724
  throw new Error(`Unexpected nested super-partitioned resource: ${n}`);
725
725
  switch (n) {
726
- case ie:
727
- case se:
726
+ case oe:
727
+ case ae:
728
728
  throw new Error(`Only data columns are supported, got: ${n}`);
729
729
  case H: {
730
730
  if (typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
@@ -747,7 +747,7 @@ function me(t, e = []) {
747
747
  throw new Error(`Missing partitionKeyLength in metadata for ${n}`);
748
748
  const i = [], s = /* @__PURE__ */ new Map();
749
749
  for (const o of t.listInputFields()) {
750
- const a = ge(o), l = t.resolve({ field: o, assertFieldType: "Input" });
750
+ const a = ye(o), l = t.resolve({ field: o, assertFieldType: "Input" });
751
751
  if (l === void 0) return;
752
752
  let u = s.get(a.baseKey);
753
753
  u || (u = {}, s.set(a.baseKey, u)), a.type === "index" ? u.index = l : u.values = l;
@@ -769,7 +769,7 @@ function me(t, e = []) {
769
769
  parts: i
770
770
  };
771
771
  }
772
- case oe: {
772
+ case le: {
773
773
  if (typeof (r == null ? void 0 : r.superPartitionKeyLength) != "number" || typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
774
774
  throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n}`);
775
775
  const i = r.superPartitionKeyLength + r.partitionKeyLength, s = [];
@@ -778,7 +778,7 @@ function me(t, e = []) {
778
778
  if (a === void 0) return;
779
779
  if (a.resourceType.name !== H)
780
780
  throw new Error(`Expected ${H} inside ${n}, but got ${a.resourceType.name}`);
781
- const l = me(a, JSON.parse(o));
781
+ const l = be(a, JSON.parse(o));
782
782
  if (l === void 0) return;
783
783
  if (l.type !== "JsonPartitioned")
784
784
  throw new Error(`Unexpected inner result type for ${n}: ${l.type}`);
@@ -799,7 +799,7 @@ function me(t, e = []) {
799
799
  if (a === void 0) return;
800
800
  if (a.resourceType.name !== B)
801
801
  throw new Error(`Expected ${B} inside ${n}, but got ${a.resourceType.name}`);
802
- const l = me(a, JSON.parse(o));
802
+ const l = be(a, JSON.parse(o));
803
803
  if (l === void 0) return;
804
804
  if (l.type !== "BinaryPartitioned")
805
805
  throw new Error(`Unexpected inner result type for ${n}: ${l.type}`);
@@ -815,15 +815,15 @@ function me(t, e = []) {
815
815
  throw new Error(`Unknown resource type: ${n}`);
816
816
  }
817
817
  }
818
- function Tt(t) {
818
+ function Et(t) {
819
819
  if (t !== void 0) {
820
- if (Oe(t)) return t;
821
- if (Se(t)) return Xe(t);
822
- if (t instanceof D) return me(t);
820
+ if (Ke(t)) return t;
821
+ if (ue(t)) return Ze(t);
822
+ if (t instanceof R) return be(t);
823
823
  throw new Error(`Unexpected input type: ${typeof t}`);
824
824
  }
825
825
  }
826
- function Lt(t, e) {
826
+ function kt(t, e) {
827
827
  const n = [...e].sort((s, o) => o[0] - s[0]);
828
828
  if (t.type === "JsonPartitioned" || t.type === "BinaryPartitioned") {
829
829
  const { partitionKeyLength: s } = t;
@@ -883,13 +883,13 @@ function Lt(t, e) {
883
883
  }
884
884
  }
885
885
  }
886
- function Ft(t) {
886
+ function Dt(t) {
887
887
  if (!Array.isArray(t)) return !1;
888
888
  if (t.length === 0) return !0;
889
889
  const e = t[0];
890
890
  return typeof e == "object" && e !== null && "key" in e && "val" in e;
891
891
  }
892
- class Et {
892
+ class Rt {
893
893
  constructor(e) {
894
894
  this.columns = e;
895
895
  }
@@ -898,30 +898,30 @@ class Et {
898
898
  return this.columns.filter((r) => n(r.spec));
899
899
  }
900
900
  }
901
- function kt(t) {
901
+ function Ot(t) {
902
902
  if (t)
903
903
  return t.map((e) => ({
904
- type: `split:${tt(e.axisId)}`,
904
+ type: `split:${rt(e.axisId)}`,
905
905
  label: e.label,
906
906
  importance: 1e6
907
907
  // High importance for split filters in labels
908
908
  }));
909
909
  }
910
- function Dt(t) {
910
+ function Kt(t) {
911
911
  if (t)
912
912
  return t.map((e) => [e.axisIdx, e.value]);
913
913
  }
914
- function Ot(t, e) {
914
+ function Nt(t, e) {
915
915
  if (!e || e.length === 0) return t;
916
916
  const n = [...e].sort((r, i) => r[0] - i[0]);
917
- return Re({ id: t, axisFilters: n });
917
+ return Ne({ id: t, axisFilters: n });
918
918
  }
919
- function Ie(t) {
919
+ function Te(t) {
920
920
  if (!t || typeof t != "object") return !1;
921
921
  const e = t, n = e.domain && typeof e.domain == "object" && Object.values(e.domain).some((i) => typeof i == "object" && i !== null && "anchor" in i), r = e.axes && Array.isArray(e.axes) && e.axes.some((i) => typeof i == "object" && i !== null && "anchor" in i);
922
922
  return !!e.domainAnchor || n || r;
923
923
  }
924
- function Rt(t) {
924
+ function Vt(t) {
925
925
  if (typeof t != "object" || !("axes" in t) || t.axes === void 0)
926
926
  return [];
927
927
  const e = t.axes.map((n, r) => typeof n == "object" && "split" in n && n.split === !0 ? r : -1).filter((n) => n !== -1);
@@ -929,10 +929,10 @@ function Rt(t) {
929
929
  throw new Error("Axis splitting is not supported when `partialAxesMatch` is defined.");
930
930
  return e.sort((n, r) => n - r), e;
931
931
  }
932
- class ae {
932
+ class X {
933
933
  constructor() {
934
934
  k(this, "defaultProviderStore", []);
935
- k(this, "providers", [new Et(this.defaultProviderStore)]);
935
+ k(this, "providers", [new Rt(this.defaultProviderStore)]);
936
936
  k(this, "axisLabelProviders", []);
937
937
  }
938
938
  addColumnProvider(e) {
@@ -961,88 +961,88 @@ class ae {
961
961
  };
962
962
  let u = () => !1;
963
963
  if (a) {
964
- const d = (Array.isArray(a) ? a : [a]).map((y) => {
965
- if (Ie(y)) {
964
+ const p = (Array.isArray(a) ? a : [a]).map((m) => {
965
+ if (Te(m)) {
966
966
  if (!r)
967
967
  throw new Error("Anchored selectors in exclude require an AnchoredIdDeriver to be provided in options.");
968
- return Y(Ce(r.anchors, y, n));
968
+ return Y(we(r.anchors, m, n));
969
969
  } else
970
- return Y(y);
970
+ return Y(m);
971
971
  });
972
- u = (y) => d.some((S) => S(y));
972
+ u = (m) => p.some((C) => C(m));
973
973
  }
974
974
  const h = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], f = [], g = /* @__PURE__ */ new Set();
975
- for (const d of h) {
976
- const y = Ie(d);
977
- let S;
978
- if (y) {
975
+ for (const p of h) {
976
+ const m = Te(p);
977
+ let C;
978
+ if (m) {
979
979
  if (!r)
980
980
  throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");
981
- S = Ce(r.anchors, d, n);
981
+ C = we(r.anchors, p, n);
982
982
  } else
983
- S = d;
983
+ C = p;
984
984
  const E = /* @__PURE__ */ new Set(), _ = [];
985
- for (const C of this.providers) {
986
- const I = C.selectColumns(S);
985
+ for (const S of this.providers) {
986
+ const I = S.selectColumns(C);
987
987
  for (const c of I) {
988
988
  if (u(c.spec)) continue;
989
989
  if (E.has(c.id))
990
- throw new Error(`Duplicate column id ${c.id} in provider ${C.constructor.name}`);
991
- const m = Qe(c.spec);
992
- g.has(m) || (E.add(c.id), g.add(m), _.push(c));
990
+ throw new Error(`Duplicate column id ${c.id} in provider ${S.constructor.name}`);
991
+ const b = et(c.spec);
992
+ g.has(b) || (E.add(c.id), g.add(b), _.push(c));
993
993
  }
994
994
  }
995
995
  if (_.length === 0) continue;
996
- const w = Rt(d), A = w.length > 0;
997
- for (const C of _) {
998
- if (!te(C.spec)) continue;
999
- const I = C.spec;
996
+ const w = Vt(p), A = w.length > 0;
997
+ for (const S of _) {
998
+ if (!re(S.spec)) continue;
999
+ const I = S.spec;
1000
1000
  if (A) {
1001
- if (Ft(C.data))
1002
- throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${C.id}`);
1003
- const c = Tt(C.data);
1001
+ if (Dt(S.data))
1002
+ throw new Error(`Splitting is not supported for PColumns with PColumnValues data format. Column id: ${S.id}`);
1003
+ const c = Et(S.data);
1004
1004
  if (!c) {
1005
1005
  if (s) continue;
1006
1006
  return;
1007
1007
  }
1008
- if (!Ze(c))
1009
- throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${c.type} for column ${C.id}`);
1010
- const m = It(c), T = w[w.length - 1];
1008
+ if (!tt(c))
1009
+ throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${c.type} for column ${S.id}`);
1010
+ const b = Ft(c), T = w[w.length - 1];
1011
1011
  if (T >= c.partitionKeyLength)
1012
1012
  throw new Error(`Not enough partition keys (${c.partitionKeyLength}) for requested split axes (max index ${T}) in column ${I.name}`);
1013
- const U = w.map((L) => this.findLabels(O(I.axesSpec[L]))), V = [], J = (L, W) => {
1013
+ const U = w.map((L) => this.findLabels(D(I.axesSpec[L]))), V = [], j = (L, W) => {
1014
1014
  if (W >= w.length) {
1015
1015
  if (V.push([...L]), V.length > 1e4)
1016
1016
  throw new Error("Too many key combinations, aborting.");
1017
1017
  return;
1018
1018
  }
1019
- const j = w[W];
1020
- if (j >= m.length)
1021
- throw new Error(`Axis index ${j} out of bounds for unique keys array (length ${m.length}) during split key generation for column ${C.id}`);
1022
- const M = m[j];
1023
- if (!M || M.length === 0) {
1019
+ const M = w[W];
1020
+ if (M >= b.length)
1021
+ throw new Error(`Axis index ${M} out of bounds for unique keys array (length ${b.length}) during split key generation for column ${S.id}`);
1022
+ const J = b[M];
1023
+ if (!J || J.length === 0) {
1024
1024
  V.length = 0;
1025
1025
  return;
1026
1026
  }
1027
- for (const Z of M)
1028
- L.push(Z), J(L, W + 1), L.pop();
1027
+ for (const ee of J)
1028
+ L.push(ee), j(L, W + 1), L.pop();
1029
1029
  };
1030
- if (J([], 0), V.length === 0)
1030
+ if (j([], 0), V.length === 0)
1031
1031
  continue;
1032
- const K = [...I.axesSpec], We = w.map((L) => L);
1032
+ const K = [...I.axesSpec], He = w.map((L) => L);
1033
1033
  for (let L = w.length - 1; L >= 0; L--)
1034
1034
  K.splice(w[L], 1);
1035
- const Ge = { ...I, axesSpec: K };
1035
+ const qe = { ...I, axesSpec: K };
1036
1036
  for (const L of V) {
1037
- const W = L.map((j, M) => {
1038
- const Z = We[M], He = O(I.axesSpec[Z]), le = U[M], qe = (le == null ? void 0 : le[j]) ?? String(j);
1039
- return { axisIdx: Z, axisId: He, value: j, label: qe };
1037
+ const W = L.map((M, J) => {
1038
+ const ee = He[J], ze = D(I.axesSpec[ee]), ce = U[J], Ye = (ce == null ? void 0 : ce[M]) ?? String(M);
1039
+ return { axisIdx: ee, axisId: ze, value: M, label: Ye };
1040
1040
  });
1041
1041
  f.push({
1042
1042
  type: "split",
1043
- originalColumn: C,
1043
+ originalColumn: S,
1044
1044
  spec: I,
1045
- adjustedSpec: Ge,
1045
+ adjustedSpec: qe,
1046
1046
  dataEntries: c,
1047
1047
  axisFilters: W
1048
1048
  });
@@ -1050,40 +1050,40 @@ class ae {
1050
1050
  } else
1051
1051
  f.push({
1052
1052
  type: "direct",
1053
- originalColumn: C,
1053
+ originalColumn: S,
1054
1054
  spec: I,
1055
1055
  adjustedSpec: I
1056
1056
  });
1057
1057
  }
1058
1058
  }
1059
1059
  if (f.length === 0) return [];
1060
- const p = Me(
1060
+ const d = Be(
1061
1061
  f,
1062
- (d) => ({
1063
- spec: d.spec,
1064
- suffixTrace: d.type === "split" ? kt(d.axisFilters) : void 0
1062
+ (p) => ({
1063
+ spec: p.spec,
1064
+ suffixTrace: p.type === "split" ? Ot(p.axisFilters) : void 0
1065
1065
  }),
1066
1066
  l
1067
- ), b = [];
1068
- for (const { value: d, label: y } of p) {
1069
- const { originalColumn: S, spec: E } = d, _ = d.type === "split" ? d.axisFilters : void 0, w = Dt(_);
1067
+ ), y = [];
1068
+ for (const { value: p, label: m } of d) {
1069
+ const { originalColumn: C, spec: E } = p, _ = p.type === "split" ? p.axisFilters : void 0, w = Kt(_);
1070
1070
  let A;
1071
- r ? A = r.deriveS(E, w) : A = Ot(S.id, w);
1072
- let C = { ...d.adjustedSpec };
1073
- o && (C = {
1074
- ...C,
1071
+ r ? A = r.deriveS(E, w) : A = Nt(C.id, w);
1072
+ let S = { ...p.adjustedSpec };
1073
+ o && (S = {
1074
+ ...S,
1075
1075
  annotations: {
1076
- ...C.annotations ?? {},
1077
- "pl7.app/label": y
1076
+ ...S.annotations ?? {},
1077
+ "pl7.app/label": m
1078
1078
  }
1079
- }), b.push({
1079
+ }), y.push({
1080
1080
  id: A,
1081
- spec: C,
1082
- data: () => d.type === "split" ? et(Lt(d.dataEntries, w)) : d.originalColumn.data,
1083
- label: y
1081
+ spec: S,
1082
+ data: () => p.type === "split" ? nt(kt(p.dataEntries, w)) : p.originalColumn.data,
1083
+ label: m
1084
1084
  });
1085
1085
  }
1086
- return b;
1086
+ return y;
1087
1087
  }
1088
1088
  getColumns(e, n) {
1089
1089
  const r = this.getUniversalEntries(e, {
@@ -1108,7 +1108,7 @@ class ae {
1108
1108
  return i;
1109
1109
  }
1110
1110
  }
1111
- function ye(t) {
1111
+ function ve(t) {
1112
1112
  const e = (i) => i.operator !== "InSet" ? i : {
1113
1113
  operator: "Or",
1114
1114
  operands: i.references.map((s) => ({
@@ -1141,17 +1141,17 @@ function ye(t) {
1141
1141
  });
1142
1142
  return t.map((i) => r(i, e));
1143
1143
  }
1144
- function ce(t, e) {
1144
+ function de(t, e) {
1145
1145
  if (t === void 0) return e === void 0;
1146
1146
  if (e === void 0) return !0;
1147
1147
  for (const n in e)
1148
1148
  if (t[n] !== e[n]) return !1;
1149
1149
  return !0;
1150
1150
  }
1151
- function Te(t) {
1152
- return ve(t, (e) => e instanceof D ? e.handle : Se(e) ? at(e, (n) => n.handle) : e);
1151
+ function Le(t) {
1152
+ return Se(t, (e) => e instanceof R ? e.handle : ue(e) ? ut(e, (n) => n.handle) : e);
1153
1153
  }
1154
- class Kt {
1154
+ class Mt {
1155
1155
  constructor() {
1156
1156
  k(this, "ctx", v());
1157
1157
  }
@@ -1164,26 +1164,26 @@ class Kt {
1164
1164
  getOptions(e, n) {
1165
1165
  const r = typeof e == "function" ? e : Y(e), i = this.getSpecs().entries.filter((a) => r(a.obj));
1166
1166
  let s = {}, o = !1;
1167
- return typeof n < "u" && (typeof n == "function" ? s = n : typeof n == "object" && ("includeNativeLabel" in n || "separator" in n || "addLabelAsSuffix" in n ? s = n : (n = n, s = n.label ?? {}, o = n.refsWithEnrichments ?? !1))), typeof s == "object" ? Me(i, (a) => a.obj, s ?? {}).map(({ value: { ref: a }, label: l }) => ({
1168
- ref: we(a, o),
1167
+ return typeof n < "u" && (typeof n == "function" ? s = n : typeof n == "object" && ("includeNativeLabel" in n || "separator" in n || "addLabelAsSuffix" in n ? s = n : (n = n, s = n.label ?? {}, o = n.refsWithEnrichments ?? !1))), typeof s == "object" ? Be(i, (a) => a.obj, s ?? {}).map(({ value: { ref: a }, label: l }) => ({
1168
+ ref: Ae(a, o),
1169
1169
  label: l
1170
1170
  })) : i.map(({ ref: a, obj: l }) => ({
1171
- ref: we(a, o),
1171
+ ref: Ae(a, o),
1172
1172
  label: s(l, a)
1173
1173
  }));
1174
1174
  }
1175
1175
  resolveAnchorCtx(e) {
1176
- if (e instanceof Ae) return e;
1176
+ if (e instanceof Pe) return e;
1177
1177
  const n = {};
1178
1178
  for (const [r, i] of Object.entries(e))
1179
- if (nt(i)) {
1179
+ if (it(i)) {
1180
1180
  const s = this.getPColumnSpecByRef(i);
1181
1181
  if (!s)
1182
1182
  return;
1183
1183
  n[r] = s;
1184
1184
  } else
1185
1185
  n[r] = i;
1186
- return new Ae(n);
1186
+ return new Pe(n);
1187
1187
  }
1188
1188
  /**
1189
1189
  * Returns columns that match the provided anchors and selectors. It applies axis filters and label derivation.
@@ -1196,7 +1196,7 @@ class Kt {
1196
1196
  getAnchoredPColumns(e, n, r) {
1197
1197
  const i = this.resolveAnchorCtx(e);
1198
1198
  if (i)
1199
- return new ae().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n, {
1199
+ return new X().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n, {
1200
1200
  ...r,
1201
1201
  anchorCtx: i
1202
1202
  });
@@ -1233,7 +1233,7 @@ class Kt {
1233
1233
  getCanonicalOptions(e, n, r) {
1234
1234
  const i = this.resolveAnchorCtx(e);
1235
1235
  if (!i) return;
1236
- const s = new ae().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n, {
1236
+ const s = new X().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n, {
1237
1237
  ...r,
1238
1238
  anchorCtx: i
1239
1239
  });
@@ -1257,7 +1257,7 @@ class Kt {
1257
1257
  ref: n.ref,
1258
1258
  obj: {
1259
1259
  ...n.obj,
1260
- data: new D(n.obj.data, [n.ref.blockId, n.ref.name])
1260
+ data: new R(n.obj.data, [n.ref.blockId, n.ref.name])
1261
1261
  }
1262
1262
  }))
1263
1263
  };
@@ -1276,9 +1276,9 @@ class Kt {
1276
1276
  ref: n.ref,
1277
1277
  obj: {
1278
1278
  ...n.obj,
1279
- data: rt(
1279
+ data: st(
1280
1280
  n.obj.data,
1281
- (r) => new D(r, [n.ref.blockId, n.ref.name])
1281
+ (r) => new R(r, [n.ref.blockId, n.ref.name])
1282
1282
  )
1283
1283
  }
1284
1284
  }))
@@ -1305,9 +1305,9 @@ class Kt {
1305
1305
  )) == null ? void 0 : r.obj;
1306
1306
  const n = this.ctx.getDataFromResultPoolByRef(e.blockId, e.name);
1307
1307
  if (n)
1308
- return ve(
1308
+ return Se(
1309
1309
  n,
1310
- (i) => new D(i, [e.blockId, e.name])
1310
+ (i) => new R(i, [e.blockId, e.name])
1311
1311
  );
1312
1312
  }
1313
1313
  /**
@@ -1318,7 +1318,7 @@ class Kt {
1318
1318
  getPColumnByRef(e) {
1319
1319
  const n = this.getDataByRef(e);
1320
1320
  if (n)
1321
- return it(n);
1321
+ return ot(n);
1322
1322
  }
1323
1323
  /**
1324
1324
  * Returns spec associated with the ref ensuring that it is a p-column spec.
@@ -1328,7 +1328,7 @@ class Kt {
1328
1328
  getPColumnSpecByRef(e) {
1329
1329
  const n = this.getSpecByRef(e);
1330
1330
  if (n) {
1331
- if (!te(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
1331
+ if (!re(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
1332
1332
  return n;
1333
1333
  }
1334
1334
  }
@@ -1347,13 +1347,13 @@ class Kt {
1347
1347
  findDataWithCompatibleSpec(e) {
1348
1348
  const n = [];
1349
1349
  e: for (const r of this.getData().entries) {
1350
- if (!te(r.obj.spec))
1350
+ if (!re(r.obj.spec))
1351
1351
  continue;
1352
1352
  const i = r.obj.spec;
1353
- if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && ce(e.domain, i.domain)) {
1353
+ if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && de(e.domain, i.domain)) {
1354
1354
  for (let s = 0; s < e.axesSpec.length; ++s) {
1355
1355
  const o = e.axesSpec[s], a = i.axesSpec[s];
1356
- if (o.name !== a.name || o.type !== a.type || !ce(o.domain, a.domain))
1356
+ if (o.name !== a.name || o.type !== a.type || !de(o.domain, a.domain))
1357
1357
  continue e;
1358
1358
  }
1359
1359
  n.push(r.obj);
@@ -1368,9 +1368,9 @@ class Kt {
1368
1368
  findLabels(e) {
1369
1369
  const n = this.getData();
1370
1370
  for (const r of n.entries) {
1371
- if (!De(r.obj)) continue;
1371
+ if (!Oe(r.obj)) continue;
1372
1372
  const i = r.obj.spec;
1373
- if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && ce(e.domain, i.axesSpec[0].domain)) {
1373
+ if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && de(e.domain, i.axesSpec[0].domain)) {
1374
1374
  if (r.obj.data.resourceType.name !== "PColumnData/Json")
1375
1375
  throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
1376
1376
  return Object.fromEntries(
@@ -1390,12 +1390,12 @@ class Kt {
1390
1390
  */
1391
1391
  selectColumns(e) {
1392
1392
  const n = typeof e == "function" ? e : Y(e);
1393
- return this.getSpecs().entries.filter(({ obj: i }) => te(i) ? n(i) : !1).map(({ ref: i, obj: s }) => {
1393
+ return this.getSpecs().entries.filter(({ obj: i }) => re(i) ? n(i) : !1).map(({ ref: i, obj: s }) => {
1394
1394
  const o = s;
1395
1395
  let a = null;
1396
1396
  const l = this;
1397
1397
  return {
1398
- id: Re(i),
1398
+ id: Ne(i),
1399
1399
  spec: o,
1400
1400
  get data() {
1401
1401
  var u;
@@ -1420,14 +1420,14 @@ class Kt {
1420
1420
  return r;
1421
1421
  }
1422
1422
  }
1423
- class ee {
1423
+ class te {
1424
1424
  constructor() {
1425
1425
  k(this, "ctx");
1426
1426
  k(this, "_argsCache");
1427
1427
  k(this, "_uiStateCache");
1428
1428
  // lazy rendering because this feature is rarely used
1429
1429
  k(this, "_activeArgsCache");
1430
- k(this, "resultPool", new Kt());
1430
+ k(this, "resultPool", new Mt());
1431
1431
  this.ctx = v();
1432
1432
  }
1433
1433
  get args() {
@@ -1462,16 +1462,16 @@ class ee {
1462
1462
  // return this.ctx.featureFlags;
1463
1463
  // }
1464
1464
  getNamedAccessor(e) {
1465
- return fe(
1465
+ return ge(
1466
1466
  this.ctx.getAccessorHandleByName(e),
1467
- (n) => new D(n, [e])
1467
+ (n) => new R(n, [e])
1468
1468
  );
1469
1469
  }
1470
1470
  get prerun() {
1471
- return this.getNamedAccessor(Ve);
1471
+ return this.getNamedAccessor(je);
1472
1472
  }
1473
1473
  get outputs() {
1474
- return this.getNamedAccessor(je);
1474
+ return this.getNamedAccessor(Je);
1475
1475
  }
1476
1476
  /**
1477
1477
  * Find labels data for a given axis id. It will search for a label column and return its data as a map.
@@ -1483,7 +1483,7 @@ class ee {
1483
1483
  }
1484
1484
  verifyInlineAndExplicitColumnsSupport(e) {
1485
1485
  var i;
1486
- const n = e.some((s) => !(s.data instanceof D) || Se(s.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
1486
+ const n = e.some((s) => !(s.data instanceof R) || ue(s.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
1487
1487
  if (n && !r) throw Error("Inline or explicit columns not supported");
1488
1488
  }
1489
1489
  patchPTableDef(e) {
@@ -1494,14 +1494,14 @@ class ee {
1494
1494
  filters: [...e.partitionFilters, ...e.filters]
1495
1495
  }), (r = this.ctx.featureFlags) != null && r.pFrameInSetFilterSupport || (e = {
1496
1496
  ...e,
1497
- partitionFilters: ye(e.partitionFilters),
1498
- filters: ye(e.filters)
1497
+ partitionFilters: ve(e.partitionFilters),
1498
+ filters: ve(e.filters)
1499
1499
  }), e;
1500
1500
  }
1501
1501
  // TODO remove all non-PColumn fields
1502
1502
  createPFrame(e) {
1503
1503
  return this.verifyInlineAndExplicitColumnsSupport(e), this.ctx.createPFrame(
1504
- e.map((n) => Te(n))
1504
+ e.map((n) => Le(n))
1505
1505
  );
1506
1506
  }
1507
1507
  createPTable(e) {
@@ -1514,8 +1514,8 @@ class ee {
1514
1514
  partitionFilters: e.filters ?? [],
1515
1515
  filters: [],
1516
1516
  sorting: e.sorting ?? []
1517
- }) : n = this.patchPTableDef(e), this.verifyInlineAndExplicitColumnsSupport(st(n.src)), this.ctx.createPTable(
1518
- ot(n, (r) => Te(r))
1517
+ }) : n = this.patchPTableDef(e), this.verifyInlineAndExplicitColumnsSupport(at(n.src)), this.ctx.createPTable(
1518
+ lt(n, (r) => Le(r))
1519
1519
  );
1520
1520
  }
1521
1521
  /** @deprecated scheduled for removal from SDK */
@@ -1535,16 +1535,16 @@ class ee {
1535
1535
  this.ctx.logError(e);
1536
1536
  }
1537
1537
  }
1538
- const z = "1.39.7";
1539
- function Nt(t) {
1538
+ const z = "1.39.18";
1539
+ function jt(t) {
1540
1540
  return t.__renderLambda === !0;
1541
1541
  }
1542
- function pe(t) {
1542
+ function fe(t) {
1543
1543
  if (t !== void 0)
1544
- return Nt(t) ? t.handle : t;
1544
+ return jt(t) ? t.handle : t;
1545
1545
  }
1546
- function Nn(t) {
1547
- return lt(t);
1546
+ function jn(t) {
1547
+ return ct(t);
1548
1548
  }
1549
1549
  const x = class x {
1550
1550
  constructor(e, n, r, i, s, o, a, l, u) {
@@ -1556,8 +1556,8 @@ const x = class x {
1556
1556
  void 0,
1557
1557
  {},
1558
1558
  {},
1559
- ne(!0),
1560
- ne([]),
1559
+ ie(!0),
1560
+ ie([]),
1561
1561
  void 0,
1562
1562
  void 0,
1563
1563
  { ...x.INITIAL_BLOCK_FEATURE_FLAGS }
@@ -1566,7 +1566,7 @@ const x = class x {
1566
1566
  output(e, n, r = {}) {
1567
1567
  if (typeof n == "function") {
1568
1568
  const i = `output#${e}`;
1569
- return G(i, () => n(new ee())), new x(
1569
+ return G(i, () => n(new te())), new x(
1570
1570
  this._renderingMode,
1571
1571
  this._initialArgs,
1572
1572
  this._initialUiState,
@@ -1605,7 +1605,7 @@ const x = class x {
1605
1605
  return this.output(e, n, { retentive: !0 });
1606
1606
  }
1607
1607
  argsValid(e) {
1608
- return typeof e == "function" ? (G("inputsValid", () => e(new ee())), new x(
1608
+ return typeof e == "function" ? (G("inputsValid", () => e(new te())), new x(
1609
1609
  this._renderingMode,
1610
1610
  this._initialArgs,
1611
1611
  this._initialUiState,
@@ -1631,7 +1631,7 @@ const x = class x {
1631
1631
  );
1632
1632
  }
1633
1633
  sections(e) {
1634
- return Array.isArray(e) ? this.sections(ne(e)) : typeof e == "function" ? (G("sections", () => e(new ee())), new x(
1634
+ return Array.isArray(e) ? this.sections(ie(e)) : typeof e == "function" ? (G("sections", () => e(new te())), new x(
1635
1635
  this._renderingMode,
1636
1636
  this._initialArgs,
1637
1637
  this._initialUiState,
@@ -1655,7 +1655,7 @@ const x = class x {
1655
1655
  }
1656
1656
  /** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
1657
1657
  title(e) {
1658
- return G("title", () => e(new ee())), new x(
1658
+ return G("title", () => e(new te())), new x(
1659
1659
  this._renderingMode,
1660
1660
  this._initialArgs,
1661
1661
  this._initialUiState,
@@ -1751,13 +1751,13 @@ const x = class x {
1751
1751
  sdkVersion: z,
1752
1752
  renderingMode: this._renderingMode,
1753
1753
  initialArgs: this._initialArgs,
1754
- inputsValid: pe(this._inputsValid),
1755
- sections: pe(this._sections),
1754
+ inputsValid: fe(this._inputsValid),
1755
+ sections: fe(this._sections),
1756
1756
  outputs: Object.fromEntries(
1757
- Object.entries(this._outputs).map(([n, r]) => [n, pe(r)])
1757
+ Object.entries(this._outputs).map(([n, r]) => [n, fe(r)])
1758
1758
  )
1759
1759
  };
1760
- return ht() ? Ne({ sdkVersion: z }) : { config: e };
1760
+ return yt() ? Me({ sdkVersion: z }) : { config: e };
1761
1761
  }
1762
1762
  };
1763
1763
  k(x, "INITIAL_BLOCK_FEATURE_FLAGS", {
@@ -1765,8 +1765,8 @@ k(x, "INITIAL_BLOCK_FEATURE_FLAGS", {
1765
1765
  requiresUIAPIVersion: 1,
1766
1766
  requiresModelAPIVersion: 1
1767
1767
  });
1768
- let Le = x;
1769
- function Ue() {
1768
+ let Fe = x;
1769
+ function Ge() {
1770
1770
  return {
1771
1771
  sourceId: null,
1772
1772
  hiddenColIds: null,
@@ -1775,45 +1775,45 @@ function Ue() {
1775
1775
  sorting: []
1776
1776
  };
1777
1777
  }
1778
- function Vt() {
1778
+ function Jt() {
1779
1779
  return {
1780
1780
  version: 3,
1781
1781
  stateCache: [],
1782
- pTableParams: Ue()
1782
+ pTableParams: Ge()
1783
1783
  };
1784
1784
  }
1785
- function jt(t) {
1785
+ function $t(t) {
1786
1786
  return "version" in t ? (t.version === 2 && (t = {
1787
1787
  version: 3,
1788
1788
  stateCache: t.stateCache.map((e) => ({
1789
1789
  ...e,
1790
1790
  filtersState: []
1791
1791
  })),
1792
- pTableParams: Ue()
1793
- }), t) : Vt();
1792
+ pTableParams: Ge()
1793
+ }), t) : Jt();
1794
1794
  }
1795
- function be(t) {
1795
+ function Ce(t) {
1796
1796
  return t.axesSpec.length === 1 && t.name === "pl7.app/label";
1797
1797
  }
1798
- function Jt(t) {
1799
- return new ae().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
1798
+ function Bt(t) {
1799
+ return new X().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
1800
1800
  name: "pl7.app/label",
1801
1801
  axes: [{}]
1802
1802
  // exactly one axis
1803
1803
  }, { dontWaitAllData: !0 });
1804
1804
  }
1805
- function Fe(t, e) {
1805
+ function Ee(t, e) {
1806
1806
  const n = [], r = [];
1807
1807
  for (const a of t)
1808
- be(a.spec) ? n.push(a) : r.push(a);
1808
+ Ce(a.spec) ? n.push(a) : r.push(a);
1809
1809
  const i = [];
1810
1810
  for (const a of r)
1811
1811
  for (const l of a.spec.axesSpec) {
1812
- const u = O(l);
1812
+ const u = D(l);
1813
1813
  i.some((h) => N(h, u)) || i.push(u);
1814
1814
  }
1815
1815
  for (const a of n) {
1816
- const l = O(a.spec.axesSpec[0]), u = i.findIndex((h) => N(h, l));
1816
+ const l = D(a.spec.axesSpec[0]), u = i.findIndex((h) => N(h, l));
1817
1817
  u !== -1 && i.splice(u, 1);
1818
1818
  }
1819
1819
  const s = (a, l) => {
@@ -1824,10 +1824,10 @@ function Fe(t, e) {
1824
1824
  return u;
1825
1825
  }, o = [];
1826
1826
  for (const a of e) {
1827
- const l = a.spec.axesSpec[0], u = O(l), h = i.findIndex((f) => N(f, u));
1827
+ const l = a.spec.axesSpec[0], u = D(l), h = i.findIndex((f) => N(f, u));
1828
1828
  if (h !== -1) {
1829
- const f = i[h], g = Object.keys(f.domain ?? {}).length, p = Object.keys(l.domain ?? {}).length;
1830
- g > p ? o.push({
1829
+ const f = i[h], g = Object.keys(f.domain ?? {}).length, d = Object.keys(l.domain ?? {}).length;
1830
+ g > d ? o.push({
1831
1831
  id: s(a.id, f.domain),
1832
1832
  spec: {
1833
1833
  ...a.spec,
@@ -1839,8 +1839,8 @@ function Fe(t, e) {
1839
1839
  }
1840
1840
  return o;
1841
1841
  }
1842
- function Mt(t) {
1843
- const e = (i) => Array.isArray(i), n = (i) => i instanceof D, r = (i) => typeof i == "object" && "type" in i;
1842
+ function Ut(t) {
1843
+ const e = (i) => Array.isArray(i), n = (i) => i instanceof R, r = (i) => typeof i == "object" && "type" in i;
1844
1844
  return t.map((i) => i.data).every((i) => {
1845
1845
  if (e(i))
1846
1846
  return !0;
@@ -1859,7 +1859,7 @@ function Mt(t) {
1859
1859
  throw Error(`unsupported column data type: ${i}`);
1860
1860
  });
1861
1861
  }
1862
- function Ee(t) {
1862
+ function ke(t) {
1863
1863
  let e = t.columns;
1864
1864
  const n = [];
1865
1865
  if (t.coreColumnPredicate) {
@@ -1881,80 +1881,80 @@ function Ee(t) {
1881
1881
  sorting: t.sorting
1882
1882
  };
1883
1883
  }
1884
- function $t(t) {
1884
+ function Wt(t) {
1885
1885
  var e;
1886
1886
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "hidden";
1887
1887
  }
1888
- function Bt(t) {
1888
+ function Gt(t) {
1889
1889
  var e;
1890
1890
  return ((e = t.annotations) == null ? void 0 : e["pl7.app/table/visibility"]) === "optional";
1891
1891
  }
1892
- function de(t, e) {
1892
+ function he(t, e) {
1893
1893
  return [...new Map(t.map((n) => [e(n), n])).values()];
1894
1894
  }
1895
- function Vn(t, e, n, r) {
1895
+ function Jn(t, e, n, r) {
1896
1896
  if (e.length === 0) return;
1897
- const i = e.filter((c) => !$t(c.spec)), s = jt(n), o = Jt(t.resultPool);
1897
+ const i = e.filter((c) => !Wt(c.spec)), s = $t(n), o = Bt(t.resultPool);
1898
1898
  if (!o) return;
1899
- const a = Fe(i.map(Pe), o), l = [...i, ...a], h = [
1900
- ...de(
1901
- [...l.flatMap((c) => c.spec.axesSpec.map((m) => O(m)))],
1902
- (c) => R(c)
1899
+ const a = Ee(i.map(xe), o), l = [...i, ...a], h = [
1900
+ ...he(
1901
+ [...l.flatMap((c) => c.spec.axesSpec.map((b) => D(b)))],
1902
+ (c) => O(c)
1903
1903
  ).map((c) => ({ type: "axis", id: c })),
1904
1904
  ...l.map((c) => ({ type: "column", id: c.id }))
1905
- ], f = new Set(h.map((c) => R(c))), g = (c) => f.has(R(c)), p = (r == null ? void 0 : r.coreJoinType) ?? "full", b = s.pTableParams.partitionFilters.filter((c) => {
1906
- const m = g(c.column);
1907
- return m || t.logWarn(`Partition filter ${JSON.stringify(c)} does not match provided columns, skipping`), m;
1908
- }), d = de(
1905
+ ], f = new Set(h.map((c) => O(c))), g = (c) => f.has(O(c)), d = (r == null ? void 0 : r.coreJoinType) ?? "full", y = s.pTableParams.partitionFilters.filter((c) => {
1906
+ const b = g(c.column);
1907
+ return b || t.logWarn(`Partition filter ${JSON.stringify(c)} does not match provided columns, skipping`), b;
1908
+ }), p = he(
1909
1909
  [...(r == null ? void 0 : r.filters) ?? [], ...s.pTableParams.filters],
1910
- (c) => R(c.column)
1910
+ (c) => O(c.column)
1911
1911
  ).filter((c) => {
1912
- const m = g(c.column);
1913
- return m || t.logWarn(`Filter ${JSON.stringify(c)} does not match provided columns, skipping`), m;
1914
- }), y = de(
1912
+ const b = g(c.column);
1913
+ return b || t.logWarn(`Filter ${JSON.stringify(c)} does not match provided columns, skipping`), b;
1914
+ }), m = he(
1915
1915
  [...(r == null ? void 0 : r.sorting) ?? [], ...s.pTableParams.sorting],
1916
- (c) => R(c.column)
1916
+ (c) => O(c.column)
1917
1917
  ).filter((c) => {
1918
- const m = g(c.column);
1919
- return m || t.logWarn(`Sorting ${JSON.stringify(c)} does not match provided columns, skipping`), m;
1920
- }), S = Ee({
1918
+ const b = g(c.column);
1919
+ return b || t.logWarn(`Sorting ${JSON.stringify(c)} does not match provided columns, skipping`), b;
1920
+ }), C = ke({
1921
1921
  columns: i,
1922
1922
  labelColumns: a,
1923
- coreJoinType: p,
1924
- partitionFilters: b,
1925
- filters: d,
1926
- sorting: y,
1923
+ coreJoinType: d,
1924
+ partitionFilters: y,
1925
+ filters: p,
1926
+ sorting: m,
1927
1927
  coreColumnPredicate: r == null ? void 0 : r.coreColumnPredicate
1928
- }), E = t.createPTable(S), _ = new Set((() => {
1929
- if (p === "inner") return [];
1928
+ }), E = t.createPTable(C), _ = new Set((() => {
1929
+ if (d === "inner") return [];
1930
1930
  const c = s.pTableParams.hiddenColIds;
1931
- return c || i.filter((m) => Bt(m.spec)).map((m) => m.id);
1931
+ return c || i.filter((b) => Gt(b.spec)).map((b) => b.id);
1932
1932
  })());
1933
1933
  i.filter((c) => {
1934
- var m;
1935
- return ((m = c.spec.annotations) == null ? void 0 : m["pl7.app/isLinkerColumn"]) === "true";
1936
- }).forEach((c) => _.delete(c.id)), r != null && r.coreColumnPredicate && i.flatMap((m) => {
1934
+ var b;
1935
+ return ((b = c.spec.annotations) == null ? void 0 : b["pl7.app/isLinkerColumn"]) === "true";
1936
+ }).forEach((c) => _.delete(c.id)), r != null && r.coreColumnPredicate && i.flatMap((b) => {
1937
1937
  var T;
1938
- return (T = r == null ? void 0 : r.coreColumnPredicate) != null && T.call(r, m.spec) ? [m.id] : [];
1939
- }).forEach((m) => _.delete(m)), [...b.map((c) => c.column), ...d.map((c) => c.column), ...y.map((c) => c.column)].filter((c) => c.type === "column").forEach((c) => _.delete(c.id));
1940
- const w = i.filter((c) => !_.has(c.id)), A = Fe(w.map(Pe), o);
1941
- if (!Mt([...w, ...A])) return;
1942
- const C = Ee({
1938
+ return (T = r == null ? void 0 : r.coreColumnPredicate) != null && T.call(r, b.spec) ? [b.id] : [];
1939
+ }).forEach((b) => _.delete(b)), [...y.map((c) => c.column), ...p.map((c) => c.column), ...m.map((c) => c.column)].filter((c) => c.type === "column").forEach((c) => _.delete(c.id));
1940
+ const w = i.filter((c) => !_.has(c.id)), A = Ee(w.map(xe), o);
1941
+ if (!Ut([...w, ...A])) return;
1942
+ const S = ke({
1943
1943
  columns: w,
1944
1944
  labelColumns: A,
1945
- coreJoinType: p,
1946
- partitionFilters: b,
1947
- filters: d,
1948
- sorting: y,
1945
+ coreJoinType: d,
1946
+ partitionFilters: y,
1947
+ filters: p,
1948
+ sorting: m,
1949
1949
  coreColumnPredicate: r == null ? void 0 : r.coreColumnPredicate
1950
- }), I = t.createPTable(C);
1950
+ }), I = t.createPTable(S);
1951
1951
  return {
1952
1952
  sourceId: s.pTableParams.sourceId,
1953
1953
  fullTableHandle: E,
1954
1954
  visibleTableHandle: I
1955
1955
  };
1956
1956
  }
1957
- function jn(t, e, n) {
1957
+ function $n(t, e, n) {
1958
1958
  const r = t.resultPool.findLabels(e);
1959
1959
  return {
1960
1960
  axis: e,
@@ -1965,7 +1965,7 @@ function jn(t, e, n) {
1965
1965
  defaultValue: n[0]
1966
1966
  };
1967
1967
  }
1968
- const Ut = (t, e) => {
1968
+ const Ht = (t, e) => {
1969
1969
  let n = t.toString();
1970
1970
  return e == null || e.forEach((r) => {
1971
1971
  if (r)
@@ -1973,7 +1973,7 @@ const Ut = (t, e) => {
1973
1973
  n += i, n += s;
1974
1974
  }), n;
1975
1975
  };
1976
- function Wt(t) {
1976
+ function qt(t) {
1977
1977
  if (!t.length)
1978
1978
  return [];
1979
1979
  let e = [[]];
@@ -1984,16 +1984,16 @@ function Wt(t) {
1984
1984
  }), e = r;
1985
1985
  }), e;
1986
1986
  }
1987
- function Gt(t) {
1987
+ function zt(t) {
1988
1988
  var e;
1989
- return t.axesSpec.length === 2 && ((e = t.annotations) == null ? void 0 : e[qt]) === "true";
1989
+ return t.axesSpec.length === 2 && ((e = t.annotations) == null ? void 0 : e[Xt]) === "true";
1990
1990
  }
1991
- const Ht = "pl7.app/graph/isVirtual", ke = "pl7.app/label", qt = "pl7.app/isLinkerColumn";
1992
- function zt(t) {
1991
+ const Yt = "pl7.app/graph/isVirtual", De = "pl7.app/label", Xt = "pl7.app/isLinkerColumn";
1992
+ function Qt(t) {
1993
1993
  var n, r;
1994
1994
  const e = /* @__PURE__ */ new Map();
1995
1995
  for (const { spec: i } of t) {
1996
- const s = i.axesSpec.map(O).map(R);
1996
+ const s = i.axesSpec.map(D).map(O);
1997
1997
  s.forEach((o) => {
1998
1998
  e.has(o) || e.set(o, /* @__PURE__ */ new Set());
1999
1999
  });
@@ -2005,11 +2005,11 @@ function zt(t) {
2005
2005
  }
2006
2006
  return e;
2007
2007
  }
2008
- function Yt(t, e) {
2009
- const n = zt(t), r = [...n.keys()].map(xe), i = [];
2008
+ function Zt(t, e) {
2009
+ const n = Qt(t), r = [...n.keys()].map(_e), i = [];
2010
2010
  for (const l of e.values()) {
2011
2011
  const u = r.find((h) => N(l, h));
2012
- u && i.push(R(u));
2012
+ u && i.push(O(u));
2013
2013
  }
2014
2014
  const s = new Set(i), o = /* @__PURE__ */ new Map();
2015
2015
  let a = [...i];
@@ -2017,34 +2017,34 @@ function Yt(t, e) {
2017
2017
  const l = [];
2018
2018
  for (const u of a)
2019
2019
  for (const h of n.get(u) ?? [])
2020
- s.has(h) || (l.push(h), s.add(h), o.set(h, xe(h)));
2020
+ s.has(h) || (l.push(h), s.add(h), o.set(h, _e(h)));
2021
2021
  a = l;
2022
2022
  }
2023
2023
  return o;
2024
2024
  }
2025
- function Xt(t, e) {
2025
+ function Re(t, e) {
2026
2026
  const n = [];
2027
2027
  return e.forEach((r) => {
2028
- n.push(...Qt(t, r));
2028
+ n.push(...en(t, r));
2029
2029
  }), n;
2030
2030
  }
2031
- function Qt(t, e) {
2032
- const n = e.spec.axesSpec.map(O);
2033
- if (n.every((u) => t.has(R(u))))
2031
+ function en(t, e) {
2032
+ const n = e.spec.axesSpec.map(D);
2033
+ if (n.every((u) => t.has(O(u))))
2034
2034
  return [e];
2035
2035
  const r = n.map((u) => {
2036
2036
  const h = [];
2037
2037
  for (const [f, g] of t)
2038
2038
  N(g, u) && !N(u, g) && h.push(g);
2039
2039
  return h;
2040
- }), i = Wt(r), s = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), a = i.map((u) => {
2040
+ }), i = qt(r), s = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), a = i.map((u) => {
2041
2041
  const h = /* @__PURE__ */ new Set();
2042
2042
  return u.map((f, g) => {
2043
- const p = e.spec.axesSpec[g].domain, b = f.domain;
2044
- return Object.entries(b ?? {}).forEach(([d, y]) => {
2045
- if ((p == null ? void 0 : p[d]) === void 0) {
2046
- const S = JSON.stringify([d, y]);
2047
- h.add(S), s.add(S);
2043
+ const d = e.spec.axesSpec[g].domain, y = f.domain;
2044
+ return Object.entries(y ?? {}).forEach(([p, m]) => {
2045
+ if ((d == null ? void 0 : d[p]) === void 0) {
2046
+ const C = JSON.stringify([p, m]);
2047
+ h.add(C), s.add(C);
2048
2048
  }
2049
2049
  }), {
2050
2050
  ...f,
@@ -2056,75 +2056,99 @@ function Qt(t, e) {
2056
2056
  a.some((h) => !h.has(u)) && o.add(u);
2057
2057
  });
2058
2058
  const l = i.map((u, h) => {
2059
- var d;
2060
- const f = Ut(e.id, u.map((y) => y.domain)), g = ((d = e.spec.annotations) == null ? void 0 : d[ke]) ?? "", p = [...a[h]].filter((y) => o.has(y)).sort().map((y) => {
2061
- var S;
2062
- return (S = JSON.parse(y)) == null ? void 0 : S[1];
2063
- }).join(" / "), b = {
2059
+ var p;
2060
+ const f = Ht(e.id, u.map((m) => m.domain)), g = ((p = e.spec.annotations) == null ? void 0 : p[De]) ?? "", d = [...a[h]].filter((m) => o.has(m)).sort().map((m) => {
2061
+ var C;
2062
+ return (C = JSON.parse(m)) == null ? void 0 : C[1];
2063
+ }).join(" / "), y = {
2064
2064
  ...e.spec.annotations,
2065
- [Ht]: "true"
2065
+ [Yt]: "true"
2066
2066
  };
2067
- return (g || p) && (b[ke] = g && p ? g + " / " + p : g + p), {
2067
+ return (g || d) && (y[De] = g && d ? g + " / " + d : g + d), {
2068
2068
  id: f,
2069
2069
  spec: {
2070
2070
  ...e.spec,
2071
- axesSpec: u.map((y, S) => ({
2072
- ...y,
2073
- annotations: e.spec.axesSpec[S].annotations
2071
+ axesSpec: u.map((m, C) => ({
2072
+ ...m,
2073
+ annotations: e.spec.axesSpec[C].annotations
2074
2074
  })),
2075
- annotations: b
2075
+ annotations: y
2076
2076
  },
2077
2077
  data: e.data
2078
2078
  };
2079
2079
  });
2080
2080
  return [e, ...l];
2081
2081
  }
2082
- function Jn(t, e) {
2083
- if (!e) return;
2084
- const n = new ae();
2082
+ function tn(t) {
2083
+ let e = !0;
2084
+ return t.data instanceof R ? e = e && t.data.getIsReadyOrError() : ue(t.data) && pt(t.data, (n) => {
2085
+ e = e && n.getIsReadyOrError();
2086
+ }), e;
2087
+ }
2088
+ function ne(t) {
2089
+ return t.every(tn);
2090
+ }
2091
+ function Bn(t, e) {
2092
+ if (!e) {
2093
+ const f = new X();
2094
+ f.addColumnProvider(t.resultPool);
2095
+ const g = f.getColumns(() => !0, { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? [];
2096
+ if (!ne(g))
2097
+ return;
2098
+ const d = new Map(g.flatMap((p) => p.spec.axesSpec).map((p) => {
2099
+ const m = D(p);
2100
+ return [O(m), m];
2101
+ })), y = Re(d, g);
2102
+ return t.createPFrame(y);
2103
+ }
2104
+ if (!ne(e))
2105
+ return;
2106
+ const n = new X();
2085
2107
  n.addColumnProvider(t.resultPool), n.addColumns(e);
2086
2108
  const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
2087
2109
  for (const f of e)
2088
2110
  for (const g of f.spec.axesSpec) {
2089
- const p = O(g);
2090
- r.set(R(p), p), i.set(R(p), p);
2111
+ const d = D(g);
2112
+ r.set(O(d), d), i.set(O(d), d);
2091
2113
  }
2092
- const s = n.getColumns((f) => Gt(f)) ?? [], o = Yt(s, r);
2114
+ const s = n.getColumns((f) => zt(f)) ?? [], o = Zt(s, r);
2093
2115
  for (const f of o)
2094
2116
  r.set(...f), i.set(...f);
2095
2117
  const a = (n.getColumns((f) => f.axesSpec.some((g) => {
2096
- const p = O(g);
2097
- for (const b of r.values())
2098
- if (N(b, p))
2118
+ const d = D(g);
2119
+ for (const y of r.values())
2120
+ if (N(y, d))
2099
2121
  return !0;
2100
2122
  return !1;
2101
- }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((f) => !be(f.spec));
2123
+ }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((f) => !Ce(f.spec));
2124
+ if (!ne(a))
2125
+ return;
2102
2126
  for (const f of a)
2103
2127
  for (const g of f.spec.axesSpec) {
2104
- const p = O(g);
2105
- i.set(R(p), p);
2128
+ const d = D(g);
2129
+ i.set(O(d), d);
2106
2130
  }
2107
2131
  const l = (n.getColumns((f) => f.axesSpec.some((g) => {
2108
- const p = O(g);
2109
- for (const b of i.values())
2110
- if (N(b, p))
2132
+ const d = D(g);
2133
+ for (const y of i.values())
2134
+ if (N(y, d))
2111
2135
  return !0;
2112
2136
  return !1;
2113
- }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((f) => be(f.spec)), u = [...a, ...l], h = Xt(r, u);
2114
- if (!h.some(
2115
- (f) => f.data instanceof D && !f.data.getIsReadyOrError()
2116
- ))
2117
- return t.createPFrame(h);
2137
+ }), { dontWaitAllData: !0, overrideLabelAnnotation: !1 }) ?? []).filter((f) => Ce(f.spec));
2138
+ if (!ne(l))
2139
+ return;
2140
+ const u = [...a, ...l], h = Re(r, u);
2141
+ return t.createPFrame(h);
2118
2142
  }
2119
- function Mn({
2143
+ function Un({
2120
2144
  selection: t,
2121
- columnId: e = ct(),
2145
+ columnId: e = ft(),
2122
2146
  label: n = "Selection marker",
2123
2147
  domain: r
2124
2148
  }) {
2125
2149
  if (!(t != null && t.axesSpec.length))
2126
2150
  return;
2127
- const i = t.selectedKeys.filter((s) => s.every((o) => !ut(o))).map((s) => ({ key: s, val: 1 }));
2151
+ const i = t.selectedKeys.filter((s) => s.every((o) => !dt(o))).map((s) => ({ key: s, val: 1 }));
2128
2152
  if (i.length)
2129
2153
  return {
2130
2154
  id: e,
@@ -2142,10 +2166,10 @@ function Mn({
2142
2166
  data: i
2143
2167
  };
2144
2168
  }
2145
- function $n(t) {
2146
- return t === pt ? (console.error("Axis value can never be N/A"), "") : t;
2169
+ function Wn(t) {
2170
+ return t === ht ? (console.error("Axis value can never be N/A"), "") : t;
2147
2171
  }
2148
- class Bn {
2172
+ class Gn {
2149
2173
  constructor(e) {
2150
2174
  this.handle = e;
2151
2175
  }
@@ -2162,135 +2186,137 @@ class Bn {
2162
2186
  var r;
2163
2187
  return (r = cfgRenderCtx.featureFlags) != null && r.pFrameInSetFilterSupport || (e = {
2164
2188
  ...e,
2165
- filters: ye(e.filters)
2189
+ filters: ve(e.filters)
2166
2190
  }), await platforma.pFrameDriver.calculateTableData(this.handle, e, n);
2167
2191
  }
2168
2192
  async getUniqueValues(e) {
2169
2193
  return await platforma.pFrameDriver.getUniqueValues(this.handle, e);
2170
2194
  }
2171
2195
  }
2172
- function Zt(t) {
2173
- return Ke({
2196
+ function nn(t) {
2197
+ return Ve({
2174
2198
  __isRef: !0,
2175
- blockId: re(t, "blockId"),
2176
- name: re(t, "name")
2199
+ blockId: se(t, "blockId"),
2200
+ name: se(t, "name")
2177
2201
  });
2178
2202
  }
2179
- function Un(t) {
2180
- return Ke({
2181
- ref: Zt(re(t, "ref")),
2182
- label: re(t, "label")
2203
+ function Hn(t) {
2204
+ return Ve({
2205
+ ref: nn(se(t, "ref")),
2206
+ label: se(t, "label")
2183
2207
  });
2184
2208
  }
2185
- const Wn = {
2209
+ const qn = {
2186
2210
  sdkVersion: z
2187
2211
  };
2188
- function en() {
2189
- return Ne({ sdkVersion: z });
2212
+ function rn() {
2213
+ return Me({ sdkVersion: z });
2190
2214
  }
2191
- function Gn(t) {
2215
+ function zn(t) {
2192
2216
  try {
2193
- return en();
2217
+ return rn();
2194
2218
  } catch {
2195
2219
  return t;
2196
2220
  }
2197
2221
  }
2198
- function Hn(t) {
2222
+ function Yn(t) {
2199
2223
  if (typeof globalThis.getEnvironmentValue == "function")
2200
2224
  return globalThis.getEnvironmentValue(t);
2201
2225
  }
2202
2226
  export {
2203
- ln as Args,
2204
- Le as BlockModel,
2205
- Wn as CurrentSdkInfo,
2227
+ pn as Args,
2228
+ Fe as BlockModel,
2229
+ qn as CurrentSdkInfo,
2206
2230
  F as FutureRef,
2207
- Ht as IS_VIRTUAL_COLUMN,
2208
- un as It,
2209
- Rn as JsRenderInternal,
2210
- ke as LABEL_ANNOTATION,
2211
- qt as LINKER_COLUMN_ANNOTATION,
2212
- cn as MainOutputs,
2213
- dt as OutputError,
2214
- vt as PAnnotationLabel,
2215
- St as PAnnotationTrace,
2216
- ae as PColumnCollection,
2217
- Bn as PFrameImpl,
2231
+ Yt as IS_VIRTUAL_COLUMN,
2232
+ dn as It,
2233
+ Vn as JsRenderInternal,
2234
+ De as LABEL_ANNOTATION,
2235
+ Xt as LINKER_COLUMN_ANNOTATION,
2236
+ fn as MainOutputs,
2237
+ gt as OutputError,
2238
+ wt as PAnnotationLabel,
2239
+ At as PAnnotationTrace,
2240
+ X as PColumnCollection,
2241
+ Gn as PFrameImpl,
2218
2242
  B as RT_BINARY_PARTITIONED,
2219
2243
  q as RT_BINARY_SUPER_PARTITIONED,
2220
2244
  H as RT_JSON_PARTITIONED,
2221
- oe as RT_JSON_SUPER_PARTITIONED,
2222
- ie as RT_RESOURCE_MAP,
2223
- se as RT_RESOURCE_MAP_PARTITIONED,
2224
- ee as RenderCtx,
2225
- Kt as ResultPool,
2226
- pn as StagingOutputs,
2227
- wt as Trace,
2228
- Ct as TraceEntry,
2229
- D as TreeNodeAccessor,
2230
- dn as UiState,
2231
- Mt as allColumnsComputed,
2232
- vn as and,
2233
- Tt as convertOrParsePColumnData,
2234
- Jn as createPFrameForGraphs,
2235
- jn as createPlDataTableSheet,
2236
- Vt as createPlDataTableStateV2,
2237
- Vn as createPlDataTableV2,
2238
- Mn as createRowSelectionColumn,
2239
- Me as deriveLabels,
2240
- pe as downgradeCfgOrLambda,
2241
- Xt as enrichCompatible,
2242
- Ln as extractArchiveAndGetURL,
2243
- Nn as extractConfig,
2244
- Lt as filterDataInfoEntries,
2245
- mn as flatten,
2246
- Un as fromPlOption,
2247
- Zt as fromPlRef,
2248
- Jt as getAllLabelColumns,
2249
- Yt as getAvailableWithLinkersAxes,
2250
- Pn as getBlobContent,
2251
- _n as getBlobContentAsJson,
2252
- xn as getBlobContentAsString,
2253
- In as getDownloadedBlobContent,
2254
- Hn as getEnvironmentValue,
2255
- X as getFromCfg,
2256
- ne as getImmediate,
2257
- Fn as getImportProgress,
2258
- re as getJsonField,
2259
- En as getLastLogs,
2260
- zt as getLinkerColumnsMap,
2261
- On as getLogHandle,
2262
- Fe as getMatchingLabelColumns,
2263
- Tn as getOnDemandBlobContent,
2264
- xt as getPartitionKeysList,
2265
- Gn as getPlatformaOrDefault,
2266
- kn as getProgressLog,
2267
- Dn as getProgressLogWithInfo,
2268
- en as getRawPlatformaInstance,
2269
- Cn as getResourceField,
2270
- wn as getResourceValueAsJson,
2271
- It as getUniquePartitionKeys,
2272
- fe as ifDef,
2273
- $t as isColumnHidden,
2274
- Bt as isColumnOptional,
2275
- Nt as isConfigLambda,
2276
- yn as isEmpty,
2277
- be as isLabelColumn,
2278
- Gt as isLinkerColumn,
2279
- an as isolate,
2280
- fn as makeArray,
2281
- Ue as makeDefaultPTableParams,
2282
- Ke as makeObject,
2283
- gn as mapArrayValues,
2284
- $n as mapPTableValueToAxisKey,
2285
- hn as mapRecordValues,
2286
- An as mapResourceFields,
2287
- bn as not,
2288
- Sn as or,
2289
- me as parsePColumnData,
2290
- Kn as parseResourceMap,
2291
- ft as readOutput,
2292
- de as uniqueBy,
2293
- jt as upgradePlDataTableStateV2,
2294
- on as wrapOutputs
2245
+ le as RT_JSON_SUPER_PARTITIONED,
2246
+ oe as RT_RESOURCE_MAP,
2247
+ ae as RT_RESOURCE_MAP_PARTITIONED,
2248
+ te as RenderCtx,
2249
+ Mt as ResultPool,
2250
+ hn as StagingOutputs,
2251
+ xt as Trace,
2252
+ Pt as TraceEntry,
2253
+ R as TreeNodeAccessor,
2254
+ gn as UiState,
2255
+ Ut as allColumnsComputed,
2256
+ ne as allColumnsReady,
2257
+ wn as and,
2258
+ Et as convertOrParsePColumnData,
2259
+ Bn as createPFrameForGraphs,
2260
+ $n as createPlDataTableSheet,
2261
+ Jt as createPlDataTableStateV2,
2262
+ Jn as createPlDataTableV2,
2263
+ Un as createRowSelectionColumn,
2264
+ Be as deriveLabels,
2265
+ fe as downgradeCfgOrLambda,
2266
+ Re as enrichCompatible,
2267
+ kn as extractArchiveAndGetURL,
2268
+ jn as extractConfig,
2269
+ kt as filterDataInfoEntries,
2270
+ vn as flatten,
2271
+ Hn as fromPlOption,
2272
+ nn as fromPlRef,
2273
+ Bt as getAllLabelColumns,
2274
+ Zt as getAvailableWithLinkersAxes,
2275
+ In as getBlobContent,
2276
+ Ln as getBlobContentAsJson,
2277
+ Tn as getBlobContentAsString,
2278
+ Fn as getDownloadedBlobContent,
2279
+ Yn as getEnvironmentValue,
2280
+ Q as getFromCfg,
2281
+ ie as getImmediate,
2282
+ Dn as getImportProgress,
2283
+ se as getJsonField,
2284
+ Rn as getLastLogs,
2285
+ Qt as getLinkerColumnsMap,
2286
+ Nn as getLogHandle,
2287
+ Ee as getMatchingLabelColumns,
2288
+ En as getOnDemandBlobContent,
2289
+ Tt as getPartitionKeysList,
2290
+ zn as getPlatformaOrDefault,
2291
+ On as getProgressLog,
2292
+ Kn as getProgressLogWithInfo,
2293
+ rn as getRawPlatformaInstance,
2294
+ Pn as getResourceField,
2295
+ xn as getResourceValueAsJson,
2296
+ Ft as getUniquePartitionKeys,
2297
+ ge as ifDef,
2298
+ Wt as isColumnHidden,
2299
+ Gt as isColumnOptional,
2300
+ tn as isColumnReady,
2301
+ jt as isConfigLambda,
2302
+ Cn as isEmpty,
2303
+ Ce as isLabelColumn,
2304
+ zt as isLinkerColumn,
2305
+ cn as isolate,
2306
+ mn as makeArray,
2307
+ Ge as makeDefaultPTableParams,
2308
+ Ve as makeObject,
2309
+ bn as mapArrayValues,
2310
+ Wn as mapPTableValueToAxisKey,
2311
+ yn as mapRecordValues,
2312
+ _n as mapResourceFields,
2313
+ Sn as not,
2314
+ An as or,
2315
+ be as parsePColumnData,
2316
+ Mn as parseResourceMap,
2317
+ mt as readOutput,
2318
+ he as uniqueBy,
2319
+ $t as upgradePlDataTableStateV2,
2320
+ un as wrapOutputs
2295
2321
  };
2296
2322
  //# sourceMappingURL=index.mjs.map