textmode.js 0.1.9-beta.6 → 0.2.0-beta.1

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