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