@webwriter/deep-learning-model 1.0.1 → 1.0.2

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.
Files changed (138) hide show
  1. package/README.md +3 -3
  2. package/components/model-editor.ts +22 -7
  3. package/custom-elements.json +24 -0
  4. package/dist/widgets/webwriter-feature-engineering.js +1381 -859
  5. package/dist/widgets/webwriter-model-designing.js +1500 -880
  6. package/dist/widgets/webwriter-model-evaluation.js +515 -524
  7. package/dist/widgets/webwriter-model-prediction.js +503 -512
  8. package/dist/widgets/webwriter-model-training.js +633 -559
  9. package/lib/layers/index.ts +77 -15
  10. package/lib/tflib.ts +9 -5
  11. package/localization/ar.xlf +28 -7
  12. package/localization/bg.xlf +28 -7
  13. package/localization/cs.xlf +28 -7
  14. package/localization/da.xlf +28 -7
  15. package/localization/de.xlf +28 -7
  16. package/localization/el.xlf +28 -7
  17. package/localization/es.xlf +28 -7
  18. package/localization/et.xlf +28 -7
  19. package/localization/fi.xlf +28 -7
  20. package/localization/fr.xlf +28 -7
  21. package/localization/generated/ar.ts +1 -0
  22. package/localization/generated/bg.ts +1 -0
  23. package/localization/generated/cs.ts +1 -0
  24. package/localization/generated/da.ts +1 -0
  25. package/localization/generated/de.ts +1 -0
  26. package/localization/generated/el.ts +1 -0
  27. package/localization/generated/es.ts +1 -0
  28. package/localization/generated/et.ts +1 -0
  29. package/localization/generated/fi.ts +1 -0
  30. package/localization/generated/fr.ts +1 -0
  31. package/localization/generated/hu.ts +1 -0
  32. package/localization/generated/id.ts +1 -0
  33. package/localization/generated/it.ts +1 -0
  34. package/localization/generated/ja.ts +1 -0
  35. package/localization/generated/ko.ts +1 -0
  36. package/localization/generated/lt.ts +1 -0
  37. package/localization/generated/lv.ts +1 -0
  38. package/localization/generated/nb.ts +1 -0
  39. package/localization/generated/nl.ts +1 -0
  40. package/localization/generated/pl.ts +1 -0
  41. package/localization/generated/pt-BR.ts +1 -0
  42. package/localization/generated/pt-PT.ts +1 -0
  43. package/localization/generated/ro.ts +1 -0
  44. package/localization/generated/ru.ts +1 -0
  45. package/localization/generated/sk.ts +1 -0
  46. package/localization/generated/sl.ts +1 -0
  47. package/localization/generated/sv.ts +1 -0
  48. package/localization/generated/tr.ts +1 -0
  49. package/localization/generated/uk.ts +1 -0
  50. package/localization/generated/zh-hans.ts +1 -0
  51. package/localization/generated/zh-hant.ts +1 -0
  52. package/localization/hu.xlf +28 -7
  53. package/localization/id.xlf +28 -7
  54. package/localization/it.xlf +28 -7
  55. package/localization/ja.xlf +28 -7
  56. package/localization/ko.xlf +28 -7
  57. package/localization/lt.xlf +28 -7
  58. package/localization/lv.xlf +28 -7
  59. package/localization/nb.xlf +28 -7
  60. package/localization/nl.xlf +28 -7
  61. package/localization/pkg/ar.xliff +1 -1
  62. package/localization/pkg/bg.xliff +1 -1
  63. package/localization/pkg/cs.xliff +1 -1
  64. package/localization/pkg/da.xliff +1 -1
  65. package/localization/pkg/de.xliff +1 -1
  66. package/localization/pkg/el.xliff +1 -1
  67. package/localization/pkg/es.xliff +1 -1
  68. package/localization/pkg/et.xliff +1 -1
  69. package/localization/pkg/fi.xliff +1 -1
  70. package/localization/pkg/fr.xliff +1 -1
  71. package/localization/pkg/hu.xliff +1 -1
  72. package/localization/pkg/id.xliff +1 -1
  73. package/localization/pkg/it.xliff +1 -1
  74. package/localization/pkg/ja.xliff +1 -1
  75. package/localization/pkg/ko.xliff +1 -1
  76. package/localization/pkg/lt.xliff +1 -1
  77. package/localization/pkg/lv.xliff +1 -1
  78. package/localization/pkg/nb.xliff +1 -1
  79. package/localization/pkg/nl.xliff +1 -1
  80. package/localization/pkg/pl.xliff +1 -1
  81. package/localization/pkg/pt-BR.xliff +1 -1
  82. package/localization/pkg/pt-PT.xliff +1 -1
  83. package/localization/pkg/ro.xliff +1 -1
  84. package/localization/pkg/ru.xliff +1 -1
  85. package/localization/pkg/sk.xliff +1 -1
  86. package/localization/pkg/sl.xliff +1 -1
  87. package/localization/pkg/sv.xliff +1 -1
  88. package/localization/pkg/tr.xliff +1 -1
  89. package/localization/pkg/uk.xliff +1 -1
  90. package/localization/pkg/zh-hans.xliff +2 -2
  91. package/localization/pkg/zh-hant.xliff +2 -2
  92. package/localization/pl.xlf +28 -7
  93. package/localization/pt-BR.xlf +28 -7
  94. package/localization/pt-PT.xlf +28 -7
  95. package/localization/ro.xlf +28 -7
  96. package/localization/ru.xlf +28 -7
  97. package/localization/sk.xlf +28 -7
  98. package/localization/sl.xlf +28 -7
  99. package/localization/snippets/ar.xliff +1 -1
  100. package/localization/snippets/bg.xliff +1 -1
  101. package/localization/snippets/cs.xliff +1 -1
  102. package/localization/snippets/da.xliff +1 -1
  103. package/localization/snippets/de.xliff +1 -1
  104. package/localization/snippets/el.xliff +1 -1
  105. package/localization/snippets/es.xliff +1 -1
  106. package/localization/snippets/et.xliff +1 -1
  107. package/localization/snippets/fi.xliff +1 -1
  108. package/localization/snippets/fr.xliff +1 -1
  109. package/localization/snippets/hu.xliff +1 -1
  110. package/localization/snippets/id.xliff +1 -1
  111. package/localization/snippets/it.xliff +1 -1
  112. package/localization/snippets/ja.xliff +1 -1
  113. package/localization/snippets/ko.xliff +1 -1
  114. package/localization/snippets/lt.xliff +1 -1
  115. package/localization/snippets/lv.xliff +1 -1
  116. package/localization/snippets/nb.xliff +1 -1
  117. package/localization/snippets/nl.xliff +1 -1
  118. package/localization/snippets/pl.xliff +1 -1
  119. package/localization/snippets/pt-BR.xliff +1 -1
  120. package/localization/snippets/pt-PT.xliff +1 -1
  121. package/localization/snippets/ro.xliff +1 -1
  122. package/localization/snippets/ru.xliff +1 -1
  123. package/localization/snippets/sk.xliff +1 -1
  124. package/localization/snippets/sl.xliff +1 -1
  125. package/localization/snippets/sv.xliff +1 -1
  126. package/localization/snippets/tr.xliff +1 -1
  127. package/localization/snippets/uk.xliff +1 -1
  128. package/localization/snippets/zh-hans.xliff +2 -2
  129. package/localization/snippets/zh-hant.xliff +2 -2
  130. package/localization/sv.xlf +28 -7
  131. package/localization/tr.xlf +28 -7
  132. package/localization/uk.xlf +28 -7
  133. package/localization/zh-hans.xlf +28 -7
  134. package/localization/zh-hant.xlf +28 -7
  135. package/package.json +2 -2
  136. package/snippets/MNIST.html +1 -1
  137. package/widgets/webwriter-model-designing.ts +25 -2
  138. package/widgets/webwriter-model-training.ts +45 -20
@@ -129,8 +129,8 @@ var init_deferred = __esm({
129
129
  Deferred = class {
130
130
  constructor() {
131
131
  this.settled = false;
132
- this.promise = new Promise((resolve, reject) => {
133
- this._resolve = resolve;
132
+ this.promise = new Promise((resolve2, reject) => {
133
+ this._resolve = resolve2;
134
134
  this._reject = reject;
135
135
  });
136
136
  }
@@ -343,6 +343,9 @@ var require_papaparse_min = __commonJS({
343
343
  })(exports, function r11() {
344
344
  var n11 = "undefined" != typeof self ? self : "undefined" != typeof window ? window : void 0 !== n11 ? n11 : {};
345
345
  var d4, s6 = !n11.document && !!n11.postMessage, a6 = n11.IS_PAPA_WORKER || false, o15 = {}, h6 = 0, v3 = {};
346
+ function P3(e12) {
347
+ return 65279 === e12.charCodeAt(0) ? e12.slice(1) : e12;
348
+ }
346
349
  function u5(e12) {
347
350
  this._handle = null, this._finished = false, this._completed = false, this._halted = false, this._input = null, this._baseIndex = 0, this._partialLine = "", this._rowCount = 0, this._start = 0, this._nextChunk = null, this.isFirstChunk = true, this._completeResults = { data: [], errors: [], meta: {} }, function(e13) {
348
351
  var t8 = b4(e13);
@@ -354,20 +357,20 @@ var require_papaparse_min = __commonJS({
354
357
  let e14 = this._config.newline;
355
358
  e14 || (r12 = this._config.quoteChar || '"', e14 = this._handle.guessLineEndings(t8, r12)), t8 = [...t8.split(e14).slice(i10)].join(e14);
356
359
  }
357
- this.isFirstChunk && U(this._config.beforeFirstChunk) && void 0 !== (r12 = this._config.beforeFirstChunk(t8)) && (t8 = r12), this.isFirstChunk = false, this._halted = false;
360
+ this.isFirstChunk && q(this._config.beforeFirstChunk) && void 0 !== (r12 = this._config.beforeFirstChunk(t8)) && (t8 = r12), this.isFirstChunk = false, this._halted = false;
358
361
  var i10 = this._partialLine + t8, r12 = (this._partialLine = "", this._handle.parse(i10, this._baseIndex, !this._finished));
359
362
  if (!this._handle.paused() && !this._handle.aborted()) {
360
363
  t8 = r12.meta.cursor, i10 = (this._finished || (this._partialLine = i10.substring(t8 - this._baseIndex), this._baseIndex = t8), r12 && r12.data && (this._rowCount += r12.data.length), this._finished || this._config.preview && this._rowCount >= this._config.preview);
361
364
  if (a6) n11.postMessage({ results: r12, workerId: v3.WORKER_ID, finished: i10 });
362
- else if (U(this._config.chunk) && !e13) {
365
+ else if (q(this._config.chunk) && !e13) {
363
366
  if (this._config.chunk(r12, this._handle), this._handle.paused() || this._handle.aborted()) return void (this._halted = true);
364
367
  this._completeResults = r12 = void 0;
365
368
  }
366
- return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(r12.data), this._completeResults.errors = this._completeResults.errors.concat(r12.errors), this._completeResults.meta = r12.meta), this._completed || !i10 || !U(this._config.complete) || r12 && r12.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = true), i10 || r12 && r12.meta.paused || this._nextChunk(), r12;
369
+ return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(r12.data), this._completeResults.errors = this._completeResults.errors.concat(r12.errors), this._completeResults.meta = r12.meta), this._completed || !i10 || !q(this._config.complete) || r12 && r12.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = true), i10 || r12 && r12.meta.paused || this._nextChunk(), r12;
367
370
  }
368
371
  this._halted = true;
369
372
  }, this._sendError = function(e13) {
370
- U(this._config.error) ? this._config.error(e13) : a6 && this._config.error && n11.postMessage({ workerId: v3.WORKER_ID, error: e13, finished: false });
373
+ q(this._config.error) ? this._config.error(e13) : a6 && this._config.error && n11.postMessage({ workerId: v3.WORKER_ID, error: e13, finished: false });
371
374
  };
372
375
  }
373
376
  function f5(e12) {
@@ -463,7 +466,7 @@ var require_papaparse_min = __commonJS({
463
466
  return !y5(e14);
464
467
  })), _4()) {
465
468
  let t10 = function(e14, t11) {
466
- U(m5.transformHeader) && (e14 = m5.transformHeader(e14, t11)), c8.push(e14);
469
+ e14 = P3(e14), q(m5.transformHeader) && (e14 = m5.transformHeader(e14, t11)), c8.push(e14);
467
470
  };
468
471
  var t9 = t10;
469
472
  if (p7) if (Array.isArray(p7.data[0])) {
@@ -493,10 +496,10 @@ var require_papaparse_min = __commonJS({
493
496
  e13 = { type: e13, code: t9, message: i11 };
494
497
  void 0 !== r13 && (e13.row = r13), p7.errors.push(e13);
495
498
  }
496
- U(m5.step) && (t8 = m5.step, m5.step = function(e13) {
499
+ q(m5.step) && (t8 = m5.step, m5.step = function(e13) {
497
500
  p7 = e13, _4() ? g4() : (g4(), 0 !== p7.data.length && (r12 += e13.data.length, m5.preview && r12 > m5.preview ? s7.abort() : (p7.data = p7.data[0], t8(p7, i10))));
498
501
  }), this.parse = function(e13, t9, i11) {
499
- var r13 = m5.quoteChar || '"', r13 = (m5.newline || (m5.newline = this.guessLineEndings(e13, r13)), a7 = false, m5.delimiter ? U(m5.delimiter) && (m5.delimiter = m5.delimiter(e13), p7.meta.delimiter = m5.delimiter) : ((r13 = ((e14, t10, i12, r14, n13) => {
502
+ var r13 = m5.quoteChar || '"', r13 = (m5.newline || (m5.newline = this.guessLineEndings(e13, r13)), a7 = false, m5.delimiter ? q(m5.delimiter) && (m5.delimiter = m5.delimiter(e13), p7.meta.delimiter = m5.delimiter) : ((r13 = ((e14, t10, i12, r14, n13) => {
500
503
  var s8, a8, o17, h8;
501
504
  n13 = n13 || [",", " ", "|", ";", v3.RECORD_SEP, v3.UNIT_SEP];
502
505
  for (var u7 = 0; u7 < n13.length; u7++) {
@@ -509,32 +512,32 @@ var require_papaparse_min = __commonJS({
509
512
  }, this.paused = function() {
510
513
  return l8;
511
514
  }, this.pause = function() {
512
- l8 = true, s7.abort(), n12 = U(m5.chunk) ? "" : n12.substring(s7.getCharIndex());
515
+ l8 = true, s7.abort(), n12 = q(m5.chunk) ? "" : n12.substring(s7.getCharIndex());
513
516
  }, this.resume = function() {
514
517
  i10.streamer._halted ? (l8 = false, i10.streamer.parseChunk(n12, true)) : setTimeout(i10.resume, 3);
515
518
  }, this.aborted = function() {
516
519
  return e12;
517
520
  }, this.abort = function() {
518
- e12 = true, s7.abort(), p7.meta.aborted = true, U(m5.complete) && m5.complete(p7), n12 = "";
521
+ e12 = true, s7.abort(), p7.meta.aborted = true, q(m5.complete) && m5.complete(p7), n12 = "";
519
522
  }, this.guessLineEndings = function(e13, t9) {
520
523
  e13 = e13.substring(0, 1048576);
521
- var t9 = new RegExp(P3(t9) + "([^]*?)" + P3(t9), "gm"), i11 = (e13 = e13.replace(t9, "")).split("\r"), t9 = e13.split("\n"), e13 = 1 < t9.length && t9[0].length < i11[0].length;
524
+ var t9 = new RegExp(U(t9) + "([^]*?)" + U(t9), "gm"), i11 = (e13 = e13.replace(t9, "")).split("\r"), t9 = e13.split("\n"), e13 = 1 < t9.length && t9[0].length < i11[0].length;
522
525
  if (1 === i11.length || e13) return "\n";
523
526
  for (var r13 = 0, n13 = 0; n13 < i11.length; n13++) "\n" === i11[n13][0] && r13++;
524
527
  return r13 >= i11.length / 2 ? "\r\n" : "\r";
525
528
  };
526
529
  }
527
- function P3(e12) {
530
+ function U(e12) {
528
531
  return e12.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
529
532
  }
530
533
  function E3(C3) {
531
- var S4 = (C3 = C3 || {}).delimiter, O = C3.newline, x3 = C3.comments, I3 = C3.step, A3 = C3.preview, T3 = C3.fastMode, D2 = null, L3 = false, F = null == C3.quoteChar ? '"' : C3.quoteChar, j3 = F;
532
- if (void 0 !== C3.escapeChar && (j3 = C3.escapeChar), ("string" != typeof S4 || -1 < v3.BAD_DELIMITERS.indexOf(S4)) && (S4 = ","), x3 === S4) throw new Error("Comment character same as delimiter");
534
+ var S4 = (C3 = C3 || {}).delimiter, O = C3.newline, x3 = C3.comments, I3 = C3.step, A3 = C3.preview, T3 = C3.fastMode, D3 = null, L3 = false, F = null == C3.quoteChar ? '"' : C3.quoteChar, j2 = F;
535
+ if (void 0 !== C3.escapeChar && (j2 = C3.escapeChar), ("string" != typeof S4 || -1 < v3.BAD_DELIMITERS.indexOf(S4)) && (S4 = ","), x3 === S4) throw new Error("Comment character same as delimiter");
533
536
  true === x3 ? x3 = "#" : ("string" != typeof x3 || -1 < v3.BAD_DELIMITERS.indexOf(x3)) && (x3 = false), "\n" !== O && "\r" !== O && "\r\n" !== O && (O = "\n");
534
537
  var z3 = 0, M3 = false;
535
538
  this.parse = function(i10, t8, r12) {
536
539
  if ("string" != typeof i10) throw new Error("Input must be a string");
537
- var n12 = i10.length, e12 = S4.length, s7 = O.length, a7 = x3.length, o16 = U(I3), h7 = [], u6 = [], d5 = [], f6 = z3 = 0;
540
+ var n12 = i10.length, e12 = S4.length, s7 = O.length, a7 = x3.length, o16 = q(I3), h7 = [], u6 = [], d5 = [], f6 = z3 = 0;
538
541
  if (!i10) return w3();
539
542
  if (T3 || false !== T3 && -1 === i10.indexOf(F)) {
540
543
  for (var l8 = i10.split(O), c8 = 0; c8 < l8.length; c8++) {
@@ -549,11 +552,11 @@ var require_papaparse_min = __commonJS({
549
552
  }
550
553
  return w3();
551
554
  }
552
- for (var p7 = i10.indexOf(S4, z3), g4 = i10.indexOf(O, z3), _4 = new RegExp(P3(j3) + P3(F), "g"), m5 = i10.indexOf(F, z3); ; ) if (i10[z3] === F) for (m5 = z3, z3++; ; ) {
555
+ for (var p7 = i10.indexOf(S4, z3), g4 = i10.indexOf(O, z3), _4 = new RegExp(U(j2) + U(F), "g"), m5 = i10.indexOf(F, z3); ; ) if (i10[z3] === F) for (m5 = z3, z3++; ; ) {
553
556
  if (-1 === (m5 = i10.indexOf(F, m5 + 1))) return r12 || u6.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: h7.length, index: z3 }), E4();
554
557
  if (m5 === n12 - 1) return E4(i10.substring(z3, m5).replace(_4, F));
555
- if (F === j3 && i10[m5 + 1] === j3) m5++;
556
- else if (F === j3 || 0 === m5 || i10[m5 - 1] !== j3) {
558
+ if (F === j2 && i10[m5 + 1] === j2) m5++;
559
+ else if (F === j2 || 0 === m5 || i10[m5 - 1] !== j2) {
557
560
  -1 !== p7 && p7 < m5 + 1 && (p7 = i10.indexOf(S4, m5 + 1));
558
561
  var y5 = v4(-1 === (g4 = -1 !== g4 && g4 < m5 + 1 ? i10.indexOf(O, m5 + 1) : g4) ? p7 : Math.min(p7, g4));
559
562
  if (i10.substr(m5 + 1 + y5, e12) === S4) {
@@ -597,17 +600,17 @@ var require_papaparse_min = __commonJS({
597
600
  var s8 = h7[0], a8 = /* @__PURE__ */ Object.create(null), o17 = new Set(s8);
598
601
  let n13 = false;
599
602
  for (let r13 = 0; r13 < s8.length; r13++) {
600
- let i11 = s8[r13];
601
- if (a8[i11 = U(C3.transformHeader) ? C3.transformHeader(i11, r13) : i11]) {
603
+ let i11 = P3(s8[r13]);
604
+ if (a8[i11 = q(C3.transformHeader) ? C3.transformHeader(i11, r13) : i11]) {
602
605
  let e14, t9 = a8[i11];
603
606
  for (; e14 = i11 + "_" + t9, t9++, o17.has(e14); ) ;
604
- o17.add(e14), s8[r13] = e14, a8[i11]++, n13 = true, (D2 = null === D2 ? {} : D2)[e14] = i11;
607
+ o17.add(e14), s8[r13] = e14, a8[i11]++, n13 = true, (D3 = null === D3 ? {} : D3)[e14] = i11;
605
608
  } else a8[i11] = 1, s8[r13] = i11;
606
609
  o17.add(i11);
607
610
  }
608
611
  n13 && console.warn("Duplicate headers found and renamed."), L3 = true;
609
612
  }
610
- return { data: h7, errors: u6, meta: { delimiter: S4, linebreak: O, aborted: M3, truncated: !!e13, cursor: f6 + (t8 || 0), renamedHeaders: D2 } };
613
+ return { data: h7, errors: u6, meta: { delimiter: S4, linebreak: O, aborted: M3, truncated: !!e13, cursor: f6 + (t8 || 0), renamedHeaders: D3 } };
611
614
  }
612
615
  function R3() {
613
616
  I3(w3()), h7 = [], u6 = [];
@@ -625,16 +628,16 @@ var require_papaparse_min = __commonJS({
625
628
  var n12 = { abort: function() {
626
629
  r12 = true, _3(t8.workerId, { data: [], errors: [], meta: { aborted: true } });
627
630
  }, pause: m4, resume: m4 };
628
- if (U(i10.userStep)) {
631
+ if (q(i10.userStep)) {
629
632
  for (var s7 = 0; s7 < t8.results.data.length && (i10.userStep({ data: t8.results.data[s7], errors: t8.results.errors, meta: t8.results.meta }, n12), !r12); s7++) ;
630
633
  delete t8.results;
631
- } else U(i10.userChunk) && (i10.userChunk(t8.results, n12, t8.file), delete t8.results);
634
+ } else q(i10.userChunk) && (i10.userChunk(t8.results, n12, t8.file), delete t8.results);
632
635
  }
633
636
  t8.finished && !r12 && _3(t8.workerId, t8.results);
634
637
  }
635
638
  function _3(e12, t8) {
636
639
  var i10 = o15[e12];
637
- U(i10.userComplete) && i10.userComplete(t8), i10.terminate(), delete o15[e12];
640
+ q(i10.userComplete) && i10.userComplete(t8), i10.terminate(), delete o15[e12];
638
641
  }
639
642
  function m4() {
640
643
  throw new Error("Not implemented.");
@@ -650,39 +653,39 @@ var require_papaparse_min = __commonJS({
650
653
  e12.apply(t8, arguments);
651
654
  };
652
655
  }
653
- function U(e12) {
656
+ function q(e12) {
654
657
  return "function" == typeof e12;
655
658
  }
656
659
  return v3.parse = function(e12, t8) {
657
660
  var i10 = (t8 = t8 || {}).dynamicTyping || false;
658
- U(i10) && (t8.dynamicTypingFunction = i10, i10 = {});
659
- if (t8.dynamicTyping = i10, t8.transform = !!U(t8.transform) && t8.transform, !t8.worker || !v3.WORKERS_SUPPORTED) return i10 = null, v3.NODE_STREAM_INPUT, "string" == typeof e12 ? (e12 = ((e13) => 65279 !== e13.charCodeAt(0) ? e13 : e13.slice(1))(e12), i10 = new (t8.download ? f5 : c7)(t8)) : true === e12.readable && U(e12.read) && U(e12.on) ? i10 = new p6(t8) : (n11.File && e12 instanceof File || e12 instanceof Object) && (i10 = new l7(t8)), i10.stream(e12);
661
+ q(i10) && (t8.dynamicTypingFunction = i10, i10 = {});
662
+ if (t8.dynamicTyping = i10, t8.transform = !!q(t8.transform) && t8.transform, !t8.worker || !v3.WORKERS_SUPPORTED) return i10 = null, v3.NODE_STREAM_INPUT, "string" == typeof e12 ? (e12 = P3(e12), i10 = new (t8.download ? f5 : c7)(t8)) : true === e12.readable && q(e12.read) && q(e12.on) ? i10 = new p6(t8) : (n11.File && e12 instanceof File || e12 instanceof Object) && (i10 = new l7(t8)), i10.stream(e12);
660
663
  (i10 = (() => {
661
664
  var e13;
662
665
  return !!v3.WORKERS_SUPPORTED && (e13 = (() => {
663
666
  var e14 = n11.URL || n11.webkitURL || null, t9 = r11.toString();
664
667
  return v3.BLOB_URL || (v3.BLOB_URL = e14.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ", "(", t9, ")();"], { type: "text/javascript" })));
665
668
  })(), (e13 = new n11.Worker(e13)).onmessage = g3, e13.id = h6++, o15[e13.id] = e13);
666
- })()).userStep = t8.step, i10.userChunk = t8.chunk, i10.userComplete = t8.complete, i10.userError = t8.error, t8.step = U(t8.step), t8.chunk = U(t8.chunk), t8.complete = U(t8.complete), t8.error = U(t8.error), delete t8.worker, i10.postMessage({ input: e12, config: t8, workerId: i10.id });
669
+ })()).userStep = t8.step, i10.userChunk = t8.chunk, i10.userComplete = t8.complete, i10.userError = t8.error, t8.step = q(t8.step), t8.chunk = q(t8.chunk), t8.complete = q(t8.complete), t8.error = q(t8.error), delete t8.worker, i10.postMessage({ input: e12, config: t8, workerId: i10.id });
667
670
  }, v3.unparse = function(e12, t8) {
668
- var n12 = false, _4 = true, m5 = ",", y5 = "\r\n", s7 = '"', a7 = s7 + s7, i10 = false, r12 = null, o16 = false, h7 = ((() => {
671
+ var s7 = false, _4 = true, m5 = ",", y5 = "\r\n", a7 = '"', o16 = a7 + a7, i10 = false, r12 = null, h7 = false, u6 = ((() => {
669
672
  if ("object" == typeof t8) {
670
673
  if ("string" != typeof t8.delimiter || v3.BAD_DELIMITERS.filter(function(e13) {
671
674
  return -1 !== t8.delimiter.indexOf(e13);
672
- }).length || (m5 = t8.delimiter), "boolean" != typeof t8.quotes && "function" != typeof t8.quotes && !Array.isArray(t8.quotes) || (n12 = t8.quotes), "boolean" != typeof t8.skipEmptyLines && "string" != typeof t8.skipEmptyLines || (i10 = t8.skipEmptyLines), "string" == typeof t8.newline && (y5 = t8.newline), "string" == typeof t8.quoteChar && (s7 = t8.quoteChar), "boolean" == typeof t8.header && (_4 = t8.header), Array.isArray(t8.columns)) {
675
+ }).length || (m5 = t8.delimiter), "boolean" != typeof t8.quotes && "function" != typeof t8.quotes && !Array.isArray(t8.quotes) || (s7 = t8.quotes), "boolean" != typeof t8.skipEmptyLines && "string" != typeof t8.skipEmptyLines || (i10 = t8.skipEmptyLines), "string" == typeof t8.newline && (y5 = t8.newline), "string" == typeof t8.quoteChar && (a7 = t8.quoteChar, o16 = a7 + a7), "boolean" == typeof t8.header && (_4 = t8.header), Array.isArray(t8.columns)) {
673
676
  if (0 === t8.columns.length) throw new Error("Option columns is empty");
674
677
  r12 = t8.columns;
675
678
  }
676
- void 0 !== t8.escapeChar && (a7 = t8.escapeChar + s7), t8.escapeFormulae instanceof RegExp ? o16 = t8.escapeFormulae : "boolean" == typeof t8.escapeFormulae && t8.escapeFormulae && (o16 = /^[=+\-@\t\r].*$/);
679
+ void 0 !== t8.escapeChar && (o16 = t8.escapeChar + a7), t8.escapeFormulae instanceof RegExp ? h7 = t8.escapeFormulae : "boolean" == typeof t8.escapeFormulae && t8.escapeFormulae && (h7 = /^[=+\-@\t\r].*$/);
677
680
  }
678
- })(), new RegExp(P3(s7), "g"));
681
+ })(), new RegExp(U(a7), "g"));
679
682
  "string" == typeof e12 && (e12 = JSON.parse(e12));
680
683
  if (Array.isArray(e12)) {
681
- if (!e12.length || Array.isArray(e12[0])) return u6(null, e12, i10);
682
- if ("object" == typeof e12[0]) return u6(r12 || Object.keys(e12[0]), e12, i10);
683
- } else if ("object" == typeof e12) return "string" == typeof e12.data && (e12.data = JSON.parse(e12.data)), Array.isArray(e12.data) && (e12.fields || (e12.fields = e12.meta && e12.meta.fields || r12), e12.fields || (e12.fields = Array.isArray(e12.data[0]) ? e12.fields : "object" == typeof e12.data[0] ? Object.keys(e12.data[0]) : []), Array.isArray(e12.data[0]) || "object" == typeof e12.data[0] || (e12.data = [e12.data])), u6(e12.fields || [], e12.data || [], i10);
684
+ if (!e12.length || Array.isArray(e12[0])) return n12(null, e12, i10);
685
+ if ("object" == typeof e12[0]) return n12(r12 || Object.keys(e12[0]), e12, i10);
686
+ } else if ("object" == typeof e12) return "string" == typeof e12.data && (e12.data = JSON.parse(e12.data)), Array.isArray(e12.data) && (e12.fields || (e12.fields = e12.meta && e12.meta.fields || r12), e12.fields || (e12.fields = Array.isArray(e12.data[0]) ? e12.fields : "object" == typeof e12.data[0] ? Object.keys(e12.data[0]) : []), Array.isArray(e12.data[0]) || "object" == typeof e12.data[0] || (e12.data = [e12.data])), n12(e12.fields || [], e12.data || [], i10);
684
687
  throw new Error("Unable to serialize unrecognized input");
685
- function u6(e13, t9, i11) {
688
+ function n12(e13, t9, i11) {
686
689
  var r13 = "", n13 = ("string" == typeof e13 && (e13 = JSON.parse(e13)), "string" == typeof t9 && (t9 = JSON.parse(t9)), Array.isArray(e13) && 0 < e13.length), s8 = !Array.isArray(t9[0]);
687
690
  if (n13 && _4) {
688
691
  for (var a8 = 0; a8 < e13.length; a8++) 0 < a8 && (r13 += m5), r13 += k3(e13[a8], a8);
@@ -709,11 +712,11 @@ var require_papaparse_min = __commonJS({
709
712
  return r13;
710
713
  }
711
714
  function k3(e13, t9) {
712
- var i11, r13;
713
- return null == e13 ? "" : e13.constructor === Date ? JSON.stringify(e13).slice(1, 25) : (r13 = false, o16 && "string" == typeof e13 && o16.test(e13) && (e13 = "'" + e13, r13 = true), i11 = e13.toString().replace(h7, a7), (r13 = r13 || true === n12 || "function" == typeof n12 && n12(e13, t9) || Array.isArray(n12) && n12[t9] || ((e14, t10) => {
715
+ var i11, r13, n13;
716
+ return null == e13 ? "" : e13.constructor === Date ? JSON.stringify(e13).slice(1, 25) : (n13 = false, h7 && "string" == typeof e13 && h7.test(e13) && (e13 = "'" + e13, n13 = true), r13 = (i11 = e13.toString()).replace(u6, o16), (n13 = n13 || true === s7 || "function" == typeof s7 && s7(e13, t9) || Array.isArray(s7) && s7[t9] || ((e14, t10) => {
714
717
  for (var i12 = 0; i12 < t10.length; i12++) if (-1 < e14.indexOf(t10[i12])) return true;
715
718
  return false;
716
- })(i11, v3.BAD_DELIMITERS) || -1 < i11.indexOf(m5) || " " === i11.charAt(0) || " " === i11.charAt(i11.length - 1)) ? s7 + i11 + s7 : i11);
719
+ })(r13, v3.BAD_DELIMITERS) || -1 < r13.indexOf(m5) || -1 < i11.indexOf(a7) || " " === r13.charAt(0) || " " === r13.charAt(r13.length - 1)) ? a7 + r13 + a7 : r13);
717
720
  }
718
721
  }, v3.RECORD_SEP = String.fromCharCode(30), v3.UNIT_SEP = String.fromCharCode(31), v3.BYTE_ORDER_MARK = "\uFEFF", v3.BAD_DELIMITERS = ["\r", "\n", '"', v3.BYTE_ORDER_MARK], v3.WORKERS_SUPPORTED = !s6 && !!n11.Worker, v3.NODE_STREAM_INPUT = 1, v3.LocalChunkSize = 10485760, v3.RemoteChunkSize = 5242880, v3.DefaultDelimiter = ",", v3.Parser = E3, v3.ParserHandle = i9, v3.NetworkStreamer = f5, v3.FileStreamer = l7, v3.StringStreamer = c7, v3.ReadableStreamStreamer = p6, n11.jQuery && ((d4 = n11.jQuery).fn.parse = function(o16) {
719
722
  var i10 = o16.config || {}, h7 = [];
@@ -722,20 +725,20 @@ var require_papaparse_min = __commonJS({
722
725
  for (var t8 = 0; t8 < this.files.length; t8++) h7.push({ file: this.files[t8], inputElem: this, instanceConfig: d4.extend({}, i10) });
723
726
  }), e12(), this;
724
727
  function e12() {
725
- if (0 === h7.length) U(o16.complete) && o16.complete();
728
+ if (0 === h7.length) q(o16.complete) && o16.complete();
726
729
  else {
727
730
  var e13, t8, i11, r12, n12 = h7[0];
728
- if (U(o16.before)) {
731
+ if (q(o16.before)) {
729
732
  var s7 = o16.before(n12.file, n12.inputElem);
730
733
  if ("object" == typeof s7) {
731
- if ("abort" === s7.action) return e13 = "AbortError", t8 = n12.file, i11 = n12.inputElem, r12 = s7.reason, void (U(o16.error) && o16.error({ name: e13 }, t8, i11, r12));
734
+ if ("abort" === s7.action) return e13 = "AbortError", t8 = n12.file, i11 = n12.inputElem, r12 = s7.reason, void (q(o16.error) && o16.error({ name: e13 }, t8, i11, r12));
732
735
  if ("skip" === s7.action) return void u6();
733
736
  "object" == typeof s7.config && (n12.instanceConfig = d4.extend(n12.instanceConfig, s7.config));
734
737
  } else if ("skip" === s7) return void u6();
735
738
  }
736
739
  var a7 = n12.instanceConfig.complete;
737
740
  n12.instanceConfig.complete = function(e14) {
738
- U(a7) && a7(e14, n12.file, n12.inputElem), u6();
741
+ q(a7) && a7(e14, n12.file, n12.inputElem), u6();
739
742
  }, v3.parse(n12.file, n12.instanceConfig);
740
743
  }
741
744
  }
@@ -1725,11 +1728,11 @@ function rightPad(a6, size3) {
1725
1728
  return a6 + " ".repeat(size3 - a6.length);
1726
1729
  }
1727
1730
  function repeatedTry(checkFn, delayFn = (counter) => 0, maxCounter, scheduleFn) {
1728
- return new Promise((resolve, reject) => {
1731
+ return new Promise((resolve2, reject) => {
1729
1732
  let tryCount = 0;
1730
1733
  const tryFn = () => {
1731
1734
  if (checkFn()) {
1732
- resolve();
1735
+ resolve2();
1733
1736
  return;
1734
1737
  }
1735
1738
  tryCount++;
@@ -1790,18 +1793,18 @@ function squeezeShape(shape, axis) {
1790
1793
  const keptDims = [];
1791
1794
  const isEmptyArray = axis != null && Array.isArray(axis) && axis.length === 0;
1792
1795
  const axes = axis == null || isEmptyArray ? null : parseAxisParam(axis, shape).sort();
1793
- let j3 = 0;
1796
+ let j2 = 0;
1794
1797
  for (let i9 = 0; i9 < shape.length; ++i9) {
1795
1798
  if (axes != null) {
1796
- if (axes[j3] === i9 && shape[i9] !== 1) {
1799
+ if (axes[j2] === i9 && shape[i9] !== 1) {
1797
1800
  throw new Error(`Can't squeeze axis ${i9} since its dim '${shape[i9]}' is not 1`);
1798
1801
  }
1799
- if ((axes[j3] == null || axes[j3] > i9) && shape[i9] === 1) {
1802
+ if ((axes[j2] == null || axes[j2] > i9) && shape[i9] === 1) {
1800
1803
  newShape.push(shape[i9]);
1801
1804
  keptDims.push(i9);
1802
1805
  }
1803
- if (axes[j3] <= i9) {
1804
- j3++;
1806
+ if (axes[j2] <= i9) {
1807
+ j2++;
1805
1808
  }
1806
1809
  }
1807
1810
  if (shape[i9] !== 1) {
@@ -3767,7 +3770,7 @@ function getFilteredNodesXToY(tape, xs, y4) {
3767
3770
  for (const inputName in nodeInputs) {
3768
3771
  const input2 = nodeInputs[inputName];
3769
3772
  let anyInputFromX = false;
3770
- for (let j3 = 0; j3 < xs.length; j3++) {
3773
+ for (let j2 = 0; j2 < xs.length; j2++) {
3771
3774
  if (tensorsFromX[input2.id]) {
3772
3775
  node.outputs.forEach((output) => tensorsFromX[output.id] = true);
3773
3776
  anyInputFromX = true;
@@ -3786,8 +3789,8 @@ function getFilteredNodesXToY(tape, xs, y4) {
3786
3789
  for (let i9 = tape.length - 1; i9 >= 0; i9--) {
3787
3790
  const node = tape[i9];
3788
3791
  const nodeInputs = node.inputs;
3789
- for (let j3 = 0; j3 < node.outputs.length; j3++) {
3790
- if (tensorsLeadToY[node.outputs[j3].id]) {
3792
+ for (let j2 = 0; j2 < node.outputs.length; j2++) {
3793
+ if (tensorsLeadToY[node.outputs[j2].id]) {
3791
3794
  for (const inputName in nodeInputs) {
3792
3795
  tensorsLeadToY[nodeInputs[inputName].id] = true;
3793
3796
  nodesToY[node.id] = true;
@@ -3884,8 +3887,8 @@ function computeMaxSizePerColumn(vals, shape, dtype, strides) {
3884
3887
  if (rank > 1) {
3885
3888
  for (let row = 0; row < n11 / numCols; row++) {
3886
3889
  const offset3 = row * numCols;
3887
- for (let j3 = 0; j3 < numCols; j3++) {
3888
- padPerCol[j3] = Math.max(padPerCol[j3], valToString(valuesOrTuples[offset3 + j3], 0, dtype).length);
3890
+ for (let j2 = 0; j2 < numCols; j2++) {
3891
+ padPerCol[j2] = Math.max(padPerCol[j2], valToString(valuesOrTuples[offset3 + j2], 0, dtype).length);
3889
3892
  }
3890
3893
  }
3891
3894
  }
@@ -5886,7 +5889,7 @@ async function encodeWeights(tensors, group) {
5886
5889
  }
5887
5890
  const spec = { name, shape: t8.shape, dtype: t8.dtype };
5888
5891
  if (t8.dtype === "string") {
5889
- const utf8bytes = new Promise(async (resolve) => {
5892
+ const utf8bytes = new Promise(async (resolve2) => {
5890
5893
  const vals = await t8.bytes();
5891
5894
  const totalNumBytes = vals.reduce((p6, c7) => p6 + c7.length, 0) + NUM_BYTES_STRING_LENGTH * vals.length;
5892
5895
  const bytes = new Uint8Array(totalNumBytes);
@@ -5899,7 +5902,7 @@ async function encodeWeights(tensors, group) {
5899
5902
  bytes.set(val, offset3);
5900
5903
  offset3 += val.length;
5901
5904
  }
5902
- resolve(bytes);
5905
+ resolve2(bytes);
5903
5906
  });
5904
5907
  dataPromises.push(utf8bytes);
5905
5908
  } else {
@@ -6449,7 +6452,7 @@ var init_indexed_db = __esm({
6449
6452
  * of `ModelArtifacts`, if the action is get.
6450
6453
  */
6451
6454
  databaseAction(modelPath, modelArtifacts) {
6452
- return new Promise((resolve, reject) => {
6455
+ return new Promise((resolve2, reject) => {
6453
6456
  const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);
6454
6457
  openRequest.onupgradeneeded = () => setUpDatabase(openRequest);
6455
6458
  openRequest.onsuccess = () => {
@@ -6463,7 +6466,7 @@ var init_indexed_db = __esm({
6463
6466
  db.close();
6464
6467
  return reject(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));
6465
6468
  } else {
6466
- resolve(getRequest.result.modelArtifacts);
6469
+ resolve2(getRequest.result.modelArtifacts);
6467
6470
  }
6468
6471
  };
6469
6472
  getRequest.onerror = (error) => {
@@ -6496,7 +6499,7 @@ var init_indexed_db = __esm({
6496
6499
  } catch (error) {
6497
6500
  return reject(error);
6498
6501
  }
6499
- putModelRequest.onsuccess = () => resolve({ modelArtifactsInfo });
6502
+ putModelRequest.onsuccess = () => resolve2({ modelArtifactsInfo });
6500
6503
  putModelRequest.onerror = (error) => {
6501
6504
  infoStore = infoTx.objectStore(INFO_STORE_NAME);
6502
6505
  const deleteInfoRequest = infoStore.delete(this.modelPath);
@@ -6546,7 +6549,7 @@ var init_indexed_db = __esm({
6546
6549
  this.indexedDB = getIndexedDBFactory();
6547
6550
  }
6548
6551
  async listModels() {
6549
- return new Promise((resolve, reject) => {
6552
+ return new Promise((resolve2, reject) => {
6550
6553
  const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);
6551
6554
  openRequest.onupgradeneeded = () => setUpDatabase(openRequest);
6552
6555
  openRequest.onsuccess = () => {
@@ -6559,7 +6562,7 @@ var init_indexed_db = __esm({
6559
6562
  for (const item of getAllInfoRequest.result) {
6560
6563
  out[item.modelPath] = item.modelArtifactsInfo;
6561
6564
  }
6562
- resolve(out);
6565
+ resolve2(out);
6563
6566
  };
6564
6567
  getAllInfoRequest.onerror = (error) => {
6565
6568
  db.close();
@@ -6572,7 +6575,7 @@ var init_indexed_db = __esm({
6572
6575
  }
6573
6576
  async removeModel(path) {
6574
6577
  path = maybeStripScheme(path);
6575
- return new Promise((resolve, reject) => {
6578
+ return new Promise((resolve2, reject) => {
6576
6579
  const openRequest = this.indexedDB.open(DATABASE_NAME, DATABASE_VERSION);
6577
6580
  openRequest.onupgradeneeded = () => setUpDatabase(openRequest);
6578
6581
  openRequest.onsuccess = () => {
@@ -6591,7 +6594,7 @@ var init_indexed_db = __esm({
6591
6594
  modelTx = db.transaction(MODEL_STORE_NAME, "readwrite");
6592
6595
  const modelStore = modelTx.objectStore(MODEL_STORE_NAME);
6593
6596
  const deleteModelRequest = modelStore.delete(path);
6594
- deleteModelRequest.onsuccess = () => resolve(getInfoRequest.result.modelArtifactsInfo);
6597
+ deleteModelRequest.onsuccess = () => resolve2(getInfoRequest.result.modelArtifactsInfo);
6595
6598
  deleteModelRequest.onerror = (error) => reject(getInfoRequest.error);
6596
6599
  };
6597
6600
  deleteInfoRequest.onsuccess = deleteModelData;
@@ -7625,8 +7628,8 @@ function computeOutputShape2D(inShape, fieldSize, stride, zeroPad, roundingMode)
7625
7628
  }
7626
7629
  const inputRows = inShape[0];
7627
7630
  const inputCols = inShape[1];
7628
- const outputRows = round2((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);
7629
- const outputCols = round2((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);
7631
+ const outputRows = round3((inputRows - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);
7632
+ const outputCols = round3((inputCols - fieldSize + 2 * zeroPad) / stride + 1, roundingMode);
7630
7633
  return [outputRows, outputCols];
7631
7634
  }
7632
7635
  function computeOutputShape4D(inShape, filterShape, outChannels, strides, zeroPad, roundingMode) {
@@ -7636,7 +7639,7 @@ function computeOutputShape4D(inShape, filterShape, outChannels, strides, zeroPa
7636
7639
  const outShape = [0, 0, 0, outChannels];
7637
7640
  for (let index = 0; index < 3; index++) {
7638
7641
  if (inShape[index] + 2 * zeroPad >= filterShape[index]) {
7639
- outShape[index] = round2((inShape[index] - filterShape[index] + 2 * zeroPad) / strides[index] + 1, roundingMode);
7642
+ outShape[index] = round3((inShape[index] - filterShape[index] + 2 * zeroPad) / strides[index] + 1, roundingMode);
7640
7643
  }
7641
7644
  }
7642
7645
  return outShape;
@@ -7694,8 +7697,8 @@ function getPadAndOutInfo(pad3, inHeight, inWidth, strideHeight, strideWidth, fi
7694
7697
  const right = dataFormat === "channelsLast" ? pad3[2][1] : pad3[3][1];
7695
7698
  const padType = top === 0 && bottom === 0 && left === 0 && right === 0 ? "VALID" : "EXPLICIT";
7696
7699
  padInfo = { top, bottom, left, right, type: padType };
7697
- outHeight = round2((inHeight - filterHeight + top + bottom) / strideHeight + 1, roundingMode);
7698
- outWidth = round2((inWidth - filterWidth + left + right) / strideWidth + 1, roundingMode);
7700
+ outHeight = round3((inHeight - filterHeight + top + bottom) / strideHeight + 1, roundingMode);
7701
+ outWidth = round3((inWidth - filterWidth + left + right) / strideWidth + 1, roundingMode);
7699
7702
  } else {
7700
7703
  throw Error(`Unknown padding parameter: ${pad3}`);
7701
7704
  }
@@ -7743,7 +7746,7 @@ function get3DPadAndOutInfo(pad3, inDepth, inHeight, inWidth, strideDepth, strid
7743
7746
  }
7744
7747
  return { padInfo, outDepth, outHeight, outWidth };
7745
7748
  }
7746
- function round2(value, roundingMode) {
7749
+ function round3(value, roundingMode) {
7747
7750
  if (!roundingMode) {
7748
7751
  return Math.trunc(value);
7749
7752
  }
@@ -8015,10 +8018,10 @@ function basicLSTMCell_(forgetBias, lstmKernel, lstmBias, data, c7, h6) {
8015
8018
  const sliceCols = res.shape[1] / 4;
8016
8019
  const sliceSize = [batchSize, sliceCols];
8017
8020
  const i9 = slice(res, [0, 0], sliceSize);
8018
- const j3 = slice(res, [0, sliceCols], sliceSize);
8021
+ const j2 = slice(res, [0, sliceCols], sliceSize);
8019
8022
  const f5 = slice(res, [0, sliceCols * 2], sliceSize);
8020
8023
  const o15 = slice(res, [0, sliceCols * 3], sliceSize);
8021
- const newC = add2(mul(sigmoid(i9), tanh2(j3)), mul($c, sigmoid(add2($forgetBias, f5))));
8024
+ const newC = add2(mul(sigmoid(i9), tanh2(j2)), mul($c, sigmoid(add2($forgetBias, f5))));
8022
8025
  const newH = mul(tanh2(newC), sigmoid(o15));
8023
8026
  return [newC, newH];
8024
8027
  }
@@ -11325,22 +11328,22 @@ var require_xorshift7 = __commonJS({
11325
11328
  return v3;
11326
11329
  };
11327
11330
  function init(me2, seed2) {
11328
- var j3, w3, X = [];
11331
+ var j2, w3, X = [];
11329
11332
  if (seed2 === (seed2 | 0)) {
11330
11333
  w3 = X[0] = seed2;
11331
11334
  } else {
11332
11335
  seed2 = "" + seed2;
11333
- for (j3 = 0; j3 < seed2.length; ++j3) {
11334
- X[j3 & 7] = X[j3 & 7] << 15 ^ seed2.charCodeAt(j3) + X[j3 + 1 & 7] << 13;
11336
+ for (j2 = 0; j2 < seed2.length; ++j2) {
11337
+ X[j2 & 7] = X[j2 & 7] << 15 ^ seed2.charCodeAt(j2) + X[j2 + 1 & 7] << 13;
11335
11338
  }
11336
11339
  }
11337
11340
  while (X.length < 8) X.push(0);
11338
- for (j3 = 0; j3 < 8 && X[j3] === 0; ++j3) ;
11339
- if (j3 == 8) w3 = X[7] = -1;
11340
- else w3 = X[j3];
11341
+ for (j2 = 0; j2 < 8 && X[j2] === 0; ++j2) ;
11342
+ if (j2 == 8) w3 = X[7] = -1;
11343
+ else w3 = X[j2];
11341
11344
  me2.x = X;
11342
11345
  me2.i = 0;
11343
- for (j3 = 256; j3 > 0; --j3) {
11346
+ for (j2 = 256; j2 > 0; --j2) {
11344
11347
  me2.next();
11345
11348
  }
11346
11349
  }
@@ -11411,7 +11414,7 @@ var require_xor4096 = __commonJS({
11411
11414
  return v3 + (w3 ^ w3 >>> 16) | 0;
11412
11415
  };
11413
11416
  function init(me2, seed2) {
11414
- var t8, v3, i9, j3, w3, X = [], limit = 128;
11417
+ var t8, v3, i9, j2, w3, X = [], limit = 128;
11415
11418
  if (seed2 === (seed2 | 0)) {
11416
11419
  v3 = seed2;
11417
11420
  seed2 = null;
@@ -11420,16 +11423,16 @@ var require_xor4096 = __commonJS({
11420
11423
  v3 = 0;
11421
11424
  limit = Math.max(limit, seed2.length);
11422
11425
  }
11423
- for (i9 = 0, j3 = -32; j3 < limit; ++j3) {
11424
- if (seed2) v3 ^= seed2.charCodeAt((j3 + 32) % seed2.length);
11425
- if (j3 === 0) w3 = v3;
11426
+ for (i9 = 0, j2 = -32; j2 < limit; ++j2) {
11427
+ if (seed2) v3 ^= seed2.charCodeAt((j2 + 32) % seed2.length);
11428
+ if (j2 === 0) w3 = v3;
11426
11429
  v3 ^= v3 << 10;
11427
11430
  v3 ^= v3 >>> 15;
11428
11431
  v3 ^= v3 << 4;
11429
11432
  v3 ^= v3 >>> 13;
11430
- if (j3 >= 0) {
11433
+ if (j2 >= 0) {
11431
11434
  w3 = w3 + 1640531527 | 0;
11432
- t8 = X[j3 & 127] ^= v3 + w3;
11435
+ t8 = X[j2 & 127] ^= v3 + w3;
11433
11436
  i9 = 0 == t8 ? i9 + 1 : 0;
11434
11437
  }
11435
11438
  }
@@ -11437,7 +11440,7 @@ var require_xor4096 = __commonJS({
11437
11440
  X[(seed2 && seed2.length || 0) & 127] = -1;
11438
11441
  }
11439
11442
  i9 = 127;
11440
- for (j3 = 4 * 128; j3 > 0; --j3) {
11443
+ for (j2 = 4 * 128; j2 > 0; --j2) {
11441
11444
  v3 = X[i9 + 34 & 127];
11442
11445
  t8 = X[i9 = i9 + 1 & 127];
11443
11446
  v3 ^= v3 << 13;
@@ -11641,7 +11644,7 @@ var require_seedrandom = __commonJS({
11641
11644
  );
11642
11645
  }
11643
11646
  function ARC4(key) {
11644
- var t8, keylen = key.length, me = this, i9 = 0, j3 = me.i = me.j = 0, s6 = me.S = [];
11647
+ var t8, keylen = key.length, me = this, i9 = 0, j2 = me.i = me.j = 0, s6 = me.S = [];
11645
11648
  if (!keylen) {
11646
11649
  key = [keylen++];
11647
11650
  }
@@ -11649,17 +11652,17 @@ var require_seedrandom = __commonJS({
11649
11652
  s6[i9] = i9++;
11650
11653
  }
11651
11654
  for (i9 = 0; i9 < width; i9++) {
11652
- s6[i9] = s6[j3 = mask & j3 + key[i9 % keylen] + (t8 = s6[i9])];
11653
- s6[j3] = t8;
11655
+ s6[i9] = s6[j2 = mask & j2 + key[i9 % keylen] + (t8 = s6[i9])];
11656
+ s6[j2] = t8;
11654
11657
  }
11655
11658
  (me.g = function(count2) {
11656
- var t9, r11 = 0, i10 = me.i, j4 = me.j, s7 = me.S;
11659
+ var t9, r11 = 0, i10 = me.i, j3 = me.j, s7 = me.S;
11657
11660
  while (count2--) {
11658
11661
  t9 = s7[i10 = mask & i10 + 1];
11659
- r11 = r11 * width + s7[mask & (s7[i10] = s7[j4 = mask & j4 + t9]) + (s7[j4] = t9)];
11662
+ r11 = r11 * width + s7[mask & (s7[i10] = s7[j3 = mask & j3 + t9]) + (s7[j3] = t9)];
11660
11663
  }
11661
11664
  me.i = i10;
11662
- me.j = j4;
11665
+ me.j = j3;
11663
11666
  return r11;
11664
11667
  })(width);
11665
11668
  }
@@ -11683,9 +11686,9 @@ var require_seedrandom = __commonJS({
11683
11686
  return result.length ? result : typ == "string" ? obj : obj + "\0";
11684
11687
  }
11685
11688
  function mixkey(seed, key) {
11686
- var stringseed = seed + "", smear, j3 = 0;
11687
- while (j3 < stringseed.length) {
11688
- key[mask & j3] = mask & (smear ^= key[mask & j3] * 19) + stringseed.charCodeAt(j3++);
11689
+ var stringseed = seed + "", smear, j2 = 0;
11690
+ while (j2 < stringseed.length) {
11691
+ key[mask & j2] = mask & (smear ^= key[mask & j2] * 19) + stringseed.charCodeAt(j2++);
11689
11692
  }
11690
11693
  return tostring(key);
11691
11694
  }
@@ -11894,16 +11897,16 @@ function createVideoElement(source) {
11894
11897
  video.style.top = "0px";
11895
11898
  video.preload = "auto";
11896
11899
  video.appendChild(source);
11897
- return new Promise((resolve) => {
11898
- video.addEventListener("loadeddata", (_3) => resolve(video));
11900
+ return new Promise((resolve2) => {
11901
+ video.addEventListener("loadeddata", (_3) => resolve2(video));
11899
11902
  video.load();
11900
11903
  });
11901
11904
  }
11902
11905
  async function play(video) {
11903
11906
  await video.play();
11904
11907
  if ("requestVideoFrameCallback" in video) {
11905
- await new Promise((resolve) => {
11906
- video.requestVideoFrameCallback(resolve);
11908
+ await new Promise((resolve2) => {
11909
+ video.requestVideoFrameCallback(resolve2);
11907
11910
  });
11908
11911
  }
11909
11912
  }
@@ -12332,14 +12335,14 @@ function round_(x3) {
12332
12335
  const inputs = { x: $x };
12333
12336
  return ENGINE.runKernel(Round, inputs);
12334
12337
  }
12335
- var round3;
12338
+ var round4;
12336
12339
  var init_round = __esm({
12337
12340
  "node_modules/@tensorflow/tfjs-core/dist/ops/round.js"() {
12338
12341
  init_engine();
12339
12342
  init_kernel_names();
12340
12343
  init_tensor_util_env();
12341
12344
  init_operation();
12342
- round3 = /* @__PURE__ */ op({ round_ });
12345
+ round4 = /* @__PURE__ */ op({ round_ });
12343
12346
  }
12344
12347
  });
12345
12348
 
@@ -14509,8 +14512,8 @@ function nonMaxSuppressionImpl_(boxes, scores, maxOutputSize, iouThreshold, scor
14509
14512
  break;
14510
14513
  }
14511
14514
  let ignoreCandidate = false;
14512
- for (let j3 = selectedIndices.length - 1; j3 >= suppressBeginIndex; --j3) {
14513
- const iou = intersectionOverUnion(boxes, boxIndex, selectedIndices[j3]);
14515
+ for (let j2 = selectedIndices.length - 1; j2 >= suppressBeginIndex; --j2) {
14516
+ const iou = intersectionOverUnion(boxes, boxIndex, selectedIndices[j2]);
14514
14517
  if (iou >= iouThreshold) {
14515
14518
  ignoreCandidate = true;
14516
14519
  break;
@@ -14545,9 +14548,9 @@ function nonMaxSuppressionImpl_(boxes, scores, maxOutputSize, iouThreshold, scor
14545
14548
  }
14546
14549
  return result;
14547
14550
  }
14548
- function intersectionOverUnion(boxes, i9, j3) {
14551
+ function intersectionOverUnion(boxes, i9, j2) {
14549
14552
  const iCoord = boxes.subarray(i9 * 4, i9 * 4 + 4);
14550
- const jCoord = boxes.subarray(j3 * 4, j3 * 4 + 4);
14553
+ const jCoord = boxes.subarray(j2 * 4, j2 * 4 + 4);
14551
14554
  const yminI = Math.min(iCoord[0], iCoord[2]);
14552
14555
  const xminI = Math.min(iCoord[1], iCoord[3]);
14553
14556
  const ymaxI = Math.max(iCoord[0], iCoord[2]);
@@ -14844,7 +14847,7 @@ function threshold_(image2, method = "binary", inverted = false, threshValue = 0
14844
14847
  grayscale = image2;
14845
14848
  }
14846
14849
  if (method === "otsu") {
14847
- const $histogram = bincount(cast(round3(grayscale), "int32"), tensor([]), 256);
14850
+ const $histogram = bincount(cast(round4(grayscale), "int32"), tensor([]), 256);
14848
14851
  $threshold = otsu($histogram, totalPixelsInImage);
14849
14852
  }
14850
14853
  const invCondition = inverted ? lessEqual(grayscale, $threshold) : greater(grayscale, $threshold);
@@ -14952,8 +14955,8 @@ function bandPart_(a6, numLower, numUpper) {
14952
14955
  $numUpper = where(less(numUpper, 0), N3, minimum(numUpper, N3));
14953
14956
  }
14954
14957
  const i9 = reshape(range(0, M3, 1, "int32"), [-1, 1]);
14955
- const j3 = range(0, N3, 1, "int32");
14956
- const ij = sub(i9, j3);
14958
+ const j2 = range(0, N3, 1, "int32");
14959
+ const ij = sub(i9, j2);
14957
14960
  const inBand = logicalAnd(lessEqual(ij, $numLower), greaterEqual(ij, neg($numUpper)));
14958
14961
  const zero = zeros([M3, N3], $a.dtype);
14959
14962
  return reshape(stack(unstack(reshape($a, [-1, M3, N3])).map((mat) => where(inBand, mat, zero))), shape);
@@ -15002,8 +15005,8 @@ function gramSchmidt_(xs) {
15002
15005
  ys.push(ENGINE.tidy(() => {
15003
15006
  let x3 = xs1d[i9];
15004
15007
  if (i9 > 0) {
15005
- for (let j3 = 0; j3 < i9; ++j3) {
15006
- const proj = mul(sum2(mul(ys[j3], x3)), ys[j3]);
15008
+ for (let j2 = 0; j2 < i9; ++j2) {
15009
+ const proj = mul(sum2(mul(ys[j2], x3)), ys[j2]);
15007
15010
  x3 = sub(x3, proj);
15008
15011
  }
15009
15012
  }
@@ -15068,14 +15071,14 @@ function qr2d(x3, fullMatrices = false) {
15068
15071
  const one2D = tensor2d([[1]], [1, 1]);
15069
15072
  let w3 = clone(one2D);
15070
15073
  const iters = m4 >= n11 ? n11 : m4;
15071
- for (let j3 = 0; j3 < iters; ++j3) {
15074
+ for (let j2 = 0; j2 < iters; ++j2) {
15072
15075
  const rTemp = r11;
15073
15076
  const wTemp = w3;
15074
15077
  const qTemp = q;
15075
15078
  [w3, r11, q] = ENGINE.tidy(() => {
15076
- const rjEnd1 = slice(r11, [j3, j3], [m4 - j3, 1]);
15079
+ const rjEnd1 = slice(r11, [j2, j2], [m4 - j2, 1]);
15077
15080
  const normX = norm(rjEnd1);
15078
- const rjj = slice(r11, [j3, j3], [1, 1]);
15081
+ const rjj = slice(r11, [j2, j2], [1, 1]);
15079
15082
  const s6 = where(greater(rjj, 0), tensor2d([[-1]]), tensor2d([[1]]));
15080
15083
  const u1 = sub(rjj, mul(s6, normX));
15081
15084
  const wPre = div(rjEnd1, u1);
@@ -15088,22 +15091,22 @@ function qr2d(x3, fullMatrices = false) {
15088
15091
  ], 0);
15089
15092
  }
15090
15093
  const tau = neg(div(matMul(s6, u1), normX));
15091
- const rjEndAll = slice(r11, [j3, 0], [m4 - j3, n11]);
15094
+ const rjEndAll = slice(r11, [j2, 0], [m4 - j2, n11]);
15092
15095
  const tauTimesW = mul(tau, w3);
15093
15096
  const wT = transpose(w3);
15094
- if (j3 === 0) {
15097
+ if (j2 === 0) {
15095
15098
  r11 = sub(rjEndAll, matMul(tauTimesW, matMul(wT, rjEndAll)));
15096
15099
  } else {
15097
15100
  const rTimesTau = sub(rjEndAll, matMul(tauTimesW, matMul(wT, rjEndAll)));
15098
- r11 = concat2([slice(r11, [0, 0], [j3, n11]), rTimesTau], 0);
15101
+ r11 = concat2([slice(r11, [0, 0], [j2, n11]), rTimesTau], 0);
15099
15102
  }
15100
15103
  const tawTimesWT = transpose(tauTimesW);
15101
- const qAllJEnd = slice(q, [0, j3], [m4, q.shape[1] - j3]);
15102
- if (j3 === 0) {
15104
+ const qAllJEnd = slice(q, [0, j2], [m4, q.shape[1] - j2]);
15105
+ if (j2 === 0) {
15103
15106
  q = sub(qAllJEnd, matMul(matMul(qAllJEnd, w3), tawTimesWT));
15104
15107
  } else {
15105
15108
  const qTimesTau = sub(qAllJEnd, matMul(matMul(qAllJEnd, w3), tawTimesWT));
15106
- q = concat2([slice(q, [0, 0], [m4, j3]), qTimesTau], 1);
15109
+ q = concat2([slice(q, [0, 0], [m4, j2]), qTimesTau], 1);
15107
15110
  }
15108
15111
  return [w3, r11, q];
15109
15112
  });
@@ -17012,7 +17015,7 @@ var init_register_optimizers = __esm({
17012
17015
 
17013
17016
  // node_modules/@tensorflow/tfjs-core/dist/io/browser_files.js
17014
17017
  function defer(f5) {
17015
- return new Promise((resolve) => setTimeout(resolve)).then(f5);
17018
+ return new Promise((resolve2) => setTimeout(resolve2)).then(f5);
17016
17019
  }
17017
17020
  function browserDownloads(fileNamePrefix = "model") {
17018
17021
  return new BrowserDownloads(fileNamePrefix);
@@ -17084,7 +17087,7 @@ var init_browser_files = __esm({
17084
17087
  this.weightsFiles = files.slice(1);
17085
17088
  }
17086
17089
  async load() {
17087
- return new Promise((resolve, reject) => {
17090
+ return new Promise((resolve2, reject) => {
17088
17091
  const jsonReader = new FileReader();
17089
17092
  jsonReader.onload = (event) => {
17090
17093
  const modelJSON = JSON.parse(event.target.result);
@@ -17099,11 +17102,11 @@ var init_browser_files = __esm({
17099
17102
  return;
17100
17103
  }
17101
17104
  if (this.weightsFiles.length === 0) {
17102
- resolve({ modelTopology });
17105
+ resolve2({ modelTopology });
17103
17106
  return;
17104
17107
  }
17105
17108
  const modelArtifactsPromise = getModelArtifactsForJSON(modelJSON, (weightsManifest2) => this.loadWeights(weightsManifest2));
17106
- resolve(modelArtifactsPromise);
17109
+ resolve2(modelArtifactsPromise);
17107
17110
  };
17108
17111
  jsonReader.onerror = (error) => reject(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`);
17109
17112
  jsonReader.readAsText(this.jsonFile);
@@ -17121,11 +17124,11 @@ var init_browser_files = __esm({
17121
17124
  return Promise.all(promises).then((buffers) => [weightSpecs, buffers]);
17122
17125
  }
17123
17126
  loadWeightsFile(path, file) {
17124
- return new Promise((resolve, reject) => {
17127
+ return new Promise((resolve2, reject) => {
17125
17128
  const weightFileReader = new FileReader();
17126
17129
  weightFileReader.onload = (event) => {
17127
17130
  const weightData = event.target.result;
17128
- resolve(weightData);
17131
+ resolve2(weightData);
17129
17132
  };
17130
17133
  weightFileReader.onerror = (error) => reject(`Failed to weights data from file of path '${path}'.`);
17131
17134
  weightFileReader.readAsArrayBuffer(file);
@@ -17826,11 +17829,11 @@ async function toPixels(img, canvas) {
17826
17829
  rgba[d4] = value * multiplier;
17827
17830
  }
17828
17831
  }
17829
- const j3 = i9 * 4;
17830
- bytes[j3 + 0] = Math.round(rgba[0]);
17831
- bytes[j3 + 1] = Math.round(rgba[1]);
17832
- bytes[j3 + 2] = Math.round(rgba[2]);
17833
- bytes[j3 + 3] = Math.round(rgba[3]);
17832
+ const j2 = i9 * 4;
17833
+ bytes[j2 + 0] = Math.round(rgba[0]);
17834
+ bytes[j2 + 1] = Math.round(rgba[1]);
17835
+ bytes[j2 + 2] = Math.round(rgba[2]);
17836
+ bytes[j2 + 3] = Math.round(rgba[3]);
17834
17837
  }
17835
17838
  if (canvas != null) {
17836
17839
  if (!hasToPixelsWarned) {
@@ -18566,7 +18569,7 @@ var init_train = __esm({
18566
18569
 
18567
18570
  // node_modules/@tensorflow/tfjs-core/dist/browser_util.js
18568
18571
  function nextFrame() {
18569
- return new Promise((resolve) => delayCallback(() => resolve()));
18572
+ return new Promise((resolve2) => delayCallback(() => resolve2()));
18570
18573
  }
18571
18574
  var delayCallback;
18572
18575
  var init_browser_util = __esm({
@@ -18953,8 +18956,8 @@ function decodeEinsumEquation(equation, numTensors) {
18953
18956
  throw new Error(`Found duplicate axes in input component ${inputTerms[i9]}. Support for duplicate axes in input is not implemented yet.`);
18954
18957
  }
18955
18958
  idDims[i9] = [];
18956
- for (let j3 = 0; j3 < inputTerms[i9].length; ++j3) {
18957
- idDims[i9].push(allDims.indexOf(inputTerms[i9][j3]));
18959
+ for (let j2 = 0; j2 < inputTerms[i9].length; ++j2) {
18960
+ idDims[i9].push(allDims.indexOf(inputTerms[i9][j2]));
18958
18961
  }
18959
18962
  }
18960
18963
  const numDims = allDims.length;
@@ -18984,11 +18987,11 @@ function checkEinsumDimSizes(nDims, idDims, tensors) {
18984
18987
  const dimSizes = new Array(nDims);
18985
18988
  for (let i9 = 0; i9 < tensors.length; ++i9) {
18986
18989
  const shape = tensors[i9].shape;
18987
- for (let j3 = 0; j3 < idDims[i9].length; ++j3) {
18988
- if (dimSizes[idDims[i9][j3]] === void 0) {
18989
- dimSizes[idDims[i9][j3]] = shape[j3];
18990
+ for (let j2 = 0; j2 < idDims[i9].length; ++j2) {
18991
+ if (dimSizes[idDims[i9][j2]] === void 0) {
18992
+ dimSizes[idDims[i9][j2]] = shape[j2];
18990
18993
  } else {
18991
- assert(dimSizes[idDims[i9][j3]] === shape[j3], () => `Expected dimension ${dimSizes[idDims[i9][j3]]} at axis ${j3} of input shaped ${JSON.stringify(shape)}, but got dimension ${shape[j3]}`);
18994
+ assert(dimSizes[idDims[i9][j2]] === shape[j2], () => `Expected dimension ${dimSizes[idDims[i9][j2]]} at axis ${j2} of input shaped ${JSON.stringify(shape)}, but got dimension ${shape[j2]}`);
18992
18995
  }
18993
18996
  }
18994
18997
  }
@@ -20475,8 +20478,8 @@ function arrayRange(start, stop) {
20475
20478
  function arrayConcat(arrays) {
20476
20479
  const result = [];
20477
20480
  for (let i9 = 0; i9 < arrays.length; ++i9) {
20478
- for (let j3 = 0; j3 < arrays[i9].length; ++j3) {
20479
- result.push(arrays[i9][j3]);
20481
+ for (let j2 = 0; j2 < arrays[i9].length; ++j2) {
20482
+ result.push(arrays[i9][j2]);
20480
20483
  }
20481
20484
  }
20482
20485
  return result;
@@ -21991,8 +21994,8 @@ var init_Tile_grad = __esm({
21991
21994
  }
21992
21995
  } else if (x3.rank === 2) {
21993
21996
  for (let i9 = 0; i9 < reps[0]; ++i9) {
21994
- for (let j3 = 0; j3 < reps[1]; ++j3) {
21995
- xGrad = add2(xGrad, slice(dy, [i9 * x3.shape[0], j3 * x3.shape[1]], [
21997
+ for (let j2 = 0; j2 < reps[1]; ++j2) {
21998
+ xGrad = add2(xGrad, slice(dy, [i9 * x3.shape[0], j2 * x3.shape[1]], [
21996
21999
  x3.shape[0],
21997
22000
  x3.shape[1]
21998
22001
  ]));
@@ -22000,20 +22003,20 @@ var init_Tile_grad = __esm({
22000
22003
  }
22001
22004
  } else if (x3.rank === 3) {
22002
22005
  for (let i9 = 0; i9 < reps[0]; ++i9) {
22003
- for (let j3 = 0; j3 < reps[1]; ++j3) {
22006
+ for (let j2 = 0; j2 < reps[1]; ++j2) {
22004
22007
  for (let k3 = 0; k3 < reps[2]; ++k3) {
22005
- xGrad = add2(xGrad, slice(dy, [i9 * x3.shape[0], j3 * x3.shape[1], k3 * x3.shape[2]], [x3.shape[0], x3.shape[1], x3.shape[2]]));
22008
+ xGrad = add2(xGrad, slice(dy, [i9 * x3.shape[0], j2 * x3.shape[1], k3 * x3.shape[2]], [x3.shape[0], x3.shape[1], x3.shape[2]]));
22006
22009
  }
22007
22010
  }
22008
22011
  }
22009
22012
  } else if (x3.rank === 4) {
22010
22013
  for (let i9 = 0; i9 < reps[0]; ++i9) {
22011
- for (let j3 = 0; j3 < reps[1]; ++j3) {
22014
+ for (let j2 = 0; j2 < reps[1]; ++j2) {
22012
22015
  for (let k3 = 0; k3 < reps[2]; ++k3) {
22013
22016
  for (let l7 = 0; l7 < reps[3]; ++l7) {
22014
22017
  xGrad = add2(xGrad, slice(dy, [
22015
22018
  i9 * x3.shape[0],
22016
- j3 * x3.shape[1],
22019
+ j2 * x3.shape[1],
22017
22020
  k3 * x3.shape[2],
22018
22021
  l7 * x3.shape[3]
22019
22022
  ], [x3.shape[0], x3.shape[1], x3.shape[2], x3.shape[3]]));
@@ -23578,7 +23581,7 @@ var init_round2 = __esm({
23578
23581
  init_tensor();
23579
23582
  getGlobalTensorClass().prototype.round = function() {
23580
23583
  this.throwIfDisposed();
23581
- return round3(this);
23584
+ return round4(this);
23582
23585
  };
23583
23586
  }
23584
23587
  });
@@ -28863,10 +28866,10 @@ var init_container = __esm({
28863
28866
  continue;
28864
28867
  }
28865
28868
  const inputShapes2 = [];
28866
- for (let j3 = 0; j3 < node.inboundLayers.length; j3++) {
28867
- const inboundLayer = node.inboundLayers[j3];
28868
- const nodeIndex2 = node.nodeIndices[j3];
28869
- const tensorIndex = node.tensorIndices[j3];
28869
+ for (let j2 = 0; j2 < node.inboundLayers.length; j2++) {
28870
+ const inboundLayer = node.inboundLayers[j2];
28871
+ const nodeIndex2 = node.nodeIndices[j2];
28872
+ const tensorIndex = node.tensorIndices[j2];
28870
28873
  const shapeKey = `${inboundLayer.name}_${nodeIndex2}_${tensorIndex}`;
28871
28874
  const inputShape2 = layersToOutputShapes[shapeKey];
28872
28875
  inputShapes2.push(inputShape2);
@@ -28874,9 +28877,9 @@ var init_container = __esm({
28874
28877
  const outputShape = layer.computeOutputShape(singletonOrArray(inputShapes2));
28875
28878
  const outputShapes2 = normalizeShapeList(outputShape);
28876
28879
  const nodeIndex = layer.inboundNodes.indexOf(node);
28877
- for (let j3 = 0; j3 < outputShapes2.length; j3++) {
28878
- const shapeKey = `${layer.name}_${nodeIndex}_${j3}`;
28879
- layersToOutputShapes[shapeKey] = outputShapes2[j3];
28880
+ for (let j2 = 0; j2 < outputShapes2.length; j2++) {
28881
+ const shapeKey = `${layer.name}_${nodeIndex}_${j2}`;
28882
+ layersToOutputShapes[shapeKey] = outputShapes2[j2];
28880
28883
  }
28881
28884
  }
28882
28885
  }
@@ -29778,12 +29781,12 @@ function standardizeInputData(data, names2, shapes, checkBatchAxis = true, excep
29778
29781
  if (array2.shape.length !== shapes[i9].length) {
29779
29782
  throw new ValueError(`Error when checking ${exceptionPrefix}: expected ${names2[i9]} to have ${shapes[i9].length} dimension(s). but got array with shape ${array2.shape}`);
29780
29783
  }
29781
- for (let j3 = 0; j3 < shapes[i9].length; ++j3) {
29782
- if (j3 === 0 && !checkBatchAxis) {
29784
+ for (let j2 = 0; j2 < shapes[i9].length; ++j2) {
29785
+ if (j2 === 0 && !checkBatchAxis) {
29783
29786
  continue;
29784
29787
  }
29785
- const dim = array2.shape[j3];
29786
- const refDim = shapes[i9][j3];
29788
+ const dim = array2.shape[j2];
29789
+ const refDim = shapes[i9][j2];
29787
29790
  if (refDim != null && refDim >= 0 && dim !== refDim) {
29788
29791
  throw new ValueError(`${exceptionPrefix} expected a batch of elements where each example has shape [${shapes[i9].slice(1, shapes[i9].length)}] (i.e.,tensor shape [*,${shapes[i9].slice(1, shapes[i9].length)}]) but the ${exceptionPrefix} received an input with ${array2.shape[0]} examples, each with shape [${array2.shape.slice(1, array2.shape.length)}] (tensor shape [${array2.shape}])`);
29789
29792
  }
@@ -29828,9 +29831,9 @@ function checkLossAndTargetCompatibility(targets, lossFns, outputShapes) {
29828
29831
  if (keyLosses.indexOf(loss) !== -1) {
29829
29832
  const slicedYShape = y4.shape.slice(1);
29830
29833
  const slicedShape = shape.slice(1);
29831
- for (let j3 = 0; j3 < slicedYShape.length; ++j3) {
29832
- const targetDim = slicedYShape[j3];
29833
- const outDim = slicedShape[j3];
29834
+ for (let j2 = 0; j2 < slicedYShape.length; ++j2) {
29835
+ const targetDim = slicedYShape[j2];
29836
+ const outDim = slicedShape[j2];
29834
29837
  if (outDim != null && targetDim !== outDim) {
29835
29838
  throw new ValueError(`A target Tensor with shape ${y4.shape} was passed for an output of shape ${shape}, while using a loss function that expects targets to have the same shape as the output.`);
29836
29839
  }
@@ -29860,12 +29863,12 @@ function checkInputData(data, names2, shapes, checkBatchAxis = true, exceptionPr
29860
29863
  if (array2.shape.length !== shapes[i9].length) {
29861
29864
  throw new ValueError(`Error when checking ${exceptionPrefix}: expected ${names2[i9]} to have ${shapes[i9].length} dimension(s), but got array with shape ${JSON.stringify(array2.shape)}`);
29862
29865
  }
29863
- for (let j3 = 0; j3 < shapes[i9].length; ++j3) {
29864
- if (j3 === 0 && !checkBatchAxis) {
29866
+ for (let j2 = 0; j2 < shapes[i9].length; ++j2) {
29867
+ if (j2 === 0 && !checkBatchAxis) {
29865
29868
  continue;
29866
29869
  }
29867
- const dim = array2.shape[j3];
29868
- const refDim = shapes[i9][j3];
29870
+ const dim = array2.shape[j2];
29871
+ const refDim = shapes[i9][j2];
29869
29872
  if (refDim != null) {
29870
29873
  if (refDim !== dim) {
29871
29874
  throw new ValueError(`Error when checking ${exceptionPrefix}: expected ${names2[i9]} to have shape ${JSON.stringify(shapes[i9])} but got array with shape ${JSON.stringify(array2.shape)}.`);
@@ -35448,15 +35451,15 @@ var init_merge = __esm({
35448
35451
  const outputShape = shape1.slice(0, shape1.length - shape2.length);
35449
35452
  for (let k3 = 0; k3 < shape2.length; ++k3) {
35450
35453
  const i9 = shape1[shape1.length - shape2.length + k3];
35451
- const j3 = shape2[k3];
35452
- if (i9 == null || j3 == null || i9 < 0 || j3 < 0) {
35454
+ const j2 = shape2[k3];
35455
+ if (i9 == null || j2 == null || i9 < 0 || j2 < 0) {
35453
35456
  outputShape.push(null);
35454
35457
  } else if (i9 === 1) {
35455
- outputShape.push(j3);
35456
- } else if (j3 === 1) {
35458
+ outputShape.push(j2);
35459
+ } else if (j2 === 1) {
35457
35460
  outputShape.push(i9);
35458
35461
  } else {
35459
- if (i9 !== j3) {
35462
+ if (i9 !== j2) {
35460
35463
  throw new ValueError("Operands could not be broadcast together with shapes " + JSON.stringify(shape1) + " " + JSON.stringify(shape2));
35461
35464
  }
35462
35465
  outputShape.push(i9);
@@ -45503,7 +45506,7 @@ __export(ops_for_converter_exports, {
45503
45506
  reverse3d: () => reverse3d,
45504
45507
  reverse4d: () => reverse4d,
45505
45508
  rfft: () => rfft,
45506
- round: () => round3,
45509
+ round: () => round4,
45507
45510
  rsqrt: () => rsqrt,
45508
45511
  scalar: () => scalar,
45509
45512
  scatterND: () => scatterND,
@@ -51221,12 +51224,12 @@ var init_microphone_iterator = __esm({
51221
51224
  const freqDataQueue = [];
51222
51225
  const timeDataQueue = [];
51223
51226
  let currentFrames = 0;
51224
- return new Promise((resolve) => {
51227
+ return new Promise((resolve2) => {
51225
51228
  const intervalID = setInterval(() => {
51226
51229
  if (this.includeSpectrogram) {
51227
51230
  this.analyser.getFloatFrequencyData(this.freqData);
51228
51231
  if (this.freqData[0] === -Infinity) {
51229
- resolve({ freqDataQueue, timeDataQueue });
51232
+ resolve2({ freqDataQueue, timeDataQueue });
51230
51233
  }
51231
51234
  freqDataQueue.push(this.freqData.slice(0, this.columnTruncateLength));
51232
51235
  }
@@ -51236,7 +51239,7 @@ var init_microphone_iterator = __esm({
51236
51239
  }
51237
51240
  if (++currentFrames === this.numFrames) {
51238
51241
  clearInterval(intervalID);
51239
- resolve({ freqDataQueue, timeDataQueue });
51242
+ resolve2({ freqDataQueue, timeDataQueue });
51240
51243
  }
51241
51244
  }, this.fftSize / this.sampleRateHz * 1e3);
51242
51245
  });
@@ -51354,9 +51357,9 @@ var init_webcam_iterator = __esm({
51354
51357
  }
51355
51358
  this.webcamVideoElement.play();
51356
51359
  this.isClosed = false;
51357
- return new Promise((resolve) => {
51360
+ return new Promise((resolve2) => {
51358
51361
  this.webcamVideoElement.onloadedmetadata = () => {
51359
- resolve();
51362
+ resolve2();
51360
51363
  };
51361
51364
  });
51362
51365
  }
@@ -51596,10 +51599,10 @@ var init_file_chunk_iterator = __esm({
51596
51599
  if (this.offset >= (this.file instanceof Uint8Array ? this.file.byteLength : this.file.size)) {
51597
51600
  return { value: null, done: true };
51598
51601
  }
51599
- const chunk = new Promise((resolve, reject) => {
51602
+ const chunk = new Promise((resolve2, reject) => {
51600
51603
  const end = this.offset + this.chunkSize;
51601
51604
  if (this.file instanceof Uint8Array) {
51602
- resolve(new Uint8Array(this.file.slice(this.offset, end)));
51605
+ resolve2(new Uint8Array(this.file.slice(this.offset, end)));
51603
51606
  } else {
51604
51607
  const fileReader = new FileReader();
51605
51608
  fileReader.onload = (event) => {
@@ -51610,7 +51613,7 @@ var init_file_chunk_iterator = __esm({
51610
51613
  if (!(data instanceof Uint8Array)) {
51611
51614
  return reject(new TypeError("FileReader returned unknown type."));
51612
51615
  }
51613
- resolve(data);
51616
+ resolve2(data);
51614
51617
  };
51615
51618
  fileReader.onabort = (event) => {
51616
51619
  return reject(new Error("Aborted"));
@@ -52353,8 +52356,8 @@ function bincountReduceImpl(xBuf, weightsBuf, size3, binaryOutput = false) {
52353
52356
  const numCols = xBuf.shape[1];
52354
52357
  const outBuf = buffer([numRows, size3], weightsBuf.dtype);
52355
52358
  for (let i9 = 0; i9 < numRows; i9++) {
52356
- for (let j3 = 0; j3 < numCols; j3++) {
52357
- const value = xBuf.get(i9, j3);
52359
+ for (let j2 = 0; j2 < numCols; j2++) {
52360
+ const value = xBuf.get(i9, j2);
52358
52361
  if (value < 0) {
52359
52362
  throw new Error("Input x must be non-negative!");
52360
52363
  }
@@ -52365,7 +52368,7 @@ function bincountReduceImpl(xBuf, weightsBuf, size3, binaryOutput = false) {
52365
52368
  outBuf.set(1, i9, value);
52366
52369
  } else {
52367
52370
  if (weightsBuf.size > 0) {
52368
- outBuf.set(outBuf.get(i9, value) + weightsBuf.get(i9, j3), i9, value);
52371
+ outBuf.set(outBuf.get(i9, value) + weightsBuf.get(i9, j2), i9, value);
52369
52372
  } else {
52370
52373
  outBuf.set(outBuf.get(i9, value) + 1, i9, value);
52371
52374
  }
@@ -52586,9 +52589,9 @@ function gatherNdImpl(indicesData, paramsBuf, dtype, numSlices, sliceRank, slice
52586
52589
  for (let i9 = 0; i9 < numSlices; i9++) {
52587
52590
  const index = [];
52588
52591
  let flattenIndex = 0;
52589
- for (let j3 = 0; j3 < sliceRank; j3++) {
52590
- const dim = indicesData[i9 * sliceRank + j3];
52591
- flattenIndex += dim * strides[j3];
52592
+ for (let j2 = 0; j2 < sliceRank; j2++) {
52593
+ const dim = indicesData[i9 * sliceRank + j2];
52594
+ flattenIndex += dim * strides[j2];
52592
52595
  index.push(dim);
52593
52596
  }
52594
52597
  if (flattenIndex < 0 || flattenIndex >= paramsSize / sliceSize) {
@@ -52736,8 +52739,8 @@ function maxImpl(aVals, reduceSize, outShape, dtype) {
52736
52739
  for (let i9 = 0; i9 < vals.length; ++i9) {
52737
52740
  const offset3 = i9 * reduceSize;
52738
52741
  let max6 = aVals[offset3];
52739
- for (let j3 = 0; j3 < reduceSize; ++j3) {
52740
- const value = aVals[offset3 + j3];
52742
+ for (let j2 = 0; j2 < reduceSize; ++j2) {
52743
+ const value = aVals[offset3 + j2];
52741
52744
  if (Number.isNaN(value) || value > max6) {
52742
52745
  max6 = value;
52743
52746
  }
@@ -52916,8 +52919,8 @@ function prodImpl(xShape, xDtype, xVals, reductionAxes) {
52916
52919
  for (let i9 = 0; i9 < outVals.length; ++i9) {
52917
52920
  const offset3 = i9 * reduceSize;
52918
52921
  let prod4 = 1;
52919
- for (let j3 = 0; j3 < reduceSize; ++j3) {
52920
- prod4 *= xVals[offset3 + j3];
52922
+ for (let j2 = 0; j2 < reduceSize; ++j2) {
52923
+ prod4 *= xVals[offset3 + j2];
52921
52924
  }
52922
52925
  outVals[i9] = prod4;
52923
52926
  }
@@ -53014,8 +53017,8 @@ function makeSplits(indices, indicesShape, paramsNestedSplits, numParamsDenseVal
53014
53017
  if (outDim >= 0) {
53015
53018
  const outSplitsOutDim = outSplits[outDim];
53016
53019
  const delta = outSplitsOutDim[outSplitsOutDim.length - 1] - splits[start];
53017
- for (let j3 = start; j3 < limit; ++j3) {
53018
- outSplits[outDim].push(splits[j3 + 1] + delta);
53020
+ for (let j2 = start; j2 < limit; ++j2) {
53021
+ outSplits[outDim].push(splits[j2 + 1] + delta);
53019
53022
  }
53020
53023
  }
53021
53024
  start = splits[start];
@@ -53034,7 +53037,7 @@ function getSplits(outSplits) {
53034
53037
  const numSplits = outSplits[i9].length;
53035
53038
  const splits = util_exports.getArrayFromDType("int32", numSplits);
53036
53039
  splitsOut.push(splits);
53037
- outSplits[i9].forEach((value, j3) => splits[j3] = value);
53040
+ outSplits[i9].forEach((value, j2) => splits[j2] = value);
53038
53041
  }
53039
53042
  return splitsOut;
53040
53043
  }
@@ -53054,8 +53057,8 @@ function writeValueSlices(paramsDenseValues, paramsDenseValuesShape, valueSlices
53054
53057
  let outPos = 0;
53055
53058
  for (const slice4 of valueSlices) {
53056
53059
  for (let i9 = slice4[0]; i9 < slice4[1]; ++i9) {
53057
- for (let j3 = 0; j3 < valueSize; ++j3) {
53058
- values[outPos * valuesM + j3] = paramsDenseValues[i9 * denseM + j3];
53060
+ for (let j2 = 0; j2 < valueSize; ++j2) {
53061
+ values[outPos * valuesM + j2] = paramsDenseValues[i9 * denseM + j2];
53059
53062
  }
53060
53063
  ++outPos;
53061
53064
  }
@@ -53327,11 +53330,11 @@ var init_RaggedTensorToTensor_impl = __esm({
53327
53330
  if (parentOutputIndexCurrent === -1) {
53328
53331
  realLength = 0;
53329
53332
  }
53330
- for (let j3 = 0; j3 < realLength; ++j3) {
53333
+ for (let j2 = 0; j2 < realLength; ++j2) {
53331
53334
  result.push(parentOutputIndexCurrent);
53332
53335
  parentOutputIndexCurrent += outputIndexMultiplier;
53333
53336
  }
53334
- for (let j3 = 0; j3 < rowLength - realLength; ++j3) {
53337
+ for (let j2 = 0; j2 < rowLength - realLength; ++j2) {
53335
53338
  result.push(-1);
53336
53339
  }
53337
53340
  }
@@ -53582,10 +53585,10 @@ function scatterImpl(indices, updates, shape, outputSize, sliceSize, numUpdates,
53582
53585
  for (let i9 = 0; i9 < numUpdates; i9++) {
53583
53586
  const index = [];
53584
53587
  let flattenIndex = 0;
53585
- for (let j3 = 0; j3 < sliceRank; j3++) {
53586
- const dim = indicesData[i9 * sliceRank + j3];
53588
+ for (let j2 = 0; j2 < sliceRank; j2++) {
53589
+ const dim = indicesData[i9 * sliceRank + j2];
53587
53590
  index.push(dim);
53588
- flattenIndex += dim * strides[j3];
53591
+ flattenIndex += dim * strides[j2];
53589
53592
  }
53590
53593
  if (flattenIndex < 0 || flattenIndex >= outputSize / sliceSize) {
53591
53594
  throw new Error(`Invalid indices: ${index} does not index into ${shape}`);
@@ -53640,7 +53643,7 @@ function sliceImpl(vals, begin, size3, shape, dtype) {
53640
53643
  const outBuf = buffer(size3, dtype);
53641
53644
  for (let i9 = 0; i9 < outBuf.size; ++i9) {
53642
53645
  const outLoc = outBuf.indexToLoc(i9);
53643
- const inLoc = outLoc.map((idx, j3) => idx + begin[j3]);
53646
+ const inLoc = outLoc.map((idx, j2) => idx + begin[j2]);
53644
53647
  outBuf.set(inBuf.get(...inLoc), ...outLoc);
53645
53648
  }
53646
53649
  if (dtype === "string") {
@@ -53741,8 +53744,8 @@ function sparseFillEmptyRowsImpl(indices, indicesShape, indicesDType, values, va
53741
53744
  const offset3 = filledCount[row];
53742
53745
  const outputI = (row === 0 ? 0 : csrOffset[row - 1]) + offset3;
53743
53746
  filledCount[row]++;
53744
- for (let j3 = 0; j3 < rank; ++j3) {
53745
- outputIndices[outputI * rank + j3] = indices[i9 * rank + j3];
53747
+ for (let j2 = 0; j2 < rank; ++j2) {
53748
+ outputIndices[outputI * rank + j2] = indices[i9 * rank + j2];
53746
53749
  }
53747
53750
  outputValues[outputI] = values[i9];
53748
53751
  reverseIndexMap[i9] = outputI;
@@ -53829,12 +53832,12 @@ function sparseReshapeImpl(inputIndices, inputIndicesShape, inputDType, inputSha
53829
53832
  const newIndices = util_exports.getArrayFromDType(inputDType, nnz * outputRank);
53830
53833
  for (let i9 = 0; i9 < nnz; ++i9) {
53831
53834
  let id3 = 0;
53832
- for (let j3 = 0; j3 < inputRank; ++j3) {
53833
- id3 += inputIndices[i9 * inputRank + j3] * inputStrides[j3];
53835
+ for (let j2 = 0; j2 < inputRank; ++j2) {
53836
+ id3 += inputIndices[i9 * inputRank + j2] * inputStrides[j2];
53834
53837
  }
53835
- for (let j3 = 0; j3 < outputRank; ++j3) {
53836
- newIndices[i9 * outputRank + j3] = Math.trunc(id3 / outputStrides[j3]);
53837
- id3 %= outputStrides[j3];
53838
+ for (let j2 = 0; j2 < outputRank; ++j2) {
53839
+ newIndices[i9 * outputRank + j2] = Math.trunc(id3 / outputStrides[j2]);
53840
+ id3 %= outputStrides[j2];
53838
53841
  }
53839
53842
  }
53840
53843
  return [newIndices, [nnz, outputRank], outputShape];
@@ -53894,13 +53897,13 @@ function sparseSegmentReductionImpl(input2, inputShape, inputDType, indices, seg
53894
53897
  if (index < 0 || index >= inputFlat[0]) {
53895
53898
  throw new Error(backend_util_exports.getSparseSegmentReductionIndicesOutOfRangeErrorMessage(i9, indices[i9], inputFlat[0]));
53896
53899
  }
53897
- for (let j3 = 0; j3 < numCol; j3++) {
53898
- output[outIndex * numCol + j3] += input2[index * numCol + j3];
53900
+ for (let j2 = 0; j2 < numCol; j2++) {
53901
+ output[outIndex * numCol + j2] += input2[index * numCol + j2];
53899
53902
  }
53900
53903
  }
53901
53904
  if (isMean) {
53902
- for (let j3 = 0; j3 < numCol; j3++) {
53903
- output[outIndex * numCol + j3] /= end - start;
53905
+ for (let j2 = 0; j2 < numCol; j2++) {
53906
+ output[outIndex * numCol + j2] /= end - start;
53904
53907
  }
53905
53908
  }
53906
53909
  start = end;
@@ -53985,8 +53988,8 @@ function stridedSliceImpl(outShape, xBuf, strides, begin) {
53985
53988
  for (let i9 = 0; i9 < outBuf.size; i9++) {
53986
53989
  const loc = outBuf.indexToLoc(i9);
53987
53990
  const newLoc = new Array(loc.length);
53988
- for (let j3 = 0; j3 < newLoc.length; j3++) {
53989
- newLoc[j3] = loc[j3] * strides[j3] + begin[j3];
53991
+ for (let j2 = 0; j2 < newLoc.length; j2++) {
53992
+ newLoc[j2] = loc[j2] * strides[j2] + begin[j2];
53990
53993
  }
53991
53994
  outBuf.set(xBuf.get(...newLoc), ...loc);
53992
53995
  }
@@ -54191,9 +54194,9 @@ function stringSplitImpl(input2, delimiter, skipEmpty) {
54191
54194
  const shape = [batchSize, maxNumEntries];
54192
54195
  let c7 = 0;
54193
54196
  for (let i9 = 0; i9 < batchSize; ++i9) {
54194
- for (let j3 = 0; j3 < numIndices[i9]; ++j3) {
54197
+ for (let j2 = 0; j2 < numIndices[i9]; ++j2) {
54195
54198
  indices[c7 * 2] = i9;
54196
- indices[c7 * 2 + 1] = j3;
54199
+ indices[c7 * 2 + 1] = j2;
54197
54200
  values[c7] = tokens[c7];
54198
54201
  ++c7;
54199
54202
  }
@@ -54250,8 +54253,8 @@ function tileImpl(xBuf, reps) {
54250
54253
  for (let i9 = 0; i9 < result.values.length; ++i9) {
54251
54254
  const newLoc = result.indexToLoc(i9);
54252
54255
  const originalLoc = new Array(xBuf.rank);
54253
- for (let j3 = 0; j3 < originalLoc.length; j3++) {
54254
- originalLoc[j3] = newLoc[j3] % xBuf.shape[j3];
54256
+ for (let j2 = 0; j2 < originalLoc.length; j2++) {
54257
+ originalLoc[j2] = newLoc[j2] % xBuf.shape[j2];
54255
54258
  }
54256
54259
  const originalIndex = xBuf.locToIndex(originalLoc);
54257
54260
  result.values[i9] = xBuf.values[originalIndex];
@@ -54279,33 +54282,33 @@ function select(array2, k3, left = 0, right = array2.length - 1) {
54279
54282
  }
54280
54283
  const t8 = array2[k3];
54281
54284
  let i9 = left;
54282
- let j3 = right;
54285
+ let j2 = right;
54283
54286
  util_exports.swap(array2, left, k3);
54284
54287
  if (comparePair(array2[right], t8) > 0) {
54285
54288
  util_exports.swap(array2, left, right);
54286
54289
  }
54287
- while (i9 < j3) {
54288
- util_exports.swap(array2, i9, j3);
54290
+ while (i9 < j2) {
54291
+ util_exports.swap(array2, i9, j2);
54289
54292
  i9++;
54290
- j3--;
54293
+ j2--;
54291
54294
  while (comparePair(array2[i9], t8) < 0) {
54292
54295
  i9 = i9 + 1;
54293
54296
  }
54294
- while (comparePair(array2[j3], t8) > 0) {
54295
- j3 = j3 - 1;
54297
+ while (comparePair(array2[j2], t8) > 0) {
54298
+ j2 = j2 - 1;
54296
54299
  }
54297
54300
  }
54298
54301
  if (comparePair(array2[left], t8) === 0) {
54299
- util_exports.swap(array2, left, j3);
54302
+ util_exports.swap(array2, left, j2);
54300
54303
  } else {
54301
- j3 = j3 + 1;
54302
- util_exports.swap(array2, j3, right);
54304
+ j2 = j2 + 1;
54305
+ util_exports.swap(array2, j2, right);
54303
54306
  }
54304
- if (j3 <= k3) {
54305
- left = j3 + 1;
54307
+ if (j2 <= k3) {
54308
+ left = j2 + 1;
54306
54309
  }
54307
- if (k3 <= j3) {
54308
- right = j3 - 1;
54310
+ if (k3 <= j2) {
54311
+ right = j2 - 1;
54309
54312
  }
54310
54313
  }
54311
54314
  }
@@ -54756,7 +54759,7 @@ function batchMatMul(args) {
54756
54759
  for (let k02 = 0; k02 < sharedDim; k02 += blockSize) {
54757
54760
  const kBlock = Math.min(k02 + blockSize, sharedDim);
54758
54761
  for (let i9 = i0; i9 < iBlock; i9++) {
54759
- for (let j3 = j0; j3 < jBlock; j3++) {
54762
+ for (let j2 = j0; j2 < jBlock; j2++) {
54760
54763
  let sum5 = 0;
54761
54764
  for (let k3 = k02; k3 < kBlock; k3++) {
54762
54765
  const aVal = (
@@ -54765,11 +54768,11 @@ function batchMatMul(args) {
54765
54768
  );
54766
54769
  const bVal = (
54767
54770
  // tslint:disable-next-line: max-line-length
54768
- b3dValues[k3 * bInnerStep + j3 * bOuterStep + batchIndexB * bBatch]
54771
+ b3dValues[k3 * bInnerStep + j2 * bOuterStep + batchIndexB * bBatch]
54769
54772
  );
54770
54773
  sum5 += aVal * bVal;
54771
54774
  }
54772
- resVals[bi * size3 + (i9 * rightDim + j3)] += sum5;
54775
+ resVals[bi * size3 + (i9 * rightDim + j2)] += sum5;
54773
54776
  }
54774
54777
  }
54775
54778
  }
@@ -54875,8 +54878,8 @@ function addN2(args) {
54875
54878
  const outVals = outBuf.values;
54876
54879
  for (let i9 = 0; i9 < tensors.length; i9++) {
54877
54880
  const currVals = vals[i9];
54878
- for (let j3 = 0; j3 < outVals.length; j3++) {
54879
- outVals[j3] += currVals[j3];
54881
+ for (let j2 = 0; j2 < outVals.length; j2++) {
54882
+ outVals[j2] += currVals[j2];
54880
54883
  }
54881
54884
  }
54882
54885
  return backend2.makeTensorInfo(outBuf.shape, outBuf.dtype, outBuf.values);
@@ -54916,8 +54919,8 @@ function all2(args) {
54916
54919
  for (let i9 = 0; i9 < vals.length; ++i9) {
54917
54920
  const offset3 = i9 * reduceSize;
54918
54921
  let all4 = aVals[offset3];
54919
- for (let j3 = 0; j3 < reduceSize; ++j3) {
54920
- const value = aVals[offset3 + j3];
54922
+ for (let j2 = 0; j2 < reduceSize; ++j2) {
54923
+ const value = aVals[offset3 + j2];
54921
54924
  all4 = all4 && value;
54922
54925
  }
54923
54926
  vals[i9] = all4;
@@ -54971,8 +54974,8 @@ function any2(args) {
54971
54974
  for (let i9 = 0; i9 < vals.length; ++i9) {
54972
54975
  const offset3 = i9 * reduceSize;
54973
54976
  let anyVal = aVals[offset3];
54974
- for (let j3 = 0; j3 < reduceSize; ++j3) {
54975
- const value = aVals[offset3 + j3];
54977
+ for (let j2 = 0; j2 < reduceSize; ++j2) {
54978
+ const value = aVals[offset3 + j2];
54976
54979
  anyVal = anyVal || value;
54977
54980
  }
54978
54981
  vals[i9] = anyVal;
@@ -55030,11 +55033,11 @@ function argMax2(args) {
55030
55033
  const offset3 = i9 * reduceSize;
55031
55034
  let max6 = aVals[offset3];
55032
55035
  let maxIndex = 0;
55033
- for (let j3 = 0; j3 < reduceSize; ++j3) {
55034
- const value = aVals[offset3 + j3];
55036
+ for (let j2 = 0; j2 < reduceSize; ++j2) {
55037
+ const value = aVals[offset3 + j2];
55035
55038
  if (value > max6) {
55036
55039
  max6 = value;
55037
- maxIndex = j3;
55040
+ maxIndex = j2;
55038
55041
  }
55039
55042
  }
55040
55043
  vals[i9] = maxIndex;
@@ -55082,11 +55085,11 @@ function argMin2(args) {
55082
55085
  const offset3 = i9 * reduceSize;
55083
55086
  let min6 = aVals[offset3];
55084
55087
  let minIndex = 0;
55085
- for (let j3 = 0; j3 < reduceSize; ++j3) {
55086
- const value = aVals[offset3 + j3];
55088
+ for (let j2 = 0; j2 < reduceSize; ++j2) {
55089
+ const value = aVals[offset3 + j2];
55087
55090
  if (value < min6) {
55088
55091
  min6 = value;
55089
- minIndex = j3;
55092
+ minIndex = j2;
55090
55093
  }
55091
55094
  }
55092
55095
  vals[i9] = minIndex;
@@ -56516,14 +56519,14 @@ function cumprod2(args) {
56516
56519
  const vals = util_exports.makeOnesTypedArray(util_exports.sizeFromShape($x.shape), resultDtype);
56517
56520
  const aVals = backend2.data.get($x.dataId).values;
56518
56521
  const finalDim = $x.shape[$x.shape.length - 1];
56519
- const indexAdjuster = reverse4 ? (i9, j3) => i9 + finalDim - j3 - 1 : (i9, j3) => i9 + j3;
56522
+ const indexAdjuster = reverse4 ? (i9, j2) => i9 + finalDim - j2 - 1 : (i9, j2) => i9 + j2;
56520
56523
  for (let i9 = 0; i9 < aVals.length; i9 += finalDim) {
56521
- for (let j3 = 0; j3 < finalDim; j3++) {
56522
- const idx = indexAdjuster(i9, j3);
56523
- if (j3 === 0) {
56524
+ for (let j2 = 0; j2 < finalDim; j2++) {
56525
+ const idx = indexAdjuster(i9, j2);
56526
+ if (j2 === 0) {
56524
56527
  vals[idx] = exclusive ? 1 : aVals[idx];
56525
56528
  } else {
56526
- const prevIdx = indexAdjuster(i9, j3 - 1);
56529
+ const prevIdx = indexAdjuster(i9, j2 - 1);
56527
56530
  vals[idx] = exclusive ? aVals[prevIdx] * vals[prevIdx] : aVals[idx] * vals[prevIdx];
56528
56531
  }
56529
56532
  }
@@ -56571,14 +56574,14 @@ function cumsum2(args) {
56571
56574
  const vals = util_exports.makeZerosTypedArray(util_exports.sizeFromShape($x.shape), resultDtype);
56572
56575
  const aVals = backend2.data.get($x.dataId).values;
56573
56576
  const finalDim = $x.shape[$x.shape.length - 1];
56574
- const indexAdjuster = reverse4 ? (i9, j3) => i9 + finalDim - j3 - 1 : (i9, j3) => i9 + j3;
56577
+ const indexAdjuster = reverse4 ? (i9, j2) => i9 + finalDim - j2 - 1 : (i9, j2) => i9 + j2;
56575
56578
  for (let i9 = 0; i9 < aVals.length; i9 += finalDim) {
56576
- for (let j3 = 0; j3 < finalDim; j3++) {
56577
- const idx = indexAdjuster(i9, j3);
56578
- if (j3 === 0) {
56579
+ for (let j2 = 0; j2 < finalDim; j2++) {
56580
+ const idx = indexAdjuster(i9, j2);
56581
+ if (j2 === 0) {
56579
56582
  vals[idx] = exclusive ? 0 : aVals[idx];
56580
56583
  } else {
56581
- const prevIdx = indexAdjuster(i9, j3 - 1);
56584
+ const prevIdx = indexAdjuster(i9, j2 - 1);
56582
56585
  vals[idx] = exclusive ? aVals[prevIdx] + vals[prevIdx] : aVals[idx] + vals[prevIdx];
56583
56586
  }
56584
56587
  }
@@ -57138,11 +57141,11 @@ function draw2(args) {
57138
57141
  rgba[d4] = value * multiplier;
57139
57142
  }
57140
57143
  }
57141
- const j3 = i9 * 4;
57142
- bytes[j3 + 0] = Math.round(rgba[0]);
57143
- bytes[j3 + 1] = Math.round(rgba[1]);
57144
- bytes[j3 + 2] = Math.round(rgba[2]);
57145
- bytes[j3 + 3] = Math.round(rgba[3]);
57144
+ const j2 = i9 * 4;
57145
+ bytes[j2 + 0] = Math.round(rgba[0]);
57146
+ bytes[j2 + 1] = Math.round(rgba[1]);
57147
+ bytes[j2 + 2] = Math.round(rgba[2]);
57148
+ bytes[j2 + 3] = Math.round(rgba[3]);
57146
57149
  }
57147
57150
  canvas.width = width;
57148
57151
  canvas.height = height;
@@ -57193,8 +57196,8 @@ function sum3(args) {
57193
57196
  for (let i9 = 0; i9 < vals.length; ++i9) {
57194
57197
  const offset3 = i9 * reduceSize;
57195
57198
  let sum5 = 0;
57196
- for (let j3 = 0; j3 < reduceSize; ++j3) {
57197
- sum5 += aVals[offset3 + j3];
57199
+ for (let j2 = 0; j2 < reduceSize; ++j2) {
57200
+ sum5 += aVals[offset3 + j2];
57198
57201
  }
57199
57202
  vals[i9] = sum5;
57200
57203
  }
@@ -58506,8 +58509,8 @@ function min4(args) {
58506
58509
  for (let i9 = 0; i9 < vals.length; ++i9) {
58507
58510
  const offset3 = i9 * reduceSize;
58508
58511
  let min6 = aVals[offset3];
58509
- for (let j3 = 0; j3 < reduceSize; ++j3) {
58510
- const value = aVals[offset3 + j3];
58512
+ for (let j2 = 0; j2 < reduceSize; ++j2) {
58513
+ const value = aVals[offset3 + j2];
58511
58514
  if (Number.isNaN(value) || value < min6) {
58512
58515
  min6 = value;
58513
58516
  }
@@ -59505,12 +59508,12 @@ var init_RotateWithOffset = __esm({
59505
59508
  });
59506
59509
 
59507
59510
  // node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Round.js
59508
- var round4, roundConfig;
59511
+ var round5, roundConfig;
59509
59512
  var init_Round = __esm({
59510
59513
  "node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/Round.js"() {
59511
59514
  init_dist();
59512
59515
  init_unary_utils();
59513
- round4 = unaryKernelFunc(Round, (xi) => {
59516
+ round5 = unaryKernelFunc(Round, (xi) => {
59514
59517
  const base = Math.floor(xi);
59515
59518
  if (xi - base < 0.5) {
59516
59519
  return Math.floor(xi);
@@ -59527,7 +59530,7 @@ var init_Round = __esm({
59527
59530
  roundConfig = {
59528
59531
  kernelName: Round,
59529
59532
  backendName: "cpu",
59530
- kernelFunc: round4
59533
+ kernelFunc: round5
59531
59534
  };
59532
59535
  }
59533
59536
  });
@@ -59640,7 +59643,7 @@ function select2(args) {
59640
59643
  let index = 0;
59641
59644
  const offset3 = conditionRank === 0 || conditionRank > 1 || t8.shape.length === 1 ? 1 : util_exports.sizeFromShape(t8.shape.slice(1));
59642
59645
  for (let i9 = 0; i9 < values.length; i9++) {
59643
- for (let j3 = 0; j3 < offset3; j3++) {
59646
+ for (let j2 = 0; j2 < offset3; j2++) {
59644
59647
  if (values[i9] === 1) {
59645
59648
  newValues[index++] = tValues[i9];
59646
59649
  } else {
@@ -64697,8 +64700,8 @@ var init_gpgpu_context = __esm({
64697
64700
  }
64698
64701
  }
64699
64702
  pollFence(fenceContext) {
64700
- return new Promise((resolve) => {
64701
- this.addItemToPoll(() => fenceContext.isFencePassed(), () => resolve());
64703
+ return new Promise((resolve2) => {
64704
+ this.addItemToPoll(() => fenceContext.isFencePassed(), () => resolve2());
64702
64705
  });
64703
64706
  }
64704
64707
  pollItems() {
@@ -65521,7 +65524,7 @@ var init_backend_webgl = __esm({
65521
65524
  async read(dataId) {
65522
65525
  if (this.pendingRead.has(dataId)) {
65523
65526
  const subscribers2 = this.pendingRead.get(dataId);
65524
- return new Promise((resolve) => subscribers2.push(resolve));
65527
+ return new Promise((resolve2) => subscribers2.push(resolve2));
65525
65528
  }
65526
65529
  const texData = this.texData.get(dataId);
65527
65530
  const { values, shape, slice: slice4, dtype, complexTensorInfos, isPacked } = texData;
@@ -65581,7 +65584,7 @@ var init_backend_webgl = __esm({
65581
65584
  const dTypeVals = this.convertAndCacheOnCPU(dataId, vals);
65582
65585
  const subscribers = this.pendingRead.get(dataId);
65583
65586
  this.pendingRead.delete(dataId);
65584
- subscribers.forEach((resolve) => resolve(dTypeVals));
65587
+ subscribers.forEach((resolve2) => resolve2(dTypeVals));
65585
65588
  if (this.pendingDisposal.has(dataId)) {
65586
65589
  this.pendingDisposal.delete(dataId);
65587
65590
  if (this.disposeData(dataId)) {
@@ -66156,10 +66159,10 @@ var init_backend_webgl = __esm({
66156
66159
  return Promise.all(ps);
66157
66160
  } else {
66158
66161
  for (const [, binary] of Object.entries(this.binaryCache)) {
66159
- const p6 = new Promise((resolve) => {
66162
+ const p6 = new Promise((resolve2) => {
66160
66163
  try {
66161
66164
  this.checkCompletion_(binary);
66162
- resolve(true);
66165
+ resolve2(true);
66163
66166
  } catch (error) {
66164
66167
  throw error;
66165
66168
  }
@@ -73306,12 +73309,12 @@ var init_gather_nd_gpu = __esm({
73306
73309
  const dtype = getCoordsDataType(shape.length);
73307
73310
  let mainLoop = `
73308
73311
  int index;`;
73309
- for (let j3 = 0; j3 < this.sliceDim; j3++) {
73312
+ for (let j2 = 0; j2 < this.sliceDim; j2++) {
73310
73313
  mainLoop += `
73311
- index = round(getIndices(coords[0], ${j3}));
73314
+ index = round(getIndices(coords[0], ${j2}));
73312
73315
  out_of_bounds = out_of_bounds || index < 0;
73313
- out_of_bounds = out_of_bounds || index >= ${this.paramsShape[j3]};
73314
- flattenIndex += index * ${this.strides[j3]};`;
73316
+ out_of_bounds = out_of_bounds || index >= ${this.paramsShape[j2]};
73317
+ flattenIndex += index * ${this.strides[j2]};`;
73315
73318
  }
73316
73319
  this.userCode = `
73317
73320
  void main() {
@@ -75371,7 +75374,7 @@ var init_pad_packed_gpu = __esm({
75371
75374
  ];
75372
75375
  const paddingArea = rank === 1 ? "rc < start || rc >= end" : "any(lessThan(rc, start)) || any(greaterThanEqual(rc, end))";
75373
75376
  let mainLoop = "";
75374
- for (let i9 = 0, j3 = rank === 1 ? 2 : 4; i9 < j3; i9++) {
75377
+ for (let i9 = 0, j2 = rank === 1 ? 2 : 4; i9 < j2; i9++) {
75375
75378
  mainLoop += `
75376
75379
  ${componentSetup[i9]}
75377
75380
  if (${paddingArea}) {
@@ -76532,7 +76535,7 @@ var init_RotateWithOffset2 = __esm({
76532
76535
  });
76533
76536
 
76534
76537
  // node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Round.js
76535
- var ROUND, round5, roundConfig2;
76538
+ var ROUND, round6, roundConfig2;
76536
76539
  var init_Round2 = __esm({
76537
76540
  "node_modules/@tensorflow/tfjs-backend-webgl/dist/kernels/Round.js"() {
76538
76541
  init_dist();
@@ -76553,11 +76556,11 @@ var init_Round2 = __esm({
76553
76556
  }
76554
76557
  }
76555
76558
  `;
76556
- round5 = unaryKernelFunc2({ opSnippet: ROUND });
76559
+ round6 = unaryKernelFunc2({ opSnippet: ROUND });
76557
76560
  roundConfig2 = {
76558
76561
  kernelName: Round,
76559
76562
  backendName: "webgl",
76560
- kernelFunc: round5
76563
+ kernelFunc: round6
76561
76564
  };
76562
76565
  }
76563
76566
  });
@@ -79209,7 +79212,7 @@ __export(dist_exports4, {
79209
79212
  reverse3d: () => reverse3d,
79210
79213
  reverse4d: () => reverse4d,
79211
79214
  rfft: () => rfft,
79212
- round: () => round3,
79215
+ round: () => round4,
79213
79216
  rsqrt: () => rsqrt,
79214
79217
  scalar: () => scalar,
79215
79218
  scatterND: () => scatterND,
@@ -79329,10 +79332,12 @@ var init_dist7 = __esm({
79329
79332
  });
79330
79333
 
79331
79334
  // lib/tflib.ts
79332
- async function getTF() {
79333
- if (window.TF == null)
79334
- window.TF = await Promise.resolve().then(() => (init_dist7(), dist_exports4));
79335
- return window.TF;
79335
+ function getTF() {
79336
+ const w3 = window;
79337
+ if (w3.__TFPromise == null) {
79338
+ w3.__TFPromise = w3.TF != null ? Promise.resolve(w3.TF) : Promise.resolve().then(() => (init_dist7(), dist_exports4)).then((tf15) => w3.TF = tf15);
79339
+ }
79340
+ return w3.__TFPromise;
79336
79341
  }
79337
79342
  var init_tflib = __esm({
79338
79343
  "lib/tflib.ts"() {
@@ -80225,6 +80230,8 @@ var init_layers = __esm({
80225
80230
  maxModelParams;
80226
80231
  /** The max layer params from the model design widget. */
80227
80232
  maxLayerParams;
80233
+ /** Called with the new selection state whenever a layer or connection is selected or unselected. */
80234
+ onSelectionChanged = null;
80228
80235
  constructor(container, editMode = "edit", maxModelParams, maxLayerParams) {
80229
80236
  let that = this;
80230
80237
  this.editMode = editMode;
@@ -80260,6 +80267,52 @@ var init_layers = __esm({
80260
80267
  this.editor.on("nodeRemoved", function(id3) {
80261
80268
  delete that.layers[id3];
80262
80269
  });
80270
+ const notifySelectionChanged = function() {
80271
+ setTimeout(function() {
80272
+ if (that.onSelectionChanged)
80273
+ that.onSelectionChanged(that.hasSelection());
80274
+ });
80275
+ };
80276
+ this.editor.on("nodeSelected", notifySelectionChanged);
80277
+ this.editor.on("nodeUnselected", notifySelectionChanged);
80278
+ this.editor.on("connectionSelected", notifySelectionChanged);
80279
+ this.editor.on("connectionUnselected", notifySelectionChanged);
80280
+ this.editor.on("nodeRemoved", notifySelectionChanged);
80281
+ this.editor.on("connectionRemoved", notifySelectionChanged);
80282
+ const nativeElementFromPoint = document.elementFromPoint.bind(document);
80283
+ container.addEventListener("touchend", function() {
80284
+ const root = container.getRootNode();
80285
+ if (root === document || typeof root.elementFromPoint !== "function")
80286
+ return;
80287
+ document.elementFromPoint = function(x3, y4) {
80288
+ let el = root.elementFromPoint(x3, y4);
80289
+ while (el && el.shadowRoot && el.shadowRoot.elementFromPoint) {
80290
+ const inner = el.shadowRoot.elementFromPoint(x3, y4);
80291
+ if (inner == null || inner === el)
80292
+ break;
80293
+ el = inner;
80294
+ }
80295
+ return el ?? nativeElementFromPoint(x3, y4);
80296
+ };
80297
+ setTimeout(function() {
80298
+ document.elementFromPoint = nativeElementFromPoint;
80299
+ });
80300
+ }, true);
80301
+ }
80302
+ /**
80303
+ * Removes the currently selected node (layer) or connection from the editor.
80304
+ */
80305
+ removeSelectedNode() {
80306
+ let editor = this.editor;
80307
+ if (editor.node_selected != null)
80308
+ editor.removeNodeId(editor.node_selected.id);
80309
+ else if (editor.connection_selected != null)
80310
+ editor.removeConnection();
80311
+ }
80312
+ /** Whether something is currently selected in the editor. */
80313
+ hasSelection() {
80314
+ let editor = this.editor;
80315
+ return editor.node_selected != null || editor.connection_selected != null;
80263
80316
  }
80264
80317
  /** Returns the average position of the layer nodes. Used to center the view. */
80265
80318
  getAveragePosition() {
@@ -80607,7 +80660,7 @@ var init_layers = __esm({
80607
80660
  * @returns the html element that wraps the entire layer.
80608
80661
  */
80609
80662
  getNodeElement() {
80610
- return this.elem.parentElement.parentElement;
80663
+ return this.elem?.parentElement?.parentElement;
80611
80664
  }
80612
80665
  /**
80613
80666
  * @param input Typically named "input_1", "input_2", ...
@@ -80720,26 +80773,33 @@ var init_layers = __esm({
80720
80773
  for (let i9 in inputs) {
80721
80774
  let input2 = inputs[i9];
80722
80775
  let inputName = i9;
80723
- if (input2.connections.length == 0 || this.getNodeInputElement(inputName).innerText == "") {
80724
- if (this.getNodeInputElement(inputName) == null)
80776
+ let inputElem = this.getNodeInputElement(inputName);
80777
+ if (input2.connections.length == 0 || inputElem == null || inputElem.innerText == "") {
80778
+ if (inputElem == null)
80725
80779
  this.addInput();
80726
80780
  setTimeout(function() {
80727
- that.getNodeInputElement(inputName).classList.remove("invalid");
80728
- that.getNodeInputElement(inputName).classList.remove("valid");
80781
+ let elem = that.getNodeInputElement(inputName);
80782
+ if (elem == null)
80783
+ return;
80784
+ elem.classList.remove("invalid");
80785
+ elem.classList.remove("valid");
80729
80786
  });
80730
80787
  continue;
80731
80788
  }
80732
80789
  let layer = this.editor.getLayerFromNodeId(parseInt(input2.connections[0].node));
80733
80790
  let output = input2.connections[0].input;
80734
- if (layer.getNodeOutputElement(output).innerText != this.getNodeInputElement(i9).innerText) {
80735
- this.getNodeInputElement(i9).classList.add("invalid");
80736
- this.getNodeInputElement(i9).classList.remove("valid");
80737
- this.getNodeInputElement(i9).title = "data has wrong dimensions";
80791
+ let outputElem = layer?.getNodeOutputElement(output);
80792
+ if (outputElem == null)
80793
+ continue;
80794
+ if (outputElem.innerText != inputElem.innerText) {
80795
+ inputElem.classList.add("invalid");
80796
+ inputElem.classList.remove("valid");
80797
+ inputElem.title = "data has wrong dimensions";
80738
80798
  return false;
80739
80799
  } else {
80740
- this.getNodeInputElement(i9).classList.remove("invalid");
80741
- this.getNodeInputElement(i9).classList.add("valid");
80742
- this.getNodeInputElement(i9).title = "";
80800
+ inputElem.classList.remove("invalid");
80801
+ inputElem.classList.add("valid");
80802
+ inputElem.title = "";
80743
80803
  }
80744
80804
  }
80745
80805
  return true;
@@ -80786,12 +80846,15 @@ var init_layers = __esm({
80786
80846
  */
80787
80847
  showValid() {
80788
80848
  let valid = this.valid();
80849
+ let elem = this.getNodeElement();
80850
+ if (elem == null)
80851
+ return;
80789
80852
  if (!valid) {
80790
- this.getNodeElement().classList.add("invalid");
80853
+ elem.classList.add("invalid");
80791
80854
  if (this.hasCyclicReference)
80792
- this.getNodeElement().setAttribute("title", msg("Has a cyclic reference."));
80855
+ elem.setAttribute("title", msg("Has a cyclic reference."));
80793
80856
  } else {
80794
- this.getNodeElement().classList.remove("invalid");
80857
+ elem.classList.remove("invalid");
80795
80858
  }
80796
80859
  }
80797
80860
  /**
@@ -80906,6 +80969,7 @@ var init_ar = __esm({
80906
80969
  "s32f2fa78e3267c4e": `\u0627\u0644\u062E\u0635\u0627\u0626\u0635 \u0641\u0642\u0637`,
80907
80970
  "s334f9922638204ab": `\u0645\u062C\u0645\u0648\u0639\u0629 \u0627\u0644\u0628\u064A\u0627\u0646\u0627\u062A \u0627\u0644\u0645\u0633\u062A\u062E\u062F\u0645\u0629`,
80908
80971
  "s34af392b321cbfa6": `\u062A\u062D\u0631\u064A\u0631 \u0643\u0644 \u0634\u064A\u0621`,
80972
+ "s38c7b3d048d88c07": `\u062D\u0630\u0641 \u0627\u0644\u0645\u062D\u062F\u062F`,
80909
80973
  "s38ddf839c081bbaf": str`
80910
80974
  ${0} الضباب
80911
80975
  `,
@@ -81065,6 +81129,7 @@ var init_bg = __esm({
81065
81129
  "s32f2fa78e3267c4e": `\u0441\u0430\u043C\u043E \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u0430`,
81066
81130
  "s334f9922638204ab": `\u0418\u0437\u043F\u043E\u043B\u0437\u0432\u0430\u043D\u0435 \u043D\u0430 \u043D\u0430\u0431\u043E\u0440 \u043E\u0442 \u0434\u0430\u043D\u043D\u0438`,
81067
81131
  "s34af392b321cbfa6": `\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u0430\u0439 \u0432\u0441\u0438\u0447\u043A\u043E`,
81132
+ "s38c7b3d048d88c07": `\u0418\u0437\u0442\u0440\u0438\u0439 \u0438\u0437\u0431\u0440\u0430\u043D\u043E\u0442\u043E`,
81068
81133
  "s38ddf839c081bbaf": str`
81069
81134
  ${0} th измерение
81070
81135
  `,
@@ -81223,6 +81288,7 @@ var init_cs = __esm({
81223
81288
  "s32f2fa78e3267c4e": `pouze vlastnosti`,
81224
81289
  "s334f9922638204ab": `Dataset pou\u017E\xEDvaj\xEDc\xED`,
81225
81290
  "s34af392b321cbfa6": `upravit v\u0161e`,
81291
+ "s38c7b3d048d88c07": `Odstranit vybran\xE9`,
81226
81292
  "s38ddf839c081bbaf": str`
81227
81293
  ${0} th dim
81228
81294
  `,
@@ -81382,6 +81448,7 @@ var init_da = __esm({
81382
81448
  "s32f2fa78e3267c4e": `kun egenskaber`,
81383
81449
  "s334f9922638204ab": `Dataset ved hj\xE6lp af`,
81384
81450
  "s34af392b321cbfa6": `rediger alt`,
81451
+ "s38c7b3d048d88c07": `Slet det valgte`,
81385
81452
  "s38ddf839c081bbaf": str`
81386
81453
  ${0} th dim
81387
81454
  `,
@@ -81540,6 +81607,7 @@ var init_de = __esm({
81540
81607
  "s32f2fa78e3267c4e": `nur Eigenschaften`,
81541
81608
  "s334f9922638204ab": `Datensatz unter Verwendung von`,
81542
81609
  "s34af392b321cbfa6": `alles bearbeiten`,
81610
+ "s38c7b3d048d88c07": `Ausgew\xE4hltes l\xF6schen`,
81543
81611
  "s38ddf839c081bbaf": str`
81544
81612
  ${0} Dim.
81545
81613
  `,
@@ -81698,6 +81766,7 @@ var init_el = __esm({
81698
81766
  "s32f2fa78e3267c4e": `\u03B9\u03B4\u03B9\u03CC\u03C4\u03B7\u03C4\u03B5\u03C2 \u03BC\u03CC\u03BD\u03BF`,
81699
81767
  "s334f9922638204ab": `\u03A7\u03C1\u03AE\u03C3\u03B7 \u03C3\u03C5\u03BD\u03CC\u03BB\u03BF\u03C5 \u03B4\u03B5\u03B4\u03BF\u03BC\u03AD\u03BD\u03C9\u03BD`,
81700
81768
  "s34af392b321cbfa6": `\u03B5\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1 \u03CC\u03BB\u03C9\u03BD`,
81769
+ "s38c7b3d048d88c07": `\u0394\u03B9\u03B1\u03B3\u03C1\u03B1\u03C6\u03AE \u03B5\u03C0\u03B9\u03BB\u03B5\u03B3\u03BC\u03AD\u03BD\u03C9\u03BD`,
81701
81770
  "s38ddf839c081bbaf": str`
81702
81771
  ${0} η διάσταση
81703
81772
  `,
@@ -81858,6 +81927,7 @@ var init_es = __esm({
81858
81927
  "s32f2fa78e3267c4e": `solo propiedades`,
81859
81928
  "s334f9922638204ab": `Conjunto de datos utilizando`,
81860
81929
  "s34af392b321cbfa6": `editar todo`,
81930
+ "s38c7b3d048d88c07": `Eliminar los elementos seleccionados`,
81861
81931
  "s38ddf839c081bbaf": str`
81862
81932
  ${0} la dimensión
81863
81933
  `,
@@ -82017,6 +82087,7 @@ var init_et = __esm({
82017
82087
  "s32f2fa78e3267c4e": `ainult omadused`,
82018
82088
  "s334f9922638204ab": `Andmekogum kasutades`,
82019
82089
  "s34af392b321cbfa6": `k\xF5ike muuta`,
82090
+ "s38c7b3d048d88c07": `Kustuta valitud`,
82020
82091
  "s38ddf839c081bbaf": str`
82021
82092
  ${0} th dim
82022
82093
  `,
@@ -82176,6 +82247,7 @@ var init_fi = __esm({
82176
82247
  "s32f2fa78e3267c4e": `vain ominaisuudet`,
82177
82248
  "s334f9922638204ab": `K\xE4ytt\xE4m\xE4si tietojoukko`,
82178
82249
  "s34af392b321cbfa6": `muokkaa kaikkea`,
82250
+ "s38c7b3d048d88c07": `Poista valitut`,
82179
82251
  "s38ddf839c081bbaf": str`
82180
82252
  ${0} th dim
82181
82253
  `,
@@ -82334,6 +82406,7 @@ var init_fr = __esm({
82334
82406
  "s32f2fa78e3267c4e": `propri\xE9t\xE9s uniquement`,
82335
82407
  "s334f9922638204ab": `Ensemble de donn\xE9es utilisant`,
82336
82408
  "s34af392b321cbfa6": `modifier tout`,
82409
+ "s38c7b3d048d88c07": `Supprimer la s\xE9lection`,
82337
82410
  "s38ddf839c081bbaf": str`
82338
82411
  ${0} th dim
82339
82412
  `,
@@ -82493,6 +82566,7 @@ var init_hu = __esm({
82493
82566
  "s32f2fa78e3267c4e": `csak tulajdons\xE1gok`,
82494
82567
  "s334f9922638204ab": `Adatk\xE9szlet haszn\xE1lata`,
82495
82568
  "s34af392b321cbfa6": `mindent szerkeszteni`,
82569
+ "s38c7b3d048d88c07": `A kijel\xF6ltek t\xF6rl\xE9se`,
82496
82570
  "s38ddf839c081bbaf": str`
82497
82571
  ${0} th dim
82498
82572
  `,
@@ -82651,6 +82725,7 @@ var init_id = __esm({
82651
82725
  "s32f2fa78e3267c4e": `hanya properti`,
82652
82726
  "s334f9922638204ab": `Dataset yang menggunakan`,
82653
82727
  "s34af392b321cbfa6": `edit semuanya`,
82728
+ "s38c7b3d048d88c07": `Hapus yang dipilih`,
82654
82729
  "s38ddf839c081bbaf": str`
82655
82730
  ${0} dimensi ke-th
82656
82731
  `,
@@ -82810,6 +82885,7 @@ var init_it = __esm({
82810
82885
  "s32f2fa78e3267c4e": `solo propriet\xE0`,
82811
82886
  "s334f9922638204ab": `Set di dati utilizzando`,
82812
82887
  "s34af392b321cbfa6": `modifica tutto`,
82888
+ "s38c7b3d048d88c07": `Elimina selezionati`,
82813
82889
  "s38ddf839c081bbaf": str`
82814
82890
  ${0} la dimensione
82815
82891
  `,
@@ -82969,6 +83045,7 @@ var init_ja = __esm({
82969
83045
  "s32f2fa78e3267c4e": `\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u307F`,
82970
83046
  "s334f9922638204ab": `\u4F7F\u7528\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8`,
82971
83047
  "s34af392b321cbfa6": `\u3059\u3079\u3066\u3092\u7DE8\u96C6\u3059\u308B`,
83048
+ "s38c7b3d048d88c07": `\u9078\u629E\u3057\u305F\u9805\u76EE\u3092\u524A\u9664`,
82972
83049
  "s38ddf839c081bbaf": str`
82973
83050
  ${0} 第
82974
83051
  `,
@@ -83127,6 +83204,7 @@ var init_ko = __esm({
83127
83204
  "s32f2fa78e3267c4e": `\uC18D\uC131\uB9CC`,
83128
83205
  "s334f9922638204ab": `\uB370\uC774\uD130\uC14B \uC0AC\uC6A9`,
83129
83206
  "s34af392b321cbfa6": `\uBAA8\uB4E0 \uAC83\uC744 \uC218\uC815\uD558\uB2E4`,
83207
+ "s38c7b3d048d88c07": `\uC120\uD0DD\uD55C \uD56D\uBAA9 \uC0AD\uC81C`,
83130
83208
  "s38ddf839c081bbaf": str`
83131
83209
  ${0} th 차원
83132
83210
  `,
@@ -83285,6 +83363,7 @@ var init_lt = __esm({
83285
83363
  "s32f2fa78e3267c4e": `tik savyb\u0117s`,
83286
83364
  "s334f9922638204ab": `Duomen\u0173 rinkinys, naudojantis`,
83287
83365
  "s34af392b321cbfa6": `redaguoti visk\u0105`,
83366
+ "s38c7b3d048d88c07": `I\u0161trinti pa\u017Eym\u0117tus`,
83288
83367
  "s38ddf839c081bbaf": str`
83289
83368
  ${0} th dim
83290
83369
  `,
@@ -83443,6 +83522,7 @@ var init_lv = __esm({
83443
83522
  "s32f2fa78e3267c4e": `tikai \u012Bpa\u0161\u012Bbas`,
83444
83523
  "s334f9922638204ab": `Datu kopa, izmantojot`,
83445
83524
  "s34af392b321cbfa6": `redi\u0123\u0113t visu`,
83525
+ "s38c7b3d048d88c07": `Dz\u0113st atlas\u012Bto`,
83446
83526
  "s38ddf839c081bbaf": str`
83447
83527
  ${0} th dim
83448
83528
  `,
@@ -83601,6 +83681,7 @@ var init_nb = __esm({
83601
83681
  "s32f2fa78e3267c4e": `egenskaper kun`,
83602
83682
  "s334f9922638204ab": `Dataset ved bruk av`,
83603
83683
  "s34af392b321cbfa6": `rediger alt`,
83684
+ "s38c7b3d048d88c07": `Slett det valgte`,
83604
83685
  "s38ddf839c081bbaf": str`
83605
83686
  ${0} th dim
83606
83687
  `,
@@ -83759,6 +83840,7 @@ var init_nl = __esm({
83759
83840
  "s32f2fa78e3267c4e": `alleen eigenschappen`,
83760
83841
  "s334f9922638204ab": `Gebruikte dataset`,
83761
83842
  "s34af392b321cbfa6": `alles bewerken`,
83843
+ "s38c7b3d048d88c07": `Geselecteerde items verwijderen`,
83762
83844
  "s38ddf839c081bbaf": str`
83763
83845
  ${0} th dim
83764
83846
  `,
@@ -83917,6 +83999,7 @@ var init_pl = __esm({
83917
83999
  "s32f2fa78e3267c4e": `tylko w\u0142a\u015Bciwo\u015Bci`,
83918
84000
  "s334f9922638204ab": `Zbi\xF3r danych wykorzystuj\u0105cy`,
83919
84001
  "s34af392b321cbfa6": `edytuj wszystko`,
84002
+ "s38c7b3d048d88c07": `Usu\u0144 zaznaczone`,
83920
84003
  "s38ddf839c081bbaf": str`
83921
84004
  ${0} th dim
83922
84005
  `,
@@ -84076,6 +84159,7 @@ var init_pt_BR = __esm({
84076
84159
  "s32f2fa78e3267c4e": `apenas propriedades`,
84077
84160
  "s334f9922638204ab": `Conjunto de dados utilizando`,
84078
84161
  "s34af392b321cbfa6": `editar tudo`,
84162
+ "s38c7b3d048d88c07": `Excluir os itens selecionados`,
84079
84163
  "s38ddf839c081bbaf": str`
84080
84164
  ${0} a dimensão
84081
84165
  `,
@@ -84235,6 +84319,7 @@ var init_pt_PT = __esm({
84235
84319
  "s32f2fa78e3267c4e": `apenas propriedades`,
84236
84320
  "s334f9922638204ab": `Conjunto de dados utilizando`,
84237
84321
  "s34af392b321cbfa6": `editar tudo`,
84322
+ "s38c7b3d048d88c07": `Apagar os elementos selecionados`,
84238
84323
  "s38ddf839c081bbaf": str`
84239
84324
  ${0} a dimensão
84240
84325
  `,
@@ -84394,6 +84479,7 @@ var init_ro = __esm({
84394
84479
  "s32f2fa78e3267c4e": `numai propriet\u0103\u021Bi`,
84395
84480
  "s334f9922638204ab": `Set de date utilizat`,
84396
84481
  "s34af392b321cbfa6": `editeaz\u0103 totul`,
84482
+ "s38c7b3d048d88c07": `\u0218terge elementele selectate`,
84397
84483
  "s38ddf839c081bbaf": str`
84398
84484
  ${0} dim
84399
84485
  `,
@@ -84553,6 +84639,7 @@ var init_ru = __esm({
84553
84639
  "s32f2fa78e3267c4e": `\u0442\u043E\u043B\u044C\u043A\u043E \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u0430`,
84554
84640
  "s334f9922638204ab": `\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435 \u043D\u0430\u0431\u043E\u0440\u0430 \u0434\u0430\u043D\u043D\u044B\u0445`,
84555
84641
  "s34af392b321cbfa6": `\u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432\u0441\u0435`,
84642
+ "s38c7b3d048d88c07": `\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u044B\u0434\u0435\u043B\u0435\u043D\u043D\u043E\u0435`,
84556
84643
  "s38ddf839c081bbaf": str`
84557
84644
  ${0} th измерение
84558
84645
  `,
@@ -84712,6 +84799,7 @@ var init_sk = __esm({
84712
84799
  "s32f2fa78e3267c4e": `len vlastnosti`,
84713
84800
  "s334f9922638204ab": `Dataset pou\u017E\xEDvaj\xFAci`,
84714
84801
  "s34af392b321cbfa6": `upravi\u0165 v\u0161etko`,
84802
+ "s38c7b3d048d88c07": `Odstr\xE1ni\u0165 vybran\xE9`,
84715
84803
  "s38ddf839c081bbaf": str`
84716
84804
  ${0} th dim
84717
84805
  `,
@@ -84871,6 +84959,7 @@ var init_sl = __esm({
84871
84959
  "s32f2fa78e3267c4e": `samo lastnosti`,
84872
84960
  "s334f9922638204ab": `Podatkovna zbirka, ki uporablja`,
84873
84961
  "s34af392b321cbfa6": `uredi vse`,
84962
+ "s38c7b3d048d88c07": `Izbri\u0161i izbrano`,
84874
84963
  "s38ddf839c081bbaf": str`
84875
84964
  ${0} th dim
84876
84965
  `,
@@ -85030,6 +85119,7 @@ var init_sv = __esm({
85030
85119
  "s32f2fa78e3267c4e": `endast egenskaper`,
85031
85120
  "s334f9922638204ab": `Dataset som anv\xE4nder`,
85032
85121
  "s34af392b321cbfa6": `redigera allt`,
85122
+ "s38c7b3d048d88c07": `Ta bort det markerade`,
85033
85123
  "s38ddf839c081bbaf": str`
85034
85124
  ${0} th dim
85035
85125
  `,
@@ -85188,6 +85278,7 @@ var init_tr = __esm({
85188
85278
  "s32f2fa78e3267c4e": `sadece \xF6zellikler`,
85189
85279
  "s334f9922638204ab": `Kullan\u0131lan veri k\xFCmesi`,
85190
85280
  "s34af392b321cbfa6": `her \u015Feyi d\xFCzenle`,
85281
+ "s38c7b3d048d88c07": `Se\xE7ilenleri sil`,
85191
85282
  "s38ddf839c081bbaf": str`
85192
85283
  ${0} th dim
85193
85284
  `,
@@ -85346,6 +85437,7 @@ var init_uk = __esm({
85346
85437
  "s32f2fa78e3267c4e": `\u0442\u0456\u043B\u044C\u043A\u0438 \u0432\u043B\u0430\u0441\u0442\u0438\u0432\u043E\u0441\u0442\u0456`,
85347
85438
  "s334f9922638204ab": `\u041D\u0430\u0431\u0456\u0440 \u0434\u0430\u043D\u0438\u0445, \u0449\u043E \u0432\u0438\u043A\u043E\u0440\u0438\u0441\u0442\u043E\u0432\u0443\u0454\u0442\u044C\u0441\u044F`,
85348
85439
  "s34af392b321cbfa6": `\u0440\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u0432\u0441\u0435`,
85440
+ "s38c7b3d048d88c07": `\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0432\u0438\u0431\u0440\u0430\u043D\u0435`,
85349
85441
  "s38ddf839c081bbaf": str`
85350
85442
  ${0} th dim
85351
85443
  `,
@@ -85555,6 +85647,7 @@ var init_zh_hans = __esm({
85555
85647
  "s6c5b5757b7756775": `Center View`,
85556
85648
  "s22fde937cb709859": `Zoom In`,
85557
85649
  "sb05582ce916894da": `Zoom Out`,
85650
+ "s38c7b3d048d88c07": `Delete selected`,
85558
85651
  "sdab07807ff1b6b12": `Model Design Widget hidden from students.`,
85559
85652
  "s026fba1543d336b2": `Feature Source`,
85560
85653
  "s32f2fa78e3267c4e": `properties only`,
@@ -85696,6 +85789,7 @@ var init_zh_hant = __esm({
85696
85789
  "s6c5b5757b7756775": `Center View`,
85697
85790
  "s22fde937cb709859": `Zoom In`,
85698
85791
  "sb05582ce916894da": `Zoom Out`,
85792
+ "s38c7b3d048d88c07": `Delete selected`,
85699
85793
  "sdab07807ff1b6b12": `Model Design Widget hidden from students.`,
85700
85794
  "s026fba1543d336b2": `Feature Source`,
85701
85795
  "s32f2fa78e3267c4e": `properties only`,
@@ -85800,10 +85894,10 @@ var __yieldStar = (value) => {
85800
85894
  isAwait = true;
85801
85895
  return {
85802
85896
  done: false,
85803
- value: new __await(new Promise((resolve) => {
85897
+ value: new __await(new Promise((resolve2) => {
85804
85898
  var x3 = obj[k3](v3);
85805
85899
  if (!(x3 instanceof Object)) __typeError("Object expected");
85806
- resolve(x3);
85900
+ resolve2(x3);
85807
85901
  }), 1)
85808
85902
  };
85809
85903
  };
@@ -86417,13 +86511,13 @@ var N = (t8, i9) => {
86417
86511
  }
86418
86512
  return [V(t8, l7 + (t8[s6] || "<?>") + (2 === i9 ? "</svg>" : 3 === i9 ? "</math>" : "")), e12];
86419
86513
  };
86420
- var S2 = class _S {
86514
+ var S2 = class _S2 {
86421
86515
  constructor({ strings: t8, _$litType$: i9 }, e12) {
86422
86516
  let r11;
86423
86517
  this.parts = [];
86424
86518
  let l7 = 0, a6 = 0;
86425
86519
  const u5 = t8.length - 1, d4 = this.parts, [f5, v3] = N(t8, i9);
86426
- if (this.el = _S.createElement(f5, e12), P.currentNode = this.el.content, 2 === i9 || 3 === i9) {
86520
+ if (this.el = _S2.createElement(f5, e12), P.currentNode = this.el.content, 2 === i9 || 3 === i9) {
86427
86521
  const t9 = this.el.content.firstChild;
86428
86522
  t9.replaceWith(...t9.childNodes);
86429
86523
  }
@@ -86488,7 +86582,7 @@ var R = class {
86488
86582
  for (const s6 of this._$AV) void 0 !== s6 && (void 0 !== s6.strings ? (s6._$AI(t8, s6, i9), i9 += s6.strings.length - 2) : s6._$AI(t8[i9])), i9++;
86489
86583
  }
86490
86584
  };
86491
- var k = class _k {
86585
+ var k = class _k2 {
86492
86586
  get _$AU() {
86493
86587
  return this._$AM?._$AU ?? this._$Cv;
86494
86588
  }
@@ -86534,7 +86628,7 @@ var k = class _k {
86534
86628
  u2(this._$AH) || (this._$AH = [], this._$AR());
86535
86629
  const i9 = this._$AH;
86536
86630
  let s6, e12 = 0;
86537
- for (const h6 of t8) e12 === i9.length ? i9.push(s6 = new _k(this.O(c3()), this.O(c3()), this, this.options)) : s6 = i9[e12], s6._$AI(h6), e12++;
86631
+ for (const h6 of t8) e12 === i9.length ? i9.push(s6 = new _k2(this.O(c3()), this.O(c3()), this, this.options)) : s6 = i9[e12], s6._$AI(h6), e12++;
86538
86632
  e12 < i9.length && (this._$AR(s6 && s6._$AB.nextSibling, e12), i9.length = e12);
86539
86633
  }
86540
86634
  _$AR(t8 = this._$AA.nextSibling, s6) {
@@ -86614,7 +86708,7 @@ var Z = class {
86614
86708
  };
86615
86709
  var j = { M: h2, P: o3, A: n3, C: 1, L: N, R, D: d2, V: M, I: k, H, N: L, U: z, B: I, F: Z };
86616
86710
  var B = t2.litHtmlPolyfillSupport;
86617
- B?.(S2, k), (t2.litHtmlVersions ??= []).push("3.3.2");
86711
+ B?.(S2, k), (t2.litHtmlVersions ??= []).push("3.3.3");
86618
86712
  var D = (t8, i9, s6) => {
86619
86713
  const e12 = s6?.renderBefore ?? i9;
86620
86714
  let h6 = e12._$litPart$;
@@ -88028,9 +88122,14 @@ var LocalizeController = class {
88028
88122
  }
88029
88123
  getTranslationData(lang) {
88030
88124
  var _a2, _b;
88031
- const locale = new Intl.Locale(lang.replace(/_/g, "-"));
88032
- const language = locale === null || locale === void 0 ? void 0 : locale.language.toLowerCase();
88033
- const region = (_b = (_a2 = locale === null || locale === void 0 ? void 0 : locale.region) === null || _a2 === void 0 ? void 0 : _a2.toLowerCase()) !== null && _b !== void 0 ? _b : "";
88125
+ let locale;
88126
+ try {
88127
+ locale = new Intl.Locale(lang.replace(/_/g, "-"));
88128
+ } catch (_c) {
88129
+ return { locale: void 0, language: "", region: "", primary: void 0, secondary: void 0 };
88130
+ }
88131
+ const language = locale.language.toLowerCase();
88132
+ const region = (_b = (_a2 = locale.region) === null || _a2 === void 0 ? void 0 : _a2.toLowerCase()) !== null && _b !== void 0 ? _b : "";
88034
88133
  const primary = translations.get(`${language}-${region}`);
88035
88134
  const secondary = translations.get(language);
88036
88135
  return { locale, language, region, primary, secondary };
@@ -88167,15 +88266,15 @@ function getAnimation(el, animationName, options) {
88167
88266
 
88168
88267
  // node_modules/@shoelace-style/shoelace/dist/chunks/chunk.AJ3ENQ5C.js
88169
88268
  function animateTo(el, keyframes, options) {
88170
- return new Promise((resolve) => {
88269
+ return new Promise((resolve2) => {
88171
88270
  if ((options == null ? void 0 : options.duration) === Infinity) {
88172
88271
  throw new Error("Promise-based animations must be finite.");
88173
88272
  }
88174
88273
  const animation = el.animate(keyframes, __spreadProps(__spreadValues({}, options), {
88175
88274
  duration: prefersReducedMotion() ? 0 : options.duration
88176
88275
  }));
88177
- animation.addEventListener("cancel", resolve, { once: true });
88178
- animation.addEventListener("finish", resolve, { once: true });
88276
+ animation.addEventListener("cancel", resolve2, { once: true });
88277
+ animation.addEventListener("finish", resolve2, { once: true });
88179
88278
  });
88180
88279
  }
88181
88280
  function parseDuration(delay) {
@@ -88195,9 +88294,9 @@ function prefersReducedMotion() {
88195
88294
  function stopAnimations(el) {
88196
88295
  return Promise.all(
88197
88296
  el.getAnimations().map((animation) => {
88198
- return new Promise((resolve) => {
88297
+ return new Promise((resolve2) => {
88199
88298
  animation.cancel();
88200
- requestAnimationFrame(resolve);
88299
+ requestAnimationFrame(resolve2);
88201
88300
  });
88202
88301
  })
88203
88302
  );
@@ -88617,10 +88716,6 @@ var oppositeSideMap = {
88617
88716
  bottom: "top",
88618
88717
  top: "bottom"
88619
88718
  };
88620
- var oppositeAlignmentMap = {
88621
- start: "end",
88622
- end: "start"
88623
- };
88624
88719
  function clamp(start, value, end) {
88625
88720
  return max(start, min(value, end));
88626
88721
  }
@@ -88639,9 +88734,9 @@ function getOppositeAxis(axis) {
88639
88734
  function getAxisLength(axis) {
88640
88735
  return axis === "y" ? "height" : "width";
88641
88736
  }
88642
- var yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
88643
88737
  function getSideAxis(placement) {
88644
- return yAxisSides.has(getSide(placement)) ? "y" : "x";
88738
+ const firstChar = placement[0];
88739
+ return firstChar === "t" || firstChar === "b" ? "y" : "x";
88645
88740
  }
88646
88741
  function getAlignmentAxis(placement) {
88647
88742
  return getOppositeAxis(getSideAxis(placement));
@@ -88664,7 +88759,7 @@ function getExpandedPlacements(placement) {
88664
88759
  return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
88665
88760
  }
88666
88761
  function getOppositeAlignmentPlacement(placement) {
88667
- return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
88762
+ return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start");
88668
88763
  }
88669
88764
  var lrPlacement = ["left", "right"];
88670
88765
  var rlPlacement = ["right", "left"];
@@ -88695,7 +88790,8 @@ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
88695
88790
  return list;
88696
88791
  }
88697
88792
  function getOppositePlacement(placement) {
88698
- return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
88793
+ const side = getSide(placement);
88794
+ return oppositeSideMap[side] + placement.slice(side.length);
88699
88795
  }
88700
88796
  function expandPaddingObject(padding) {
88701
88797
  return {
@@ -88789,6 +88885,63 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
88789
88885
  }
88790
88886
  return coords2;
88791
88887
  }
88888
+ async function detectOverflow(state, options) {
88889
+ var _await$platform$isEle;
88890
+ if (options === void 0) {
88891
+ options = {};
88892
+ }
88893
+ const {
88894
+ x: x3,
88895
+ y: y4,
88896
+ platform: platform2,
88897
+ rects,
88898
+ elements,
88899
+ strategy
88900
+ } = state;
88901
+ const {
88902
+ boundary = "clippingAncestors",
88903
+ rootBoundary = "viewport",
88904
+ elementContext = "floating",
88905
+ altBoundary = false,
88906
+ padding = 0
88907
+ } = evaluate(options, state);
88908
+ const paddingObject = getPaddingObject(padding);
88909
+ const altContext = elementContext === "floating" ? "reference" : "floating";
88910
+ const element = elements[altBoundary ? altContext : elementContext];
88911
+ const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
88912
+ element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
88913
+ boundary,
88914
+ rootBoundary,
88915
+ strategy
88916
+ }));
88917
+ const rect = elementContext === "floating" ? {
88918
+ x: x3,
88919
+ y: y4,
88920
+ width: rects.floating.width,
88921
+ height: rects.floating.height
88922
+ } : rects.reference;
88923
+ const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
88924
+ const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
88925
+ x: 1,
88926
+ y: 1
88927
+ } : {
88928
+ x: 1,
88929
+ y: 1
88930
+ };
88931
+ const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
88932
+ elements,
88933
+ rect,
88934
+ offsetParent,
88935
+ strategy
88936
+ }) : rect);
88937
+ return {
88938
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
88939
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
88940
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
88941
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
88942
+ };
88943
+ }
88944
+ var MAX_RESET_COUNT = 50;
88792
88945
  var computePosition = async (reference, floating, config) => {
88793
88946
  const {
88794
88947
  placement = "bottom",
@@ -88796,7 +88949,10 @@ var computePosition = async (reference, floating, config) => {
88796
88949
  middleware = [],
88797
88950
  platform: platform2
88798
88951
  } = config;
88799
- const validMiddleware = middleware.filter(Boolean);
88952
+ const platformWithDetectOverflow = platform2.detectOverflow ? platform2 : {
88953
+ ...platform2,
88954
+ detectOverflow
88955
+ };
88800
88956
  const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(floating));
88801
88957
  let rects = await platform2.getElementRects({
88802
88958
  reference,
@@ -88808,13 +88964,17 @@ var computePosition = async (reference, floating, config) => {
88808
88964
  y: y4
88809
88965
  } = computeCoordsFromPlacement(rects, placement, rtl);
88810
88966
  let statefulPlacement = placement;
88811
- let middlewareData = {};
88812
88967
  let resetCount = 0;
88813
- for (let i9 = 0; i9 < validMiddleware.length; i9++) {
88968
+ const middlewareData = {};
88969
+ for (let i9 = 0; i9 < middleware.length; i9++) {
88970
+ const currentMiddleware = middleware[i9];
88971
+ if (!currentMiddleware) {
88972
+ continue;
88973
+ }
88814
88974
  const {
88815
88975
  name,
88816
88976
  fn
88817
- } = validMiddleware[i9];
88977
+ } = currentMiddleware;
88818
88978
  const {
88819
88979
  x: nextX,
88820
88980
  y: nextY,
@@ -88828,7 +88988,7 @@ var computePosition = async (reference, floating, config) => {
88828
88988
  strategy,
88829
88989
  middlewareData,
88830
88990
  rects,
88831
- platform: platform2,
88991
+ platform: platformWithDetectOverflow,
88832
88992
  elements: {
88833
88993
  reference,
88834
88994
  floating
@@ -88836,14 +88996,11 @@ var computePosition = async (reference, floating, config) => {
88836
88996
  });
88837
88997
  x3 = nextX != null ? nextX : x3;
88838
88998
  y4 = nextY != null ? nextY : y4;
88839
- middlewareData = {
88840
- ...middlewareData,
88841
- [name]: {
88842
- ...middlewareData[name],
88843
- ...data
88844
- }
88999
+ middlewareData[name] = {
89000
+ ...middlewareData[name],
89001
+ ...data
88845
89002
  };
88846
- if (reset && resetCount <= 50) {
89003
+ if (reset && resetCount < MAX_RESET_COUNT) {
88847
89004
  resetCount++;
88848
89005
  if (typeof reset === "object") {
88849
89006
  if (reset.placement) {
@@ -88872,62 +89029,6 @@ var computePosition = async (reference, floating, config) => {
88872
89029
  middlewareData
88873
89030
  };
88874
89031
  };
88875
- async function detectOverflow(state, options) {
88876
- var _await$platform$isEle;
88877
- if (options === void 0) {
88878
- options = {};
88879
- }
88880
- const {
88881
- x: x3,
88882
- y: y4,
88883
- platform: platform2,
88884
- rects,
88885
- elements,
88886
- strategy
88887
- } = state;
88888
- const {
88889
- boundary = "clippingAncestors",
88890
- rootBoundary = "viewport",
88891
- elementContext = "floating",
88892
- altBoundary = false,
88893
- padding = 0
88894
- } = evaluate(options, state);
88895
- const paddingObject = getPaddingObject(padding);
88896
- const altContext = elementContext === "floating" ? "reference" : "floating";
88897
- const element = elements[altBoundary ? altContext : elementContext];
88898
- const clippingClientRect = rectToClientRect(await platform2.getClippingRect({
88899
- element: ((_await$platform$isEle = await (platform2.isElement == null ? void 0 : platform2.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating)),
88900
- boundary,
88901
- rootBoundary,
88902
- strategy
88903
- }));
88904
- const rect = elementContext === "floating" ? {
88905
- x: x3,
88906
- y: y4,
88907
- width: rects.floating.width,
88908
- height: rects.floating.height
88909
- } : rects.reference;
88910
- const offsetParent = await (platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating));
88911
- const offsetScale = await (platform2.isElement == null ? void 0 : platform2.isElement(offsetParent)) ? await (platform2.getScale == null ? void 0 : platform2.getScale(offsetParent)) || {
88912
- x: 1,
88913
- y: 1
88914
- } : {
88915
- x: 1,
88916
- y: 1
88917
- };
88918
- const elementClientRect = rectToClientRect(platform2.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
88919
- elements,
88920
- rect,
88921
- offsetParent,
88922
- strategy
88923
- }) : rect);
88924
- return {
88925
- top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
88926
- bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
88927
- left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
88928
- right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
88929
- };
88930
- }
88931
89032
  var arrow = (options) => ({
88932
89033
  name: "arrow",
88933
89034
  options,
@@ -89029,7 +89130,7 @@ var flip = function(options) {
89029
89130
  fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
89030
89131
  }
89031
89132
  const placements2 = [initialPlacement, ...fallbackPlacements];
89032
- const overflow = await detectOverflow(state, detectOverflowOptions);
89133
+ const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
89033
89134
  const overflows = [];
89034
89135
  let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
89035
89136
  if (checkMainAxis) {
@@ -89178,7 +89279,8 @@ var shift = function(options) {
89178
89279
  const {
89179
89280
  x: x3,
89180
89281
  y: y4,
89181
- placement
89282
+ placement,
89283
+ platform: platform2
89182
89284
  } = state;
89183
89285
  const {
89184
89286
  mainAxis: checkMainAxis = true,
@@ -89201,7 +89303,7 @@ var shift = function(options) {
89201
89303
  x: x3,
89202
89304
  y: y4
89203
89305
  };
89204
- const overflow = await detectOverflow(state, detectOverflowOptions);
89306
+ const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
89205
89307
  const crossAxis = getSideAxis(getSide(placement));
89206
89308
  const mainAxis = getOppositeAxis(crossAxis);
89207
89309
  let mainAxisCoord = coords2[mainAxis];
@@ -89259,7 +89361,7 @@ var size = function(options) {
89259
89361
  },
89260
89362
  ...detectOverflowOptions
89261
89363
  } = evaluate(options, state);
89262
- const overflow = await detectOverflow(state, detectOverflowOptions);
89364
+ const overflow = await platform2.detectOverflow(state, detectOverflowOptions);
89263
89365
  const side = getSide(placement);
89264
89366
  const alignment = getAlignment(placement);
89265
89367
  const isYAxis = getSideAxis(placement) === "y";
@@ -89360,7 +89462,6 @@ function isShadowRoot(value) {
89360
89462
  }
89361
89463
  return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
89362
89464
  }
89363
- var invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
89364
89465
  function isOverflowElement(element) {
89365
89466
  const {
89366
89467
  overflow,
@@ -89368,29 +89469,31 @@ function isOverflowElement(element) {
89368
89469
  overflowY,
89369
89470
  display
89370
89471
  } = getComputedStyle2(element);
89371
- return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
89472
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents";
89372
89473
  }
89373
- var tableElements = /* @__PURE__ */ new Set(["table", "td", "th"]);
89374
89474
  function isTableElement(element) {
89375
- return tableElements.has(getNodeName(element));
89475
+ return /^(table|td|th)$/.test(getNodeName(element));
89376
89476
  }
89377
- var topLayerSelectors = [":popover-open", ":modal"];
89378
89477
  function isTopLayer(element) {
89379
- return topLayerSelectors.some((selector) => {
89380
- try {
89381
- return element.matches(selector);
89382
- } catch (_e) {
89383
- return false;
89478
+ try {
89479
+ if (element.matches(":popover-open")) {
89480
+ return true;
89384
89481
  }
89385
- });
89482
+ } catch (_e) {
89483
+ }
89484
+ try {
89485
+ return element.matches(":modal");
89486
+ } catch (_e) {
89487
+ return false;
89488
+ }
89386
89489
  }
89387
- var transformProperties = ["transform", "translate", "scale", "rotate", "perspective"];
89388
- var willChangeValues = ["transform", "translate", "scale", "rotate", "perspective", "filter"];
89389
- var containValues = ["paint", "layout", "strict", "content"];
89490
+ var willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
89491
+ var containRe = /paint|layout|strict|content/;
89492
+ var isNotNone = (value) => !!value && value !== "none";
89493
+ var isWebKitValue;
89390
89494
  function isContainingBlock(elementOrCss) {
89391
- const webkit = isWebKit();
89392
89495
  const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss;
89393
- return transformProperties.some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || willChangeValues.some((value) => (css.willChange || "").includes(value)) || containValues.some((value) => (css.contain || "").includes(value));
89496
+ return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || "");
89394
89497
  }
89395
89498
  function getContainingBlock(element) {
89396
89499
  let currentNode = getParentNode(element);
@@ -89405,12 +89508,13 @@ function getContainingBlock(element) {
89405
89508
  return null;
89406
89509
  }
89407
89510
  function isWebKit() {
89408
- if (typeof CSS === "undefined" || !CSS.supports) return false;
89409
- return CSS.supports("-webkit-backdrop-filter", "none");
89511
+ if (isWebKitValue == null) {
89512
+ isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none");
89513
+ }
89514
+ return isWebKitValue;
89410
89515
  }
89411
- var lastTraversableNodeNames = /* @__PURE__ */ new Set(["html", "body", "#document"]);
89412
89516
  function isLastTraversableNode(node) {
89413
- return lastTraversableNodeNames.has(getNodeName(node));
89517
+ return /^(html|body|#document)$/.test(getNodeName(node));
89414
89518
  }
89415
89519
  function getComputedStyle2(element) {
89416
89520
  return getWindow(element).getComputedStyle(element);
@@ -89464,8 +89568,9 @@ function getOverflowAncestors(node, list, traverseIframes) {
89464
89568
  if (isBody) {
89465
89569
  const frameElement = getFrameElement(win);
89466
89570
  return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
89571
+ } else {
89572
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
89467
89573
  }
89468
- return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
89469
89574
  }
89470
89575
  function getFrameElement(win) {
89471
89576
  return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
@@ -89629,7 +89734,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
89629
89734
  if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
89630
89735
  scroll = getNodeScroll(offsetParent);
89631
89736
  }
89632
- if (isHTMLElement(offsetParent)) {
89737
+ if (isOffsetParentAnElement) {
89633
89738
  const offsetRect = getBoundingClientRect(offsetParent);
89634
89739
  scale2 = getScale(offsetParent);
89635
89740
  offsets.x = offsetRect.x + offsetParent.clientLeft;
@@ -89703,7 +89808,6 @@ function getViewportRect(element, strategy) {
89703
89808
  y: y4
89704
89809
  };
89705
89810
  }
89706
- var absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
89707
89811
  function getInnerBoundingClientRect(element, strategy) {
89708
89812
  const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
89709
89813
  const top = clientRect.top + element.clientTop;
@@ -89761,7 +89865,7 @@ function getClippingElementAncestors(element, cache) {
89761
89865
  if (!currentNodeIsContaining && computedStyle.position === "fixed") {
89762
89866
  currentContainingBlockComputedStyle = null;
89763
89867
  }
89764
- const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
89868
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === "absolute" || currentContainingBlockComputedStyle.position === "fixed") || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
89765
89869
  if (shouldDropCurrentNode) {
89766
89870
  result = result.filter((ancestor) => ancestor !== currentNode);
89767
89871
  } else {
@@ -89781,20 +89885,23 @@ function getClippingRect(_ref) {
89781
89885
  } = _ref;
89782
89886
  const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
89783
89887
  const clippingAncestors = [...elementClippingAncestors, rootBoundary];
89784
- const firstClippingAncestor = clippingAncestors[0];
89785
- const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
89786
- const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
89787
- accRect.top = max(rect.top, accRect.top);
89788
- accRect.right = min(rect.right, accRect.right);
89789
- accRect.bottom = min(rect.bottom, accRect.bottom);
89790
- accRect.left = max(rect.left, accRect.left);
89791
- return accRect;
89792
- }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
89888
+ const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);
89889
+ let top = firstRect.top;
89890
+ let right = firstRect.right;
89891
+ let bottom = firstRect.bottom;
89892
+ let left = firstRect.left;
89893
+ for (let i9 = 1; i9 < clippingAncestors.length; i9++) {
89894
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i9], strategy);
89895
+ top = max(rect.top, top);
89896
+ right = min(rect.right, right);
89897
+ bottom = min(rect.bottom, bottom);
89898
+ left = max(rect.left, left);
89899
+ }
89793
89900
  return {
89794
- width: clippingRect.right - clippingRect.left,
89795
- height: clippingRect.bottom - clippingRect.top,
89796
- x: clippingRect.left,
89797
- y: clippingRect.top
89901
+ width: right - left,
89902
+ height: bottom - top,
89903
+ x: left,
89904
+ y: top
89798
89905
  };
89799
89906
  }
89800
89907
  function getDimensions(element) {
@@ -90003,7 +90110,7 @@ function autoUpdate(reference, floating, update2, options) {
90003
90110
  animationFrame = false
90004
90111
  } = options;
90005
90112
  const referenceEl = unwrapElement(reference);
90006
- const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
90113
+ const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
90007
90114
  ancestors.forEach((ancestor) => {
90008
90115
  ancestorScroll && ancestor.addEventListener("scroll", update2, {
90009
90116
  passive: true
@@ -90016,7 +90123,7 @@ function autoUpdate(reference, floating, update2, options) {
90016
90123
  if (elementResize) {
90017
90124
  resizeObserver = new ResizeObserver((_ref) => {
90018
90125
  let [firstEntry] = _ref;
90019
- if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
90126
+ if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {
90020
90127
  resizeObserver.unobserve(floating);
90021
90128
  cancelAnimationFrame(reobserveFrame);
90022
90129
  reobserveFrame = requestAnimationFrame(() => {
@@ -90029,7 +90136,9 @@ function autoUpdate(reference, floating, update2, options) {
90029
90136
  if (referenceEl && !animationFrame) {
90030
90137
  resizeObserver.observe(referenceEl);
90031
90138
  }
90032
- resizeObserver.observe(floating);
90139
+ if (floating) {
90140
+ resizeObserver.observe(floating);
90141
+ }
90033
90142
  }
90034
90143
  let frameId;
90035
90144
  let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
@@ -90241,16 +90350,16 @@ var SlPopup = class extends ShoelaceElement {
90241
90350
  });
90242
90351
  }
90243
90352
  async stop() {
90244
- return new Promise((resolve) => {
90353
+ return new Promise((resolve2) => {
90245
90354
  if (this.cleanup) {
90246
90355
  this.cleanup();
90247
90356
  this.cleanup = void 0;
90248
90357
  this.removeAttribute("data-current-placement");
90249
90358
  this.style.removeProperty("--auto-size-available-width");
90250
90359
  this.style.removeProperty("--auto-size-available-height");
90251
- requestAnimationFrame(() => resolve());
90360
+ requestAnimationFrame(() => resolve2());
90252
90361
  } else {
90253
- resolve();
90362
+ resolve2();
90254
90363
  }
90255
90364
  });
90256
90365
  }
@@ -90493,11 +90602,11 @@ __decorateClass2([
90493
90602
 
90494
90603
  // node_modules/@shoelace-style/shoelace/dist/chunks/chunk.B4BZKR24.js
90495
90604
  function waitForEvent(el, eventName) {
90496
- return new Promise((resolve) => {
90605
+ return new Promise((resolve2) => {
90497
90606
  function done(event) {
90498
90607
  if (event.target === el) {
90499
90608
  el.removeEventListener(eventName, done);
90500
- resolve();
90609
+ resolve2();
90501
90610
  }
90502
90611
  }
90503
90612
  el.addEventListener(eventName, done);
@@ -97329,8 +97438,8 @@ self.QrCreator = H2;
97329
97438
  h6 = c7.size / e12;
97330
97439
  a6.beginPath();
97331
97440
  for (r11 = 0; r11 < e12; r11 += 1) for (b4 = 0; b4 < e12; b4 += 1) {
97332
- var g3 = a6, x3 = c7.left + b4 * h6, u5 = c7.top + r11 * h6, p6 = r11, q = b4, f5 = d4.a, k3 = x3 + h6, m4 = u5 + h6, D2 = p6 - 1, E3 = p6 + 1, n11 = q - 1, l7 = q + 1, y5 = Math.floor(Math.min(0.5, Math.max(0, c7.R)) * h6), v4 = f5(p6, q), I3 = f5(D2, n11), w4 = f5(D2, q);
97333
- D2 = f5(D2, l7);
97441
+ var g3 = a6, x3 = c7.left + b4 * h6, u5 = c7.top + r11 * h6, p6 = r11, q = b4, f5 = d4.a, k3 = x3 + h6, m4 = u5 + h6, D3 = p6 - 1, E3 = p6 + 1, n11 = q - 1, l7 = q + 1, y5 = Math.floor(Math.min(0.5, Math.max(0, c7.R)) * h6), v4 = f5(p6, q), I3 = f5(D3, n11), w4 = f5(D3, q);
97442
+ D3 = f5(D3, l7);
97334
97443
  var F = f5(p6, l7);
97335
97444
  l7 = f5(E3, l7);
97336
97445
  q = f5(
@@ -97343,7 +97452,7 @@ self.QrCreator = H2;
97343
97452
  u5 = Math.round(u5);
97344
97453
  k3 = Math.round(k3);
97345
97454
  m4 = Math.round(m4);
97346
- v4 ? C3(g3, x3, u5, k3, m4, y5, !w4 && !p6, !w4 && !F, !q && !F, !q && !p6) : z3(g3, x3, u5, k3, m4, y5, w4 && p6 && I3, w4 && F && D2, q && F && l7, q && p6 && E3);
97455
+ v4 ? C3(g3, x3, u5, k3, m4, y5, !w4 && !p6, !w4 && !F, !q && !F, !q && !p6) : z3(g3, x3, u5, k3, m4, y5, w4 && p6 && I3, w4 && F && D3, q && F && l7, q && p6 && E3);
97347
97456
  }
97348
97457
  A3(a6, c7);
97349
97458
  a6.fill();
@@ -99727,10 +99836,10 @@ var n9 = e6(class extends f3 {
99727
99836
  }
99728
99837
  update(i9, [s6]) {
99729
99838
  const e12 = s6 !== this.G;
99730
- return e12 && void 0 !== this.G && this.rt(void 0), (e12 || this.lt !== this.ct) && (this.G = s6, this.ht = i9.options?.host, this.rt(this.ct = i9.element)), A;
99839
+ return e12 && this.rt(void 0), (e12 || this.lt !== this.ct) && (this.G = s6, this.ht = i9.options?.host, this.rt(this.ct = i9.element)), A;
99731
99840
  }
99732
99841
  rt(t8) {
99733
- if (this.isConnected || (t8 = void 0), "function" == typeof this.G) {
99842
+ if (void 0 !== this.G) if (this.isConnected || (t8 = void 0), "function" == typeof this.G) {
99734
99843
  const i9 = this.ht ?? globalThis;
99735
99844
  let s6 = o11.get(i9);
99736
99845
  void 0 === s6 && (s6 = /* @__PURE__ */ new WeakMap(), o11.set(i9, s6)), void 0 !== s6.get(this.G) && this.G.call(this.ht, void 0), s6.set(this.G, t8), void 0 !== t8 && this.G.call(this.ht, t8);
@@ -107088,7 +107197,7 @@ var _SlAlert = class _SlAlert2 extends ShoelaceElement {
107088
107197
  * calling this method again. The returned promise will resolve after the alert is hidden.
107089
107198
  */
107090
107199
  async toast() {
107091
- return new Promise((resolve) => {
107200
+ return new Promise((resolve2) => {
107092
107201
  this.handleCountdownChange();
107093
107202
  if (_SlAlert2.toastStack.parentElement === null) {
107094
107203
  document.body.append(_SlAlert2.toastStack);
@@ -107102,7 +107211,7 @@ var _SlAlert = class _SlAlert2 extends ShoelaceElement {
107102
107211
  "sl-after-hide",
107103
107212
  () => {
107104
107213
  _SlAlert2.toastStack.removeChild(this);
107105
- resolve();
107214
+ resolve2();
107106
107215
  if (_SlAlert2.toastStack.querySelector("sl-alert") === null) {
107107
107216
  _SlAlert2.toastStack.remove();
107108
107217
  }
@@ -108401,8 +108510,8 @@ var __runInitializers = (array2, flags, self2, value) => {
108401
108510
  };
108402
108511
  var __decorateElement = (array2, flags, name, decorators, target, extra) => {
108403
108512
  var fn, it, done, ctx, access, k23 = flags & 7, s42 = !!(flags & 8), p32 = !!(flags & 16);
108404
- var j22 = k23 > 3 ? array2.length + 1 : k23 ? s42 ? 1 : 2 : 0, key = __decoratorStrings[k23 + 5];
108405
- var initializers = k23 > 3 && (array2[j22 - 1] = []), extraInitializers = array2[j22] || (array2[j22] = []);
108513
+ var j2 = k23 > 3 ? array2.length + 1 : k23 ? s42 ? 1 : 2 : 0, key = __decoratorStrings[k23 + 5];
108514
+ var initializers = k23 > 3 && (array2[j2 - 1] = []), extraInitializers = array2[j2] || (array2[j2] = []);
108406
108515
  var desc = k23 && (!p32 && !s42 && (target = target.prototype), k23 < 5 && (k23 > 3 || !p32) && __getOwnPropDesc3(k23 < 4 ? target : { get [name]() {
108407
108516
  return __privateGet2(this, extra);
108408
108517
  }, set [name](x22) {
@@ -108608,13 +108717,15 @@ var y3 = class extends HTMLElement {
108608
108717
  const i52 = this.constructor, e52 = i52._$Eh.get(t32);
108609
108718
  if (void 0 !== e52 && this._$Em !== e52) {
108610
108719
  const t42 = i52.getPropertyOptions(e52), h32 = "function" == typeof t42.converter ? { fromAttribute: t42.converter } : void 0 !== t42.converter?.fromAttribute ? t42.converter : u4;
108611
- this._$Em = e52, this[e52] = h32.fromAttribute(s42, t42.type) ?? this._$Ej?.get(e52) ?? null, this._$Em = null;
108720
+ this._$Em = e52;
108721
+ const r52 = h32.fromAttribute(s42, t42.type);
108722
+ this[e52] = r52 ?? this._$Ej?.get(e52) ?? r52, this._$Em = null;
108612
108723
  }
108613
108724
  }
108614
- requestUpdate(t32, s42, i52) {
108725
+ requestUpdate(t32, s42, i52, e52 = false, h32) {
108615
108726
  if (void 0 !== t32) {
108616
- const e52 = this.constructor, h32 = this[t32];
108617
- if (i52 ??= e52.getPropertyOptions(t32), !((i52.hasChanged ?? f4)(h32, s42) || i52.useDefault && i52.reflect && h32 === this._$Ej?.get(t32) && !this.hasAttribute(e52._$Eu(t32, i52)))) return;
108727
+ const r52 = this.constructor;
108728
+ if (false === e52 && (h32 = this[t32]), i52 ??= r52.getPropertyOptions(t32), !((i52.hasChanged ?? f4)(h32, s42) || i52.useDefault && i52.reflect && h32 === this._$Ej?.get(t32) && !this.hasAttribute(r52._$Eu(t32, i52)))) return;
108618
108729
  this.C(t32, s42, i52);
108619
108730
  }
108620
108731
  false === this.isUpdatePending && (this._$ES = this._$EP());
@@ -108682,96 +108793,97 @@ var y3 = class extends HTMLElement {
108682
108793
  firstUpdated(t32) {
108683
108794
  }
108684
108795
  };
108685
- y3.elementStyles = [], y3.shadowRootOptions = { mode: "open" }, y3[d3("elementProperties")] = /* @__PURE__ */ new Map(), y3[d3("finalized")] = /* @__PURE__ */ new Map(), p4?.({ ReactiveElement: y3 }), (a4.reactiveElementVersions ??= []).push("2.1.0");
108796
+ y3.elementStyles = [], y3.shadowRootOptions = { mode: "open" }, y3[d3("elementProperties")] = /* @__PURE__ */ new Map(), y3[d3("finalized")] = /* @__PURE__ */ new Map(), p4?.({ ReactiveElement: y3 }), (a4.reactiveElementVersions ??= []).push("2.1.2");
108686
108797
  var t22 = globalThis;
108687
- var i32 = t22.trustedTypes;
108688
- var s22 = i32 ? i32.createPolicy("lit-html", { createHTML: (t32) => t32 }) : void 0;
108689
- var e32 = "$lit$";
108690
- var h22 = `lit$${Math.random().toFixed(9).slice(2)}$`;
108691
- var o32 = "?" + h22;
108692
- var n32 = `<${o32}>`;
108693
- var r32 = document;
108694
- var l22 = () => r32.createComment("");
108695
- var c32 = (t32) => null === t32 || "object" != typeof t32 && "function" != typeof t32;
108696
- var a22 = Array.isArray;
108697
- var u22 = (t32) => a22(t32) || "function" == typeof t32?.[Symbol.iterator];
108698
- var d22 = "[ \n\f\r]";
108699
- var f22 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g;
108700
- var v2 = /-->/g;
108701
- var _2 = />/g;
108702
- var m3 = RegExp(`>|${d22}(?:([^\\s"'>=/]+)(${d22}*=${d22}*(?:[^
108798
+ var i32 = (t32) => t32;
108799
+ var s22 = t22.trustedTypes;
108800
+ var e32 = s22 ? s22.createPolicy("lit-html", { createHTML: (t32) => t32 }) : void 0;
108801
+ var h22 = "$lit$";
108802
+ var o32 = `lit$${Math.random().toFixed(9).slice(2)}$`;
108803
+ var n32 = "?" + o32;
108804
+ var r32 = `<${n32}>`;
108805
+ var l22 = document;
108806
+ var c32 = () => l22.createComment("");
108807
+ var a22 = (t32) => null === t32 || "object" != typeof t32 && "function" != typeof t32;
108808
+ var u22 = Array.isArray;
108809
+ var d22 = (t32) => u22(t32) || "function" == typeof t32?.[Symbol.iterator];
108810
+ var f22 = "[ \n\f\r]";
108811
+ var v2 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g;
108812
+ var _2 = /-->/g;
108813
+ var m3 = />/g;
108814
+ var p22 = RegExp(`>|${f22}(?:([^\\s"'>=/]+)(${f22}*=${f22}*(?:[^
108703
108815
  \f\r"'\`<>=]|("|')|))|$)`, "g");
108704
- var p22 = /'/g;
108705
- var g2 = /"/g;
108706
- var $3 = /^(?:script|style|textarea|title)$/i;
108707
- var y22 = (t32) => (i52, ...s42) => ({ _$litType$: t32, strings: i52, values: s42 });
108708
- var x2 = y22(1);
108709
- var b22 = y22(2);
108710
- var w2 = y22(3);
108711
- var T2 = Symbol.for("lit-noChange");
108712
- var E2 = Symbol.for("lit-nothing");
108713
- var A2 = /* @__PURE__ */ new WeakMap();
108714
- var C2 = r32.createTreeWalker(r32, 129);
108715
- function P2(t32, i52) {
108716
- if (!a22(t32) || !t32.hasOwnProperty("raw")) throw Error("invalid template strings array");
108717
- return void 0 !== s22 ? s22.createHTML(i52) : i52;
108718
- }
108719
- var V2 = (t32, i52) => {
108720
- const s42 = t32.length - 1, o62 = [];
108721
- let r52, l32 = 2 === i52 ? "<svg>" : 3 === i52 ? "<math>" : "", c42 = f22;
108816
+ var g2 = /'/g;
108817
+ var $3 = /"/g;
108818
+ var y22 = /^(?:script|style|textarea|title)$/i;
108819
+ var x2 = (t32) => (i52, ...s42) => ({ _$litType$: t32, strings: i52, values: s42 });
108820
+ var b22 = x2(1);
108821
+ var w2 = x2(2);
108822
+ var T2 = x2(3);
108823
+ var E2 = Symbol.for("lit-noChange");
108824
+ var A2 = Symbol.for("lit-nothing");
108825
+ var C2 = /* @__PURE__ */ new WeakMap();
108826
+ var P2 = l22.createTreeWalker(l22, 129);
108827
+ function V2(t32, i52) {
108828
+ if (!u22(t32) || !t32.hasOwnProperty("raw")) throw Error("invalid template strings array");
108829
+ return void 0 !== e32 ? e32.createHTML(i52) : i52;
108830
+ }
108831
+ var N2 = (t32, i52) => {
108832
+ const s42 = t32.length - 1, e52 = [];
108833
+ let n52, l32 = 2 === i52 ? "<svg>" : 3 === i52 ? "<math>" : "", c42 = v2;
108722
108834
  for (let i62 = 0; i62 < s42; i62++) {
108723
108835
  const s52 = t32[i62];
108724
- let a33, u32, d32 = -1, y32 = 0;
108725
- for (; y32 < s52.length && (c42.lastIndex = y32, u32 = c42.exec(s52), null !== u32); ) y32 = c42.lastIndex, c42 === f22 ? "!--" === u32[1] ? c42 = v2 : void 0 !== u32[1] ? c42 = _2 : void 0 !== u32[2] ? ($3.test(u32[2]) && (r52 = RegExp("</" + u32[2], "g")), c42 = m3) : void 0 !== u32[3] && (c42 = m3) : c42 === m3 ? ">" === u32[0] ? (c42 = r52 ?? f22, d32 = -1) : void 0 === u32[1] ? d32 = -2 : (d32 = c42.lastIndex - u32[2].length, a33 = u32[1], c42 = void 0 === u32[3] ? m3 : '"' === u32[3] ? g2 : p22) : c42 === g2 || c42 === p22 ? c42 = m3 : c42 === v2 || c42 === _2 ? c42 = f22 : (c42 = m3, r52 = void 0);
108726
- const x22 = c42 === m3 && t32[i62 + 1].startsWith("/>") ? " " : "";
108727
- l32 += c42 === f22 ? s52 + n32 : d32 >= 0 ? (o62.push(a33), s52.slice(0, d32) + e32 + s52.slice(d32) + h22 + x22) : s52 + h22 + (-2 === d32 ? i62 : x22);
108836
+ let a33, u32, d32 = -1, f32 = 0;
108837
+ for (; f32 < s52.length && (c42.lastIndex = f32, u32 = c42.exec(s52), null !== u32); ) f32 = c42.lastIndex, c42 === v2 ? "!--" === u32[1] ? c42 = _2 : void 0 !== u32[1] ? c42 = m3 : void 0 !== u32[2] ? (y22.test(u32[2]) && (n52 = RegExp("</" + u32[2], "g")), c42 = p22) : void 0 !== u32[3] && (c42 = p22) : c42 === p22 ? ">" === u32[0] ? (c42 = n52 ?? v2, d32 = -1) : void 0 === u32[1] ? d32 = -2 : (d32 = c42.lastIndex - u32[2].length, a33 = u32[1], c42 = void 0 === u32[3] ? p22 : '"' === u32[3] ? $3 : g2) : c42 === $3 || c42 === g2 ? c42 = p22 : c42 === _2 || c42 === m3 ? c42 = v2 : (c42 = p22, n52 = void 0);
108838
+ const x22 = c42 === p22 && t32[i62 + 1].startsWith("/>") ? " " : "";
108839
+ l32 += c42 === v2 ? s52 + r32 : d32 >= 0 ? (e52.push(a33), s52.slice(0, d32) + h22 + s52.slice(d32) + o32 + x22) : s52 + o32 + (-2 === d32 ? i62 : x22);
108728
108840
  }
108729
- return [P2(t32, l32 + (t32[s42] || "<?>") + (2 === i52 ? "</svg>" : 3 === i52 ? "</math>" : "")), o62];
108841
+ return [V2(t32, l32 + (t32[s42] || "<?>") + (2 === i52 ? "</svg>" : 3 === i52 ? "</math>" : "")), e52];
108730
108842
  };
108731
- var N2 = class _N {
108732
- constructor({ strings: t32, _$litType$: s42 }, n52) {
108843
+ var S22 = class _S {
108844
+ constructor({ strings: t32, _$litType$: i52 }, e52) {
108733
108845
  let r52;
108734
108846
  this.parts = [];
108735
- let c42 = 0, a33 = 0;
108736
- const u32 = t32.length - 1, d32 = this.parts, [f32, v22] = V2(t32, s42);
108737
- if (this.el = _N.createElement(f32, n52), C2.currentNode = this.el.content, 2 === s42 || 3 === s42) {
108847
+ let l32 = 0, a33 = 0;
108848
+ const u32 = t32.length - 1, d32 = this.parts, [f32, v22] = N2(t32, i52);
108849
+ if (this.el = _S.createElement(f32, e52), P2.currentNode = this.el.content, 2 === i52 || 3 === i52) {
108738
108850
  const t42 = this.el.content.firstChild;
108739
108851
  t42.replaceWith(...t42.childNodes);
108740
108852
  }
108741
- for (; null !== (r52 = C2.nextNode()) && d32.length < u32; ) {
108853
+ for (; null !== (r52 = P2.nextNode()) && d32.length < u32; ) {
108742
108854
  if (1 === r52.nodeType) {
108743
- if (r52.hasAttributes()) for (const t42 of r52.getAttributeNames()) if (t42.endsWith(e32)) {
108744
- const i52 = v22[a33++], s52 = r52.getAttribute(t42).split(h22), e52 = /([.?@])?(.*)/.exec(i52);
108745
- d32.push({ type: 1, index: c42, name: e52[2], strings: s52, ctor: "." === e52[1] ? H3 : "?" === e52[1] ? I2 : "@" === e52[1] ? L2 : k2 }), r52.removeAttribute(t42);
108746
- } else t42.startsWith(h22) && (d32.push({ type: 6, index: c42 }), r52.removeAttribute(t42));
108747
- if ($3.test(r52.tagName)) {
108748
- const t42 = r52.textContent.split(h22), s52 = t42.length - 1;
108749
- if (s52 > 0) {
108750
- r52.textContent = i32 ? i32.emptyScript : "";
108751
- for (let i52 = 0; i52 < s52; i52++) r52.append(t42[i52], l22()), C2.nextNode(), d32.push({ type: 2, index: ++c42 });
108752
- r52.append(t42[s52], l22());
108753
- }
108754
- }
108755
- } else if (8 === r52.nodeType) if (r52.data === o32) d32.push({ type: 2, index: c42 });
108855
+ if (r52.hasAttributes()) for (const t42 of r52.getAttributeNames()) if (t42.endsWith(h22)) {
108856
+ const i62 = v22[a33++], s42 = r52.getAttribute(t42).split(o32), e62 = /([.?@])?(.*)/.exec(i62);
108857
+ d32.push({ type: 1, index: l32, name: e62[2], strings: s42, ctor: "." === e62[1] ? I2 : "?" === e62[1] ? L2 : "@" === e62[1] ? z2 : H3 }), r52.removeAttribute(t42);
108858
+ } else t42.startsWith(o32) && (d32.push({ type: 6, index: l32 }), r52.removeAttribute(t42));
108859
+ if (y22.test(r52.tagName)) {
108860
+ const t42 = r52.textContent.split(o32), i62 = t42.length - 1;
108861
+ if (i62 > 0) {
108862
+ r52.textContent = s22 ? s22.emptyScript : "";
108863
+ for (let s42 = 0; s42 < i62; s42++) r52.append(t42[s42], c32()), P2.nextNode(), d32.push({ type: 2, index: ++l32 });
108864
+ r52.append(t42[i62], c32());
108865
+ }
108866
+ }
108867
+ } else if (8 === r52.nodeType) if (r52.data === n32) d32.push({ type: 2, index: l32 });
108756
108868
  else {
108757
108869
  let t42 = -1;
108758
- for (; -1 !== (t42 = r52.data.indexOf(h22, t42 + 1)); ) d32.push({ type: 7, index: c42 }), t42 += h22.length - 1;
108870
+ for (; -1 !== (t42 = r52.data.indexOf(o32, t42 + 1)); ) d32.push({ type: 7, index: l32 }), t42 += o32.length - 1;
108759
108871
  }
108760
- c42++;
108872
+ l32++;
108761
108873
  }
108762
108874
  }
108763
108875
  static createElement(t32, i52) {
108764
- const s42 = r32.createElement("template");
108876
+ const s42 = l22.createElement("template");
108765
108877
  return s42.innerHTML = t32, s42;
108766
108878
  }
108767
108879
  };
108768
- function S22(t32, i52, s42 = t32, e52) {
108769
- if (i52 === T2) return i52;
108880
+ function M2(t32, i52, s42 = t32, e52) {
108881
+ if (i52 === E2) return i52;
108770
108882
  let h32 = void 0 !== e52 ? s42._$Co?.[e52] : s42._$Cl;
108771
- const o62 = c32(i52) ? void 0 : i52._$litDirective$;
108772
- return h32?.constructor !== o62 && (h32?._$AO?.(false), void 0 === o62 ? h32 = void 0 : (h32 = new o62(t32), h32._$AT(t32, s42, e52)), void 0 !== e52 ? (s42._$Co ??= [])[e52] = h32 : s42._$Cl = h32), void 0 !== h32 && (i52 = S22(t32, h32._$AS(t32, i52.values), h32, e52)), i52;
108883
+ const o62 = a22(i52) ? void 0 : i52._$litDirective$;
108884
+ return h32?.constructor !== o62 && (h32?._$AO?.(false), void 0 === o62 ? h32 = void 0 : (h32 = new o62(t32), h32._$AT(t32, s42, e52)), void 0 !== e52 ? (s42._$Co ??= [])[e52] = h32 : s42._$Cl = h32), void 0 !== h32 && (i52 = M2(t32, h32._$AS(t32, i52.values), h32, e52)), i52;
108773
108885
  }
108774
- var M2 = class {
108886
+ var R2 = class {
108775
108887
  constructor(t32, i52) {
108776
108888
  this._$AV = [], this._$AN = void 0, this._$AD = t32, this._$AM = i52;
108777
108889
  }
@@ -108782,29 +108894,29 @@ var M2 = class {
108782
108894
  return this._$AM._$AU;
108783
108895
  }
108784
108896
  u(t32) {
108785
- const { el: { content: i52 }, parts: s42 } = this._$AD, e52 = (t32?.creationScope ?? r32).importNode(i52, true);
108786
- C2.currentNode = e52;
108787
- let h32 = C2.nextNode(), o62 = 0, n52 = 0, l32 = s42[0];
108788
- for (; void 0 !== l32; ) {
108789
- if (o62 === l32.index) {
108897
+ const { el: { content: i52 }, parts: s42 } = this._$AD, e52 = (t32?.creationScope ?? l22).importNode(i52, true);
108898
+ P2.currentNode = e52;
108899
+ let h32 = P2.nextNode(), o62 = 0, n52 = 0, r52 = s42[0];
108900
+ for (; void 0 !== r52; ) {
108901
+ if (o62 === r52.index) {
108790
108902
  let i62;
108791
- 2 === l32.type ? i62 = new R2(h32, h32.nextSibling, this, t32) : 1 === l32.type ? i62 = new l32.ctor(h32, l32.name, l32.strings, this, t32) : 6 === l32.type && (i62 = new z2(h32, this, t32)), this._$AV.push(i62), l32 = s42[++n52];
108903
+ 2 === r52.type ? i62 = new k2(h32, h32.nextSibling, this, t32) : 1 === r52.type ? i62 = new r52.ctor(h32, r52.name, r52.strings, this, t32) : 6 === r52.type && (i62 = new Z2(h32, this, t32)), this._$AV.push(i62), r52 = s42[++n52];
108792
108904
  }
108793
- o62 !== l32?.index && (h32 = C2.nextNode(), o62++);
108905
+ o62 !== r52?.index && (h32 = P2.nextNode(), o62++);
108794
108906
  }
108795
- return C2.currentNode = r32, e52;
108907
+ return P2.currentNode = l22, e52;
108796
108908
  }
108797
108909
  p(t32) {
108798
108910
  let i52 = 0;
108799
108911
  for (const s42 of this._$AV) void 0 !== s42 && (void 0 !== s42.strings ? (s42._$AI(t32, s42, i52), i52 += s42.strings.length - 2) : s42._$AI(t32[i52])), i52++;
108800
108912
  }
108801
108913
  };
108802
- var R2 = class _R {
108914
+ var k2 = class _k {
108803
108915
  get _$AU() {
108804
108916
  return this._$AM?._$AU ?? this._$Cv;
108805
108917
  }
108806
108918
  constructor(t32, i52, s42, e52) {
108807
- this.type = 2, this._$AH = E2, this._$AN = void 0, this._$AA = t32, this._$AB = i52, this._$AM = s42, this.options = e52, this._$Cv = e52?.isConnected ?? true;
108919
+ this.type = 2, this._$AH = A2, this._$AN = void 0, this._$AA = t32, this._$AB = i52, this._$AM = s42, this.options = e52, this._$Cv = e52?.isConnected ?? true;
108808
108920
  }
108809
108921
  get parentNode() {
108810
108922
  let t32 = this._$AA.parentNode;
@@ -108818,7 +108930,7 @@ var R2 = class _R {
108818
108930
  return this._$AB;
108819
108931
  }
108820
108932
  _$AI(t32, i52 = this) {
108821
- t32 = S22(this, t32, i52), c32(t32) ? t32 === E2 || null == t32 || "" === t32 ? (this._$AH !== E2 && this._$AR(), this._$AH = E2) : t32 !== this._$AH && t32 !== T2 && this._(t32) : void 0 !== t32._$litType$ ? this.$(t32) : void 0 !== t32.nodeType ? this.T(t32) : u22(t32) ? this.k(t32) : this._(t32);
108933
+ t32 = M2(this, t32, i52), a22(t32) ? t32 === A2 || null == t32 || "" === t32 ? (this._$AH !== A2 && this._$AR(), this._$AH = A2) : t32 !== this._$AH && t32 !== E2 && this._(t32) : void 0 !== t32._$litType$ ? this.$(t32) : void 0 !== t32.nodeType ? this.T(t32) : d22(t32) ? this.k(t32) : this._(t32);
108822
108934
  }
108823
108935
  O(t32) {
108824
108936
  return this._$AA.parentNode.insertBefore(t32, this._$AB);
@@ -108827,38 +108939,38 @@ var R2 = class _R {
108827
108939
  this._$AH !== t32 && (this._$AR(), this._$AH = this.O(t32));
108828
108940
  }
108829
108941
  _(t32) {
108830
- this._$AH !== E2 && c32(this._$AH) ? this._$AA.nextSibling.data = t32 : this.T(r32.createTextNode(t32)), this._$AH = t32;
108942
+ this._$AH !== A2 && a22(this._$AH) ? this._$AA.nextSibling.data = t32 : this.T(l22.createTextNode(t32)), this._$AH = t32;
108831
108943
  }
108832
108944
  $(t32) {
108833
- const { values: i52, _$litType$: s42 } = t32, e52 = "number" == typeof s42 ? this._$AC(t32) : (void 0 === s42.el && (s42.el = N2.createElement(P2(s42.h, s42.h[0]), this.options)), s42);
108945
+ const { values: i52, _$litType$: s42 } = t32, e52 = "number" == typeof s42 ? this._$AC(t32) : (void 0 === s42.el && (s42.el = S22.createElement(V2(s42.h, s42.h[0]), this.options)), s42);
108834
108946
  if (this._$AH?._$AD === e52) this._$AH.p(i52);
108835
108947
  else {
108836
- const t42 = new M2(e52, this), s52 = t42.u(this.options);
108948
+ const t42 = new R2(e52, this), s52 = t42.u(this.options);
108837
108949
  t42.p(i52), this.T(s52), this._$AH = t42;
108838
108950
  }
108839
108951
  }
108840
108952
  _$AC(t32) {
108841
- let i52 = A2.get(t32.strings);
108842
- return void 0 === i52 && A2.set(t32.strings, i52 = new N2(t32)), i52;
108953
+ let i52 = C2.get(t32.strings);
108954
+ return void 0 === i52 && C2.set(t32.strings, i52 = new S22(t32)), i52;
108843
108955
  }
108844
108956
  k(t32) {
108845
- a22(this._$AH) || (this._$AH = [], this._$AR());
108957
+ u22(this._$AH) || (this._$AH = [], this._$AR());
108846
108958
  const i52 = this._$AH;
108847
108959
  let s42, e52 = 0;
108848
- for (const h32 of t32) e52 === i52.length ? i52.push(s42 = new _R(this.O(l22()), this.O(l22()), this, this.options)) : s42 = i52[e52], s42._$AI(h32), e52++;
108960
+ for (const h32 of t32) e52 === i52.length ? i52.push(s42 = new _k(this.O(c32()), this.O(c32()), this, this.options)) : s42 = i52[e52], s42._$AI(h32), e52++;
108849
108961
  e52 < i52.length && (this._$AR(s42 && s42._$AB.nextSibling, e52), i52.length = e52);
108850
108962
  }
108851
- _$AR(t32 = this._$AA.nextSibling, i52) {
108852
- for (this._$AP?.(false, true, i52); t32 && t32 !== this._$AB; ) {
108853
- const i62 = t32.nextSibling;
108854
- t32.remove(), t32 = i62;
108963
+ _$AR(t32 = this._$AA.nextSibling, s42) {
108964
+ for (this._$AP?.(false, true, s42); t32 !== this._$AB; ) {
108965
+ const s52 = i32(t32).nextSibling;
108966
+ i32(t32).remove(), t32 = s52;
108855
108967
  }
108856
108968
  }
108857
108969
  setConnected(t32) {
108858
108970
  void 0 === this._$AM && (this._$Cv = t32, this._$AP?.(t32));
108859
108971
  }
108860
108972
  };
108861
- var k2 = class {
108973
+ var H3 = class {
108862
108974
  get tagName() {
108863
108975
  return this.element.tagName;
108864
108976
  }
@@ -108866,53 +108978,53 @@ var k2 = class {
108866
108978
  return this._$AM._$AU;
108867
108979
  }
108868
108980
  constructor(t32, i52, s42, e52, h32) {
108869
- this.type = 1, this._$AH = E2, this._$AN = void 0, this.element = t32, this.name = i52, this._$AM = e52, this.options = h32, s42.length > 2 || "" !== s42[0] || "" !== s42[1] ? (this._$AH = Array(s42.length - 1).fill(new String()), this.strings = s42) : this._$AH = E2;
108981
+ this.type = 1, this._$AH = A2, this._$AN = void 0, this.element = t32, this.name = i52, this._$AM = e52, this.options = h32, s42.length > 2 || "" !== s42[0] || "" !== s42[1] ? (this._$AH = Array(s42.length - 1).fill(new String()), this.strings = s42) : this._$AH = A2;
108870
108982
  }
108871
108983
  _$AI(t32, i52 = this, s42, e52) {
108872
108984
  const h32 = this.strings;
108873
108985
  let o62 = false;
108874
- if (void 0 === h32) t32 = S22(this, t32, i52, 0), o62 = !c32(t32) || t32 !== this._$AH && t32 !== T2, o62 && (this._$AH = t32);
108986
+ if (void 0 === h32) t32 = M2(this, t32, i52, 0), o62 = !a22(t32) || t32 !== this._$AH && t32 !== E2, o62 && (this._$AH = t32);
108875
108987
  else {
108876
108988
  const e62 = t32;
108877
108989
  let n52, r52;
108878
- for (t32 = h32[0], n52 = 0; n52 < h32.length - 1; n52++) r52 = S22(this, e62[s42 + n52], i52, n52), r52 === T2 && (r52 = this._$AH[n52]), o62 ||= !c32(r52) || r52 !== this._$AH[n52], r52 === E2 ? t32 = E2 : t32 !== E2 && (t32 += (r52 ?? "") + h32[n52 + 1]), this._$AH[n52] = r52;
108990
+ for (t32 = h32[0], n52 = 0; n52 < h32.length - 1; n52++) r52 = M2(this, e62[s42 + n52], i52, n52), r52 === E2 && (r52 = this._$AH[n52]), o62 ||= !a22(r52) || r52 !== this._$AH[n52], r52 === A2 ? t32 = A2 : t32 !== A2 && (t32 += (r52 ?? "") + h32[n52 + 1]), this._$AH[n52] = r52;
108879
108991
  }
108880
108992
  o62 && !e52 && this.j(t32);
108881
108993
  }
108882
108994
  j(t32) {
108883
- t32 === E2 ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t32 ?? "");
108995
+ t32 === A2 ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t32 ?? "");
108884
108996
  }
108885
108997
  };
108886
- var H3 = class extends k2 {
108998
+ var I2 = class extends H3 {
108887
108999
  constructor() {
108888
109000
  super(...arguments), this.type = 3;
108889
109001
  }
108890
109002
  j(t32) {
108891
- this.element[this.name] = t32 === E2 ? void 0 : t32;
109003
+ this.element[this.name] = t32 === A2 ? void 0 : t32;
108892
109004
  }
108893
109005
  };
108894
- var I2 = class extends k2 {
109006
+ var L2 = class extends H3 {
108895
109007
  constructor() {
108896
109008
  super(...arguments), this.type = 4;
108897
109009
  }
108898
109010
  j(t32) {
108899
- this.element.toggleAttribute(this.name, !!t32 && t32 !== E2);
109011
+ this.element.toggleAttribute(this.name, !!t32 && t32 !== A2);
108900
109012
  }
108901
109013
  };
108902
- var L2 = class extends k2 {
109014
+ var z2 = class extends H3 {
108903
109015
  constructor(t32, i52, s42, e52, h32) {
108904
109016
  super(t32, i52, s42, e52, h32), this.type = 5;
108905
109017
  }
108906
109018
  _$AI(t32, i52 = this) {
108907
- if ((t32 = S22(this, t32, i52, 0) ?? E2) === T2) return;
108908
- const s42 = this._$AH, e52 = t32 === E2 && s42 !== E2 || t32.capture !== s42.capture || t32.once !== s42.once || t32.passive !== s42.passive, h32 = t32 !== E2 && (s42 === E2 || e52);
109019
+ if ((t32 = M2(this, t32, i52, 0) ?? A2) === E2) return;
109020
+ const s42 = this._$AH, e52 = t32 === A2 && s42 !== A2 || t32.capture !== s42.capture || t32.once !== s42.once || t32.passive !== s42.passive, h32 = t32 !== A2 && (s42 === A2 || e52);
108909
109021
  e52 && this.element.removeEventListener(this.name, this, s42), h32 && this.element.addEventListener(this.name, this, t32), this._$AH = t32;
108910
109022
  }
108911
109023
  handleEvent(t32) {
108912
109024
  "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t32) : this._$AH.handleEvent(t32);
108913
109025
  }
108914
109026
  };
108915
- var z2 = class {
109027
+ var Z2 = class {
108916
109028
  constructor(t32, i52, s42) {
108917
109029
  this.element = t32, this.type = 6, this._$AN = void 0, this._$AM = i52, this.options = s42;
108918
109030
  }
@@ -108920,17 +109032,17 @@ var z2 = class {
108920
109032
  return this._$AM._$AU;
108921
109033
  }
108922
109034
  _$AI(t32) {
108923
- S22(this, t32);
109035
+ M2(this, t32);
108924
109036
  }
108925
109037
  };
108926
- var j2 = t22.litHtmlPolyfillSupport;
108927
- j2?.(N2, R2), (t22.litHtmlVersions ??= []).push("3.3.0");
108928
- var B2 = (t32, i52, s42) => {
109038
+ var B2 = t22.litHtmlPolyfillSupport;
109039
+ B2?.(S22, k2), (t22.litHtmlVersions ??= []).push("3.3.2");
109040
+ var D2 = (t32, i52, s42) => {
108929
109041
  const e52 = s42?.renderBefore ?? i52;
108930
109042
  let h32 = e52._$litPart$;
108931
109043
  if (void 0 === h32) {
108932
109044
  const t42 = s42?.renderBefore ?? null;
108933
- e52._$litPart$ = h32 = new R2(i52.insertBefore(l22(), t42), t42, void 0, s42 ?? {});
109045
+ e52._$litPart$ = h32 = new k2(i52.insertBefore(c32(), t42), t42, void 0, s42 ?? {});
108934
109046
  }
108935
109047
  return h32._$AI(t32), h32;
108936
109048
  };
@@ -108945,7 +109057,7 @@ var i42 = class extends y3 {
108945
109057
  }
108946
109058
  update(t32) {
108947
109059
  const r52 = this.render();
108948
- this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t32), this._$Do = B2(r52, this.renderRoot, this.renderOptions);
109060
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t32), this._$Do = D2(r52, this.renderRoot, this.renderOptions);
108949
109061
  }
108950
109062
  connectedCallback() {
108951
109063
  super.connectedCallback(), this._$Do?.setConnected(true);
@@ -108954,13 +109066,13 @@ var i42 = class extends y3 {
108954
109066
  super.disconnectedCallback(), this._$Do?.setConnected(false);
108955
109067
  }
108956
109068
  render() {
108957
- return T2;
109069
+ return E2;
108958
109070
  }
108959
109071
  };
108960
109072
  i42._$litElement$ = true, i42["finalized"] = true, s32.litElementHydrateSupport?.({ LitElement: i42 });
108961
109073
  var o42 = s32.litElementPolyfillSupport;
108962
109074
  o42?.({ LitElement: i42 });
108963
- (s32.litElementVersions ??= []).push("4.2.0");
109075
+ (s32.litElementVersions ??= []).push("4.2.2");
108964
109076
  var o52 = { attribute: true, type: String, converter: u4, reflect: false, hasChanged: f4 };
108965
109077
  var r42 = (t32 = o52, e52, r52) => {
108966
109078
  const { kind: n52, metadata: i52 } = r52;
@@ -108969,7 +109081,7 @@ var r42 = (t32 = o52, e52, r52) => {
108969
109081
  const { name: o62 } = r52;
108970
109082
  return { set(r62) {
108971
109083
  const n62 = e52.get.call(this);
108972
- e52.set.call(this, r62), this.requestUpdate(o62, n62, t32);
109084
+ e52.set.call(this, r62), this.requestUpdate(o62, n62, t32, true, r62);
108973
109085
  }, init(e62) {
108974
109086
  return void 0 !== e62 && this.C(o62, void 0, t32, e62), e62;
108975
109087
  } };
@@ -108978,7 +109090,7 @@ var r42 = (t32 = o52, e52, r52) => {
108978
109090
  const { name: o62 } = r52;
108979
109091
  return function(r62) {
108980
109092
  const n62 = this[o62];
108981
- e52.call(this, r62), this.requestUpdate(o62, n62, t32);
109093
+ e52.call(this, r62), this.requestUpdate(o62, n62, t32, true, r62);
108982
109094
  };
108983
109095
  }
108984
109096
  throw Error("Unsupported decorator location: " + n52);
@@ -109104,13 +109216,19 @@ var LitElementWw = class extends (_a = ScopedElementsMixin2(i42), _contentEditab
109104
109216
  constructor() {
109105
109217
  super(...arguments);
109106
109218
  __runInitializers(_init, 5, this);
109107
- __publicField2(this, "options");
109108
- __publicField2(this, "actions", {});
109109
109219
  __publicField2(this, "localize");
109110
109220
  __privateAdd2(this, _contentEditable, __runInitializers(_init, 8, this)), __runInitializers(_init, 11, this);
109111
109221
  __privateAdd2(this, _lang, "");
109112
109222
  __publicField2(this, "_inTransaction", false);
109113
109223
  }
109224
+ /** Declare attributes as options. Used by WebWriter to auto-generate input fields to modify these attributes. As the name suggests, this is mostly suited to simple attributes (boolean, string, etc.). As this is a getter, you can dynamically change options depending on the state of the widget. */
109225
+ get dynamicOptions() {
109226
+ return {};
109227
+ }
109228
+ /** Declare methods as actions. Used by WebWriter to treat all DOM changes triggered by the method as a single change (as a transaction). As this is a getter, you can dynamically change actions depending on the state of the widget. */
109229
+ get dynamicActions() {
109230
+ return {};
109231
+ }
109114
109232
  get lang() {
109115
109233
  return (__privateGet2(this, _lang) || this.parentElement?.closest("[lang]")?.lang) ?? "";
109116
109234
  }
@@ -109315,11 +109433,19 @@ var DEFAULT_PARSERS = {
109315
109433
  stringFromBytes(bytes) {
109316
109434
  return bytes && decoder.decode(bytes);
109317
109435
  },
109436
+ jsonFromBytes(bytes) {
109437
+ return bytes && JSON.parse(decoder.decode(bytes));
109438
+ },
109318
109439
  geometryFromBytes(bytes) {
109319
109440
  return bytes && wkbToGeojson({ view: new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength), offset: 0 });
109320
109441
  },
109321
109442
  geographyFromBytes(bytes) {
109322
109443
  return bytes && wkbToGeojson({ view: new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength), offset: 0 });
109444
+ },
109445
+ uuidFromBytes(bytes) {
109446
+ if (!bytes) return void 0;
109447
+ const hex = Array.from(bytes, (b4) => b4.toString(16).padStart(2, "0")).join("");
109448
+ return hex.slice(0, 8) + "-" + hex.slice(8, 12) + "-" + hex.slice(12, 16) + "-" + hex.slice(16, 20) + "-" + hex.slice(20, 32);
109323
109449
  }
109324
109450
  };
109325
109451
  function convertWithDictionary(data, dictionary, encoding, columnDecoder) {
@@ -109337,8 +109463,13 @@ function convertWithDictionary(data, dictionary, encoding, columnDecoder) {
109337
109463
  }
109338
109464
  }
109339
109465
  function convert(data, columnDecoder) {
109340
- const { element, parsers, utf8 = true } = columnDecoder;
109466
+ const { element, parsers, utf8 = true, schemaPath } = columnDecoder;
109341
109467
  const { type, converted_type: ctype, logical_type: ltype } = element;
109468
+ const nullable = element.repetition_type !== "REQUIRED";
109469
+ const isVariant = schemaPath?.some((s6) => s6.element.logical_type?.type === "VARIANT");
109470
+ if (isVariant && type === "BYTE_ARRAY" && ctype !== "UTF8" && ltype?.type !== "STRING") {
109471
+ return data;
109472
+ }
109342
109473
  if (ctype === "DECIMAL") {
109343
109474
  const scale2 = element.scale || 0;
109344
109475
  const factor = 10 ** -scale2;
@@ -109365,7 +109496,7 @@ function convert(data, columnDecoder) {
109365
109496
  return Array.from(data).map((v3) => parsers.timestampFromMicroseconds(v3));
109366
109497
  }
109367
109498
  if (ctype === "JSON") {
109368
- return data.map((v3) => JSON.parse(decoder.decode(v3)));
109499
+ return data.map((v3) => parsers.jsonFromBytes(v3));
109369
109500
  }
109370
109501
  if (ctype === "BSON") {
109371
109502
  throw new Error("parquet bson not supported");
@@ -109379,23 +109510,24 @@ function convert(data, columnDecoder) {
109379
109510
  if (ltype?.type === "GEOGRAPHY") {
109380
109511
  return data.map((v3) => parsers.geographyFromBytes(v3));
109381
109512
  }
109513
+ if (ltype?.type === "UUID") {
109514
+ return data.map((v3) => parsers.uuidFromBytes(v3));
109515
+ }
109382
109516
  if (ctype === "UTF8" || ltype?.type === "STRING" || utf8 && type === "BYTE_ARRAY") {
109383
109517
  return data.map((v3) => parsers.stringFromBytes(v3));
109384
109518
  }
109385
109519
  if (ctype === "UINT_64" || ltype?.type === "INTEGER" && ltype.bitWidth === 64 && !ltype.isSigned) {
109386
- if (data instanceof BigInt64Array) {
109387
- return new BigUint64Array(data.buffer, data.byteOffset, data.length);
109388
- }
109389
- const arr = new BigUint64Array(data.length);
109390
- for (let i9 = 0; i9 < arr.length; i9++) arr[i9] = BigInt(data[i9]);
109520
+ if (data instanceof BigInt64Array) return new BigUint64Array(data.buffer, data.byteOffset, data.length);
109521
+ const arr = nullable ? new Array(data.length) : new BigUint64Array(data.length);
109522
+ for (let i9 = 0; i9 < arr.length; i9++) arr[i9] = data[i9];
109391
109523
  return arr;
109392
109524
  }
109393
109525
  if (ctype === "UINT_32" || ltype?.type === "INTEGER" && ltype.bitWidth === 32 && !ltype.isSigned) {
109394
- if (data instanceof Int32Array) {
109395
- return new Uint32Array(data.buffer, data.byteOffset, data.length);
109526
+ if (data instanceof Int32Array) return new Uint32Array(data.buffer, data.byteOffset, data.length);
109527
+ const arr = nullable ? new Array(data.length) : new Uint32Array(data.length);
109528
+ for (let i9 = 0; i9 < arr.length; i9++) {
109529
+ arr[i9] = data[i9] < 0 ? 4294967296 + data[i9] : data[i9];
109396
109530
  }
109397
- const arr = new Uint32Array(data.length);
109398
- for (let i9 = 0; i9 < arr.length; i9++) arr[i9] = data[i9];
109399
109531
  return arr;
109400
109532
  }
109401
109533
  if (ltype?.type === "FLOAT16") {
@@ -109531,87 +109663,70 @@ function isFlatColumn(schemaPath) {
109531
109663
  }
109532
109664
 
109533
109665
  // node_modules/hyparquet/src/thrift.js
109534
- var CompactType = {
109535
- STOP: 0,
109536
- TRUE: 1,
109537
- FALSE: 2,
109538
- BYTE: 3,
109539
- I16: 4,
109540
- I32: 5,
109541
- I64: 6,
109542
- DOUBLE: 7,
109543
- BINARY: 8,
109544
- LIST: 9,
109545
- SET: 10,
109546
- MAP: 11,
109547
- STRUCT: 12,
109548
- UUID: 13
109549
- };
109666
+ var STOP = 0;
109667
+ var TRUE = 1;
109668
+ var FALSE = 2;
109669
+ var BYTE = 3;
109670
+ var I16 = 4;
109671
+ var I32 = 5;
109672
+ var I64 = 6;
109673
+ var DOUBLE = 7;
109674
+ var BINARY = 8;
109675
+ var LIST = 9;
109676
+ var STRUCT = 12;
109550
109677
  function deserializeTCompactProtocol(reader) {
109551
- let lastFid = 0;
109552
109678
  const value = {};
109679
+ let fid = 0;
109553
109680
  while (reader.offset < reader.view.byteLength) {
109554
- const [type, fid, newLastFid] = readFieldBegin(reader, lastFid);
109555
- lastFid = newLastFid;
109556
- if (type === CompactType.STOP) {
109557
- break;
109558
- }
109681
+ const byte = reader.view.getUint8(reader.offset++);
109682
+ const type = byte & 15;
109683
+ if (type === STOP) break;
109684
+ const delta = byte >> 4;
109685
+ fid = delta ? fid + delta : readZigZag(reader);
109559
109686
  value[`field_${fid}`] = readElement(reader, type);
109560
109687
  }
109561
109688
  return value;
109562
109689
  }
109563
109690
  function readElement(reader, type) {
109564
109691
  switch (type) {
109565
- case CompactType.TRUE:
109692
+ case TRUE:
109566
109693
  return true;
109567
- case CompactType.FALSE:
109694
+ case FALSE:
109568
109695
  return false;
109569
- case CompactType.BYTE:
109696
+ case BYTE:
109570
109697
  return reader.view.getInt8(reader.offset++);
109571
- case CompactType.I16:
109572
- case CompactType.I32:
109698
+ case I16:
109699
+ case I32:
109573
109700
  return readZigZag(reader);
109574
- case CompactType.I64:
109701
+ case I64:
109575
109702
  return readZigZagBigInt(reader);
109576
- case CompactType.DOUBLE: {
109703
+ case DOUBLE: {
109577
109704
  const value = reader.view.getFloat64(reader.offset, true);
109578
109705
  reader.offset += 8;
109579
109706
  return value;
109580
109707
  }
109581
- case CompactType.BINARY: {
109708
+ case BINARY: {
109582
109709
  const stringLength = readVarInt(reader);
109583
109710
  const strBytes = new Uint8Array(reader.view.buffer, reader.view.byteOffset + reader.offset, stringLength);
109584
109711
  reader.offset += stringLength;
109585
109712
  return strBytes;
109586
109713
  }
109587
- case CompactType.LIST: {
109714
+ case LIST: {
109588
109715
  const byte = reader.view.getUint8(reader.offset++);
109589
109716
  const elemType = byte & 15;
109590
109717
  let listSize = byte >> 4;
109591
109718
  if (listSize === 15) {
109592
109719
  listSize = readVarInt(reader);
109593
109720
  }
109594
- const boolType = elemType === CompactType.TRUE || elemType === CompactType.FALSE;
109721
+ const boolType = elemType === TRUE || elemType === FALSE;
109595
109722
  const values = new Array(listSize);
109596
109723
  for (let i9 = 0; i9 < listSize; i9++) {
109597
- values[i9] = boolType ? readElement(reader, CompactType.BYTE) === 1 : readElement(reader, elemType);
109724
+ values[i9] = boolType ? readElement(reader, BYTE) === 1 : readElement(reader, elemType);
109598
109725
  }
109599
109726
  return values;
109600
109727
  }
109601
- case CompactType.STRUCT: {
109602
- const structValues = {};
109603
- let lastFid = 0;
109604
- while (true) {
109605
- const [fieldType, fid, newLastFid] = readFieldBegin(reader, lastFid);
109606
- lastFid = newLastFid;
109607
- if (fieldType === CompactType.STOP) {
109608
- break;
109609
- }
109610
- structValues[`field_${fid}`] = readElement(reader, fieldType);
109611
- }
109612
- return structValues;
109613
- }
109614
- // TODO: MAP, SET, UUID
109728
+ case STRUCT:
109729
+ return deserializeTCompactProtocol(reader);
109615
109730
  default:
109616
109731
  throw new Error(`thrift unhandled type: ${type}`);
109617
109732
  }
@@ -109648,16 +109763,6 @@ function readZigZagBigInt(reader) {
109648
109763
  const zigzag = readVarBigInt(reader);
109649
109764
  return zigzag >> 1n ^ -(zigzag & 1n);
109650
109765
  }
109651
- function readFieldBegin(reader, lastFid) {
109652
- const byte = reader.view.getUint8(reader.offset++);
109653
- const type = byte & 15;
109654
- if (type === CompactType.STOP) {
109655
- return [0, 0, lastFid];
109656
- }
109657
- const delta = byte >> 4;
109658
- const fid = delta ? lastFid + delta : readZigZag(reader);
109659
- return [type, fid, fid];
109660
- }
109661
109766
 
109662
109767
  // node_modules/hyparquet/src/geoparquet.js
109663
109768
  function markGeoColumns(schema, key_value_metadata) {
@@ -109665,23 +109770,20 @@ function markGeoColumns(schema, key_value_metadata) {
109665
109770
  const geo = key_value_metadata?.find(({ key }) => key === "geo")?.value;
109666
109771
  const decodedColumns = (geo && JSON.parse(geo)?.columns) ?? {};
109667
109772
  for (const [name, column] of Object.entries(decodedColumns)) {
109668
- if (column.encoding !== "WKB") {
109669
- continue;
109670
- }
109773
+ if (column.encoding !== "WKB") continue;
109671
109774
  const type = column.edges === "spherical" ? "GEOGRAPHY" : "GEOMETRY";
109672
109775
  const id3 = column.crs?.id ?? column.crs?.ids?.[0];
109673
109776
  const crs = id3 ? `${id3.authority}:${id3.code.toString()}` : void 0;
109674
109777
  columns.set(name, { type, crs });
109675
109778
  }
109676
109779
  for (let i9 = 1; i9 < schema.length; i9++) {
109677
- const element = schema[i9];
109678
- const { logical_type, name, num_children, repetition_type, type } = element;
109780
+ const { logical_type, name, num_children, type } = schema[i9];
109679
109781
  if (num_children) {
109680
109782
  i9 += num_children;
109681
109783
  continue;
109682
109784
  }
109683
- if (type === "BYTE_ARRAY" && logical_type === void 0 && repetition_type !== "REPEATED") {
109684
- element.logical_type = columns.get(name);
109785
+ if (type === "BYTE_ARRAY" && !logical_type) {
109786
+ schema[i9].logical_type = columns.get(name);
109685
109787
  }
109686
109788
  }
109687
109789
  }
@@ -109916,6 +110018,7 @@ function convertMetadata(value, schema, parsers) {
109916
110018
  if (type === "INT64" && view.byteLength === 8) return view.getBigInt64(0, true);
109917
110019
  if (converted_type === "DECIMAL") return parseDecimal(value) * 10 ** -(schema.scale || 0);
109918
110020
  if (logical_type?.type === "FLOAT16") return parseFloat16(value);
110021
+ if (logical_type?.type === "UUID") return parsers.uuidFromBytes(value);
109919
110022
  if (type === "FIXED_LEN_BYTE_ARRAY") return value;
109920
110023
  return value;
109921
110024
  }
@@ -109924,16 +110027,216 @@ function convertMetadata(value, schema, parsers) {
109924
110027
  function readOffsetIndex(reader) {
109925
110028
  const thrift = deserializeTCompactProtocol(reader);
109926
110029
  return {
109927
- page_locations: thrift.field_1.map(pageLocation),
110030
+ // @ts-ignore
110031
+ page_locations: thrift.field_1.map((loc) => ({
110032
+ offset: loc.field_1,
110033
+ compressed_page_size: loc.field_2,
110034
+ first_row_index: loc.field_3
110035
+ })),
109928
110036
  unencoded_byte_array_data_bytes: thrift.field_2
109929
110037
  };
109930
110038
  }
109931
- function pageLocation(loc) {
109932
- return {
109933
- offset: loc.field_1,
109934
- compressed_page_size: loc.field_2,
109935
- first_row_index: loc.field_3
109936
- };
110039
+
110040
+ // node_modules/hyparquet/src/xxhash.js
110041
+ var MASK = 0xffffffffffffffffn;
110042
+ var PRIME1 = 0x9e3779b185ebca87n;
110043
+ var PRIME2 = 0xc2b2ae3d27d4eb4fn;
110044
+ var PRIME3 = 0x165667b19e3779f9n;
110045
+ var PRIME4 = 0x85ebca77c2b2ae63n;
110046
+ var PRIME5 = 0x27d4eb2f165667c5n;
110047
+ function rotl64(x3, r11) {
110048
+ return (x3 << r11 | x3 >> 64n - r11) & MASK;
110049
+ }
110050
+ function round2(acc, val) {
110051
+ acc = acc + val * PRIME2 & MASK;
110052
+ acc = rotl64(acc, 31n);
110053
+ return acc * PRIME1 & MASK;
110054
+ }
110055
+ function mergeRound(acc, val) {
110056
+ acc ^= round2(0n, val);
110057
+ return acc * PRIME1 + PRIME4 & MASK;
110058
+ }
110059
+ function xxhash64(input2, seed = 0n) {
110060
+ const view = new DataView(input2.buffer, input2.byteOffset, input2.byteLength);
110061
+ const len = input2.byteLength;
110062
+ let offset3 = 0;
110063
+ let h64;
110064
+ if (len >= 32) {
110065
+ let v1 = seed + PRIME1 + PRIME2 & MASK;
110066
+ let v22 = seed + PRIME2 & MASK;
110067
+ let v3 = seed;
110068
+ let v4 = seed - PRIME1 & MASK;
110069
+ while (offset3 + 32 <= len) {
110070
+ v1 = round2(v1, view.getBigUint64(offset3, true));
110071
+ offset3 += 8;
110072
+ v22 = round2(v22, view.getBigUint64(offset3, true));
110073
+ offset3 += 8;
110074
+ v3 = round2(v3, view.getBigUint64(offset3, true));
110075
+ offset3 += 8;
110076
+ v4 = round2(v4, view.getBigUint64(offset3, true));
110077
+ offset3 += 8;
110078
+ }
110079
+ h64 = rotl64(v1, 1n) + rotl64(v22, 7n) + rotl64(v3, 12n) + rotl64(v4, 18n) & MASK;
110080
+ h64 = mergeRound(h64, v1);
110081
+ h64 = mergeRound(h64, v22);
110082
+ h64 = mergeRound(h64, v3);
110083
+ h64 = mergeRound(h64, v4);
110084
+ } else {
110085
+ h64 = seed + PRIME5 & MASK;
110086
+ }
110087
+ h64 = h64 + BigInt(len) & MASK;
110088
+ while (offset3 + 8 <= len) {
110089
+ h64 ^= round2(0n, view.getBigUint64(offset3, true));
110090
+ h64 = rotl64(h64, 27n) * PRIME1 + PRIME4 & MASK;
110091
+ offset3 += 8;
110092
+ }
110093
+ if (offset3 + 4 <= len) {
110094
+ h64 ^= BigInt(view.getUint32(offset3, true)) * PRIME1 & MASK;
110095
+ h64 = rotl64(h64, 23n) * PRIME2 + PRIME3 & MASK;
110096
+ offset3 += 4;
110097
+ }
110098
+ while (offset3 < len) {
110099
+ h64 ^= BigInt(view.getUint8(offset3)) * PRIME5 & MASK;
110100
+ h64 = rotl64(h64, 11n) * PRIME1 & MASK;
110101
+ offset3 += 1;
110102
+ }
110103
+ h64 ^= h64 >> 33n;
110104
+ h64 = h64 * PRIME2 & MASK;
110105
+ h64 ^= h64 >> 29n;
110106
+ h64 = h64 * PRIME3 & MASK;
110107
+ h64 ^= h64 >> 32n;
110108
+ return h64;
110109
+ }
110110
+
110111
+ // node_modules/hyparquet/src/bloom.js
110112
+ var textEncoder = new TextEncoder();
110113
+ var SALT = new Uint32Array([
110114
+ 1203114875,
110115
+ 1150766481,
110116
+ 2284105051,
110117
+ 2729912477,
110118
+ 1884591559,
110119
+ 770785867,
110120
+ 2667333959,
110121
+ 1550580529
110122
+ ]);
110123
+ function blockIndex(hash, numBlocks) {
110124
+ return Number((hash >> 32n) * BigInt(numBlocks) >> 32n);
110125
+ }
110126
+ function blockMask(hash) {
110127
+ const m4 = new Uint32Array(8);
110128
+ const low = Number(hash & 0xffffffffn) | 0;
110129
+ for (let i9 = 0; i9 < 8; i9++) {
110130
+ m4[i9] = 1 << (Math.imul(low, SALT[i9]) >>> 27);
110131
+ }
110132
+ return m4;
110133
+ }
110134
+ function sbbfContains(blocks, hash) {
110135
+ const offset3 = blockIndex(hash, blocks.length >> 3) << 3;
110136
+ const m4 = blockMask(hash);
110137
+ for (let i9 = 0; i9 < 8; i9++) {
110138
+ if ((blocks[offset3 + i9] & m4[i9]) === 0) return false;
110139
+ }
110140
+ return true;
110141
+ }
110142
+ function readBloomFilter(reader) {
110143
+ const header = deserializeTCompactProtocol(reader);
110144
+ const numBytes = header.field_1;
110145
+ if (typeof numBytes !== "number" || numBytes <= 0 || numBytes % 32 !== 0) return void 0;
110146
+ if (!header.field_2?.field_1) return void 0;
110147
+ if (!header.field_3?.field_1) return void 0;
110148
+ if (!header.field_4?.field_1) return void 0;
110149
+ const { view, offset: offset3 } = reader;
110150
+ if (offset3 + numBytes > view.byteLength) {
110151
+ throw new Error(`parquet bloom filter truncated: need ${numBytes} bytes, have ${view.byteLength - offset3}`);
110152
+ }
110153
+ const blocks = new Uint32Array(numBytes >> 2);
110154
+ for (let i9 = 0; i9 < blocks.length; i9++) {
110155
+ blocks[i9] = view.getUint32(offset3 + i9 * 4, true);
110156
+ }
110157
+ reader.offset = offset3 + numBytes;
110158
+ return { numBytes, blocks };
110159
+ }
110160
+ function hashParquetValue(value, element) {
110161
+ if (value === null || value === void 0) return void 0;
110162
+ const { type, converted_type, logical_type } = element;
110163
+ if (type === "BOOLEAN") {
110164
+ if (typeof value !== "boolean") return void 0;
110165
+ return xxhash64(new Uint8Array([value ? 1 : 0]));
110166
+ }
110167
+ if (type === "FLOAT") {
110168
+ if (typeof value !== "number") return void 0;
110169
+ const buf = new ArrayBuffer(4);
110170
+ new DataView(buf).setFloat32(0, value, true);
110171
+ return xxhash64(new Uint8Array(buf));
110172
+ }
110173
+ if (type === "DOUBLE") {
110174
+ if (typeof value !== "number") return void 0;
110175
+ const buf = new ArrayBuffer(8);
110176
+ new DataView(buf).setFloat64(0, value, true);
110177
+ return xxhash64(new Uint8Array(buf));
110178
+ }
110179
+ if (type === "INT32") {
110180
+ if (converted_type === "DATE" || converted_type === "DECIMAL" || converted_type === "TIME_MILLIS") return void 0;
110181
+ if (logical_type?.type === "DATE" || logical_type?.type === "TIME" || logical_type?.type === "DECIMAL") return void 0;
110182
+ if (typeof value !== "number" || !Number.isInteger(value)) return void 0;
110183
+ const buf = new ArrayBuffer(4);
110184
+ new DataView(buf).setInt32(0, value | 0, true);
110185
+ return xxhash64(new Uint8Array(buf));
110186
+ }
110187
+ if (type === "INT64") {
110188
+ if (converted_type === "TIMESTAMP_MILLIS" || converted_type === "TIMESTAMP_MICROS") return void 0;
110189
+ if (converted_type === "TIME_MICROS" || converted_type === "DECIMAL") return void 0;
110190
+ if (logical_type?.type === "TIMESTAMP" || logical_type?.type === "TIME" || logical_type?.type === "DECIMAL") return void 0;
110191
+ let bigValue;
110192
+ if (typeof value === "bigint") bigValue = value;
110193
+ else if (typeof value === "number" && Number.isSafeInteger(value)) bigValue = BigInt(value);
110194
+ else return void 0;
110195
+ const buf = new ArrayBuffer(8);
110196
+ new DataView(buf).setBigUint64(0, BigInt.asUintN(64, bigValue), true);
110197
+ return xxhash64(new Uint8Array(buf));
110198
+ }
110199
+ if (type === "BYTE_ARRAY") {
110200
+ if (converted_type === "JSON" || converted_type === "BSON" || converted_type === "DECIMAL") return void 0;
110201
+ if (logical_type?.type === "JSON" || logical_type?.type === "BSON" || logical_type?.type === "VARIANT") return void 0;
110202
+ if (logical_type?.type === "GEOMETRY" || logical_type?.type === "GEOGRAPHY") return void 0;
110203
+ if (typeof value === "string") return xxhash64(textEncoder.encode(value));
110204
+ if (value instanceof Uint8Array) return xxhash64(value);
110205
+ return void 0;
110206
+ }
110207
+ if (type === "FIXED_LEN_BYTE_ARRAY") {
110208
+ if (converted_type === "DECIMAL" || converted_type === "INTERVAL") return void 0;
110209
+ if (logical_type?.type === "DECIMAL" || logical_type?.type === "UUID" || logical_type?.type === "FLOAT16") return void 0;
110210
+ if (logical_type?.type === "GEOMETRY" || logical_type?.type === "GEOGRAPHY") return void 0;
110211
+ if (value instanceof Uint8Array) return xxhash64(value);
110212
+ return void 0;
110213
+ }
110214
+ return void 0;
110215
+ }
110216
+ function bloomEligibleColumns(filter) {
110217
+ const out = /* @__PURE__ */ new Set();
110218
+ walkBloomEligible(filter, out);
110219
+ return out;
110220
+ }
110221
+ function walkBloomEligible(filter, out) {
110222
+ if (!filter) return;
110223
+ if ("$and" in filter && Array.isArray(filter.$and)) {
110224
+ for (const sub4 of filter.$and) walkBloomEligible(sub4, out);
110225
+ return;
110226
+ }
110227
+ if ("$or" in filter && Array.isArray(filter.$or)) {
110228
+ for (const sub4 of filter.$or) walkBloomEligible(sub4, out);
110229
+ return;
110230
+ }
110231
+ if ("$nor" in filter) return;
110232
+ for (const [field, condition] of Object.entries(filter)) {
110233
+ if (field.startsWith("$")) continue;
110234
+ if (typeof condition === "object" && condition !== null && !Array.isArray(condition)) {
110235
+ if ("$eq" in condition || "$in" in condition) out.add(field);
110236
+ } else {
110237
+ out.add(field);
110238
+ }
110239
+ }
109937
110240
  }
109938
110241
 
109939
110242
  // node_modules/hyparquet/src/utils.js
@@ -109945,8 +110248,14 @@ function concat(aaa, bbb) {
109945
110248
  }
109946
110249
  function equals(a6, b4, strict = true) {
109947
110250
  if (strict ? a6 === b4 : a6 == b4) return true;
109948
- if (a6 instanceof Uint8Array && b4 instanceof Uint8Array) return equals(Array.from(a6), Array.from(b4), strict);
109949
- if (!a6 || !b4 || typeof a6 !== typeof b4) return false;
110251
+ if (!a6 || !b4 || typeof a6 !== "object" || typeof b4 !== "object") return false;
110252
+ if (a6 instanceof Uint8Array && b4 instanceof Uint8Array) {
110253
+ if (a6.length !== b4.length) return false;
110254
+ for (let i9 = 0; i9 < a6.length; i9++) {
110255
+ if (a6[i9] !== b4[i9]) return false;
110256
+ }
110257
+ return true;
110258
+ }
109950
110259
  if (Array.isArray(a6) && Array.isArray(b4)) {
109951
110260
  if (a6.length !== b4.length) return false;
109952
110261
  for (let i9 = 0; i9 < a6.length; i9++) {
@@ -109954,7 +110263,6 @@ function equals(a6, b4, strict = true) {
109954
110263
  }
109955
110264
  return true;
109956
110265
  }
109957
- if (typeof a6 !== "object") return false;
109958
110266
  const aKeys = Object.keys(a6);
109959
110267
  if (aKeys.length !== Object.keys(b4).length) return false;
109960
110268
  for (const k3 of aKeys) {
@@ -109962,7 +110270,7 @@ function equals(a6, b4, strict = true) {
109962
110270
  }
109963
110271
  return true;
109964
110272
  }
109965
- async function byteLengthFromUrlUsingFetch(url, requestInit = {}, fetchFn = globalThis.fetch) {
110273
+ async function byteLengthFromUrlUsingGet(url, requestInit = {}, fetchFn = globalThis.fetch) {
109966
110274
  const controller = new AbortController();
109967
110275
  const headers = new Headers(requestInit.headers);
109968
110276
  headers.set("Range", "bytes=0-0");
@@ -109990,12 +110298,12 @@ async function byteLengthFromUrl(url, requestInit, customFetch) {
109990
110298
  const fetch4 = customFetch ?? globalThis.fetch;
109991
110299
  const res = await fetch4(url, { ...requestInit, method: "HEAD" });
109992
110300
  if (res.status === 403) {
109993
- return byteLengthFromUrlUsingFetch(url, requestInit, fetch4);
110301
+ return byteLengthFromUrlUsingGet(url, requestInit, fetch4);
109994
110302
  }
109995
110303
  if (!res.ok) throw new Error(`fetch head failed ${res.status}`);
109996
110304
  const length = res.headers.get("Content-Length");
109997
110305
  if (!length) {
109998
- return byteLengthFromUrlUsingFetch(url, requestInit, fetch4);
110306
+ return byteLengthFromUrlUsingGet(url, requestInit, fetch4);
109999
110307
  }
110000
110308
  return parseInt(length);
110001
110309
  }
@@ -110048,9 +110356,9 @@ function columnsNeededForFilter(filter) {
110048
110356
  } else if ("$nor" in filter && Array.isArray(filter.$nor)) {
110049
110357
  columns.push(...filter.$nor.flatMap(columnsNeededForFilter));
110050
110358
  } else {
110051
- columns.push(...Object.keys(filter));
110359
+ columns.push(...Object.keys(filter).map((key) => key.split(".")[0]));
110052
110360
  }
110053
- return columns;
110361
+ return [...new Set(columns)];
110054
110362
  }
110055
110363
  function matchFilter(record, filter, strict = true) {
110056
110364
  if ("$and" in filter && Array.isArray(filter.$and)) {
@@ -110063,7 +110371,7 @@ function matchFilter(record, filter, strict = true) {
110063
110371
  return !filter.$nor.some((subQuery) => matchFilter(record, subQuery, strict));
110064
110372
  }
110065
110373
  return Object.entries(filter).every(([field, condition]) => {
110066
- const value = record[field];
110374
+ const value = resolve(record, field);
110067
110375
  if (typeof condition !== "object" || condition === null || Array.isArray(condition)) {
110068
110376
  return equals(value, condition, strict);
110069
110377
  }
@@ -110081,13 +110389,13 @@ function matchFilter(record, filter, strict = true) {
110081
110389
  });
110082
110390
  });
110083
110391
  }
110084
- function canSkipRowGroup({ rowGroup, physicalColumns, filter, strict = true }) {
110392
+ function canSkipRowGroup({ rowGroup, physicalColumns, filter, strict = true, bloomFilters, schemaElements }) {
110085
110393
  if (!filter) return false;
110086
110394
  if ("$and" in filter && Array.isArray(filter.$and)) {
110087
- return filter.$and.some((subFilter) => canSkipRowGroup({ rowGroup, physicalColumns, filter: subFilter, strict }));
110395
+ return filter.$and.some((subFilter) => canSkipRowGroup({ rowGroup, physicalColumns, filter: subFilter, strict, bloomFilters, schemaElements }));
110088
110396
  }
110089
110397
  if ("$or" in filter && Array.isArray(filter.$or)) {
110090
- return filter.$or.every((subFilter) => canSkipRowGroup({ rowGroup, physicalColumns, filter: subFilter, strict }));
110398
+ return filter.$or.every((subFilter) => canSkipRowGroup({ rowGroup, physicalColumns, filter: subFilter, strict, bloomFilters, schemaElements }));
110091
110399
  }
110092
110400
  if ("$nor" in filter && Array.isArray(filter.$nor)) {
110093
110401
  return false;
@@ -110096,38 +110404,67 @@ function canSkipRowGroup({ rowGroup, physicalColumns, filter, strict = true }) {
110096
110404
  const columnIndex = physicalColumns.indexOf(field);
110097
110405
  if (columnIndex === -1) continue;
110098
110406
  const stats = rowGroup.columns[columnIndex].meta_data?.statistics;
110099
- if (!stats) continue;
110100
- const { min: min6, max: max6, min_value, max_value } = stats;
110407
+ const { min: min6, max: max6, min_value, max_value } = stats || {};
110101
110408
  const minVal = min_value !== void 0 ? min_value : min6;
110102
110409
  const maxVal = max_value !== void 0 ? max_value : max6;
110103
- if (minVal === void 0 || maxVal === void 0) continue;
110410
+ const haveStats = minVal !== void 0 && maxVal !== void 0;
110411
+ const bloom = bloomFilters?.[field];
110412
+ const element = schemaElements?.[field];
110104
110413
  for (const [operator, target] of Object.entries(condition || {})) {
110105
- if (operator === "$gt" && maxVal <= target) return true;
110106
- if (operator === "$gte" && maxVal < target) return true;
110107
- if (operator === "$lt" && minVal >= target) return true;
110108
- if (operator === "$lte" && minVal > target) return true;
110109
- if (operator === "$eq" && (target < minVal || target > maxVal)) return true;
110110
- if (operator === "$ne" && equals(minVal, maxVal, strict) && equals(minVal, target, strict)) return true;
110111
- if (operator === "$in" && Array.isArray(target) && target.every((v3) => v3 < minVal || v3 > maxVal)) return true;
110112
- if (operator === "$nin" && Array.isArray(target) && equals(minVal, maxVal, strict) && target.includes(minVal)) return true;
110414
+ if (haveStats) {
110415
+ if (operator === "$gt" && maxVal <= target) return true;
110416
+ if (operator === "$gte" && maxVal < target) return true;
110417
+ if (operator === "$lt" && minVal >= target) return true;
110418
+ if (operator === "$lte" && minVal > target) return true;
110419
+ if (operator === "$eq" && (target < minVal || target > maxVal)) return true;
110420
+ if (operator === "$ne" && equals(minVal, maxVal, strict) && equals(minVal, target, strict)) return true;
110421
+ if (operator === "$in" && Array.isArray(target) && target.every((v3) => v3 < minVal || v3 > maxVal)) return true;
110422
+ if (operator === "$nin" && Array.isArray(target) && equals(minVal, maxVal, strict) && target.includes(minVal)) return true;
110423
+ }
110424
+ if (bloom && element) {
110425
+ if (operator === "$eq") {
110426
+ const hash = hashParquetValue(target, element);
110427
+ if (hash !== void 0 && !sbbfContains(bloom.blocks, hash)) return true;
110428
+ }
110429
+ if (operator === "$in" && Array.isArray(target) && target.length > 0) {
110430
+ let allAbsent = true;
110431
+ for (const v3 of target) {
110432
+ const h6 = hashParquetValue(v3, element);
110433
+ if (h6 === void 0 || sbbfContains(bloom.blocks, h6)) {
110434
+ allAbsent = false;
110435
+ break;
110436
+ }
110437
+ }
110438
+ if (allAbsent) return true;
110439
+ }
110440
+ }
110113
110441
  }
110114
110442
  }
110115
110443
  return false;
110116
110444
  }
110445
+ function resolve(record, path) {
110446
+ let value = record;
110447
+ for (const part of path.split(".")) {
110448
+ value = value?.[part];
110449
+ }
110450
+ return value;
110451
+ }
110117
110452
 
110118
110453
  // node_modules/hyparquet/src/plan.js
110119
110454
  var runLimit = 1 << 21;
110120
- function parquetPlan({ metadata, rowStart = 0, rowEnd = Infinity, columns, filter, filterStrict = true, useOffsetIndex = false }) {
110455
+ function parquetPlan({ metadata, rowStart = 0, rowEnd = Infinity, columns, filter, filterStrict = true, useOffsetIndex = false, bloomFiltersByGroup, schemaElements }) {
110121
110456
  if (!metadata) throw new Error("parquetPlan requires metadata");
110122
110457
  const groups = [];
110123
110458
  const fetches = [];
110124
110459
  const indexes = [];
110125
110460
  const physicalColumns = getPhysicalColumns(parquetSchema(metadata));
110126
110461
  let groupStart = 0;
110462
+ let rgIdx = 0;
110127
110463
  for (const rowGroup of metadata.row_groups) {
110128
110464
  const groupRows = Number(rowGroup.num_rows);
110129
110465
  const groupEnd = groupStart + groupRows;
110130
- if (groupRows > 0 && groupEnd > rowStart && groupStart < rowEnd && !canSkipRowGroup({ rowGroup, physicalColumns, filter, strict: filterStrict })) {
110466
+ const bloomFilters = bloomFiltersByGroup?.[rgIdx];
110467
+ if (groupRows > 0 && groupEnd > rowStart && groupStart < rowEnd && !canSkipRowGroup({ rowGroup, physicalColumns, filter, strict: filterStrict, bloomFilters, schemaElements })) {
110131
110468
  const chunks = [];
110132
110469
  let groupStartByte = Infinity;
110133
110470
  let groupEndByte = -Infinity;
@@ -110141,7 +110478,7 @@ function parquetPlan({ metadata, rowStart = 0, rowEnd = Infinity, columns, filte
110141
110478
  const endByte = Number(columnOffset + meta.total_compressed_size);
110142
110479
  if (startByte < groupStartByte) groupStartByte = startByte;
110143
110480
  if (endByte > groupEndByte) groupEndByte = endByte;
110144
- if (useOffsetIndex && chunk.offset_index_offset && chunk.offset_index_length) {
110481
+ if (useOffsetIndex && chunk.offset_index_offset && chunk.offset_index_length && (rowStart > groupStart || rowEnd < groupEnd)) {
110145
110482
  const offsetIndexStart = Number(chunk.offset_index_offset);
110146
110483
  chunks.push({
110147
110484
  columnMetadata: meta,
@@ -110149,7 +110486,7 @@ function parquetPlan({ metadata, rowStart = 0, rowEnd = Infinity, columns, filte
110149
110486
  startByte: offsetIndexStart,
110150
110487
  endByte: offsetIndexStart + chunk.offset_index_length
110151
110488
  },
110152
- bounds: { startByte, endByte }
110489
+ range: { startByte, endByte }
110153
110490
  });
110154
110491
  } else {
110155
110492
  chunks.push({
@@ -110181,11 +110518,40 @@ function parquetPlan({ metadata, rowStart = 0, rowEnd = Infinity, columns, filte
110181
110518
  if (run) fetches.push(run);
110182
110519
  }
110183
110520
  groupStart = groupEnd;
110521
+ rgIdx++;
110184
110522
  }
110185
110523
  if (!isFinite(rowEnd)) rowEnd = groupStart;
110186
110524
  fetches.push(...indexes);
110187
110525
  return { metadata, rowStart, rowEnd, columns, fetches, groups };
110188
110526
  }
110527
+ async function prefetchBloomFilters({ file, metadata, filter, filterStrict = true }) {
110528
+ const result = metadata.row_groups.map(() => (
110529
+ /** @type {Record<string, BloomFilter>} */
110530
+ {}
110531
+ ));
110532
+ const eligibleCols = bloomEligibleColumns(filter);
110533
+ if (eligibleCols.size === 0) return result;
110534
+ const physicalColumns = getPhysicalColumns(parquetSchema(metadata));
110535
+ const tasks = [];
110536
+ metadata.row_groups.forEach((rowGroup, rgIdx) => {
110537
+ if (canSkipRowGroup({ rowGroup, physicalColumns, filter, strict: filterStrict })) return;
110538
+ for (const colName of eligibleCols) {
110539
+ const columnIdx = physicalColumns.indexOf(colName);
110540
+ if (columnIdx === -1) continue;
110541
+ const meta = rowGroup.columns[columnIdx]?.meta_data;
110542
+ if (!meta?.bloom_filter_offset || !meta.bloom_filter_length) continue;
110543
+ const start = Number(meta.bloom_filter_offset);
110544
+ const end = start + meta.bloom_filter_length;
110545
+ tasks.push((async () => {
110546
+ const buffer2 = await file.slice(start, end);
110547
+ const bloom = readBloomFilter({ view: new DataView(buffer2), offset: 0 });
110548
+ if (bloom) result[rgIdx][colName] = bloom;
110549
+ })());
110550
+ }
110551
+ });
110552
+ if (tasks.length) await Promise.all(tasks);
110553
+ return result;
110554
+ }
110189
110555
  function prefetchAsyncBuffer(file, { fetches }) {
110190
110556
  const promises = fetches.map(({ startByte, endByte }) => file.slice(startByte, endByte));
110191
110557
  return {
@@ -110210,11 +110576,270 @@ function prefetchAsyncBuffer(file, { fetches }) {
110210
110576
  };
110211
110577
  }
110212
110578
 
110579
+ // node_modules/hyparquet/src/variant.js
110580
+ var decoder3 = new TextDecoder();
110581
+ var metadataCache = /* @__PURE__ */ new WeakMap();
110582
+ function decodeVariantColumn(value, parsers = DEFAULT_PARSERS) {
110583
+ if (Array.isArray(value)) {
110584
+ return value.map((entry) => decodeVariantColumn(entry, parsers));
110585
+ }
110586
+ if (typeof value !== "object") return value;
110587
+ if ("metadata" in value) {
110588
+ const metadata = parseVariantMetadata(value.metadata);
110589
+ const shreddedFields = value.typed_value && decodeTypedValue(value.typed_value, metadata, parsers);
110590
+ const binaryValue = value.value && readVariant(makeReader(value.value), metadata, parsers);
110591
+ if (shreddedFields && binaryValue) {
110592
+ return { ...binaryValue, ...shreddedFields };
110593
+ }
110594
+ return shreddedFields ?? binaryValue;
110595
+ }
110596
+ return value;
110597
+ }
110598
+ function decodeTypedValue(typedValue, metadata, parsers) {
110599
+ if (typedValue instanceof Date) return typedValue;
110600
+ if (typedValue && typeof typedValue === "object" && !Array.isArray(typedValue) && !(typedValue instanceof Uint8Array)) {
110601
+ if ("typed_value" in typedValue && typedValue.typed_value !== null && typedValue.typed_value !== void 0) {
110602
+ return decodeTypedValue(typedValue.typed_value, metadata, parsers);
110603
+ }
110604
+ if ("value" in typedValue && typedValue.value instanceof Uint8Array) {
110605
+ return readVariant(makeReader(typedValue.value), metadata, parsers);
110606
+ }
110607
+ if ("typed_value" in typedValue || "value" in typedValue) {
110608
+ return null;
110609
+ }
110610
+ const result = {};
110611
+ for (const [key, field] of Object.entries(typedValue)) {
110612
+ if (!metadata.dictionary.includes(key)) continue;
110613
+ result[key] = decodeTypedValue(field, metadata, parsers);
110614
+ }
110615
+ return result;
110616
+ }
110617
+ if (typedValue instanceof Uint8Array) {
110618
+ return readVariant(makeReader(typedValue), metadata, parsers);
110619
+ }
110620
+ if (Array.isArray(typedValue)) {
110621
+ return typedValue.map((element) => decodeTypedValue(element, metadata, parsers));
110622
+ }
110623
+ return typedValue;
110624
+ }
110625
+ function makeReader(bytes) {
110626
+ return { view: new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength), offset: 0 };
110627
+ }
110628
+ function parseVariantMetadata(bytes) {
110629
+ let bufferCache = metadataCache.get(bytes.buffer);
110630
+ if (!bufferCache) {
110631
+ bufferCache = /* @__PURE__ */ new Map();
110632
+ metadataCache.set(bytes.buffer, bufferCache);
110633
+ }
110634
+ const key = `${bytes.byteOffset}:${bytes.byteLength}`;
110635
+ const cached = bufferCache.get(key);
110636
+ if (cached) return cached;
110637
+ const reader = makeReader(bytes);
110638
+ const header = reader.view.getUint8(reader.offset++);
110639
+ const version10 = header & 15;
110640
+ if (version10 !== 1) throw new Error(`parquet unsupported variant metadata version: ${version10}`);
110641
+ const sorted = (header >> 4 & 1) === 1;
110642
+ const offsetSize = (header >> 6 & 3) + 1;
110643
+ const dictionarySize = readUnsigned(reader, offsetSize);
110644
+ const offsets = new Array(dictionarySize + 1);
110645
+ for (let i9 = 0; i9 < offsets.length; i9++) {
110646
+ offsets[i9] = readUnsigned(reader, offsetSize);
110647
+ }
110648
+ const base = reader.offset;
110649
+ const dictionary = new Array(dictionarySize);
110650
+ for (let i9 = 0; i9 < dictionarySize; i9++) {
110651
+ const start = offsets[i9];
110652
+ const end = offsets[i9 + 1];
110653
+ const strBytes = new Uint8Array(bytes.buffer, bytes.byteOffset + base + start, end - start);
110654
+ dictionary[i9] = decoder3.decode(strBytes);
110655
+ }
110656
+ const metadata = { dictionary, sorted };
110657
+ bufferCache.set(key, metadata);
110658
+ return metadata;
110659
+ }
110660
+ function readUnsigned(reader, byteWidth2) {
110661
+ let value = 0;
110662
+ for (let i9 = 0; i9 < byteWidth2; i9++) {
110663
+ value |= reader.view.getUint8(reader.offset + i9) << i9 * 8;
110664
+ }
110665
+ reader.offset += byteWidth2;
110666
+ return value;
110667
+ }
110668
+ function readVariant(reader, metadata, parsers) {
110669
+ const typeByte = reader.view.getUint8(reader.offset++);
110670
+ const basicType = typeByte & 3;
110671
+ const header = typeByte >> 2;
110672
+ if (basicType === 0) return readVariantPrimitive(reader, header, parsers);
110673
+ if (basicType === 2) return readVariantObject(reader, header, metadata, parsers);
110674
+ if (basicType === 3) return readVariantArray(reader, header, metadata, parsers);
110675
+ const bytes = new Uint8Array(reader.view.buffer, reader.view.byteOffset + reader.offset, header);
110676
+ reader.offset += header;
110677
+ return decoder3.decode(bytes);
110678
+ }
110679
+ function readVariantPrimitive(reader, typeId, parsers) {
110680
+ switch (typeId) {
110681
+ case 0:
110682
+ return null;
110683
+ case 1:
110684
+ return true;
110685
+ case 2:
110686
+ return false;
110687
+ case 3: {
110688
+ const value = reader.view.getInt8(reader.offset);
110689
+ reader.offset += 1;
110690
+ return value;
110691
+ }
110692
+ case 4: {
110693
+ const value = reader.view.getInt16(reader.offset, true);
110694
+ reader.offset += 2;
110695
+ return value;
110696
+ }
110697
+ case 5: {
110698
+ const value = reader.view.getInt32(reader.offset, true);
110699
+ reader.offset += 4;
110700
+ return value;
110701
+ }
110702
+ case 6: {
110703
+ const value = reader.view.getBigInt64(reader.offset, true);
110704
+ reader.offset += 8;
110705
+ return value;
110706
+ }
110707
+ case 7: {
110708
+ const value = reader.view.getFloat64(reader.offset, true);
110709
+ reader.offset += 8;
110710
+ return value;
110711
+ }
110712
+ case 8:
110713
+ return readVariantDecimal(reader, 4);
110714
+ case 9:
110715
+ return readVariantDecimal(reader, 8);
110716
+ case 10:
110717
+ return readVariantDecimal(reader, 16);
110718
+ case 11: {
110719
+ const value = reader.view.getInt32(reader.offset, true);
110720
+ reader.offset += 4;
110721
+ return parsers.dateFromDays(value);
110722
+ }
110723
+ case 12:
110724
+ // timestamp_micros (utc)
110725
+ case 13: {
110726
+ const value = reader.view.getBigInt64(reader.offset, true);
110727
+ reader.offset += 8;
110728
+ return parsers.timestampFromMicroseconds(value);
110729
+ }
110730
+ case 14: {
110731
+ const value = reader.view.getFloat32(reader.offset, true);
110732
+ reader.offset += 4;
110733
+ return value;
110734
+ }
110735
+ case 15:
110736
+ return readVariantBinary(reader);
110737
+ case 16: {
110738
+ const bytes = readVariantBinary(reader);
110739
+ return decoder3.decode(bytes);
110740
+ }
110741
+ case 17: {
110742
+ const value = reader.view.getBigInt64(reader.offset, true);
110743
+ reader.offset += 8;
110744
+ return value;
110745
+ }
110746
+ case 18:
110747
+ // timestamp_nanos (utc)
110748
+ case 19: {
110749
+ const value = reader.view.getBigInt64(reader.offset, true);
110750
+ reader.offset += 8;
110751
+ return parsers.timestampFromNanoseconds(value);
110752
+ }
110753
+ case 20: {
110754
+ const bytes = new Uint8Array(reader.view.buffer, reader.view.byteOffset + reader.offset, 16);
110755
+ reader.offset += 16;
110756
+ const hex = Array.from(bytes, (b4) => b4.toString(16).padStart(2, "0")).join("");
110757
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
110758
+ }
110759
+ default:
110760
+ throw new Error(`parquet unsupported variant primitive type: ${typeId}`);
110761
+ }
110762
+ }
110763
+ function readVariantObject(reader, header, metadata, parsers) {
110764
+ const offsetWidth = (header & 3) + 1;
110765
+ const idWidth = (header >> 2 & 3) + 1;
110766
+ const isLarge = header >> 4 & 1;
110767
+ const numElements = isLarge ? readUnsigned(reader, 4) : reader.view.getUint8(reader.offset++);
110768
+ const fieldIds = new Array(numElements);
110769
+ for (let i9 = 0; i9 < numElements; i9++) {
110770
+ fieldIds[i9] = readUnsigned(reader, idWidth);
110771
+ }
110772
+ const offsets = new Array(numElements + 1);
110773
+ for (let i9 = 0; i9 < offsets.length; i9++) {
110774
+ offsets[i9] = readUnsigned(reader, offsetWidth);
110775
+ }
110776
+ const out = {};
110777
+ for (let i9 = 0; i9 < numElements; i9++) {
110778
+ const key = metadata.dictionary[fieldIds[i9]];
110779
+ const valueReader = {
110780
+ view: reader.view,
110781
+ offset: reader.offset + offsets[i9]
110782
+ };
110783
+ out[key] = readVariant(valueReader, metadata, parsers);
110784
+ }
110785
+ reader.offset += offsets[offsets.length - 1];
110786
+ return out;
110787
+ }
110788
+ function readVariantArray(reader, header, metadata, parsers) {
110789
+ const fieldOffsetSize = header & 3;
110790
+ const isLarge = header >> 2 & 1;
110791
+ const offsetWidth = fieldOffsetSize + 1;
110792
+ const numElements = readUnsigned(reader, isLarge ? 4 : 1);
110793
+ const offsets = new Array(numElements + 1);
110794
+ for (let i9 = 0; i9 < offsets.length; i9++) {
110795
+ offsets[i9] = readUnsigned(reader, offsetWidth);
110796
+ }
110797
+ const valuesStart = reader.offset;
110798
+ const result = new Array(numElements);
110799
+ for (let i9 = 0; i9 < numElements; i9++) {
110800
+ const valueReader = {
110801
+ view: reader.view,
110802
+ offset: valuesStart + offsets[i9]
110803
+ };
110804
+ result[i9] = readVariant(valueReader, metadata, parsers);
110805
+ }
110806
+ reader.offset = valuesStart + offsets[offsets.length - 1];
110807
+ return result;
110808
+ }
110809
+ function readVariantDecimal(reader, width) {
110810
+ const scale2 = reader.view.getUint8(reader.offset);
110811
+ reader.offset += 1;
110812
+ let unscaled;
110813
+ if (width === 4) {
110814
+ unscaled = BigInt(reader.view.getInt32(reader.offset, true));
110815
+ reader.offset += 4;
110816
+ } else if (width === 8) {
110817
+ unscaled = reader.view.getBigInt64(reader.offset, true);
110818
+ reader.offset += 8;
110819
+ } else {
110820
+ const low = reader.view.getBigUint64(reader.offset, true);
110821
+ const high = reader.view.getBigInt64(reader.offset + 8, true);
110822
+ unscaled = high << 64n | low;
110823
+ reader.offset += 16;
110824
+ }
110825
+ return Number(unscaled) * 10 ** -scale2;
110826
+ }
110827
+ function readVariantBinary(reader) {
110828
+ const length = reader.view.getUint32(reader.offset, true);
110829
+ reader.offset += 4;
110830
+ const bytes = new Uint8Array(reader.view.buffer, reader.view.byteOffset + reader.offset, length);
110831
+ reader.offset += length;
110832
+ return bytes;
110833
+ }
110834
+
110213
110835
  // node_modules/hyparquet/src/assemble.js
110214
110836
  function assembleLists(output, definitionLevels, repetitionLevels, values, schemaPath) {
110215
- const n11 = definitionLevels?.length || repetitionLevels.length;
110216
- if (!n11) return values;
110217
110837
  const maxDefinitionLevel = getMaxDefinitionLevel(schemaPath);
110838
+ if (!definitionLevels?.length && !repetitionLevels.length) {
110839
+ if (!maxDefinitionLevel || !values.length) return values;
110840
+ definitionLevels = new Array(values.length).fill(maxDefinitionLevel);
110841
+ }
110842
+ const n11 = definitionLevels?.length || repetitionLevels.length;
110218
110843
  const repetitionPath = schemaPath.map(({ element }) => element.repetition_type);
110219
110844
  let valueIndex = 0;
110220
110845
  const containerStack = [output];
@@ -110273,7 +110898,7 @@ function assembleLists(output, definitionLevels, repetitionLevels, values, schem
110273
110898
  }
110274
110899
  return output;
110275
110900
  }
110276
- function assembleNested(subcolumnData, schema, depth = 0) {
110901
+ function assembleNested(subcolumnData, schema, parsers, depth = 0) {
110277
110902
  const path = schema.path.join(".");
110278
110903
  const optional = schema.element.repetition_type === "OPTIONAL";
110279
110904
  const nextDepth = optional ? depth + 1 : depth;
@@ -110284,7 +110909,7 @@ function assembleNested(subcolumnData, schema, depth = 0) {
110284
110909
  sublist = sublist.children[0];
110285
110910
  subDepth++;
110286
110911
  }
110287
- assembleNested(subcolumnData, sublist, subDepth);
110912
+ assembleNested(subcolumnData, sublist, parsers, subDepth);
110288
110913
  const subcolumn = sublist.path.join(".");
110289
110914
  const values = subcolumnData.get(subcolumn);
110290
110915
  if (!values) throw new Error("parquet list column missing values");
@@ -110295,8 +110920,8 @@ function assembleNested(subcolumnData, schema, depth = 0) {
110295
110920
  }
110296
110921
  if (isMapLike(schema)) {
110297
110922
  const mapName = schema.children[0].element.name;
110298
- assembleNested(subcolumnData, schema.children[0].children[0], nextDepth + 1);
110299
- assembleNested(subcolumnData, schema.children[0].children[1], nextDepth + 1);
110923
+ assembleNested(subcolumnData, schema.children[0].children[0], parsers, nextDepth + 1);
110924
+ assembleNested(subcolumnData, schema.children[0].children[1], parsers, nextDepth + 1);
110300
110925
  const keys = subcolumnData.get(`${path}.${mapName}.key`);
110301
110926
  const values = subcolumnData.get(`${path}.${mapName}.value`);
110302
110927
  if (!keys) throw new Error("parquet map column missing keys");
@@ -110315,7 +110940,7 @@ function assembleNested(subcolumnData, schema, depth = 0) {
110315
110940
  const invertDepth = schema.element.repetition_type === "REQUIRED" ? depth : depth + 1;
110316
110941
  const struct = {};
110317
110942
  for (const child of schema.children) {
110318
- assembleNested(subcolumnData, child, invertDepth);
110943
+ assembleNested(subcolumnData, child, parsers, invertDepth);
110319
110944
  const childData = subcolumnData.get(child.path.join("."));
110320
110945
  if (!childData) throw new Error("parquet struct missing child data");
110321
110946
  struct[child.element.name] = childData;
@@ -110323,7 +110948,10 @@ function assembleNested(subcolumnData, schema, depth = 0) {
110323
110948
  for (const child of schema.children) {
110324
110949
  subcolumnData.delete(child.path.join("."));
110325
110950
  }
110326
- const inverted = invertStruct(struct, invertDepth);
110951
+ let inverted = invertStruct(struct, invertDepth);
110952
+ if (schema.element.logical_type?.type === "VARIANT") {
110953
+ inverted = decodeVariantColumn(inverted, parsers);
110954
+ }
110327
110955
  if (optional) flattenAtDepth(inverted, depth);
110328
110956
  subcolumnData.set(path, inverted);
110329
110957
  }
@@ -110345,9 +110973,9 @@ function assembleMaps(keys, values, depth) {
110345
110973
  } else {
110346
110974
  if (keys[i9]) {
110347
110975
  const obj = {};
110348
- for (let j3 = 0; j3 < keys[i9].length; j3++) {
110349
- const value = values[i9][j3];
110350
- obj[keys[i9][j3]] = value === void 0 ? null : value;
110976
+ for (let j2 = 0; j2 < keys[i9].length; j2++) {
110977
+ const value = values[i9][j2];
110978
+ obj[keys[i9][j2]] = value === void 0 ? null : value;
110351
110979
  }
110352
110980
  out.push(obj);
110353
110981
  } else {
@@ -110417,7 +111045,7 @@ function deltaBinaryUnpack(reader, count2, output) {
110417
111045
  reader.offset += Math.ceil((miniblockCount * Number(bitWidth2) + Number(bitpackPos)) / 8);
110418
111046
  }
110419
111047
  } else {
110420
- for (let j3 = 0; j3 < valuesPerMiniblock && outputIndex < count2; j3++) {
111048
+ for (let j2 = 0; j2 < valuesPerMiniblock && outputIndex < count2; j2++) {
110421
111049
  value += minDelta;
110422
111050
  output[outputIndex++] = int32 ? Number(value) : value;
110423
111051
  }
@@ -110452,9 +111080,6 @@ function deltaByteArray(reader, count2, output) {
110452
111080
  }
110453
111081
 
110454
111082
  // node_modules/hyparquet/src/encoding.js
110455
- function bitWidth(value) {
110456
- return 32 - Math.clz32(value);
110457
- }
110458
111083
  function readRleBitPackedHybrid(reader, width, output, length) {
110459
111084
  if (length === void 0) {
110460
111085
  length = reader.view.getUint32(reader.offset, true);
@@ -110864,6 +111489,9 @@ function readDefinitionLevelsV2(reader, daph2, schemaPath) {
110864
111489
  return values;
110865
111490
  }
110866
111491
  }
111492
+ function bitWidth(value) {
111493
+ return 32 - Math.clz32(value);
111494
+ }
110867
111495
 
110868
111496
  // node_modules/hyparquet/src/column.js
110869
111497
  function readColumn(reader, { groupStart, selectStart, selectEnd }, columnDecoder, onPage) {
@@ -110873,6 +111501,7 @@ function readColumn(reader, { groupStart, selectStart, selectEnd }, columnDecode
110873
111501
  let dictionary = void 0;
110874
111502
  let lastChunk = void 0;
110875
111503
  let rowCount = 0;
111504
+ let skipped = 0;
110876
111505
  const emitLastChunk = onPage && (() => {
110877
111506
  lastChunk && onPage({
110878
111507
  pathInSchema,
@@ -110885,23 +111514,28 @@ function readColumn(reader, { groupStart, selectStart, selectEnd }, columnDecode
110885
111514
  if (reader.offset >= reader.view.byteLength - 1) break;
110886
111515
  const header = parquetHeader(reader);
110887
111516
  if (header.type === "DICTIONARY_PAGE") {
110888
- dictionary = readPage(reader, header, columnDecoder, dictionary, void 0, 0);
110889
- dictionary = convert(dictionary, columnDecoder);
111517
+ const { data } = readPage(reader, header, columnDecoder, dictionary, void 0, 0);
111518
+ if (data) dictionary = convert(data, columnDecoder);
110890
111519
  } else {
110891
111520
  const lastChunkLength = lastChunk?.length || 0;
110892
- const values = readPage(reader, header, columnDecoder, dictionary, lastChunk, selectStart - rowCount);
110893
- if (lastChunk === values) {
110894
- rowCount += values.length - lastChunkLength;
110895
- } else {
111521
+ const result = readPage(reader, header, columnDecoder, dictionary, lastChunk, selectStart - rowCount);
111522
+ if (result.skipped) {
111523
+ if (!chunks.length) {
111524
+ skipped += result.skipped;
111525
+ }
111526
+ rowCount += result.skipped;
111527
+ } else if (result.data && lastChunk === result.data) {
111528
+ rowCount += result.data.length - lastChunkLength;
111529
+ } else if (result.data && result.data.length) {
110896
111530
  emitLastChunk?.();
110897
- chunks.push(values);
110898
- rowCount += values.length;
110899
- lastChunk = values;
111531
+ chunks.push(result.data);
111532
+ rowCount += result.data.length;
111533
+ lastChunk = result.data;
110900
111534
  }
110901
111535
  }
110902
111536
  }
110903
111537
  emitLastChunk?.();
110904
- return chunks;
111538
+ return { data: chunks, skipped };
110905
111539
  }
110906
111540
  function readPage(reader, header, columnDecoder, dictionary, previousChunk, pageStart) {
110907
111541
  const { type, element, schemaPath, codec, compressors } = columnDecoder;
@@ -110915,32 +111549,25 @@ function readPage(reader, header, columnDecoder, dictionary, previousChunk, page
110915
111549
  const daph = header.data_page_header;
110916
111550
  if (!daph) throw new Error("parquet data page header is undefined");
110917
111551
  if (pageStart > daph.num_values && isFlatColumn(schemaPath)) {
110918
- return new Array(daph.num_values);
111552
+ return { skipped: daph.num_values };
110919
111553
  }
110920
111554
  const page = decompressPage(compressedBytes, Number(header.uncompressed_page_size), codec, compressors);
110921
111555
  const { definitionLevels, repetitionLevels, dataPage } = readDataPage(page, daph, columnDecoder);
110922
- let values = convertWithDictionary(dataPage, dictionary, daph.encoding, columnDecoder);
110923
- if (repetitionLevels.length || definitionLevels?.length) {
110924
- const output = Array.isArray(previousChunk) ? previousChunk : [];
110925
- return assembleLists(output, definitionLevels, repetitionLevels, values, schemaPath);
110926
- } else {
110927
- for (let i9 = 2; i9 < schemaPath.length; i9++) {
110928
- if (schemaPath[i9].element.repetition_type !== "REQUIRED") {
110929
- values = Array.from(values, (e12) => [e12]);
110930
- }
110931
- }
110932
- return values;
110933
- }
111556
+ const values = convertWithDictionary(dataPage, dictionary, daph.encoding, columnDecoder);
111557
+ const output = Array.isArray(previousChunk) ? previousChunk : [];
111558
+ const assembled = assembleLists(output, definitionLevels, repetitionLevels, values, schemaPath);
111559
+ return { skipped: 0, data: assembled };
110934
111560
  } else if (header.type === "DATA_PAGE_V2") {
110935
111561
  const daph2 = header.data_page_header_v2;
110936
111562
  if (!daph2) throw new Error("parquet data page header v2 is undefined");
110937
111563
  if (pageStart > daph2.num_rows) {
110938
- return new Array(daph2.num_values);
111564
+ return { skipped: daph2.num_values };
110939
111565
  }
110940
111566
  const { definitionLevels, repetitionLevels, dataPage } = readDataPageV2(compressedBytes, header, columnDecoder);
110941
111567
  const values = convertWithDictionary(dataPage, dictionary, daph2.encoding, columnDecoder);
110942
111568
  const output = Array.isArray(previousChunk) ? previousChunk : [];
110943
- return assembleLists(output, definitionLevels, repetitionLevels, values, schemaPath);
111569
+ const assembled = assembleLists(output, definitionLevels, repetitionLevels, values, schemaPath);
111570
+ return { skipped: 0, data: assembled };
110944
111571
  } else if (header.type === "DICTIONARY_PAGE") {
110945
111572
  const diph = header.dictionary_page_header;
110946
111573
  if (!diph) throw new Error("parquet dictionary page header is undefined");
@@ -110951,7 +111578,8 @@ function readPage(reader, header, columnDecoder, dictionary, previousChunk, page
110951
111578
  compressors
110952
111579
  );
110953
111580
  const reader2 = { view: new DataView(page.buffer, page.byteOffset, page.byteLength), offset: 0 };
110954
- return readPlain(reader2, type, diph.num_values, element.type_length);
111581
+ const dictArray = readPlain(reader2, type, diph.num_values, element.type_length);
111582
+ return { skipped: 0, data: dictArray };
110955
111583
  } else {
110956
111584
  throw new Error(`parquet unsupported page type: ${header.type}`);
110957
111585
  }
@@ -111007,68 +111635,62 @@ function parquetHeader(reader) {
111007
111635
 
111008
111636
  // node_modules/hyparquet/src/rowgroup.js
111009
111637
  function readRowGroup(options, { metadata }, groupPlan) {
111010
- const { file, compressors, utf8 } = options;
111011
111638
  const asyncColumns = [];
111012
- const parsers = { ...DEFAULT_PARSERS, ...options.parsers };
111013
- for (const chunkPlan of groupPlan.chunks) {
111014
- const { columnMetadata } = chunkPlan;
111015
- const schemaPath = getSchemaPath(metadata.schema, columnMetadata.path_in_schema);
111639
+ for (const chunk of groupPlan.chunks) {
111640
+ const { data_page_offset, dictionary_page_offset, path_in_schema: pathInSchema } = chunk.columnMetadata;
111641
+ const schemaPath = getSchemaPath(metadata.schema, pathInSchema);
111016
111642
  const columnDecoder = {
111017
- pathInSchema: columnMetadata.path_in_schema,
111018
- type: columnMetadata.type,
111643
+ pathInSchema,
111019
111644
  element: schemaPath[schemaPath.length - 1].element,
111020
111645
  schemaPath,
111021
- codec: columnMetadata.codec,
111022
- parsers,
111023
- compressors,
111024
- utf8
111646
+ parsers: { ...DEFAULT_PARSERS, ...options.parsers },
111647
+ ...options,
111648
+ ...chunk.columnMetadata
111025
111649
  };
111026
- if (!("offsetIndex" in chunkPlan)) {
111650
+ let { startByte, endByte } = chunk.range;
111651
+ if (!("offsetIndex" in chunk)) {
111027
111652
  asyncColumns.push({
111028
- pathInSchema: columnMetadata.path_in_schema,
111029
- data: Promise.resolve(file.slice(chunkPlan.range.startByte, chunkPlan.range.endByte)).then((buffer2) => {
111653
+ pathInSchema,
111654
+ data: Promise.resolve(options.file.slice(startByte, endByte)).then((buffer2) => {
111030
111655
  const reader = { view: new DataView(buffer2), offset: 0 };
111031
- return {
111032
- pageSkip: 0,
111033
- data: readColumn(reader, groupPlan, columnDecoder, options.onPage)
111034
- };
111656
+ return readColumn(reader, groupPlan, columnDecoder, options.onPage);
111035
111657
  })
111036
111658
  });
111037
111659
  continue;
111038
111660
  }
111039
111661
  asyncColumns.push({
111040
- pathInSchema: columnMetadata.path_in_schema,
111662
+ pathInSchema,
111041
111663
  // fetch offset index
111042
- data: Promise.resolve(file.slice(chunkPlan.offsetIndex.startByte, chunkPlan.offsetIndex.endByte)).then(async (arrayBuffer) => {
111043
- const offsetIndex = readOffsetIndex({ view: new DataView(arrayBuffer), offset: 0 });
111664
+ data: Promise.resolve(options.file.slice(chunk.offsetIndex.startByte, chunk.offsetIndex.endByte)).then(async (arrayBuffer) => {
111044
111665
  const { selectStart, selectEnd } = groupPlan;
111045
- const pages = offsetIndex.page_locations;
111046
- let startByte = NaN;
111047
- let endByte = NaN;
111048
- let pageSkip = 0;
111666
+ const pages = readOffsetIndex({ view: new DataView(arrayBuffer), offset: 0 }).page_locations;
111667
+ let skipped = -1;
111668
+ const hasDict = dictionary_page_offset || data_page_offset < pages[0].offset;
111049
111669
  for (let i9 = 0; i9 < pages.length; i9++) {
111050
111670
  const page = pages[i9];
111051
111671
  const pageStart = Number(page.first_row_index);
111052
111672
  const pageEnd = i9 + 1 < pages.length ? Number(pages[i9 + 1].first_row_index) : groupPlan.groupRows;
111053
- if (pageStart < selectEnd && pageEnd > selectStart) {
111054
- if (Number.isNaN(startByte)) {
111055
- startByte = Number(page.offset);
111056
- pageSkip = pageStart;
111057
- }
111673
+ if (skipped < 0 && !hasDict && pageEnd > selectStart) {
111674
+ startByte = Number(page.offset);
111675
+ skipped = pageStart;
111676
+ }
111677
+ if (pageStart < selectEnd) {
111058
111678
  endByte = Number(page.offset) + page.compressed_page_size;
111059
111679
  }
111060
111680
  }
111061
- const buffer2 = await file.slice(startByte, endByte);
111681
+ if (skipped < 0) skipped = 0;
111682
+ const buffer2 = await options.file.slice(startByte, endByte);
111062
111683
  const reader = { view: new DataView(buffer2), offset: 0 };
111063
- const adjustedGroupPlan = pageSkip ? {
111684
+ const adjustedGroupPlan = skipped ? {
111064
111685
  ...groupPlan,
111065
- groupStart: groupPlan.groupStart + pageSkip,
111066
- selectStart: groupPlan.selectStart - pageSkip,
111067
- selectEnd: groupPlan.selectEnd - pageSkip
111686
+ groupStart: groupPlan.groupStart + skipped,
111687
+ selectStart: groupPlan.selectStart - skipped,
111688
+ selectEnd: groupPlan.selectEnd - skipped
111068
111689
  } : groupPlan;
111690
+ const { data, skipped: columnSkipped } = readColumn(reader, adjustedGroupPlan, columnDecoder, options.onPage);
111069
111691
  return {
111070
- data: readColumn(reader, adjustedGroupPlan, columnDecoder, options.onPage),
111071
- pageSkip
111692
+ data,
111693
+ skipped: skipped + columnSkipped
111072
111694
  };
111073
111695
  })
111074
111696
  });
@@ -111076,69 +111698,71 @@ function readRowGroup(options, { metadata }, groupPlan) {
111076
111698
  return { groupStart: groupPlan.groupStart, groupRows: groupPlan.groupRows, asyncColumns };
111077
111699
  }
111078
111700
  async function asyncGroupToRows({ asyncColumns }, selectStart, selectEnd, columns, rowFormat) {
111079
- const asyncPages = await Promise.all(asyncColumns.map(async ({ data }) => {
111080
- const pages = await data;
111081
- return {
111082
- ...pages,
111083
- data: flatten(pages.data)
111084
- };
111085
- }));
111086
- const includedColumnNames = asyncColumns.map((child) => child.pathInSchema[0]).filter((name) => !columns || columns.includes(name));
111087
- const columnOrder = columns ?? includedColumnNames;
111088
- const columnIndexes = columnOrder.map((name) => asyncColumns.findIndex((column) => column.pathInSchema[0] === name));
111701
+ const asyncPages = await Promise.all(asyncColumns.map(
111702
+ (column) => column.data.then(({ skipped, data }) => ({ skipped, data: flatten(data) }))
111703
+ ));
111089
111704
  const selectCount = selectEnd - selectStart;
111090
111705
  if (rowFormat === "object") {
111091
111706
  const groupData2 = Array(selectCount);
111092
111707
  for (let selectRow = 0; selectRow < selectCount; selectRow++) {
111093
- const row = selectStart + selectRow;
111094
111708
  const rowData = {};
111095
111709
  for (let i9 = 0; i9 < asyncColumns.length; i9++) {
111096
- const { data, pageSkip } = asyncPages[i9];
111097
- rowData[asyncColumns[i9].pathInSchema[0]] = data[row - pageSkip];
111710
+ const { data, skipped } = asyncPages[i9];
111711
+ rowData[asyncColumns[i9].pathInSchema[0]] = data[selectStart + selectRow - skipped];
111098
111712
  }
111099
111713
  groupData2[selectRow] = rowData;
111100
111714
  }
111101
111715
  return groupData2;
111102
111716
  }
111717
+ const includedColumnNames = asyncColumns.map((child) => child.pathInSchema[0]).filter((name) => !columns || columns.includes(name));
111718
+ const columnOrder = columns ?? includedColumnNames;
111719
+ const columnIndexes = columnOrder.map((name) => asyncColumns.findIndex((column) => column.pathInSchema[0] === name));
111103
111720
  const groupData = Array(selectCount);
111104
111721
  for (let selectRow = 0; selectRow < selectCount; selectRow++) {
111105
- const row = selectStart + selectRow;
111106
111722
  const rowData = Array(asyncColumns.length);
111107
111723
  for (let i9 = 0; i9 < columnOrder.length; i9++) {
111108
111724
  const colIdx = columnIndexes[i9];
111109
- if (colIdx >= 0) {
111110
- const { data, pageSkip } = asyncPages[colIdx];
111111
- rowData[i9] = data[row - pageSkip];
111112
- }
111725
+ if (colIdx < 0) throw new Error(`parquet column not found: ${columnOrder[i9]}`);
111726
+ const { data, skipped } = asyncPages[colIdx];
111727
+ rowData[i9] = data[selectStart + selectRow - skipped];
111113
111728
  }
111114
111729
  groupData[selectRow] = rowData;
111115
111730
  }
111116
111731
  return groupData;
111117
111732
  }
111118
- function assembleAsync(asyncRowGroup, schemaTree2) {
111733
+ function assembleAsync(asyncRowGroup, schemaTree2, parsers) {
111119
111734
  const { asyncColumns } = asyncRowGroup;
111735
+ parsers = { ...DEFAULT_PARSERS, ...parsers };
111120
111736
  const assembled = [];
111121
111737
  for (const child of schemaTree2.children) {
111122
111738
  if (child.children.length) {
111123
111739
  const childColumns = asyncColumns.filter((column) => column.pathInSchema[0] === child.element.name);
111124
111740
  if (!childColumns.length) continue;
111125
- const flatData = /* @__PURE__ */ new Map();
111126
- const data = Promise.all(childColumns.map((column) => {
111127
- return column.data.then(({ data: data2 }) => {
111128
- flatData.set(column.pathInSchema.join("."), flatten(data2));
111129
- });
111130
- })).then(() => {
111131
- assembleNested(flatData, child);
111132
- const flatColumn = flatData.get(child.path.join("."));
111133
- if (!flatColumn) throw new Error("parquet column data not assembled");
111134
- return { data: [flatColumn], pageSkip: 0 };
111741
+ assembled.push({
111742
+ pathInSchema: child.path,
111743
+ data: (async () => {
111744
+ const resolved = await Promise.all(childColumns.map((c7) => c7.data));
111745
+ const subcolumnData = /* @__PURE__ */ new Map();
111746
+ let minLength = Infinity;
111747
+ for (let i9 = 0; i9 < childColumns.length; i9++) {
111748
+ const flat = flatten(resolved[i9].data);
111749
+ subcolumnData.set(childColumns[i9].pathInSchema.join("."), flat);
111750
+ minLength = Math.min(minLength, flat.length);
111751
+ }
111752
+ for (const [key, value] of subcolumnData) {
111753
+ if (value.length > minLength) {
111754
+ subcolumnData.set(key, value.slice(0, minLength));
111755
+ }
111756
+ }
111757
+ assembleNested(subcolumnData, child, parsers);
111758
+ const assembled2 = subcolumnData.get(child.element.name);
111759
+ if (!assembled2) throw new Error("parquet column data not assembled");
111760
+ return { data: [assembled2], skipped: 0 };
111761
+ })()
111135
111762
  });
111136
- assembled.push({ pathInSchema: child.path, data });
111137
111763
  } else {
111138
111764
  const asyncColumn = asyncColumns.find((column) => column.pathInSchema[0] === child.element.name);
111139
- if (asyncColumn) {
111140
- assembled.push(asyncColumn);
111141
- }
111765
+ if (asyncColumn) assembled.push(asyncColumn);
111142
111766
  }
111143
111767
  }
111144
111768
  return { ...asyncRowGroup, asyncColumns: assembled };
@@ -111168,21 +111792,20 @@ async function parquetRead(options) {
111168
111792
  requiresProjection = true;
111169
111793
  }
111170
111794
  }
111171
- const readOptions = readColumns !== columns ? { ...options, columns: readColumns } : options;
111795
+ let readOptions = readColumns !== columns ? { ...options, columns: readColumns } : options;
111796
+ readOptions = await withBloomFilters(readOptions);
111172
111797
  const asyncGroups = parquetReadAsync(readOptions);
111173
111798
  if (!onComplete && !onChunk) {
111174
- for (const { asyncColumns } of asyncGroups) {
111175
- for (const { data } of asyncColumns) await data;
111176
- }
111799
+ await awaitAllColumns(asyncGroups);
111177
111800
  return;
111178
111801
  }
111179
111802
  const schemaTree2 = parquetSchema(options.metadata);
111180
- const assembled = asyncGroups.map((arg) => assembleAsync(arg, schemaTree2));
111803
+ const assembled = asyncGroups.map((arg) => assembleAsync(arg, schemaTree2, options.parsers));
111181
111804
  if (onChunk) {
111182
111805
  for (const asyncGroup of assembled) {
111183
111806
  for (const asyncColumn of asyncGroup.asyncColumns) {
111184
- asyncColumn.data.then(({ data, pageSkip }) => {
111185
- let rowStart2 = asyncGroup.groupStart + pageSkip;
111807
+ asyncColumn.data.then(({ data, skipped }) => {
111808
+ let rowStart2 = asyncGroup.groupStart + skipped;
111186
111809
  for (const columnData of data) {
111187
111810
  onChunk({
111188
111811
  columnName: asyncColumn.pathInSchema[0],
@@ -111192,11 +111815,13 @@ async function parquetRead(options) {
111192
111815
  });
111193
111816
  rowStart2 += columnData.length;
111194
111817
  }
111818
+ }, () => {
111195
111819
  });
111196
111820
  }
111197
111821
  }
111198
111822
  }
111199
111823
  if (onComplete) {
111824
+ await awaitAllColumns(assembled);
111200
111825
  const rows = [];
111201
111826
  for (const asyncGroup of assembled) {
111202
111827
  const selectStart = Math.max(rowStart - asyncGroup.groupStart, 0);
@@ -111223,17 +111848,38 @@ async function parquetRead(options) {
111223
111848
  }
111224
111849
  onComplete(rows);
111225
111850
  } else {
111226
- for (const { asyncColumns } of assembled) {
111227
- for (const { data } of asyncColumns) await data;
111228
- }
111851
+ await awaitAllColumns(assembled);
111229
111852
  }
111230
111853
  }
111854
+ async function awaitAllColumns(asyncGroups) {
111855
+ const all4 = asyncGroups.flatMap((g3) => g3.asyncColumns.map((c7) => c7.data));
111856
+ const results = await Promise.allSettled(all4);
111857
+ const failed = results.find((r11) => r11.status === "rejected");
111858
+ if (failed) throw failed.reason;
111859
+ }
111231
111860
  function parquetReadAsync(options) {
111232
111861
  if (!options.metadata) throw new Error("parquet requires metadata");
111233
111862
  const plan = parquetPlan(options);
111234
111863
  options.file = prefetchAsyncBuffer(options.file, plan);
111235
111864
  return plan.groups.map((groupPlan) => readRowGroup(options, plan, groupPlan));
111236
111865
  }
111866
+ async function withBloomFilters(options) {
111867
+ if (!options.useBloomFilters) return options;
111868
+ if (!options.filter || !options.metadata) return options;
111869
+ const schemaTree2 = parquetSchema(options.metadata);
111870
+ const schemaElements = {};
111871
+ for (const child of schemaTree2.children) schemaElements[child.element.name] = child.element;
111872
+ const bloomFiltersByGroup = await prefetchBloomFilters({
111873
+ file: options.file,
111874
+ metadata: options.metadata,
111875
+ filter: options.filter,
111876
+ filterStrict: options.filterStrict
111877
+ });
111878
+ return (
111879
+ /** @type {BaseParquetReadOptions} */
111880
+ { ...options, bloomFiltersByGroup, schemaElements }
111881
+ );
111882
+ }
111237
111883
  function parquetReadObjects(options) {
111238
111884
  return new Promise((onComplete, reject) => {
111239
111885
  parquetRead({
@@ -111269,7 +111915,7 @@ var dataset_input_styles_default = i`
111269
111915
  `;
111270
111916
 
111271
111917
  // node_modules/@tabler/icons/icons/outline/file.svg
111272
- var file_default = 'data:image/svg+xml,<svg%0A xmlns="http://www.w3.org/2000/svg"%0A width="24"%0A height="24"%0A viewBox="0 0 24 24"%0A fill="none"%0A stroke="currentColor"%0A stroke-width="2"%0A stroke-linecap="round"%0A stroke-linejoin="round"%0A class="icon icon-tabler icons-tabler-outline icon-tabler-file"%0A>%0A <path stroke="none" d="M0 0h24v24H0z" fill="none"/>%0A <path d="M14 3v4a1 1 0 0 0 1 1h4" />%0A <path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2" />%0A</svg>';
111918
+ var file_default = 'data:image/svg+xml,<svg%0A xmlns="http://www.w3.org/2000/svg"%0A width="24"%0A height="24"%0A viewBox="0 0 24 24"%0A fill="none"%0A stroke="currentColor"%0A stroke-width="2"%0A stroke-linecap="round"%0A stroke-linejoin="round"%0A class="icon icon-tabler icons-tabler-outline icon-tabler-file"%0A>%0A <path stroke="none" d="M0 0h24v24H0z" fill="none" />%0A <path d="M14 3v4a1 1 0 0 0 1 1h4" />%0A <path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2" />%0A</svg>';
111273
111919
 
111274
111920
  // components/dataset-input/dataset-input.ts
111275
111921
  var DatasetInput = class extends LitElementWw {
@@ -111688,20 +112334,35 @@ var ModelEditor = class extends LitElementWw {
111688
112334
  createLayer(name) {
111689
112335
  this.controler.createLayer(name, this.fields);
111690
112336
  }
112337
+ persistState() {
112338
+ this.state = this.controler.export();
112339
+ this.dispatchEvent(new CustomEvent("modelchange", {
112340
+ detail: {
112341
+ state: this.controler.export()
112342
+ }
112343
+ }));
112344
+ }
112345
+ removeSelectedNode() {
112346
+ this.controler.removeSelectedNode();
112347
+ this.persistState();
112348
+ }
111691
112349
  render() {
111692
112350
  let canvas = document.createElement("div");
111693
112351
  canvas.id = "drawflow";
111694
112352
  this.controler = new Editor14(canvas, this.editmode, this.modelparams, this.layerparams);
111695
112353
  this.controler.import(this.state || [], this.fields);
111696
112354
  let that = this;
111697
- canvas.addEventListener("mouseup", function() {
111698
- that.state = that.controler.export();
111699
- that.dispatchEvent(new CustomEvent("modelchange", {
111700
- detail: {
111701
- state: that.controler.export()
111702
- }
111703
- }));
112355
+ this.controler.onSelectionChanged = function(selected) {
112356
+ that.dispatchEvent(new CustomEvent("selectionchange", { detail: { selected } }));
112357
+ };
112358
+ setTimeout(function() {
112359
+ that.dispatchEvent(new CustomEvent("selectionchange", { detail: { selected: false } }));
111704
112360
  });
112361
+ let persist = function() {
112362
+ that.persistState();
112363
+ };
112364
+ canvas.addEventListener("mouseup", persist);
112365
+ canvas.addEventListener("touchend", persist);
111705
112366
  canvas.addEventListener("keydown", function(e12) {
111706
112367
  if (e12.key == "Delete") {
111707
112368
  e12.preventDefault();
@@ -112003,6 +112664,19 @@ var AiWidgetsDesigns = class extends LitElementWw {
112003
112664
  set currentCanvas(_3) {
112004
112665
  this.#currentCanvas = _3;
112005
112666
  }
112667
+ #hasSelection = false;
112668
+ get hasSelection() {
112669
+ return this.#hasSelection;
112670
+ }
112671
+ set hasSelection(_3) {
112672
+ this.#hasSelection = _3;
112673
+ }
112674
+ /**
112675
+ * Called when the selection inside the model editor changed
112676
+ */
112677
+ _selectionChange(e12) {
112678
+ this.hasSelection = e12.detail.selected;
112679
+ }
112006
112680
  /**
112007
112681
  * Called when the model design inside the model editor was changed
112008
112682
  * @param e
@@ -112028,7 +112702,7 @@ var AiWidgetsDesigns = class extends LitElementWw {
112028
112702
  }
112029
112703
  return b2`
112030
112704
  <div id="content" style=${this.editMode == "hidden" ? "display:none" : ""}>
112031
- <model-editor id="model-editor" @modelchange=${this._editorChange} editmode=${this.editMode} modelparams=${this.maxModelParameters} layerparams=${this.maxLayerParameters}></model-editor>
112705
+ <model-editor id="model-editor" @modelchange=${this._editorChange} @selectionchange=${this._selectionChange} editmode=${this.editMode} modelparams=${this.maxModelParameters} layerparams=${this.maxLayerParameters}></model-editor>
112032
112706
  <div id="stats">
112033
112707
  <p>${msg("Number of Operations:")} <span id="numberNodes"></span></p>
112034
112708
  <p>${msg("Total Parameters:")} <span id="params"></span></p>
@@ -112068,6 +112742,9 @@ var AiWidgetsDesigns = class extends LitElementWw {
112068
112742
  <sl-tooltip content=${msg("Zoom In")}><sl-button @click=${() => this.zoomIn()}>+</sl-button></sl-tooltip>
112069
112743
  <sl-tooltip content=${msg("Zoom Out")}><sl-button @click=${() => this.zoomOut()}>-</sl-button></sl-tooltip>
112070
112744
  </div>
112745
+ <div id="delete-control" style="display:${this.editMode == "edit" && this.hasSelection ? "" : "none"}">
112746
+ <sl-button variant="danger" @click=${() => this.currentCanvas.removeSelectedNode()}>${msg("Delete selected")}</sl-button>
112747
+ </div>
112071
112748
  </div>
112072
112749
  <p style=${this.editMode != "hidden" ? "display:none" : ""}>${msg("Model Design Widget hidden from students.")}</p>
112073
112750
  <div part="options">
@@ -112194,6 +112871,12 @@ __publicField(AiWidgetsDesigns, "styles", i`
112194
112871
  right: 5px;
112195
112872
  top: 5px;
112196
112873
  z-index: 10;
112874
+ }
112875
+ #delete-control {
112876
+ position:absolute;
112877
+ right: 5px;
112878
+ bottom: 110px;
112879
+ z-index: 10;
112197
112880
  }`);
112198
112881
  __decorateClass([
112199
112882
  n4({ type: String, attribute: true, reflect: true })
@@ -112216,6 +112899,9 @@ __decorateClass([
112216
112899
  __decorateClass([
112217
112900
  e5("#model-editor")
112218
112901
  ], AiWidgetsDesigns.prototype, "currentCanvas", 1);
112902
+ __decorateClass([
112903
+ r5()
112904
+ ], AiWidgetsDesigns.prototype, "hasSelection", 1);
112219
112905
  AiWidgetsDesigns = __decorateClass([
112220
112906
  t3("webwriter-model-designing")
112221
112907
  ], AiWidgetsDesigns);
@@ -112266,7 +112952,7 @@ lit-html/directives/ref.js:
112266
112952
  papaparse/papaparse.min.js:
112267
112953
  (* @license
112268
112954
  Papa Parse
112269
- v5.5.3
112955
+ v5.5.4
112270
112956
  https://github.com/mholt/PapaParse
112271
112957
  License: MIT
112272
112958
  *)
@@ -113867,86 +114553,27 @@ lit-html/directives/style-map.js:
113867
114553
  *)
113868
114554
 
113869
114555
  @lit/reactive-element/reactive-element.js:
113870
- (**
113871
- * @license
113872
- * Copyright 2017 Google LLC
113873
- * SPDX-License-Identifier: BSD-3-Clause
113874
- *)
113875
-
113876
114556
  lit-html/lit-html.js:
113877
- (**
113878
- * @license
113879
- * Copyright 2017 Google LLC
113880
- * SPDX-License-Identifier: BSD-3-Clause
113881
- *)
113882
-
113883
114557
  lit-element/lit-element.js:
113884
- (**
113885
- * @license
113886
- * Copyright 2017 Google LLC
113887
- * SPDX-License-Identifier: BSD-3-Clause
113888
- *)
113889
-
113890
- lit-html/is-server.js:
113891
- (**
113892
- * @license
113893
- * Copyright 2022 Google LLC
113894
- * SPDX-License-Identifier: BSD-3-Clause
113895
- *)
113896
-
113897
114558
  @lit/reactive-element/decorators/custom-element.js:
113898
- (**
113899
- * @license
113900
- * Copyright 2017 Google LLC
113901
- * SPDX-License-Identifier: BSD-3-Clause
113902
- *)
113903
-
113904
114559
  @lit/reactive-element/decorators/property.js:
113905
- (**
113906
- * @license
113907
- * Copyright 2017 Google LLC
113908
- * SPDX-License-Identifier: BSD-3-Clause
113909
- *)
113910
-
113911
114560
  @lit/reactive-element/decorators/state.js:
113912
- (**
113913
- * @license
113914
- * Copyright 2017 Google LLC
113915
- * SPDX-License-Identifier: BSD-3-Clause
113916
- *)
113917
-
113918
114561
  @lit/reactive-element/decorators/event-options.js:
113919
- (**
113920
- * @license
113921
- * Copyright 2017 Google LLC
113922
- * SPDX-License-Identifier: BSD-3-Clause
113923
- *)
113924
-
113925
114562
  @lit/reactive-element/decorators/base.js:
113926
- (**
113927
- * @license
113928
- * Copyright 2017 Google LLC
113929
- * SPDX-License-Identifier: BSD-3-Clause
113930
- *)
113931
-
113932
114563
  @lit/reactive-element/decorators/query.js:
113933
- (**
113934
- * @license
113935
- * Copyright 2017 Google LLC
113936
- * SPDX-License-Identifier: BSD-3-Clause
113937
- *)
113938
-
113939
114564
  @lit/reactive-element/decorators/query-all.js:
114565
+ @lit/reactive-element/decorators/query-async.js:
114566
+ @lit/reactive-element/decorators/query-assigned-nodes.js:
113940
114567
  (**
113941
114568
  * @license
113942
114569
  * Copyright 2017 Google LLC
113943
114570
  * SPDX-License-Identifier: BSD-3-Clause
113944
114571
  *)
113945
114572
 
113946
- @lit/reactive-element/decorators/query-async.js:
114573
+ lit-html/is-server.js:
113947
114574
  (**
113948
114575
  * @license
113949
- * Copyright 2017 Google LLC
114576
+ * Copyright 2022 Google LLC
113950
114577
  * SPDX-License-Identifier: BSD-3-Clause
113951
114578
  *)
113952
114579
 
@@ -113956,12 +114583,5 @@ lit-html/directives/style-map.js:
113956
114583
  * Copyright 2021 Google LLC
113957
114584
  * SPDX-License-Identifier: BSD-3-Clause
113958
114585
  *)
113959
-
113960
- @lit/reactive-element/decorators/query-assigned-nodes.js:
113961
- (**
113962
- * @license
113963
- * Copyright 2017 Google LLC
113964
- * SPDX-License-Identifier: BSD-3-Clause
113965
- *)
113966
114586
  *)
113967
114587
  */