@milaboratories/milaboratories.ui-examples.model 1.1.29 → 1.1.30
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/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +7 -0
- package/dist/bundle.js +538 -373
- package/dist/bundle.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +3 -3
package/dist/bundle.js
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
}, "");
|
|
36
36
|
return `{${values}}`;
|
|
37
37
|
};
|
|
38
|
-
const
|
|
38
|
+
const g$1 = /* @__PURE__ */ getDefaultExportFromCjs(canonicalize);
|
|
39
39
|
var util;
|
|
40
40
|
(function(util2) {
|
|
41
41
|
util2.assertEqual = (val) => val;
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
return obj;
|
|
55
55
|
};
|
|
56
56
|
util2.getValidEnumValues = (obj) => {
|
|
57
|
-
const validKeys = util2.objectKeys(obj).filter((
|
|
57
|
+
const validKeys = util2.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
|
|
58
58
|
const filtered = {};
|
|
59
|
-
for (const
|
|
60
|
-
filtered[
|
|
59
|
+
for (const k of validKeys) {
|
|
60
|
+
filtered[k] = obj[k];
|
|
61
61
|
}
|
|
62
62
|
return util2.objectValues(filtered);
|
|
63
63
|
};
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
|
88
88
|
}
|
|
89
89
|
util2.joinValues = joinValues;
|
|
90
|
-
util2.jsonStringifyReplacer = (
|
|
90
|
+
util2.jsonStringifyReplacer = (_, value) => {
|
|
91
91
|
if (typeof value === "bigint") {
|
|
92
92
|
return value.toString();
|
|
93
93
|
}
|
|
@@ -402,7 +402,7 @@
|
|
|
402
402
|
};
|
|
403
403
|
}
|
|
404
404
|
let errorMessage = "";
|
|
405
|
-
const maps = errorMaps.filter((
|
|
405
|
+
const maps = errorMaps.filter((m2) => !!m2).slice().reverse();
|
|
406
406
|
for (const map of maps) {
|
|
407
407
|
errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
|
|
408
408
|
}
|
|
@@ -492,12 +492,12 @@
|
|
|
492
492
|
const isDirty = (x2) => x2.status === "dirty";
|
|
493
493
|
const isValid = (x2) => x2.status === "valid";
|
|
494
494
|
const isAsync = (x2) => typeof Promise !== "undefined" && x2 instanceof Promise;
|
|
495
|
-
function __classPrivateFieldGet(receiver, state, kind,
|
|
496
|
-
if (typeof state === "function" ? receiver !== state || !
|
|
495
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
496
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
497
497
|
return state.get(receiver);
|
|
498
498
|
}
|
|
499
|
-
function __classPrivateFieldSet(receiver, state, value, kind,
|
|
500
|
-
if (typeof state === "function" ? receiver !== state || !
|
|
499
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
500
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
501
501
|
return state.set(receiver, value), value;
|
|
502
502
|
}
|
|
503
503
|
typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
|
|
@@ -3105,29 +3105,29 @@
|
|
|
3105
3105
|
const params = { errorMap: ctx.common.contextualErrorMap };
|
|
3106
3106
|
const fn = ctx.data;
|
|
3107
3107
|
if (this._def.returns instanceof ZodPromise) {
|
|
3108
|
-
const
|
|
3108
|
+
const me2 = this;
|
|
3109
3109
|
return OK(async function(...args) {
|
|
3110
3110
|
const error = new ZodError([]);
|
|
3111
|
-
const parsedArgs = await
|
|
3111
|
+
const parsedArgs = await me2._def.args.parseAsync(args, params).catch((e) => {
|
|
3112
3112
|
error.addIssue(makeArgsIssue(args, e));
|
|
3113
3113
|
throw error;
|
|
3114
3114
|
});
|
|
3115
3115
|
const result = await Reflect.apply(fn, this, parsedArgs);
|
|
3116
|
-
const parsedReturns = await
|
|
3116
|
+
const parsedReturns = await me2._def.returns._def.type.parseAsync(result, params).catch((e) => {
|
|
3117
3117
|
error.addIssue(makeReturnsIssue(result, e));
|
|
3118
3118
|
throw error;
|
|
3119
3119
|
});
|
|
3120
3120
|
return parsedReturns;
|
|
3121
3121
|
});
|
|
3122
3122
|
} else {
|
|
3123
|
-
const
|
|
3123
|
+
const me2 = this;
|
|
3124
3124
|
return OK(function(...args) {
|
|
3125
|
-
const parsedArgs =
|
|
3125
|
+
const parsedArgs = me2._def.args.safeParse(args, params);
|
|
3126
3126
|
if (!parsedArgs.success) {
|
|
3127
3127
|
throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
|
|
3128
3128
|
}
|
|
3129
3129
|
const result = Reflect.apply(fn, this, parsedArgs.data);
|
|
3130
|
-
const parsedReturns =
|
|
3130
|
+
const parsedReturns = me2._def.returns.safeParse(result, params);
|
|
3131
3131
|
if (!parsedReturns.success) {
|
|
3132
3132
|
throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
|
|
3133
3133
|
}
|
|
@@ -3731,10 +3731,10 @@
|
|
|
3731
3731
|
return ZodAny.create().superRefine((data, ctx) => {
|
|
3732
3732
|
var _a, _b;
|
|
3733
3733
|
if (!check(data)) {
|
|
3734
|
-
const
|
|
3735
|
-
const _fatal = (_b = (_a =
|
|
3736
|
-
const
|
|
3737
|
-
ctx.addIssue({ code: "custom", ...
|
|
3734
|
+
const p2 = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
|
|
3735
|
+
const _fatal = (_b = (_a = p2.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;
|
|
3736
|
+
const p22 = typeof p2 === "string" ? { message: p2 } : p2;
|
|
3737
|
+
ctx.addIssue({ code: "custom", ...p22, fatal: _fatal });
|
|
3738
3738
|
}
|
|
3739
3739
|
});
|
|
3740
3740
|
return ZodAny.create();
|
|
@@ -3832,7 +3832,7 @@
|
|
|
3832
3832
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
3833
3833
|
};
|
|
3834
3834
|
const NEVER = INVALID;
|
|
3835
|
-
var z
|
|
3835
|
+
var z = /* @__PURE__ */ Object.freeze({
|
|
3836
3836
|
__proto__: null,
|
|
3837
3837
|
defaultErrorMap: errorMap,
|
|
3838
3838
|
setErrorMap,
|
|
@@ -3948,30 +3948,33 @@
|
|
|
3948
3948
|
quotelessJson,
|
|
3949
3949
|
ZodError
|
|
3950
3950
|
});
|
|
3951
|
-
var
|
|
3952
|
-
var F = (n, t, e) => t in n ?
|
|
3953
|
-
var
|
|
3954
|
-
function
|
|
3951
|
+
var V = Object.defineProperty;
|
|
3952
|
+
var F = (n, t, e) => t in n ? V(n, t, { enumerable: true, configurable: true, writable: true, value: e }) : n[t] = e;
|
|
3953
|
+
var m = (n, t, e) => F(n, typeof t != "symbol" ? t + "" : t, e);
|
|
3954
|
+
function w(n) {
|
|
3955
3955
|
throw new Error("Unexpected object: " + n);
|
|
3956
3956
|
}
|
|
3957
|
-
function
|
|
3957
|
+
function p(n) {
|
|
3958
3958
|
const { type: t, name: e, domain: r } = n;
|
|
3959
3959
|
return { type: t, name: e, ...r && { domain: r } };
|
|
3960
3960
|
}
|
|
3961
|
-
function
|
|
3961
|
+
function wn(n) {
|
|
3962
|
+
return g$1(p(n));
|
|
3963
|
+
}
|
|
3964
|
+
function G$1(n, t) {
|
|
3962
3965
|
if (n === void 0) return t === void 0;
|
|
3963
3966
|
if (t === void 0) return true;
|
|
3964
3967
|
for (const e in t)
|
|
3965
3968
|
if (n[e] !== t[e]) return false;
|
|
3966
3969
|
return true;
|
|
3967
3970
|
}
|
|
3968
|
-
function
|
|
3969
|
-
return n.name === t.name &&
|
|
3971
|
+
function Q$1(n, t) {
|
|
3972
|
+
return n.name === t.name && G$1(n.domain, t.domain);
|
|
3970
3973
|
}
|
|
3971
|
-
function
|
|
3972
|
-
return { ...n, src:
|
|
3974
|
+
function An(n, t) {
|
|
3975
|
+
return { ...n, src: h(n.src, t) };
|
|
3973
3976
|
}
|
|
3974
|
-
function
|
|
3977
|
+
function h(n, t) {
|
|
3975
3978
|
switch (n.type) {
|
|
3976
3979
|
case "column":
|
|
3977
3980
|
return {
|
|
@@ -3982,103 +3985,122 @@
|
|
|
3982
3985
|
case "full":
|
|
3983
3986
|
return {
|
|
3984
3987
|
type: n.type,
|
|
3985
|
-
entries: n.entries.map((e) =>
|
|
3988
|
+
entries: n.entries.map((e) => h(e, t))
|
|
3986
3989
|
};
|
|
3987
3990
|
case "outer":
|
|
3988
3991
|
return {
|
|
3989
3992
|
type: "outer",
|
|
3990
|
-
primary:
|
|
3991
|
-
secondary: n.secondary.map((e) =>
|
|
3993
|
+
primary: h(n.primary, t),
|
|
3994
|
+
secondary: n.secondary.map((e) => h(e, t))
|
|
3992
3995
|
};
|
|
3993
3996
|
default:
|
|
3994
|
-
|
|
3997
|
+
w(n);
|
|
3995
3998
|
}
|
|
3996
3999
|
}
|
|
3997
|
-
function
|
|
3998
|
-
return
|
|
4000
|
+
function Y(n) {
|
|
4001
|
+
return g$1(n);
|
|
4002
|
+
}
|
|
4003
|
+
function x$1(n) {
|
|
4004
|
+
return g$1(p(n));
|
|
3999
4005
|
}
|
|
4000
|
-
function
|
|
4006
|
+
function P$1(n, t) {
|
|
4001
4007
|
return JSON.stringify([n, t]);
|
|
4002
4008
|
}
|
|
4003
|
-
class
|
|
4009
|
+
class Pn {
|
|
4004
4010
|
/**
|
|
4005
4011
|
* Creates a new anchor context from a set of anchor column specifications
|
|
4006
4012
|
* @param anchors Record of anchor column specifications indexed by anchor ID
|
|
4007
4013
|
*/
|
|
4008
4014
|
constructor(t) {
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4015
|
+
m(this, "domains", /* @__PURE__ */ new Map());
|
|
4016
|
+
m(this, "axes", /* @__PURE__ */ new Map());
|
|
4017
|
+
m(this, "domainPacks", []);
|
|
4018
|
+
m(this, "domainPackToAnchor", /* @__PURE__ */ new Map());
|
|
4013
4019
|
this.anchors = t;
|
|
4014
4020
|
const e = Object.entries(t);
|
|
4015
4021
|
e.sort((r, o) => r[0].localeCompare(o[0]));
|
|
4016
4022
|
for (const [r, o] of e) {
|
|
4017
4023
|
for (let i = 0; i < o.axesSpec.length; i++) {
|
|
4018
|
-
const
|
|
4019
|
-
this.axes.set(
|
|
4024
|
+
const s = o.axesSpec[i], a = x$1(s);
|
|
4025
|
+
this.axes.set(a, { anchor: r, idx: i });
|
|
4020
4026
|
}
|
|
4021
4027
|
if (o.domain !== void 0) {
|
|
4022
4028
|
const i = Object.entries(o.domain);
|
|
4023
|
-
i.sort((
|
|
4024
|
-
for (const [
|
|
4025
|
-
const
|
|
4026
|
-
this.domains.set(
|
|
4029
|
+
i.sort((s, a) => s[0].localeCompare(a[0])), this.domainPackToAnchor.set(JSON.stringify(i), r), this.domainPacks.push(i.map(([s]) => s));
|
|
4030
|
+
for (const [s, a] of i) {
|
|
4031
|
+
const f = P$1(s, a);
|
|
4032
|
+
this.domains.set(f, r);
|
|
4027
4033
|
}
|
|
4028
4034
|
}
|
|
4029
4035
|
}
|
|
4030
4036
|
}
|
|
4031
4037
|
/**
|
|
4032
|
-
*
|
|
4033
|
-
* Replaces domain values and axes with anchored references when possible
|
|
4034
|
-
* @param spec Column specification to anchor
|
|
4035
|
-
* @returns An anchored column identifier that can be used to identify columns similar to the input specification
|
|
4038
|
+
* Implementation of derive method
|
|
4036
4039
|
*/
|
|
4037
|
-
derive(t) {
|
|
4038
|
-
const
|
|
4040
|
+
derive(t, e) {
|
|
4041
|
+
const r = {
|
|
4039
4042
|
name: t.name,
|
|
4040
4043
|
axes: []
|
|
4041
4044
|
};
|
|
4042
|
-
let
|
|
4045
|
+
let o;
|
|
4043
4046
|
if (t.domain !== void 0)
|
|
4044
4047
|
n:
|
|
4045
|
-
for (const
|
|
4046
|
-
const
|
|
4047
|
-
for (const
|
|
4048
|
-
const
|
|
4049
|
-
if (
|
|
4050
|
-
|
|
4048
|
+
for (const s of this.domainPacks) {
|
|
4049
|
+
const a = [];
|
|
4050
|
+
for (const u of s) {
|
|
4051
|
+
const d = t.domain[u];
|
|
4052
|
+
if (d !== void 0)
|
|
4053
|
+
a.push([u, d]);
|
|
4051
4054
|
else
|
|
4052
4055
|
break n;
|
|
4053
4056
|
}
|
|
4054
|
-
const
|
|
4055
|
-
if (
|
|
4056
|
-
|
|
4057
|
+
const f = this.domainPackToAnchor.get(JSON.stringify(a));
|
|
4058
|
+
if (f !== void 0) {
|
|
4059
|
+
r.domainAnchor = f, o = new Set(s);
|
|
4057
4060
|
break;
|
|
4058
4061
|
}
|
|
4059
4062
|
}
|
|
4060
|
-
for (const [
|
|
4061
|
-
if (
|
|
4063
|
+
for (const [s, a] of Object.entries(t.domain ?? {})) {
|
|
4064
|
+
if (o !== void 0 && o.has(s))
|
|
4062
4065
|
continue;
|
|
4063
|
-
const
|
|
4064
|
-
|
|
4066
|
+
const f = P$1(s, a), u = this.domains.get(f);
|
|
4067
|
+
r.domain ?? (r.domain = {}), r.domain[s] = u ? { anchor: u } : a;
|
|
4065
4068
|
}
|
|
4066
|
-
|
|
4067
|
-
const
|
|
4068
|
-
return this.axes.get(
|
|
4069
|
-
}), e
|
|
4069
|
+
if (r.axes = t.axesSpec.map((s) => {
|
|
4070
|
+
const a = x$1(s);
|
|
4071
|
+
return this.axes.get(a) ?? s;
|
|
4072
|
+
}), !e || e.length === 0)
|
|
4073
|
+
return r;
|
|
4074
|
+
const i = [];
|
|
4075
|
+
for (const s of e) {
|
|
4076
|
+
const [a, f] = s;
|
|
4077
|
+
if (typeof a == "number") {
|
|
4078
|
+
if (a < 0 || a >= t.axesSpec.length)
|
|
4079
|
+
throw new Error(`Axis index ${a} is out of bounds (0-${t.axesSpec.length - 1})`);
|
|
4080
|
+
i.push([a, f]);
|
|
4081
|
+
} else {
|
|
4082
|
+
const u = t.axesSpec.findIndex((d) => d.name === a);
|
|
4083
|
+
if (u === -1)
|
|
4084
|
+
throw new Error(`Axis with name "${a}" not found in the column specification`);
|
|
4085
|
+
i.push([u, f]);
|
|
4086
|
+
}
|
|
4087
|
+
}
|
|
4088
|
+
return i.sort((s, a) => s[0] - a[0]), {
|
|
4089
|
+
source: r,
|
|
4090
|
+
axisFilters: i
|
|
4091
|
+
};
|
|
4070
4092
|
}
|
|
4071
4093
|
/**
|
|
4072
4094
|
* Derives a canonicalized string representation of an anchored column identifier, can be used as a unique identifier for the column
|
|
4073
4095
|
* @param spec Column specification to anchor
|
|
4096
|
+
* @param axisFilters Optional axis filters to apply to the column
|
|
4074
4097
|
* @returns A canonicalized string representation of the anchored column identifier
|
|
4075
4098
|
*/
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
return k(e);
|
|
4099
|
+
deriveS(t, e) {
|
|
4100
|
+
return Y(this.derive(t, e));
|
|
4079
4101
|
}
|
|
4080
4102
|
}
|
|
4081
|
-
function
|
|
4103
|
+
function En(n, t) {
|
|
4082
4104
|
const e = { ...t };
|
|
4083
4105
|
if (e.domainAnchor !== void 0) {
|
|
4084
4106
|
const r = n[e.domainAnchor];
|
|
@@ -4093,19 +4115,19 @@
|
|
|
4093
4115
|
if (typeof i == "string")
|
|
4094
4116
|
r[o] = i;
|
|
4095
4117
|
else {
|
|
4096
|
-
const
|
|
4097
|
-
if (!
|
|
4118
|
+
const s = n[i.anchor];
|
|
4119
|
+
if (!s)
|
|
4098
4120
|
throw new Error(`Anchor "${i.anchor}" not found for domain key "${o}"`);
|
|
4099
|
-
if (!
|
|
4121
|
+
if (!s.domain || s.domain[o] === void 0)
|
|
4100
4122
|
throw new Error(`Domain key "${o}" not found in anchor "${i.anchor}"`);
|
|
4101
|
-
r[o] =
|
|
4123
|
+
r[o] = s.domain[o];
|
|
4102
4124
|
}
|
|
4103
4125
|
e.domain = r;
|
|
4104
4126
|
}
|
|
4105
|
-
return e.axes && (e.axes = e.axes.map((r) =>
|
|
4127
|
+
return e.axes && (e.axes = e.axes.map((r) => Z$1(n, r))), e;
|
|
4106
4128
|
}
|
|
4107
|
-
function
|
|
4108
|
-
if (!
|
|
4129
|
+
function Z$1(n, t) {
|
|
4130
|
+
if (!q(t))
|
|
4109
4131
|
return t;
|
|
4110
4132
|
const e = t.anchor, r = n[e];
|
|
4111
4133
|
if (!r)
|
|
@@ -4122,7 +4144,7 @@
|
|
|
4122
4144
|
throw new Error(`Axis with name "${t.name}" not found in anchor "${e}"`);
|
|
4123
4145
|
return o[0];
|
|
4124
4146
|
} else if ("id" in t) {
|
|
4125
|
-
const o = r.axesSpec.filter((i) =>
|
|
4147
|
+
const o = r.axesSpec.filter((i) => Q$1(t.id, p(i)));
|
|
4126
4148
|
if (o.length > 1)
|
|
4127
4149
|
throw new Error(`Multiple matching axes found for matcher in anchor "${e}"`);
|
|
4128
4150
|
if (o.length === 0)
|
|
@@ -4131,26 +4153,26 @@
|
|
|
4131
4153
|
}
|
|
4132
4154
|
throw new Error("Unsupported axis reference type");
|
|
4133
4155
|
}
|
|
4134
|
-
function
|
|
4156
|
+
function q(n) {
|
|
4135
4157
|
return typeof n == "object" && "anchor" in n;
|
|
4136
4158
|
}
|
|
4137
|
-
function
|
|
4159
|
+
function c(n) {
|
|
4138
4160
|
return n.kind === "PColumn";
|
|
4139
4161
|
}
|
|
4140
|
-
function
|
|
4141
|
-
return
|
|
4162
|
+
function v(n) {
|
|
4163
|
+
return c(n.spec);
|
|
4142
4164
|
}
|
|
4143
|
-
function
|
|
4144
|
-
if (!
|
|
4165
|
+
function Sn(n) {
|
|
4166
|
+
if (!v(n)) throw new Error(`not a PColumn (kind = ${n.spec.kind})`);
|
|
4145
4167
|
return n;
|
|
4146
4168
|
}
|
|
4147
|
-
function
|
|
4169
|
+
function Cn(n, t) {
|
|
4148
4170
|
return n === void 0 ? void 0 : {
|
|
4149
4171
|
...n,
|
|
4150
4172
|
data: t(n.data)
|
|
4151
4173
|
};
|
|
4152
4174
|
}
|
|
4153
|
-
function
|
|
4175
|
+
function $n(n) {
|
|
4154
4176
|
const t = /* @__PURE__ */ new Map(), e = (r) => {
|
|
4155
4177
|
switch (r.type) {
|
|
4156
4178
|
case "column":
|
|
@@ -4165,12 +4187,12 @@
|
|
|
4165
4187
|
for (const o of r.secondary) e(o);
|
|
4166
4188
|
return;
|
|
4167
4189
|
default:
|
|
4168
|
-
|
|
4190
|
+
w(r);
|
|
4169
4191
|
}
|
|
4170
4192
|
};
|
|
4171
4193
|
return e(n), [...t.values()];
|
|
4172
4194
|
}
|
|
4173
|
-
function
|
|
4195
|
+
function E(n, t) {
|
|
4174
4196
|
if (n.name !== void 0 && n.name !== t.name)
|
|
4175
4197
|
return false;
|
|
4176
4198
|
if (n.type !== void 0) {
|
|
@@ -4188,7 +4210,7 @@
|
|
|
4188
4210
|
}
|
|
4189
4211
|
return true;
|
|
4190
4212
|
}
|
|
4191
|
-
function
|
|
4213
|
+
function I$1(n, t) {
|
|
4192
4214
|
if (t.name !== void 0 && n.name !== t.name || t.namePattern !== void 0 && !new RegExp(t.namePattern).test(n.name))
|
|
4193
4215
|
return false;
|
|
4194
4216
|
if (t.type !== void 0) {
|
|
@@ -4205,16 +4227,16 @@
|
|
|
4205
4227
|
return false;
|
|
4206
4228
|
}
|
|
4207
4229
|
if (t.axes !== void 0) {
|
|
4208
|
-
const e = n.axesSpec.map(
|
|
4230
|
+
const e = n.axesSpec.map(p);
|
|
4209
4231
|
if (t.partialAxesMatch) {
|
|
4210
4232
|
for (const r of t.axes)
|
|
4211
|
-
if (!e.some((o) =>
|
|
4233
|
+
if (!e.some((o) => E(r, o)))
|
|
4212
4234
|
return false;
|
|
4213
4235
|
} else {
|
|
4214
4236
|
if (e.length !== t.axes.length)
|
|
4215
4237
|
return false;
|
|
4216
4238
|
for (let r = 0; r < t.axes.length; r++)
|
|
4217
|
-
if (!
|
|
4239
|
+
if (!E(t.axes[r], e[r]))
|
|
4218
4240
|
return false;
|
|
4219
4241
|
}
|
|
4220
4242
|
}
|
|
@@ -4234,72 +4256,72 @@
|
|
|
4234
4256
|
}
|
|
4235
4257
|
return true;
|
|
4236
4258
|
}
|
|
4237
|
-
function
|
|
4238
|
-
return Array.isArray(n) ? (t) => n.some((e) =>
|
|
4259
|
+
function Vn(n) {
|
|
4260
|
+
return Array.isArray(n) ? (t) => n.some((e) => c(t) && I$1(t, e)) : (t) => c(t) && I$1(t, n);
|
|
4239
4261
|
}
|
|
4240
|
-
z
|
|
4241
|
-
__isRef: z
|
|
4242
|
-
blockId: z
|
|
4243
|
-
name: z
|
|
4262
|
+
z.object({
|
|
4263
|
+
__isRef: z.literal(true).describe("Crucial marker for the block dependency tree reconstruction"),
|
|
4264
|
+
blockId: z.string().describe("Upstream block id"),
|
|
4265
|
+
name: z.string().describe("Name of the output provided to the upstream block's output context")
|
|
4244
4266
|
}).describe(
|
|
4245
4267
|
"Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees."
|
|
4246
4268
|
).strict().readonly();
|
|
4247
|
-
function
|
|
4269
|
+
function On(n) {
|
|
4248
4270
|
return typeof n == "object" && n !== null && "__isRef" in n && n.__isRef === true && "blockId" in n && "name" in n;
|
|
4249
4271
|
}
|
|
4250
|
-
function
|
|
4272
|
+
function Bn(n, t) {
|
|
4251
4273
|
return n.ok ? { ok: true, value: t(n.value) } : n;
|
|
4252
4274
|
}
|
|
4253
|
-
const
|
|
4254
|
-
z
|
|
4255
|
-
var
|
|
4256
|
-
var
|
|
4257
|
-
var
|
|
4258
|
-
function
|
|
4275
|
+
const an = 24;
|
|
4276
|
+
z.string().length(an).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
|
|
4277
|
+
var we = Object.defineProperty;
|
|
4278
|
+
var Ie = (t, e, n) => e in t ? we(t, e, { enumerable: true, configurable: true, writable: true, value: n }) : t[e] = n;
|
|
4279
|
+
var x = (t, e, n) => Ie(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4280
|
+
function W(t) {
|
|
4259
4281
|
return { type: "Immediate", value: t };
|
|
4260
4282
|
}
|
|
4261
|
-
function
|
|
4283
|
+
function ke() {
|
|
4262
4284
|
return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
|
|
4263
4285
|
}
|
|
4264
|
-
function
|
|
4286
|
+
function me(t) {
|
|
4265
4287
|
if (t && typeof globalThis.getPlatforma == "function")
|
|
4266
4288
|
return globalThis.getPlatforma(t);
|
|
4267
4289
|
if (typeof globalThis.platforma < "u") return globalThis.platforma;
|
|
4268
4290
|
throw new Error("Can't get platforma instance.");
|
|
4269
4291
|
}
|
|
4270
|
-
function
|
|
4292
|
+
function Ee() {
|
|
4271
4293
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
4272
4294
|
}
|
|
4273
|
-
function
|
|
4295
|
+
function g() {
|
|
4274
4296
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
4275
4297
|
throw new Error("Not in config rendering context");
|
|
4276
4298
|
}
|
|
4277
|
-
function
|
|
4278
|
-
const n =
|
|
4299
|
+
function $(t, e) {
|
|
4300
|
+
const n = Ee();
|
|
4279
4301
|
if (n === void 0) return false;
|
|
4280
4302
|
if (t in n.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
|
|
4281
4303
|
return n.callbackRegistry[t] = e, true;
|
|
4282
4304
|
}
|
|
4283
|
-
const
|
|
4284
|
-
function
|
|
4285
|
-
t in
|
|
4286
|
-
for (const s of
|
|
4305
|
+
const X = /* @__PURE__ */ new Map();
|
|
4306
|
+
function Oe(t, e) {
|
|
4307
|
+
t in g().callbackRegistry || (g().callbackRegistry[t] = (n) => {
|
|
4308
|
+
for (const s of X.get(t))
|
|
4287
4309
|
s(n);
|
|
4288
|
-
},
|
|
4310
|
+
}, X.set(t, [])), X.get(t).push(e);
|
|
4289
4311
|
}
|
|
4290
|
-
class
|
|
4312
|
+
class S {
|
|
4291
4313
|
constructor(e, n = (s) => s) {
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
this.handle = e, this.postProcess = n,
|
|
4314
|
+
x(this, "isResolved", false);
|
|
4315
|
+
x(this, "resolvedValue");
|
|
4316
|
+
this.handle = e, this.postProcess = n, Oe(e, (s) => {
|
|
4295
4317
|
this.resolvedValue = n(s), this.isResolved = true;
|
|
4296
4318
|
});
|
|
4297
4319
|
}
|
|
4298
4320
|
map(e) {
|
|
4299
|
-
return new
|
|
4321
|
+
return new S(this.handle, (n) => e(this.postProcess(n)));
|
|
4300
4322
|
}
|
|
4301
4323
|
mapDefined(e) {
|
|
4302
|
-
return new
|
|
4324
|
+
return new S(this.handle, (n) => {
|
|
4303
4325
|
const s = this.postProcess(n);
|
|
4304
4326
|
return s ? e(s) : void 0;
|
|
4305
4327
|
});
|
|
@@ -4308,10 +4330,10 @@
|
|
|
4308
4330
|
return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
|
|
4309
4331
|
}
|
|
4310
4332
|
}
|
|
4311
|
-
function
|
|
4333
|
+
function se(t, e) {
|
|
4312
4334
|
return t === void 0 ? void 0 : e(t);
|
|
4313
4335
|
}
|
|
4314
|
-
class
|
|
4336
|
+
class I {
|
|
4315
4337
|
constructor(e, n) {
|
|
4316
4338
|
this.handle = e, this.resolvePath = n;
|
|
4317
4339
|
}
|
|
@@ -4348,49 +4370,49 @@
|
|
|
4348
4370
|
resolveWithCommon(e, ...n) {
|
|
4349
4371
|
const s = [
|
|
4350
4372
|
...this.resolvePath,
|
|
4351
|
-
...n.map((
|
|
4373
|
+
...n.map((i) => typeof i == "string" ? i : i.field)
|
|
4352
4374
|
];
|
|
4353
|
-
return
|
|
4354
|
-
|
|
4355
|
-
(
|
|
4375
|
+
return se(
|
|
4376
|
+
g().resolveWithCommon(this.handle, e, ...n),
|
|
4377
|
+
(i) => new I(i, s)
|
|
4356
4378
|
);
|
|
4357
4379
|
}
|
|
4358
4380
|
get resourceType() {
|
|
4359
|
-
return
|
|
4381
|
+
return g().getResourceType(this.handle);
|
|
4360
4382
|
}
|
|
4361
4383
|
getInputsLocked() {
|
|
4362
|
-
return
|
|
4384
|
+
return g().getInputsLocked(this.handle);
|
|
4363
4385
|
}
|
|
4364
4386
|
getOutputsLocked() {
|
|
4365
|
-
return
|
|
4387
|
+
return g().getOutputsLocked(this.handle);
|
|
4366
4388
|
}
|
|
4367
4389
|
getIsReadyOrError() {
|
|
4368
|
-
return
|
|
4390
|
+
return g().getIsReadyOrError(this.handle);
|
|
4369
4391
|
}
|
|
4370
4392
|
getIsFinal() {
|
|
4371
|
-
return
|
|
4393
|
+
return g().getIsFinal(this.handle);
|
|
4372
4394
|
}
|
|
4373
4395
|
getError() {
|
|
4374
4396
|
const e = [...this.resolvePath, "error"];
|
|
4375
|
-
return
|
|
4376
|
-
|
|
4377
|
-
(n) => new
|
|
4397
|
+
return se(
|
|
4398
|
+
g().getError(this.handle),
|
|
4399
|
+
(n) => new I(n, e)
|
|
4378
4400
|
);
|
|
4379
4401
|
}
|
|
4380
4402
|
listInputFields() {
|
|
4381
|
-
return
|
|
4403
|
+
return g().listInputFields(this.handle);
|
|
4382
4404
|
}
|
|
4383
4405
|
listOutputFields() {
|
|
4384
|
-
return
|
|
4406
|
+
return g().listOutputFields(this.handle);
|
|
4385
4407
|
}
|
|
4386
4408
|
listDynamicFields() {
|
|
4387
|
-
return
|
|
4409
|
+
return g().listDynamicFields(this.handle);
|
|
4388
4410
|
}
|
|
4389
4411
|
getKeyValueBase64(e) {
|
|
4390
|
-
return
|
|
4412
|
+
return g().getKeyValueBase64(this.handle, e);
|
|
4391
4413
|
}
|
|
4392
4414
|
getKeyValueAsString(e) {
|
|
4393
|
-
return
|
|
4415
|
+
return g().getKeyValueAsString(this.handle, e);
|
|
4394
4416
|
}
|
|
4395
4417
|
getKeyValueAsJson(e) {
|
|
4396
4418
|
const n = this.getKeyValueAsString(e);
|
|
@@ -4398,10 +4420,10 @@
|
|
|
4398
4420
|
return JSON.parse(n);
|
|
4399
4421
|
}
|
|
4400
4422
|
getDataBase64() {
|
|
4401
|
-
return
|
|
4423
|
+
return g().getDataBase64(this.handle);
|
|
4402
4424
|
}
|
|
4403
4425
|
getDataAsString() {
|
|
4404
|
-
return
|
|
4426
|
+
return g().getDataAsString(this.handle);
|
|
4405
4427
|
}
|
|
4406
4428
|
getDataAsJson() {
|
|
4407
4429
|
const e = this.getDataAsString();
|
|
@@ -4413,38 +4435,38 @@
|
|
|
4413
4435
|
*/
|
|
4414
4436
|
getPColumns(e = false, n = "") {
|
|
4415
4437
|
const s = this.parsePObjectCollection(e, n);
|
|
4416
|
-
return s === void 0 ? void 0 : Object.entries(s).map(([,
|
|
4417
|
-
if (!
|
|
4418
|
-
return
|
|
4438
|
+
return s === void 0 ? void 0 : Object.entries(s).map(([, r]) => {
|
|
4439
|
+
if (!v(r)) throw new Error(`not a PColumn (kind = ${r.spec.kind})`);
|
|
4440
|
+
return r;
|
|
4419
4441
|
});
|
|
4420
4442
|
}
|
|
4421
4443
|
/**
|
|
4422
4444
|
*
|
|
4423
4445
|
*/
|
|
4424
4446
|
parsePObjectCollection(e = false, n = "") {
|
|
4425
|
-
const s =
|
|
4447
|
+
const s = g().parsePObjectCollection(
|
|
4426
4448
|
this.handle,
|
|
4427
4449
|
e,
|
|
4428
4450
|
n,
|
|
4429
4451
|
...this.resolvePath
|
|
4430
4452
|
);
|
|
4431
4453
|
if (s === void 0) return;
|
|
4432
|
-
const
|
|
4433
|
-
for (const [
|
|
4434
|
-
const
|
|
4435
|
-
r
|
|
4454
|
+
const i = {};
|
|
4455
|
+
for (const [r, o] of Object.entries(s)) {
|
|
4456
|
+
const u = [...this.resolvePath, r];
|
|
4457
|
+
i[r] = Cn(o, (c2) => new I(c2, u));
|
|
4436
4458
|
}
|
|
4437
|
-
return
|
|
4459
|
+
return i;
|
|
4438
4460
|
}
|
|
4439
4461
|
getFileContentAsBase64() {
|
|
4440
|
-
return new
|
|
4462
|
+
return new S(g().getBlobContentAsBase64(this.handle));
|
|
4441
4463
|
}
|
|
4442
4464
|
getFileContentAsString() {
|
|
4443
|
-
return new
|
|
4465
|
+
return new S(g().getBlobContentAsString(this.handle));
|
|
4444
4466
|
}
|
|
4445
4467
|
getFileContentAsJson() {
|
|
4446
|
-
return new
|
|
4447
|
-
|
|
4468
|
+
return new S(
|
|
4469
|
+
g().getBlobContentAsString(this.handle)
|
|
4448
4470
|
).mapDefined((e) => JSON.parse(e));
|
|
4449
4471
|
}
|
|
4450
4472
|
/**
|
|
@@ -4463,7 +4485,7 @@
|
|
|
4463
4485
|
* @returns downloaded file handle
|
|
4464
4486
|
*/
|
|
4465
4487
|
getFileHandle() {
|
|
4466
|
-
return new
|
|
4488
|
+
return new S(g().getDownloadedBlobContentHandle(this.handle));
|
|
4467
4489
|
}
|
|
4468
4490
|
/**
|
|
4469
4491
|
* @deprecated use getFileHandle
|
|
@@ -4475,7 +4497,7 @@
|
|
|
4475
4497
|
* @returns downloaded file handle
|
|
4476
4498
|
*/
|
|
4477
4499
|
getRemoteFileHandle() {
|
|
4478
|
-
return new
|
|
4500
|
+
return new S(g().getOnDemandBlobContentHandle(this.handle));
|
|
4479
4501
|
}
|
|
4480
4502
|
/**
|
|
4481
4503
|
* @deprecated use getRemoteFileHandle
|
|
@@ -4487,22 +4509,22 @@
|
|
|
4487
4509
|
* @returns the url to the extracted folder
|
|
4488
4510
|
*/
|
|
4489
4511
|
extractArchiveAndGetURL(e) {
|
|
4490
|
-
return new
|
|
4512
|
+
return new S(g().extractArchiveAndGetURL(this.handle, e));
|
|
4491
4513
|
}
|
|
4492
4514
|
getImportProgress() {
|
|
4493
|
-
return new
|
|
4515
|
+
return new S(g().getImportProgress(this.handle));
|
|
4494
4516
|
}
|
|
4495
4517
|
getLastLogs(e) {
|
|
4496
|
-
return new
|
|
4518
|
+
return new S(g().getLastLogs(this.handle, e));
|
|
4497
4519
|
}
|
|
4498
4520
|
getProgressLog(e) {
|
|
4499
|
-
return new
|
|
4521
|
+
return new S(g().getProgressLog(this.handle, e));
|
|
4500
4522
|
}
|
|
4501
4523
|
getProgressLogWithInfo(e) {
|
|
4502
|
-
return new
|
|
4524
|
+
return new S(g().getProgressLogWithInfo(this.handle, e));
|
|
4503
4525
|
}
|
|
4504
4526
|
getLogHandle() {
|
|
4505
|
-
return new
|
|
4527
|
+
return new S(g().getLogHandle(this.handle));
|
|
4506
4528
|
}
|
|
4507
4529
|
allFieldsResolved(e = "Input") {
|
|
4508
4530
|
switch (e) {
|
|
@@ -4517,85 +4539,175 @@
|
|
|
4517
4539
|
}
|
|
4518
4540
|
}
|
|
4519
4541
|
mapFields(e, n) {
|
|
4520
|
-
const { fieldType: s, requireLocked:
|
|
4542
|
+
const { fieldType: s, requireLocked: i, skipUnresolved: r } = {
|
|
4521
4543
|
fieldType: "Input",
|
|
4522
4544
|
requireLocked: true,
|
|
4523
4545
|
skipUnresolved: false,
|
|
4524
4546
|
...n
|
|
4525
4547
|
}, o = e;
|
|
4526
|
-
if (
|
|
4548
|
+
if (i && (s === "Input" && !this.getInputsLocked() || s === "Output" && !this.getOutputsLocked()))
|
|
4527
4549
|
return;
|
|
4528
|
-
let
|
|
4529
|
-
(
|
|
4550
|
+
let c2 = (s === "Input" ? this.listInputFields() : s === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
|
|
4551
|
+
(a) => [a, this.resolve({ field: a, assertFieldType: s })]
|
|
4530
4552
|
);
|
|
4531
|
-
return
|
|
4553
|
+
return r && (c2 = c2.filter((a) => a[1] !== void 0)), c2.map(([a, h2]) => o(a, h2));
|
|
4532
4554
|
}
|
|
4533
4555
|
}
|
|
4534
|
-
const
|
|
4535
|
-
const
|
|
4536
|
-
type: z
|
|
4537
|
-
importance: z
|
|
4538
|
-
id: z
|
|
4539
|
-
label: z
|
|
4540
|
-
}),
|
|
4541
|
-
function
|
|
4542
|
-
const s = /* @__PURE__ */ new Map(),
|
|
4543
|
-
var
|
|
4544
|
-
const
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4556
|
+
const ye = "staging", be = "main";
|
|
4557
|
+
const Ne = "pl7.app/label", Ue = "pl7.app/trace", Be = z.object({
|
|
4558
|
+
type: z.string(),
|
|
4559
|
+
importance: z.number().optional(),
|
|
4560
|
+
id: z.string().optional(),
|
|
4561
|
+
label: z.string()
|
|
4562
|
+
}), Me = z.array(Be), Je = 1e-3, $e = "__LABEL__", ue = "__LABEL__@1";
|
|
4563
|
+
function Q(t, e, n = {}) {
|
|
4564
|
+
const s = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), r = t.map((l) => {
|
|
4565
|
+
var F2, M;
|
|
4566
|
+
const f = e(l);
|
|
4567
|
+
let d, y, _;
|
|
4568
|
+
"spec" in f && typeof f.spec == "object" ? (d = f.spec, y = f.prefixTrace, _ = f.suffixTrace) : d = f;
|
|
4569
|
+
const A = (F2 = d.annotations) == null ? void 0 : F2[Ne], v2 = (M = d.annotations) == null ? void 0 : M[Ue], m2 = (v2 ? Me.safeParse(JSON.parse(v2)).data : void 0) ?? [], w2 = [
|
|
4570
|
+
...y ?? [],
|
|
4571
|
+
...m2,
|
|
4572
|
+
..._ ?? []
|
|
4573
|
+
];
|
|
4574
|
+
if (A) {
|
|
4575
|
+
const C = { label: A, type: $e, importance: -2 };
|
|
4576
|
+
n.addLabelAsSuffix ? w2.push(C) : w2.splice(0, 0, C);
|
|
4548
4577
|
}
|
|
4549
|
-
const
|
|
4550
|
-
for (let C =
|
|
4551
|
-
const { type:
|
|
4552
|
-
|
|
4553
|
-
const
|
|
4554
|
-
|
|
4555
|
-
|
|
4578
|
+
const L = [], R = /* @__PURE__ */ new Map();
|
|
4579
|
+
for (let C = w2.length - 1; C >= 0; --C) {
|
|
4580
|
+
const { type: D } = w2[C], q2 = w2[C].importance ?? 0, z2 = (R.get(D) ?? 0) + 1;
|
|
4581
|
+
R.set(D, z2);
|
|
4582
|
+
const O = `${D}@${z2}`;
|
|
4583
|
+
i.set(O, (i.get(O) ?? 0) + 1), s.set(
|
|
4584
|
+
O,
|
|
4556
4585
|
Math.max(
|
|
4557
|
-
s.get(
|
|
4558
|
-
|
|
4586
|
+
s.get(O) ?? Number.NEGATIVE_INFINITY,
|
|
4587
|
+
q2 - (w2.length - C) * Je
|
|
4559
4588
|
)
|
|
4560
|
-
),
|
|
4589
|
+
), L.push({ ...w2[C], fullType: O, occurenceIndex: z2 });
|
|
4561
4590
|
}
|
|
4562
|
-
return
|
|
4563
|
-
value:
|
|
4564
|
-
spec:
|
|
4565
|
-
label:
|
|
4566
|
-
fullTrace:
|
|
4591
|
+
return L.reverse(), {
|
|
4592
|
+
value: l,
|
|
4593
|
+
spec: d,
|
|
4594
|
+
label: A,
|
|
4595
|
+
fullTrace: L
|
|
4567
4596
|
};
|
|
4568
|
-
}), o = [],
|
|
4569
|
-
|
|
4570
|
-
for (const [
|
|
4571
|
-
|
|
4572
|
-
const
|
|
4573
|
-
const
|
|
4597
|
+
}), o = [], u = [], c2 = [...s];
|
|
4598
|
+
c2.sort(([, l], [, f]) => f - l);
|
|
4599
|
+
for (const [l] of c2)
|
|
4600
|
+
l.endsWith("@1") || i.get(l) === t.length ? o.push(l) : u.push(l);
|
|
4601
|
+
const a = (l) => r.map((f) => {
|
|
4602
|
+
const d = f.fullTrace.filter((_) => l.has(_.fullType)).map((_) => _.label), y = n.separator ?? " / ";
|
|
4574
4603
|
return {
|
|
4575
|
-
label:
|
|
4576
|
-
value:
|
|
4604
|
+
label: d.join(y),
|
|
4605
|
+
value: f.value
|
|
4577
4606
|
};
|
|
4578
4607
|
});
|
|
4579
4608
|
if (o.length === 0) {
|
|
4580
|
-
if (
|
|
4581
|
-
return
|
|
4582
|
-
}
|
|
4583
|
-
let
|
|
4584
|
-
for (;
|
|
4585
|
-
const
|
|
4586
|
-
n.includeNativeLabel &&
|
|
4587
|
-
for (let
|
|
4588
|
-
|
|
4589
|
-
const
|
|
4590
|
-
if (new Set(
|
|
4591
|
-
|
|
4592
|
-
}
|
|
4593
|
-
return
|
|
4609
|
+
if (u.length !== 0) throw new Error("Assertion error.");
|
|
4610
|
+
return a(new Set(ue));
|
|
4611
|
+
}
|
|
4612
|
+
let h2 = 0, p2 = 0;
|
|
4613
|
+
for (; h2 < o.length; ) {
|
|
4614
|
+
const l = /* @__PURE__ */ new Set();
|
|
4615
|
+
n.includeNativeLabel && l.add(ue);
|
|
4616
|
+
for (let d = 0; d < h2; ++d) l.add(o[d]);
|
|
4617
|
+
l.add(o[p2]);
|
|
4618
|
+
const f = a(l);
|
|
4619
|
+
if (new Set(f.map((d) => d.label)).size === t.length) return f;
|
|
4620
|
+
p2++, p2 == o.length && (h2++, p2 = h2);
|
|
4621
|
+
}
|
|
4622
|
+
return a(/* @__PURE__ */ new Set([...o, ...u]));
|
|
4594
4623
|
}
|
|
4595
|
-
|
|
4624
|
+
const B = "PColumnData/", re = B + "ResourceMap", oe = B + "Partitioned/ResourceMap", ce = B + "JsonPartitioned", Z = B + "BinaryPartitioned", _e = B + "Partitioned/", pe = _e + "JsonPartitioned", ee = _e + "BinaryPartitioned";
|
|
4625
|
+
const de = (t) => {
|
|
4626
|
+
if (!t.endsWith(".index")) {
|
|
4627
|
+
if (t.endsWith(".values"))
|
|
4628
|
+
return t.substring(0, t.length - 7);
|
|
4629
|
+
throw Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
|
|
4630
|
+
}
|
|
4631
|
+
};
|
|
4632
|
+
function Ge(t) {
|
|
4633
|
+
if (!t) return;
|
|
4634
|
+
const e = t.resourceType.name, n = t.getDataAsJson(), s = [];
|
|
4635
|
+
let i = 0;
|
|
4636
|
+
switch (e) {
|
|
4637
|
+
case re:
|
|
4638
|
+
i = n.keyLength;
|
|
4639
|
+
break;
|
|
4640
|
+
case oe:
|
|
4641
|
+
i = n.partitionKeyLength + n.keyLength;
|
|
4642
|
+
break;
|
|
4643
|
+
case ce:
|
|
4644
|
+
case Z:
|
|
4645
|
+
i = n.partitionKeyLength;
|
|
4646
|
+
break;
|
|
4647
|
+
case ee:
|
|
4648
|
+
case pe:
|
|
4649
|
+
i = n.superPartitionKeyLength + n.partitionKeyLength;
|
|
4650
|
+
break;
|
|
4651
|
+
}
|
|
4652
|
+
switch (e) {
|
|
4653
|
+
case re:
|
|
4654
|
+
case ce:
|
|
4655
|
+
case Z:
|
|
4656
|
+
for (let r of t.listInputFields()) {
|
|
4657
|
+
if (e === Z) {
|
|
4658
|
+
const u = de(r);
|
|
4659
|
+
if (u) r = u;
|
|
4660
|
+
else continue;
|
|
4661
|
+
}
|
|
4662
|
+
const o = [...JSON.parse(r)];
|
|
4663
|
+
s.push(o);
|
|
4664
|
+
}
|
|
4665
|
+
break;
|
|
4666
|
+
case oe:
|
|
4667
|
+
case ee:
|
|
4668
|
+
case pe:
|
|
4669
|
+
for (const r of t.listInputFields()) {
|
|
4670
|
+
const o = [...JSON.parse(r)], u = t.resolve({ field: r, assertFieldType: "Input" });
|
|
4671
|
+
if (u !== void 0)
|
|
4672
|
+
for (let c2 of u.listInputFields()) {
|
|
4673
|
+
if (e === ee) {
|
|
4674
|
+
const h2 = de(c2);
|
|
4675
|
+
if (h2) c2 = h2;
|
|
4676
|
+
else continue;
|
|
4677
|
+
}
|
|
4678
|
+
const a = [...o, ...JSON.parse(c2)];
|
|
4679
|
+
s.push(a);
|
|
4680
|
+
}
|
|
4681
|
+
}
|
|
4682
|
+
break;
|
|
4683
|
+
}
|
|
4684
|
+
return { data: s, keyLength: i };
|
|
4685
|
+
}
|
|
4686
|
+
function We(t) {
|
|
4687
|
+
const e = Ge(t);
|
|
4688
|
+
if (!e) return;
|
|
4689
|
+
const { data: n, keyLength: s } = e, i = [];
|
|
4690
|
+
for (let r = 0; r < s; ++r)
|
|
4691
|
+
i.push(/* @__PURE__ */ new Set());
|
|
4692
|
+
for (const r of n) {
|
|
4693
|
+
if (r.length !== s)
|
|
4694
|
+
throw new Error("key length does not match partition length");
|
|
4695
|
+
for (let o = 0; o < s; ++o)
|
|
4696
|
+
i[o].add(r[o]);
|
|
4697
|
+
}
|
|
4698
|
+
return i.map((r) => Array.from(r.values()));
|
|
4699
|
+
}
|
|
4700
|
+
function te(t, e) {
|
|
4701
|
+
if (t === void 0) return e === void 0;
|
|
4702
|
+
if (e === void 0) return true;
|
|
4703
|
+
for (const n in e)
|
|
4704
|
+
if (t[n] !== e[n]) return false;
|
|
4705
|
+
return true;
|
|
4706
|
+
}
|
|
4707
|
+
class Ke {
|
|
4596
4708
|
constructor() {
|
|
4597
|
-
|
|
4598
|
-
|
|
4709
|
+
x(this, "ctx", g());
|
|
4710
|
+
x(this, "defaultLabelFn", (e, n) => {
|
|
4599
4711
|
var s;
|
|
4600
4712
|
return ((s = e.annotations) == null ? void 0 : s["pl7.app/label"]) ?? "Unlabelled";
|
|
4601
4713
|
});
|
|
@@ -4607,33 +4719,85 @@
|
|
|
4607
4719
|
return this.ctx.calculateOptions(e);
|
|
4608
4720
|
}
|
|
4609
4721
|
getOptions(e, n) {
|
|
4610
|
-
const s = typeof e == "function" ? e :
|
|
4611
|
-
return typeof n == "object" || typeof n > "u" ?
|
|
4612
|
-
ref:
|
|
4722
|
+
const s = typeof e == "function" ? e : Vn(e), i = this.getSpecs().entries.filter((r) => s(r.obj));
|
|
4723
|
+
return typeof n == "object" || typeof n > "u" ? Q(i, (r) => r.obj, n ?? {}).map(({ value: { ref: r }, label: o }) => ({
|
|
4724
|
+
ref: r,
|
|
4613
4725
|
label: o
|
|
4614
|
-
})) :
|
|
4615
|
-
ref:
|
|
4616
|
-
label: n(
|
|
4726
|
+
})) : i.map((r) => ({
|
|
4727
|
+
ref: r.ref,
|
|
4728
|
+
label: n(r.obj, r.ref)
|
|
4617
4729
|
}));
|
|
4618
4730
|
}
|
|
4619
4731
|
// Implementation
|
|
4620
4732
|
getCanonicalOptions(e, n, s) {
|
|
4621
|
-
const
|
|
4622
|
-
if (!(e instanceof
|
|
4623
|
-
for (const [a,
|
|
4624
|
-
if (
|
|
4625
|
-
const
|
|
4626
|
-
if (!
|
|
4733
|
+
const i = {};
|
|
4734
|
+
if (!(e instanceof Pn))
|
|
4735
|
+
for (const [a, h2] of Object.entries(e))
|
|
4736
|
+
if (On(h2)) {
|
|
4737
|
+
const p2 = this.getPColumnSpecByRef(h2);
|
|
4738
|
+
if (!p2)
|
|
4627
4739
|
return;
|
|
4628
|
-
|
|
4740
|
+
i[a] = p2;
|
|
4629
4741
|
} else
|
|
4630
|
-
|
|
4631
|
-
const
|
|
4632
|
-
Array.isArray(n) ? n.map((a) =>
|
|
4633
|
-
), o = this.getSpecs().entries.filter(({ obj: a }) =>
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4742
|
+
i[a] = h2;
|
|
4743
|
+
const r = typeof n == "function" ? n : Vn(
|
|
4744
|
+
Array.isArray(n) ? n.map((a) => En(i, a)) : En(i, n)
|
|
4745
|
+
), o = this.getSpecs().entries.filter(({ obj: a }) => c(a) ? r(a) : false);
|
|
4746
|
+
if (o.length === 0)
|
|
4747
|
+
return [];
|
|
4748
|
+
const u = e instanceof Pn ? e : new Pn(i), c$1 = typeof n == "object" && !Array.isArray(n) && "axes" in n && n.axes !== void 0 && n.partialAxesMatch === void 0 ? n.axes.map((a, h2) => "split" in a && a.split === true ? h2 : -1).filter((a) => a !== -1) : [];
|
|
4749
|
+
if (c$1.sort((a, h2) => a - h2), c$1.length > 0) {
|
|
4750
|
+
const a = [], h2 = c$1[c$1.length - 1];
|
|
4751
|
+
for (const { ref: l, obj: f } of o) {
|
|
4752
|
+
if (!c(f)) continue;
|
|
4753
|
+
const d = this.getDataByRef(l);
|
|
4754
|
+
if (!d || !v(d)) continue;
|
|
4755
|
+
const y = We(d.data);
|
|
4756
|
+
if (!y) continue;
|
|
4757
|
+
if (h2 >= y.length)
|
|
4758
|
+
throw new Error(`Not enough partition keys for the requested split axes in column ${f.name}`);
|
|
4759
|
+
const _ = c$1.map((m2) => this.findLabels(p(f.axesSpec[m2]))), A = [], v$1 = (m2, w2) => {
|
|
4760
|
+
if (w2 >= c$1.length) {
|
|
4761
|
+
A.push([...m2]);
|
|
4762
|
+
return;
|
|
4763
|
+
}
|
|
4764
|
+
const L = c$1[w2], R = y[L];
|
|
4765
|
+
for (const F2 of R)
|
|
4766
|
+
m2.push(F2), v$1(m2, w2 + 1), m2.pop();
|
|
4767
|
+
};
|
|
4768
|
+
v$1([], 0);
|
|
4769
|
+
for (const m2 of A) {
|
|
4770
|
+
const w2 = m2.map((R, F2) => {
|
|
4771
|
+
const M = c$1[F2], C = wn(p(f.axesSpec[M])), D = _[F2], q2 = (D == null ? void 0 : D[R]) ?? String(R);
|
|
4772
|
+
return {
|
|
4773
|
+
type: `split:${C}`,
|
|
4774
|
+
label: q2,
|
|
4775
|
+
importance: 1e6
|
|
4776
|
+
};
|
|
4777
|
+
}), L = c$1.map((R, F2) => [R, m2[F2]]);
|
|
4778
|
+
a.push({
|
|
4779
|
+
obj: f,
|
|
4780
|
+
ref: l,
|
|
4781
|
+
filteringTrace: w2,
|
|
4782
|
+
filters: L
|
|
4783
|
+
});
|
|
4784
|
+
}
|
|
4785
|
+
}
|
|
4786
|
+
return Q(
|
|
4787
|
+
a,
|
|
4788
|
+
(l) => ({
|
|
4789
|
+
spec: l.obj,
|
|
4790
|
+
suffixTrace: l.filteringTrace
|
|
4791
|
+
}),
|
|
4792
|
+
s ?? {}
|
|
4793
|
+
).map((l) => ({
|
|
4794
|
+
value: u.deriveS(l.value.obj, l.value.filters),
|
|
4795
|
+
label: l.label
|
|
4796
|
+
}));
|
|
4797
|
+
}
|
|
4798
|
+
return Q(o, (a) => a.obj, s ?? {}).map(({ value: { obj: a }, label: h2 }) => ({
|
|
4799
|
+
value: u.deriveS(a),
|
|
4800
|
+
label: h2
|
|
4637
4801
|
}));
|
|
4638
4802
|
}
|
|
4639
4803
|
/**
|
|
@@ -4650,7 +4814,7 @@
|
|
|
4650
4814
|
ref: n.ref,
|
|
4651
4815
|
obj: {
|
|
4652
4816
|
...n.obj,
|
|
4653
|
-
data: new
|
|
4817
|
+
data: new I(n.obj.data, [n.ref.blockId, n.ref.name])
|
|
4654
4818
|
}
|
|
4655
4819
|
}))
|
|
4656
4820
|
};
|
|
@@ -4669,9 +4833,9 @@
|
|
|
4669
4833
|
ref: n.ref,
|
|
4670
4834
|
obj: {
|
|
4671
4835
|
...n.obj,
|
|
4672
|
-
data:
|
|
4836
|
+
data: Bn(
|
|
4673
4837
|
n.obj.data,
|
|
4674
|
-
(s) => new
|
|
4838
|
+
(s) => new I(s, [n.ref.blockId, n.ref.name])
|
|
4675
4839
|
)
|
|
4676
4840
|
}
|
|
4677
4841
|
}))
|
|
@@ -4694,9 +4858,9 @@
|
|
|
4694
4858
|
var n;
|
|
4695
4859
|
return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (n = this.getData().entries.find(
|
|
4696
4860
|
(s) => s.ref.blockId === e.blockId && s.ref.name === e.name
|
|
4697
|
-
)) == null ? void 0 : n.obj :
|
|
4861
|
+
)) == null ? void 0 : n.obj : Cn(
|
|
4698
4862
|
this.ctx.getDataFromResultPoolByRef(e.blockId, e.name),
|
|
4699
|
-
(s) => new
|
|
4863
|
+
(s) => new I(s, [e.blockId, e.name])
|
|
4700
4864
|
);
|
|
4701
4865
|
}
|
|
4702
4866
|
/**
|
|
@@ -4707,7 +4871,7 @@
|
|
|
4707
4871
|
getPColumnByRef(e) {
|
|
4708
4872
|
const n = this.getDataByRef(e);
|
|
4709
4873
|
if (n)
|
|
4710
|
-
return
|
|
4874
|
+
return Sn(n);
|
|
4711
4875
|
}
|
|
4712
4876
|
/**
|
|
4713
4877
|
* Returns spec associated with the ref ensuring that it is a p-column spec.
|
|
@@ -4717,7 +4881,7 @@
|
|
|
4717
4881
|
getPColumnSpecByRef(e) {
|
|
4718
4882
|
const n = this.getSpecByRef(e);
|
|
4719
4883
|
if (n) {
|
|
4720
|
-
if (!
|
|
4884
|
+
if (!c(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
|
|
4721
4885
|
return n;
|
|
4722
4886
|
}
|
|
4723
4887
|
}
|
|
@@ -4736,13 +4900,13 @@
|
|
|
4736
4900
|
findDataWithCompatibleSpec(e) {
|
|
4737
4901
|
const n = [];
|
|
4738
4902
|
e: for (const s of this.getData().entries) {
|
|
4739
|
-
if (!
|
|
4903
|
+
if (!c(s.obj.spec))
|
|
4740
4904
|
continue;
|
|
4741
|
-
const
|
|
4742
|
-
if (e.name ===
|
|
4743
|
-
for (let
|
|
4744
|
-
const o = e.axesSpec[
|
|
4745
|
-
if (o.name !==
|
|
4905
|
+
const i = s.obj.spec;
|
|
4906
|
+
if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && te(e.domain, i.domain)) {
|
|
4907
|
+
for (let r = 0; r < e.axesSpec.length; ++r) {
|
|
4908
|
+
const o = e.axesSpec[r], u = i.axesSpec[r];
|
|
4909
|
+
if (o.name !== u.name || o.type !== u.type || !te(o.domain, u.domain))
|
|
4746
4910
|
continue e;
|
|
4747
4911
|
}
|
|
4748
4912
|
n.push(s.obj);
|
|
@@ -4750,22 +4914,35 @@
|
|
|
4750
4914
|
}
|
|
4751
4915
|
return n;
|
|
4752
4916
|
}
|
|
4917
|
+
/**
|
|
4918
|
+
* Find labels data for a given axis id. It will search for a label column and return its data as a map.
|
|
4919
|
+
* @returns a map of axis value => label
|
|
4920
|
+
*/
|
|
4921
|
+
findLabels(e) {
|
|
4922
|
+
const n = this.getData();
|
|
4923
|
+
for (const s of n.entries) {
|
|
4924
|
+
if (!v(s.obj)) continue;
|
|
4925
|
+
const i = s.obj.spec;
|
|
4926
|
+
if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && te(e.domain, i.axesSpec[0].domain)) {
|
|
4927
|
+
if (s.obj.data.resourceType.name !== "PColumnData/Json")
|
|
4928
|
+
throw Error(`Expected JSON column for labels, got: ${s.obj.data.resourceType.name}`);
|
|
4929
|
+
return Object.fromEntries(
|
|
4930
|
+
Object.entries(
|
|
4931
|
+
s.obj.data.getDataAsJson().data
|
|
4932
|
+
).map((o) => [JSON.parse(o[0])[0], o[1]])
|
|
4933
|
+
);
|
|
4934
|
+
}
|
|
4935
|
+
}
|
|
4936
|
+
}
|
|
4753
4937
|
}
|
|
4754
|
-
|
|
4755
|
-
if (t === void 0) return e === void 0;
|
|
4756
|
-
if (e === void 0) return true;
|
|
4757
|
-
for (const n in e)
|
|
4758
|
-
if (t[n] !== e[n]) return false;
|
|
4759
|
-
return true;
|
|
4760
|
-
}
|
|
4761
|
-
class V {
|
|
4938
|
+
class G {
|
|
4762
4939
|
constructor() {
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
this.ctx =
|
|
4940
|
+
x(this, "ctx");
|
|
4941
|
+
x(this, "args");
|
|
4942
|
+
x(this, "uiState");
|
|
4943
|
+
x(this, "_activeArgsCache");
|
|
4944
|
+
x(this, "resultPool", new Ke());
|
|
4945
|
+
this.ctx = g(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
|
|
4769
4946
|
}
|
|
4770
4947
|
/**
|
|
4771
4948
|
* Returns args snapshot the block was executed for (i.e. when "Run" button was pressed).
|
|
@@ -4781,45 +4958,33 @@
|
|
|
4781
4958
|
// return this.ctx.featureFlags;
|
|
4782
4959
|
// }
|
|
4783
4960
|
getNamedAccessor(e) {
|
|
4784
|
-
return
|
|
4961
|
+
return se(
|
|
4785
4962
|
this.ctx.getAccessorHandleByName(e),
|
|
4786
|
-
(n) => new
|
|
4963
|
+
(n) => new I(n, [e])
|
|
4787
4964
|
);
|
|
4788
4965
|
}
|
|
4789
4966
|
get prerun() {
|
|
4790
|
-
return this.getNamedAccessor(
|
|
4967
|
+
return this.getNamedAccessor(ye);
|
|
4791
4968
|
}
|
|
4792
4969
|
get outputs() {
|
|
4793
|
-
return this.getNamedAccessor(
|
|
4970
|
+
return this.getNamedAccessor(be);
|
|
4794
4971
|
}
|
|
4795
4972
|
/**
|
|
4796
4973
|
* Find labels data for a given axis id. It will search for a label column and return its data as a map.
|
|
4797
4974
|
* @returns a map of axis value => label
|
|
4975
|
+
* @deprecated Use resultPool.findLabels instead
|
|
4798
4976
|
*/
|
|
4799
4977
|
findLabels(e) {
|
|
4800
|
-
|
|
4801
|
-
for (const s of n.entries) {
|
|
4802
|
-
if (!q$1(s.obj)) continue;
|
|
4803
|
-
const r = s.obj.spec;
|
|
4804
|
-
if (r.name === "pl7.app/label" && r.axesSpec.length === 1 && r.axesSpec[0].name === e.name && r.axesSpec[0].type === e.type && X(e.domain, r.axesSpec[0].domain)) {
|
|
4805
|
-
if (s.obj.data.resourceType.name !== "PColumnData/Json")
|
|
4806
|
-
throw Error(`Expected JSON column for labels, got: ${s.obj.data.resourceType.name}`);
|
|
4807
|
-
return Object.fromEntries(
|
|
4808
|
-
Object.entries(
|
|
4809
|
-
s.obj.data.getDataAsJson().data
|
|
4810
|
-
).map((o) => [JSON.parse(o[0])[0], o[1]])
|
|
4811
|
-
);
|
|
4812
|
-
}
|
|
4813
|
-
}
|
|
4978
|
+
return this.resultPool.findLabels(e);
|
|
4814
4979
|
}
|
|
4815
4980
|
verifyInlineColumnsSupport(e) {
|
|
4816
|
-
var
|
|
4817
|
-
const n = e.some((
|
|
4981
|
+
var i;
|
|
4982
|
+
const n = e.some((r) => !(r.data instanceof I)), s = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === true;
|
|
4818
4983
|
if (n && !s) throw Error("inline columns not supported");
|
|
4819
4984
|
}
|
|
4820
4985
|
createPFrame(e) {
|
|
4821
4986
|
return this.verifyInlineColumnsSupport(e), this.ctx.createPFrame(
|
|
4822
|
-
e.map((n) =>
|
|
4987
|
+
e.map((n) => Cn(n, (s) => s instanceof I ? s.handle : s))
|
|
4823
4988
|
);
|
|
4824
4989
|
}
|
|
4825
4990
|
createPTable(e) {
|
|
@@ -4831,10 +4996,10 @@
|
|
|
4831
4996
|
},
|
|
4832
4997
|
filters: e.filters ?? [],
|
|
4833
4998
|
sorting: e.sorting ?? []
|
|
4834
|
-
} : n = e, this.verifyInlineColumnsSupport(
|
|
4835
|
-
|
|
4999
|
+
} : n = e, this.verifyInlineColumnsSupport($n(n.src)), this.ctx.createPTable(
|
|
5000
|
+
An(
|
|
4836
5001
|
n,
|
|
4837
|
-
(s) =>
|
|
5002
|
+
(s) => Cn(s, (i) => i instanceof I ? i.handle : i)
|
|
4838
5003
|
)
|
|
4839
5004
|
);
|
|
4840
5005
|
}
|
|
@@ -4847,33 +5012,33 @@
|
|
|
4847
5012
|
return this.ctx.getCurrentUnstableMarker();
|
|
4848
5013
|
}
|
|
4849
5014
|
}
|
|
4850
|
-
const
|
|
4851
|
-
function
|
|
5015
|
+
const j = "1.25.0";
|
|
5016
|
+
function He(t) {
|
|
4852
5017
|
return t.__renderLambda === true;
|
|
4853
5018
|
}
|
|
4854
|
-
function
|
|
5019
|
+
function ne(t) {
|
|
4855
5020
|
if (t !== void 0)
|
|
4856
|
-
return
|
|
5021
|
+
return He(t) ? t.handle : t;
|
|
4857
5022
|
}
|
|
4858
|
-
class
|
|
4859
|
-
constructor(e, n, s,
|
|
4860
|
-
this._renderingMode = e, this._initialArgs = n, this._initialUiState = s, this._outputs =
|
|
5023
|
+
class P {
|
|
5024
|
+
constructor(e, n, s, i, r, o, u) {
|
|
5025
|
+
this._renderingMode = e, this._initialArgs = n, this._initialUiState = s, this._outputs = i, this._inputsValid = r, this._sections = o, this._title = u;
|
|
4861
5026
|
}
|
|
4862
5027
|
static create(e = "Heavy") {
|
|
4863
|
-
return new
|
|
5028
|
+
return new P(
|
|
4864
5029
|
e,
|
|
4865
5030
|
void 0,
|
|
4866
5031
|
{},
|
|
4867
5032
|
{},
|
|
4868
|
-
|
|
4869
|
-
|
|
5033
|
+
W(true),
|
|
5034
|
+
W([]),
|
|
4870
5035
|
void 0
|
|
4871
5036
|
);
|
|
4872
5037
|
}
|
|
4873
5038
|
output(e, n, s = {}) {
|
|
4874
5039
|
if (typeof n == "function") {
|
|
4875
|
-
const
|
|
4876
|
-
return
|
|
5040
|
+
const i = `output#${e}`;
|
|
5041
|
+
return $(i, () => n(new G())), new P(
|
|
4877
5042
|
this._renderingMode,
|
|
4878
5043
|
this._initialArgs,
|
|
4879
5044
|
this._initialUiState,
|
|
@@ -4881,7 +5046,7 @@
|
|
|
4881
5046
|
...this._outputs,
|
|
4882
5047
|
[e]: {
|
|
4883
5048
|
__renderLambda: true,
|
|
4884
|
-
handle:
|
|
5049
|
+
handle: i,
|
|
4885
5050
|
...s
|
|
4886
5051
|
}
|
|
4887
5052
|
},
|
|
@@ -4890,7 +5055,7 @@
|
|
|
4890
5055
|
this._title
|
|
4891
5056
|
);
|
|
4892
5057
|
} else
|
|
4893
|
-
return new
|
|
5058
|
+
return new P(
|
|
4894
5059
|
this._renderingMode,
|
|
4895
5060
|
this._initialArgs,
|
|
4896
5061
|
this._initialUiState,
|
|
@@ -4908,7 +5073,7 @@
|
|
|
4908
5073
|
return this.output(e, n, { retentive: true });
|
|
4909
5074
|
}
|
|
4910
5075
|
argsValid(e) {
|
|
4911
|
-
return typeof e == "function" ? (
|
|
5076
|
+
return typeof e == "function" ? ($("inputsValid", () => e(new G())), new P(
|
|
4912
5077
|
this._renderingMode,
|
|
4913
5078
|
this._initialArgs,
|
|
4914
5079
|
this._initialUiState,
|
|
@@ -4919,7 +5084,7 @@
|
|
|
4919
5084
|
},
|
|
4920
5085
|
this._sections,
|
|
4921
5086
|
this._title
|
|
4922
|
-
)) : new
|
|
5087
|
+
)) : new P(
|
|
4923
5088
|
this._renderingMode,
|
|
4924
5089
|
this._initialArgs,
|
|
4925
5090
|
this._initialUiState,
|
|
@@ -4930,7 +5095,7 @@
|
|
|
4930
5095
|
);
|
|
4931
5096
|
}
|
|
4932
5097
|
sections(e) {
|
|
4933
|
-
return Array.isArray(e) ? this.sections(
|
|
5098
|
+
return Array.isArray(e) ? this.sections(W(e)) : typeof e == "function" ? ($("sections", () => e(new G())), new P(
|
|
4934
5099
|
this._renderingMode,
|
|
4935
5100
|
this._initialArgs,
|
|
4936
5101
|
this._initialUiState,
|
|
@@ -4938,7 +5103,7 @@
|
|
|
4938
5103
|
this._inputsValid,
|
|
4939
5104
|
{ __renderLambda: true, handle: "sections" },
|
|
4940
5105
|
this._title
|
|
4941
|
-
)) : new
|
|
5106
|
+
)) : new P(
|
|
4942
5107
|
this._renderingMode,
|
|
4943
5108
|
this._initialArgs,
|
|
4944
5109
|
this._initialUiState,
|
|
@@ -4950,7 +5115,7 @@
|
|
|
4950
5115
|
}
|
|
4951
5116
|
/** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
|
|
4952
5117
|
title(e) {
|
|
4953
|
-
return
|
|
5118
|
+
return $("title", () => e(new G())), new P(
|
|
4954
5119
|
this._renderingMode,
|
|
4955
5120
|
this._initialArgs,
|
|
4956
5121
|
this._initialUiState,
|
|
@@ -4965,7 +5130,7 @@
|
|
|
4965
5130
|
* @deprecated use {@link withArgs}
|
|
4966
5131
|
* */
|
|
4967
5132
|
initialArgs(e) {
|
|
4968
|
-
return new
|
|
5133
|
+
return new P(
|
|
4969
5134
|
this._renderingMode,
|
|
4970
5135
|
e,
|
|
4971
5136
|
this._initialUiState,
|
|
@@ -4977,7 +5142,7 @@
|
|
|
4977
5142
|
}
|
|
4978
5143
|
/** Sets initial args for the block, this value must be specified. */
|
|
4979
5144
|
withArgs(e) {
|
|
4980
|
-
return new
|
|
5145
|
+
return new P(
|
|
4981
5146
|
this._renderingMode,
|
|
4982
5147
|
e,
|
|
4983
5148
|
this._initialUiState,
|
|
@@ -4989,7 +5154,7 @@
|
|
|
4989
5154
|
}
|
|
4990
5155
|
/** Defines type and sets initial value for block UiState. */
|
|
4991
5156
|
withUiState(e) {
|
|
4992
|
-
return new
|
|
5157
|
+
return new P(
|
|
4993
5158
|
this._renderingMode,
|
|
4994
5159
|
this._initialArgs,
|
|
4995
5160
|
e,
|
|
@@ -5006,7 +5171,7 @@
|
|
|
5006
5171
|
if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
|
|
5007
5172
|
const e = {
|
|
5008
5173
|
v3: {
|
|
5009
|
-
sdkVersion:
|
|
5174
|
+
sdkVersion: j,
|
|
5010
5175
|
renderingMode: this._renderingMode,
|
|
5011
5176
|
initialArgs: this._initialArgs,
|
|
5012
5177
|
initialUiState: this._initialUiState,
|
|
@@ -5016,72 +5181,72 @@
|
|
|
5016
5181
|
outputs: this._outputs
|
|
5017
5182
|
},
|
|
5018
5183
|
// fields below are added to allow previous desktop versions read generated configs
|
|
5019
|
-
sdkVersion:
|
|
5184
|
+
sdkVersion: j,
|
|
5020
5185
|
renderingMode: this._renderingMode,
|
|
5021
5186
|
initialArgs: this._initialArgs,
|
|
5022
|
-
inputsValid:
|
|
5023
|
-
sections:
|
|
5187
|
+
inputsValid: ne(this._inputsValid),
|
|
5188
|
+
sections: ne(this._sections),
|
|
5024
5189
|
outputs: Object.fromEntries(
|
|
5025
|
-
Object.entries(this._outputs).map(([n, s]) => [n,
|
|
5190
|
+
Object.entries(this._outputs).map(([n, s]) => [n, ne(s)])
|
|
5026
5191
|
)
|
|
5027
5192
|
};
|
|
5028
|
-
return
|
|
5193
|
+
return ke() ? me({ sdkVersion: j }) : { config: e };
|
|
5029
5194
|
}
|
|
5030
5195
|
}
|
|
5031
|
-
function
|
|
5032
|
-
var
|
|
5196
|
+
function Vt(t, e, n, s) {
|
|
5197
|
+
var a, h2;
|
|
5033
5198
|
Array.isArray(s) && (s = { filters: s });
|
|
5034
|
-
const
|
|
5035
|
-
let
|
|
5036
|
-
if (
|
|
5037
|
-
for (const
|
|
5038
|
-
|
|
5039
|
-
return
|
|
5199
|
+
const i = t.resultPool.getData().entries.map((p2) => p2.obj).filter(v).filter((p2) => p2.spec.name === "pl7.app/label" && p2.spec.axesSpec.length === 1), r = (p2, l) => {
|
|
5200
|
+
let f = p2.toString();
|
|
5201
|
+
if (l)
|
|
5202
|
+
for (const d in l)
|
|
5203
|
+
f += d, f += l[d];
|
|
5204
|
+
return f;
|
|
5040
5205
|
}, o = /* @__PURE__ */ new Map();
|
|
5041
|
-
for (const
|
|
5042
|
-
for (const
|
|
5043
|
-
const
|
|
5044
|
-
for (const
|
|
5045
|
-
const
|
|
5046
|
-
if (
|
|
5047
|
-
const
|
|
5048
|
-
if (
|
|
5049
|
-
const
|
|
5050
|
-
o.set(
|
|
5051
|
-
id:
|
|
5206
|
+
for (const p$1 of e)
|
|
5207
|
+
for (const l of p$1.spec.axesSpec) {
|
|
5208
|
+
const f = p(l);
|
|
5209
|
+
for (const d of i) {
|
|
5210
|
+
const y = d.spec.axesSpec[0], _ = p(d.spec.axesSpec[0]);
|
|
5211
|
+
if (Q$1(f, _)) {
|
|
5212
|
+
const A = Object.keys(f.domain ?? {}).length, v2 = Object.keys(_.domain ?? {}).length;
|
|
5213
|
+
if (A > v2) {
|
|
5214
|
+
const m2 = r(d.id, f.domain);
|
|
5215
|
+
o.set(m2, {
|
|
5216
|
+
id: m2,
|
|
5052
5217
|
spec: {
|
|
5053
|
-
...
|
|
5054
|
-
axesSpec: [{ ...
|
|
5218
|
+
...d.spec,
|
|
5219
|
+
axesSpec: [{ ...f, annotations: y.annotations }]
|
|
5055
5220
|
},
|
|
5056
|
-
data:
|
|
5221
|
+
data: d.data
|
|
5057
5222
|
});
|
|
5058
5223
|
} else
|
|
5059
|
-
o.set(
|
|
5224
|
+
o.set(r(d.id), d);
|
|
5060
5225
|
}
|
|
5061
5226
|
}
|
|
5062
5227
|
}
|
|
5063
5228
|
if ([...e, ...o.values()].some(
|
|
5064
|
-
(
|
|
5229
|
+
(p2) => p2.data instanceof I && !p2.data.getIsReadyOrError()
|
|
5065
5230
|
))
|
|
5066
5231
|
return;
|
|
5067
|
-
let
|
|
5068
|
-
const
|
|
5232
|
+
let u = e;
|
|
5233
|
+
const c2 = [];
|
|
5069
5234
|
if (s != null && s.coreColumnPredicate) {
|
|
5070
|
-
|
|
5071
|
-
for (const
|
|
5072
|
-
s.coreColumnPredicate(
|
|
5235
|
+
u = [];
|
|
5236
|
+
for (const p2 of e)
|
|
5237
|
+
s.coreColumnPredicate(p2.spec) ? u.push(p2) : c2.push(p2);
|
|
5073
5238
|
}
|
|
5074
|
-
return
|
|
5239
|
+
return c2.push(...o.values()), t.createPTable({
|
|
5075
5240
|
src: {
|
|
5076
5241
|
type: "outer",
|
|
5077
5242
|
primary: {
|
|
5078
5243
|
type: (s == null ? void 0 : s.coreJoinType) ?? "full",
|
|
5079
|
-
entries:
|
|
5244
|
+
entries: u.map((p2) => ({ type: "column", column: p2 }))
|
|
5080
5245
|
},
|
|
5081
|
-
secondary:
|
|
5246
|
+
secondary: c2.map((p2) => ({ type: "column", column: p2 }))
|
|
5082
5247
|
},
|
|
5083
|
-
filters: [...(s == null ? void 0 : s.filters) ?? [], ...((
|
|
5084
|
-
sorting: ((
|
|
5248
|
+
filters: [...(s == null ? void 0 : s.filters) ?? [], ...((a = n == null ? void 0 : n.pTableParams) == null ? void 0 : a.filters) ?? []],
|
|
5249
|
+
sorting: ((h2 = n == null ? void 0 : n.pTableParams) == null ? void 0 : h2.sorting) ?? []
|
|
5085
5250
|
});
|
|
5086
5251
|
}
|
|
5087
5252
|
function* range(from, to, step = 1) {
|
|
@@ -5099,11 +5264,11 @@
|
|
|
5099
5264
|
function times(n, cb) {
|
|
5100
5265
|
return toList(range(0, n)).map(cb);
|
|
5101
5266
|
}
|
|
5102
|
-
const $BlockArgs = z
|
|
5103
|
-
tableNumRows: z
|
|
5104
|
-
numbers: z
|
|
5267
|
+
const $BlockArgs = z.object({
|
|
5268
|
+
tableNumRows: z.number().default(100),
|
|
5269
|
+
numbers: z.array(z.coerce.number())
|
|
5105
5270
|
});
|
|
5106
|
-
const platforma =
|
|
5271
|
+
const platforma = P.create("Heavy").withArgs({ numbers: [1, 2, 3, 4], tableNumRows: 100 }).withUiState({ dataTableState: void 0, dynamicSections: [] }).argsValid((ctx) => {
|
|
5107
5272
|
if (ctx.args.numbers.length === 5) {
|
|
5108
5273
|
throw new Error("argsValid: test error");
|
|
5109
5274
|
}
|
|
@@ -5115,13 +5280,13 @@
|
|
|
5115
5280
|
var _a, _b, _c, _d, _e2;
|
|
5116
5281
|
if (!((_c = (_b = (_a = ctx.uiState) == null ? void 0 : _a.dataTableState) == null ? void 0 : _b.tableState.pTableParams) == null ? void 0 : _c.filters)) return void 0;
|
|
5117
5282
|
const data = times(ctx.args.tableNumRows ?? 0, (i) => {
|
|
5118
|
-
const
|
|
5283
|
+
const v2 = i + 1;
|
|
5119
5284
|
return {
|
|
5120
|
-
key: [
|
|
5121
|
-
val:
|
|
5285
|
+
key: [v2, v2 + 0.1],
|
|
5286
|
+
val: v2.toString()
|
|
5122
5287
|
};
|
|
5123
5288
|
});
|
|
5124
|
-
return
|
|
5289
|
+
return Vt(
|
|
5125
5290
|
ctx,
|
|
5126
5291
|
[
|
|
5127
5292
|
{
|