@milaboratories/pl-model-common 1.13.3 → 1.13.5

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,38 +1,38 @@
1
1
  var $ = Object.defineProperty;
2
- var L = (n, t, e) => t in n ? $(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
- var p = (n, t, e) => L(n, typeof t != "symbol" ? t + "" : t, e);
4
- import g from "canonicalize";
5
- import { z as m } from "zod";
6
- function cn(n) {
2
+ var D = (n, t, e) => t in n ? $(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var m = (n, t, e) => D(n, typeof t != "symbol" ? t + "" : t, e);
4
+ import b from "canonicalize";
5
+ import { z as y } from "zod";
6
+ function fn(n) {
7
7
  return n !== void 0 && n.startsWith("log+live://log/");
8
8
  }
9
9
  function w(n) {
10
10
  throw new Error("Unexpected object: " + n);
11
11
  }
12
12
  const S = "upload://upload/", E = "index://index/";
13
- function V(n) {
13
+ function L(n) {
14
14
  return n.startsWith(S);
15
15
  }
16
- function D(n) {
16
+ function V(n) {
17
17
  return n.startsWith(E);
18
18
  }
19
19
  function I(n) {
20
- if (D(n)) {
20
+ if (V(n)) {
21
21
  const t = n.slice(E.length);
22
22
  return JSON.parse(decodeURIComponent(t)).path;
23
- } else if (V(n)) {
23
+ } else if (L(n)) {
24
24
  const t = n.slice(S.length);
25
25
  return JSON.parse(decodeURIComponent(t)).localPath;
26
26
  }
27
27
  w(n);
28
28
  }
29
- function j(n) {
29
+ function B(n) {
30
30
  return n.replace(/^.*[\\/]/, "");
31
31
  }
32
- function fn(n) {
33
- return j(I(n));
34
- }
35
32
  function dn(n) {
33
+ return B(I(n));
34
+ }
35
+ function pn(n) {
36
36
  if (!n || typeof n != "object")
37
37
  return !1;
38
38
  const t = n;
@@ -49,7 +49,7 @@ function dn(n) {
49
49
  return !1;
50
50
  }
51
51
  }
52
- function pn(n, t) {
52
+ function mn(n, t) {
53
53
  if (n !== void 0)
54
54
  switch (n.type) {
55
55
  case "Json":
@@ -77,7 +77,7 @@ function pn(n, t) {
77
77
  }
78
78
  }
79
79
  }
80
- function mn(n) {
80
+ function j(n) {
81
81
  if (!n || typeof n != "object")
82
82
  return !1;
83
83
  const t = n;
@@ -95,6 +95,9 @@ function mn(n) {
95
95
  }
96
96
  }
97
97
  function yn(n) {
98
+ return j(n) ? n.type === "JsonPartitioned" || n.type === "BinaryPartitioned" : !1;
99
+ }
100
+ function ln(n) {
98
101
  switch (n.type) {
99
102
  case "Json": {
100
103
  const t = Object.entries(n.data).map(([e, r]) => ({ key: JSON.parse(e), value: r }));
@@ -122,7 +125,7 @@ function yn(n) {
122
125
  }
123
126
  }
124
127
  }
125
- function ln(n) {
128
+ function hn(n) {
126
129
  switch (n.type) {
127
130
  case "Json": {
128
131
  const t = {};
@@ -156,7 +159,7 @@ function ln(n) {
156
159
  }
157
160
  }
158
161
  }
159
- function hn(n, t) {
162
+ function gn(n, t) {
160
163
  if (n !== void 0)
161
164
  switch (n.type) {
162
165
  case "Json":
@@ -186,30 +189,30 @@ function hn(n, t) {
186
189
  }
187
190
  }
188
191
  }
189
- const B = -2147483648, A = -9007199254740991n, bn = NaN, gn = NaN, F = null, U = null;
192
+ const F = -2147483648, P = -9007199254740991n, bn = NaN, wn = NaN, U = null, K = null;
190
193
  function h(n, t) {
191
194
  switch (t) {
192
195
  case "Int":
193
- return n === B;
196
+ return n === F;
194
197
  case "Long":
195
- return n === Number(A) || n === A;
198
+ return n === Number(P) || n === P;
196
199
  case "Float":
197
200
  return Number.isNaN(n);
198
201
  case "Double":
199
202
  return Number.isNaN(n);
200
203
  case "String":
201
- return n === F;
202
- case "Bytes":
203
204
  return n === U;
205
+ case "Bytes":
206
+ return n === K;
204
207
  default:
205
208
  throw Error(`unsupported data type: ${t}`);
206
209
  }
207
210
  }
208
- function wn(n) {
209
- if (!K(n)) throw new Error(`Expected not-NA PValue, got ${n}`);
211
+ function Pn(n) {
212
+ if (!R(n)) throw new Error(`Expected not-NA PValue, got ${n}`);
210
213
  return n;
211
214
  }
212
- function K(n, t) {
215
+ function R(n, t) {
213
216
  if (!t)
214
217
  return typeof n == "string" || typeof n == "number" && isFinite(n) || typeof n == "bigint";
215
218
  if (h(n, t)) return !1;
@@ -230,7 +233,7 @@ function K(n, t) {
230
233
  throw Error(`unsupported data type: ${t}`);
231
234
  }
232
235
  }
233
- function R(n, t) {
236
+ function M(n, t) {
234
237
  if (!t)
235
238
  return n === null || typeof n == "string" || typeof n == "number" || typeof n == "bigint";
236
239
  if (h(n, t)) return !0;
@@ -256,9 +259,9 @@ function An(n) {
256
259
  if (typeof n == "bigint") return { bigint: n.toString() };
257
260
  throw new Error(`Type ${typeof n} (value ${n}) not yet supported.`);
258
261
  }
259
- function M(n, t) {
262
+ function _(n, t) {
260
263
  if (n === null || typeof n == "string" || typeof n == "number" || typeof n == "bigint") {
261
- if (t && !h(n, t) && !R(n, t))
264
+ if (t && !h(n, t) && !M(n, t))
262
265
  throw new Error(`Unexpected value type, got ${typeof n}, expected ${t}`);
263
266
  return n;
264
267
  }
@@ -269,12 +272,12 @@ function M(n, t) {
269
272
  }
270
273
  throw new Error(`Unsupported type ${typeof n} (value ${n}).`);
271
274
  }
272
- function Pn(n) {
273
- if (n = _(n), n === null) throw new Error("Value is null");
275
+ function xn(n) {
276
+ if (n = H(n), n === null) throw new Error("Value is null");
274
277
  return n;
275
278
  }
276
- function _(n) {
277
- if (n = M(n), n === null) return null;
279
+ function H(n) {
280
+ if (n = _(n), n === null) return null;
278
281
  if (typeof n == "string") return n;
279
282
  if (typeof n == "number") {
280
283
  if (!isFinite(n)) throw new Error(`Value is not finite (${n})`);
@@ -284,19 +287,19 @@ function _(n) {
284
287
  return Number(n);
285
288
  throw new Error(`Unexpected value type: ${typeof n}`);
286
289
  }
287
- function v(n, t) {
290
+ function T(n, t) {
288
291
  const e = Math.floor(t / 8), r = 1 << 7 - t % 8;
289
292
  return (n[e] & r) > 0;
290
293
  }
291
- const H = { type: "absent" }, T = null;
292
- function xn(n) {
294
+ const v = { type: "absent" }, W = null;
295
+ function kn(n) {
293
296
  return typeof n == "object" && n !== null && n.type === "absent";
294
297
  }
295
- function kn(n, t, e = {}) {
296
- if (v(n.absent, t))
297
- return e.absent === void 0 ? H : e.absent;
298
+ function Nn(n, t, e = {}) {
299
+ if (T(n.absent, t))
300
+ return e.absent === void 0 ? v : e.absent;
298
301
  const r = n.data[t], o = n.type;
299
- if (h(r, o)) return e.na === void 0 ? T : e.na;
302
+ if (h(r, o)) return e.na === void 0 ? W : e.na;
300
303
  switch (o) {
301
304
  case "Int":
302
305
  return r;
@@ -314,27 +317,27 @@ function kn(n, t, e = {}) {
314
317
  throw Error(`unsupported data type: ${o}`);
315
318
  }
316
319
  }
317
- function y(n) {
320
+ function p(n) {
318
321
  const { type: t, name: e, domain: r } = n;
319
322
  return { type: t, name: e, ...r && { domain: r } };
320
323
  }
321
- function Nn(n) {
322
- return n.map(y);
323
- }
324
324
  function Sn(n) {
325
- return g(y(n));
325
+ return n.map(p);
326
+ }
327
+ function En(n) {
328
+ return b(p(n));
326
329
  }
327
- function W(n, t) {
330
+ function X(n, t) {
328
331
  if (n === void 0) return t === void 0;
329
332
  if (t === void 0) return !0;
330
333
  for (const e in t)
331
334
  if (n[e] !== t[e]) return !1;
332
335
  return !0;
333
336
  }
334
- function X(n, t) {
335
- return n.name === t.name && W(n.domain, t.domain);
337
+ function z(n, t) {
338
+ return n.name === t.name && X(n.domain, t.domain);
336
339
  }
337
- function En(n, t) {
340
+ function Cn(n, t) {
338
341
  return { ...n, src: l(n.src, t) };
339
342
  }
340
343
  function l(n, t) {
@@ -367,14 +370,14 @@ function l(n, t) {
367
370
  w(n);
368
371
  }
369
372
  }
370
- function z(n) {
371
- return g(n);
373
+ function G(n) {
374
+ return b(n);
372
375
  }
373
- function Cn(n) {
376
+ function Jn(n) {
374
377
  return JSON.parse(n);
375
378
  }
376
- function P(n) {
377
- return g(y(n));
379
+ function A(n) {
380
+ return b(p(n));
378
381
  }
379
382
  function x(n, t) {
380
383
  return JSON.stringify([n, t]);
@@ -385,30 +388,30 @@ class On {
385
388
  * @param anchors Record of anchor column specifications indexed by anchor ID
386
389
  */
387
390
  constructor(t) {
388
- p(this, "domains", /* @__PURE__ */ new Map());
389
- p(this, "axes", /* @__PURE__ */ new Map());
391
+ m(this, "domains", /* @__PURE__ */ new Map());
392
+ m(this, "axes", /* @__PURE__ */ new Map());
390
393
  /**
391
394
  * Domain packs are used to group domain keys that can be anchored to the same anchor
392
395
  * This is used to optimize the lookup of domain anchors
393
396
  */
394
- p(this, "domainPacks", []);
397
+ m(this, "domainPacks", []);
395
398
  /**
396
399
  * Maps domain packs to anchors
397
400
  */
398
- p(this, "domainPackToAnchor", /* @__PURE__ */ new Map());
401
+ m(this, "domainPackToAnchor", /* @__PURE__ */ new Map());
399
402
  this.anchors = t;
400
403
  const e = Object.entries(t);
401
404
  e.sort((r, o) => r[0].localeCompare(o[0]));
402
405
  for (const [r, o] of e) {
403
- for (let i = 0; i < o.axesSpec.length; i++) {
404
- const a = o.axesSpec[i], s = P(a);
405
- this.axes.set(s, { anchor: r, idx: i });
406
+ for (let s = 0; s < o.axesSpec.length; s++) {
407
+ const a = o.axesSpec[s], i = A(a);
408
+ this.axes.set(i, { anchor: r, idx: s });
406
409
  }
407
410
  if (o.domain !== void 0) {
408
- const i = Object.entries(o.domain);
409
- i.sort((a, s) => a[0].localeCompare(s[0])), this.domainPackToAnchor.set(JSON.stringify(i), r), this.domainPacks.push(i.map(([a]) => a));
410
- for (const [a, s] of i) {
411
- const u = x(a, s);
411
+ const s = Object.entries(o.domain);
412
+ s.sort((a, i) => a[0].localeCompare(i[0])), this.domainPackToAnchor.set(JSON.stringify(s), r), this.domainPacks.push(s.map(([a]) => a));
413
+ for (const [a, i] of s) {
414
+ const u = x(a, i);
412
415
  this.domains.set(u, r);
413
416
  }
414
417
  }
@@ -426,48 +429,48 @@ class On {
426
429
  if (t.domain !== void 0)
427
430
  n:
428
431
  for (const a of this.domainPacks) {
429
- const s = [];
432
+ const i = [];
430
433
  for (const c of a) {
431
434
  const d = t.domain[c];
432
435
  if (d !== void 0)
433
- s.push([c, d]);
436
+ i.push([c, d]);
434
437
  else
435
438
  break n;
436
439
  }
437
- const u = this.domainPackToAnchor.get(JSON.stringify(s));
440
+ const u = this.domainPackToAnchor.get(JSON.stringify(i));
438
441
  if (u !== void 0) {
439
442
  r.domainAnchor = u, o = new Set(a);
440
443
  break;
441
444
  }
442
445
  }
443
- for (const [a, s] of Object.entries(t.domain ?? {})) {
446
+ for (const [a, i] of Object.entries(t.domain ?? {})) {
444
447
  if (o !== void 0 && o.has(a))
445
448
  continue;
446
- const u = x(a, s), c = this.domains.get(u);
447
- r.domain ?? (r.domain = {}), r.domain[a] = c ? { anchor: c } : s;
449
+ const u = x(a, i), c = this.domains.get(u);
450
+ r.domain ?? (r.domain = {}), r.domain[a] = c ? { anchor: c } : i;
448
451
  }
449
452
  if (r.axes = t.axesSpec.map((a) => {
450
- const s = P(a);
451
- return this.axes.get(s) ?? a;
453
+ const i = A(a), u = this.axes.get(i);
454
+ return u === void 0 ? p(a) : u;
452
455
  }), !e || e.length === 0)
453
456
  return r;
454
- const i = [];
457
+ const s = [];
455
458
  for (const a of e) {
456
- const [s, u] = a;
457
- if (typeof s == "number") {
458
- if (s < 0 || s >= t.axesSpec.length)
459
- throw new Error(`Axis index ${s} is out of bounds (0-${t.axesSpec.length - 1})`);
460
- i.push([s, u]);
459
+ const [i, u] = a;
460
+ if (typeof i == "number") {
461
+ if (i < 0 || i >= t.axesSpec.length)
462
+ throw new Error(`Axis index ${i} is out of bounds (0-${t.axesSpec.length - 1})`);
463
+ s.push([i, u]);
461
464
  } else {
462
- const c = t.axesSpec.findIndex((d) => d.name === s);
465
+ const c = t.axesSpec.findIndex((d) => d.name === i);
463
466
  if (c === -1)
464
- throw new Error(`Axis with name "${s}" not found in the column specification`);
465
- i.push([c, u]);
467
+ throw new Error(`Axis with name "${i}" not found in the column specification`);
468
+ s.push([c, u]);
466
469
  }
467
470
  }
468
- return i.sort((a, s) => a[0] - s[0]), {
471
+ return s.sort((a, i) => a[0] - i[0]), {
469
472
  source: r,
470
- axisFilters: i
473
+ axisFilters: s
471
474
  };
472
475
  }
473
476
  /**
@@ -477,37 +480,40 @@ class On {
477
480
  * @returns A canonicalized string representation of the anchored column identifier
478
481
  */
479
482
  deriveS(t, e) {
480
- return z(this.derive(t, e));
483
+ return G(this.derive(t, e));
481
484
  }
482
485
  }
483
- function Jn(n, t) {
484
- const e = { ...t };
485
- if (e.domainAnchor !== void 0) {
486
- const r = n[e.domainAnchor];
487
- if (!r)
488
- throw new Error(`Anchor "${e.domainAnchor}" not found`);
489
- const o = r.domain || {};
490
- e.domain = { ...o, ...e.domain }, delete e.domainAnchor;
486
+ function $n(n, t, e) {
487
+ const r = { ...t }, o = (e == null ? void 0 : e.ignoreMissingDomains) ?? !1;
488
+ if (r.domainAnchor !== void 0) {
489
+ const s = n[r.domainAnchor];
490
+ if (!s)
491
+ throw new Error(`Anchor "${r.domainAnchor}" not found`);
492
+ const a = s.domain || {};
493
+ r.domain = { ...a, ...r.domain }, delete r.domainAnchor;
491
494
  }
492
- if (e.domain) {
493
- const r = {};
494
- for (const [o, i] of Object.entries(e.domain))
495
+ if (r.domain) {
496
+ const s = {};
497
+ for (const [a, i] of Object.entries(r.domain))
495
498
  if (typeof i == "string")
496
- r[o] = i;
499
+ s[a] = i;
497
500
  else {
498
- const a = n[i.anchor];
499
- if (!a)
500
- throw new Error(`Anchor "${i.anchor}" not found for domain key "${o}"`);
501
- if (!a.domain || a.domain[o] === void 0)
502
- throw new Error(`Domain key "${o}" not found in anchor "${i.anchor}"`);
503
- r[o] = a.domain[o];
501
+ const u = n[i.anchor];
502
+ if (!u)
503
+ throw new Error(`Anchor "${i.anchor}" not found for domain key "${a}"`);
504
+ if (!u.domain || u.domain[a] === void 0) {
505
+ if (!o)
506
+ throw new Error(`Domain key "${a}" not found in anchor "${i.anchor}"`);
507
+ continue;
508
+ }
509
+ s[a] = u.domain[a];
504
510
  }
505
- e.domain = r;
511
+ r.domain = s;
506
512
  }
507
- return e.axes && (e.axes = e.axes.map((r) => G(n, r))), e;
513
+ return r.axes && (r.axes = r.axes.map((s) => Q(n, s))), r;
508
514
  }
509
- function G(n, t) {
510
- if (!Q(t))
515
+ function Q(n, t) {
516
+ if (!Y(t))
511
517
  return t;
512
518
  const e = t.anchor, r = n[e];
513
519
  if (!r)
@@ -517,14 +523,14 @@ function G(n, t) {
517
523
  throw new Error(`Axis index ${t.idx} out of bounds for anchor "${e}"`);
518
524
  return r.axesSpec[t.idx];
519
525
  } else if ("name" in t) {
520
- const o = r.axesSpec.filter((i) => i.name === t.name);
526
+ const o = r.axesSpec.filter((s) => s.name === t.name);
521
527
  if (o.length > 1)
522
528
  throw new Error(`Multiple axes with name "${t.name}" found in anchor "${e}"`);
523
529
  if (o.length === 0)
524
530
  throw new Error(`Axis with name "${t.name}" not found in anchor "${e}"`);
525
531
  return o[0];
526
532
  } else if ("id" in t) {
527
- const o = r.axesSpec.filter((i) => X(t.id, y(i)));
533
+ const o = r.axesSpec.filter((s) => z(t.id, p(s)));
528
534
  if (o.length > 1)
529
535
  throw new Error(`Multiple matching axes found for matcher in anchor "${e}"`);
530
536
  if (o.length === 0)
@@ -533,16 +539,16 @@ function G(n, t) {
533
539
  }
534
540
  throw new Error("Unsupported axis reference type");
535
541
  }
536
- function Q(n) {
542
+ function Y(n) {
537
543
  return typeof n == "object" && "anchor" in n;
538
544
  }
539
- function $n(n) {
545
+ function Dn(n) {
540
546
  return typeof n == "object" && n !== null && "source" in n && "axisFilters" in n;
541
547
  }
542
548
  function f(n) {
543
549
  return n.kind === "PColumn";
544
550
  }
545
- function Y(n) {
551
+ function Z(n) {
546
552
  return f(n.spec);
547
553
  }
548
554
  function Ln(n) {
@@ -551,11 +557,11 @@ function Ln(n) {
551
557
  function Vn(n) {
552
558
  return f(n.obj.spec);
553
559
  }
554
- function Dn(n) {
555
- if (!Y(n)) throw new Error(`not a PColumn (kind = ${n.spec.kind})`);
560
+ function In(n) {
561
+ if (!Z(n)) throw new Error(`not a PColumn (kind = ${n.spec.kind})`);
556
562
  return n;
557
563
  }
558
- function In(n, t) {
564
+ function Bn(n, t) {
559
565
  return n === void 0 ? void 0 : {
560
566
  ...n,
561
567
  data: t(n.data)
@@ -584,21 +590,21 @@ function jn(n) {
584
590
  };
585
591
  return e(n), [...t.values()];
586
592
  }
587
- function Z(n) {
593
+ function q(n) {
588
594
  throw new Error("Unexpected object: " + n);
589
595
  }
590
- function b(n, t) {
596
+ function g(n, t) {
591
597
  switch (n.type) {
592
598
  case "and":
593
599
  for (const e of n.operands)
594
- if (!b(e, t)) return !1;
600
+ if (!g(e, t)) return !1;
595
601
  return !0;
596
602
  case "or":
597
603
  for (const e of n.operands)
598
- if (b(e, t)) return !0;
604
+ if (g(e, t)) return !0;
599
605
  return !1;
600
606
  case "not":
601
- return !b(n.operand, t);
607
+ return !g(n.operand, t);
602
608
  case "name":
603
609
  return f(t) && t.name === n.name;
604
610
  case "name_pattern":
@@ -611,12 +617,12 @@ function b(n, t) {
611
617
  return f(t) && n.axes.every(
612
618
  (e) => t.axesSpec.some(
613
619
  (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(
614
- ([o, i]) => r.domain[o] === i
620
+ ([o, s]) => r.domain[o] === s
615
621
  ))
616
622
  )
617
623
  );
618
624
  default:
619
- Z(n);
625
+ q(n);
620
626
  }
621
627
  }
622
628
  function k(n, t) {
@@ -654,7 +660,7 @@ function N(n, t) {
654
660
  return !1;
655
661
  }
656
662
  if (t.axes !== void 0) {
657
- const e = n.axesSpec.map(y);
663
+ const e = n.axesSpec.map(p);
658
664
  if (t.partialAxesMatch) {
659
665
  for (const r of t.axes)
660
666
  if (!e.some((o) => k(r, o)))
@@ -676,33 +682,33 @@ function N(n, t) {
676
682
  if (t.annotationPatterns !== void 0) {
677
683
  const e = n.annotations || {};
678
684
  for (const [r, o] of Object.entries(t.annotationPatterns)) {
679
- const i = e[r];
680
- if (i === void 0 || !new RegExp(o).test(i))
685
+ const s = e[r];
686
+ if (s === void 0 || !new RegExp(o).test(s))
681
687
  return !1;
682
688
  }
683
689
  }
684
690
  return !0;
685
691
  }
686
- function Bn(n) {
692
+ function Fn(n) {
687
693
  return Array.isArray(n) ? (t) => n.some((e) => f(t) && N(t, e)) : (t) => f(t) && N(t, n);
688
694
  }
689
- const Fn = { href: "/" }, Un = m.object({
690
- __isRef: m.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),
691
- blockId: m.string().describe("Upstream block id"),
692
- name: m.string().describe("Name of the output provided to the upstream block's output context")
695
+ const Un = { href: "/" }, Kn = y.object({
696
+ __isRef: y.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),
697
+ blockId: y.string().describe("Upstream block id"),
698
+ name: y.string().describe("Name of the output provided to the upstream block's output context")
693
699
  }).describe(
694
700
  "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."
695
701
  ).strict().readonly();
696
- function Kn(n) {
702
+ function Rn(n) {
697
703
  return typeof n == "object" && n !== null && "__isRef" in n && n.__isRef === !0 && "blockId" in n && "name" in n;
698
704
  }
699
- function Rn(n, t) {
705
+ function Mn(n, t) {
700
706
  return n.blockId === t.blockId && n.name === t.name;
701
707
  }
702
- function Mn(n, t) {
708
+ function _n(n, t) {
703
709
  return n.ok ? { ok: !0, value: t(n.value) } : n;
704
710
  }
705
- function q(n) {
711
+ function nn(n) {
706
712
  if (n instanceof Int8Array || n instanceof Uint8Array || n instanceof Uint8ClampedArray)
707
713
  return new DataView(n.buffer, n.byteOffset, n.byteLength);
708
714
  if (n instanceof ArrayBuffer) return new DataView(n);
@@ -710,110 +716,111 @@ function q(n) {
710
716
  "Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray"
711
717
  );
712
718
  }
713
- const nn = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", tn = "0123456789ABCDEFGHIJKLMNOPQRSTUV", en = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
719
+ const tn = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567", en = "0123456789ABCDEFGHIJKLMNOPQRSTUV", rn = "0123456789ABCDEFGHJKMNPQRSTVWXYZ";
714
720
  function C(n, t, e) {
715
721
  e = e || {};
716
722
  let r, o;
717
723
  switch (t) {
718
724
  case "RFC3548":
719
725
  case "RFC4648":
720
- r = nn, o = !0;
726
+ r = tn, o = !0;
721
727
  break;
722
728
  case "RFC4648-HEX":
723
- r = tn, o = !0;
729
+ r = en, o = !0;
724
730
  break;
725
731
  case "Crockford":
726
- r = en, o = !1;
732
+ r = rn, o = !1;
727
733
  break;
728
734
  default:
729
735
  throw new Error("Unknown base32 variant: " + String(t));
730
736
  }
731
- const i = e.padding !== void 0 ? e.padding : o, a = q(n);
732
- let s = 0, u = 0, c = "";
737
+ const s = e.padding !== void 0 ? e.padding : o, a = nn(n);
738
+ let i = 0, u = 0, c = "";
733
739
  for (let d = 0; d < a.byteLength; d++)
734
- for (u = u << 8 | a.getUint8(d), s += 8; s >= 5; )
735
- c += r[u >>> s - 5 & 31], s -= 5;
736
- if (s > 0 && (c += r[u << 5 - s & 31]), i)
740
+ for (u = u << 8 | a.getUint8(d), i += 8; i >= 5; )
741
+ c += r[u >>> i - 5 & 31], i -= 5;
742
+ if (i > 0 && (c += r[u << 5 - i & 31]), s)
737
743
  for (; c.length % 8 !== 0; )
738
744
  c += "=";
739
745
  return c;
740
746
  }
741
- const O = 15, rn = 24, J = m.string().length(rn).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
742
- function _n() {
743
- const n = new Uint8Array(O);
744
- return crypto.getRandomValues(n), J.parse(C(n, "RFC4648"));
747
+ const J = 15, on = 24, O = y.string().length(on).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
748
+ function Hn() {
749
+ const n = new Uint8Array(J);
750
+ return crypto.getRandomValues(n), O.parse(C(n, "RFC4648"));
745
751
  }
746
- function on(n) {
747
- if (n.length !== O) throw new Error(`Wrong number of bytes: ${n.length}`);
748
- return J.parse(C(n, "RFC4648"));
752
+ function sn(n) {
753
+ if (n.length !== J) throw new Error(`Wrong number of bytes: ${n.length}`);
754
+ return O.parse(C(n, "RFC4648"));
749
755
  }
750
- async function vn(n) {
756
+ async function Tn(n) {
751
757
  const t = new TextEncoder(), e = await crypto.subtle.digest("SHA-256", t.encode(n));
752
- return on(new Uint8Array(e.slice(0, 15)));
758
+ return sn(new Uint8Array(e.slice(0, 15)));
753
759
  }
754
760
  export {
755
761
  On as AnchoredIdDeriver,
756
- Fn as DefaultNavigationState,
757
- H as PTableAbsent,
758
- T as PTableNA,
759
- U as PValueBytesNA,
760
- gn as PValueDoubleNA,
762
+ Un as DefaultNavigationState,
763
+ v as PTableAbsent,
764
+ W as PTableNA,
765
+ K as PValueBytesNA,
766
+ wn as PValueDoubleNA,
761
767
  bn as PValueFloatNA,
762
- B as PValueIntNA,
763
- A as PValueLongNA,
764
- F as PValueStringNA,
765
- J as PlId,
766
- O as PlIdBytes,
767
- rn as PlIdLength,
768
- Un as PlRef,
769
- Sn as canonicalizeAxisId,
770
- yn as dataInfoToEntries,
771
- vn as digestPlId,
772
- wn as ensureNotNAPValue,
773
- Dn as ensurePColumn,
774
- ln as entriesToDataInfo,
775
- b as executePSpecPredicate,
768
+ F as PValueIntNA,
769
+ P as PValueLongNA,
770
+ U as PValueStringNA,
771
+ O as PlId,
772
+ J as PlIdBytes,
773
+ on as PlIdLength,
774
+ Kn as PlRef,
775
+ En as canonicalizeAxisId,
776
+ ln as dataInfoToEntries,
777
+ Tn as digestPlId,
778
+ Pn as ensureNotNAPValue,
779
+ In as ensurePColumn,
780
+ hn as entriesToDataInfo,
781
+ g as executePSpecPredicate,
776
782
  jn as extractAllColumns,
777
- Nn as getAxesId,
778
- y as getAxisId,
779
- fn as getFileNameFromHandle,
783
+ Sn as getAxesId,
784
+ p as getAxisId,
785
+ dn as getFileNameFromHandle,
780
786
  I as getFilePathFromHandle,
781
- dn as isDataInfo,
782
- mn as isDataInfoEntries,
783
- $n as isFilteredPColumn,
784
- D as isImportFileHandleIndex,
785
- V as isImportFileHandleUpload,
786
- cn as isLiveLog,
787
- K as isNotNAPValue,
788
- Y as isPColumn,
787
+ pn as isDataInfo,
788
+ j as isDataInfoEntries,
789
+ Dn as isFilteredPColumn,
790
+ V as isImportFileHandleIndex,
791
+ L as isImportFileHandleUpload,
792
+ fn as isLiveLog,
793
+ R as isNotNAPValue,
794
+ Z as isPColumn,
789
795
  Vn as isPColumnResult,
790
796
  f as isPColumnSpec,
791
797
  Ln as isPColumnSpecResult,
792
- xn as isPTableAbsent,
793
- R as isPValue,
794
- Kn as isPlRef,
795
- v as isValueAbsent,
798
+ kn as isPTableAbsent,
799
+ M as isPValue,
800
+ yn as isPartitionedDataInfoEntries,
801
+ Rn as isPlRef,
802
+ T as isValueAbsent,
796
803
  h as isValueNA,
797
- pn as mapDataInfo,
798
- hn as mapDataInfoEntries,
804
+ mn as mapDataInfo,
805
+ gn as mapDataInfoEntries,
799
806
  l as mapJoinEntry,
800
- In as mapPObjectData,
801
- En as mapPTableDef,
802
- Mn as mapValueInVOE,
807
+ Bn as mapPObjectData,
808
+ Cn as mapPTableDef,
809
+ _n as mapValueInVOE,
803
810
  k as matchAxis,
804
- X as matchAxisId,
811
+ z as matchAxisId,
805
812
  N as matchPColumn,
806
- kn as pTableValue,
807
- Pn as pValueToStringOrNumber,
808
- _ as pValueToStringOrNumberOrNull,
809
- Cn as parseColumnId,
810
- on as plId,
811
- Rn as plRefsEqual,
812
- Jn as resolveAnchors,
813
- M as safeConvertToPValue,
814
- Bn as selectorsToPredicate,
815
- z as stringifyColumnId,
813
+ Nn as pTableValue,
814
+ xn as pValueToStringOrNumber,
815
+ H as pValueToStringOrNumberOrNull,
816
+ Jn as parseColumnId,
817
+ sn as plId,
818
+ Mn as plRefsEqual,
819
+ $n as resolveAnchors,
820
+ _ as safeConvertToPValue,
821
+ Fn as selectorsToPredicate,
822
+ G as stringifyColumnId,
816
823
  An as toJsonSafePValue,
817
- _n as uniquePlId
824
+ Hn as uniquePlId
818
825
  };
819
826
  //# sourceMappingURL=index.mjs.map