@rive-app/canvas-lite 2.26.3 → 2.26.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/rive.d.ts +155 -0
- package/rive.js +868 -286
- package/rive.js.map +1 -1
- package/rive.wasm +0 -0
- package/rive_advanced.mjs.d.ts +129 -0
- package/rive_fallback.wasm +0 -0
package/rive.js
CHANGED
|
@@ -266,7 +266,7 @@ const fa = "createConicGradient createImageData createLinearGradient createPatte
|
|
|
266
266
|
a.clearColor(0, 0, 0, 0);
|
|
267
267
|
a.clear(a.COLOR_BUFFER_BIT);
|
|
268
268
|
a.enable(a.SCISSOR_TEST);
|
|
269
|
-
q.sort((C,
|
|
269
|
+
q.sort((C, X) => X.Ba - C.Ba);
|
|
270
270
|
v = w.push(G);
|
|
271
271
|
m != v && (a.bufferData(a.ARRAY_BUFFER, 8 * v, a.DYNAMIC_DRAW), m = v);
|
|
272
272
|
v = 0;
|
|
@@ -274,8 +274,8 @@ const fa = "createConicGradient createImageData createLinearGradient createPatte
|
|
|
274
274
|
a.bufferSubData(a.ARRAY_BUFFER, v, O.ia), v += 4 * O.ia.length;
|
|
275
275
|
}
|
|
276
276
|
console.assert(v == 4 * G);
|
|
277
|
-
for (var
|
|
278
|
-
a.bufferSubData(a.ARRAY_BUFFER, v,
|
|
277
|
+
for (var Y of q) {
|
|
278
|
+
a.bufferSubData(a.ARRAY_BUFFER, v, Y.Ea), v += 4 * Y.Ea.length;
|
|
279
279
|
}
|
|
280
280
|
console.assert(v == 8 * G);
|
|
281
281
|
v = x.push(D);
|
|
@@ -286,15 +286,15 @@ const fa = "createConicGradient createImageData createLinearGradient createPatte
|
|
|
286
286
|
}
|
|
287
287
|
console.assert(O == 2 * D);
|
|
288
288
|
ia = 0;
|
|
289
|
-
|
|
289
|
+
Y = !0;
|
|
290
290
|
v = O = 0;
|
|
291
291
|
for (const C of q) {
|
|
292
292
|
C.image.da != ia && (a.bindTexture(a.TEXTURE_2D, C.image.ca || null), ia = C.image.da);
|
|
293
|
-
C.hb ? (a.scissor(C.na, I - C.oa - C.va, C.sb, C.va),
|
|
293
|
+
C.hb ? (a.scissor(C.na, I - C.oa - C.va, C.sb, C.va), Y = !0) : Y && (a.scissor(0, I - r, g, r), Y = !1);
|
|
294
294
|
q = 2 / g;
|
|
295
|
-
const
|
|
296
|
-
a.uniform4f(e, C.N[0] * q * C.X, C.N[1] *
|
|
297
|
-
a.uniform2f(f, C.N[4] * q * C.X + q * (C.na - C.fb * C.X) - 1, C.N[5] *
|
|
295
|
+
const X = -2 / r;
|
|
296
|
+
a.uniform4f(e, C.N[0] * q * C.X, C.N[1] * X * C.Y, C.N[2] * q * C.X, C.N[3] * X * C.Y);
|
|
297
|
+
a.uniform2f(f, C.N[4] * q * C.X + q * (C.na - C.fb * C.X) - 1, C.N[5] * X * C.Y + X * (C.oa - C.gb * C.Y) + 1);
|
|
298
298
|
a.vertexAttribPointer(0, 2, a.FLOAT, !1, 0, v);
|
|
299
299
|
a.vertexAttribPointer(1, 2, a.FLOAT, !1, 0, v + 4 * G);
|
|
300
300
|
a.drawElements(a.TRIANGLES, C.indices.length, a.UNSIGNED_SHORT, O);
|
|
@@ -351,7 +351,7 @@ h.onRuntimeInitialized = function() {
|
|
|
351
351
|
return "rgba(" + ((16711680 & p) >>> 16) + "," + ((65280 & p) >>> 8) + "," + ((255 & p) >>> 0) + "," + ((4278190080 & p) >>> 24) / 255 + ")";
|
|
352
352
|
}
|
|
353
353
|
function c() {
|
|
354
|
-
0 < I.length && (ha.Qa(v.drawWidth(), v.drawHeight(), I, O,
|
|
354
|
+
0 < I.length && (ha.Qa(v.drawWidth(), v.drawHeight(), I, O, Y), I = [], Y = O = 0, v.reset(512, 512));
|
|
355
355
|
for (const p of D) {
|
|
356
356
|
for (const u of p.u) {
|
|
357
357
|
u();
|
|
@@ -461,8 +461,8 @@ h.onRuntimeInitialized = function() {
|
|
|
461
461
|
var H = E.ra;
|
|
462
462
|
const K = E.ga;
|
|
463
463
|
E.bb ? (E = T - y, H -= F, y = p.createRadialGradient(y, F, 0, y, F, Math.sqrt(E * E + H * H))) : y = p.createLinearGradient(y, F, T, H);
|
|
464
|
-
for (let
|
|
465
|
-
F = K[
|
|
464
|
+
for (let Z = 0, N = K.length; Z < N; Z++) {
|
|
465
|
+
F = K[Z], y.addColorStop(F.stop, a(F.color));
|
|
466
466
|
}
|
|
467
467
|
this.ma = y;
|
|
468
468
|
this.P = null;
|
|
@@ -480,7 +480,7 @@ h.onRuntimeInitialized = function() {
|
|
|
480
480
|
}
|
|
481
481
|
},});
|
|
482
482
|
const D = new Set();
|
|
483
|
-
let v = null, I = [], O = 0,
|
|
483
|
+
let v = null, I = [], O = 0, Y = 0;
|
|
484
484
|
var ia = h.CanvasRenderer = m.extend("Renderer", {__construct:function(p) {
|
|
485
485
|
this.__parent.__construct.call(this);
|
|
486
486
|
this.D = [1, 0, 0, 1, 0, 0];
|
|
@@ -524,29 +524,29 @@ h.onRuntimeInitialized = function() {
|
|
|
524
524
|
p[B] = u[A + B];
|
|
525
525
|
}
|
|
526
526
|
}, _drawImageMesh:function(p, u, A, B, y, E, F, H, T, K) {
|
|
527
|
-
var
|
|
527
|
+
var Z = this.o.canvas.width, N = this.o.canvas.height;
|
|
528
528
|
const tb = T - F, ub = K - H;
|
|
529
529
|
F = Math.max(F, 0);
|
|
530
530
|
H = Math.max(H, 0);
|
|
531
|
-
T = Math.min(T,
|
|
531
|
+
T = Math.min(T, Z);
|
|
532
532
|
K = Math.min(K, N);
|
|
533
533
|
const wa = T - F, xa = K - H;
|
|
534
|
-
console.assert(wa <= Math.min(tb,
|
|
534
|
+
console.assert(wa <= Math.min(tb, Z));
|
|
535
535
|
console.assert(xa <= Math.min(ub, N));
|
|
536
536
|
if (!(0 >= wa || 0 >= xa)) {
|
|
537
537
|
T = wa < tb || xa < ub;
|
|
538
|
-
|
|
539
|
-
var ja = Math.ceil(wa * K), ka = Math.ceil(xa *
|
|
538
|
+
Z = K = 1;
|
|
539
|
+
var ja = Math.ceil(wa * K), ka = Math.ceil(xa * Z);
|
|
540
540
|
N = ha.eb();
|
|
541
541
|
ja > N && (K *= N / ja, ja = N);
|
|
542
|
-
ka > N && (
|
|
542
|
+
ka > N && (Z *= N / ka, ka = N);
|
|
543
543
|
v || (v = new h.DynamicRectanizer(N), v.reset(512, 512));
|
|
544
544
|
N = v.addRect(ja, ka);
|
|
545
545
|
0 > N && (c(), D.add(this), N = v.addRect(ja, ka), console.assert(0 <= N));
|
|
546
546
|
var vb = N & 65535, wb = N >> 16;
|
|
547
|
-
I.push({N:this.D.slice(this.D.length - 6), image:p, na:vb, oa:wb, fb:F, gb:H, sb:ja, va:ka, X:K, Y, ia:new Float32Array(B), Ea:new Float32Array(y), indices:new Uint16Array(E), hb:T, Ba:p.da << 1 | (T ? 1 : 0),});
|
|
547
|
+
I.push({N:this.D.slice(this.D.length - 6), image:p, na:vb, oa:wb, fb:F, gb:H, sb:ja, va:ka, X:K, Y:Z, ia:new Float32Array(B), Ea:new Float32Array(y), indices:new Uint16Array(E), hb:T, Ba:p.da << 1 | (T ? 1 : 0),});
|
|
548
548
|
O += B.length;
|
|
549
|
-
|
|
549
|
+
Y += E.length;
|
|
550
550
|
var pa = this.o, oc = b(u);
|
|
551
551
|
this.u.push(function() {
|
|
552
552
|
pa.save();
|
|
@@ -600,7 +600,7 @@ h.onRuntimeInitialized = function() {
|
|
|
600
600
|
}, makeRenderPath:function() {
|
|
601
601
|
return new q();
|
|
602
602
|
}, makeRenderImage:function() {
|
|
603
|
-
let p =
|
|
603
|
+
let p = X;
|
|
604
604
|
return new r({W:() => {
|
|
605
605
|
p.total++;
|
|
606
606
|
}, R:() => {
|
|
@@ -611,18 +611,18 @@ h.onRuntimeInitialized = function() {
|
|
|
611
611
|
}
|
|
612
612
|
},});
|
|
613
613
|
},};
|
|
614
|
-
let C = h.load,
|
|
614
|
+
let C = h.load, X = null;
|
|
615
615
|
h.load = function(p, u, A = !0) {
|
|
616
616
|
const B = new h.FallbackFileAssetLoader();
|
|
617
617
|
void 0 !== u && B.addLoader(u);
|
|
618
618
|
A && (u = new h.CDNFileAssetLoader(), B.addLoader(u));
|
|
619
619
|
return new Promise(function(y) {
|
|
620
620
|
let E = null;
|
|
621
|
-
|
|
621
|
+
X = {total:0, loaded:0, ready:function() {
|
|
622
622
|
y(E);
|
|
623
623
|
},};
|
|
624
624
|
E = C(p, B);
|
|
625
|
-
0 ==
|
|
625
|
+
0 == X.total && y(E);
|
|
626
626
|
});
|
|
627
627
|
};
|
|
628
628
|
let pc = h.RendererWrapper.prototype.align;
|
|
@@ -640,15 +640,15 @@ h.onRuntimeInitialized = function() {
|
|
|
640
640
|
v && v.delete();
|
|
641
641
|
};
|
|
642
642
|
};
|
|
643
|
-
var ma = Object.assign({}, h), na = "./this.program", oa = "object" == typeof window, qa = "function" == typeof importScripts,
|
|
643
|
+
var ma = Object.assign({}, h), na = "./this.program", oa = "object" == typeof window, qa = "function" == typeof importScripts, ra = "", sa, ta;
|
|
644
644
|
if (oa || qa) {
|
|
645
|
-
qa ?
|
|
645
|
+
qa ? ra = self.location.href : "undefined" != typeof document && document.currentScript && (ra = document.currentScript.src), _scriptDir && (ra = _scriptDir), 0 !== ra.indexOf("blob:") ? ra = ra.substr(0, ra.replace(/[?#].*/, "").lastIndexOf("/") + 1) : ra = "", qa && (ta = b => {
|
|
646
646
|
var a = new XMLHttpRequest();
|
|
647
647
|
a.open("GET", b, !1);
|
|
648
648
|
a.responseType = "arraybuffer";
|
|
649
649
|
a.send(null);
|
|
650
650
|
return new Uint8Array(a.response);
|
|
651
|
-
}),
|
|
651
|
+
}), sa = (b, a, c) => {
|
|
652
652
|
var d = new XMLHttpRequest();
|
|
653
653
|
d.open("GET", b, !0);
|
|
654
654
|
d.responseType = "arraybuffer";
|
|
@@ -659,99 +659,99 @@ if (oa || qa) {
|
|
|
659
659
|
d.send(null);
|
|
660
660
|
};
|
|
661
661
|
}
|
|
662
|
-
var
|
|
662
|
+
var ua = h.print || console.log.bind(console), va = h.printErr || console.error.bind(console);
|
|
663
663
|
Object.assign(h, ma);
|
|
664
664
|
ma = null;
|
|
665
665
|
h.thisProgram && (na = h.thisProgram);
|
|
666
|
-
var
|
|
667
|
-
h.wasmBinary && (
|
|
666
|
+
var ya;
|
|
667
|
+
h.wasmBinary && (ya = h.wasmBinary);
|
|
668
668
|
var noExitRuntime = h.noExitRuntime || !0;
|
|
669
|
-
"object" != typeof WebAssembly &&
|
|
670
|
-
var
|
|
671
|
-
function
|
|
672
|
-
var b =
|
|
673
|
-
h.HEAP8 =
|
|
674
|
-
h.HEAP16 =
|
|
675
|
-
h.HEAP32 =
|
|
676
|
-
h.HEAPU8 =
|
|
677
|
-
h.HEAPU16 =
|
|
678
|
-
h.HEAPU32 =
|
|
679
|
-
h.HEAPF32 =
|
|
680
|
-
h.HEAPF64 =
|
|
669
|
+
"object" != typeof WebAssembly && za("no native wasm support detected");
|
|
670
|
+
var Aa, z, Ba = !1, Ca, J, Da, Ea, L, M, Fa, Ga;
|
|
671
|
+
function Ha() {
|
|
672
|
+
var b = Aa.buffer;
|
|
673
|
+
h.HEAP8 = Ca = new Int8Array(b);
|
|
674
|
+
h.HEAP16 = Da = new Int16Array(b);
|
|
675
|
+
h.HEAP32 = L = new Int32Array(b);
|
|
676
|
+
h.HEAPU8 = J = new Uint8Array(b);
|
|
677
|
+
h.HEAPU16 = Ea = new Uint16Array(b);
|
|
678
|
+
h.HEAPU32 = M = new Uint32Array(b);
|
|
679
|
+
h.HEAPF32 = Fa = new Float32Array(b);
|
|
680
|
+
h.HEAPF64 = Ga = new Float64Array(b);
|
|
681
681
|
}
|
|
682
|
-
var
|
|
683
|
-
function
|
|
682
|
+
var Ia, Ja = [], Ka = [], La = [];
|
|
683
|
+
function Ma() {
|
|
684
684
|
var b = h.preRun.shift();
|
|
685
|
-
|
|
685
|
+
Ja.unshift(b);
|
|
686
686
|
}
|
|
687
|
-
var
|
|
688
|
-
function
|
|
687
|
+
var Na = 0, Oa = null, Pa = null;
|
|
688
|
+
function za(b) {
|
|
689
689
|
if (h.onAbort) {
|
|
690
690
|
h.onAbort(b);
|
|
691
691
|
}
|
|
692
692
|
b = "Aborted(" + b + ")";
|
|
693
|
-
|
|
694
|
-
|
|
693
|
+
va(b);
|
|
694
|
+
Ba = !0;
|
|
695
695
|
b = new WebAssembly.RuntimeError(b + ". Build with -sASSERTIONS for more info.");
|
|
696
696
|
ba(b);
|
|
697
697
|
throw b;
|
|
698
698
|
}
|
|
699
|
-
function
|
|
699
|
+
function Qa(b) {
|
|
700
700
|
return b.startsWith("data:application/octet-stream;base64,");
|
|
701
701
|
}
|
|
702
|
-
var
|
|
703
|
-
|
|
704
|
-
if (!
|
|
705
|
-
var
|
|
706
|
-
|
|
702
|
+
var Ra;
|
|
703
|
+
Ra = "canvas_advanced.wasm";
|
|
704
|
+
if (!Qa(Ra)) {
|
|
705
|
+
var Sa = Ra;
|
|
706
|
+
Ra = h.locateFile ? h.locateFile(Sa, ra) : ra + Sa;
|
|
707
707
|
}
|
|
708
|
-
function
|
|
709
|
-
if (b ==
|
|
710
|
-
return new Uint8Array(
|
|
708
|
+
function Ta(b) {
|
|
709
|
+
if (b == Ra && ya) {
|
|
710
|
+
return new Uint8Array(ya);
|
|
711
711
|
}
|
|
712
|
-
if (
|
|
713
|
-
return
|
|
712
|
+
if (ta) {
|
|
713
|
+
return ta(b);
|
|
714
714
|
}
|
|
715
715
|
throw "both async and sync fetching of the wasm failed";
|
|
716
716
|
}
|
|
717
|
-
function
|
|
718
|
-
if (!
|
|
717
|
+
function Ua(b) {
|
|
718
|
+
if (!ya && (oa || qa)) {
|
|
719
719
|
if ("function" == typeof fetch && !b.startsWith("file://")) {
|
|
720
720
|
return fetch(b, {credentials:"same-origin"}).then(a => {
|
|
721
721
|
if (!a.ok) {
|
|
722
722
|
throw "failed to load wasm binary file at '" + b + "'";
|
|
723
723
|
}
|
|
724
724
|
return a.arrayBuffer();
|
|
725
|
-
}).catch(() =>
|
|
725
|
+
}).catch(() => Ta(b));
|
|
726
726
|
}
|
|
727
|
-
if (
|
|
727
|
+
if (sa) {
|
|
728
728
|
return new Promise((a, c) => {
|
|
729
|
-
|
|
729
|
+
sa(b, d => a(new Uint8Array(d)), c);
|
|
730
730
|
});
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
|
-
return Promise.resolve().then(() =>
|
|
733
|
+
return Promise.resolve().then(() => Ta(b));
|
|
734
734
|
}
|
|
735
|
-
function
|
|
736
|
-
return
|
|
737
|
-
|
|
738
|
-
|
|
735
|
+
function Va(b, a, c) {
|
|
736
|
+
return Ua(b).then(d => WebAssembly.instantiate(d, a)).then(d => d).then(c, d => {
|
|
737
|
+
va("failed to asynchronously prepare wasm: " + d);
|
|
738
|
+
za(d);
|
|
739
739
|
});
|
|
740
740
|
}
|
|
741
|
-
function
|
|
742
|
-
var c =
|
|
743
|
-
return
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
return
|
|
741
|
+
function Wa(b, a) {
|
|
742
|
+
var c = Ra;
|
|
743
|
+
return ya || "function" != typeof WebAssembly.instantiateStreaming || Qa(c) || c.startsWith("file://") || "function" != typeof fetch ? Va(c, b, a) : fetch(c, {credentials:"same-origin"}).then(d => WebAssembly.instantiateStreaming(d, b).then(a, function(e) {
|
|
744
|
+
va("wasm streaming compile failed: " + e);
|
|
745
|
+
va("falling back to ArrayBuffer instantiation");
|
|
746
|
+
return Va(c, b, a);
|
|
747
747
|
}));
|
|
748
748
|
}
|
|
749
|
-
var
|
|
749
|
+
var Xa = b => {
|
|
750
750
|
for (; 0 < b.length;) {
|
|
751
751
|
b.shift()(h);
|
|
752
752
|
}
|
|
753
753
|
};
|
|
754
|
-
function
|
|
754
|
+
function Ya(b) {
|
|
755
755
|
if (void 0 === b) {
|
|
756
756
|
return "_unknown";
|
|
757
757
|
}
|
|
@@ -759,24 +759,24 @@ function Xa(b) {
|
|
|
759
759
|
var a = b.charCodeAt(0);
|
|
760
760
|
return 48 <= a && 57 >= a ? `_${b}` : b;
|
|
761
761
|
}
|
|
762
|
-
function
|
|
763
|
-
b =
|
|
762
|
+
function Za(b, a) {
|
|
763
|
+
b = Ya(b);
|
|
764
764
|
return {[b]:function() {
|
|
765
765
|
return a.apply(this, arguments);
|
|
766
766
|
}}[b];
|
|
767
767
|
}
|
|
768
|
-
function
|
|
768
|
+
function $a() {
|
|
769
769
|
this.G = [void 0];
|
|
770
770
|
this.ta = [];
|
|
771
771
|
}
|
|
772
|
-
var
|
|
773
|
-
function
|
|
774
|
-
throw new
|
|
772
|
+
var P = new $a(), ab = void 0;
|
|
773
|
+
function Q(b) {
|
|
774
|
+
throw new ab(b);
|
|
775
775
|
}
|
|
776
|
-
var
|
|
777
|
-
b ||
|
|
778
|
-
return
|
|
779
|
-
},
|
|
776
|
+
var R = b => {
|
|
777
|
+
b || Q("Cannot use deleted val. handle = " + b);
|
|
778
|
+
return P.get(b).value;
|
|
779
|
+
}, S = b => {
|
|
780
780
|
switch(b) {
|
|
781
781
|
case void 0:
|
|
782
782
|
return 1;
|
|
@@ -787,11 +787,11 @@ var S = b => {
|
|
|
787
787
|
case !1:
|
|
788
788
|
return 4;
|
|
789
789
|
default:
|
|
790
|
-
return
|
|
790
|
+
return P.Za({Aa:1, value:b});
|
|
791
791
|
}
|
|
792
792
|
};
|
|
793
793
|
function bb(b) {
|
|
794
|
-
var a = Error, c =
|
|
794
|
+
var a = Error, c = Za(b, function(d) {
|
|
795
795
|
this.name = b;
|
|
796
796
|
this.message = d;
|
|
797
797
|
d = Error(d).stack;
|
|
@@ -806,8 +806,8 @@ function bb(b) {
|
|
|
806
806
|
}
|
|
807
807
|
var cb = void 0, db = void 0;
|
|
808
808
|
function U(b) {
|
|
809
|
-
for (var a = "";
|
|
810
|
-
a += db[
|
|
809
|
+
for (var a = ""; J[b];) {
|
|
810
|
+
a += db[J[b++]];
|
|
811
811
|
}
|
|
812
812
|
return a;
|
|
813
813
|
}
|
|
@@ -821,7 +821,7 @@ function fb() {
|
|
|
821
821
|
}
|
|
822
822
|
var gb = void 0, hb = {};
|
|
823
823
|
function ib(b, a) {
|
|
824
|
-
for (void 0 === a &&
|
|
824
|
+
for (void 0 === a && Q("ptr should not be undefined"); b.l;) {
|
|
825
825
|
a = b.S(a), b = b.l;
|
|
826
826
|
}
|
|
827
827
|
return a;
|
|
@@ -835,7 +835,7 @@ function kb(b) {
|
|
|
835
835
|
}
|
|
836
836
|
function nb(b, a) {
|
|
837
837
|
var c = jb[b];
|
|
838
|
-
void 0 === c &&
|
|
838
|
+
void 0 === c && Q(a + " has unknown type " + kb(b));
|
|
839
839
|
return c;
|
|
840
840
|
}
|
|
841
841
|
function ob() {
|
|
@@ -895,7 +895,7 @@ function Eb(b) {
|
|
|
895
895
|
}
|
|
896
896
|
}
|
|
897
897
|
function Fb(b) {
|
|
898
|
-
return this.fromWireType(
|
|
898
|
+
return this.fromWireType(L[b >> 2]);
|
|
899
899
|
}
|
|
900
900
|
var Gb = {}, Hb = {};
|
|
901
901
|
function V(b, a, c) {
|
|
@@ -935,12 +935,12 @@ function Jb(b) {
|
|
|
935
935
|
}
|
|
936
936
|
function Kb(b, a, c = {}) {
|
|
937
937
|
var d = a.name;
|
|
938
|
-
b ||
|
|
938
|
+
b || Q(`type "${d}" must have a positive integer typeid pointer`);
|
|
939
939
|
if (jb.hasOwnProperty(b)) {
|
|
940
940
|
if (c.ab) {
|
|
941
941
|
return;
|
|
942
942
|
}
|
|
943
|
-
|
|
943
|
+
Q(`Cannot register type '${d}' twice`);
|
|
944
944
|
}
|
|
945
945
|
jb[b] = a;
|
|
946
946
|
delete Hb[b];
|
|
@@ -953,7 +953,7 @@ function Ib(b, a, c = {}) {
|
|
|
953
953
|
Kb(b, a, c);
|
|
954
954
|
}
|
|
955
955
|
function Lb(b) {
|
|
956
|
-
|
|
956
|
+
Q(b.g.j.h.name + " instance already deleted");
|
|
957
957
|
}
|
|
958
958
|
function Mb() {
|
|
959
959
|
}
|
|
@@ -961,7 +961,7 @@ function Nb(b, a, c) {
|
|
|
961
961
|
if (void 0 === b[a].m) {
|
|
962
962
|
var d = b[a];
|
|
963
963
|
b[a] = function() {
|
|
964
|
-
b[a].m.hasOwnProperty(arguments.length) ||
|
|
964
|
+
b[a].m.hasOwnProperty(arguments.length) || Q(`Function '${c}' called with an invalid number of arguments (${arguments.length}) - expects one of (${b[a].m})!`);
|
|
965
965
|
return b[a].m[arguments.length].apply(this, arguments);
|
|
966
966
|
};
|
|
967
967
|
b[a].m = [];
|
|
@@ -969,7 +969,7 @@ function Nb(b, a, c) {
|
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
971
|
function Ob(b, a, c) {
|
|
972
|
-
h.hasOwnProperty(b) ? ((void 0 === c || void 0 !== h[b].m && void 0 !== h[b].m[c]) &&
|
|
972
|
+
h.hasOwnProperty(b) ? ((void 0 === c || void 0 !== h[b].m && void 0 !== h[b].m[c]) && Q(`Cannot register public name '${b}' twice`), Nb(h, b, b), h.hasOwnProperty(c) && Q(`Cannot register multiple overloads of a function with the same number of arguments (${c})!`), h[b].m[c] = a) : (h[b] = a, void 0 !== c && (h[b].tb = c));
|
|
973
973
|
}
|
|
974
974
|
function Pb(b, a, c, d, e, f, m, k) {
|
|
975
975
|
this.name = b;
|
|
@@ -984,21 +984,21 @@ function Pb(b, a, c, d, e, f, m, k) {
|
|
|
984
984
|
}
|
|
985
985
|
function Qb(b, a, c) {
|
|
986
986
|
for (; a !== c;) {
|
|
987
|
-
a.S ||
|
|
987
|
+
a.S || Q(`Expected null or instance of ${c.name}, got an instance of ${a.name}`), b = a.S(b), a = a.l;
|
|
988
988
|
}
|
|
989
989
|
return b;
|
|
990
990
|
}
|
|
991
991
|
function Rb(b, a) {
|
|
992
992
|
if (null === a) {
|
|
993
|
-
return this.ea &&
|
|
993
|
+
return this.ea && Q(`null is not a valid ${this.name}`), 0;
|
|
994
994
|
}
|
|
995
|
-
a.g ||
|
|
996
|
-
a.g.i ||
|
|
995
|
+
a.g || Q(`Cannot pass "${Sb(a)}" as a ${this.name}`);
|
|
996
|
+
a.g.i || Q(`Cannot pass deleted object as a pointer of type ${this.name}`);
|
|
997
997
|
return Qb(a.g.i, a.g.j.h, this.h);
|
|
998
998
|
}
|
|
999
999
|
function Tb(b, a) {
|
|
1000
1000
|
if (null === a) {
|
|
1001
|
-
this.ea &&
|
|
1001
|
+
this.ea && Q(`null is not a valid ${this.name}`);
|
|
1002
1002
|
if (this.V) {
|
|
1003
1003
|
var c = this.fa();
|
|
1004
1004
|
null !== b && b.push(this.H, c);
|
|
@@ -1006,14 +1006,14 @@ function Tb(b, a) {
|
|
|
1006
1006
|
}
|
|
1007
1007
|
return 0;
|
|
1008
1008
|
}
|
|
1009
|
-
a.g ||
|
|
1010
|
-
a.g.i ||
|
|
1011
|
-
!this.U && a.g.j.U &&
|
|
1009
|
+
a.g || Q(`Cannot pass "${Sb(a)}" as a ${this.name}`);
|
|
1010
|
+
a.g.i || Q(`Cannot pass deleted object as a pointer of type ${this.name}`);
|
|
1011
|
+
!this.U && a.g.j.U && Q(`Cannot convert argument of type ${a.g.A ? a.g.A.name : a.g.j.name} to parameter type ${this.name}`);
|
|
1012
1012
|
c = Qb(a.g.i, a.g.j.h, this.h);
|
|
1013
1013
|
if (this.V) {
|
|
1014
|
-
switch(void 0 === a.g.s &&
|
|
1014
|
+
switch(void 0 === a.g.s && Q("Passing raw pointer to smart pointer is illegal"), this.nb) {
|
|
1015
1015
|
case 0:
|
|
1016
|
-
a.g.A === this ? c = a.g.s :
|
|
1016
|
+
a.g.A === this ? c = a.g.s : Q(`Cannot convert argument of type ${a.g.A ? a.g.A.name : a.g.j.name} to parameter type ${this.name}`);
|
|
1017
1017
|
break;
|
|
1018
1018
|
case 1:
|
|
1019
1019
|
c = a.g.s;
|
|
@@ -1023,25 +1023,25 @@ function Tb(b, a) {
|
|
|
1023
1023
|
c = a.g.s;
|
|
1024
1024
|
} else {
|
|
1025
1025
|
var d = a.clone();
|
|
1026
|
-
c = this.jb(c,
|
|
1026
|
+
c = this.jb(c, S(function() {
|
|
1027
1027
|
d["delete"]();
|
|
1028
1028
|
}));
|
|
1029
1029
|
null !== b && b.push(this.H, c);
|
|
1030
1030
|
}
|
|
1031
1031
|
break;
|
|
1032
1032
|
default:
|
|
1033
|
-
|
|
1033
|
+
Q("Unsupporting sharing policy");
|
|
1034
1034
|
}
|
|
1035
1035
|
}
|
|
1036
1036
|
return c;
|
|
1037
1037
|
}
|
|
1038
1038
|
function Ub(b, a) {
|
|
1039
1039
|
if (null === a) {
|
|
1040
|
-
return this.ea &&
|
|
1040
|
+
return this.ea && Q(`null is not a valid ${this.name}`), 0;
|
|
1041
1041
|
}
|
|
1042
|
-
a.g ||
|
|
1043
|
-
a.g.i ||
|
|
1044
|
-
a.g.j.U &&
|
|
1042
|
+
a.g || Q(`Cannot pass "${Sb(a)}" as a ${this.name}`);
|
|
1043
|
+
a.g.i || Q(`Cannot pass deleted object as a pointer of type ${this.name}`);
|
|
1044
|
+
a.g.j.U && Q(`Cannot convert argument of type ${a.g.j.name} to parameter type ${this.name}`);
|
|
1045
1045
|
return Qb(a.g.i, a.g.j.h, this.h);
|
|
1046
1046
|
}
|
|
1047
1047
|
function Vb(b, a, c, d) {
|
|
@@ -1059,7 +1059,7 @@ function Wb(b, a, c) {
|
|
|
1059
1059
|
}
|
|
1060
1060
|
var Xb = [], Yb = b => {
|
|
1061
1061
|
var a = Xb[b];
|
|
1062
|
-
a || (b >= Xb.length && (Xb.length = b + 1), Xb[b] = a =
|
|
1062
|
+
a || (b >= Xb.length && (Xb.length = b + 1), Xb[b] = a = Ia.get(b));
|
|
1063
1063
|
return a;
|
|
1064
1064
|
}, Zb = (b, a) => {
|
|
1065
1065
|
var c = [];
|
|
@@ -1075,10 +1075,10 @@ var Xb = [], Yb = b => {
|
|
|
1075
1075
|
return d;
|
|
1076
1076
|
};
|
|
1077
1077
|
};
|
|
1078
|
-
function
|
|
1078
|
+
function W(b, a) {
|
|
1079
1079
|
b = U(b);
|
|
1080
1080
|
var c = b.includes("j") ? Zb(b, a) : Yb(a);
|
|
1081
|
-
"function" != typeof c &&
|
|
1081
|
+
"function" != typeof c && Q(`unknown function pointer with signature ${b}: ${a}`);
|
|
1082
1082
|
return c;
|
|
1083
1083
|
}
|
|
1084
1084
|
var $b = void 0;
|
|
@@ -1092,7 +1092,7 @@ function ac(b, a) {
|
|
|
1092
1092
|
}
|
|
1093
1093
|
function bc(b, a, c, d, e) {
|
|
1094
1094
|
var f = a.length;
|
|
1095
|
-
2 > f &&
|
|
1095
|
+
2 > f && Q("argTypes array size mismatch! Must at least get return value and 'this' types!");
|
|
1096
1096
|
var m = null !== a[1] && null !== c, k = !1;
|
|
1097
1097
|
for (c = 1; c < a.length; ++c) {
|
|
1098
1098
|
if (null !== a[c] && void 0 === a[c].v) {
|
|
@@ -1102,7 +1102,7 @@ function bc(b, a, c, d, e) {
|
|
|
1102
1102
|
}
|
|
1103
1103
|
var n = "void" !== a[0].name, l = f - 2, t = Array(l), w = [], x = [];
|
|
1104
1104
|
return function() {
|
|
1105
|
-
arguments.length !== l &&
|
|
1105
|
+
arguments.length !== l && Q(`function ${b} called with ${arguments.length} arguments, expected ${l} args!`);
|
|
1106
1106
|
x.length = 0;
|
|
1107
1107
|
w.length = m ? 2 : 1;
|
|
1108
1108
|
w[0] = e;
|
|
@@ -1128,32 +1128,32 @@ function bc(b, a, c, d, e) {
|
|
|
1128
1128
|
}
|
|
1129
1129
|
function cc(b, a) {
|
|
1130
1130
|
for (var c = [], d = 0; d < b; d++) {
|
|
1131
|
-
c.push(
|
|
1131
|
+
c.push(M[a + 4 * d >> 2]);
|
|
1132
1132
|
}
|
|
1133
1133
|
return c;
|
|
1134
1134
|
}
|
|
1135
1135
|
function dc(b, a, c) {
|
|
1136
|
-
b instanceof Object ||
|
|
1137
|
-
b instanceof a.h.constructor ||
|
|
1138
|
-
b.g.i ||
|
|
1136
|
+
b instanceof Object || Q(`${c} with invalid "this": ${b}`);
|
|
1137
|
+
b instanceof a.h.constructor || Q(`${c} incompatible with "this" of type ${b.constructor.name}`);
|
|
1138
|
+
b.g.i || Q(`cannot call emscripten binding method ${c} on deleted object`);
|
|
1139
1139
|
return Qb(b.g.i, b.g.j.h, a.h);
|
|
1140
1140
|
}
|
|
1141
1141
|
function ec(b) {
|
|
1142
|
-
b >=
|
|
1142
|
+
b >= P.ua && 0 === --P.get(b).Aa && P.$a(b);
|
|
1143
1143
|
}
|
|
1144
1144
|
function fc(b, a, c) {
|
|
1145
1145
|
switch(a) {
|
|
1146
1146
|
case 0:
|
|
1147
1147
|
return function(d) {
|
|
1148
|
-
return this.fromWireType((c ?
|
|
1148
|
+
return this.fromWireType((c ? Ca : J)[d]);
|
|
1149
1149
|
};
|
|
1150
1150
|
case 1:
|
|
1151
1151
|
return function(d) {
|
|
1152
|
-
return this.fromWireType((c ?
|
|
1152
|
+
return this.fromWireType((c ? Da : Ea)[d >> 1]);
|
|
1153
1153
|
};
|
|
1154
1154
|
case 2:
|
|
1155
1155
|
return function(d) {
|
|
1156
|
-
return this.fromWireType((c ?
|
|
1156
|
+
return this.fromWireType((c ? L : M)[d >> 2]);
|
|
1157
1157
|
};
|
|
1158
1158
|
default:
|
|
1159
1159
|
throw new TypeError("Unknown integer type: " + b);
|
|
@@ -1170,11 +1170,11 @@ function gc(b, a) {
|
|
|
1170
1170
|
switch(a) {
|
|
1171
1171
|
case 2:
|
|
1172
1172
|
return function(c) {
|
|
1173
|
-
return this.fromWireType(
|
|
1173
|
+
return this.fromWireType(Fa[c >> 2]);
|
|
1174
1174
|
};
|
|
1175
1175
|
case 3:
|
|
1176
1176
|
return function(c) {
|
|
1177
|
-
return this.fromWireType(
|
|
1177
|
+
return this.fromWireType(Ga[c >> 3]);
|
|
1178
1178
|
};
|
|
1179
1179
|
default:
|
|
1180
1180
|
throw new TypeError("Unknown float type: " + b);
|
|
@@ -1184,21 +1184,21 @@ function hc(b, a, c) {
|
|
|
1184
1184
|
switch(a) {
|
|
1185
1185
|
case 0:
|
|
1186
1186
|
return c ? function(d) {
|
|
1187
|
-
return
|
|
1187
|
+
return Ca[d];
|
|
1188
1188
|
} : function(d) {
|
|
1189
|
-
return
|
|
1189
|
+
return J[d];
|
|
1190
1190
|
};
|
|
1191
1191
|
case 1:
|
|
1192
1192
|
return c ? function(d) {
|
|
1193
|
-
return Ca[d >> 1];
|
|
1194
|
-
} : function(d) {
|
|
1195
1193
|
return Da[d >> 1];
|
|
1194
|
+
} : function(d) {
|
|
1195
|
+
return Ea[d >> 1];
|
|
1196
1196
|
};
|
|
1197
1197
|
case 2:
|
|
1198
1198
|
return c ? function(d) {
|
|
1199
|
-
return
|
|
1199
|
+
return L[d >> 2];
|
|
1200
1200
|
} : function(d) {
|
|
1201
|
-
return
|
|
1201
|
+
return M[d >> 2];
|
|
1202
1202
|
};
|
|
1203
1203
|
default:
|
|
1204
1204
|
throw new TypeError("Unknown integer type: " + b);
|
|
@@ -1276,16 +1276,16 @@ var ic = (b, a, c, d) => {
|
|
|
1276
1276
|
return d;
|
|
1277
1277
|
}, mc = "undefined" != typeof TextDecoder ? new TextDecoder("utf-16le") : void 0, nc = (b, a) => {
|
|
1278
1278
|
var c = b >> 1;
|
|
1279
|
-
for (var d = c + a / 2; !(c >= d) &&
|
|
1279
|
+
for (var d = c + a / 2; !(c >= d) && Ea[c];) {
|
|
1280
1280
|
++c;
|
|
1281
1281
|
}
|
|
1282
1282
|
c <<= 1;
|
|
1283
1283
|
if (32 < c - b && mc) {
|
|
1284
|
-
return mc.decode(
|
|
1284
|
+
return mc.decode(J.subarray(b, c));
|
|
1285
1285
|
}
|
|
1286
1286
|
c = "";
|
|
1287
1287
|
for (d = 0; !(d >= a / 2); ++d) {
|
|
1288
|
-
var e =
|
|
1288
|
+
var e = Da[b + 2 * d >> 1];
|
|
1289
1289
|
if (0 == e) {
|
|
1290
1290
|
break;
|
|
1291
1291
|
}
|
|
@@ -1301,13 +1301,13 @@ var ic = (b, a, c, d) => {
|
|
|
1301
1301
|
var d = a;
|
|
1302
1302
|
c = c < 2 * b.length ? c / 2 : b.length;
|
|
1303
1303
|
for (var e = 0; e < c; ++e) {
|
|
1304
|
-
|
|
1304
|
+
Da[a >> 1] = b.charCodeAt(e), a += 2;
|
|
1305
1305
|
}
|
|
1306
|
-
|
|
1306
|
+
Da[a >> 1] = 0;
|
|
1307
1307
|
return a - d;
|
|
1308
1308
|
}, rc = b => 2 * b.length, sc = (b, a) => {
|
|
1309
1309
|
for (var c = 0, d = ""; !(c >= a / 4);) {
|
|
1310
|
-
var e =
|
|
1310
|
+
var e = L[b + 4 * c >> 2];
|
|
1311
1311
|
if (0 == e) {
|
|
1312
1312
|
break;
|
|
1313
1313
|
}
|
|
@@ -1328,13 +1328,13 @@ var ic = (b, a, c, d) => {
|
|
|
1328
1328
|
var m = b.charCodeAt(++e);
|
|
1329
1329
|
f = 65536 + ((f & 1023) << 10) | m & 1023;
|
|
1330
1330
|
}
|
|
1331
|
-
|
|
1331
|
+
L[a >> 2] = f;
|
|
1332
1332
|
a += 4;
|
|
1333
1333
|
if (a + 4 > c) {
|
|
1334
1334
|
break;
|
|
1335
1335
|
}
|
|
1336
1336
|
}
|
|
1337
|
-
|
|
1337
|
+
L[a >> 2] = 0;
|
|
1338
1338
|
return a - d;
|
|
1339
1339
|
}, uc = b => {
|
|
1340
1340
|
for (var a = 0, c = 0; c < b.length; ++c) {
|
|
@@ -1356,7 +1356,7 @@ function yc(b) {
|
|
|
1356
1356
|
}
|
|
1357
1357
|
function zc(b, a) {
|
|
1358
1358
|
for (var c = Array(b), d = 0; d < b; ++d) {
|
|
1359
|
-
c[d] = nb(
|
|
1359
|
+
c[d] = nb(M[a + 4 * d >> 2], "parameter " + d);
|
|
1360
1360
|
}
|
|
1361
1361
|
return c;
|
|
1362
1362
|
}
|
|
@@ -1431,9 +1431,9 @@ var Jc = (b, a, c, d) => {
|
|
|
1431
1431
|
q = k(q);
|
|
1432
1432
|
return 0 >= m(r, g) ? 0 >= m(q, g) ? g.getFullYear() + 1 : g.getFullYear() : g.getFullYear() - 1;
|
|
1433
1433
|
}
|
|
1434
|
-
var l =
|
|
1435
|
-
d = {qb:
|
|
1436
|
-
c = c ? lc(
|
|
1434
|
+
var l = L[d + 40 >> 2];
|
|
1435
|
+
d = {qb:L[d >> 2], pb:L[d + 4 >> 2], Z:L[d + 8 >> 2], ha:L[d + 12 >> 2], $:L[d + 16 >> 2], K:L[d + 20 >> 2], C:L[d + 24 >> 2], J:L[d + 28 >> 2], ub:L[d + 32 >> 2], ob:L[d + 36 >> 2], rb:l ? l ? lc(J, l) : "" : ""};
|
|
1436
|
+
c = c ? lc(J, c) : "";
|
|
1437
1437
|
l = {"%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",};
|
|
1438
1438
|
for (var t in l) {
|
|
1439
1439
|
c = c.replace(new RegExp(t, "g"), l[t]);
|
|
@@ -1473,10 +1473,10 @@ var Jc = (b, a, c, d) => {
|
|
|
1473
1473
|
if (t.length > a) {
|
|
1474
1474
|
return 0;
|
|
1475
1475
|
}
|
|
1476
|
-
|
|
1476
|
+
Ca.set(t, b);
|
|
1477
1477
|
return t.length - 1;
|
|
1478
1478
|
};
|
|
1479
|
-
Object.assign(
|
|
1479
|
+
Object.assign($a.prototype, {get(b) {
|
|
1480
1480
|
return this.G[b];
|
|
1481
1481
|
}, has(b) {
|
|
1482
1482
|
return void 0 !== this.G[b];
|
|
@@ -1488,17 +1488,17 @@ Object.assign(Za.prototype, {get(b) {
|
|
|
1488
1488
|
this.G[b] = void 0;
|
|
1489
1489
|
this.ta.push(b);
|
|
1490
1490
|
}});
|
|
1491
|
-
|
|
1491
|
+
ab = h.BindingError = class extends Error {
|
|
1492
1492
|
constructor(b) {
|
|
1493
1493
|
super(b);
|
|
1494
1494
|
this.name = "BindingError";
|
|
1495
1495
|
}
|
|
1496
1496
|
};
|
|
1497
|
-
|
|
1498
|
-
|
|
1497
|
+
P.G.push({value:void 0}, {value:null}, {value:!0}, {value:!1},);
|
|
1498
|
+
P.ua = P.G.length;
|
|
1499
1499
|
h.count_emval_handles = function() {
|
|
1500
|
-
for (var b = 0, a =
|
|
1501
|
-
void 0 !==
|
|
1500
|
+
for (var b = 0, a = P.ua; a < P.G.length; ++a) {
|
|
1501
|
+
void 0 !== P.G[a] && ++b;
|
|
1502
1502
|
}
|
|
1503
1503
|
return b;
|
|
1504
1504
|
};
|
|
@@ -1554,7 +1554,7 @@ Mb.prototype.clone = function() {
|
|
|
1554
1554
|
};
|
|
1555
1555
|
Mb.prototype["delete"] = function() {
|
|
1556
1556
|
this.g.i || Lb(this);
|
|
1557
|
-
this.g.M && !this.g.O &&
|
|
1557
|
+
this.g.M && !this.g.O && Q("Object already scheduled for deletion");
|
|
1558
1558
|
ob(this);
|
|
1559
1559
|
qb(this.g);
|
|
1560
1560
|
this.g.O || (this.g.s = void 0, this.g.i = void 0);
|
|
@@ -1564,7 +1564,7 @@ Mb.prototype.isDeleted = function() {
|
|
|
1564
1564
|
};
|
|
1565
1565
|
Mb.prototype.deleteLater = function() {
|
|
1566
1566
|
this.g.i || Lb(this);
|
|
1567
|
-
this.g.M && !this.g.O &&
|
|
1567
|
+
this.g.M && !this.g.O && Q("Object already scheduled for deletion");
|
|
1568
1568
|
eb.push(this);
|
|
1569
1569
|
1 === eb.length && gb && gb(fb);
|
|
1570
1570
|
this.g.M = !0;
|
|
@@ -1614,9 +1614,9 @@ $b = h.UnboundTypeError = bb("UnboundTypeError");
|
|
|
1614
1614
|
var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
1615
1615
|
b = U(b);
|
|
1616
1616
|
a = nb(a, "wrapper");
|
|
1617
|
-
c =
|
|
1617
|
+
c = R(c);
|
|
1618
1618
|
var d = [].slice, e = a.h, f = e.B, m = e.l.B, k = e.l.constructor;
|
|
1619
|
-
b =
|
|
1619
|
+
b = Za(b, function() {
|
|
1620
1620
|
e.l.ya.forEach(function(l) {
|
|
1621
1621
|
if (this[l] === m[l]) {
|
|
1622
1622
|
throw new cb(`Pure virtual function ${l} must be implemented in JavaScript`);
|
|
@@ -1626,7 +1626,7 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1626
1626
|
this.__construct.apply(this, d.call(arguments));
|
|
1627
1627
|
});
|
|
1628
1628
|
f.__construct = function() {
|
|
1629
|
-
this === f &&
|
|
1629
|
+
this === f && Q("Pass correct 'this' to __construct");
|
|
1630
1630
|
var l = k.implement.apply(void 0, [this].concat(d.call(arguments)));
|
|
1631
1631
|
ob(l);
|
|
1632
1632
|
var t = l.g;
|
|
@@ -1636,20 +1636,20 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1636
1636
|
Cb(this);
|
|
1637
1637
|
l = t.i;
|
|
1638
1638
|
l = ib(e, l);
|
|
1639
|
-
hb.hasOwnProperty(l) ?
|
|
1639
|
+
hb.hasOwnProperty(l) ? Q(`Tried to register registered instance: ${l}`) : hb[l] = this;
|
|
1640
1640
|
};
|
|
1641
1641
|
f.__destruct = function() {
|
|
1642
|
-
this === f &&
|
|
1642
|
+
this === f && Q("Pass correct 'this' to __destruct");
|
|
1643
1643
|
ob(this);
|
|
1644
1644
|
var l = this.g.i;
|
|
1645
1645
|
l = ib(e, l);
|
|
1646
|
-
hb.hasOwnProperty(l) ? delete hb[l] :
|
|
1646
|
+
hb.hasOwnProperty(l) ? delete hb[l] : Q(`Tried to unregister unregistered instance: ${l}`);
|
|
1647
1647
|
};
|
|
1648
1648
|
b.prototype = Object.create(f);
|
|
1649
1649
|
for (var n in c) {
|
|
1650
1650
|
b.prototype[n] = c[n];
|
|
1651
1651
|
}
|
|
1652
|
-
return
|
|
1652
|
+
return S(b);
|
|
1653
1653
|
}, _embind_finalize_value_object:function(b) {
|
|
1654
1654
|
var a = Db[b];
|
|
1655
1655
|
delete Db[b];
|
|
@@ -1695,11 +1695,11 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1695
1695
|
return k ? d : e;
|
|
1696
1696
|
}, argPackAdvance:8, readValueFromPointer:function(m) {
|
|
1697
1697
|
if (1 === c) {
|
|
1698
|
-
var k =
|
|
1698
|
+
var k = Ca;
|
|
1699
1699
|
} else if (2 === c) {
|
|
1700
|
-
k =
|
|
1700
|
+
k = Da;
|
|
1701
1701
|
} else if (4 === c) {
|
|
1702
|
-
k =
|
|
1702
|
+
k = L;
|
|
1703
1703
|
} else {
|
|
1704
1704
|
throw new TypeError("Unknown boolean type size: " + a);
|
|
1705
1705
|
}
|
|
@@ -1707,11 +1707,11 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1707
1707
|
}, v:null,});
|
|
1708
1708
|
}, _embind_register_class:function(b, a, c, d, e, f, m, k, n, l, t, w, x) {
|
|
1709
1709
|
t = U(t);
|
|
1710
|
-
f =
|
|
1711
|
-
k && (k =
|
|
1712
|
-
l && (l =
|
|
1713
|
-
x =
|
|
1714
|
-
var g =
|
|
1710
|
+
f = W(e, f);
|
|
1711
|
+
k && (k = W(m, k));
|
|
1712
|
+
l && (l = W(n, l));
|
|
1713
|
+
x = W(w, x);
|
|
1714
|
+
var g = Ya(t);
|
|
1715
1715
|
Ob(g, function() {
|
|
1716
1716
|
ac(`Cannot construct ${t} due to unbound types`, [d]);
|
|
1717
1717
|
});
|
|
@@ -1723,16 +1723,16 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1723
1723
|
} else {
|
|
1724
1724
|
G = Mb.prototype;
|
|
1725
1725
|
}
|
|
1726
|
-
r =
|
|
1726
|
+
r = Za(g, function() {
|
|
1727
1727
|
if (Object.getPrototypeOf(this) !== D) {
|
|
1728
|
-
throw new
|
|
1728
|
+
throw new ab("Use 'new' to construct " + t);
|
|
1729
1729
|
}
|
|
1730
1730
|
if (void 0 === v.I) {
|
|
1731
|
-
throw new
|
|
1731
|
+
throw new ab(t + " has no accessible constructor");
|
|
1732
1732
|
}
|
|
1733
1733
|
var O = v.I[arguments.length];
|
|
1734
1734
|
if (void 0 === O) {
|
|
1735
|
-
throw new
|
|
1735
|
+
throw new ab(`Tried to invoke ctor of ${t} with invalid number of parameters (${arguments.length}) - expected (${Object.keys(v.I).toString()}) parameters instead!`);
|
|
1736
1736
|
}
|
|
1737
1737
|
return O.apply(this, arguments);
|
|
1738
1738
|
});
|
|
@@ -1750,7 +1750,7 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1750
1750
|
}, _embind_register_class_class_function:function(b, a, c, d, e, f, m) {
|
|
1751
1751
|
var k = cc(c, d);
|
|
1752
1752
|
a = U(a);
|
|
1753
|
-
f =
|
|
1753
|
+
f = W(e, f);
|
|
1754
1754
|
V([], [b], function(n) {
|
|
1755
1755
|
function l() {
|
|
1756
1756
|
ac(`Cannot call ${t} due to unbound types`, k);
|
|
@@ -1774,7 +1774,7 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1774
1774
|
});
|
|
1775
1775
|
}, _embind_register_class_class_property:function(b, a, c, d, e, f, m, k) {
|
|
1776
1776
|
a = U(a);
|
|
1777
|
-
f =
|
|
1777
|
+
f = W(e, f);
|
|
1778
1778
|
V([], [b], function(n) {
|
|
1779
1779
|
n = n[0];
|
|
1780
1780
|
var l = `${n.name}.${a}`, t = {get() {
|
|
@@ -1783,7 +1783,7 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1783
1783
|
t.set = k ? () => {
|
|
1784
1784
|
ac(`Cannot access ${l} due to unbound types`, [c]);
|
|
1785
1785
|
} : () => {
|
|
1786
|
-
|
|
1786
|
+
Q(`${l} is a read-only property`);
|
|
1787
1787
|
};
|
|
1788
1788
|
Object.defineProperty(n.h.constructor, a, t);
|
|
1789
1789
|
V([], [c], function(w) {
|
|
@@ -1791,7 +1791,7 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1791
1791
|
var x = {get() {
|
|
1792
1792
|
return w.fromWireType(f(d));
|
|
1793
1793
|
}, enumerable:!0};
|
|
1794
|
-
k && (k =
|
|
1794
|
+
k && (k = W(m, k), x.set = g => {
|
|
1795
1795
|
var r = [];
|
|
1796
1796
|
k(d, w.toWireType(r, g));
|
|
1797
1797
|
Eb(r);
|
|
@@ -1803,13 +1803,13 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1803
1803
|
});
|
|
1804
1804
|
}, _embind_register_class_constructor:function(b, a, c, d, e, f) {
|
|
1805
1805
|
var m = cc(a, c);
|
|
1806
|
-
e =
|
|
1806
|
+
e = W(d, e);
|
|
1807
1807
|
V([], [b], function(k) {
|
|
1808
1808
|
k = k[0];
|
|
1809
1809
|
var n = `constructor ${k.name}`;
|
|
1810
1810
|
void 0 === k.h.I && (k.h.I = []);
|
|
1811
1811
|
if (void 0 !== k.h.I[a - 1]) {
|
|
1812
|
-
throw new
|
|
1812
|
+
throw new ab(`Cannot register multiple constructors with identical number of parameters (${a - 1}) for class '${k.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);
|
|
1813
1813
|
}
|
|
1814
1814
|
k.h.I[a - 1] = () => {
|
|
1815
1815
|
ac(`Cannot construct ${k.name} due to unbound types`, m);
|
|
@@ -1824,7 +1824,7 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1824
1824
|
}, _embind_register_class_function:function(b, a, c, d, e, f, m, k) {
|
|
1825
1825
|
var n = cc(c, d);
|
|
1826
1826
|
a = U(a);
|
|
1827
|
-
f =
|
|
1827
|
+
f = W(e, f);
|
|
1828
1828
|
V([], [b], function(l) {
|
|
1829
1829
|
function t() {
|
|
1830
1830
|
ac(`Cannot call ${w} due to unbound types`, n);
|
|
@@ -1844,7 +1844,7 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1844
1844
|
});
|
|
1845
1845
|
}, _embind_register_class_property:function(b, a, c, d, e, f, m, k, n, l) {
|
|
1846
1846
|
a = U(a);
|
|
1847
|
-
e =
|
|
1847
|
+
e = W(d, e);
|
|
1848
1848
|
V([], [b], function(t) {
|
|
1849
1849
|
t = t[0];
|
|
1850
1850
|
var w = `${t.name}.${a}`, x = {get() {
|
|
@@ -1853,7 +1853,7 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1853
1853
|
x.set = n ? () => {
|
|
1854
1854
|
ac(`Cannot access ${w} due to unbound types`, [c, m]);
|
|
1855
1855
|
} : () => {
|
|
1856
|
-
|
|
1856
|
+
Q(w + " is a read-only property");
|
|
1857
1857
|
};
|
|
1858
1858
|
Object.defineProperty(t.h.B, a, x);
|
|
1859
1859
|
V([], n ? [c, m] : [c], function(g) {
|
|
@@ -1862,7 +1862,7 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1862
1862
|
return r.fromWireType(e(f, D));
|
|
1863
1863
|
}, enumerable:!0};
|
|
1864
1864
|
if (n) {
|
|
1865
|
-
n =
|
|
1865
|
+
n = W(k, n);
|
|
1866
1866
|
var G = g[1];
|
|
1867
1867
|
q.set = function(D) {
|
|
1868
1868
|
var v = dc(this, t, w + " setter"), I = [];
|
|
@@ -1878,11 +1878,11 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1878
1878
|
}, _embind_register_emval:function(b, a) {
|
|
1879
1879
|
a = U(a);
|
|
1880
1880
|
Ib(b, {name:a, fromWireType:function(c) {
|
|
1881
|
-
var d =
|
|
1881
|
+
var d = R(c);
|
|
1882
1882
|
ec(c);
|
|
1883
1883
|
return d;
|
|
1884
1884
|
}, toWireType:function(c, d) {
|
|
1885
|
-
return
|
|
1885
|
+
return S(d);
|
|
1886
1886
|
}, argPackAdvance:8, readValueFromPointer:Fb, v:null,});
|
|
1887
1887
|
}, _embind_register_enum:function(b, a, c, d) {
|
|
1888
1888
|
function e() {
|
|
@@ -1900,7 +1900,7 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1900
1900
|
var d = nb(b, "enum");
|
|
1901
1901
|
a = U(a);
|
|
1902
1902
|
b = d.constructor;
|
|
1903
|
-
d = Object.create(d.constructor.prototype, {value:{value:c}, constructor:{value:
|
|
1903
|
+
d = Object.create(d.constructor.prototype, {value:{value:c}, constructor:{value:Za(`${d.name}_${a}`, function() {
|
|
1904
1904
|
})},});
|
|
1905
1905
|
b.values[c] = d;
|
|
1906
1906
|
b[a] = d;
|
|
@@ -1915,7 +1915,7 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1915
1915
|
}, _embind_register_function:function(b, a, c, d, e, f) {
|
|
1916
1916
|
var m = cc(a, c);
|
|
1917
1917
|
b = U(b);
|
|
1918
|
-
e =
|
|
1918
|
+
e = W(d, e);
|
|
1919
1919
|
Ob(b, function() {
|
|
1920
1920
|
ac(`Cannot call ${b} due to unbound types`, m);
|
|
1921
1921
|
}, a - 1);
|
|
@@ -1941,7 +1941,7 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1941
1941
|
}, _embind_register_memory_view:function(b, a, c) {
|
|
1942
1942
|
function d(f) {
|
|
1943
1943
|
f >>= 2;
|
|
1944
|
-
var m =
|
|
1944
|
+
var m = M;
|
|
1945
1945
|
return new e(m.buffer, m[f + 1], m[f]);
|
|
1946
1946
|
}
|
|
1947
1947
|
var e = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array,][a];
|
|
@@ -1951,12 +1951,12 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1951
1951
|
a = U(a);
|
|
1952
1952
|
var c = "std::string" === a;
|
|
1953
1953
|
Ib(b, {name:a, fromWireType:function(d) {
|
|
1954
|
-
var e =
|
|
1954
|
+
var e = M[d >> 2], f = d + 4;
|
|
1955
1955
|
if (c) {
|
|
1956
1956
|
for (var m = f, k = 0; k <= e; ++k) {
|
|
1957
1957
|
var n = f + k;
|
|
1958
|
-
if (k == e || 0 ==
|
|
1959
|
-
m = m ? lc(
|
|
1958
|
+
if (k == e || 0 == J[n]) {
|
|
1959
|
+
m = m ? lc(J, m, n - m) : "";
|
|
1960
1960
|
if (void 0 === l) {
|
|
1961
1961
|
var l = m;
|
|
1962
1962
|
} else {
|
|
@@ -1968,7 +1968,7 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1968
1968
|
} else {
|
|
1969
1969
|
l = Array(e);
|
|
1970
1970
|
for (k = 0; k < e; ++k) {
|
|
1971
|
-
l[k] = String.fromCharCode(
|
|
1971
|
+
l[k] = String.fromCharCode(J[f + k]);
|
|
1972
1972
|
}
|
|
1973
1973
|
l = l.join("");
|
|
1974
1974
|
}
|
|
@@ -1977,22 +1977,22 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
1977
1977
|
}, toWireType:function(d, e) {
|
|
1978
1978
|
e instanceof ArrayBuffer && (e = new Uint8Array(e));
|
|
1979
1979
|
var f = "string" == typeof e;
|
|
1980
|
-
f || e instanceof Uint8Array || e instanceof Uint8ClampedArray || e instanceof Int8Array ||
|
|
1980
|
+
f || e instanceof Uint8Array || e instanceof Uint8ClampedArray || e instanceof Int8Array || Q("Cannot pass non-string to std::string");
|
|
1981
1981
|
var m = c && f ? jc(e) : e.length;
|
|
1982
1982
|
var k = Mc(4 + m + 1), n = k + 4;
|
|
1983
|
-
|
|
1983
|
+
M[k >> 2] = m;
|
|
1984
1984
|
if (c && f) {
|
|
1985
|
-
ic(e,
|
|
1985
|
+
ic(e, J, n, m + 1);
|
|
1986
1986
|
} else {
|
|
1987
1987
|
if (f) {
|
|
1988
1988
|
for (f = 0; f < m; ++f) {
|
|
1989
1989
|
var l = e.charCodeAt(f);
|
|
1990
|
-
255 < l && (mb(n),
|
|
1991
|
-
|
|
1990
|
+
255 < l && (mb(n), Q("String has UTF-16 code units that do not fit in 8 bits"));
|
|
1991
|
+
J[n + f] = l;
|
|
1992
1992
|
}
|
|
1993
1993
|
} else {
|
|
1994
1994
|
for (f = 0; f < m; ++f) {
|
|
1995
|
-
|
|
1995
|
+
J[n + f] = e[f];
|
|
1996
1996
|
}
|
|
1997
1997
|
}
|
|
1998
1998
|
}
|
|
@@ -2007,13 +2007,13 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
2007
2007
|
var d = nc;
|
|
2008
2008
|
var e = qc;
|
|
2009
2009
|
var f = rc;
|
|
2010
|
-
var m = () =>
|
|
2010
|
+
var m = () => Ea;
|
|
2011
2011
|
var k = 1;
|
|
2012
2012
|
} else {
|
|
2013
|
-
4 === a && (d = sc, e = tc, f = uc, m = () =>
|
|
2013
|
+
4 === a && (d = sc, e = tc, f = uc, m = () => M, k = 2);
|
|
2014
2014
|
}
|
|
2015
2015
|
Ib(b, {name:c, fromWireType:function(n) {
|
|
2016
|
-
for (var l =
|
|
2016
|
+
for (var l = M[n >> 2], t = m(), w, x = n + 4, g = 0; g <= l; ++g) {
|
|
2017
2017
|
var r = n + 4 + g * a;
|
|
2018
2018
|
if (g == l || 0 == t[r >> k]) {
|
|
2019
2019
|
x = d(x, r - x), void 0 === w ? w = x : (w += String.fromCharCode(0), w += x), x = r + a;
|
|
@@ -2022,9 +2022,9 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
2022
2022
|
mb(n);
|
|
2023
2023
|
return w;
|
|
2024
2024
|
}, toWireType:function(n, l) {
|
|
2025
|
-
"string" != typeof l &&
|
|
2025
|
+
"string" != typeof l && Q(`Cannot pass non-string to C++ string type ${c}`);
|
|
2026
2026
|
var t = f(l), w = Mc(4 + t + a);
|
|
2027
|
-
|
|
2027
|
+
M[w >> 2] = t >> k;
|
|
2028
2028
|
e(l, w + 4, t + a);
|
|
2029
2029
|
null !== n && n.push(mb, w);
|
|
2030
2030
|
return w;
|
|
@@ -2032,30 +2032,30 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
2032
2032
|
mb(n);
|
|
2033
2033
|
},});
|
|
2034
2034
|
}, _embind_register_value_object:function(b, a, c, d, e, f) {
|
|
2035
|
-
Db[b] = {name:U(a), fa:
|
|
2035
|
+
Db[b] = {name:U(a), fa:W(c, d), H:W(e, f), sa:[],};
|
|
2036
2036
|
}, _embind_register_value_object_field:function(b, a, c, d, e, f, m, k, n, l) {
|
|
2037
|
-
Db[b].sa.push({Sa:U(a), Ya:c, Wa:
|
|
2037
|
+
Db[b].sa.push({Sa:U(a), Ya:c, Wa:W(d, e), Xa:f, lb:m, kb:W(k, n), mb:l,});
|
|
2038
2038
|
}, _embind_register_void:function(b, a) {
|
|
2039
2039
|
a = U(a);
|
|
2040
2040
|
Ib(b, {cb:!0, name:a, argPackAdvance:0, fromWireType:function() {
|
|
2041
2041
|
}, toWireType:function() {
|
|
2042
2042
|
},});
|
|
2043
2043
|
}, _emscripten_get_now_is_monotonic:() => !0, _emval_as:function(b, a, c) {
|
|
2044
|
-
b =
|
|
2044
|
+
b = R(b);
|
|
2045
2045
|
a = nb(a, "emval::as");
|
|
2046
|
-
var d = [], e =
|
|
2047
|
-
|
|
2046
|
+
var d = [], e = S(d);
|
|
2047
|
+
M[c >> 2] = e;
|
|
2048
2048
|
return a.toWireType(d, b);
|
|
2049
2049
|
}, _emval_call_method:function(b, a, c, d, e) {
|
|
2050
2050
|
b = xc[b];
|
|
2051
|
-
a =
|
|
2051
|
+
a = R(a);
|
|
2052
2052
|
c = wc(c);
|
|
2053
2053
|
var f = [];
|
|
2054
|
-
|
|
2054
|
+
M[d >> 2] = S(f);
|
|
2055
2055
|
return b(a, c, f, e);
|
|
2056
2056
|
}, _emval_call_void_method:function(b, a, c, d) {
|
|
2057
2057
|
b = xc[b];
|
|
2058
|
-
a =
|
|
2058
|
+
a = R(a);
|
|
2059
2059
|
c = wc(c);
|
|
2060
2060
|
b(a, c, null, d);
|
|
2061
2061
|
}, _emval_decref:ec, _emval_get_method_caller:function(b, a) {
|
|
@@ -2083,36 +2083,38 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
2083
2083
|
return Ac[a] = e;
|
|
2084
2084
|
}, _emval_get_module_property:function(b) {
|
|
2085
2085
|
b = wc(b);
|
|
2086
|
-
return
|
|
2086
|
+
return S(h[b]);
|
|
2087
2087
|
}, _emval_get_property:function(b, a) {
|
|
2088
|
-
b =
|
|
2089
|
-
a =
|
|
2090
|
-
return
|
|
2088
|
+
b = R(b);
|
|
2089
|
+
a = R(a);
|
|
2090
|
+
return S(b[a]);
|
|
2091
2091
|
}, _emval_incref:function(b) {
|
|
2092
|
-
4 < b && (
|
|
2092
|
+
4 < b && (P.get(b).Aa += 1);
|
|
2093
|
+
}, _emval_new_array:function() {
|
|
2094
|
+
return S([]);
|
|
2093
2095
|
}, _emval_new_cstring:function(b) {
|
|
2094
|
-
return
|
|
2096
|
+
return S(wc(b));
|
|
2095
2097
|
}, _emval_new_object:function() {
|
|
2096
|
-
return
|
|
2098
|
+
return S({});
|
|
2097
2099
|
}, _emval_run_destructors:function(b) {
|
|
2098
|
-
var a =
|
|
2100
|
+
var a = R(b);
|
|
2099
2101
|
Eb(a);
|
|
2100
2102
|
ec(b);
|
|
2101
2103
|
}, _emval_set_property:function(b, a, c) {
|
|
2102
|
-
b =
|
|
2103
|
-
a =
|
|
2104
|
-
c =
|
|
2104
|
+
b = R(b);
|
|
2105
|
+
a = R(a);
|
|
2106
|
+
c = R(c);
|
|
2105
2107
|
b[a] = c;
|
|
2106
2108
|
}, _emval_take_value:function(b, a) {
|
|
2107
2109
|
b = nb(b, "_emval_take_value");
|
|
2108
2110
|
b = b.readValueFromPointer(a);
|
|
2109
|
-
return
|
|
2111
|
+
return S(b);
|
|
2110
2112
|
}, abort:() => {
|
|
2111
|
-
|
|
2113
|
+
za("");
|
|
2112
2114
|
}, emscripten_date_now:function() {
|
|
2113
2115
|
return Date.now();
|
|
2114
|
-
}, emscripten_get_now:() => performance.now(), emscripten_memcpy_big:(b, a, c) =>
|
|
2115
|
-
var a =
|
|
2116
|
+
}, emscripten_get_now:() => performance.now(), emscripten_memcpy_big:(b, a, c) => J.copyWithin(b, a, a + c), emscripten_resize_heap:b => {
|
|
2117
|
+
var a = J.length;
|
|
2116
2118
|
b >>>= 0;
|
|
2117
2119
|
if (2147483648 < b) {
|
|
2118
2120
|
return !1;
|
|
@@ -2123,10 +2125,10 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
2123
2125
|
var e = Math;
|
|
2124
2126
|
d = Math.max(b, d);
|
|
2125
2127
|
a: {
|
|
2126
|
-
e = e.min.call(e, 2147483648, d + (65536 - d % 65536) % 65536) -
|
|
2128
|
+
e = e.min.call(e, 2147483648, d + (65536 - d % 65536) % 65536) - Aa.buffer.byteLength + 65535 >>> 16;
|
|
2127
2129
|
try {
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
+
Aa.grow(e);
|
|
2131
|
+
Ha();
|
|
2130
2132
|
var f = 1;
|
|
2131
2133
|
break a;
|
|
2132
2134
|
} catch (m) {
|
|
@@ -2142,85 +2144,85 @@ var Nc = {_embind_create_inheriting_constructor:function(b, a, c) {
|
|
|
2142
2144
|
var c = 0;
|
|
2143
2145
|
Dc().forEach(function(d, e) {
|
|
2144
2146
|
var f = a + c;
|
|
2145
|
-
e =
|
|
2147
|
+
e = M[b + 4 * e >> 2] = f;
|
|
2146
2148
|
for (f = 0; f < d.length; ++f) {
|
|
2147
|
-
|
|
2149
|
+
Ca[e++ >> 0] = d.charCodeAt(f);
|
|
2148
2150
|
}
|
|
2149
|
-
|
|
2151
|
+
Ca[e >> 0] = 0;
|
|
2150
2152
|
c += d.length + 1;
|
|
2151
2153
|
});
|
|
2152
2154
|
return 0;
|
|
2153
2155
|
}, environ_sizes_get:(b, a) => {
|
|
2154
2156
|
var c = Dc();
|
|
2155
|
-
|
|
2157
|
+
M[b >> 2] = c.length;
|
|
2156
2158
|
var d = 0;
|
|
2157
2159
|
c.forEach(function(e) {
|
|
2158
2160
|
d += e.length + 1;
|
|
2159
2161
|
});
|
|
2160
|
-
|
|
2162
|
+
M[a >> 2] = d;
|
|
2161
2163
|
return 0;
|
|
2162
2164
|
}, fd_close:() => 52, fd_seek:function() {
|
|
2163
2165
|
return 70;
|
|
2164
2166
|
}, fd_write:(b, a, c, d) => {
|
|
2165
2167
|
for (var e = 0, f = 0; f < c; f++) {
|
|
2166
|
-
var m =
|
|
2168
|
+
var m = M[a >> 2], k = M[a + 4 >> 2];
|
|
2167
2169
|
a += 8;
|
|
2168
2170
|
for (var n = 0; n < k; n++) {
|
|
2169
|
-
var l =
|
|
2170
|
-
0 === l || 10 === l ? ((1 === b ?
|
|
2171
|
+
var l = J[m + n], t = Ec[b];
|
|
2172
|
+
0 === l || 10 === l ? ((1 === b ? ua : va)(lc(t, 0)), t.length = 0) : t.push(l);
|
|
2171
2173
|
}
|
|
2172
2174
|
e += k;
|
|
2173
2175
|
}
|
|
2174
|
-
|
|
2176
|
+
M[d >> 2] = e;
|
|
2175
2177
|
return 0;
|
|
2176
2178
|
}, strftime_l:(b, a, c, d) => Jc(b, a, c, d)};
|
|
2177
2179
|
(function() {
|
|
2178
2180
|
function b(c) {
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
h.monitorRunDependencies && h.monitorRunDependencies(
|
|
2186
|
-
if (0 ==
|
|
2187
|
-
var d =
|
|
2188
|
-
|
|
2181
|
+
z = c = c.exports;
|
|
2182
|
+
Aa = z.memory;
|
|
2183
|
+
Ha();
|
|
2184
|
+
Ia = z.__indirect_function_table;
|
|
2185
|
+
Ka.unshift(z.__wasm_call_ctors);
|
|
2186
|
+
Na--;
|
|
2187
|
+
h.monitorRunDependencies && h.monitorRunDependencies(Na);
|
|
2188
|
+
if (0 == Na && (null !== Oa && (clearInterval(Oa), Oa = null), Pa)) {
|
|
2189
|
+
var d = Pa;
|
|
2190
|
+
Pa = null;
|
|
2189
2191
|
d();
|
|
2190
2192
|
}
|
|
2191
2193
|
return c;
|
|
2192
2194
|
}
|
|
2193
2195
|
var a = {env:Nc, wasi_snapshot_preview1:Nc,};
|
|
2194
|
-
|
|
2195
|
-
h.monitorRunDependencies && h.monitorRunDependencies(
|
|
2196
|
+
Na++;
|
|
2197
|
+
h.monitorRunDependencies && h.monitorRunDependencies(Na);
|
|
2196
2198
|
if (h.instantiateWasm) {
|
|
2197
2199
|
try {
|
|
2198
2200
|
return h.instantiateWasm(a, b);
|
|
2199
2201
|
} catch (c) {
|
|
2200
|
-
|
|
2202
|
+
va("Module.instantiateWasm callback failed with error: " + c), ba(c);
|
|
2201
2203
|
}
|
|
2202
2204
|
}
|
|
2203
|
-
|
|
2205
|
+
Wa(a, function(c) {
|
|
2204
2206
|
b(c.instance);
|
|
2205
2207
|
}).catch(ba);
|
|
2206
2208
|
return {};
|
|
2207
2209
|
})();
|
|
2208
|
-
var mb = b => (mb =
|
|
2209
|
-
h.__embind_initialize_bindings = () => (h.__embind_initialize_bindings =
|
|
2210
|
-
h.dynCall_jiji = (b, a, c, d, e) => (h.dynCall_jiji =
|
|
2211
|
-
h.dynCall_viijii = (b, a, c, d, e, f, m) => (h.dynCall_viijii =
|
|
2212
|
-
h.dynCall_iiiiij = (b, a, c, d, e, f, m) => (h.dynCall_iiiiij =
|
|
2213
|
-
h.dynCall_iiiiijj = (b, a, c, d, e, f, m, k, n) => (h.dynCall_iiiiijj =
|
|
2214
|
-
h.dynCall_iiiiiijj = (b, a, c, d, e, f, m, k, n, l) => (h.dynCall_iiiiiijj =
|
|
2210
|
+
var mb = b => (mb = z.free)(b), Mc = b => (Mc = z.malloc)(b), lb = b => (lb = z.__getTypeName)(b);
|
|
2211
|
+
h.__embind_initialize_bindings = () => (h.__embind_initialize_bindings = z._embind_initialize_bindings)();
|
|
2212
|
+
h.dynCall_jiji = (b, a, c, d, e) => (h.dynCall_jiji = z.dynCall_jiji)(b, a, c, d, e);
|
|
2213
|
+
h.dynCall_viijii = (b, a, c, d, e, f, m) => (h.dynCall_viijii = z.dynCall_viijii)(b, a, c, d, e, f, m);
|
|
2214
|
+
h.dynCall_iiiiij = (b, a, c, d, e, f, m) => (h.dynCall_iiiiij = z.dynCall_iiiiij)(b, a, c, d, e, f, m);
|
|
2215
|
+
h.dynCall_iiiiijj = (b, a, c, d, e, f, m, k, n) => (h.dynCall_iiiiijj = z.dynCall_iiiiijj)(b, a, c, d, e, f, m, k, n);
|
|
2216
|
+
h.dynCall_iiiiiijj = (b, a, c, d, e, f, m, k, n, l) => (h.dynCall_iiiiiijj = z.dynCall_iiiiiijj)(b, a, c, d, e, f, m, k, n, l);
|
|
2215
2217
|
var Oc;
|
|
2216
|
-
|
|
2218
|
+
Pa = function Pc() {
|
|
2217
2219
|
Oc || Qc();
|
|
2218
|
-
Oc || (
|
|
2220
|
+
Oc || (Pa = Pc);
|
|
2219
2221
|
};
|
|
2220
2222
|
function Qc() {
|
|
2221
2223
|
function b() {
|
|
2222
|
-
if (!Oc && (Oc = !0, h.calledRun = !0, !
|
|
2223
|
-
|
|
2224
|
+
if (!Oc && (Oc = !0, h.calledRun = !0, !Ba)) {
|
|
2225
|
+
Xa(Ka);
|
|
2224
2226
|
aa(h);
|
|
2225
2227
|
if (h.onRuntimeInitialized) {
|
|
2226
2228
|
h.onRuntimeInitialized();
|
|
@@ -2228,20 +2230,20 @@ function Qc() {
|
|
|
2228
2230
|
if (h.postRun) {
|
|
2229
2231
|
for ("function" == typeof h.postRun && (h.postRun = [h.postRun]); h.postRun.length;) {
|
|
2230
2232
|
var a = h.postRun.shift();
|
|
2231
|
-
|
|
2233
|
+
La.unshift(a);
|
|
2232
2234
|
}
|
|
2233
2235
|
}
|
|
2234
|
-
|
|
2236
|
+
Xa(La);
|
|
2235
2237
|
}
|
|
2236
2238
|
}
|
|
2237
|
-
if (!(0 <
|
|
2239
|
+
if (!(0 < Na)) {
|
|
2238
2240
|
if (h.preRun) {
|
|
2239
2241
|
for ("function" == typeof h.preRun && (h.preRun = [h.preRun]); h.preRun.length;) {
|
|
2240
|
-
|
|
2242
|
+
Ma();
|
|
2241
2243
|
}
|
|
2242
2244
|
}
|
|
2243
|
-
|
|
2244
|
-
0 <
|
|
2245
|
+
Xa(Ja);
|
|
2246
|
+
0 < Na || (h.setStatus ? (h.setStatus("Running..."), setTimeout(function() {
|
|
2245
2247
|
setTimeout(function() {
|
|
2246
2248
|
h.setStatus("");
|
|
2247
2249
|
}, 1);
|
|
@@ -2269,7 +2271,7 @@ Qc();
|
|
|
2269
2271
|
/* 2 */
|
|
2270
2272
|
/***/ ((module) => {
|
|
2271
2273
|
|
|
2272
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-lite","version":"2.26.
|
|
2274
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@rive-app/canvas-lite","version":"2.26.5","description":"A lite version of Rive\'s canvas 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)"],"license":"MIT","files":["rive.js","rive.js.map","rive.wasm","rive_fallback.wasm","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
|
|
2273
2275
|
|
|
2274
2276
|
/***/ }),
|
|
2275
2277
|
/* 3 */
|
|
@@ -2728,6 +2730,7 @@ var __webpack_exports__ = {};
|
|
|
2728
2730
|
__webpack_require__.r(__webpack_exports__);
|
|
2729
2731
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
2730
2732
|
/* harmony export */ Alignment: () => (/* binding */ Alignment),
|
|
2733
|
+
/* harmony export */ DataEnum: () => (/* binding */ DataEnum),
|
|
2731
2734
|
/* harmony export */ EventType: () => (/* binding */ EventType),
|
|
2732
2735
|
/* harmony export */ Fit: () => (/* binding */ Fit),
|
|
2733
2736
|
/* harmony export */ Layout: () => (/* binding */ Layout),
|
|
@@ -2739,6 +2742,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2739
2742
|
/* harmony export */ StateMachineInput: () => (/* binding */ StateMachineInput),
|
|
2740
2743
|
/* harmony export */ StateMachineInputType: () => (/* binding */ StateMachineInputType),
|
|
2741
2744
|
/* harmony export */ Testing: () => (/* binding */ Testing),
|
|
2745
|
+
/* harmony export */ ViewModel: () => (/* binding */ ViewModel),
|
|
2746
|
+
/* harmony export */ ViewModelInstance: () => (/* binding */ ViewModelInstance),
|
|
2747
|
+
/* harmony export */ ViewModelInstanceBoolean: () => (/* binding */ ViewModelInstanceBoolean),
|
|
2748
|
+
/* harmony export */ ViewModelInstanceColor: () => (/* binding */ ViewModelInstanceColor),
|
|
2749
|
+
/* harmony export */ ViewModelInstanceEnum: () => (/* binding */ ViewModelInstanceEnum),
|
|
2750
|
+
/* harmony export */ ViewModelInstanceNumber: () => (/* binding */ ViewModelInstanceNumber),
|
|
2751
|
+
/* harmony export */ ViewModelInstanceString: () => (/* binding */ ViewModelInstanceString),
|
|
2752
|
+
/* harmony export */ ViewModelInstanceTrigger: () => (/* binding */ ViewModelInstanceTrigger),
|
|
2753
|
+
/* harmony export */ ViewModelInstanceValue: () => (/* binding */ ViewModelInstanceValue),
|
|
2742
2754
|
/* harmony export */ decodeAudio: () => (/* binding */ decodeAudio),
|
|
2743
2755
|
/* harmony export */ decodeFont: () => (/* binding */ decodeFont),
|
|
2744
2756
|
/* harmony export */ decodeImage: () => (/* binding */ decodeImage)
|
|
@@ -2762,6 +2774,17 @@ var __extends = (undefined && undefined.__extends) || (function () {
|
|
|
2762
2774
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
2763
2775
|
};
|
|
2764
2776
|
})();
|
|
2777
|
+
var __assign = (undefined && undefined.__assign) || function () {
|
|
2778
|
+
__assign = Object.assign || function(t) {
|
|
2779
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2780
|
+
s = arguments[i];
|
|
2781
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
2782
|
+
t[p] = s[p];
|
|
2783
|
+
}
|
|
2784
|
+
return t;
|
|
2785
|
+
};
|
|
2786
|
+
return __assign.apply(this, arguments);
|
|
2787
|
+
};
|
|
2765
2788
|
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2766
2789
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
2767
2790
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -3198,6 +3221,11 @@ var StateMachine = /** @class */ (function () {
|
|
|
3198
3221
|
this.inputs.length = 0;
|
|
3199
3222
|
this.instance.delete();
|
|
3200
3223
|
};
|
|
3224
|
+
StateMachine.prototype.bindViewModelInstance = function (viewModelInstance) {
|
|
3225
|
+
if (viewModelInstance.runtimeInstance != null) {
|
|
3226
|
+
this.instance.bindViewModelInstance(viewModelInstance.runtimeInstance);
|
|
3227
|
+
}
|
|
3228
|
+
};
|
|
3201
3229
|
return StateMachine;
|
|
3202
3230
|
}());
|
|
3203
3231
|
// #endregion
|
|
@@ -3344,6 +3372,9 @@ var Animator = /** @class */ (function () {
|
|
|
3344
3372
|
if (sm) {
|
|
3345
3373
|
var newStateMachine = new StateMachine(sm, this.runtime, playing, this.artboard);
|
|
3346
3374
|
this.stateMachines.push(newStateMachine);
|
|
3375
|
+
if (!playing) {
|
|
3376
|
+
newStateMachine.advanceAndApply(0);
|
|
3377
|
+
}
|
|
3347
3378
|
}
|
|
3348
3379
|
else {
|
|
3349
3380
|
// In order to maintain compatibility with current behavior, if a state machine is not found
|
|
@@ -4089,6 +4120,8 @@ var Rive = /** @class */ (function () {
|
|
|
4089
4120
|
this._audioEventListener = null;
|
|
4090
4121
|
// draw method bound to the class
|
|
4091
4122
|
this._boundDraw = null;
|
|
4123
|
+
this._viewModelInstance = null;
|
|
4124
|
+
this._dataEnums = null;
|
|
4092
4125
|
// Durations to generate a frame for the last second. Used for performance profiling.
|
|
4093
4126
|
this.durations = [];
|
|
4094
4127
|
this.frameTimes = [];
|
|
@@ -4174,6 +4207,7 @@ var Rive = /** @class */ (function () {
|
|
|
4174
4207
|
buffer: this.buffer,
|
|
4175
4208
|
riveFile: this.riveFile,
|
|
4176
4209
|
autoplay: params.autoplay,
|
|
4210
|
+
autoBind: params.autoBind,
|
|
4177
4211
|
animations: params.animations,
|
|
4178
4212
|
stateMachines: params.stateMachines,
|
|
4179
4213
|
artboard: params.artboard,
|
|
@@ -4192,7 +4226,7 @@ var Rive = /** @class */ (function () {
|
|
|
4192
4226
|
// Initializes the Rive object either from constructor or load()
|
|
4193
4227
|
Rive.prototype.init = function (_a) {
|
|
4194
4228
|
var _this = this;
|
|
4195
|
-
var src = _a.src, buffer = _a.buffer, riveFile = _a.riveFile, animations = _a.animations, stateMachines = _a.stateMachines, artboard = _a.artboard, _b = _a.autoplay, autoplay = _b === void 0 ? false : _b, _c = _a.useOffscreenRenderer, useOffscreenRenderer = _c === void 0 ? false : _c;
|
|
4229
|
+
var src = _a.src, buffer = _a.buffer, riveFile = _a.riveFile, animations = _a.animations, stateMachines = _a.stateMachines, artboard = _a.artboard, _b = _a.autoplay, autoplay = _b === void 0 ? false : _b, _c = _a.useOffscreenRenderer, useOffscreenRenderer = _c === void 0 ? false : _c, _d = _a.autoBind, autoBind = _d === void 0 ? false : _d;
|
|
4196
4230
|
if (this.destroyed) {
|
|
4197
4231
|
return;
|
|
4198
4232
|
}
|
|
@@ -4227,7 +4261,7 @@ var Rive = /** @class */ (function () {
|
|
|
4227
4261
|
_this.resizeDrawingSurfaceToCanvas();
|
|
4228
4262
|
}
|
|
4229
4263
|
// Load Rive data from a source uri or a data buffer
|
|
4230
|
-
_this.initData(artboard, startingAnimationNames, startingStateMachineNames, autoplay)
|
|
4264
|
+
_this.initData(artboard, startingAnimationNames, startingStateMachineNames, autoplay, autoBind)
|
|
4231
4265
|
.then(function () { return _this.setupRiveListeners(); })
|
|
4232
4266
|
.catch(function (e) {
|
|
4233
4267
|
console.error(e);
|
|
@@ -4308,7 +4342,7 @@ var Rive = /** @class */ (function () {
|
|
|
4308
4342
|
this._artboardHeight || this.artboard.height;
|
|
4309
4343
|
};
|
|
4310
4344
|
// Initializes runtime with Rive data and preps for playing
|
|
4311
|
-
Rive.prototype.initData = function (artboardName, animationNames, stateMachineNames, autoplay) {
|
|
4345
|
+
Rive.prototype.initData = function (artboardName, animationNames, stateMachineNames, autoplay, autoBind) {
|
|
4312
4346
|
return __awaiter(this, void 0, void 0, function () {
|
|
4313
4347
|
var error_1, msg;
|
|
4314
4348
|
var _a;
|
|
@@ -4334,7 +4368,7 @@ var Rive = /** @class */ (function () {
|
|
|
4334
4368
|
}
|
|
4335
4369
|
this.file = this.riveFile.getInstance();
|
|
4336
4370
|
// Initialize and draw frame
|
|
4337
|
-
this.initArtboard(artboardName, animationNames, stateMachineNames, autoplay);
|
|
4371
|
+
this.initArtboard(artboardName, animationNames, stateMachineNames, autoplay, autoBind);
|
|
4338
4372
|
// Initialize the artboard size
|
|
4339
4373
|
this.initArtboardSize();
|
|
4340
4374
|
// Check for audio
|
|
@@ -4363,7 +4397,7 @@ var Rive = /** @class */ (function () {
|
|
|
4363
4397
|
});
|
|
4364
4398
|
};
|
|
4365
4399
|
// Initialize for playback
|
|
4366
|
-
Rive.prototype.initArtboard = function (artboardName, animationNames, stateMachineNames, autoplay) {
|
|
4400
|
+
Rive.prototype.initArtboard = function (artboardName, animationNames, stateMachineNames, autoplay, autoBind) {
|
|
4367
4401
|
if (!this.file) {
|
|
4368
4402
|
return;
|
|
4369
4403
|
}
|
|
@@ -4408,13 +4442,24 @@ var Rive = /** @class */ (function () {
|
|
|
4408
4442
|
data: instanceNames,
|
|
4409
4443
|
},
|
|
4410
4444
|
});
|
|
4445
|
+
if (autoBind) {
|
|
4446
|
+
var viewModel = this.file.defaultArtboardViewModel(rootArtboard);
|
|
4447
|
+
if (viewModel !== null) {
|
|
4448
|
+
var runtimeInstance = viewModel.defaultInstance();
|
|
4449
|
+
if (runtimeInstance !== null) {
|
|
4450
|
+
var viewModelInstance = new ViewModelInstance(runtimeInstance, null);
|
|
4451
|
+
this.bindViewModelInstance(viewModelInstance);
|
|
4452
|
+
}
|
|
4453
|
+
}
|
|
4454
|
+
}
|
|
4411
4455
|
};
|
|
4412
4456
|
// Draws the current artboard frame
|
|
4413
4457
|
Rive.prototype.drawFrame = function () {
|
|
4414
|
-
var _a;
|
|
4458
|
+
var _a, _b;
|
|
4415
4459
|
if ((_a = document === null || document === void 0 ? void 0 : document.timeline) === null || _a === void 0 ? void 0 : _a.currentTime) {
|
|
4416
4460
|
if (this.loaded && this.artboard && !this.frameRequestId) {
|
|
4417
4461
|
this._boundDraw(document.timeline.currentTime);
|
|
4462
|
+
(_b = this.runtime) === null || _b === void 0 ? void 0 : _b.resolveAnimationFrame();
|
|
4418
4463
|
}
|
|
4419
4464
|
}
|
|
4420
4465
|
else {
|
|
@@ -4426,6 +4471,7 @@ var Rive = /** @class */ (function () {
|
|
|
4426
4471
|
* @param time the time at which to render a frame
|
|
4427
4472
|
*/
|
|
4428
4473
|
Rive.prototype.draw = function (time, onSecond) {
|
|
4474
|
+
var _a;
|
|
4429
4475
|
// Clear the frameRequestId, as we're now rendering a fresh frame
|
|
4430
4476
|
this.frameRequestId = null;
|
|
4431
4477
|
var before = performance.now();
|
|
@@ -4461,8 +4507,8 @@ var Rive = /** @class */ (function () {
|
|
|
4461
4507
|
// - Advance non-paused state machines by the elapsed number of seconds
|
|
4462
4508
|
// - Advance to the first frame even when autoplay is false
|
|
4463
4509
|
var activeStateMachines = this.animator.stateMachines.filter(function (a) { return a.playing; });
|
|
4464
|
-
for (var
|
|
4465
|
-
var stateMachine = activeStateMachines_1[
|
|
4510
|
+
for (var _b = 0, activeStateMachines_1 = activeStateMachines; _b < activeStateMachines_1.length; _b++) {
|
|
4511
|
+
var stateMachine = activeStateMachines_1[_b];
|
|
4466
4512
|
// Check for events before the current frame's state machine advance
|
|
4467
4513
|
var numEventsReported = stateMachine.reportedEventCount();
|
|
4468
4514
|
if (numEventsReported) {
|
|
@@ -4477,7 +4523,7 @@ var Rive = /** @class */ (function () {
|
|
|
4477
4523
|
// Handle the event side effect if explicitly enabled
|
|
4478
4524
|
if (this.automaticallyHandleEvents) {
|
|
4479
4525
|
var newAnchorTag = document.createElement("a");
|
|
4480
|
-
var
|
|
4526
|
+
var _c = event_1, url = _c.url, target = _c.target;
|
|
4481
4527
|
var sanitizedUrl = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.sanitizeUrl)(url);
|
|
4482
4528
|
url && newAnchorTag.setAttribute("href", sanitizedUrl);
|
|
4483
4529
|
target && newAnchorTag.setAttribute("target", target);
|
|
@@ -4530,6 +4576,7 @@ var Rive = /** @class */ (function () {
|
|
|
4530
4576
|
this.frameTimes.shift();
|
|
4531
4577
|
this.durations.shift();
|
|
4532
4578
|
}
|
|
4579
|
+
(_a = this._viewModelInstance) === null || _a === void 0 ? void 0 : _a.handleCallbacks();
|
|
4533
4580
|
// Calling requestAnimationFrame will rerun draw() at the correct rate:
|
|
4534
4581
|
// https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Basic_animations
|
|
4535
4582
|
if (this.animator.isPlaying) {
|
|
@@ -4587,7 +4634,7 @@ var Rive = /** @class */ (function () {
|
|
|
4587
4634
|
* Rive class
|
|
4588
4635
|
*/
|
|
4589
4636
|
Rive.prototype.cleanup = function () {
|
|
4590
|
-
var _a;
|
|
4637
|
+
var _a, _b;
|
|
4591
4638
|
this.destroyed = true;
|
|
4592
4639
|
// Stop the renderer if it hasn't already been stopped.
|
|
4593
4640
|
this.stopRendering();
|
|
@@ -4608,6 +4655,9 @@ var Rive = /** @class */ (function () {
|
|
|
4608
4655
|
audioManager.remove(this._audioEventListener);
|
|
4609
4656
|
this._audioEventListener = null;
|
|
4610
4657
|
}
|
|
4658
|
+
(_b = this._viewModelInstance) === null || _b === void 0 ? void 0 : _b.cleanup();
|
|
4659
|
+
this._viewModelInstance = null;
|
|
4660
|
+
this._dataEnums = null;
|
|
4611
4661
|
};
|
|
4612
4662
|
/**
|
|
4613
4663
|
* Cleans up the Renderer object. Only call this API if you no longer
|
|
@@ -4759,16 +4809,17 @@ var Rive = /** @class */ (function () {
|
|
|
4759
4809
|
*
|
|
4760
4810
|
*/
|
|
4761
4811
|
Rive.prototype.reset = function (params) {
|
|
4762
|
-
var _a;
|
|
4812
|
+
var _a, _b;
|
|
4763
4813
|
// Get the current artboard, animations, state machines, and playback states
|
|
4764
4814
|
var artBoardName = params === null || params === void 0 ? void 0 : params.artboard;
|
|
4765
4815
|
var animationNames = mapToStringArray(params === null || params === void 0 ? void 0 : params.animations);
|
|
4766
4816
|
var stateMachineNames = mapToStringArray(params === null || params === void 0 ? void 0 : params.stateMachines);
|
|
4767
4817
|
var autoplay = (_a = params === null || params === void 0 ? void 0 : params.autoplay) !== null && _a !== void 0 ? _a : false;
|
|
4818
|
+
var autoBind = (_b = params === null || params === void 0 ? void 0 : params.autoBind) !== null && _b !== void 0 ? _b : false;
|
|
4768
4819
|
// Stop everything and clean up
|
|
4769
4820
|
this.cleanupInstances();
|
|
4770
4821
|
// Reinitialize an artboard instance with the state
|
|
4771
|
-
this.initArtboard(artBoardName, animationNames, stateMachineNames, autoplay);
|
|
4822
|
+
this.initArtboard(artBoardName, animationNames, stateMachineNames, autoplay, autoBind);
|
|
4772
4823
|
this.taskQueue.process();
|
|
4773
4824
|
};
|
|
4774
4825
|
// Loads a new Rive file, keeping listeners in place
|
|
@@ -5391,6 +5442,62 @@ var Rive = /** @class */ (function () {
|
|
|
5391
5442
|
enumerable: false,
|
|
5392
5443
|
configurable: true
|
|
5393
5444
|
});
|
|
5445
|
+
/**
|
|
5446
|
+
* Initialize the data context with the view model instance.
|
|
5447
|
+
*/
|
|
5448
|
+
Rive.prototype.bindViewModelInstance = function (viewModelInstance) {
|
|
5449
|
+
var _a;
|
|
5450
|
+
if (this.artboard && !this.destroyed) {
|
|
5451
|
+
if (viewModelInstance && viewModelInstance.runtimeInstance) {
|
|
5452
|
+
viewModelInstance.internalIncrementReferenceCount();
|
|
5453
|
+
(_a = this._viewModelInstance) === null || _a === void 0 ? void 0 : _a.cleanup();
|
|
5454
|
+
this._viewModelInstance = viewModelInstance;
|
|
5455
|
+
this.artboard.bindViewModelInstance(viewModelInstance.runtimeInstance);
|
|
5456
|
+
this.animator.stateMachines.forEach(function (stateMachine) {
|
|
5457
|
+
return stateMachine.bindViewModelInstance(viewModelInstance);
|
|
5458
|
+
});
|
|
5459
|
+
}
|
|
5460
|
+
}
|
|
5461
|
+
};
|
|
5462
|
+
Object.defineProperty(Rive.prototype, "viewModelInstance", {
|
|
5463
|
+
get: function () {
|
|
5464
|
+
return this._viewModelInstance;
|
|
5465
|
+
},
|
|
5466
|
+
enumerable: false,
|
|
5467
|
+
configurable: true
|
|
5468
|
+
});
|
|
5469
|
+
Rive.prototype.viewModelByIndex = function (index) {
|
|
5470
|
+
var viewModel = this.file.viewModelByIndex(index);
|
|
5471
|
+
if (viewModel !== null) {
|
|
5472
|
+
return new ViewModel(viewModel);
|
|
5473
|
+
}
|
|
5474
|
+
return null;
|
|
5475
|
+
};
|
|
5476
|
+
Rive.prototype.viewModelByName = function (name) {
|
|
5477
|
+
var viewModel = this.file.viewModelByName(name);
|
|
5478
|
+
if (viewModel !== null) {
|
|
5479
|
+
return new ViewModel(viewModel);
|
|
5480
|
+
}
|
|
5481
|
+
return null;
|
|
5482
|
+
};
|
|
5483
|
+
Rive.prototype.enums = function () {
|
|
5484
|
+
if (this._dataEnums === null) {
|
|
5485
|
+
var dataEnums = this.file.enums();
|
|
5486
|
+
this._dataEnums = dataEnums.map(function (dataEnum) {
|
|
5487
|
+
return new DataEnum(dataEnum);
|
|
5488
|
+
});
|
|
5489
|
+
}
|
|
5490
|
+
return this._dataEnums;
|
|
5491
|
+
};
|
|
5492
|
+
Rive.prototype.defaultViewModel = function () {
|
|
5493
|
+
if (this.artboard) {
|
|
5494
|
+
var viewModel = this.file.defaultArtboardViewModel(this.artboard);
|
|
5495
|
+
if (viewModel) {
|
|
5496
|
+
return new ViewModel(viewModel);
|
|
5497
|
+
}
|
|
5498
|
+
}
|
|
5499
|
+
return null;
|
|
5500
|
+
};
|
|
5394
5501
|
// Error message for missing source or buffer
|
|
5395
5502
|
Rive.missingErrorMessage = "Rive source file or data buffer required";
|
|
5396
5503
|
// Error message for removed rive file
|
|
@@ -5398,6 +5505,481 @@ var Rive = /** @class */ (function () {
|
|
|
5398
5505
|
return Rive;
|
|
5399
5506
|
}());
|
|
5400
5507
|
|
|
5508
|
+
var ViewModel = /** @class */ (function () {
|
|
5509
|
+
function ViewModel(viewModel) {
|
|
5510
|
+
this._viewModel = viewModel;
|
|
5511
|
+
}
|
|
5512
|
+
Object.defineProperty(ViewModel.prototype, "instanceCount", {
|
|
5513
|
+
get: function () {
|
|
5514
|
+
return this._viewModel.instanceCount;
|
|
5515
|
+
},
|
|
5516
|
+
enumerable: false,
|
|
5517
|
+
configurable: true
|
|
5518
|
+
});
|
|
5519
|
+
Object.defineProperty(ViewModel.prototype, "name", {
|
|
5520
|
+
get: function () {
|
|
5521
|
+
return this._viewModel.name;
|
|
5522
|
+
},
|
|
5523
|
+
enumerable: false,
|
|
5524
|
+
configurable: true
|
|
5525
|
+
});
|
|
5526
|
+
ViewModel.prototype.instanceByIndex = function (index) {
|
|
5527
|
+
var instance = this._viewModel.instanceByIndex(index);
|
|
5528
|
+
if (instance !== null) {
|
|
5529
|
+
return new ViewModelInstance(instance, null);
|
|
5530
|
+
}
|
|
5531
|
+
return null;
|
|
5532
|
+
};
|
|
5533
|
+
ViewModel.prototype.instanceByName = function (name) {
|
|
5534
|
+
var instance = this._viewModel.instanceByName(name);
|
|
5535
|
+
if (instance !== null) {
|
|
5536
|
+
return new ViewModelInstance(instance, null);
|
|
5537
|
+
}
|
|
5538
|
+
return null;
|
|
5539
|
+
};
|
|
5540
|
+
ViewModel.prototype.defaultInstance = function () {
|
|
5541
|
+
var runtimeInstance = this._viewModel.defaultInstance();
|
|
5542
|
+
if (runtimeInstance !== null) {
|
|
5543
|
+
return new ViewModelInstance(runtimeInstance, null);
|
|
5544
|
+
}
|
|
5545
|
+
return null;
|
|
5546
|
+
};
|
|
5547
|
+
ViewModel.prototype.instance = function () {
|
|
5548
|
+
var runtimeInstance = this._viewModel.instance();
|
|
5549
|
+
if (runtimeInstance !== null) {
|
|
5550
|
+
return new ViewModelInstance(runtimeInstance, null);
|
|
5551
|
+
}
|
|
5552
|
+
return null;
|
|
5553
|
+
};
|
|
5554
|
+
Object.defineProperty(ViewModel.prototype, "properties", {
|
|
5555
|
+
get: function () {
|
|
5556
|
+
return this._viewModel.getProperties();
|
|
5557
|
+
},
|
|
5558
|
+
enumerable: false,
|
|
5559
|
+
configurable: true
|
|
5560
|
+
});
|
|
5561
|
+
Object.defineProperty(ViewModel.prototype, "instanceNames", {
|
|
5562
|
+
get: function () {
|
|
5563
|
+
return this._viewModel.getInstanceNames();
|
|
5564
|
+
},
|
|
5565
|
+
enumerable: false,
|
|
5566
|
+
configurable: true
|
|
5567
|
+
});
|
|
5568
|
+
return ViewModel;
|
|
5569
|
+
}());
|
|
5570
|
+
|
|
5571
|
+
var DataEnum = /** @class */ (function () {
|
|
5572
|
+
function DataEnum(dataEnum) {
|
|
5573
|
+
this._dataEnum = dataEnum;
|
|
5574
|
+
}
|
|
5575
|
+
Object.defineProperty(DataEnum.prototype, "name", {
|
|
5576
|
+
get: function () {
|
|
5577
|
+
return this._dataEnum.name;
|
|
5578
|
+
},
|
|
5579
|
+
enumerable: false,
|
|
5580
|
+
configurable: true
|
|
5581
|
+
});
|
|
5582
|
+
Object.defineProperty(DataEnum.prototype, "values", {
|
|
5583
|
+
get: function () {
|
|
5584
|
+
return this._dataEnum.values;
|
|
5585
|
+
},
|
|
5586
|
+
enumerable: false,
|
|
5587
|
+
configurable: true
|
|
5588
|
+
});
|
|
5589
|
+
return DataEnum;
|
|
5590
|
+
}());
|
|
5591
|
+
|
|
5592
|
+
var ViewModelInstance = /** @class */ (function () {
|
|
5593
|
+
function ViewModelInstance(runtimeInstance, root) {
|
|
5594
|
+
this._propertiesWithCallbacks = [];
|
|
5595
|
+
this._referenceCount = 0;
|
|
5596
|
+
this._runtimeInstance = runtimeInstance;
|
|
5597
|
+
this._root = root || this;
|
|
5598
|
+
}
|
|
5599
|
+
Object.defineProperty(ViewModelInstance.prototype, "runtimeInstance", {
|
|
5600
|
+
get: function () {
|
|
5601
|
+
return this._runtimeInstance;
|
|
5602
|
+
},
|
|
5603
|
+
enumerable: false,
|
|
5604
|
+
configurable: true
|
|
5605
|
+
});
|
|
5606
|
+
ViewModelInstance.prototype.handleCallbacks = function () {
|
|
5607
|
+
if (this._propertiesWithCallbacks.length !== 0) {
|
|
5608
|
+
this._propertiesWithCallbacks.forEach(function (property) {
|
|
5609
|
+
property.handleCallbacks();
|
|
5610
|
+
});
|
|
5611
|
+
}
|
|
5612
|
+
};
|
|
5613
|
+
ViewModelInstance.prototype.clearCallbacks = function () {
|
|
5614
|
+
this._propertiesWithCallbacks.forEach(function (property) {
|
|
5615
|
+
property.clearCallbacks();
|
|
5616
|
+
});
|
|
5617
|
+
};
|
|
5618
|
+
/**
|
|
5619
|
+
* method to access a property instance of type number belonging
|
|
5620
|
+
* to the view model instance or to a nested view model instance
|
|
5621
|
+
* @param path - path to the number property
|
|
5622
|
+
*/
|
|
5623
|
+
ViewModelInstance.prototype.number = function (path) {
|
|
5624
|
+
var _a;
|
|
5625
|
+
var instance = (_a = this._runtimeInstance) === null || _a === void 0 ? void 0 : _a.number(path);
|
|
5626
|
+
if (instance) {
|
|
5627
|
+
return new ViewModelInstanceNumber(instance, this._root);
|
|
5628
|
+
}
|
|
5629
|
+
return null;
|
|
5630
|
+
};
|
|
5631
|
+
/**
|
|
5632
|
+
* method to access a property instance of type string belonging
|
|
5633
|
+
* to the view model instance or to a nested view model instance
|
|
5634
|
+
* @param path - path to the number property
|
|
5635
|
+
*/
|
|
5636
|
+
ViewModelInstance.prototype.string = function (path) {
|
|
5637
|
+
var _a;
|
|
5638
|
+
var instance = (_a = this._runtimeInstance) === null || _a === void 0 ? void 0 : _a.string(path);
|
|
5639
|
+
if (instance) {
|
|
5640
|
+
return new ViewModelInstanceString(instance, this._root);
|
|
5641
|
+
}
|
|
5642
|
+
return null;
|
|
5643
|
+
};
|
|
5644
|
+
/**
|
|
5645
|
+
* method to access a property instance of type boolean belonging
|
|
5646
|
+
* to the view model instance or to a nested view model instance
|
|
5647
|
+
* @param path - path to the number property
|
|
5648
|
+
*/
|
|
5649
|
+
ViewModelInstance.prototype.boolean = function (path) {
|
|
5650
|
+
var _a;
|
|
5651
|
+
var instance = (_a = this._runtimeInstance) === null || _a === void 0 ? void 0 : _a.boolean(path);
|
|
5652
|
+
if (instance) {
|
|
5653
|
+
return new ViewModelInstanceBoolean(instance, this._root);
|
|
5654
|
+
}
|
|
5655
|
+
return null;
|
|
5656
|
+
};
|
|
5657
|
+
/**
|
|
5658
|
+
* method to access a property instance of type color belonging
|
|
5659
|
+
* to the view model instance or to a nested view model instance
|
|
5660
|
+
* @param path - path to the number property
|
|
5661
|
+
*/
|
|
5662
|
+
ViewModelInstance.prototype.color = function (path) {
|
|
5663
|
+
var _a;
|
|
5664
|
+
var instance = (_a = this._runtimeInstance) === null || _a === void 0 ? void 0 : _a.color(path);
|
|
5665
|
+
if (instance) {
|
|
5666
|
+
return new ViewModelInstanceColor(instance, this._root);
|
|
5667
|
+
}
|
|
5668
|
+
return null;
|
|
5669
|
+
};
|
|
5670
|
+
/**
|
|
5671
|
+
* method to access a property instance of type trigger belonging
|
|
5672
|
+
* to the view model instance or to a nested view model instance
|
|
5673
|
+
* @param path - path to the number property
|
|
5674
|
+
*/
|
|
5675
|
+
ViewModelInstance.prototype.trigger = function (path) {
|
|
5676
|
+
var _a;
|
|
5677
|
+
var instance = (_a = this._runtimeInstance) === null || _a === void 0 ? void 0 : _a.trigger(path);
|
|
5678
|
+
if (instance) {
|
|
5679
|
+
return new ViewModelInstanceTrigger(instance, this._root);
|
|
5680
|
+
}
|
|
5681
|
+
return null;
|
|
5682
|
+
};
|
|
5683
|
+
/**
|
|
5684
|
+
* method to access a property instance of type enum belonging
|
|
5685
|
+
* to the view model instance or to a nested view model instance
|
|
5686
|
+
* @param path - path to the number property
|
|
5687
|
+
*/
|
|
5688
|
+
ViewModelInstance.prototype.enum = function (path) {
|
|
5689
|
+
var _a;
|
|
5690
|
+
var instance = (_a = this._runtimeInstance) === null || _a === void 0 ? void 0 : _a.enum(path);
|
|
5691
|
+
if (instance) {
|
|
5692
|
+
return new ViewModelInstanceEnum(instance, this._root);
|
|
5693
|
+
}
|
|
5694
|
+
return null;
|
|
5695
|
+
};
|
|
5696
|
+
/**
|
|
5697
|
+
* method to access a view model property instance belonging
|
|
5698
|
+
* to the view model instance or to a nested view model instance
|
|
5699
|
+
* @param path - path to the number property
|
|
5700
|
+
*/
|
|
5701
|
+
ViewModelInstance.prototype.viewModel = function (path) {
|
|
5702
|
+
var _a;
|
|
5703
|
+
var viewModelInstance = (_a = this._runtimeInstance) === null || _a === void 0 ? void 0 : _a.viewModel(path);
|
|
5704
|
+
if (viewModelInstance) {
|
|
5705
|
+
return new ViewModelInstance(viewModelInstance, this._root);
|
|
5706
|
+
}
|
|
5707
|
+
return null;
|
|
5708
|
+
};
|
|
5709
|
+
/**
|
|
5710
|
+
* method to replace a view model property with another view model value
|
|
5711
|
+
* @param path - path to the view model property
|
|
5712
|
+
* @param value - view model that will replace the original
|
|
5713
|
+
*/
|
|
5714
|
+
ViewModelInstance.prototype.replaceViewModel = function (path, value) {
|
|
5715
|
+
var _a;
|
|
5716
|
+
if (value.runtimeInstance !== null) {
|
|
5717
|
+
return (((_a = this._runtimeInstance) === null || _a === void 0 ? void 0 : _a.replaceViewModel(path, value.runtimeInstance)) ||
|
|
5718
|
+
false);
|
|
5719
|
+
}
|
|
5720
|
+
return false;
|
|
5721
|
+
};
|
|
5722
|
+
/*
|
|
5723
|
+
* method for internal use, it shouldn't be called externally
|
|
5724
|
+
*/
|
|
5725
|
+
ViewModelInstance.prototype.addToCallbacks = function (property) {
|
|
5726
|
+
if (!this._propertiesWithCallbacks.includes(property)) {
|
|
5727
|
+
this._propertiesWithCallbacks.push(property);
|
|
5728
|
+
}
|
|
5729
|
+
};
|
|
5730
|
+
/*
|
|
5731
|
+
* method for internal use, it shouldn't be called externally
|
|
5732
|
+
*/
|
|
5733
|
+
ViewModelInstance.prototype.removeFromCallbacks = function (property) {
|
|
5734
|
+
if (this._propertiesWithCallbacks.includes(property)) {
|
|
5735
|
+
this._propertiesWithCallbacks = this._propertiesWithCallbacks.filter(function (prop) { return prop !== property; });
|
|
5736
|
+
}
|
|
5737
|
+
};
|
|
5738
|
+
/*
|
|
5739
|
+
* method to add one to the reference counter of the instance.
|
|
5740
|
+
* Use if the file owning the reference is destroyed but the instance needs to stay around
|
|
5741
|
+
*/
|
|
5742
|
+
ViewModelInstance.prototype.incrementReferenceCount = function () {
|
|
5743
|
+
var _a;
|
|
5744
|
+
this._referenceCount++;
|
|
5745
|
+
(_a = this._runtimeInstance) === null || _a === void 0 ? void 0 : _a.incrementReferenceCount();
|
|
5746
|
+
};
|
|
5747
|
+
/*
|
|
5748
|
+
* method to subtract one to the reference counter of the instance.
|
|
5749
|
+
* Use if incrementReferenceCount has been called
|
|
5750
|
+
*/
|
|
5751
|
+
ViewModelInstance.prototype.decrementReferenceCount = function () {
|
|
5752
|
+
var _a;
|
|
5753
|
+
this._referenceCount--;
|
|
5754
|
+
(_a = this._runtimeInstance) === null || _a === void 0 ? void 0 : _a.decrementReferenceCount();
|
|
5755
|
+
};
|
|
5756
|
+
Object.defineProperty(ViewModelInstance.prototype, "properties", {
|
|
5757
|
+
get: function () {
|
|
5758
|
+
var _a;
|
|
5759
|
+
return (((_a = this._runtimeInstance) === null || _a === void 0 ? void 0 : _a.getProperties().map(function (prop) { return (__assign({}, prop)); })) || []);
|
|
5760
|
+
},
|
|
5761
|
+
enumerable: false,
|
|
5762
|
+
configurable: true
|
|
5763
|
+
});
|
|
5764
|
+
ViewModelInstance.prototype.internalIncrementReferenceCount = function () {
|
|
5765
|
+
this._referenceCount++;
|
|
5766
|
+
};
|
|
5767
|
+
ViewModelInstance.prototype.cleanup = function () {
|
|
5768
|
+
this._referenceCount--;
|
|
5769
|
+
if (this._referenceCount <= 0) {
|
|
5770
|
+
this._runtimeInstance = null;
|
|
5771
|
+
this.clearCallbacks();
|
|
5772
|
+
this._propertiesWithCallbacks = [];
|
|
5773
|
+
}
|
|
5774
|
+
};
|
|
5775
|
+
return ViewModelInstance;
|
|
5776
|
+
}());
|
|
5777
|
+
|
|
5778
|
+
var ViewModelInstanceValue = /** @class */ (function () {
|
|
5779
|
+
function ViewModelInstanceValue(instance, root) {
|
|
5780
|
+
this.callbacks = [];
|
|
5781
|
+
this._viewModelInstanceValue = instance;
|
|
5782
|
+
this._rootViewModel = root;
|
|
5783
|
+
}
|
|
5784
|
+
ViewModelInstanceValue.prototype.on = function (callback) {
|
|
5785
|
+
// Since we don't clean the changed flag for properties that don't have listeners,
|
|
5786
|
+
// we clean it the first time we add a listener to it
|
|
5787
|
+
if (this.callbacks.length === 0) {
|
|
5788
|
+
this._viewModelInstanceValue.clearChanges();
|
|
5789
|
+
}
|
|
5790
|
+
if (!this.callbacks.includes(callback)) {
|
|
5791
|
+
this.callbacks.push(callback);
|
|
5792
|
+
this._rootViewModel.addToCallbacks(this);
|
|
5793
|
+
}
|
|
5794
|
+
};
|
|
5795
|
+
ViewModelInstanceValue.prototype.off = function (callback) {
|
|
5796
|
+
if (!callback) {
|
|
5797
|
+
this.callbacks.length = 0;
|
|
5798
|
+
}
|
|
5799
|
+
else {
|
|
5800
|
+
this.callbacks = this.callbacks.filter(function (cb) { return cb !== callback; });
|
|
5801
|
+
}
|
|
5802
|
+
if (this.callbacks.length === 0) {
|
|
5803
|
+
this._rootViewModel.removeFromCallbacks(this);
|
|
5804
|
+
}
|
|
5805
|
+
};
|
|
5806
|
+
ViewModelInstanceValue.prototype.internalHandleCallback = function (callback) { };
|
|
5807
|
+
ViewModelInstanceValue.prototype.handleCallbacks = function () {
|
|
5808
|
+
var _this = this;
|
|
5809
|
+
if (this._viewModelInstanceValue.hasChanged) {
|
|
5810
|
+
this._viewModelInstanceValue.clearChanges();
|
|
5811
|
+
this.callbacks.forEach(function (callback) {
|
|
5812
|
+
_this.internalHandleCallback(callback);
|
|
5813
|
+
});
|
|
5814
|
+
}
|
|
5815
|
+
};
|
|
5816
|
+
ViewModelInstanceValue.prototype.clearCallbacks = function () {
|
|
5817
|
+
this.callbacks.length = 0;
|
|
5818
|
+
};
|
|
5819
|
+
Object.defineProperty(ViewModelInstanceValue.prototype, "name", {
|
|
5820
|
+
get: function () {
|
|
5821
|
+
return this._viewModelInstanceValue.name;
|
|
5822
|
+
},
|
|
5823
|
+
enumerable: false,
|
|
5824
|
+
configurable: true
|
|
5825
|
+
});
|
|
5826
|
+
return ViewModelInstanceValue;
|
|
5827
|
+
}());
|
|
5828
|
+
|
|
5829
|
+
var ViewModelInstanceString = /** @class */ (function (_super) {
|
|
5830
|
+
__extends(ViewModelInstanceString, _super);
|
|
5831
|
+
function ViewModelInstanceString(instance, root) {
|
|
5832
|
+
return _super.call(this, instance, root) || this;
|
|
5833
|
+
}
|
|
5834
|
+
Object.defineProperty(ViewModelInstanceString.prototype, "value", {
|
|
5835
|
+
get: function () {
|
|
5836
|
+
return this._viewModelInstanceValue.value;
|
|
5837
|
+
},
|
|
5838
|
+
set: function (val) {
|
|
5839
|
+
this._viewModelInstanceValue.value = val;
|
|
5840
|
+
},
|
|
5841
|
+
enumerable: false,
|
|
5842
|
+
configurable: true
|
|
5843
|
+
});
|
|
5844
|
+
ViewModelInstanceString.prototype.internalHandleCallback = function (callback) {
|
|
5845
|
+
callback(this.value);
|
|
5846
|
+
};
|
|
5847
|
+
return ViewModelInstanceString;
|
|
5848
|
+
}(ViewModelInstanceValue));
|
|
5849
|
+
|
|
5850
|
+
var ViewModelInstanceNumber = /** @class */ (function (_super) {
|
|
5851
|
+
__extends(ViewModelInstanceNumber, _super);
|
|
5852
|
+
function ViewModelInstanceNumber(instance, root) {
|
|
5853
|
+
return _super.call(this, instance, root) || this;
|
|
5854
|
+
}
|
|
5855
|
+
Object.defineProperty(ViewModelInstanceNumber.prototype, "value", {
|
|
5856
|
+
get: function () {
|
|
5857
|
+
return this._viewModelInstanceValue.value;
|
|
5858
|
+
},
|
|
5859
|
+
set: function (val) {
|
|
5860
|
+
this._viewModelInstanceValue.value = val;
|
|
5861
|
+
},
|
|
5862
|
+
enumerable: false,
|
|
5863
|
+
configurable: true
|
|
5864
|
+
});
|
|
5865
|
+
ViewModelInstanceNumber.prototype.internalHandleCallback = function (callback) {
|
|
5866
|
+
callback(this.value);
|
|
5867
|
+
};
|
|
5868
|
+
return ViewModelInstanceNumber;
|
|
5869
|
+
}(ViewModelInstanceValue));
|
|
5870
|
+
|
|
5871
|
+
var ViewModelInstanceBoolean = /** @class */ (function (_super) {
|
|
5872
|
+
__extends(ViewModelInstanceBoolean, _super);
|
|
5873
|
+
function ViewModelInstanceBoolean(instance, root) {
|
|
5874
|
+
return _super.call(this, instance, root) || this;
|
|
5875
|
+
}
|
|
5876
|
+
Object.defineProperty(ViewModelInstanceBoolean.prototype, "value", {
|
|
5877
|
+
get: function () {
|
|
5878
|
+
return this._viewModelInstanceValue.value;
|
|
5879
|
+
},
|
|
5880
|
+
set: function (val) {
|
|
5881
|
+
this._viewModelInstanceValue.value = val;
|
|
5882
|
+
},
|
|
5883
|
+
enumerable: false,
|
|
5884
|
+
configurable: true
|
|
5885
|
+
});
|
|
5886
|
+
ViewModelInstanceBoolean.prototype.internalHandleCallback = function (callback) {
|
|
5887
|
+
callback(this.value);
|
|
5888
|
+
};
|
|
5889
|
+
return ViewModelInstanceBoolean;
|
|
5890
|
+
}(ViewModelInstanceValue));
|
|
5891
|
+
|
|
5892
|
+
var ViewModelInstanceTrigger = /** @class */ (function (_super) {
|
|
5893
|
+
__extends(ViewModelInstanceTrigger, _super);
|
|
5894
|
+
function ViewModelInstanceTrigger(instance, root) {
|
|
5895
|
+
return _super.call(this, instance, root) || this;
|
|
5896
|
+
}
|
|
5897
|
+
ViewModelInstanceTrigger.prototype.trigger = function () {
|
|
5898
|
+
return this._viewModelInstanceValue.trigger();
|
|
5899
|
+
};
|
|
5900
|
+
ViewModelInstanceTrigger.prototype.internalHandleCallback = function (callback) {
|
|
5901
|
+
callback();
|
|
5902
|
+
};
|
|
5903
|
+
return ViewModelInstanceTrigger;
|
|
5904
|
+
}(ViewModelInstanceValue));
|
|
5905
|
+
|
|
5906
|
+
var ViewModelInstanceEnum = /** @class */ (function (_super) {
|
|
5907
|
+
__extends(ViewModelInstanceEnum, _super);
|
|
5908
|
+
function ViewModelInstanceEnum(instance, root) {
|
|
5909
|
+
return _super.call(this, instance, root) || this;
|
|
5910
|
+
}
|
|
5911
|
+
Object.defineProperty(ViewModelInstanceEnum.prototype, "value", {
|
|
5912
|
+
get: function () {
|
|
5913
|
+
return this._viewModelInstanceValue.value;
|
|
5914
|
+
},
|
|
5915
|
+
set: function (val) {
|
|
5916
|
+
this._viewModelInstanceValue.value = val;
|
|
5917
|
+
},
|
|
5918
|
+
enumerable: false,
|
|
5919
|
+
configurable: true
|
|
5920
|
+
});
|
|
5921
|
+
Object.defineProperty(ViewModelInstanceEnum.prototype, "valueIndex", {
|
|
5922
|
+
get: function () {
|
|
5923
|
+
return this._viewModelInstanceValue
|
|
5924
|
+
.valueIndex;
|
|
5925
|
+
},
|
|
5926
|
+
set: function (val) {
|
|
5927
|
+
this._viewModelInstanceValue.valueIndex = val;
|
|
5928
|
+
},
|
|
5929
|
+
enumerable: false,
|
|
5930
|
+
configurable: true
|
|
5931
|
+
});
|
|
5932
|
+
Object.defineProperty(ViewModelInstanceEnum.prototype, "values", {
|
|
5933
|
+
get: function () {
|
|
5934
|
+
return this._viewModelInstanceValue.values;
|
|
5935
|
+
},
|
|
5936
|
+
enumerable: false,
|
|
5937
|
+
configurable: true
|
|
5938
|
+
});
|
|
5939
|
+
ViewModelInstanceEnum.prototype.internalHandleCallback = function (callback) {
|
|
5940
|
+
callback(this.value);
|
|
5941
|
+
};
|
|
5942
|
+
return ViewModelInstanceEnum;
|
|
5943
|
+
}(ViewModelInstanceValue));
|
|
5944
|
+
|
|
5945
|
+
var ViewModelInstanceColor = /** @class */ (function (_super) {
|
|
5946
|
+
__extends(ViewModelInstanceColor, _super);
|
|
5947
|
+
function ViewModelInstanceColor(instance, root) {
|
|
5948
|
+
return _super.call(this, instance, root) || this;
|
|
5949
|
+
}
|
|
5950
|
+
Object.defineProperty(ViewModelInstanceColor.prototype, "value", {
|
|
5951
|
+
get: function () {
|
|
5952
|
+
return this._viewModelInstanceValue.value;
|
|
5953
|
+
},
|
|
5954
|
+
set: function (val) {
|
|
5955
|
+
this._viewModelInstanceValue.value = val;
|
|
5956
|
+
},
|
|
5957
|
+
enumerable: false,
|
|
5958
|
+
configurable: true
|
|
5959
|
+
});
|
|
5960
|
+
ViewModelInstanceColor.prototype.rgb = function (r, g, b) {
|
|
5961
|
+
this._viewModelInstanceValue.rgb(r, g, b);
|
|
5962
|
+
};
|
|
5963
|
+
ViewModelInstanceColor.prototype.rgba = function (r, g, b, a) {
|
|
5964
|
+
this._viewModelInstanceValue.argb(a, r, g, b);
|
|
5965
|
+
};
|
|
5966
|
+
ViewModelInstanceColor.prototype.argb = function (a, r, g, b) {
|
|
5967
|
+
this._viewModelInstanceValue.argb(a, r, g, b);
|
|
5968
|
+
};
|
|
5969
|
+
// Value 0 to 255
|
|
5970
|
+
ViewModelInstanceColor.prototype.alpha = function (a) {
|
|
5971
|
+
this._viewModelInstanceValue.alpha(a);
|
|
5972
|
+
};
|
|
5973
|
+
// Value 0 to 1
|
|
5974
|
+
ViewModelInstanceColor.prototype.opacity = function (o) {
|
|
5975
|
+
this._viewModelInstanceValue.alpha(Math.round(Math.max(0, Math.min(1, o)) * 255));
|
|
5976
|
+
};
|
|
5977
|
+
ViewModelInstanceColor.prototype.internalHandleCallback = function (callback) {
|
|
5978
|
+
callback(this.value);
|
|
5979
|
+
};
|
|
5980
|
+
return ViewModelInstanceColor;
|
|
5981
|
+
}(ViewModelInstanceValue));
|
|
5982
|
+
|
|
5401
5983
|
// Loads Rive data from a URI via fetch.
|
|
5402
5984
|
var loadRiveFile = function (src) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5403
5985
|
var req, res, buffer;
|