textmode.js 0.4.0 → 0.4.1-beta.1
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/textmode.esm.js +281 -270
- package/dist/textmode.esm.min.js +77 -66
- package/dist/textmode.umd.js +5 -5
- package/dist/textmode.umd.min.js +3 -3
- package/dist/types/textmode/Textmodifier.d.ts +4 -0
- package/package.json +1 -1
package/dist/textmode.esm.js
CHANGED
|
@@ -56,12 +56,12 @@ const D = class D {
|
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
h(D, "l", null);
|
|
59
|
-
let
|
|
60
|
-
const z =
|
|
59
|
+
let j = D;
|
|
60
|
+
const z = j._(), et = /* @__PURE__ */ new WeakMap();
|
|
61
61
|
function Y(a, t) {
|
|
62
62
|
et.set(a, t);
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function V(a) {
|
|
65
65
|
return et.get(a);
|
|
66
66
|
}
|
|
67
67
|
class it {
|
|
@@ -81,14 +81,14 @@ class it {
|
|
|
81
81
|
h(this, "H", []);
|
|
82
82
|
}
|
|
83
83
|
G() {
|
|
84
|
-
this.H.push({ I: this.C, N: this.M, X: this.U, W: this.F, L: [...this.L], K: this.$, j: this.D, k: this.k, Y: [...this.R],
|
|
84
|
+
this.H.push({ I: this.C, N: this.M, X: this.U, W: this.F, L: [...this.L], K: this.$, j: this.D, k: this.k, Y: [...this.R], q: [...this.P], V: [...this.S] });
|
|
85
85
|
}
|
|
86
86
|
Z() {
|
|
87
87
|
const t = this.H.pop();
|
|
88
|
-
t ? (this.C = t.I, this.M = t.N, this.U = t.X, this.F = t.W, this.L = t.L, this.$ = t.K, this.D = t.j, this.k = t.k, this.R = t.Y, this.P = t.
|
|
88
|
+
t ? (this.C = t.I, this.M = t.N, this.U = t.X, this.F = t.W, this.L = t.L, this.$ = t.K, this.D = t.j, this.k = t.k, this.R = t.Y, this.P = t.q, this.S = t.V) : console.warn("pop() called without matching push()");
|
|
89
89
|
}
|
|
90
90
|
J(t) {
|
|
91
|
-
t.I = this.C, t.N = this.M, t.X = this.U, t.W = this.F, t.Y[0] = this.R[0], t.Y[1] = this.R[1], t.Y[2] = this.R[2], t.
|
|
91
|
+
t.I = this.C, t.N = this.M, t.X = this.U, t.W = this.F, t.Y[0] = this.R[0], t.Y[1] = this.R[1], t.Y[2] = this.R[2], t.q[0] = this.P[0], t.q[1] = this.P[1], t.q[2] = this.P[2], t.q[3] = this.P[3], t.V[0] = this.S[0], t.V[1] = this.S[1], t.V[2] = this.S[2], t.V[3] = this.S[3], t.K = this.$, t.j = this.D, t.k = this.k, t.L[0] = this.L[0], t.L[1] = this.L[1];
|
|
92
92
|
}
|
|
93
93
|
get lineWeight() {
|
|
94
94
|
return this.C;
|
|
@@ -134,7 +134,7 @@ class it {
|
|
|
134
134
|
this.O = [t / 255, e / 255, i / 255, s / 255];
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
|
-
class
|
|
137
|
+
class q {
|
|
138
138
|
constructor(t, e, i = e, s = 1, r = {}, n = null, o = !1) {
|
|
139
139
|
h(this, "dt");
|
|
140
140
|
h(this, "_t");
|
|
@@ -143,30 +143,30 @@ class j {
|
|
|
143
143
|
h(this, "gt");
|
|
144
144
|
h(this, "At");
|
|
145
145
|
h(this, "yt", []);
|
|
146
|
-
h(this, "
|
|
147
|
-
h(this, "
|
|
146
|
+
h(this, "wt");
|
|
147
|
+
h(this, "Ct", null);
|
|
148
148
|
h(this, "bt", []);
|
|
149
149
|
h(this, "xt", null);
|
|
150
150
|
h(this, "Mt", !1);
|
|
151
151
|
h(this, "Ft", null);
|
|
152
|
-
this.dt = e, this._t = i, this.u = { filter: "nearest", wrap: "clamp", format: "rgba", type: "unsigned_byte", ...r }, this.gt = t, this.
|
|
152
|
+
this.dt = e, this._t = i, this.u = { filter: "nearest", wrap: "clamp", format: "rgba", type: "unsigned_byte", ...r }, this.gt = t, this.wt = Math.min(Math.max(1, s), 8), this.xt = n, this.Mt = !!o, this.Ft = this.Mt ? new it() : null;
|
|
153
153
|
const c = t.getParameter(t.MAX_DRAW_BUFFERS), l = t.getParameter(t.MAX_COLOR_ATTACHMENTS);
|
|
154
|
-
this.
|
|
154
|
+
this.wt = Math.min(this.wt, c, l), this.At = t.createFramebuffer(), this.Rt(), this.zt(), this.bt = Array(this.wt).fill(null);
|
|
155
155
|
}
|
|
156
|
-
|
|
156
|
+
Rt() {
|
|
157
157
|
const t = this.gt, e = this.u.filter === "linear" ? t.LINEAR : t.NEAREST, i = this.u.wrap === "repeat" ? t.REPEAT : t.CLAMP_TO_EDGE, s = this.u.type === "float" ? t.FLOAT : t.UNSIGNED_BYTE;
|
|
158
|
-
for (let r = 0; r < this.
|
|
158
|
+
for (let r = 0; r < this.wt; r++) {
|
|
159
159
|
const n = t.createTexture();
|
|
160
160
|
t.bindTexture(t.TEXTURE_2D, n), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MIN_FILTER, e), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_MAG_FILTER, e), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_S, i), t.texParameteri(t.TEXTURE_2D, t.TEXTURE_WRAP_T, i), t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, this.dt, this._t, 0, t.RGBA, s, null), this.yt.push(n);
|
|
161
161
|
}
|
|
162
162
|
t.bindTexture(t.TEXTURE_2D, null);
|
|
163
163
|
}
|
|
164
|
-
|
|
164
|
+
zt() {
|
|
165
165
|
const t = this.gt;
|
|
166
|
-
if (t.bindFramebuffer(t.FRAMEBUFFER, this.At), this.
|
|
166
|
+
if (t.bindFramebuffer(t.FRAMEBUFFER, this.At), this.wt === 1) t.framebufferTexture2D(t.FRAMEBUFFER, t.COLOR_ATTACHMENT0, t.TEXTURE_2D, this.yt[0], 0);
|
|
167
167
|
else {
|
|
168
168
|
const i = [];
|
|
169
|
-
for (let s = 0; s < this.
|
|
169
|
+
for (let s = 0; s < this.wt; s++) {
|
|
170
170
|
const r = t.COLOR_ATTACHMENT0 + s;
|
|
171
171
|
t.framebufferTexture2D(t.FRAMEBUFFER, r, t.TEXTURE_2D, this.yt[s], 0), i.push(r);
|
|
172
172
|
}
|
|
@@ -180,7 +180,7 @@ class j {
|
|
|
180
180
|
e.bindTexture(e.TEXTURE_2D, this.yt[0]), e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL, 1), e.texImage2D(e.TEXTURE_2D, 0, e.RGBA, e.RGBA, e.UNSIGNED_BYTE, t), e.bindTexture(e.TEXTURE_2D, null);
|
|
181
181
|
}
|
|
182
182
|
resize(t, e) {
|
|
183
|
-
this.dt = t, this._t = e, this.vt = null, this.bt = Array(this.
|
|
183
|
+
this.dt = t, this._t = e, this.vt = null, this.bt = Array(this.wt).fill(null);
|
|
184
184
|
const i = this.gt, s = this.u.type === "float" ? i.FLOAT : i.UNSIGNED_BYTE;
|
|
185
185
|
for (const r of this.yt) i.bindTexture(i.TEXTURE_2D, r), i.texImage2D(i.TEXTURE_2D, 0, i.RGBA, this.dt, this._t, 0, i.RGBA, s, null);
|
|
186
186
|
i.bindTexture(i.TEXTURE_2D, null);
|
|
@@ -204,19 +204,19 @@ class j {
|
|
|
204
204
|
const n = ((i = (e = this.xt).Pt) == null ? void 0 : i.call(e)) ?? null;
|
|
205
205
|
n && this.xt.St(n), this.Mt && this.Ft && ((r = (s = this.xt).$t) == null || r.call(s, this.Ft));
|
|
206
206
|
}
|
|
207
|
-
this.
|
|
208
|
-
for (let n = 0; n < this.
|
|
207
|
+
this.Ct = { framebuffer: t.getParameter(t.FRAMEBUFFER_BINDING), viewport: t.getParameter(t.VIEWPORT) }, t.bindFramebuffer(t.FRAMEBUFFER, this.At), this.bt = Array(this.wt).fill(null);
|
|
208
|
+
for (let n = 0; n < this.wt; n++) t.clearBufferfv(t.COLOR, n, new Float32Array([0, 0, 0, 0]));
|
|
209
209
|
t.viewport(0, 0, this.dt, this._t), Y(t, [0, 0, this.dt, this._t]);
|
|
210
210
|
}
|
|
211
211
|
end() {
|
|
212
212
|
var e, i, s, r;
|
|
213
|
-
if (!this.
|
|
213
|
+
if (!this.Ct) return;
|
|
214
214
|
const t = this.gt;
|
|
215
215
|
if (this.xt) {
|
|
216
216
|
const n = ((i = (e = this.xt).Pt) == null ? void 0 : i.call(e)) ?? null;
|
|
217
217
|
n && this.xt.St(n);
|
|
218
218
|
}
|
|
219
|
-
t.bindFramebuffer(t.FRAMEBUFFER, this.
|
|
219
|
+
t.bindFramebuffer(t.FRAMEBUFFER, this.Ct.framebuffer), t.viewport(...this.Ct.viewport), Y(t, this.Ct.viewport), this.Ct = null, this.xt && this.Mt && this.Ft && ((r = (s = this.xt).Et) == null || r.call(s));
|
|
220
220
|
}
|
|
221
221
|
Dt() {
|
|
222
222
|
const t = this.gt;
|
|
@@ -286,7 +286,7 @@ class S {
|
|
|
286
286
|
Yt(t) {
|
|
287
287
|
return this.Lt.get(t) || null;
|
|
288
288
|
}
|
|
289
|
-
|
|
289
|
+
qt() {
|
|
290
290
|
const t = [];
|
|
291
291
|
for (const [e, i] of this.Lt.entries()) t.push({ name: e, ...i });
|
|
292
292
|
return t;
|
|
@@ -345,14 +345,14 @@ class S {
|
|
|
345
345
|
console.warn(`Unsupported uniform type for array '${t}': ${r}`);
|
|
346
346
|
}
|
|
347
347
|
else if (e instanceof WebGLTexture) {
|
|
348
|
-
const l = this.
|
|
348
|
+
const l = this.Vt();
|
|
349
349
|
o.uniform1i(i, l), o.activeTexture(o.TEXTURE0 + l), o.bindTexture(o.TEXTURE_2D, e);
|
|
350
|
-
} else if (e instanceof
|
|
351
|
-
const l = this.
|
|
350
|
+
} else if (e instanceof q) {
|
|
351
|
+
const l = this.Vt();
|
|
352
352
|
o.uniform1i(i, l), o.activeTexture(o.TEXTURE0 + l), o.bindTexture(o.TEXTURE_2D, e.textures[0]);
|
|
353
353
|
} else console.warn(`Unsupported uniform type for '${t}':`, typeof e);
|
|
354
354
|
}
|
|
355
|
-
|
|
355
|
+
Vt() {
|
|
356
356
|
return this.Ot++;
|
|
357
357
|
}
|
|
358
358
|
get Zt() {
|
|
@@ -363,7 +363,7 @@ class S {
|
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
365
|
const H = `#version 300 es
|
|
366
|
-
in vec2 a_position;in vec2 a_texCoord;in vec2 a_instancePosition;in vec2 a_instanceSize;in vec3 a_instanceCharacter;in vec4 a_instancePrimaryColor;in vec4 a_instanceSecondaryColor;in vec2 a_instanceRotation;in vec3 a_instanceTransform;in vec3 a_instanceGlobalRotation;in vec2 a_instanceRotationCenter;in vec2 a_instanceBezierCP1;in vec2 a_instanceBezierCP2;in vec2 a_instanceBezierStart;in vec2 a_instanceBezierEnd;in vec2 a_instanceArcAngles;uniform float U9;uniform vec2
|
|
366
|
+
in vec2 a_position;in vec2 a_texCoord;in vec2 a_instancePosition;in vec2 a_instanceSize;in vec3 a_instanceCharacter;in vec4 a_instancePrimaryColor;in vec4 a_instanceSecondaryColor;in vec2 a_instanceRotation;in vec3 a_instanceTransform;in vec3 a_instanceGlobalRotation;in vec2 a_instanceRotationCenter;in vec2 a_instanceBezierCP1;in vec2 a_instanceBezierCP2;in vec2 a_instanceBezierStart;in vec2 a_instanceBezierEnd;in vec2 a_instanceArcAngles;uniform float U9;uniform vec2 Uw;out vec2 v_uv;out vec3 v_character;out vec4 v_primaryColor;out vec4 v_secondaryColor;out vec2 v_rotation;out vec3 v_transform;mat3 A(float B){float C=sin(B),D=cos(B);return mat3(1,0,0,0,D,-C,0,C,D);}mat3 E(float B){float C=sin(B),D=cos(B);return mat3(D,0,C,0,1,0,-C,0,D);}mat3 F(float B){float C=sin(B),D=cos(B);return mat3(D,-C,0,C,D,0,0,0,1);}vec2 G(float H,vec2 I,vec2 J,vec2 K,vec2 L){float M=1.-H,N=M*M,O=H*H;return N*M*I+3.*N*H*J+3.*M*O*K+O*H*L;}vec2 P(float H,vec2 I,vec2 J,vec2 K,vec2 L){float M=1.-H,N=M*M,O=H*H;return-3.*N*I+3.*N*J-6.*M*H*J+6.*M*H*K-3.*O*K+3.*O*L;}void main(){v_uv=a_texCoord;v_character=a_instanceCharacter;v_primaryColor=a_instancePrimaryColor;v_secondaryColor=a_instanceSecondaryColor;v_rotation=a_instanceRotation;v_transform=a_instanceTransform;vec2 Q;bool R=length(a_instanceBezierCP1)+length(a_instanceBezierCP2)+length(a_instanceBezierStart)+length(a_instanceBezierEnd)>0.;bool S=a_instanceArcAngles.x!=0.||a_instanceArcAngles.y!=0.;if(R){float H=a_position.x;vec2 T=G(H,a_instanceBezierStart,a_instanceBezierCP1,a_instanceBezierCP2,a_instanceBezierEnd);vec2 U=P(H,a_instanceBezierStart,a_instanceBezierCP1,a_instanceBezierCP2,a_instanceBezierEnd);float V=length(U);U=V>0.?U/V:vec2(1,0);Q=T+vec2(-U.y,U.x)*a_position.y*a_instanceSize.y;}else if(S){float C=a_instanceArcAngles.x,W=a_instanceArcAngles.y;C=mod(C,6.28318530718);if(C<0.)C+=6.28318530718;W=mod(W,6.28318530718);if(W<0.)W+=6.28318530718;float X=C-W;if(X<=0.)X+=6.28318530718;float Y=C-a_position.x*X;vec2 Z=vec2(cos(Y),sin(Y))*a_position.y;Q=Z*a_instanceSize*.5+a_instanceSize*.5+a_instancePosition;}else{Q=a_position*a_instanceSize+a_instancePosition;}vec2 a=(Q/Uw)*2.-1.;a.y=-a.y;if(length(a_instanceGlobalRotation)>0.){vec3 b=vec3(a-a_instanceRotationCenter,0);b.x*=U9;if(a_instanceGlobalRotation.x!=0.)b=A(-a_instanceGlobalRotation.x)*b;if(a_instanceGlobalRotation.y!=0.)b=E(-a_instanceGlobalRotation.y)*b;if(a_instanceGlobalRotation.z!=0.)b=F(-a_instanceGlobalRotation.z)*b;b.x/=U9;a=b.xy+a_instanceRotationCenter;}gl_Position=vec4(a,0,1);}`, st = "attribute vec2 a_position;attribute vec2 a_texCoord;varying vec2 v_uv;void main(){v_uv=a_texCoord;gl_Position=vec4(a_position,0.,1.);}";
|
|
367
367
|
class lt {
|
|
368
368
|
constructor(t) {
|
|
369
369
|
h(this, "gt");
|
|
@@ -432,17 +432,17 @@ class ft {
|
|
|
432
432
|
h(this, "gt");
|
|
433
433
|
h(this, "xt");
|
|
434
434
|
h(this, "As", null);
|
|
435
|
-
h(this, "
|
|
435
|
+
h(this, "ws", null);
|
|
436
436
|
this.gt = t, this.gs = new ut(t), this.xt = e;
|
|
437
437
|
}
|
|
438
|
-
|
|
439
|
-
const { shader: s } = t, r =
|
|
440
|
-
s.Wt({ U9: r[2] / r[3],
|
|
438
|
+
Cs(t, e, i) {
|
|
439
|
+
const { shader: s } = t, r = V(this.gt) || this.gt.getParameter(this.gt.VIEWPORT);
|
|
440
|
+
s.Wt({ U9: r[2] / r[3], Uw: [r[2], r[3]] });
|
|
441
441
|
const n = (l) => {
|
|
442
442
|
if (!l || !l.bs()) return;
|
|
443
443
|
const f = l.unitGeometry, u = l.unitBuffer;
|
|
444
444
|
try {
|
|
445
|
-
this.gs.us(s.Zt, l.type + "", f, u), l.batch.Ms(s), l.batch.Fs(f.
|
|
445
|
+
this.gs.us(s.Zt, l.type + "", f, u), l.batch.Ms(s), l.batch.Fs(f.Rs, f.zs);
|
|
446
446
|
} finally {
|
|
447
447
|
l.batch.Ts(s), this.gs.vs(), l.Ps();
|
|
448
448
|
}
|
|
@@ -468,10 +468,10 @@ class ft {
|
|
|
468
468
|
Ds(t, e, i, s, r, n, o, c) {
|
|
469
469
|
e.Nt(), e.Wt(i);
|
|
470
470
|
const l = this.gt.getParameter(this.gt.VIEWPORT);
|
|
471
|
-
if (e.Wt({ U9: l[2] / l[3],
|
|
471
|
+
if (e.Wt({ U9: l[2] / l[3], Uw: [l[2], l[3]] }), t.Ps(), t.$s({ x: s, y: r, width: n, height: o }, c), t.bs()) {
|
|
472
472
|
const f = t.unitGeometry, u = t.unitBuffer;
|
|
473
473
|
try {
|
|
474
|
-
this.gs.us(e.Zt, t.type + "", f, u), t.batch.Ms(e), t.batch.Fs(f.
|
|
474
|
+
this.gs.us(e.Zt, t.type + "", f, u), t.batch.Ms(e), t.batch.Fs(f.Rs, f.zs);
|
|
475
475
|
} finally {
|
|
476
476
|
t.batch.Ts(e), this.gs.vs(), t.Ps();
|
|
477
477
|
}
|
|
@@ -481,7 +481,7 @@ class ft {
|
|
|
481
481
|
return this.xt.es();
|
|
482
482
|
}
|
|
483
483
|
Es(t, e) {
|
|
484
|
-
return this.As && this.
|
|
484
|
+
return this.As && this.ws && this.ws.w === t && this.ws.h === e || (this.As && this.As.Dt(), this.As = new q(this.gt, t, e, 5), this.ws = { w: t, h: e }), this.As;
|
|
485
485
|
}
|
|
486
486
|
Dt() {
|
|
487
487
|
this.gs.Dt(), this.As && this.As.Dt();
|
|
@@ -495,7 +495,7 @@ class dt {
|
|
|
495
495
|
}
|
|
496
496
|
Hs(t) {
|
|
497
497
|
if (this.Os >= this.Bs.length) {
|
|
498
|
-
const i = { id: this.Ls++, type: t, params: {}, state: { I: 1, N: 0, X: 0, W: 0, Y: [0, 0, 0],
|
|
498
|
+
const i = { id: this.Ls++, type: t, params: {}, state: { I: 1, N: 0, X: 0, W: 0, Y: [0, 0, 0], q: [1, 1, 1, 1], V: [0, 0, 0, 1], K: !1, j: !1, k: !1, L: [0, 0] } };
|
|
499
499
|
this.Bs.push(i);
|
|
500
500
|
}
|
|
501
501
|
const e = this.Bs[this.Os];
|
|
@@ -544,28 +544,28 @@ class dt {
|
|
|
544
544
|
return { next: () => t < e ? { value: i[t++], done: !1 } : { value: void 0, done: !0 } };
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
|
-
const
|
|
548
|
-
static
|
|
547
|
+
const L = class L {
|
|
548
|
+
static qs(t, e, i = 0) {
|
|
549
549
|
var n, o, c, l, f, u, m, p, g, d;
|
|
550
|
-
const s = e || new Float32Array(
|
|
550
|
+
const s = e || new Float32Array(L.FLOATS_PER_INSTANCE);
|
|
551
551
|
let r = i;
|
|
552
|
-
return s[r++] = t.fs[0], s[r++] = t.fs[1], s[r++] = t.Os[0], s[r++] = t.Os[1], s[r++] = t.Y[0], s[r++] = t.Y[1], s[r++] = t.Y[2], s[r++] = t.
|
|
552
|
+
return s[r++] = t.fs[0], s[r++] = t.fs[1], s[r++] = t.Os[0], s[r++] = t.Os[1], s[r++] = t.Y[0], s[r++] = t.Y[1], s[r++] = t.Y[2], s[r++] = t.q[0], s[r++] = t.q[1], s[r++] = t.q[2], s[r++] = t.q[3], s[r++] = t.V[0], s[r++] = t.V[1], s[r++] = t.V[2], s[r++] = t.V[3], s[r++] = t.L[0], s[r++] = t.L[1], s[r++] = t.Vs[0], s[r++] = t.Vs[1], s[r++] = t.Vs[2], s[r++] = t.N, s[r++] = t.X, s[r++] = t.W, s[r++] = t.Zs[0], s[r++] = t.Zs[1], s[r++] = ((n = t.Qs) == null ? void 0 : n[0]) || 0, s[r++] = ((o = t.Qs) == null ? void 0 : o[1]) || 0, s[r++] = ((c = t.Js) == null ? void 0 : c[0]) || 0, s[r++] = ((l = t.Js) == null ? void 0 : l[1]) || 0, s[r++] = ((f = t.te) == null ? void 0 : f[0]) || 0, s[r++] = ((u = t.te) == null ? void 0 : u[1]) || 0, s[r++] = ((m = t.se) == null ? void 0 : m[0]) || 0, s[r++] = ((p = t.se) == null ? void 0 : p[1]) || 0, s[r++] = ((g = t.ee) == null ? void 0 : g[0]) || 0, s[r++] = ((d = t.ee) == null ? void 0 : d[1]) || 0, s;
|
|
553
553
|
}
|
|
554
554
|
static ie(t) {
|
|
555
|
-
const e = t.length *
|
|
555
|
+
const e = t.length * L.FLOATS_PER_INSTANCE, i = new Float32Array(e);
|
|
556
556
|
for (let s = 0; s < t.length; s++) {
|
|
557
|
-
const r = s *
|
|
558
|
-
|
|
557
|
+
const r = s * L.FLOATS_PER_INSTANCE;
|
|
558
|
+
L.qs(t[s], i, r);
|
|
559
559
|
}
|
|
560
560
|
return i;
|
|
561
561
|
}
|
|
562
562
|
};
|
|
563
|
-
h(
|
|
564
|
-
let _ =
|
|
563
|
+
h(L, "BYTES_PER_INSTANCE", 140), h(L, "FLOATS_PER_INSTANCE", 35);
|
|
564
|
+
let _ = L;
|
|
565
565
|
const b = class b {
|
|
566
566
|
};
|
|
567
567
|
h(b, "STRIDE", _.BYTES_PER_INSTANCE), h(b, "ATTRIBUTES", { a_instancePosition: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: b.STRIDE, offset: 0, divisor: 1 }, a_instanceSize: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: b.STRIDE, offset: 8, divisor: 1 }, a_instanceCharacter: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: b.STRIDE, offset: 16, divisor: 1 }, a_instancePrimaryColor: { location: -1, size: 4, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: b.STRIDE, offset: 28, divisor: 1 }, a_instanceSecondaryColor: { location: -1, size: 4, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: b.STRIDE, offset: 44, divisor: 1 }, a_instanceRotation: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: b.STRIDE, offset: 60, divisor: 1 }, a_instanceTransform: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: b.STRIDE, offset: 68, divisor: 1 }, a_instanceGlobalRotation: { location: -1, size: 3, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: b.STRIDE, offset: 80, divisor: 1 }, a_instanceRotationCenter: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: b.STRIDE, offset: 92, divisor: 1 }, a_instanceArcAngles: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: b.STRIDE, offset: 100, divisor: 1 }, a_instanceBezierCP1: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: b.STRIDE, offset: 108, divisor: 1 }, a_instanceBezierCP2: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: b.STRIDE, offset: 116, divisor: 1 }, a_instanceBezierStart: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: b.STRIDE, offset: 124, divisor: 1 }, a_instanceBezierEnd: { location: -1, size: 2, type: WebGL2RenderingContext.FLOAT, normalized: !1, stride: b.STRIDE, offset: 132, divisor: 1 } });
|
|
568
|
-
let
|
|
568
|
+
let W = b;
|
|
569
569
|
class gt {
|
|
570
570
|
constructor(t, e = 1e3, i = 1.5) {
|
|
571
571
|
h(this, "gt");
|
|
@@ -615,7 +615,7 @@ class gt {
|
|
|
615
615
|
if (!e) {
|
|
616
616
|
e = /* @__PURE__ */ new Map();
|
|
617
617
|
const i = this.gt;
|
|
618
|
-
for (const s in
|
|
618
|
+
for (const s in W.ATTRIBUTES) {
|
|
619
619
|
const r = i.getAttribLocation(t, s);
|
|
620
620
|
r !== -1 && e.set(s, r);
|
|
621
621
|
}
|
|
@@ -630,7 +630,7 @@ class gt {
|
|
|
630
630
|
const s = this._e(i);
|
|
631
631
|
e.bindBuffer(e.ARRAY_BUFFER, this.he);
|
|
632
632
|
for (const [r, n] of s) {
|
|
633
|
-
const o =
|
|
633
|
+
const o = W.ATTRIBUTES[r];
|
|
634
634
|
o && (e.enableVertexAttribArray(n), e.vertexAttribPointer(n, o.size, o.type, o.normalized, o.stride, o.offset), e.vertexAttribDivisor(n, o.divisor));
|
|
635
635
|
}
|
|
636
636
|
}
|
|
@@ -678,40 +678,40 @@ class B {
|
|
|
678
678
|
Dt() {
|
|
679
679
|
this.me.Dt(), this.gt.deleteBuffer(this.Ae);
|
|
680
680
|
}
|
|
681
|
-
|
|
682
|
-
const n = this.
|
|
683
|
-
return { fs: [t, e], Os: [i, s], Y: r.Y || [0, 0, 0],
|
|
681
|
+
we(t, e, i, s, r) {
|
|
682
|
+
const n = this.Ce(t, e, i, s, r.N || 0, r.X || 0, r.W || 0);
|
|
683
|
+
return { fs: [t, e], Os: [i, s], Y: r.Y || [0, 0, 0], q: r.q || [1, 1, 1, 1], V: r.V || [0, 0, 0, 1], L: r.L || [0, 0], Vs: [r.k ? 1 : 0, r.K ? 1 : 0, r.j ? 1 : 0], N: n.radiansX, X: n.radiansY, W: n.radiansZ, Zs: [n.centerX, n.centerY] };
|
|
684
684
|
}
|
|
685
685
|
be(t, e) {
|
|
686
|
-
const i =
|
|
686
|
+
const i = V(this.gt) || [0, 0, this.gt.canvas.width, this.gt.canvas.height];
|
|
687
687
|
return { nx: t / i[2] * 2 - 1, ny: 1 - e / i[3] * 2 };
|
|
688
688
|
}
|
|
689
689
|
xe(t, e, i) {
|
|
690
690
|
const s = this.be(e, i);
|
|
691
691
|
t.Zs = [s.nx, s.ny];
|
|
692
692
|
}
|
|
693
|
-
|
|
694
|
-
const c =
|
|
693
|
+
Ce(t, e, i, s, r, n, o) {
|
|
694
|
+
const c = V(this.gt) || [0, 0, this.gt.canvas.width, this.gt.canvas.height], l = c[2], f = c[3];
|
|
695
695
|
return { centerX: (t + i / 2) / l * 2 - 1, centerY: 1 - (e + s / 2) / f * 2, radiansX: -r * Math.PI / 180, radiansY: -n * Math.PI / 180, radiansZ: -o * Math.PI / 180, aspectRatio: l / f };
|
|
696
696
|
}
|
|
697
697
|
}
|
|
698
|
-
const mt = { ye: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1]),
|
|
698
|
+
const mt = { ye: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1]), zs: 6, Rs: WebGL2RenderingContext.TRIANGLES, ps: 16, ds: { fs: { size: 2, offset: 0 }, _s: { size: 2, offset: 8 } } };
|
|
699
699
|
class At extends B {
|
|
700
700
|
constructor(t, e) {
|
|
701
701
|
super(t, e, x.RECTANGLE, mt);
|
|
702
702
|
}
|
|
703
703
|
$s(t, e) {
|
|
704
|
-
const i = this.
|
|
704
|
+
const i = this.we(t.x, t.y, t.width, t.height, e);
|
|
705
705
|
return this.me.$s(i);
|
|
706
706
|
}
|
|
707
707
|
}
|
|
708
|
-
const pt = { ye: new Float32Array([0, -0.5, 0, 0, 1, -0.5, 1, 0, 0, 0.5, 0, 1, 0, 0.5, 0, 1, 1, -0.5, 1, 0, 1, 0.5, 1, 1]),
|
|
708
|
+
const pt = { ye: new Float32Array([0, -0.5, 0, 0, 1, -0.5, 1, 0, 0, 0.5, 0, 1, 0, 0.5, 0, 1, 1, -0.5, 1, 0, 1, 0.5, 1, 1]), zs: 6, Rs: WebGL2RenderingContext.TRIANGLES, ps: 16, ds: { fs: { size: 2, offset: 0 }, _s: { size: 2, offset: 8 } } };
|
|
709
709
|
class vt extends B {
|
|
710
710
|
constructor(t, e) {
|
|
711
711
|
super(t, e, x.LINE, pt);
|
|
712
712
|
}
|
|
713
713
|
$s(t, e) {
|
|
714
|
-
const i = t.x2 - t.x1, s = t.y2 - t.y1, r = Math.hypot(i, s), n = t.thickness || e.I || 1, o = t.x1 + i / 2, c = t.y1 + s / 2, l = o - r / 2, f = c, u = this.
|
|
714
|
+
const i = t.x2 - t.x1, s = t.y2 - t.y1, r = Math.hypot(i, s), n = t.thickness || e.I || 1, o = t.x1 + i / 2, c = t.y1 + s / 2, l = o - r / 2, f = c, u = this.we(l, f, r, n, e);
|
|
715
715
|
return this.xe(u, o, c), this.me.$s(u);
|
|
716
716
|
}
|
|
717
717
|
}
|
|
@@ -722,40 +722,40 @@ const yt = { ye: function(a = 32) {
|
|
|
722
722
|
t.push(0, 0, 0.5, 0.5, n, o, c, l, f, u, m, p);
|
|
723
723
|
}
|
|
724
724
|
return new Float32Array(t);
|
|
725
|
-
}(32),
|
|
725
|
+
}(32), zs: 96, Rs: WebGL2RenderingContext.TRIANGLES, ps: 16, ds: { fs: { size: 2, offset: 0 }, _s: { size: 2, offset: 8 } } };
|
|
726
726
|
class xt extends B {
|
|
727
727
|
constructor(t, e) {
|
|
728
728
|
super(t, e, x.ELLIPSE, yt);
|
|
729
729
|
}
|
|
730
730
|
$s(t, e) {
|
|
731
|
-
const i = this.
|
|
731
|
+
const i = this.we(t.x, t.y, t.width, t.height, e);
|
|
732
732
|
return this.xe(i, t.x, t.y), this.me.$s(i);
|
|
733
733
|
}
|
|
734
734
|
}
|
|
735
|
-
let
|
|
735
|
+
let wt = { ye: function(a) {
|
|
736
736
|
const t = [];
|
|
737
737
|
for (let e = 0; e < a; e++) {
|
|
738
738
|
const i = e / a, s = (e + 1) / a;
|
|
739
739
|
t.push(i, 0, i, 0, i, 1, i, 1, s, 1, s, 1);
|
|
740
740
|
}
|
|
741
741
|
return new Float32Array(t);
|
|
742
|
-
}(32),
|
|
743
|
-
class
|
|
742
|
+
}(32), zs: 96, Rs: WebGL2RenderingContext.TRIANGLES, ps: 16, ds: { fs: { size: 2, offset: 0 }, _s: { size: 2, offset: 8 } } };
|
|
743
|
+
class Et extends B {
|
|
744
744
|
constructor(t, e) {
|
|
745
|
-
super(t, e, x.ARC,
|
|
745
|
+
super(t, e, x.ARC, wt);
|
|
746
746
|
}
|
|
747
747
|
$s(t, e) {
|
|
748
|
-
const i = t.x - t.width / 2, s = t.y - t.height / 2, r = t.start * Math.PI / 180, n = t.stop * Math.PI / 180, o = this.
|
|
748
|
+
const i = t.x - t.width / 2, s = t.y - t.height / 2, r = t.start * Math.PI / 180, n = t.stop * Math.PI / 180, o = this.we(i, s, t.width, t.height, e);
|
|
749
749
|
return this.xe(o, t.x, t.y), o.Qs = [r, n], this.me.$s(o);
|
|
750
750
|
}
|
|
751
751
|
}
|
|
752
|
-
const Tt = { ye: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0.5, 1, 0.5, 1]),
|
|
752
|
+
const Tt = { ye: new Float32Array([0, 0, 0, 0, 1, 0, 1, 0, 0.5, 1, 0.5, 1]), zs: 3, Rs: WebGL2RenderingContext.TRIANGLES, ps: 16, ds: { fs: { size: 2, offset: 0 }, _s: { size: 2, offset: 8 } } };
|
|
753
753
|
class Rt extends B {
|
|
754
754
|
constructor(t, e) {
|
|
755
755
|
super(t, e, x.TRIANGLE, Tt);
|
|
756
756
|
}
|
|
757
757
|
$s(t, e) {
|
|
758
|
-
const i = Math.min(t.x1, t.x2, t.x3), s = Math.max(t.x1, t.x2, t.x3), r = Math.min(t.y1, t.y2, t.y3), n = s - i, o = Math.max(t.y1, t.y2, t.y3) - r, c = this.
|
|
758
|
+
const i = Math.min(t.x1, t.x2, t.x3), s = Math.max(t.x1, t.x2, t.x3), r = Math.min(t.y1, t.y2, t.y3), n = s - i, o = Math.max(t.y1, t.y2, t.y3) - r, c = this.we(i, r, n, o, e), l = i + 0.5 * n, f = r + o * (1 / 3);
|
|
759
759
|
return this.xe(c, l, f), this.me.$s(c);
|
|
760
760
|
}
|
|
761
761
|
}
|
|
@@ -770,13 +770,13 @@ const bt = { ye: function(a = 16) {
|
|
|
770
770
|
t.push(i, -0.5, i, 0), t.push(s, -0.5, s, 0), t.push(i, 0.5, i, 1), t.push(i, 0.5, i, 1), t.push(s, -0.5, s, 0), t.push(s, 0.5, s, 1);
|
|
771
771
|
}
|
|
772
772
|
return new Float32Array(t);
|
|
773
|
-
}(16),
|
|
773
|
+
}(16), zs: 96, Rs: WebGL2RenderingContext.TRIANGLES, ps: 16, ds: { fs: { size: 2, offset: 0 }, _s: { size: 2, offset: 8 } } };
|
|
774
774
|
class Ct extends B {
|
|
775
775
|
constructor(t, e) {
|
|
776
776
|
super(t, e, x.BEZIER_CURVE, bt);
|
|
777
777
|
}
|
|
778
778
|
$s(t, e) {
|
|
779
|
-
const i = e.I || 1, s = $(0.5, t.x1, t.cp1x, t.cp2x, t.x2), r = $(0.5, t.y1, t.cp1y, t.cp2y, t.y2), n = this.
|
|
779
|
+
const i = e.I || 1, s = $(0.5, t.x1, t.cp1x, t.cp2x, t.x2), r = $(0.5, t.y1, t.cp1y, t.cp2y, t.y2), n = this.we(0, 0, 1, i, e);
|
|
780
780
|
return this.xe(n, s, r), n.se = [t.x1, t.y1], n.Js = [t.cp1x, t.cp1y], n.te = [t.cp2x, t.cp2y], n.ee = [t.x2, t.y2], this.me.$s(n);
|
|
781
781
|
}
|
|
782
782
|
}
|
|
@@ -785,8 +785,8 @@ class Ut {
|
|
|
785
785
|
h(this, "gt");
|
|
786
786
|
h(this, "Me", null);
|
|
787
787
|
h(this, "Fe");
|
|
788
|
-
h(this, "
|
|
789
|
-
h(this, "
|
|
788
|
+
h(this, "Re", null);
|
|
789
|
+
h(this, "ze", {});
|
|
790
790
|
h(this, "Te", null);
|
|
791
791
|
h(this, "Pe", /* @__PURE__ */ new Map());
|
|
792
792
|
h(this, "Se");
|
|
@@ -799,7 +799,7 @@ class Ut {
|
|
|
799
799
|
let e = this.Pe.get(t);
|
|
800
800
|
if (e) return e;
|
|
801
801
|
const i = new gt(this.gt);
|
|
802
|
-
return e = (0, { [x.RECTANGLE]: () => new At(this.gt, i), [x.LINE]: () => new vt(this.gt, i), [x.ELLIPSE]: () => new xt(this.gt, i), [x.ARC]: () => new
|
|
802
|
+
return e = (0, { [x.RECTANGLE]: () => new At(this.gt, i), [x.LINE]: () => new vt(this.gt, i), [x.ELLIPSE]: () => new xt(this.gt, i), [x.ARC]: () => new Et(this.gt, i), [x.TRIANGLE]: () => new Rt(this.gt, i), [x.BEZIER_CURVE]: () => new Ct(this.gt, i) }[t])(), this.Pe.set(t, e), e;
|
|
803
803
|
}
|
|
804
804
|
ke(t) {
|
|
805
805
|
this.Me !== t && (this.Me = t, t.Nt());
|
|
@@ -820,13 +820,13 @@ class Ut {
|
|
|
820
820
|
return this.Fe.ns();
|
|
821
821
|
}
|
|
822
822
|
Be(t) {
|
|
823
|
-
this.
|
|
823
|
+
this.Re = t, t && (this.ze = {});
|
|
824
824
|
}
|
|
825
825
|
Kt(t, e) {
|
|
826
|
-
this.
|
|
826
|
+
this.ze[t] = e;
|
|
827
827
|
}
|
|
828
828
|
Le(t) {
|
|
829
|
-
Object.assign(this.
|
|
829
|
+
Object.assign(this.ze, t);
|
|
830
830
|
}
|
|
831
831
|
hs(t) {
|
|
832
832
|
return this.Fe.hs(t);
|
|
@@ -847,7 +847,7 @@ class Ut {
|
|
|
847
847
|
g !== -1 && (r.enableVertexAttribArray(g), r.vertexAttribPointer(g, 2, r.FLOAT, !1, 8, 0)), r.drawArrays(r.TRIANGLES, 0, 6), g !== -1 && r.disableVertexAttribArray(g);
|
|
848
848
|
}
|
|
849
849
|
Ne(t, e, i, s) {
|
|
850
|
-
this.
|
|
850
|
+
this.Re ? (this.$e.Is(t, e, i, s, this.Re, { ...this.ze }, this.Ee), this.Re = null, this.ze = {}) : this.$e.Gs(t, e, i, s, this.Ee);
|
|
851
851
|
}
|
|
852
852
|
Xe(t, e, i, s) {
|
|
853
853
|
this.$e.Ns(t, e, i, s, this.Ee.lineWeight, this.Ee);
|
|
@@ -863,12 +863,12 @@ class Ut {
|
|
|
863
863
|
this.$e.js(t, e, i, s, r, n, o, c, l, this.Ee);
|
|
864
864
|
}
|
|
865
865
|
Ye(t, e, i = 1, s = {}) {
|
|
866
|
-
return new
|
|
866
|
+
return new q(this.gt, t, e, i, s, this, !0);
|
|
867
867
|
}
|
|
868
|
-
|
|
868
|
+
qe(t, e, i, s, r, n) {
|
|
869
869
|
this.$e.Ws(t, e, i, s, r, n, this.Ee);
|
|
870
870
|
}
|
|
871
|
-
|
|
871
|
+
Ve(t, e = t, i = t, s = 255) {
|
|
872
872
|
this.Ee.ft(t, e, i, s), this.Ys(t / 255, e / 255, i / 255, s / 255);
|
|
873
873
|
}
|
|
874
874
|
Ys(t = 0, e = 0, i = 0, s = 0) {
|
|
@@ -891,12 +891,12 @@ class Ut {
|
|
|
891
891
|
t && (this.Ee = t);
|
|
892
892
|
}
|
|
893
893
|
St(t) {
|
|
894
|
-
const e = t, i =
|
|
894
|
+
const e = t, i = V(this.gt) ?? this.gt.getParameter(this.gt.VIEWPORT), s = { shader: e, gl: this.gt, viewport: i };
|
|
895
895
|
this.ke(e);
|
|
896
896
|
const r = /* @__PURE__ */ new Set();
|
|
897
897
|
for (const n of this.$e) n.type === x.CUSTOM ? r.add(x.RECTANGLE) : r.add(n.type);
|
|
898
898
|
for (const n of r) n !== x.CUSTOM && this.De(n);
|
|
899
|
-
this.Se.
|
|
899
|
+
this.Se.Cs(s, this.$e, this.Pe), this.$e.Ys();
|
|
900
900
|
}
|
|
901
901
|
Dt() {
|
|
902
902
|
this.gt.deleteBuffer(this.Te), this.$e.Ys();
|
|
@@ -904,13 +904,13 @@ class Ut {
|
|
|
904
904
|
this.Fe.Dt(), this.Se.Dt();
|
|
905
905
|
}
|
|
906
906
|
}
|
|
907
|
-
const
|
|
907
|
+
const E = { readShort: (a, t) => (E.t.uint16[0] = a[t] << 8 | a[t + 1], E.t.int16[0]), readUshort: (a, t) => a[t] << 8 | a[t + 1], readUshorts(a, t, e) {
|
|
908
908
|
const i = [];
|
|
909
|
-
for (let s = 0; s < e; s++) i.push(
|
|
909
|
+
for (let s = 0; s < e; s++) i.push(E.readUshort(a, t + 2 * s));
|
|
910
910
|
return i;
|
|
911
911
|
}, readUint(a, t) {
|
|
912
|
-
const e =
|
|
913
|
-
return e[3] = a[t], e[2] = a[t + 1], e[1] = a[t + 2], e[0] = a[t + 3],
|
|
912
|
+
const e = E.t.uint8;
|
|
913
|
+
return e[3] = a[t], e[2] = a[t + 1], e[1] = a[t + 2], e[0] = a[t + 3], E.t.uint32[0];
|
|
914
914
|
}, readASCII(a, t, e) {
|
|
915
915
|
let i = "";
|
|
916
916
|
for (let s = 0; s < e; s++) i += String.fromCharCode(a[t + s]);
|
|
@@ -928,10 +928,10 @@ const w = { readShort: (a, t) => (w.t.uint16[0] = a[t] << 8 | a[t + 1], w.t.int1
|
|
|
928
928
|
function X(a) {
|
|
929
929
|
return a + 3 & -4;
|
|
930
930
|
}
|
|
931
|
-
function
|
|
931
|
+
function k(a, t, e) {
|
|
932
932
|
const i = t + e;
|
|
933
933
|
let s = 0;
|
|
934
|
-
const r =
|
|
934
|
+
const r = E.t;
|
|
935
935
|
for (let n = t; n < i; n += 4) r.uint8[3] = a[n] || 0, r.uint8[2] = a[n + 1] || 0, r.uint8[1] = a[n + 2] || 0, r.uint8[0] = a[n + 3] || 0, s = s + (r.uint32[0] >>> 0) >>> 0;
|
|
936
936
|
return s >>> 0;
|
|
937
937
|
}
|
|
@@ -978,7 +978,7 @@ function N(a) {
|
|
|
978
978
|
}
|
|
979
979
|
return { min: t, max: e, table: n };
|
|
980
980
|
}
|
|
981
|
-
function
|
|
981
|
+
function K(a, t) {
|
|
982
982
|
let e = 0;
|
|
983
983
|
for (let i = 1; i <= t.max; i++) {
|
|
984
984
|
e |= a.readBits(1) << i - 1;
|
|
@@ -1026,23 +1026,23 @@ function Ot(a) {
|
|
|
1026
1026
|
for (let v = 280; v <= 287; v++) d[v] = 8;
|
|
1027
1027
|
p = N(d), g = N(Array(32).fill(5));
|
|
1028
1028
|
} else {
|
|
1029
|
-
const d = r.readBits(5) + 257, v = r.readBits(5) + 1, A = r.readBits(4) + 4,
|
|
1030
|
-
for (let F = 0; F < A; F++) y[
|
|
1029
|
+
const d = r.readBits(5) + 257, v = r.readBits(5) + 1, A = r.readBits(4) + 4, w = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], y = Array(19).fill(0);
|
|
1030
|
+
for (let F = 0; F < A; F++) y[w[F]] = r.readBits(3);
|
|
1031
1031
|
const U = N(y), T = [];
|
|
1032
1032
|
for (; T.length < d + v; ) {
|
|
1033
|
-
const F =
|
|
1033
|
+
const F = K(r, U);
|
|
1034
1034
|
if (F <= 15) T.push(F);
|
|
1035
1035
|
else if (F === 16) {
|
|
1036
|
-
const I = r.readBits(2) + 3,
|
|
1037
|
-
for (let J = 0; J < I; J++) T.push(
|
|
1036
|
+
const I = r.readBits(2) + 3, M = T[T.length - 1] || 0;
|
|
1037
|
+
for (let J = 0; J < I; J++) T.push(M);
|
|
1038
1038
|
} else if (F === 17) {
|
|
1039
1039
|
const I = r.readBits(3) + 3;
|
|
1040
|
-
for (let
|
|
1040
|
+
for (let M = 0; M < I; M++) T.push(0);
|
|
1041
1041
|
} else {
|
|
1042
1042
|
if (F !== 18) throw Error("Invalid code length symbol");
|
|
1043
1043
|
{
|
|
1044
1044
|
const I = r.readBits(7) + 11;
|
|
1045
|
-
for (let
|
|
1045
|
+
for (let M = 0; M < I; M++) T.push(0);
|
|
1046
1046
|
}
|
|
1047
1047
|
}
|
|
1048
1048
|
}
|
|
@@ -1050,16 +1050,16 @@ function Ot(a) {
|
|
|
1050
1050
|
p = N(R), g = N(P);
|
|
1051
1051
|
}
|
|
1052
1052
|
for (; ; ) {
|
|
1053
|
-
const d =
|
|
1053
|
+
const d = K(r, p);
|
|
1054
1054
|
if (d < 256) n.push(d);
|
|
1055
1055
|
else {
|
|
1056
1056
|
if (d === 256) break;
|
|
1057
1057
|
if (d > 256 && d < 286) {
|
|
1058
1058
|
const v = d - 257;
|
|
1059
1059
|
let A = o[v];
|
|
1060
|
-
const
|
|
1061
|
-
|
|
1062
|
-
const y =
|
|
1060
|
+
const w = c[v];
|
|
1061
|
+
w && (A += r.readBits(w));
|
|
1062
|
+
const y = K(r, g);
|
|
1063
1063
|
if (y >= 30) throw Error("Invalid distance symbol");
|
|
1064
1064
|
let U = l[y];
|
|
1065
1065
|
const T = f[y];
|
|
@@ -1075,19 +1075,19 @@ function Ot(a) {
|
|
|
1075
1075
|
}
|
|
1076
1076
|
}(new Ft(a.subarray(i)), s), new Uint8Array(s);
|
|
1077
1077
|
}
|
|
1078
|
-
function
|
|
1079
|
-
const t =
|
|
1078
|
+
function Lt(a) {
|
|
1079
|
+
const t = E, e = new Uint8Array(a);
|
|
1080
1080
|
if (t.readASCII(e, 0, 4) !== "wOFF") throw Error("Invalid WOFF signature");
|
|
1081
1081
|
const i = t.readUint(e, 4), s = t.readUshort(e, 12), r = t.readUint(e, 16), n = [];
|
|
1082
1082
|
let o = 44;
|
|
1083
1083
|
for (let A = 0; A < s; A++) {
|
|
1084
|
-
const
|
|
1085
|
-
n.push({ tag:
|
|
1084
|
+
const w = t.readASCII(e, o, 4), y = t.readUint(e, o + 4), U = t.readUint(e, o + 8), T = t.readUint(e, o + 12), R = t.readUint(e, o + 16);
|
|
1085
|
+
n.push({ tag: w, offset: y, compLength: U, origLength: T, checksum: R }), o += 20;
|
|
1086
1086
|
}
|
|
1087
1087
|
for (const A of n) {
|
|
1088
|
-
const
|
|
1089
|
-
if (A.compLength === A.origLength) A.data = new Uint8Array(
|
|
1090
|
-
else if (A.data = Ot(
|
|
1088
|
+
const w = new Uint8Array(e.buffer, A.offset, A.compLength);
|
|
1089
|
+
if (A.compLength === A.origLength) A.data = new Uint8Array(w);
|
|
1090
|
+
else if (A.data = Ot(w), A.data.length !== A.origLength) if (A.data.length < A.origLength) {
|
|
1091
1091
|
const y = new Uint8Array(A.origLength);
|
|
1092
1092
|
y.set(A.data), A.data = y;
|
|
1093
1093
|
} else A.data = A.data.subarray(0, A.origLength);
|
|
@@ -1104,37 +1104,37 @@ function Mt(a) {
|
|
|
1104
1104
|
let v = 12;
|
|
1105
1105
|
for (const A of n) {
|
|
1106
1106
|
t.writeASCII(d, v, A.tag), v += 4;
|
|
1107
|
-
let
|
|
1108
|
-
if (A.tag === "head" &&
|
|
1109
|
-
const y = new Uint8Array(
|
|
1107
|
+
let w = A.data;
|
|
1108
|
+
if (A.tag === "head" && w.length >= 12) {
|
|
1109
|
+
const y = new Uint8Array(w);
|
|
1110
1110
|
t.writeUint(y, 8, 0);
|
|
1111
|
-
const U =
|
|
1111
|
+
const U = k(y, 0, X(y.length));
|
|
1112
1112
|
t.writeUint(d, v, U), v += 4;
|
|
1113
1113
|
} else {
|
|
1114
|
-
const y =
|
|
1114
|
+
const y = k(w, 0, X(w.length));
|
|
1115
1115
|
t.writeUint(d, v, y), v += 4;
|
|
1116
1116
|
}
|
|
1117
1117
|
t.writeUint(d, v, g[A.tag]), v += 4, t.writeUint(d, v, A.data.length), v += 4;
|
|
1118
1118
|
}
|
|
1119
1119
|
for (const A of n) {
|
|
1120
|
-
const
|
|
1121
|
-
d.set(A.data,
|
|
1120
|
+
const w = g[A.tag];
|
|
1121
|
+
d.set(A.data, w);
|
|
1122
1122
|
}
|
|
1123
1123
|
if (n.find((A) => A.tag === "head")) {
|
|
1124
|
-
const A = g.head,
|
|
1125
|
-
const T =
|
|
1124
|
+
const A = g.head, w = function(y, U) {
|
|
1125
|
+
const T = E, R = U + 8, P = [y[R], y[R + 1], y[R + 2], y[R + 3]];
|
|
1126
1126
|
T.writeUint(y, R, 0);
|
|
1127
|
-
const F = 2981146554 - (
|
|
1127
|
+
const F = 2981146554 - (k(y, 0, X(y.length)) >>> 0) >>> 0;
|
|
1128
1128
|
return y[R] = P[0], y[R + 1] = P[1], y[R + 2] = P[2], y[R + 3] = P[3], F >>> 0;
|
|
1129
1129
|
}(d, A);
|
|
1130
|
-
t.writeUint(d, A + 8,
|
|
1130
|
+
t.writeUint(d, A + 8, w);
|
|
1131
1131
|
}
|
|
1132
1132
|
return d.buffer;
|
|
1133
1133
|
}
|
|
1134
|
-
const
|
|
1134
|
+
const Mt = { parseTab(a, t, e) {
|
|
1135
1135
|
const i = { tables: [], ids: {}, off: t };
|
|
1136
1136
|
a = new Uint8Array(a.buffer, t, e), t = 0;
|
|
1137
|
-
const s =
|
|
1137
|
+
const s = E, r = s.readUshort, n = r(a, t += 2);
|
|
1138
1138
|
t += 2;
|
|
1139
1139
|
const o = [];
|
|
1140
1140
|
for (let c = 0; c < n; c++) {
|
|
@@ -1154,14 +1154,14 @@ const Lt = { parseTab(a, t, e) {
|
|
|
1154
1154
|
}
|
|
1155
1155
|
return i;
|
|
1156
1156
|
}, parse4(a, t) {
|
|
1157
|
-
const e =
|
|
1157
|
+
const e = E, i = e.readUshort, s = e.readUshorts, r = t, n = i(a, t += 2);
|
|
1158
1158
|
t += 2;
|
|
1159
1159
|
const o = i(a, t += 2) >>> 1, c = { format: 4, searchRange: i(a, t += 2), entrySelector: 0, rangeShift: 0, endCount: [], startCount: [], idDelta: [], idRangeOffset: [], glyphIdArray: [] };
|
|
1160
1160
|
t += 2, c.entrySelector = i(a, t), t += 2, c.rangeShift = i(a, t), t += 2, c.endCount = s(a, t, o), t += 2 * o, t += 2, c.startCount = s(a, t, o), t += 2 * o;
|
|
1161
1161
|
for (let l = 0; l < o; l++) c.idDelta.push(e.readShort(a, t)), t += 2;
|
|
1162
1162
|
return c.idRangeOffset = s(a, t, o), t += 2 * o, c.glyphIdArray = s(a, t, r + n - t >> 1), c;
|
|
1163
1163
|
}, parse12(a, t) {
|
|
1164
|
-
const e =
|
|
1164
|
+
const e = E.readUint;
|
|
1165
1165
|
e(a, t += 4), e(a, t += 4);
|
|
1166
1166
|
const i = e(a, t += 4);
|
|
1167
1167
|
t += 4;
|
|
@@ -1169,7 +1169,7 @@ const Lt = { parseTab(a, t, e) {
|
|
|
1169
1169
|
for (let r = 0; r < 3 * i; r += 3) s[r] = e(a, t + (r << 2)), s[r + 1] = e(a, t + (r << 2) + 4), s[r + 2] = e(a, t + (r << 2) + 8);
|
|
1170
1170
|
return { format: 12, groups: s };
|
|
1171
1171
|
} }, Dt = { parseTab(a, t, e) {
|
|
1172
|
-
const i =
|
|
1172
|
+
const i = E;
|
|
1173
1173
|
t += 18;
|
|
1174
1174
|
const s = i.readUshort(a, t);
|
|
1175
1175
|
t += 2, t += 16;
|
|
@@ -1182,7 +1182,7 @@ const Lt = { parseTab(a, t, e) {
|
|
|
1182
1182
|
const c = i.readShort(a, t);
|
|
1183
1183
|
return t += 2, t += 6, { unitsPerEm: s, xMin: r, yMin: n, xMax: o, yMax: c, indexToLocFormat: i.readShort(a, t) };
|
|
1184
1184
|
} }, _t = { parseTab(a, t, e) {
|
|
1185
|
-
const i =
|
|
1185
|
+
const i = E;
|
|
1186
1186
|
t += 4;
|
|
1187
1187
|
const s = ["ascender", "descender", "lineGap", "advanceWidthMax", "minLeftSideBearing", "minRightSideBearing", "xMaxExtent", "caretSlopeRise", "caretSlopeRun", "caretOffset", "res0", "res1", "res2", "res3", "metricDataFormat", "numberOfHMetrics"], r = {};
|
|
1188
1188
|
for (let n = 0; n < s.length; n++) {
|
|
@@ -1191,16 +1191,16 @@ const Lt = { parseTab(a, t, e) {
|
|
|
1191
1191
|
}
|
|
1192
1192
|
return r;
|
|
1193
1193
|
} }, St = { parseTab(a, t, e, i) {
|
|
1194
|
-
const s =
|
|
1194
|
+
const s = E, r = [], n = [], o = i.maxp.numGlyphs, c = i.hhea.numberOfHMetrics;
|
|
1195
1195
|
let l = 0, f = 0, u = 0;
|
|
1196
1196
|
for (; u < c; ) l = s.readUshort(a, t + (u << 2)), f = s.readShort(a, t + (u << 2) + 2), r.push(l), n.push(f), u++;
|
|
1197
1197
|
for (; u < o; ) r.push(l), n.push(f), u++;
|
|
1198
1198
|
return { aWidth: r, lsBearing: n };
|
|
1199
|
-
} }, tt = { cmap:
|
|
1200
|
-
const i =
|
|
1199
|
+
} }, tt = { cmap: Mt, head: Dt, hhea: _t, maxp: { parseTab(a, t, e) {
|
|
1200
|
+
const i = E;
|
|
1201
1201
|
return i.readUint(a, t), t += 4, { numGlyphs: i.readUshort(a, t) };
|
|
1202
1202
|
} }, hmtx: St, loca: { parseTab(a, t, e, i) {
|
|
1203
|
-
const s =
|
|
1203
|
+
const s = E, r = [], n = i.head.indexToLocFormat, o = i.maxp.numGlyphs + 1;
|
|
1204
1204
|
if (n === 0) for (let c = 0; c < o; c++) r.push(s.readUshort(a, t + (c << 1)) << 1);
|
|
1205
1205
|
else if (n === 1) for (let c = 0; c < o; c++) r.push(s.readUint(a, t + (c << 2)));
|
|
1206
1206
|
return r;
|
|
@@ -1209,7 +1209,7 @@ const Lt = { parseTab(a, t, e) {
|
|
|
1209
1209
|
for (let n = 0; n < r; n++) s.push(null);
|
|
1210
1210
|
return s;
|
|
1211
1211
|
}, Qe(a, t) {
|
|
1212
|
-
const e =
|
|
1212
|
+
const e = E, i = a.Je, s = a.loca;
|
|
1213
1213
|
if (s[t] === s[t + 1]) return null;
|
|
1214
1214
|
const r = O.findTable(i, "glyf", a.ti);
|
|
1215
1215
|
if (!r) return null;
|
|
@@ -1247,8 +1247,8 @@ const Lt = { parseTab(a, t, e) {
|
|
|
1247
1247
|
} else o.parts = [], o.endPts = [], o.flags = [], o.xs = [], o.ys = [];
|
|
1248
1248
|
return o;
|
|
1249
1249
|
} } }, O = { parse(a) {
|
|
1250
|
-
const t = new Uint8Array(a), e =
|
|
1251
|
-
if (e === "wOFF") a =
|
|
1250
|
+
const t = new Uint8Array(a), e = E.readASCII(t, 0, 4);
|
|
1251
|
+
if (e === "wOFF") a = Lt(a);
|
|
1252
1252
|
else if (e === "wOF2") throw Error("WOFF2 is not supported in this build (Brotli + WOFF2 transforms required)");
|
|
1253
1253
|
return [((i, s, r, n) => {
|
|
1254
1254
|
const o = tt, c = { Je: i, si: s, ti: r };
|
|
@@ -1263,7 +1263,7 @@ const Lt = { parseTab(a, t, e) {
|
|
|
1263
1263
|
return c;
|
|
1264
1264
|
})(new Uint8Array(a), 0, 0, {})];
|
|
1265
1265
|
}, findTable(a, t, e) {
|
|
1266
|
-
const i =
|
|
1266
|
+
const i = E, s = i.readUshort(a, e + 4);
|
|
1267
1267
|
let r = e + 12;
|
|
1268
1268
|
for (let n = 0; n < s; n++) {
|
|
1269
1269
|
const o = i.readASCII(a, r, 4);
|
|
@@ -1273,7 +1273,7 @@ const Lt = { parseTab(a, t, e) {
|
|
|
1273
1273
|
r += 16;
|
|
1274
1274
|
}
|
|
1275
1275
|
return null;
|
|
1276
|
-
}, T: tt, B:
|
|
1276
|
+
}, T: tt, B: E };
|
|
1277
1277
|
class Bt {
|
|
1278
1278
|
ei(t) {
|
|
1279
1279
|
var i;
|
|
@@ -1401,16 +1401,16 @@ class It {
|
|
|
1401
1401
|
h(this, "Ai");
|
|
1402
1402
|
h(this, "yi");
|
|
1403
1403
|
h(this, "xt");
|
|
1404
|
-
h(this, "
|
|
1405
|
-
this.xt = t, this.
|
|
1404
|
+
h(this, "wi");
|
|
1405
|
+
this.xt = t, this.wi = new Z(), this.Ai = document.createElement("canvas"), this.yi = this.Ai.getContext("2d", { willReadFrequently: !0, alpha: !0 });
|
|
1406
1406
|
}
|
|
1407
1407
|
createTextureAtlas(t, e, i, s) {
|
|
1408
1408
|
const r = t.length, n = Math.ceil(Math.sqrt(r)), o = Math.ceil(r / n), c = e.width * n, l = e.height * o, f = typeof s == "object" ? s : null;
|
|
1409
|
-
this.
|
|
1409
|
+
this.Ci(c, l), this.bi(t, e, n, i, f);
|
|
1410
1410
|
const u = this.xt.Ye(c, l, 1, { filter: "nearest" });
|
|
1411
1411
|
return u.Tt(this.Ai), { framebuffer: u, columns: n, rows: o };
|
|
1412
1412
|
}
|
|
1413
|
-
|
|
1413
|
+
Ci(t, e) {
|
|
1414
1414
|
this.Ai.width = t, this.Ai.height = e, this.Ai.style.width = t + "px", this.Ai.style.height = e + "px", this.yi.imageSmoothingEnabled = !1, this.Ai.style.imageRendering = "pixelated", this.yi.clearRect(0, 0, t, e), this.yi.textBaseline = "top", this.yi.textAlign = "left", this.yi.fillStyle = "white";
|
|
1415
1415
|
}
|
|
1416
1416
|
bi(t, e, i, s, r) {
|
|
@@ -1418,12 +1418,12 @@ class It {
|
|
|
1418
1418
|
for (let o = 0; o < t.length; o++) {
|
|
1419
1419
|
const c = o % i, l = Math.floor(o / i), f = t[o].character, u = this.xi(r, f);
|
|
1420
1420
|
if (!u) continue;
|
|
1421
|
-
const m = f.codePointAt(0) || 0, p = this.
|
|
1421
|
+
const m = f.codePointAt(0) || 0, p = this.wi.li(r, m), g = this.Mi(r, p) * n, d = c * e.width, v = l * e.height, A = d + 0.5 * e.width, w = v + 0.5 * e.height, y = Math.round(A - 0.5 * e.width), U = Math.round(w - 0.5 * s), T = y + 0.5 * (e.width - g), R = U + r.hhea.ascender * n;
|
|
1422
1422
|
this.Fi(u, T, R, n);
|
|
1423
1423
|
}
|
|
1424
1424
|
}
|
|
1425
1425
|
xi(t, e) {
|
|
1426
|
-
const i = e.codePointAt(0) || 0, s = this.
|
|
1426
|
+
const i = e.codePointAt(0) || 0, s = this.wi.li(t, i);
|
|
1427
1427
|
if (s === 0) return null;
|
|
1428
1428
|
if (t.glyf && t.glyf[s] !== null) return t.glyf[s];
|
|
1429
1429
|
if (O && O.T && O.T.glyf) {
|
|
@@ -1457,11 +1457,11 @@ class It {
|
|
|
1457
1457
|
const d = e + r[g] * s, v = i - n[g] * s;
|
|
1458
1458
|
let A = g + 1 > u ? l : g + 1;
|
|
1459
1459
|
if (1 & c[A]) {
|
|
1460
|
-
const
|
|
1461
|
-
this.yi.quadraticCurveTo(d, v,
|
|
1460
|
+
const w = e + r[A] * s, y = i - n[A] * s;
|
|
1461
|
+
this.yi.quadraticCurveTo(d, v, w, y), g = A + 1;
|
|
1462
1462
|
} else {
|
|
1463
|
-
const
|
|
1464
|
-
this.yi.quadraticCurveTo(d, v,
|
|
1463
|
+
const w = (d + (e + r[A] * s)) / 2, y = (v + (i - n[A] * s)) / 2;
|
|
1464
|
+
this.yi.quadraticCurveTo(d, v, w, y), g = A;
|
|
1465
1465
|
}
|
|
1466
1466
|
}
|
|
1467
1467
|
this.yi.closePath();
|
|
@@ -1474,35 +1474,35 @@ class It {
|
|
|
1474
1474
|
}
|
|
1475
1475
|
class Nt {
|
|
1476
1476
|
constructor() {
|
|
1477
|
-
h(this, "
|
|
1478
|
-
this.
|
|
1477
|
+
h(this, "Ri");
|
|
1478
|
+
this.Ri = new Z();
|
|
1479
1479
|
}
|
|
1480
|
-
|
|
1480
|
+
zi(t, e, i) {
|
|
1481
1481
|
let s = 0;
|
|
1482
|
-
const r = this.
|
|
1482
|
+
const r = this.Ri.mi(i, e), n = r.lineHeight;
|
|
1483
1483
|
for (const o of t) {
|
|
1484
|
-
const c = this.
|
|
1484
|
+
const c = this.Ri.pi(i, o);
|
|
1485
1485
|
if (c === 0) continue;
|
|
1486
|
-
const l = this.
|
|
1486
|
+
const l = this.Ri._i(i, c) * r.scale;
|
|
1487
1487
|
s = Math.max(s, l);
|
|
1488
1488
|
}
|
|
1489
1489
|
return { width: Math.ceil(s), height: Math.ceil(n) };
|
|
1490
1490
|
}
|
|
1491
1491
|
gi() {
|
|
1492
|
-
this.
|
|
1492
|
+
this.Ri.gi();
|
|
1493
1493
|
}
|
|
1494
1494
|
}
|
|
1495
1495
|
class zt {
|
|
1496
1496
|
constructor() {
|
|
1497
|
-
h(this, "
|
|
1498
|
-
this.
|
|
1497
|
+
h(this, "wi");
|
|
1498
|
+
this.wi = new Z();
|
|
1499
1499
|
}
|
|
1500
1500
|
createCharacterObjects(t, e) {
|
|
1501
1501
|
return t.map((i, s) => {
|
|
1502
1502
|
const r = i.codePointAt(0) || 0, n = this.Ti(s);
|
|
1503
1503
|
let o = 0;
|
|
1504
1504
|
if (e.hmtx && e.hmtx.aWidth) {
|
|
1505
|
-
const c = this.
|
|
1505
|
+
const c = this.wi.li(e, r);
|
|
1506
1506
|
c > 0 && e.hmtx.aWidth[c] !== void 0 && (o = e.hmtx.aWidth[c]);
|
|
1507
1507
|
}
|
|
1508
1508
|
return { character: i, unicode: r, color: n, advanceWidth: o };
|
|
@@ -1547,13 +1547,13 @@ class Gt {
|
|
|
1547
1547
|
e = await (await fetch("data:font/woff;base64,d09GRgABAAAAABbwAAoAAAAAfywAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABjbWFwAAAA9AAAAbsAAAkgIO8lSWdseWYAAAKwAAAOfgAAaLS4ctN0aGVhZAAAETAAAAAsAAAAOCi8/PVoaGVhAAARXAAAABkAAAAkCwEFAmhtdHgAABF4AAAAhQAABAQEAIOAbG9jYQAAEgAAAAKUAAAECAAy54BtYXhwAAAUlAAAABgAAAAgASIAgm5hbWUAABSsAAAB5wAAA6RWz85KT1MvMgAAFpQAAABFAAAAYM+QEyRwb3N0AAAW3AAAABQAAAAgAGkANHja7dRPSFRRFMfx38wdXblw4cJC7M0bz60gWlULGUFctWgR0UIQQkmDyn27kpAQaaEO2jhWJuafiQFtcDJtSqGhiFZtot5x3jzEVQQhl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7p4Lr5retx3fcN/5Mb+Dfs25RpE/8mji0etqzfwLHteZufmzrZobfj/K5ednna0/fe/l+Pca7seNpjYGRgYGRkaGBQYAABJgY0AAAP+ACmeNp1ksFO20AQhv8NgRJaUApSy61LDxVc4uAjNxoJReoNKdCrYy8hZb1rrTcIuPMKfaY+QM899RH6AP3tDJEKqlcefzvzz/xrywD21ScoLK9N3ktW5E3hDl6hL7zG7HvhLrMfhNfxGonwBjUnwj2uz8JbzH4R3sZbPArvIMV34T28wQ+6qG6Puz5+Civyb+EOO/4Ir6GvOsJdaLUrvI53KhXeoGYs3MOu+iq8hai+CW/jo/olvIOiA+E97HeKw/xIp8M0nYQ6O/MunpvZwmbhafv01JK/MKGee6ePB8N/JCFzN6dO+8o4bee5cbnRM+NMyKyuFqHytdHR3MXSF0ZfNQOn93rVORoNm4l64ua3NMjsdYxVfZIkeTBZZC73ZeldPfBhllSLKR0KX2ZzlzyY4BO2JmNjrdeXPtjiAIfIcQTNbz/knWKCgBoZzuDhEHEOgxkWsMyFF9Xne/1Mf8Fdo5i3dY1jDOjz/ymB0eEGp63ao2J/Q5YT8pabqOnQsGn1lvuKjoHRc05Tj4x3jCUzRZu5Wp1winvGl54jruHqjI3C0fVW3qDxuWZ/pEvNPzjhylkxrETR5fQoW09HzYDPwJMm7emm8g5Fq8nIjpWHdronLV0TjJmxXJ4nuGwnWPYcAH8BoeumrAB42mNgYmFgnMDAysDCxMDEAAIQGoiNGc6A+CwMENDAwNDNwFDwGMpliHT00WNwYFBQy4aogJCMgSCSGcJTYGAAAEBYBpIAAAB42mNgZoCANAZjIMnIgAYADecAng==")).arrayBuffer();
|
|
1548
1548
|
await this.ji(e), this.$i = O.parse(e)[0], await this.Yi();
|
|
1549
1549
|
}
|
|
1550
|
-
|
|
1550
|
+
qi(t) {
|
|
1551
1551
|
if (t === void 0) return this.ki;
|
|
1552
|
-
this.ki = t, this.Oi = this.Xi.
|
|
1552
|
+
this.ki = t, this.Oi = this.Xi.zi(this.Ei.map((i) => i.character), this.ki, this.$i);
|
|
1553
1553
|
const e = this.Ni.createTextureAtlas(this.Ei, this.Oi, this.ki, this.$i);
|
|
1554
1554
|
this.Di = e.framebuffer, this.Bi = e.columns, this.Li = e.rows;
|
|
1555
1555
|
}
|
|
1556
|
-
async
|
|
1556
|
+
async Vi(t) {
|
|
1557
1557
|
try {
|
|
1558
1558
|
const e = await fetch(t);
|
|
1559
1559
|
if (!e.ok) throw new C(`Failed to load font file: ${e.status} ${e.statusText}`);
|
|
@@ -1572,7 +1572,7 @@ class Gt {
|
|
|
1572
1572
|
}
|
|
1573
1573
|
async Yi() {
|
|
1574
1574
|
const t = this.Ii.ei(this.$i), e = this.Ii.ni(t);
|
|
1575
|
-
this.Gi.clear(), this.Ei = this.Wi.createCharacterObjects(e, this.$i), this.Oi = this.Xi.
|
|
1575
|
+
this.Gi.clear(), this.Ei = this.Wi.createCharacterObjects(e, this.$i), this.Oi = this.Xi.zi(e, this.ki, this.$i);
|
|
1576
1576
|
const i = this.Ni.createTextureAtlas(this.Ei, this.Oi, this.ki, this.$i);
|
|
1577
1577
|
this.Di = i.framebuffer, this.Bi = i.columns, this.Li = i.rows;
|
|
1578
1578
|
}
|
|
@@ -1778,10 +1778,10 @@ class G {
|
|
|
1778
1778
|
h(this, "j", 0);
|
|
1779
1779
|
h(this, "L", [0, 0]);
|
|
1780
1780
|
h(this, "yr", "sampled");
|
|
1781
|
-
h(this, "
|
|
1782
|
-
h(this, "
|
|
1783
|
-
h(this, "
|
|
1784
|
-
h(this, "
|
|
1781
|
+
h(this, "wr", "fixed");
|
|
1782
|
+
h(this, "q", [1, 1, 1, 1]);
|
|
1783
|
+
h(this, "V", [0, 0, 0, 1]);
|
|
1784
|
+
h(this, "Cr", [0, 0, 0, 1]);
|
|
1785
1785
|
h(this, "br", [[0.1, 0, 0]]);
|
|
1786
1786
|
h(this, "Mr");
|
|
1787
1787
|
this.gt = t, this.Ar = e, this.dt = i, this._t = s;
|
|
@@ -1806,28 +1806,28 @@ class G {
|
|
|
1806
1806
|
return this.L = [i, s], this;
|
|
1807
1807
|
}
|
|
1808
1808
|
Ge() {
|
|
1809
|
-
return { texture: this.Ar, invert: this.k, flipX: this.K, flipY: this.j, charRotation: this.L, charColorFixed: this.yr === "fixed", charColor: this.
|
|
1809
|
+
return { texture: this.Ar, invert: this.k, flipX: this.K, flipY: this.j, charRotation: this.L, charColorFixed: this.yr === "fixed", charColor: this.q, cellColorFixed: this.wr === "fixed", cellColor: this.V, backgroundColor: this.Cr, charCount: this.br.length, charList: this.br };
|
|
1810
1810
|
}
|
|
1811
1811
|
charColorMode(t) {
|
|
1812
1812
|
return this.yr = t, this;
|
|
1813
1813
|
}
|
|
1814
1814
|
cellColorMode(t) {
|
|
1815
|
-
return this.
|
|
1815
|
+
return this.wr = t, this;
|
|
1816
1816
|
}
|
|
1817
1817
|
charColor(t, e, i, s) {
|
|
1818
|
-
return this.
|
|
1818
|
+
return this.q = [(t ?? 0) / 255, (e ?? t ?? 0) / 255, (i ?? t ?? 0) / 255, (s ?? 255) / 255], this;
|
|
1819
1819
|
}
|
|
1820
1820
|
cellColor(t, e, i, s) {
|
|
1821
|
-
return this.
|
|
1821
|
+
return this.V = [(t ?? 0) / 255, (e ?? t ?? 0) / 255, (i ?? t ?? 0) / 255, (s ?? 255) / 255], this;
|
|
1822
1822
|
}
|
|
1823
1823
|
background(t, e, i, s) {
|
|
1824
|
-
return this.
|
|
1824
|
+
return this.Cr = [(t ?? 0) / 255, (e ?? t ?? 0) / 255, (i ?? t ?? 0) / 255, (s ?? 255) / 255], this;
|
|
1825
1825
|
}
|
|
1826
1826
|
characters(t) {
|
|
1827
1827
|
const e = this.Mr(t).filter((i) => Array.isArray(i)).slice(0, 64);
|
|
1828
1828
|
return this.br = e, this;
|
|
1829
1829
|
}
|
|
1830
|
-
static
|
|
1830
|
+
static Rr(t, e, i) {
|
|
1831
1831
|
const s = t.context, r = s.createTexture();
|
|
1832
1832
|
s.bindTexture(s.TEXTURE_2D, r), s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, 1), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, s.NEAREST), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, s.NEAREST), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, s.CLAMP_TO_EDGE), s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, s.CLAMP_TO_EDGE), s.texImage2D(s.TEXTURE_2D, 0, s.RGBA, s.RGBA, s.UNSIGNED_BYTE, e), s.bindTexture(s.TEXTURE_2D, null);
|
|
1833
1833
|
const n = e.naturalWidth ?? e.width ?? e.videoWidth ?? 0, o = e.naturalHeight ?? e.height ?? e.videoHeight ?? 0, c = new G(s, r, n, o);
|
|
@@ -1845,7 +1845,7 @@ class G {
|
|
|
1845
1845
|
}
|
|
1846
1846
|
class Yt {
|
|
1847
1847
|
constructor(t = 60) {
|
|
1848
|
-
h(this, "
|
|
1848
|
+
h(this, "zr");
|
|
1849
1849
|
h(this, "Tr");
|
|
1850
1850
|
h(this, "Pr", null);
|
|
1851
1851
|
h(this, "Sr", 0);
|
|
@@ -1855,7 +1855,7 @@ class Yt {
|
|
|
1855
1855
|
h(this, "kr", []);
|
|
1856
1856
|
h(this, "Br", 10);
|
|
1857
1857
|
h(this, "Lr", 0);
|
|
1858
|
-
this.
|
|
1858
|
+
this.zr = t, this.Tr = 1e3 / t;
|
|
1859
1859
|
}
|
|
1860
1860
|
start(t) {
|
|
1861
1861
|
if (!this.$r) return;
|
|
@@ -1878,7 +1878,7 @@ class Yt {
|
|
|
1878
1878
|
}
|
|
1879
1879
|
frameRate(t, e) {
|
|
1880
1880
|
if (t === void 0) return this.Er;
|
|
1881
|
-
this.
|
|
1881
|
+
this.zr = t, this.Tr = 1e3 / t, this.$r && e && (this.stop(), this.start(e));
|
|
1882
1882
|
}
|
|
1883
1883
|
measureFrameRate() {
|
|
1884
1884
|
const t = performance.now();
|
|
@@ -1894,7 +1894,7 @@ class Yt {
|
|
|
1894
1894
|
return this.$r;
|
|
1895
1895
|
}
|
|
1896
1896
|
get frameRateLimit() {
|
|
1897
|
-
return this.
|
|
1897
|
+
return this.zr;
|
|
1898
1898
|
}
|
|
1899
1899
|
get currentFrameRate() {
|
|
1900
1900
|
return this.Er;
|
|
@@ -1925,8 +1925,8 @@ class rt {
|
|
|
1925
1925
|
h(this, "Kr");
|
|
1926
1926
|
h(this, "jr");
|
|
1927
1927
|
h(this, "Yr");
|
|
1928
|
-
h(this, "
|
|
1929
|
-
h(this, "
|
|
1928
|
+
h(this, "qr");
|
|
1929
|
+
h(this, "Vr", !1);
|
|
1930
1930
|
h(this, "Zr");
|
|
1931
1931
|
h(this, "Qr");
|
|
1932
1932
|
h(this, "Jr");
|
|
@@ -1949,7 +1949,7 @@ class rt {
|
|
|
1949
1949
|
this.Or = t, this.hn();
|
|
1950
1950
|
}
|
|
1951
1951
|
an() {
|
|
1952
|
-
if (this.
|
|
1952
|
+
if (this.Vr) return;
|
|
1953
1953
|
const t = this.er.canvas;
|
|
1954
1954
|
this.Xr = (e) => {
|
|
1955
1955
|
this.cn(e), this.ln(e);
|
|
@@ -1961,17 +1961,17 @@ class rt {
|
|
|
1961
1961
|
this.cn(e), this.fn(e);
|
|
1962
1962
|
}, this.Yr = (e) => {
|
|
1963
1963
|
this.cn(e), this.dn(e);
|
|
1964
|
-
}, this.
|
|
1964
|
+
}, this.qr = (e) => {
|
|
1965
1965
|
this.cn(e), this.pn(e);
|
|
1966
|
-
}, t.addEventListener("mousemove", this.Xr, { passive: !0 }), t.addEventListener("mouseleave", this.Wr, { passive: !0 }), t.addEventListener("mousedown", this.Kr, { passive: !0 }), t.addEventListener("mouseup", this.jr, { passive: !0 }), t.addEventListener("click", this.Yr, { passive: !0 }), t.addEventListener("wheel", this.
|
|
1966
|
+
}, t.addEventListener("mousemove", this.Xr, { passive: !0 }), t.addEventListener("mouseleave", this.Wr, { passive: !0 }), t.addEventListener("mousedown", this.Kr, { passive: !0 }), t.addEventListener("mouseup", this.jr, { passive: !0 }), t.addEventListener("click", this.Yr, { passive: !0 }), t.addEventListener("wheel", this.qr, { passive: !1 }), this.Vr = !0;
|
|
1967
1967
|
}
|
|
1968
1968
|
_n() {
|
|
1969
|
-
if (!this.
|
|
1969
|
+
if (!this.Vr) return;
|
|
1970
1970
|
const t = this.er.canvas;
|
|
1971
|
-
t.removeEventListener("mousemove", this.Xr), t.removeEventListener("mouseleave", this.Wr), t.removeEventListener("mousedown", this.Kr), t.removeEventListener("mouseup", this.jr), t.removeEventListener("click", this.Yr), t.removeEventListener("wheel", this.
|
|
1971
|
+
t.removeEventListener("mousemove", this.Xr), t.removeEventListener("mouseleave", this.Wr), t.removeEventListener("mousedown", this.Kr), t.removeEventListener("mouseup", this.jr), t.removeEventListener("click", this.Yr), t.removeEventListener("wheel", this.qr), this.Vr = !1;
|
|
1972
1972
|
}
|
|
1973
1973
|
hn() {
|
|
1974
|
-
if (this.
|
|
1974
|
+
if (this.Vr) try {
|
|
1975
1975
|
if (this.Ir) {
|
|
1976
1976
|
const t = new MouseEvent("mousemove", { clientX: this.Ir.x, clientY: this.Ir.y, bubbles: !1, cancelable: !1 });
|
|
1977
1977
|
this.cn(t);
|
|
@@ -1995,7 +1995,7 @@ class rt {
|
|
|
1995
1995
|
yn(t) {
|
|
1996
1996
|
this.sn = t;
|
|
1997
1997
|
}
|
|
1998
|
-
|
|
1998
|
+
wn() {
|
|
1999
1999
|
return { x: this.Hr.x, y: this.Hr.y };
|
|
2000
2000
|
}
|
|
2001
2001
|
ln(t) {
|
|
@@ -2035,37 +2035,37 @@ class rt {
|
|
|
2035
2035
|
f >= 0 && f < this.Or.cols && u >= 0 && u < this.Or.rows ? (this.Hr.x = f, this.Hr.y = u) : (this.Hr.x = -1, this.Hr.y = -1);
|
|
2036
2036
|
}
|
|
2037
2037
|
}
|
|
2038
|
-
const
|
|
2038
|
+
const Vt = Object.freeze(Object.defineProperty({ __proto__: null, MouseManager: rt }, Symbol.toStringTag, { value: "Module" }));
|
|
2039
2039
|
class nt {
|
|
2040
2040
|
constructor() {
|
|
2041
|
-
h(this, "
|
|
2041
|
+
h(this, "Cn", /* @__PURE__ */ new Map());
|
|
2042
2042
|
h(this, "bn", null);
|
|
2043
2043
|
h(this, "xn", null);
|
|
2044
2044
|
h(this, "Mn");
|
|
2045
2045
|
h(this, "Fn");
|
|
2046
|
-
h(this, "
|
|
2047
|
-
h(this, "zn");
|
|
2046
|
+
h(this, "Vr", !1);
|
|
2048
2047
|
h(this, "Rn");
|
|
2048
|
+
h(this, "zn");
|
|
2049
2049
|
h(this, "Tn", { ArrowUp: "UP_ARROW", ArrowDown: "DOWN_ARROW", ArrowLeft: "LEFT_ARROW", ArrowRight: "RIGHT_ARROW", F1: "F1", F2: "F2", F3: "F3", F4: "F4", F5: "F5", F6: "F6", F7: "F7", F8: "F8", F9: "F9", F10: "F10", F11: "F11", F12: "F12", Enter: "ENTER", Return: "RETURN", Tab: "TAB", Escape: "ESCAPE", Backspace: "BACKSPACE", Delete: "DELETE", Insert: "INSERT", Home: "HOME", End: "END", PageUp: "PAGE_UP", PageDown: "PAGE_DOWN", Shift: "SHIFT", Control: "CONTROL", Alt: "ALT", Meta: "META", " ": "SPACE" });
|
|
2050
2050
|
}
|
|
2051
2051
|
an() {
|
|
2052
|
-
this.
|
|
2052
|
+
this.Vr || (this.Mn = (t) => {
|
|
2053
2053
|
this.Pn(t);
|
|
2054
2054
|
}, this.Fn = (t) => {
|
|
2055
2055
|
this.Sn(t);
|
|
2056
|
-
}, window.addEventListener("keydown", this.Mn, { passive: !1 }), window.addEventListener("keyup", this.Fn, { passive: !1 }), this.
|
|
2056
|
+
}, window.addEventListener("keydown", this.Mn, { passive: !1 }), window.addEventListener("keyup", this.Fn, { passive: !1 }), this.Vr = !0);
|
|
2057
2057
|
}
|
|
2058
2058
|
_n() {
|
|
2059
|
-
this.
|
|
2059
|
+
this.Vr && (window.removeEventListener("keydown", this.Mn), window.removeEventListener("keyup", this.Fn), this.Vr = !1, this.Cn.clear(), this.bn = null, this.xn = null);
|
|
2060
2060
|
}
|
|
2061
2061
|
vn(t) {
|
|
2062
|
-
this.
|
|
2062
|
+
this.Rn = t;
|
|
2063
2063
|
}
|
|
2064
2064
|
gn(t) {
|
|
2065
|
-
this.
|
|
2065
|
+
this.zn = t;
|
|
2066
2066
|
}
|
|
2067
2067
|
$n(t) {
|
|
2068
|
-
const e = this.En(t), i = this.
|
|
2068
|
+
const e = this.En(t), i = this.Cn.get(t) || this.Cn.get(e);
|
|
2069
2069
|
return (i == null ? void 0 : i.isPressed) || !1;
|
|
2070
2070
|
}
|
|
2071
2071
|
Dn() {
|
|
@@ -2076,38 +2076,38 @@ class nt {
|
|
|
2076
2076
|
}
|
|
2077
2077
|
Bn() {
|
|
2078
2078
|
const t = [];
|
|
2079
|
-
for (const [e, i] of this.
|
|
2079
|
+
for (const [e, i] of this.Cn) i.isPressed && t.push(e);
|
|
2080
2080
|
return t;
|
|
2081
2081
|
}
|
|
2082
2082
|
Ln() {
|
|
2083
2083
|
return { ctrl: this.$n("Control"), shift: this.$n("Shift"), alt: this.$n("Alt"), meta: this.$n("Meta") };
|
|
2084
2084
|
}
|
|
2085
2085
|
On() {
|
|
2086
|
-
this.
|
|
2086
|
+
this.Cn.clear(), this.bn = null, this.xn = null;
|
|
2087
2087
|
}
|
|
2088
2088
|
Pn(t) {
|
|
2089
2089
|
const e = t.key, i = Date.now();
|
|
2090
|
-
this.
|
|
2091
|
-
const s = this.
|
|
2092
|
-
if (!s.isPressed && (s.isPressed = !0, s.lastPressTime = i, this.bn = e, this.
|
|
2090
|
+
this.Cn.has(e) || this.Cn.set(e, { isPressed: !1, lastPressTime: 0, lastReleaseTime: 0 });
|
|
2091
|
+
const s = this.Cn.get(e);
|
|
2092
|
+
if (!s.isPressed && (s.isPressed = !0, s.lastPressTime = i, this.bn = e, this.Rn)) {
|
|
2093
2093
|
const r = { key: e, keyCode: t.keyCode, ctrlKey: t.ctrlKey, shiftKey: t.shiftKey, altKey: t.altKey, metaKey: t.metaKey, isPressed: !0, originalEvent: t };
|
|
2094
|
-
this.
|
|
2094
|
+
this.Rn(r);
|
|
2095
2095
|
}
|
|
2096
2096
|
}
|
|
2097
2097
|
Sn(t) {
|
|
2098
2098
|
const e = t.key, i = Date.now();
|
|
2099
|
-
this.
|
|
2100
|
-
const s = this.
|
|
2101
|
-
if (s.isPressed = !1, s.lastReleaseTime = i, this.xn = e, this.
|
|
2099
|
+
this.Cn.has(e) || this.Cn.set(e, { isPressed: !1, lastPressTime: 0, lastReleaseTime: 0 });
|
|
2100
|
+
const s = this.Cn.get(e);
|
|
2101
|
+
if (s.isPressed = !1, s.lastReleaseTime = i, this.xn = e, this.zn) {
|
|
2102
2102
|
const r = { key: e, keyCode: t.keyCode, ctrlKey: t.ctrlKey, shiftKey: t.shiftKey, altKey: t.altKey, metaKey: t.metaKey, isPressed: !1, originalEvent: t };
|
|
2103
|
-
this.
|
|
2103
|
+
this.zn(r);
|
|
2104
2104
|
}
|
|
2105
2105
|
}
|
|
2106
2106
|
En(t) {
|
|
2107
2107
|
return this.Tn[t] || t.toLowerCase();
|
|
2108
2108
|
}
|
|
2109
2109
|
}
|
|
2110
|
-
const
|
|
2110
|
+
const Wt = Object.freeze(Object.defineProperty({ __proto__: null, KeyboardManager: nt }, Symbol.toStringTag, { value: "Module" }));
|
|
2111
2111
|
class ot {
|
|
2112
2112
|
constructor(t, e) {
|
|
2113
2113
|
h(this, "er");
|
|
@@ -2121,9 +2121,9 @@ class ot {
|
|
|
2121
2121
|
h(this, "Kn");
|
|
2122
2122
|
h(this, "jn");
|
|
2123
2123
|
h(this, "Yn");
|
|
2124
|
-
h(this, "Vn");
|
|
2125
2124
|
h(this, "qn");
|
|
2126
|
-
h(this, "
|
|
2125
|
+
h(this, "Vn");
|
|
2126
|
+
h(this, "Vr", !1);
|
|
2127
2127
|
h(this, "Zn");
|
|
2128
2128
|
h(this, "Qn");
|
|
2129
2129
|
h(this, "Jn");
|
|
@@ -2151,29 +2151,29 @@ class ot {
|
|
|
2151
2151
|
this.Wn = i.style.touchAction, this.Kn = i.style.userSelect, i.style.touchAction || (i.style.touchAction = "none"), i.style.userSelect || (i.style.userSelect = "none");
|
|
2152
2152
|
}
|
|
2153
2153
|
Ki(t) {
|
|
2154
|
-
this.Or = t, this.
|
|
2154
|
+
this.Or = t, this.wo();
|
|
2155
2155
|
}
|
|
2156
2156
|
an() {
|
|
2157
|
-
if (this.
|
|
2157
|
+
if (this.Vr) return;
|
|
2158
2158
|
const t = this.er.canvas;
|
|
2159
2159
|
this.jn = (e) => {
|
|
2160
|
-
this.
|
|
2160
|
+
this.Co(e);
|
|
2161
2161
|
}, this.Yn = (e) => {
|
|
2162
2162
|
this.bo(e);
|
|
2163
|
-
}, this.Vn = (e) => {
|
|
2164
|
-
this.xo(e);
|
|
2165
2163
|
}, this.qn = (e) => {
|
|
2164
|
+
this.xo(e);
|
|
2165
|
+
}, this.Vn = (e) => {
|
|
2166
2166
|
this.Mo(e);
|
|
2167
|
-
}, t.addEventListener("touchstart", this.jn, { passive: !1 }), t.addEventListener("touchmove", this.Yn, { passive: !1 }), t.addEventListener("touchend", this.
|
|
2167
|
+
}, t.addEventListener("touchstart", this.jn, { passive: !1 }), t.addEventListener("touchmove", this.Yn, { passive: !1 }), t.addEventListener("touchend", this.qn, { passive: !1 }), t.addEventListener("touchcancel", this.Vn, { passive: !1 }), this.Vr = !0;
|
|
2168
2168
|
}
|
|
2169
2169
|
_n() {
|
|
2170
|
-
if (!this.
|
|
2170
|
+
if (!this.Vr) return;
|
|
2171
2171
|
const t = this.er.canvas;
|
|
2172
|
-
t.removeEventListener("touchstart", this.jn), t.removeEventListener("touchmove", this.Yn), t.removeEventListener("touchend", this.
|
|
2172
|
+
t.removeEventListener("touchstart", this.jn), t.removeEventListener("touchmove", this.Yn), t.removeEventListener("touchend", this.qn), t.removeEventListener("touchcancel", this.Vn), this.Vr = !1, this.Xn = null, this.Gn.clear(), this.In.clear(), this.Nn.forEach((e) => {
|
|
2173
2173
|
e.longPressTimer !== null && window.clearTimeout(e.longPressTimer);
|
|
2174
2174
|
}), this.Nn.clear(), this.yo = null, this.Ao = 0, t.style.touchAction = this.Wn, t.style.userSelect = this.Kn;
|
|
2175
2175
|
}
|
|
2176
|
-
|
|
2176
|
+
wo() {
|
|
2177
2177
|
if (!this.Or || this.Gn.size === 0) return;
|
|
2178
2178
|
const t = /* @__PURE__ */ new Map();
|
|
2179
2179
|
for (const e of this.Gn.values()) {
|
|
@@ -2182,10 +2182,10 @@ class ot {
|
|
|
2182
2182
|
}
|
|
2183
2183
|
this.Gn = t;
|
|
2184
2184
|
}
|
|
2185
|
-
|
|
2185
|
+
Ro() {
|
|
2186
2186
|
return Array.from(this.Gn.values()).map((t) => ({ ...t }));
|
|
2187
2187
|
}
|
|
2188
|
-
|
|
2188
|
+
zo(t) {
|
|
2189
2189
|
this.Zn = t;
|
|
2190
2190
|
}
|
|
2191
2191
|
An(t) {
|
|
@@ -2215,7 +2215,7 @@ class ot {
|
|
|
2215
2215
|
Bo(t) {
|
|
2216
2216
|
this.ho = t;
|
|
2217
2217
|
}
|
|
2218
|
-
|
|
2218
|
+
Co(t) {
|
|
2219
2219
|
var s;
|
|
2220
2220
|
if (!this.Or) return;
|
|
2221
2221
|
t.preventDefault(), (s = this.Hn) == null || s.en(this.vo);
|
|
@@ -2326,7 +2326,7 @@ class ot {
|
|
|
2326
2326
|
return 180 * Math.atan2(e.clientY - t.clientY, e.clientX - t.clientX) / Math.PI;
|
|
2327
2327
|
}
|
|
2328
2328
|
}
|
|
2329
|
-
const
|
|
2329
|
+
const kt = Object.freeze(Object.defineProperty({ __proto__: null, TouchManager: ot }, Symbol.toStringTag, { value: "Module" })), Kt = (a) => class extends a {
|
|
2330
2330
|
rotate(t = 0, e = 0, i = 0) {
|
|
2331
2331
|
this.xt.state.st(t), this.xt.state.et(e), this.xt.state.it(i);
|
|
2332
2332
|
}
|
|
@@ -2358,7 +2358,7 @@ const Vt = Object.freeze(Object.defineProperty({ __proto__: null, TouchManager:
|
|
|
2358
2358
|
this.xt.state.tt(t);
|
|
2359
2359
|
}
|
|
2360
2360
|
background(t, e = t, i = t, s = 255) {
|
|
2361
|
-
this.xt.
|
|
2361
|
+
this.xt.Ve(t, e, i, s);
|
|
2362
2362
|
}
|
|
2363
2363
|
char(t) {
|
|
2364
2364
|
this.xt.state.rt(this.$i.Pi(t));
|
|
@@ -2382,7 +2382,7 @@ const Vt = Object.freeze(Object.defineProperty({ __proto__: null, TouchManager:
|
|
|
2382
2382
|
this.xt.state.lt(t);
|
|
2383
2383
|
}
|
|
2384
2384
|
clear() {
|
|
2385
|
-
this.xt.
|
|
2385
|
+
this.xt.Ve(0, 0, 0, 0);
|
|
2386
2386
|
}
|
|
2387
2387
|
ellipse(t, e, i, s) {
|
|
2388
2388
|
this.xt.We(t, e, i / 2, s / 2);
|
|
@@ -2394,7 +2394,7 @@ const Vt = Object.freeze(Object.defineProperty({ __proto__: null, TouchManager:
|
|
|
2394
2394
|
this.xt.je(t, e, i, s, r, n, o, c);
|
|
2395
2395
|
}
|
|
2396
2396
|
arc(t, e, i, s, r, n) {
|
|
2397
|
-
this.xt.
|
|
2397
|
+
this.xt.qe(t, e, i, s, r, n);
|
|
2398
2398
|
}
|
|
2399
2399
|
shader(t) {
|
|
2400
2400
|
this.xt.Be(t);
|
|
@@ -2421,25 +2421,25 @@ const Vt = Object.freeze(Object.defineProperty({ __proto__: null, TouchManager:
|
|
|
2421
2421
|
}
|
|
2422
2422
|
}
|
|
2423
2423
|
async loadImage(t) {
|
|
2424
|
-
if (typeof t != "string") return G.
|
|
2424
|
+
if (typeof t != "string") return G.Rr(this.xt, t, (s) => this.$i.Si(s));
|
|
2425
2425
|
const e = t, i = await new Promise((s, r) => {
|
|
2426
2426
|
const n = new Image();
|
|
2427
2427
|
n.crossOrigin = "anonymous", n.onload = () => s(n), n.onerror = (o) => r(o), n.src = e;
|
|
2428
2428
|
});
|
|
2429
|
-
return G.
|
|
2429
|
+
return G.Rr(this.xt, i, (s) => this.$i.Si(s));
|
|
2430
2430
|
}
|
|
2431
|
-
},
|
|
2431
|
+
}, jt = (a) => class extends a {
|
|
2432
2432
|
async loadFont(t) {
|
|
2433
|
-
return this.$i.
|
|
2433
|
+
return this.$i.Vi(t).then(() => {
|
|
2434
2434
|
const e = this.$i.maxGlyphDimensions;
|
|
2435
|
-
this.Or.hr(e.width, e.height), this.
|
|
2435
|
+
this.Or.hr(e.width, e.height), this.qo.resize(this.Or.cols, this.Or.rows), this.xt.Ze(), this.Hn.hn();
|
|
2436
2436
|
});
|
|
2437
2437
|
}
|
|
2438
2438
|
fontSize(t) {
|
|
2439
2439
|
if (!z.v(typeof t == "number" && t > 0, "Font size must be a positive number greater than 0.", { method: "fontSize", providedValue: t }) || this.$i.fontSize === t) return;
|
|
2440
|
-
this.$i.
|
|
2440
|
+
this.$i.qi(t);
|
|
2441
2441
|
const e = this.$i.maxGlyphDimensions;
|
|
2442
|
-
this.Or.hr(e.width, e.height), this.
|
|
2442
|
+
this.Or.hr(e.width, e.height), this.qo.resize(this.Or.cols, this.Or.rows), this.xt.Ze(), this.Hn.hn();
|
|
2443
2443
|
}
|
|
2444
2444
|
glyphColor(t) {
|
|
2445
2445
|
return this.$i.Pi(t);
|
|
@@ -2447,27 +2447,27 @@ const Vt = Object.freeze(Object.defineProperty({ __proto__: null, TouchManager:
|
|
|
2447
2447
|
glyphColors(t) {
|
|
2448
2448
|
return this.$i.Si(t);
|
|
2449
2449
|
}
|
|
2450
|
-
},
|
|
2450
|
+
}, qt = (a) => class extends a {
|
|
2451
2451
|
get frameCount() {
|
|
2452
|
-
return this.
|
|
2452
|
+
return this.Vo.frameCount;
|
|
2453
2453
|
}
|
|
2454
2454
|
set frameCount(t) {
|
|
2455
|
-
this.
|
|
2455
|
+
this.Vo.frameCount = t;
|
|
2456
2456
|
}
|
|
2457
2457
|
frameRate(t) {
|
|
2458
|
-
return t === void 0 ? this.
|
|
2458
|
+
return t === void 0 ? this.Vo.currentFrameRate : this.Vo.frameRate(t, () => this.Zo());
|
|
2459
2459
|
}
|
|
2460
2460
|
noLoop() {
|
|
2461
|
-
this.
|
|
2461
|
+
this.Vo.pause();
|
|
2462
2462
|
}
|
|
2463
2463
|
loop() {
|
|
2464
|
-
this.
|
|
2464
|
+
this.Vo.resume(() => this.Zo());
|
|
2465
2465
|
}
|
|
2466
2466
|
redraw(t = 1) {
|
|
2467
2467
|
if (z.v(typeof t == "number" && t > 0 && Number.isInteger(t), "Redraw count must be a positive integer.", { method: "redraw", providedValue: t })) for (let e = 0; e < t; e++) this.Zo();
|
|
2468
2468
|
}
|
|
2469
2469
|
isLooping() {
|
|
2470
|
-
return this.
|
|
2470
|
+
return this.Vo.isLooping;
|
|
2471
2471
|
}
|
|
2472
2472
|
}, Zt = (a) => class extends a {
|
|
2473
2473
|
constructor(...t) {
|
|
@@ -2489,7 +2489,7 @@ const Vt = Object.freeze(Object.defineProperty({ __proto__: null, TouchManager:
|
|
|
2489
2489
|
this.Hn.yn(t);
|
|
2490
2490
|
}
|
|
2491
2491
|
get mouse() {
|
|
2492
|
-
return this.Hn.
|
|
2492
|
+
return this.Hn.wn();
|
|
2493
2493
|
}
|
|
2494
2494
|
cursor(t) {
|
|
2495
2495
|
this.Hn.nn(t);
|
|
@@ -2499,7 +2499,7 @@ const Vt = Object.freeze(Object.defineProperty({ __proto__: null, TouchManager:
|
|
|
2499
2499
|
super(...t);
|
|
2500
2500
|
}
|
|
2501
2501
|
touchStarted(t) {
|
|
2502
|
-
this.Qo.
|
|
2502
|
+
this.Qo.zo(t);
|
|
2503
2503
|
}
|
|
2504
2504
|
touchMoved(t) {
|
|
2505
2505
|
this.Qo.An(t);
|
|
@@ -2529,7 +2529,7 @@ const Vt = Object.freeze(Object.defineProperty({ __proto__: null, TouchManager:
|
|
|
2529
2529
|
this.Qo.Bo(t);
|
|
2530
2530
|
}
|
|
2531
2531
|
get touches() {
|
|
2532
|
-
return this.Qo.
|
|
2532
|
+
return this.Qo.Ro();
|
|
2533
2533
|
}
|
|
2534
2534
|
}, Jt = (a) => class extends a {
|
|
2535
2535
|
constructor(...t) {
|
|
@@ -2629,12 +2629,12 @@ class te {
|
|
|
2629
2629
|
h(this, "$i");
|
|
2630
2630
|
h(this, "er");
|
|
2631
2631
|
h(this, "Or");
|
|
2632
|
-
h(this, "
|
|
2632
|
+
h(this, "Vo");
|
|
2633
2633
|
h(this, "Hn");
|
|
2634
2634
|
h(this, "Qo");
|
|
2635
2635
|
h(this, "Jo");
|
|
2636
2636
|
h(this, "_h");
|
|
2637
|
-
h(this, "
|
|
2637
|
+
h(this, "qo");
|
|
2638
2638
|
h(this, "mh");
|
|
2639
2639
|
h(this, "gh");
|
|
2640
2640
|
h(this, "Ah");
|
|
@@ -2644,68 +2644,79 @@ class te {
|
|
|
2644
2644
|
}
|
|
2645
2645
|
class ee extends function(e, ...i) {
|
|
2646
2646
|
return i.reduce((s, r) => r(s), e);
|
|
2647
|
-
}(te,
|
|
2647
|
+
}(te, Kt, jt, qt, Zt, Qt, Jt) {
|
|
2648
2648
|
constructor(e = {}) {
|
|
2649
2649
|
super();
|
|
2650
2650
|
h(this, "yh");
|
|
2651
|
+
h(this, "wh", !1);
|
|
2651
2652
|
h(this, "Ch", !1);
|
|
2652
|
-
h(this, "
|
|
2653
|
+
h(this, "bh", !1);
|
|
2654
|
+
h(this, "xh", () => {
|
|
2653
2655
|
});
|
|
2654
|
-
h(this, "
|
|
2656
|
+
h(this, "Mh", () => {
|
|
2655
2657
|
});
|
|
2656
|
-
h(this, "
|
|
2658
|
+
h(this, "Fh", () => {
|
|
2657
2659
|
});
|
|
2658
|
-
h(this, "
|
|
2660
|
+
h(this, "Rh");
|
|
2659
2661
|
h(this, "lr");
|
|
2660
2662
|
h(this, "cr", !1);
|
|
2661
|
-
h(this, "
|
|
2662
|
-
this.yh = new $t(this), this.cr = e.overlay ?? !1, this.er = new Xt(e), this.xt = new Ut(this.er.gr()), this.$i = new Gt(this.xt, e.fontSize ?? 16), this.
|
|
2663
|
+
h(this, "zh");
|
|
2664
|
+
this.yh = new $t(this), this.cr = e.overlay ?? !1, this.er = new Xt(e), this.xt = new Ut(this.er.gr()), this.$i = new Gt(this.xt, e.fontSize ?? 16), this.Vo = new Yt(e.frameRate ?? 60), this.Hn = new rt(this.er), this.Qo = new ot(this.er, this.Hn), this.Jo = new nt(), this._h = this.xt.Pt(), this.mh = this.xt.rs(), this.Th(e);
|
|
2663
2665
|
}
|
|
2664
|
-
async
|
|
2666
|
+
async Th(e) {
|
|
2665
2667
|
await this.$i.Ki(e.fontSource);
|
|
2666
2668
|
const i = this.$i.maxGlyphDimensions;
|
|
2667
|
-
this.Or = new Ht(this.er.canvas, i.width, i.height), this.Hn.Ki(this.Or), this.Qo.Ki(this.Or), this.
|
|
2669
|
+
this.Or = new Ht(this.er.canvas, i.width, i.height), this.Hn.Ki(this.Or), this.Qo.Ki(this.Or), this.qo = this.xt.Ye(this.Or.cols, this.Or.rows, 5), this.gh = this.xt.Ye(this.Or.width, this.Or.height, 1), this.cr && (this.zh = G.Rr(this.xt, this.er.targetCanvas, (s) => this.$i.Si(s))), this.Ah = this.xt.cs(st, "precision mediump float;uniform sampler2D Ua;uniform vec2 Ub;uniform vec2 Uc;uniform vec2 Ud;void main(){vec2 A=gl_FragCoord.xy-Uc;vec2 B=A*(Ub/Ud);vec2 C=(floor(B)+0.5)/Ub;gl_FragColor=texture2D(Ua,C);}"), this.Ph(), await this.yh.nh(e.plugins ?? []), this.xh(), this.Vo.start(() => this.Zo());
|
|
2668
2670
|
}
|
|
2669
2671
|
dh() {
|
|
2670
|
-
return { renderer: this.xt, font: this.$i, grid: this.Or, canvas: this.er, drawFramebuffer: this.
|
|
2672
|
+
return { renderer: this.xt, font: this.$i, grid: this.Or, canvas: this.er, drawFramebuffer: this.qo, asciiFramebuffer: this.gh, flushDrawCommands: () => {
|
|
2671
2673
|
this.xt.St(this._h);
|
|
2672
2674
|
} };
|
|
2673
2675
|
}
|
|
2674
|
-
|
|
2675
|
-
this.
|
|
2676
|
-
this.cr && this.resizeCanvas(this.er.targetCanvas.width, this.er.targetCanvas.height), this.
|
|
2677
|
-
}, window.addEventListener("resize", this.
|
|
2676
|
+
Ph() {
|
|
2677
|
+
this.Rh = () => {
|
|
2678
|
+
this.cr && this.resizeCanvas(this.er.targetCanvas.width, this.er.targetCanvas.height), this.Fh();
|
|
2679
|
+
}, window.addEventListener("resize", this.Rh), this.Hn.an(), this.Qo.an(), this.Jo.an(), window.addEventListener("blur", () => {
|
|
2678
2680
|
this.Jo.On();
|
|
2679
2681
|
}), window.ResizeObserver && this.cr && (this.lr = new ResizeObserver(() => {
|
|
2680
2682
|
this.resizeCanvas(this.er.targetCanvas.width, this.er.targetCanvas.height);
|
|
2681
2683
|
}), this.lr.observe(this.er.targetCanvas));
|
|
2682
2684
|
}
|
|
2683
2685
|
Zo() {
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2686
|
+
this.Ch = !0;
|
|
2687
|
+
try {
|
|
2688
|
+
if (this.Vo.measureFrameRate(), this.Vo.incrementFrame(), this.cr) {
|
|
2689
|
+
const i = this.xt.context;
|
|
2690
|
+
i.bindTexture(i.TEXTURE_2D, this.zh.texture), i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL, 1), i.texImage2D(i.TEXTURE_2D, 0, i.RGBA, i.RGBA, i.UNSIGNED_BYTE, this.er.targetCanvas), i.bindTexture(i.TEXTURE_2D, null);
|
|
2691
|
+
}
|
|
2692
|
+
this.yh.runPreDrawHooks(), this.qo.begin(), this.xt.ke(this._h), this.Mh(), this.xt.St(this._h), this.qo.end(), this.gh.begin(), this.xt.ke(this.mh), this.mh.Wt({ U0: this.$i.fontFramebuffer, U1: [this.$i.textureColumns, this.$i.textureRows], U2: this.qo.textures[0], U3: this.qo.textures[1], U4: this.qo.textures[2], U5: this.qo.textures[4], U6: this.qo.textures[3], U7: [this.Or.cols, this.Or.rows], U8: [this.gh.width, this.gh.height], U9: this.gh.width / this.gh.height }), this.xt.Ie(0, 0, this.er.width, this.er.height), this.gh.end();
|
|
2693
|
+
const e = this.xt.state.canvasBackgroundColor;
|
|
2694
|
+
this.xt.Ys(e[0], e[1], e[2], e[3]), this.xt.ke(this.Ah), this.Ah.Wt({ Ua: this.gh.textures[0], Ub: [this.gh.width, this.gh.height], Uc: [this.Or.offsetX, this.Or.offsetY], Ud: [this.Or.width, this.Or.height] }), this.xt.Ie(this.Or.offsetX, this.Or.offsetY, this.Or.width, this.Or.height), this.yh.runPostDrawHooks();
|
|
2695
|
+
} catch (e) {
|
|
2696
|
+
console.error("[textmode.js] Error during render:", e);
|
|
2697
|
+
} finally {
|
|
2698
|
+
this.Ch = !1, this.wh && !this.bh && this.Sh();
|
|
2688
2699
|
}
|
|
2689
|
-
this.yh.runPreDrawHooks(), this.Vo.begin(), this.xt.ke(this._h), this.bh(), this.xt.St(this._h), this.Vo.end(), this.gh.begin(), this.xt.ke(this.mh), this.mh.Wt({ U0: this.$i.fontFramebuffer, U1: [this.$i.textureColumns, this.$i.textureRows], U2: this.Vo.textures[0], U3: this.Vo.textures[1], U4: this.Vo.textures[2], U5: this.Vo.textures[4], U6: this.Vo.textures[3], U7: [this.Or.cols, this.Or.rows], U8: [this.gh.width, this.gh.height], U9: this.gh.width / this.gh.height }), this.xt.Ie(0, 0, this.er.width, this.er.height), this.gh.end();
|
|
2690
|
-
const e = this.xt.state.canvasBackgroundColor;
|
|
2691
|
-
this.xt.Ys(e[0], e[1], e[2], e[3]), this.xt.ke(this.Ah), this.Ah.Wt({ Ua: this.gh.textures[0], Ub: [this.gh.width, this.gh.height], Uc: [this.Or.offsetX, this.Or.offsetY], Ud: [this.Or.width, this.Or.height] }), this.xt.Ie(this.Or.offsetX, this.Or.offsetY, this.Or.width, this.Or.height), this.yh.runPostDrawHooks();
|
|
2692
2700
|
}
|
|
2693
2701
|
setup(e) {
|
|
2694
|
-
this.
|
|
2702
|
+
this.xh = e;
|
|
2695
2703
|
}
|
|
2696
2704
|
draw(e) {
|
|
2697
|
-
this.
|
|
2705
|
+
this.Mh = e;
|
|
2698
2706
|
}
|
|
2699
2707
|
windowResized(e) {
|
|
2700
|
-
this.
|
|
2708
|
+
this.Fh = e;
|
|
2701
2709
|
}
|
|
2702
2710
|
resizeCanvas(e, i) {
|
|
2703
|
-
this.er.vr(e, i), this.Or.nr(), this.
|
|
2711
|
+
this.er.vr(e, i), this.Or.nr(), this.qo.resize(this.Or.cols, this.Or.rows), this.gh.resize(this.Or.width, this.Or.height), this.xt.Ze(), this.Hn.hn(), this.Qo.wo(), this.Zo();
|
|
2704
2712
|
}
|
|
2705
2713
|
destroy() {
|
|
2706
|
-
this.
|
|
2714
|
+
this.bh || this.wh || (this.wh = !0, this.Vo.stop(), this.noLoop(), this.Ch || this.Sh());
|
|
2715
|
+
}
|
|
2716
|
+
Sh() {
|
|
2717
|
+
this.bh || (this.wh = !1, this.yh.fh().catch((e) => {
|
|
2707
2718
|
console.error("[textmode.js] Error while disposing plugins:", e);
|
|
2708
|
-
}), window.removeEventListener("resize", this.
|
|
2719
|
+
}), window.removeEventListener("resize", this.Rh), this.Hn._n(), this.Qo._n(), this.Jo._n(), this.$i.Dt(), this.xt.Dt(), this.gh.Dt(), this.Ah.Dt(), this.er.Dt(), this.zh && this.zh.Dt(), this.bh = !0);
|
|
2709
2720
|
}
|
|
2710
2721
|
get grid() {
|
|
2711
2722
|
return this.Or;
|
|
@@ -2723,13 +2734,13 @@ class ee extends function(e, ...i) {
|
|
|
2723
2734
|
return this.er.canvas;
|
|
2724
2735
|
}
|
|
2725
2736
|
get drawFramebuffer() {
|
|
2726
|
-
return this.
|
|
2737
|
+
return this.qo;
|
|
2727
2738
|
}
|
|
2728
2739
|
get isDisposed() {
|
|
2729
|
-
return this.
|
|
2740
|
+
return this.bh;
|
|
2730
2741
|
}
|
|
2731
2742
|
get overlay() {
|
|
2732
|
-
return this.
|
|
2743
|
+
return this.zh;
|
|
2733
2744
|
}
|
|
2734
2745
|
}
|
|
2735
2746
|
class Q {
|
|
@@ -2742,15 +2753,15 @@ class Q {
|
|
|
2742
2753
|
z.A(t);
|
|
2743
2754
|
}
|
|
2744
2755
|
static get version() {
|
|
2745
|
-
return "0.4.
|
|
2756
|
+
return "0.4.1-beta.1";
|
|
2746
2757
|
}
|
|
2747
2758
|
}
|
|
2748
|
-
const se = Object.freeze(Object.defineProperty({ __proto__: null, keyboard:
|
|
2759
|
+
const se = Object.freeze(Object.defineProperty({ __proto__: null, keyboard: Wt, mouse: Vt, touch: kt }, Symbol.toStringTag, { value: "Module" })), re = Q.create, ne = Q.setErrorLevel, oe = Q.version;
|
|
2749
2760
|
export {
|
|
2750
2761
|
Xt as TextmodeCanvas,
|
|
2751
2762
|
ct as TextmodeErrorLevel,
|
|
2752
2763
|
Gt as TextmodeFont,
|
|
2753
|
-
|
|
2764
|
+
q as TextmodeFramebuffer,
|
|
2754
2765
|
Ht as TextmodeGrid,
|
|
2755
2766
|
G as TextmodeImage,
|
|
2756
2767
|
ee as Textmodifier,
|