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

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({
@@ -3980,74 +3980,94 @@
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 pt = Object.defineProperty;
4007
+ var dt = (e, t, n) => t in e ? pt(e, t, { enumerable: true, configurable: true, writable: true, value: n }) : e[t] = n;
4008
+ var w = (e, t, n) => dt(e, typeof t != "symbol" ? t + "" : t, n);
4009
+ function D(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))
4035
+ function St(e, t) {
4036
+ e in u().callbackRegistry || (u().callbackRegistry[e] = (n) => {
4037
+ for (const r of N.get(e))
4018
4038
  r(n);
4019
- }, N.set(t, [])), N.get(t).push(e);
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) => {
4042
+ constructor(t, n = (r) => r) {
4043
+ w(this, "isResolved", false);
4044
+ w(this, "resolvedValue");
4045
+ this.handle = t, this.postProcess = n, St(t, (r) => {
4026
4046
  this.resolvedValue = n(r), 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
4054
  const r = this.postProcess(n);
4035
- return r ? e(r) : void 0;
4055
+ return r ? t(r) : 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 Q(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(
4069
+ resolve(...t) {
4070
+ const n = t.map(
4051
4071
  (r) => ({
4052
4072
  assertFieldType: "Input",
4053
4073
  ...typeof r == "string" ? { field: r } : r
@@ -4055,8 +4075,8 @@
4055
4075
  );
4056
4076
  return this.resolveWithCommon({}, ...n);
4057
4077
  }
4058
- resolveOutput(...e) {
4059
- const n = e.map(
4078
+ resolveOutput(...t) {
4079
+ const n = t.map(
4060
4080
  (r) => ({
4061
4081
  assertFieldType: "Output",
4062
4082
  ...typeof r == "string" ? { field: r } : r
@@ -4064,8 +4084,8 @@
4064
4084
  );
4065
4085
  return this.resolveWithCommon({}, ...n);
4066
4086
  }
4067
- resolveInput(...e) {
4068
- const n = e.map(
4087
+ resolveInput(...t) {
4088
+ const n = t.map(
4069
4089
  (r) => ({
4070
4090
  assertFieldType: "Input",
4071
4091
  ...typeof r == "string" ? { field: r } : r
@@ -4073,11 +4093,11 @@
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 Q(u().resolveWithCommon(this.handle, t, ...n));
4081
4101
  }
4082
4102
  get resourceType() {
4083
4103
  return u().getResourceType(this.handle);
@@ -4095,7 +4115,7 @@
4095
4115
  return u().getIsFinal(this.handle);
4096
4116
  }
4097
4117
  getError() {
4098
- return X(u().getError(this.handle));
4118
+ return Q(u().getError(this.handle));
4099
4119
  }
4100
4120
  listInputFields() {
4101
4121
  return u().listInputFields(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,15 +4144,15 @@
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);
4154
+ getPColumns(t = false, n = "") {
4155
+ const r = this.parsePObjectCollection(t, n);
4136
4156
  return r === void 0 ? void 0 : Object.entries(r).map(([, i]) => {
4137
4157
  if (!U$1(i)) throw new Error(`not a PColumn (kind = ${i.spec.kind})`);
4138
4158
  return i;
@@ -4141,17 +4161,17 @@
4141
4161
  /**
4142
4162
  *
4143
4163
  */
4144
- parsePObjectCollection(e = false, n = "") {
4164
+ parsePObjectCollection(t = false, n = "") {
4145
4165
  const r = u().parsePObjectCollection(
4146
4166
  this.handle,
4147
- e,
4167
+ t,
4148
4168
  n
4149
4169
  );
4150
4170
  if (r === void 0) return;
4151
- const s2 = {};
4171
+ const s = {};
4152
4172
  for (const [i, o2] of Object.entries(r))
4153
- s2[i] = Z$1(o2, (a) => new S(a));
4154
- return s2;
4173
+ s[i] = Z$1(o2, (l) => new _(l));
4174
+ return s;
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: r, requireLocked: s, 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 (s && (r === "Input" && !this.getInputsLocked() || r === "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 = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
4257
+ (c) => [c, this.resolve({ field: c, assertFieldType: r })]
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 it = "staging", ot = "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__", Z = "__LABEL__@1";
4269
+ function kt(e, t, n = {}) {
4270
+ const r = /* @__PURE__ */ new Map(), s = /* @__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], ct = 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
+ s.set(I, (s.get(I) ?? 0) + 1), r.set(
4263
4283
  I,
4264
4284
  Math.max(
4265
4285
  r.get(I) ?? Number.NEGATIVE_INFINITY,
4266
- ue - (b.length - _) * Re
4286
+ ct - (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 = [...r];
4297
+ a.sort(([, p], [, m]) => m - p);
4298
+ for (const [p] of a)
4299
+ p.endsWith("@1") || s.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(Z));
4310
+ }
4311
+ let f2 = 0, S2 = 0;
4312
+ for (; f2 < o2.length; ) {
4313
+ const p = /* @__PURE__ */ new Set();
4314
+ n.includeNativeLabel && p.add(Z);
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 Dt {
4304
4324
  constructor() {
4305
- v(this, "ctx", u());
4306
- v(this, "defaultLabelFn", (e, n) => {
4325
+ w(this, "ctx", u());
4326
+ w(this, "defaultLabelFn", (t, n) => {
4307
4327
  var r;
4308
- return ((r = e.annotations) == null ? void 0 : r["pl7.app/label"]) ?? "Unlabelled";
4328
+ return ((r = t.annotations) == null ? void 0 : r["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 r = this.getSpecs().entries.filter((s) => t(s.obj));
4339
+ return typeof n == "object" || typeof n > "u" ? kt(r, (s) => s.obj, n ?? {}).map(({ value: { ref: s }, label: i }) => ({
4340
+ ref: s,
4321
4341
  label: i
4322
- })) : r.map((s2) => ({
4323
- ref: s2.ref,
4324
- label: n(s2.obj, s2.ref)
4342
+ })) : r.map((s) => ({
4343
+ ref: s.ref,
4344
+ label: n(s.obj, s.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, (r) => new _(r))
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
4401
+ (r) => r.ref.blockId === t.blockId && r.ref.name === t.name
4382
4402
  )) == null ? void 0 : n.obj : Z$1(
4383
- this.ctx.getDataFromResultPoolByRef(e.blockId, e.name),
4384
- (r) => new S(r)
4403
+ this.ctx.getDataFromResultPoolByRef(t.blockId, t.name),
4404
+ (r) => new _(r)
4385
4405
  );
4386
4406
  }
4387
4407
  /**
@@ -4389,37 +4409,49 @@
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
  }
4417
+ /**
4418
+ * Returns spec associated with the ref ensuring that it is a p-column spec.
4419
+ * @param ref a Ref
4420
+ * @returns p-column spec associated with the ref
4421
+ */
4422
+ getPColumnSpecByRef(t) {
4423
+ const n = this.getSpecByRef(t);
4424
+ if (n) {
4425
+ if (!o(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
4426
+ return n;
4427
+ }
4428
+ }
4397
4429
  /**
4398
4430
  * @param ref a Ref
4399
4431
  * @returns object spec associated with the ref
4400
4432
  */
4401
- getSpecByRef(e) {
4433
+ getSpecByRef(t) {
4402
4434
  var n;
4403
4435
  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);
4436
+ (r) => r.ref.blockId === t.blockId && r.ref.name === t.name
4437
+ )) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(t.blockId, t.name);
4406
4438
  }
4407
4439
  /**
4408
4440
  * @param spec object specification
4409
4441
  * @returns array of data objects with compatible specs
4410
4442
  * @deprecated delete this method after Jan 1, 2025
4411
4443
  */
4412
- findDataWithCompatibleSpec(e) {
4444
+ findDataWithCompatibleSpec(t) {
4413
4445
  const n = [];
4414
- e: for (const r of this.getData().entries) {
4446
+ t: for (const r of this.getData().entries) {
4415
4447
  if (!o(r.obj.spec))
4416
4448
  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;
4449
+ const s = r.obj.spec;
4450
+ if (t.name === s.name && t.valueType === s.valueType && t.axesSpec.length === s.axesSpec.length && $(t.domain, s.domain)) {
4451
+ for (let i = 0; i < t.axesSpec.length; ++i) {
4452
+ const o2 = t.axesSpec[i], l = s.axesSpec[i];
4453
+ if (o2.name !== l.name || o2.type !== l.type || !$(o2.domain, l.domain))
4454
+ continue t;
4423
4455
  }
4424
4456
  n.push(r.obj);
4425
4457
  }
@@ -4427,27 +4459,27 @@
4427
4459
  return n;
4428
4460
  }
4429
4461
  }
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;
4462
+ function $(e, t) {
4463
+ if (e === void 0) return t === void 0;
4464
+ if (t === void 0) return true;
4465
+ for (const n in t)
4466
+ if (e[n] !== t[n]) return false;
4435
4467
  return true;
4436
4468
  }
4437
- class D {
4469
+ class k {
4438
4470
  constructor() {
4439
- v(this, "ctx");
4440
- v(this, "args");
4441
- v(this, "uiState");
4442
- v(this, "resultPool", new Oe());
4471
+ w(this, "ctx");
4472
+ w(this, "args");
4473
+ w(this, "uiState");
4474
+ w(this, "resultPool", new Dt());
4443
4475
  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
4476
  }
4445
- getNamedAccessor(e) {
4446
- const n = this.ctx.getAccessorHandleByName(e);
4447
- return n ? new S(n) : void 0;
4477
+ getNamedAccessor(t) {
4478
+ const n = this.ctx.getAccessorHandleByName(t);
4479
+ return n ? new _(n) : void 0;
4448
4480
  }
4449
4481
  get prerun() {
4450
- return this.getNamedAccessor(se);
4482
+ return this.getNamedAccessor(it);
4451
4483
  }
4452
4484
  /**
4453
4485
  * @deprecated use prerun
@@ -4462,7 +4494,7 @@
4462
4494
  return this.precalc;
4463
4495
  }
4464
4496
  get outputs() {
4465
- return this.getNamedAccessor(ie);
4497
+ return this.getNamedAccessor(ot);
4466
4498
  }
4467
4499
  /**
4468
4500
  * @deprecated use outputs
@@ -4474,15 +4506,15 @@
4474
4506
  * Find labels data for a given axis id. It will search for a label column and return its data as a map.
4475
4507
  * @returns a map of axis value => label
4476
4508
  */
4477
- findLabels(e) {
4509
+ findLabels(t) {
4478
4510
  const n = this.resultPool.getData();
4479
4511
  for (const r of n.entries) {
4480
4512
  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)) {
4513
+ const s = r.obj.spec;
4514
+ if (s.name === "pl7.app/label" && s.axesSpec.length === 1 && s.axesSpec[0].name === t.name && s.axesSpec[0].type === t.type && $(t.domain, s.axesSpec[0].domain)) {
4483
4515
  if (r.obj.data.resourceType.name !== "PColumnData/Json")
4484
4516
  throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
4485
- return new Map(
4517
+ return Object.fromEntries(
4486
4518
  Object.entries(
4487
4519
  r.obj.data.getDataAsJson().data
4488
4520
  ).map((o2) => [JSON.parse(o2[0])[0], o2[1]])
@@ -4490,140 +4522,75 @@
4490
4522
  }
4491
4523
  }
4492
4524
  }
4493
- createPFrame(e) {
4494
- return this.ctx.createPFrame(e.map((n) => Z$1(n, (r) => r.handle)));
4525
+ verifyInlineColumnsSupport(t) {
4526
+ var s;
4527
+ const n = t.some((i) => !(i.data instanceof _)), r = ((s = this.ctx.featureFlags) == null ? void 0 : s.inlineColumnsSupport) === true;
4528
+ if (n && !r) throw Error("inline columns not supported");
4495
4529
  }
4496
- createPTable(e) {
4530
+ createPFrame(t) {
4531
+ return this.verifyInlineColumnsSupport(t), this.ctx.createPFrame(t.map((n) => Z$1(
4532
+ n,
4533
+ (r) => r instanceof _ ? r.handle : r
4534
+ )));
4535
+ }
4536
+ createPTable(t) {
4497
4537
  var n;
4498
- return "columns" in e ? n = {
4538
+ return "columns" in t ? n = {
4499
4539
  src: {
4500
4540
  type: "full",
4501
- entries: e.columns.map((r) => ({ type: "column", column: r }))
4541
+ entries: t.columns.map((r) => ({ type: "column", column: r }))
4502
4542
  },
4503
- filters: e.filters ?? [],
4504
- sorting: e.sorting ?? []
4505
- } : n = e, this.ctx.createPTable(M$1(n, (r) => Z$1(r, (s2) => s2.handle)));
4543
+ filters: t.filters ?? [],
4544
+ sorting: t.sorting ?? []
4545
+ } : n = t, this.verifyInlineColumnsSupport(T(n.src)), this.ctx.createPTable(M(n, (r) => Z$1(
4546
+ r,
4547
+ (s) => s instanceof _ ? s.handle : s
4548
+ )));
4506
4549
  }
4507
4550
  /** @deprecated scheduled for removal from SDK */
4508
- getBlockLabel(e) {
4509
- return this.ctx.getBlockLabel(e);
4551
+ getBlockLabel(t) {
4552
+ return this.ctx.getBlockLabel(t);
4510
4553
  }
4511
4554
  getCurrentUnstableMarker() {
4512
4555
  if (!(typeof this.ctx.getCurrentUnstableMarker > "u"))
4513
4556
  return this.ctx.getCurrentUnstableMarker();
4514
4557
  }
4515
4558
  }
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;
4559
+ const P = "1.20.0";
4560
+ function xt(e) {
4561
+ return e.__renderLambda === true;
4595
4562
  }
4596
- function U(t) {
4597
- if (t !== void 0)
4598
- return ke(t) ? t.handle : t;
4563
+ function U(e) {
4564
+ if (e !== void 0)
4565
+ return xt(e) ? e.handle : e;
4599
4566
  }
4600
4567
  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;
4568
+ constructor(t, n, r, s, i, o2, l) {
4569
+ this._renderingMode = t, this._initialArgs = n, this._initialUiState = r, this._outputs = s, this._inputsValid = i, this._sections = o2, this._title = l;
4603
4570
  }
4604
- static create(e = "Heavy") {
4571
+ static create(t = "Heavy") {
4605
4572
  return new h(
4606
- e,
4573
+ t,
4607
4574
  void 0,
4608
4575
  {},
4609
4576
  {},
4610
- k(true),
4611
- k([]),
4577
+ D(true),
4578
+ D([]),
4612
4579
  void 0
4613
4580
  );
4614
4581
  }
4615
- output(e, n, r = {}) {
4582
+ output(t, n, r = {}) {
4616
4583
  if (typeof n == "function") {
4617
- const s2 = `output#${e}`;
4618
- return O(s2, () => n(new D())), new h(
4584
+ const s = `output#${t}`;
4585
+ return O(s, () => n(new k())), new h(
4619
4586
  this._renderingMode,
4620
4587
  this._initialArgs,
4621
4588
  this._initialUiState,
4622
4589
  {
4623
4590
  ...this._outputs,
4624
- [e]: {
4591
+ [t]: {
4625
4592
  __renderLambda: true,
4626
- handle: s2,
4593
+ handle: s,
4627
4594
  ...r
4628
4595
  }
4629
4596
  },
@@ -4638,7 +4605,7 @@
4638
4605
  this._initialUiState,
4639
4606
  {
4640
4607
  ...this._outputs,
4641
- [e]: n
4608
+ [t]: n
4642
4609
  },
4643
4610
  this._inputsValid,
4644
4611
  this._sections,
@@ -4646,15 +4613,15 @@
4646
4613
  );
4647
4614
  }
4648
4615
  /** Shortcut for {@link output} with retentive flag set to true. */
4649
- retentiveOutput(e, n) {
4650
- return this.output(e, n, { retentive: true });
4616
+ retentiveOutput(t, n) {
4617
+ return this.output(t, n, { retentive: true });
4651
4618
  }
4652
4619
  /** @deprecated */
4653
- canRun(e) {
4654
- return this.inputsValid(e);
4620
+ canRun(t) {
4621
+ return this.inputsValid(t);
4655
4622
  }
4656
- argsValid(e) {
4657
- return typeof e == "function" ? (O("inputsValid", () => e(new D())), new h(
4623
+ argsValid(t) {
4624
+ return typeof t == "function" ? (O("inputsValid", () => t(new k())), new h(
4658
4625
  this._renderingMode,
4659
4626
  this._initialArgs,
4660
4627
  this._initialUiState,
@@ -4670,16 +4637,16 @@
4670
4637
  this._initialArgs,
4671
4638
  this._initialUiState,
4672
4639
  this._outputs,
4673
- e,
4640
+ t,
4674
4641
  this._sections,
4675
4642
  this._title
4676
4643
  );
4677
4644
  }
4678
- inputsValid(e) {
4679
- return this.argsValid(e);
4645
+ inputsValid(t) {
4646
+ return this.argsValid(t);
4680
4647
  }
4681
- sections(e) {
4682
- return Array.isArray(e) ? this.sections(k(e)) : typeof e == "function" ? (O("sections", () => e(new D())), new h(
4648
+ sections(t) {
4649
+ return Array.isArray(t) ? this.sections(D(t)) : typeof t == "function" ? (O("sections", () => t(new k())), new h(
4683
4650
  this._renderingMode,
4684
4651
  this._initialArgs,
4685
4652
  this._initialUiState,
@@ -4693,12 +4660,12 @@
4693
4660
  this._initialUiState,
4694
4661
  this._outputs,
4695
4662
  this._inputsValid,
4696
- e,
4663
+ t,
4697
4664
  this._title
4698
4665
  );
4699
4666
  }
4700
- title(e) {
4701
- return O("title", () => e(new D())), new h(
4667
+ title(t) {
4668
+ return O("title", () => t(new k())), new h(
4702
4669
  this._renderingMode,
4703
4670
  this._initialArgs,
4704
4671
  this._initialUiState,
@@ -4712,10 +4679,10 @@
4712
4679
  * Sets initial args for the block, this value must be specified.
4713
4680
  * @deprecated use {@link withArgs}
4714
4681
  * */
4715
- initialArgs(e) {
4682
+ initialArgs(t) {
4716
4683
  return new h(
4717
4684
  this._renderingMode,
4718
- e,
4685
+ t,
4719
4686
  this._initialUiState,
4720
4687
  this._outputs,
4721
4688
  this._inputsValid,
@@ -4724,10 +4691,10 @@
4724
4691
  );
4725
4692
  }
4726
4693
  /** Sets initial args for the block, this value must be specified. */
4727
- withArgs(e) {
4694
+ withArgs(t) {
4728
4695
  return new h(
4729
4696
  this._renderingMode,
4730
- e,
4697
+ t,
4731
4698
  this._initialUiState,
4732
4699
  this._outputs,
4733
4700
  this._inputsValid,
@@ -4736,11 +4703,11 @@
4736
4703
  );
4737
4704
  }
4738
4705
  /** Defines type and sets initial value for block UiState. */
4739
- withUiState(e) {
4706
+ withUiState(t) {
4740
4707
  return new h(
4741
4708
  this._renderingMode,
4742
4709
  this._initialArgs,
4743
- e,
4710
+ t,
4744
4711
  this._outputs,
4745
4712
  this._inputsValid,
4746
4713
  this._sections,
@@ -4752,9 +4719,9 @@
4752
4719
  * other features provided by the platforma to the block. */
4753
4720
  done() {
4754
4721
  if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
4755
- const e = {
4722
+ const t = {
4756
4723
  v3: {
4757
- sdkVersion: C,
4724
+ sdkVersion: P,
4758
4725
  renderingMode: this._renderingMode,
4759
4726
  initialArgs: this._initialArgs,
4760
4727
  initialUiState: this._initialUiState,
@@ -4764,7 +4731,7 @@
4764
4731
  outputs: this._outputs
4765
4732
  },
4766
4733
  // fields below are added to allow previous desktop versions read generated configs
4767
- sdkVersion: C,
4734
+ sdkVersion: P,
4768
4735
  renderingMode: this._renderingMode,
4769
4736
  initialArgs: this._initialArgs,
4770
4737
  inputsValid: U(this._inputsValid),
@@ -4773,71 +4740,71 @@
4773
4740
  Object.entries(this._outputs).map(([n, r]) => [n, U(r)])
4774
4741
  )
4775
4742
  };
4776
- return _e() ? re({ sdkVersion: C }) : { config: e };
4743
+ return vt() ? st({ sdkVersion: P }) : { config: t };
4777
4744
  }
4778
4745
  }
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);
4746
+ function me(e, t, n, r) {
4747
+ var o2, l;
4748
+ const s = 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();
4749
+ for (const a of t)
4750
+ for (const c of a.spec.axesSpec) {
4751
+ const f2 = S(c);
4752
+ for (const S$1 of s)
4753
+ z(f2, S(S$1.spec.axesSpec[0])) && i.set(S$1.id, S$1);
4787
4754
  }
4788
- if (![...e, ...i.values()].find((l) => !l.data.getIsReadyOrError()))
4789
- return t.createPTable({
4755
+ if (![...t, ...i.values()].some(
4756
+ (a) => a.data instanceof _ && !a.data.getIsReadyOrError()
4757
+ ))
4758
+ return e.createPTable({
4790
4759
  src: {
4791
4760
  type: "outer",
4792
4761
  primary: {
4793
4762
  type: "full",
4794
- entries: e.map((l) => ({ type: "column", column: l }))
4763
+ entries: t.map((a) => ({ type: "column", column: a }))
4795
4764
  },
4796
- secondary: Array.from(i.values()).map((l) => ({ type: "column", column: l }))
4765
+ secondary: [...i.values()].map((a) => ({ type: "column", column: a }))
4797
4766
  },
4798
4767
  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) ?? []
4768
+ sorting: ((l = n == null ? void 0 : n.pTableParams) == null ? void 0 : l.sorting) ?? []
4800
4769
  });
4801
4770
  }
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
4771
  const $BlockArgs = z$1.object({
4814
4772
  numbers: z$1.array(z$1.coerce.number())
4815
4773
  });
4816
4774
  const platforma = h.create("Heavy").withArgs({ numbers: [1, 2, 3] }).withUiState({ dataTableState: void 0 }).output("numbers", (ctx) => {
4817
4775
  var _a, _b;
4818
4776
  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
4777
  }).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, [
4778
+ var _a, _b, _c, _d, _e;
4779
+ 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;
4780
+ return me(ctx, [
4781
+ {
4782
+ id: "example",
4783
+ spec: {
4784
+ kind: "PColumn",
4785
+ valueType: "String",
4786
+ name: "example",
4787
+ annotations: {
4788
+ "pl7.app/label": "String column"
4789
+ },
4790
+ axesSpec: [
4791
+ {
4792
+ type: "Int",
4793
+ name: "index",
4794
+ annotations: {
4795
+ "pl7.app/label": "Int axis"
4796
+ }
4797
+ }
4798
+ ]
4799
+ },
4800
+ data: [
4801
+ { key: [1], val: "1" },
4802
+ { key: [2], val: "2" }
4803
+ ]
4804
+ }
4805
+ ], ctx.uiState.dataTableState.tableState, [
4839
4806
  ...(_d = ctx.uiState.dataTableState.tableState.pTableParams) == null ? void 0 : _d.filters,
4840
- ...((_e2 = ctx.uiState.dataTableState.filterModel) == null ? void 0 : _e2.filters) ?? []
4807
+ ...((_e = ctx.uiState.dataTableState.filterModel) == null ? void 0 : _e.filters) ?? []
4841
4808
  ]);
4842
4809
  }).sections((ctx) => {
4843
4810
  return [