@milaboratories/milaboratories.ui-examples.model 1.0.50 → 1.1.0

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/bundle.js CHANGED
@@ -53,7 +53,7 @@
53
53
  return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
54
54
  }
55
55
  util2.joinValues = joinValues;
56
- util2.jsonStringifyReplacer = (_, value) => {
56
+ util2.jsonStringifyReplacer = (_2, value) => {
57
57
  if (typeof value === "bigint") {
58
58
  return value.toString();
59
59
  }
@@ -409,12 +409,12 @@
409
409
  }
410
410
  static mergeArray(status, results) {
411
411
  const arrayValue = [];
412
- for (const s2 of results) {
413
- if (s2.status === "aborted")
412
+ for (const s of results) {
413
+ if (s.status === "aborted")
414
414
  return INVALID;
415
- if (s2.status === "dirty")
415
+ if (s.status === "dirty")
416
416
  status.dirty();
417
- arrayValue.push(s2.value);
417
+ arrayValue.push(s.value);
418
418
  }
419
419
  return { status: status.value, value: arrayValue };
420
420
  }
@@ -458,12 +458,12 @@
458
458
  const isDirty = (x) => x.status === "dirty";
459
459
  const isValid = (x) => x.status === "valid";
460
460
  const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
461
- function __classPrivateFieldGet(receiver, state, kind, f) {
462
- 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");
461
+ function __classPrivateFieldGet(receiver, state, kind, f2) {
462
+ if (typeof state === "function" ? receiver !== state || !f2 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
463
463
  return state.get(receiver);
464
464
  }
465
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
466
- 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");
465
+ function __classPrivateFieldSet(receiver, state, value, kind, f2) {
466
+ if (typeof state === "function" ? receiver !== state || !f2 : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
467
467
  return state.set(receiver, value), value;
468
468
  }
469
469
  typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
@@ -3071,29 +3071,29 @@
3071
3071
  const params = { errorMap: ctx.common.contextualErrorMap };
3072
3072
  const fn = ctx.data;
3073
3073
  if (this._def.returns instanceof ZodPromise) {
3074
- const me = this;
3074
+ const me2 = this;
3075
3075
  return OK(async function(...args) {
3076
3076
  const error = new ZodError([]);
3077
- const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
3077
+ const parsedArgs = await me2._def.args.parseAsync(args, params).catch((e) => {
3078
3078
  error.addIssue(makeArgsIssue(args, e));
3079
3079
  throw error;
3080
3080
  });
3081
3081
  const result = await Reflect.apply(fn, this, parsedArgs);
3082
- const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
3082
+ const parsedReturns = await me2._def.returns._def.type.parseAsync(result, params).catch((e) => {
3083
3083
  error.addIssue(makeReturnsIssue(result, e));
3084
3084
  throw error;
3085
3085
  });
3086
3086
  return parsedReturns;
3087
3087
  });
3088
3088
  } else {
3089
- const me = this;
3089
+ const me2 = this;
3090
3090
  return OK(function(...args) {
3091
- const parsedArgs = me._def.args.safeParse(args, params);
3091
+ const parsedArgs = me2._def.args.safeParse(args, params);
3092
3092
  if (!parsedArgs.success) {
3093
3093
  throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
3094
3094
  }
3095
3095
  const result = Reflect.apply(fn, this, parsedArgs.data);
3096
- const parsedReturns = me._def.returns.safeParse(result, params);
3096
+ const parsedReturns = me2._def.returns.safeParse(result, params);
3097
3097
  if (!parsedReturns.success) {
3098
3098
  throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
3099
3099
  }
@@ -3914,14 +3914,14 @@
3914
3914
  quotelessJson,
3915
3915
  ZodError
3916
3916
  });
3917
- function c(t) {
3917
+ function f(t) {
3918
3918
  throw new Error("Unexpected object: " + t);
3919
3919
  }
3920
- function B$1(t) {
3920
+ function S(t) {
3921
3921
  const { type: n, name: r, domain: e } = t;
3922
3922
  return { type: n, name: r, ...e && { domain: e } };
3923
3923
  }
3924
- function C$1(t, n) {
3924
+ function B(t, n) {
3925
3925
  if (t === void 0) return n === void 0;
3926
3926
  if (n === void 0) return true;
3927
3927
  for (const r in n)
@@ -3929,12 +3929,12 @@
3929
3929
  return true;
3930
3930
  }
3931
3931
  function z(t, n) {
3932
- return t.name === n.name && C$1(t.domain, n.domain);
3932
+ return t.name === n.name && B(t.domain, n.domain);
3933
3933
  }
3934
- function M$1(t, n) {
3935
- return { ...t, src: s(t.src, n) };
3934
+ function M(t, n) {
3935
+ return { ...t, src: u$1(t.src, n) };
3936
3936
  }
3937
- function s(t, n) {
3937
+ function u$1(t, n) {
3938
3938
  switch (t.type) {
3939
3939
  case "column":
3940
3940
  return {
@@ -3945,16 +3945,16 @@
3945
3945
  case "full":
3946
3946
  return {
3947
3947
  type: t.type,
3948
- entries: t.entries.map((r) => s(r, n))
3948
+ entries: t.entries.map((r) => u$1(r, n))
3949
3949
  };
3950
3950
  case "outer":
3951
3951
  return {
3952
3952
  type: "outer",
3953
- primary: s(t.primary, n),
3954
- secondary: t.secondary.map((r) => s(r, n))
3953
+ primary: u$1(t.primary, n),
3954
+ secondary: t.secondary.map((r) => u$1(r, n))
3955
3955
  };
3956
3956
  default:
3957
- c(t);
3957
+ f(t);
3958
3958
  }
3959
3959
  }
3960
3960
  z$1.object({
@@ -3974,110 +3974,130 @@
3974
3974
  if (!U$1(t)) throw new Error(`not a PColumn (kind = ${t.spec.kind})`);
3975
3975
  return t;
3976
3976
  }
3977
- function Z$1(t, n) {
3977
+ function Z(t, n) {
3978
3978
  return t === void 0 ? void 0 : {
3979
3979
  ...t,
3980
3980
  data: n(t.data)
3981
3981
  };
3982
3982
  }
3983
- function T$1(t, n) {
3983
+ function T(t) {
3984
+ const n = /* @__PURE__ */ new Map(), r = (e) => {
3985
+ switch (e.type) {
3986
+ case "column":
3987
+ n.set(e.column.id, e.column);
3988
+ return;
3989
+ case "full":
3990
+ case "inner":
3991
+ for (const i of e.entries) r(i);
3992
+ return;
3993
+ case "outer":
3994
+ r(e.primary);
3995
+ for (const i of e.secondary) r(i);
3996
+ return;
3997
+ default:
3998
+ f(e);
3999
+ }
4000
+ };
4001
+ return r(t), [...n.values()];
4002
+ }
4003
+ function v(t, n) {
3984
4004
  return t.ok ? { ok: true, value: n(t.value) } : t;
3985
4005
  }
3986
- var ce = Object.defineProperty;
3987
- var de = (t, e, n) => e in t ? ce(t, e, { enumerable: true, configurable: true, writable: true, value: n }) : t[e] = n;
3988
- var v = (t, e, n) => de(t, typeof e != "symbol" ? e + "" : e, n);
3989
- function k(t) {
3990
- return { type: "Immediate", value: t };
4006
+ var ct = Object.defineProperty;
4007
+ var pt = (e, t, n) => t in e ? ct(e, t, { enumerable: true, configurable: true, writable: true, value: n }) : e[t] = n;
4008
+ var w = (e, t, n) => pt(e, typeof t != "symbol" ? t + "" : t, n);
4009
+ function k(e) {
4010
+ return { type: "Immediate", value: e };
3991
4011
  }
3992
- function _e() {
4012
+ function vt() {
3993
4013
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
3994
4014
  }
3995
- function re(t) {
3996
- if (t && typeof globalThis.getPlatforma == "function")
3997
- return globalThis.getPlatforma(t);
4015
+ function st(e) {
4016
+ if (e && typeof globalThis.getPlatforma == "function")
4017
+ return globalThis.getPlatforma(e);
3998
4018
  if (typeof globalThis.platforma < "u") return globalThis.platforma;
3999
4019
  throw new Error("Can't get platforma instance.");
4000
4020
  }
4001
- function ve() {
4021
+ function wt() {
4002
4022
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
4003
4023
  }
4004
4024
  function u() {
4005
4025
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
4006
4026
  throw new Error("Not in config rendering context");
4007
4027
  }
4008
- function O(t, e) {
4009
- const n = ve();
4028
+ function O(e, t) {
4029
+ const n = wt();
4010
4030
  if (n === void 0) return false;
4011
- if (t in n.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
4012
- return n.callbackRegistry[t] = e, true;
4031
+ if (e in n.callbackRegistry) throw new Error(`Callback with key ${e} already registered.`);
4032
+ return n.callbackRegistry[e] = t, true;
4013
4033
  }
4014
4034
  const N = /* @__PURE__ */ new Map();
4015
- function we(t, e) {
4016
- t in u().callbackRegistry || (u().callbackRegistry[t] = (n) => {
4017
- for (const r of N.get(t))
4018
- r(n);
4019
- }, N.set(t, [])), N.get(t).push(e);
4035
+ function St(e, t) {
4036
+ e in u().callbackRegistry || (u().callbackRegistry[e] = (n) => {
4037
+ for (const s of N.get(e))
4038
+ s(n);
4039
+ }, N.set(e, [])), N.get(e).push(t);
4020
4040
  }
4021
4041
  class g {
4022
- constructor(e, n = (r) => r) {
4023
- v(this, "isResolved", false);
4024
- v(this, "resolvedValue");
4025
- this.handle = e, this.postProcess = n, we(e, (r) => {
4026
- this.resolvedValue = n(r), this.isResolved = true;
4042
+ constructor(t, n = (s) => s) {
4043
+ w(this, "isResolved", false);
4044
+ w(this, "resolvedValue");
4045
+ this.handle = t, this.postProcess = n, St(t, (s) => {
4046
+ this.resolvedValue = n(s), this.isResolved = true;
4027
4047
  });
4028
4048
  }
4029
- map(e) {
4030
- return new g(this.handle, (n) => e(this.postProcess(n)));
4049
+ map(t) {
4050
+ return new g(this.handle, (n) => t(this.postProcess(n)));
4031
4051
  }
4032
- mapDefined(e) {
4052
+ mapDefined(t) {
4033
4053
  return new g(this.handle, (n) => {
4034
- const r = this.postProcess(n);
4035
- return r ? e(r) : void 0;
4054
+ const s = this.postProcess(n);
4055
+ return s ? t(s) : void 0;
4036
4056
  });
4037
4057
  }
4038
4058
  toJSON() {
4039
4059
  return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
4040
4060
  }
4041
4061
  }
4042
- function X(t) {
4043
- return t === void 0 ? void 0 : new S(t);
4062
+ function X(e) {
4063
+ return e === void 0 ? void 0 : new _(e);
4044
4064
  }
4045
- class S {
4046
- constructor(e) {
4047
- this.handle = e;
4065
+ class _ {
4066
+ constructor(t) {
4067
+ this.handle = t;
4048
4068
  }
4049
- resolve(...e) {
4050
- const n = e.map(
4051
- (r) => ({
4069
+ resolve(...t) {
4070
+ const n = t.map(
4071
+ (s) => ({
4052
4072
  assertFieldType: "Input",
4053
- ...typeof r == "string" ? { field: r } : r
4073
+ ...typeof s == "string" ? { field: s } : s
4054
4074
  })
4055
4075
  );
4056
4076
  return this.resolveWithCommon({}, ...n);
4057
4077
  }
4058
- resolveOutput(...e) {
4059
- const n = e.map(
4060
- (r) => ({
4078
+ resolveOutput(...t) {
4079
+ const n = t.map(
4080
+ (s) => ({
4061
4081
  assertFieldType: "Output",
4062
- ...typeof r == "string" ? { field: r } : r
4082
+ ...typeof s == "string" ? { field: s } : s
4063
4083
  })
4064
4084
  );
4065
4085
  return this.resolveWithCommon({}, ...n);
4066
4086
  }
4067
- resolveInput(...e) {
4068
- const n = e.map(
4069
- (r) => ({
4087
+ resolveInput(...t) {
4088
+ const n = t.map(
4089
+ (s) => ({
4070
4090
  assertFieldType: "Input",
4071
- ...typeof r == "string" ? { field: r } : r
4091
+ ...typeof s == "string" ? { field: s } : s
4072
4092
  })
4073
4093
  );
4074
4094
  return this.resolveWithCommon({}, ...n);
4075
4095
  }
4076
- resolveAny(...e) {
4077
- return this.resolveWithCommon({}, ...e);
4096
+ resolveAny(...t) {
4097
+ return this.resolveWithCommon({}, ...t);
4078
4098
  }
4079
- resolveWithCommon(e, ...n) {
4080
- return X(u().resolveWithCommon(this.handle, e, ...n));
4099
+ resolveWithCommon(t, ...n) {
4100
+ return X(u().resolveWithCommon(this.handle, t, ...n));
4081
4101
  }
4082
4102
  get resourceType() {
4083
4103
  return u().getResourceType(this.handle);
@@ -4106,14 +4126,14 @@
4106
4126
  listDynamicFields() {
4107
4127
  return u().listDynamicFields(this.handle);
4108
4128
  }
4109
- getKeyValueBase64(e) {
4110
- return u().getKeyValueBase64(this.handle, e);
4129
+ getKeyValueBase64(t) {
4130
+ return u().getKeyValueBase64(this.handle, t);
4111
4131
  }
4112
- getKeyValueAsString(e) {
4113
- return u().getKeyValueAsString(this.handle, e);
4132
+ getKeyValueAsString(t) {
4133
+ return u().getKeyValueAsString(this.handle, t);
4114
4134
  }
4115
- getKeyValueAsJson(e) {
4116
- const n = this.getKeyValueAsString(e);
4135
+ getKeyValueAsJson(t) {
4136
+ const n = this.getKeyValueAsString(t);
4117
4137
  if (n == null) throw new Error("Resource has no content.");
4118
4138
  return JSON.parse(n);
4119
4139
  }
@@ -4124,16 +4144,16 @@
4124
4144
  return u().getDataAsString(this.handle);
4125
4145
  }
4126
4146
  getDataAsJson() {
4127
- const e = this.getDataAsString();
4128
- if (e == null) throw new Error("Resource has no content.");
4129
- return JSON.parse(e);
4147
+ const t = this.getDataAsString();
4148
+ if (t == null) throw new Error("Resource has no content.");
4149
+ return JSON.parse(t);
4130
4150
  }
4131
4151
  /**
4132
4152
  *
4133
4153
  */
4134
- getPColumns(e = false, n = "") {
4135
- const r = this.parsePObjectCollection(e, n);
4136
- return r === void 0 ? void 0 : Object.entries(r).map(([, i]) => {
4154
+ getPColumns(t = false, n = "") {
4155
+ const s = this.parsePObjectCollection(t, n);
4156
+ return s === void 0 ? void 0 : Object.entries(s).map(([, i]) => {
4137
4157
  if (!U$1(i)) throw new Error(`not a PColumn (kind = ${i.spec.kind})`);
4138
4158
  return i;
4139
4159
  });
@@ -4141,17 +4161,17 @@
4141
4161
  /**
4142
4162
  *
4143
4163
  */
4144
- parsePObjectCollection(e = false, n = "") {
4145
- const r = u().parsePObjectCollection(
4164
+ parsePObjectCollection(t = false, n = "") {
4165
+ const s = u().parsePObjectCollection(
4146
4166
  this.handle,
4147
- e,
4167
+ t,
4148
4168
  n
4149
4169
  );
4150
- if (r === void 0) return;
4151
- const s2 = {};
4152
- for (const [i, o2] of Object.entries(r))
4153
- s2[i] = Z$1(o2, (a) => new S(a));
4154
- return s2;
4170
+ if (s === void 0) return;
4171
+ const r = {};
4172
+ for (const [i, o2] of Object.entries(s))
4173
+ r[i] = Z(o2, (l) => new _(l));
4174
+ return r;
4155
4175
  }
4156
4176
  getFileContentAsBase64() {
4157
4177
  return new g(u().getBlobContentAsBase64(this.handle));
@@ -4162,7 +4182,7 @@
4162
4182
  getFileContentAsJson() {
4163
4183
  return new g(
4164
4184
  u().getBlobContentAsString(this.handle)
4165
- ).mapDefined((e) => JSON.parse(e));
4185
+ ).mapDefined((t) => JSON.parse(t));
4166
4186
  }
4167
4187
  /**
4168
4188
  * @deprecated use getFileContentAsBase64
@@ -4203,17 +4223,17 @@
4203
4223
  getImportProgress() {
4204
4224
  return new g(u().getImportProgress(this.handle));
4205
4225
  }
4206
- getLastLogs(e) {
4207
- return new g(u().getLastLogs(this.handle, e));
4226
+ getLastLogs(t) {
4227
+ return new g(u().getLastLogs(this.handle, t));
4208
4228
  }
4209
- getProgressLog(e) {
4210
- return new g(u().getProgressLog(this.handle, e));
4229
+ getProgressLog(t) {
4230
+ return new g(u().getProgressLog(this.handle, t));
4211
4231
  }
4212
4232
  getLogHandle() {
4213
4233
  return new g(u().getLogHandle(this.handle));
4214
4234
  }
4215
- allFieldsResolved(e = "Input") {
4216
- switch (e) {
4235
+ allFieldsResolved(t = "Input") {
4236
+ switch (t) {
4217
4237
  case "Input":
4218
4238
  return this.getInputsLocked() && this.listInputFields().every(
4219
4239
  (n) => this.resolve({ field: n, assertFieldType: "Input" }) !== void 0
@@ -4224,104 +4244,104 @@
4224
4244
  );
4225
4245
  }
4226
4246
  }
4227
- mapFields(e, n) {
4228
- const { fieldType: r, requireLocked: s2, skipUnresolved: i } = {
4247
+ mapFields(t, n) {
4248
+ const { fieldType: s, requireLocked: r, skipUnresolved: i } = {
4229
4249
  fieldType: "Input",
4230
4250
  requireLocked: true,
4231
4251
  skipUnresolved: false,
4232
4252
  ...n
4233
- }, o2 = e;
4234
- if (s2 && (r === "Input" && !this.getInputsLocked() || r === "Output" && !this.getOutputsLocked()))
4253
+ }, o2 = t;
4254
+ if (r && (s === "Input" && !this.getInputsLocked() || s === "Output" && !this.getOutputsLocked()))
4235
4255
  return;
4236
- let l = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
4237
- (c2) => [c2, this.resolve({ field: c2, assertFieldType: r })]
4256
+ let a = (s === "Input" ? this.listInputFields() : s === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
4257
+ (c) => [c, this.resolve({ field: c, assertFieldType: s })]
4238
4258
  );
4239
- return i && (l = l.filter((c2) => c2[1] !== void 0)), l.map(([c2, f]) => o2(c2, f));
4259
+ return i && (a = a.filter((c) => c[1] !== void 0)), a.map(([c, f2]) => o2(c, f2));
4240
4260
  }
4241
4261
  }
4242
- const se = "staging", ie = "main";
4243
- const Ae = "pl7.app/label", Pe = "pl7.app/trace", Ie = z$1.object({
4262
+ const rt = "staging", it = "main";
4263
+ const It = "pl7.app/label", Pt = "pl7.app/trace", Rt = z$1.object({
4244
4264
  type: z$1.string(),
4245
4265
  importance: z$1.number().optional(),
4246
4266
  id: z$1.string().optional(),
4247
4267
  label: z$1.string()
4248
- }), Ce = z$1.array(Ie), Re = 1e-3, Te = "__LABEL__", Q = "__LABEL__@1";
4249
- function Fe(t, e, n = {}) {
4250
- const r = /* @__PURE__ */ new Map(), s2 = /* @__PURE__ */ new Map(), i = t.map((d) => {
4268
+ }), Ft = z$1.array(Rt), Tt = 1e-3, Ot = "__LABEL__", Q = "__LABEL__@1";
4269
+ function Dt(e, t, n = {}) {
4270
+ const s = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = e.map((p) => {
4251
4271
  var q, z2;
4252
- const m = e(d), y = (q = m.annotations) == null ? void 0 : q[Ae], F = (z2 = m.annotations) == null ? void 0 : z2[Pe], b = (F ? Ce.safeParse(JSON.parse(F)).data : void 0) ?? [];
4272
+ const m = t(p), y = (q = m.annotations) == null ? void 0 : q[It], T2 = (z2 = m.annotations) == null ? void 0 : z2[Pt], b = (T2 ? Ft.safeParse(JSON.parse(T2)).data : void 0) ?? [];
4253
4273
  if (y) {
4254
- const _ = { label: y, type: Te, importance: -2 };
4255
- n.addLabelAsSuffix ? b.push(_) : b.splice(0, 0, _);
4274
+ const v2 = { label: y, type: Ot, importance: -2 };
4275
+ n.addLabelAsSuffix ? b.push(v2) : b.splice(0, 0, v2);
4256
4276
  }
4257
4277
  const E = [], W = /* @__PURE__ */ new Map();
4258
- for (let _ = b.length - 1; _ >= 0; --_) {
4259
- const { type: V } = b[_], ue = b[_].importance ?? 0, j = (W.get(V) ?? 0) + 1;
4278
+ for (let v2 = b.length - 1; v2 >= 0; --v2) {
4279
+ const { type: V } = b[v2], ut = b[v2].importance ?? 0, j = (W.get(V) ?? 0) + 1;
4260
4280
  W.set(V, j);
4261
4281
  const I = `${V}@${j}`;
4262
- s2.set(I, (s2.get(I) ?? 0) + 1), r.set(
4282
+ r.set(I, (r.get(I) ?? 0) + 1), s.set(
4263
4283
  I,
4264
4284
  Math.max(
4265
- r.get(I) ?? Number.NEGATIVE_INFINITY,
4266
- ue - (b.length - _) * Re
4285
+ s.get(I) ?? Number.NEGATIVE_INFINITY,
4286
+ ut - (b.length - v2) * Tt
4267
4287
  )
4268
- ), E.push({ ...b[_], fullType: I, occurenceIndex: j });
4288
+ ), E.push({ ...b[v2], fullType: I, occurenceIndex: j });
4269
4289
  }
4270
4290
  return E.reverse(), {
4271
- value: d,
4291
+ value: p,
4272
4292
  spec: m,
4273
4293
  label: y,
4274
4294
  fullTrace: E
4275
4295
  };
4276
- }), o2 = [], a = [], l = [...r];
4277
- l.sort(([, d], [, m]) => m - d);
4278
- for (const [d] of l)
4279
- d.endsWith("@1") || s2.get(d) === t.length ? o2.push(d) : a.push(d);
4280
- const c2 = (d) => i.map((m) => {
4281
- const y = m.fullTrace.filter((b) => d.has(b.fullType)).map((b) => b.label), F = n.separator ?? " / ";
4296
+ }), o2 = [], l = [], a = [...s];
4297
+ a.sort(([, p], [, m]) => m - p);
4298
+ for (const [p] of a)
4299
+ p.endsWith("@1") || r.get(p) === e.length ? o2.push(p) : l.push(p);
4300
+ const c = (p) => i.map((m) => {
4301
+ const y = m.fullTrace.filter((b) => p.has(b.fullType)).map((b) => b.label), T2 = n.separator ?? " / ";
4282
4302
  return {
4283
- label: y.join(F),
4303
+ label: y.join(T2),
4284
4304
  value: m.value
4285
4305
  };
4286
4306
  });
4287
4307
  if (o2.length === 0) {
4288
- if (a.length !== 0) throw new Error("Assertion error.");
4289
- return c2(new Set(Q));
4290
- }
4291
- let f = 0, w = 0;
4292
- for (; f < o2.length; ) {
4293
- const d = /* @__PURE__ */ new Set();
4294
- n.includeNativeLabel && d.add(Q);
4295
- for (let y = 0; y < f; ++y) d.add(o2[y]);
4296
- d.add(o2[w]);
4297
- const m = c2(d);
4298
- if (new Set(m.map((y) => y.label)).size === t.length) return m;
4299
- w++, w == o2.length && (f++, w = f);
4300
- }
4301
- return c2(/* @__PURE__ */ new Set([...o2, ...a]));
4308
+ if (l.length !== 0) throw new Error("Assertion error.");
4309
+ return c(new Set(Q));
4310
+ }
4311
+ let f2 = 0, S2 = 0;
4312
+ for (; f2 < o2.length; ) {
4313
+ const p = /* @__PURE__ */ new Set();
4314
+ n.includeNativeLabel && p.add(Q);
4315
+ for (let y = 0; y < f2; ++y) p.add(o2[y]);
4316
+ p.add(o2[S2]);
4317
+ const m = c(p);
4318
+ if (new Set(m.map((y) => y.label)).size === e.length) return m;
4319
+ S2++, S2 == o2.length && (f2++, S2 = f2);
4320
+ }
4321
+ return c(/* @__PURE__ */ new Set([...o2, ...l]));
4302
4322
  }
4303
- class Oe {
4323
+ class kt {
4304
4324
  constructor() {
4305
- v(this, "ctx", u());
4306
- v(this, "defaultLabelFn", (e, n) => {
4307
- var r;
4308
- return ((r = e.annotations) == null ? void 0 : r["pl7.app/label"]) ?? "Unlabelled";
4325
+ w(this, "ctx", u());
4326
+ w(this, "defaultLabelFn", (t, n) => {
4327
+ var s;
4328
+ return ((s = t.annotations) == null ? void 0 : s["pl7.app/label"]) ?? "Unlabelled";
4309
4329
  });
4310
4330
  }
4311
4331
  /**
4312
4332
  * @deprecated use getOptions()
4313
4333
  */
4314
- calculateOptions(e) {
4315
- return this.ctx.calculateOptions(e);
4334
+ calculateOptions(t) {
4335
+ return this.ctx.calculateOptions(t);
4316
4336
  }
4317
- getOptions(e, n) {
4318
- const r = this.getSpecs().entries.filter((s2) => e(s2.obj));
4319
- return typeof n == "object" || typeof n > "u" ? Fe(r, (s2) => s2.obj, n ?? {}).map(({ value: { ref: s2 }, label: i }) => ({
4320
- ref: s2,
4337
+ getOptions(t, n) {
4338
+ const s = this.getSpecs().entries.filter((r) => t(r.obj));
4339
+ return typeof n == "object" || typeof n > "u" ? Dt(s, (r) => r.obj, n ?? {}).map(({ value: { ref: r }, label: i }) => ({
4340
+ ref: r,
4321
4341
  label: i
4322
- })) : r.map((s2) => ({
4323
- ref: s2.ref,
4324
- label: n(s2.obj, s2.ref)
4342
+ })) : s.map((r) => ({
4343
+ ref: r.ref,
4344
+ label: n(r.obj, r.ref)
4325
4345
  }));
4326
4346
  }
4327
4347
  /**
@@ -4331,14 +4351,14 @@
4331
4351
  return this.getData();
4332
4352
  }
4333
4353
  getData() {
4334
- const e = this.ctx.getDataFromResultPool();
4354
+ const t = this.ctx.getDataFromResultPool();
4335
4355
  return {
4336
- isComplete: e.isComplete,
4337
- entries: e.entries.map((n) => ({
4356
+ isComplete: t.isComplete,
4357
+ entries: t.entries.map((n) => ({
4338
4358
  ref: n.ref,
4339
4359
  obj: {
4340
4360
  ...n.obj,
4341
- data: new S(n.obj.data)
4361
+ data: new _(n.obj.data)
4342
4362
  }
4343
4363
  }))
4344
4364
  };
@@ -4350,14 +4370,14 @@
4350
4370
  return this.getDataWithErrors();
4351
4371
  }
4352
4372
  getDataWithErrors() {
4353
- const e = this.ctx.getDataWithErrorsFromResultPool();
4373
+ const t = this.ctx.getDataWithErrorsFromResultPool();
4354
4374
  return {
4355
- isComplete: e.isComplete,
4356
- entries: e.entries.map((n) => ({
4375
+ isComplete: t.isComplete,
4376
+ entries: t.entries.map((n) => ({
4357
4377
  ref: n.ref,
4358
4378
  obj: {
4359
4379
  ...n.obj,
4360
- data: T$1(n.obj.data, (r) => new S(r))
4380
+ data: v(n.obj.data, (s) => new _(s))
4361
4381
  }
4362
4382
  }))
4363
4383
  };
@@ -4375,13 +4395,13 @@
4375
4395
  * @param ref a Ref
4376
4396
  * @returns data associated with the ref
4377
4397
  */
4378
- getDataByRef(e) {
4398
+ getDataByRef(t) {
4379
4399
  var n;
4380
4400
  return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (n = this.getData().entries.find(
4381
- (r) => r.ref.blockId === e.blockId && r.ref.name === e.name
4382
- )) == null ? void 0 : n.obj : Z$1(
4383
- this.ctx.getDataFromResultPoolByRef(e.blockId, e.name),
4384
- (r) => new S(r)
4401
+ (s) => s.ref.blockId === t.blockId && s.ref.name === t.name
4402
+ )) == null ? void 0 : n.obj : Z(
4403
+ this.ctx.getDataFromResultPoolByRef(t.blockId, t.name),
4404
+ (s) => new _(s)
4385
4405
  );
4386
4406
  }
4387
4407
  /**
@@ -4389,8 +4409,8 @@
4389
4409
  * @param ref a Ref
4390
4410
  * @returns p-column associated with the ref
4391
4411
  */
4392
- getPColumnByRef(e) {
4393
- const n = this.getDataByRef(e);
4412
+ getPColumnByRef(t) {
4413
+ const n = this.getDataByRef(t);
4394
4414
  if (n)
4395
4415
  return Y(n);
4396
4416
  }
@@ -4398,56 +4418,56 @@
4398
4418
  * @param ref a Ref
4399
4419
  * @returns object spec associated with the ref
4400
4420
  */
4401
- getSpecByRef(e) {
4421
+ getSpecByRef(t) {
4402
4422
  var n;
4403
4423
  return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (n = this.getSpecs().entries.find(
4404
- (r) => r.ref.blockId === e.blockId && r.ref.name === e.name
4405
- )) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(e.blockId, e.name);
4424
+ (s) => s.ref.blockId === t.blockId && s.ref.name === t.name
4425
+ )) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(t.blockId, t.name);
4406
4426
  }
4407
4427
  /**
4408
4428
  * @param spec object specification
4409
4429
  * @returns array of data objects with compatible specs
4410
4430
  * @deprecated delete this method after Jan 1, 2025
4411
4431
  */
4412
- findDataWithCompatibleSpec(e) {
4432
+ findDataWithCompatibleSpec(t) {
4413
4433
  const n = [];
4414
- e: for (const r of this.getData().entries) {
4415
- if (!o(r.obj.spec))
4434
+ t: for (const s of this.getData().entries) {
4435
+ if (!o(s.obj.spec))
4416
4436
  continue;
4417
- const s2 = r.obj.spec;
4418
- if (e.name === s2.name && e.valueType === s2.valueType && e.axesSpec.length === s2.axesSpec.length && $(e.domain, s2.domain)) {
4419
- for (let i = 0; i < e.axesSpec.length; ++i) {
4420
- const o2 = e.axesSpec[i], a = s2.axesSpec[i];
4421
- if (o2.name !== a.name || o2.type !== a.type || !$(o2.domain, a.domain))
4422
- continue e;
4437
+ const r = s.obj.spec;
4438
+ if (t.name === r.name && t.valueType === r.valueType && t.axesSpec.length === r.axesSpec.length && $(t.domain, r.domain)) {
4439
+ for (let i = 0; i < t.axesSpec.length; ++i) {
4440
+ const o2 = t.axesSpec[i], l = r.axesSpec[i];
4441
+ if (o2.name !== l.name || o2.type !== l.type || !$(o2.domain, l.domain))
4442
+ continue t;
4423
4443
  }
4424
- n.push(r.obj);
4444
+ n.push(s.obj);
4425
4445
  }
4426
4446
  }
4427
4447
  return n;
4428
4448
  }
4429
4449
  }
4430
- function $(t, e) {
4431
- if (t === void 0) return e === void 0;
4432
- if (e === void 0) return true;
4433
- for (const n in e)
4434
- if (t[n] !== e[n]) return false;
4450
+ function $(e, t) {
4451
+ if (e === void 0) return t === void 0;
4452
+ if (t === void 0) return true;
4453
+ for (const n in t)
4454
+ if (e[n] !== t[n]) return false;
4435
4455
  return true;
4436
4456
  }
4437
4457
  class D {
4438
4458
  constructor() {
4439
- v(this, "ctx");
4440
- v(this, "args");
4441
- v(this, "uiState");
4442
- v(this, "resultPool", new Oe());
4459
+ w(this, "ctx");
4460
+ w(this, "args");
4461
+ w(this, "uiState");
4462
+ w(this, "resultPool", new kt());
4443
4463
  this.ctx = u(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : void 0;
4444
4464
  }
4445
- getNamedAccessor(e) {
4446
- const n = this.ctx.getAccessorHandleByName(e);
4447
- return n ? new S(n) : void 0;
4465
+ getNamedAccessor(t) {
4466
+ const n = this.ctx.getAccessorHandleByName(t);
4467
+ return n ? new _(n) : void 0;
4448
4468
  }
4449
4469
  get prerun() {
4450
- return this.getNamedAccessor(se);
4470
+ return this.getNamedAccessor(rt);
4451
4471
  }
4452
4472
  /**
4453
4473
  * @deprecated use prerun
@@ -4462,7 +4482,7 @@
4462
4482
  return this.precalc;
4463
4483
  }
4464
4484
  get outputs() {
4465
- return this.getNamedAccessor(ie);
4485
+ return this.getNamedAccessor(it);
4466
4486
  }
4467
4487
  /**
4468
4488
  * @deprecated use outputs
@@ -4474,136 +4494,71 @@
4474
4494
  * Find labels data for a given axis id. It will search for a label column and return its data as a map.
4475
4495
  * @returns a map of axis value => label
4476
4496
  */
4477
- findLabels(e) {
4497
+ findLabels(t) {
4478
4498
  const n = this.resultPool.getData();
4479
- for (const r of n.entries) {
4480
- if (!U$1(r.obj)) continue;
4481
- const s2 = r.obj.spec;
4482
- if (s2.name === "pl7.app/label" && s2.axesSpec.length === 1 && s2.axesSpec[0].name === e.name && s2.axesSpec[0].type === e.type && $(e.domain, s2.axesSpec[0].domain)) {
4483
- if (r.obj.data.resourceType.name !== "PColumnData/Json")
4484
- throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
4499
+ for (const s of n.entries) {
4500
+ if (!U$1(s.obj)) continue;
4501
+ const r = s.obj.spec;
4502
+ if (r.name === "pl7.app/label" && r.axesSpec.length === 1 && r.axesSpec[0].name === t.name && r.axesSpec[0].type === t.type && $(t.domain, r.axesSpec[0].domain)) {
4503
+ if (s.obj.data.resourceType.name !== "PColumnData/Json")
4504
+ throw Error(`Expected JSON column for labels, got: ${s.obj.data.resourceType.name}`);
4485
4505
  return new Map(
4486
4506
  Object.entries(
4487
- r.obj.data.getDataAsJson().data
4507
+ s.obj.data.getDataAsJson().data
4488
4508
  ).map((o2) => [JSON.parse(o2[0])[0], o2[1]])
4489
4509
  );
4490
4510
  }
4491
4511
  }
4492
4512
  }
4493
- createPFrame(e) {
4494
- return this.ctx.createPFrame(e.map((n) => Z$1(n, (r) => r.handle)));
4513
+ verifyInlineColumnsSupport(t) {
4514
+ var r;
4515
+ const n = t.some((i) => !(i.data instanceof _)), s = ((r = this.ctx.featureFlags) == null ? void 0 : r.inlineColumnsSupport) === true;
4516
+ if (n && !s) throw Error("inline columns not supported");
4495
4517
  }
4496
- createPTable(e) {
4518
+ createPFrame(t) {
4519
+ return this.verifyInlineColumnsSupport(t), this.ctx.createPFrame(t.map((n) => Z(
4520
+ n,
4521
+ (s) => s instanceof _ ? s.handle : s
4522
+ )));
4523
+ }
4524
+ createPTable(t) {
4497
4525
  var n;
4498
- return "columns" in e ? n = {
4526
+ return "columns" in t ? n = {
4499
4527
  src: {
4500
4528
  type: "full",
4501
- entries: e.columns.map((r) => ({ type: "column", column: r }))
4529
+ entries: t.columns.map((s) => ({ type: "column", column: s }))
4502
4530
  },
4503
- filters: e.filters ?? [],
4504
- sorting: e.sorting ?? []
4505
- } : n = e, this.ctx.createPTable(M$1(n, (r) => Z$1(r, (s2) => s2.handle)));
4531
+ filters: t.filters ?? [],
4532
+ sorting: t.sorting ?? []
4533
+ } : n = t, this.verifyInlineColumnsSupport(T(n.src)), this.ctx.createPTable(M(n, (s) => Z(
4534
+ s,
4535
+ (r) => r instanceof _ ? r.handle : r
4536
+ )));
4506
4537
  }
4507
4538
  /** @deprecated scheduled for removal from SDK */
4508
- getBlockLabel(e) {
4509
- return this.ctx.getBlockLabel(e);
4539
+ getBlockLabel(t) {
4540
+ return this.ctx.getBlockLabel(t);
4510
4541
  }
4511
4542
  getCurrentUnstableMarker() {
4512
4543
  if (!(typeof this.ctx.getCurrentUnstableMarker > "u"))
4513
4544
  return this.ctx.getCurrentUnstableMarker();
4514
4545
  }
4515
4546
  }
4516
- const T = "PColumnData/", K = T + "ResourceMap", G = T + "Partitioned/ResourceMap", Z = T + "JsonPartitioned", M = T + "BinaryPartitioned", ae = T + "Partitioned/", ee = ae + "JsonPartitioned", B = ae + "BinaryPartitioned";
4517
- const te = (t) => {
4518
- if (!t.endsWith(".index")) {
4519
- if (t.endsWith(".values"))
4520
- return t.substring(0, t.length - 7);
4521
- throw Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
4522
- }
4523
- };
4524
- function De(t) {
4525
- if (!t) return;
4526
- const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
4527
- let s2 = 0;
4528
- switch (e) {
4529
- case K:
4530
- s2 = n.keyLength;
4531
- break;
4532
- case G:
4533
- s2 = n.partitionKeyLength + n.keyLength;
4534
- break;
4535
- case Z:
4536
- case M:
4537
- s2 = n.partitionKeyLength;
4538
- break;
4539
- case B:
4540
- case ee:
4541
- s2 = n.superPartitionKeyLength + n.partitionKeyLength;
4542
- break;
4543
- }
4544
- switch (e) {
4545
- case K:
4546
- case Z:
4547
- case M:
4548
- for (let i of t.listInputFields()) {
4549
- if (e === M) {
4550
- const a = te(i);
4551
- if (a) i = a;
4552
- else continue;
4553
- }
4554
- const o2 = [...JSON.parse(i)];
4555
- r.push(o2);
4556
- }
4557
- break;
4558
- case G:
4559
- case B:
4560
- case ee:
4561
- for (const i of t.listInputFields()) {
4562
- const o2 = [...JSON.parse(i)], a = t.resolve({ field: i, assertFieldType: "Input" });
4563
- if (a !== void 0)
4564
- for (let l of a.listInputFields()) {
4565
- if (e === B) {
4566
- const f = te(l);
4567
- if (f) l = f;
4568
- else continue;
4569
- }
4570
- const c2 = [...o2, ...JSON.parse(l)];
4571
- r.push(c2);
4572
- }
4573
- }
4574
- break;
4575
- }
4576
- return { data: r, keyLength: s2 };
4577
- }
4578
- function pt(t) {
4579
- const e = De(t);
4580
- if (!e) return;
4581
- const { data: n, keyLength: r } = e, s2 = [];
4582
- for (let i = 0; i < r; ++i)
4583
- s2.push(/* @__PURE__ */ new Set());
4584
- for (const i of n) {
4585
- if (i.length !== r)
4586
- throw new Error("key length does not match partition length");
4587
- for (let o2 = 0; o2 < r; ++o2)
4588
- s2[o2].add(i[o2]);
4589
- }
4590
- return s2.map((i) => Array.from(i.values()));
4591
- }
4592
- const C = "1.18.0";
4593
- function ke(t) {
4594
- return t.__renderLambda === true;
4547
+ const P = "1.19.0";
4548
+ function xt(e) {
4549
+ return e.__renderLambda === true;
4595
4550
  }
4596
- function U(t) {
4597
- if (t !== void 0)
4598
- return ke(t) ? t.handle : t;
4551
+ function U(e) {
4552
+ if (e !== void 0)
4553
+ return xt(e) ? e.handle : e;
4599
4554
  }
4600
4555
  class h {
4601
- constructor(e, n, r, s2, i, o2, a) {
4602
- this._renderingMode = e, this._initialArgs = n, this._initialUiState = r, this._outputs = s2, this._inputsValid = i, this._sections = o2, this._title = a;
4556
+ constructor(t, n, s, r, i, o2, l) {
4557
+ this._renderingMode = t, this._initialArgs = n, this._initialUiState = s, this._outputs = r, this._inputsValid = i, this._sections = o2, this._title = l;
4603
4558
  }
4604
- static create(e = "Heavy") {
4559
+ static create(t = "Heavy") {
4605
4560
  return new h(
4606
- e,
4561
+ t,
4607
4562
  void 0,
4608
4563
  {},
4609
4564
  {},
@@ -4612,19 +4567,19 @@
4612
4567
  void 0
4613
4568
  );
4614
4569
  }
4615
- output(e, n, r = {}) {
4570
+ output(t, n, s = {}) {
4616
4571
  if (typeof n == "function") {
4617
- const s2 = `output#${e}`;
4618
- return O(s2, () => n(new D())), new h(
4572
+ const r = `output#${t}`;
4573
+ return O(r, () => n(new D())), new h(
4619
4574
  this._renderingMode,
4620
4575
  this._initialArgs,
4621
4576
  this._initialUiState,
4622
4577
  {
4623
4578
  ...this._outputs,
4624
- [e]: {
4579
+ [t]: {
4625
4580
  __renderLambda: true,
4626
- handle: s2,
4627
- ...r
4581
+ handle: r,
4582
+ ...s
4628
4583
  }
4629
4584
  },
4630
4585
  this._inputsValid,
@@ -4638,7 +4593,7 @@
4638
4593
  this._initialUiState,
4639
4594
  {
4640
4595
  ...this._outputs,
4641
- [e]: n
4596
+ [t]: n
4642
4597
  },
4643
4598
  this._inputsValid,
4644
4599
  this._sections,
@@ -4646,15 +4601,15 @@
4646
4601
  );
4647
4602
  }
4648
4603
  /** Shortcut for {@link output} with retentive flag set to true. */
4649
- retentiveOutput(e, n) {
4650
- return this.output(e, n, { retentive: true });
4604
+ retentiveOutput(t, n) {
4605
+ return this.output(t, n, { retentive: true });
4651
4606
  }
4652
4607
  /** @deprecated */
4653
- canRun(e) {
4654
- return this.inputsValid(e);
4608
+ canRun(t) {
4609
+ return this.inputsValid(t);
4655
4610
  }
4656
- argsValid(e) {
4657
- return typeof e == "function" ? (O("inputsValid", () => e(new D())), new h(
4611
+ argsValid(t) {
4612
+ return typeof t == "function" ? (O("inputsValid", () => t(new D())), new h(
4658
4613
  this._renderingMode,
4659
4614
  this._initialArgs,
4660
4615
  this._initialUiState,
@@ -4670,16 +4625,16 @@
4670
4625
  this._initialArgs,
4671
4626
  this._initialUiState,
4672
4627
  this._outputs,
4673
- e,
4628
+ t,
4674
4629
  this._sections,
4675
4630
  this._title
4676
4631
  );
4677
4632
  }
4678
- inputsValid(e) {
4679
- return this.argsValid(e);
4633
+ inputsValid(t) {
4634
+ return this.argsValid(t);
4680
4635
  }
4681
- sections(e) {
4682
- return Array.isArray(e) ? this.sections(k(e)) : typeof e == "function" ? (O("sections", () => e(new D())), new h(
4636
+ sections(t) {
4637
+ return Array.isArray(t) ? this.sections(k(t)) : typeof t == "function" ? (O("sections", () => t(new D())), new h(
4683
4638
  this._renderingMode,
4684
4639
  this._initialArgs,
4685
4640
  this._initialUiState,
@@ -4693,12 +4648,12 @@
4693
4648
  this._initialUiState,
4694
4649
  this._outputs,
4695
4650
  this._inputsValid,
4696
- e,
4651
+ t,
4697
4652
  this._title
4698
4653
  );
4699
4654
  }
4700
- title(e) {
4701
- return O("title", () => e(new D())), new h(
4655
+ title(t) {
4656
+ return O("title", () => t(new D())), new h(
4702
4657
  this._renderingMode,
4703
4658
  this._initialArgs,
4704
4659
  this._initialUiState,
@@ -4712,10 +4667,10 @@
4712
4667
  * Sets initial args for the block, this value must be specified.
4713
4668
  * @deprecated use {@link withArgs}
4714
4669
  * */
4715
- initialArgs(e) {
4670
+ initialArgs(t) {
4716
4671
  return new h(
4717
4672
  this._renderingMode,
4718
- e,
4673
+ t,
4719
4674
  this._initialUiState,
4720
4675
  this._outputs,
4721
4676
  this._inputsValid,
@@ -4724,10 +4679,10 @@
4724
4679
  );
4725
4680
  }
4726
4681
  /** Sets initial args for the block, this value must be specified. */
4727
- withArgs(e) {
4682
+ withArgs(t) {
4728
4683
  return new h(
4729
4684
  this._renderingMode,
4730
- e,
4685
+ t,
4731
4686
  this._initialUiState,
4732
4687
  this._outputs,
4733
4688
  this._inputsValid,
@@ -4736,11 +4691,11 @@
4736
4691
  );
4737
4692
  }
4738
4693
  /** Defines type and sets initial value for block UiState. */
4739
- withUiState(e) {
4694
+ withUiState(t) {
4740
4695
  return new h(
4741
4696
  this._renderingMode,
4742
4697
  this._initialArgs,
4743
- e,
4698
+ t,
4744
4699
  this._outputs,
4745
4700
  this._inputsValid,
4746
4701
  this._sections,
@@ -4752,9 +4707,9 @@
4752
4707
  * other features provided by the platforma to the block. */
4753
4708
  done() {
4754
4709
  if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
4755
- const e = {
4710
+ const t = {
4756
4711
  v3: {
4757
- sdkVersion: C,
4712
+ sdkVersion: P,
4758
4713
  renderingMode: this._renderingMode,
4759
4714
  initialArgs: this._initialArgs,
4760
4715
  initialUiState: this._initialUiState,
@@ -4764,80 +4719,80 @@
4764
4719
  outputs: this._outputs
4765
4720
  },
4766
4721
  // fields below are added to allow previous desktop versions read generated configs
4767
- sdkVersion: C,
4722
+ sdkVersion: P,
4768
4723
  renderingMode: this._renderingMode,
4769
4724
  initialArgs: this._initialArgs,
4770
4725
  inputsValid: U(this._inputsValid),
4771
4726
  sections: U(this._sections),
4772
4727
  outputs: Object.fromEntries(
4773
- Object.entries(this._outputs).map(([n, r]) => [n, U(r)])
4728
+ Object.entries(this._outputs).map(([n, s]) => [n, U(s)])
4774
4729
  )
4775
4730
  };
4776
- return _e() ? re({ sdkVersion: C }) : { config: e };
4731
+ return vt() ? st({ sdkVersion: P }) : { config: t };
4777
4732
  }
4778
4733
  }
4779
- function ht(t, e, n, r) {
4780
- var o2, a;
4781
- const s2 = t.resultPool.getData().entries.map((l) => l.obj).filter(U$1).filter((l) => l.spec.name === "pl7.app/label" && l.spec.axesSpec.length === 1), i = /* @__PURE__ */ new Map();
4782
- for (const l of e)
4783
- for (const c2 of l.spec.axesSpec) {
4784
- const f = B$1(c2);
4785
- for (const w of s2)
4786
- z(f, B$1(w.spec.axesSpec[0])) && i.set(w.id, w);
4734
+ function me(e, t, n, s) {
4735
+ var o2, l;
4736
+ const r = e.resultPool.getData().entries.map((a) => a.obj).filter(U$1).filter((a) => a.spec.name === "pl7.app/label" && a.spec.axesSpec.length === 1), i = /* @__PURE__ */ new Map();
4737
+ for (const a of t)
4738
+ for (const c of a.spec.axesSpec) {
4739
+ const f2 = S(c);
4740
+ for (const S$1 of r)
4741
+ z(f2, S(S$1.spec.axesSpec[0])) && i.set(S$1.id, S$1);
4787
4742
  }
4788
- if (![...e, ...i.values()].find((l) => !l.data.getIsReadyOrError()))
4789
- return t.createPTable({
4743
+ if (![...t, ...i.values()].some(
4744
+ (a) => a.data instanceof _ && !a.data.getIsReadyOrError()
4745
+ ))
4746
+ return e.createPTable({
4790
4747
  src: {
4791
4748
  type: "outer",
4792
4749
  primary: {
4793
4750
  type: "full",
4794
- entries: e.map((l) => ({ type: "column", column: l }))
4751
+ entries: t.map((a) => ({ type: "column", column: a }))
4795
4752
  },
4796
- secondary: Array.from(i.values()).map((l) => ({ type: "column", column: l }))
4753
+ secondary: [...i.values()].map((a) => ({ type: "column", column: a }))
4797
4754
  },
4798
- filters: [...((o2 = n == null ? void 0 : n.pTableParams) == null ? void 0 : o2.filters) ?? [], ...r ?? []],
4799
- sorting: ((a = n == null ? void 0 : n.pTableParams) == null ? void 0 : a.sorting) ?? []
4755
+ filters: [...((o2 = n == null ? void 0 : n.pTableParams) == null ? void 0 : o2.filters) ?? [], ...s ?? []],
4756
+ sorting: ((l = n == null ? void 0 : n.pTableParams) == null ? void 0 : l.sorting) ?? []
4800
4757
  });
4801
4758
  }
4802
- function gt(t, e, n) {
4803
- const r = t.findLabels(e);
4804
- return {
4805
- axis: e,
4806
- options: n.map((s2) => ({
4807
- value: s2,
4808
- label: (r == null ? void 0 : r.get(s2)) ?? s2.toString()
4809
- })),
4810
- defaultValue: n[0]
4811
- };
4812
- }
4813
4759
  const $BlockArgs = z$1.object({
4814
4760
  numbers: z$1.array(z$1.coerce.number())
4815
4761
  });
4816
4762
  const platforma = h.create("Heavy").withArgs({ numbers: [1, 2, 3] }).withUiState({ dataTableState: void 0 }).output("numbers", (ctx) => {
4817
4763
  var _a, _b;
4818
4764
  return (_b = (_a = ctx.outputs) == null ? void 0 : _a.resolve("numbers")) == null ? void 0 : _b.getDataAsJson();
4819
- }).retentiveOutput("inputOptions", (ctx) => {
4820
- return ctx.resultPool.getOptions((spec) => o(spec));
4821
- }).output("sheets", (ctx) => {
4822
- var _a, _b;
4823
- if (!((_b = (_a = ctx.uiState) == null ? void 0 : _a.dataTableState) == null ? void 0 : _b.anchorColumn)) return void 0;
4824
- const anchor = ctx.resultPool.getPColumnByRef(ctx.uiState.dataTableState.anchorColumn);
4825
- if (!anchor) return void 0;
4826
- const r = pt(anchor.data);
4827
- if (!r) return void 0;
4828
- return r.map((values, i) => gt(ctx, anchor.spec.axesSpec[i], values));
4829
4765
  }).output("pt", (ctx) => {
4830
- var _a, _b, _c, _d, _e2;
4831
- if (((_b = (_a = ctx.uiState) == null ? void 0 : _a.dataTableState) == null ? void 0 : _b.anchorColumn) === void 0) return void 0;
4832
- const anchorColumn = ctx.resultPool.getDataByRef(ctx.uiState.dataTableState.anchorColumn);
4833
- if (!anchorColumn || !U$1(anchorColumn)) {
4834
- console.error("Anchor column is undefined or is not PColumn", anchorColumn);
4835
- return void 0;
4836
- }
4837
- if (((_c = ctx.uiState.dataTableState.tableState.pTableParams) == null ? void 0 : _c.filters) === void 0) return void 0;
4838
- return ht(ctx, [anchorColumn], ctx.uiState.dataTableState.tableState, [
4766
+ var _a, _b, _c, _d, _e;
4767
+ 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;
4768
+ return me(ctx, [
4769
+ {
4770
+ id: "example",
4771
+ spec: {
4772
+ kind: "PColumn",
4773
+ valueType: "String",
4774
+ name: "example",
4775
+ annotations: {
4776
+ "pl7.app/label": "String column"
4777
+ },
4778
+ axesSpec: [
4779
+ {
4780
+ type: "Int",
4781
+ name: "index",
4782
+ annotations: {
4783
+ "pl7.app/label": "Int axis"
4784
+ }
4785
+ }
4786
+ ]
4787
+ },
4788
+ data: [
4789
+ { key: [1], val: "1" },
4790
+ { key: [2], val: "2" }
4791
+ ]
4792
+ }
4793
+ ], ctx.uiState.dataTableState.tableState, [
4839
4794
  ...(_d = ctx.uiState.dataTableState.tableState.pTableParams) == null ? void 0 : _d.filters,
4840
- ...((_e2 = ctx.uiState.dataTableState.filterModel) == null ? void 0 : _e2.filters) ?? []
4795
+ ...((_e = ctx.uiState.dataTableState.filterModel) == null ? void 0 : _e.filters) ?? []
4841
4796
  ]);
4842
4797
  }).sections((ctx) => {
4843
4798
  return [