@canvasengine/presets 2.0.0-beta.45 → 2.0.0-beta.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Tilemap/TileLayer.d.ts +95 -0
- package/dist/Tilemap/TileLayer.d.ts.map +1 -0
- package/dist/index.global.js +14 -19
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +859 -867
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useProps as Lt, h as ft, Graphics as Kt, tick as Ie, mount as Te, on as pi, Container as Dt, animatedSignal as mi, signal as
|
|
1
|
+
import { useProps as Lt, h as ft, Graphics as Kt, tick as Ie, mount as Te, on as pi, Container as Dt, animatedSignal as mi, signal as z, RadialGradient as _i, isObservable as gi, isSignal as oe, effect as Ze, DisplayObject as yi, registerComponent as xi, createComponent as Ei, loop as wi, TilingSprite as vi, Mesh as bi } from "canvasengine";
|
|
2
2
|
import * as mt from "pixi.js";
|
|
3
3
|
import { Geometry as ti, Buffer as Se, BufferUsage as kt, ExtensionType as Zt, NOOP as Ai, UniformGroup as ee, Matrix as Ii, Texture as ie, BindGroup as ei, Shader as Ce, GlProgram as re, GpuProgram as Ti, ViewContainer as Si, State as Ci, Bounds as Mi, TextureSource as Bi, groupD8 as ot, Container as Fi, extensions as Me, AnimatedSprite as Di, Assets as Ni, Rectangle as Pi } from "pixi.js";
|
|
4
4
|
function le(h) {
|
|
@@ -17,8 +17,8 @@ function Lr(h) {
|
|
|
17
17
|
backgroundColor: c,
|
|
18
18
|
foregroundColor: a,
|
|
19
19
|
border: o,
|
|
20
|
-
innerMargin:
|
|
21
|
-
borderRadius:
|
|
20
|
+
innerMargin: g,
|
|
21
|
+
borderRadius: I
|
|
22
22
|
} = Lt(h, {
|
|
23
23
|
backgroundColor: "#000000",
|
|
24
24
|
foregroundColor: "#FFFFFF",
|
|
@@ -31,28 +31,28 @@ function Lr(h) {
|
|
|
31
31
|
...h,
|
|
32
32
|
width: t,
|
|
33
33
|
height: e,
|
|
34
|
-
draw(
|
|
35
|
-
|
|
34
|
+
draw(E) {
|
|
35
|
+
I() ? E.roundRect(0, 0, t(), e(), I()) : E.rect(0, 0, t(), e()), o && E.stroke(o), E.fill(c());
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
ft(Kt, {
|
|
39
39
|
width: t,
|
|
40
40
|
height: e,
|
|
41
|
-
draw(
|
|
42
|
-
const S =
|
|
41
|
+
draw(E) {
|
|
42
|
+
const S = g(), T = I(), F = Math.max(
|
|
43
43
|
0,
|
|
44
44
|
Math.min(
|
|
45
45
|
t() - 2 * S,
|
|
46
46
|
i() / s() * (t() - 2 * S)
|
|
47
47
|
)
|
|
48
|
-
),
|
|
49
|
-
|
|
48
|
+
), B = e() - 2 * S;
|
|
49
|
+
I ? E.roundRect(S, S, F, B, T) : E.rect(S, S, F, B);
|
|
50
50
|
const D = a();
|
|
51
51
|
if (D.startsWith("rgba")) {
|
|
52
|
-
const [
|
|
53
|
-
|
|
52
|
+
const [P, _, v, m] = D.match(/\d+(\.\d+)?/g).map(Number);
|
|
53
|
+
E.fill({ color: Oi(P, _, v), alpha: m });
|
|
54
54
|
} else
|
|
55
|
-
|
|
55
|
+
E.fill(D);
|
|
56
56
|
}
|
|
57
57
|
})
|
|
58
58
|
);
|
|
@@ -205,13 +205,13 @@ class Y {
|
|
|
205
205
|
return Math.floor(Math.random() * (e - t) + t);
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
|
-
var
|
|
208
|
+
var jt;
|
|
209
209
|
(function(h) {
|
|
210
210
|
h.Circle = "circle", h.Box = "box", h.Ring = "ring";
|
|
211
|
-
})(
|
|
211
|
+
})(jt || (jt = {}));
|
|
212
212
|
class Ri extends Be {
|
|
213
213
|
constructor() {
|
|
214
|
-
super(
|
|
214
|
+
super(jt.Box);
|
|
215
215
|
}
|
|
216
216
|
// *********************************************************************************************
|
|
217
217
|
// * Public *
|
|
@@ -219,13 +219,13 @@ class Ri extends Be {
|
|
|
219
219
|
emit(t) {
|
|
220
220
|
const e = this._settings, i = this.emitter, s = e.width * 0.5 * this.__scaleMod, c = e.height * 0.5 * this.__scaleMod;
|
|
221
221
|
let a = i.rotation;
|
|
222
|
-
const o = Y.float(-s, s),
|
|
223
|
-
a != 0 ? (t.component.x = this.__x + this._t * (this.x - this.__x) + o * Math.cos(a) -
|
|
222
|
+
const o = Y.float(-s, s), g = Y.float(-c, c);
|
|
223
|
+
a != 0 ? (t.component.x = this.__x + this._t * (this.x - this.__x) + o * Math.cos(a) - g * Math.sin(a), t.component.y = this.__y + this._t * (this.y - this.__y) + o * Math.sin(a) + g * Math.cos(a)) : (t.component.x = this.__x + this._t * (this.x - this.__x) + o, t.component.y = this.__y + this._t * (this.y - this.__y) + g), e.radial ? (a += Math.atan2(g, o), t.dx = Math.cos(a), t.dy = Math.sin(a)) : (t.dx = this._dx, t.dy = this._dy), t.component.rotation = a, this._t += this._posInterpolationStep;
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
class Ui extends Be {
|
|
227
227
|
constructor() {
|
|
228
|
-
super(
|
|
228
|
+
super(jt.Circle);
|
|
229
229
|
}
|
|
230
230
|
// *********************************************************************************************
|
|
231
231
|
// * Public *
|
|
@@ -243,7 +243,7 @@ class Ui extends Be {
|
|
|
243
243
|
}
|
|
244
244
|
class ki extends Be {
|
|
245
245
|
constructor() {
|
|
246
|
-
super(
|
|
246
|
+
super(jt.Ring);
|
|
247
247
|
}
|
|
248
248
|
// *********************************************************************************************
|
|
249
249
|
// * Public *
|
|
@@ -472,8 +472,8 @@ let Yi = class extends Ot {
|
|
|
472
472
|
let o = e.childs.length;
|
|
473
473
|
if (this._hasChildEmitters = o > 0, this._childEmitters)
|
|
474
474
|
for (; --o > -1; ) {
|
|
475
|
-
const
|
|
476
|
-
|
|
475
|
+
const g = e.childs[o], I = c.getParticleEmitterById(g.id);
|
|
476
|
+
I.init(t.container, !0, (g.scale || 1) * (i || 1)), g.adoptRotation && (I.rotation = s.rotation, I.__adoptRotation = !0), I.__parent = this, this._childEmitters.push(I);
|
|
477
477
|
}
|
|
478
478
|
}
|
|
479
479
|
return e.useSpawns && (e.spawn.onStart.length > 0 && t.__subSpawn(this, e.spawn.onStart), this._spawnOnHalfway = e.spawn.onHalfway.length > 0), t.__on.particleSpawned.__hasCallback && t.__on.particleSpawned.dispatch(this), this;
|
|
@@ -498,8 +498,8 @@ let Yi = class extends Ot {
|
|
|
498
498
|
const a = this._childEmitters;
|
|
499
499
|
let o = a.length;
|
|
500
500
|
for (; --o > -1; ) {
|
|
501
|
-
const
|
|
502
|
-
|
|
501
|
+
const g = a[o];
|
|
502
|
+
g.__recycled || (g.x = s.position.x, g.y = s.position.y, g.__adoptRotation && (g.rotation = s.rotation));
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
505
|
this.emitter.__on.particleUpdated.__hasCallback && this.emitter.__on.particleUpdated.dispatch(this), this.__on.updated.__hasCallback && this.__on.updated.dispatch(this);
|
|
@@ -563,8 +563,8 @@ class bt {
|
|
|
563
563
|
bt.parse(c, a, i);
|
|
564
564
|
else
|
|
565
565
|
for (let o of c)
|
|
566
|
-
for (let
|
|
567
|
-
o[
|
|
566
|
+
for (let g in i)
|
|
567
|
+
o[g] == null && (o[g] = i[g]);
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
570
|
}
|
|
@@ -745,24 +745,24 @@ var Gi = function(h, t, e, i) {
|
|
|
745
745
|
});
|
|
746
746
|
}
|
|
747
747
|
return new (e || (e = Promise))(function(c, a) {
|
|
748
|
-
function o(
|
|
748
|
+
function o(E) {
|
|
749
749
|
try {
|
|
750
|
-
|
|
750
|
+
I(i.next(E));
|
|
751
751
|
} catch (S) {
|
|
752
752
|
a(S);
|
|
753
753
|
}
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function g(E) {
|
|
756
756
|
try {
|
|
757
|
-
|
|
757
|
+
I(i.throw(E));
|
|
758
758
|
} catch (S) {
|
|
759
759
|
a(S);
|
|
760
760
|
}
|
|
761
761
|
}
|
|
762
|
-
function
|
|
763
|
-
|
|
762
|
+
function I(E) {
|
|
763
|
+
E.done ? c(E.value) : s(E.value).then(o, g);
|
|
764
764
|
}
|
|
765
|
-
|
|
765
|
+
I((i = i.apply(h, t || [])).next());
|
|
766
766
|
});
|
|
767
767
|
};
|
|
768
768
|
class _t {
|
|
@@ -864,11 +864,11 @@ class _t {
|
|
|
864
864
|
rfx_spritesheet: e,
|
|
865
865
|
rfx_bundleSettings: t
|
|
866
866
|
};
|
|
867
|
-
for (var
|
|
868
|
-
o[
|
|
867
|
+
for (var g in s)
|
|
868
|
+
o[g] = s[g];
|
|
869
869
|
mt.Assets.addBundle("rfx_assets", o);
|
|
870
|
-
const
|
|
871
|
-
c(this.initBundle(
|
|
870
|
+
const I = yield mt.Assets.loadBundle("rfx_assets");
|
|
871
|
+
c(this.initBundle(I.rfx_bundleSettings));
|
|
872
872
|
}));
|
|
873
873
|
}
|
|
874
874
|
/**
|
|
@@ -1175,15 +1175,15 @@ class _t {
|
|
|
1175
1175
|
i = /* @__PURE__ */ new Map();
|
|
1176
1176
|
const a = t;
|
|
1177
1177
|
a.values();
|
|
1178
|
-
for (const [o,
|
|
1179
|
-
|
|
1178
|
+
for (const [o, g] of a)
|
|
1179
|
+
g instanceof mt.Texture && (i[o] = g);
|
|
1180
1180
|
} else
|
|
1181
1181
|
i = t;
|
|
1182
1182
|
const s = {}, c = { sprites: [], movieClips: [] };
|
|
1183
1183
|
for (let a in i)
|
|
1184
1184
|
if (!(e && a.indexOf(e) == -1) && (this.initSprite(a, { texture: a, anchorX: 0.5, anchorY: 0.5 }), c.sprites.push(a), a.substr(0, 3) == "mc_")) {
|
|
1185
|
-
const
|
|
1186
|
-
s[
|
|
1185
|
+
const g = a.split("_")[1];
|
|
1186
|
+
s[g] == null && (s[g] = []), s[g].push(a);
|
|
1187
1187
|
}
|
|
1188
1188
|
for (let a in s) {
|
|
1189
1189
|
let o = s[a];
|
|
@@ -1444,16 +1444,16 @@ class ke extends ii {
|
|
|
1444
1444
|
return;
|
|
1445
1445
|
if (this._time += t, !this.exhausted && e >= this._effectStartTime) {
|
|
1446
1446
|
const c = this.__fx, a = this._nextEffectSettings;
|
|
1447
|
-
let o,
|
|
1447
|
+
let o, g, I;
|
|
1448
1448
|
switch (a.componentType) {
|
|
1449
1449
|
case vt.Sprite:
|
|
1450
|
-
o = c.__getSprite(a.componentId),
|
|
1450
|
+
o = c.__getSprite(a.componentId), I = c.__containers[a.containerId] || this.container, I.addChild(o), o.blendMode = c.__getBlendMode(a.blendMode), o.tint = a.tint, o.scale.set(Y.float(a.scaleMin, a.scaleMax) * Y.float(this.settings.scaleMin, this.settings.scaleMax) * this._scaleMod), o.alpha = Y.float(a.alphaMin, a.alphaMax), o.anchor.set(a.componentParams.anchorX, a.componentParams.anchorY), g = new Ot({ component: o, endTime: e + a.duration * 1e3 }), this._elements.add(g), o.x = this._x, o.y = this._y, o.rotation = this._rotation + Y.float(a.rotationMin, a.rotationMax), this.__on.effectSpawned.__hasCallback && this.__on.effectSpawned.dispatch(vt.Sprite, o);
|
|
1451
1451
|
break;
|
|
1452
1452
|
case vt.MovieClip:
|
|
1453
|
-
o = c.__getMovieClip(a.componentId), a.componentParams.loop ? (o.animationSpeed = Y.float(a.componentParams.animationSpeedMin || 1, a.componentParams.animationSpeedMax || 1), o.loop = a.componentParams.loop || !1) : a.duration, o.anchor.set(a.componentParams.anchorX, a.componentParams.anchorY), o.gotoAndPlay(0),
|
|
1453
|
+
o = c.__getMovieClip(a.componentId), a.componentParams.loop ? (o.animationSpeed = Y.float(a.componentParams.animationSpeedMin || 1, a.componentParams.animationSpeedMax || 1), o.loop = a.componentParams.loop || !1) : a.duration, o.anchor.set(a.componentParams.anchorX, a.componentParams.anchorY), o.gotoAndPlay(0), I = c.__containers[a.containerId] || this.container, I.addChild(o), o.blendMode = c.__getBlendMode(a.blendMode), o.tint = a.tint, o.scale.set(Y.float(a.scaleMin, a.scaleMax) * Y.float(this.settings.scaleMin, this.settings.scaleMax) * this._scaleMod), o.alpha = Y.float(a.alphaMin, a.alphaMax), g = new Ot({ component: o, endTime: e + a.duration * 1e3 }), this._elements.add(g), o.x = this._x, o.y = this._y, o.rotation = this._rotation + Y.float(a.rotationMin, a.rotationMax), this.__on.effectSpawned.__hasCallback && this.__on.effectSpawned.dispatch(vt.MovieClip, o);
|
|
1454
1454
|
break;
|
|
1455
1455
|
case vt.Emitter:
|
|
1456
|
-
o = c.getParticleEmitterById(a.componentId),
|
|
1456
|
+
o = c.getParticleEmitterById(a.componentId), I = c.__containers[a.containerId] || this.container, o.init(I, !0, Y.float(a.scaleMin, a.scaleMax) * Y.float(this.settings.scaleMin, this.settings.scaleMax) * this._scaleMod), g = new Ot({ component: o, endTime: o.endTime }), this._elements.add(g), o.x = this._x, o.y = this._y, o.rotation = this._rotation + o.settings.rotation, this.__on.effectSpawned.__hasCallback && this.__on.effectSpawned.dispatch(vt.Emitter, o);
|
|
1457
1457
|
break;
|
|
1458
1458
|
case vt.Trigger:
|
|
1459
1459
|
this.__on.triggerActivated.__hasCallback && this.__on.triggerActivated.dispatch(a.triggerValue);
|
|
@@ -1546,34 +1546,34 @@ function Yr(h) {
|
|
|
1546
1546
|
s.update(a);
|
|
1547
1547
|
}), Te(async (a) => {
|
|
1548
1548
|
c = a;
|
|
1549
|
-
let
|
|
1549
|
+
let g = { ...(await mt.Assets.load(["fx_settings", "fx_spritesheet"])).fx_settings };
|
|
1550
1550
|
if (e.emitters) {
|
|
1551
|
-
const
|
|
1551
|
+
const E = e.emitters.map((S, T) => ({
|
|
1552
1552
|
...S,
|
|
1553
|
-
id: 1e4 +
|
|
1553
|
+
id: 1e4 + T
|
|
1554
1554
|
}));
|
|
1555
|
-
|
|
1556
|
-
...
|
|
1557
|
-
...
|
|
1555
|
+
g.emitters = [
|
|
1556
|
+
...g.emitters,
|
|
1557
|
+
...E
|
|
1558
1558
|
];
|
|
1559
1559
|
}
|
|
1560
|
-
s.initBundle(
|
|
1560
|
+
s.initBundle(g, !0);
|
|
1561
1561
|
}), pi(t, () => {
|
|
1562
1562
|
s.getParticleEmitter(i()).init(c.componentInstance);
|
|
1563
1563
|
}), ft(Dt);
|
|
1564
1564
|
}
|
|
1565
1565
|
function Vr(h) {
|
|
1566
1566
|
const { radius: t } = Lt(h), e = mi(1), i = 1, s = 2, c = 1e-3, a = () => {
|
|
1567
|
-
const
|
|
1568
|
-
e.update(() =>
|
|
1567
|
+
const g = Date.now() * c, I = (Math.sin(g) + Math.sin(g * 1.3) + Math.sin(g * 0.7)) / 3, E = i + (s - i) * (I * 0.5 + 0.5);
|
|
1568
|
+
e.update(() => E), requestAnimationFrame(a);
|
|
1569
1569
|
};
|
|
1570
1570
|
return a(), ft(Kt, {
|
|
1571
|
-
draw: (
|
|
1572
|
-
const
|
|
1573
|
-
|
|
1574
|
-
const S =
|
|
1575
|
-
|
|
1576
|
-
|
|
1571
|
+
draw: (g) => {
|
|
1572
|
+
const I = t() * 2, E = new _i(I, I, 0, I, I, 0);
|
|
1573
|
+
E.addColorStop(0, "rgba(255, 255, 0, 1)"), E.addColorStop(0.5, "rgba(255, 255, 0, 0.3)"), E.addColorStop(0.8, "rgba(255, 255, 0, 0)");
|
|
1574
|
+
const S = I / 2;
|
|
1575
|
+
g.rect(-S, -S, I, I).fill(
|
|
1576
|
+
E.render({ translate: { x: S, y: S } })
|
|
1577
1577
|
);
|
|
1578
1578
|
},
|
|
1579
1579
|
...h,
|
|
@@ -1581,23 +1581,23 @@ function Vr(h) {
|
|
|
1581
1581
|
});
|
|
1582
1582
|
}
|
|
1583
1583
|
function Gr(h) {
|
|
1584
|
-
const { children: t } = h, e =
|
|
1584
|
+
const { children: t } = h, e = z(0), i = z(0);
|
|
1585
1585
|
let s;
|
|
1586
1586
|
const c = (a) => {
|
|
1587
|
-
a.rect(-80, -80, e() +
|
|
1588
|
-
const
|
|
1589
|
-
const
|
|
1590
|
-
a.circle(
|
|
1587
|
+
a.rect(-80, -80, e() + 160, i() + 160), a.fill(0);
|
|
1588
|
+
const g = (I) => {
|
|
1589
|
+
const E = oe(I.propObservables.x) ? I.propObservables.x() : I.props.x, S = oe(I.propObservables.y) ? I.propObservables.y() : I.props.y, T = oe(I.propObservables.radius) ? I.propObservables.radius() : I.props.radius;
|
|
1590
|
+
a.circle(E, S, T), a.cut();
|
|
1591
1591
|
};
|
|
1592
|
-
for (let
|
|
1593
|
-
if (gi(
|
|
1594
|
-
s && s.unsubscribe(), s =
|
|
1595
|
-
for (let S of
|
|
1596
|
-
|
|
1592
|
+
for (let I of t) {
|
|
1593
|
+
if (gi(I)) {
|
|
1594
|
+
s && s.unsubscribe(), s = I.subscribe((E) => {
|
|
1595
|
+
for (let S of E.fullElements)
|
|
1596
|
+
g(S);
|
|
1597
1597
|
});
|
|
1598
1598
|
return;
|
|
1599
1599
|
}
|
|
1600
|
-
|
|
1600
|
+
g(I);
|
|
1601
1601
|
}
|
|
1602
1602
|
};
|
|
1603
1603
|
return Te((a) => {
|
|
@@ -1635,33 +1635,33 @@ function qr(h = {}) {
|
|
|
1635
1635
|
segments: 8,
|
|
1636
1636
|
segmentWidth: 3,
|
|
1637
1637
|
inactiveAlpha: 0.15
|
|
1638
|
-
}),
|
|
1639
|
-
Ie(({ deltaTime:
|
|
1640
|
-
const
|
|
1641
|
-
|
|
1638
|
+
}), g = z(0);
|
|
1639
|
+
Ie(({ deltaTime: B }) => {
|
|
1640
|
+
const P = (typeof s == "function" ? s() : s) * B / 1e3;
|
|
1641
|
+
g.set(g() + P);
|
|
1642
1642
|
});
|
|
1643
|
-
const
|
|
1644
|
-
const D = typeof t == "function" ? t() : t,
|
|
1643
|
+
const I = (B) => {
|
|
1644
|
+
const D = typeof t == "function" ? t() : t, P = typeof e == "function" ? e() : e, _ = i ? typeof i == "function" ? i() : i : null, v = typeof c == "function" ? c() : c;
|
|
1645
1645
|
typeof a == "function" && a();
|
|
1646
|
-
const m = typeof o == "function" ? o() : o, d =
|
|
1647
|
-
_ &&
|
|
1648
|
-
const b = 360 / v,
|
|
1646
|
+
const m = typeof o == "function" ? o() : o, d = g();
|
|
1647
|
+
_ && B.circle(0, 0, D).fill(_);
|
|
1648
|
+
const b = 360 / v, N = D * 0.4, O = D;
|
|
1649
1649
|
for (let R = 0; R < v; R++) {
|
|
1650
|
-
const
|
|
1651
|
-
let it = Math.abs(L -
|
|
1650
|
+
const y = R * b, L = (d % 360 + 360) % 360;
|
|
1651
|
+
let it = Math.abs(L - y);
|
|
1652
1652
|
it > 180 && (it = 360 - it);
|
|
1653
1653
|
let K = it / 120;
|
|
1654
1654
|
K = Math.min(1, K), K = K * K * K;
|
|
1655
|
-
const lt = m + (1 - K) * (1 - m), at =
|
|
1656
|
-
|
|
1655
|
+
const lt = m + (1 - K) * (1 - m), at = y * (Math.PI / 180), ut = b * (Math.PI / 180), k = at - ut / 2, rt = at + ut / 2;
|
|
1656
|
+
B.arc(0, 0, N, k, rt).arc(0, 0, O, rt, k, !0).fill({ color: P, alpha: lt });
|
|
1657
1657
|
}
|
|
1658
|
-
}, S = (typeof t == "function" ? t() : t) * 2,
|
|
1658
|
+
}, S = (typeof t == "function" ? t() : t) * 2, T = typeof t == "function" ? z(S) : z(S), F = typeof t == "function" ? z(S) : z(S);
|
|
1659
1659
|
return typeof t == "function" && Ze(() => {
|
|
1660
|
-
const
|
|
1661
|
-
|
|
1660
|
+
const B = t();
|
|
1661
|
+
T.set(B * 2), F.set(B * 2);
|
|
1662
1662
|
}), ft(Dt, h, [
|
|
1663
1663
|
ft(Kt, {
|
|
1664
|
-
draw:
|
|
1664
|
+
draw: I
|
|
1665
1665
|
})
|
|
1666
1666
|
]);
|
|
1667
1667
|
}
|
|
@@ -1689,95 +1689,88 @@ function qi(h) {
|
|
|
1689
1689
|
}), e;
|
|
1690
1690
|
}
|
|
1691
1691
|
var ce = {};
|
|
1692
|
-
const Ki = {},
|
|
1692
|
+
const Ki = {}, ji = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1693
1693
|
__proto__: null,
|
|
1694
1694
|
default: Ki
|
|
1695
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1695
|
+
}, Symbol.toStringTag, { value: "Module" })), zi = /* @__PURE__ */ qi(ji);
|
|
1696
1696
|
var ue = {}, Ht = { exports: {} }, he = {}, Vt = {}, Le;
|
|
1697
1697
|
function Wi() {
|
|
1698
1698
|
if (Le) return Vt;
|
|
1699
|
-
Le = 1, Vt.byteLength = o, Vt.toByteArray =
|
|
1699
|
+
Le = 1, Vt.byteLength = o, Vt.toByteArray = I, Vt.fromByteArray = T;
|
|
1700
1700
|
for (var h = [], t = [], e = typeof Uint8Array < "u" ? Uint8Array : Array, i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", s = 0, c = i.length; s < c; ++s)
|
|
1701
1701
|
h[s] = i[s], t[i.charCodeAt(s)] = s;
|
|
1702
1702
|
t[45] = 62, t[95] = 63;
|
|
1703
|
-
function a(
|
|
1704
|
-
var
|
|
1705
|
-
if (
|
|
1703
|
+
function a(F) {
|
|
1704
|
+
var B = F.length;
|
|
1705
|
+
if (B % 4 > 0)
|
|
1706
1706
|
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
1707
|
-
var D =
|
|
1708
|
-
D === -1 && (D =
|
|
1709
|
-
var
|
|
1710
|
-
return [D,
|
|
1707
|
+
var D = F.indexOf("=");
|
|
1708
|
+
D === -1 && (D = B);
|
|
1709
|
+
var P = D === B ? 0 : 4 - D % 4;
|
|
1710
|
+
return [D, P];
|
|
1711
1711
|
}
|
|
1712
|
-
function o(
|
|
1713
|
-
var
|
|
1714
|
-
return (D +
|
|
1712
|
+
function o(F) {
|
|
1713
|
+
var B = a(F), D = B[0], P = B[1];
|
|
1714
|
+
return (D + P) * 3 / 4 - P;
|
|
1715
1715
|
}
|
|
1716
|
-
function
|
|
1717
|
-
return (
|
|
1716
|
+
function g(F, B, D) {
|
|
1717
|
+
return (B + D) * 3 / 4 - D;
|
|
1718
1718
|
}
|
|
1719
|
-
function
|
|
1720
|
-
var
|
|
1719
|
+
function I(F) {
|
|
1720
|
+
var B, D = a(F), P = D[0], _ = D[1], v = new e(g(F, P, _)), m = 0, d = _ > 0 ? P - 4 : P, b;
|
|
1721
1721
|
for (b = 0; b < d; b += 4)
|
|
1722
|
-
|
|
1723
|
-
return _ === 2 && (
|
|
1722
|
+
B = t[F.charCodeAt(b)] << 18 | t[F.charCodeAt(b + 1)] << 12 | t[F.charCodeAt(b + 2)] << 6 | t[F.charCodeAt(b + 3)], v[m++] = B >> 16 & 255, v[m++] = B >> 8 & 255, v[m++] = B & 255;
|
|
1723
|
+
return _ === 2 && (B = t[F.charCodeAt(b)] << 2 | t[F.charCodeAt(b + 1)] >> 4, v[m++] = B & 255), _ === 1 && (B = t[F.charCodeAt(b)] << 10 | t[F.charCodeAt(b + 1)] << 4 | t[F.charCodeAt(b + 2)] >> 2, v[m++] = B >> 8 & 255, v[m++] = B & 255), v;
|
|
1724
1724
|
}
|
|
1725
|
-
function
|
|
1726
|
-
return h[
|
|
1725
|
+
function E(F) {
|
|
1726
|
+
return h[F >> 18 & 63] + h[F >> 12 & 63] + h[F >> 6 & 63] + h[F & 63];
|
|
1727
1727
|
}
|
|
1728
|
-
function S(
|
|
1729
|
-
for (var
|
|
1730
|
-
|
|
1728
|
+
function S(F, B, D) {
|
|
1729
|
+
for (var P, _ = [], v = B; v < D; v += 3)
|
|
1730
|
+
P = (F[v] << 16 & 16711680) + (F[v + 1] << 8 & 65280) + (F[v + 2] & 255), _.push(E(P));
|
|
1731
1731
|
return _.join("");
|
|
1732
1732
|
}
|
|
1733
|
-
function
|
|
1734
|
-
for (var
|
|
1735
|
-
_.push(S(
|
|
1736
|
-
return
|
|
1737
|
-
h[
|
|
1738
|
-
)) :
|
|
1739
|
-
h[
|
|
1733
|
+
function T(F) {
|
|
1734
|
+
for (var B, D = F.length, P = D % 3, _ = [], v = 16383, m = 0, d = D - P; m < d; m += v)
|
|
1735
|
+
_.push(S(F, m, m + v > d ? d : m + v));
|
|
1736
|
+
return P === 1 ? (B = F[D - 1], _.push(
|
|
1737
|
+
h[B >> 2] + h[B << 4 & 63] + "=="
|
|
1738
|
+
)) : P === 2 && (B = (F[D - 2] << 8) + F[D - 1], _.push(
|
|
1739
|
+
h[B >> 10] + h[B >> 4 & 63] + h[B << 2 & 63] + "="
|
|
1740
1740
|
)), _.join("");
|
|
1741
1741
|
}
|
|
1742
1742
|
return Vt;
|
|
1743
1743
|
}
|
|
1744
1744
|
var Qt = {};
|
|
1745
|
-
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
1746
1745
|
var Xe;
|
|
1747
1746
|
function $i() {
|
|
1748
1747
|
return Xe || (Xe = 1, Qt.read = function(h, t, e, i, s) {
|
|
1749
|
-
var c, a, o = s * 8 - i - 1,
|
|
1750
|
-
for (S +=
|
|
1748
|
+
var c, a, o = s * 8 - i - 1, g = (1 << o) - 1, I = g >> 1, E = -7, S = e ? s - 1 : 0, T = e ? -1 : 1, F = h[t + S];
|
|
1749
|
+
for (S += T, c = F & (1 << -E) - 1, F >>= -E, E += o; E > 0; c = c * 256 + h[t + S], S += T, E -= 8)
|
|
1751
1750
|
;
|
|
1752
|
-
for (a = c & (1 << -
|
|
1751
|
+
for (a = c & (1 << -E) - 1, c >>= -E, E += i; E > 0; a = a * 256 + h[t + S], S += T, E -= 8)
|
|
1753
1752
|
;
|
|
1754
1753
|
if (c === 0)
|
|
1755
|
-
c = 1 -
|
|
1754
|
+
c = 1 - I;
|
|
1756
1755
|
else {
|
|
1757
|
-
if (c ===
|
|
1758
|
-
return a ? NaN : (
|
|
1759
|
-
a = a + Math.pow(2, i), c = c -
|
|
1756
|
+
if (c === g)
|
|
1757
|
+
return a ? NaN : (F ? -1 : 1) * (1 / 0);
|
|
1758
|
+
a = a + Math.pow(2, i), c = c - I;
|
|
1760
1759
|
}
|
|
1761
|
-
return (
|
|
1760
|
+
return (F ? -1 : 1) * a * Math.pow(2, c - i);
|
|
1762
1761
|
}, Qt.write = function(h, t, e, i, s, c) {
|
|
1763
|
-
var a, o,
|
|
1764
|
-
for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (o = isNaN(t) ? 1 : 0, a =
|
|
1762
|
+
var a, o, g, I = c * 8 - s - 1, E = (1 << I) - 1, S = E >> 1, T = s === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, F = i ? 0 : c - 1, B = i ? 1 : -1, D = t < 0 || t === 0 && 1 / t < 0 ? 1 : 0;
|
|
1763
|
+
for (t = Math.abs(t), isNaN(t) || t === 1 / 0 ? (o = isNaN(t) ? 1 : 0, a = E) : (a = Math.floor(Math.log(t) / Math.LN2), t * (g = Math.pow(2, -a)) < 1 && (a--, g *= 2), a + S >= 1 ? t += T / g : t += T * Math.pow(2, 1 - S), t * g >= 2 && (a++, g /= 2), a + S >= E ? (o = 0, a = E) : a + S >= 1 ? (o = (t * g - 1) * Math.pow(2, s), a = a + S) : (o = t * Math.pow(2, S - 1) * Math.pow(2, s), a = 0)); s >= 8; h[e + F] = o & 255, F += B, o /= 256, s -= 8)
|
|
1765
1764
|
;
|
|
1766
|
-
for (a = a << s | o,
|
|
1765
|
+
for (a = a << s | o, I += s; I > 0; h[e + F] = a & 255, F += B, a /= 256, I -= 8)
|
|
1767
1766
|
;
|
|
1768
|
-
h[e +
|
|
1767
|
+
h[e + F - B] |= D * 128;
|
|
1769
1768
|
}), Qt;
|
|
1770
1769
|
}
|
|
1771
|
-
/*!
|
|
1772
|
-
* The buffer module from node.js, for the browser.
|
|
1773
|
-
*
|
|
1774
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
1775
|
-
* @license MIT
|
|
1776
|
-
*/
|
|
1777
1770
|
var Ye;
|
|
1778
1771
|
function si() {
|
|
1779
|
-
return Ye || (Ye = 1, function(h) {
|
|
1780
|
-
const t = Wi(), e = $i(), i = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
|
|
1772
|
+
return Ye || (Ye = 1, (function(h) {
|
|
1773
|
+
const t = Wi(), e = $i(), i = typeof Symbol == "function" && typeof Symbol.for == "function" ? /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom") : null;
|
|
1781
1774
|
h.Buffer = o, h.SlowBuffer = v, h.INSPECT_MAX_BYTES = 50;
|
|
1782
1775
|
const s = 2147483647;
|
|
1783
1776
|
h.kMaxLength = s, o.TYPED_ARRAY_SUPPORT = c(), !o.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
|
|
@@ -1820,14 +1813,14 @@ function si() {
|
|
|
1820
1813
|
);
|
|
1821
1814
|
return S(u);
|
|
1822
1815
|
}
|
|
1823
|
-
return
|
|
1816
|
+
return g(u, r, n);
|
|
1824
1817
|
}
|
|
1825
1818
|
o.poolSize = 8192;
|
|
1826
|
-
function
|
|
1819
|
+
function g(u, r, n) {
|
|
1827
1820
|
if (typeof u == "string")
|
|
1828
|
-
return
|
|
1821
|
+
return T(u, r);
|
|
1829
1822
|
if (ArrayBuffer.isView(u))
|
|
1830
|
-
return
|
|
1823
|
+
return B(u);
|
|
1831
1824
|
if (u == null)
|
|
1832
1825
|
throw new TypeError(
|
|
1833
1826
|
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof u
|
|
@@ -1841,8 +1834,8 @@ function si() {
|
|
|
1841
1834
|
const p = u.valueOf && u.valueOf();
|
|
1842
1835
|
if (p != null && p !== u)
|
|
1843
1836
|
return o.from(p, r, n);
|
|
1844
|
-
const
|
|
1845
|
-
if (
|
|
1837
|
+
const x = P(u);
|
|
1838
|
+
if (x) return x;
|
|
1846
1839
|
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof u[Symbol.toPrimitive] == "function")
|
|
1847
1840
|
return o.from(u[Symbol.toPrimitive]("string"), r, n);
|
|
1848
1841
|
throw new TypeError(
|
|
@@ -1850,48 +1843,48 @@ function si() {
|
|
|
1850
1843
|
);
|
|
1851
1844
|
}
|
|
1852
1845
|
o.from = function(u, r, n) {
|
|
1853
|
-
return
|
|
1846
|
+
return g(u, r, n);
|
|
1854
1847
|
}, Object.setPrototypeOf(o.prototype, Uint8Array.prototype), Object.setPrototypeOf(o, Uint8Array);
|
|
1855
|
-
function
|
|
1848
|
+
function I(u) {
|
|
1856
1849
|
if (typeof u != "number")
|
|
1857
1850
|
throw new TypeError('"size" argument must be of type number');
|
|
1858
1851
|
if (u < 0)
|
|
1859
1852
|
throw new RangeError('The value "' + u + '" is invalid for option "size"');
|
|
1860
1853
|
}
|
|
1861
|
-
function
|
|
1862
|
-
return
|
|
1854
|
+
function E(u, r, n) {
|
|
1855
|
+
return I(u), u <= 0 ? a(u) : r !== void 0 ? typeof n == "string" ? a(u).fill(r, n) : a(u).fill(r) : a(u);
|
|
1863
1856
|
}
|
|
1864
1857
|
o.alloc = function(u, r, n) {
|
|
1865
|
-
return
|
|
1858
|
+
return E(u, r, n);
|
|
1866
1859
|
};
|
|
1867
1860
|
function S(u) {
|
|
1868
|
-
return
|
|
1861
|
+
return I(u), a(u < 0 ? 0 : _(u) | 0);
|
|
1869
1862
|
}
|
|
1870
1863
|
o.allocUnsafe = function(u) {
|
|
1871
1864
|
return S(u);
|
|
1872
1865
|
}, o.allocUnsafeSlow = function(u) {
|
|
1873
1866
|
return S(u);
|
|
1874
1867
|
};
|
|
1875
|
-
function
|
|
1868
|
+
function T(u, r) {
|
|
1876
1869
|
if ((typeof r != "string" || r === "") && (r = "utf8"), !o.isEncoding(r))
|
|
1877
1870
|
throw new TypeError("Unknown encoding: " + r);
|
|
1878
1871
|
const n = m(u, r) | 0;
|
|
1879
1872
|
let p = a(n);
|
|
1880
|
-
const
|
|
1881
|
-
return
|
|
1873
|
+
const x = p.write(u, r);
|
|
1874
|
+
return x !== n && (p = p.slice(0, x)), p;
|
|
1882
1875
|
}
|
|
1883
|
-
function
|
|
1876
|
+
function F(u) {
|
|
1884
1877
|
const r = u.length < 0 ? 0 : _(u.length) | 0, n = a(r);
|
|
1885
1878
|
for (let p = 0; p < r; p += 1)
|
|
1886
1879
|
n[p] = u[p] & 255;
|
|
1887
1880
|
return n;
|
|
1888
1881
|
}
|
|
1889
|
-
function
|
|
1882
|
+
function B(u) {
|
|
1890
1883
|
if (pt(u, Uint8Array)) {
|
|
1891
1884
|
const r = new Uint8Array(u);
|
|
1892
1885
|
return D(r.buffer, r.byteOffset, r.byteLength);
|
|
1893
1886
|
}
|
|
1894
|
-
return
|
|
1887
|
+
return F(u);
|
|
1895
1888
|
}
|
|
1896
1889
|
function D(u, r, n) {
|
|
1897
1890
|
if (r < 0 || u.byteLength < r)
|
|
@@ -1901,15 +1894,15 @@ function si() {
|
|
|
1901
1894
|
let p;
|
|
1902
1895
|
return r === void 0 && n === void 0 ? p = new Uint8Array(u) : n === void 0 ? p = new Uint8Array(u, r) : p = new Uint8Array(u, r, n), Object.setPrototypeOf(p, o.prototype), p;
|
|
1903
1896
|
}
|
|
1904
|
-
function
|
|
1897
|
+
function P(u) {
|
|
1905
1898
|
if (o.isBuffer(u)) {
|
|
1906
1899
|
const r = _(u.length) | 0, n = a(r);
|
|
1907
1900
|
return n.length === 0 || u.copy(n, 0, 0, r), n;
|
|
1908
1901
|
}
|
|
1909
1902
|
if (u.length !== void 0)
|
|
1910
|
-
return typeof u.length != "number" || ae(u.length) ? a(0) :
|
|
1903
|
+
return typeof u.length != "number" || ae(u.length) ? a(0) : F(u);
|
|
1911
1904
|
if (u.type === "Buffer" && Array.isArray(u.data))
|
|
1912
|
-
return
|
|
1905
|
+
return F(u.data);
|
|
1913
1906
|
}
|
|
1914
1907
|
function _(u) {
|
|
1915
1908
|
if (u >= s)
|
|
@@ -1927,13 +1920,13 @@ function si() {
|
|
|
1927
1920
|
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
|
|
1928
1921
|
);
|
|
1929
1922
|
if (r === n) return 0;
|
|
1930
|
-
let p = r.length,
|
|
1931
|
-
for (let A = 0, C = Math.min(p,
|
|
1923
|
+
let p = r.length, x = n.length;
|
|
1924
|
+
for (let A = 0, C = Math.min(p, x); A < C; ++A)
|
|
1932
1925
|
if (r[A] !== n[A]) {
|
|
1933
|
-
p = r[A],
|
|
1926
|
+
p = r[A], x = n[A];
|
|
1934
1927
|
break;
|
|
1935
1928
|
}
|
|
1936
|
-
return p <
|
|
1929
|
+
return p < x ? -1 : x < p ? 1 : 0;
|
|
1937
1930
|
}, o.isEncoding = function(r) {
|
|
1938
1931
|
switch (String(r).toLowerCase()) {
|
|
1939
1932
|
case "hex":
|
|
@@ -1960,23 +1953,23 @@ function si() {
|
|
|
1960
1953
|
if (n === void 0)
|
|
1961
1954
|
for (n = 0, p = 0; p < r.length; ++p)
|
|
1962
1955
|
n += r[p].length;
|
|
1963
|
-
const
|
|
1956
|
+
const x = o.allocUnsafe(n);
|
|
1964
1957
|
let A = 0;
|
|
1965
1958
|
for (p = 0; p < r.length; ++p) {
|
|
1966
1959
|
let C = r[p];
|
|
1967
1960
|
if (pt(C, Uint8Array))
|
|
1968
|
-
A + C.length >
|
|
1969
|
-
|
|
1961
|
+
A + C.length > x.length ? (o.isBuffer(C) || (C = o.from(C)), C.copy(x, A)) : Uint8Array.prototype.set.call(
|
|
1962
|
+
x,
|
|
1970
1963
|
C,
|
|
1971
1964
|
A
|
|
1972
1965
|
);
|
|
1973
1966
|
else if (o.isBuffer(C))
|
|
1974
|
-
C.copy(
|
|
1967
|
+
C.copy(x, A);
|
|
1975
1968
|
else
|
|
1976
1969
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
1977
1970
|
A += C.length;
|
|
1978
1971
|
}
|
|
1979
|
-
return
|
|
1972
|
+
return x;
|
|
1980
1973
|
};
|
|
1981
1974
|
function m(u, r) {
|
|
1982
1975
|
if (o.isBuffer(u))
|
|
@@ -1989,7 +1982,7 @@ function si() {
|
|
|
1989
1982
|
);
|
|
1990
1983
|
const n = u.length, p = arguments.length > 2 && arguments[2] === !0;
|
|
1991
1984
|
if (!p && n === 0) return 0;
|
|
1992
|
-
let
|
|
1985
|
+
let x = !1;
|
|
1993
1986
|
for (; ; )
|
|
1994
1987
|
switch (r) {
|
|
1995
1988
|
case "ascii":
|
|
@@ -2009,9 +2002,9 @@ function si() {
|
|
|
2009
2002
|
case "base64":
|
|
2010
2003
|
return Yt(u).length;
|
|
2011
2004
|
default:
|
|
2012
|
-
if (
|
|
2005
|
+
if (x)
|
|
2013
2006
|
return p ? -1 : et(u).length;
|
|
2014
|
-
r = ("" + r).toLowerCase(),
|
|
2007
|
+
r = ("" + r).toLowerCase(), x = !0;
|
|
2015
2008
|
}
|
|
2016
2009
|
}
|
|
2017
2010
|
o.byteLength = m;
|
|
@@ -2027,7 +2020,7 @@ function si() {
|
|
|
2027
2020
|
case "utf-8":
|
|
2028
2021
|
return lt(this, r, n);
|
|
2029
2022
|
case "ascii":
|
|
2030
|
-
return
|
|
2023
|
+
return k(this, r, n);
|
|
2031
2024
|
case "latin1":
|
|
2032
2025
|
case "binary":
|
|
2033
2026
|
return rt(this, r, n);
|
|
@@ -2079,22 +2072,22 @@ function si() {
|
|
|
2079
2072
|
let r = "";
|
|
2080
2073
|
const n = h.INSPECT_MAX_BYTES;
|
|
2081
2074
|
return r = this.toString("hex", 0, n).replace(/(.{2})/g, "$1 ").trim(), this.length > n && (r += " ... "), "<Buffer " + r + ">";
|
|
2082
|
-
}, i && (o.prototype[i] = o.prototype.inspect), o.prototype.compare = function(r, n, p,
|
|
2075
|
+
}, i && (o.prototype[i] = o.prototype.inspect), o.prototype.compare = function(r, n, p, x, A) {
|
|
2083
2076
|
if (pt(r, Uint8Array) && (r = o.from(r, r.offset, r.byteLength)), !o.isBuffer(r))
|
|
2084
2077
|
throw new TypeError(
|
|
2085
2078
|
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof r
|
|
2086
2079
|
);
|
|
2087
|
-
if (n === void 0 && (n = 0), p === void 0 && (p = r ? r.length : 0),
|
|
2080
|
+
if (n === void 0 && (n = 0), p === void 0 && (p = r ? r.length : 0), x === void 0 && (x = 0), A === void 0 && (A = this.length), n < 0 || p > r.length || x < 0 || A > this.length)
|
|
2088
2081
|
throw new RangeError("out of range index");
|
|
2089
|
-
if (
|
|
2082
|
+
if (x >= A && n >= p)
|
|
2090
2083
|
return 0;
|
|
2091
|
-
if (
|
|
2084
|
+
if (x >= A)
|
|
2092
2085
|
return -1;
|
|
2093
2086
|
if (n >= p)
|
|
2094
2087
|
return 1;
|
|
2095
|
-
if (n >>>= 0, p >>>= 0,
|
|
2096
|
-
let C = A -
|
|
2097
|
-
const J = Math.min(C, X), H = this.slice(
|
|
2088
|
+
if (n >>>= 0, p >>>= 0, x >>>= 0, A >>>= 0, this === r) return 0;
|
|
2089
|
+
let C = A - x, X = p - n;
|
|
2090
|
+
const J = Math.min(C, X), H = this.slice(x, A), Z = r.slice(n, p);
|
|
2098
2091
|
for (let q = 0; q < J; ++q)
|
|
2099
2092
|
if (H[q] !== Z[q]) {
|
|
2100
2093
|
C = H[q], X = Z[q];
|
|
@@ -2102,21 +2095,21 @@ function si() {
|
|
|
2102
2095
|
}
|
|
2103
2096
|
return C < X ? -1 : X < C ? 1 : 0;
|
|
2104
2097
|
};
|
|
2105
|
-
function
|
|
2098
|
+
function N(u, r, n, p, x) {
|
|
2106
2099
|
if (u.length === 0) return -1;
|
|
2107
|
-
if (typeof n == "string" ? (p = n, n = 0) : n > 2147483647 ? n = 2147483647 : n < -2147483648 && (n = -2147483648), n = +n, ae(n) && (n =
|
|
2108
|
-
if (
|
|
2100
|
+
if (typeof n == "string" ? (p = n, n = 0) : n > 2147483647 ? n = 2147483647 : n < -2147483648 && (n = -2147483648), n = +n, ae(n) && (n = x ? 0 : u.length - 1), n < 0 && (n = u.length + n), n >= u.length) {
|
|
2101
|
+
if (x) return -1;
|
|
2109
2102
|
n = u.length - 1;
|
|
2110
2103
|
} else if (n < 0)
|
|
2111
|
-
if (
|
|
2104
|
+
if (x) n = 0;
|
|
2112
2105
|
else return -1;
|
|
2113
2106
|
if (typeof r == "string" && (r = o.from(r, p)), o.isBuffer(r))
|
|
2114
|
-
return r.length === 0 ? -1 : O(u, r, n, p,
|
|
2107
|
+
return r.length === 0 ? -1 : O(u, r, n, p, x);
|
|
2115
2108
|
if (typeof r == "number")
|
|
2116
|
-
return r = r & 255, typeof Uint8Array.prototype.indexOf == "function" ?
|
|
2109
|
+
return r = r & 255, typeof Uint8Array.prototype.indexOf == "function" ? x ? Uint8Array.prototype.indexOf.call(u, r, n) : Uint8Array.prototype.lastIndexOf.call(u, r, n) : O(u, [r], n, p, x);
|
|
2117
2110
|
throw new TypeError("val must be string, number or Buffer");
|
|
2118
2111
|
}
|
|
2119
|
-
function O(u, r, n, p,
|
|
2112
|
+
function O(u, r, n, p, x) {
|
|
2120
2113
|
let A = 1, C = u.length, X = r.length;
|
|
2121
2114
|
if (p !== void 0 && (p = String(p).toLowerCase(), p === "ucs2" || p === "ucs-2" || p === "utf16le" || p === "utf-16le")) {
|
|
2122
2115
|
if (u.length < 2 || r.length < 2)
|
|
@@ -2127,7 +2120,7 @@ function si() {
|
|
|
2127
2120
|
return A === 1 ? Z[q] : Z.readUInt16BE(q * A);
|
|
2128
2121
|
}
|
|
2129
2122
|
let H;
|
|
2130
|
-
if (
|
|
2123
|
+
if (x) {
|
|
2131
2124
|
let Z = -1;
|
|
2132
2125
|
for (H = n; H < C; H++)
|
|
2133
2126
|
if (J(u, H) === J(r, Z === -1 ? 0 : H - Z)) {
|
|
@@ -2149,14 +2142,14 @@ function si() {
|
|
|
2149
2142
|
o.prototype.includes = function(r, n, p) {
|
|
2150
2143
|
return this.indexOf(r, n, p) !== -1;
|
|
2151
2144
|
}, o.prototype.indexOf = function(r, n, p) {
|
|
2152
|
-
return
|
|
2145
|
+
return N(this, r, n, p, !0);
|
|
2153
2146
|
}, o.prototype.lastIndexOf = function(r, n, p) {
|
|
2154
|
-
return
|
|
2147
|
+
return N(this, r, n, p, !1);
|
|
2155
2148
|
};
|
|
2156
2149
|
function R(u, r, n, p) {
|
|
2157
2150
|
n = Number(n) || 0;
|
|
2158
|
-
const
|
|
2159
|
-
p ? (p = Number(p), p >
|
|
2151
|
+
const x = u.length - n;
|
|
2152
|
+
p ? (p = Number(p), p > x && (p = x)) : p = x;
|
|
2160
2153
|
const A = r.length;
|
|
2161
2154
|
p > A / 2 && (p = A / 2);
|
|
2162
2155
|
let C;
|
|
@@ -2167,7 +2160,7 @@ function si() {
|
|
|
2167
2160
|
}
|
|
2168
2161
|
return C;
|
|
2169
2162
|
}
|
|
2170
|
-
function
|
|
2163
|
+
function y(u, r, n, p) {
|
|
2171
2164
|
return St(et(r, u.length - n), u, n, p);
|
|
2172
2165
|
}
|
|
2173
2166
|
function L(u, r, n, p) {
|
|
@@ -2179,13 +2172,13 @@ function si() {
|
|
|
2179
2172
|
function V(u, r, n, p) {
|
|
2180
2173
|
return St(ne(r, u.length - n), u, n, p);
|
|
2181
2174
|
}
|
|
2182
|
-
o.prototype.write = function(r, n, p,
|
|
2175
|
+
o.prototype.write = function(r, n, p, x) {
|
|
2183
2176
|
if (n === void 0)
|
|
2184
|
-
|
|
2177
|
+
x = "utf8", p = this.length, n = 0;
|
|
2185
2178
|
else if (p === void 0 && typeof n == "string")
|
|
2186
|
-
|
|
2179
|
+
x = n, p = this.length, n = 0;
|
|
2187
2180
|
else if (isFinite(n))
|
|
2188
|
-
n = n >>> 0, isFinite(p) ? (p = p >>> 0,
|
|
2181
|
+
n = n >>> 0, isFinite(p) ? (p = p >>> 0, x === void 0 && (x = "utf8")) : (x = p, p = void 0);
|
|
2189
2182
|
else
|
|
2190
2183
|
throw new Error(
|
|
2191
2184
|
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
|
|
@@ -2193,15 +2186,15 @@ function si() {
|
|
|
2193
2186
|
const A = this.length - n;
|
|
2194
2187
|
if ((p === void 0 || p > A) && (p = A), r.length > 0 && (p < 0 || n < 0) || n > this.length)
|
|
2195
2188
|
throw new RangeError("Attempt to write outside buffer bounds");
|
|
2196
|
-
|
|
2189
|
+
x || (x = "utf8");
|
|
2197
2190
|
let C = !1;
|
|
2198
2191
|
for (; ; )
|
|
2199
|
-
switch (
|
|
2192
|
+
switch (x) {
|
|
2200
2193
|
case "hex":
|
|
2201
2194
|
return R(this, r, n, p);
|
|
2202
2195
|
case "utf8":
|
|
2203
2196
|
case "utf-8":
|
|
2204
|
-
return
|
|
2197
|
+
return y(this, r, n, p);
|
|
2205
2198
|
case "ascii":
|
|
2206
2199
|
case "latin1":
|
|
2207
2200
|
case "binary":
|
|
@@ -2214,8 +2207,8 @@ function si() {
|
|
|
2214
2207
|
case "utf-16le":
|
|
2215
2208
|
return V(this, r, n, p);
|
|
2216
2209
|
default:
|
|
2217
|
-
if (C) throw new TypeError("Unknown encoding: " +
|
|
2218
|
-
|
|
2210
|
+
if (C) throw new TypeError("Unknown encoding: " + x);
|
|
2211
|
+
x = ("" + x).toLowerCase(), C = !0;
|
|
2219
2212
|
}
|
|
2220
2213
|
}, o.prototype.toJSON = function() {
|
|
2221
2214
|
return {
|
|
@@ -2229,27 +2222,27 @@ function si() {
|
|
|
2229
2222
|
function lt(u, r, n) {
|
|
2230
2223
|
n = Math.min(u.length, n);
|
|
2231
2224
|
const p = [];
|
|
2232
|
-
let
|
|
2233
|
-
for (;
|
|
2234
|
-
const A = u[
|
|
2225
|
+
let x = r;
|
|
2226
|
+
for (; x < n; ) {
|
|
2227
|
+
const A = u[x];
|
|
2235
2228
|
let C = null, X = A > 239 ? 4 : A > 223 ? 3 : A > 191 ? 2 : 1;
|
|
2236
|
-
if (
|
|
2229
|
+
if (x + X <= n) {
|
|
2237
2230
|
let J, H, Z, q;
|
|
2238
2231
|
switch (X) {
|
|
2239
2232
|
case 1:
|
|
2240
2233
|
A < 128 && (C = A);
|
|
2241
2234
|
break;
|
|
2242
2235
|
case 2:
|
|
2243
|
-
J = u[
|
|
2236
|
+
J = u[x + 1], (J & 192) === 128 && (q = (A & 31) << 6 | J & 63, q > 127 && (C = q));
|
|
2244
2237
|
break;
|
|
2245
2238
|
case 3:
|
|
2246
|
-
J = u[
|
|
2239
|
+
J = u[x + 1], H = u[x + 2], (J & 192) === 128 && (H & 192) === 128 && (q = (A & 15) << 12 | (J & 63) << 6 | H & 63, q > 2047 && (q < 55296 || q > 57343) && (C = q));
|
|
2247
2240
|
break;
|
|
2248
2241
|
case 4:
|
|
2249
|
-
J = u[
|
|
2242
|
+
J = u[x + 1], H = u[x + 2], Z = u[x + 3], (J & 192) === 128 && (H & 192) === 128 && (Z & 192) === 128 && (q = (A & 15) << 18 | (J & 63) << 12 | (H & 63) << 6 | Z & 63, q > 65535 && q < 1114112 && (C = q));
|
|
2250
2243
|
}
|
|
2251
2244
|
}
|
|
2252
|
-
C === null ? (C = 65533, X = 1) : C > 65535 && (C -= 65536, p.push(C >>> 10 & 1023 | 55296), C = 56320 | C & 1023), p.push(C),
|
|
2245
|
+
C === null ? (C = 65533, X = 1) : C > 65535 && (C -= 65536, p.push(C >>> 10 & 1023 | 55296), C = 56320 | C & 1023), p.push(C), x += X;
|
|
2253
2246
|
}
|
|
2254
2247
|
return ut(p);
|
|
2255
2248
|
}
|
|
@@ -2266,134 +2259,134 @@ function si() {
|
|
|
2266
2259
|
);
|
|
2267
2260
|
return n;
|
|
2268
2261
|
}
|
|
2269
|
-
function
|
|
2262
|
+
function k(u, r, n) {
|
|
2270
2263
|
let p = "";
|
|
2271
2264
|
n = Math.min(u.length, n);
|
|
2272
|
-
for (let
|
|
2273
|
-
p += String.fromCharCode(u[
|
|
2265
|
+
for (let x = r; x < n; ++x)
|
|
2266
|
+
p += String.fromCharCode(u[x] & 127);
|
|
2274
2267
|
return p;
|
|
2275
2268
|
}
|
|
2276
2269
|
function rt(u, r, n) {
|
|
2277
2270
|
let p = "";
|
|
2278
2271
|
n = Math.min(u.length, n);
|
|
2279
|
-
for (let
|
|
2280
|
-
p += String.fromCharCode(u[
|
|
2272
|
+
for (let x = r; x < n; ++x)
|
|
2273
|
+
p += String.fromCharCode(u[x]);
|
|
2281
2274
|
return p;
|
|
2282
2275
|
}
|
|
2283
2276
|
function W(u, r, n) {
|
|
2284
2277
|
const p = u.length;
|
|
2285
2278
|
(!r || r < 0) && (r = 0), (!n || n < 0 || n > p) && (n = p);
|
|
2286
|
-
let
|
|
2279
|
+
let x = "";
|
|
2287
2280
|
for (let A = r; A < n; ++A)
|
|
2288
|
-
|
|
2289
|
-
return
|
|
2281
|
+
x += fi[u[A]];
|
|
2282
|
+
return x;
|
|
2290
2283
|
}
|
|
2291
2284
|
function tt(u, r, n) {
|
|
2292
2285
|
const p = u.slice(r, n);
|
|
2293
|
-
let
|
|
2286
|
+
let x = "";
|
|
2294
2287
|
for (let A = 0; A < p.length - 1; A += 2)
|
|
2295
|
-
|
|
2296
|
-
return
|
|
2288
|
+
x += String.fromCharCode(p[A] + p[A + 1] * 256);
|
|
2289
|
+
return x;
|
|
2297
2290
|
}
|
|
2298
2291
|
o.prototype.slice = function(r, n) {
|
|
2299
2292
|
const p = this.length;
|
|
2300
2293
|
r = ~~r, n = n === void 0 ? p : ~~n, r < 0 ? (r += p, r < 0 && (r = 0)) : r > p && (r = p), n < 0 ? (n += p, n < 0 && (n = 0)) : n > p && (n = p), n < r && (n = r);
|
|
2301
|
-
const
|
|
2302
|
-
return Object.setPrototypeOf(
|
|
2294
|
+
const x = this.subarray(r, n);
|
|
2295
|
+
return Object.setPrototypeOf(x, o.prototype), x;
|
|
2303
2296
|
};
|
|
2304
|
-
function
|
|
2297
|
+
function U(u, r, n) {
|
|
2305
2298
|
if (u % 1 !== 0 || u < 0) throw new RangeError("offset is not uint");
|
|
2306
2299
|
if (u + r > n) throw new RangeError("Trying to access beyond buffer length");
|
|
2307
2300
|
}
|
|
2308
2301
|
o.prototype.readUintLE = o.prototype.readUIntLE = function(r, n, p) {
|
|
2309
|
-
r = r >>> 0, n = n >>> 0, p ||
|
|
2310
|
-
let
|
|
2302
|
+
r = r >>> 0, n = n >>> 0, p || U(r, n, this.length);
|
|
2303
|
+
let x = this[r], A = 1, C = 0;
|
|
2311
2304
|
for (; ++C < n && (A *= 256); )
|
|
2312
|
-
|
|
2313
|
-
return
|
|
2305
|
+
x += this[r + C] * A;
|
|
2306
|
+
return x;
|
|
2314
2307
|
}, o.prototype.readUintBE = o.prototype.readUIntBE = function(r, n, p) {
|
|
2315
|
-
r = r >>> 0, n = n >>> 0, p ||
|
|
2316
|
-
let
|
|
2308
|
+
r = r >>> 0, n = n >>> 0, p || U(r, n, this.length);
|
|
2309
|
+
let x = this[r + --n], A = 1;
|
|
2317
2310
|
for (; n > 0 && (A *= 256); )
|
|
2318
|
-
|
|
2319
|
-
return
|
|
2311
|
+
x += this[r + --n] * A;
|
|
2312
|
+
return x;
|
|
2320
2313
|
}, o.prototype.readUint8 = o.prototype.readUInt8 = function(r, n) {
|
|
2321
|
-
return r = r >>> 0, n ||
|
|
2314
|
+
return r = r >>> 0, n || U(r, 1, this.length), this[r];
|
|
2322
2315
|
}, o.prototype.readUint16LE = o.prototype.readUInt16LE = function(r, n) {
|
|
2323
|
-
return r = r >>> 0, n ||
|
|
2316
|
+
return r = r >>> 0, n || U(r, 2, this.length), this[r] | this[r + 1] << 8;
|
|
2324
2317
|
}, o.prototype.readUint16BE = o.prototype.readUInt16BE = function(r, n) {
|
|
2325
|
-
return r = r >>> 0, n ||
|
|
2318
|
+
return r = r >>> 0, n || U(r, 2, this.length), this[r] << 8 | this[r + 1];
|
|
2326
2319
|
}, o.prototype.readUint32LE = o.prototype.readUInt32LE = function(r, n) {
|
|
2327
|
-
return r = r >>> 0, n ||
|
|
2320
|
+
return r = r >>> 0, n || U(r, 4, this.length), (this[r] | this[r + 1] << 8 | this[r + 2] << 16) + this[r + 3] * 16777216;
|
|
2328
2321
|
}, o.prototype.readUint32BE = o.prototype.readUInt32BE = function(r, n) {
|
|
2329
|
-
return r = r >>> 0, n ||
|
|
2322
|
+
return r = r >>> 0, n || U(r, 4, this.length), this[r] * 16777216 + (this[r + 1] << 16 | this[r + 2] << 8 | this[r + 3]);
|
|
2330
2323
|
}, o.prototype.readBigUInt64LE = Ct(function(r) {
|
|
2331
|
-
r = r >>> 0,
|
|
2324
|
+
r = r >>> 0, j(r, "offset");
|
|
2332
2325
|
const n = this[r], p = this[r + 7];
|
|
2333
2326
|
(n === void 0 || p === void 0) && st(r, this.length - 8);
|
|
2334
|
-
const
|
|
2335
|
-
return BigInt(
|
|
2327
|
+
const x = n + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + this[++r] * 2 ** 24, A = this[++r] + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + p * 2 ** 24;
|
|
2328
|
+
return BigInt(x) + (BigInt(A) << BigInt(32));
|
|
2336
2329
|
}), o.prototype.readBigUInt64BE = Ct(function(r) {
|
|
2337
|
-
r = r >>> 0,
|
|
2330
|
+
r = r >>> 0, j(r, "offset");
|
|
2338
2331
|
const n = this[r], p = this[r + 7];
|
|
2339
2332
|
(n === void 0 || p === void 0) && st(r, this.length - 8);
|
|
2340
|
-
const
|
|
2341
|
-
return (BigInt(
|
|
2333
|
+
const x = n * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + this[++r], A = this[++r] * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + p;
|
|
2334
|
+
return (BigInt(x) << BigInt(32)) + BigInt(A);
|
|
2342
2335
|
}), o.prototype.readIntLE = function(r, n, p) {
|
|
2343
|
-
r = r >>> 0, n = n >>> 0, p ||
|
|
2344
|
-
let
|
|
2336
|
+
r = r >>> 0, n = n >>> 0, p || U(r, n, this.length);
|
|
2337
|
+
let x = this[r], A = 1, C = 0;
|
|
2345
2338
|
for (; ++C < n && (A *= 256); )
|
|
2346
|
-
|
|
2347
|
-
return A *= 128,
|
|
2339
|
+
x += this[r + C] * A;
|
|
2340
|
+
return A *= 128, x >= A && (x -= Math.pow(2, 8 * n)), x;
|
|
2348
2341
|
}, o.prototype.readIntBE = function(r, n, p) {
|
|
2349
|
-
r = r >>> 0, n = n >>> 0, p ||
|
|
2350
|
-
let
|
|
2351
|
-
for (;
|
|
2352
|
-
C += this[r + --
|
|
2342
|
+
r = r >>> 0, n = n >>> 0, p || U(r, n, this.length);
|
|
2343
|
+
let x = n, A = 1, C = this[r + --x];
|
|
2344
|
+
for (; x > 0 && (A *= 256); )
|
|
2345
|
+
C += this[r + --x] * A;
|
|
2353
2346
|
return A *= 128, C >= A && (C -= Math.pow(2, 8 * n)), C;
|
|
2354
2347
|
}, o.prototype.readInt8 = function(r, n) {
|
|
2355
|
-
return r = r >>> 0, n ||
|
|
2348
|
+
return r = r >>> 0, n || U(r, 1, this.length), this[r] & 128 ? (255 - this[r] + 1) * -1 : this[r];
|
|
2356
2349
|
}, o.prototype.readInt16LE = function(r, n) {
|
|
2357
|
-
r = r >>> 0, n ||
|
|
2350
|
+
r = r >>> 0, n || U(r, 2, this.length);
|
|
2358
2351
|
const p = this[r] | this[r + 1] << 8;
|
|
2359
2352
|
return p & 32768 ? p | 4294901760 : p;
|
|
2360
2353
|
}, o.prototype.readInt16BE = function(r, n) {
|
|
2361
|
-
r = r >>> 0, n ||
|
|
2354
|
+
r = r >>> 0, n || U(r, 2, this.length);
|
|
2362
2355
|
const p = this[r + 1] | this[r] << 8;
|
|
2363
2356
|
return p & 32768 ? p | 4294901760 : p;
|
|
2364
2357
|
}, o.prototype.readInt32LE = function(r, n) {
|
|
2365
|
-
return r = r >>> 0, n ||
|
|
2358
|
+
return r = r >>> 0, n || U(r, 4, this.length), this[r] | this[r + 1] << 8 | this[r + 2] << 16 | this[r + 3] << 24;
|
|
2366
2359
|
}, o.prototype.readInt32BE = function(r, n) {
|
|
2367
|
-
return r = r >>> 0, n ||
|
|
2360
|
+
return r = r >>> 0, n || U(r, 4, this.length), this[r] << 24 | this[r + 1] << 16 | this[r + 2] << 8 | this[r + 3];
|
|
2368
2361
|
}, o.prototype.readBigInt64LE = Ct(function(r) {
|
|
2369
|
-
r = r >>> 0,
|
|
2362
|
+
r = r >>> 0, j(r, "offset");
|
|
2370
2363
|
const n = this[r], p = this[r + 7];
|
|
2371
2364
|
(n === void 0 || p === void 0) && st(r, this.length - 8);
|
|
2372
|
-
const
|
|
2373
|
-
return (BigInt(
|
|
2365
|
+
const x = this[r + 4] + this[r + 5] * 2 ** 8 + this[r + 6] * 2 ** 16 + (p << 24);
|
|
2366
|
+
return (BigInt(x) << BigInt(32)) + BigInt(n + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + this[++r] * 2 ** 24);
|
|
2374
2367
|
}), o.prototype.readBigInt64BE = Ct(function(r) {
|
|
2375
|
-
r = r >>> 0,
|
|
2368
|
+
r = r >>> 0, j(r, "offset");
|
|
2376
2369
|
const n = this[r], p = this[r + 7];
|
|
2377
2370
|
(n === void 0 || p === void 0) && st(r, this.length - 8);
|
|
2378
|
-
const
|
|
2371
|
+
const x = (n << 24) + // Overflow
|
|
2379
2372
|
this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + this[++r];
|
|
2380
|
-
return (BigInt(
|
|
2373
|
+
return (BigInt(x) << BigInt(32)) + BigInt(this[++r] * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + p);
|
|
2381
2374
|
}), o.prototype.readFloatLE = function(r, n) {
|
|
2382
|
-
return r = r >>> 0, n ||
|
|
2375
|
+
return r = r >>> 0, n || U(r, 4, this.length), e.read(this, r, !0, 23, 4);
|
|
2383
2376
|
}, o.prototype.readFloatBE = function(r, n) {
|
|
2384
|
-
return r = r >>> 0, n ||
|
|
2377
|
+
return r = r >>> 0, n || U(r, 4, this.length), e.read(this, r, !1, 23, 4);
|
|
2385
2378
|
}, o.prototype.readDoubleLE = function(r, n) {
|
|
2386
|
-
return r = r >>> 0, n ||
|
|
2379
|
+
return r = r >>> 0, n || U(r, 8, this.length), e.read(this, r, !0, 52, 8);
|
|
2387
2380
|
}, o.prototype.readDoubleBE = function(r, n) {
|
|
2388
|
-
return r = r >>> 0, n ||
|
|
2381
|
+
return r = r >>> 0, n || U(r, 8, this.length), e.read(this, r, !1, 52, 8);
|
|
2389
2382
|
};
|
|
2390
|
-
function $(u, r, n, p,
|
|
2383
|
+
function $(u, r, n, p, x, A) {
|
|
2391
2384
|
if (!o.isBuffer(u)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
2392
|
-
if (r >
|
|
2385
|
+
if (r > x || r < A) throw new RangeError('"value" argument is out of bounds');
|
|
2393
2386
|
if (n + p > u.length) throw new RangeError("Index out of range");
|
|
2394
2387
|
}
|
|
2395
|
-
o.prototype.writeUintLE = o.prototype.writeUIntLE = function(r, n, p,
|
|
2396
|
-
if (r = +r, n = n >>> 0, p = p >>> 0, !
|
|
2388
|
+
o.prototype.writeUintLE = o.prototype.writeUIntLE = function(r, n, p, x) {
|
|
2389
|
+
if (r = +r, n = n >>> 0, p = p >>> 0, !x) {
|
|
2397
2390
|
const X = Math.pow(2, 8 * p) - 1;
|
|
2398
2391
|
$(this, r, n, p, X, 0);
|
|
2399
2392
|
}
|
|
@@ -2401,8 +2394,8 @@ function si() {
|
|
|
2401
2394
|
for (this[n] = r & 255; ++C < p && (A *= 256); )
|
|
2402
2395
|
this[n + C] = r / A & 255;
|
|
2403
2396
|
return n + p;
|
|
2404
|
-
}, o.prototype.writeUintBE = o.prototype.writeUIntBE = function(r, n, p,
|
|
2405
|
-
if (r = +r, n = n >>> 0, p = p >>> 0, !
|
|
2397
|
+
}, o.prototype.writeUintBE = o.prototype.writeUIntBE = function(r, n, p, x) {
|
|
2398
|
+
if (r = +r, n = n >>> 0, p = p >>> 0, !x) {
|
|
2406
2399
|
const X = Math.pow(2, 8 * p) - 1;
|
|
2407
2400
|
$(this, r, n, p, X, 0);
|
|
2408
2401
|
}
|
|
@@ -2421,15 +2414,15 @@ function si() {
|
|
|
2421
2414
|
}, o.prototype.writeUint32BE = o.prototype.writeUInt32BE = function(r, n, p) {
|
|
2422
2415
|
return r = +r, n = n >>> 0, p || $(this, r, n, 4, 4294967295, 0), this[n] = r >>> 24, this[n + 1] = r >>> 16, this[n + 2] = r >>> 8, this[n + 3] = r & 255, n + 4;
|
|
2423
2416
|
};
|
|
2424
|
-
function At(u, r, n, p,
|
|
2425
|
-
Q(r, p,
|
|
2417
|
+
function At(u, r, n, p, x) {
|
|
2418
|
+
Q(r, p, x, u, n, 7);
|
|
2426
2419
|
let A = Number(r & BigInt(4294967295));
|
|
2427
2420
|
u[n++] = A, A = A >> 8, u[n++] = A, A = A >> 8, u[n++] = A, A = A >> 8, u[n++] = A;
|
|
2428
2421
|
let C = Number(r >> BigInt(32) & BigInt(4294967295));
|
|
2429
2422
|
return u[n++] = C, C = C >> 8, u[n++] = C, C = C >> 8, u[n++] = C, C = C >> 8, u[n++] = C, n;
|
|
2430
2423
|
}
|
|
2431
|
-
function Et(u, r, n, p,
|
|
2432
|
-
Q(r, p,
|
|
2424
|
+
function Et(u, r, n, p, x) {
|
|
2425
|
+
Q(r, p, x, u, n, 7);
|
|
2433
2426
|
let A = Number(r & BigInt(4294967295));
|
|
2434
2427
|
u[n + 7] = A, A = A >> 8, u[n + 6] = A, A = A >> 8, u[n + 5] = A, A = A >> 8, u[n + 4] = A;
|
|
2435
2428
|
let C = Number(r >> BigInt(32) & BigInt(4294967295));
|
|
@@ -2439,8 +2432,8 @@ function si() {
|
|
|
2439
2432
|
return At(this, r, n, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
2440
2433
|
}), o.prototype.writeBigUInt64BE = Ct(function(r, n = 0) {
|
|
2441
2434
|
return Et(this, r, n, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
2442
|
-
}), o.prototype.writeIntLE = function(r, n, p,
|
|
2443
|
-
if (r = +r, n = n >>> 0, !
|
|
2435
|
+
}), o.prototype.writeIntLE = function(r, n, p, x) {
|
|
2436
|
+
if (r = +r, n = n >>> 0, !x) {
|
|
2444
2437
|
const J = Math.pow(2, 8 * p - 1);
|
|
2445
2438
|
$(this, r, n, p, J - 1, -J);
|
|
2446
2439
|
}
|
|
@@ -2448,8 +2441,8 @@ function si() {
|
|
|
2448
2441
|
for (this[n] = r & 255; ++A < p && (C *= 256); )
|
|
2449
2442
|
r < 0 && X === 0 && this[n + A - 1] !== 0 && (X = 1), this[n + A] = (r / C >> 0) - X & 255;
|
|
2450
2443
|
return n + p;
|
|
2451
|
-
}, o.prototype.writeIntBE = function(r, n, p,
|
|
2452
|
-
if (r = +r, n = n >>> 0, !
|
|
2444
|
+
}, o.prototype.writeIntBE = function(r, n, p, x) {
|
|
2445
|
+
if (r = +r, n = n >>> 0, !x) {
|
|
2453
2446
|
const J = Math.pow(2, 8 * p - 1);
|
|
2454
2447
|
$(this, r, n, p, J - 1, -J);
|
|
2455
2448
|
}
|
|
@@ -2472,48 +2465,48 @@ function si() {
|
|
|
2472
2465
|
}), o.prototype.writeBigInt64BE = Ct(function(r, n = 0) {
|
|
2473
2466
|
return Et(this, r, n, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
2474
2467
|
});
|
|
2475
|
-
function Xt(u, r, n, p,
|
|
2468
|
+
function Xt(u, r, n, p, x, A) {
|
|
2476
2469
|
if (n + p > u.length) throw new RangeError("Index out of range");
|
|
2477
2470
|
if (n < 0) throw new RangeError("Index out of range");
|
|
2478
2471
|
}
|
|
2479
|
-
function $t(u, r, n, p,
|
|
2480
|
-
return r = +r, n = n >>> 0,
|
|
2472
|
+
function $t(u, r, n, p, x) {
|
|
2473
|
+
return r = +r, n = n >>> 0, x || Xt(u, r, n, 4), e.write(u, r, n, p, 23, 4), n + 4;
|
|
2481
2474
|
}
|
|
2482
2475
|
o.prototype.writeFloatLE = function(r, n, p) {
|
|
2483
2476
|
return $t(this, r, n, !0, p);
|
|
2484
2477
|
}, o.prototype.writeFloatBE = function(r, n, p) {
|
|
2485
2478
|
return $t(this, r, n, !1, p);
|
|
2486
2479
|
};
|
|
2487
|
-
function f(u, r, n, p,
|
|
2488
|
-
return r = +r, n = n >>> 0,
|
|
2480
|
+
function f(u, r, n, p, x) {
|
|
2481
|
+
return r = +r, n = n >>> 0, x || Xt(u, r, n, 8), e.write(u, r, n, p, 52, 8), n + 8;
|
|
2489
2482
|
}
|
|
2490
2483
|
o.prototype.writeDoubleLE = function(r, n, p) {
|
|
2491
2484
|
return f(this, r, n, !0, p);
|
|
2492
2485
|
}, o.prototype.writeDoubleBE = function(r, n, p) {
|
|
2493
2486
|
return f(this, r, n, !1, p);
|
|
2494
|
-
}, o.prototype.copy = function(r, n, p,
|
|
2487
|
+
}, o.prototype.copy = function(r, n, p, x) {
|
|
2495
2488
|
if (!o.isBuffer(r)) throw new TypeError("argument should be a Buffer");
|
|
2496
|
-
if (p || (p = 0), !
|
|
2489
|
+
if (p || (p = 0), !x && x !== 0 && (x = this.length), n >= r.length && (n = r.length), n || (n = 0), x > 0 && x < p && (x = p), x === p || r.length === 0 || this.length === 0) return 0;
|
|
2497
2490
|
if (n < 0)
|
|
2498
2491
|
throw new RangeError("targetStart out of bounds");
|
|
2499
2492
|
if (p < 0 || p >= this.length) throw new RangeError("Index out of range");
|
|
2500
|
-
if (
|
|
2501
|
-
|
|
2502
|
-
const A =
|
|
2503
|
-
return this === r && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(n, p,
|
|
2493
|
+
if (x < 0) throw new RangeError("sourceEnd out of bounds");
|
|
2494
|
+
x > this.length && (x = this.length), r.length - n < x - p && (x = r.length - n + p);
|
|
2495
|
+
const A = x - p;
|
|
2496
|
+
return this === r && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(n, p, x) : Uint8Array.prototype.set.call(
|
|
2504
2497
|
r,
|
|
2505
|
-
this.subarray(p,
|
|
2498
|
+
this.subarray(p, x),
|
|
2506
2499
|
n
|
|
2507
2500
|
), A;
|
|
2508
|
-
}, o.prototype.fill = function(r, n, p,
|
|
2501
|
+
}, o.prototype.fill = function(r, n, p, x) {
|
|
2509
2502
|
if (typeof r == "string") {
|
|
2510
|
-
if (typeof n == "string" ? (
|
|
2503
|
+
if (typeof n == "string" ? (x = n, n = 0, p = this.length) : typeof p == "string" && (x = p, p = this.length), x !== void 0 && typeof x != "string")
|
|
2511
2504
|
throw new TypeError("encoding must be a string");
|
|
2512
|
-
if (typeof
|
|
2513
|
-
throw new TypeError("Unknown encoding: " +
|
|
2505
|
+
if (typeof x == "string" && !o.isEncoding(x))
|
|
2506
|
+
throw new TypeError("Unknown encoding: " + x);
|
|
2514
2507
|
if (r.length === 1) {
|
|
2515
2508
|
const C = r.charCodeAt(0);
|
|
2516
|
-
(
|
|
2509
|
+
(x === "utf8" && C < 128 || x === "latin1") && (r = C);
|
|
2517
2510
|
}
|
|
2518
2511
|
} else typeof r == "number" ? r = r & 255 : typeof r == "boolean" && (r = Number(r));
|
|
2519
2512
|
if (n < 0 || this.length < n || this.length < p)
|
|
@@ -2526,7 +2519,7 @@ function si() {
|
|
|
2526
2519
|
for (A = n; A < p; ++A)
|
|
2527
2520
|
this[A] = r;
|
|
2528
2521
|
else {
|
|
2529
|
-
const C = o.isBuffer(r) ? r : o.from(r,
|
|
2522
|
+
const C = o.isBuffer(r) ? r : o.from(r, x), X = C.length;
|
|
2530
2523
|
if (X === 0)
|
|
2531
2524
|
throw new TypeError('The value "' + r + '" is invalid for argument "value"');
|
|
2532
2525
|
for (A = 0; A < p - n; ++A)
|
|
@@ -2547,11 +2540,11 @@ function si() {
|
|
|
2547
2540
|
get code() {
|
|
2548
2541
|
return u;
|
|
2549
2542
|
}
|
|
2550
|
-
set code(
|
|
2543
|
+
set code(x) {
|
|
2551
2544
|
Object.defineProperty(this, "code", {
|
|
2552
2545
|
configurable: !0,
|
|
2553
2546
|
enumerable: !0,
|
|
2554
|
-
value:
|
|
2547
|
+
value: x,
|
|
2555
2548
|
writable: !0
|
|
2556
2549
|
});
|
|
2557
2550
|
}
|
|
@@ -2575,8 +2568,8 @@ function si() {
|
|
|
2575
2568
|
), M(
|
|
2576
2569
|
"ERR_OUT_OF_RANGE",
|
|
2577
2570
|
function(u, r, n) {
|
|
2578
|
-
let p = `The value of "${u}" is out of range.`,
|
|
2579
|
-
return Number.isInteger(n) && Math.abs(n) > 2 ** 32 ?
|
|
2571
|
+
let p = `The value of "${u}" is out of range.`, x = n;
|
|
2572
|
+
return Number.isInteger(n) && Math.abs(n) > 2 ** 32 ? x = w(String(n)) : typeof n == "bigint" && (x = String(n), (n > BigInt(2) ** BigInt(32) || n < -(BigInt(2) ** BigInt(32))) && (x = w(x)), x += "n"), p += ` It must be ${r}. Received ${x}`, p;
|
|
2580
2573
|
},
|
|
2581
2574
|
RangeError
|
|
2582
2575
|
);
|
|
@@ -2588,22 +2581,22 @@ function si() {
|
|
|
2588
2581
|
return `${u.slice(0, n)}${r}`;
|
|
2589
2582
|
}
|
|
2590
2583
|
function G(u, r, n) {
|
|
2591
|
-
|
|
2584
|
+
j(r, "offset"), (u[r] === void 0 || u[r + n] === void 0) && st(r, u.length - (n + 1));
|
|
2592
2585
|
}
|
|
2593
|
-
function Q(u, r, n, p,
|
|
2586
|
+
function Q(u, r, n, p, x, A) {
|
|
2594
2587
|
if (u > n || u < r) {
|
|
2595
2588
|
const C = typeof r == "bigint" ? "n" : "";
|
|
2596
2589
|
let X;
|
|
2597
2590
|
throw r === 0 || r === BigInt(0) ? X = `>= 0${C} and < 2${C} ** ${(A + 1) * 8}${C}` : X = `>= -(2${C} ** ${(A + 1) * 8 - 1}${C}) and < 2 ** ${(A + 1) * 8 - 1}${C}`, new l.ERR_OUT_OF_RANGE("value", X, u);
|
|
2598
2591
|
}
|
|
2599
|
-
G(p,
|
|
2592
|
+
G(p, x, A);
|
|
2600
2593
|
}
|
|
2601
|
-
function
|
|
2594
|
+
function j(u, r) {
|
|
2602
2595
|
if (typeof u != "number")
|
|
2603
2596
|
throw new l.ERR_INVALID_ARG_TYPE(r, "number", u);
|
|
2604
2597
|
}
|
|
2605
2598
|
function st(u, r, n) {
|
|
2606
|
-
throw Math.floor(u) !== u ? (
|
|
2599
|
+
throw Math.floor(u) !== u ? (j(u, n), new l.ERR_OUT_OF_RANGE("offset", "an integer", u)) : r < 0 ? new l.ERR_BUFFER_OUT_OF_BOUNDS() : new l.ERR_OUT_OF_RANGE(
|
|
2607
2600
|
"offset",
|
|
2608
2601
|
`>= 0 and <= ${r}`,
|
|
2609
2602
|
u
|
|
@@ -2620,11 +2613,11 @@ function si() {
|
|
|
2620
2613
|
r = r || 1 / 0;
|
|
2621
2614
|
let n;
|
|
2622
2615
|
const p = u.length;
|
|
2623
|
-
let
|
|
2616
|
+
let x = null;
|
|
2624
2617
|
const A = [];
|
|
2625
2618
|
for (let C = 0; C < p; ++C) {
|
|
2626
2619
|
if (n = u.charCodeAt(C), n > 55295 && n < 57344) {
|
|
2627
|
-
if (!
|
|
2620
|
+
if (!x) {
|
|
2628
2621
|
if (n > 56319) {
|
|
2629
2622
|
(r -= 3) > -1 && A.push(239, 191, 189);
|
|
2630
2623
|
continue;
|
|
@@ -2632,16 +2625,16 @@ function si() {
|
|
|
2632
2625
|
(r -= 3) > -1 && A.push(239, 191, 189);
|
|
2633
2626
|
continue;
|
|
2634
2627
|
}
|
|
2635
|
-
|
|
2628
|
+
x = n;
|
|
2636
2629
|
continue;
|
|
2637
2630
|
}
|
|
2638
2631
|
if (n < 56320) {
|
|
2639
|
-
(r -= 3) > -1 && A.push(239, 191, 189),
|
|
2632
|
+
(r -= 3) > -1 && A.push(239, 191, 189), x = n;
|
|
2640
2633
|
continue;
|
|
2641
2634
|
}
|
|
2642
|
-
n = (
|
|
2643
|
-
} else
|
|
2644
|
-
if (
|
|
2635
|
+
n = (x - 55296 << 10 | n - 56320) + 65536;
|
|
2636
|
+
} else x && (r -= 3) > -1 && A.push(239, 191, 189);
|
|
2637
|
+
if (x = null, n < 128) {
|
|
2645
2638
|
if ((r -= 1) < 0) break;
|
|
2646
2639
|
A.push(n);
|
|
2647
2640
|
} else if (n < 2048) {
|
|
@@ -2677,20 +2670,20 @@ function si() {
|
|
|
2677
2670
|
return r;
|
|
2678
2671
|
}
|
|
2679
2672
|
function ne(u, r) {
|
|
2680
|
-
let n, p,
|
|
2673
|
+
let n, p, x;
|
|
2681
2674
|
const A = [];
|
|
2682
2675
|
for (let C = 0; C < u.length && !((r -= 2) < 0); ++C)
|
|
2683
|
-
n = u.charCodeAt(C), p = n >> 8,
|
|
2676
|
+
n = u.charCodeAt(C), p = n >> 8, x = n % 256, A.push(x), A.push(p);
|
|
2684
2677
|
return A;
|
|
2685
2678
|
}
|
|
2686
2679
|
function Yt(u) {
|
|
2687
2680
|
return t.toByteArray(Tt(u));
|
|
2688
2681
|
}
|
|
2689
2682
|
function St(u, r, n, p) {
|
|
2690
|
-
let
|
|
2691
|
-
for (
|
|
2692
|
-
r[
|
|
2693
|
-
return
|
|
2683
|
+
let x;
|
|
2684
|
+
for (x = 0; x < p && !(x + n >= r.length || x >= u.length); ++x)
|
|
2685
|
+
r[x + n] = u[x];
|
|
2686
|
+
return x;
|
|
2694
2687
|
}
|
|
2695
2688
|
function pt(u, r) {
|
|
2696
2689
|
return u instanceof r || u != null && u.constructor != null && u.constructor.name != null && u.constructor.name === r.name;
|
|
@@ -2698,45 +2691,44 @@ function si() {
|
|
|
2698
2691
|
function ae(u) {
|
|
2699
2692
|
return u !== u;
|
|
2700
2693
|
}
|
|
2701
|
-
const fi = function() {
|
|
2694
|
+
const fi = (function() {
|
|
2702
2695
|
const u = "0123456789abcdef", r = new Array(256);
|
|
2703
2696
|
for (let n = 0; n < 16; ++n) {
|
|
2704
2697
|
const p = n * 16;
|
|
2705
|
-
for (let
|
|
2706
|
-
r[p +
|
|
2698
|
+
for (let x = 0; x < 16; ++x)
|
|
2699
|
+
r[p + x] = u[n] + u[x];
|
|
2707
2700
|
}
|
|
2708
2701
|
return r;
|
|
2709
|
-
}();
|
|
2702
|
+
})();
|
|
2710
2703
|
function Ct(u) {
|
|
2711
2704
|
return typeof BigInt > "u" ? di : u;
|
|
2712
2705
|
}
|
|
2713
2706
|
function di() {
|
|
2714
2707
|
throw new Error("BigInt not supported");
|
|
2715
2708
|
}
|
|
2716
|
-
}(he)), he;
|
|
2709
|
+
})(he)), he;
|
|
2717
2710
|
}
|
|
2718
|
-
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
2719
2711
|
var Ve;
|
|
2720
2712
|
function Hi() {
|
|
2721
|
-
return Ve || (Ve = 1, function(h, t) {
|
|
2713
|
+
return Ve || (Ve = 1, (function(h, t) {
|
|
2722
2714
|
var e = si(), i = e.Buffer;
|
|
2723
2715
|
function s(a, o) {
|
|
2724
|
-
for (var
|
|
2725
|
-
o[
|
|
2716
|
+
for (var g in a)
|
|
2717
|
+
o[g] = a[g];
|
|
2726
2718
|
}
|
|
2727
2719
|
i.from && i.alloc && i.allocUnsafe && i.allocUnsafeSlow ? h.exports = e : (s(e, t), t.Buffer = c);
|
|
2728
|
-
function c(a, o,
|
|
2729
|
-
return i(a, o,
|
|
2720
|
+
function c(a, o, g) {
|
|
2721
|
+
return i(a, o, g);
|
|
2730
2722
|
}
|
|
2731
|
-
c.prototype = Object.create(i.prototype), s(i, c), c.from = function(a, o,
|
|
2723
|
+
c.prototype = Object.create(i.prototype), s(i, c), c.from = function(a, o, g) {
|
|
2732
2724
|
if (typeof a == "number")
|
|
2733
2725
|
throw new TypeError("Argument must not be a number");
|
|
2734
|
-
return i(a, o,
|
|
2735
|
-
}, c.alloc = function(a, o,
|
|
2726
|
+
return i(a, o, g);
|
|
2727
|
+
}, c.alloc = function(a, o, g) {
|
|
2736
2728
|
if (typeof a != "number")
|
|
2737
2729
|
throw new TypeError("Argument must be a number");
|
|
2738
|
-
var
|
|
2739
|
-
return o !== void 0 ? typeof
|
|
2730
|
+
var I = i(a);
|
|
2731
|
+
return o !== void 0 ? typeof g == "string" ? I.fill(o, g) : I.fill(o) : I.fill(0), I;
|
|
2740
2732
|
}, c.allocUnsafe = function(a) {
|
|
2741
2733
|
if (typeof a != "number")
|
|
2742
2734
|
throw new TypeError("Argument must be a number");
|
|
@@ -2746,7 +2738,7 @@ function Hi() {
|
|
|
2746
2738
|
throw new TypeError("Argument must be a number");
|
|
2747
2739
|
return e.SlowBuffer(a);
|
|
2748
2740
|
};
|
|
2749
|
-
}(Ht, Ht.exports)), Ht.exports;
|
|
2741
|
+
})(Ht, Ht.exports)), Ht.exports;
|
|
2750
2742
|
}
|
|
2751
2743
|
var Ge;
|
|
2752
2744
|
function Qi() {
|
|
@@ -2805,16 +2797,16 @@ function Qi() {
|
|
|
2805
2797
|
var v;
|
|
2806
2798
|
switch (this.encoding) {
|
|
2807
2799
|
case "utf16le":
|
|
2808
|
-
this.text = S, this.end =
|
|
2800
|
+
this.text = S, this.end = T, v = 4;
|
|
2809
2801
|
break;
|
|
2810
2802
|
case "utf8":
|
|
2811
|
-
this.fillLast =
|
|
2803
|
+
this.fillLast = g, v = 4;
|
|
2812
2804
|
break;
|
|
2813
2805
|
case "base64":
|
|
2814
|
-
this.text =
|
|
2806
|
+
this.text = F, this.end = B, v = 3;
|
|
2815
2807
|
break;
|
|
2816
2808
|
default:
|
|
2817
|
-
this.write = D, this.end =
|
|
2809
|
+
this.write = D, this.end = P;
|
|
2818
2810
|
return;
|
|
2819
2811
|
}
|
|
2820
2812
|
this.lastNeed = 0, this.lastTotal = 0, this.lastChar = h.allocUnsafe(v);
|
|
@@ -2828,7 +2820,7 @@ function Qi() {
|
|
|
2828
2820
|
} else
|
|
2829
2821
|
m = 0;
|
|
2830
2822
|
return m < _.length ? v ? v + this.text(_, m) : this.text(_, m) : v || "";
|
|
2831
|
-
}, s.prototype.end =
|
|
2823
|
+
}, s.prototype.end = E, s.prototype.text = I, s.prototype.fillLast = function(_) {
|
|
2832
2824
|
if (this.lastNeed <= _.length)
|
|
2833
2825
|
return _.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
2834
2826
|
_.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, _.length), this.lastNeed -= _.length;
|
|
@@ -2852,21 +2844,21 @@ function Qi() {
|
|
|
2852
2844
|
return _.lastNeed = 2, "�";
|
|
2853
2845
|
}
|
|
2854
2846
|
}
|
|
2855
|
-
function
|
|
2847
|
+
function g(_) {
|
|
2856
2848
|
var v = this.lastTotal - this.lastNeed, m = o(this, _);
|
|
2857
2849
|
if (m !== void 0) return m;
|
|
2858
2850
|
if (this.lastNeed <= _.length)
|
|
2859
2851
|
return _.copy(this.lastChar, v, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
2860
2852
|
_.copy(this.lastChar, v, 0, _.length), this.lastNeed -= _.length;
|
|
2861
2853
|
}
|
|
2862
|
-
function
|
|
2854
|
+
function I(_, v) {
|
|
2863
2855
|
var m = a(this, _, v);
|
|
2864
2856
|
if (!this.lastNeed) return _.toString("utf8", v);
|
|
2865
2857
|
this.lastTotal = m;
|
|
2866
2858
|
var d = _.length - (m - this.lastNeed);
|
|
2867
2859
|
return _.copy(this.lastChar, 0, d), _.toString("utf8", v, d);
|
|
2868
2860
|
}
|
|
2869
|
-
function
|
|
2861
|
+
function E(_) {
|
|
2870
2862
|
var v = _ && _.length ? this.write(_) : "";
|
|
2871
2863
|
return this.lastNeed ? v + "�" : v;
|
|
2872
2864
|
}
|
|
@@ -2882,7 +2874,7 @@ function Qi() {
|
|
|
2882
2874
|
}
|
|
2883
2875
|
return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = _[_.length - 1], _.toString("utf16le", v, _.length - 1);
|
|
2884
2876
|
}
|
|
2885
|
-
function
|
|
2877
|
+
function T(_) {
|
|
2886
2878
|
var v = _ && _.length ? this.write(_) : "";
|
|
2887
2879
|
if (this.lastNeed) {
|
|
2888
2880
|
var m = this.lastTotal - this.lastNeed;
|
|
@@ -2890,29 +2882,29 @@ function Qi() {
|
|
|
2890
2882
|
}
|
|
2891
2883
|
return v;
|
|
2892
2884
|
}
|
|
2893
|
-
function
|
|
2885
|
+
function F(_, v) {
|
|
2894
2886
|
var m = (_.length - v) % 3;
|
|
2895
2887
|
return m === 0 ? _.toString("base64", v) : (this.lastNeed = 3 - m, this.lastTotal = 3, m === 1 ? this.lastChar[0] = _[_.length - 1] : (this.lastChar[0] = _[_.length - 2], this.lastChar[1] = _[_.length - 1]), _.toString("base64", v, _.length - m));
|
|
2896
2888
|
}
|
|
2897
|
-
function
|
|
2889
|
+
function B(_) {
|
|
2898
2890
|
var v = _ && _.length ? this.write(_) : "";
|
|
2899
2891
|
return this.lastNeed ? v + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : v;
|
|
2900
2892
|
}
|
|
2901
2893
|
function D(_) {
|
|
2902
2894
|
return _.toString(this.encoding);
|
|
2903
2895
|
}
|
|
2904
|
-
function
|
|
2896
|
+
function P(_) {
|
|
2905
2897
|
return _ && _.length ? this.write(_) : "";
|
|
2906
2898
|
}
|
|
2907
2899
|
return ue;
|
|
2908
2900
|
}
|
|
2909
2901
|
var qe;
|
|
2910
2902
|
function Ji() {
|
|
2911
|
-
return qe || (qe = 1, function(h) {
|
|
2903
|
+
return qe || (qe = 1, (function(h) {
|
|
2912
2904
|
(function(t) {
|
|
2913
2905
|
t.parser = function(f, l) {
|
|
2914
2906
|
return new i(f, l);
|
|
2915
|
-
}, t.SAXParser = i, t.SAXStream =
|
|
2907
|
+
}, t.SAXParser = i, t.SAXStream = E, t.createStream = I, t.MAX_BUFFER_LENGTH = 64 * 1024;
|
|
2916
2908
|
var e = [
|
|
2917
2909
|
"comment",
|
|
2918
2910
|
"sgmlDecl",
|
|
@@ -2951,7 +2943,7 @@ function Ji() {
|
|
|
2951
2943
|
if (!(this instanceof i))
|
|
2952
2944
|
return new i(f, l);
|
|
2953
2945
|
var M = this;
|
|
2954
|
-
c(M), M.q = M.c = "", M.bufferCheckPosition = t.MAX_BUFFER_LENGTH, M.opt = l || {}, M.opt.lowercase = M.opt.lowercase || M.opt.lowercasetags, M.looseCase = M.opt.lowercase ? "toLowerCase" : "toUpperCase", M.tags = [], M.closed = M.closedRoot = M.sawRoot = !1, M.tag = M.error = null, M.strict = !!f, M.noscript = !!(f || M.opt.noscript), M.state =
|
|
2946
|
+
c(M), M.q = M.c = "", M.bufferCheckPosition = t.MAX_BUFFER_LENGTH, M.opt = l || {}, M.opt.lowercase = M.opt.lowercase || M.opt.lowercasetags, M.looseCase = M.opt.lowercase ? "toLowerCase" : "toUpperCase", M.tags = [], M.closed = M.closedRoot = M.sawRoot = !1, M.tag = M.error = null, M.strict = !!f, M.noscript = !!(f || M.opt.noscript), M.state = y.BEGIN, M.strictEntities = M.opt.strictEntities, M.ENTITIES = M.strictEntities ? Object.create(t.XML_ENTITIES) : Object.create(t.ENTITIES), M.attribList = [], M.opt.xmlns && (M.ns = Object.create(D)), M.opt.unquotedAttributeValues === void 0 && (M.opt.unquotedAttributeValues = !f), M.trackPosition = M.opt.position !== !1, M.trackPosition && (M.position = M.line = M.column = 0), it(M, "onready");
|
|
2955
2947
|
}
|
|
2956
2948
|
Object.create || (Object.create = function(f) {
|
|
2957
2949
|
function l() {
|
|
@@ -2983,8 +2975,8 @@ function Ji() {
|
|
|
2983
2975
|
}
|
|
2984
2976
|
M = Math.max(M, Q);
|
|
2985
2977
|
}
|
|
2986
|
-
var
|
|
2987
|
-
f.bufferCheckPosition =
|
|
2978
|
+
var j = t.MAX_BUFFER_LENGTH - M;
|
|
2979
|
+
f.bufferCheckPosition = j + f.position;
|
|
2988
2980
|
}
|
|
2989
2981
|
function c(f) {
|
|
2990
2982
|
for (var l = 0, M = e.length; l < M; l++)
|
|
@@ -3010,29 +3002,29 @@ function Ji() {
|
|
|
3010
3002
|
};
|
|
3011
3003
|
var o;
|
|
3012
3004
|
try {
|
|
3013
|
-
o =
|
|
3005
|
+
o = zi.Stream;
|
|
3014
3006
|
} catch {
|
|
3015
3007
|
o = function() {
|
|
3016
3008
|
};
|
|
3017
3009
|
}
|
|
3018
3010
|
o || (o = function() {
|
|
3019
3011
|
});
|
|
3020
|
-
var
|
|
3012
|
+
var g = t.EVENTS.filter(function(f) {
|
|
3021
3013
|
return f !== "error" && f !== "end";
|
|
3022
3014
|
});
|
|
3023
|
-
function
|
|
3024
|
-
return new
|
|
3015
|
+
function I(f, l) {
|
|
3016
|
+
return new E(f, l);
|
|
3025
3017
|
}
|
|
3026
|
-
function
|
|
3027
|
-
if (!(this instanceof
|
|
3028
|
-
return new
|
|
3018
|
+
function E(f, l) {
|
|
3019
|
+
if (!(this instanceof E))
|
|
3020
|
+
return new E(f, l);
|
|
3029
3021
|
o.apply(this), this._parser = new i(f, l), this.writable = !0, this.readable = !0;
|
|
3030
3022
|
var M = this;
|
|
3031
3023
|
this._parser.onend = function() {
|
|
3032
3024
|
M.emit("end");
|
|
3033
3025
|
}, this._parser.onerror = function(w) {
|
|
3034
3026
|
M.emit("error", w), M._parser.error = null;
|
|
3035
|
-
}, this._decoder = null,
|
|
3027
|
+
}, this._decoder = null, g.forEach(function(w) {
|
|
3036
3028
|
Object.defineProperty(M, "on" + w, {
|
|
3037
3029
|
get: function() {
|
|
3038
3030
|
return M._parser["on" + w];
|
|
@@ -3047,11 +3039,11 @@ function Ji() {
|
|
|
3047
3039
|
});
|
|
3048
3040
|
});
|
|
3049
3041
|
}
|
|
3050
|
-
|
|
3042
|
+
E.prototype = Object.create(o.prototype, {
|
|
3051
3043
|
constructor: {
|
|
3052
|
-
value:
|
|
3044
|
+
value: E
|
|
3053
3045
|
}
|
|
3054
|
-
}),
|
|
3046
|
+
}), E.prototype.write = function(f) {
|
|
3055
3047
|
if (typeof Buffer == "function" && typeof Buffer.isBuffer == "function" && Buffer.isBuffer(f)) {
|
|
3056
3048
|
if (!this._decoder) {
|
|
3057
3049
|
var l = Qi().StringDecoder;
|
|
@@ -3060,16 +3052,16 @@ function Ji() {
|
|
|
3060
3052
|
f = this._decoder.write(f);
|
|
3061
3053
|
}
|
|
3062
3054
|
return this._parser.write(f.toString()), this.emit("data", f), !0;
|
|
3063
|
-
},
|
|
3055
|
+
}, E.prototype.end = function(f) {
|
|
3064
3056
|
return f && f.length && this.write(f), this._parser.end(), !0;
|
|
3065
|
-
},
|
|
3057
|
+
}, E.prototype.on = function(f, l) {
|
|
3066
3058
|
var M = this;
|
|
3067
|
-
return !M._parser["on" + f] &&
|
|
3059
|
+
return !M._parser["on" + f] && g.indexOf(f) !== -1 && (M._parser["on" + f] = function() {
|
|
3068
3060
|
var w = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);
|
|
3069
3061
|
w.splice(0, 0, f), M.emit.apply(M, w);
|
|
3070
3062
|
}), o.prototype.on.call(M, f, l);
|
|
3071
3063
|
};
|
|
3072
|
-
var S = "[CDATA[",
|
|
3064
|
+
var S = "[CDATA[", T = "DOCTYPE", F = "http://www.w3.org/XML/1998/namespace", B = "http://www.w3.org/2000/xmlns/", D = { xml: F, xmlns: B }, P = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, _ = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/, v = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, m = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
|
|
3073
3065
|
function d(f) {
|
|
3074
3066
|
return f === " " || f === `
|
|
3075
3067
|
` || f === "\r" || f === " ";
|
|
@@ -3077,7 +3069,7 @@ function Ji() {
|
|
|
3077
3069
|
function b(f) {
|
|
3078
3070
|
return f === '"' || f === "'";
|
|
3079
3071
|
}
|
|
3080
|
-
function
|
|
3072
|
+
function N(f) {
|
|
3081
3073
|
return f === ">" || d(f);
|
|
3082
3074
|
}
|
|
3083
3075
|
function O(f, l) {
|
|
@@ -3086,79 +3078,79 @@ function Ji() {
|
|
|
3086
3078
|
function R(f, l) {
|
|
3087
3079
|
return !O(f, l);
|
|
3088
3080
|
}
|
|
3089
|
-
var
|
|
3081
|
+
var y = 0;
|
|
3090
3082
|
t.STATE = {
|
|
3091
|
-
BEGIN:
|
|
3083
|
+
BEGIN: y++,
|
|
3092
3084
|
// leading byte order mark or whitespace
|
|
3093
|
-
BEGIN_WHITESPACE:
|
|
3085
|
+
BEGIN_WHITESPACE: y++,
|
|
3094
3086
|
// leading whitespace
|
|
3095
|
-
TEXT:
|
|
3087
|
+
TEXT: y++,
|
|
3096
3088
|
// general stuff
|
|
3097
|
-
TEXT_ENTITY:
|
|
3089
|
+
TEXT_ENTITY: y++,
|
|
3098
3090
|
// & and such.
|
|
3099
|
-
OPEN_WAKA:
|
|
3091
|
+
OPEN_WAKA: y++,
|
|
3100
3092
|
// <
|
|
3101
|
-
SGML_DECL:
|
|
3093
|
+
SGML_DECL: y++,
|
|
3102
3094
|
// <!BLARG
|
|
3103
|
-
SGML_DECL_QUOTED:
|
|
3095
|
+
SGML_DECL_QUOTED: y++,
|
|
3104
3096
|
// <!BLARG foo "bar
|
|
3105
|
-
DOCTYPE:
|
|
3097
|
+
DOCTYPE: y++,
|
|
3106
3098
|
// <!DOCTYPE
|
|
3107
|
-
DOCTYPE_QUOTED:
|
|
3099
|
+
DOCTYPE_QUOTED: y++,
|
|
3108
3100
|
// <!DOCTYPE "//blah
|
|
3109
|
-
DOCTYPE_DTD:
|
|
3101
|
+
DOCTYPE_DTD: y++,
|
|
3110
3102
|
// <!DOCTYPE "//blah" [ ...
|
|
3111
|
-
DOCTYPE_DTD_QUOTED:
|
|
3103
|
+
DOCTYPE_DTD_QUOTED: y++,
|
|
3112
3104
|
// <!DOCTYPE "//blah" [ "foo
|
|
3113
|
-
COMMENT_STARTING:
|
|
3105
|
+
COMMENT_STARTING: y++,
|
|
3114
3106
|
// <!-
|
|
3115
|
-
COMMENT:
|
|
3107
|
+
COMMENT: y++,
|
|
3116
3108
|
// <!--
|
|
3117
|
-
COMMENT_ENDING:
|
|
3109
|
+
COMMENT_ENDING: y++,
|
|
3118
3110
|
// <!-- blah -
|
|
3119
|
-
COMMENT_ENDED:
|
|
3111
|
+
COMMENT_ENDED: y++,
|
|
3120
3112
|
// <!-- blah --
|
|
3121
|
-
CDATA:
|
|
3113
|
+
CDATA: y++,
|
|
3122
3114
|
// <![CDATA[ something
|
|
3123
|
-
CDATA_ENDING:
|
|
3115
|
+
CDATA_ENDING: y++,
|
|
3124
3116
|
// ]
|
|
3125
|
-
CDATA_ENDING_2:
|
|
3117
|
+
CDATA_ENDING_2: y++,
|
|
3126
3118
|
// ]]
|
|
3127
|
-
PROC_INST:
|
|
3119
|
+
PROC_INST: y++,
|
|
3128
3120
|
// <?hi
|
|
3129
|
-
PROC_INST_BODY:
|
|
3121
|
+
PROC_INST_BODY: y++,
|
|
3130
3122
|
// <?hi there
|
|
3131
|
-
PROC_INST_ENDING:
|
|
3123
|
+
PROC_INST_ENDING: y++,
|
|
3132
3124
|
// <?hi "there" ?
|
|
3133
|
-
OPEN_TAG:
|
|
3125
|
+
OPEN_TAG: y++,
|
|
3134
3126
|
// <strong
|
|
3135
|
-
OPEN_TAG_SLASH:
|
|
3127
|
+
OPEN_TAG_SLASH: y++,
|
|
3136
3128
|
// <strong /
|
|
3137
|
-
ATTRIB:
|
|
3129
|
+
ATTRIB: y++,
|
|
3138
3130
|
// <a
|
|
3139
|
-
ATTRIB_NAME:
|
|
3131
|
+
ATTRIB_NAME: y++,
|
|
3140
3132
|
// <a foo
|
|
3141
|
-
ATTRIB_NAME_SAW_WHITE:
|
|
3133
|
+
ATTRIB_NAME_SAW_WHITE: y++,
|
|
3142
3134
|
// <a foo _
|
|
3143
|
-
ATTRIB_VALUE:
|
|
3135
|
+
ATTRIB_VALUE: y++,
|
|
3144
3136
|
// <a foo=
|
|
3145
|
-
ATTRIB_VALUE_QUOTED:
|
|
3137
|
+
ATTRIB_VALUE_QUOTED: y++,
|
|
3146
3138
|
// <a foo="bar
|
|
3147
|
-
ATTRIB_VALUE_CLOSED:
|
|
3139
|
+
ATTRIB_VALUE_CLOSED: y++,
|
|
3148
3140
|
// <a foo="bar"
|
|
3149
|
-
ATTRIB_VALUE_UNQUOTED:
|
|
3141
|
+
ATTRIB_VALUE_UNQUOTED: y++,
|
|
3150
3142
|
// <a foo=bar
|
|
3151
|
-
ATTRIB_VALUE_ENTITY_Q:
|
|
3143
|
+
ATTRIB_VALUE_ENTITY_Q: y++,
|
|
3152
3144
|
// <foo bar="""
|
|
3153
|
-
ATTRIB_VALUE_ENTITY_U:
|
|
3145
|
+
ATTRIB_VALUE_ENTITY_U: y++,
|
|
3154
3146
|
// <foo bar="
|
|
3155
|
-
CLOSE_TAG:
|
|
3147
|
+
CLOSE_TAG: y++,
|
|
3156
3148
|
// </a
|
|
3157
|
-
CLOSE_TAG_SAW_WHITE:
|
|
3149
|
+
CLOSE_TAG_SAW_WHITE: y++,
|
|
3158
3150
|
// </a >
|
|
3159
|
-
SCRIPT:
|
|
3151
|
+
SCRIPT: y++,
|
|
3160
3152
|
// <script> ...
|
|
3161
|
-
SCRIPT_ENDING:
|
|
3153
|
+
SCRIPT_ENDING: y++
|
|
3162
3154
|
// <script> ... <
|
|
3163
3155
|
}, t.XML_ENTITIES = {
|
|
3164
3156
|
amp: "&",
|
|
@@ -3426,7 +3418,7 @@ function Ji() {
|
|
|
3426
3418
|
});
|
|
3427
3419
|
for (var L in t.STATE)
|
|
3428
3420
|
t.STATE[t.STATE[L]] = L;
|
|
3429
|
-
|
|
3421
|
+
y = t.STATE;
|
|
3430
3422
|
function it(f, l, M) {
|
|
3431
3423
|
f[l] && f[l](M);
|
|
3432
3424
|
}
|
|
@@ -3446,9 +3438,9 @@ Column: ` + f.column + `
|
|
|
3446
3438
|
Char: ` + f.c), l = new Error(l), f.error = l, it(f, "onerror", l), f;
|
|
3447
3439
|
}
|
|
3448
3440
|
function ut(f) {
|
|
3449
|
-
return f.sawRoot && !f.closedRoot &&
|
|
3441
|
+
return f.sawRoot && !f.closedRoot && k(f, "Unclosed root tag"), f.state !== y.BEGIN && f.state !== y.BEGIN_WHITESPACE && f.state !== y.TEXT && at(f, "Unexpected end"), K(f), f.c = "", f.closed = !0, it(f, "onend"), i.call(f, f.strict, f.opt), f;
|
|
3450
3442
|
}
|
|
3451
|
-
function
|
|
3443
|
+
function k(f, l) {
|
|
3452
3444
|
if (typeof f != "object" || !(f instanceof i))
|
|
3453
3445
|
throw new Error("bad call to strictFail");
|
|
3454
3446
|
f.strict && at(f, l);
|
|
@@ -3470,16 +3462,16 @@ Char: ` + f.c), l = new Error(l), f.error = l, it(f, "onerror", l), f;
|
|
|
3470
3462
|
if (f.opt.xmlns) {
|
|
3471
3463
|
var l = W(f.attribName, !0), M = l.prefix, w = l.local;
|
|
3472
3464
|
if (M === "xmlns")
|
|
3473
|
-
if (w === "xml" && f.attribValue !==
|
|
3474
|
-
|
|
3465
|
+
if (w === "xml" && f.attribValue !== F)
|
|
3466
|
+
k(
|
|
3475
3467
|
f,
|
|
3476
|
-
"xml: prefix must be bound to " +
|
|
3468
|
+
"xml: prefix must be bound to " + F + `
|
|
3477
3469
|
Actual: ` + f.attribValue
|
|
3478
3470
|
);
|
|
3479
|
-
else if (w === "xmlns" && f.attribValue !==
|
|
3480
|
-
|
|
3471
|
+
else if (w === "xmlns" && f.attribValue !== B)
|
|
3472
|
+
k(
|
|
3481
3473
|
f,
|
|
3482
|
-
"xmlns: prefix must be bound to " +
|
|
3474
|
+
"xmlns: prefix must be bound to " + B + `
|
|
3483
3475
|
Actual: ` + f.attribValue
|
|
3484
3476
|
);
|
|
3485
3477
|
else {
|
|
@@ -3494,10 +3486,10 @@ Actual: ` + f.attribValue
|
|
|
3494
3486
|
});
|
|
3495
3487
|
f.attribName = f.attribValue = "";
|
|
3496
3488
|
}
|
|
3497
|
-
function
|
|
3489
|
+
function U(f, l) {
|
|
3498
3490
|
if (f.opt.xmlns) {
|
|
3499
3491
|
var M = f.tag, w = W(f.tagName);
|
|
3500
|
-
M.prefix = w.prefix, M.local = w.local, M.uri = M.ns[w.prefix] || "", M.prefix && !M.uri && (
|
|
3492
|
+
M.prefix = w.prefix, M.local = w.local, M.uri = M.ns[w.prefix] || "", M.prefix && !M.uri && (k(f, "Unbound namespace prefix: " + JSON.stringify(f.tagName)), M.uri = w.prefix);
|
|
3501
3493
|
var G = f.tags[f.tags.length - 1] || f;
|
|
3502
3494
|
M.ns && G.ns !== M.ns && Object.keys(M.ns).forEach(function(pt) {
|
|
3503
3495
|
V(f, "onopennamespace", {
|
|
@@ -3505,7 +3497,7 @@ Actual: ` + f.attribValue
|
|
|
3505
3497
|
uri: M.ns[pt]
|
|
3506
3498
|
});
|
|
3507
3499
|
});
|
|
3508
|
-
for (var Q = 0,
|
|
3500
|
+
for (var Q = 0, j = f.attribList.length; Q < j; Q++) {
|
|
3509
3501
|
var st = f.attribList[Q], ct = st[0], Tt = st[1], et = W(ct, !0), yt = et.prefix, ne = et.local, Yt = yt === "" ? "" : M.ns[yt] || "", St = {
|
|
3510
3502
|
name: ct,
|
|
3511
3503
|
value: Tt,
|
|
@@ -3513,20 +3505,20 @@ Actual: ` + f.attribValue
|
|
|
3513
3505
|
local: ne,
|
|
3514
3506
|
uri: Yt
|
|
3515
3507
|
};
|
|
3516
|
-
yt && yt !== "xmlns" && !Yt && (
|
|
3508
|
+
yt && yt !== "xmlns" && !Yt && (k(f, "Unbound namespace prefix: " + JSON.stringify(yt)), St.uri = yt), f.tag.attributes[ct] = St, V(f, "onattribute", St);
|
|
3517
3509
|
}
|
|
3518
3510
|
f.attribList.length = 0;
|
|
3519
3511
|
}
|
|
3520
|
-
f.tag.isSelfClosing = !!l, f.sawRoot = !0, f.tags.push(f.tag), V(f, "onopentag", f.tag), l || (!f.noscript && f.tagName.toLowerCase() === "script" ? f.state =
|
|
3512
|
+
f.tag.isSelfClosing = !!l, f.sawRoot = !0, f.tags.push(f.tag), V(f, "onopentag", f.tag), l || (!f.noscript && f.tagName.toLowerCase() === "script" ? f.state = y.SCRIPT : f.state = y.TEXT, f.tag = null, f.tagName = ""), f.attribName = f.attribValue = "", f.attribList.length = 0;
|
|
3521
3513
|
}
|
|
3522
3514
|
function $(f) {
|
|
3523
3515
|
if (!f.tagName) {
|
|
3524
|
-
|
|
3516
|
+
k(f, "Weird empty close tag."), f.textNode += "</>", f.state = y.TEXT;
|
|
3525
3517
|
return;
|
|
3526
3518
|
}
|
|
3527
3519
|
if (f.script) {
|
|
3528
3520
|
if (f.tagName !== "script") {
|
|
3529
|
-
f.script += "</" + f.tagName + ">", f.tagName = "", f.state =
|
|
3521
|
+
f.script += "</" + f.tagName + ">", f.tagName = "", f.state = y.SCRIPT;
|
|
3530
3522
|
return;
|
|
3531
3523
|
}
|
|
3532
3524
|
V(f, "onscript", f.script), f.script = "";
|
|
@@ -3536,35 +3528,35 @@ Actual: ` + f.attribValue
|
|
|
3536
3528
|
for (var w = M; l--; ) {
|
|
3537
3529
|
var G = f.tags[l];
|
|
3538
3530
|
if (G.name !== w)
|
|
3539
|
-
|
|
3531
|
+
k(f, "Unexpected close tag");
|
|
3540
3532
|
else
|
|
3541
3533
|
break;
|
|
3542
3534
|
}
|
|
3543
3535
|
if (l < 0) {
|
|
3544
|
-
|
|
3536
|
+
k(f, "Unmatched closing tag: " + f.tagName), f.textNode += "</" + f.tagName + ">", f.state = y.TEXT;
|
|
3545
3537
|
return;
|
|
3546
3538
|
}
|
|
3547
3539
|
f.tagName = M;
|
|
3548
3540
|
for (var Q = f.tags.length; Q-- > l; ) {
|
|
3549
|
-
var
|
|
3541
|
+
var j = f.tag = f.tags.pop();
|
|
3550
3542
|
f.tagName = f.tag.name, V(f, "onclosetag", f.tagName);
|
|
3551
3543
|
var st = {};
|
|
3552
|
-
for (var ct in
|
|
3553
|
-
st[ct] =
|
|
3544
|
+
for (var ct in j.ns)
|
|
3545
|
+
st[ct] = j.ns[ct];
|
|
3554
3546
|
var Tt = f.tags[f.tags.length - 1] || f;
|
|
3555
|
-
f.opt.xmlns &&
|
|
3556
|
-
var yt =
|
|
3547
|
+
f.opt.xmlns && j.ns !== Tt.ns && Object.keys(j.ns).forEach(function(et) {
|
|
3548
|
+
var yt = j.ns[et];
|
|
3557
3549
|
V(f, "onclosenamespace", { prefix: et, uri: yt });
|
|
3558
3550
|
});
|
|
3559
3551
|
}
|
|
3560
|
-
l === 0 && (f.closedRoot = !0), f.tagName = f.attribValue = f.attribName = "", f.attribList.length = 0, f.state =
|
|
3552
|
+
l === 0 && (f.closedRoot = !0), f.tagName = f.attribValue = f.attribName = "", f.attribList.length = 0, f.state = y.TEXT;
|
|
3561
3553
|
}
|
|
3562
3554
|
function At(f) {
|
|
3563
3555
|
var l = f.entity, M = l.toLowerCase(), w, G = "";
|
|
3564
|
-
return f.ENTITIES[l] ? f.ENTITIES[l] : f.ENTITIES[M] ? f.ENTITIES[M] : (l = M, l.charAt(0) === "#" && (l.charAt(1) === "x" ? (l = l.slice(2), w = parseInt(l, 16), G = w.toString(16)) : (l = l.slice(1), w = parseInt(l, 10), G = w.toString(10))), l = l.replace(/^0+/, ""), isNaN(w) || G.toLowerCase() !== l ? (
|
|
3556
|
+
return f.ENTITIES[l] ? f.ENTITIES[l] : f.ENTITIES[M] ? f.ENTITIES[M] : (l = M, l.charAt(0) === "#" && (l.charAt(1) === "x" ? (l = l.slice(2), w = parseInt(l, 16), G = w.toString(16)) : (l = l.slice(1), w = parseInt(l, 10), G = w.toString(10))), l = l.replace(/^0+/, ""), isNaN(w) || G.toLowerCase() !== l ? (k(f, "Invalid character entity"), "&" + f.entity + ";") : String.fromCodePoint(w));
|
|
3565
3557
|
}
|
|
3566
3558
|
function Et(f, l) {
|
|
3567
|
-
l === "<" ? (f.state =
|
|
3559
|
+
l === "<" ? (f.state = y.OPEN_WAKA, f.startTagPosition = f.position) : d(l) || (k(f, "Non-whitespace before first tag."), f.textNode = l, f.state = y.TEXT);
|
|
3568
3560
|
}
|
|
3569
3561
|
function Xt(f, l) {
|
|
3570
3562
|
var M = "";
|
|
@@ -3585,194 +3577,193 @@ Actual: ` + f.attribValue
|
|
|
3585
3577
|
for (var M = 0, w = ""; w = Xt(f, M++), l.c = w, !!w; )
|
|
3586
3578
|
switch (l.trackPosition && (l.position++, w === `
|
|
3587
3579
|
` ? (l.line++, l.column = 0) : l.column++), l.state) {
|
|
3588
|
-
case
|
|
3589
|
-
if (l.state =
|
|
3580
|
+
case y.BEGIN:
|
|
3581
|
+
if (l.state = y.BEGIN_WHITESPACE, w === "\uFEFF")
|
|
3590
3582
|
continue;
|
|
3591
3583
|
Et(l, w);
|
|
3592
3584
|
continue;
|
|
3593
|
-
case
|
|
3585
|
+
case y.BEGIN_WHITESPACE:
|
|
3594
3586
|
Et(l, w);
|
|
3595
3587
|
continue;
|
|
3596
|
-
case
|
|
3588
|
+
case y.TEXT:
|
|
3597
3589
|
if (l.sawRoot && !l.closedRoot) {
|
|
3598
3590
|
for (var G = M - 1; w && w !== "<" && w !== "&"; )
|
|
3599
3591
|
w = Xt(f, M++), w && l.trackPosition && (l.position++, w === `
|
|
3600
3592
|
` ? (l.line++, l.column = 0) : l.column++);
|
|
3601
3593
|
l.textNode += f.substring(G, M - 1);
|
|
3602
3594
|
}
|
|
3603
|
-
w === "<" && !(l.sawRoot && l.closedRoot && !l.strict) ? (l.state =
|
|
3595
|
+
w === "<" && !(l.sawRoot && l.closedRoot && !l.strict) ? (l.state = y.OPEN_WAKA, l.startTagPosition = l.position) : (!d(w) && (!l.sawRoot || l.closedRoot) && k(l, "Text data outside of root node."), w === "&" ? l.state = y.TEXT_ENTITY : l.textNode += w);
|
|
3604
3596
|
continue;
|
|
3605
|
-
case
|
|
3606
|
-
w === "<" ? l.state =
|
|
3597
|
+
case y.SCRIPT:
|
|
3598
|
+
w === "<" ? l.state = y.SCRIPT_ENDING : l.script += w;
|
|
3607
3599
|
continue;
|
|
3608
|
-
case
|
|
3609
|
-
w === "/" ? l.state =
|
|
3600
|
+
case y.SCRIPT_ENDING:
|
|
3601
|
+
w === "/" ? l.state = y.CLOSE_TAG : (l.script += "<" + w, l.state = y.SCRIPT);
|
|
3610
3602
|
continue;
|
|
3611
|
-
case
|
|
3603
|
+
case y.OPEN_WAKA:
|
|
3612
3604
|
if (w === "!")
|
|
3613
|
-
l.state =
|
|
3614
|
-
else if (!d(w)) if (O(
|
|
3615
|
-
l.state =
|
|
3605
|
+
l.state = y.SGML_DECL, l.sgmlDecl = "";
|
|
3606
|
+
else if (!d(w)) if (O(P, w))
|
|
3607
|
+
l.state = y.OPEN_TAG, l.tagName = w;
|
|
3616
3608
|
else if (w === "/")
|
|
3617
|
-
l.state =
|
|
3609
|
+
l.state = y.CLOSE_TAG, l.tagName = "";
|
|
3618
3610
|
else if (w === "?")
|
|
3619
|
-
l.state =
|
|
3611
|
+
l.state = y.PROC_INST, l.procInstName = l.procInstBody = "";
|
|
3620
3612
|
else {
|
|
3621
|
-
if (
|
|
3613
|
+
if (k(l, "Unencoded <"), l.startTagPosition + 1 < l.position) {
|
|
3622
3614
|
var Q = l.position - l.startTagPosition;
|
|
3623
3615
|
w = new Array(Q).join(" ") + w;
|
|
3624
3616
|
}
|
|
3625
|
-
l.textNode += "<" + w, l.state =
|
|
3617
|
+
l.textNode += "<" + w, l.state = y.TEXT;
|
|
3626
3618
|
}
|
|
3627
3619
|
continue;
|
|
3628
|
-
case
|
|
3620
|
+
case y.SGML_DECL:
|
|
3629
3621
|
if (l.sgmlDecl + w === "--") {
|
|
3630
|
-
l.state =
|
|
3622
|
+
l.state = y.COMMENT, l.comment = "", l.sgmlDecl = "";
|
|
3631
3623
|
continue;
|
|
3632
3624
|
}
|
|
3633
|
-
l.doctype && l.doctype !== !0 && l.sgmlDecl ? (l.state =
|
|
3625
|
+
l.doctype && l.doctype !== !0 && l.sgmlDecl ? (l.state = y.DOCTYPE_DTD, l.doctype += "<!" + l.sgmlDecl + w, l.sgmlDecl = "") : (l.sgmlDecl + w).toUpperCase() === S ? (V(l, "onopencdata"), l.state = y.CDATA, l.sgmlDecl = "", l.cdata = "") : (l.sgmlDecl + w).toUpperCase() === T ? (l.state = y.DOCTYPE, (l.doctype || l.sawRoot) && k(
|
|
3634
3626
|
l,
|
|
3635
3627
|
"Inappropriately located doctype declaration"
|
|
3636
|
-
), l.doctype = "", l.sgmlDecl = "") : w === ">" ? (V(l, "onsgmldeclaration", l.sgmlDecl), l.sgmlDecl = "", l.state =
|
|
3628
|
+
), l.doctype = "", l.sgmlDecl = "") : w === ">" ? (V(l, "onsgmldeclaration", l.sgmlDecl), l.sgmlDecl = "", l.state = y.TEXT) : (b(w) && (l.state = y.SGML_DECL_QUOTED), l.sgmlDecl += w);
|
|
3637
3629
|
continue;
|
|
3638
|
-
case
|
|
3639
|
-
w === l.q && (l.state =
|
|
3630
|
+
case y.SGML_DECL_QUOTED:
|
|
3631
|
+
w === l.q && (l.state = y.SGML_DECL, l.q = ""), l.sgmlDecl += w;
|
|
3640
3632
|
continue;
|
|
3641
|
-
case
|
|
3642
|
-
w === ">" ? (l.state =
|
|
3633
|
+
case y.DOCTYPE:
|
|
3634
|
+
w === ">" ? (l.state = y.TEXT, V(l, "ondoctype", l.doctype), l.doctype = !0) : (l.doctype += w, w === "[" ? l.state = y.DOCTYPE_DTD : b(w) && (l.state = y.DOCTYPE_QUOTED, l.q = w));
|
|
3643
3635
|
continue;
|
|
3644
|
-
case
|
|
3645
|
-
l.doctype += w, w === l.q && (l.q = "", l.state =
|
|
3636
|
+
case y.DOCTYPE_QUOTED:
|
|
3637
|
+
l.doctype += w, w === l.q && (l.q = "", l.state = y.DOCTYPE);
|
|
3646
3638
|
continue;
|
|
3647
|
-
case
|
|
3648
|
-
w === "]" ? (l.doctype += w, l.state =
|
|
3639
|
+
case y.DOCTYPE_DTD:
|
|
3640
|
+
w === "]" ? (l.doctype += w, l.state = y.DOCTYPE) : w === "<" ? (l.state = y.OPEN_WAKA, l.startTagPosition = l.position) : b(w) ? (l.doctype += w, l.state = y.DOCTYPE_DTD_QUOTED, l.q = w) : l.doctype += w;
|
|
3649
3641
|
continue;
|
|
3650
|
-
case
|
|
3651
|
-
l.doctype += w, w === l.q && (l.state =
|
|
3642
|
+
case y.DOCTYPE_DTD_QUOTED:
|
|
3643
|
+
l.doctype += w, w === l.q && (l.state = y.DOCTYPE_DTD, l.q = "");
|
|
3652
3644
|
continue;
|
|
3653
|
-
case
|
|
3654
|
-
w === "-" ? l.state =
|
|
3645
|
+
case y.COMMENT:
|
|
3646
|
+
w === "-" ? l.state = y.COMMENT_ENDING : l.comment += w;
|
|
3655
3647
|
continue;
|
|
3656
|
-
case
|
|
3657
|
-
w === "-" ? (l.state =
|
|
3648
|
+
case y.COMMENT_ENDING:
|
|
3649
|
+
w === "-" ? (l.state = y.COMMENT_ENDED, l.comment = lt(l.opt, l.comment), l.comment && V(l, "oncomment", l.comment), l.comment = "") : (l.comment += "-" + w, l.state = y.COMMENT);
|
|
3658
3650
|
continue;
|
|
3659
|
-
case
|
|
3660
|
-
w !== ">" ? (
|
|
3651
|
+
case y.COMMENT_ENDED:
|
|
3652
|
+
w !== ">" ? (k(l, "Malformed comment"), l.comment += "--" + w, l.state = y.COMMENT) : l.doctype && l.doctype !== !0 ? l.state = y.DOCTYPE_DTD : l.state = y.TEXT;
|
|
3661
3653
|
continue;
|
|
3662
|
-
case
|
|
3663
|
-
w === "]" ? l.state =
|
|
3654
|
+
case y.CDATA:
|
|
3655
|
+
w === "]" ? l.state = y.CDATA_ENDING : l.cdata += w;
|
|
3664
3656
|
continue;
|
|
3665
|
-
case
|
|
3666
|
-
w === "]" ? l.state =
|
|
3657
|
+
case y.CDATA_ENDING:
|
|
3658
|
+
w === "]" ? l.state = y.CDATA_ENDING_2 : (l.cdata += "]" + w, l.state = y.CDATA);
|
|
3667
3659
|
continue;
|
|
3668
|
-
case
|
|
3669
|
-
w === ">" ? (l.cdata && V(l, "oncdata", l.cdata), V(l, "onclosecdata"), l.cdata = "", l.state =
|
|
3660
|
+
case y.CDATA_ENDING_2:
|
|
3661
|
+
w === ">" ? (l.cdata && V(l, "oncdata", l.cdata), V(l, "onclosecdata"), l.cdata = "", l.state = y.TEXT) : w === "]" ? l.cdata += "]" : (l.cdata += "]]" + w, l.state = y.CDATA);
|
|
3670
3662
|
continue;
|
|
3671
|
-
case
|
|
3672
|
-
w === "?" ? l.state =
|
|
3663
|
+
case y.PROC_INST:
|
|
3664
|
+
w === "?" ? l.state = y.PROC_INST_ENDING : d(w) ? l.state = y.PROC_INST_BODY : l.procInstName += w;
|
|
3673
3665
|
continue;
|
|
3674
|
-
case
|
|
3666
|
+
case y.PROC_INST_BODY:
|
|
3675
3667
|
if (!l.procInstBody && d(w))
|
|
3676
3668
|
continue;
|
|
3677
|
-
w === "?" ? l.state =
|
|
3669
|
+
w === "?" ? l.state = y.PROC_INST_ENDING : l.procInstBody += w;
|
|
3678
3670
|
continue;
|
|
3679
|
-
case
|
|
3671
|
+
case y.PROC_INST_ENDING:
|
|
3680
3672
|
w === ">" ? (V(l, "onprocessinginstruction", {
|
|
3681
3673
|
name: l.procInstName,
|
|
3682
3674
|
body: l.procInstBody
|
|
3683
|
-
}), l.procInstName = l.procInstBody = "", l.state =
|
|
3675
|
+
}), l.procInstName = l.procInstBody = "", l.state = y.TEXT) : (l.procInstBody += "?" + w, l.state = y.PROC_INST_BODY);
|
|
3684
3676
|
continue;
|
|
3685
|
-
case
|
|
3686
|
-
O(_, w) ? l.tagName += w : (rt(l), w === ">" ?
|
|
3677
|
+
case y.OPEN_TAG:
|
|
3678
|
+
O(_, w) ? l.tagName += w : (rt(l), w === ">" ? U(l) : w === "/" ? l.state = y.OPEN_TAG_SLASH : (d(w) || k(l, "Invalid character in tag name"), l.state = y.ATTRIB));
|
|
3687
3679
|
continue;
|
|
3688
|
-
case
|
|
3689
|
-
w === ">" ? (
|
|
3680
|
+
case y.OPEN_TAG_SLASH:
|
|
3681
|
+
w === ">" ? (U(l, !0), $(l)) : (k(l, "Forward-slash in opening tag not followed by >"), l.state = y.ATTRIB);
|
|
3690
3682
|
continue;
|
|
3691
|
-
case
|
|
3683
|
+
case y.ATTRIB:
|
|
3692
3684
|
if (d(w))
|
|
3693
3685
|
continue;
|
|
3694
|
-
w === ">" ?
|
|
3686
|
+
w === ">" ? U(l) : w === "/" ? l.state = y.OPEN_TAG_SLASH : O(P, w) ? (l.attribName = w, l.attribValue = "", l.state = y.ATTRIB_NAME) : k(l, "Invalid attribute name");
|
|
3695
3687
|
continue;
|
|
3696
|
-
case
|
|
3697
|
-
w === "=" ? l.state =
|
|
3688
|
+
case y.ATTRIB_NAME:
|
|
3689
|
+
w === "=" ? l.state = y.ATTRIB_VALUE : w === ">" ? (k(l, "Attribute without value"), l.attribValue = l.attribName, tt(l), U(l)) : d(w) ? l.state = y.ATTRIB_NAME_SAW_WHITE : O(_, w) ? l.attribName += w : k(l, "Invalid attribute name");
|
|
3698
3690
|
continue;
|
|
3699
|
-
case
|
|
3691
|
+
case y.ATTRIB_NAME_SAW_WHITE:
|
|
3700
3692
|
if (w === "=")
|
|
3701
|
-
l.state =
|
|
3693
|
+
l.state = y.ATTRIB_VALUE;
|
|
3702
3694
|
else {
|
|
3703
3695
|
if (d(w))
|
|
3704
3696
|
continue;
|
|
3705
|
-
|
|
3697
|
+
k(l, "Attribute without value"), l.tag.attributes[l.attribName] = "", l.attribValue = "", V(l, "onattribute", {
|
|
3706
3698
|
name: l.attribName,
|
|
3707
3699
|
value: ""
|
|
3708
|
-
}), l.attribName = "", w === ">" ?
|
|
3700
|
+
}), l.attribName = "", w === ">" ? U(l) : O(P, w) ? (l.attribName = w, l.state = y.ATTRIB_NAME) : (k(l, "Invalid attribute name"), l.state = y.ATTRIB);
|
|
3709
3701
|
}
|
|
3710
3702
|
continue;
|
|
3711
|
-
case
|
|
3703
|
+
case y.ATTRIB_VALUE:
|
|
3712
3704
|
if (d(w))
|
|
3713
3705
|
continue;
|
|
3714
|
-
b(w) ? (l.q = w, l.state =
|
|
3706
|
+
b(w) ? (l.q = w, l.state = y.ATTRIB_VALUE_QUOTED) : (l.opt.unquotedAttributeValues || at(l, "Unquoted attribute value"), l.state = y.ATTRIB_VALUE_UNQUOTED, l.attribValue = w);
|
|
3715
3707
|
continue;
|
|
3716
|
-
case
|
|
3708
|
+
case y.ATTRIB_VALUE_QUOTED:
|
|
3717
3709
|
if (w !== l.q) {
|
|
3718
|
-
w === "&" ? l.state =
|
|
3710
|
+
w === "&" ? l.state = y.ATTRIB_VALUE_ENTITY_Q : l.attribValue += w;
|
|
3719
3711
|
continue;
|
|
3720
3712
|
}
|
|
3721
|
-
tt(l), l.q = "", l.state =
|
|
3713
|
+
tt(l), l.q = "", l.state = y.ATTRIB_VALUE_CLOSED;
|
|
3722
3714
|
continue;
|
|
3723
|
-
case
|
|
3724
|
-
d(w) ? l.state =
|
|
3715
|
+
case y.ATTRIB_VALUE_CLOSED:
|
|
3716
|
+
d(w) ? l.state = y.ATTRIB : w === ">" ? U(l) : w === "/" ? l.state = y.OPEN_TAG_SLASH : O(P, w) ? (k(l, "No whitespace between attributes"), l.attribName = w, l.attribValue = "", l.state = y.ATTRIB_NAME) : k(l, "Invalid attribute name");
|
|
3725
3717
|
continue;
|
|
3726
|
-
case
|
|
3727
|
-
if (!
|
|
3728
|
-
w === "&" ? l.state =
|
|
3718
|
+
case y.ATTRIB_VALUE_UNQUOTED:
|
|
3719
|
+
if (!N(w)) {
|
|
3720
|
+
w === "&" ? l.state = y.ATTRIB_VALUE_ENTITY_U : l.attribValue += w;
|
|
3729
3721
|
continue;
|
|
3730
3722
|
}
|
|
3731
|
-
tt(l), w === ">" ?
|
|
3723
|
+
tt(l), w === ">" ? U(l) : l.state = y.ATTRIB;
|
|
3732
3724
|
continue;
|
|
3733
|
-
case
|
|
3725
|
+
case y.CLOSE_TAG:
|
|
3734
3726
|
if (l.tagName)
|
|
3735
|
-
w === ">" ? $(l) : O(_, w) ? l.tagName += w : l.script ? (l.script += "</" + l.tagName, l.tagName = "", l.state =
|
|
3727
|
+
w === ">" ? $(l) : O(_, w) ? l.tagName += w : l.script ? (l.script += "</" + l.tagName, l.tagName = "", l.state = y.SCRIPT) : (d(w) || k(l, "Invalid tagname in closing tag"), l.state = y.CLOSE_TAG_SAW_WHITE);
|
|
3736
3728
|
else {
|
|
3737
3729
|
if (d(w))
|
|
3738
3730
|
continue;
|
|
3739
|
-
R(
|
|
3731
|
+
R(P, w) ? l.script ? (l.script += "</" + w, l.state = y.SCRIPT) : k(l, "Invalid tagname in closing tag.") : l.tagName = w;
|
|
3740
3732
|
}
|
|
3741
3733
|
continue;
|
|
3742
|
-
case
|
|
3734
|
+
case y.CLOSE_TAG_SAW_WHITE:
|
|
3743
3735
|
if (d(w))
|
|
3744
3736
|
continue;
|
|
3745
|
-
w === ">" ? $(l) :
|
|
3737
|
+
w === ">" ? $(l) : k(l, "Invalid characters in closing tag");
|
|
3746
3738
|
continue;
|
|
3747
|
-
case
|
|
3748
|
-
case
|
|
3749
|
-
case
|
|
3750
|
-
var
|
|
3739
|
+
case y.TEXT_ENTITY:
|
|
3740
|
+
case y.ATTRIB_VALUE_ENTITY_Q:
|
|
3741
|
+
case y.ATTRIB_VALUE_ENTITY_U:
|
|
3742
|
+
var j, st;
|
|
3751
3743
|
switch (l.state) {
|
|
3752
|
-
case
|
|
3753
|
-
|
|
3744
|
+
case y.TEXT_ENTITY:
|
|
3745
|
+
j = y.TEXT, st = "textNode";
|
|
3754
3746
|
break;
|
|
3755
|
-
case
|
|
3756
|
-
|
|
3747
|
+
case y.ATTRIB_VALUE_ENTITY_Q:
|
|
3748
|
+
j = y.ATTRIB_VALUE_QUOTED, st = "attribValue";
|
|
3757
3749
|
break;
|
|
3758
|
-
case
|
|
3759
|
-
|
|
3750
|
+
case y.ATTRIB_VALUE_ENTITY_U:
|
|
3751
|
+
j = y.ATTRIB_VALUE_UNQUOTED, st = "attribValue";
|
|
3760
3752
|
break;
|
|
3761
3753
|
}
|
|
3762
3754
|
if (w === ";") {
|
|
3763
3755
|
var ct = At(l);
|
|
3764
|
-
l.opt.unparsedEntities && !Object.values(t.XML_ENTITIES).includes(ct) ? (l.entity = "", l.state =
|
|
3765
|
-
} else O(l.entity.length ? m : v, w) ? l.entity += w : (
|
|
3756
|
+
l.opt.unparsedEntities && !Object.values(t.XML_ENTITIES).includes(ct) ? (l.entity = "", l.state = j, l.write(ct)) : (l[st] += ct, l.entity = "", l.state = j);
|
|
3757
|
+
} else O(l.entity.length ? m : v, w) ? l.entity += w : (k(l, "Invalid character in entity name"), l[st] += "&" + l.entity + w, l.entity = "", l.state = j);
|
|
3766
3758
|
continue;
|
|
3767
3759
|
default:
|
|
3768
3760
|
throw new Error(l, "Unknown state: " + l.state);
|
|
3769
3761
|
}
|
|
3770
3762
|
return l.position >= l.bufferCheckPosition && s(l), l;
|
|
3771
3763
|
}
|
|
3772
|
-
|
|
3773
|
-
String.fromCodePoint || function() {
|
|
3764
|
+
String.fromCodePoint || (function() {
|
|
3774
3765
|
var f = String.fromCharCode, l = Math.floor, M = function() {
|
|
3775
|
-
var w = 16384, G = [], Q,
|
|
3766
|
+
var w = 16384, G = [], Q, j, st = -1, ct = arguments.length;
|
|
3776
3767
|
if (!ct)
|
|
3777
3768
|
return "";
|
|
3778
3769
|
for (var Tt = ""; ++st < ct; ) {
|
|
@@ -3782,7 +3773,7 @@ Actual: ` + f.attribValue
|
|
|
3782
3773
|
et > 1114111 || // not a valid Unicode code point
|
|
3783
3774
|
l(et) !== et)
|
|
3784
3775
|
throw RangeError("Invalid code point: " + et);
|
|
3785
|
-
et <= 65535 ? G.push(et) : (et -= 65536, Q = (et >> 10) + 55296,
|
|
3776
|
+
et <= 65535 ? G.push(et) : (et -= 65536, Q = (et >> 10) + 55296, j = et % 1024 + 56320, G.push(Q, j)), (st + 1 === ct || G.length > w) && (Tt += f.apply(null, G), G.length = 0);
|
|
3786
3777
|
}
|
|
3787
3778
|
return Tt;
|
|
3788
3779
|
};
|
|
@@ -3791,9 +3782,9 @@ Actual: ` + f.attribValue
|
|
|
3791
3782
|
configurable: !0,
|
|
3792
3783
|
writable: !0
|
|
3793
3784
|
}) : String.fromCodePoint = M;
|
|
3794
|
-
}();
|
|
3785
|
+
})();
|
|
3795
3786
|
})(h);
|
|
3796
|
-
}(ce)), ce;
|
|
3787
|
+
})(ce)), ce;
|
|
3797
3788
|
}
|
|
3798
3789
|
var fe, Ke;
|
|
3799
3790
|
function Fe() {
|
|
@@ -3803,10 +3794,10 @@ function Fe() {
|
|
|
3803
3794
|
}
|
|
3804
3795
|
}), fe;
|
|
3805
3796
|
}
|
|
3806
|
-
var de,
|
|
3797
|
+
var de, je;
|
|
3807
3798
|
function De() {
|
|
3808
|
-
if (
|
|
3809
|
-
|
|
3799
|
+
if (je) return de;
|
|
3800
|
+
je = 1;
|
|
3810
3801
|
var h = Fe().isArray;
|
|
3811
3802
|
return de = {
|
|
3812
3803
|
copyOptions: function(t) {
|
|
@@ -3832,10 +3823,10 @@ function De() {
|
|
|
3832
3823
|
}
|
|
3833
3824
|
}, de;
|
|
3834
3825
|
}
|
|
3835
|
-
var pe,
|
|
3826
|
+
var pe, ze;
|
|
3836
3827
|
function ni() {
|
|
3837
|
-
if (
|
|
3838
|
-
|
|
3828
|
+
if (ze) return pe;
|
|
3829
|
+
ze = 1;
|
|
3839
3830
|
var h = Ji(), t = De(), e = Fe().isArray, i, s;
|
|
3840
3831
|
function c(_) {
|
|
3841
3832
|
return i = t.copyOptions(_), t.ensureFlagExists("ignoreDeclaration", i), t.ensureFlagExists("ignoreInstruction", i), t.ensureFlagExists("ignoreAttributes", i), t.ensureFlagExists("ignoreText", i), t.ensureFlagExists("ignoreComment", i), t.ensureFlagExists("ignoreCdata", i), t.ensureFlagExists("ignoreDoctype", i), t.ensureFlagExists("compact", i), t.ensureFlagExists("alwaysChildren", i), t.ensureFlagExists("addParent", i), t.ensureFlagExists("trim", i), t.ensureFlagExists("nativeType", i), t.ensureFlagExists("nativeTypeAttributes", i), t.ensureFlagExists("sanitize", i), t.ensureFlagExists("instructionHasAttributes", i), t.ensureFlagExists("captureSpacesBetweenElements", i), t.ensureAlwaysArrayExists(i), t.ensureKeyExists("declaration", i), t.ensureKeyExists("instruction", i), t.ensureKeyExists("attributes", i), t.ensureKeyExists("text", i), t.ensureKeyExists("comment", i), t.ensureKeyExists("cdata", i), t.ensureKeyExists("doctype", i), t.ensureKeyExists("type", i), t.ensureKeyExists("name", i), t.ensureKeyExists("elements", i), t.ensureKeyExists("parent", i), t.checkFnExists("doctype", i), t.checkFnExists("instruction", i), t.checkFnExists("cdata", i), t.checkFnExists("comment", i), t.checkFnExists("text", i), t.checkFnExists("instructionName", i), t.checkFnExists("elementName", i), t.checkFnExists("attributeName", i), t.checkFnExists("attributeValue", i), t.checkFnExists("attributes", i), i;
|
|
@@ -3874,7 +3865,7 @@ function ni() {
|
|
|
3874
3865
|
i.addParent && (b[i.parentKey] = s), s[i.elementsKey].push(b);
|
|
3875
3866
|
}
|
|
3876
3867
|
}
|
|
3877
|
-
function
|
|
3868
|
+
function g(_) {
|
|
3878
3869
|
if ("attributesFn" in i && _ && (_ = i.attributesFn(_, s)), (i.trim || "attributeValueFn" in i || "attributeNameFn" in i || i.nativeTypeAttributes) && _) {
|
|
3879
3870
|
var v;
|
|
3880
3871
|
for (v in _)
|
|
@@ -3885,12 +3876,12 @@ function ni() {
|
|
|
3885
3876
|
}
|
|
3886
3877
|
return _;
|
|
3887
3878
|
}
|
|
3888
|
-
function
|
|
3879
|
+
function I(_) {
|
|
3889
3880
|
var v = {};
|
|
3890
3881
|
if (_.body && (_.name.toLowerCase() === "xml" || i.instructionHasAttributes)) {
|
|
3891
3882
|
for (var m = /([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g, d; (d = m.exec(_.body)) !== null; )
|
|
3892
3883
|
v[d[1]] = d[2] || d[3] || d[4];
|
|
3893
|
-
v =
|
|
3884
|
+
v = g(v);
|
|
3894
3885
|
}
|
|
3895
3886
|
if (_.name.toLowerCase() === "xml") {
|
|
3896
3887
|
if (i.ignoreDeclaration)
|
|
@@ -3904,9 +3895,9 @@ function ni() {
|
|
|
3904
3895
|
i.instructionHasAttributes && Object.keys(v).length ? (b[_.name] = {}, b[_.name][i.attributesKey] = v) : b[_.name] = _.body, o("instruction", b);
|
|
3905
3896
|
}
|
|
3906
3897
|
}
|
|
3907
|
-
function
|
|
3898
|
+
function E(_, v) {
|
|
3908
3899
|
var m;
|
|
3909
|
-
if (typeof _ == "object" && (v = _.attributes, _ = _.name), v =
|
|
3900
|
+
if (typeof _ == "object" && (v = _.attributes, _ = _.name), v = g(v), "elementNameFn" in i && (_ = i.elementNameFn(_, s)), i.compact) {
|
|
3910
3901
|
if (m = {}, !i.ignoreAttributes && v && Object.keys(v).length) {
|
|
3911
3902
|
m[i.attributesKey] = {};
|
|
3912
3903
|
var d;
|
|
@@ -3921,25 +3912,25 @@ function ni() {
|
|
|
3921
3912
|
function S(_) {
|
|
3922
3913
|
i.ignoreText || !_.trim() && !i.captureSpacesBetweenElements || (i.trim && (_ = _.trim()), i.nativeType && (_ = a(_)), i.sanitize && (_ = _.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">")), o("text", _));
|
|
3923
3914
|
}
|
|
3924
|
-
function
|
|
3915
|
+
function T(_) {
|
|
3925
3916
|
i.ignoreComment || (i.trim && (_ = _.trim()), o("comment", _));
|
|
3926
3917
|
}
|
|
3927
|
-
function
|
|
3918
|
+
function F(_) {
|
|
3928
3919
|
var v = s[i.parentKey];
|
|
3929
3920
|
i.addParent || delete s[i.parentKey], s = v;
|
|
3930
3921
|
}
|
|
3931
|
-
function
|
|
3922
|
+
function B(_) {
|
|
3932
3923
|
i.ignoreCdata || (i.trim && (_ = _.trim()), o("cdata", _));
|
|
3933
3924
|
}
|
|
3934
3925
|
function D(_) {
|
|
3935
3926
|
i.ignoreDoctype || (_ = _.replace(/^ /, ""), i.trim && (_ = _.trim()), o("doctype", _));
|
|
3936
3927
|
}
|
|
3937
|
-
function
|
|
3928
|
+
function P(_) {
|
|
3938
3929
|
_.note = _;
|
|
3939
3930
|
}
|
|
3940
3931
|
return pe = function(_, v) {
|
|
3941
3932
|
var m = h.parser(!0, {}), d = {};
|
|
3942
|
-
if (s = d, i = c(v), m.opt = { strictEntities: !0 }, m.onopentag =
|
|
3933
|
+
if (s = d, i = c(v), m.opt = { strictEntities: !0 }, m.onopentag = E, m.ontext = S, m.oncomment = T, m.onclosetag = F, m.onerror = P, m.oncdata = B, m.ondoctype = D, m.onprocessinginstruction = I, m.write(_).close(), d[i.elementsKey]) {
|
|
3943
3934
|
var b = d[i.elementsKey];
|
|
3944
3935
|
delete d[i.elementsKey], d[i.elementsKey] = b, delete d.text;
|
|
3945
3936
|
}
|
|
@@ -3956,9 +3947,9 @@ function Zi() {
|
|
|
3956
3947
|
return h.ensureSpacesExists(s), s;
|
|
3957
3948
|
}
|
|
3958
3949
|
return me = function(i, s) {
|
|
3959
|
-
var c, a, o,
|
|
3960
|
-
return c = e(s), a = t(i, c),
|
|
3961
|
-
return
|
|
3950
|
+
var c, a, o, g;
|
|
3951
|
+
return c = e(s), a = t(i, c), g = "compact" in c && c.compact ? "_parent" : "parent", "addParent" in c && c.addParent ? o = JSON.stringify(a, function(I, E) {
|
|
3952
|
+
return I === g ? "_" : E;
|
|
3962
3953
|
}, c.spaces) : o = JSON.stringify(a, null, c.spaces), o.replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
3963
3954
|
}, me;
|
|
3964
3955
|
}
|
|
@@ -3979,40 +3970,40 @@ function ai() {
|
|
|
3979
3970
|
if (d.ignoreAttributes)
|
|
3980
3971
|
return "";
|
|
3981
3972
|
"attributesFn" in d && (m = d.attributesFn(m, i, e));
|
|
3982
|
-
var
|
|
3983
|
-
for (
|
|
3984
|
-
m.hasOwnProperty(
|
|
3973
|
+
var N, O, R, y, L = [];
|
|
3974
|
+
for (N in m)
|
|
3975
|
+
m.hasOwnProperty(N) && m[N] !== null && m[N] !== void 0 && (y = d.noQuotesForNativeAttributes && typeof m[N] != "string" ? "" : '"', O = "" + m[N], O = O.replace(/"/g, """), R = "attributeNameFn" in d ? d.attributeNameFn(N, O, i, e) : N, L.push(d.spaces && d.indentAttributes ? c(d, b + 1, !1) : " "), L.push(R + "=" + y + ("attributeValueFn" in d ? d.attributeValueFn(O, N, i, e) : O) + y));
|
|
3985
3976
|
return m && Object.keys(m).length && d.spaces && d.indentAttributes && L.push(c(d, b, !1)), L.join("");
|
|
3986
3977
|
}
|
|
3987
3978
|
function o(m, d, b) {
|
|
3988
3979
|
return e = m, i = "xml", d.ignoreDeclaration ? "" : "<?xml" + a(m[d.attributesKey], d, b) + "?>";
|
|
3989
3980
|
}
|
|
3990
|
-
function
|
|
3981
|
+
function g(m, d, b) {
|
|
3991
3982
|
if (d.ignoreInstruction)
|
|
3992
3983
|
return "";
|
|
3993
|
-
var
|
|
3994
|
-
for (
|
|
3995
|
-
if (m.hasOwnProperty(
|
|
3984
|
+
var N;
|
|
3985
|
+
for (N in m)
|
|
3986
|
+
if (m.hasOwnProperty(N))
|
|
3996
3987
|
break;
|
|
3997
|
-
var O = "instructionNameFn" in d ? d.instructionNameFn(
|
|
3998
|
-
if (typeof m[
|
|
3999
|
-
return e = m, i = O, "<?" + O + a(m[
|
|
4000
|
-
var R = m[
|
|
4001
|
-
return "instructionFn" in d && (R = d.instructionFn(R,
|
|
3988
|
+
var O = "instructionNameFn" in d ? d.instructionNameFn(N, m[N], i, e) : N;
|
|
3989
|
+
if (typeof m[N] == "object")
|
|
3990
|
+
return e = m, i = O, "<?" + O + a(m[N][d.attributesKey], d, b) + "?>";
|
|
3991
|
+
var R = m[N] ? m[N] : "";
|
|
3992
|
+
return "instructionFn" in d && (R = d.instructionFn(R, N, i, e)), "<?" + O + (R ? " " + R : "") + "?>";
|
|
4002
3993
|
}
|
|
4003
|
-
function
|
|
3994
|
+
function I(m, d) {
|
|
4004
3995
|
return d.ignoreComment ? "" : "<!--" + ("commentFn" in d ? d.commentFn(m, i, e) : m) + "-->";
|
|
4005
3996
|
}
|
|
4006
|
-
function
|
|
3997
|
+
function E(m, d) {
|
|
4007
3998
|
return d.ignoreCdata ? "" : "<![CDATA[" + ("cdataFn" in d ? d.cdataFn(m, i, e) : m.replace("]]>", "]]]]><![CDATA[>")) + "]]>";
|
|
4008
3999
|
}
|
|
4009
4000
|
function S(m, d) {
|
|
4010
4001
|
return d.ignoreDoctype ? "" : "<!DOCTYPE " + ("doctypeFn" in d ? d.doctypeFn(m, i, e) : m) + ">";
|
|
4011
4002
|
}
|
|
4012
|
-
function
|
|
4003
|
+
function T(m, d) {
|
|
4013
4004
|
return d.ignoreText ? "" : (m = "" + m, m = m.replace(/&/g, "&"), m = m.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"), "textFn" in d ? d.textFn(m, i, e) : m);
|
|
4014
4005
|
}
|
|
4015
|
-
function
|
|
4006
|
+
function F(m, d) {
|
|
4016
4007
|
var b;
|
|
4017
4008
|
if (m.elements && m.elements.length)
|
|
4018
4009
|
for (b = 0; b < m.elements.length; ++b)
|
|
@@ -4021,14 +4012,17 @@ function ai() {
|
|
|
4021
4012
|
if (d.indentText)
|
|
4022
4013
|
return !0;
|
|
4023
4014
|
break;
|
|
4015
|
+
// skip to next key
|
|
4024
4016
|
case "cdata":
|
|
4025
4017
|
if (d.indentCdata)
|
|
4026
4018
|
return !0;
|
|
4027
4019
|
break;
|
|
4020
|
+
// skip to next key
|
|
4028
4021
|
case "instruction":
|
|
4029
4022
|
if (d.indentInstruction)
|
|
4030
4023
|
return !0;
|
|
4031
4024
|
break;
|
|
4025
|
+
// skip to next key
|
|
4032
4026
|
case "doctype":
|
|
4033
4027
|
case "comment":
|
|
4034
4028
|
case "element":
|
|
@@ -4038,54 +4032,58 @@ function ai() {
|
|
|
4038
4032
|
}
|
|
4039
4033
|
return !1;
|
|
4040
4034
|
}
|
|
4041
|
-
function
|
|
4035
|
+
function B(m, d, b) {
|
|
4042
4036
|
e = m, i = m.name;
|
|
4043
|
-
var
|
|
4044
|
-
|
|
4037
|
+
var N = [], O = "elementNameFn" in d ? d.elementNameFn(m.name, m) : m.name;
|
|
4038
|
+
N.push("<" + O), m[d.attributesKey] && N.push(a(m[d.attributesKey], d, b));
|
|
4045
4039
|
var R = m[d.elementsKey] && m[d.elementsKey].length || m[d.attributesKey] && m[d.attributesKey]["xml:space"] === "preserve";
|
|
4046
|
-
return R || ("fullTagEmptyElementFn" in d ? R = d.fullTagEmptyElementFn(m.name, m) : R = d.fullTagEmptyElement), R ? (
|
|
4047
|
-
` + Array(b + 1).join(d.spaces) : ""),
|
|
4040
|
+
return R || ("fullTagEmptyElementFn" in d ? R = d.fullTagEmptyElementFn(m.name, m) : R = d.fullTagEmptyElement), R ? (N.push(">"), m[d.elementsKey] && m[d.elementsKey].length && (N.push(D(m[d.elementsKey], d, b + 1)), e = m, i = m.name), N.push(d.spaces && F(m, d) ? `
|
|
4041
|
+
` + Array(b + 1).join(d.spaces) : ""), N.push("</" + O + ">")) : N.push("/>"), N.join("");
|
|
4048
4042
|
}
|
|
4049
|
-
function D(m, d, b,
|
|
4043
|
+
function D(m, d, b, N) {
|
|
4050
4044
|
return m.reduce(function(O, R) {
|
|
4051
|
-
var
|
|
4045
|
+
var y = c(d, b, N && !O);
|
|
4052
4046
|
switch (R.type) {
|
|
4053
4047
|
case "element":
|
|
4054
|
-
return O +
|
|
4048
|
+
return O + y + B(R, d, b);
|
|
4055
4049
|
case "comment":
|
|
4056
|
-
return O +
|
|
4050
|
+
return O + y + I(R[d.commentKey], d);
|
|
4057
4051
|
case "doctype":
|
|
4058
|
-
return O +
|
|
4052
|
+
return O + y + S(R[d.doctypeKey], d);
|
|
4059
4053
|
case "cdata":
|
|
4060
|
-
return O + (d.indentCdata ?
|
|
4054
|
+
return O + (d.indentCdata ? y : "") + E(R[d.cdataKey], d);
|
|
4061
4055
|
case "text":
|
|
4062
|
-
return O + (d.indentText ?
|
|
4056
|
+
return O + (d.indentText ? y : "") + T(R[d.textKey], d);
|
|
4063
4057
|
case "instruction":
|
|
4064
4058
|
var L = {};
|
|
4065
|
-
return L[R[d.nameKey]] = R[d.attributesKey] ? R : R[d.instructionKey], O + (d.indentInstruction ?
|
|
4059
|
+
return L[R[d.nameKey]] = R[d.attributesKey] ? R : R[d.instructionKey], O + (d.indentInstruction ? y : "") + g(L, d, b);
|
|
4066
4060
|
}
|
|
4067
4061
|
}, "");
|
|
4068
4062
|
}
|
|
4069
|
-
function
|
|
4070
|
-
var
|
|
4071
|
-
for (
|
|
4072
|
-
if (m.hasOwnProperty(
|
|
4073
|
-
switch (
|
|
4063
|
+
function P(m, d, b) {
|
|
4064
|
+
var N;
|
|
4065
|
+
for (N in m)
|
|
4066
|
+
if (m.hasOwnProperty(N))
|
|
4067
|
+
switch (N) {
|
|
4074
4068
|
case d.parentKey:
|
|
4075
4069
|
case d.attributesKey:
|
|
4076
4070
|
break;
|
|
4071
|
+
// skip to next key
|
|
4077
4072
|
case d.textKey:
|
|
4078
4073
|
if (d.indentText || b)
|
|
4079
4074
|
return !0;
|
|
4080
4075
|
break;
|
|
4076
|
+
// skip to next key
|
|
4081
4077
|
case d.cdataKey:
|
|
4082
4078
|
if (d.indentCdata || b)
|
|
4083
4079
|
return !0;
|
|
4084
4080
|
break;
|
|
4081
|
+
// skip to next key
|
|
4085
4082
|
case d.instructionKey:
|
|
4086
4083
|
if (d.indentInstruction || b)
|
|
4087
4084
|
return !0;
|
|
4088
4085
|
break;
|
|
4086
|
+
// skip to next key
|
|
4089
4087
|
case d.doctypeKey:
|
|
4090
4088
|
case d.commentKey:
|
|
4091
4089
|
return !0;
|
|
@@ -4094,55 +4092,56 @@ function ai() {
|
|
|
4094
4092
|
}
|
|
4095
4093
|
return !1;
|
|
4096
4094
|
}
|
|
4097
|
-
function _(m, d, b,
|
|
4095
|
+
function _(m, d, b, N, O) {
|
|
4098
4096
|
e = m, i = d;
|
|
4099
4097
|
var R = "elementNameFn" in b ? b.elementNameFn(d, m) : d;
|
|
4100
4098
|
if (typeof m > "u" || m === null || m === "")
|
|
4101
4099
|
return "fullTagEmptyElementFn" in b && b.fullTagEmptyElementFn(d, m) || b.fullTagEmptyElement ? "<" + R + "></" + R + ">" : "<" + R + "/>";
|
|
4102
|
-
var
|
|
4100
|
+
var y = [];
|
|
4103
4101
|
if (d) {
|
|
4104
|
-
if (
|
|
4105
|
-
return
|
|
4106
|
-
m[b.attributesKey] &&
|
|
4107
|
-
var L =
|
|
4102
|
+
if (y.push("<" + R), typeof m != "object")
|
|
4103
|
+
return y.push(">" + T(m, b) + "</" + R + ">"), y.join("");
|
|
4104
|
+
m[b.attributesKey] && y.push(a(m[b.attributesKey], b, N));
|
|
4105
|
+
var L = P(m, b, !0) || m[b.attributesKey] && m[b.attributesKey]["xml:space"] === "preserve";
|
|
4108
4106
|
if (L || ("fullTagEmptyElementFn" in b ? L = b.fullTagEmptyElementFn(d, m) : L = b.fullTagEmptyElement), L)
|
|
4109
|
-
|
|
4107
|
+
y.push(">");
|
|
4110
4108
|
else
|
|
4111
|
-
return
|
|
4109
|
+
return y.push("/>"), y.join("");
|
|
4112
4110
|
}
|
|
4113
|
-
return
|
|
4111
|
+
return y.push(v(m, b, N + 1, !1)), e = m, i = d, d && y.push((O ? c(b, N, !1) : "") + "</" + R + ">"), y.join("");
|
|
4114
4112
|
}
|
|
4115
|
-
function v(m, d, b,
|
|
4116
|
-
var O, R,
|
|
4113
|
+
function v(m, d, b, N) {
|
|
4114
|
+
var O, R, y, L = [];
|
|
4117
4115
|
for (R in m)
|
|
4118
4116
|
if (m.hasOwnProperty(R))
|
|
4119
|
-
for (
|
|
4117
|
+
for (y = t(m[R]) ? m[R] : [m[R]], O = 0; O < y.length; ++O) {
|
|
4120
4118
|
switch (R) {
|
|
4121
4119
|
case d.declarationKey:
|
|
4122
|
-
L.push(o(
|
|
4120
|
+
L.push(o(y[O], d, b));
|
|
4123
4121
|
break;
|
|
4124
4122
|
case d.instructionKey:
|
|
4125
|
-
L.push((d.indentInstruction ? c(d, b,
|
|
4123
|
+
L.push((d.indentInstruction ? c(d, b, N) : "") + g(y[O], d, b));
|
|
4126
4124
|
break;
|
|
4127
4125
|
case d.attributesKey:
|
|
4128
4126
|
case d.parentKey:
|
|
4129
4127
|
break;
|
|
4128
|
+
// skip
|
|
4130
4129
|
case d.textKey:
|
|
4131
|
-
L.push((d.indentText ? c(d, b,
|
|
4130
|
+
L.push((d.indentText ? c(d, b, N) : "") + T(y[O], d));
|
|
4132
4131
|
break;
|
|
4133
4132
|
case d.cdataKey:
|
|
4134
|
-
L.push((d.indentCdata ? c(d, b,
|
|
4133
|
+
L.push((d.indentCdata ? c(d, b, N) : "") + E(y[O], d));
|
|
4135
4134
|
break;
|
|
4136
4135
|
case d.doctypeKey:
|
|
4137
|
-
L.push(c(d, b,
|
|
4136
|
+
L.push(c(d, b, N) + S(y[O], d));
|
|
4138
4137
|
break;
|
|
4139
4138
|
case d.commentKey:
|
|
4140
|
-
L.push(c(d, b,
|
|
4139
|
+
L.push(c(d, b, N) + I(y[O], d));
|
|
4141
4140
|
break;
|
|
4142
4141
|
default:
|
|
4143
|
-
L.push(c(d, b,
|
|
4142
|
+
L.push(c(d, b, N) + _(y[O], R, d, b, P(y[O], d)));
|
|
4144
4143
|
}
|
|
4145
|
-
|
|
4144
|
+
N = N && !L.length;
|
|
4146
4145
|
}
|
|
4147
4146
|
return L.join("");
|
|
4148
4147
|
}
|
|
@@ -4187,7 +4186,6 @@ var xe = er(), ir = si();
|
|
|
4187
4186
|
const dt = class dt {
|
|
4188
4187
|
constructor(t, e = "", i = "") {
|
|
4189
4188
|
this.xml = t, this.filePath = e, this.basePath = i, this.layers = /* @__PURE__ */ new Map(), this.transform = (s) => {
|
|
4190
|
-
var y, T;
|
|
4191
4189
|
if (!s) return;
|
|
4192
4190
|
const c = s.attributes || s._attributes;
|
|
4193
4191
|
if (!c) return s;
|
|
@@ -4241,45 +4239,45 @@ const dt = class dt {
|
|
|
4241
4239
|
])
|
|
4242
4240
|
};
|
|
4243
4241
|
if (a.properties) {
|
|
4244
|
-
const
|
|
4245
|
-
for (let
|
|
4246
|
-
const
|
|
4247
|
-
if (!
|
|
4248
|
-
let
|
|
4249
|
-
switch (
|
|
4242
|
+
const g = dt.toArray(a.properties.property), I = {};
|
|
4243
|
+
for (let E of g) {
|
|
4244
|
+
const S = E._attributes;
|
|
4245
|
+
if (!S) continue;
|
|
4246
|
+
let T;
|
|
4247
|
+
switch (S.type) {
|
|
4250
4248
|
case "file":
|
|
4251
|
-
|
|
4249
|
+
T = this.getImagePath(S.value);
|
|
4252
4250
|
break;
|
|
4253
4251
|
case "object":
|
|
4254
4252
|
case "float":
|
|
4255
4253
|
case "int":
|
|
4256
|
-
|
|
4254
|
+
T = +S.value;
|
|
4257
4255
|
break;
|
|
4258
4256
|
case "bool":
|
|
4259
|
-
|
|
4257
|
+
T = S.value == "true";
|
|
4260
4258
|
break;
|
|
4261
4259
|
case "class":
|
|
4262
|
-
|
|
4263
|
-
...
|
|
4264
|
-
_classname:
|
|
4260
|
+
T = {
|
|
4261
|
+
...this.transform(E)?.properties ?? {},
|
|
4262
|
+
_classname: S.propertytype
|
|
4265
4263
|
};
|
|
4266
4264
|
break;
|
|
4267
4265
|
default:
|
|
4268
|
-
|
|
4266
|
+
T = S.value;
|
|
4269
4267
|
}
|
|
4270
|
-
S
|
|
4268
|
+
I[S.name] = T;
|
|
4271
4269
|
}
|
|
4272
|
-
a.properties =
|
|
4270
|
+
a.properties = I;
|
|
4273
4271
|
}
|
|
4274
|
-
a.polygon && (a.polygon = this.transform(a.polygon)), a.polyline && (a.polyline = this.transform(a.polyline)), a.points && (a = a.points.split(" ").map((
|
|
4275
|
-
const
|
|
4276
|
-
return { x: +
|
|
4272
|
+
a.polygon && (a.polygon = this.transform(a.polygon)), a.polyline && (a.polyline = this.transform(a.polyline)), a.points && (a = a.points.split(" ").map((g) => {
|
|
4273
|
+
const I = g.split(",");
|
|
4274
|
+
return { x: +I[0], y: +I[1] };
|
|
4277
4275
|
})), a.point && (a.point = !0), a.ellipse && (a.ellipse = !0), a.text && (a.text = {
|
|
4278
4276
|
text: a.text._text,
|
|
4279
4277
|
...this.transform(a.text)
|
|
4280
4278
|
}, delete a.text._text), a.image && (a.image = this.transform(a.image)), a.source && (this.isTilesetSource(a) || (a.source = this.getImagePath(a.source)));
|
|
4281
|
-
const o = a.object ||
|
|
4282
|
-
return o && (a.objects = dt.toArray(o).map((
|
|
4279
|
+
const o = a.object || a.objectgroup?.object;
|
|
4280
|
+
return o && (a.objects = dt.toArray(o).map((g) => this.transform(g))), delete a._attributes, delete a.attributes, delete a.object, delete a.objectgroup, a;
|
|
4283
4281
|
};
|
|
4284
4282
|
}
|
|
4285
4283
|
static toArray(t) {
|
|
@@ -4312,42 +4310,41 @@ const dt = class dt {
|
|
|
4312
4310
|
parseMap() {
|
|
4313
4311
|
const t = xe.xml2js(this.xml, { compact: !0 }), e = xe.xml2js(this.xml), i = t.map.tileset;
|
|
4314
4312
|
t.map.group;
|
|
4315
|
-
const s = (
|
|
4316
|
-
const { objectgroup:
|
|
4317
|
-
D && dt.toArray(D).forEach((
|
|
4318
|
-
if (this.layers.has(+
|
|
4319
|
-
throw new Error(`Tiled Parser Error: Layer with id ${
|
|
4320
|
-
this.layers.set(+
|
|
4313
|
+
const s = (I) => {
|
|
4314
|
+
const { objectgroup: E, group: S, layer: T, imagelayer: F } = I, B = (D) => {
|
|
4315
|
+
D && dt.toArray(D).forEach((P) => {
|
|
4316
|
+
if (this.layers.has(+P._attributes.id))
|
|
4317
|
+
throw new Error(`Tiled Parser Error: Layer with id ${P._attributes.id} already exists`);
|
|
4318
|
+
this.layers.set(+P._attributes.id, P);
|
|
4321
4319
|
});
|
|
4322
4320
|
};
|
|
4323
|
-
|
|
4321
|
+
B(E), B(T), B(S), B(F), S && s(S);
|
|
4324
4322
|
};
|
|
4325
4323
|
s(t.map);
|
|
4326
|
-
const c = (
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
|
|
4334
|
-
const D = {
|
|
4324
|
+
const c = (I, E = []) => {
|
|
4325
|
+
if (!I) return E;
|
|
4326
|
+
for (let S of I) {
|
|
4327
|
+
const { name: T } = S;
|
|
4328
|
+
if (!["layer", "group", "imagelayer", "objectgroup"].includes(T)) continue;
|
|
4329
|
+
const F = S.elements?.find((D) => D.name == "data");
|
|
4330
|
+
S.layer = this.layers.get(+S.attributes.id);
|
|
4331
|
+
const B = {
|
|
4335
4332
|
...this.transform(F) ?? {},
|
|
4336
|
-
...this.transform(
|
|
4337
|
-
...this.transform(
|
|
4338
|
-
layers: c(
|
|
4333
|
+
...this.transform(S),
|
|
4334
|
+
...this.transform(S.layer),
|
|
4335
|
+
layers: c(S.elements),
|
|
4339
4336
|
data: F ? F.elements[0].text : void 0,
|
|
4340
|
-
type:
|
|
4337
|
+
type: T == "layer" ? "tilelayer" : T
|
|
4341
4338
|
};
|
|
4342
|
-
delete
|
|
4339
|
+
delete B.elements, delete B.layer, B.data && (B.data = dt.decode(B, B.width * B.height)), E.push(B);
|
|
4343
4340
|
}
|
|
4344
|
-
return
|
|
4345
|
-
}, a = c(e.elements[0].elements), o = dt.toArray(i).map((
|
|
4341
|
+
return E;
|
|
4342
|
+
}, a = c(e.elements[0].elements), o = dt.toArray(i).map((I) => this.transform(I)), g = {
|
|
4346
4343
|
...this.transform(t.map),
|
|
4347
4344
|
layers: a,
|
|
4348
4345
|
tilesets: o
|
|
4349
4346
|
};
|
|
4350
|
-
return delete
|
|
4347
|
+
return delete g.layer, delete g.tileset, delete g.group, delete g.imagelayer, g;
|
|
4351
4348
|
}
|
|
4352
4349
|
parseTileset() {
|
|
4353
4350
|
const t = xe.xml2js(this.xml, { compact: !0 }), { tileset: e } = t, i = {
|
|
@@ -4373,7 +4370,7 @@ dt.propToNumber = (t, e) => {
|
|
|
4373
4370
|
let ve = dt;
|
|
4374
4371
|
class Ne {
|
|
4375
4372
|
constructor(t) {
|
|
4376
|
-
this.properties = {}, this.properties =
|
|
4373
|
+
this.properties = {}, this.properties = t?.properties ?? {};
|
|
4377
4374
|
}
|
|
4378
4375
|
getProperty(t, e) {
|
|
4379
4376
|
const i = this.properties[t];
|
|
@@ -4392,7 +4389,7 @@ class Ne {
|
|
|
4392
4389
|
const rr = 2147483648, sr = 1073741824, nr = 536870912, ar = 268435456;
|
|
4393
4390
|
class Wt extends Ne {
|
|
4394
4391
|
constructor(t) {
|
|
4395
|
-
super(t), this.obj = t, this._gid = t
|
|
4392
|
+
super(t), this.obj = t, this._gid = t?.gid;
|
|
4396
4393
|
}
|
|
4397
4394
|
static getRealGid(t) {
|
|
4398
4395
|
return t & 268435455;
|
|
@@ -4425,7 +4422,7 @@ let be = class extends Wt {
|
|
|
4425
4422
|
};
|
|
4426
4423
|
class or extends Wt {
|
|
4427
4424
|
constructor(t) {
|
|
4428
|
-
super(t), this.layerName = "", Object.assign(this, t), t
|
|
4425
|
+
super(t), this.layerName = "", Object.assign(this, t), t?.gid && (this.y -= this.height);
|
|
4429
4426
|
}
|
|
4430
4427
|
}
|
|
4431
4428
|
class Pe extends Ne {
|
|
@@ -4551,13 +4548,13 @@ class It {
|
|
|
4551
4548
|
if (!o)
|
|
4552
4549
|
return i(null);
|
|
4553
4550
|
if (s(o)) {
|
|
4554
|
-
const
|
|
4551
|
+
const g = new ve(o, t, this.basePath);
|
|
4555
4552
|
if (e == "map") {
|
|
4556
|
-
const
|
|
4557
|
-
return i(
|
|
4553
|
+
const I = g.parseMap();
|
|
4554
|
+
return i(I);
|
|
4558
4555
|
} else if (e == "tileset") {
|
|
4559
|
-
const
|
|
4560
|
-
return i(
|
|
4556
|
+
const I = g.parseTileset();
|
|
4557
|
+
return i(I);
|
|
4561
4558
|
}
|
|
4562
4559
|
}
|
|
4563
4560
|
return i(JSON.parse(o));
|
|
@@ -4573,7 +4570,7 @@ class It {
|
|
|
4573
4570
|
headers: {
|
|
4574
4571
|
"Content-Type": "application/xml"
|
|
4575
4572
|
}
|
|
4576
|
-
}).then((
|
|
4573
|
+
}).then((g) => g.text()).then(c).catch((g) => i(null, g));
|
|
4577
4574
|
}
|
|
4578
4575
|
}
|
|
4579
4576
|
parseFile(t, e = {}) {
|
|
@@ -4582,23 +4579,23 @@ class It {
|
|
|
4582
4579
|
let o = !1;
|
|
4583
4580
|
if (a) return t(null, a);
|
|
4584
4581
|
if (c.tilesets) {
|
|
4585
|
-
const
|
|
4586
|
-
|
|
4582
|
+
const g = [], I = () => {
|
|
4583
|
+
E++, E == c.tilesets.length && !o && (c.tilesets = g, t(c));
|
|
4587
4584
|
};
|
|
4588
|
-
let
|
|
4585
|
+
let E = 0;
|
|
4589
4586
|
for (let S = 0; S < c.tilesets.length; S++) {
|
|
4590
|
-
const
|
|
4591
|
-
if (!
|
|
4592
|
-
|
|
4587
|
+
const T = c.tilesets[S];
|
|
4588
|
+
if (!T.source || T.tiles || T.image || T.tile) {
|
|
4589
|
+
g[S] = T, I();
|
|
4593
4590
|
continue;
|
|
4594
4591
|
}
|
|
4595
|
-
i && It.typeOfFile(
|
|
4596
|
-
if (
|
|
4597
|
-
return o = !0, t(null,
|
|
4598
|
-
|
|
4599
|
-
...
|
|
4600
|
-
firstgid:
|
|
4601
|
-
},
|
|
4592
|
+
i && It.typeOfFile(T.source).isPath && (T.source = s(T.source)), this._parseFile(T.source, "tileset", (F, B) => {
|
|
4593
|
+
if (B)
|
|
4594
|
+
return o = !0, t(null, B);
|
|
4595
|
+
g[S] = {
|
|
4596
|
+
...F,
|
|
4597
|
+
firstgid: T.firstgid
|
|
4598
|
+
}, I();
|
|
4602
4599
|
});
|
|
4603
4600
|
}
|
|
4604
4601
|
}
|
|
@@ -4615,13 +4612,11 @@ class It {
|
|
|
4615
4612
|
const Ft = {
|
|
4616
4613
|
/** The default number of textures per tilemap in a tilemap composite. */
|
|
4617
4614
|
TEXTURES_PER_TILEMAP: 16,
|
|
4618
|
-
/** The scaling mode of the combined texture tiling. */
|
|
4619
|
-
TEXTILE_SCALE_MODE: "linear",
|
|
4620
4615
|
/** This will enable 32-bit index buffers. It's useful when you have more than 16K tiles. */
|
|
4621
4616
|
use32bitIndex: !1
|
|
4622
4617
|
};
|
|
4623
4618
|
var cr = Object.defineProperty, ur = (h, t, e) => t in h ? cr(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e, Bt = (h, t, e) => (ur(h, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4624
|
-
const
|
|
4619
|
+
const zt = class qt extends ti {
|
|
4625
4620
|
constructor(t) {
|
|
4626
4621
|
const e = new Se({
|
|
4627
4622
|
data: new Float32Array(2),
|
|
@@ -4643,52 +4638,52 @@ const jt = class qt extends ti {
|
|
|
4643
4638
|
buffer: e,
|
|
4644
4639
|
format: "float32x2",
|
|
4645
4640
|
stride: i,
|
|
4646
|
-
offset:
|
|
4641
|
+
offset: 8
|
|
4647
4642
|
// location: 4,
|
|
4648
4643
|
},
|
|
4649
4644
|
aFrame: {
|
|
4650
4645
|
buffer: e,
|
|
4651
4646
|
format: "float32x4",
|
|
4652
4647
|
stride: i,
|
|
4653
|
-
offset:
|
|
4648
|
+
offset: 16
|
|
4654
4649
|
// location: 3,
|
|
4655
4650
|
},
|
|
4656
4651
|
aAnim: {
|
|
4657
4652
|
buffer: e,
|
|
4658
4653
|
format: "float32x2",
|
|
4659
4654
|
stride: i,
|
|
4660
|
-
offset:
|
|
4655
|
+
offset: 32
|
|
4661
4656
|
// location: 1,
|
|
4662
4657
|
},
|
|
4663
4658
|
aTextureId: {
|
|
4664
4659
|
buffer: e,
|
|
4665
4660
|
format: "sint32",
|
|
4666
4661
|
stride: i,
|
|
4667
|
-
offset:
|
|
4662
|
+
offset: 40
|
|
4668
4663
|
// location: 5
|
|
4669
4664
|
},
|
|
4670
4665
|
aAnimDivisor: {
|
|
4671
4666
|
buffer: e,
|
|
4672
4667
|
format: "float32",
|
|
4673
4668
|
stride: i,
|
|
4674
|
-
offset:
|
|
4669
|
+
offset: 44
|
|
4675
4670
|
// location: 2
|
|
4676
4671
|
},
|
|
4677
4672
|
aAlpha: {
|
|
4678
4673
|
buffer: e,
|
|
4679
4674
|
format: "float32",
|
|
4680
4675
|
stride: i,
|
|
4681
|
-
offset:
|
|
4676
|
+
offset: 48
|
|
4682
4677
|
// location: 0
|
|
4683
4678
|
}
|
|
4684
4679
|
}
|
|
4685
4680
|
}), Bt(this, "lastTimeAccess", 0), Bt(this, "vertSize", qt.vertSize), Bt(this, "vertPerQuad", qt.vertPerQuad), Bt(this, "stride", qt.stride), Bt(this, "buf"), this.buf = e;
|
|
4686
4681
|
}
|
|
4687
4682
|
};
|
|
4688
|
-
Bt(
|
|
4689
|
-
Bt(
|
|
4690
|
-
Bt(
|
|
4691
|
-
let hr =
|
|
4683
|
+
Bt(zt, "vertSize", 13);
|
|
4684
|
+
Bt(zt, "vertPerQuad", 4);
|
|
4685
|
+
Bt(zt, "stride", zt.vertSize * 4);
|
|
4686
|
+
let hr = zt;
|
|
4692
4687
|
var fr = Object.defineProperty, dr = (h, t, e) => t in h ? fr(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e, Mt = (h, t, e) => (dr(h, typeof t != "symbol" ? t + "" : t, e), e);
|
|
4693
4688
|
class oi {
|
|
4694
4689
|
constructor() {
|
|
@@ -5093,7 +5088,6 @@ class Je extends Si {
|
|
|
5093
5088
|
* be wrapped into an array. This should not contain any duplicates.
|
|
5094
5089
|
*/
|
|
5095
5090
|
setTileset(t = []) {
|
|
5096
|
-
var i, s;
|
|
5097
5091
|
let e = this.tileset;
|
|
5098
5092
|
if (t instanceof Pt)
|
|
5099
5093
|
this.tileset = t, this.didViewUpdate = !0;
|
|
@@ -5103,18 +5097,18 @@ class Je extends Si {
|
|
|
5103
5097
|
e = this.tileset = new Pt(Ft.TEXTURES_PER_TILEMAP), e.push(t), this.didViewUpdate = !0;
|
|
5104
5098
|
} else {
|
|
5105
5099
|
if (t.length === e.count) {
|
|
5106
|
-
let
|
|
5107
|
-
for (let
|
|
5108
|
-
if (
|
|
5109
|
-
|
|
5100
|
+
let i = !0;
|
|
5101
|
+
for (let s = 0; s < t.length; s++)
|
|
5102
|
+
if (t[s]?.source !== e.arr[s]) {
|
|
5103
|
+
i = !1;
|
|
5110
5104
|
break;
|
|
5111
5105
|
}
|
|
5112
|
-
if (
|
|
5106
|
+
if (i)
|
|
5113
5107
|
return this;
|
|
5114
5108
|
}
|
|
5115
5109
|
e = this.tileset = new Pt(Ft.TEXTURES_PER_TILEMAP);
|
|
5116
|
-
for (let
|
|
5117
|
-
e.push(
|
|
5110
|
+
for (let i = 0; i < t.length; i++)
|
|
5111
|
+
e.push(t[i]?.source);
|
|
5118
5112
|
this.didViewUpdate = !0;
|
|
5119
5113
|
}
|
|
5120
5114
|
return this;
|
|
@@ -5156,9 +5150,9 @@ class Je extends Si {
|
|
|
5156
5150
|
let d;
|
|
5157
5151
|
typeof t == "string" ? d = ie.from(t) : d = t;
|
|
5158
5152
|
const b = this.tileset;
|
|
5159
|
-
for (let
|
|
5160
|
-
if (b.arr[
|
|
5161
|
-
a =
|
|
5153
|
+
for (let N = 0; N < b.count; N++)
|
|
5154
|
+
if (b.arr[N] === d.source) {
|
|
5155
|
+
a = N;
|
|
5162
5156
|
break;
|
|
5163
5157
|
}
|
|
5164
5158
|
"frame" in d && (s.u = s.u ?? d.frame.x, s.v = s.v ?? d.frame.y, s.tileWidth = s.tileWidth ?? d.orig.width, s.tileHeight = s.tileHeight ?? d.orig.height), c = d.source;
|
|
@@ -5166,19 +5160,19 @@ class Je extends Si {
|
|
|
5166
5160
|
if (!o && !c)
|
|
5167
5161
|
return console.error("The tile texture was not found in the tilemap tileset."), this;
|
|
5168
5162
|
const {
|
|
5169
|
-
u:
|
|
5170
|
-
v:
|
|
5171
|
-
tileWidth:
|
|
5163
|
+
u: g = 0,
|
|
5164
|
+
v: I = 0,
|
|
5165
|
+
tileWidth: E = c.width,
|
|
5172
5166
|
tileHeight: S = c.height,
|
|
5173
|
-
animX:
|
|
5174
|
-
animY:
|
|
5175
|
-
rotate:
|
|
5167
|
+
animX: T = 0,
|
|
5168
|
+
animY: F = 0,
|
|
5169
|
+
rotate: B = 0,
|
|
5176
5170
|
animCountX: D = 1024,
|
|
5177
|
-
animCountY:
|
|
5171
|
+
animCountY: P = 1024,
|
|
5178
5172
|
animDivisor: _ = 1,
|
|
5179
5173
|
alpha: v = 1
|
|
5180
5174
|
} = s, m = this.pointsBuf;
|
|
5181
|
-
return this.hasAnimatedTile = this.hasAnimatedTile ||
|
|
5175
|
+
return this.hasAnimatedTile = this.hasAnimatedTile || T > 0 || F > 0, m.push(g), m.push(I), m.push(e), m.push(i), m.push(E), m.push(S), m.push(B), m.push(T | 0), m.push(F | 0), m.push(a), m.push(D), m.push(P), m.push(_), m.push(v), this.tilemapBounds.addFrame(e, i, e + E, i + S), this;
|
|
5182
5176
|
}
|
|
5183
5177
|
/** Changes the rotation of the last tile. */
|
|
5184
5178
|
tileRotate(t) {
|
|
@@ -5217,72 +5211,72 @@ class Je extends Si {
|
|
|
5217
5211
|
t.checkIndexBuffer(i);
|
|
5218
5212
|
const a = s.getBuffer("aVertexPosition"), o = s.stride * c;
|
|
5219
5213
|
if (!this.vbBuffer || this.vbBuffer.byteLength < o) {
|
|
5220
|
-
let
|
|
5221
|
-
for (;
|
|
5222
|
-
|
|
5223
|
-
this.vbBuffer = new ArrayBuffer(
|
|
5224
|
-
}
|
|
5225
|
-
const
|
|
5226
|
-
let
|
|
5227
|
-
for (let
|
|
5214
|
+
let T = s.stride;
|
|
5215
|
+
for (; T < o; )
|
|
5216
|
+
T *= 2;
|
|
5217
|
+
this.vbBuffer = new ArrayBuffer(T), this.vbArray = new Float32Array(this.vbBuffer), this.vbInts = new Uint32Array(this.vbBuffer);
|
|
5218
|
+
}
|
|
5219
|
+
const g = this.vbArray, I = this.vbInts;
|
|
5220
|
+
let E = 0, S = 0;
|
|
5221
|
+
for (let T = 0; T < e.length; T += xt) {
|
|
5228
5222
|
this.compositeParent && (S = e[
|
|
5229
|
-
|
|
5223
|
+
T + 9
|
|
5230
5224
|
/* TEXTURE_INDEX */
|
|
5231
5225
|
]);
|
|
5232
|
-
const
|
|
5233
|
-
|
|
5226
|
+
const B = e[
|
|
5227
|
+
T + 2
|
|
5234
5228
|
/* X */
|
|
5235
5229
|
], D = e[
|
|
5236
|
-
|
|
5230
|
+
T + 3
|
|
5237
5231
|
/* Y */
|
|
5238
|
-
],
|
|
5239
|
-
|
|
5232
|
+
], P = e[
|
|
5233
|
+
T + 4
|
|
5240
5234
|
/* TILE_WIDTH */
|
|
5241
5235
|
], _ = e[
|
|
5242
|
-
|
|
5236
|
+
T + 5
|
|
5243
5237
|
/* TILE_HEIGHT */
|
|
5244
5238
|
], v = e[
|
|
5245
|
-
|
|
5239
|
+
T + 0
|
|
5246
5240
|
/* U */
|
|
5247
5241
|
], m = e[
|
|
5248
|
-
|
|
5242
|
+
T + 1
|
|
5249
5243
|
/* V */
|
|
5250
5244
|
];
|
|
5251
5245
|
let d = e[
|
|
5252
|
-
|
|
5246
|
+
T + 6
|
|
5253
5247
|
/* ROTATE */
|
|
5254
5248
|
];
|
|
5255
5249
|
const b = e[
|
|
5256
|
-
|
|
5250
|
+
T + 7
|
|
5257
5251
|
/* ANIM_X */
|
|
5258
|
-
],
|
|
5259
|
-
|
|
5252
|
+
], N = e[
|
|
5253
|
+
T + 8
|
|
5260
5254
|
/* ANIM_Y */
|
|
5261
5255
|
], O = e[
|
|
5262
|
-
|
|
5256
|
+
T + 10
|
|
5263
5257
|
/* ANIM_COUNT_X */
|
|
5264
5258
|
] || 1024, R = e[
|
|
5265
|
-
|
|
5259
|
+
T + 11
|
|
5266
5260
|
/* ANIM_COUNT_Y */
|
|
5267
|
-
] || 1024,
|
|
5268
|
-
|
|
5261
|
+
] || 1024, y = b + O * 2048, L = N + R * 2048, it = e[
|
|
5262
|
+
T + 12
|
|
5269
5263
|
/* ANIM_DIVISOR */
|
|
5270
5264
|
], V = e[
|
|
5271
|
-
|
|
5265
|
+
T + 13
|
|
5272
5266
|
/* ALPHA */
|
|
5273
5267
|
];
|
|
5274
|
-
let K, lt, at, ut,
|
|
5268
|
+
let K, lt, at, ut, k, rt, W, tt;
|
|
5275
5269
|
if (d === 0)
|
|
5276
|
-
K = v, lt = m, at = v +
|
|
5270
|
+
K = v, lt = m, at = v + P, ut = m, k = v + P, rt = m + _, W = v, tt = m + _;
|
|
5277
5271
|
else {
|
|
5278
|
-
let
|
|
5279
|
-
d % 4 !== 0 && (
|
|
5280
|
-
const At = v +
|
|
5281
|
-
d = ot.add(d, ot.NW), K = At +
|
|
5272
|
+
let U = P / 2, $ = _ / 2;
|
|
5273
|
+
d % 4 !== 0 && (U = _ / 2, $ = P / 2);
|
|
5274
|
+
const At = v + U, Et = m + $;
|
|
5275
|
+
d = ot.add(d, ot.NW), K = At + U * ot.uX(d), lt = Et + $ * ot.uY(d), d = ot.add(d, 2), at = At + U * ot.uX(d), ut = Et + $ * ot.uY(d), d = ot.add(d, 2), k = At + U * ot.uX(d), rt = Et + $ * ot.uY(d), d = ot.add(d, 2), W = At + U * ot.uX(d), tt = Et + $ * ot.uY(d);
|
|
5282
5276
|
}
|
|
5283
|
-
|
|
5277
|
+
g[E++] = B, g[E++] = D, g[E++] = K, g[E++] = lt, g[E++] = v + 0.5, g[E++] = m + 0.5, g[E++] = v + P - 0.5, g[E++] = m + _ - 0.5, g[E++] = y, g[E++] = L, I[E++] = S, g[E++] = it, g[E++] = V, g[E++] = B + P, g[E++] = D, g[E++] = at, g[E++] = ut, g[E++] = v + 0.5, g[E++] = m + 0.5, g[E++] = v + P - 0.5, g[E++] = m + _ - 0.5, g[E++] = y, g[E++] = L, I[E++] = S, g[E++] = it, g[E++] = V, g[E++] = B + P, g[E++] = D + _, g[E++] = k, g[E++] = rt, g[E++] = v + 0.5, g[E++] = m + 0.5, g[E++] = v + P - 0.5, g[E++] = m + _ - 0.5, g[E++] = y, g[E++] = L, I[E++] = S, g[E++] = it, g[E++] = V, g[E++] = B, g[E++] = D + _, g[E++] = W, g[E++] = tt, g[E++] = v + 0.5, g[E++] = m + 0.5, g[E++] = v + P - 0.5, g[E++] = m + _ - 0.5, g[E++] = y, g[E++] = L, I[E++] = S, g[E++] = it, g[E++] = V;
|
|
5284
5278
|
}
|
|
5285
|
-
a.data =
|
|
5279
|
+
a.data = g;
|
|
5286
5280
|
}
|
|
5287
5281
|
/**
|
|
5288
5282
|
* @internal
|
|
@@ -5333,7 +5327,7 @@ class Je extends Si {
|
|
|
5333
5327
|
* @deprecated Since @pixi/tilemap 3.
|
|
5334
5328
|
*/
|
|
5335
5329
|
// eslint-disable-next-line max-params
|
|
5336
|
-
addRect(t, e, i, s, c, a, o,
|
|
5330
|
+
addRect(t, e, i, s, c, a, o, g = 0, I = 0, E = 0, S = 1024, T = 1024, F = 1, B = 1) {
|
|
5337
5331
|
return this.tile(
|
|
5338
5332
|
t,
|
|
5339
5333
|
s,
|
|
@@ -5343,13 +5337,13 @@ class Je extends Si {
|
|
|
5343
5337
|
v: i,
|
|
5344
5338
|
tileWidth: a,
|
|
5345
5339
|
tileHeight: o,
|
|
5346
|
-
animX:
|
|
5347
|
-
animY:
|
|
5348
|
-
rotate:
|
|
5340
|
+
animX: g,
|
|
5341
|
+
animY: I,
|
|
5342
|
+
rotate: E,
|
|
5349
5343
|
animCountX: S,
|
|
5350
|
-
animCountY:
|
|
5351
|
-
animDivisor:
|
|
5352
|
-
alpha:
|
|
5344
|
+
animCountY: T,
|
|
5345
|
+
animDivisor: F,
|
|
5346
|
+
alpha: B
|
|
5353
5347
|
}
|
|
5354
5348
|
);
|
|
5355
5349
|
}
|
|
@@ -5437,16 +5431,16 @@ class Mr extends Fi {
|
|
|
5437
5431
|
const a = this.children;
|
|
5438
5432
|
if (this.lastModifiedTilemap = null, typeof t == "number") {
|
|
5439
5433
|
const o = t / this.texturesPerTilemap >> 0;
|
|
5440
|
-
let
|
|
5434
|
+
let g = 0;
|
|
5441
5435
|
if (c = a[o], c)
|
|
5442
|
-
|
|
5436
|
+
g = t % this.texturesPerTilemap;
|
|
5443
5437
|
else {
|
|
5444
5438
|
if (c = a[0], !c)
|
|
5445
5439
|
return this;
|
|
5446
|
-
|
|
5440
|
+
g = 0;
|
|
5447
5441
|
}
|
|
5448
5442
|
c.tile(
|
|
5449
|
-
|
|
5443
|
+
g,
|
|
5450
5444
|
e,
|
|
5451
5445
|
i,
|
|
5452
5446
|
s
|
|
@@ -5454,10 +5448,10 @@ class Mr extends Fi {
|
|
|
5454
5448
|
} else {
|
|
5455
5449
|
typeof t == "string" && (t = ie.from(t));
|
|
5456
5450
|
for (let o = 0; o < a.length; o++) {
|
|
5457
|
-
const
|
|
5458
|
-
for (let
|
|
5459
|
-
if (
|
|
5460
|
-
c =
|
|
5451
|
+
const g = a[o], I = g.getTileset().arr;
|
|
5452
|
+
for (let E = 0; E < I.length; E++)
|
|
5453
|
+
if (I[E] === t.source) {
|
|
5454
|
+
c = g;
|
|
5461
5455
|
break;
|
|
5462
5456
|
}
|
|
5463
5457
|
if (c)
|
|
@@ -5465,9 +5459,9 @@ class Mr extends Fi {
|
|
|
5465
5459
|
}
|
|
5466
5460
|
if (!c) {
|
|
5467
5461
|
for (let o = a.length - 1; o >= 0; o--) {
|
|
5468
|
-
const
|
|
5469
|
-
if (
|
|
5470
|
-
c =
|
|
5462
|
+
const g = a[o];
|
|
5463
|
+
if (g.getTileset().count < this.texturesPerTilemap) {
|
|
5464
|
+
c = g, g.getTileset().push(t.source);
|
|
5471
5465
|
break;
|
|
5472
5466
|
}
|
|
5473
5467
|
}
|
|
@@ -5509,7 +5503,7 @@ class Mr extends Fi {
|
|
|
5509
5503
|
* @deprecated Since @pixi/tilemap 3.
|
|
5510
5504
|
* @see CompositeTilemap.tile
|
|
5511
5505
|
*/
|
|
5512
|
-
addFrame(t, e, i, s, c, a, o,
|
|
5506
|
+
addFrame(t, e, i, s, c, a, o, g, I) {
|
|
5513
5507
|
return this.tile(
|
|
5514
5508
|
t,
|
|
5515
5509
|
e,
|
|
@@ -5519,8 +5513,8 @@ class Mr extends Fi {
|
|
|
5519
5513
|
animY: c,
|
|
5520
5514
|
animCountX: a,
|
|
5521
5515
|
animCountY: o,
|
|
5522
|
-
animDivisor:
|
|
5523
|
-
alpha:
|
|
5516
|
+
animDivisor: g,
|
|
5517
|
+
alpha: I
|
|
5524
5518
|
}
|
|
5525
5519
|
);
|
|
5526
5520
|
}
|
|
@@ -5529,21 +5523,21 @@ class Mr extends Fi {
|
|
|
5529
5523
|
* @see CompositeTilemap.tile
|
|
5530
5524
|
*/
|
|
5531
5525
|
// eslint-disable-next-line max-params
|
|
5532
|
-
addRect(t, e, i, s, c, a, o,
|
|
5533
|
-
const
|
|
5534
|
-
return this.children[
|
|
5535
|
-
|
|
5526
|
+
addRect(t, e, i, s, c, a, o, g, I, E, S, T) {
|
|
5527
|
+
const F = t / this.texturesPerTilemap >> 0, B = t % this.texturesPerTilemap;
|
|
5528
|
+
return this.children[F] && this.children[F].getTileset().count > 0 ? (this.lastModifiedTilemap = this.children[F], this.lastModifiedTilemap.addRect(
|
|
5529
|
+
B,
|
|
5536
5530
|
e,
|
|
5537
5531
|
i,
|
|
5538
5532
|
s,
|
|
5539
5533
|
c,
|
|
5540
5534
|
a,
|
|
5541
5535
|
o,
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5536
|
+
g,
|
|
5537
|
+
I,
|
|
5538
|
+
E,
|
|
5545
5539
|
S,
|
|
5546
|
-
|
|
5540
|
+
T
|
|
5547
5541
|
)) : this.lastModifiedTilemap = null, this;
|
|
5548
5542
|
}
|
|
5549
5543
|
/**
|
|
@@ -5602,15 +5596,15 @@ class Oe extends yi(Mr) {
|
|
|
5602
5596
|
}
|
|
5603
5597
|
/** @internal */
|
|
5604
5598
|
createTile(t, e, i = {}) {
|
|
5605
|
-
const { real: s, filter: c } = i, { tilewidth: a, tileheight: o, width:
|
|
5599
|
+
const { real: s, filter: c } = i, { tilewidth: a, tileheight: o, width: g } = this._layer;
|
|
5606
5600
|
s && (t = Math.floor(t / a), e = Math.floor(e / o));
|
|
5607
|
-
const
|
|
5608
|
-
if (!
|
|
5609
|
-
const S = Oe.findTileSet(
|
|
5601
|
+
const I = t + e * g, E = this._layer.getTileByIndex(I);
|
|
5602
|
+
if (!E || E && E.gid == 0) return;
|
|
5603
|
+
const S = Oe.findTileSet(E.gid, this.tileSets);
|
|
5610
5604
|
if (!S) return;
|
|
5611
|
-
const
|
|
5612
|
-
if (
|
|
5613
|
-
return
|
|
5605
|
+
const T = new te(E, S);
|
|
5606
|
+
if (T.x = t * a, T.y = e * o + (o - T.texture.height), T._x = t, T._y = e, S.tileoffset && (T.x += S.tileoffset.x ?? 0, T.y += S.tileoffset.y ?? 0), !(c && !c(T)))
|
|
5607
|
+
return T;
|
|
5614
5608
|
}
|
|
5615
5609
|
_addFrame(t, e, i) {
|
|
5616
5610
|
const s = this.tile(t.texture, t.x, t.y, {
|
|
@@ -5670,69 +5664,67 @@ class Fr extends lr {
|
|
|
5670
5664
|
}
|
|
5671
5665
|
}
|
|
5672
5666
|
function Dr(h, t, e) {
|
|
5673
|
-
var s, c;
|
|
5674
5667
|
const i = [];
|
|
5675
|
-
for (const
|
|
5676
|
-
if (
|
|
5677
|
-
i.push(
|
|
5668
|
+
for (const s of h) {
|
|
5669
|
+
if (s.type !== Ut.Tile) {
|
|
5670
|
+
i.push(s);
|
|
5678
5671
|
continue;
|
|
5679
5672
|
}
|
|
5680
|
-
const
|
|
5681
|
-
let
|
|
5682
|
-
if (Array.isArray(
|
|
5683
|
-
|
|
5673
|
+
const c = /* @__PURE__ */ new Map();
|
|
5674
|
+
let a;
|
|
5675
|
+
if (Array.isArray(s.data))
|
|
5676
|
+
a = s.data.map((g) => typeof g == "number" ? g : parseInt(String(g), 10));
|
|
5684
5677
|
else {
|
|
5685
|
-
i.push(
|
|
5678
|
+
i.push(s);
|
|
5686
5679
|
continue;
|
|
5687
5680
|
}
|
|
5688
|
-
for (let
|
|
5689
|
-
const
|
|
5690
|
-
if (
|
|
5691
|
-
let
|
|
5692
|
-
for (let
|
|
5693
|
-
if (t[
|
|
5694
|
-
|
|
5681
|
+
for (let g = 0; g < a.length; g++) {
|
|
5682
|
+
const I = a[g];
|
|
5683
|
+
if (I === 0) continue;
|
|
5684
|
+
let E;
|
|
5685
|
+
for (let B = t.length - 1; B >= 0; B--)
|
|
5686
|
+
if (t[B].firstgid && t[B].firstgid <= I) {
|
|
5687
|
+
E = t[B];
|
|
5695
5688
|
break;
|
|
5696
5689
|
}
|
|
5697
|
-
if (!
|
|
5698
|
-
|
|
5690
|
+
if (!E) {
|
|
5691
|
+
c.has(0) || c.set(0, new Array(a.length).fill(0)), c.get(0)[g] = I;
|
|
5699
5692
|
continue;
|
|
5700
5693
|
}
|
|
5701
|
-
const
|
|
5702
|
-
|
|
5703
|
-
}
|
|
5704
|
-
const
|
|
5705
|
-
for (const
|
|
5706
|
-
const
|
|
5707
|
-
if (
|
|
5708
|
-
const
|
|
5709
|
-
...
|
|
5710
|
-
name: `${
|
|
5694
|
+
const S = I - E.firstgid, T = E.tileset.tiles?.[S]?.properties, F = T?.z ?? 0;
|
|
5695
|
+
T?.z, c.has(F) || c.set(F, new Array(a.length).fill(0)), c.get(F)[g] = I;
|
|
5696
|
+
}
|
|
5697
|
+
const o = Array.from(c.keys()).sort((g, I) => g - I);
|
|
5698
|
+
for (const g of o) {
|
|
5699
|
+
const I = c.get(g);
|
|
5700
|
+
if (I.some((E) => E !== 0)) {
|
|
5701
|
+
const E = {
|
|
5702
|
+
...s,
|
|
5703
|
+
name: `${s.name}_z${g}`,
|
|
5711
5704
|
// Always add _z suffix
|
|
5712
|
-
data:
|
|
5705
|
+
data: I,
|
|
5713
5706
|
properties: {
|
|
5714
|
-
...
|
|
5715
|
-
z:
|
|
5707
|
+
...s.properties,
|
|
5708
|
+
z: g
|
|
5716
5709
|
}
|
|
5717
5710
|
};
|
|
5718
|
-
i.push(
|
|
5711
|
+
i.push(E);
|
|
5719
5712
|
}
|
|
5720
5713
|
}
|
|
5721
5714
|
}
|
|
5722
|
-
return i.sort((
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
return y - T;
|
|
5715
|
+
return i.sort((s, c) => {
|
|
5716
|
+
const a = s.properties?.z ?? 0.5, o = c.properties?.z ?? 0.5;
|
|
5717
|
+
return a - o;
|
|
5726
5718
|
}), i;
|
|
5727
5719
|
}
|
|
5728
|
-
function
|
|
5720
|
+
function zr(h) {
|
|
5729
5721
|
const { map: t, basePath: e, createLayersPerTilesZ: i } = Lt(h, {
|
|
5730
5722
|
createLayersPerTilesZ: !1,
|
|
5731
5723
|
basePath: ""
|
|
5732
|
-
}), s =
|
|
5724
|
+
}), s = z([]), c = h.objectLayer;
|
|
5733
5725
|
let a = [], o = {};
|
|
5734
|
-
const
|
|
5735
|
-
|
|
5726
|
+
const g = async (E, S = "") => typeof E != "string" ? E : await new It(
|
|
5727
|
+
E,
|
|
5736
5728
|
{
|
|
5737
5729
|
basePath: S
|
|
5738
5730
|
}
|
|
@@ -5740,17 +5732,17 @@ function jr(h) {
|
|
|
5740
5732
|
getOnlyBasename: !1
|
|
5741
5733
|
});
|
|
5742
5734
|
Ze(async () => {
|
|
5743
|
-
const
|
|
5744
|
-
if (
|
|
5745
|
-
o = await
|
|
5746
|
-
for (let
|
|
5747
|
-
|
|
5735
|
+
const E = t();
|
|
5736
|
+
if (E) {
|
|
5737
|
+
o = await g(E, e()), a = [];
|
|
5738
|
+
for (let T of o.tilesets)
|
|
5739
|
+
T.tile && (T.tiles = T.tile), T.tiles || (T.tiles = []), a.push(await new Fr(T).load(T.image.source));
|
|
5748
5740
|
let S = o.layers;
|
|
5749
5741
|
i() && (S = Dr(o.layers, a)), s.set(S);
|
|
5750
5742
|
}
|
|
5751
5743
|
});
|
|
5752
|
-
const
|
|
5753
|
-
switch (
|
|
5744
|
+
const I = (E, S = {}) => ft(Dt, S, wi(E, (T) => {
|
|
5745
|
+
switch (T.type) {
|
|
5754
5746
|
case Ut.Tile:
|
|
5755
5747
|
return ft(Br, {
|
|
5756
5748
|
tilewidth: o.tilewidth,
|
|
@@ -5759,27 +5751,27 @@ function jr(h) {
|
|
|
5759
5751
|
width: o.width,
|
|
5760
5752
|
// @ts-ignore
|
|
5761
5753
|
height: o.height,
|
|
5762
|
-
...
|
|
5754
|
+
...T,
|
|
5763
5755
|
tilesets: a
|
|
5764
5756
|
});
|
|
5765
5757
|
case Ut.Image:
|
|
5766
|
-
const { width:
|
|
5758
|
+
const { width: F, height: B, source: D } = T.image;
|
|
5767
5759
|
return ft(vi, {
|
|
5768
5760
|
image: D,
|
|
5769
|
-
...
|
|
5770
|
-
width:
|
|
5771
|
-
height:
|
|
5761
|
+
...T,
|
|
5762
|
+
width: T.repeatx ? T.width * T.tilewidth : F,
|
|
5763
|
+
height: T.repeaty ? T.height * T.tileheight : B
|
|
5772
5764
|
});
|
|
5773
5765
|
case Ut.Group:
|
|
5774
|
-
return
|
|
5766
|
+
return I(z(T.layers), T);
|
|
5775
5767
|
case Ut.ObjectGroup:
|
|
5776
|
-
const
|
|
5777
|
-
return ft(Dt,
|
|
5768
|
+
const P = c?.(T);
|
|
5769
|
+
return ft(Dt, T, P);
|
|
5778
5770
|
default:
|
|
5779
5771
|
return ft(Dt);
|
|
5780
5772
|
}
|
|
5781
5773
|
}));
|
|
5782
|
-
return ft(Dt, h,
|
|
5774
|
+
return ft(Dt, h, I(s));
|
|
5783
5775
|
}
|
|
5784
5776
|
function Nr() {
|
|
5785
5777
|
const h = (
|
|
@@ -6210,60 +6202,60 @@ function Or() {
|
|
|
6210
6202
|
}
|
|
6211
6203
|
const Rr = (h) => {
|
|
6212
6204
|
const {
|
|
6213
|
-
effect: t =
|
|
6214
|
-
speed: e =
|
|
6215
|
-
windDirection: i =
|
|
6216
|
-
windStrength: s =
|
|
6217
|
-
density: c =
|
|
6205
|
+
effect: t = z("rain"),
|
|
6206
|
+
speed: e = z(0.5),
|
|
6207
|
+
windDirection: i = z(0),
|
|
6208
|
+
windStrength: s = z(0.2),
|
|
6209
|
+
density: c = z(120),
|
|
6218
6210
|
// Reduced default density for better performance
|
|
6219
|
-
maxDrops: a =
|
|
6211
|
+
maxDrops: a = z(80),
|
|
6220
6212
|
// Reduced default maxDrops for better performance
|
|
6221
|
-
height: o =
|
|
6213
|
+
height: o = z(0.2),
|
|
6222
6214
|
// Fog height parameter (0 = bottom, 1 = top)
|
|
6223
|
-
scale:
|
|
6215
|
+
scale: g = z(2),
|
|
6224
6216
|
// Fog noise scale parameter
|
|
6225
|
-
resolution:
|
|
6226
|
-
} = Lt(h),
|
|
6217
|
+
resolution: I
|
|
6218
|
+
} = Lt(h), E = z([1e3, 1e3]), S = I ? typeof I == "function" ? I : z(I) : E;
|
|
6227
6219
|
Te((ut) => {
|
|
6228
|
-
const
|
|
6229
|
-
|
|
6230
|
-
const rt =
|
|
6231
|
-
rt && rt.width > 0 && rt.height > 0 &&
|
|
6220
|
+
const k = ut.props.context;
|
|
6221
|
+
k?.canvasSize && t(() => {
|
|
6222
|
+
const rt = k.canvasSize();
|
|
6223
|
+
rt && rt.width > 0 && rt.height > 0 && E.set([rt.width, rt.height]);
|
|
6232
6224
|
});
|
|
6233
6225
|
});
|
|
6234
|
-
const
|
|
6226
|
+
const T = typeof e == "function" ? e : z(e), F = typeof i == "function" ? i : z(i), B = typeof s == "function" ? s : z(s), D = typeof c == "function" ? c : z(c), P = typeof a == "function" ? a : z(a), _ = typeof o == "function" ? o : z(o), v = typeof g == "function" ? g : z(g);
|
|
6235
6227
|
let m, d;
|
|
6236
6228
|
if (t() === "rain")
|
|
6237
6229
|
m = Nr(), d = {
|
|
6238
6230
|
uTime: { value: 0, type: "f32" },
|
|
6239
6231
|
uResolution: { value: S(), type: "vec2<f32>" },
|
|
6240
|
-
uRainSpeed: { value:
|
|
6241
|
-
uWindDirection: { value:
|
|
6242
|
-
uWindStrength: { value:
|
|
6232
|
+
uRainSpeed: { value: T(), type: "f32" },
|
|
6233
|
+
uWindDirection: { value: F(), type: "f32" },
|
|
6234
|
+
uWindStrength: { value: B(), type: "f32" },
|
|
6243
6235
|
uRainDensity: { value: D(), type: "f32" },
|
|
6244
|
-
uMaxDrops: { value:
|
|
6236
|
+
uMaxDrops: { value: P(), type: "f32" }
|
|
6245
6237
|
};
|
|
6246
6238
|
else if (t() === "snow")
|
|
6247
6239
|
m = Pr(), d = {
|
|
6248
6240
|
uTime: { value: 0, type: "f32" },
|
|
6249
6241
|
uResolution: { value: S(), type: "vec2<f32>" },
|
|
6250
|
-
uSnowSpeed: { value:
|
|
6251
|
-
uWindDirection: { value:
|
|
6252
|
-
uWindStrength: { value:
|
|
6242
|
+
uSnowSpeed: { value: T(), type: "f32" },
|
|
6243
|
+
uWindDirection: { value: F(), type: "f32" },
|
|
6244
|
+
uWindStrength: { value: B(), type: "f32" },
|
|
6253
6245
|
uSnowDensity: { value: D(), type: "f32" },
|
|
6254
|
-
uMaxFlakes: { value:
|
|
6246
|
+
uMaxFlakes: { value: P(), type: "f32" }
|
|
6255
6247
|
};
|
|
6256
6248
|
else if (t() === "fog")
|
|
6257
6249
|
m = Or(), d = {
|
|
6258
6250
|
uTime: { value: 0, type: "f32" },
|
|
6259
6251
|
uResolution: { value: S(), type: "vec2<f32>" },
|
|
6260
|
-
uSpeed: { value:
|
|
6252
|
+
uSpeed: { value: T(), type: "f32" },
|
|
6261
6253
|
uScale: { value: v(), type: "f32" },
|
|
6262
6254
|
uDensity: { value: D(), type: "f32" }
|
|
6263
6255
|
};
|
|
6264
6256
|
else
|
|
6265
6257
|
throw new Error(`Unknown weather effect: ${t()}. Supported: rain, snow, fog`);
|
|
6266
|
-
const b = new ee(d),
|
|
6258
|
+
const b = new ee(d), N = new Ce({
|
|
6267
6259
|
glProgram: m,
|
|
6268
6260
|
resources: { uniforms: b }
|
|
6269
6261
|
}), O = new ti({
|
|
@@ -6273,43 +6265,43 @@ const Rr = (h) => {
|
|
|
6273
6265
|
},
|
|
6274
6266
|
indexBuffer: [0, 1, 2, 0, 2, 3]
|
|
6275
6267
|
});
|
|
6276
|
-
let R = Math.random() * 10,
|
|
6268
|
+
let R = Math.random() * 10, y = [...S()], L = F(), it = B(), V = T(), K = D(), lt = P();
|
|
6277
6269
|
_();
|
|
6278
6270
|
let at = v();
|
|
6279
6271
|
return Ie(({ deltaTime: ut }) => {
|
|
6280
6272
|
R += ut / 600, b.uniforms.uTime = R;
|
|
6281
|
-
const
|
|
6282
|
-
(
|
|
6283
|
-
const rt =
|
|
6273
|
+
const k = S();
|
|
6274
|
+
(k[0] !== y[0] || k[1] !== y[1]) && (b.uniforms.uResolution = k, y = [...k]);
|
|
6275
|
+
const rt = F();
|
|
6284
6276
|
if (rt !== L && (b.uniforms.uWindDirection = rt, L = rt), t() === "rain" || t() === "snow") {
|
|
6285
|
-
const W =
|
|
6277
|
+
const W = B();
|
|
6286
6278
|
W !== it && (b.uniforms.uWindStrength = W, it = W);
|
|
6287
6279
|
}
|
|
6288
6280
|
if (t() === "rain") {
|
|
6289
|
-
const W =
|
|
6281
|
+
const W = T();
|
|
6290
6282
|
W !== V && (b.uniforms.uRainSpeed = W, V = W);
|
|
6291
6283
|
const tt = D();
|
|
6292
6284
|
tt !== K && (b.uniforms.uRainDensity = tt, K = tt);
|
|
6293
|
-
const
|
|
6294
|
-
|
|
6285
|
+
const U = P();
|
|
6286
|
+
U !== lt && (b.uniforms.uMaxDrops = U, lt = U);
|
|
6295
6287
|
} else if (t() === "snow") {
|
|
6296
|
-
const W =
|
|
6288
|
+
const W = T();
|
|
6297
6289
|
W !== V && (b.uniforms.uSnowSpeed = W, V = W);
|
|
6298
6290
|
const tt = D();
|
|
6299
6291
|
tt !== K && (b.uniforms.uSnowDensity = tt, K = tt);
|
|
6300
|
-
const
|
|
6301
|
-
|
|
6292
|
+
const U = P();
|
|
6293
|
+
U !== lt && (b.uniforms.uMaxFlakes = U, lt = U);
|
|
6302
6294
|
} else if (t() === "fog") {
|
|
6303
|
-
const W =
|
|
6295
|
+
const W = T();
|
|
6304
6296
|
W !== V && (b.uniforms.uSpeed = W, V = W);
|
|
6305
6297
|
const tt = v();
|
|
6306
6298
|
tt !== at && (b.uniforms.uScale = tt, at = tt);
|
|
6307
|
-
const
|
|
6308
|
-
|
|
6299
|
+
const U = D();
|
|
6300
|
+
U !== K && (b.uniforms.uDensity = U, K = U);
|
|
6309
6301
|
}
|
|
6310
6302
|
}), ft(bi, {
|
|
6311
6303
|
geometry: O,
|
|
6312
|
-
shader:
|
|
6304
|
+
shader: N,
|
|
6313
6305
|
width: "100%",
|
|
6314
6306
|
height: "100%"
|
|
6315
6307
|
});
|
|
@@ -6320,7 +6312,7 @@ export {
|
|
|
6320
6312
|
qr as Loading,
|
|
6321
6313
|
Gr as NightAmbiant,
|
|
6322
6314
|
Yr as Particle,
|
|
6323
|
-
|
|
6315
|
+
zr as TiledMap,
|
|
6324
6316
|
Wr as Weather,
|
|
6325
6317
|
Rr as WeatherEffect
|
|
6326
6318
|
};
|