textmode.js 0.1.6-beta.6 → 0.1.6-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/textmode.esm.js +1193 -1167
  2. package/dist/textmode.esm.min.js +1234 -1208
  3. package/dist/textmode.umd.js +56 -18
  4. package/dist/textmode.umd.min.js +56 -18
  5. package/dist/types/errors/Error.d.ts +3 -5
  6. package/dist/types/errors/ErrorHandler.d.ts +3 -3
  7. package/dist/types/export/base/DataExtractor.d.ts +3 -3
  8. package/dist/types/export/base/FileHandler.d.ts +6 -6
  9. package/dist/types/export/image/ImageContentGenerator.d.ts +3 -3
  10. package/dist/types/export/image/ImageDataExtractor.d.ts +1 -1
  11. package/dist/types/export/image/ImageExporter.d.ts +8 -8
  12. package/dist/types/export/image/ImageFileHandler.d.ts +3 -15
  13. package/dist/types/export/svg/SVGContentGenerator.d.ts +11 -11
  14. package/dist/types/export/svg/SVGDataExtractor.d.ts +3 -3
  15. package/dist/types/export/svg/SVGExporter.d.ts +6 -6
  16. package/dist/types/export/svg/SVGFileHandler.d.ts +3 -3
  17. package/dist/types/export/svg/SVGPathGenerator.d.ts +5 -6
  18. package/dist/types/export/txt/TXTContentGenerator.d.ts +1 -1
  19. package/dist/types/export/txt/TXTDataExtractor.d.ts +1 -1
  20. package/dist/types/export/txt/TXTExporter.d.ts +6 -6
  21. package/dist/types/export/txt/TXTFileHandler.d.ts +2 -2
  22. package/dist/types/rendering/webgl/Framebuffer.d.ts +8 -8
  23. package/dist/types/rendering/webgl/Renderer.d.ts +35 -35
  24. package/dist/types/rendering/webgl/Shader.d.ts +14 -14
  25. package/dist/types/rendering/webgl/geometries/BaseGeometry.d.ts +10 -10
  26. package/dist/types/rendering/webgl/geometries/Line.d.ts +1 -1
  27. package/dist/types/rendering/webgl/geometries/Rectangle.d.ts +2 -2
  28. package/dist/types/textmode/Canvas.d.ts +9 -7
  29. package/dist/types/textmode/ConversionPipeline.d.ts +23 -15
  30. package/dist/types/textmode/Grid.d.ts +6 -6
  31. package/dist/types/textmode/Textmodifier.d.ts +13 -15
  32. package/dist/types/textmode/converters/BrightnessConverter.d.ts +8 -8
  33. package/dist/types/textmode/converters/Converter.d.ts +5 -5
  34. package/dist/types/textmode/converters/FeatureConverter.d.ts +6 -6
  35. package/dist/types/textmode/font/TextmodeFont.d.ts +8 -8
  36. package/package.json +1 -1
@@ -1,91 +1,88 @@
1
1
  var Z = Object.defineProperty;
2
2
  var q = (E, A, t) => A in E ? Z(E, A, { enumerable: !0, configurable: !0, writable: !0, value: t }) : E[A] = t;
3
- var r = (E, A, t) => q(E, typeof A != "symbol" ? A + "" : A, t);
3
+ var Q = (E, A, t) => q(E, typeof A != "symbol" ? A + "" : A, t);
4
4
  class I extends Error {
5
- constructor(t, e, B = {}) {
6
- super(I.t(t, B));
7
- r(this, "A");
8
- r(this, "context");
9
- this.name = "TextmodeError", this.A = e, this.context = B;
10
- }
11
- static t(t, e) {
12
- let B = t;
13
- if (e && Object.keys(e).length > 0) {
14
- B += `
5
+ constructor(A, t = {}) {
6
+ super(I.A(A, t)), this.name = "TextmodeError";
7
+ }
8
+ static A(A, t) {
9
+ let e = A;
10
+ if (t && Object.keys(t).length > 0) {
11
+ e += `
15
12
 
16
13
  📋 Context:`;
17
- for (const [s, Q] of Object.entries(e))
18
- B += `
19
- - ${s}: ${I.i(Q)}`;
14
+ for (const [r, B] of Object.entries(t))
15
+ e += `
16
+ - ${r}: ${I.i(B)}`;
20
17
  }
21
- return B += `
18
+ return e += `
22
19
 
23
- `, B += "↓".repeat(24) + `
24
- `, B;
25
- }
26
- static i(t) {
27
- if (t === null) return "null";
28
- if (t === void 0) return "undefined";
29
- if (typeof t == "string") return `"${t}"`;
30
- if (typeof t == "number" || typeof t == "boolean") return t + "";
31
- if (Array.isArray(t)) return t.length === 0 ? "[]" : t.length <= 5 ? `[${t.map((e) => I.i(e)).join(", ")}]` : `[${t.slice(0, 3).map((e) => I.i(e)).join(", ")}, ... +${t.length - 3} more]`;
32
- if (typeof t == "object") {
33
- const e = Object.keys(t);
34
- return e.length === 0 ? "{}" : e.length <= 3 ? `{ ${e.map((B) => `${B}: ${I.i(t[B])}`).join(", ")} }` : `{ ${e.slice(0, 2).map((B) => `${B}: ${I.i(t[B])}`).join(", ")}, ... +${e.length - 2} more }`;
20
+ `, e += "↓".repeat(24) + `
21
+ `, e;
22
+ }
23
+ static i(A) {
24
+ if (A === null) return "null";
25
+ if (A === void 0) return "undefined";
26
+ if (typeof A == "string") return `"${A}"`;
27
+ if (typeof A == "number" || typeof A == "boolean") return A + "";
28
+ if (Array.isArray(A)) return A.length === 0 ? "[]" : A.length <= 5 ? `[${A.map((t) => I.i(t)).join(", ")}]` : `[${A.slice(0, 3).map((t) => I.i(t)).join(", ")}, ... +${A.length - 3} more]`;
29
+ if (typeof A == "object") {
30
+ const t = Object.keys(A);
31
+ return t.length === 0 ? "{}" : t.length <= 3 ? `{ ${t.map((e) => `${e}: ${I.i(A[e])}`).join(", ")} }` : `{ ${t.slice(0, 2).map((e) => `${e}: ${I.i(A[e])}`).join(", ")}, ... +${t.length - 2} more }`;
35
32
  }
36
- return t + "";
33
+ return A + "";
37
34
  }
38
35
  }
39
36
  var AA = ((E) => (E[E.SILENT = 0] = "SILENT", E[E.WARNING = 1] = "WARNING", E[E.ERROR = 2] = "ERROR", E[E.THROW = 3] = "THROW", E))(AA || {});
40
37
  const x = class x {
41
38
  constructor() {
42
- r(this, "h", { D: 3 });
39
+ Q(this, "h", { globalLevel: 3 });
43
40
  }
44
- static C() {
41
+ static D() {
45
42
  return x.o || (x.o = new x()), x.o;
46
43
  }
47
- l(A, t, e) {
48
- const B = "%c[textmode.js] Oops! (╯°□°)╯︵ Something went wrong in your code.", s = "color: #f44336; font-weight: bold; background: #ffebee; padding: 2px 6px; border-radius: 3px;";
49
- switch (this.h.D) {
44
+ l(A, t) {
45
+ const e = "%c[textmode.js] Oops! (╯°□°)╯︵ Something went wrong in your code.", r = "color: #f44336; font-weight: bold; background: #ffebee; padding: 2px 6px; border-radius: 3px;";
46
+ switch (this.h.globalLevel) {
50
47
  case 0:
51
48
  return !1;
52
49
  case 1:
53
- return console.group(B, s), console.warn(I.t(A, t)), console.groupEnd(), !1;
50
+ return console.group(e, r), console.warn(I.A(A, t)), console.groupEnd(), !1;
54
51
  case 2:
55
- return console.group(B, s), console.error(I.t(A, t)), console.groupEnd(), !1;
52
+ return console.group(e, r), console.error(I.A(A, t)), console.groupEnd(), !1;
56
53
  default:
57
- throw new I(A, e, t);
54
+ throw new I(A, t);
58
55
  }
59
56
  }
60
- validate(A, t, e) {
57
+ C(A, t, e) {
61
58
  return !!A || (this.l(t, e), !1);
62
59
  }
63
60
  u(A) {
64
- this.h.D = A;
61
+ this.h.globalLevel = A;
65
62
  }
66
63
  };
67
- r(x, "o", null);
68
- let F = x;
69
- const u = F.C(), N = /* @__PURE__ */ new WeakMap();
70
- function S(E, A) {
64
+ Q(x, "o", null);
65
+ let U = x;
66
+ const P = U.D(), N = /* @__PURE__ */ new WeakMap();
67
+ function F(E, A) {
71
68
  N.set(E, A);
72
69
  }
73
- function J(E) {
70
+ function V(E) {
74
71
  return N.get(E);
75
72
  }
76
- class X {
77
- constructor(A, t, e = t, B = {}) {
78
- r(this, "P");
79
- r(this, "I");
80
- r(this, "m");
81
- r(this, "p");
82
- r(this, "v");
83
- r(this, "options");
84
- r(this, "_", null);
85
- r(this, "M", null);
86
- this.P = A, this.p = t, this.v = e, this.options = { filter: "nearest", wrap: "clamp", format: "rgba", type: "unsigned_byte", ...B }, this.m = this.createTexture(), this.I = A.createFramebuffer(), this.G();
87
- }
88
- F(A) {
73
+ class K {
74
+ constructor(A, t, e = t, r = {}) {
75
+ Q(this, "P");
76
+ Q(this, "I");
77
+ Q(this, "m");
78
+ Q(this, "p");
79
+ Q(this, "_");
80
+ Q(this, "h");
81
+ Q(this, "v", null);
82
+ Q(this, "M", null);
83
+ this.P = A, this.p = t, this._ = e, this.h = { filter: "nearest", wrap: "clamp", format: "rgba", type: "unsigned_byte", ...r }, this.m = this.G(), this.I = A.createFramebuffer(), this.F();
84
+ }
85
+ Y(A) {
89
86
  const { P: t } = this, e = t.getParameter(t.FRAMEBUFFER_BINDING);
90
87
  t.bindFramebuffer(t.FRAMEBUFFER, this.I);
91
88
  try {
@@ -94,17 +91,17 @@ class X {
94
91
  t.bindFramebuffer(t.FRAMEBUFFER, e);
95
92
  }
96
93
  }
97
- createTexture() {
94
+ G() {
98
95
  const { P: A } = this, t = A.createTexture();
99
96
  A.bindTexture(A.TEXTURE_2D, t);
100
- const e = this.options.filter === "linear" ? A.LINEAR : A.NEAREST, B = this.options.wrap === "repeat" ? A.REPEAT : A.CLAMP_TO_EDGE;
101
- return A.texParameteri(A.TEXTURE_2D, A.TEXTURE_MIN_FILTER, e), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_MAG_FILTER, e), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_WRAP_S, B), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_WRAP_T, B), this.Y(), t;
97
+ const e = this.h.filter === "linear" ? A.LINEAR : A.NEAREST, r = this.h.wrap === "repeat" ? A.REPEAT : A.CLAMP_TO_EDGE;
98
+ return A.texParameteri(A.TEXTURE_2D, A.TEXTURE_MIN_FILTER, e), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_MAG_FILTER, e), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_WRAP_S, r), A.texParameteri(A.TEXTURE_2D, A.TEXTURE_WRAP_T, r), this.$(), t;
102
99
  }
103
- Y() {
104
- const { P: A } = this, t = this.options.type === "float" ? A.FLOAT : A.UNSIGNED_BYTE;
105
- A.texImage2D(A.TEXTURE_2D, 0, A.RGBA, this.p, this.v, 0, A.RGBA, t, null);
100
+ $() {
101
+ const { P: A } = this, t = this.h.type === "float" ? A.FLOAT : A.UNSIGNED_BYTE;
102
+ A.texImage2D(A.TEXTURE_2D, 0, A.RGBA, this.p, this._, 0, A.RGBA, t, null);
106
103
  }
107
- G() {
104
+ F() {
108
105
  const { P: A } = this;
109
106
  A.bindFramebuffer(A.FRAMEBUFFER, this.I), A.framebufferTexture2D(A.FRAMEBUFFER, A.COLOR_ATTACHMENT0, A.TEXTURE_2D, this.m, 0), A.bindFramebuffer(A.FRAMEBUFFER, null);
110
107
  }
@@ -112,47 +109,47 @@ class X {
112
109
  const { P: t } = this;
113
110
  t.bindTexture(t.TEXTURE_2D, this.m), t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL, 1), t.texImage2D(t.TEXTURE_2D, 0, t.RGBA, t.RGBA, t.UNSIGNED_BYTE, A), t.bindTexture(t.TEXTURE_2D, null);
114
111
  }
115
- S(A, t, e) {
116
- const { P: B } = this;
117
- B.bindTexture(B.TEXTURE_2D, this.m), B.texImage2D(B.TEXTURE_2D, 0, B.RGBA, t, e, 0, B.RGBA, B.UNSIGNED_BYTE, A), B.bindTexture(B.TEXTURE_2D, null);
112
+ updatePixels(A, t, e) {
113
+ const { P: r } = this;
114
+ r.bindTexture(r.TEXTURE_2D, this.m), r.texImage2D(r.TEXTURE_2D, 0, r.RGBA, t, e, 0, r.RGBA, r.UNSIGNED_BYTE, A), r.bindTexture(r.TEXTURE_2D, null);
118
115
  }
119
116
  resize(A, t) {
120
117
  const { P: e } = this;
121
- this.p = A, this.v = t, this.M = null, e.bindTexture(e.TEXTURE_2D, this.m), this.Y(), e.bindTexture(e.TEXTURE_2D, null);
118
+ this.p = A, this._ = t, this.M = null, e.bindTexture(e.TEXTURE_2D, this.m), this.$(), e.bindTexture(e.TEXTURE_2D, null);
122
119
  }
123
- O() {
120
+ begin() {
124
121
  const { P: A } = this;
125
- this._ = { framebuffer: A.getParameter(A.FRAMEBUFFER_BINDING), viewport: A.getParameter(A.VIEWPORT) }, A.bindFramebuffer(A.FRAMEBUFFER, this.I), A.viewport(0, 0, this.p, this.v), S(A, [0, 0, this.p, this.v]);
122
+ this.v = { framebuffer: A.getParameter(A.FRAMEBUFFER_BINDING), viewport: A.getParameter(A.VIEWPORT) }, A.bindFramebuffer(A.FRAMEBUFFER, this.I), A.viewport(0, 0, this.p, this._), F(A, [0, 0, this.p, this._]);
126
123
  }
127
124
  end() {
128
- if (!this._) return;
125
+ if (!this.v) return;
129
126
  const { P: A } = this;
130
- A.bindFramebuffer(A.FRAMEBUFFER, this._.framebuffer), A.viewport(...this._.viewport), S(A, this._.viewport), this._ = null;
127
+ A.bindFramebuffer(A.FRAMEBUFFER, this.v.framebuffer), A.viewport(...this.v.viewport), F(A, this.v.viewport), this.v = null;
131
128
  }
132
- U() {
129
+ loadPixels() {
133
130
  const { P: A } = this;
134
- this.M || (this.M = new Uint8Array(this.p * this.v * 4)), this.F(() => {
135
- A.readPixels(0, 0, this.p, this.v, A.RGBA, A.UNSIGNED_BYTE, this.M);
131
+ this.M || (this.M = new Uint8Array(this.p * this._ * 4)), this.Y(() => {
132
+ A.readPixels(0, 0, this.p, this._, A.RGBA, A.UNSIGNED_BYTE, this.M);
136
133
  });
137
134
  }
138
- get(A, t, e, B) {
139
- const { P: s } = this;
135
+ get(A, t, e, r) {
136
+ const { P: B } = this;
140
137
  if (A === void 0 && t === void 0) {
141
- const Q = new Uint8Array(this.p * this.v * 4);
142
- return this.F(() => (s.readPixels(0, 0, this.p, this.v, s.RGBA, s.UNSIGNED_BYTE, Q), Q));
138
+ const s = new Uint8Array(this.p * this._ * 4);
139
+ return this.Y(() => (B.readPixels(0, 0, this.p, this._, B.RGBA, B.UNSIGNED_BYTE, s), s));
143
140
  }
144
- if (e === void 0 && B === void 0) {
145
- (A < 0 || t < 0 || A >= this.p || t >= this.v) && (console.warn("The x and y values passed to Framebuffer.get are outside of its range and will be clamped."), A = Math.max(0, Math.min(A, this.p - 1)), t = Math.max(0, Math.min(t, this.v - 1)));
146
- const Q = new Uint8Array(4);
147
- return this.F(() => (s.readPixels(A, t, 1, 1, s.RGBA, s.UNSIGNED_BYTE, Q), [Q[0], Q[1], Q[2], Q[3]]));
141
+ if (e === void 0 && r === void 0) {
142
+ (A < 0 || t < 0 || A >= this.p || t >= this._) && (console.warn("The x and y values passed to Framebuffer.get are outside of its range and will be clamped."), A = Math.max(0, Math.min(A, this.p - 1)), t = Math.max(0, Math.min(t, this._ - 1)));
143
+ const s = new Uint8Array(4);
144
+ return this.Y(() => (B.readPixels(A, t, 1, 1, B.RGBA, B.UNSIGNED_BYTE, s), [s[0], s[1], s[2], s[3]]));
148
145
  }
149
146
  {
150
- A = Math.max(0, Math.min(A, this.p - 1)), t = Math.max(0, Math.min(t, this.v - 1)), e = Math.max(1, Math.min(e, this.p - A)), B = Math.max(1, Math.min(B, this.v - t));
151
- const Q = new Uint8Array(e * B * 4);
152
- return this.F(() => (s.readPixels(A, t, e, B, s.RGBA, s.UNSIGNED_BYTE, Q), Q));
147
+ A = Math.max(0, Math.min(A, this.p - 1)), t = Math.max(0, Math.min(t, this._ - 1)), e = Math.max(1, Math.min(e, this.p - A)), r = Math.max(1, Math.min(r, this._ - t));
148
+ const s = new Uint8Array(e * r * 4);
149
+ return this.Y(() => (B.readPixels(A, t, e, r, B.RGBA, B.UNSIGNED_BYTE, s), s));
153
150
  }
154
151
  }
155
- dispose() {
152
+ S() {
156
153
  this.I && this.P.deleteFramebuffer(this.I), this.m && this.P.deleteTexture(this.m);
157
154
  }
158
155
  get framebuffer() {
@@ -165,55 +162,55 @@ class X {
165
162
  return this.p;
166
163
  }
167
164
  get height() {
168
- return this.v;
165
+ return this._;
169
166
  }
170
- get k() {
167
+ get pixels() {
171
168
  return this.M;
172
169
  }
173
170
  }
174
- class f {
171
+ class w {
175
172
  constructor(A, t, e) {
176
- r(this, "P");
177
- r(this, "V");
178
- r(this, "H", /* @__PURE__ */ new Map());
179
- r(this, "R", /* @__PURE__ */ new Map());
180
- r(this, "$", 0);
181
- r(this, "J");
182
- this.P = A, this.V = this.createProgram(t, e), this.J = A.getParameter(A.MAX_TEXTURE_IMAGE_UNITS), this.L();
183
- }
184
- L() {
185
- const A = this.P.getProgramParameter(this.V, this.P.ACTIVE_UNIFORMS);
173
+ Q(this, "P");
174
+ Q(this, "O");
175
+ Q(this, "U", /* @__PURE__ */ new Map());
176
+ Q(this, "k", /* @__PURE__ */ new Map());
177
+ Q(this, "V", 0);
178
+ Q(this, "R");
179
+ this.P = A, this.O = this.H(t, e), this.R = A.getParameter(A.MAX_TEXTURE_IMAGE_UNITS), this.J();
180
+ }
181
+ J() {
182
+ const A = this.P.getProgramParameter(this.O, this.P.ACTIVE_UNIFORMS);
186
183
  for (let t = 0; t < A; t++) {
187
- const e = this.P.getActiveUniform(this.V, t);
184
+ const e = this.P.getActiveUniform(this.O, t);
188
185
  if (e) {
189
- const B = this.P.getUniformLocation(this.V, e.name);
190
- B && (this.H.set(e.name, B), this.R.set(e.name, e.type));
186
+ const r = this.P.getUniformLocation(this.O, e.name);
187
+ r && (this.U.set(e.name, r), this.k.set(e.name, e.type));
191
188
  }
192
189
  }
193
190
  }
194
- createProgram(A, t) {
195
- const e = this.createShader(this.P.VERTEX_SHADER, A), B = this.createShader(this.P.FRAGMENT_SHADER, t), s = this.P.createProgram();
196
- if (this.P.attachShader(s, e), this.P.attachShader(s, B), this.P.linkProgram(s), !this.P.getProgramParameter(s, this.P.LINK_STATUS)) {
197
- const Q = this.P.getProgramInfoLog(s);
198
- throw Error("Shader program link error: " + Q);
191
+ H(A, t) {
192
+ const e = this.L(this.P.VERTEX_SHADER, A), r = this.L(this.P.FRAGMENT_SHADER, t), B = this.P.createProgram();
193
+ if (this.P.attachShader(B, e), this.P.attachShader(B, r), this.P.linkProgram(B), !this.P.getProgramParameter(B, this.P.LINK_STATUS)) {
194
+ const s = this.P.getProgramInfoLog(B);
195
+ throw Error("Shader program link error: " + s);
199
196
  }
200
- return this.P.deleteShader(e), this.P.deleteShader(B), s;
197
+ return this.P.deleteShader(e), this.P.deleteShader(r), B;
201
198
  }
202
- createShader(A, t) {
199
+ L(A, t) {
203
200
  const e = this.P.createShader(A);
204
201
  if (this.P.shaderSource(e, t), this.P.compileShader(e), !this.P.getShaderParameter(e, this.P.COMPILE_STATUS)) {
205
- const B = this.P.getShaderInfoLog(e);
206
- throw this.P.deleteShader(e), Error("Shader compilation error: " + B);
202
+ const r = this.P.getShaderInfoLog(e);
203
+ throw this.P.deleteShader(e), Error("Shader compilation error: " + r);
207
204
  }
208
205
  return e;
209
206
  }
210
207
  K() {
211
- this.P.useProgram(this.V), this.W();
208
+ this.P.useProgram(this.O), this.W();
212
209
  }
213
- j(A, t) {
214
- const e = this.H.get(A);
210
+ setUniform(A, t) {
211
+ const e = this.U.get(A);
215
212
  if (e) if (typeof t == "number")
216
- this.Z(A) ? this.P.uniform1i(e, Math.floor(t)) : this.P.uniform1f(e, t);
213
+ this.j(A) ? this.P.uniform1i(e, Math.floor(t)) : this.P.uniform1f(e, t);
217
214
  else if (typeof t == "boolean") this.P.uniform1i(e, t ? 1 : 0);
218
215
  else if (Array.isArray(t)) switch (t.length) {
219
216
  case 2:
@@ -229,526 +226,526 @@ class f {
229
226
  console.warn(`Unsupported array length ${t.length} for uniform '${A}'`);
230
227
  }
231
228
  else if (t instanceof WebGLTexture) {
232
- const B = this.N();
233
- this.P.uniform1i(e, B), this.P.activeTexture(this.P.TEXTURE0 + B), this.P.bindTexture(this.P.TEXTURE_2D, t);
234
- } else if (t instanceof X) {
235
- const B = this.N();
236
- this.P.uniform1i(e, B), this.P.activeTexture(this.P.TEXTURE0 + B), this.P.bindTexture(this.P.TEXTURE_2D, t.texture);
229
+ const r = this.Z();
230
+ this.P.uniform1i(e, r), this.P.activeTexture(this.P.TEXTURE0 + r), this.P.bindTexture(this.P.TEXTURE_2D, t);
231
+ } else if (t instanceof K) {
232
+ const r = this.Z();
233
+ this.P.uniform1i(e, r), this.P.activeTexture(this.P.TEXTURE0 + r), this.P.bindTexture(this.P.TEXTURE_2D, t.texture);
237
234
  } else console.warn(`Unsupported uniform type for '${A}':`, typeof t);
238
235
  }
239
- N() {
240
- return this.$ >= this.J && console.warn(`Exceeded maximum texture units (${this.J}). Texture may not render correctly.`), this.$++;
236
+ Z() {
237
+ return this.V >= this.R && console.warn(`Exceeded maximum texture units (${this.R}). Texture may not render correctly.`), this.V++;
241
238
  }
242
- Z(A) {
243
- const t = this.R.get(A);
239
+ j(A) {
240
+ const t = this.k.get(A);
244
241
  return !!t && (t === this.P.INT || t === this.P.INT_VEC2 || t === this.P.INT_VEC3 || t === this.P.INT_VEC4 || t === this.P.SAMPLER_2D || t === this.P.SAMPLER_CUBE);
245
242
  }
246
- get X() {
247
- return this.V;
243
+ get glProgram() {
244
+ return this.O;
248
245
  }
249
- dispose() {
250
- this.P.deleteProgram(this.V);
246
+ S() {
247
+ this.P.deleteProgram(this.O);
251
248
  }
252
249
  W() {
253
- this.$ = 0;
250
+ this.V = 0;
254
251
  }
255
252
  }
256
- class W {
253
+ class X {
257
254
  constructor(A) {
258
- r(this, "P");
259
- r(this, "q", null);
260
- r(this, "AA", 16);
261
- r(this, "tA", /* @__PURE__ */ new Map());
255
+ Q(this, "P");
256
+ Q(this, "N", null);
257
+ Q(this, "X", 16);
258
+ Q(this, "q", /* @__PURE__ */ new Map());
262
259
  this.P = A;
263
260
  }
264
- eA() {
265
- if (this.q) return;
261
+ AA() {
262
+ if (this.N) return;
266
263
  const A = this.P;
267
- this.q = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, this.q);
264
+ this.N = A.createBuffer(), A.bindBuffer(A.ARRAY_BUFFER, this.N);
268
265
  }
269
- BA() {
266
+ tA() {
270
267
  const A = this.P, t = A.getParameter(A.CURRENT_PROGRAM);
271
- let e = this.tA.get(t);
272
- return e || (e = { QA: A.getAttribLocation(t, "a_position"), sA: A.getAttribLocation(t, "a_texCoord") }, this.tA.set(t, e)), A.enableVertexAttribArray(e.QA), A.vertexAttribPointer(e.QA, 2, A.FLOAT, !1, this.AA, 0), A.enableVertexAttribArray(e.sA), A.vertexAttribPointer(e.sA, 2, A.FLOAT, !1, this.AA, 8), { EA: e.QA, iA: e.sA };
268
+ let e = this.q.get(t);
269
+ return e || (e = { a_position: A.getAttribLocation(t, "a_position"), a_texCoord: A.getAttribLocation(t, "a_texCoord") }, this.q.set(t, e)), A.enableVertexAttribArray(e.a_position), A.vertexAttribPointer(e.a_position, 2, A.FLOAT, !1, this.X, 0), A.enableVertexAttribArray(e.a_texCoord), A.vertexAttribPointer(e.a_texCoord, 2, A.FLOAT, !1, this.X, 8), { positionLoc: e.a_position, texLoc: e.a_texCoord };
273
270
  }
274
- rA(A, t) {
271
+ eA(A, t) {
275
272
  const e = this.P;
276
273
  e.disableVertexAttribArray(A), e.disableVertexAttribArray(t);
277
274
  }
278
- gA(A, t) {
279
- const e = this.P, B = J(e) || [0, 0, e.canvas.width, e.canvas.height];
280
- return { oA: A / B[2] * 2 - 1, nA: 1 - t / B[3] * 2 };
275
+ BA(A, t) {
276
+ const e = this.P, r = V(e) || [0, 0, e.canvas.width, e.canvas.height];
277
+ return { nx: A / r[2] * 2 - 1, ny: 1 - t / r[3] * 2 };
281
278
  }
282
- hA(A, t, e, B) {
283
- const s = this.P;
284
- this.eA(), s.bindBuffer(s.ARRAY_BUFFER, this.q);
285
- const Q = new Float32Array([A, B, 0, 0, e, B, 1, 0, A, t, 0, 1, A, t, 0, 1, e, B, 1, 0, e, t, 1, 1]);
286
- s.bufferData(s.ARRAY_BUFFER, Q, s.DYNAMIC_DRAW);
279
+ QA(A, t, e, r) {
280
+ const B = this.P;
281
+ this.AA(), B.bindBuffer(B.ARRAY_BUFFER, this.N);
282
+ const s = new Float32Array([A, r, 0, 0, e, r, 1, 0, A, t, 0, 1, A, t, 0, 1, e, r, 1, 0, e, t, 1, 1]);
283
+ B.bufferData(B.ARRAY_BUFFER, s, B.DYNAMIC_DRAW);
287
284
  }
288
- dispose() {
289
- this.q && this.P.deleteBuffer(this.q);
285
+ S() {
286
+ this.N && this.P.deleteBuffer(this.N);
290
287
  }
291
288
  }
292
- class tA extends W {
289
+ class tA extends X {
293
290
  constructor(A) {
294
291
  super(A);
295
292
  }
296
- aA(A, t, e, B) {
297
- const s = this.gA(A, t), Q = this.gA(A + e, t + B);
298
- this.hA(s.oA, s.nA, Q.oA, Q.nA);
299
- const i = this.BA();
300
- this.P.drawArrays(this.P.TRIANGLES, 0, 6), this.rA(i.EA, i.iA);
293
+ sA(A, t, e, r) {
294
+ const B = this.BA(A, t), s = this.BA(A + e, t + r);
295
+ this.QA(B.nx, B.ny, s.nx, s.ny);
296
+ const i = this.tA();
297
+ this.P.drawArrays(this.P.TRIANGLES, 0, 6), this.eA(i.positionLoc, i.texLoc);
301
298
  }
302
- DA(A, t, e, B, s) {
303
- this.aA(A, t, e, s), this.aA(A + e - s, t, s, B), this.aA(A, t + B - s, e, s), this.aA(A, t, s, B);
299
+ rA(A, t, e, r, B) {
300
+ this.sA(A, t, e, B), this.sA(A + e - B, t, B, r), this.sA(A, t + r - B, e, B), this.sA(A, t, B, r);
304
301
  }
305
302
  }
306
- class eA extends W {
303
+ class eA extends X {
307
304
  constructor(A) {
308
305
  super(A);
309
306
  }
310
- draw(A, t, e, B, s) {
311
- const Q = e - A, i = B - t, g = Math.hypot(Q, i);
312
- if (g === 0) {
313
- const n = s / 2, h = this.gA(A - n, t - n), a = this.gA(A + n, t + n);
314
- this.hA(h.oA, h.nA, a.oA, a.nA);
307
+ iA(A, t, e, r, B) {
308
+ const s = e - A, i = r - t, o = Math.hypot(s, i);
309
+ if (o === 0) {
310
+ const n = B / 2, a = this.BA(A - n, t - n), h = this.BA(A + n, t + n);
311
+ this.QA(a.nx, a.ny, h.nx, h.ny);
315
312
  } else {
316
- const n = -i / g, h = Q / g, a = s / 2, P = A + n * a, c = t + h * a, l = A - n * a, C = t - h * a, d = e + n * a, w = B + h * a, p = e - n * a, v = B - h * a, R = this.gA(P, c), b = this.gA(l, C), _ = this.gA(d, w), $ = this.gA(p, v), y = this.P;
317
- this.eA(), y.bindBuffer(y.ARRAY_BUFFER, this.q);
318
- const K = new Float32Array([R.oA, R.nA, 0, 0, b.oA, b.nA, 0, 1, _.oA, _.nA, 1, 0, b.oA, b.nA, 0, 1, $.oA, $.nA, 1, 1, _.oA, _.nA, 1, 0]);
319
- y.bufferData(y.ARRAY_BUFFER, K, y.DYNAMIC_DRAW);
313
+ const n = -i / o, a = s / o, h = B / 2, C = A + n * h, D = t + a * h, c = A - n * h, u = t - a * h, f = e + n * h, d = r + a * h, m = e - n * h, p = r - a * h, M = this.BA(C, D), v = this.BA(c, u), b = this.BA(f, d), z = this.BA(m, p), y = this.P;
314
+ this.AA(), y.bindBuffer(y.ARRAY_BUFFER, this.N);
315
+ const j = new Float32Array([M.nx, M.ny, 0, 0, v.nx, v.ny, 0, 1, b.nx, b.ny, 1, 0, v.nx, v.ny, 0, 1, z.nx, z.ny, 1, 1, b.nx, b.ny, 1, 0]);
316
+ y.bufferData(y.ARRAY_BUFFER, j, y.DYNAMIC_DRAW);
320
317
  }
321
- const o = this.BA();
322
- this.P.drawArrays(this.P.TRIANGLES, 0, 6), this.rA(o.EA, o.iA);
318
+ const g = this.tA();
319
+ this.P.drawArrays(this.P.TRIANGLES, 0, 6), this.eA(g.positionLoc, g.texLoc);
323
320
  }
324
321
  }
325
- var m = "attribute vec2 a_position;attribute vec2 a_texCoord;varying vec2 v_uv;uniform float u_rotation;uniform vec2 u_center;uniform float u_aspectRatio;mat2 rotate2D(float angle){float s=sin(angle);float c=cos(angle);return mat2(c,-s,s,c);}void main(){v_uv=a_texCoord;vec2 pos=a_position;pos-=u_center;pos.x*=u_aspectRatio;pos=rotate2D(-u_rotation)*pos;pos.x/=u_aspectRatio;pos+=u_center;gl_Position=vec4(pos,0.0,1.0);}";
326
- class BA {
322
+ var R = "attribute vec2 a_position;attribute vec2 a_texCoord;varying vec2 v_uv;uniform float u_rotation;uniform vec2 u_center;uniform float u_aspectRatio;mat2 rotate2D(float angle){float s=sin(angle);float c=cos(angle);return mat2(c,-s,s,c);}void main(){v_uv=a_texCoord;vec2 pos=a_position;pos-=u_center;pos.x*=u_aspectRatio;pos=rotate2D(-u_rotation)*pos;pos.x/=u_aspectRatio;pos+=u_center;gl_Position=vec4(pos,0.0,1.0);}";
323
+ class rA {
327
324
  constructor(A) {
328
- r(this, "P");
329
- r(this, "CA");
330
- r(this, "lA");
331
- r(this, "cA", null);
332
- r(this, "uA");
333
- r(this, "PA");
334
- r(this, "IA", [1, 1, 1, 1]);
335
- r(this, "wA", !0);
336
- r(this, "fA", [0, 0, 0, 1]);
337
- r(this, "dA", 1);
338
- r(this, "mA", !0);
339
- r(this, "pA", 0);
340
- r(this, "vA", []);
341
- this.P = A, this.CA = new f(this.P, m, "precision lowp float;uniform sampler2D u_texture;varying vec2 v_uv;void main(){gl_FragColor=texture2D(u_texture,v_uv);}"), this.lA = new f(this.P, m, "precision lowp float;uniform vec4 u_color;void main(){gl_FragColor=u_color;}"), this.uA = new tA(this.P), this.PA = new eA(this.P), this.P.enable(this.P.BLEND), this.P.blendEquation(this.P.FUNC_ADD), this.P.blendFunc(this.P.ONE, this.P.ONE_MINUS_SRC_ALPHA), S(this.P, [0, 0, this.P.canvas.width, this.P.canvas.height]);
342
- }
343
- bA(A) {
344
- this.cA !== A && (this.cA = A, A.K());
345
- }
346
- fill(A, t, e, B) {
347
- if (this.wA = !0, t === void 0 && e === void 0 && B === void 0) {
348
- const s = A / 255;
349
- this.IA = [s, s, s, 1];
350
- } else if (e !== void 0 && B === void 0) this.IA = [A / 255, t / 255, e / 255, 1];
325
+ Q(this, "P");
326
+ Q(this, "EA");
327
+ Q(this, "gA");
328
+ Q(this, "oA", null);
329
+ Q(this, "nA");
330
+ Q(this, "aA");
331
+ Q(this, "hA", [1, 1, 1, 1]);
332
+ Q(this, "DA", !0);
333
+ Q(this, "lA", [0, 0, 0, 1]);
334
+ Q(this, "CA", 1);
335
+ Q(this, "cA", !0);
336
+ Q(this, "uA", 0);
337
+ Q(this, "PA", []);
338
+ this.P = A, this.EA = new w(this.P, R, "precision lowp float;uniform sampler2D u_texture;varying vec2 v_uv;void main(){gl_FragColor=texture2D(u_texture,v_uv);}"), this.gA = new w(this.P, R, "precision lowp float;uniform vec4 u_color;void main(){gl_FragColor=u_color;}"), this.nA = new tA(this.P), this.aA = new eA(this.P), this.P.enable(this.P.BLEND), this.P.blendEquation(this.P.FUNC_ADD), this.P.blendFunc(this.P.ONE, this.P.ONE_MINUS_SRC_ALPHA), F(this.P, [0, 0, this.P.canvas.width, this.P.canvas.height]);
339
+ }
340
+ IA(A) {
341
+ this.oA !== A && (this.oA = A, A.K());
342
+ }
343
+ wA(A, t, e, r) {
344
+ if (this.DA = !0, t === void 0 && e === void 0 && r === void 0) {
345
+ const B = A / 255;
346
+ this.hA = [B, B, B, 1];
347
+ } else if (e !== void 0 && r === void 0) this.hA = [A / 255, t / 255, e / 255, 1];
351
348
  else {
352
- if (e === void 0 || B === void 0) throw Error("Invalid fill parameters. Use fill(gray), fill(r,g,b), or fill(r,g,b,a)");
353
- this.IA = [A / 255, t / 255, e / 255, B / 255];
349
+ if (e === void 0 || r === void 0) throw Error("Invalid fill parameters. Use fill(gray), fill(r,g,b), or fill(r,g,b,a)");
350
+ this.hA = [A / 255, t / 255, e / 255, r / 255];
354
351
  }
355
352
  }
356
- stroke(A, t, e, B) {
357
- if (this.mA = !0, t === void 0 && e === void 0 && B === void 0) {
358
- const s = A / 255;
359
- this.fA = [s, s, s, 1];
360
- } else if (e !== void 0 && B === void 0) this.fA = [A / 255, t / 255, e / 255, 1];
353
+ fA(A, t, e, r) {
354
+ if (this.cA = !0, t === void 0 && e === void 0 && r === void 0) {
355
+ const B = A / 255;
356
+ this.lA = [B, B, B, 1];
357
+ } else if (e !== void 0 && r === void 0) this.lA = [A / 255, t / 255, e / 255, 1];
361
358
  else {
362
- if (e === void 0 || B === void 0) throw Error("Invalid stroke parameters. Use stroke(gray), stroke(r,g,b), or stroke(r,g,b,a)");
363
- this.fA = [A / 255, t / 255, e / 255, B / 255];
359
+ if (e === void 0 || r === void 0) throw Error("Invalid stroke parameters. Use stroke(gray), stroke(r,g,b), or stroke(r,g,b,a)");
360
+ this.lA = [A / 255, t / 255, e / 255, r / 255];
364
361
  }
365
362
  }
366
- xA(A) {
363
+ dA(A) {
367
364
  if (A < 0) throw Error("Stroke weight must be non-negative");
368
- this.dA = A;
365
+ this.CA = A;
369
366
  }
370
- _A() {
371
- this.mA = !1;
367
+ mA() {
368
+ this.cA = !1;
372
369
  }
373
- yA() {
374
- this.wA = !1;
370
+ pA() {
371
+ this.DA = !1;
375
372
  }
376
- rotate(A) {
377
- this.pA = A;
373
+ _A(A) {
374
+ this.uA = A;
378
375
  }
379
- push() {
380
- this.vA.push({ MA: [...this.IA], wA: this.wA, GA: [...this.fA], xA: this.dA, mA: this.mA, rotation: this.pA });
376
+ vA() {
377
+ this.PA.push({ fillColor: [...this.hA], fillMode: this.DA, strokeColor: [...this.lA], strokeWeight: this.CA, strokeMode: this.cA, rotation: this.uA });
381
378
  }
382
- pop() {
383
- const A = this.vA.pop();
384
- A ? (this.IA = A.MA, this.wA = A.wA, this.fA = A.GA, this.dA = A.xA, this.mA = A.mA, this.pA = A.rotation) : console.warn("pop() called without matching push()");
379
+ bA() {
380
+ const A = this.PA.pop();
381
+ A ? (this.hA = A.fillColor, this.DA = A.fillMode, this.lA = A.strokeColor, this.CA = A.strokeWeight, this.cA = A.strokeMode, this.uA = A.rotation) : console.warn("pop() called without matching push()");
385
382
  }
386
- reset() {
387
- this.cA = null, this.vA = [], this.pA = 0;
383
+ xA() {
384
+ this.oA = null, this.PA = [], this.uA = 0;
388
385
  }
389
- createShader(A, t) {
390
- return new f(this.P, A, t);
386
+ yA(A, t) {
387
+ return new w(this.P, A, t);
391
388
  }
392
- FA(A) {
393
- return new f(this.P, m, A);
389
+ MA(A) {
390
+ return new w(this.P, R, A);
394
391
  }
395
- j(A, t) {
396
- this.cA.j(A, t);
392
+ GA(A, t) {
393
+ this.oA.setUniform(A, t);
397
394
  }
398
- rect(A, t, e, B) {
399
- if (this.cA !== null) {
400
- const { YA: h, TA: a, SA: P, aspectRatio: c } = this.OA(A, t, e, B);
401
- return this.j("u_rotation", P), this.j("u_center", [h, a]), this.j("u_aspectRatio", c), this.uA.aA(A, t, e, B), void (this.cA = null);
395
+ FA(A, t, e, r) {
396
+ if (this.oA !== null) {
397
+ const { centerX: a, centerY: h, radians: C, aspectRatio: D } = this.YA(A, t, e, r);
398
+ return this.GA("u_rotation", C), this.GA("u_center", [a, h]), this.GA("u_aspectRatio", D), this.nA.sA(A, t, e, r), void (this.oA = null);
402
399
  }
403
- const s = this.lA;
404
- let Q = 0, i = 0, g = 0, o = 1;
405
- const n = this.OA(A, t, e, B);
406
- Q = n.YA, i = n.TA, g = n.SA, o = n.aspectRatio, this.wA && (this.bA(s), this.j("u_color", this.IA), this.j("u_rotation", g), this.j("u_center", [Q, i]), this.j("u_aspectRatio", o), this.uA.aA(A, t, e, B)), this.mA && this.dA > 0 && (this.bA(s), this.j("u_color", this.fA), this.j("u_rotation", g), this.j("u_center", [Q, i]), this.j("u_aspectRatio", o), this.uA.DA(A, t, e, B, this.dA)), this.cA = null;
407
- }
408
- line(A, t, e, B) {
409
- if (this.cA !== null) {
410
- const l = (A + e) / 2, C = (t + B) / 2, d = Math.abs(e - A) || 1, w = Math.abs(B - t) || 1, { YA: p, TA: v, SA: R, aspectRatio: b } = this.OA(l - d / 2, C - w / 2, d, w);
411
- this.j("u_rotation", R), this.j("u_center", [p, v]), this.j("u_aspectRatio", b);
412
- const _ = this.dA > 0 ? this.dA : 1;
413
- return this.PA.draw(A, t, e, B, _), void (this.cA = null);
400
+ const B = this.gA;
401
+ let s = 0, i = 0, o = 0, g = 1;
402
+ const n = this.YA(A, t, e, r);
403
+ s = n.centerX, i = n.centerY, o = n.radians, g = n.aspectRatio, this.DA && (this.IA(B), this.GA("u_color", this.hA), this.GA("u_rotation", o), this.GA("u_center", [s, i]), this.GA("u_aspectRatio", g), this.nA.sA(A, t, e, r)), this.cA && this.CA > 0 && (this.IA(B), this.GA("u_color", this.lA), this.GA("u_rotation", o), this.GA("u_center", [s, i]), this.GA("u_aspectRatio", g), this.nA.rA(A, t, e, r, this.CA)), this.oA = null;
404
+ }
405
+ $A(A, t, e, r) {
406
+ if (this.oA !== null) {
407
+ const c = (A + e) / 2, u = (t + r) / 2, f = Math.abs(e - A) || 1, d = Math.abs(r - t) || 1, { centerX: m, centerY: p, radians: M, aspectRatio: v } = this.YA(c - f / 2, u - d / 2, f, d);
408
+ this.GA("u_rotation", M), this.GA("u_center", [m, p]), this.GA("u_aspectRatio", v);
409
+ const b = this.CA > 0 ? this.CA : 1;
410
+ return this.aA.iA(A, t, e, r, b), void (this.oA = null);
414
411
  }
415
- if (!this.mA || this.dA <= 0) return;
416
- const s = this.lA, Q = (A + e) / 2, i = (t + B) / 2, g = Math.abs(e - A) || 1, o = Math.abs(B - t) || 1, n = this.pA !== 0;
417
- let h = 0, a = 0, P = 0, c = 1;
412
+ if (!this.cA || this.CA <= 0) return;
413
+ const B = this.gA, s = (A + e) / 2, i = (t + r) / 2, o = Math.abs(e - A) || 1, g = Math.abs(r - t) || 1, n = this.uA !== 0;
414
+ let a = 0, h = 0, C = 0, D = 1;
418
415
  if (n) {
419
- const l = this.OA(Q - g / 2, i - o / 2, g, o);
420
- h = l.YA, a = l.TA, P = l.SA, c = l.aspectRatio;
416
+ const c = this.YA(s - o / 2, i - g / 2, o, g);
417
+ a = c.centerX, h = c.centerY, C = c.radians, D = c.aspectRatio;
421
418
  }
422
- this.bA(s), this.j("u_color", this.fA), n && (this.j("u_rotation", P), this.j("u_center", [h, a]), this.j("u_aspectRatio", c)), this.PA.draw(A, t, e, B, this.dA);
419
+ this.IA(B), this.GA("u_color", this.lA), n && (this.GA("u_rotation", C), this.GA("u_center", [a, h]), this.GA("u_aspectRatio", D)), this.aA.iA(A, t, e, r, this.CA);
423
420
  }
424
- OA(A, t, e, B) {
425
- const s = J(this.P) || [0, 0, this.P.canvas.width, this.P.canvas.height], Q = s[2], i = s[3], g = Q / i;
426
- return { YA: (A + e / 2) / Q * 2 - 1, TA: 1 - (t + B / 2) / i * 2, SA: this.pA * Math.PI / 180, aspectRatio: g };
421
+ YA(A, t, e, r) {
422
+ const B = V(this.P) || [0, 0, this.P.canvas.width, this.P.canvas.height], s = B[2], i = B[3], o = s / i;
423
+ return { centerX: (A + e / 2) / s * 2 - 1, centerY: 1 - (t + r / 2) / i * 2, radians: this.uA * Math.PI / 180, aspectRatio: o };
427
424
  }
428
- createFramebuffer(A, t, e = {}) {
429
- return new X(this.P, A, t, e);
425
+ TA(A, t, e = {}) {
426
+ return new K(this.P, A, t, e);
430
427
  }
431
- background(A, t = A, e = A, B = 255) {
432
- this.clear(A / 255, t / 255, e / 255, B / 255);
428
+ SA(A, t = A, e = A, r = 255) {
429
+ this.OA(A / 255, t / 255, e / 255, r / 255);
433
430
  }
434
- clear(A = 0, t = 0, e = 0, B = 0) {
435
- this.P.clearColor(A, t, e, B), this.P.clear(this.P.COLOR_BUFFER_BIT);
431
+ OA(A = 0, t = 0, e = 0, r = 0) {
432
+ this.P.clearColor(A, t, e, r), this.P.clear(this.P.COLOR_BUFFER_BIT);
436
433
  }
437
434
  UA() {
438
- this.P.viewport(0, 0, this.P.canvas.width, this.P.canvas.height), S(this.P, [0, 0, this.P.canvas.width, this.P.canvas.height]);
435
+ this.P.viewport(0, 0, this.P.canvas.width, this.P.canvas.height), F(this.P, [0, 0, this.P.canvas.width, this.P.canvas.height]);
439
436
  }
440
437
  get context() {
441
438
  return this.P;
442
439
  }
443
- dispose() {
444
- this.CA.dispose(), this.lA.dispose(), this.uA.dispose(), this.PA.dispose();
440
+ S() {
441
+ this.EA.S(), this.gA.S(), this.nA.S(), this.aA.S();
445
442
  }
446
- image(A, t, e, B, s) {
447
- const Q = this.P, i = B ?? A.width, g = s ?? A.height;
448
- this.bA(this.CA), this.j("u_texture", A.texture);
449
- const o = this.OA(t, e, i, g);
450
- this.j("u_rotation", o.SA), this.j("u_center", [o.YA, o.TA]), this.j("u_aspectRatio", o.aspectRatio), this.uA.aA(t, e, i, g), Q.bindTexture(Q.TEXTURE_2D, null), this.cA = null;
443
+ kA(A, t, e, r, B) {
444
+ const s = this.P, i = r ?? A.width, o = B ?? A.height;
445
+ this.IA(this.EA), this.GA("u_texture", A.texture);
446
+ const g = this.YA(t, e, i, o);
447
+ this.GA("u_rotation", g.radians), this.GA("u_center", [g.centerX, g.centerY]), this.GA("u_aspectRatio", g.aspectRatio), this.nA.sA(t, e, i, o), s.bindTexture(s.TEXTURE_2D, null), this.oA = null;
451
448
  }
452
449
  }
453
- var M, D = {};
454
- D.parse = function(E) {
455
- var A = function(t, e, B, s) {
456
- var Q = D.T, i = { cmap: Q.cmap, head: Q.head, hhea: Q.hhea, maxp: Q.maxp, hmtx: Q.hmtx, loca: Q.loca, glyf: Q.glyf }, g = { _data: t, _index: e, _offset: B };
457
- for (var o in i) {
458
- var n = D.findTable(t, o, B);
450
+ var _, l = {};
451
+ l.parse = function(E) {
452
+ var A = function(t, e, r, B) {
453
+ var s = l.T, i = { cmap: s.cmap, head: s.head, hhea: s.hhea, maxp: s.maxp, hmtx: s.hmtx, loca: s.loca, glyf: s.glyf }, o = { _data: t, _index: e, _offset: r };
454
+ for (var g in i) {
455
+ var n = l.findTable(t, g, r);
459
456
  if (n) {
460
- var h = n[0], a = s[h];
461
- a == null && (a = i[o].kA(t, h, n[1], g)), g[o] = s[h] = a;
457
+ var a = n[0], h = B[a];
458
+ h == null && (h = i[g].parseTab(t, a, n[1], o)), o[g] = B[a] = h;
462
459
  }
463
460
  }
464
- return g;
461
+ return o;
465
462
  }(new Uint8Array(E), 0, 0, {});
466
463
  return [A];
467
- }, D.findTable = function(E, A, t) {
468
- for (var e = D.B, B = e.VA(E, t + 4), s = t + 12, Q = 0; Q < B; Q++) {
469
- var i = e.HA(E, s, 4);
470
- e.RA(E, s + 4);
471
- var g = e.RA(E, s + 8), o = e.RA(E, s + 12);
472
- if (i == A) return [g, o];
473
- s += 16;
464
+ }, l.findTable = function(E, A, t) {
465
+ for (var e = l.B, r = e.readUshort(E, t + 4), B = t + 12, s = 0; s < r; s++) {
466
+ var i = e.readASCII(E, B, 4);
467
+ e.readUint(E, B + 4);
468
+ var o = e.readUint(E, B + 8), g = e.readUint(E, B + 12);
469
+ if (i == A) return [o, g];
470
+ B += 16;
474
471
  }
475
472
  return null;
476
- }, D.T = {}, D.B = { $A: function(E, A) {
477
- return D.B.zA.uint16[0] = E[A] << 8 | E[A + 1], D.B.zA.int16[0];
478
- }, VA: function(E, A) {
473
+ }, l.T = {}, l.B = { readShort: function(E, A) {
474
+ return l.B.t.uint16[0] = E[A] << 8 | E[A + 1], l.B.t.int16[0];
475
+ }, readUshort: function(E, A) {
479
476
  return E[A] << 8 | E[A + 1];
480
- }, JA: function(E, A, t) {
481
- for (var e = [], B = 0; B < t; B++) e.push(D.B.VA(E, A + 2 * B));
477
+ }, readUshorts: function(E, A, t) {
478
+ for (var e = [], r = 0; r < t; r++) e.push(l.B.readUshort(E, A + 2 * r));
482
479
  return e;
483
- }, RA: function(E, A) {
484
- var t = D.B.zA.uint8;
485
- return t[3] = E[A], t[2] = E[A + 1], t[1] = E[A + 2], t[0] = E[A + 3], D.B.zA.uint32[0];
486
- }, HA: function(E, A, t) {
487
- for (var e = "", B = 0; B < t; B++) e += String.fromCharCode(E[A + B]);
480
+ }, readUint: function(E, A) {
481
+ var t = l.B.t.uint8;
482
+ return t[3] = E[A], t[2] = E[A + 1], t[1] = E[A + 2], t[0] = E[A + 3], l.B.t.uint32[0];
483
+ }, readASCII: function(E, A, t) {
484
+ for (var e = "", r = 0; r < t; r++) e += String.fromCharCode(E[A + r]);
488
485
  return e;
489
- }, zA: (M = new ArrayBuffer(8), { uint8: new Uint8Array(M), int16: new Int16Array(M), uint16: new Uint16Array(M), uint32: new Uint32Array(M) }) }, D.T.cmap = { kA: function(E, A, t) {
490
- var e = { LA: [], KA: {}, off: A };
486
+ }, t: (_ = new ArrayBuffer(8), { uint8: new Uint8Array(_), int16: new Int16Array(_), uint16: new Uint16Array(_), uint32: new Uint32Array(_) }) }, l.T.cmap = { parseTab: function(E, A, t) {
487
+ var e = { tables: [], ids: {}, off: A };
491
488
  E = new Uint8Array(E.buffer, A, t), A = 0;
492
- var B = D.B, s = B.VA, Q = D.T.cmap;
493
- s(E, A);
494
- var i = s(E, A += 2);
489
+ var r = l.B, B = r.readUshort, s = l.T.cmap;
490
+ B(E, A);
491
+ var i = B(E, A += 2);
495
492
  A += 2;
496
- for (var g = [], o = 0; o < i; o++) {
497
- var n = s(E, A), h = s(E, A += 2);
493
+ for (var o = [], g = 0; g < i; g++) {
494
+ var n = B(E, A), a = B(E, A += 2);
498
495
  A += 2;
499
- var a = B.RA(E, A);
496
+ var h = r.readUint(E, A);
500
497
  A += 4;
501
- var P = "p" + n + "e" + h, c = g.indexOf(a);
502
- if (c == -1) {
503
- c = e.LA.length;
504
- var l = {};
505
- g.push(a);
506
- var C = l.format = s(E, a);
507
- C == 4 ? l = Q.WA(E, a, l) : C == 12 && (l = Q.jA(E, a, l)), e.LA.push(l);
498
+ var C = "p" + n + "e" + a, D = o.indexOf(h);
499
+ if (D == -1) {
500
+ D = e.tables.length;
501
+ var c = {};
502
+ o.push(h);
503
+ var u = c.format = B(E, h);
504
+ u == 4 ? c = s.parse4(E, h, c) : u == 12 && (c = s.parse12(E, h, c)), e.tables.push(c);
508
505
  }
509
- e.KA[P] != null && console.log("multiple tables for one platform+encoding: " + P), e.KA[P] = c;
506
+ e.ids[C] != null && console.log("multiple tables for one platform+encoding: " + C), e.ids[C] = D;
510
507
  }
511
508
  return e;
512
- }, WA: function(E, A, t) {
513
- var e = D.B, B = e.VA, s = e.JA, Q = A, i = B(E, A += 2);
514
- B(E, A += 2);
515
- var g = B(E, A += 2);
509
+ }, parse4: function(E, A, t) {
510
+ var e = l.B, r = e.readUshort, B = e.readUshorts, s = A, i = r(E, A += 2);
511
+ r(E, A += 2);
512
+ var o = r(E, A += 2);
516
513
  A += 2;
517
- var o = g >>> 1;
518
- t.ZA = B(E, A), A += 2, t.NA = B(E, A), A += 2, t.XA = B(E, A), A += 2, t.qA = s(E, A, o), A += 2 * o, A += 2, t.At = s(E, A, o), A += 2 * o, t.tt = [];
519
- for (var n = 0; n < o; n++) t.tt.push(e.$A(E, A)), A += 2;
520
- return t.et = s(E, A, o), A += 2 * o, t.Bt = s(E, A, Q + i - A >> 1), t;
521
- }, jA: function(E, A, t) {
522
- var e = D.B.RA;
514
+ var g = o >>> 1;
515
+ t.searchRange = r(E, A), A += 2, t.entrySelector = r(E, A), A += 2, t.rangeShift = r(E, A), A += 2, t.endCount = B(E, A, g), A += 2 * g, A += 2, t.startCount = B(E, A, g), A += 2 * g, t.idDelta = [];
516
+ for (var n = 0; n < g; n++) t.idDelta.push(e.readShort(E, A)), A += 2;
517
+ return t.idRangeOffset = B(E, A, g), A += 2 * g, t.glyphIdArray = B(E, A, s + i - A >> 1), t;
518
+ }, parse12: function(E, A, t) {
519
+ var e = l.B.readUint;
523
520
  e(E, A += 4), e(E, A += 4);
524
- var B = 3 * e(E, A += 4);
521
+ var r = 3 * e(E, A += 4);
525
522
  A += 4;
526
- for (var s = t.groups = new Uint32Array(B), Q = 0; Q < B; Q += 3) s[Q] = e(E, A + (Q << 2)), s[Q + 1] = e(E, A + (Q << 2) + 4), s[Q + 2] = e(E, A + (Q << 2) + 8);
523
+ for (var B = t.groups = new Uint32Array(r), s = 0; s < r; s += 3) B[s] = e(E, A + (s << 2)), B[s + 1] = e(E, A + (s << 2) + 4), B[s + 2] = e(E, A + (s << 2) + 8);
527
524
  return t;
528
- } }, D.T.head = { kA: function(E, A, t) {
529
- var e = D.B, B = {};
530
- return A += 18, B.unitsPerEm = e.VA(E, A), A += 2, A += 16, B.xMin = e.$A(E, A), A += 2, B.yMin = e.$A(E, A), A += 2, B.xMax = e.$A(E, A), A += 2, B.yMax = e.$A(E, A), A += 2, A += 6, B.indexToLocFormat = e.$A(E, A), B;
531
- } }, D.T.hhea = { kA: function(E, A, t) {
532
- var e = D.B, B = {};
525
+ } }, l.T.head = { parseTab: function(E, A, t) {
526
+ var e = l.B, r = {};
527
+ return A += 18, r.unitsPerEm = e.readUshort(E, A), A += 2, A += 16, r.xMin = e.readShort(E, A), A += 2, r.yMin = e.readShort(E, A), A += 2, r.xMax = e.readShort(E, A), A += 2, r.yMax = e.readShort(E, A), A += 2, A += 6, r.indexToLocFormat = e.readShort(E, A), r;
528
+ } }, l.T.hhea = { parseTab: function(E, A, t) {
529
+ var e = l.B, r = {};
533
530
  A += 4;
534
- for (var s = ["ascender", "descender", "lineGap", "advanceWidthMax", "minLeftSideBearing", "minRightSideBearing", "xMaxExtent", "caretSlopeRise", "caretSlopeRun", "caretOffset", "res0", "res1", "res2", "res3", "metricDataFormat", "numberOfHMetrics"], Q = 0; Q < s.length; Q++) {
535
- var i = s[Q], g = i == "advanceWidthMax" || i == "numberOfHMetrics" ? e.VA : e.$A;
536
- B[i] = g(E, A + 2 * Q);
537
- }
531
+ for (var B = ["ascender", "descender", "lineGap", "advanceWidthMax", "minLeftSideBearing", "minRightSideBearing", "xMaxExtent", "caretSlopeRise", "caretSlopeRun", "caretOffset", "res0", "res1", "res2", "res3", "metricDataFormat", "numberOfHMetrics"], s = 0; s < B.length; s++) {
532
+ var i = B[s], o = i == "advanceWidthMax" || i == "numberOfHMetrics" ? e.readUshort : e.readShort;
533
+ r[i] = o(E, A + 2 * s);
534
+ }
535
+ return r;
536
+ } }, l.T.hmtx = { parseTab: function(E, A, t, e) {
537
+ for (var r = l.B, B = [], s = [], i = e.maxp.numGlyphs, o = e.hhea.numberOfHMetrics, g = 0, n = 0, a = 0; a < o; ) g = r.readUshort(E, A + (a << 2)), n = r.readShort(E, A + (a << 2) + 2), B.push(g), s.push(n), a++;
538
+ for (; a < i; ) B.push(g), s.push(n), a++;
539
+ return { aWidth: B, lsBearing: s };
540
+ } }, l.T.maxp = { parseTab: function(E, A, t) {
541
+ var e = l.B, r = e.readUshort, B = {};
542
+ return e.readUint(E, A), A += 4, B.numGlyphs = r(E, A), A += 2, B;
543
+ } }, l.T.loca = { parseTab: function(E, A, t, e) {
544
+ var r = l.B, B = [], s = e.head.indexToLocFormat, i = e.maxp.numGlyphs + 1;
545
+ if (s == 0) for (var o = 0; o < i; o++) B.push(r.readUshort(E, A + (o << 1)) << 1);
546
+ if (s == 1) for (o = 0; o < i; o++) B.push(r.readUint(E, A + (o << 2)));
538
547
  return B;
539
- } }, D.T.hmtx = { kA: function(E, A, t, e) {
540
- for (var B = D.B, s = [], Q = [], i = e.maxp.numGlyphs, g = e.hhea.numberOfHMetrics, o = 0, n = 0, h = 0; h < g; ) o = B.VA(E, A + (h << 2)), n = B.$A(E, A + (h << 2) + 2), s.push(o), Q.push(n), h++;
541
- for (; h < i; ) s.push(o), Q.push(n), h++;
542
- return { Qt: s, st: Q };
543
- } }, D.T.maxp = { kA: function(E, A, t) {
544
- var e = D.B, B = e.VA, s = {};
545
- return e.RA(E, A), A += 4, s.numGlyphs = B(E, A), A += 2, s;
546
- } }, D.T.loca = { kA: function(E, A, t, e) {
547
- var B = D.B, s = [], Q = e.head.indexToLocFormat, i = e.maxp.numGlyphs + 1;
548
- if (Q == 0) for (var g = 0; g < i; g++) s.push(B.VA(E, A + (g << 1)) << 1);
549
- if (Q == 1) for (g = 0; g < i; g++) s.push(B.RA(E, A + (g << 2)));
550
- return s;
551
- } }, D.T.glyf = { kA: function(E, A, t, e) {
552
- for (var B = [], s = e.maxp.numGlyphs, Q = 0; Q < s; Q++) B.push(null);
553
- return B;
554
- }, Et: function(E, A) {
555
- var t = D.B, e = E._data, B = E.loca;
556
- if (B[A] == B[A + 1]) return null;
557
- var s = D.findTable(e, "glyf", E._offset)[0] + B[A], Q = {};
558
- if (Q.it = t.$A(e, s), s += 2, Q.xMin = t.$A(e, s), s += 2, Q.yMin = t.$A(e, s), s += 2, Q.xMax = t.$A(e, s), s += 2, Q.yMax = t.$A(e, s), s += 2, Q.xMin >= Q.xMax || Q.yMin >= Q.yMax) return null;
559
- if (Q.it > 0) {
560
- Q.rt = [];
561
- for (var i = 0; i < Q.it; i++) Q.rt.push(t.VA(e, s)), s += 2;
562
- var g = t.VA(e, s);
563
- if (s += 2, e.length - s < g) return null;
564
- s += g;
565
- var o = Q.rt[Q.it - 1] + 1;
566
- for (Q.flags = [], i = 0; i < o; i++) {
567
- var n = e[s];
568
- if (s++, Q.flags.push(n), 8 & n) {
569
- var h = e[s];
570
- s++;
571
- for (var a = 0; a < h; a++) Q.flags.push(n), i++;
548
+ } }, l.T.glyf = { parseTab: function(E, A, t, e) {
549
+ for (var r = [], B = e.maxp.numGlyphs, s = 0; s < B; s++) r.push(null);
550
+ return r;
551
+ }, VA: function(E, A) {
552
+ var t = l.B, e = E._data, r = E.loca;
553
+ if (r[A] == r[A + 1]) return null;
554
+ var B = l.findTable(e, "glyf", E._offset)[0] + r[A], s = {};
555
+ if (s.noc = t.readShort(e, B), B += 2, s.xMin = t.readShort(e, B), B += 2, s.yMin = t.readShort(e, B), B += 2, s.xMax = t.readShort(e, B), B += 2, s.yMax = t.readShort(e, B), B += 2, s.xMin >= s.xMax || s.yMin >= s.yMax) return null;
556
+ if (s.noc > 0) {
557
+ s.endPts = [];
558
+ for (var i = 0; i < s.noc; i++) s.endPts.push(t.readUshort(e, B)), B += 2;
559
+ var o = t.readUshort(e, B);
560
+ if (B += 2, e.length - B < o) return null;
561
+ B += o;
562
+ var g = s.endPts[s.noc - 1] + 1;
563
+ for (s.flags = [], i = 0; i < g; i++) {
564
+ var n = e[B];
565
+ if (B++, s.flags.push(n), 8 & n) {
566
+ var a = e[B];
567
+ B++;
568
+ for (var h = 0; h < a; h++) s.flags.push(n), i++;
572
569
  }
573
570
  }
574
- for (Q.gt = [], i = 0; i < o; i++) {
575
- var P = !!(2 & Q.flags[i]), c = !!(16 & Q.flags[i]);
576
- P ? (Q.gt.push(c ? e[s] : -e[s]), s++) : c ? Q.gt.push(0) : (Q.gt.push(t.$A(e, s)), s += 2);
571
+ for (s.xs = [], i = 0; i < g; i++) {
572
+ var C = !!(2 & s.flags[i]), D = !!(16 & s.flags[i]);
573
+ C ? (s.xs.push(D ? e[B] : -e[B]), B++) : D ? s.xs.push(0) : (s.xs.push(t.readShort(e, B)), B += 2);
577
574
  }
578
- for (Q.ot = [], i = 0; i < o; i++)
579
- P = !!(4 & Q.flags[i]), c = !!(32 & Q.flags[i]), P ? (Q.ot.push(c ? e[s] : -e[s]), s++) : c ? Q.ot.push(0) : (Q.ot.push(t.$A(e, s)), s += 2);
580
- var l = 0, C = 0;
581
- for (i = 0; i < o; i++) l += Q.gt[i], C += Q.ot[i], Q.gt[i] = l, Q.ot[i] = C;
582
- } else Q.nt = [];
583
- return Q;
584
- } }, typeof module < "u" && module.exports ? module.exports = D : typeof window < "u" && (window.Typr = D);
585
- class sA {
586
- ht(A) {
575
+ for (s.ys = [], i = 0; i < g; i++)
576
+ C = !!(4 & s.flags[i]), D = !!(32 & s.flags[i]), C ? (s.ys.push(D ? e[B] : -e[B]), B++) : D ? s.ys.push(0) : (s.ys.push(t.readShort(e, B)), B += 2);
577
+ var c = 0, u = 0;
578
+ for (i = 0; i < g; i++) c += s.xs[i], u += s.ys[i], s.xs[i] = c, s.ys[i] = u;
579
+ } else s.parts = [];
580
+ return s;
581
+ } }, typeof module < "u" && module.exports ? module.exports = l : typeof window < "u" && (window.Typr = l);
582
+ class BA {
583
+ extractCharacters(A) {
587
584
  var e;
588
585
  const t = [];
589
- return (e = A == null ? void 0 : A.cmap) != null && e.LA ? (A.cmap.LA.forEach((B) => {
590
- if (B.format === 4) {
591
- const s = this.Dt(B);
592
- t.push(...s);
593
- } else if (B.format === 12) {
594
- const s = this.Ct(B);
595
- t.push(...s);
586
+ return (e = A == null ? void 0 : A.cmap) != null && e.tables ? (A.cmap.tables.forEach((r) => {
587
+ if (r.format === 4) {
588
+ const B = this.RA(r);
589
+ t.push(...B);
590
+ } else if (r.format === 12) {
591
+ const B = this.HA(r);
592
+ t.push(...B);
596
593
  }
597
594
  }), [...new Set(t)]) : [];
598
595
  }
599
- Dt(A) {
596
+ RA(A) {
600
597
  const t = [];
601
- if (!(A.At && A.qA && A.et && A.tt)) return t;
602
- for (let e = 0; e < A.At.length; e++) {
603
- const B = A.At[e], s = A.qA[e];
604
- if (B !== 65535 || s !== 65535) {
605
- for (let Q = B; Q <= s; Q++)
606
- if (this.lt(A, Q, e) > 0) {
607
- const i = String.fromCodePoint(Q);
598
+ if (!(A.startCount && A.endCount && A.idRangeOffset && A.idDelta)) return t;
599
+ for (let e = 0; e < A.startCount.length; e++) {
600
+ const r = A.startCount[e], B = A.endCount[e];
601
+ if (r !== 65535 || B !== 65535) {
602
+ for (let s = r; s <= B; s++)
603
+ if (this.zA(A, s, e) > 0) {
604
+ const i = String.fromCodePoint(s);
608
605
  t.push(i);
609
606
  }
610
607
  }
611
608
  }
612
609
  return t;
613
610
  }
614
- Ct(A) {
611
+ HA(A) {
615
612
  const t = [];
616
613
  if (!A.groups) return t;
617
614
  for (let e = 0; e < A.groups.length; e += 3) {
618
- const B = A.groups[e], s = A.groups[e + 1], Q = A.groups[e + 2];
619
- for (let i = B; i <= s; i++)
620
- if (Q + (i - B) > 0) {
621
- const g = String.fromCodePoint(i);
622
- t.push(g);
615
+ const r = A.groups[e], B = A.groups[e + 1], s = A.groups[e + 2];
616
+ for (let i = r; i <= B; i++)
617
+ if (s + (i - r) > 0) {
618
+ const o = String.fromCodePoint(i);
619
+ t.push(o);
623
620
  }
624
621
  }
625
622
  return t;
626
623
  }
627
- lt(A, t, e) {
628
- if (A.et[e] === 0) return t + A.tt[e] & 65535;
624
+ zA(A, t, e) {
625
+ if (A.idRangeOffset[e] === 0) return t + A.idDelta[e] & 65535;
629
626
  {
630
- const B = A.et[e] / 2 + (t - A.At[e]) - (A.At.length - e);
631
- if (B >= 0 && A.Bt && B < A.Bt.length) {
632
- const s = A.Bt[B];
633
- if (s !== 0) return s + A.tt[e] & 65535;
627
+ const r = A.idRangeOffset[e] / 2 + (t - A.startCount[e]) - (A.startCount.length - e);
628
+ if (r >= 0 && A.glyphIdArray && r < A.glyphIdArray.length) {
629
+ const B = A.glyphIdArray[r];
630
+ if (B !== 0) return B + A.idDelta[e] & 65535;
634
631
  }
635
632
  }
636
633
  return 0;
637
634
  }
638
- ct(A) {
639
- return A.filter((t) => this.ut(t));
635
+ filterProblematicCharacters(A) {
636
+ return A.filter((t) => this.JA(t));
640
637
  }
641
- ut(A) {
638
+ JA(A) {
642
639
  const t = A.codePointAt(0) || 0;
643
640
  return !(t >= 0 && t <= 31 && t !== 9 && t !== 10 && t !== 13 || t >= 127 && t <= 159);
644
641
  }
645
642
  }
646
- class QA {
643
+ class sA {
647
644
  constructor(A) {
648
- r(this, "Pt");
649
- r(this, "It");
650
- r(this, "wt");
651
- this.wt = A, this.Pt = document.createElement("canvas"), this.It = this.Pt.getContext("2d", { ft: !0, alpha: !1 });
652
- }
653
- dt(A, t, e, B) {
654
- const s = A.length, Q = Math.ceil(Math.sqrt(s)), i = Math.ceil(s / Q), g = t.width * Q, o = t.height * i;
655
- this.vt(g, o, e, B), this.bt(A, t, Q, e), this.xt();
656
- const n = this.wt.createFramebuffer(g, o, { filter: "nearest" });
657
- return n.update(this.Pt), { framebuffer: n, columns: Q, rows: i };
658
- }
659
- vt(A, t, e, B) {
660
- this.Pt.width = A, this.Pt.height = t, this.Pt.style.width = A + "px", this.Pt.style.height = A + "px", this.It.imageSmoothingEnabled = !1, this.Pt.style.imageRendering = "pixelated", this.It.fillStyle = "black", this.It.fillRect(0, 0, A, t), this.It.font = `${e}px ${B}`, this.It.textBaseline = "top", this.It.textAlign = "left", this.It.fillStyle = "white";
661
- }
662
- bt(A, t, e, B) {
663
- for (let s = 0; s < A.length; s++) {
664
- const Q = s % e, i = Math.floor(s / e), g = Q * t.width + 0.5 * t.width, o = i * t.height + 0.5 * t.height, n = Math.round(g - 0.5 * t.width), h = Math.round(o - 0.5 * B);
665
- this.It.fillText(A[s]._t, n, h);
645
+ Q(this, "LA");
646
+ Q(this, "KA");
647
+ Q(this, "WA");
648
+ this.WA = A, this.LA = document.createElement("canvas"), this.KA = this.LA.getContext("2d", { willReadFrequently: !0, alpha: !1 });
649
+ }
650
+ createTextureAtlas(A, t, e, r) {
651
+ const B = A.length, s = Math.ceil(Math.sqrt(B)), i = Math.ceil(B / s), o = t.width * s, g = t.height * i;
652
+ this.jA(o, g, e, r), this.ZA(A, t, s, e), this.NA();
653
+ const n = this.WA.TA(o, g, { filter: "nearest" });
654
+ return n.update(this.LA), { framebuffer: n, columns: s, rows: i };
655
+ }
656
+ jA(A, t, e, r) {
657
+ this.LA.width = A, this.LA.height = t, this.LA.style.width = A + "px", this.LA.style.height = A + "px", this.KA.imageSmoothingEnabled = !1, this.LA.style.imageRendering = "pixelated", this.KA.fillStyle = "black", this.KA.fillRect(0, 0, A, t), this.KA.font = `${e}px ${r}`, this.KA.textBaseline = "top", this.KA.textAlign = "left", this.KA.fillStyle = "white";
658
+ }
659
+ ZA(A, t, e, r) {
660
+ for (let B = 0; B < A.length; B++) {
661
+ const s = B % e, i = Math.floor(B / e), o = s * t.width + 0.5 * t.width, g = i * t.height + 0.5 * t.height, n = Math.round(o - 0.5 * t.width), a = Math.round(g - 0.5 * r);
662
+ this.KA.fillText(A[B].character, n, a);
666
663
  }
667
664
  }
668
- xt(A = 128) {
669
- const t = this.It.getImageData(0, 0, this.Pt.width, this.Pt.height), e = t.data;
670
- for (let B = 0; B < e.length; B += 4) {
671
- const s = 0.299 * e[B] + 0.587 * e[B + 1] + 0.114 * e[B + 2] > A + 32 ? 255 : 0;
672
- e[B] = s, e[B + 1] = s, e[B + 2] = s;
665
+ NA(A = 128) {
666
+ const t = this.KA.getImageData(0, 0, this.LA.width, this.LA.height), e = t.data;
667
+ for (let r = 0; r < e.length; r += 4) {
668
+ const B = 0.299 * e[r] + 0.587 * e[r + 1] + 0.114 * e[r + 2] > A + 32 ? 255 : 0;
669
+ e[r] = B, e[r + 1] = B, e[r + 2] = B;
673
670
  }
674
- this.It.putImageData(t, 0, 0);
671
+ this.KA.putImageData(t, 0, 0);
675
672
  }
676
673
  }
677
674
  class iA {
678
675
  constructor() {
679
- r(this, "yt");
680
- r(this, "Mt");
681
- this.yt = document.createElement("canvas"), this.Mt = this.yt.getContext("2d");
682
- }
683
- Gt(A, t, e) {
684
- this.Mt.font = `${t}px ${e}`;
685
- let B = 0, s = 0;
686
- for (const Q of A) {
687
- const i = this.Mt.measureText(Q);
688
- B = Math.max(B, i.width), s = Math.max(s, i.actualBoundingBoxAscent + i.actualBoundingBoxDescent);
676
+ Q(this, "XA");
677
+ Q(this, "qA");
678
+ this.XA = document.createElement("canvas"), this.qA = this.XA.getContext("2d");
679
+ }
680
+ calculateMaxGlyphDimensions(A, t, e) {
681
+ this.qA.font = `${t}px ${e}`;
682
+ let r = 0, B = 0;
683
+ for (const s of A) {
684
+ const i = this.qA.measureText(s);
685
+ r = Math.max(r, i.width), B = Math.max(B, i.actualBoundingBoxAscent + i.actualBoundingBoxDescent);
689
686
  }
690
- return { width: B, height: s };
687
+ return { width: r, height: B };
691
688
  }
692
689
  }
693
690
  class EA {
694
- Ft(A, t) {
695
- return A.map((e, B) => {
696
- const s = e.codePointAt(0) || 0, Q = this.Yt(B);
691
+ createCharacterObjects(A, t) {
692
+ return A.map((e, r) => {
693
+ const B = e.codePointAt(0) || 0, s = this.At(r);
697
694
  let i = 0;
698
- if (t.hmtx && t.hmtx.Qt) {
699
- const g = this.Tt(t, s);
700
- g > 0 && t.hmtx.Qt[g] !== void 0 && (i = t.hmtx.Qt[g]);
695
+ if (t.hmtx && t.hmtx.aWidth) {
696
+ const o = this.tt(t, B);
697
+ o > 0 && t.hmtx.aWidth[o] !== void 0 && (i = t.hmtx.aWidth[o]);
701
698
  }
702
- return { _t: e, unicode: s, color: Q, St: i };
699
+ return { character: e, unicode: B, color: s, advanceWidth: i };
703
700
  });
704
701
  }
705
- Tt(A, t) {
702
+ tt(A, t) {
706
703
  const e = A.cmap;
707
- if (!e || !e.LA) return 0;
708
- for (const B of e.LA) if (B.format === 4) {
709
- for (let s = 0; s < B.At.length; s++) if (t >= B.At[s] && t <= B.qA[s]) {
710
- if (B.et[s] === 0) return t + B.tt[s] & 65535;
704
+ if (!e || !e.tables) return 0;
705
+ for (const r of e.tables) if (r.format === 4) {
706
+ for (let B = 0; B < r.startCount.length; B++) if (t >= r.startCount[B] && t <= r.endCount[B]) {
707
+ if (r.idRangeOffset[B] === 0) return t + r.idDelta[B] & 65535;
711
708
  {
712
- const Q = B.et[s] / 2 + (t - B.At[s]) - (B.At.length - s);
713
- if (Q >= 0 && Q < B.Bt.length) {
714
- const i = B.Bt[Q];
715
- if (i !== 0) return i + B.tt[s] & 65535;
709
+ const s = r.idRangeOffset[B] / 2 + (t - r.startCount[B]) - (r.startCount.length - B);
710
+ if (s >= 0 && s < r.glyphIdArray.length) {
711
+ const i = r.glyphIdArray[s];
712
+ if (i !== 0) return i + r.idDelta[B] & 65535;
716
713
  }
717
714
  }
718
715
  }
719
716
  }
720
717
  return 0;
721
718
  }
722
- Yt(A) {
719
+ At(A) {
723
720
  return [A % 256, Math.floor(A / 256) % 256, Math.floor(A / 65536) % 256];
724
721
  }
725
- Ot(A, t) {
726
- if (!u.validate(typeof A == "string", "Character must be a string.", { method: "getCharacterColor", Ut: A })) return [0, 0, 0];
727
- const e = t.find((B) => B._t === A);
722
+ getCharacterColor(A, t) {
723
+ if (!P.C(typeof A == "string", "Character must be a string.", { method: "getCharacterColor", providedValue: A })) return [0, 0, 0];
724
+ const e = t.find((r) => r.character === A);
728
725
  return e ? e.color : [0, 0, 0];
729
726
  }
730
- kt(A, t) {
731
- return u.validate(typeof A == "string" && A.length > 0, "Characters must be a string with at least one character.", { method: "getCharacterColors", Ut: A }) ? A.split("").map((e) => this.Ot(e, t) || [0, 0, 0]) : [[0, 0, 0]];
727
+ getCharacterColors(A, t) {
728
+ return P.C(typeof A == "string" && A.length > 0, "Characters must be a string with at least one character.", { method: "getCharacterColors", providedValue: A }) ? A.split("").map((e) => this.getCharacterColor(e, t) || [0, 0, 0]) : [[0, 0, 0]];
732
729
  }
733
730
  }
734
- class rA {
731
+ class QA {
735
732
  constructor(A, t = 16) {
736
- r(this, "Vt");
737
- r(this, "Ht", []);
738
- r(this, "Rt");
739
- r(this, "$t", 16);
740
- r(this, "zt", 0);
741
- r(this, "Jt", 0);
742
- r(this, "Lt", { width: 0, height: 0 });
743
- r(this, "Kt");
744
- r(this, "Wt", "UrsaFont");
745
- r(this, "jt");
746
- r(this, "Zt");
747
- r(this, "Nt");
748
- r(this, "Xt");
749
- this.$t = t, this.jt = new sA(), this.Zt = new QA(A), this.Nt = new iA(), this.Xt = new EA();
750
- }
751
- async initialize(A) {
733
+ Q(this, "et");
734
+ Q(this, "Bt", []);
735
+ Q(this, "Qt");
736
+ Q(this, "st", 16);
737
+ Q(this, "rt", 0);
738
+ Q(this, "it", 0);
739
+ Q(this, "Et", { width: 0, height: 0 });
740
+ Q(this, "gt");
741
+ Q(this, "ot", "UrsaFont");
742
+ Q(this, "nt");
743
+ Q(this, "ht");
744
+ Q(this, "Dt");
745
+ Q(this, "lt");
746
+ this.st = t, this.nt = new BA(), this.ht = new sA(A), this.Dt = new iA(), this.lt = new EA();
747
+ }
748
+ async Ct(A) {
752
749
  let t;
753
750
  if (A) {
754
751
  const e = await fetch(A);
@@ -757,233 +754,232 @@ class rA {
757
754
  } else
758
755
  t = await (await fetch(`data:font/truetype;charset=utf-8;base64,AAEAAAAKAIAAAwAgT1MvMs+QEyQAAAEoAAAAYGNtYXAg7yVJAAAFjAAACSBnbHlmuHLTdAAAErQAAGi0aGVhZFvXdUwAAACsAAAANmhoZWELAQUCAAAA5AAAACRobXR4BACDgAAAAYgAAAQEbG9jYQAy54AAAA6sAAAECG1heHABIgCCAAABCAAAACBuYW1lVs/OSgAAe2gAAAOicG9zdABpADQAAH8MAAAAIAABAAAAAQAAzOWHqV8PPPUAAAQAAAAAAHxiGCcAAAAAfGIYJwAAAAAEAAQAAAAACAACAAEAAAAAAAEAAAQAAAAAAAQAAAAAAAcAAAEAAAAAAAAAAAAAAAAAAAEBAAEAAAEBAIAAIAAAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAgQAAZAABQAEAgACAAAAAAACAAIAAAACAAAzAMwAAAAABAAAAAAAAACAAACLAABw4wAAAAAAAAAAWUFMLgBAACAmawQAAAAAAAQAAAAAAAFRAAAAAAMABAAAAAAgAAAEAAAABAAAAAQAAAAEAAGABAABAAQAAIAEAACABAAAgAQAAIAEAAGABAABAAQAAQAEAACABAABAAQAAIAEAACABAABAAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAABAAQAAIAEAAEABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAABAAQAAIAEAAEABAAAgAQAAIAEAAEABAAAgAQAAIAEAACABAAAgAQAAIAEAAEABAAAgAQAAIAEAAGABAAAgAQAAIAEAAGABAAAgAQAAIAEAACABAAAgAQAAIAEAAEABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAAAgAQAAIAEAACABAABgAQAAQAEAACABAAAAAQAAgAEAACABAAAgAQAAIAEAACABAACAAQAAAAEAAIABAABgAQAAgAEAACABAAAgAQAAAAEAACABAAAAAQAAAAEAAAABAAAAAQAAAAEAAIABAADAAQAAAAEAAAABAAAgAQAAYAEAAAABAAAAAQAAIAEAAAABAAAgAQAAIAEAACABAAAAAQAAIAEAAAABAAAAAQAAIAEAAGABAAAAAQAAAAEAAAABAAAAAQAAIAEAACABAAAAAQAAIAEAACABAAAAAQAAIAEAACABAAAgAQAAAAEAACABAAAAAQAAAAEAAEABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAACAAQAAIAEAAAABAAAAAQAAAAEAACABAABAAQAAQAEAAEABAABAAQAAIAEAACABAAAAAQAAAAEAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==\r
759
756
  `)).arrayBuffer();
760
- await this.qt(t), this.Vt = D.parse(t)[0], await this.Ae();
757
+ await this.ct(t), this.et = l.parse(t)[0], await this.ut();
761
758
  }
762
- te(A) {
763
- if (A === void 0) return this.$t;
764
- this.$t = A, this.Lt = this.Nt.Gt(this.Ht.map((e) => e._t), this.$t, this.Wt);
765
- const t = this.Zt.dt(this.Ht, this.Lt, this.$t, this.Wt);
766
- this.Rt = t.framebuffer, this.zt = t.columns, this.Jt = t.rows;
759
+ Pt(A) {
760
+ if (A === void 0) return this.st;
761
+ this.st = A, this.Et = this.Dt.calculateMaxGlyphDimensions(this.Bt.map((e) => e.character), this.st, this.ot);
762
+ const t = this.ht.createTextureAtlas(this.Bt, this.Et, this.st, this.ot);
763
+ this.Qt = t.framebuffer, this.rt = t.columns, this.it = t.rows;
767
764
  }
768
- async ee(A) {
765
+ async It(A) {
769
766
  try {
770
767
  const t = await fetch(A);
771
768
  if (!t.ok) throw new I(`Failed to load font file: ${t.status} ${t.statusText}`);
772
769
  const e = await t.arrayBuffer();
773
- await this.qt(e);
774
- const B = D.parse(e);
775
- if (!B || B.length === 0) throw Error("Failed to parse font file");
776
- this.Vt = B[0], await this.Ae();
770
+ await this.ct(e);
771
+ const r = l.parse(e);
772
+ if (!r || r.length === 0) throw Error("Failed to parse font file");
773
+ this.et = r[0], await this.ut();
777
774
  } catch (t) {
778
775
  throw new I("Failed to load font: " + (t instanceof Error ? t.message : "Unknown error"), t);
779
776
  }
780
777
  }
781
- async qt(A) {
778
+ async ct(A) {
782
779
  const t = Date.now();
783
- this.Wt = this.Wt === "UrsaFont" ? "UrsaFont" : "CustomFont_" + t, this.Kt = new FontFace(this.Wt, A), await this.Kt.load(), document.fonts.add(this.Kt);
780
+ this.ot = this.ot === "UrsaFont" ? "UrsaFont" : "CustomFont_" + t, this.gt = new FontFace(this.ot, A), await this.gt.load(), document.fonts.add(this.gt);
784
781
  }
785
- async Ae() {
786
- const A = this.jt.ht(this.Vt), t = this.jt.ct(A);
787
- this.Ht = this.Xt.Ft(t, this.Vt), this.Lt = this.Nt.Gt(t, this.$t, this.Wt);
788
- const e = this.Zt.dt(this.Ht, this.Lt, this.$t, this.Wt);
789
- this.Rt = e.framebuffer, this.zt = e.columns, this.Jt = e.rows;
782
+ async ut() {
783
+ const A = this.nt.extractCharacters(this.et), t = this.nt.filterProblematicCharacters(A);
784
+ this.Bt = this.lt.createCharacterObjects(t, this.et), this.Et = this.Dt.calculateMaxGlyphDimensions(t, this.st, this.ot);
785
+ const e = this.ht.createTextureAtlas(this.Bt, this.Et, this.st, this.ot);
786
+ this.Qt = e.framebuffer, this.rt = e.columns, this.it = e.rows;
790
787
  }
791
- Ot(A) {
792
- return this.Xt.Ot(A, this.Ht);
788
+ getCharacterColor(A) {
789
+ return this.lt.getCharacterColor(A, this.Bt);
793
790
  }
794
- kt(A) {
795
- return this.Xt.kt(A, this.Ht);
791
+ getCharacterColors(A) {
792
+ return this.lt.getCharacterColors(A, this.Bt);
796
793
  }
797
- Be(A) {
794
+ hasAllCharacters(A) {
798
795
  if (typeof A != "string" || A.length === 0) return !1;
799
- const t = new Set(this.Ht.map((e) => e._t));
796
+ const t = new Set(this.Bt.map((e) => e.character));
800
797
  for (const e of A) if (!t.has(e)) return !1;
801
798
  return !0;
802
799
  }
803
- get Qe() {
804
- return this.Rt;
800
+ S() {
801
+ this.Qt.S(), document.fonts.delete(this.gt);
805
802
  }
806
- get se() {
807
- return this.Ht;
803
+ get fontFramebuffer() {
804
+ return this.Qt;
808
805
  }
809
- get Ee() {
810
- return this.zt;
806
+ get characters() {
807
+ return this.Bt;
811
808
  }
812
- get ie() {
813
- return this.Jt;
809
+ get textureColumns() {
810
+ return this.rt;
814
811
  }
815
- get re() {
816
- return this.Lt;
812
+ get textureRows() {
813
+ return this.it;
817
814
  }
818
- dispose() {
819
- this.Rt.dispose(), document.fonts.delete(this.Kt);
815
+ get maxGlyphDimensions() {
816
+ return this.Et;
820
817
  }
821
818
  get fontSize() {
822
- return this.$t;
819
+ return this.st;
823
820
  }
824
821
  get font() {
825
- return this.Vt;
822
+ return this.et;
826
823
  }
827
824
  }
828
- class gA {
825
+ class oA {
829
826
  constructor(A, t, e) {
830
- r(this, "ge");
831
- r(this, "oe");
832
- r(this, "p");
833
- r(this, "v");
834
- r(this, "ne");
835
- r(this, "he");
836
- r(this, "ae", !1);
837
- r(this, "De");
838
- r(this, "Ce");
839
- r(this, "le");
840
- this.De = A, this.Ce = t, this.le = e, this.reset();
841
- }
842
- reset() {
843
- this.ae || (this.ge = Math.floor(this.De.width / this.Ce), this.oe = Math.floor(this.De.height / this.le)), this.ce();
844
- }
845
- ce() {
846
- this.p = this.ge * this.Ce, this.v = this.oe * this.le, this.ne = Math.floor((this.De.width - this.p) / 2), this.he = Math.floor((this.De.height - this.v) / 2);
847
- }
848
- ue(A, t) {
849
- this.Ce = A, this.le = t, this.reset();
827
+ Q(this, "wt");
828
+ Q(this, "ft");
829
+ Q(this, "p");
830
+ Q(this, "_");
831
+ Q(this, "dt");
832
+ Q(this, "_t");
833
+ Q(this, "vt", !1);
834
+ Q(this, "bt");
835
+ Q(this, "xt");
836
+ Q(this, "yt");
837
+ this.bt = A, this.xt = t, this.yt = e, this.xA();
838
+ }
839
+ xA() {
840
+ this.vt || (this.wt = Math.floor(this.bt.width / this.xt), this.ft = Math.floor(this.bt.height / this.yt)), this.Mt();
841
+ }
842
+ Mt() {
843
+ this.p = this.wt * this.xt, this._ = this.ft * this.yt, this.dt = Math.floor((this.bt.width - this.p) / 2), this._t = Math.floor((this.bt.height - this._) / 2);
844
+ }
845
+ Gt(A, t) {
846
+ this.xt = A, this.yt = t, this.xA();
850
847
  }
851
- Pe(A, t) {
852
- this.ae = !0, this.ge = A, this.oe = t, this.ce();
848
+ Ft(A, t) {
849
+ this.vt = !0, this.wt = A, this.ft = t, this.Mt();
853
850
  }
854
- Ie() {
855
- this.ae = !1, this.reset();
851
+ Yt() {
852
+ this.vt = !1, this.xA();
856
853
  }
857
- resize() {
858
- this.ae ? this.ce() : this.reset();
854
+ $t() {
855
+ this.vt ? this.Mt() : this.xA();
859
856
  }
860
- we(A) {
861
- if (A === void 0) return this.ae;
862
- this.ae = A;
857
+ Tt(A) {
858
+ if (A === void 0) return this.vt;
859
+ this.vt = A;
863
860
  }
864
- get fe() {
865
- return this.Ce;
861
+ get cellWidth() {
862
+ return this.xt;
866
863
  }
867
- get de() {
868
- return this.le;
864
+ get cellHeight() {
865
+ return this.yt;
869
866
  }
870
867
  get cols() {
871
- return this.ge;
868
+ return this.wt;
872
869
  }
873
870
  get rows() {
874
- return this.oe;
871
+ return this.ft;
875
872
  }
876
873
  get width() {
877
874
  return this.p;
878
875
  }
879
876
  get height() {
880
- return this.v;
877
+ return this._;
881
878
  }
882
879
  get offsetX() {
883
- return this.ne;
880
+ return this.dt;
884
881
  }
885
882
  get offsetY() {
886
- return this.he;
883
+ return this._t;
887
884
  }
888
885
  }
889
- class oA {
886
+ class gA {
890
887
  constructor(A, t = !1, e = {}) {
891
- r(this, "De");
892
- r(this, "me");
893
- r(this, "pe");
894
- r(this, "ve");
895
- r(this, "be");
896
- this.me = A, this.pe = t, this.De = this.xe(e.width, e.height), t && this._e();
897
- }
898
- xe(A, t) {
899
- var B;
888
+ Q(this, "bt");
889
+ Q(this, "St");
890
+ Q(this, "Ot");
891
+ Q(this, "Ut");
892
+ Q(this, "onTransformChange");
893
+ this.St = A, this.Ot = t, this.bt = this.kt(e.width, e.height), t && this.setupTransformObserver();
894
+ }
895
+ kt(A, t) {
896
+ var r;
900
897
  const e = document.createElement("canvas");
901
- if (e.className = "textmodeCanvas", e.style.imageRendering = "pixelated", this.pe) e.width = A || 800, e.height = t || 600, document.body.appendChild(e);
898
+ if (e.className = "textmodeCanvas", e.style.imageRendering = "pixelated", this.Ot) e.width = A || 800, e.height = t || 600, document.body.appendChild(e);
902
899
  else {
903
- const s = this.me.getBoundingClientRect();
904
- let Q = Math.round(s.width), i = Math.round(s.height);
905
- if (this.me instanceof HTMLVideoElement) {
906
- const n = this.me;
907
- (Q === 0 || i === 0) && n.videoWidth > 0 && n.videoHeight > 0 && (Q = n.videoWidth, i = n.videoHeight);
900
+ const B = this.St.getBoundingClientRect();
901
+ let s = Math.round(B.width), i = Math.round(B.height);
902
+ if (this.St instanceof HTMLVideoElement) {
903
+ const n = this.St;
904
+ (s === 0 || i === 0) && n.videoWidth > 0 && n.videoHeight > 0 && (s = n.videoWidth, i = n.videoHeight);
908
905
  }
909
- e.width = Q, e.height = i, e.style.position = "absolute", e.style.pointerEvents = "none";
910
- const g = window.getComputedStyle(this.me);
911
- let o = parseInt(g.zIndex || "0", 10);
912
- isNaN(o) && (o = 0), e.style.zIndex = "" + (o + 1), this.ye(e), (B = this.me.parentNode) == null || B.insertBefore(e, this.me.nextSibling);
906
+ e.width = s, e.height = i, e.style.position = "absolute", e.style.pointerEvents = "none";
907
+ const o = window.getComputedStyle(this.St);
908
+ let g = parseInt(o.zIndex || "0", 10);
909
+ isNaN(g) && (g = 0), e.style.zIndex = "" + (g + 1), this.Vt(e), (r = this.St.parentNode) == null || r.insertBefore(e, this.St.nextSibling);
913
910
  }
914
911
  return e;
915
912
  }
916
- ye(A) {
917
- const t = this.me.getBoundingClientRect();
918
- let e = this.me.offsetParent;
913
+ Vt(A) {
914
+ const t = this.St.getBoundingClientRect();
915
+ let e = this.St.offsetParent;
919
916
  if (e && e !== document.body) {
920
- const B = e.getBoundingClientRect();
921
- A.style.top = t.top - B.top + "px", A.style.left = t.left - B.left + "px";
917
+ const r = e.getBoundingClientRect();
918
+ A.style.top = t.top - r.top + "px", A.style.left = t.left - r.left + "px";
922
919
  } else A.style.top = t.top + window.scrollY + "px", A.style.left = t.left + window.scrollX + "px";
923
920
  }
924
- resize(A, t) {
925
- if (this.pe) this.De.width = A ?? this.De.width, this.De.height = t ?? this.De.height;
921
+ $t(A, t) {
922
+ if (this.Ot) this.bt.width = A ?? this.bt.width, this.bt.height = t ?? this.bt.height;
926
923
  else {
927
- const e = this.me.getBoundingClientRect();
928
- let B = Math.round(e.width), s = Math.round(e.height);
929
- if (this.me instanceof HTMLVideoElement) {
930
- const Q = this.me;
931
- (B === 0 || s === 0) && Q.videoWidth > 0 && Q.videoHeight > 0 && (B = Q.videoWidth, s = Q.videoHeight);
924
+ const e = this.St.getBoundingClientRect();
925
+ let r = Math.round(e.width), B = Math.round(e.height);
926
+ if (this.St instanceof HTMLVideoElement) {
927
+ const s = this.St;
928
+ (r === 0 || B === 0) && s.videoWidth > 0 && s.videoHeight > 0 && (r = s.videoWidth, B = s.videoHeight);
932
929
  }
933
- this.De.width = B, this.De.height = s, this.ye(this.De);
930
+ this.bt.width = r, this.bt.height = B, this.Vt(this.bt);
934
931
  }
935
932
  }
936
- Me() {
937
- const A = { alpha: !1, premultipliedAlpha: !1, Ge: !0, antialias: !1, Fe: !1, Ye: !1, powerPreference: "high-performance" }, t = this.De.getContext("webgl2", A) || this.De.getContext("webgl", A);
933
+ Rt() {
934
+ const A = { alpha: !1, premultipliedAlpha: !1, preserveDrawingBuffer: !0, antialias: !1, depth: !1, stencil: !1, powerPreference: "high-performance" }, t = this.bt.getContext("webgl2", A) || this.bt.getContext("webgl", A);
938
935
  if (!t) throw new I("WebGL context could not be created. Ensure your browser supports WebGL.");
939
936
  return t;
940
937
  }
941
- _e() {
942
- this.ve = new ResizeObserver((A) => {
938
+ setupTransformObserver() {
939
+ this.Ut = new ResizeObserver((A) => {
943
940
  for (const t of A) {
944
941
  const e = t.contentRect;
945
- !this.be || Math.round(e.width) === this.De.width && Math.round(e.height) === this.De.height || this.be();
946
- }
947
- }), this.ve.observe(this.De);
948
- }
949
- dispose() {
950
- if (this.ve && this.ve.disconnect(), this.De) {
951
- const A = this.De.getContext("webgl") || this.De.getContext("webgl2");
952
- if (A) {
953
- const t = A.getExtension("WEBGL_lose_context");
954
- t && t.Te();
942
+ !this.onTransformChange || Math.round(e.width) === this.bt.width && Math.round(e.height) === this.bt.height || this.onTransformChange();
955
943
  }
956
- this.De.parentNode && this.De.parentNode.removeChild(this.De);
944
+ }), this.Ut.observe(this.bt);
945
+ }
946
+ S() {
947
+ this.Ut && this.Ut.disconnect();
948
+ const A = this.bt.getContext("webgl") || this.bt.getContext("webgl2");
949
+ if (A) {
950
+ const t = A.getExtension("WEBGL_lose_context");
951
+ t && t.loseContext();
957
952
  }
953
+ this.bt.parentNode && this.bt.parentNode.removeChild(this.bt);
958
954
  }
959
955
  get canvas() {
960
- return this.De;
956
+ return this.bt;
961
957
  }
962
958
  get width() {
963
- return this.De.width;
959
+ return this.bt.width;
964
960
  }
965
961
  get height() {
966
- return this.De.height;
962
+ return this.bt.height;
967
963
  }
968
964
  }
969
965
  class T {
970
- constructor(A, t, e, B = {}) {
971
- r(this, "Se");
972
- r(this, "Oe");
973
- r(this, "grid");
974
- r(this, "Ue");
975
- r(this, "ke");
976
- r(this, "Ve");
977
- r(this, "He");
978
- r(this, "Re");
979
- r(this, "h");
980
- this.Se = A, this.Oe = t, this.grid = e, this.h = B;
981
- const s = this.grid.cols, Q = this.grid.rows;
982
- this.Ue = this.Se.createFramebuffer(s, Q), this.ke = this.Se.createFramebuffer(s, Q), this.Ve = this.Se.createFramebuffer(s, Q), this.He = this.Se.createFramebuffer(s, Q), this.Re = this.Se.createFramebuffer(s, Q);
983
- }
984
- resize() {
985
- const A = this.grid.cols, t = this.grid.rows;
986
- this.Ue.resize(A, t), this.ke.resize(A, t), this.Ve.resize(A, t), this.He.resize(A, t), this.Re.resize(A, t);
966
+ constructor(A, t, e, r = {}) {
967
+ Q(this, "WA");
968
+ Q(this, "Ht");
969
+ Q(this, "zt");
970
+ Q(this, "Jt");
971
+ Q(this, "Lt");
972
+ Q(this, "Kt");
973
+ Q(this, "Wt");
974
+ Q(this, "jt");
975
+ Q(this, "h");
976
+ this.WA = A, this.Ht = t, this.zt = e, this.h = r;
977
+ const B = this.zt.cols, s = this.zt.rows;
978
+ this.Jt = this.WA.TA(B, s), this.Lt = this.WA.TA(B, s), this.Kt = this.WA.TA(B, s), this.Wt = this.WA.TA(B, s), this.jt = this.WA.TA(B, s);
979
+ }
980
+ $t() {
981
+ const A = this.zt.cols, t = this.zt.rows;
982
+ this.Jt.resize(A, t), this.Lt.resize(A, t), this.Kt.resize(A, t), this.Wt.resize(A, t), this.jt.resize(A, t);
987
983
  }
988
984
  enabled(A) {
989
985
  this.h.enabled = A;
@@ -994,23 +990,23 @@ class T {
994
990
  disable() {
995
991
  this.enabled(!1);
996
992
  }
997
- dispose() {
998
- this.Ue.dispose(), this.ke.dispose(), this.Ve.dispose(), this.He.dispose(), this.Re.dispose();
993
+ S() {
994
+ this.Jt.S(), this.Lt.S(), this.Kt.S(), this.Wt.S(), this.jt.S();
999
995
  }
1000
- get $e() {
1001
- return this.Ue;
996
+ get characterFramebuffer() {
997
+ return this.Jt;
1002
998
  }
1003
- get ze() {
1004
- return this.ke;
999
+ get primaryColorFramebuffer() {
1000
+ return this.Lt;
1005
1001
  }
1006
- get Je() {
1007
- return this.Ve;
1002
+ get secondaryColorFramebuffer() {
1003
+ return this.Kt;
1008
1004
  }
1009
- get Le() {
1010
- return this.He;
1005
+ get rotationFramebuffer() {
1006
+ return this.Wt;
1011
1007
  }
1012
- get Ke() {
1013
- return this.Re;
1008
+ get transformFramebuffer() {
1009
+ return this.jt;
1014
1010
  }
1015
1011
  get options() {
1016
1012
  return this.h;
@@ -1018,28 +1014,28 @@ class T {
1018
1014
  }
1019
1015
  class nA {
1020
1016
  constructor(A, t) {
1021
- r(this, "I");
1022
- r(this, "wt");
1023
- r(this, "We");
1024
- this.wt = A, this.We = t;
1025
- const e = Math.max(this.We.length, 1);
1026
- this.I = this.wt.createFramebuffer(e, 1), this.je();
1027
- }
1028
- je() {
1029
- const A = this.We.length;
1017
+ Q(this, "I");
1018
+ Q(this, "WA");
1019
+ Q(this, "Zt");
1020
+ this.WA = A, this.Zt = t;
1021
+ const e = Math.max(this.Zt.length, 1);
1022
+ this.I = this.WA.TA(e, 1), this.Nt();
1023
+ }
1024
+ Nt() {
1025
+ const A = this.Zt.length;
1030
1026
  this.I.width !== A && this.I.resize(A, 1);
1031
1027
  const t = new Uint8Array(1 * A * 4);
1032
1028
  for (let e = 0; e < A; e++) {
1033
- const B = this.We[e], s = 4 * e;
1034
- t[s] = B[0], t[s + 1] = B[1], t[s + 2] = B[2], t[s + 3] = 255;
1029
+ const r = this.Zt[e], B = 4 * e;
1030
+ t[B] = r[0], t[B + 1] = r[1], t[B + 2] = r[2], t[B + 3] = 255;
1035
1031
  }
1036
- this.I.S(t, A, 1);
1032
+ this.I.updatePixels(t, A, 1);
1037
1033
  }
1038
- Ze(A) {
1039
- this.We = A, this.je();
1034
+ setColors(A) {
1035
+ this.Zt = A, this.Nt();
1040
1036
  }
1041
- get Ne() {
1042
- return this.We;
1037
+ get colors() {
1038
+ return this.Zt;
1043
1039
  }
1044
1040
  get framebuffer() {
1045
1041
  return this.I;
@@ -1048,342 +1044,386 @@ class nA {
1048
1044
  return this.I.texture;
1049
1045
  }
1050
1046
  }
1051
- class Y extends T {
1052
- constructor(t, e, B, s = {}) {
1053
- super(t, e, B, s);
1054
- r(this, "palette");
1055
- this.palette = new nA(this.Se, this.Oe.kt(" .:-=+*%@#"));
1047
+ class S extends T {
1048
+ constructor(t, e, r, B = {}) {
1049
+ super(t, e, r, B);
1050
+ Q(this, "Xt");
1051
+ this.Xt = new nA(this.WA, this.Ht.getCharacterColors(" .:-=+*%@#"));
1056
1052
  }
1057
- se(t) {
1058
- u.validate(this.Oe.Be(t), "One or more characters do not exist in the current font.", { method: "characters", Ut: t }) && (this.h.se = t, this.palette.Ze(this.Oe.kt(t)));
1053
+ characters(t) {
1054
+ P.C(this.Ht.hasAllCharacters(t), "One or more characters do not exist in the current font.", { method: "characters", providedValue: t }) && (this.h.characters = t, this.Xt.setColors(this.Ht.getCharacterColors(t)));
1059
1055
  }
1060
- Xe(t, e, B, s = 255) {
1061
- const Q = this.qe(t, "characterColor", e, B, s);
1062
- Q && (this.h.Xe = Q);
1056
+ characterColor(t, e, r, B = 255) {
1057
+ const s = this.qt(t, "characterColor", e, r, B);
1058
+ s && (this.h.characterColor = s);
1063
1059
  }
1064
- AB(t) {
1065
- this.tB(t, "characterColorMode");
1060
+ characterColorMode(t) {
1061
+ this.Ae(t, "characterColorMode");
1066
1062
  }
1067
- eB(t, e, B, s = 255) {
1068
- const Q = this.qe(t, "cellColor", e, B, s);
1069
- Q && (this.h.eB = Q);
1063
+ cellColor(t, e, r, B = 255) {
1064
+ const s = this.qt(t, "cellColor", e, r, B);
1065
+ s && (this.h.cellColor = s);
1070
1066
  }
1071
- BB(t) {
1072
- this.tB(t, "cellColorMode");
1067
+ cellColorMode(t) {
1068
+ this.Ae(t, "cellColorMode");
1073
1069
  }
1074
- QB(t) {
1075
- this.sB(t, "invert", "Invert");
1070
+ invert(t) {
1071
+ this.te(t, "invert", "Invert");
1076
1072
  }
1077
1073
  rotation(t) {
1078
- if (!u.validate(typeof t == "number", "Rotation angle must be a number.", { method: "rotation", Ut: t })) return;
1074
+ if (!P.C(typeof t == "number", "Rotation angle must be a number.", { method: "rotation", providedValue: t })) return;
1079
1075
  (t %= 360) < 0 && (t += 360);
1080
- const e = 255 * t / 360, B = Math.floor(e) / 255, s = Math.round(e - B);
1081
- this.h.rotation = [B, s, 0, 1];
1076
+ const e = 255 * t / 360, r = Math.floor(e) / 255, B = Math.round(e - r);
1077
+ this.h.rotation = [r, B, 0, 1];
1082
1078
  }
1083
- EB(t) {
1084
- this.sB(t, "flipHorizontally", "Flip horizontally");
1079
+ flipHorizontally(t) {
1080
+ this.te(t, "flipHorizontally", "Flip horizontally");
1085
1081
  }
1086
- iB(t) {
1087
- this.sB(t, "flipVertically", "Flip vertically");
1082
+ flipVertically(t) {
1083
+ this.te(t, "flipVertically", "Flip vertically");
1088
1084
  }
1089
- qe(t, e, B, s, Q = 255) {
1090
- let i, g, o, n;
1085
+ qt(t, e, r, B, s = 255) {
1086
+ let i, o, g, n;
1091
1087
  if (typeof t == "string") {
1092
- const h = this.rB(t);
1093
- if (!h) return u.validate(!1, "Invalid hex color format. Use '#FF0000', '#F00', 'FF0000', or 'F00'.", { method: e, Ut: t }), null;
1094
- [i, g, o, n] = h;
1095
- } else if (i = t, g = B !== void 0 ? B : t, o = s !== void 0 ? s : t, n = Q, !u.validate([i, g, o, n].every((h) => h >= 0 && h <= 255), e.charAt(0).toUpperCase() + e.slice(1) + " color values must be between 0 and 255", { method: e, gB: { r: i, g, b: o, a: n } })) return null;
1096
- return [i / 255, g / 255, o / 255, n / 255];
1088
+ const a = this.ee(t);
1089
+ if (!a) return P.C(!1, "Invalid hex color format. Use '#FF0000', '#F00', 'FF0000', or 'F00'.", { method: e, providedValue: t }), null;
1090
+ [i, o, g, n] = a;
1091
+ } else if (i = t, o = r !== void 0 ? r : t, g = B !== void 0 ? B : t, n = s, !P.C([i, o, g, n].every((a) => a >= 0 && a <= 255), e.charAt(0).toUpperCase() + e.slice(1) + " color values must be between 0 and 255", { method: e, providedValues: { r: i, g: o, b: g, a: n } })) return null;
1092
+ return [i / 255, o / 255, g / 255, n / 255];
1097
1093
  }
1098
- tB(t, e) {
1099
- u.validate(["sampled", "fixed"].includes(t), "Invalid color mode. Must be 'sampled' or 'fixed'.", { method: e, Ut: t }) && (this.h[e] = t);
1094
+ Ae(t, e) {
1095
+ P.C(["sampled", "fixed"].includes(t), "Invalid color mode. Must be 'sampled' or 'fixed'.", { method: e, providedValue: t }) && (this.h[e] = t);
1100
1096
  }
1101
- sB(t, e, B) {
1102
- u.validate(typeof t == "boolean" || typeof t == "number" && Number.isInteger(t), B + " must be a boolean value or an integer (0 for false, any other number for true).", { method: e, Ut: t }) && (this.h[e] = !!t);
1097
+ te(t, e, r) {
1098
+ P.C(typeof t == "boolean" || typeof t == "number" && Number.isInteger(t), r + " must be a boolean value or an integer (0 for false, any other number for true).", { method: e, providedValue: t }) && (this.h[e] = !!t);
1103
1099
  }
1104
- rB(t) {
1100
+ ee(t) {
1105
1101
  return t = t.replace(/^#/, ""), /^[0-9A-Fa-f]{3}$|^[0-9A-Fa-f]{6}$/.test(t) ? (t.length === 3 && (t = t.split("").map((e) => e + e).join("")), [parseInt(t.slice(0, 2), 16), parseInt(t.slice(2, 4), 16), parseInt(t.slice(4, 6), 16), 255]) : null;
1106
1102
  }
1107
1103
  }
1108
- const hA = { enabled: !0, se: " .:-=+*%@#", Xe: [1, 1, 1, 1], AB: "sampled", eB: [0, 0, 0, 1], BB: "fixed", QB: !1, rotation: [0, 0, 0, 255], EB: !1, iB: !1, oB: [0, 255] };
1109
- class U extends Y {
1110
- constructor(t, e, B) {
1111
- super(t, e, B, { ...hA });
1112
- r(this, "nB");
1113
- r(this, "hB");
1114
- r(this, "aB");
1115
- r(this, "DB");
1116
- r(this, "CB");
1117
- r(this, "lB");
1118
- this.nB = new f(t.context, m, "precision lowp float;uniform sampler2D u_sketchTexture;uniform vec2 u_gridCellDimensions;uniform vec2 u_brightnessRange;varying vec2 v_uv;void main(){vec2 cellCenter=(floor(v_uv*u_gridCellDimensions)+vec2(0.5))/u_gridCellDimensions;vec4 color=texture2D(u_sketchTexture,cellCenter);float brightness=dot(color.rgb,vec3(0.299,0.587,0.114));float brightnessValue=brightness*255.0;if(brightnessValue>=u_brightnessRange.x&&brightnessValue<=u_brightnessRange.y){gl_FragColor=color;}else{gl_FragColor=vec4(0.0);}}"), this.hB = new f(t.context, m, "precision lowp float;uniform sampler2D u_sampleTexture;uniform vec4 u_fillColor;uniform bool u_useFixedColor;varying vec2 v_uv;void main(){vec4 sampleColor=texture2D(u_sampleTexture,v_uv);if(sampleColor.a>0.0){if(u_useFixedColor){gl_FragColor=u_fillColor;}else{gl_FragColor=sampleColor;}}else{gl_FragColor=vec4(0.0);}}"), this.DB = new f(t.context, m, "precision lowp float;uniform sampler2D u_sampleTexture;uniform bool u_invert;uniform bool u_flipHorizontally;uniform bool u_flipVertically;varying vec2 v_uv;void main(){vec4 sampleColor=texture2D(u_sampleTexture,v_uv);if(sampleColor.a>0.0){float invertValue=u_invert ? 1.0 : 0.0;float flipHValue=u_flipHorizontally ? 1.0 : 0.0;float flipVValue=u_flipVertically ? 1.0 : 0.0;gl_FragColor=vec4(invertValue,flipHValue,flipVValue,1.0);}else{gl_FragColor=vec4(0.0);}}"), this.CB = new f(t.context, m, "precision lowp float;uniform sampler2D u_sampleTexture;uniform vec4 u_rotationColor;varying vec2 v_uv;void main(){vec4 sampleColor=texture2D(u_sampleTexture,v_uv);if(sampleColor.a>0.0){gl_FragColor=u_rotationColor;}else{gl_FragColor=vec4(0.0);}}"), this.aB = new f(t.context, m, "precision lowp float;uniform sampler2D u_colorSampleFramebuffer;uniform sampler2D u_charPaletteTexture;uniform vec2 u_charPaletteSize;uniform vec2 u_brightnessRange;varying vec2 v_uv;void main(){vec4 color=texture2D(u_colorSampleFramebuffer,v_uv);if(color.a==0.0){gl_FragColor=vec4(0.0);return;}float brightness=dot(color.rgb,vec3(0.299,0.587,0.114))*255.0;vec2 range=u_brightnessRange;if(brightness<range.x||brightness>range.y){gl_FragColor=vec4(0.0);return;}float t=(brightness-range.x)/(range.y-range.x);float idx=clamp(floor(t*u_charPaletteSize.x),0.0,u_charPaletteSize.x-1.0);vec3 charColor=texture2D(u_charPaletteTexture,vec2((idx+0.5)/u_charPaletteSize.x,0.0)).rgb;gl_FragColor=vec4(charColor,1.0);}"), this.lB = this.Se.createFramebuffer(this.grid.cols, this.grid.rows);
1119
- }
1120
- cB(t) {
1121
- const e = this.grid.cols, B = this.grid.rows;
1122
- this.lB.O(), this.Se.clear(), this.Se.bA(this.nB), this.Se.j("u_sketchTexture", t), this.Se.j("u_gridCellDimensions", [e, B]), this.Se.j("u_brightnessRange", this.h.oB), this.Se.rect(0, 0, e, B), this.lB.end(), this.ke.O(), this.Se.clear(), this.Se.bA(this.hB), this.Se.j("u_sampleTexture", this.lB), this.Se.j("u_fillColor", this.h.Xe), this.Se.j("u_useFixedColor", this.h.AB === "fixed"), this.Se.rect(0, 0, e, B), this.ke.end(), this.Ve.O(), this.Se.clear(), this.Se.bA(this.hB), this.Se.j("u_sampleTexture", this.lB), this.Se.j("u_fillColor", this.h.eB), this.Se.j("u_useFixedColor", this.h.BB === "fixed"), this.Se.rect(0, 0, e, B), this.Ve.end(), this.Re.O(), this.Se.clear(), this.Se.bA(this.DB), this.Se.j("u_sampleTexture", this.lB), this.Se.j("u_invert", this.h.QB), this.Se.j("u_flipHorizontally", this.h.EB), this.Se.j("u_flipVertically", this.h.iB), this.Se.rect(0, 0, e, B), this.Re.end(), this.He.O(), this.Se.clear(), this.Se.bA(this.CB), this.Se.j("u_sampleTexture", this.lB), this.Se.j("u_rotationColor", this.h.rotation), this.Se.rect(0, 0, e, B), this.He.end(), this.Ue.O(), this.Se.clear(), this.Se.bA(this.aB), this.Se.j("u_colorSampleFramebuffer", this.lB), this.Se.j("u_charPaletteTexture", this.palette.texture), this.Se.j("u_charPaletteSize", [this.palette.Ne.length, 1]), this.Se.j("u_brightnessRange", this.h.oB), this.Se.rect(0, 0, e, B), this.Ue.end();
1123
- }
1124
- resize() {
1125
- super.resize(), this.lB.resize(this.grid.cols, this.grid.rows);
1126
- }
1127
- oB(t) {
1128
- u.validate(Array.isArray(t) && t.length === 2 && t.every((e) => typeof e == "number" && e >= 0 && e <= 255), "Brightness range must be an array of two numbers between 0 and 255.", { method: "brightnessRange", Ut: t }) && (this.h.oB = t);
1104
+ const G = `attribute vec2 a_position;\r
1105
+ attribute vec2 a_texCoord;\r
1106
+ varying vec2 v_uv;\r
1107
+ \r
1108
+ uniform float u_rotation; // rotation angle in radians\r
1109
+ uniform vec2 u_center; // rotation center in normalized coordinates\r
1110
+ uniform float u_aspectRatio; // canvas width / canvas height\r
1111
+ \r
1112
+ mat2 rotate2D(float angle) {\r
1113
+ float s = sin(angle);\r
1114
+ float c = cos(angle);\r
1115
+ return mat2(c, -s, s, c);\r
1116
+ }\r
1117
+ \r
1118
+ void main() {\r
1119
+ v_uv = a_texCoord;\r
1120
+ \r
1121
+ // Use the position directly (it's already in normalized device coordinates)\r
1122
+ vec2 pos = a_position;\r
1123
+ \r
1124
+ // Translate to origin for rotation\r
1125
+ pos -= u_center;\r
1126
+ \r
1127
+ // Correct for aspect ratio: scale X coordinate to make space square\r
1128
+ pos.x *= u_aspectRatio;\r
1129
+ \r
1130
+ // Rotate in corrected space\r
1131
+ // Negate rotation to make positive values rotate clockwise (like p5.js)\r
1132
+ pos = rotate2D(-u_rotation) * pos;\r
1133
+ \r
1134
+ // Restore aspect ratio: scale X coordinate back\r
1135
+ pos.x /= u_aspectRatio;\r
1136
+ \r
1137
+ // Translate back from origin\r
1138
+ pos += u_center;\r
1139
+ \r
1140
+ gl_Position = vec4(pos, 0.0, 1.0);\r
1141
+ }\r
1142
+ `, aA = { enabled: !0, characters: " .:-=+*%@#", characterColor: [1, 1, 1, 1], characterColorMode: "sampled", cellColor: [0, 0, 0, 1], cellColorMode: "fixed", invert: !1, rotation: [0, 0, 0, 255], flipHorizontally: !1, flipVertically: !1, brightnessRange: [0, 255] };
1143
+ class W extends S {
1144
+ constructor(t, e, r) {
1145
+ super(t, e, r, { ...aA });
1146
+ Q(this, "Be");
1147
+ Q(this, "Qe");
1148
+ Q(this, "se");
1149
+ Q(this, "re");
1150
+ Q(this, "ie");
1151
+ Q(this, "Ee");
1152
+ this.Be = new w(t.context, G, "precision lowp float;uniform sampler2D u_sketchTexture;uniform vec2 u_gridCellDimensions;uniform vec2 u_brightnessRange;varying vec2 v_uv;void main(){vec2 cellCenter=(floor(v_uv*u_gridCellDimensions)+vec2(0.5))/u_gridCellDimensions;vec4 color=texture2D(u_sketchTexture,cellCenter);float brightness=dot(color.rgb,vec3(0.299,0.587,0.114));float brightnessValue=brightness*255.0;if(brightnessValue>=u_brightnessRange.x&&brightnessValue<=u_brightnessRange.y){gl_FragColor=color;}else{gl_FragColor=vec4(0.0);}}"), this.Qe = new w(t.context, G, "precision lowp float;uniform sampler2D u_sampleTexture;uniform vec4 u_fillColor;uniform bool u_useFixedColor;varying vec2 v_uv;void main(){vec4 sampleColor=texture2D(u_sampleTexture,v_uv);if(sampleColor.a>0.0){if(u_useFixedColor){gl_FragColor=u_fillColor;}else{gl_FragColor=sampleColor;}}else{gl_FragColor=vec4(0.0);}}"), this.re = new w(t.context, G, "precision lowp float;uniform sampler2D u_sampleTexture;uniform bool u_invert;uniform bool u_flipHorizontally;uniform bool u_flipVertically;varying vec2 v_uv;void main(){vec4 sampleColor=texture2D(u_sampleTexture,v_uv);if(sampleColor.a>0.0){float invertValue=u_invert ? 1.0 : 0.0;float flipHValue=u_flipHorizontally ? 1.0 : 0.0;float flipVValue=u_flipVertically ? 1.0 : 0.0;gl_FragColor=vec4(invertValue,flipHValue,flipVValue,1.0);}else{gl_FragColor=vec4(0.0);}}"), this.ie = new w(t.context, G, "precision lowp float;uniform sampler2D u_sampleTexture;uniform vec4 u_rotationColor;varying vec2 v_uv;void main(){vec4 sampleColor=texture2D(u_sampleTexture,v_uv);if(sampleColor.a>0.0){gl_FragColor=u_rotationColor;}else{gl_FragColor=vec4(0.0);}}"), this.se = new w(t.context, G, "precision lowp float;uniform sampler2D u_colorSampleFramebuffer;uniform sampler2D u_charPaletteTexture;uniform vec2 u_charPaletteSize;uniform vec2 u_brightnessRange;varying vec2 v_uv;void main(){vec4 color=texture2D(u_colorSampleFramebuffer,v_uv);if(color.a==0.0){gl_FragColor=vec4(0.0);return;}float brightness=dot(color.rgb,vec3(0.299,0.587,0.114))*255.0;vec2 range=u_brightnessRange;if(brightness<range.x||brightness>range.y){gl_FragColor=vec4(0.0);return;}float t=(brightness-range.x)/(range.y-range.x);float idx=clamp(floor(t*u_charPaletteSize.x),0.0,u_charPaletteSize.x-1.0);vec3 charColor=texture2D(u_charPaletteTexture,vec2((idx+0.5)/u_charPaletteSize.x,0.0)).rgb;gl_FragColor=vec4(charColor,1.0);}"), this.Ee = this.WA.TA(this.zt.cols, this.zt.rows);
1153
+ }
1154
+ ge(t) {
1155
+ const e = this.zt.cols, r = this.zt.rows;
1156
+ this.Ee.begin(), this.WA.OA(), this.WA.IA(this.Be), this.WA.GA("u_sketchTexture", t), this.WA.GA("u_gridCellDimensions", [e, r]), this.WA.GA("u_brightnessRange", this.h.brightnessRange), this.WA.FA(0, 0, e, r), this.Ee.end(), this.Lt.begin(), this.WA.OA(), this.WA.IA(this.Qe), this.WA.GA("u_sampleTexture", this.Ee), this.WA.GA("u_fillColor", this.h.characterColor), this.WA.GA("u_useFixedColor", this.h.characterColorMode === "fixed"), this.WA.FA(0, 0, e, r), this.Lt.end(), this.Kt.begin(), this.WA.OA(), this.WA.IA(this.Qe), this.WA.GA("u_sampleTexture", this.Ee), this.WA.GA("u_fillColor", this.h.cellColor), this.WA.GA("u_useFixedColor", this.h.cellColorMode === "fixed"), this.WA.FA(0, 0, e, r), this.Kt.end(), this.jt.begin(), this.WA.OA(), this.WA.IA(this.re), this.WA.GA("u_sampleTexture", this.Ee), this.WA.GA("u_invert", this.h.invert), this.WA.GA("u_flipHorizontally", this.h.flipHorizontally), this.WA.GA("u_flipVertically", this.h.flipVertically), this.WA.FA(0, 0, e, r), this.jt.end(), this.Wt.begin(), this.WA.OA(), this.WA.IA(this.ie), this.WA.GA("u_sampleTexture", this.Ee), this.WA.GA("u_rotationColor", this.h.rotation), this.WA.FA(0, 0, e, r), this.Wt.end(), this.Jt.begin(), this.WA.OA(), this.WA.IA(this.se), this.WA.GA("u_colorSampleFramebuffer", this.Ee), this.WA.GA("u_charPaletteTexture", this.Xt.texture), this.WA.GA("u_charPaletteSize", [this.Xt.colors.length, 1]), this.WA.GA("u_brightnessRange", this.h.brightnessRange), this.WA.FA(0, 0, e, r), this.Jt.end();
1157
+ }
1158
+ $t() {
1159
+ super.$t(), this.Ee.resize(this.zt.cols, this.zt.rows);
1160
+ }
1161
+ brightnessRange(t) {
1162
+ P.C(Array.isArray(t) && t.length === 2 && t.every((e) => typeof e == "number" && e >= 0 && e <= 255), "Brightness range must be an array of two numbers between 0 and 255.", { method: "brightnessRange", providedValue: t }) && (this.h.brightnessRange = t);
1129
1163
  }
1130
1164
  }
1131
- const MA = Object.freeze(Object.defineProperty({ __proto__: null, uB: U, PB: T, IB: Y }, Symbol.toStringTag, { value: "Module" }));
1132
- class aA {
1165
+ const TA = Object.freeze(Object.defineProperty({ __proto__: null, TextmodeBrightnessConverter: W, TextmodeConverter: T, TextmodeFeatureConverter: S }, Symbol.toStringTag, { value: "Module" }));
1166
+ class hA {
1133
1167
  constructor(A, t, e) {
1134
- r(this, "Se");
1135
- r(this, "font");
1136
- r(this, "grid");
1137
- r(this, "wB");
1138
- r(this, "fB");
1139
- r(this, "dB");
1140
- r(this, "mB");
1141
- r(this, "pB");
1142
- r(this, "Ue");
1143
- r(this, "ke");
1144
- r(this, "Ve");
1145
- r(this, "He");
1146
- r(this, "Re");
1147
- this.Se = A, this.font = t, this.grid = e, this.pB = this.Se.createShader(m, "precision mediump float;uniform sampler2D u_characterTexture;uniform vec2 u_charsetDimensions;uniform sampler2D u_primaryColorTexture;uniform sampler2D u_secondaryColorTexture;uniform sampler2D u_transformTexture;uniform sampler2D u_asciiCharacterTexture;uniform sampler2D u_rotationTexture;uniform sampler2D u_captureTexture;uniform vec2 u_captureDimensions;uniform int u_backgroundMode;uniform vec2 u_gridCellDimensions;uniform vec2 u_gridPixelDimensions;mat2 rotate2D(float angle){float s=sin(angle);float c=cos(angle);return mat2(c,-s,s,c);}void main(){vec2 adjustedCoord=gl_FragCoord.xy/u_gridPixelDimensions;vec2 gridCoord=adjustedCoord*u_gridCellDimensions;vec2 cellCoord=floor(gridCoord);vec2 charIndexTexCoord=(cellCoord+0.5)/u_gridCellDimensions;vec4 primaryColor=texture2D(u_primaryColorTexture,charIndexTexCoord);vec4 secondaryColor=texture2D(u_secondaryColorTexture,charIndexTexCoord);vec4 transformColor=texture2D(u_transformTexture,charIndexTexCoord);bool isInverted=transformColor.r>0.5;bool flipHorizontal=transformColor.g>0.5;bool flipVertical=transformColor.b>0.5;vec4 encodedIndexVec=texture2D(u_asciiCharacterTexture,charIndexTexCoord);if(encodedIndexVec.a<0.01){gl_FragColor=(u_backgroundMode==0)? vec4(0.0):texture2D(u_captureTexture,gl_FragCoord.xy/u_captureDimensions);return;}int charIndex=int(encodedIndexVec.r*255.0+0.5)+int(encodedIndexVec.g*255.0+0.5)*256;int charCol=int(mod(float(charIndex),u_charsetDimensions.x));int charRow=charIndex/int(u_charsetDimensions.x);float flippedRow=(u_charsetDimensions.y-1.0)-float(charRow);vec2 charCoord=vec2(float(charCol),flippedRow)/u_charsetDimensions;vec4 rotationColor=texture2D(u_rotationTexture,charIndexTexCoord);float scaledAngle=rotationColor.r*255.0+rotationColor.g;float rotationAngle=(scaledAngle*360.0/255.0)*0.017453292;vec2 fractionalPart=fract(gridCoord)-0.5;if(flipHorizontal)fractionalPart.x=-fractionalPart.x;if(flipVertical)fractionalPart.y=-fractionalPart.y;fractionalPart=rotate2D(rotationAngle)*fractionalPart+0.5;vec2 cellSize=1.0/u_charsetDimensions;vec2 texCoord=charCoord+fractionalPart*cellSize;vec2 cellMax=charCoord+cellSize;if(any(lessThan(texCoord,charCoord))||any(greaterThan(texCoord,cellMax))){gl_FragColor=isInverted ? primaryColor : secondaryColor;return;}vec4 charTexel=texture2D(u_characterTexture,texCoord);if(isInverted)charTexel.rgb=1.0-charTexel.rgb;gl_FragColor=mix(secondaryColor,primaryColor,charTexel);}"), this.fB = new U(A, t, e), this.dB = new T(A, t, e), this.wB = [this.fB, this.dB], this.Ue = this.Se.createFramebuffer(e.cols, e.rows), this.ke = this.Se.createFramebuffer(e.cols, e.rows), this.Ve = this.Se.createFramebuffer(e.cols, e.rows), this.He = this.Se.createFramebuffer(e.cols, e.rows), this.Re = this.Se.createFramebuffer(e.cols, e.rows), this.mB = this.Se.createFramebuffer(this.grid.width, this.grid.height);
1148
- }
1149
- vB(A) {
1150
- for (const e of this.wB) e.options.enabled && e instanceof Y && e.cB(A);
1151
- const t = (e, B) => {
1152
- e.O(), this.Se.clear();
1153
- for (const s of this.wB) s.options.enabled && this.Se.image(B(s), 0, 0);
1168
+ Q(this, "WA");
1169
+ Q(this, "et");
1170
+ Q(this, "zt");
1171
+ Q(this, "oe");
1172
+ Q(this, "ne");
1173
+ Q(this, "ae");
1174
+ Q(this, "he");
1175
+ Q(this, "De");
1176
+ Q(this, "Jt");
1177
+ Q(this, "Lt");
1178
+ Q(this, "Kt");
1179
+ Q(this, "Wt");
1180
+ Q(this, "jt");
1181
+ this.WA = A, this.et = t, this.zt = e, this.De = this.WA.yA(R, "precision mediump float;uniform sampler2D u_characterTexture;uniform vec2 u_charsetDimensions;uniform sampler2D u_primaryColorTexture;uniform sampler2D u_secondaryColorTexture;uniform sampler2D u_transformTexture;uniform sampler2D u_asciiCharacterTexture;uniform sampler2D u_rotationTexture;uniform sampler2D u_captureTexture;uniform vec2 u_captureDimensions;uniform int u_backgroundMode;uniform vec2 u_gridCellDimensions;uniform vec2 u_gridPixelDimensions;mat2 rotate2D(float angle){float s=sin(angle);float c=cos(angle);return mat2(c,-s,s,c);}void main(){vec2 adjustedCoord=gl_FragCoord.xy/u_gridPixelDimensions;vec2 gridCoord=adjustedCoord*u_gridCellDimensions;vec2 cellCoord=floor(gridCoord);vec2 charIndexTexCoord=(cellCoord+0.5)/u_gridCellDimensions;vec4 primaryColor=texture2D(u_primaryColorTexture,charIndexTexCoord);vec4 secondaryColor=texture2D(u_secondaryColorTexture,charIndexTexCoord);vec4 transformColor=texture2D(u_transformTexture,charIndexTexCoord);bool isInverted=transformColor.r>0.5;bool flipHorizontal=transformColor.g>0.5;bool flipVertical=transformColor.b>0.5;vec4 encodedIndexVec=texture2D(u_asciiCharacterTexture,charIndexTexCoord);if(encodedIndexVec.a<0.01){gl_FragColor=(u_backgroundMode==0)? vec4(0.0):texture2D(u_captureTexture,gl_FragCoord.xy/u_captureDimensions);return;}int charIndex=int(encodedIndexVec.r*255.0+0.5)+int(encodedIndexVec.g*255.0+0.5)*256;int charCol=int(mod(float(charIndex),u_charsetDimensions.x));int charRow=charIndex/int(u_charsetDimensions.x);float flippedRow=(u_charsetDimensions.y-1.0)-float(charRow);vec2 charCoord=vec2(float(charCol),flippedRow)/u_charsetDimensions;vec4 rotationColor=texture2D(u_rotationTexture,charIndexTexCoord);float scaledAngle=rotationColor.r*255.0+rotationColor.g;float rotationAngle=(scaledAngle*360.0/255.0)*0.017453292;vec2 fractionalPart=fract(gridCoord)-0.5;if(flipHorizontal)fractionalPart.x=-fractionalPart.x;if(flipVertical)fractionalPart.y=-fractionalPart.y;fractionalPart=rotate2D(rotationAngle)*fractionalPart+0.5;vec2 cellSize=1.0/u_charsetDimensions;vec2 texCoord=charCoord+fractionalPart*cellSize;vec2 cellMax=charCoord+cellSize;if(any(lessThan(texCoord,charCoord))||any(greaterThan(texCoord,cellMax))){gl_FragColor=isInverted ? primaryColor : secondaryColor;return;}vec4 charTexel=texture2D(u_characterTexture,texCoord);if(isInverted)charTexel.rgb=1.0-charTexel.rgb;gl_FragColor=mix(secondaryColor,primaryColor,charTexel);}"), this.ne = new W(A, t, e), this.ae = new T(A, t, e), this.oe = [this.ne, this.ae], this.Jt = this.WA.TA(e.cols, e.rows), this.Lt = this.WA.TA(e.cols, e.rows), this.Kt = this.WA.TA(e.cols, e.rows), this.Wt = this.WA.TA(e.cols, e.rows), this.jt = this.WA.TA(e.cols, e.rows), this.he = this.WA.TA(this.zt.width, this.zt.height);
1182
+ }
1183
+ le(A) {
1184
+ for (const e of this.oe) e.options.enabled && e instanceof S && e.ge(A);
1185
+ const t = (e, r) => {
1186
+ e.begin(), this.WA.OA();
1187
+ for (const B of this.oe) B.options.enabled && this.WA.kA(r(B), 0, 0);
1154
1188
  e.end();
1155
1189
  };
1156
- t(this.Ue, (e) => e.$e), t(this.ke, (e) => e.ze), t(this.Ve, (e) => e.Je), t(this.He, (e) => e.Le), t(this.Re, (e) => e.Ke), this.mB.O(), this.Se.clear(), this.Se.bA(this.pB), this.Se.j("u_characterTexture", this.font.Qe), this.Se.j("u_charsetDimensions", [this.font.Ee, this.font.ie]), this.Se.j("u_asciiCharacterTexture", this.Ue.texture), this.Se.j("u_primaryColorTexture", this.ke.texture), this.Se.j("u_secondaryColorTexture", this.Ve.texture), this.Se.j("u_transformTexture", this.Re.texture), this.Se.j("u_rotationTexture", this.He.texture), this.Se.j("u_captureTexture", A.texture), this.Se.j("u_backgroundMode", !1), this.Se.j("u_captureDimensions", [A.width, A.height]), this.Se.j("u_gridCellDimensions", [this.grid.cols, this.grid.rows]), this.Se.j("u_gridPixelDimensions", [this.grid.width, this.grid.height]), this.Se.rect(0, 0, this.mB.width, this.mB.height), this.mB.end();
1190
+ t(this.Jt, (e) => e.characterFramebuffer), t(this.Lt, (e) => e.primaryColorFramebuffer), t(this.Kt, (e) => e.secondaryColorFramebuffer), t(this.Wt, (e) => e.rotationFramebuffer), t(this.jt, (e) => e.transformFramebuffer), this.he.begin(), this.WA.OA(), this.WA.IA(this.De), this.WA.GA("u_characterTexture", this.et.fontFramebuffer), this.WA.GA("u_charsetDimensions", [this.et.textureColumns, this.et.textureRows]), this.WA.GA("u_asciiCharacterTexture", this.Jt.texture), this.WA.GA("u_primaryColorTexture", this.Lt.texture), this.WA.GA("u_secondaryColorTexture", this.Kt.texture), this.WA.GA("u_transformTexture", this.jt.texture), this.WA.GA("u_rotationTexture", this.Wt.texture), this.WA.GA("u_captureTexture", A.texture), this.WA.GA("u_backgroundMode", !1), this.WA.GA("u_captureDimensions", [A.width, A.height]), this.WA.GA("u_gridCellDimensions", [this.zt.cols, this.zt.rows]), this.WA.GA("u_gridPixelDimensions", [this.zt.width, this.zt.height]), this.WA.FA(0, 0, this.he.width, this.he.height), this.he.end();
1157
1191
  }
1158
1192
  add(A) {
1159
- if (!u.validate(A === "brightness" || A === "custom", 'Converter type must be either "brightness" or "custom". Provided: ' + A, { method: "add", Ut: A })) return;
1193
+ if (!P.C(A === "brightness" || A === "custom", 'Converter type must be either "brightness" or "custom".', { method: "add", providedValue: A })) return;
1160
1194
  let t;
1161
- return t = A === "brightness" ? new U(this.Se, this.font, this.grid) : new T(this.Se, this.font, this.grid), this.wB.push(t), t;
1195
+ return t = A === "brightness" ? new W(this.WA, this.et, this.zt) : new T(this.WA, this.et, this.zt), this.oe.push(t), t;
1162
1196
  }
1163
1197
  remove(A) {
1164
- if (!u.validate(A instanceof T, "Parameter must be a TextmodeConverter instance.", { method: "remove", Ut: A })) return;
1165
- const t = this.wB.indexOf(A);
1166
- u.validate(t !== -1, "Converter instance not found in pipeline.", { method: "remove", Ut: A, bB: this.wB.length }) && this.wB.splice(t, 1);
1167
- }
1168
- get texture() {
1169
- return this.mB;
1198
+ if (!P.C(A instanceof T, "Parameter must be a TextmodeConverter instance.", { method: "remove", providedValue: A })) return;
1199
+ const t = this.oe.indexOf(A);
1200
+ P.C(t !== -1, "Converter instance not found in pipeline.", { method: "remove", providedValue: A, convertersCount: this.oe.length }) && this.oe.splice(t, 1);
1170
1201
  }
1171
- resize() {
1172
- this.mB.resize(this.grid.width, this.grid.height);
1173
- const A = this.grid.cols, t = this.grid.rows;
1174
- this.Ue.resize(A, t), this.ke.resize(A, t), this.Ve.resize(A, t), this.He.resize(A, t), this.Re.resize(A, t);
1175
- for (const e of this.wB) e.resize();
1202
+ $t() {
1203
+ this.he.resize(this.zt.width, this.zt.height);
1204
+ const A = this.zt.cols, t = this.zt.rows;
1205
+ this.Jt.resize(A, t), this.Lt.resize(A, t), this.Kt.resize(A, t), this.Wt.resize(A, t), this.jt.resize(A, t);
1206
+ for (const e of this.oe) e.$t();
1176
1207
  }
1177
- xB() {
1178
- return this.wB.some((A) => A.options.enabled);
1208
+ hasEnabledConverters() {
1209
+ return this.oe.some((A) => A.options.enabled);
1179
1210
  }
1180
1211
  disable() {
1181
- for (const A of this.wB) A.disable();
1212
+ for (const A of this.oe) A.disable();
1182
1213
  }
1183
1214
  enable() {
1184
- for (const A of this.wB) A.enable();
1215
+ for (const A of this.oe) A.enable();
1185
1216
  }
1186
- dispose() {
1187
- for (const A of this.wB) A.dispose();
1188
- this.Ue.dispose(), this.ke.dispose(), this.Ve.dispose(), this.He.dispose(), this.Re.dispose(), this.mB.dispose(), this.pB.dispose();
1217
+ S() {
1218
+ for (const A of this.oe) A.S();
1219
+ this.Jt.S(), this.Lt.S(), this.Kt.S(), this.Wt.S(), this.jt.S(), this.he.S(), this.De.S();
1189
1220
  }
1190
- get $e() {
1191
- return this.Ue;
1221
+ get texture() {
1222
+ return this.he;
1192
1223
  }
1193
- get ze() {
1194
- return this.ke;
1224
+ get characterFramebuffer() {
1225
+ return this.Jt;
1226
+ }
1227
+ get primaryColorFramebuffer() {
1228
+ return this.Lt;
1195
1229
  }
1196
- get Je() {
1197
- return this.Ve;
1230
+ get secondaryColorFramebuffer() {
1231
+ return this.Kt;
1198
1232
  }
1199
- get Le() {
1200
- return this.He;
1233
+ get rotationFramebuffer() {
1234
+ return this.Wt;
1235
+ }
1236
+ get transformFramebuffer() {
1237
+ return this.jt;
1238
+ }
1239
+ get brightness() {
1240
+ return this.ne;
1201
1241
  }
1202
- get Ke() {
1203
- return this.Re;
1242
+ get custom() {
1243
+ return this.ae;
1204
1244
  }
1205
1245
  }
1206
- const DA = (E) => class extends E {
1207
- fill(A, t, e, B) {
1208
- this.wt.fill(A, t, e, B);
1246
+ const lA = (E) => class extends E {
1247
+ fill(A, t, e, r) {
1248
+ this.WA.wA(A, t, e, r);
1209
1249
  }
1210
- stroke(A, t, e, B) {
1211
- this.wt.stroke(A, t, e, B);
1250
+ stroke(A, t, e, r) {
1251
+ this.WA.fA(A, t, e, r);
1212
1252
  }
1213
- xA(A) {
1214
- this.wt.xA(A);
1253
+ strokeWeight(A) {
1254
+ this.WA.dA(A);
1215
1255
  }
1216
- _A() {
1217
- this.wt._A();
1256
+ noStroke() {
1257
+ this.WA.mA();
1218
1258
  }
1219
- yA() {
1220
- this.wt.yA();
1259
+ noFill() {
1260
+ this.WA.pA();
1221
1261
  }
1222
1262
  rotate(A) {
1223
- this.wt.rotate(A);
1263
+ this.WA._A(A);
1224
1264
  }
1225
1265
  push() {
1226
- this.wt.push();
1266
+ this.WA.vA();
1227
1267
  }
1228
1268
  pop() {
1229
- this.wt.pop();
1269
+ this.WA.bA();
1230
1270
  }
1231
- rect(A, t, e = 1, B = 1) {
1232
- this.wt.rect(A, t, e, B);
1271
+ rect(A, t, e = 1, r = 1) {
1272
+ this.WA.FA(A, t, e, r);
1233
1273
  }
1234
- line(A, t, e, B) {
1235
- this.wt.line(A, t, e, B);
1274
+ line(A, t, e, r) {
1275
+ this.WA.$A(A, t, e, r);
1236
1276
  }
1237
- background(A, t = A, e = A, B = 255) {
1238
- this.wt.background(A, t, e, B);
1277
+ background(A, t = A, e = A, r = 255) {
1278
+ this.WA.SA(A, t, e, r);
1239
1279
  }
1240
1280
  createShader(A, t) {
1241
- return this.wt.createShader(A, t);
1281
+ return this.WA.yA(A, t);
1242
1282
  }
1243
- FA(A) {
1244
- return this.wt.FA(A);
1283
+ createFilterShader(A) {
1284
+ return this.WA.MA(A);
1245
1285
  }
1246
- bA(A) {
1247
- this.wt.bA(A);
1286
+ shader(A) {
1287
+ this.WA.IA(A);
1248
1288
  }
1249
- j(A, t) {
1250
- this.wt.j(A, t);
1289
+ setUniform(A, t) {
1290
+ this.WA.GA(A, t);
1251
1291
  }
1252
1292
  };
1253
- class O {
1254
- _B(A) {
1255
- const t = A.get("brightness"), e = t == null ? void 0 : t.$e, B = t == null ? void 0 : t.ze, s = t == null ? void 0 : t.Je, Q = t == null ? void 0 : t.Ke, i = t == null ? void 0 : t.Le;
1256
- return e == null || e.U(), B == null || B.U(), s == null || s.U(), Q == null || Q.U(), i == null || i.U(), { yB: (e == null ? void 0 : e.k) || new Uint8Array(0), MB: (B == null ? void 0 : B.k) || new Uint8Array(0), GB: (s == null ? void 0 : s.k) || new Uint8Array(0), FB: (Q == null ? void 0 : Q.k) || new Uint8Array(0), YB: (i == null ? void 0 : i.k) || new Uint8Array(0) };
1293
+ class Y {
1294
+ Ce(A) {
1295
+ const t = A.get("brightness"), e = t == null ? void 0 : t.characterFramebuffer, r = t == null ? void 0 : t.primaryColorFramebuffer, B = t == null ? void 0 : t.secondaryColorFramebuffer, s = t == null ? void 0 : t.transformFramebuffer, i = t == null ? void 0 : t.rotationFramebuffer;
1296
+ return e == null || e.loadPixels(), r == null || r.loadPixels(), B == null || B.loadPixels(), s == null || s.loadPixels(), i == null || i.loadPixels(), { characterPixels: (e == null ? void 0 : e.pixels) || new Uint8Array(0), primaryColorPixels: (r == null ? void 0 : r.pixels) || new Uint8Array(0), secondaryColorPixels: (B == null ? void 0 : B.pixels) || new Uint8Array(0), transformPixels: (s == null ? void 0 : s.pixels) || new Uint8Array(0), rotationPixels: (i == null ? void 0 : i.pixels) || new Uint8Array(0) };
1257
1297
  }
1258
- TB(A, t) {
1298
+ ce(A, t) {
1259
1299
  return A[t] + (A[t + 1] << 8);
1260
1300
  }
1261
- SB(A, t) {
1301
+ ue(A, t) {
1262
1302
  return { r: A[t], g: A[t + 1], b: A[t + 2], a: A[t + 3] };
1263
1303
  }
1264
1304
  }
1265
- class k {
1266
- OB(A, t) {
1305
+ class O {
1306
+ Pe(A, t) {
1267
1307
  return new Blob([A], { type: t });
1268
1308
  }
1269
- UB(A, t, e) {
1309
+ Ie(A, t, e) {
1270
1310
  try {
1271
- const B = this.OB(A, e), s = URL.createObjectURL(B), Q = document.createElement("a");
1272
- Q.href = s, Q.download = t, Q.style.display = "none", Q.rel = "noopener", document.body.appendChild(Q), Q.click(), document.body.removeChild(Q), URL.revokeObjectURL(s);
1273
- } catch (B) {
1274
- throw console.error("Failed to download file:", B), Error("File download failed: " + (B instanceof Error ? B.message : "Unknown error"));
1311
+ const r = this.Pe(A, e), B = URL.createObjectURL(r), s = document.createElement("a");
1312
+ s.href = B, s.download = t, s.style.display = "none", s.rel = "noopener", document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(B);
1313
+ } catch (r) {
1314
+ throw console.error("Failed to download file:", r), Error("File download failed: " + (r instanceof Error ? r.message : "Unknown error"));
1275
1315
  }
1276
1316
  }
1277
- kB() {
1317
+ we() {
1278
1318
  return (/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace(/:/g, "-");
1279
1319
  }
1280
- VB() {
1320
+ fe() {
1281
1321
  const A = /* @__PURE__ */ new Date();
1282
- return { HB: A.toISOString().split("T")[0], time: A.toTimeString().split(" ")[0].replace(/:/g, "-") };
1322
+ return { date: A.toISOString().split("T")[0], time: A.toTimeString().split(" ")[0].replace(/:/g, "-") };
1283
1323
  }
1284
- RB(A) {
1324
+ de(A) {
1285
1325
  return A.replace(/[<>:"/\\|?*]/g, "_").replace(/\s+/g, "_").replace(/_{2,}/g, "_").replace(/^_+|_+$/g, "").substring(0, 255);
1286
1326
  }
1287
- $B() {
1288
- return "'textmode-export'-" + this.kB();
1327
+ me() {
1328
+ return "'textmode-export'-" + this.we();
1289
1329
  }
1290
1330
  }
1291
- class lA extends O {
1292
- zB(A, t, e) {
1293
- const B = A[e] === 255, s = A[e + 1] === 255, Q = A[e + 2] === 255, i = t[e], g = t[e + 1];
1294
- return { JB: B, LB: s, KB: Q, rotation: Math.round(360 * (i + g / 255) / 255 * 100) / 100 };
1331
+ class cA extends Y {
1332
+ pe(A, t, e) {
1333
+ const r = A[e] === 255, B = A[e + 1] === 255, s = A[e + 2] === 255, i = t[e], o = t[e + 1];
1334
+ return { isInverted: r, flipHorizontal: B, flipVertical: s, rotation: Math.round(360 * (i + o / 255) / 255 * 100) / 100 };
1295
1335
  }
1296
- WB(A, t, e) {
1297
- return { x: A, y: t, jB: A * e.fe, ZB: t * e.de };
1336
+ _e(A, t, e) {
1337
+ return { x: A, y: t, cellX: A * e.cellWidth, cellY: t * e.cellHeight };
1298
1338
  }
1299
- NB(A, t) {
1339
+ ve(A, t) {
1300
1340
  const e = [];
1301
- let B = 0;
1302
- for (let s = 0; s < t.rows; s++) for (let Q = 0; Q < t.cols; Q++) {
1303
- const i = 4 * B, g = this.TB(A.yB, i);
1304
- let o = this.SB(A.MB, i), n = this.SB(A.GB, i);
1305
- const h = this.zB(A.FB, A.YB, i);
1306
- if (h.JB) {
1307
- const P = o;
1308
- o = n, n = P;
1341
+ let r = 0;
1342
+ for (let B = 0; B < t.rows; B++) for (let s = 0; s < t.cols; s++) {
1343
+ const i = 4 * r, o = this.ce(A.characterPixels, i);
1344
+ let g = this.ue(A.primaryColorPixels, i), n = this.ue(A.secondaryColorPixels, i);
1345
+ const a = this.pe(A.transformPixels, A.rotationPixels, i);
1346
+ if (a.isInverted) {
1347
+ const C = g;
1348
+ g = n, n = C;
1309
1349
  }
1310
- const a = this.WB(Q, s, t);
1311
- e.push({ charIndex: g, XB: o, qB: n, transform: h, position: a }), B++;
1350
+ const h = this._e(s, B, t);
1351
+ e.push({ charIndex: o, primaryColor: g, secondaryColor: n, transform: a, position: h }), r++;
1312
1352
  }
1313
1353
  return e;
1314
1354
  }
1315
1355
  }
1316
- class PA {
1317
- AQ(A, t) {
1356
+ class CA {
1357
+ tt(A, t) {
1318
1358
  const e = A.cmap;
1319
- for (const B of e.LA) if (B.format === 4) {
1320
- for (let s = 0; s < B.At.length; s++) if (t >= B.At[s] && t <= B.qA[s]) {
1321
- if (B.et[s] === 0) return t + B.tt[s] & 65535;
1359
+ for (const r of e.tables) if (r.format === 4) {
1360
+ for (let B = 0; B < r.startCount.length; B++) if (t >= r.startCount[B] && t <= r.endCount[B]) {
1361
+ if (r.idRangeOffset[B] === 0) return t + r.idDelta[B] & 65535;
1322
1362
  {
1323
- const Q = B.et[s] / 2 + (t - B.At[s]) - (B.At.length - s);
1324
- if (Q >= 0 && Q < B.Bt.length) {
1325
- const i = B.Bt[Q];
1326
- if (i !== 0) return i + B.tt[s] & 65535;
1363
+ const s = r.idRangeOffset[B] / 2 + (t - r.startCount[B]) - (r.startCount.length - B);
1364
+ if (s >= 0 && s < r.glyphIdArray.length) {
1365
+ const i = r.glyphIdArray[s];
1366
+ if (i !== 0) return i + r.idDelta[B] & 65535;
1327
1367
  }
1328
1368
  }
1329
1369
  }
1330
1370
  }
1331
1371
  return 0;
1332
1372
  }
1333
- tQ(A, t, e, B, s) {
1334
- const Q = s / A.head.unitsPerEm;
1335
- return { eQ: () => ({ x1: e + t.xMin * Q, y1: B + -t.yMax * Q, x2: e + t.xMax * Q, y2: B + -t.yMin * Q }), BQ: () => this.QQ(t, e, B, Q) };
1336
- }
1337
- QQ(A, t, e, B) {
1338
- if (!A || !A.gt) return "";
1339
- const { gt: s, ot: Q, rt: i, flags: g } = A;
1340
- if (!(s && Q && i && g)) return "";
1341
- let o = "", n = 0;
1342
- for (let h = 0; h < i.length; h++) {
1343
- const a = i[h];
1344
- if (!(a < n)) {
1345
- if (a >= n) {
1346
- const P = t + s[n] * B, c = e - Q[n] * B;
1347
- o += `M${P.toFixed(2)},${c.toFixed(2)}`;
1348
- let l = n + 1;
1349
- for (; l <= a; )
1350
- if (1 & g[l]) {
1351
- const C = t + s[l] * B, d = e - Q[l] * B;
1352
- o += `L${C.toFixed(2)},${d.toFixed(2)}`, l++;
1373
+ be(A, t, e, r, B) {
1374
+ const s = B / A.head.unitsPerEm;
1375
+ return { getBoundingBox: () => ({ x1: e + t.xMin * s, y1: r + -t.yMax * s, x2: e + t.xMax * s, y2: r + -t.yMin * s }), toSVG: () => this.xe(t, e, r, s) };
1376
+ }
1377
+ xe(A, t, e, r) {
1378
+ if (!A || !A.xs) return "";
1379
+ const { xs: B, ys: s, endPts: i, flags: o } = A;
1380
+ if (!(B && s && i && o)) return "";
1381
+ let g = "", n = 0;
1382
+ for (let a = 0; a < i.length; a++) {
1383
+ const h = i[a];
1384
+ if (!(h < n)) {
1385
+ if (h >= n) {
1386
+ const C = t + B[n] * r, D = e - s[n] * r;
1387
+ g += `M${C.toFixed(2)},${D.toFixed(2)}`;
1388
+ let c = n + 1;
1389
+ for (; c <= h; )
1390
+ if (1 & o[c]) {
1391
+ const u = t + B[c] * r, f = e - s[c] * r;
1392
+ g += `L${u.toFixed(2)},${f.toFixed(2)}`, c++;
1353
1393
  } else {
1354
- const C = t + s[l] * B, d = e - Q[l] * B;
1355
- let w = l + 1 > a ? n : l + 1;
1356
- if (1 & g[w]) {
1357
- const p = t + s[w] * B, v = e - Q[w] * B;
1358
- o += `Q${C.toFixed(2)},${d.toFixed(2)} ${p.toFixed(2)},${v.toFixed(2)}`, l = w + 1;
1394
+ const u = t + B[c] * r, f = e - s[c] * r;
1395
+ let d = c + 1 > h ? n : c + 1;
1396
+ if (1 & o[d]) {
1397
+ const m = t + B[d] * r, p = e - s[d] * r;
1398
+ g += `Q${u.toFixed(2)},${f.toFixed(2)} ${m.toFixed(2)},${p.toFixed(2)}`, c = d + 1;
1359
1399
  } else {
1360
- const p = (C + (t + s[w] * B)) / 2, v = (d + (e - Q[w] * B)) / 2;
1361
- o += `Q${C.toFixed(2)},${d.toFixed(2)} ${p.toFixed(2)},${v.toFixed(2)}`, l = w;
1400
+ const m = (u + (t + B[d] * r)) / 2, p = (f + (e - s[d] * r)) / 2;
1401
+ g += `Q${u.toFixed(2)},${f.toFixed(2)} ${m.toFixed(2)},${p.toFixed(2)}`, c = d;
1362
1402
  }
1363
1403
  }
1364
- o += "Z";
1404
+ g += "Z";
1365
1405
  }
1366
- n = a + 1;
1406
+ n = h + 1;
1367
1407
  }
1368
1408
  }
1369
- return o;
1409
+ return g;
1370
1410
  }
1371
- sQ(A, t, e, B, s) {
1372
- const Q = A.codePointAt(0) || 0, i = this.AQ(t, Q);
1373
- let g = null;
1374
- return t.glyf && t.glyf[i] !== null ? g = t.glyf[i] : D && D.T && D.T.glyf && D.T.glyf.Et && (g = D.T.glyf.Et(t, i), t.glyf && g && (t.glyf[i] = g)), this.tQ(t, g, e, B, s);
1411
+ ye(A, t, e, r, B) {
1412
+ const s = A.codePointAt(0) || 0, i = this.tt(t, s);
1413
+ let o = null;
1414
+ return t.glyf && t.glyf[i] !== null ? o = t.glyf[i] : l && l.T && l.T.glyf && l.T.glyf.VA && (o = l.T.glyf.VA(t, i), t.glyf && o && (t.glyf[i] = o)), this.be(t, o, e, r, B);
1375
1415
  }
1376
- EQ(A, t, e, B, s, Q, i, g) {
1377
- const o = e + (s - g * (i / t.head.unitsPerEm)) / 2, n = B + (Q + 0.7 * i) / 2;
1378
- return this.sQ(A, t, o, n, i).BQ() || null;
1416
+ Me(A, t, e, r, B, s, i, o) {
1417
+ const g = e + (B - o * (i / t.head.unitsPerEm)) / 2, n = r + (s + 0.7 * i) / 2;
1418
+ return this.ye(A, t, g, n, i).toSVG() || null;
1379
1419
  }
1380
1420
  }
1381
- class cA {
1421
+ class DA {
1382
1422
  constructor() {
1383
- r(this, "iQ");
1384
- this.iQ = new PA();
1423
+ Q(this, "Ge");
1424
+ this.Ge = new CA();
1385
1425
  }
1386
- rQ(A) {
1426
+ Fe(A) {
1387
1427
  return `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
1388
1428
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
1389
1429
  <svg width="${A.width}" height="${A.height}" viewBox="0 0 ${A.width} ${A.height}"
@@ -1391,175 +1431,175 @@ class cA {
1391
1431
  <title>textmode art generated via textmode.js</title>
1392
1432
  <desc>textmode art visualization generated by textmode.js library</desc>`;
1393
1433
  }
1394
- gQ() {
1434
+ Ye() {
1395
1435
  return `
1396
1436
  </g>
1397
1437
  </svg>`;
1398
1438
  }
1399
- oQ(A, t) {
1400
- if (!t.nQ) return "";
1401
- const e = t.backgroundColor, B = `rgba(${e[0]},${e[1]},${e[2]},${e[3] / 255})`;
1439
+ $e(A, t) {
1440
+ if (!t.includeBackgroundRectangles) return "";
1441
+ const e = t.backgroundColor, r = `rgba(${e[0]},${e[1]},${e[2]},${e[3] / 255})`;
1402
1442
  return `
1403
- <rect width="${A.width}" height="${A.height}" fill="${B}" />`;
1443
+ <rect width="${A.width}" height="${A.height}" fill="${r}" />`;
1404
1444
  }
1405
- hQ(A) {
1445
+ Te(A) {
1406
1446
  return `rgba(${A.r},${A.g},${A.b},${A.a / 255})`;
1407
1447
  }
1408
- aQ(A, t) {
1409
- const { transform: e, position: B } = A, s = B.jB + t.fe / 2, Q = B.ZB + t.de / 2, i = [];
1410
- if (e.LB || e.KB) {
1411
- const g = e.LB ? -1 : 1, o = e.KB ? -1 : 1;
1412
- i.push(`translate(${s} ${Q})`), i.push(`scale(${g} ${o})`), i.push(`translate(${-s} ${-Q})`);
1448
+ Se(A, t) {
1449
+ const { transform: e, position: r } = A, B = r.cellX + t.cellWidth / 2, s = r.cellY + t.cellHeight / 2, i = [];
1450
+ if (e.flipHorizontal || e.flipVertical) {
1451
+ const o = e.flipHorizontal ? -1 : 1, g = e.flipVertical ? -1 : 1;
1452
+ i.push(`translate(${B} ${s})`), i.push(`scale(${o} ${g})`), i.push(`translate(${-B} ${-s})`);
1413
1453
  }
1414
- return e.rotation && i.push(`rotate(${e.rotation} ${s} ${Q})`), i.length ? ` transform="${i.join(" ")}"` : "";
1415
- }
1416
- DQ(A, t, e) {
1417
- if (!e.nQ || A.qB.a === 0) return "";
1418
- const { position: B } = A, s = this.hQ(A.qB);
1419
- return e.CQ === "stroke" ? `
1420
- <rect x="${B.jB}" y="${B.ZB}" width="${t.fe}" height="${t.de}" stroke="${s}" fill="none" stroke-width="${e.strokeWidth}" />` : `
1421
- <rect x="${B.jB}" y="${B.ZB}" width="${t.fe}" height="${t.de}" fill="${s}" />`;
1422
- }
1423
- sQ(A, t, e, B) {
1424
- const s = e.se[A.charIndex];
1454
+ return e.rotation && i.push(`rotate(${e.rotation} ${B} ${s})`), i.length ? ` transform="${i.join(" ")}"` : "";
1455
+ }
1456
+ Oe(A, t, e) {
1457
+ if (!e.includeBackgroundRectangles || A.secondaryColor.a === 0) return "";
1458
+ const { position: r } = A, B = this.Te(A.secondaryColor);
1459
+ return e.drawMode === "stroke" ? `
1460
+ <rect x="${r.cellX}" y="${r.cellY}" width="${t.cellWidth}" height="${t.cellHeight}" stroke="${B}" fill="none" stroke-width="${e.strokeWidth}" />` : `
1461
+ <rect x="${r.cellX}" y="${r.cellY}" width="${t.cellWidth}" height="${t.cellHeight}" fill="${B}" />`;
1462
+ }
1463
+ ye(A, t, e, r) {
1464
+ const B = e.characters[A.charIndex];
1465
+ if (!B) return "";
1466
+ const s = this.Ge.Me(B.character, e.font, A.position.cellX, A.position.cellY, t.cellWidth, t.cellHeight, e.fontSize, B.advanceWidth);
1425
1467
  if (!s) return "";
1426
- const Q = this.iQ.EQ(s._t, e.font, A.position.jB, A.position.ZB, t.fe, t.de, e.fontSize, s.St);
1427
- if (!Q) return "";
1428
- const i = this.hQ(A.XB);
1429
- return B.CQ === "stroke" ? `
1430
- <path id="${`path-${A.charIndex}-${A.position.jB}-${A.position.ZB}`.replace(/\./g, "-")}" d="${Q}" stroke="${i}" stroke-width="${B.strokeWidth}" fill="none" />` : `
1431
- <path d="${Q}" fill="${i}" />`;
1432
- }
1433
- lQ(A, t, e, B) {
1434
- let s = "";
1435
- s += this.DQ(A, t, B);
1436
- const Q = this.aQ(A, t), i = this.sQ(A, t, e, B);
1437
- return i && (Q ? (s += `
1438
- <g${Q}>`, s += i, s += `
1439
- </g>`) : s += i), s;
1440
- }
1441
- cQ(A, t, e, B) {
1442
- let s = this.rQ(t);
1443
- s += this.oQ(t, B), s += `
1468
+ const i = this.Te(A.primaryColor);
1469
+ return r.drawMode === "stroke" ? `
1470
+ <path id="${`path-${A.charIndex}-${A.position.cellX}-${A.position.cellY}`.replace(/\./g, "-")}" d="${s}" stroke="${i}" stroke-width="${r.strokeWidth}" fill="none" />` : `
1471
+ <path d="${s}" fill="${i}" />`;
1472
+ }
1473
+ Ue(A, t, e, r) {
1474
+ let B = "";
1475
+ B += this.Oe(A, t, r);
1476
+ const s = this.Se(A, t), i = this.ye(A, t, e, r);
1477
+ return i && (s ? (B += `
1478
+ <g${s}>`, B += i, B += `
1479
+ </g>`) : B += i), B;
1480
+ }
1481
+ ke(A, t, e, r) {
1482
+ let B = this.Fe(t);
1483
+ B += this.$e(t, r), B += `
1444
1484
  <g id="ascii-cells">`;
1445
- for (const Q of A) s += this.lQ(Q, t, e, B);
1446
- return s += this.gQ(), s;
1485
+ for (const s of A) B += this.Ue(s, t, e, r);
1486
+ return B += this.Ye(), B;
1447
1487
  }
1448
- uQ(A) {
1488
+ Ve(A) {
1449
1489
  return A.replace(/<path[^>]*d=""[^>]*\/>/g, "").replace(/\n\s*\n/g, `
1450
1490
  `).replace(/[ \t]+$/gm, "");
1451
1491
  }
1452
1492
  }
1453
- class CA extends k {
1454
- PQ(A) {
1455
- return this.OB(A, "image/svg+xml;charset=utf-8");
1493
+ class uA extends O {
1494
+ Re(A) {
1495
+ return this.Pe(A, "image/svg+xml;charset=utf-8");
1456
1496
  }
1457
- IQ(A, t) {
1458
- this.UB(A, this.RB(t) + ".svg", "image/svg+xml;charset=utf-8");
1497
+ He(A, t) {
1498
+ this.Ie(A, this.de(t) + ".svg", "image/svg+xml;charset=utf-8");
1459
1499
  }
1460
- wQ(A, t) {
1461
- this.IQ(A, t || this.$B());
1500
+ ze(A, t) {
1501
+ this.He(A, t || this.me());
1462
1502
  }
1463
1503
  }
1464
- class V {
1504
+ class k {
1465
1505
  constructor() {
1466
- r(this, "fQ");
1467
- r(this, "dQ");
1468
- r(this, "mQ");
1469
- this.fQ = new lA(), this.dQ = new cA(), this.mQ = new CA();
1506
+ Q(this, "Je");
1507
+ Q(this, "Le");
1508
+ Q(this, "Ke");
1509
+ this.Je = new cA(), this.Le = new DA(), this.Ke = new uA();
1470
1510
  }
1471
- pQ(A) {
1472
- return { nQ: A.nQ ?? !0, CQ: A.CQ ?? "fill", strokeWidth: A.strokeWidth ?? 1, backgroundColor: A.backgroundColor ?? [0, 0, 0, 0] };
1511
+ We(A) {
1512
+ return { includeBackgroundRectangles: A.includeBackgroundRectangles ?? !0, drawMode: A.drawMode ?? "fill", strokeWidth: A.strokeWidth ?? 1, backgroundColor: A.backgroundColor ?? [0, 0, 0, 0] };
1473
1513
  }
1474
- vQ(A, t = {}) {
1475
- const e = this.pQ(t), B = this.fQ._B(A.bQ), s = this.fQ.NB(B, A.grid), Q = this.dQ.cQ(s, A.grid, A.font, e);
1476
- return this.dQ.uQ(Q);
1514
+ je(A, t = {}) {
1515
+ const e = this.We(t), r = this.Je.Ce(A.pipeline), B = this.Je.ve(r, A.grid), s = this.Le.ke(B, A.grid, A.font, e);
1516
+ return this.Le.Ve(s);
1477
1517
  }
1478
- wQ(A, t = {}) {
1479
- const e = this.vQ(A, t), B = t.filename || this.mQ.$B();
1480
- this.mQ.wQ(e, B);
1518
+ ze(A, t = {}) {
1519
+ const e = this.je(A, t), r = t.filename || this.Ke.me();
1520
+ this.Ke.ze(e, r);
1481
1521
  }
1482
1522
  }
1483
- class uA extends O {
1484
- xQ(A, t, e, B = " ") {
1523
+ class PA extends Y {
1524
+ Ze(A, t, e, r = " ") {
1485
1525
  var i;
1486
- const s = [];
1487
- let Q = 0;
1488
- for (let g = 0; g < t.rows; g++) {
1489
- const o = [];
1526
+ const B = [];
1527
+ let s = 0;
1528
+ for (let o = 0; o < t.rows; o++) {
1529
+ const g = [];
1490
1530
  for (let n = 0; n < t.cols; n++) {
1491
- const h = 4 * Q, a = this.TB(A.yB, h), P = ((i = e.se[a]) == null ? void 0 : i._t) || B;
1492
- o.push(P), Q++;
1531
+ const a = 4 * s, h = this.ce(A.characterPixels, a), C = ((i = e.characters[h]) == null ? void 0 : i.character) || r;
1532
+ g.push(C), s++;
1493
1533
  }
1494
- s.push(o);
1534
+ B.push(g);
1495
1535
  }
1496
- return s;
1536
+ return B;
1497
1537
  }
1498
1538
  }
1499
1539
  class IA {
1500
- _Q(A, t) {
1540
+ Ne(A, t) {
1501
1541
  const e = [];
1502
- for (const s of A) {
1503
- let Q = s.join("");
1504
- t.yQ || (Q = Q.replace(/\s+$/, "")), e.push(Q);
1542
+ for (const B of A) {
1543
+ let s = B.join("");
1544
+ t.preserveTrailingSpaces || (s = s.replace(/\s+$/, "")), e.push(s);
1505
1545
  }
1506
- const B = t.MQ === "crlf" ? `\r
1546
+ const r = t.lineEnding === "crlf" ? `\r
1507
1547
  ` : `
1508
1548
  `;
1509
- return e.join(B);
1549
+ return e.join(r);
1510
1550
  }
1511
1551
  }
1512
- class wA extends k {
1513
- GQ(A, t) {
1514
- const e = this.FQ(t);
1515
- this.UB(A, e, "text/plain;charset=utf-8");
1552
+ class dA extends O {
1553
+ Xe(A, t) {
1554
+ const e = this.qe(t);
1555
+ this.Ie(A, e, "text/plain;charset=utf-8");
1516
1556
  }
1517
- FQ(A) {
1518
- let t = this.RB(A);
1519
- return t === ".txt" || t.length <= 4 ? this.$B() : t;
1557
+ qe(A) {
1558
+ let t = this.de(A);
1559
+ return t === ".txt" || t.length <= 4 ? this.me() : t;
1520
1560
  }
1521
1561
  }
1522
- class L {
1562
+ class H {
1523
1563
  constructor() {
1524
- r(this, "fQ");
1525
- r(this, "dQ");
1526
- r(this, "mQ");
1527
- this.fQ = new uA(), this.dQ = new IA(), this.mQ = new wA();
1564
+ Q(this, "Je");
1565
+ Q(this, "Le");
1566
+ Q(this, "Ke");
1567
+ this.Je = new PA(), this.Le = new IA(), this.Ke = new dA();
1528
1568
  }
1529
- pQ(A) {
1530
- return { yQ: A.yQ ?? !1, MQ: A.MQ ?? "lf", YQ: A.YQ ?? " " };
1569
+ We(A) {
1570
+ return { preserveTrailingSpaces: A.preserveTrailingSpaces ?? !1, lineEnding: A.lineEnding ?? "lf", emptyCharacter: A.emptyCharacter ?? " " };
1531
1571
  }
1532
- TQ(A, t = {}) {
1533
- const e = this.pQ(t), B = this.fQ._B(A.bQ), s = this.fQ.xQ(B, A.grid, A.font, e.YQ);
1534
- return this.dQ._Q(s, e);
1572
+ AB(A, t = {}) {
1573
+ const e = this.We(t), r = this.Je.Ce(A.pipeline), B = this.Je.Ze(r, A.grid, A.font, e.emptyCharacter);
1574
+ return this.Le.Ne(B, e);
1535
1575
  }
1536
- GQ(A, t = {}) {
1537
- const e = this.TQ(A, t), B = t.filename || this.mQ.$B();
1538
- this.mQ.GQ(e, B);
1576
+ Xe(A, t = {}) {
1577
+ const e = this.AB(A, t), r = t.filename || this.Ke.me();
1578
+ this.Ke.Xe(e, r);
1539
1579
  }
1540
1580
  }
1541
- class dA extends O {
1542
- SQ(A, t = 1, e = "transparent") {
1543
- const B = A.canvas;
1544
- if (t === 1 && e === "transparent") return B;
1545
- const s = document.createElement("canvas"), Q = s.getContext("2d"), i = Math.round(B.width * t), g = Math.round(B.height * t);
1546
- return s.width = i, s.height = g, e !== "transparent" && (Q.fillStyle = e, Q.fillRect(0, 0, i, g)), Q.imageSmoothingEnabled = !1, Q.drawImage(B, 0, 0, B.width, B.height, 0, 0, i, g), s;
1581
+ class fA extends Y {
1582
+ tB(A, t = 1, e = "transparent") {
1583
+ const r = A.canvas;
1584
+ if (t === 1 && e === "transparent") return r;
1585
+ const B = document.createElement("canvas"), s = B.getContext("2d"), i = Math.round(r.width * t), o = Math.round(r.height * t);
1586
+ return B.width = i, B.height = o, e !== "transparent" && (s.fillStyle = e, s.fillRect(0, 0, i, o)), s.imageSmoothingEnabled = !1, s.drawImage(r, 0, 0, r.width, r.height, 0, 0, i, o), B;
1547
1587
  }
1548
1588
  }
1549
- class fA {
1550
- OQ(A, t) {
1551
- const e = this.UQ(t.format);
1552
- return t.format === "png" ? A.toDataURL(e) : A.toDataURL(e, t.kQ);
1553
- }
1554
- async VQ(A, t) {
1555
- return new Promise((e, B) => {
1556
- const s = this.UQ(t.format), Q = (i) => {
1557
- i ? e(i) : B(Error(`Failed to generate ${t.format.toUpperCase()} blob`));
1589
+ class wA {
1590
+ eB(A, t) {
1591
+ const e = this.BB(t.format);
1592
+ return t.format === "png" ? A.toDataURL(e) : A.toDataURL(e, t.quality);
1593
+ }
1594
+ async QB(A, t) {
1595
+ return new Promise((e, r) => {
1596
+ const B = this.BB(t.format), s = (i) => {
1597
+ i ? e(i) : r(Error(`Failed to generate ${t.format.toUpperCase()} blob`));
1558
1598
  };
1559
- t.format === "png" ? A.toBlob(Q, s) : A.toBlob(Q, s, t.kQ);
1599
+ t.format === "png" ? A.toBlob(s, B) : A.toBlob(s, B, t.quality);
1560
1600
  });
1561
1601
  }
1562
- UQ(A) {
1602
+ BB(A) {
1563
1603
  switch (A) {
1564
1604
  case "png":
1565
1605
  return "image/png";
@@ -1572,274 +1612,260 @@ class fA {
1572
1612
  }
1573
1613
  }
1574
1614
  }
1575
- const z = { HQ: "image/png", RQ: "image/jpeg", $Q: "image/webp" }, G = { HQ: ".png", RQ: ".jpg", $Q: ".webp" };
1576
- class mA extends k {
1577
- zQ(A, t, e) {
1578
- this.JQ(A, this.RB(t) + G[e]);
1615
+ const mA = { png: "image/png", jpg: "image/jpeg", webp: "image/webp" }, $ = { png: ".png", jpg: ".jpg", webp: ".webp" };
1616
+ class pA extends O {
1617
+ sB(A, t, e) {
1618
+ this.rB(A, this.de(t) + $[e]);
1579
1619
  }
1580
- JQ(A, t) {
1620
+ rB(A, t) {
1581
1621
  const e = URL.createObjectURL(A);
1582
1622
  try {
1583
- const B = document.createElement("a");
1584
- B.href = e, B.download = t, B.style.display = "none", B.rel = "noopener", document.body.appendChild(B), B.click(), document.body.removeChild(B);
1623
+ const r = document.createElement("a");
1624
+ r.href = e, r.download = t, r.style.display = "none", r.rel = "noopener", document.body.appendChild(r), r.click(), document.body.removeChild(r);
1585
1625
  } finally {
1586
1626
  URL.revokeObjectURL(e);
1587
1627
  }
1588
1628
  }
1589
- LQ(A) {
1590
- return A in z && A in G;
1591
- }
1592
- UQ(A) {
1593
- return z[A];
1594
- }
1595
- KQ(A) {
1596
- return G[A];
1629
+ iB(A) {
1630
+ return A in mA && A in $;
1597
1631
  }
1598
1632
  }
1599
- class pA {
1633
+ class xA {
1600
1634
  constructor() {
1601
- r(this, "fQ");
1602
- r(this, "dQ");
1603
- r(this, "mQ");
1604
- this.fQ = new dA(), this.dQ = new fA(), this.mQ = new mA();
1635
+ Q(this, "Je");
1636
+ Q(this, "Le");
1637
+ Q(this, "Ke");
1638
+ this.Je = new fA(), this.Le = new wA(), this.Ke = new pA();
1605
1639
  }
1606
- pQ(A) {
1607
- return { format: A.format ?? "png", kQ: A.kQ ?? 1, scale: A.scale ?? 1, backgroundColor: A.backgroundColor ?? "transparent" };
1640
+ We(A) {
1641
+ return { format: A.format ?? "png", quality: A.quality ?? 1, scale: A.scale ?? 1, backgroundColor: A.backgroundColor ?? "transparent" };
1608
1642
  }
1609
- WQ(A) {
1610
- if (console.log("Validating image export options:", A), !this.mQ.LQ(A.format)) throw Error(`Saving '${A.format}' files is not supported`);
1611
- if (A.kQ < 0 || A.kQ > 1) throw Error("Image quality must be between 0.0 and 1.0");
1643
+ EB(A) {
1644
+ if (console.log("Validating image export options:", A), !this.Ke.iB(A.format)) throw Error(`Saving '${A.format}' files is not supported`);
1645
+ if (A.quality < 0 || A.quality > 1) throw Error("Image quality must be between 0.0 and 1.0");
1612
1646
  if (A.scale <= 0) throw Error("Scale factor must be greater than 0");
1613
1647
  A.scale > 10 && console.warn("Large scale factors may result in very large files and slow performance"), A.format === "jpg" && A.backgroundColor === "transparent" && (A.backgroundColor = "black");
1614
1648
  }
1615
- jQ(A, t = {}) {
1616
- const e = this.pQ(t);
1617
- if (this.WQ(e), e.scale === 1 && e.backgroundColor === "transparent") return this.dQ.OQ(A.canvas, e);
1618
- const B = this.fQ.SQ(A, e.scale, e.backgroundColor);
1619
- return this.dQ.OQ(B, e);
1649
+ gB(A, t = {}) {
1650
+ const e = this.We(t);
1651
+ if (this.EB(e), e.scale === 1 && e.backgroundColor === "transparent") return this.Le.eB(A.canvas, e);
1652
+ const r = this.Je.tB(A, e.scale, e.backgroundColor);
1653
+ return this.Le.eB(r, e);
1620
1654
  }
1621
- async VQ(A, t = {}) {
1622
- const e = this.pQ(t);
1623
- if (this.WQ(e), e.scale === 1 && e.backgroundColor === "transparent") return await this.dQ.VQ(A.canvas, e);
1624
- const B = this.fQ.SQ(A, e.scale, e.backgroundColor);
1625
- return await this.dQ.VQ(B, e);
1655
+ async QB(A, t = {}) {
1656
+ const e = this.We(t);
1657
+ if (this.EB(e), e.scale === 1 && e.backgroundColor === "transparent") return await this.Le.QB(A.canvas, e);
1658
+ const r = this.Je.tB(A, e.scale, e.backgroundColor);
1659
+ return await this.Le.QB(r, e);
1626
1660
  }
1627
- async zQ(A, t = {}) {
1628
- const e = await this.VQ(A, t), B = t.format ?? "png", s = t.filename || this.mQ.$B();
1629
- this.mQ.zQ(e, s, B);
1661
+ async sB(A, t = {}) {
1662
+ const e = await this.QB(A, t), r = t.format ?? "png", B = t.filename || this.Ke.me();
1663
+ this.Ke.sB(e, B, r);
1630
1664
  }
1631
1665
  }
1632
1666
  const vA = (E) => class extends E {
1633
1667
  toString(A = {}) {
1634
- return new L().TQ(this, A);
1668
+ return new H().AB(this, A);
1635
1669
  }
1636
- ZQ(A = {}) {
1637
- new L().GQ(this, A);
1670
+ saveStrings(A = {}) {
1671
+ new H().Xe(this, A);
1638
1672
  }
1639
- BQ(A = {}) {
1640
- return new V().vQ(this, A);
1673
+ toSVG(A = {}) {
1674
+ return new k().je(this, A);
1641
1675
  }
1642
- wQ(A = {}) {
1643
- new V().wQ(this, A);
1676
+ saveSVG(A = {}) {
1677
+ new k().ze(this, A);
1644
1678
  }
1645
- async NQ(A, t = "png", e = {}) {
1646
- await new pA().zQ(this.XQ, { ...e, filename: A, format: t });
1679
+ async saveCanvas(A, t = "png", e = {}) {
1680
+ await new xA().sB(this.textmodeCanvas, { ...e, filename: A, format: t });
1647
1681
  }
1648
- }, xA = (E) => class extends E {
1649
- async ee(A) {
1650
- return this.Vt.ee(A).then(() => {
1651
- const t = this.Vt.re;
1652
- this.qQ.ue(t.width, t.height), this.As.resize();
1682
+ }, bA = (E) => class extends E {
1683
+ async loadFont(A) {
1684
+ return this.et.It(A).then(() => {
1685
+ const t = this.et.maxGlyphDimensions;
1686
+ this.zt.Gt(t.width, t.height), this.oB.$t();
1653
1687
  });
1654
1688
  }
1655
1689
  fontSize(A) {
1656
- if (!u.validate(typeof A == "number" && A > 0, "Font size must be a positive number greater than 0.", { method: "fontSize", Ut: A }) || this.Vt.fontSize === A) return;
1657
- this.Vt.te(A);
1658
- const t = this.Vt.re;
1659
- this.qQ.ue(t.width, t.height), this.As.resize(), this.wt.UA();
1690
+ if (!P.C(typeof A == "number" && A > 0, "Font size must be a positive number greater than 0.", { method: "fontSize", providedValue: A }) || this.et.fontSize === A) return;
1691
+ this.et.Pt(A);
1692
+ const t = this.et.maxGlyphDimensions;
1693
+ this.zt.Gt(t.width, t.height), this.oB.$t(), this.WA.UA();
1660
1694
  }
1661
- }, bA = (E) => class extends E {
1662
- ts(A) {
1663
- return this.As.add(A);
1695
+ }, yA = (E) => class extends E {
1696
+ addConverter(A) {
1697
+ return this.oB.add(A);
1664
1698
  }
1665
- es(A) {
1666
- this.As.remove(A);
1699
+ removeConverter(A) {
1700
+ this.oB.remove(A);
1667
1701
  }
1668
1702
  };
1669
1703
  class _A {
1670
1704
  constructor() {
1671
- r(this, "wt");
1672
- r(this, "Vt");
1673
- r(this, "As");
1674
- r(this, "XQ");
1675
- r(this, "qQ");
1705
+ Q(this, "WA");
1706
+ Q(this, "et");
1707
+ Q(this, "oB");
1708
+ Q(this, "textmodeCanvas");
1709
+ Q(this, "zt");
1676
1710
  }
1677
1711
  }
1678
- class H extends function(t, ...e) {
1679
- return e.reduce((B, s) => s(B), t);
1680
- }(_A, DA, vA, xA, bA) {
1712
+ class J extends function(t, ...e) {
1713
+ return e.reduce((r, B) => B(r), t);
1714
+ }(_A, lA, vA, bA, yA) {
1681
1715
  constructor(t = null, e = {}) {
1682
1716
  super();
1683
- r(this, "me");
1684
- r(this, "Bs");
1685
- r(this, "ve");
1686
- r(this, "Qs");
1687
- r(this, "ss");
1688
- r(this, "Es", null);
1689
- r(this, "rs", 0);
1690
- r(this, "gs");
1691
- r(this, "ns", !0);
1692
- r(this, "hs", 0);
1693
- r(this, "Ds", 0);
1694
- r(this, "Cs", 0);
1695
- r(this, "ls", []);
1696
- r(this, "cs", 10);
1697
- r(this, "us", !1);
1698
- r(this, "Ps", !1);
1699
- r(this, "Is", () => {
1717
+ Q(this, "St");
1718
+ Q(this, "nB");
1719
+ Q(this, "Ut");
1720
+ Q(this, "aB");
1721
+ Q(this, "hB");
1722
+ Q(this, "DB", null);
1723
+ Q(this, "lB", 0);
1724
+ Q(this, "CB");
1725
+ Q(this, "cB", !0);
1726
+ Q(this, "uB", 0);
1727
+ Q(this, "PB", 0);
1728
+ Q(this, "IB", 0);
1729
+ Q(this, "wB", []);
1730
+ Q(this, "fB", 10);
1731
+ Q(this, "dB", !1);
1732
+ Q(this, "mB", !1);
1733
+ Q(this, "pB", () => {
1700
1734
  });
1701
- r(this, "ws", () => {
1735
+ Q(this, "_B", () => {
1702
1736
  });
1703
- r(this, "fs");
1704
- r(this, "ds", !1);
1705
- this.me = t, this.Ps = t === null, this.Qs = e.ps ?? "auto", this.ss = e.vs ?? 60, this.gs = 1e3 / this.ss;
1737
+ Q(this, "vB");
1738
+ this.St = t, this.mB = t === null, this.aB = e.renderMode ?? "auto", this.hB = e.frameRate ?? 60, this.CB = 1e3 / this.hB;
1706
1739
  }
1707
1740
  static async create(t = null, e = {}) {
1708
- const B = new this(t, e), s = B.Ps ? e : void 0;
1709
- let Q, i;
1710
- B.XQ = new oA(B.me, B.Ps, s), B.wt = new BA(B.XQ.Me()), B.Ps ? (Q = e.width || 800, i = e.height || 600) : (Q = B.XQ.width || 800, i = B.XQ.height || 600), B.Bs = B.wt.createFramebuffer(Q, i), B.Vt = new rA(B.wt, e.fontSize ?? 16), await B.Vt.initialize(e.bs);
1711
- const g = B.Vt.re;
1712
- return B.qQ = new gA(B.XQ.canvas, g.width, g.height), B.As = new aA(B.wt, B.Vt, B.qQ), B.xs(), B._s(), B;
1713
- }
1714
- xs() {
1715
- this.fs = () => {
1716
- this.Ps ? this.ws() : this.resize();
1717
- }, window.addEventListener("resize", this.fs), window.ResizeObserver && this.me && !this.Ps && (this.ve = new ResizeObserver(() => {
1718
- this.resize();
1719
- }), this.ve.observe(this.me));
1720
- }
1721
- vB() {
1722
- if (this.ys(), this.Cs++, this.us) console.warn("Cannot render: Required resources have been disposed");
1723
- else if (this.Ps ? (this.Bs.O(), this.Is(), this.Bs.end()) : this.Bs.update(this.me), this.As.xB() ? (this.As.vB(this.Bs), this.wt.background(0), this.wt.image(this.As.texture, this.qQ.offsetX, this.qQ.offsetY, this.As.texture.width, this.As.texture.height)) : (this.wt.clear(), this.wt.image(this.Bs, this.qQ.offsetX, this.qQ.offsetY, this.Bs.width, this.Bs.height)), this.ds) {
1724
- let t = 0;
1725
- this.wt.image(this.As.$e, t, 0, this.As.$e.width, this.As.$e.height), t += this.As.$e.width, this.wt.image(this.As.ze, t, 0, this.As.ze.width, this.As.ze.height), t += this.As.ze.width, this.wt.image(this.As.Je, t, 0, this.As.Je.width, this.As.Je.height), t += this.As.Je.width, this.wt.image(this.As.Ke, t, 0, this.As.Ke.width, this.As.Ke.height), t += this.As.Ke.width, this.wt.image(this.As.Le, t, 0, this.As.Le.width, this.As.Le.height);
1726
- }
1741
+ const r = new this(t, e), B = r.mB ? e : void 0;
1742
+ let s, i;
1743
+ r.textmodeCanvas = new gA(r.captureSource, r.mB, B), r.WA = new rA(r.textmodeCanvas.Rt()), r.mB ? (s = e.width || 800, i = e.height || 600) : (s = r.textmodeCanvas.width || 800, i = r.textmodeCanvas.height || 600), r.nB = r.WA.TA(s, i), r.et = new QA(r.WA, e.fontSize ?? 16), await r.et.Ct(e.fontSource);
1744
+ const o = r.et.maxGlyphDimensions;
1745
+ return r.zt = new oA(r.textmodeCanvas.canvas, o.width, o.height), r.oB = new hA(r.WA, r.et, r.zt), r.bB(), r.xB(), r;
1746
+ }
1747
+ bB() {
1748
+ this.vB = () => {
1749
+ this.mB ? this._B() : this.yB();
1750
+ }, window.addEventListener("resize", this.vB), window.ResizeObserver && this.St && !this.mB && (this.Ut = new ResizeObserver(() => {
1751
+ this.yB();
1752
+ }), this.Ut.observe(this.St));
1727
1753
  }
1728
- resize() {
1729
- this.XQ.resize(), this.Bs.resize(this.XQ.width, this.XQ.height), this.qQ.resize(), this.As.resize(), this.wt.UA(), this.Qs !== "manual" && this.vB();
1754
+ render() {
1755
+ this.MB(), this.IB++, this.dB ? console.warn("Cannot render: Required resources have been disposed") : (this.mB ? (this.nB.begin(), this.pB(), this.nB.end()) : this.nB.update(this.St), this.oB.hasEnabledConverters() ? (this.oB.le(this.nB), this.WA.SA(0), this.WA.kA(this.oB.texture, this.zt.offsetX, this.zt.offsetY, this.oB.texture.width, this.oB.texture.height)) : (this.WA.OA(), this.WA.kA(this.nB, this.zt.offsetX, this.zt.offsetY, this.nB.width, this.nB.height)));
1730
1756
  }
1731
- _s() {
1732
- if (this.Qs !== "auto" || !this.ns) return;
1733
- this.rs = performance.now();
1757
+ yB() {
1758
+ this.textmodeCanvas.$t(), this.nB.resize(this.textmodeCanvas.width, this.textmodeCanvas.height), this.zt.$t(), this.oB.$t(), this.WA.UA(), this.aB !== "manual" && this.render();
1759
+ }
1760
+ xB() {
1761
+ if (this.aB !== "auto" || !this.cB) return;
1762
+ this.lB = performance.now();
1734
1763
  const t = (e) => {
1735
- if (!this.ns) return void (this.Es = null);
1736
- const B = e - this.rs;
1737
- B >= this.gs && (this.vB(), this.rs = e - B % this.gs), this.ns && (this.Es = requestAnimationFrame(t));
1764
+ if (!this.cB) return void (this.DB = null);
1765
+ const r = e - this.lB;
1766
+ r >= this.CB && (this.render(), this.lB = e - r % this.CB), this.cB && (this.DB = requestAnimationFrame(t));
1738
1767
  };
1739
- this.Es = requestAnimationFrame(t);
1768
+ this.DB = requestAnimationFrame(t);
1740
1769
  }
1741
- ys() {
1770
+ MB() {
1742
1771
  const t = performance.now();
1743
- if (this.Ds > 0) {
1744
- const e = t - this.Ds;
1745
- this.ls.push(e), this.ls.length > this.cs && this.ls.shift();
1746
- const B = this.ls.reduce((s, Q) => s + Q, 0) / this.ls.length;
1747
- this.hs = 1e3 / B;
1772
+ if (this.PB > 0) {
1773
+ const e = t - this.PB;
1774
+ this.wB.push(e), this.wB.length > this.fB && this.wB.shift();
1775
+ const r = this.wB.reduce((B, s) => B + s, 0) / this.wB.length;
1776
+ this.uB = 1e3 / r;
1748
1777
  }
1749
- this.Ds = t;
1778
+ this.PB = t;
1750
1779
  }
1751
- Ms() {
1752
- this.Es && (cancelAnimationFrame(this.Es), this.Es = null);
1780
+ GB() {
1781
+ this.DB && (cancelAnimationFrame(this.DB), this.DB = null);
1753
1782
  }
1754
- ps(t) {
1755
- this.Qs !== t && (this.Ms(), this.Qs = t, t === "auto" && this.ns && this._s());
1783
+ renderMode(t) {
1784
+ this.aB !== t && (this.GB(), this.aB = t, t === "auto" && this.cB && this.xB());
1756
1785
  }
1757
- vs(t) {
1758
- if (t === void 0) return this.hs;
1759
- this.ss = t, this.gs = 1e3 / t, this.Qs === "auto" && this.ns && (this.Ms(), this._s());
1786
+ frameRate(t) {
1787
+ if (t === void 0) return this.uB;
1788
+ this.hB = t, this.CB = 1e3 / t, this.aB === "auto" && this.cB && (this.GB(), this.xB());
1760
1789
  }
1761
- Gs() {
1762
- this.ns && (this.ns = !1, this.Es && (cancelAnimationFrame(this.Es), this.Es = null));
1790
+ noLoop() {
1791
+ this.cB && (this.cB = !1, this.DB && (cancelAnimationFrame(this.DB), this.DB = null));
1763
1792
  }
1764
1793
  loop() {
1765
- this.ns || (this.ns = !0, this.Qs === "auto" && this._s());
1794
+ this.cB || (this.cB = !0, this.aB === "auto" && this.xB());
1766
1795
  }
1767
- Fs(t = 1) {
1768
- if (u.validate(typeof t == "number" && t > 0 && Number.isInteger(t), "Redraw count must be a positive integer.", { method: "redraw", Ut: t })) for (let e = 0; e < t; e++) this.vB();
1796
+ redraw(t = 1) {
1797
+ if (P.C(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.render();
1769
1798
  }
1770
- Ys() {
1771
- return this.Qs === "auto" && this.ns;
1799
+ isLooping() {
1800
+ return this.aB === "auto" && this.cB;
1772
1801
  }
1773
1802
  draw(t) {
1774
- this.Is = t;
1803
+ this.pB = t;
1775
1804
  }
1776
- Ts(t) {
1777
- this.ws = t;
1805
+ windowResized(t) {
1806
+ this._B = t;
1778
1807
  }
1779
- Ss(t, e) {
1780
- this.XQ.resize(t, e), this.Bs.resize(this.XQ.width, this.XQ.height), this.qQ.resize(), this.As.resize(), this.wt.UA(), this.Qs !== "manual" && this.vB();
1808
+ resizeCanvas(t, e) {
1809
+ this.textmodeCanvas.$t(t, e), this.nB.resize(this.textmodeCanvas.width, this.textmodeCanvas.height), this.zt.$t(), this.oB.$t(), this.WA.UA(), this.aB !== "manual" && this.render();
1781
1810
  }
1782
1811
  destroy() {
1783
- this.us || (this.Ms(), window.removeEventListener("resize", this.fs), this.ve && this.ve.disconnect(), this.As.dispose(), this.Vt.dispose(), this.Bs.dispose(), this.wt.dispose(), this.us = !0);
1784
- }
1785
- debug(t) {
1786
- this.ds = t;
1812
+ this.dB || (this.GB(), window.removeEventListener("resize", this.vB), this.Ut && this.Ut.disconnect(), this.oB.S(), this.et.S(), this.nB.S(), this.WA.S(), this.dB = !0);
1787
1813
  }
1788
1814
  get grid() {
1789
- return this.qQ;
1815
+ return this.zt;
1790
1816
  }
1791
1817
  get font() {
1792
- return this.Vt;
1818
+ return this.et;
1793
1819
  }
1794
1820
  get mode() {
1795
- return this.Qs;
1821
+ return this.aB;
1796
1822
  }
1797
- get bQ() {
1798
- return this.As;
1823
+ get pipeline() {
1824
+ return this.oB;
1799
1825
  }
1800
1826
  get frameCount() {
1801
- return this.Cs;
1827
+ return this.IB;
1802
1828
  }
1803
1829
  set frameCount(t) {
1804
- this.Cs = t;
1830
+ this.IB = t;
1805
1831
  }
1806
1832
  get width() {
1807
- return this.XQ.width;
1833
+ return this.textmodeCanvas.width;
1808
1834
  }
1809
1835
  get height() {
1810
- return this.XQ.height;
1836
+ return this.textmodeCanvas.height;
1811
1837
  }
1812
- get Os() {
1813
- return this.us;
1838
+ get isDisposed() {
1839
+ return this.dB;
1814
1840
  }
1815
1841
  }
1816
- class j {
1842
+ class L {
1817
1843
  static async create(A, t = {}) {
1818
- if (A instanceof HTMLCanvasElement || A instanceof HTMLVideoElement) return H.create(A, t);
1844
+ if (A instanceof HTMLCanvasElement || A instanceof HTMLVideoElement) return J.create(A, t);
1819
1845
  {
1820
1846
  const e = A || {};
1821
- return H.create(null, e);
1847
+ return J.create(null, e);
1822
1848
  }
1823
1849
  }
1824
- static Us(A) {
1825
- u.u(A);
1850
+ static setErrorLevel(A) {
1851
+ P.u(A);
1826
1852
  }
1827
1853
  static get version() {
1828
- return "0.1.6-beta.6";
1854
+ return "0.1.6-beta.7";
1829
1855
  }
1830
1856
  }
1831
- const TA = Object.freeze(Object.defineProperty({ __proto__: null }, Symbol.toStringTag, { value: "Module" })), RA = j.create, SA = j.Us, GA = j.version;
1857
+ const MA = Object.freeze(Object.defineProperty({ __proto__: null }, Symbol.toStringTag, { value: "Module" })), RA = L.create, FA = L.setErrorLevel, UA = L.version;
1832
1858
  export {
1833
- oA as TextmodeCanvas,
1834
- aA as TextmodeConversionPipeline,
1859
+ gA as TextmodeCanvas,
1860
+ hA as TextmodeConversionPipeline,
1835
1861
  AA as TextmodeErrorLevel,
1836
- rA as TextmodeFont,
1837
- gA as TextmodeGrid,
1838
- H as Textmodifier,
1839
- MA as converters,
1862
+ QA as TextmodeFont,
1863
+ oA as TextmodeGrid,
1864
+ J as Textmodifier,
1865
+ TA as converters,
1840
1866
  RA as create,
1841
- TA as export,
1842
- SA as setErrorLevel,
1843
- j as textmode,
1844
- GA as version
1867
+ MA as export,
1868
+ FA as setErrorLevel,
1869
+ L as textmode,
1870
+ UA as version
1845
1871
  };