@milaboratories/pl-model-common 1.11.3 → 1.12.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/index.mjs CHANGED
@@ -1,64 +1,64 @@
1
- var $ = Object.defineProperty;
2
- var F = (n, t, e) => t in n ? $(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
- var d = (n, t, e) => F(n, typeof t != "symbol" ? t + "" : t, e);
4
- import k from "canonicalize";
5
- import { z as m } from "zod";
6
- function un(n) {
1
+ var V = Object.defineProperty;
2
+ var F = (n, t, e) => t in n ? V(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var m = (n, t, e) => F(n, typeof t != "symbol" ? t + "" : t, e);
4
+ import g from "canonicalize";
5
+ import { z as l } from "zod";
6
+ function dn(n) {
7
7
  return n !== void 0 && n.startsWith("log+live://log/");
8
8
  }
9
- function g(n) {
9
+ function w(n) {
10
10
  throw new Error("Unexpected object: " + n);
11
11
  }
12
- const I = "upload://upload/", N = "index://index/";
12
+ const k = "upload://upload/", N = "index://index/";
13
13
  function D(n) {
14
- return n.startsWith(I);
14
+ return n.startsWith(k);
15
15
  }
16
- function U(n) {
16
+ function O(n) {
17
17
  return n.startsWith(N);
18
18
  }
19
- function O(n) {
20
- if (U(n)) {
19
+ function U(n) {
20
+ if (O(n)) {
21
21
  const t = n.slice(N.length);
22
22
  return JSON.parse(decodeURIComponent(t)).path;
23
23
  } else if (D(n)) {
24
- const t = n.slice(I.length);
24
+ const t = n.slice(k.length);
25
25
  return JSON.parse(decodeURIComponent(t)).localPath;
26
26
  }
27
- g(n);
27
+ w(n);
28
28
  }
29
29
  function B(n) {
30
30
  return n.replace(/^.*[\\/]/, "");
31
31
  }
32
- function dn(n) {
33
- return B(O(n));
32
+ function mn(n) {
33
+ return B(U(n));
34
34
  }
35
- const R = -2147483648, w = -9007199254740991n, j = NaN, L = NaN, M = null, _ = null;
36
- function p(n, t) {
35
+ const R = -2147483648, A = -9007199254740991n, j = NaN, L = NaN, J = null, M = null;
36
+ function y(n, t) {
37
37
  switch (t) {
38
38
  case "Int":
39
39
  return n === R;
40
40
  case "Long":
41
- return n === Number(w) || n === w;
41
+ return n === Number(A) || n === A;
42
42
  case "Float":
43
43
  return n === j;
44
44
  case "Double":
45
45
  return n === L;
46
46
  case "String":
47
- return n === M;
47
+ return n === J;
48
48
  case "Bytes":
49
- return n === _;
49
+ return n === M;
50
50
  default:
51
51
  throw Error(`unsupported data type: ${t}`);
52
52
  }
53
53
  }
54
- function mn(n) {
55
- if (!H(n)) throw new Error(`Expected not-NA PValue, got ${n}`);
54
+ function ln(n) {
55
+ if (!_(n)) throw new Error(`Expected not-NA PValue, got ${n}`);
56
56
  return n;
57
57
  }
58
- function H(n, t) {
58
+ function _(n, t) {
59
59
  if (!t)
60
60
  return typeof n == "string" || typeof n == "number" && isFinite(n) || typeof n == "bigint";
61
- if (p(n, t)) return !1;
61
+ if (y(n, t)) return !1;
62
62
  switch (t) {
63
63
  case "Int":
64
64
  return typeof n == "number";
@@ -76,10 +76,10 @@ function H(n, t) {
76
76
  throw Error(`unsupported data type: ${t}`);
77
77
  }
78
78
  }
79
- function J(n, t) {
79
+ function H(n, t) {
80
80
  if (!t)
81
81
  return n === null || typeof n == "string" || typeof n == "number" || typeof n == "bigint";
82
- if (p(n, t)) return !0;
82
+ if (y(n, t)) return !0;
83
83
  switch (t) {
84
84
  case "Int":
85
85
  return typeof n == "number";
@@ -97,14 +97,14 @@ function J(n, t) {
97
97
  throw Error(`unsupported data type: ${t}`);
98
98
  }
99
99
  }
100
- function ln(n) {
100
+ function pn(n) {
101
101
  if (n === null || typeof n == "string" || typeof n == "number") return n;
102
102
  if (typeof n == "bigint") return { bigint: n.toString() };
103
103
  throw new Error(`Type ${typeof n} (value ${n}) not yet supported.`);
104
104
  }
105
105
  function K(n, t) {
106
106
  if (n === null || typeof n == "string" || typeof n == "number" || typeof n == "bigint") {
107
- if (t && !p(n, t) && !J(n, t))
107
+ if (t && !y(n, t) && !H(n, t))
108
108
  throw new Error(`Unexpected value type, got ${typeof n}, expected ${t}`);
109
109
  return n;
110
110
  }
@@ -115,7 +115,7 @@ function K(n, t) {
115
115
  }
116
116
  throw new Error(`Unsupported type ${typeof n} (value ${n}).`);
117
117
  }
118
- function pn(n) {
118
+ function hn(n) {
119
119
  if (n = T(n), n === null) throw new Error("Value is null");
120
120
  return n;
121
121
  }
@@ -134,15 +134,15 @@ function W(n, t) {
134
134
  const e = Math.floor(t / 8), r = 1 << 7 - t % 8;
135
135
  return (n[e] & r) > 0;
136
136
  }
137
- const X = { type: "absent" }, G = null;
138
- function hn(n) {
137
+ const X = { type: "absent" }, z = null;
138
+ function yn(n) {
139
139
  return typeof n == "object" && n !== null && n.type === "absent";
140
140
  }
141
- function yn(n, t, e = {}) {
141
+ function bn(n, t, e = {}) {
142
142
  if (W(n.absent, t))
143
143
  return e.absent === void 0 ? X : e.absent;
144
144
  const r = n.data[t], o = n.type;
145
- if (p(r, o)) return e.na === void 0 ? G : e.na;
145
+ if (y(r, o)) return e.na === void 0 ? z : e.na;
146
146
  switch (o) {
147
147
  case "Int":
148
148
  return r;
@@ -160,27 +160,30 @@ function yn(n, t, e = {}) {
160
160
  throw Error(`unsupported data type: ${o}`);
161
161
  }
162
162
  }
163
- function h(n) {
163
+ function p(n) {
164
164
  const { type: t, name: e, domain: r } = n;
165
165
  return { type: t, name: e, ...r && { domain: r } };
166
166
  }
167
- function bn(n) {
168
- return n.map(h);
167
+ function gn(n) {
168
+ return n.map(p);
169
169
  }
170
- function Q(n, t) {
170
+ function wn(n) {
171
+ return g(p(n));
172
+ }
173
+ function G(n, t) {
171
174
  if (n === void 0) return t === void 0;
172
175
  if (t === void 0) return !0;
173
176
  for (const e in t)
174
177
  if (n[e] !== t[e]) return !1;
175
178
  return !0;
176
179
  }
177
- function z(n, t) {
178
- return n.name === t.name && Q(n.domain, t.domain);
180
+ function Q(n, t) {
181
+ return n.name === t.name && G(n.domain, t.domain);
179
182
  }
180
- function gn(n, t) {
181
- return { ...n, src: l(n.src, t) };
183
+ function An(n, t) {
184
+ return { ...n, src: h(n.src, t) };
182
185
  }
183
- function l(n, t) {
186
+ function h(n, t) {
184
187
  switch (n.type) {
185
188
  case "column":
186
189
  return {
@@ -191,110 +194,132 @@ function l(n, t) {
191
194
  case "full":
192
195
  return {
193
196
  type: n.type,
194
- entries: n.entries.map((e) => l(e, t))
197
+ entries: n.entries.map((e) => h(e, t))
195
198
  };
196
199
  case "outer":
197
200
  return {
198
201
  type: "outer",
199
- primary: l(n.primary, t),
200
- secondary: n.secondary.map((e) => l(e, t))
202
+ primary: h(n.primary, t),
203
+ secondary: n.secondary.map((e) => h(e, t))
201
204
  };
202
205
  default:
203
- g(n);
206
+ w(n);
204
207
  }
205
208
  }
206
- function A(n) {
207
- return k(h(n));
209
+ function Y(n) {
210
+ return g(n);
211
+ }
212
+ function xn(n) {
213
+ return JSON.parse(n);
214
+ }
215
+ function x(n) {
216
+ return g(p(n));
208
217
  }
209
- function x(n, t) {
218
+ function P(n, t) {
210
219
  return JSON.stringify([n, t]);
211
220
  }
212
- class wn {
221
+ class Pn {
213
222
  /**
214
223
  * Creates a new anchor context from a set of anchor column specifications
215
224
  * @param anchors Record of anchor column specifications indexed by anchor ID
216
225
  */
217
226
  constructor(t) {
218
- d(this, "domains", /* @__PURE__ */ new Map());
219
- d(this, "axes", /* @__PURE__ */ new Map());
227
+ m(this, "domains", /* @__PURE__ */ new Map());
228
+ m(this, "axes", /* @__PURE__ */ new Map());
220
229
  /**
221
230
  * Domain packs are used to group domain keys that can be anchored to the same anchor
222
231
  * This is used to optimize the lookup of domain anchors
223
232
  */
224
- d(this, "domainPacks", []);
233
+ m(this, "domainPacks", []);
225
234
  /**
226
235
  * Maps domain packs to anchors
227
236
  */
228
- d(this, "domainPackToAnchor", /* @__PURE__ */ new Map());
237
+ m(this, "domainPackToAnchor", /* @__PURE__ */ new Map());
229
238
  this.anchors = t;
230
239
  const e = Object.entries(t);
231
240
  e.sort((r, o) => r[0].localeCompare(o[0]));
232
241
  for (const [r, o] of e) {
233
242
  for (let i = 0; i < o.axesSpec.length; i++) {
234
- const a = o.axesSpec[i], s = A(a);
235
- this.axes.set(s, { anchor: r, idx: i });
243
+ const s = o.axesSpec[i], a = x(s);
244
+ this.axes.set(a, { anchor: r, idx: i });
236
245
  }
237
246
  if (o.domain !== void 0) {
238
247
  const i = Object.entries(o.domain);
239
- i.sort((a, s) => a[0].localeCompare(s[0])), this.domainPackToAnchor.set(JSON.stringify(i), r), this.domainPacks.push(i.map(([a]) => a));
240
- for (const [a, s] of i) {
241
- const c = x(a, s);
242
- this.domains.set(c, r);
248
+ i.sort((s, a) => s[0].localeCompare(a[0])), this.domainPackToAnchor.set(JSON.stringify(i), r), this.domainPacks.push(i.map(([s]) => s));
249
+ for (const [s, a] of i) {
250
+ const f = P(s, a);
251
+ this.domains.set(f, r);
243
252
  }
244
253
  }
245
254
  }
246
255
  }
247
256
  /**
248
- * Derives an anchored column identifier from a column specification
249
- * Replaces domain values and axes with anchored references when possible
250
- * @param spec Column specification to anchor
251
- * @returns An anchored column identifier that can be used to identify columns similar to the input specification
257
+ * Implementation of derive method
252
258
  */
253
- derive(t) {
254
- const e = {
259
+ derive(t, e) {
260
+ const r = {
255
261
  name: t.name,
256
262
  axes: []
257
263
  };
258
- let r;
264
+ let o;
259
265
  if (t.domain !== void 0)
260
266
  n:
261
- for (const o of this.domainPacks) {
262
- const i = [];
263
- for (const s of o) {
264
- const c = t.domain[s];
265
- if (c !== void 0)
266
- i.push([s, c]);
267
+ for (const s of this.domainPacks) {
268
+ const a = [];
269
+ for (const u of s) {
270
+ const d = t.domain[u];
271
+ if (d !== void 0)
272
+ a.push([u, d]);
267
273
  else
268
274
  break n;
269
275
  }
270
- const a = this.domainPackToAnchor.get(JSON.stringify(i));
271
- if (a !== void 0) {
272
- e.domainAnchor = a, r = new Set(o);
276
+ const f = this.domainPackToAnchor.get(JSON.stringify(a));
277
+ if (f !== void 0) {
278
+ r.domainAnchor = f, o = new Set(s);
273
279
  break;
274
280
  }
275
281
  }
276
- for (const [o, i] of Object.entries(t.domain ?? {})) {
277
- if (r !== void 0 && r.has(o))
282
+ for (const [s, a] of Object.entries(t.domain ?? {})) {
283
+ if (o !== void 0 && o.has(s))
278
284
  continue;
279
- const a = x(o, i), s = this.domains.get(a);
280
- e.domain ?? (e.domain = {}), e.domain[o] = s ? { anchor: s } : i;
285
+ const f = P(s, a), u = this.domains.get(f);
286
+ r.domain ?? (r.domain = {}), r.domain[s] = u ? { anchor: u } : a;
287
+ }
288
+ if (r.axes = t.axesSpec.map((s) => {
289
+ const a = x(s);
290
+ return this.axes.get(a) ?? s;
291
+ }), !e || e.length === 0)
292
+ return r;
293
+ const i = [];
294
+ for (const s of e) {
295
+ const [a, f] = s;
296
+ if (typeof a == "number") {
297
+ if (a < 0 || a >= t.axesSpec.length)
298
+ throw new Error(`Axis index ${a} is out of bounds (0-${t.axesSpec.length - 1})`);
299
+ i.push([a, f]);
300
+ } else {
301
+ const u = t.axesSpec.findIndex((d) => d.name === a);
302
+ if (u === -1)
303
+ throw new Error(`Axis with name "${a}" not found in the column specification`);
304
+ i.push([u, f]);
305
+ }
281
306
  }
282
- return e.axes = t.axesSpec.map((o) => {
283
- const i = A(o);
284
- return this.axes.get(i) ?? o;
285
- }), e;
307
+ return i.sort((s, a) => s[0] - a[0]), {
308
+ source: r,
309
+ axisFilters: i
310
+ };
286
311
  }
287
312
  /**
288
313
  * Derives a canonicalized string representation of an anchored column identifier, can be used as a unique identifier for the column
289
314
  * @param spec Column specification to anchor
315
+ * @param axisFilters Optional axis filters to apply to the column
290
316
  * @returns A canonicalized string representation of the anchored column identifier
291
317
  */
292
- deriveCanonical(t) {
293
- const e = this.derive(t);
294
- return k(e);
318
+ deriveS(t, e) {
319
+ return Y(this.derive(t, e));
295
320
  }
296
321
  }
297
- function An(n, t) {
322
+ function En(n, t) {
298
323
  const e = { ...t };
299
324
  if (e.domainAnchor !== void 0) {
300
325
  const r = n[e.domainAnchor];
@@ -309,19 +334,19 @@ function An(n, t) {
309
334
  if (typeof i == "string")
310
335
  r[o] = i;
311
336
  else {
312
- const a = n[i.anchor];
313
- if (!a)
337
+ const s = n[i.anchor];
338
+ if (!s)
314
339
  throw new Error(`Anchor "${i.anchor}" not found for domain key "${o}"`);
315
- if (!a.domain || a.domain[o] === void 0)
340
+ if (!s.domain || s.domain[o] === void 0)
316
341
  throw new Error(`Domain key "${o}" not found in anchor "${i.anchor}"`);
317
- r[o] = a.domain[o];
342
+ r[o] = s.domain[o];
318
343
  }
319
344
  e.domain = r;
320
345
  }
321
- return e.axes && (e.axes = e.axes.map((r) => Y(n, r))), e;
346
+ return e.axes && (e.axes = e.axes.map((r) => Z(n, r))), e;
322
347
  }
323
- function Y(n, t) {
324
- if (!Z(t))
348
+ function Z(n, t) {
349
+ if (!q(t))
325
350
  return t;
326
351
  const e = t.anchor, r = n[e];
327
352
  if (!r)
@@ -338,7 +363,7 @@ function Y(n, t) {
338
363
  throw new Error(`Axis with name "${t.name}" not found in anchor "${e}"`);
339
364
  return o[0];
340
365
  } else if ("id" in t) {
341
- const o = r.axesSpec.filter((i) => z(t.id, h(i)));
366
+ const o = r.axesSpec.filter((i) => Q(t.id, p(i)));
342
367
  if (o.length > 1)
343
368
  throw new Error(`Multiple matching axes found for matcher in anchor "${e}"`);
344
369
  if (o.length === 0)
@@ -347,32 +372,35 @@ function Y(n, t) {
347
372
  }
348
373
  throw new Error("Unsupported axis reference type");
349
374
  }
350
- function Z(n) {
375
+ function q(n) {
351
376
  return typeof n == "object" && "anchor" in n;
352
377
  }
353
- function f(n) {
378
+ function In(n) {
379
+ return typeof n == "object" && n !== null && "source" in n && "axisFilters" in n;
380
+ }
381
+ function c(n) {
354
382
  return n.kind === "PColumn";
355
383
  }
356
- function q(n) {
357
- return f(n.spec);
384
+ function v(n) {
385
+ return c(n.spec);
358
386
  }
359
- function xn(n) {
360
- return f(n.obj);
387
+ function kn(n) {
388
+ return c(n.obj);
361
389
  }
362
- function Pn(n) {
363
- return f(n.obj.spec);
390
+ function Nn(n) {
391
+ return c(n.obj.spec);
364
392
  }
365
- function En(n) {
366
- if (!q(n)) throw new Error(`not a PColumn (kind = ${n.spec.kind})`);
393
+ function Sn(n) {
394
+ if (!v(n)) throw new Error(`not a PColumn (kind = ${n.spec.kind})`);
367
395
  return n;
368
396
  }
369
- function kn(n, t) {
397
+ function Cn(n, t) {
370
398
  return n === void 0 ? void 0 : {
371
399
  ...n,
372
400
  data: t(n.data)
373
401
  };
374
402
  }
375
- function In(n) {
403
+ function $n(n) {
376
404
  const t = /* @__PURE__ */ new Map(), e = (r) => {
377
405
  switch (r.type) {
378
406
  case "column":
@@ -387,12 +415,12 @@ function In(n) {
387
415
  for (const o of r.secondary) e(o);
388
416
  return;
389
417
  default:
390
- g(r);
418
+ w(r);
391
419
  }
392
420
  };
393
421
  return e(n), [...t.values()];
394
422
  }
395
- function v(n) {
423
+ function nn(n) {
396
424
  throw new Error("Unexpected object: " + n);
397
425
  }
398
426
  function b(n, t) {
@@ -408,15 +436,15 @@ function b(n, t) {
408
436
  case "not":
409
437
  return !b(n.operand, t);
410
438
  case "name":
411
- return f(t) && t.name === n.name;
439
+ return c(t) && t.name === n.name;
412
440
  case "name_pattern":
413
- return f(t) && !!t.name.match(n.pattern);
441
+ return c(t) && !!t.name.match(n.pattern);
414
442
  case "annotation":
415
- return f(t) && t.annotations !== void 0 && t.annotations[n.annotation] === n.value;
443
+ return c(t) && t.annotations !== void 0 && t.annotations[n.annotation] === n.value;
416
444
  case "annotation_pattern":
417
- return f(t) && t.annotations !== void 0 && t.annotations[n.annotation] !== void 0 && !!t.annotations[n.annotation].match(n.pattern);
445
+ return c(t) && t.annotations !== void 0 && t.annotations[n.annotation] !== void 0 && !!t.annotations[n.annotation].match(n.pattern);
418
446
  case "has_axes":
419
- return f(t) && n.axes.every(
447
+ return c(t) && n.axes.every(
420
448
  (e) => t.axesSpec.some(
421
449
  (r) => (e.type === void 0 || e.type === r.type) && (e.name === void 0 || e.name === r.name) && (e.domain === void 0 || Object.keys(e.domain).length === 0 || r.domain !== void 0 && Object.entries(e.domain).every(
422
450
  ([o, i]) => r.domain[o] === i
@@ -424,10 +452,10 @@ function b(n, t) {
424
452
  )
425
453
  );
426
454
  default:
427
- v(n);
455
+ nn(n);
428
456
  }
429
457
  }
430
- function P(n, t) {
458
+ function E(n, t) {
431
459
  if (n.name !== void 0 && n.name !== t.name)
432
460
  return !1;
433
461
  if (n.type !== void 0) {
@@ -445,7 +473,7 @@ function P(n, t) {
445
473
  }
446
474
  return !0;
447
475
  }
448
- function E(n, t) {
476
+ function I(n, t) {
449
477
  if (t.name !== void 0 && n.name !== t.name || t.namePattern !== void 0 && !new RegExp(t.namePattern).test(n.name))
450
478
  return !1;
451
479
  if (t.type !== void 0) {
@@ -462,16 +490,16 @@ function E(n, t) {
462
490
  return !1;
463
491
  }
464
492
  if (t.axes !== void 0) {
465
- const e = n.axesSpec.map(h);
493
+ const e = n.axesSpec.map(p);
466
494
  if (t.partialAxesMatch) {
467
495
  for (const r of t.axes)
468
- if (!e.some((o) => P(r, o)))
496
+ if (!e.some((o) => E(r, o)))
469
497
  return !1;
470
498
  } else {
471
499
  if (e.length !== t.axes.length)
472
500
  return !1;
473
501
  for (let r = 0; r < t.axes.length; r++)
474
- if (!P(t.axes[r], e[r]))
502
+ if (!E(t.axes[r], e[r]))
475
503
  return !1;
476
504
  }
477
505
  }
@@ -491,26 +519,26 @@ function E(n, t) {
491
519
  }
492
520
  return !0;
493
521
  }
494
- function Nn(n) {
495
- return Array.isArray(n) ? (t) => n.some((e) => f(t) && E(t, e)) : (t) => f(t) && E(t, n);
522
+ function Vn(n) {
523
+ return Array.isArray(n) ? (t) => n.some((e) => c(t) && I(t, e)) : (t) => c(t) && I(t, n);
496
524
  }
497
- const Cn = { href: "/" }, Sn = m.object({
498
- __isRef: m.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),
499
- blockId: m.string().describe("Upstream block id"),
500
- name: m.string().describe("Name of the output provided to the upstream block's output context")
525
+ const Fn = { href: "/" }, Dn = l.object({
526
+ __isRef: l.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),
527
+ blockId: l.string().describe("Upstream block id"),
528
+ name: l.string().describe("Name of the output provided to the upstream block's output context")
501
529
  }).describe(
502
530
  "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."
503
531
  ).strict().readonly();
504
- function Vn(n) {
532
+ function On(n) {
505
533
  return typeof n == "object" && n !== null && "__isRef" in n && n.__isRef === !0 && "blockId" in n && "name" in n;
506
534
  }
507
- function $n(n, t) {
535
+ function Un(n, t) {
508
536
  return n.blockId === t.blockId && n.name === t.name;
509
537
  }
510
- function Fn(n, t) {
538
+ function Bn(n, t) {
511
539
  return n.ok ? { ok: !0, value: t(n.value) } : n;
512
540
  }
513
- function nn(n) {
541
+ function tn(n) {
514
542
  if (n instanceof Int8Array || n instanceof Uint8Array || n instanceof Uint8ClampedArray)
515
543
  return new DataView(n.buffer, n.byteOffset, n.byteLength);
516
544
  if (n instanceof ArrayBuffer) return new DataView(n);
@@ -518,100 +546,104 @@ function nn(n) {
518
546
  "Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray"
519
547
  );
520
548
  }
521
- const tn = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", en = "0123456789ABCDEFGHIJKLMNOPQRSTUV", rn = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
522
- function C(n, t, e) {
549
+ const en = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", rn = "0123456789ABCDEFGHIJKLMNOPQRSTUV", on = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
550
+ function S(n, t, e) {
523
551
  e = e || {};
524
552
  let r, o;
525
553
  switch (t) {
526
554
  case "RFC3548":
527
555
  case "RFC4648":
528
- r = tn, o = !0;
556
+ r = en, o = !0;
529
557
  break;
530
558
  case "RFC4648-HEX":
531
- r = en, o = !0;
559
+ r = rn, o = !0;
532
560
  break;
533
561
  case "Crockford":
534
- r = rn, o = !1;
562
+ r = on, o = !1;
535
563
  break;
536
564
  default:
537
565
  throw new Error("Unknown base32 variant: " + String(t));
538
566
  }
539
- const i = e.padding !== void 0 ? e.padding : o, a = nn(n);
540
- let s = 0, c = 0, u = "";
541
- for (let y = 0; y < a.byteLength; y++)
542
- for (c = c << 8 | a.getUint8(y), s += 8; s >= 5; )
543
- u += r[c >>> s - 5 & 31], s -= 5;
544
- if (s > 0 && (u += r[c << 5 - s & 31]), i)
567
+ const i = e.padding !== void 0 ? e.padding : o, s = tn(n);
568
+ let a = 0, f = 0, u = "";
569
+ for (let d = 0; d < s.byteLength; d++)
570
+ for (f = f << 8 | s.getUint8(d), a += 8; a >= 5; )
571
+ u += r[f >>> a - 5 & 31], a -= 5;
572
+ if (a > 0 && (u += r[f << 5 - a & 31]), i)
545
573
  for (; u.length % 8 !== 0; )
546
574
  u += "=";
547
575
  return u;
548
576
  }
549
- const S = 15, on = 24, V = m.string().length(on).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
550
- function Dn() {
551
- const n = new Uint8Array(S);
552
- return crypto.getRandomValues(n), V.parse(C(n, "RFC4648"));
577
+ const C = 15, an = 24, $ = l.string().length(an).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
578
+ function Rn() {
579
+ const n = new Uint8Array(C);
580
+ return crypto.getRandomValues(n), $.parse(S(n, "RFC4648"));
553
581
  }
554
- function an(n) {
555
- if (n.length !== S) throw new Error(`Wrong number of bytes: ${n.length}`);
556
- return V.parse(C(n, "RFC4648"));
582
+ function sn(n) {
583
+ if (n.length !== C) throw new Error(`Wrong number of bytes: ${n.length}`);
584
+ return $.parse(S(n, "RFC4648"));
557
585
  }
558
- async function Un(n) {
586
+ async function jn(n) {
559
587
  const t = new TextEncoder(), e = await crypto.subtle.digest("SHA-256", t.encode(n));
560
- return an(new Uint8Array(e.slice(0, 15)));
588
+ return sn(new Uint8Array(e.slice(0, 15)));
561
589
  }
562
590
  export {
563
- wn as AnchorIdDeriver,
564
- Cn as DefaultNavigationState,
591
+ Pn as AnchoredIdDeriver,
592
+ Fn as DefaultNavigationState,
565
593
  X as PTableAbsent,
566
- G as PTableNA,
567
- _ as PValueBytesNA,
594
+ z as PTableNA,
595
+ M as PValueBytesNA,
568
596
  L as PValueDoubleNA,
569
597
  j as PValueFloatNA,
570
598
  R as PValueIntNA,
571
- w as PValueLongNA,
572
- M as PValueStringNA,
573
- V as PlId,
574
- S as PlIdBytes,
575
- on as PlIdLength,
576
- Sn as PlRef,
577
- Un as digestPlId,
578
- mn as ensureNotNAPValue,
579
- En as ensurePColumn,
599
+ A as PValueLongNA,
600
+ J as PValueStringNA,
601
+ $ as PlId,
602
+ C as PlIdBytes,
603
+ an as PlIdLength,
604
+ Dn as PlRef,
605
+ wn as canonicalizeAxisId,
606
+ jn as digestPlId,
607
+ ln as ensureNotNAPValue,
608
+ Sn as ensurePColumn,
580
609
  b as executePSpecPredicate,
581
- In as extractAllColumns,
582
- bn as getAxesId,
583
- h as getAxisId,
584
- dn as getFileNameFromHandle,
585
- O as getFilePathFromHandle,
586
- U as isImportFileHandleIndex,
610
+ $n as extractAllColumns,
611
+ gn as getAxesId,
612
+ p as getAxisId,
613
+ mn as getFileNameFromHandle,
614
+ U as getFilePathFromHandle,
615
+ In as isFilteredPColumn,
616
+ O as isImportFileHandleIndex,
587
617
  D as isImportFileHandleUpload,
588
- un as isLiveLog,
589
- H as isNotNAPValue,
590
- q as isPColumn,
591
- Pn as isPColumnResult,
592
- f as isPColumnSpec,
593
- xn as isPColumnSpecResult,
594
- hn as isPTableAbsent,
595
- J as isPValue,
596
- Vn as isPlRef,
618
+ dn as isLiveLog,
619
+ _ as isNotNAPValue,
620
+ v as isPColumn,
621
+ Nn as isPColumnResult,
622
+ c as isPColumnSpec,
623
+ kn as isPColumnSpecResult,
624
+ yn as isPTableAbsent,
625
+ H as isPValue,
626
+ On as isPlRef,
597
627
  W as isValueAbsent,
598
- p as isValueNA,
599
- l as mapJoinEntry,
600
- kn as mapPObjectData,
601
- gn as mapPTableDef,
602
- Fn as mapValueInVOE,
603
- P as matchAxis,
604
- z as matchAxisId,
605
- E as matchPColumn,
606
- yn as pTableValue,
607
- pn as pValueToStringOrNumber,
628
+ y as isValueNA,
629
+ h as mapJoinEntry,
630
+ Cn as mapPObjectData,
631
+ An as mapPTableDef,
632
+ Bn as mapValueInVOE,
633
+ E as matchAxis,
634
+ Q as matchAxisId,
635
+ I as matchPColumn,
636
+ bn as pTableValue,
637
+ hn as pValueToStringOrNumber,
608
638
  T as pValueToStringOrNumberOrNull,
609
- an as plId,
610
- $n as plRefsEqual,
611
- An as resolveAnchors,
639
+ xn as parseColumnId,
640
+ sn as plId,
641
+ Un as plRefsEqual,
642
+ En as resolveAnchors,
612
643
  K as safeConvertToPValue,
613
- Nn as selectorsToPredicate,
614
- ln as toJsonSafePValue,
615
- Dn as uniquePlId
644
+ Vn as selectorsToPredicate,
645
+ Y as stringifyColumnId,
646
+ pn as toJsonSafePValue,
647
+ Rn as uniquePlId
616
648
  };
617
649
  //# sourceMappingURL=index.mjs.map