@rive-app/webgl2 2.37.1 → 2.37.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/rive.js CHANGED
@@ -155,6 +155,17 @@ __webpack_require__.r(__webpack_exports__);
155
155
  /* harmony export */ });
156
156
  /* harmony import */ var _rive_advanced_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
157
157
  /* harmony import */ var package_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5);
158
+ var __assign = (undefined && undefined.__assign) || function () {
159
+ __assign = Object.assign || function(t) {
160
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
161
+ s = arguments[i];
162
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
163
+ t[p] = s[p];
164
+ }
165
+ return t;
166
+ };
167
+ return __assign.apply(this, arguments);
168
+ };
158
169
 
159
170
 
160
171
  // Runtime singleton; use getInstance to provide a callback that returns the
@@ -165,12 +176,15 @@ var RuntimeLoader = /** @class */ (function () {
165
176
  }
166
177
  // Loads the runtime
167
178
  RuntimeLoader.loadRuntime = function () {
179
+ // Capture the URL at call time so the catch closure always refers to the
180
+ // URL this particular attempt used, even if wasmURL is mutated for a retry.
181
+ var attemptedUrl = RuntimeLoader.wasmURL;
182
+ var wasmBinary = RuntimeLoader.wasmBinary;
168
183
  if (RuntimeLoader.enablePerfMarks)
169
184
  performance.mark('rive:wasm-init:start');
170
- _rive_advanced_mjs__WEBPACK_IMPORTED_MODULE_0__["default"]({
185
+ _rive_advanced_mjs__WEBPACK_IMPORTED_MODULE_0__["default"](__assign({
171
186
  // Loads Wasm bundle
172
- locateFile: function () { return RuntimeLoader.wasmURL; },
173
- })
187
+ locateFile: function () { return attemptedUrl; } }, (wasmBinary ? { wasmBinary: wasmBinary } : {})))
174
188
  .then(function (rive) {
175
189
  var _a;
176
190
  if (RuntimeLoader.enablePerfMarks) {
@@ -195,18 +209,30 @@ var RuntimeLoader = /** @class */ (function () {
195
209
  };
196
210
  // Log detailed error for debugging
197
211
  console.debug("Rive WASM load error details:", errorDetails);
198
- // In case unpkg fails, or the wasm was not supported, we try to load the fallback module from jsdelivr.
199
- // This `rive_fallback.wasm` is compiled to support older architecture.
200
- // TODO: (Gordon): preemptively test browser support and load the correct wasm file. Then use jsdelvr only if unpkg fails.
201
- var backupJsdelivrUrl = "https://cdn.jsdelivr.net/npm/".concat(package_json__WEBPACK_IMPORTED_MODULE_1__.name, "@").concat(package_json__WEBPACK_IMPORTED_MODULE_1__.version, "/rive_fallback.wasm");
202
- if (RuntimeLoader.wasmURL.toLowerCase() !== backupJsdelivrUrl) {
203
- console.warn("Failed to load WASM from ".concat(RuntimeLoader.wasmURL, " (").concat(errorDetails.message, "), trying jsdelivr as a backup"));
204
- RuntimeLoader.setWasmUrl(backupJsdelivrUrl);
212
+ // In case the primary URL fails, or the wasm was not supported, try the
213
+ // fallback URL (a rive_fallback.wasm compiled for older architectures).
214
+ // The fallback can be customised or disabled via setWasmFallbackUrl().
215
+ // TODO: (Gordon): preemptively test browser support and load the correct wasm file. Then use the fallback only if the primary fails.
216
+ var fallbackUrl = RuntimeLoader.wasmFallbackURL;
217
+ var alreadyOnFallback = fallbackUrl !== null &&
218
+ attemptedUrl.toLowerCase() === fallbackUrl.toLowerCase();
219
+ if (fallbackUrl !== null && !alreadyOnFallback) {
220
+ console.warn("Failed to load WASM from ".concat(attemptedUrl, " (").concat(errorDetails.message, "), trying fallback URL: ").concat(fallbackUrl));
221
+ // Clear wasmBinary so the retry actually fetches via locateFile
222
+ // instead of re-using the same (failing) in-memory binary.
223
+ RuntimeLoader.wasmBinary = null;
224
+ RuntimeLoader.setWasmUrl(fallbackUrl);
205
225
  RuntimeLoader.loadRuntime();
206
226
  }
207
227
  else {
228
+ // When alreadyOnFallback is true, wasmURL has already been overwritten
229
+ // with the fallback URL, so we can no longer recover the original
230
+ // primary URL here. The primary URL was logged in the earlier warning.
231
+ var triedUrls = alreadyOnFallback
232
+ ? "the configured WASM URL or its fallback (".concat(fallbackUrl, ")")
233
+ : attemptedUrl;
208
234
  var errorMessage = [
209
- "Could not load Rive WASM file from ".concat(RuntimeLoader.wasmURL, " or ").concat(backupJsdelivrUrl, "."),
235
+ "Could not load Rive WASM file from ".concat(triedUrls, "."),
210
236
  "Possible reasons:",
211
237
  "- Network connection is down",
212
238
  "- WebAssembly is not supported in this environment",
@@ -252,6 +278,31 @@ var RuntimeLoader = /** @class */ (function () {
252
278
  RuntimeLoader.getWasmUrl = function () {
253
279
  return RuntimeLoader.wasmURL;
254
280
  };
281
+ /**
282
+ * Sets the URL used as a fallback when the primary WASM URL fails to load.
283
+ * Pass `null` to disable the fallback entirely.
284
+ *
285
+ * Defaults to pulling from the jsdelivr CDN.
286
+ */
287
+ RuntimeLoader.setWasmFallbackUrl = function (url) {
288
+ RuntimeLoader.wasmFallbackURL = url;
289
+ };
290
+ // Gets the current fallback wasm url (null means fallback is disabled)
291
+ RuntimeLoader.getWasmFallbackUrl = function () {
292
+ return RuntimeLoader.wasmFallbackURL;
293
+ };
294
+ // Manually sets the wasm binary or clears it with null
295
+ RuntimeLoader.setWasmBinary = function (value) {
296
+ if ((value instanceof ArrayBuffer) || value === null) {
297
+ RuntimeLoader.wasmBinary = value;
298
+ return;
299
+ }
300
+ console.error("setWasmBinary expects an ArrayBuffer or null");
301
+ };
302
+ // Gets the current wasm build as ArrayBuffer or null
303
+ RuntimeLoader.getWasmBinary = function () {
304
+ return RuntimeLoader.wasmBinary;
305
+ };
255
306
  // Flag to indicate that loading has started/completed
256
307
  RuntimeLoader.isLoading = false;
257
308
  // List of callbacks for the runtime that come in while loading
@@ -259,6 +310,10 @@ var RuntimeLoader = /** @class */ (function () {
259
310
  // Path to the Wasm file; default path works for testing only;
260
311
  // if embedded wasm is used then this is never used.
261
312
  RuntimeLoader.wasmURL = "https://unpkg.com/".concat(package_json__WEBPACK_IMPORTED_MODULE_1__.name, "@").concat(package_json__WEBPACK_IMPORTED_MODULE_1__.version, "/rive.wasm");
313
+ // Fallback WASM URL tried when the primary URL fails. Set to null to disable
314
+ // the fallback entirely. Defaults to pulling from the jsdelivr CDN.
315
+ RuntimeLoader.wasmFallbackURL = "https://cdn.jsdelivr.net/npm/".concat(package_json__WEBPACK_IMPORTED_MODULE_1__.name, "@").concat(package_json__WEBPACK_IMPORTED_MODULE_1__.version, "/rive_fallback.wasm");
316
+ RuntimeLoader.wasmBinary = null;
262
317
  /**
263
318
  * When true, performance.mark / performance.measure entries are emitted for
264
319
  * WASM initialization.
@@ -423,18 +478,18 @@ l.onRuntimeInitialized = function() {
423
478
  this.Ab = r.getContext("2d");
424
479
  this.Db = d;
425
480
  this.S = [];
426
- this.ka = 0;
481
+ this.ja = 0;
427
482
  this.clear = function() {
428
- console.assert(0 == this.ka);
483
+ console.assert(0 == this.ja);
429
484
  this.S = [];
430
485
  e.delete(this);
431
486
  };
432
487
  this.save = function() {
433
- ++this.ka;
488
+ ++this.ja;
434
489
  this.S.push(d.save.bind(d));
435
490
  };
436
491
  this.restore = function() {
437
- 0 < this.ka && (this.S.push(d.restore.bind(d)), --this.ka);
492
+ 0 < this.ja && (this.S.push(d.restore.bind(d)), --this.ja);
438
493
  };
439
494
  this.transform = function(u) {
440
495
  this.S.push(d.transform.bind(d, u));
@@ -443,7 +498,7 @@ l.onRuntimeInitialized = function() {
443
498
  this.S.push(d.align.bind(d, u, z, A, C, G));
444
499
  };
445
500
  this.flush = function() {
446
- console.assert(0 == this.ka);
501
+ console.assert(0 == this.ja);
447
502
  e.add(this);
448
503
  d.Ya || c();
449
504
  };
@@ -469,8 +524,8 @@ l.onRuntimeInitialized = function() {
469
524
  C.call(this);
470
525
  var G = this.La;
471
526
  q === w[G] && (q = null);
472
- "object" == typeof JSEvents && JSEvents.Kc(w[G].C.canvas);
473
- w[G] && w[G].C.canvas && (w[G].C.canvas.zb = void 0);
527
+ "object" == typeof JSEvents && JSEvents.Kc(w[G].F.canvas);
528
+ w[G] && w[G].F.canvas && (w[G].F.canvas.zb = void 0);
474
529
  this.La = this.G = this.Ma = this.T = w[G] = null;
475
530
  };
476
531
  return A;
@@ -479,7 +534,7 @@ l.onRuntimeInitialized = function() {
479
534
  if (d) {
480
535
  var r = d.Cb, u = 0, z = 0, A = 0, C = Array(e.size), G = 0;
481
536
  for (var J of e) {
482
- J.fa = Math.min(J.G.width, r), J.ea = Math.min(J.G.height, r), J.Ja = J.ea * J.fa, u = Math.max(u, J.fa), z = Math.max(z, J.ea), A += J.Ja, C[G++] = J;
537
+ J.ea = Math.min(J.G.width, r), J.da = Math.min(J.G.height, r), J.Ja = J.da * J.ea, u = Math.max(u, J.ea), z = Math.max(z, J.da), A += J.Ja, C[G++] = J;
483
538
  }
484
539
  e.clear();
485
540
  if (!(0 >= A)) {
@@ -494,13 +549,13 @@ l.onRuntimeInitialized = function() {
494
549
  for (J = 0; J < C.length;) {
495
550
  A.reset(u, z);
496
551
  for (G = J; G < C.length; ++G) {
497
- var K = C[G], I = A.addRect(K.fa, K.ea);
552
+ var K = C[G], I = A.addRect(K.ea, K.da);
498
553
  if (0 > I) {
499
554
  console.assert(G > J);
500
555
  break;
501
556
  }
502
- K.qa = I & 65535;
503
- K.ra = I >> 16;
557
+ K.pa = I & 65535;
558
+ K.qa = I >> 16;
504
559
  }
505
560
  K = p.push(A.drawWidth());
506
561
  I = m.push(A.drawHeight());
@@ -513,13 +568,13 @@ l.onRuntimeInitialized = function() {
513
568
  d.clear();
514
569
  for (K = J; K < G; ++K) {
515
570
  I = C[K];
516
- d.saveClipRect(I.qa, I.ra, I.qa + I.fa, I.ra + I.ea);
571
+ d.saveClipRect(I.pa, I.qa, I.pa + I.ea, I.qa + I.da);
517
572
  let Z = new l.Mat2D();
518
- Z.xx = I.fa / I.G.width;
519
- Z.yy = I.ea / I.G.height;
573
+ Z.xx = I.ea / I.G.width;
574
+ Z.yy = I.da / I.G.height;
520
575
  Z.xy = Z.yx = 0;
521
- Z.tx = I.qa;
522
- Z.ty = I.ra;
576
+ Z.tx = I.pa;
577
+ Z.ty = I.qa;
523
578
  d.transform(Z);
524
579
  for (const ob of I.S) {
525
580
  ob();
@@ -528,7 +583,7 @@ l.onRuntimeInitialized = function() {
528
583
  I.S = [];
529
584
  }
530
585
  for (d.flush(); J < G; ++J) {
531
- K = C[J], I = K.Ab, I.globalCompositeOperation = "copy", I.drawImage(d.G, K.qa, K.ra, K.fa, K.ea, 0, 0, K.G.width, K.G.height);
586
+ K = C[J], I = K.Ab, I.globalCompositeOperation = "copy", I.drawImage(d.G, K.pa, K.qa, K.ea, K.da, 0, 0, K.G.width, K.G.height);
532
587
  }
533
588
  J = G;
534
589
  }
@@ -691,54 +746,54 @@ function Na(a, b) {
691
746
  return Ma(c, a, b);
692
747
  }));
693
748
  }
694
- var Oa, Pa, Ta = {564097:(a, b, c, d, e) => {
749
+ var Oa, Pa, Ta = {564189:(a, b, c, d, e) => {
695
750
  if ("undefined" === typeof window || void 0 === (window.AudioContext || window.webkitAudioContext)) {
696
751
  return 0;
697
752
  }
698
753
  if ("undefined" === typeof window.h) {
699
754
  window.h = {Ea:0};
700
755
  window.h.I = {};
701
- window.h.I.Ca = a;
756
+ window.h.I.Ba = a;
702
757
  window.h.I.capture = b;
703
758
  window.h.I.Pa = c;
704
- window.h.ia = {};
705
- window.h.ia.stopped = d;
706
- window.h.ia.ub = e;
759
+ window.h.ha = {};
760
+ window.h.ha.stopped = d;
761
+ window.h.ha.ub = e;
707
762
  let f = window.h;
708
- f.D = [];
763
+ f.C = [];
709
764
  f.lc = function(g) {
710
- for (var k = 0; k < f.D.length; ++k) {
711
- if (null == f.D[k]) {
712
- return f.D[k] = g, k;
765
+ for (var k = 0; k < f.C.length; ++k) {
766
+ if (null == f.C[k]) {
767
+ return f.C[k] = g, k;
713
768
  }
714
769
  }
715
- f.D.push(g);
716
- return f.D.length - 1;
770
+ f.C.push(g);
771
+ return f.C.length - 1;
717
772
  };
718
773
  f.yb = function(g) {
719
- for (f.D[g] = null; 0 < f.D.length;) {
720
- if (null == f.D[f.D.length - 1]) {
721
- f.D.pop();
774
+ for (f.C[g] = null; 0 < f.C.length;) {
775
+ if (null == f.C[f.C.length - 1]) {
776
+ f.C.pop();
722
777
  } else {
723
778
  break;
724
779
  }
725
780
  }
726
781
  };
727
782
  f.Mc = function(g) {
728
- for (var k = 0; k < f.D.length; ++k) {
729
- if (f.D[k] == g) {
783
+ for (var k = 0; k < f.C.length; ++k) {
784
+ if (f.C[k] == g) {
730
785
  return f.yb(k);
731
786
  }
732
787
  }
733
788
  };
734
- f.ta = function(g) {
735
- return f.D[g];
789
+ f.sa = function(g) {
790
+ return f.C[g];
736
791
  };
737
792
  f.Xa = ["touchend", "click"];
738
793
  f.unlock = function() {
739
- for (var g = 0; g < f.D.length; ++g) {
740
- var k = f.D[g];
741
- null != k && null != k.K && k.state === f.ia.ub && k.K.resume().then(() => {
794
+ for (var g = 0; g < f.C.length; ++g) {
795
+ var k = f.C[g];
796
+ null != k && null != k.K && k.state === f.ha.ub && k.K.resume().then(() => {
742
797
  Qa(k.nb);
743
798
  }, p => {
744
799
  console.error("Failed to resume audiocontext", p);
@@ -754,11 +809,11 @@ var Oa, Pa, Ta = {564097:(a, b, c, d, e) => {
754
809
  }
755
810
  window.h.Ea += 1;
756
811
  return 1;
757
- }, 566275:() => {
812
+ }, 566367:() => {
758
813
  "undefined" !== typeof window.h && (window.h.Xa.map(function(a) {
759
814
  document.removeEventListener(a, window.h.unlock, !0);
760
815
  }), --window.h.Ea, 0 === window.h.Ea && delete window.h);
761
- }, 566579:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 566683:() => {
816
+ }, 566671:() => void 0 !== navigator.mediaDevices && void 0 !== navigator.mediaDevices.getUserMedia, 566775:() => {
762
817
  try {
763
818
  var a = new (window.AudioContext || window.webkitAudioContext)(), b = a.sampleRate;
764
819
  a.close();
@@ -766,33 +821,33 @@ var Oa, Pa, Ta = {564097:(a, b, c, d, e) => {
766
821
  } catch (c) {
767
822
  return 0;
768
823
  }
769
- }, 566854:(a, b, c, d, e, f) => {
824
+ }, 566946:(a, b, c, d, e, f) => {
770
825
  if ("undefined" === typeof window.h) {
771
826
  return -1;
772
827
  }
773
828
  var g = {}, k = {};
774
- a == window.h.I.Ca && 0 != c && (k.sampleRate = c);
829
+ a == window.h.I.Ba && 0 != c && (k.sampleRate = c);
775
830
  g.K = new (window.AudioContext || window.webkitAudioContext)(k);
776
831
  g.K.suspend();
777
- g.state = window.h.ia.stopped;
832
+ g.state = window.h.ha.stopped;
778
833
  c = 0;
779
- a != window.h.I.Ca && (c = b);
834
+ a != window.h.I.Ba && (c = b);
780
835
  g.Y = g.K.createScriptProcessor(d, c, b);
781
836
  g.Y.onaudioprocess = function(p) {
782
- if (null == g.ua || 0 == g.ua.length) {
783
- g.ua = new Float32Array(xa.buffer, e, d * b);
837
+ if (null == g.ta || 0 == g.ta.length) {
838
+ g.ta = new Float32Array(xa.buffer, e, d * b);
784
839
  }
785
840
  if (a == window.h.I.capture || a == window.h.I.Pa) {
786
841
  for (var m = 0; m < b; m += 1) {
787
- for (var t = p.inputBuffer.getChannelData(m), v = g.ua, x = 0; x < d; x += 1) {
842
+ for (var t = p.inputBuffer.getChannelData(m), v = g.ta, x = 0; x < d; x += 1) {
788
843
  v[x * b + m] = t[x];
789
844
  }
790
845
  }
791
846
  Ra(f, d, e);
792
847
  }
793
- if (a == window.h.I.Ca || a == window.h.I.Pa) {
848
+ if (a == window.h.I.Ba || a == window.h.I.Pa) {
794
849
  for (Sa(f, d, e), m = 0; m < p.outputBuffer.numberOfChannels; ++m) {
795
- for (t = p.outputBuffer.getChannelData(m), v = g.ua, x = 0; x < d; x += 1) {
850
+ for (t = p.outputBuffer.getChannelData(m), v = g.ta, x = 0; x < d; x += 1) {
796
851
  t[x] = v[x * b + m];
797
852
  }
798
853
  }
@@ -809,27 +864,27 @@ var Oa, Pa, Ta = {564097:(a, b, c, d, e) => {
809
864
  }).catch(function(p) {
810
865
  console.log("Failed to get user media: " + p);
811
866
  });
812
- a == window.h.I.Ca && g.Y.connect(g.K.destination);
867
+ a == window.h.I.Ba && g.Y.connect(g.K.destination);
813
868
  g.nb = f;
814
869
  return window.h.lc(g);
815
- }, 569731:a => window.h.ta(a).K.sampleRate, 569804:a => {
816
- a = window.h.ta(a);
870
+ }, 569823:a => window.h.sa(a).K.sampleRate, 569896:a => {
871
+ a = window.h.sa(a);
817
872
  void 0 !== a.Y && (a.Y.onaudioprocess = function() {
818
873
  }, a.Y.disconnect(), a.Y = void 0);
819
874
  void 0 !== a.Fa && (a.Fa.disconnect(), a.Fa = void 0);
820
875
  a.K.close();
821
876
  a.K = void 0;
822
877
  a.nb = void 0;
823
- }, 570204:a => {
878
+ }, 570296:a => {
824
879
  window.h.yb(a);
825
- }, 570254:a => {
826
- a = window.h.ta(a);
880
+ }, 570346:a => {
881
+ a = window.h.sa(a);
827
882
  a.K.resume();
828
- a.state = window.h.ia.ub;
829
- }, 570393:a => {
830
- a = window.h.ta(a);
883
+ a.state = window.h.ha.ub;
884
+ }, 570485:a => {
885
+ a = window.h.sa(a);
831
886
  a.K.suspend();
832
- a.state = window.h.ia.stopped;
887
+ a.state = window.h.ha.stopped;
833
888
  }}, Ua = a => {
834
889
  for (; 0 < a.length;) {
835
890
  a.shift()(l);
@@ -985,9 +1040,9 @@ var lb = {open(a) {
985
1040
  a.s = b;
986
1041
  a.seekable = !1;
987
1042
  }, close(a) {
988
- a.s.V.sa(a.s);
989
- }, sa(a) {
990
- a.s.V.sa(a.s);
1043
+ a.s.V.ra(a.s);
1044
+ }, ra(a) {
1045
+ a.s.V.ra(a.s);
991
1046
  }, read(a, b, c, d) {
992
1047
  if (!a.s || !a.s.V.hb) {
993
1048
  throw new M(60);
@@ -1038,7 +1093,7 @@ var lb = {open(a) {
1038
1093
  return a;
1039
1094
  }, Sa(a, b) {
1040
1095
  null === b || 10 === b ? (ra(L(a.H, 0)), a.H = []) : 0 != b && a.H.push(b);
1041
- }, sa(a) {
1096
+ }, ra(a) {
1042
1097
  a.H && 0 < a.H.length && (ra(L(a.H, 0)), a.H = []);
1043
1098
  }, Vb() {
1044
1099
  return {sc:25856, uc:5, rc:191, tc:35387, qc:[3, 28, 127, 21, 4, 0, 1, 0, 17, 19, 26, 0, 18, 15, 23, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,]};
@@ -1048,7 +1103,7 @@ var lb = {open(a) {
1048
1103
  return [24, 80];
1049
1104
  },}, nb = {Sa(a, b) {
1050
1105
  null === b || 10 === b ? (sa(L(a.H, 0)), a.H = []) : 0 != b && a.H.push(b);
1051
- }, sa(a) {
1106
+ }, ra(a) {
1052
1107
  a.H && 0 < a.H.length && (sa(L(a.H, 0)), a.H = []);
1053
1108
  },};
1054
1109
  function pb(a, b) {
@@ -1061,7 +1116,7 @@ var N = {N:null, U() {
1061
1116
  if (24576 === (c & 61440) || 4096 === (c & 61440)) {
1062
1117
  throw new M(63);
1063
1118
  }
1064
- N.N || (N.N = {dir:{node:{X:N.j.X, P:N.j.P, la:N.j.la, Aa:N.j.Aa, sb:N.j.sb, xb:N.j.xb, tb:N.j.tb, rb:N.j.rb, Ga:N.j.Ga}, stream:{aa:N.m.aa}}, file:{node:{X:N.j.X, P:N.j.P}, stream:{aa:N.m.aa, read:N.m.read, write:N.m.write, $a:N.m.$a, jb:N.m.jb, lb:N.m.lb}}, link:{node:{X:N.j.X, P:N.j.P, ma:N.j.ma}, stream:{}}, ab:{node:{X:N.j.X, P:N.j.P}, stream:qb}});
1119
+ N.N || (N.N = {dir:{node:{X:N.j.X, P:N.j.P, ka:N.j.ka, za:N.j.za, sb:N.j.sb, xb:N.j.xb, tb:N.j.tb, rb:N.j.rb, Ga:N.j.Ga}, stream:{aa:N.m.aa}}, file:{node:{X:N.j.X, P:N.j.P}, stream:{aa:N.m.aa, read:N.m.read, write:N.m.write, $a:N.m.$a, jb:N.m.jb, lb:N.m.lb}}, link:{node:{X:N.j.X, P:N.j.P, la:N.j.la}, stream:{}}, ab:{node:{X:N.j.X, P:N.j.P}, stream:qb}});
1065
1120
  c = rb(a, b, c, d);
1066
1121
  16384 === (c.mode & 61440) ? (c.j = N.N.dir.node, c.m = N.N.dir.stream, c.l = {}) : 32768 === (c.mode & 61440) ? (c.j = N.N.file.node, c.m = N.N.file.stream, c.v = 0, c.l = null) : 40960 === (c.mode & 61440) ? (c.j = N.N.link.node, c.m = N.N.link.stream) : 8192 === (c.mode & 61440) && (c.j = N.N.ab.node, c.m = N.N.ab.stream);
1067
1122
  c.timestamp = Date.now();
@@ -1098,9 +1153,9 @@ var N = {N:null, U() {
1098
1153
  a.v = b;
1099
1154
  }
1100
1155
  }
1101
- }, la() {
1156
+ }, ka() {
1102
1157
  throw sb[44];
1103
- }, Aa(a, b, c, d) {
1158
+ }, za(a, b, c, d) {
1104
1159
  return N.createNode(a, b, c, d);
1105
1160
  }, sb(a, b, c) {
1106
1161
  if (16384 === (a.mode & 61440)) {
@@ -1139,7 +1194,7 @@ var N = {N:null, U() {
1139
1194
  a = N.createNode(a, b, 41471, 0);
1140
1195
  a.link = c;
1141
1196
  return a;
1142
- }, ma(a) {
1197
+ }, la(a) {
1143
1198
  if (40960 !== (a.mode & 61440)) {
1144
1199
  throw new M(28);
1145
1200
  }
@@ -1250,7 +1305,7 @@ var N = {N:null, U() {
1250
1305
  a ||= this;
1251
1306
  this.parent = a;
1252
1307
  this.U = a.U;
1253
- this.Ba = null;
1308
+ this.Aa = null;
1254
1309
  this.id = yb++;
1255
1310
  this.name = b;
1256
1311
  this.mode = c;
@@ -1288,7 +1343,7 @@ function Db(a, b = {}) {
1288
1343
  }
1289
1344
  c = tb(c, a[e]);
1290
1345
  d = Ya(d + "/" + a[e]);
1291
- c.Ba && (!f || f && b.gb) && (c = c.Ba.root);
1346
+ c.Aa && (!f || f && b.gb) && (c = c.Aa.root);
1292
1347
  if (!f || b.fb) {
1293
1348
  for (f = 0; 40960 === (c.mode & 61440);) {
1294
1349
  if (c = Eb(d), d = cb(Za(d), c), c = Db(d, {Ua:b.Ua + 1}).node, 40 < f++) {
@@ -1315,7 +1370,7 @@ function Gb(a, b) {
1315
1370
  return (a + c >>> 0) % zb.length;
1316
1371
  }
1317
1372
  function tb(a, b) {
1318
- var c = 16384 === (a.mode & 61440) ? (c = Hb(a, "x")) ? c : a.j.la ? 0 : 2 : 54;
1373
+ var c = 16384 === (a.mode & 61440) ? (c = Hb(a, "x")) ? c : a.j.ka ? 0 : 2 : 54;
1319
1374
  if (c) {
1320
1375
  throw new M(c);
1321
1376
  }
@@ -1325,7 +1380,7 @@ function tb(a, b) {
1325
1380
  return c;
1326
1381
  }
1327
1382
  }
1328
- return a.j.la(a, b);
1383
+ return a.j.ka(a, b);
1329
1384
  }
1330
1385
  function rb(a, b, c, d) {
1331
1386
  a = new Cb(a, b, c, d);
@@ -1403,7 +1458,7 @@ function Nb(a, b) {
1403
1458
  var d = Db(b, {gb:!1});
1404
1459
  b = d.path;
1405
1460
  d = d.node;
1406
- if (d.Ba) {
1461
+ if (d.Aa) {
1407
1462
  throw new M(10);
1408
1463
  }
1409
1464
  if (16384 !== (d.mode & 61440)) {
@@ -1414,7 +1469,7 @@ function Nb(a, b) {
1414
1469
  a = a.U(b);
1415
1470
  a.U = b;
1416
1471
  b.root = a;
1417
- c ? vb = a : d && (d.Ba = b, d.U && d.U.Yb.push(b));
1472
+ c ? vb = a : d && (d.Aa = b, d.U && d.U.Yb.push(b));
1418
1473
  }
1419
1474
  function Ob(a, b, c) {
1420
1475
  var d = Db(a, {parent:!0}).node;
@@ -1426,10 +1481,10 @@ function Ob(a, b, c) {
1426
1481
  if (e) {
1427
1482
  throw new M(e);
1428
1483
  }
1429
- if (!d.j.Aa) {
1484
+ if (!d.j.za) {
1430
1485
  throw new M(63);
1431
1486
  }
1432
- return d.j.Aa(d, a, b, c);
1487
+ return d.j.za(d, a, b, c);
1433
1488
  }
1434
1489
  function Pb(a) {
1435
1490
  return Ob(a, 16895, 0);
@@ -1461,10 +1516,10 @@ function Eb(a) {
1461
1516
  if (!a) {
1462
1517
  throw new M(44);
1463
1518
  }
1464
- if (!a.j.ma) {
1519
+ if (!a.j.la) {
1465
1520
  throw new M(28);
1466
1521
  }
1467
- return cb(Fb(a.parent), a.j.ma(a));
1522
+ return cb(Fb(a.parent), a.j.la(a));
1468
1523
  }
1469
1524
  function Sb(a, b, c) {
1470
1525
  if ("" === a) {
@@ -1626,7 +1681,7 @@ var Xb, Yb = {}, Tb, Wa = void 0, Zb = (a, b) => Object.defineProperty(b, "name"
1626
1681
  }, ec = [], fc = () => {
1627
1682
  for (; ec.length;) {
1628
1683
  var a = ec.pop();
1629
- a.g.ha = !1;
1684
+ a.g.ga = !1;
1630
1685
  a["delete"]();
1631
1686
  }
1632
1687
  }, gc, hc = {}, ic = (a, b) => {
@@ -1634,7 +1689,7 @@ var Xb, Yb = {}, Tb, Wa = void 0, Zb = (a, b) => Object.defineProperty(b, "name"
1634
1689
  throw new P("ptr should not be undefined");
1635
1690
  }
1636
1691
  for (; a.B;) {
1637
- b = a.oa(b), a = a.B;
1692
+ b = a.na(b), a = a.B;
1638
1693
  }
1639
1694
  return b;
1640
1695
  }, jc = {}, mc = a => {
@@ -1665,7 +1720,7 @@ var Xb, Yb = {}, Tb, Wa = void 0, Zb = (a, b) => Object.defineProperty(b, "name"
1665
1720
  if (!b.u || !b.o) {
1666
1721
  throw new tc("makeClassHandle requires ptr and ptrType");
1667
1722
  }
1668
- if (!!b.J !== !!b.F) {
1723
+ if (!!b.J !== !!b.D) {
1669
1724
  throw new tc("Both smartPtrType and smartPtr must be specified");
1670
1725
  }
1671
1726
  b.count = {value:1};
@@ -1677,11 +1732,11 @@ var Xb, Yb = {}, Tb, Wa = void 0, Zb = (a, b) => Object.defineProperty(b, "name"
1677
1732
  pc = new FinalizationRegistry(b => {
1678
1733
  b = b.g;
1679
1734
  --b.count.value;
1680
- 0 === b.count.value && (b.F ? b.J.O(b.F) : b.u.i.O(b.o));
1735
+ 0 === b.count.value && (b.D ? b.J.O(b.D) : b.u.i.O(b.o));
1681
1736
  });
1682
1737
  uc = b => {
1683
1738
  var c = b.g;
1684
- c.F && pc.register(b, {g:c}, b);
1739
+ c.D && pc.register(b, {g:c}, b);
1685
1740
  return b;
1686
1741
  };
1687
1742
  oc = b => {
@@ -1756,7 +1811,7 @@ var Ec = (a, b, c) => {
1756
1811
  return a[b].A[e.length].apply(this, e);
1757
1812
  };
1758
1813
  a[b].A = [];
1759
- a[b].A[d.ga] = d;
1814
+ a[b].A[d.fa] = d;
1760
1815
  }
1761
1816
  }, Fc = (a, b, c) => {
1762
1817
  if (l.hasOwnProperty(a)) {
@@ -1786,16 +1841,16 @@ function Hc(a, b, c, d, e, f, g, k) {
1786
1841
  this.O = d;
1787
1842
  this.B = e;
1788
1843
  this.Nb = f;
1789
- this.oa = g;
1844
+ this.na = g;
1790
1845
  this.Ib = k;
1791
1846
  this.ob = [];
1792
1847
  }
1793
1848
  var Ic = (a, b, c) => {
1794
1849
  for (; b !== c;) {
1795
- if (!b.oa) {
1850
+ if (!b.na) {
1796
1851
  throw new P(`Expected null or instance of ${c.name}, got an instance of ${b.name}`);
1797
1852
  }
1798
- a = b.oa(a);
1853
+ a = b.na(a);
1799
1854
  b = b.B;
1800
1855
  }
1801
1856
  return a;
@@ -1820,7 +1875,7 @@ function Lc(a, b) {
1820
1875
  if (this.Ra) {
1821
1876
  throw new P(`null is not a valid ${this.name}`);
1822
1877
  }
1823
- if (this.wa) {
1878
+ if (this.va) {
1824
1879
  var c = this.Ta();
1825
1880
  null !== a && a.push(this.O, c);
1826
1881
  return c;
@@ -1833,28 +1888,28 @@ function Lc(a, b) {
1833
1888
  if (!b.g.o) {
1834
1889
  throw new P(`Cannot pass deleted object as a pointer of type ${this.name}`);
1835
1890
  }
1836
- if (!this.va && b.g.u.va) {
1891
+ if (!this.ua && b.g.u.ua) {
1837
1892
  throw new P(`Cannot convert argument of type ${b.g.J ? b.g.J.name : b.g.u.name} to parameter type ${this.name}`);
1838
1893
  }
1839
1894
  c = Ic(b.g.o, b.g.u.i, this.i);
1840
- if (this.wa) {
1841
- if (void 0 === b.g.F) {
1895
+ if (this.va) {
1896
+ if (void 0 === b.g.D) {
1842
1897
  throw new P("Passing raw pointer to smart pointer is illegal");
1843
1898
  }
1844
1899
  switch(this.fc) {
1845
1900
  case 0:
1846
1901
  if (b.g.J === this) {
1847
- c = b.g.F;
1902
+ c = b.g.D;
1848
1903
  } else {
1849
1904
  throw new P(`Cannot convert argument of type ${b.g.J ? b.g.J.name : b.g.u.name} to parameter type ${this.name}`);
1850
1905
  }
1851
1906
  break;
1852
1907
  case 1:
1853
- c = b.g.F;
1908
+ c = b.g.D;
1854
1909
  break;
1855
1910
  case 2:
1856
1911
  if (b.g.J === this) {
1857
- c = b.g.F;
1912
+ c = b.g.D;
1858
1913
  } else {
1859
1914
  var d = b.clone();
1860
1915
  c = this.bc(c, ac(() => d["delete"]()));
@@ -1880,7 +1935,7 @@ function Mc(a, b) {
1880
1935
  if (!b.g.o) {
1881
1936
  throw new P(`Cannot pass deleted object as a pointer of type ${this.name}`);
1882
1937
  }
1883
- if (b.g.u.va) {
1938
+ if (b.g.u.ua) {
1884
1939
  throw new P(`Cannot convert argument of type ${b.g.u.name} to parameter type ${this.name}`);
1885
1940
  }
1886
1941
  return Ic(b.g.o, b.g.u.i, this.i);
@@ -1889,8 +1944,8 @@ function Nc(a, b, c, d, e, f, g, k, p, m, t) {
1889
1944
  this.name = a;
1890
1945
  this.i = b;
1891
1946
  this.Ra = c;
1892
- this.va = d;
1893
- this.wa = e;
1947
+ this.ua = d;
1948
+ this.va = e;
1894
1949
  this.ac = f;
1895
1950
  this.fc = g;
1896
1951
  this.qb = k;
@@ -1903,7 +1958,7 @@ var Oc = (a, b, c) => {
1903
1958
  if (!l.hasOwnProperty(a)) {
1904
1959
  throw new tc("Replacing nonexistent public symbol");
1905
1960
  }
1906
- void 0 !== l[a].A && void 0 !== c ? l[a].A[c] = b : (l[a] = b, l[a].ga = c);
1961
+ void 0 !== l[a].A && void 0 !== c ? l[a].A[c] = b : (l[a] = b, l[a].fa = c);
1907
1962
  }, Pc = [], Qc, Rc = a => {
1908
1963
  var b = Pc[a];
1909
1964
  b || (a >= Pc.length && (Pc.length = a + 1), Pc[a] = b = Qc.get(a));
@@ -2151,20 +2206,20 @@ var Yc = (a, b) => {
2151
2206
  F[b + 4 * e >> 2] = g;
2152
2207
  }
2153
2208
  }, ka = (a, b) => {
2154
- var c = Ld(w), d = {handle:c, attributes:b, version:b.Ec, C:a};
2209
+ var c = Ld(w), d = {handle:c, attributes:b, version:b.Ec, F:a};
2155
2210
  a.canvas && (a.canvas.zb = d);
2156
2211
  w[c] = d;
2157
2212
  ("undefined" == typeof b.Jb || b.Jb) && Nd(d);
2158
2213
  return c;
2159
2214
  }, la = a => {
2160
2215
  q = w[a];
2161
- l.wc = W = q?.C;
2216
+ l.wc = W = q?.F;
2162
2217
  return !(a && !W);
2163
2218
  }, Nd = a => {
2164
2219
  a ||= q;
2165
2220
  if (!a.Tb) {
2166
2221
  a.Tb = !0;
2167
- var b = a.C;
2222
+ var b = a.F;
2168
2223
  yd(b);
2169
2224
  zd(b);
2170
2225
  2 <= a.version && (b.cb = b.getExtension("EXT_disjoint_timer_query_webgl2"));
@@ -2335,8 +2390,8 @@ var Td = (a, b) => {
2335
2390
  }
2336
2391
  }
2337
2392
  function p(n) {
2338
- var r = n.ca;
2339
- for (n = new Date((new Date(n.da + 1900, 0, 1)).getTime()); 0 < r;) {
2393
+ var r = n.ba;
2394
+ for (n = new Date((new Date(n.ca + 1900, 0, 1)).getTime()); 0 < r;) {
2340
2395
  var u = n.getMonth(), z = (ud(n.getFullYear()) ? Yd : Zd)[u];
2341
2396
  if (r > z - n.getDate()) {
2342
2397
  r -= z - n.getDate() + 1, n.setDate(1), 11 > u ? n.setMonth(u + 1) : (n.setMonth(0), n.setFullYear(n.getFullYear() + 1));
@@ -2351,33 +2406,33 @@ var Td = (a, b) => {
2351
2406
  return 0 >= g(r, n) ? 0 >= g(u, n) ? n.getFullYear() + 1 : n.getFullYear() : n.getFullYear() - 1;
2352
2407
  }
2353
2408
  var m = H[d + 40 >> 2];
2354
- d = {jc:F[d >> 2], ic:F[d + 4 >> 2], Ha:F[d + 8 >> 2], Va:F[d + 12 >> 2], Ia:F[d + 16 >> 2], da:F[d + 20 >> 2], R:F[d + 24 >> 2], ca:F[d + 28 >> 2], Lc:F[d + 32 >> 2], hc:F[d + 36 >> 2], kc:m ? m ? L(D, m) : "" : ""};
2409
+ d = {jc:F[d >> 2], ic:F[d + 4 >> 2], Ha:F[d + 8 >> 2], Va:F[d + 12 >> 2], Ia:F[d + 16 >> 2], ca:F[d + 20 >> 2], R:F[d + 24 >> 2], ba:F[d + 28 >> 2], Lc:F[d + 32 >> 2], hc:F[d + 36 >> 2], kc:m ? m ? L(D, m) : "" : ""};
2355
2410
  c = c ? L(D, c) : "";
2356
2411
  m = {"%c":"%a %b %d %H:%M:%S %Y", "%D":"%m/%d/%y", "%F":"%Y-%m-%d", "%h":"%b", "%r":"%I:%M:%S %p", "%R":"%H:%M", "%T":"%H:%M:%S", "%x":"%m/%d/%y", "%X":"%H:%M:%S", "%Ec":"%c", "%EC":"%C", "%Ex":"%m/%d/%y", "%EX":"%H:%M:%S", "%Ey":"%y", "%EY":"%Y", "%Od":"%d", "%Oe":"%e", "%OH":"%H", "%OI":"%I", "%Om":"%m", "%OM":"%M", "%OS":"%S", "%Ou":"%u", "%OU":"%U", "%OV":"%V", "%Ow":"%w", "%OW":"%W", "%Oy":"%y",};
2357
2412
  for (var t in m) {
2358
2413
  c = c.replace(new RegExp(t, "g"), m[t]);
2359
2414
  }
2360
2415
  var v = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "), x = "January February March April May June July August September October November December".split(" ");
2361
- m = {"%a":n => v[n.R].substring(0, 3), "%A":n => v[n.R], "%b":n => x[n.Ia].substring(0, 3), "%B":n => x[n.Ia], "%C":n => f((n.da + 1900) / 100 | 0, 2), "%d":n => f(n.Va, 2), "%e":n => e(n.Va, 2, " "), "%g":n => p(n).toString().substring(2), "%G":p, "%H":n => f(n.Ha, 2), "%I":n => {
2416
+ m = {"%a":n => v[n.R].substring(0, 3), "%A":n => v[n.R], "%b":n => x[n.Ia].substring(0, 3), "%B":n => x[n.Ia], "%C":n => f((n.ca + 1900) / 100 | 0, 2), "%d":n => f(n.Va, 2), "%e":n => e(n.Va, 2, " "), "%g":n => p(n).toString().substring(2), "%G":p, "%H":n => f(n.Ha, 2), "%I":n => {
2362
2417
  n = n.Ha;
2363
2418
  0 == n ? n = 12 : 12 < n && (n -= 12);
2364
2419
  return f(n, 2);
2365
2420
  }, "%j":n => {
2366
- for (var r = 0, u = 0; u <= n.Ia - 1; r += (ud(n.da + 1900) ? Yd : Zd)[u++]) {
2421
+ for (var r = 0, u = 0; u <= n.Ia - 1; r += (ud(n.ca + 1900) ? Yd : Zd)[u++]) {
2367
2422
  }
2368
2423
  return f(n.Va + r, 3);
2369
- }, "%m":n => f(n.Ia + 1, 2), "%M":n => f(n.ic, 2), "%n":() => "\n", "%p":n => 0 <= n.Ha && 12 > n.Ha ? "AM" : "PM", "%S":n => f(n.jc, 2), "%t":() => "\t", "%u":n => n.R || 7, "%U":n => f(Math.floor((n.ca + 7 - n.R) / 7), 2), "%V":n => {
2370
- var r = Math.floor((n.ca + 7 - (n.R + 6) % 7) / 7);
2371
- 2 >= (n.R + 371 - n.ca - 2) % 7 && r++;
2424
+ }, "%m":n => f(n.Ia + 1, 2), "%M":n => f(n.ic, 2), "%n":() => "\n", "%p":n => 0 <= n.Ha && 12 > n.Ha ? "AM" : "PM", "%S":n => f(n.jc, 2), "%t":() => "\t", "%u":n => n.R || 7, "%U":n => f(Math.floor((n.ba + 7 - n.R) / 7), 2), "%V":n => {
2425
+ var r = Math.floor((n.ba + 7 - (n.R + 6) % 7) / 7);
2426
+ 2 >= (n.R + 371 - n.ba - 2) % 7 && r++;
2372
2427
  if (r) {
2373
- 53 == r && (u = (n.R + 371 - n.ca) % 7, 4 == u || 3 == u && ud(n.da) || (r = 1));
2428
+ 53 == r && (u = (n.R + 371 - n.ba) % 7, 4 == u || 3 == u && ud(n.ca) || (r = 1));
2374
2429
  } else {
2375
2430
  r = 52;
2376
- var u = (n.R + 7 - n.ca - 1) % 7;
2377
- (4 == u || 5 == u && ud(n.da % 400 - 1)) && r++;
2431
+ var u = (n.R + 7 - n.ba - 1) % 7;
2432
+ (4 == u || 5 == u && ud(n.ca % 400 - 1)) && r++;
2378
2433
  }
2379
2434
  return f(r, 2);
2380
- }, "%w":n => n.R, "%W":n => f(Math.floor((n.ca + 7 - (n.R + 6) % 7) / 7), 2), "%y":n => (n.da + 1900).toString().substring(2), "%Y":n => n.da + 1900, "%z":n => {
2435
+ }, "%w":n => n.R, "%W":n => f(Math.floor((n.ba + 7 - (n.R + 6) % 7) / 7), 2), "%y":n => (n.ca + 1900).toString().substring(2), "%Y":n => n.ca + 1900, "%z":n => {
2381
2436
  n = n.hc;
2382
2437
  var r = 0 <= n;
2383
2438
  n = Math.abs(n) / 60;
@@ -2427,9 +2482,9 @@ Pb("/home/web_user");
2427
2482
  Pb("/proc/self/fd");
2428
2483
  Nb({U() {
2429
2484
  var b = rb(a, "fd", 16895, 73);
2430
- b.j = {la(c, d) {
2485
+ b.j = {ka(c, d) {
2431
2486
  var e = Kb(+d);
2432
- c = {parent:null, U:{kb:"fake"}, j:{ma:() => e.path},};
2487
+ c = {parent:null, U:{kb:"fake"}, j:{la:() => e.path},};
2433
2488
  return c.parent = c;
2434
2489
  }};
2435
2490
  return b;
@@ -2475,42 +2530,42 @@ Object.assign(Dc.prototype, {isAliasOf:function(a) {
2475
2530
  a.g = a.g;
2476
2531
  var d = a.g.u.i;
2477
2532
  for (a = a.g.o; b.B;) {
2478
- c = b.oa(c), b = b.B;
2533
+ c = b.na(c), b = b.B;
2479
2534
  }
2480
2535
  for (; d.B;) {
2481
- a = d.oa(a), d = d.B;
2536
+ a = d.na(a), d = d.B;
2482
2537
  }
2483
2538
  return b === d && c === a;
2484
2539
  }, clone:function() {
2485
2540
  this.g.o || Cc(this);
2486
- if (this.g.ja) {
2541
+ if (this.g.ia) {
2487
2542
  return this.g.count.value += 1, this;
2488
2543
  }
2489
2544
  var a = uc, b = Object, c = b.create, d = Object.getPrototypeOf(this), e = this.g;
2490
- a = a(c.call(b, d, {g:{value:{count:e.count, ha:e.ha, ja:e.ja, o:e.o, u:e.u, F:e.F, J:e.J,},}}));
2545
+ a = a(c.call(b, d, {g:{value:{count:e.count, ga:e.ga, ia:e.ia, o:e.o, u:e.u, D:e.D, J:e.J,},}}));
2491
2546
  a.g.count.value += 1;
2492
- a.g.ha = !1;
2547
+ a.g.ga = !1;
2493
2548
  return a;
2494
2549
  }, ["delete"]() {
2495
2550
  this.g.o || Cc(this);
2496
- if (this.g.ha && !this.g.ja) {
2551
+ if (this.g.ga && !this.g.ia) {
2497
2552
  throw new P("Object already scheduled for deletion");
2498
2553
  }
2499
2554
  oc(this);
2500
2555
  var a = this.g;
2501
2556
  --a.count.value;
2502
- 0 === a.count.value && (a.F ? a.J.O(a.F) : a.u.i.O(a.o));
2503
- this.g.ja || (this.g.F = void 0, this.g.o = void 0);
2557
+ 0 === a.count.value && (a.D ? a.J.O(a.D) : a.u.i.O(a.o));
2558
+ this.g.ia || (this.g.D = void 0, this.g.o = void 0);
2504
2559
  }, isDeleted:function() {
2505
2560
  return !this.g.o;
2506
2561
  }, deleteLater:function() {
2507
2562
  this.g.o || Cc(this);
2508
- if (this.g.ha && !this.g.ja) {
2563
+ if (this.g.ga && !this.g.ia) {
2509
2564
  throw new P("Object already scheduled for deletion");
2510
2565
  }
2511
2566
  ec.push(this);
2512
2567
  1 === ec.length && gc && gc(fc);
2513
- this.g.ha = !0;
2568
+ this.g.ga = !0;
2514
2569
  return this;
2515
2570
  },});
2516
2571
  Object.assign(Nc.prototype, {Ob(a) {
@@ -2520,7 +2575,7 @@ Object.assign(Nc.prototype, {Ob(a) {
2520
2575
  this.O?.(a);
2521
2576
  }, argPackAdvance:8, readValueFromPointer:yc, fromWireType:function(a) {
2522
2577
  function b() {
2523
- return this.wa ? vc(this.i.M, {u:this.ac, o:c, J:this, F:a,}) : vc(this.i.M, {u:this, o:a,});
2578
+ return this.va ? vc(this.i.M, {u:this.ac, o:c, J:this, D:a,}) : vc(this.i.M, {u:this, o:a,});
2524
2579
  }
2525
2580
  var c = this.Ob(a);
2526
2581
  if (!c) {
@@ -2529,7 +2584,7 @@ Object.assign(Nc.prototype, {Ob(a) {
2529
2584
  var d = sc(this.i, c);
2530
2585
  if (void 0 !== d) {
2531
2586
  if (0 === d.g.count.value) {
2532
- return d.g.o = c, d.g.F = a, d.clone();
2587
+ return d.g.o = c, d.g.D = a, d.clone();
2533
2588
  }
2534
2589
  d = d.clone();
2535
2590
  this.bb(a);
@@ -2540,9 +2595,9 @@ Object.assign(Nc.prototype, {Ob(a) {
2540
2595
  if (!d) {
2541
2596
  return b.call(this);
2542
2597
  }
2543
- d = this.va ? d.Gb : d.pointerType;
2598
+ d = this.ua ? d.Gb : d.pointerType;
2544
2599
  var e = qc(c, this.i, d.i);
2545
- return null === e ? b.call(this) : this.wa ? vc(d.i.M, {u:d, o:e, J:this, F:a,}) : vc(d.i.M, {u:d, o:e,});
2600
+ return null === e ? b.call(this) : this.va ? vc(d.i.M, {u:d, o:e, J:this, D:a,}) : vc(d.i.M, {u:d, o:e,});
2546
2601
  },});
2547
2602
  Uc = l.UnboundTypeError = bc("UnboundTypeError");
2548
2603
  for (var W, ce = 0; 32 > ce; ++ce) {
@@ -2700,7 +2755,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2700
2755
  oc(k);
2701
2756
  var p = k.g;
2702
2757
  k.notifyOnDestruction();
2703
- p.ja = !0;
2758
+ p.ia = !0;
2704
2759
  Object.defineProperties(this, {g:{value:p}});
2705
2760
  uc(this);
2706
2761
  k = p.o;
@@ -2807,8 +2862,8 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2807
2862
  var C = new Hc(t, r, A, x, u, f, k, m);
2808
2863
  if (C.B) {
2809
2864
  var G;
2810
- (G = C.B).pa ?? (G.pa = []);
2811
- C.B.pa.push(C);
2865
+ (G = C.B).oa ?? (G.oa = []);
2866
+ C.B.oa.push(C);
2812
2867
  }
2813
2868
  u = new Nc(t, C, !0, !1, !1);
2814
2869
  G = new Nc(t + "*", C, !1, !1, !1);
@@ -2830,12 +2885,12 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2830
2885
  var t = `${p.name}.${b}`;
2831
2886
  b.startsWith("@@") && (b = Symbol[b.substring(2)]);
2832
2887
  var v = p.i.constructor;
2833
- void 0 === v[b] ? (m.ga = c - 1, v[b] = m) : (Ec(v, b, t), v[b].A[c - 1] = m);
2888
+ void 0 === v[b] ? (m.fa = c - 1, v[b] = m) : (Ec(v, b, t), v[b].A[c - 1] = m);
2834
2889
  T([], k, x => {
2835
2890
  x = Xc(t, [x[0], null].concat(x.slice(1)), null, f, g);
2836
- void 0 === v[b].A ? (x.ga = c - 1, v[b] = x) : v[b].A[c - 1] = x;
2837
- if (p.i.pa) {
2838
- for (const n of p.i.pa) {
2891
+ void 0 === v[b].A ? (x.fa = c - 1, v[b] = x) : v[b].A[c - 1] = x;
2892
+ if (p.i.oa) {
2893
+ for (const n of p.i.oa) {
2839
2894
  n.constructor.hasOwnProperty(b) || (n.constructor[b] = x);
2840
2895
  }
2841
2896
  }
@@ -2906,10 +2961,10 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
2906
2961
  b.startsWith("@@") && (b = Symbol[b.substring(2)]);
2907
2962
  k && m.i.ob.push(b);
2908
2963
  var x = m.i.M, n = x[b];
2909
- void 0 === n || void 0 === n.A && n.className !== m.name && n.ga === c - 2 ? (t.ga = c - 2, t.className = m.name, x[b] = t) : (Ec(x, b, v), x[b].A[c - 2] = t);
2964
+ void 0 === n || void 0 === n.A && n.className !== m.name && n.fa === c - 2 ? (t.fa = c - 2, t.className = m.name, x[b] = t) : (Ec(x, b, v), x[b].A[c - 2] = t);
2910
2965
  T([], p, r => {
2911
2966
  r = Xc(v, r, m, f, g);
2912
- void 0 === x[b].A ? (r.ga = c - 2, x[b] = r) : x[b].A[c - 2] = r;
2967
+ void 0 === x[b].A ? (r.fa = c - 2, x[b] = r) : x[b].A[c - 2] = r;
2913
2968
  return [];
2914
2969
  });
2915
2970
  return [];
@@ -3177,7 +3232,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3177
3232
  g = a(g);
3178
3233
  k < e ? (gb(f, D, c, 17), gb(g, D, d, 17)) : (gb(f, D, d, 17), gb(g, D, c, 17));
3179
3234
  }, beginPixelLocalStorageWEBGL:function(a, b, c) {
3180
- (a = w[a].C.ba) && a.beginPixelLocalStorageWEBGL(l.HEAPU32.subarray(c, c + b));
3235
+ (a = w[a].F.Ca) && a.beginPixelLocalStorageWEBGL(l.HEAPU32.subarray(c, c + b));
3181
3236
  }, decode_image:function(a, b, c) {
3182
3237
  var d = l.images;
3183
3238
  d || (d = new Map(), l.images = d);
@@ -3237,17 +3292,17 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3237
3292
  "WEBGL_draw_instanced_base_vertex_base_instance" == b && yd(W);
3238
3293
  "WEBGL_multi_draw_instanced_base_vertex_base_instance" == b && zd(W);
3239
3294
  "WEBGL_multi_draw" == b && (W.Zb = W.getExtension("WEBGL_multi_draw"));
3240
- return !!a.C.getExtension(b);
3295
+ return !!a.F.getExtension(b);
3241
3296
  }, emscripten_webgl_get_current_context:() => q ? q.handle : 0, emscripten_webgl_make_context_current:a => la(a) ? 0 : -5, enable_WEBGL_provoking_vertex:function(a) {
3242
- a = w[a].C;
3297
+ a = w[a].F;
3243
3298
  a.pb = a.getExtension("WEBGL_provoking_vertex");
3244
3299
  return !!a.pb;
3245
3300
  }, enable_WEBGL_shader_pixel_local_storage_coherent:function(a) {
3246
- a = w[a].C;
3247
- a.ba = a.getExtension("WEBGL_shader_pixel_local_storage");
3248
- return !(!a.ba || !a.ba.isCoherent());
3301
+ a = w[a].F;
3302
+ const b = a.getExtension("WEBGL_shader_pixel_local_storage");
3303
+ return b && b.isCoherent() && 5 == b.framebufferTexturePixelLocalStorageWEBGL.length ? (a.Ca = b, !0) : !1;
3249
3304
  }, endPixelLocalStorageWEBGL:function(a, b, c) {
3250
- (a = w[a].C.ba) && a.endPixelLocalStorageWEBGL(l.HEAPU32.subarray(c, c + b));
3305
+ (a = w[a].F.Ca) && a.endPixelLocalStorageWEBGL(l.HEAPU32.subarray(c, c + b));
3251
3306
  }, environ_get:(a, b) => {
3252
3307
  var c = 0;
3253
3308
  Qd().forEach((d, e) => {
@@ -3413,11 +3468,9 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3413
3468
  return C.$;
3414
3469
  }
3415
3470
  }, framebufferPixelLocalClearValuefvWEBGL:function(a, b, c, d, e, f) {
3416
- (a = w[a].C.ba) && a.framebufferPixelLocalClearValuefvWEBGL(b, [c, d, e, f]);
3417
- }, framebufferTexturePixelLocalStorageWEBGL:function(a, b, c, d, e) {
3418
- (a = w[a].C.ba) && a.framebufferTexturePixelLocalStorageWEBGL(b, Fd[c], d, e);
3419
- }, getFramebufferPixelLocalStorageParameterivWEBGL:function(a, b, c) {
3420
- return (a = w[a].C.ba) ? a.getFramebufferPixelLocalStorageParameterWEBGL(b, c) : 0;
3471
+ (a = w[a].F.Ca) && a.framebufferPixelLocalClearValuefvWEBGL(b, [c, d, e, f]);
3472
+ }, framebufferTexturePixelLocalStorageWEBGL:function(a, b, c, d, e, f) {
3473
+ (a = w[a].F.Ca) && a.framebufferTexturePixelLocalStorageWEBGL(b, Fd[c], d, e, f);
3421
3474
  }, glActiveTexture:a => W.activeTexture(a), glAttachShader:(a, b) => {
3422
3475
  W.attachShader(V[a], Gd[b]);
3423
3476
  }, glBindBuffer:(a, b) => {
@@ -3448,7 +3501,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3448
3501
  }, glCreateProgram:() => {
3449
3502
  var a = Ld(V), b = W.createProgram();
3450
3503
  b.name = a;
3451
- b.za = b.xa = b.ya = 0;
3504
+ b.ya = b.wa = b.xa = 0;
3452
3505
  b.Wa = 1;
3453
3506
  V[a] = b;
3454
3507
  return a;
@@ -3523,11 +3576,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3523
3576
  Md(a, b, "createTexture", Fd);
3524
3577
  }, glGenVertexArrays:(a, b) => {
3525
3578
  Md(a, b, "createVertexArray", Hd);
3526
- }, glGenerateMipmap:a => W.generateMipmap(a), glGetError:() => {
3527
- var a = W.getError() || X;
3528
- X = 0;
3529
- return a;
3530
- }, glGetIntegerv:(a, b) => Td(a, b), glGetProgramiv:(a, b, c) => {
3579
+ }, glGenerateMipmap:a => W.generateMipmap(a), glGetIntegerv:(a, b) => Td(a, b), glGetProgramiv:(a, b, c) => {
3531
3580
  if (c) {
3532
3581
  if (a >= Bd) {
3533
3582
  X ||= 1281;
@@ -3535,26 +3584,26 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3535
3584
  if (a = V[a], 35716 == b) {
3536
3585
  a = W.getProgramInfoLog(a), null === a && (a = "(unknown error)"), F[c >> 2] = a.length + 1;
3537
3586
  } else if (35719 == b) {
3538
- if (!a.za) {
3587
+ if (!a.ya) {
3539
3588
  for (b = 0; b < W.getProgramParameter(a, 35718); ++b) {
3540
- a.za = Math.max(a.za, W.getActiveUniform(a, b).name.length + 1);
3589
+ a.ya = Math.max(a.ya, W.getActiveUniform(a, b).name.length + 1);
3541
3590
  }
3542
3591
  }
3543
- F[c >> 2] = a.za;
3592
+ F[c >> 2] = a.ya;
3544
3593
  } else if (35722 == b) {
3545
- if (!a.xa) {
3594
+ if (!a.wa) {
3546
3595
  for (b = 0; b < W.getProgramParameter(a, 35721); ++b) {
3547
- a.xa = Math.max(a.xa, W.getActiveAttrib(a, b).name.length + 1);
3596
+ a.wa = Math.max(a.wa, W.getActiveAttrib(a, b).name.length + 1);
3548
3597
  }
3549
3598
  }
3550
- F[c >> 2] = a.xa;
3599
+ F[c >> 2] = a.wa;
3551
3600
  } else if (35381 == b) {
3552
- if (!a.ya) {
3601
+ if (!a.xa) {
3553
3602
  for (b = 0; b < W.getProgramParameter(a, 35382); ++b) {
3554
- a.ya = Math.max(a.ya, W.getActiveUniformBlockName(a, b).length + 1);
3603
+ a.xa = Math.max(a.xa, W.getActiveUniformBlockName(a, b).length + 1);
3555
3604
  }
3556
3605
  }
3557
- F[c >> 2] = a.ya;
3606
+ F[c >> 2] = a.xa;
3558
3607
  } else {
3559
3608
  F[c >> 2] = W.getProgramParameter(a, b);
3560
3609
  }
@@ -3594,9 +3643,9 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3594
3643
  }, glGetUniformBlockIndex:(a, b) => W.getUniformBlockIndex(V[a], b ? L(D, b) : ""), glGetUniformLocation:(a, b) => {
3595
3644
  b = b ? L(D, b) : "";
3596
3645
  if (a = V[a]) {
3597
- var c = a, d = c.na, e = c.wb, f;
3646
+ var c = a, d = c.ma, e = c.wb, f;
3598
3647
  if (!d) {
3599
- for (c.na = d = {}, c.vb = {}, f = 0; f < W.getProgramParameter(c, 35718); ++f) {
3648
+ for (c.ma = d = {}, c.vb = {}, f = 0; f < W.getProgramParameter(c, 35718); ++f) {
3600
3649
  var g = W.getActiveUniform(c, f);
3601
3650
  var k = g.name;
3602
3651
  g = g.size;
@@ -3610,7 +3659,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3610
3659
  }
3611
3660
  }
3612
3661
  }
3613
- c = a.na;
3662
+ c = a.ma;
3614
3663
  d = 0;
3615
3664
  e = b;
3616
3665
  f = Wd(b);
@@ -3630,7 +3679,7 @@ var ee = {__syscall_fcntl64:function(a, b, c) {
3630
3679
  }, glLinkProgram:a => {
3631
3680
  a = V[a];
3632
3681
  W.linkProgram(a);
3633
- a.na = 0;
3682
+ a.ma = 0;
3634
3683
  a.wb = {};
3635
3684
  }, glPixelStorei:(a, b) => {
3636
3685
  3317 == a ? Jd = b : 3314 == a && (Kd = b);
@@ -3672,8 +3721,8 @@ f, g, k, p) => {
3672
3721
  var c = W, d = c.uniform1i;
3673
3722
  var e = W.Hb;
3674
3723
  if (e) {
3675
- var f = e.na[a];
3676
- "number" == typeof f && (e.na[a] = f = W.getUniformLocation(e, e.vb[a] + (0 < f ? `[${f}]` : "")));
3724
+ var f = e.ma[a];
3725
+ "number" == typeof f && (e.ma[a] = f = W.getUniformLocation(e, e.vb[a] + (0 < f ? `[${f}]` : "")));
3677
3726
  a = f;
3678
3727
  } else {
3679
3728
  X ||= 1282, a = void 0;
@@ -3695,10 +3744,10 @@ f, g, k, p) => {
3695
3744
  }, glViewport:(a, b, c, d) => W.viewport(a, b, c, d), invoke_vii:de, isWindowsBrowser:function() {
3696
3745
  return -1 < navigator.platform.indexOf("Win");
3697
3746
  }, provokingVertexWEBGL:function(a, b) {
3698
- (a = w[a].C.pb) && a.provokingVertexWEBGL(b);
3747
+ (a = w[a].F.pb) && a.provokingVertexWEBGL(b);
3699
3748
  }, strftime:$d, strftime_l:(a, b, c, d) => $d(a, b, c, d), upload_image:function(a, b) {
3700
3749
  var c = l.images;
3701
- c && (b = c.get(b)) && (a = w[a].C, a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0), a.texImage2D(a.TEXTURE_2D, 0, a.RGBA, a.RGBA, a.UNSIGNED_BYTE, b), a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1));
3750
+ c && (b = c.get(b)) && (a = w[a].F, a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0), a.texImage2D(a.TEXTURE_2D, 0, a.RGBA, a.RGBA, a.UNSIGNED_BYTE, b), a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !1));
3702
3751
  }}, Y = function() {
3703
3752
  function a(c) {
3704
3753
  Y = c.exports;
@@ -3814,7 +3863,7 @@ moduleRtn = ca;
3814
3863
  /* 5 */
3815
3864
  /***/ ((module) => {
3816
3865
 
3817
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/webgl2","version":"2.37.1","description":"Rive\'s webgl2 based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)","Chris Dalton <chris@rive.app> (https://rive.app)"],"license":"MIT","files":["rive.js","rive.wasm","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts","runtimeLoader.d.ts","utils"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
3866
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/webgl2","version":"2.37.3","description":"Rive\'s webgl2 based web api.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)","Chris Dalton <chris@rive.app> (https://rive.app)"],"license":"MIT","files":["rive.js","rive.wasm","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts","runtimeLoader.d.ts","utils"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
3818
3867
 
3819
3868
  /***/ }),
3820
3869
  /* 6 */
@@ -3858,60 +3907,70 @@ __webpack_require__.r(__webpack_exports__);
3858
3907
  /* harmony export */ });
3859
3908
  var _this = undefined;
3860
3909
  /**
3861
- * Returns the clientX and clientY properties from touch or mouse events. Also
3862
- * calls preventDefault() on the event if it is a touchstart or touchmove to prevent
3863
- * scrolling the page on mobile devices
3864
- * @param event - Either a TouchEvent or a MouseEvent
3865
- * @returns - Coordinates of the clientX and clientY properties from the touch/mouse event
3910
+ * Extracts ClientCoordinates from a TouchList, respecting multi-touch vs.
3911
+ * single-touch mode. In single-touch mode, only the touch matching
3912
+ * primaryTouchId is returned (or the first touch when primaryTouchId is null).
3866
3913
  */
3867
- var getClientCoordinates = function (event, isTouchScrollEnabled, enableMultiTouch) {
3868
- var _a, _b;
3914
+ var getTouchCoordinates = function (changedTouches, enableMultiTouch, primaryTouchId) {
3915
+ var _a;
3869
3916
  var coordinates = [];
3870
- if (["touchstart", "touchmove"].indexOf(event.type) > -1 &&
3871
- ((_a = event.changedTouches) === null || _a === void 0 ? void 0 : _a.length)) {
3872
- // This flag, if false, prevents touch events on the canvas default behavior
3873
- // which may prevent scrolling if a drag motion on the canvas is performed
3874
- if (!isTouchScrollEnabled) {
3875
- event.preventDefault();
3876
- }
3877
- var cnt = 0;
3878
- var totalTouches = enableMultiTouch
3879
- ? event.changedTouches.length
3880
- : 1;
3881
- while (cnt < totalTouches) {
3882
- var touch = event.changedTouches[cnt];
3917
+ if (enableMultiTouch) {
3918
+ for (var i = 0; i < changedTouches.length; i++) {
3919
+ var touch = changedTouches[i];
3883
3920
  coordinates.push({
3884
3921
  clientX: touch.clientX,
3885
3922
  clientY: touch.clientY,
3886
3923
  identifier: touch.identifier,
3887
3924
  });
3888
- cnt++;
3889
3925
  }
3890
3926
  }
3891
- else if (event.type === "touchend" &&
3892
- ((_b = event.changedTouches) === null || _b === void 0 ? void 0 : _b.length)) {
3893
- var cnt = 0;
3894
- var totalTouches = enableMultiTouch
3895
- ? event.changedTouches.length
3896
- : 1;
3897
- while (cnt < totalTouches) {
3898
- var touch = event.changedTouches[cnt];
3927
+ else {
3928
+ // In "single-touch mode", only track the primary finger identified at touchstart.
3929
+ // Search changedTouches for the touch matching the recorded primary touch identifier, or (on initial touchstart)
3930
+ // take the first available touch identifier.
3931
+ var primaryTouch = primaryTouchId !== null
3932
+ ? (_a = Array.from(changedTouches).find(function (t) { return t.identifier === primaryTouchId; })) !== null && _a !== void 0 ? _a : null
3933
+ : changedTouches[0];
3934
+ if (primaryTouch) {
3899
3935
  coordinates.push({
3900
- clientX: touch.clientX,
3901
- clientY: touch.clientY,
3902
- identifier: touch.identifier,
3936
+ clientX: primaryTouch.clientX,
3937
+ clientY: primaryTouch.clientY,
3938
+ identifier: primaryTouch.identifier,
3903
3939
  });
3904
- cnt++;
3905
3940
  }
3906
3941
  }
3907
- else {
3908
- coordinates.push({
3942
+ return coordinates;
3943
+ };
3944
+ /**
3945
+ * Returns the clientX and clientY properties from touch or mouse events. Also
3946
+ * calls preventDefault() on the event if it is a touchstart or touchmove to prevent
3947
+ * scrolling the page on mobile devices
3948
+ * @param event - Either a TouchEvent or a MouseEvent
3949
+ * @param isTouchScrollEnabled - Whether touch scrolling is enabled
3950
+ * @param enableMultiTouch - Whether to process multiple simultaneous touches
3951
+ * @param primaryTouchId - When working with single touches, only process the touch
3952
+ * with this identifier. Pass null to accept any touch (used during touchstart to
3953
+ * capture the first finger down).
3954
+ * @returns - Coordinates of the clientX and clientY properties from the touch/mouse event
3955
+ */
3956
+ var getClientCoordinates = function (event, isTouchScrollEnabled, enableMultiTouch, primaryTouchId) {
3957
+ var _a;
3958
+ var touchEvent = event;
3959
+ if ((_a = touchEvent.changedTouches) === null || _a === void 0 ? void 0 : _a.length) {
3960
+ // This flag, if false, prevents touch events on the canvas default behavior
3961
+ // which may prevent scrolling if a drag motion on the canvas is performed
3962
+ if (!isTouchScrollEnabled && ["touchstart", "touchmove"].includes(event.type)) {
3963
+ event.preventDefault();
3964
+ }
3965
+ return getTouchCoordinates(touchEvent.changedTouches, enableMultiTouch, primaryTouchId);
3966
+ }
3967
+ return [
3968
+ {
3909
3969
  clientX: event.clientX,
3910
3970
  clientY: event.clientY,
3911
3971
  identifier: 0,
3912
- });
3913
- }
3914
- return coordinates;
3972
+ },
3973
+ ];
3915
3974
  };
3916
3975
  /**
3917
3976
  * Registers mouse move/up/down callback handlers on the canvas to send meaningful coordinates to
@@ -3943,7 +4002,15 @@ var registerTouchInteractions = function (_a) {
3943
4002
  **/
3944
4003
  var _prevEventType = null;
3945
4004
  var _syntheticEventsActive = false;
4005
+ /**
4006
+ * When enableMultiTouch is false ("single-touch mode"), we track the identifier of the first finger that touched down.
4007
+ * All subsequent touch events are filtered to this identifier so that a second finger
4008
+ * moving cannot displace the tracked pointer position.
4009
+ * Reset to null when the primary finger lifts (or touchcancel is called)
4010
+ */
4011
+ var _primaryTouchId = null;
3946
4012
  var processEventCallback = function (event) {
4013
+ var _a;
3947
4014
  // Exit early out of all synthetic mouse events
3948
4015
  // https://stackoverflow.com/questions/9656990/how-to-prevent-simulated-mouse-events-in-mobile-browsers
3949
4016
  // https://stackoverflow.com/questions/25572070/javascript-touchend-versus-click-dilemma
@@ -3962,7 +4029,15 @@ var registerTouchInteractions = function (_a) {
3962
4029
  _prevEventType === "touchstart";
3963
4030
  _prevEventType = event.type;
3964
4031
  var boundingRect = event.currentTarget.getBoundingClientRect();
3965
- var coordinateSets = getClientCoordinates(event, isTouchScrollEnabled, enableMultiTouch);
4032
+ // On touchstart in single-touch mode, record the first new finger as the primary
4033
+ // touch if we aren't already tracking one.
4034
+ if (!enableMultiTouch && event.type === "touchstart" && _primaryTouchId === null) {
4035
+ var firstTouch = (_a = event.changedTouches) === null || _a === void 0 ? void 0 : _a[0];
4036
+ if (firstTouch) {
4037
+ _primaryTouchId = firstTouch.identifier;
4038
+ }
4039
+ }
4040
+ var coordinateSets = getClientCoordinates(event, isTouchScrollEnabled, enableMultiTouch, enableMultiTouch ? null : _primaryTouchId);
3966
4041
  var forwardMatrix = rive.computeAlignment(fit, alignment, {
3967
4042
  minX: 0,
3968
4043
  minY: 0,
@@ -4027,8 +4102,8 @@ var registerTouchInteractions = function (_a) {
4027
4102
  stateMachine.pointerMove(coordinateSet.transformedX, coordinateSet.transformedY, coordinateSet.identifier);
4028
4103
  });
4029
4104
  };
4030
- for (var _a = 0, stateMachines_2 = stateMachines; _a < stateMachines_2.length; _a++) {
4031
- var stateMachine = stateMachines_2[_a];
4105
+ for (var _b = 0, stateMachines_2 = stateMachines; _b < stateMachines_2.length; _b++) {
4106
+ var stateMachine = stateMachines_2[_b];
4032
4107
  _loop_2(stateMachine);
4033
4108
  }
4034
4109
  break;
@@ -4041,8 +4116,8 @@ var registerTouchInteractions = function (_a) {
4041
4116
  stateMachine.pointerDown(coordinateSet.transformedX, coordinateSet.transformedY, coordinateSet.identifier);
4042
4117
  });
4043
4118
  };
4044
- for (var _b = 0, stateMachines_3 = stateMachines; _b < stateMachines_3.length; _b++) {
4045
- var stateMachine = stateMachines_3[_b];
4119
+ for (var _c = 0, stateMachines_3 = stateMachines; _c < stateMachines_3.length; _c++) {
4120
+ var stateMachine = stateMachines_3[_c];
4046
4121
  _loop_3(stateMachine);
4047
4122
  }
4048
4123
  break;
@@ -4055,10 +4130,16 @@ var registerTouchInteractions = function (_a) {
4055
4130
  stateMachine.pointerExit(coordinateSet.transformedX, coordinateSet.transformedY, coordinateSet.identifier);
4056
4131
  });
4057
4132
  };
4058
- for (var _c = 0, stateMachines_4 = stateMachines; _c < stateMachines_4.length; _c++) {
4059
- var stateMachine = stateMachines_4[_c];
4133
+ for (var _d = 0, stateMachines_4 = stateMachines; _d < stateMachines_4.length; _d++) {
4134
+ var stateMachine = stateMachines_4[_d];
4060
4135
  _loop_4(stateMachine);
4061
4136
  }
4137
+ // Release the primary touch lock once that finger lifts so the next
4138
+ // touchstart can claim a new primary finger.
4139
+ if (!enableMultiTouch &&
4140
+ coordinateSets.some(function (c) { return c.identifier === _primaryTouchId; })) {
4141
+ _primaryTouchId = null;
4142
+ }
4062
4143
  break;
4063
4144
  }
4064
4145
  case "mouseup": {
@@ -4067,8 +4148,8 @@ var registerTouchInteractions = function (_a) {
4067
4148
  stateMachine.pointerUp(coordinateSet.transformedX, coordinateSet.transformedY, coordinateSet.identifier);
4068
4149
  });
4069
4150
  };
4070
- for (var _d = 0, stateMachines_5 = stateMachines; _d < stateMachines_5.length; _d++) {
4071
- var stateMachine = stateMachines_5[_d];
4151
+ for (var _e = 0, stateMachines_5 = stateMachines; _e < stateMachines_5.length; _e++) {
4152
+ var stateMachine = stateMachines_5[_e];
4072
4153
  _loop_5(stateMachine);
4073
4154
  }
4074
4155
  break;
@@ -4076,6 +4157,9 @@ var registerTouchInteractions = function (_a) {
4076
4157
  default:
4077
4158
  }
4078
4159
  };
4160
+ var touchCancelCallback = function () {
4161
+ _primaryTouchId = null;
4162
+ };
4079
4163
  var callback = processEventCallback.bind(_this);
4080
4164
  canvas.addEventListener("mouseover", callback);
4081
4165
  canvas.addEventListener("mouseout", callback);
@@ -4089,6 +4173,7 @@ var registerTouchInteractions = function (_a) {
4089
4173
  passive: isTouchScrollEnabled,
4090
4174
  });
4091
4175
  canvas.addEventListener("touchend", callback);
4176
+ canvas.addEventListener("touchcancel", touchCancelCallback);
4092
4177
  return function () {
4093
4178
  canvas.removeEventListener("mouseover", callback);
4094
4179
  canvas.removeEventListener("mouseout", callback);
@@ -4098,6 +4183,7 @@ var registerTouchInteractions = function (_a) {
4098
4183
  canvas.removeEventListener("touchmove", callback);
4099
4184
  canvas.removeEventListener("touchstart", callback);
4100
4185
  canvas.removeEventListener("touchend", callback);
4186
+ canvas.removeEventListener("touchcancel", touchCancelCallback);
4101
4187
  };
4102
4188
  };
4103
4189