@platforma-open/milaboratories.repertoire-diversity-2.model 1.1.2 → 1.2.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
@@ -43,7 +43,7 @@
43
43
  return canonicalize;
44
44
  }
45
45
  var canonicalizeExports = requireCanonicalize();
46
- const Pe = /* @__PURE__ */ getDefaultExportFromCjs(canonicalizeExports);
46
+ const _e = /* @__PURE__ */ getDefaultExportFromCjs(canonicalizeExports);
47
47
  var util;
48
48
  (function(util2) {
49
49
  util2.assertEqual = (val) => val;
@@ -95,7 +95,7 @@
95
95
  return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
96
96
  }
97
97
  util2.joinValues = joinValues;
98
- util2.jsonStringifyReplacer = (_2, value) => {
98
+ util2.jsonStringifyReplacer = (_, value) => {
99
99
  if (typeof value === "bigint") {
100
100
  return value.toString();
101
101
  }
@@ -3111,7 +3111,7 @@
3111
3111
  });
3112
3112
  }
3113
3113
  const params = { errorMap: ctx.common.contextualErrorMap };
3114
- const fn2 = ctx.data;
3114
+ const fn = ctx.data;
3115
3115
  if (this._def.returns instanceof ZodPromise) {
3116
3116
  const me = this;
3117
3117
  return OK(async function(...args) {
@@ -3120,7 +3120,7 @@
3120
3120
  error.addIssue(makeArgsIssue(args, e));
3121
3121
  throw error;
3122
3122
  });
3123
- const result = await Reflect.apply(fn2, this, parsedArgs);
3123
+ const result = await Reflect.apply(fn, this, parsedArgs);
3124
3124
  const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
3125
3125
  error.addIssue(makeReturnsIssue(result, e));
3126
3126
  throw error;
@@ -3134,7 +3134,7 @@
3134
3134
  if (!parsedArgs.success) {
3135
3135
  throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
3136
3136
  }
3137
- const result = Reflect.apply(fn2, this, parsedArgs.data);
3137
+ const result = Reflect.apply(fn, this, parsedArgs.data);
3138
3138
  const parsedReturns = me._def.returns.safeParse(result, params);
3139
3139
  if (!parsedReturns.success) {
3140
3140
  throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
@@ -3956,13 +3956,13 @@
3956
3956
  quotelessJson,
3957
3957
  ZodError
3958
3958
  });
3959
- var $ = Object.defineProperty;
3960
- var D = (n2, t, e) => t in n2 ? $(n2, t, { enumerable: true, configurable: true, writable: true, value: e }) : n2[t] = e;
3961
- var m$2 = (n2, t, e) => D(n2, typeof t != "symbol" ? t + "" : t, e);
3959
+ var I$1 = Object.defineProperty;
3960
+ var $ = (n2, t, e) => t in n2 ? I$1(n2, t, { enumerable: true, configurable: true, writable: true, value: e }) : n2[t] = e;
3961
+ var m$2 = (n2, t, e) => $(n2, typeof t != "symbol" ? t + "" : t, e);
3962
3962
  function w(n2) {
3963
3963
  throw new Error("Unexpected object: " + n2);
3964
3964
  }
3965
- function pn(n2) {
3965
+ function mn(n2) {
3966
3966
  if (!n2 || typeof n2 != "object")
3967
3967
  return false;
3968
3968
  const t = n2;
@@ -3979,7 +3979,7 @@
3979
3979
  return false;
3980
3980
  }
3981
3981
  }
3982
- function mn(n2, t) {
3982
+ function yn(n2, t) {
3983
3983
  if (n2 !== void 0)
3984
3984
  switch (n2.type) {
3985
3985
  case "Json":
@@ -4024,10 +4024,10 @@
4024
4024
  return false;
4025
4025
  }
4026
4026
  }
4027
- function yn(n2) {
4027
+ function ln(n2) {
4028
4028
  return j(n2) ? n2.type === "JsonPartitioned" || n2.type === "BinaryPartitioned" : false;
4029
4029
  }
4030
- function ln(n2) {
4030
+ function hn(n2) {
4031
4031
  switch (n2.type) {
4032
4032
  case "Json": {
4033
4033
  const t = Object.entries(n2.data).map(([e, r]) => ({ key: JSON.parse(e), value: r }));
@@ -4055,7 +4055,7 @@
4055
4055
  }
4056
4056
  }
4057
4057
  }
4058
- function hn(n2) {
4058
+ function gn(n2) {
4059
4059
  switch (n2.type) {
4060
4060
  case "Json": {
4061
4061
  const t = {};
@@ -4089,12 +4089,31 @@
4089
4089
  }
4090
4090
  }
4091
4091
  }
4092
+ function En(n2) {
4093
+ return {
4094
+ kind: n2.kind,
4095
+ valueType: n2.valueType,
4096
+ name: n2.name,
4097
+ domain: n2.domain,
4098
+ parentAxes: n2.parentAxes,
4099
+ axesId: z(n2.axesSpec)
4100
+ };
4101
+ }
4102
+ function Cn$1(n2) {
4103
+ return {
4104
+ columnId: n2.id,
4105
+ spec: n2.spec
4106
+ };
4107
+ }
4092
4108
  function p$1(n2) {
4093
4109
  const { type: t, name: e, domain: r } = n2;
4094
4110
  return { type: t, name: e, ...r && { domain: r } };
4095
4111
  }
4096
- function En(n2) {
4097
- return Pe(p$1(n2));
4112
+ function z(n2) {
4113
+ return n2.map(p$1);
4114
+ }
4115
+ function Jn(n2) {
4116
+ return _e(p$1(n2));
4098
4117
  }
4099
4118
  function X$1(n2, t) {
4100
4119
  if (n2 === void 0) return t === void 0;
@@ -4103,10 +4122,10 @@
4103
4122
  if (n2[e] !== t[e]) return false;
4104
4123
  return true;
4105
4124
  }
4106
- function z(n2, t) {
4125
+ function G(n2, t) {
4107
4126
  return n2.name === t.name && X$1(n2.domain, t.domain);
4108
4127
  }
4109
- function Cn(n2, t) {
4128
+ function On(n2, t) {
4110
4129
  return { ...n2, src: l$1(n2.src, t) };
4111
4130
  }
4112
4131
  function l$1(n2, t) {
@@ -4139,16 +4158,16 @@
4139
4158
  w(n2);
4140
4159
  }
4141
4160
  }
4142
- function G(n2) {
4143
- return Pe(n2);
4161
+ function Q(n2) {
4162
+ return _e(n2);
4144
4163
  }
4145
- function A(n2) {
4146
- return Pe(p$1(n2));
4164
+ function x(n2) {
4165
+ return _e(p$1(n2));
4147
4166
  }
4148
- function x(n2, t) {
4167
+ function A(n2, t) {
4149
4168
  return JSON.stringify([n2, t]);
4150
4169
  }
4151
- class On {
4170
+ class $n {
4152
4171
  /**
4153
4172
  * Creates a new anchor context from a set of anchor column specifications
4154
4173
  * @param anchors Record of anchor column specifications indexed by anchor ID
@@ -4163,14 +4182,14 @@
4163
4182
  e.sort((r, o) => r[0].localeCompare(o[0]));
4164
4183
  for (const [r, o] of e) {
4165
4184
  for (let s2 = 0; s2 < o.axesSpec.length; s2++) {
4166
- const a = o.axesSpec[s2], i = A(a);
4185
+ const a = o.axesSpec[s2], i = x(a);
4167
4186
  this.axes.set(i, { anchor: r, idx: s2 });
4168
4187
  }
4169
4188
  if (o.domain !== void 0) {
4170
4189
  const s2 = Object.entries(o.domain);
4171
4190
  s2.sort((a, i) => a[0].localeCompare(i[0])), this.domainPackToAnchor.set(JSON.stringify(s2), r), this.domainPacks.push(s2.map(([a]) => a));
4172
4191
  for (const [a, i] of s2) {
4173
- const u2 = x(a, i);
4192
+ const u2 = A(a, i);
4174
4193
  this.domains.set(u2, r);
4175
4194
  }
4176
4195
  }
@@ -4205,11 +4224,11 @@
4205
4224
  for (const [a, i] of Object.entries(t.domain ?? {})) {
4206
4225
  if (o !== void 0 && o.has(a))
4207
4226
  continue;
4208
- const u2 = x(a, i), c2 = this.domains.get(u2);
4227
+ const u2 = A(a, i), c2 = this.domains.get(u2);
4209
4228
  r.domain ?? (r.domain = {}), r.domain[a] = c2 ? { anchor: c2 } : i;
4210
4229
  }
4211
4230
  if (r.axes = t.axesSpec.map((a) => {
4212
- const i = A(a), u2 = this.axes.get(i);
4231
+ const i = x(a), u2 = this.axes.get(i);
4213
4232
  return u2 === void 0 ? p$1(a) : u2;
4214
4233
  }), !e || e.length === 0)
4215
4234
  return r;
@@ -4239,10 +4258,10 @@
4239
4258
  * @returns A canonicalized string representation of the anchored column identifier
4240
4259
  */
4241
4260
  deriveS(t, e) {
4242
- return G(this.derive(t, e));
4261
+ return Q(this.derive(t, e));
4243
4262
  }
4244
4263
  }
4245
- function $n(n2, t, e) {
4264
+ function Dn(n2, t, e) {
4246
4265
  const r = { ...t }, o = (e == null ? void 0 : e.ignoreMissingDomains) ?? false;
4247
4266
  if (r.domainAnchor !== void 0) {
4248
4267
  const s2 = n2[r.domainAnchor];
@@ -4269,10 +4288,10 @@
4269
4288
  }
4270
4289
  r.domain = s2;
4271
4290
  }
4272
- return r.axes && (r.axes = r.axes.map((s2) => Q(n2, s2))), r;
4291
+ return r.axes && (r.axes = r.axes.map((s2) => Y$1(n2, s2))), r;
4273
4292
  }
4274
- function Q(n2, t) {
4275
- if (!Y$1(t))
4293
+ function Y$1(n2, t) {
4294
+ if (!Z$1(t))
4276
4295
  return t;
4277
4296
  const e = t.anchor, r = n2[e];
4278
4297
  if (!r)
@@ -4289,7 +4308,7 @@
4289
4308
  throw new Error(`Axis with name "${t.name}" not found in anchor "${e}"`);
4290
4309
  return o[0];
4291
4310
  } else if ("id" in t) {
4292
- const o = r.axesSpec.filter((s2) => z(t.id, p$1(s2)));
4311
+ const o = r.axesSpec.filter((s2) => G(t.id, p$1(s2)));
4293
4312
  if (o.length > 1)
4294
4313
  throw new Error(`Multiple matching axes found for matcher in anchor "${e}"`);
4295
4314
  if (o.length === 0)
@@ -4298,26 +4317,26 @@
4298
4317
  }
4299
4318
  throw new Error("Unsupported axis reference type");
4300
4319
  }
4301
- function Y$1(n2) {
4320
+ function Z$1(n2) {
4302
4321
  return typeof n2 == "object" && "anchor" in n2;
4303
4322
  }
4304
4323
  function f(n2) {
4305
4324
  return n2.kind === "PColumn";
4306
4325
  }
4307
- function Z$1(n2) {
4326
+ function q(n2) {
4308
4327
  return f(n2.spec);
4309
4328
  }
4310
- function In(n2) {
4311
- if (!Z$1(n2)) throw new Error(`not a PColumn (kind = ${n2.spec.kind})`);
4329
+ function jn(n2) {
4330
+ if (!q(n2)) throw new Error(`not a PColumn (kind = ${n2.spec.kind})`);
4312
4331
  return n2;
4313
4332
  }
4314
- function Bn(n2, t) {
4333
+ function Fn(n2, t) {
4315
4334
  return n2 === void 0 ? void 0 : {
4316
4335
  ...n2,
4317
4336
  data: t(n2.data)
4318
4337
  };
4319
4338
  }
4320
- function jn(n2) {
4339
+ function Un(n2) {
4321
4340
  const t = /* @__PURE__ */ new Map(), e = (r) => {
4322
4341
  switch (r.type) {
4323
4342
  case "column":
@@ -4404,7 +4423,7 @@
4404
4423
  }
4405
4424
  return true;
4406
4425
  }
4407
- function Fn(n2) {
4426
+ function Kn(n2) {
4408
4427
  return Array.isArray(n2) ? (t) => n2.some((e) => f(t) && N(t, e)) : (t) => f(t) && N(t, n2);
4409
4428
  }
4410
4429
  z$1.object({
@@ -4414,14 +4433,17 @@
4414
4433
  }).describe(
4415
4434
  "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."
4416
4435
  ).strict().readonly();
4417
- function Rn(n2) {
4436
+ function Tn(n2) {
4418
4437
  return typeof n2 == "object" && n2 !== null && "__isRef" in n2 && n2.__isRef === true && "blockId" in n2 && "name" in n2;
4419
4438
  }
4420
- function _n(n2, t) {
4439
+ function _n$1(n2, t) {
4421
4440
  return n2.ok ? { ok: true, value: t(n2.value) } : n2;
4422
4441
  }
4423
- const on = 24;
4424
- z$1.string().length(on).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
4442
+ const sn = 24;
4443
+ z$1.string().length(sn).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
4444
+ function Xn(n2) {
4445
+ return _e(n2);
4446
+ }
4425
4447
  var stringify = { exports: {} };
4426
4448
  var hasRequiredStringify;
4427
4449
  function requireStringify() {
@@ -4481,22 +4503,22 @@
4481
4503
  cause: z$1.lazy(() => n).optional(),
4482
4504
  errors: z$1.lazy(() => n.array()).optional()
4483
4505
  });
4484
- var je = Object.defineProperty;
4485
- var Ke = (t, e, n2) => e in t ? je(t, e, { enumerable: true, configurable: true, writable: true, value: n2 }) : t[e] = n2;
4486
- var L = (t, e, n2) => Ke(t, typeof e != "symbol" ? e + "" : e, n2);
4506
+ var Ue = Object.defineProperty;
4507
+ var Me = (t, e, n2) => e in t ? Ue(t, e, { enumerable: true, configurable: true, writable: true, value: n2 }) : t[e] = n2;
4508
+ var L = (t, e, n2) => Me(t, typeof e != "symbol" ? e + "" : e, n2);
4487
4509
  function Z(t) {
4488
4510
  return { type: "Immediate", value: t };
4489
4511
  }
4490
- function Xe() {
4512
+ function it() {
4491
4513
  return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
4492
4514
  }
4493
- function _e(t) {
4515
+ function Te(t) {
4494
4516
  if (t && typeof globalThis.getPlatforma == "function")
4495
4517
  return globalThis.getPlatforma(t);
4496
4518
  if (typeof globalThis.platforma < "u") return globalThis.platforma;
4497
4519
  throw new Error("Can't get platforma instance.");
4498
4520
  }
4499
- function Qe() {
4521
+ function st() {
4500
4522
  if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
4501
4523
  }
4502
4524
  function m() {
@@ -4504,31 +4526,31 @@
4504
4526
  throw new Error("Not in config rendering context");
4505
4527
  }
4506
4528
  function Y(t, e) {
4507
- const n2 = Qe();
4529
+ const n2 = st();
4508
4530
  if (n2 === void 0) return false;
4509
4531
  if (t in n2.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
4510
4532
  return n2.callbackRegistry[t] = e, true;
4511
4533
  }
4512
4534
  const ae = /* @__PURE__ */ new Map();
4513
- function Ze(t, e) {
4535
+ function ot(t, e) {
4514
4536
  t in m().callbackRegistry || (m().callbackRegistry[t] = (n2) => {
4515
4537
  for (const r of ae.get(t))
4516
4538
  r(n2);
4517
4539
  }, ae.set(t, [])), ae.get(t).push(e);
4518
4540
  }
4519
- class C {
4541
+ class S {
4520
4542
  constructor(e, n2 = (r) => r) {
4521
4543
  L(this, "isResolved", false);
4522
4544
  L(this, "resolvedValue");
4523
- this.handle = e, this.postProcess = n2, Ze(e, (r) => {
4545
+ this.handle = e, this.postProcess = n2, ot(e, (r) => {
4524
4546
  this.resolvedValue = n2(r), this.isResolved = true;
4525
4547
  });
4526
4548
  }
4527
4549
  map(e) {
4528
- return new C(this.handle, (n2) => e(this.postProcess(n2)));
4550
+ return new S(this.handle, (n2) => e(this.postProcess(n2)));
4529
4551
  }
4530
4552
  mapDefined(e) {
4531
- return new C(this.handle, (n2) => {
4553
+ return new S(this.handle, (n2) => {
4532
4554
  const r = this.postProcess(n2);
4533
4555
  return r ? e(r) : void 0;
4534
4556
  });
@@ -4540,7 +4562,7 @@
4540
4562
  function pe(t, e) {
4541
4563
  return t === void 0 ? void 0 : e(t);
4542
4564
  }
4543
- class _ {
4565
+ class I {
4544
4566
  constructor(e, n2) {
4545
4567
  this.handle = e, this.resolvePath = n2;
4546
4568
  }
@@ -4581,7 +4603,7 @@
4581
4603
  ];
4582
4604
  return pe(
4583
4605
  m().resolveWithCommon(this.handle, e, ...n2),
4584
- (i) => new _(i, r)
4606
+ (i) => new I(i, r)
4585
4607
  );
4586
4608
  }
4587
4609
  get resourceType() {
@@ -4603,7 +4625,7 @@
4603
4625
  const e = [...this.resolvePath, "error"];
4604
4626
  return pe(
4605
4627
  m().getError(this.handle),
4606
- (n2) => new _(n2, e)
4628
+ (n2) => new I(n2, e)
4607
4629
  );
4608
4630
  }
4609
4631
  listInputFields() {
@@ -4643,7 +4665,7 @@
4643
4665
  getPColumns(e = false, n2 = "") {
4644
4666
  const r = this.parsePObjectCollection(e, n2);
4645
4667
  return r === void 0 ? void 0 : Object.entries(r).map(([, s2]) => {
4646
- if (!Z$1(s2)) throw new Error(`not a PColumn (kind = ${s2.spec.kind})`);
4668
+ if (!q(s2)) throw new Error(`not a PColumn (kind = ${s2.spec.kind})`);
4647
4669
  return s2;
4648
4670
  });
4649
4671
  }
@@ -4661,18 +4683,18 @@
4661
4683
  const i = {};
4662
4684
  for (const [s2, o] of Object.entries(r)) {
4663
4685
  const a = [...this.resolvePath, s2];
4664
- i[s2] = Bn(o, (l2) => new _(l2, a));
4686
+ i[s2] = Fn(o, (l2) => new I(l2, a));
4665
4687
  }
4666
4688
  return i;
4667
4689
  }
4668
4690
  getFileContentAsBase64() {
4669
- return new C(m().getBlobContentAsBase64(this.handle));
4691
+ return new S(m().getBlobContentAsBase64(this.handle));
4670
4692
  }
4671
4693
  getFileContentAsString() {
4672
- return new C(m().getBlobContentAsString(this.handle));
4694
+ return new S(m().getBlobContentAsString(this.handle));
4673
4695
  }
4674
4696
  getFileContentAsJson() {
4675
- return new C(
4697
+ return new S(
4676
4698
  m().getBlobContentAsString(this.handle)
4677
4699
  ).mapDefined((e) => JSON.parse(e));
4678
4700
  }
@@ -4692,7 +4714,7 @@
4692
4714
  * @returns downloaded file handle
4693
4715
  */
4694
4716
  getFileHandle() {
4695
- return new C(m().getDownloadedBlobContentHandle(this.handle));
4717
+ return new S(m().getDownloadedBlobContentHandle(this.handle));
4696
4718
  }
4697
4719
  /**
4698
4720
  * @deprecated use getFileHandle
@@ -4704,7 +4726,7 @@
4704
4726
  * @returns downloaded file handle
4705
4727
  */
4706
4728
  getRemoteFileHandle() {
4707
- return new C(m().getOnDemandBlobContentHandle(this.handle));
4729
+ return new S(m().getOnDemandBlobContentHandle(this.handle));
4708
4730
  }
4709
4731
  /**
4710
4732
  * @deprecated use getRemoteFileHandle
@@ -4716,22 +4738,22 @@
4716
4738
  * @returns the url to the extracted folder
4717
4739
  */
4718
4740
  extractArchiveAndGetURL(e) {
4719
- return new C(m().extractArchiveAndGetURL(this.handle, e));
4741
+ return new S(m().extractArchiveAndGetURL(this.handle, e));
4720
4742
  }
4721
4743
  getImportProgress() {
4722
- return new C(m().getImportProgress(this.handle));
4744
+ return new S(m().getImportProgress(this.handle));
4723
4745
  }
4724
4746
  getLastLogs(e) {
4725
- return new C(m().getLastLogs(this.handle, e));
4747
+ return new S(m().getLastLogs(this.handle, e));
4726
4748
  }
4727
4749
  getProgressLog(e) {
4728
- return new C(m().getProgressLog(this.handle, e));
4750
+ return new S(m().getProgressLog(this.handle, e));
4729
4751
  }
4730
4752
  getProgressLogWithInfo(e) {
4731
- return new C(m().getProgressLogWithInfo(this.handle, e));
4753
+ return new S(m().getProgressLogWithInfo(this.handle, e));
4732
4754
  }
4733
4755
  getLogHandle() {
4734
- return new C(m().getLogHandle(this.handle));
4756
+ return new S(m().getLogHandle(this.handle));
4735
4757
  }
4736
4758
  allFieldsResolved(e = "Input") {
4737
4759
  switch (e) {
@@ -4757,89 +4779,89 @@
4757
4779
  let l2 = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
4758
4780
  (u2) => [u2, this.resolve({ field: u2, assertFieldType: r })]
4759
4781
  );
4760
- return s2 && (l2 = l2.filter((u2) => u2[1] !== void 0)), l2.map(([u2, S]) => o(u2, S));
4782
+ return s2 && (l2 = l2.filter((u2) => u2[1] !== void 0)), l2.map(([u2, y]) => o(u2, y));
4761
4783
  }
4762
4784
  }
4763
- const Ie = "staging", Le = "main";
4764
- const nt = "pl7.app/label", rt = "pl7.app/trace", it = z$1.object({
4785
+ const Ee = "staging", Fe = "main";
4786
+ const ut = "pl7.app/label", ct = "pl7.app/trace", pt = z$1.object({
4765
4787
  type: z$1.string(),
4766
4788
  importance: z$1.number().optional(),
4767
4789
  id: z$1.string().optional(),
4768
4790
  label: z$1.string()
4769
- }), st = z$1.array(it), ot = 1e-3, at = "__LABEL__", ve = "__LABEL__@1";
4770
- function Ee(t, e, n2 = {}) {
4771
- const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s2 = t.map((p2) => {
4772
- var q, F;
4773
- const c2 = e(p2);
4774
- let h, A2, y;
4775
- "spec" in c2 && typeof c2.spec == "object" ? (h = c2.spec, A2 = c2.prefixTrace, y = c2.suffixTrace) : h = c2;
4776
- const v = (q = h.annotations) == null ? void 0 : q[nt], g = (F = h.annotations) == null ? void 0 : F[rt], P = (g ? st.safeParse(JSON.parse(g)).data : void 0) ?? [], b = [
4777
- ...A2 ?? [],
4778
- ...P,
4779
- ...y ?? []
4791
+ }), dt = z$1.array(pt), ft = 1e-3, ht = "__LABEL__", Ae = "__LABEL__@1";
4792
+ function Oe(t, e, n2 = {}) {
4793
+ const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s2 = t.map((f2) => {
4794
+ var q2, F;
4795
+ const h = e(f2);
4796
+ let d, x2, c2;
4797
+ "spec" in h && typeof h.spec == "object" ? (d = h.spec, x2 = h.prefixTrace, c2 = h.suffixTrace) : d = h;
4798
+ const v = (q2 = d.annotations) == null ? void 0 : q2[ut], g = (F = d.annotations) == null ? void 0 : F[ct], b = (g ? dt.safeParse(JSON.parse(g)).data : void 0) ?? [], A2 = [
4799
+ ...x2 ?? [],
4800
+ ...b,
4801
+ ...c2 ?? []
4780
4802
  ];
4781
4803
  if (v) {
4782
- const I = { label: v, type: at, importance: -2 };
4783
- n2.addLabelAsSuffix ? b.push(I) : b.splice(0, 0, I);
4804
+ const _ = { label: v, type: ht, importance: -2 };
4805
+ n2.addLabelAsSuffix ? A2.push(_) : A2.splice(0, 0, _);
4784
4806
  }
4785
- const k2 = [], $2 = /* @__PURE__ */ new Map();
4786
- for (let I = b.length - 1; I >= 0; --I) {
4787
- const { type: R } = b[I], se = b[I].importance ?? 0, J = ($2.get(R) ?? 0) + 1;
4807
+ const D = [], $2 = /* @__PURE__ */ new Map();
4808
+ for (let _ = A2.length - 1; _ >= 0; --_) {
4809
+ const { type: R } = A2[_], se = A2[_].importance ?? 0, J = ($2.get(R) ?? 0) + 1;
4788
4810
  $2.set(R, J);
4789
- const w2 = `${R}@${J}`;
4790
- i.set(w2, (i.get(w2) ?? 0) + 1), r.set(
4791
- w2,
4811
+ const P = `${R}@${J}`;
4812
+ i.set(P, (i.get(P) ?? 0) + 1), r.set(
4813
+ P,
4792
4814
  Math.max(
4793
- r.get(w2) ?? Number.NEGATIVE_INFINITY,
4794
- se - (b.length - I) * ot
4815
+ r.get(P) ?? Number.NEGATIVE_INFINITY,
4816
+ se - (A2.length - _) * ft
4795
4817
  )
4796
- ), k2.push({ ...b[I], fullType: w2, occurenceIndex: J });
4818
+ ), D.push({ ...A2[_], fullType: P, occurenceIndex: J });
4797
4819
  }
4798
- return k2.reverse(), {
4799
- value: p2,
4800
- spec: h,
4820
+ return D.reverse(), {
4821
+ value: f2,
4822
+ spec: d,
4801
4823
  label: v,
4802
- fullTrace: k2
4824
+ fullTrace: D
4803
4825
  };
4804
4826
  }), o = [], a = [], l2 = [...r];
4805
- l2.sort(([, p2], [, c2]) => c2 - p2);
4806
- for (const [p2] of l2)
4807
- p2.endsWith("@1") || i.get(p2) === t.length ? o.push(p2) : a.push(p2);
4808
- const u2 = (p2) => {
4809
- const c2 = [];
4810
- for (let h = 0; h < s2.length; h++) {
4811
- const A2 = s2[h], y = A2.fullTrace.filter((P) => p2.has(P.fullType));
4812
- if (y.length === 0)
4827
+ l2.sort(([, f2], [, h]) => h - f2);
4828
+ for (const [f2] of l2)
4829
+ f2.endsWith("@1") || i.get(f2) === t.length ? o.push(f2) : a.push(f2);
4830
+ const u2 = (f2) => {
4831
+ const h = [];
4832
+ for (let d = 0; d < s2.length; d++) {
4833
+ const x2 = s2[d], c2 = x2.fullTrace.filter((b) => f2.has(b.fullType));
4834
+ if (c2.length === 0)
4813
4835
  return;
4814
- const v = y.map((P) => P.label), g = n2.separator ?? " / ";
4815
- c2.push({
4836
+ const v = c2.map((b) => b.label), g = n2.separator ?? " / ";
4837
+ h.push({
4816
4838
  label: v.join(g),
4817
- value: A2.value
4839
+ value: x2.value
4818
4840
  });
4819
4841
  }
4820
- return c2;
4842
+ return h;
4821
4843
  };
4822
4844
  if (o.length === 0) {
4823
4845
  if (a.length !== 0) throw new Error("Assertion error.");
4824
- const p2 = u2(new Set(ve));
4825
- if (p2 === void 0) throw new Error("Assertion error.");
4826
- return p2;
4846
+ const f2 = u2(new Set(Ae));
4847
+ if (f2 === void 0) throw new Error("Assertion error.");
4848
+ return f2;
4827
4849
  }
4828
- let S = 0, d = 0;
4829
- for (; S < o.length; ) {
4830
- const p2 = /* @__PURE__ */ new Set();
4831
- n2.includeNativeLabel && p2.add(ve);
4832
- for (let h = 0; h < S; ++h) p2.add(o[h]);
4833
- p2.add(o[d]);
4834
- const c2 = u2(p2);
4835
- if (c2 !== void 0 && new Set(c2.map((h) => h.label)).size === t.length) return c2;
4836
- d++, d >= o.length && (S++, d = S);
4837
- }
4838
- const f2 = u2(/* @__PURE__ */ new Set([...o, ...a]));
4839
- if (f2 === void 0) throw new Error("Assertion error.");
4840
- return f2;
4841
- }
4842
- const H = "PColumnData/", te = H + "ResourceMap", ne = H + "Partitioned/ResourceMap", U = H + "JsonPartitioned", V = H + "BinaryPartitioned", Fe = H + "Partitioned/", re = Fe + "JsonPartitioned", B = Fe + "BinaryPartitioned";
4850
+ let y = 0, w2 = 0;
4851
+ for (; y < o.length; ) {
4852
+ const f2 = /* @__PURE__ */ new Set();
4853
+ n2.includeNativeLabel && f2.add(Ae);
4854
+ for (let d = 0; d < y; ++d) f2.add(o[d]);
4855
+ f2.add(o[w2]);
4856
+ const h = u2(f2);
4857
+ if (h !== void 0 && new Set(h.map((d) => d.label)).size === t.length) return h;
4858
+ w2++, w2 >= o.length && (y++, w2 = y);
4859
+ }
4860
+ const p2 = u2(/* @__PURE__ */ new Set([...o, ...a]));
4861
+ if (p2 === void 0) throw new Error("Assertion error.");
4862
+ return p2;
4863
+ }
4864
+ const H = "PColumnData/", ne = H + "ResourceMap", re = H + "Partitioned/ResourceMap", B = H + "JsonPartitioned", K = H + "BinaryPartitioned", Re = H + "Partitioned/", ie = Re + "JsonPartitioned", U = Re + "BinaryPartitioned";
4843
4865
  const fe = (t) => {
4844
4866
  if (t.endsWith(".index"))
4845
4867
  return { baseKey: t.substring(0, t.length - 6), type: "index" };
@@ -4847,44 +4869,44 @@
4847
4869
  return { baseKey: t.substring(0, t.length - 7), type: "values" };
4848
4870
  throw new Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
4849
4871
  };
4850
- function lt(t) {
4872
+ function gt(t) {
4851
4873
  if (!t) return;
4852
4874
  const e = t.resourceType.name, n2 = t.getDataAsJson(), r = [];
4853
4875
  let i = 0;
4854
4876
  switch (e) {
4855
- case te:
4877
+ case ne:
4856
4878
  i = n2.keyLength;
4857
4879
  break;
4858
- case ne:
4880
+ case re:
4859
4881
  i = n2.partitionKeyLength + n2.keyLength;
4860
4882
  break;
4861
- case U:
4862
- case V:
4883
+ case B:
4884
+ case K:
4863
4885
  i = n2.partitionKeyLength;
4864
4886
  break;
4865
- case B:
4866
- case re:
4887
+ case U:
4888
+ case ie:
4867
4889
  i = n2.superPartitionKeyLength + n2.partitionKeyLength;
4868
4890
  break;
4869
4891
  }
4870
4892
  switch (e) {
4871
- case te:
4872
- case U:
4873
- case V:
4893
+ case ne:
4894
+ case B:
4895
+ case K:
4874
4896
  for (let s2 of t.listInputFields()) {
4875
- e === V && (s2 = fe(s2).baseKey);
4897
+ e === K && (s2 = fe(s2).baseKey);
4876
4898
  const o = [...JSON.parse(s2)];
4877
4899
  r.push(o);
4878
4900
  }
4879
4901
  break;
4880
- case ne:
4881
- case B:
4882
4902
  case re:
4903
+ case U:
4904
+ case ie:
4883
4905
  for (const s2 of t.listInputFields()) {
4884
4906
  const o = [...JSON.parse(s2)], a = t.resolve({ field: s2, assertFieldType: "Input" });
4885
4907
  if (a !== void 0)
4886
4908
  for (let l2 of a.listInputFields()) {
4887
- e === B && (l2 = fe(l2).baseKey);
4909
+ e === U && (l2 = fe(l2).baseKey);
4888
4910
  const u2 = [...o, ...JSON.parse(l2)];
4889
4911
  r.push(u2);
4890
4912
  }
@@ -4893,7 +4915,7 @@
4893
4915
  }
4894
4916
  return { data: r, keyLength: i };
4895
4917
  }
4896
- function ut(t) {
4918
+ function mt(t) {
4897
4919
  if (t.type !== "JsonPartitioned" && t.type !== "BinaryPartitioned")
4898
4920
  throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${t.type}`);
4899
4921
  const { parts: e, partitionKeyLength: n2 } = t, r = [];
@@ -4912,11 +4934,11 @@
4912
4934
  }
4913
4935
  return r.map((i) => Array.from(i.values()));
4914
4936
  }
4915
- function ct(t) {
4937
+ function yt(t) {
4916
4938
  if (t === void 0) return;
4917
4939
  if (j(t))
4918
- return ut(t);
4919
- const e = lt(t);
4940
+ return mt(t);
4941
+ const e = gt(t);
4920
4942
  if (!e) return;
4921
4943
  const { data: n2, keyLength: r } = e, i = [];
4922
4944
  for (let s2 = 0; s2 < r; ++s2)
@@ -4932,13 +4954,13 @@
4932
4954
  function he(t, e = []) {
4933
4955
  if (t === void 0 || !t.getIsReadyOrError()) return;
4934
4956
  const n2 = t.resourceType.name, r = t.getDataAsJson();
4935
- if (e.length > 0 && (n2 === re || n2 === B))
4957
+ if (e.length > 0 && (n2 === ie || n2 === U))
4936
4958
  throw new Error(`Unexpected nested super-partitioned resource: ${n2}`);
4937
4959
  switch (n2) {
4938
- case te:
4939
4960
  case ne:
4961
+ case re:
4940
4962
  throw new Error(`Only data columns are supported, got: ${n2}`);
4941
- case U: {
4963
+ case B: {
4942
4964
  if (typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
4943
4965
  throw new Error(`Missing partitionKeyLength in metadata for ${n2}`);
4944
4966
  const i = [];
@@ -4954,7 +4976,7 @@
4954
4976
  parts: i
4955
4977
  };
4956
4978
  }
4957
- case V: {
4979
+ case K: {
4958
4980
  if (typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
4959
4981
  throw new Error(`Missing partitionKeyLength in metadata for ${n2}`);
4960
4982
  const i = [], s2 = /* @__PURE__ */ new Map();
@@ -4981,15 +5003,15 @@
4981
5003
  parts: i
4982
5004
  };
4983
5005
  }
4984
- case re: {
5006
+ case ie: {
4985
5007
  if (typeof (r == null ? void 0 : r.superPartitionKeyLength) != "number" || typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
4986
5008
  throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n2}`);
4987
5009
  const i = r.superPartitionKeyLength + r.partitionKeyLength, s2 = [];
4988
5010
  for (const o of t.listInputFields()) {
4989
5011
  const a = t.resolve({ field: o, assertFieldType: "Input" });
4990
5012
  if (a === void 0) return;
4991
- if (a.resourceType.name !== U)
4992
- throw new Error(`Expected ${U} inside ${n2}, but got ${a.resourceType.name}`);
5013
+ if (a.resourceType.name !== B)
5014
+ throw new Error(`Expected ${B} inside ${n2}, but got ${a.resourceType.name}`);
4993
5015
  const l2 = he(a, JSON.parse(o));
4994
5016
  if (l2 === void 0) return;
4995
5017
  if (l2.type !== "JsonPartitioned")
@@ -5002,15 +5024,15 @@
5002
5024
  parts: s2
5003
5025
  };
5004
5026
  }
5005
- case B: {
5027
+ case U: {
5006
5028
  if (typeof (r == null ? void 0 : r.superPartitionKeyLength) != "number" || typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
5007
5029
  throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n2}`);
5008
5030
  const i = r.superPartitionKeyLength + r.partitionKeyLength, s2 = [];
5009
5031
  for (const o of t.listInputFields()) {
5010
5032
  const a = t.resolve({ field: o, assertFieldType: "Input" });
5011
5033
  if (a === void 0) return;
5012
- if (a.resourceType.name !== V)
5013
- throw new Error(`Expected ${V} inside ${n2}, but got ${a.resourceType.name}`);
5034
+ if (a.resourceType.name !== K)
5035
+ throw new Error(`Expected ${K} inside ${n2}, but got ${a.resourceType.name}`);
5014
5036
  const l2 = he(a, JSON.parse(o));
5015
5037
  if (l2 === void 0) return;
5016
5038
  if (l2.type !== "BinaryPartitioned")
@@ -5027,15 +5049,15 @@
5027
5049
  throw new Error(`Unknown resource type: ${n2}`);
5028
5050
  }
5029
5051
  }
5030
- function pt(t) {
5052
+ function vt(t) {
5031
5053
  if (t !== void 0) {
5032
5054
  if (j(t)) return t;
5033
- if (pn(t)) return ln(t);
5034
- if (t instanceof _) return he(t);
5055
+ if (mn(t)) return hn(t);
5056
+ if (t instanceof I) return he(t);
5035
5057
  throw new Error(`Unexpected input type: ${typeof t}`);
5036
5058
  }
5037
5059
  }
5038
- function dt(t, e) {
5060
+ function bt(t, e) {
5039
5061
  const n2 = [...e].sort((s2, o) => o[0] - s2[0]);
5040
5062
  if (t.type === "JsonPartitioned" || t.type === "BinaryPartitioned") {
5041
5063
  const { partitionKeyLength: s2 } = t;
@@ -5095,39 +5117,39 @@
5095
5117
  }
5096
5118
  }
5097
5119
  }
5098
- class ft {
5120
+ class wt {
5099
5121
  constructor(e) {
5100
5122
  this.columns = e;
5101
5123
  }
5102
5124
  selectColumns(e) {
5103
- const n2 = typeof e == "function" ? e : Fn(e);
5125
+ const n2 = typeof e == "function" ? e : Kn(e);
5104
5126
  return this.columns.filter((r) => n2(r.spec));
5105
5127
  }
5106
5128
  }
5107
- function ht(t) {
5129
+ function At(t) {
5108
5130
  if (t)
5109
5131
  return t.map((e) => ({
5110
- type: `split:${En(e.axisId)}`,
5132
+ type: `split:${Jn(e.axisId)}`,
5111
5133
  label: e.label,
5112
5134
  importance: 1e6
5113
5135
  // High importance for split filters in labels
5114
5136
  }));
5115
5137
  }
5116
- function gt(t) {
5138
+ function Pt(t) {
5117
5139
  if (t)
5118
5140
  return t.map((e) => [e.axisIdx, e.value]);
5119
5141
  }
5120
- function mt(t, e) {
5142
+ function xt(t, e) {
5121
5143
  if (!e || e.length === 0) return t;
5122
5144
  const n2 = [...e].sort((r, i) => r[0] - i[0]);
5123
- return Pe({ id: t, axisFilters: n2 });
5145
+ return _e({ id: t, axisFilters: n2 });
5124
5146
  }
5125
- function yt(t) {
5147
+ function Ct(t) {
5126
5148
  if (!t || typeof t != "object") return false;
5127
5149
  const e = t, n2 = e.domain && typeof e.domain == "object" && Object.values(e.domain).some((i) => typeof i == "object" && i !== null && "anchor" in i), r = e.axes && Array.isArray(e.axes) && e.axes.some((i) => typeof i == "object" && i !== null && "anchor" in i);
5128
5150
  return !!e.domainAnchor || n2 || r;
5129
5151
  }
5130
- function vt(t) {
5152
+ function St(t) {
5131
5153
  if (typeof t != "object" || !("axes" in t) || t.axes === void 0)
5132
5154
  return [];
5133
5155
  const e = t.axes.map((n2, r) => typeof n2 == "object" && "split" in n2 && n2.split === true ? r : -1).filter((n2) => n2 !== -1);
@@ -5135,10 +5157,10 @@
5135
5157
  throw new Error("Axis splitting is not supported when `partialAxesMatch` is defined.");
5136
5158
  return e.sort((n2, r) => n2 - r), e;
5137
5159
  }
5138
- class be {
5160
+ class ge {
5139
5161
  constructor() {
5140
5162
  L(this, "defaultProviderStore", []);
5141
- L(this, "providers", [new ft(this.defaultProviderStore)]);
5163
+ L(this, "providers", [new wt(this.defaultProviderStore)]);
5142
5164
  L(this, "axisLabelProviders", []);
5143
5165
  }
5144
5166
  addColumnProvider(e) {
@@ -5165,73 +5187,73 @@
5165
5187
  ...o && (i == null ? void 0 : i.includeNativeLabel) !== false ? { includeNativeLabel: true } : {},
5166
5188
  ...i ?? {}
5167
5189
  }, l2 = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], u2 = [];
5168
- for (const f$1 of l2) {
5169
- const p2 = yt(f$1);
5170
- let c2;
5171
- if (p2) {
5190
+ for (const p2 of l2) {
5191
+ const f$1 = Ct(p2);
5192
+ let h;
5193
+ if (f$1) {
5172
5194
  if (!r)
5173
5195
  throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");
5174
- c2 = $n(r.anchors, f$1, n2);
5196
+ h = Dn(r.anchors, p2, n2);
5175
5197
  } else
5176
- c2 = f$1;
5177
- const h = /* @__PURE__ */ new Set(), A2 = [];
5198
+ h = p2;
5199
+ const d = /* @__PURE__ */ new Set(), x2 = [];
5178
5200
  for (const g of this.providers) {
5179
- const P = g.selectColumns(c2);
5180
- for (const b of P) {
5181
- if (h.has(b.id)) throw new Error(`Duplicate column id ${b.id} in provider ${g.constructor.name}`);
5182
- h.add(b.id), A2.push(b);
5201
+ const b = g.selectColumns(h);
5202
+ for (const A2 of b) {
5203
+ if (d.has(A2.id)) throw new Error(`Duplicate column id ${A2.id} in provider ${g.constructor.name}`);
5204
+ d.add(A2.id), x2.push(A2);
5183
5205
  }
5184
5206
  }
5185
- if (A2.length === 0) continue;
5186
- const y = vt(f$1), v = y.length > 0;
5187
- for (const g of A2) {
5207
+ if (x2.length === 0) continue;
5208
+ const c2 = St(p2), v = c2.length > 0;
5209
+ for (const g of x2) {
5188
5210
  if (!f(g.spec)) continue;
5189
- const P = g.spec;
5211
+ const b = g.spec;
5190
5212
  if (v) {
5191
- const b = pt(g.data);
5192
- if (!b) {
5213
+ const A2 = vt(g.data);
5214
+ if (!A2) {
5193
5215
  if (s2) continue;
5194
5216
  return;
5195
5217
  }
5196
- if (!yn(b))
5197
- throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${b.type} for column ${g.id}`);
5198
- const k2 = ct(b), $2 = y[y.length - 1];
5199
- if ($2 >= b.partitionKeyLength)
5200
- throw new Error(`Not enough partition keys (${b.partitionKeyLength}) for requested split axes (max index ${$2}) in column ${P.name}`);
5201
- const q = y.map((w2) => this.findLabels(p$1(P.axesSpec[w2]))), F = [], I = (w2, N2) => {
5202
- if (N2 >= y.length) {
5203
- if (F.push([...w2]), F.length > 1e4)
5218
+ if (!ln(A2))
5219
+ throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${A2.type} for column ${g.id}`);
5220
+ const D = yt(A2), $2 = c2[c2.length - 1];
5221
+ if ($2 >= A2.partitionKeyLength)
5222
+ throw new Error(`Not enough partition keys (${A2.partitionKeyLength}) for requested split axes (max index ${$2}) in column ${b.name}`);
5223
+ const q2 = c2.map((P) => this.findLabels(p$1(b.axesSpec[P]))), F = [], _ = (P, N2) => {
5224
+ if (N2 >= c2.length) {
5225
+ if (F.push([...P]), F.length > 1e4)
5204
5226
  throw new Error("Too many key combinations, aborting.");
5205
5227
  return;
5206
5228
  }
5207
- const D2 = y[N2];
5208
- if (D2 >= k2.length)
5209
- throw new Error(`Axis index ${D2} out of bounds for unique keys array (length ${k2.length}) during split key generation for column ${g.id}`);
5210
- const O = k2[D2];
5211
- if (!O || O.length === 0) {
5229
+ const O = c2[N2];
5230
+ if (O >= D.length)
5231
+ throw new Error(`Axis index ${O} out of bounds for unique keys array (length ${D.length}) during split key generation for column ${g.id}`);
5232
+ const k2 = D[O];
5233
+ if (!k2 || k2.length === 0) {
5212
5234
  F.length = 0;
5213
5235
  return;
5214
5236
  }
5215
- for (const z2 of O)
5216
- w2.push(z2), I(w2, N2 + 1), w2.pop();
5237
+ for (const z2 of k2)
5238
+ P.push(z2), _(P, N2 + 1), P.pop();
5217
5239
  };
5218
- if (I([], 0), F.length === 0)
5240
+ if (_([], 0), F.length === 0)
5219
5241
  continue;
5220
- const R = [...P.axesSpec], se = y.map((w2) => w2);
5221
- for (let w2 = y.length - 1; w2 >= 0; w2--)
5222
- R.splice(y[w2], 1);
5223
- const J = { ...P, axesSpec: R };
5224
- for (const w2 of F) {
5225
- const N2 = w2.map((D2, O) => {
5226
- const z2 = se[O], Re = p$1(P.axesSpec[z2]), oe = q[O], Oe = (oe == null ? void 0 : oe[D2]) ?? String(D2);
5227
- return { axisIdx: z2, axisId: Re, value: D2, label: Oe };
5242
+ const R = [...b.axesSpec], se = c2.map((P) => P);
5243
+ for (let P = c2.length - 1; P >= 0; P--)
5244
+ R.splice(c2[P], 1);
5245
+ const J = { ...b, axesSpec: R };
5246
+ for (const P of F) {
5247
+ const N2 = P.map((O, k2) => {
5248
+ const z2 = se[k2], Ne = p$1(b.axesSpec[z2]), oe = q2[k2], Be = (oe == null ? void 0 : oe[O]) ?? String(O);
5249
+ return { axisIdx: z2, axisId: Ne, value: O, label: Be };
5228
5250
  });
5229
5251
  u2.push({
5230
5252
  type: "split",
5231
5253
  originalColumn: g,
5232
- spec: P,
5254
+ spec: b,
5233
5255
  adjustedSpec: J,
5234
- dataEntries: b,
5256
+ dataEntries: A2,
5235
5257
  axisFilters: N2
5236
5258
  });
5237
5259
  }
@@ -5239,39 +5261,39 @@
5239
5261
  u2.push({
5240
5262
  type: "direct",
5241
5263
  originalColumn: g,
5242
- spec: P,
5243
- adjustedSpec: P
5264
+ spec: b,
5265
+ adjustedSpec: b
5244
5266
  });
5245
5267
  }
5246
5268
  }
5247
5269
  if (u2.length === 0) return [];
5248
- const S = Ee(
5270
+ const y = Oe(
5249
5271
  u2,
5250
- (f2) => ({
5251
- spec: f2.spec,
5252
- suffixTrace: f2.type === "split" ? ht(f2.axisFilters) : void 0
5272
+ (p2) => ({
5273
+ spec: p2.spec,
5274
+ suffixTrace: p2.type === "split" ? At(p2.axisFilters) : void 0
5253
5275
  }),
5254
5276
  a
5255
- ), d = [];
5256
- for (const { value: f2, label: p2 } of S) {
5257
- const { originalColumn: c2, spec: h } = f2, A2 = f2.type === "split" ? f2.axisFilters : void 0, y = gt(A2);
5277
+ ), w2 = [];
5278
+ for (const { value: p2, label: f2 } of y) {
5279
+ const { originalColumn: h, spec: d } = p2, x2 = p2.type === "split" ? p2.axisFilters : void 0, c2 = Pt(x2);
5258
5280
  let v;
5259
- r ? v = r.deriveS(h, y) : v = mt(c2.id, y);
5260
- let g = { ...f2.adjustedSpec };
5281
+ r ? v = r.deriveS(d, c2) : v = xt(h.id, c2);
5282
+ let g = { ...p2.adjustedSpec };
5261
5283
  o && (g = {
5262
5284
  ...g,
5263
5285
  annotations: {
5264
5286
  ...g.annotations ?? {},
5265
- "pl7.app/label": p2
5287
+ "pl7.app/label": f2
5266
5288
  }
5267
- }), d.push({
5289
+ }), w2.push({
5268
5290
  id: v,
5269
5291
  spec: g,
5270
- data: () => f2.type === "split" ? hn(dt(f2.dataEntries, y)) : f2.originalColumn.data,
5271
- label: p2
5292
+ data: () => p2.type === "split" ? gn(bt(p2.dataEntries, c2)) : p2.originalColumn.data,
5293
+ label: f2
5272
5294
  });
5273
5295
  }
5274
- return d;
5296
+ return w2;
5275
5297
  }
5276
5298
  getColumns(e, n2) {
5277
5299
  const r = this.getUniversalEntries(e, {
@@ -5303,10 +5325,10 @@
5303
5325
  if (t[n2] !== e[n2]) return false;
5304
5326
  return true;
5305
5327
  }
5306
- function we(t) {
5307
- return Bn(t, (e) => e instanceof _ ? e.handle : pn(e) ? mn(e, (n2) => n2.handle) : e);
5328
+ function Pe(t) {
5329
+ return Fn(t, (e) => e instanceof I ? e.handle : mn(e) ? yn(e, (n2) => n2.handle) : e);
5308
5330
  }
5309
- class bt {
5331
+ class It {
5310
5332
  constructor() {
5311
5333
  L(this, "ctx", m());
5312
5334
  }
@@ -5317,8 +5339,8 @@
5317
5339
  return this.ctx.calculateOptions(e);
5318
5340
  }
5319
5341
  getOptions(e, n2) {
5320
- const r = typeof e == "function" ? e : Fn(e), i = this.getSpecs().entries.filter((s2) => r(s2.obj));
5321
- return typeof n2 == "object" || typeof n2 > "u" ? Ee(i, (s2) => s2.obj, n2 ?? {}).map(({ value: { ref: s2 }, label: o }) => ({
5342
+ const r = typeof e == "function" ? e : Kn(e), i = this.getSpecs().entries.filter((s2) => r(s2.obj));
5343
+ return typeof n2 == "object" || typeof n2 > "u" ? Oe(i, (s2) => s2.obj, n2 ?? {}).map(({ value: { ref: s2 }, label: o }) => ({
5322
5344
  ref: s2,
5323
5345
  label: o
5324
5346
  })) : i.map((s2) => ({
@@ -5327,17 +5349,17 @@
5327
5349
  }));
5328
5350
  }
5329
5351
  resolveAnchorCtx(e) {
5330
- if (e instanceof On) return e;
5352
+ if (e instanceof $n) return e;
5331
5353
  const n2 = {};
5332
5354
  for (const [r, i] of Object.entries(e))
5333
- if (Rn(i)) {
5355
+ if (Tn(i)) {
5334
5356
  const s2 = this.getPColumnSpecByRef(i);
5335
5357
  if (!s2)
5336
5358
  return;
5337
5359
  n2[r] = s2;
5338
5360
  } else
5339
5361
  n2[r] = i;
5340
- return new On(n2);
5362
+ return new $n(n2);
5341
5363
  }
5342
5364
  /**
5343
5365
  * Returns columns that match the provided anchors and selectors. It applies axis filters and label derivation.
@@ -5350,7 +5372,7 @@
5350
5372
  getAnchoredPColumns(e, n2, r) {
5351
5373
  const i = this.resolveAnchorCtx(e);
5352
5374
  if (i)
5353
- return new be().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n2, {
5375
+ return new ge().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n2, {
5354
5376
  ...r,
5355
5377
  anchorCtx: i
5356
5378
  });
@@ -5387,7 +5409,7 @@
5387
5409
  getCanonicalOptions(e, n2, r) {
5388
5410
  const i = this.resolveAnchorCtx(e);
5389
5411
  if (!i) return;
5390
- const s2 = new be().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n2, {
5412
+ const s2 = new ge().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n2, {
5391
5413
  ...r,
5392
5414
  anchorCtx: i
5393
5415
  });
@@ -5411,7 +5433,7 @@
5411
5433
  ref: n2.ref,
5412
5434
  obj: {
5413
5435
  ...n2.obj,
5414
- data: new _(n2.obj.data, [n2.ref.blockId, n2.ref.name])
5436
+ data: new I(n2.obj.data, [n2.ref.blockId, n2.ref.name])
5415
5437
  }
5416
5438
  }))
5417
5439
  };
@@ -5430,9 +5452,9 @@
5430
5452
  ref: n2.ref,
5431
5453
  obj: {
5432
5454
  ...n2.obj,
5433
- data: _n(
5455
+ data: _n$1(
5434
5456
  n2.obj.data,
5435
- (r) => new _(r, [n2.ref.blockId, n2.ref.name])
5457
+ (r) => new I(r, [n2.ref.blockId, n2.ref.name])
5436
5458
  )
5437
5459
  }
5438
5460
  }))
@@ -5459,9 +5481,9 @@
5459
5481
  )) == null ? void 0 : r.obj;
5460
5482
  const n2 = this.ctx.getDataFromResultPoolByRef(e.blockId, e.name);
5461
5483
  if (n2)
5462
- return Bn(
5484
+ return Fn(
5463
5485
  n2,
5464
- (i) => new _(i, [e.blockId, e.name])
5486
+ (i) => new I(i, [e.blockId, e.name])
5465
5487
  );
5466
5488
  }
5467
5489
  /**
@@ -5472,7 +5494,7 @@
5472
5494
  getPColumnByRef(e) {
5473
5495
  const n2 = this.getDataByRef(e);
5474
5496
  if (n2)
5475
- return In(n2);
5497
+ return jn(n2);
5476
5498
  }
5477
5499
  /**
5478
5500
  * Returns spec associated with the ref ensuring that it is a p-column spec.
@@ -5522,7 +5544,7 @@
5522
5544
  findLabels(e) {
5523
5545
  const n2 = this.getData();
5524
5546
  for (const r of n2.entries) {
5525
- if (!Z$1(r.obj)) continue;
5547
+ if (!q(r.obj)) continue;
5526
5548
  const i = r.obj.spec;
5527
5549
  if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && le(e.domain, i.axesSpec[0].domain)) {
5528
5550
  if (r.obj.data.resourceType.name !== "PColumnData/Json")
@@ -5543,13 +5565,13 @@
5543
5565
  * @returns An array of PColumn objects matching the selectors. Data is loaded on first access.
5544
5566
  */
5545
5567
  selectColumns(e) {
5546
- const n2 = typeof e == "function" ? e : Fn(e);
5568
+ const n2 = typeof e == "function" ? e : Kn(e);
5547
5569
  return this.getSpecs().entries.filter(({ obj: i }) => f(i) ? n2(i) : false).map(({ ref: i, obj: s2 }) => {
5548
5570
  const o = s2;
5549
5571
  let a = null;
5550
5572
  const l2 = this;
5551
5573
  return {
5552
- id: Pe(i),
5574
+ id: _e(i),
5553
5575
  spec: o,
5554
5576
  get data() {
5555
5577
  var u2;
@@ -5580,7 +5602,7 @@
5580
5602
  L(this, "args");
5581
5603
  L(this, "uiState");
5582
5604
  L(this, "_activeArgsCache");
5583
- L(this, "resultPool", new bt());
5605
+ L(this, "resultPool", new It());
5584
5606
  this.ctx = m(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
5585
5607
  }
5586
5608
  /**
@@ -5599,14 +5621,14 @@
5599
5621
  getNamedAccessor(e) {
5600
5622
  return pe(
5601
5623
  this.ctx.getAccessorHandleByName(e),
5602
- (n2) => new _(n2, [e])
5624
+ (n2) => new I(n2, [e])
5603
5625
  );
5604
5626
  }
5605
5627
  get prerun() {
5606
- return this.getNamedAccessor(Ie);
5628
+ return this.getNamedAccessor(Ee);
5607
5629
  }
5608
5630
  get outputs() {
5609
- return this.getNamedAccessor(Le);
5631
+ return this.getNamedAccessor(Fe);
5610
5632
  }
5611
5633
  /**
5612
5634
  * Find labels data for a given axis id. It will search for a label column and return its data as a map.
@@ -5618,13 +5640,13 @@
5618
5640
  }
5619
5641
  verifyInlineAndExplicitColumnsSupport(e) {
5620
5642
  var i;
5621
- const n2 = e.some((s2) => !(s2.data instanceof _) || pn(s2.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === true;
5643
+ const n2 = e.some((s2) => !(s2.data instanceof I) || mn(s2.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === true;
5622
5644
  if (n2 && !r) throw Error("Inline or explicit columns not supported");
5623
5645
  }
5624
5646
  // TODO remove all non-PColumn fields
5625
5647
  createPFrame(e) {
5626
5648
  return this.verifyInlineAndExplicitColumnsSupport(e), this.ctx.createPFrame(
5627
- e.map((n2) => we(n2))
5649
+ e.map((n2) => Pe(n2))
5628
5650
  );
5629
5651
  }
5630
5652
  createPTable(e) {
@@ -5636,8 +5658,8 @@
5636
5658
  },
5637
5659
  filters: e.filters ?? [],
5638
5660
  sorting: e.sorting ?? []
5639
- } : n2 = e, this.verifyInlineAndExplicitColumnsSupport(jn(n2.src)), this.ctx.createPTable(
5640
- Cn(n2, (r) => we(r))
5661
+ } : n2 = e, this.verifyInlineAndExplicitColumnsSupport(Un(n2.src)), this.ctx.createPTable(
5662
+ On(n2, (r) => Pe(r))
5641
5663
  );
5642
5664
  }
5643
5665
  /** @deprecated scheduled for removal from SDK */
@@ -5649,13 +5671,13 @@
5649
5671
  return this.ctx.getCurrentUnstableMarker();
5650
5672
  }
5651
5673
  }
5652
- const M = "1.29.2";
5653
- function wt(t) {
5674
+ const M = "1.29.17";
5675
+ function _t(t) {
5654
5676
  return t.__renderLambda === true;
5655
5677
  }
5656
5678
  function ue(t) {
5657
5679
  if (t !== void 0)
5658
- return wt(t) ? t.handle : t;
5680
+ return _t(t) ? t.handle : t;
5659
5681
  }
5660
5682
  class T {
5661
5683
  constructor(e, n2, r, i, s2, o, a) {
@@ -5827,66 +5849,101 @@
5827
5849
  Object.entries(this._outputs).map(([n2, r]) => [n2, ue(r)])
5828
5850
  )
5829
5851
  };
5830
- return Xe() ? _e({ sdkVersion: M }) : { config: e };
5852
+ return it() ? Te({ sdkVersion: M }) : { config: e };
5831
5853
  }
5832
5854
  }
5833
- function fn(t, e, n2, r) {
5834
- var u2, S;
5835
- Array.isArray(r) && (r = { filters: r });
5836
- const i = t.resultPool.getData().entries.map((d) => d.obj).filter(Z$1).filter((d) => d.spec.name === "pl7.app/label" && d.spec.axesSpec.length === 1), s2 = (d, f2) => {
5837
- let p2 = d.toString();
5838
- if (f2)
5839
- for (const c2 in f2)
5840
- p2 += c2, p2 += f2[c2];
5841
- return p2;
5842
- }, o = /* @__PURE__ */ new Map();
5843
- for (const d of e)
5844
- for (const f2 of d.spec.axesSpec) {
5845
- const p2 = p$1(f2);
5846
- for (const c2 of i) {
5847
- const h = c2.spec.axesSpec[0], A2 = p$1(c2.spec.axesSpec[0]);
5848
- if (z(p2, A2)) {
5849
- const y = Object.keys(p2.domain ?? {}).length, v = Object.keys(A2.domain ?? {}).length;
5850
- if (y > v) {
5851
- const g = s2(c2.id, p2.domain);
5852
- o.set(g, {
5853
- id: g,
5855
+ function je(t) {
5856
+ return new ge().addAxisLabelProvider(t).addColumnProvider(t).getColumns({
5857
+ name: "pl7.app/label",
5858
+ axes: [{}]
5859
+ // exactly one axis
5860
+ }, { dontWaitAllData: true });
5861
+ }
5862
+ function Ve(t, e) {
5863
+ const n2 = (i, s2) => {
5864
+ let o = i.toString();
5865
+ if (s2)
5866
+ for (const a in s2)
5867
+ o += a, o += s2[a];
5868
+ return o;
5869
+ }, r = /* @__PURE__ */ new Map();
5870
+ for (const i of t)
5871
+ for (const s2 of i.spec.axesSpec) {
5872
+ const o = p$1(s2);
5873
+ for (const a of e) {
5874
+ const l2 = a.spec.axesSpec[0], u2 = p$1(a.spec.axesSpec[0]);
5875
+ if (G(o, u2)) {
5876
+ const y = Object.keys(o.domain ?? {}).length, w2 = Object.keys(u2.domain ?? {}).length;
5877
+ if (y > w2) {
5878
+ const p2 = n2(a.id, o.domain);
5879
+ r.set(p2, {
5880
+ id: p2,
5854
5881
  spec: {
5855
- ...c2.spec,
5856
- axesSpec: [{ ...p2, annotations: h.annotations }]
5882
+ ...a.spec,
5883
+ axesSpec: [{ ...o, annotations: l2.annotations }]
5857
5884
  },
5858
- data: c2.data
5885
+ data: a.data
5859
5886
  });
5860
5887
  } else
5861
- o.set(s2(c2.id), c2);
5888
+ r.set(n2(a.id), a);
5862
5889
  }
5863
5890
  }
5864
5891
  }
5865
- if ([...e, ...o.values()].some(
5866
- (d) => d.data instanceof _ && !d.data.getIsReadyOrError()
5867
- ))
5868
- return;
5869
- let a = e;
5870
- const l2 = [];
5871
- if (r != null && r.coreColumnPredicate) {
5872
- a = [];
5873
- for (const d of e)
5874
- r.coreColumnPredicate(d.spec) ? a.push(d) : l2.push(d);
5875
- }
5876
- return l2.push(...o.values()), t.createPTable({
5892
+ return [...r.values()];
5893
+ }
5894
+ function Ke(t) {
5895
+ const e = (i) => Array.isArray(i), n2 = (i) => i instanceof I, r = (i) => typeof i == "object" && "type" in i;
5896
+ return t.map((i) => i.data).every((i) => {
5897
+ if (e(i))
5898
+ return true;
5899
+ if (n2(i))
5900
+ return i.getIsReadyOrError();
5901
+ if (r(i))
5902
+ switch (i.type) {
5903
+ case "Json":
5904
+ return true;
5905
+ case "JsonPartitioned":
5906
+ return Object.values(i.parts).every((o) => o.getIsReadyOrError());
5907
+ case "BinaryPartitioned":
5908
+ return Object.values(i.parts).every((o) => o.index.getIsReadyOrError() && o.values.getIsReadyOrError());
5909
+ }
5910
+ else
5911
+ throw Error(`unsupported column data type: ${i}`);
5912
+ });
5913
+ }
5914
+ function $e(t, e, n2, r, i, s2) {
5915
+ let o = t;
5916
+ const a = [];
5917
+ if (s2) {
5918
+ o = [];
5919
+ for (const l2 of t)
5920
+ s2(l2.spec) ? o.push(l2) : a.push(l2);
5921
+ }
5922
+ return a.push(...e), {
5877
5923
  src: {
5878
5924
  type: "outer",
5879
5925
  primary: {
5880
- type: (r == null ? void 0 : r.coreJoinType) ?? "full",
5881
- entries: a.map((d) => ({ type: "column", column: d }))
5926
+ type: n2,
5927
+ entries: o.map((l2) => ({ type: "column", column: l2 }))
5882
5928
  },
5883
- secondary: l2.map((d) => ({ type: "column", column: d }))
5929
+ secondary: a.map((l2) => ({ type: "column", column: l2 }))
5884
5930
  },
5885
- filters: [...(r == null ? void 0 : r.filters) ?? [], ...((u2 = n2 == null ? void 0 : n2.pTableParams) == null ? void 0 : u2.filters) ?? []],
5886
- sorting: ((S = n2 == null ? void 0 : n2.pTableParams) == null ? void 0 : S.sorting) ?? []
5887
- });
5931
+ filters: r,
5932
+ sorting: i
5933
+ };
5888
5934
  }
5889
- const At = (t, e) => {
5935
+ function Cn(t, e, n2, r) {
5936
+ var u2, y;
5937
+ Array.isArray(r) && (r = { filters: r });
5938
+ const i = (r == null ? void 0 : r.coreJoinType) ?? "full", s2 = [...(r == null ? void 0 : r.filters) ?? [], ...((u2 = n2 == null ? void 0 : n2.pTableParams) == null ? void 0 : u2.filters) ?? []], o = ((y = n2 == null ? void 0 : n2.pTableParams) == null ? void 0 : y.sorting) ?? [], a = je(t.resultPool);
5939
+ if (!a) return;
5940
+ const l2 = Ve(e.map(Cn$1), a);
5941
+ if (Ke([...e, ...l2]))
5942
+ return t.createPTable(
5943
+ $e(e, l2, i, s2, o, r == null ? void 0 : r.coreColumnPredicate)
5944
+ );
5945
+ }
5946
+ const Et = (t, e) => {
5890
5947
  let n2 = t.toString();
5891
5948
  return e == null || e.forEach((r) => {
5892
5949
  if (r)
@@ -5894,7 +5951,7 @@
5894
5951
  n2 += i, n2 += s2;
5895
5952
  }), n2;
5896
5953
  };
5897
- function St(t) {
5954
+ function Ft(t) {
5898
5955
  if (!t.length)
5899
5956
  return [];
5900
5957
  let e = [[]];
@@ -5905,87 +5962,93 @@
5905
5962
  }), e = r;
5906
5963
  }), e;
5907
5964
  }
5908
- function xt(t, e) {
5965
+ function Dt(t, e) {
5909
5966
  const n2 = t.spec.axesSpec.map(p$1);
5910
- return e.spec.axesSpec.map(p$1).every((i) => n2.some((s2) => z(s2, i) && z(i, s2)));
5967
+ return e.spec.axesSpec.map(p$1).every((i) => n2.some((s2) => G(s2, i) && G(i, s2)));
5911
5968
  }
5912
- function De(t, e) {
5969
+ function Je(t, e) {
5913
5970
  const n2 = t.spec.axesSpec.map(p$1);
5914
- return e.spec.axesSpec.map(p$1).every((i) => n2.some((s2) => z(s2, i)));
5971
+ return e.spec.axesSpec.map(p$1).every((i) => n2.some((s2) => G(s2, i)));
5915
5972
  }
5916
- const Pt = "pl7.app/graph/isVirtual", Ae = "pl7.app/label";
5917
- function Se(t, e) {
5973
+ const Ot = "pl7.app/graph/isVirtual", xe = "pl7.app/label";
5974
+ function Ce(t, e) {
5918
5975
  const n2 = t.spec.axesSpec.map(p$1), r = e.spec.axesSpec.map(p$1);
5919
- if (xt(t, e))
5976
+ if (Dt(t, e))
5920
5977
  return [];
5921
- if (!De(t, e))
5978
+ if (!Je(t, e))
5922
5979
  return [];
5923
- const o = r.map((d) => n2.filter((f2) => z(f2, d))), a = St(o), l2 = /* @__PURE__ */ new Set(), u2 = /* @__PURE__ */ new Set(), S = a.map((d) => {
5924
- const f2 = /* @__PURE__ */ new Set();
5925
- return d.map((p2, c2) => {
5926
- const h = e.spec.axesSpec[c2].domain, A2 = p2.domain;
5927
- return Object.entries(A2 ?? {}).forEach(([y, v]) => {
5928
- if ((h == null ? void 0 : h[y]) === void 0) {
5929
- const g = JSON.stringify([y, v]);
5930
- f2.add(g), l2.add(g);
5980
+ const o = r.map((w2) => n2.filter((p2) => G(p2, w2))), a = Ft(o), l2 = /* @__PURE__ */ new Set(), u2 = /* @__PURE__ */ new Set(), y = a.map((w2) => {
5981
+ const p2 = /* @__PURE__ */ new Set();
5982
+ return w2.map((f2, h) => {
5983
+ const d = e.spec.axesSpec[h].domain, x2 = f2.domain;
5984
+ return Object.entries(x2 ?? {}).forEach(([c2, v]) => {
5985
+ if ((d == null ? void 0 : d[c2]) === void 0) {
5986
+ const g = JSON.stringify([c2, v]);
5987
+ p2.add(g), l2.add(g);
5931
5988
  }
5932
5989
  }), {
5933
- ...p2,
5934
- annotations: e.spec.axesSpec[c2].annotations
5990
+ ...f2,
5991
+ annotations: e.spec.axesSpec[h].annotations
5935
5992
  };
5936
- }), f2;
5993
+ }), p2;
5937
5994
  });
5938
- return [...l2].forEach((d) => {
5939
- S.some((f2) => !f2.has(d)) && u2.add(d);
5940
- }), a.map((d, f2) => {
5941
- var y;
5942
- const p2 = At(e.id, d.map((v) => v.domain)), c2 = ((y = e.spec.annotations) == null ? void 0 : y[Ae]) ?? "", h = [...S[f2]].filter((v) => u2.has(v)).sort().map((v) => {
5995
+ return [...l2].forEach((w2) => {
5996
+ y.some((p2) => !p2.has(w2)) && u2.add(w2);
5997
+ }), a.map((w2, p2) => {
5998
+ var c2;
5999
+ const f2 = Et(e.id, w2.map((v) => v.domain)), h = ((c2 = e.spec.annotations) == null ? void 0 : c2[xe]) ?? "", d = [...y[p2]].filter((v) => u2.has(v)).sort().map((v) => {
5943
6000
  var g;
5944
6001
  return (g = JSON.parse(v)) == null ? void 0 : g[1];
5945
- }).join(" / "), A2 = {
6002
+ }).join(" / "), x2 = {
5946
6003
  ...e.spec.annotations,
5947
- [Pt]: "true"
6004
+ [Ot]: "true"
5948
6005
  };
5949
- return (c2 || h) && (A2[Ae] = c2 && h ? c2 + " / " + h : c2 + h), {
5950
- id: p2,
6006
+ return (h || d) && (x2[xe] = h && d ? h + " / " + d : h + d), {
6007
+ id: f2,
5951
6008
  spec: {
5952
6009
  ...e.spec,
5953
- axesSpec: d.map((v, g) => ({
6010
+ axesSpec: w2.map((v, g) => ({
5954
6011
  ...v,
5955
6012
  annotations: e.spec.axesSpec[g].annotations
5956
6013
  })),
5957
- annotations: A2
6014
+ annotations: x2
5958
6015
  },
5959
6016
  data: e.data
5960
6017
  };
5961
6018
  });
5962
6019
  }
5963
- function Ct(t) {
6020
+ function Rt(t) {
5964
6021
  const e = [];
5965
6022
  for (let n2 = 0; n2 < t.length; n2++)
5966
6023
  for (let r = n2 + 1; r < t.length; r++) {
5967
6024
  const i = t[n2], s2 = t[r];
5968
6025
  e.push(
5969
- ...Se(i, s2),
5970
- ...Se(s2, i)
6026
+ ...Ce(i, s2),
6027
+ ...Ce(s2, i)
5971
6028
  );
5972
6029
  }
5973
6030
  return e;
5974
6031
  }
5975
- function _t(t, e) {
5976
- const n2 = [...t];
5977
- for (const r of e)
5978
- for (const i of t) {
5979
- if (i.id === r.id)
5980
- break;
5981
- if (De(i, r)) {
5982
- n2.push(r);
5983
- break;
5984
- }
6032
+ function kt(t, e) {
6033
+ const n2 = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map();
6034
+ t.forEach((s2) => {
6035
+ n2.add(s2.id), r.set(Xn(En(s2.spec)), s2);
6036
+ });
6037
+ const i = /* @__PURE__ */ new Map();
6038
+ for (const s2 of e) {
6039
+ if (n2.has(s2.id)) continue;
6040
+ const o = Xn(En(s2.spec));
6041
+ if (!r.has(o)) {
6042
+ for (const a of r.values())
6043
+ if (Je(a, s2)) {
6044
+ i.set(o, s2);
6045
+ break;
6046
+ }
5985
6047
  }
5986
- return n2;
6048
+ }
6049
+ return [...r.values(), ...i.values()];
5987
6050
  }
5988
- const It = [
6051
+ const jt = [
5989
6052
  "Int",
5990
6053
  "Long",
5991
6054
  "Float",
@@ -5993,17 +6056,14 @@
5993
6056
  "String",
5994
6057
  "Bytes"
5995
6058
  ];
5996
- function gn(t, e) {
6059
+ function _n(t, e) {
5997
6060
  if (e === void 0) return;
5998
- const n2 = t.resultPool.getData().entries.map((s2) => s2.obj).filter(Z$1).filter((s2) => It.includes(s2.spec.valueType)), r = _t(e, n2), i = [...r, ...Ct(r)];
6061
+ const n2 = t.resultPool.getData().entries.map((s2) => s2.obj).filter(q).filter((s2) => jt.includes(s2.spec.valueType)), r = kt(e, n2), i = [...r, ...Rt(r)];
5999
6062
  if (!i.some(
6000
- (s2) => s2.data instanceof _ && !s2.data.getIsReadyOrError()
6063
+ (s2) => s2.data instanceof I && !s2.data.getIsReadyOrError()
6001
6064
  ))
6002
6065
  return t.createPFrame(i);
6003
6066
  }
6004
- function isNumericType(c2) {
6005
- return c2.valueType === "Double" || c2.valueType === "Int" || c2.valueType === "Float" || c2.valueType === "Long";
6006
- }
6007
6067
  const model = T.create().withArgs({
6008
6068
  metrics: [
6009
6069
  {
@@ -6056,32 +6116,42 @@
6056
6116
  filters: []
6057
6117
  }
6058
6118
  }
6059
- }).argsValid((ctx) => ctx.args.abundanceRef !== void 0).output("abundanceOptions", (ctx) => ctx.resultPool.getOptions(
6060
- (c2) => {
6061
- var _a, _b;
6062
- return f(c2) && isNumericType(c2) && ((_a = c2.annotations) == null ? void 0 : _a["pl7.app/isAbundance"]) === "true" && ((_b = c2.annotations) == null ? void 0 : _b["pl7.app/abundance/normalized"]) === "false";
6063
- }
6064
- )).output("pt", (ctx) => {
6119
+ }).argsValid((ctx) => ctx.args.abundanceRef !== void 0).output(
6120
+ "abundanceOptions",
6121
+ (ctx) => ctx.resultPool.getOptions([
6122
+ {
6123
+ axes: [
6124
+ { name: "pl7.app/sampleId" },
6125
+ {}
6126
+ ],
6127
+ annotations: {
6128
+ "pl7.app/isAbundance": "true",
6129
+ "pl7.app/abundance/normalized": "false",
6130
+ "pl7.app/abundance/isPrimary": "true"
6131
+ }
6132
+ }
6133
+ ])
6134
+ ).output("pt", (ctx) => {
6065
6135
  var _a, _b, _c;
6066
6136
  const pCols = (_b = (_a = ctx.outputs) == null ? void 0 : _a.resolve("pf")) == null ? void 0 : _b.getPColumns();
6067
6137
  if (pCols === void 0) {
6068
6138
  return void 0;
6069
6139
  }
6070
- return fn(ctx, pCols, (_c = ctx.uiState) == null ? void 0 : _c.tableState);
6140
+ return Cn(ctx, pCols, (_c = ctx.uiState) == null ? void 0 : _c.tableState);
6071
6141
  }).output("pf", (ctx) => {
6072
6142
  var _a, _b;
6073
6143
  const pCols = (_b = (_a = ctx.outputs) == null ? void 0 : _a.resolve("pf")) == null ? void 0 : _b.getPColumns();
6074
6144
  if (pCols === void 0) {
6075
6145
  return void 0;
6076
6146
  }
6077
- return gn(ctx, pCols);
6147
+ return _n(ctx, pCols);
6078
6148
  }).output("isRunning", (ctx) => {
6079
6149
  var _a;
6080
6150
  return ((_a = ctx.outputs) == null ? void 0 : _a.getIsReadyOrError()) === false;
6081
6151
  }).title((ctx) => {
6082
6152
  var _a;
6083
6153
  return ((_a = ctx.uiState) == null ? void 0 : _a.blockTitle) ?? "Repertoire Diversity";
6084
- }).sections((_2) => [
6154
+ }).sections((_) => [
6085
6155
  { type: "link", href: "/", label: "Main" },
6086
6156
  { type: "link", href: "/diversityGraph", label: "Diversity Graph" }
6087
6157
  ]).done();