@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/components/PlDataTable.d.ts +1 -1
- package/dist/components/PlDataTable.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +386 -344
- package/dist/index.mjs.map +1 -1
- package/dist/render/accessor.d.ts +3 -1
- package/dist/render/accessor.d.ts.map +1 -1
- package/dist/render/api.d.ts.map +1 -1
- package/dist/render/internal.d.ts +1 -1
- package/dist/render/internal.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/PlDataTable.ts +40 -9
- package/src/render/accessor.ts +24 -15
- package/src/render/api.ts +11 -6
- package/src/render/internal.ts +2 -1
package/dist/index.mjs
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { isPColumn as
|
|
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
|
|
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
|
|
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
|
|
16
|
+
function Nt(e) {
|
|
17
17
|
return new Proxy(e, {
|
|
18
18
|
get(t, n) {
|
|
19
|
-
return
|
|
19
|
+
return vt(t[n]);
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null ?
|
|
23
|
+
function f(e) {
|
|
24
|
+
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null ? L(e) : e;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
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 =
|
|
36
|
-
function
|
|
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
|
|
39
|
+
function st(e) {
|
|
40
40
|
const t = {};
|
|
41
|
-
for (const [n,
|
|
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(
|
|
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
|
|
55
|
+
function E(e, t) {
|
|
56
56
|
return {
|
|
57
57
|
type: "GetJsonField",
|
|
58
|
-
source:
|
|
59
|
-
field:
|
|
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:
|
|
114
|
-
field:
|
|
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:
|
|
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
|
|
133
|
+
function se(e) {
|
|
134
134
|
return {
|
|
135
135
|
type: "GetBlobContent",
|
|
136
|
-
source:
|
|
136
|
+
source: f(e)
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function ie(e) {
|
|
140
140
|
return {
|
|
141
141
|
type: "GetBlobContentAsString",
|
|
142
|
-
source:
|
|
142
|
+
source: f(e)
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function re() {
|
|
146
146
|
return function(e) {
|
|
147
147
|
return {
|
|
148
148
|
type: "GetBlobContentAsJson",
|
|
149
|
-
source:
|
|
149
|
+
source: f(e)
|
|
150
150
|
};
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
153
|
function oe(e) {
|
|
154
154
|
return {
|
|
155
155
|
type: "GetDownloadedBlobContent",
|
|
156
|
-
source:
|
|
156
|
+
source: f(e)
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
function ae(e) {
|
|
160
160
|
return {
|
|
161
161
|
type: "GetOnDemandBlobContent",
|
|
162
|
-
source:
|
|
162
|
+
source: f(e)
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
165
|
function le(e) {
|
|
166
166
|
return {
|
|
167
167
|
type: "GetImportProgress",
|
|
168
|
-
source:
|
|
168
|
+
source: f(e)
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
171
|
function ue(e, t) {
|
|
172
172
|
return {
|
|
173
173
|
type: "GetLastLogs",
|
|
174
|
-
source:
|
|
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:
|
|
181
|
+
source: f(e),
|
|
182
182
|
patternToSearch: t
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function de(e) {
|
|
186
186
|
return {
|
|
187
187
|
type: "GetLogHandle",
|
|
188
|
-
source:
|
|
188
|
+
source: f(e)
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function _t() {
|
|
192
192
|
return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
|
|
193
193
|
}
|
|
194
|
-
function
|
|
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
|
|
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
|
|
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
|
|
217
|
-
|
|
218
|
-
},
|
|
216
|
+
for (const s of B.get(e))
|
|
217
|
+
s(n);
|
|
218
|
+
}, B.set(e, [])), B.get(e).push(t);
|
|
219
219
|
}
|
|
220
|
-
class
|
|
221
|
-
constructor(t, n = (
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
this.handle = t, this.postProcess = n, St(t, (
|
|
225
|
-
this.resolvedValue = n(
|
|
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
|
|
229
|
+
return new v(this.handle, (n) => t(this.postProcess(n)));
|
|
230
230
|
}
|
|
231
231
|
mapDefined(t) {
|
|
232
|
-
return new
|
|
233
|
-
const
|
|
234
|
-
return
|
|
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
|
|
242
|
-
return e === void 0 ? void 0 :
|
|
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
|
-
(
|
|
250
|
+
(s) => ({
|
|
251
251
|
assertFieldType: "Input",
|
|
252
|
-
...typeof
|
|
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
|
-
(
|
|
259
|
+
(s) => ({
|
|
260
260
|
assertFieldType: "Output",
|
|
261
|
-
...typeof
|
|
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
|
-
(
|
|
268
|
+
(s) => ({
|
|
269
269
|
assertFieldType: "Input",
|
|
270
|
-
...typeof
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
335
|
-
return
|
|
336
|
-
if (!
|
|
337
|
-
return
|
|
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
|
|
355
|
+
const s = u().parsePObjectCollection(
|
|
345
356
|
this.handle,
|
|
346
357
|
t,
|
|
347
|
-
n
|
|
358
|
+
n,
|
|
359
|
+
...this.resolvePath
|
|
348
360
|
);
|
|
349
|
-
if (
|
|
350
|
-
const
|
|
351
|
-
for (const [
|
|
352
|
-
|
|
353
|
-
|
|
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
|
|
370
|
+
return new v(u().getBlobContentAsBase64(this.handle));
|
|
357
371
|
}
|
|
358
372
|
getFileContentAsString() {
|
|
359
|
-
return new
|
|
373
|
+
return new v(u().getBlobContentAsString(this.handle));
|
|
360
374
|
}
|
|
361
375
|
getFileContentAsJson() {
|
|
362
|
-
return new
|
|
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
|
|
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
|
|
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
|
|
417
|
+
return new v(u().getImportProgress(this.handle));
|
|
404
418
|
}
|
|
405
419
|
getLastLogs(t) {
|
|
406
|
-
return new
|
|
420
|
+
return new v(u().getLastLogs(this.handle, t));
|
|
407
421
|
}
|
|
408
422
|
getProgressLog(t) {
|
|
409
|
-
return new
|
|
423
|
+
return new v(u().getProgressLog(this.handle, t));
|
|
410
424
|
}
|
|
411
425
|
getLogHandle() {
|
|
412
|
-
return new
|
|
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:
|
|
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 (
|
|
447
|
+
if (i && (s === "Input" && !this.getInputsLocked() || s === "Output" && !this.getOutputsLocked()))
|
|
434
448
|
return;
|
|
435
|
-
let
|
|
436
|
-
(
|
|
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
|
|
452
|
+
return r && (d = d.filter((a) => a[1] !== void 0)), d.map(([a, p]) => o(a, p));
|
|
439
453
|
}
|
|
440
454
|
}
|
|
441
|
-
const
|
|
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
|
|
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((
|
|
464
|
+
if (at(n)) n.__awaited_futures__.forEach((i) => e.add(i));
|
|
451
465
|
else if (Array.isArray(n))
|
|
452
|
-
for (const
|
|
466
|
+
for (const i of n) $(e, t, i);
|
|
453
467
|
else
|
|
454
|
-
for (const [,
|
|
455
|
-
|
|
468
|
+
for (const [, i] of Object.entries(n))
|
|
469
|
+
i !== n && $(e, t, i);
|
|
456
470
|
}
|
|
457
|
-
function
|
|
471
|
+
function Ct(e) {
|
|
458
472
|
const t = /* @__PURE__ */ new Set();
|
|
459
|
-
return
|
|
473
|
+
return $(t, /* @__PURE__ */ new Set(), e), t;
|
|
460
474
|
}
|
|
461
|
-
const
|
|
475
|
+
const pe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
462
476
|
__proto__: null,
|
|
463
|
-
GlobalCfgRenderCtxFeatureFlags:
|
|
477
|
+
GlobalCfgRenderCtxFeatureFlags: Pt,
|
|
464
478
|
MainAccessorName: ot,
|
|
465
|
-
StagingAccessorName:
|
|
466
|
-
getAllFutureAwaits:
|
|
479
|
+
StagingAccessorName: rt,
|
|
480
|
+
getAllFutureAwaits: Ct,
|
|
467
481
|
isFutureAwait: at
|
|
468
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
469
|
-
type:
|
|
470
|
-
importance:
|
|
471
|
-
id:
|
|
472
|
-
label:
|
|
473
|
-
}), Ft =
|
|
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
|
|
476
|
-
var
|
|
477
|
-
const m = t(
|
|
478
|
-
if (
|
|
479
|
-
const
|
|
480
|
-
n.addLabelAsSuffix ?
|
|
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
|
|
483
|
-
for (let
|
|
484
|
-
const { type: V } =
|
|
485
|
-
|
|
486
|
-
const
|
|
487
|
-
|
|
488
|
-
|
|
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
|
-
|
|
491
|
-
ct - (
|
|
504
|
+
s.get(R) ?? Number.NEGATIVE_INFINITY,
|
|
505
|
+
ct - (y.length - w) * Tt
|
|
492
506
|
)
|
|
493
|
-
),
|
|
507
|
+
), C.push({ ...y[w], fullType: R, occurenceIndex: j });
|
|
494
508
|
}
|
|
495
|
-
return
|
|
496
|
-
value:
|
|
509
|
+
return C.reverse(), {
|
|
510
|
+
value: c,
|
|
497
511
|
spec: m,
|
|
498
|
-
label:
|
|
499
|
-
fullTrace:
|
|
512
|
+
label: h,
|
|
513
|
+
fullTrace: C
|
|
500
514
|
};
|
|
501
|
-
}), o = [], l = [],
|
|
502
|
-
|
|
503
|
-
for (const [
|
|
504
|
-
|
|
505
|
-
const
|
|
506
|
-
const
|
|
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:
|
|
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
|
|
515
|
-
}
|
|
516
|
-
let
|
|
517
|
-
for (;
|
|
518
|
-
const
|
|
519
|
-
n.includeNativeLabel &&
|
|
520
|
-
for (let
|
|
521
|
-
|
|
522
|
-
const m = c
|
|
523
|
-
if (new Set(m.map((
|
|
524
|
-
|
|
525
|
-
}
|
|
526
|
-
return
|
|
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
|
-
|
|
531
|
-
|
|
532
|
-
var
|
|
533
|
-
return ((
|
|
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
|
|
544
|
-
return typeof n == "object" || typeof n > "u" ? kt(
|
|
545
|
-
ref:
|
|
546
|
-
label:
|
|
547
|
-
})) :
|
|
548
|
-
ref:
|
|
549
|
-
label: n(
|
|
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(
|
|
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
|
-
(
|
|
607
|
-
)) == null ? void 0 : n.obj :
|
|
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
|
-
(
|
|
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 (!
|
|
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
|
-
(
|
|
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
|
|
652
|
-
if (!
|
|
668
|
+
t: for (const s of this.getData().entries) {
|
|
669
|
+
if (!X(s.obj.spec))
|
|
653
670
|
continue;
|
|
654
|
-
const
|
|
655
|
-
if (t.name ===
|
|
656
|
-
for (let
|
|
657
|
-
const o = t.axesSpec[
|
|
658
|
-
if (o.name !== l.name || o.type !== l.type ||
|
|
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(
|
|
678
|
+
n.push(s.obj);
|
|
662
679
|
}
|
|
663
680
|
}
|
|
664
681
|
return n;
|
|
665
682
|
}
|
|
666
683
|
}
|
|
667
|
-
function
|
|
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
|
|
691
|
+
class D {
|
|
675
692
|
constructor() {
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
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
|
-
|
|
684
|
-
|
|
700
|
+
return J(
|
|
701
|
+
this.ctx.getAccessorHandleByName(t),
|
|
702
|
+
(n) => new _(n, [t])
|
|
703
|
+
);
|
|
685
704
|
}
|
|
686
705
|
get prerun() {
|
|
687
|
-
return this.getNamedAccessor(
|
|
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
|
|
717
|
-
if (!
|
|
718
|
-
const
|
|
719
|
-
if (
|
|
720
|
-
if (
|
|
721
|
-
throw Error(`Expected JSON column for labels, got: ${
|
|
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
|
-
|
|
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
|
|
732
|
-
const n = t.some((
|
|
733
|
-
if (n && !
|
|
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) =>
|
|
755
|
+
return this.verifyInlineColumnsSupport(t), this.ctx.createPFrame(t.map((n) => x(
|
|
737
756
|
n,
|
|
738
|
-
(
|
|
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((
|
|
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, (
|
|
751
|
-
|
|
752
|
-
(
|
|
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
|
|
765
|
-
function ut(e, t, n,
|
|
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
|
|
769
|
-
let
|
|
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" }),
|
|
772
|
-
|
|
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
|
|
793
|
+
return r;
|
|
775
794
|
}
|
|
776
|
-
case
|
|
777
|
-
let
|
|
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)
|
|
799
|
+
if (l === void 0) r = !1;
|
|
781
800
|
else {
|
|
782
|
-
const
|
|
801
|
+
const d = [...s, ...JSON.parse(o)], a = ut(
|
|
783
802
|
l,
|
|
784
803
|
t,
|
|
785
804
|
n,
|
|
786
|
-
|
|
787
|
-
|
|
805
|
+
d,
|
|
806
|
+
i
|
|
788
807
|
);
|
|
789
|
-
|
|
808
|
+
r = r && a;
|
|
790
809
|
}
|
|
791
810
|
}
|
|
792
|
-
return
|
|
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
|
|
800
|
-
return { isComplete: ut(e, t,
|
|
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(),
|
|
812
|
-
let
|
|
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
|
-
|
|
834
|
+
i = n.keyLength;
|
|
835
|
+
break;
|
|
836
|
+
case H:
|
|
837
|
+
i = n.partitionKeyLength + n.keyLength;
|
|
819
838
|
break;
|
|
820
839
|
case tt:
|
|
821
|
-
case
|
|
822
|
-
|
|
840
|
+
case N:
|
|
841
|
+
i = n.partitionKeyLength;
|
|
823
842
|
break;
|
|
824
843
|
case M:
|
|
825
844
|
case et:
|
|
826
|
-
|
|
845
|
+
i = n.superPartitionKeyLength + n.partitionKeyLength;
|
|
827
846
|
break;
|
|
828
847
|
}
|
|
829
848
|
switch (t) {
|
|
830
|
-
case
|
|
849
|
+
case G:
|
|
831
850
|
case tt:
|
|
832
|
-
case
|
|
833
|
-
for (let
|
|
834
|
-
if (t ===
|
|
835
|
-
const l = nt(
|
|
836
|
-
if (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(
|
|
840
|
-
|
|
858
|
+
const o = [...JSON.parse(r)];
|
|
859
|
+
s.push(o);
|
|
841
860
|
}
|
|
842
861
|
break;
|
|
843
|
-
case
|
|
862
|
+
case H:
|
|
844
863
|
case M:
|
|
845
864
|
case et:
|
|
846
|
-
for (const
|
|
847
|
-
const o = [...JSON.parse(
|
|
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
|
|
868
|
+
for (let d of l.listInputFields()) {
|
|
850
869
|
if (t === M) {
|
|
851
|
-
const
|
|
852
|
-
if (
|
|
870
|
+
const p = nt(d);
|
|
871
|
+
if (p) d = p;
|
|
853
872
|
else continue;
|
|
854
873
|
}
|
|
855
|
-
const
|
|
856
|
-
|
|
874
|
+
const a = [...o, ...JSON.parse(d)];
|
|
875
|
+
s.push(a);
|
|
857
876
|
}
|
|
858
877
|
}
|
|
859
878
|
break;
|
|
860
879
|
}
|
|
861
|
-
return { data:
|
|
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:
|
|
867
|
-
for (let
|
|
868
|
-
|
|
869
|
-
for (const
|
|
870
|
-
if (
|
|
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 <
|
|
873
|
-
|
|
891
|
+
for (let o = 0; o < s; ++o)
|
|
892
|
+
i[o].add(r[o]);
|
|
874
893
|
}
|
|
875
|
-
return
|
|
894
|
+
return i.map((r) => Array.from(r.values()));
|
|
876
895
|
}
|
|
877
|
-
const
|
|
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
|
|
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:
|
|
895
|
-
outputs:
|
|
896
|
-
renderingMode:
|
|
913
|
+
inputsValid: s,
|
|
914
|
+
outputs: i,
|
|
915
|
+
renderingMode: r,
|
|
897
916
|
sdkVersion: o,
|
|
898
917
|
sections: l,
|
|
899
|
-
title:
|
|
900
|
-
} = e.v3, { code:
|
|
918
|
+
title: d
|
|
919
|
+
} = e.v3, { code: a } = e;
|
|
901
920
|
return {
|
|
902
921
|
initialArgs: t,
|
|
903
922
|
initialUiState: n,
|
|
904
|
-
inputsValid:
|
|
905
|
-
outputs:
|
|
906
|
-
renderingMode:
|
|
923
|
+
inputsValid: s,
|
|
924
|
+
outputs: i,
|
|
925
|
+
renderingMode: r,
|
|
907
926
|
sdkVersion: o,
|
|
908
927
|
sections: l,
|
|
909
|
-
title:
|
|
910
|
-
code:
|
|
928
|
+
title: d,
|
|
929
|
+
code: a
|
|
911
930
|
};
|
|
912
931
|
} else if (e.inputsValid !== void 0) {
|
|
913
|
-
const { sdkVersion: t, renderingMode: n, outputs:
|
|
914
|
-
if (t === void 0 || n === 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 = ${
|
|
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(
|
|
942
|
+
Object.entries(s).map(([a, p]) => [a, A(p)])
|
|
924
943
|
),
|
|
925
|
-
inputsValid:
|
|
926
|
-
sections:
|
|
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:
|
|
932
|
-
if (
|
|
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 = ${
|
|
953
|
+
`Malformed config v1. SDK version ${t}; Fields = ${d.join(", ")}`
|
|
935
954
|
);
|
|
936
955
|
return {
|
|
937
956
|
sdkVersion: t ?? "unknown",
|
|
938
|
-
renderingMode:
|
|
957
|
+
renderingMode: s,
|
|
939
958
|
initialArgs: o,
|
|
940
959
|
outputs: Object.fromEntries(
|
|
941
|
-
Object.entries(
|
|
960
|
+
Object.entries(i).map(([a, p]) => [a, A(p)])
|
|
942
961
|
),
|
|
943
|
-
inputsValid:
|
|
944
|
-
sections:
|
|
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
|
|
956
|
-
constructor(t, n,
|
|
957
|
-
this._renderingMode = t, this._initialArgs = n, this._initialUiState =
|
|
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
|
|
979
|
+
return new b(
|
|
961
980
|
t,
|
|
962
981
|
void 0,
|
|
963
982
|
{},
|
|
964
983
|
{},
|
|
965
|
-
|
|
966
|
-
|
|
984
|
+
L(!0),
|
|
985
|
+
L([]),
|
|
967
986
|
void 0
|
|
968
987
|
);
|
|
969
988
|
}
|
|
970
|
-
output(t, n,
|
|
989
|
+
output(t, n, s = {}) {
|
|
971
990
|
if (typeof n == "function") {
|
|
972
|
-
const
|
|
973
|
-
return
|
|
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:
|
|
982
|
-
...
|
|
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
|
|
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" ? (
|
|
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
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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:
|
|
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:
|
|
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,
|
|
1147
|
+
Object.entries(this._outputs).map(([n, s]) => [n, U(s)])
|
|
1129
1148
|
)
|
|
1130
1149
|
};
|
|
1131
|
-
return
|
|
1150
|
+
return _t() ? it({ sdkVersion: F }) : { config: t };
|
|
1132
1151
|
}
|
|
1133
1152
|
}
|
|
1134
|
-
function me(e, t, n,
|
|
1135
|
-
var
|
|
1136
|
-
const
|
|
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
|
|
1139
|
-
const
|
|
1140
|
-
for (const
|
|
1141
|
-
|
|
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, ...
|
|
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: [...
|
|
1194
|
+
secondary: [...o.values()].map((a) => ({ type: "column", column: a }))
|
|
1154
1195
|
},
|
|
1155
|
-
filters: [...((
|
|
1156
|
-
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
|
|
1201
|
+
const s = e.findLabels(t);
|
|
1161
1202
|
return {
|
|
1162
1203
|
axis: t,
|
|
1163
|
-
options: n.map((
|
|
1164
|
-
value:
|
|
1165
|
-
label: (
|
|
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
|
|
1232
|
+
return st({
|
|
1192
1233
|
__isRef: !0,
|
|
1193
|
-
blockId:
|
|
1194
|
-
name:
|
|
1234
|
+
blockId: E(e, "blockId"),
|
|
1235
|
+
name: E(e, "name")
|
|
1195
1236
|
});
|
|
1196
1237
|
}
|
|
1197
|
-
function
|
|
1198
|
-
return
|
|
1199
|
-
ref: Et(
|
|
1200
|
-
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
|
|
1204
|
-
sdkVersion:
|
|
1244
|
+
const _e = {
|
|
1245
|
+
sdkVersion: F
|
|
1205
1246
|
};
|
|
1206
1247
|
function we() {
|
|
1207
|
-
return
|
|
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
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1256
|
+
b as BlockModel,
|
|
1257
|
+
_e as CurrentSdkInfo,
|
|
1258
|
+
v as FutureRef,
|
|
1218
1259
|
Jt as It,
|
|
1219
|
-
|
|
1260
|
+
pe as JsRenderInternal,
|
|
1220
1261
|
$t as MainOutputs,
|
|
1221
1262
|
bt as OutputError,
|
|
1222
|
-
|
|
1223
|
-
|
|
1263
|
+
At as PAnnotationLabel,
|
|
1264
|
+
It as PAnnotationTrace,
|
|
1224
1265
|
be as PFrameImpl,
|
|
1225
|
-
|
|
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
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
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
|
-
|
|
1286
|
+
ve as fromPlOption,
|
|
1246
1287
|
Et as fromPlRef,
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1288
|
+
se as getBlobContent,
|
|
1289
|
+
re as getBlobContentAsJson,
|
|
1290
|
+
ie as getBlobContentAsString,
|
|
1250
1291
|
oe as getDownloadedBlobContent,
|
|
1251
1292
|
Se as getEnvironmentValue,
|
|
1252
|
-
|
|
1253
|
-
|
|
1293
|
+
T as getFromCfg,
|
|
1294
|
+
L as getImmediate,
|
|
1254
1295
|
le as getImportProgress,
|
|
1255
|
-
|
|
1296
|
+
E as getJsonField,
|
|
1256
1297
|
ue as getLastLogs,
|
|
1257
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1277
|
-
|
|
1318
|
+
vt as readOutput,
|
|
1319
|
+
Nt as wrapOutputs
|
|
1278
1320
|
};
|
|
1279
1321
|
//# sourceMappingURL=index.mjs.map
|