@kolkrabbi/design-editor 0.2.0 → 0.3.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 (34) hide show
  1. package/README.md +41 -26
  2. package/dist/{BufferResource-CKQMSOM4.js → BufferResource-BfLgK37S.js} +42 -34
  3. package/dist/{CanvasPool-ilDNHrRx.js → CanvasPool-YNSF8hsR.js} +9 -9
  4. package/dist/CanvasRenderer-Bl0rlqNq.js +2 -0
  5. package/dist/{browserAll-CJ593myQ.js → FederatedEventTarget-BJgROaRQ.js} +119 -127
  6. package/dist/FilterSystem-BUrPNXx-.js +1323 -0
  7. package/dist/{Geometry-D3fkwmax.js → Geometry-C5s5KpWq.js} +492 -411
  8. package/dist/{OrbitControls-CE3qSrHQ.js → OrbitControls-Cql8Rn2i.js} +1944 -1914
  9. package/dist/{RenderTargetSystem-umK0aqrs.js → RenderTargetSystem-oFwWv5IW.js} +1107 -612
  10. package/dist/WebGLRenderer-CXxpVIx3.js +2 -0
  11. package/dist/WebGPURenderer-BwLEUYBa.js +2 -0
  12. package/dist/browserAll-CAzdTUbR.js +6 -0
  13. package/dist/canvasUtils-BoNfkAod.js +168 -0
  14. package/dist/{rolldown-runtime-B0aSnxlc.js → chunk-3b4jIN3o.js} +4 -11
  15. package/dist/design-editor.css +2 -2
  16. package/dist/design-editor.js +7675 -8478
  17. package/dist/{getTextureBatchBindGroup-ChWkOJ3t.js → getTextureBatchBindGroup-CNWhZRbV.js} +5 -5
  18. package/dist/{host-6EhdLf5-.js → host-CVR9RL_W.js} +8 -6
  19. package/dist/{host-DPFYZP9I.js → host-be1CWhN1.js} +4 -2
  20. package/dist/init-jApIMi04.js +4 -0
  21. package/dist/{phase-D3rwI6OO.js → phase-t_DhU5Nm.js} +2 -2
  22. package/dist/pipeline-CMpuPUaX.js +11995 -0
  23. package/dist/{src-zDOFeQWX.js → src-QwKcYKfv.js} +747 -746
  24. package/dist/webworkerAll-DEZhpG90.js +2 -0
  25. package/package.json +33 -27
  26. package/LICENSE +0 -21
  27. package/dist/CanvasRenderer-CDbc3nH9.js +0 -3396
  28. package/dist/WebGLRenderer-DVKPZbKc.js +0 -2145
  29. package/dist/WebGPURenderer-DHSBocAL.js +0 -1656
  30. package/dist/canvasUtils-CXoNqK7T.js +0 -168
  31. package/dist/defaultFilter.vert-C9efGgir.js +0 -888
  32. package/dist/init-4Y6mtayI.js +0 -441
  33. package/dist/pipeline-DfTD40M-.js +0 -4825
  34. package/dist/webworkerAll-wTH3MKcZ.js +0 -2
@@ -1,2145 +0,0 @@
1
- import { n as e } from "./rolldown-runtime-B0aSnxlc.js";
2
- import { K as t, O as n, Q as r, V as i, _ as a, a as o, c as s, d as c, f as l, h as u, it as d, o as f, r as p, rt as m, s as h, t as ee, w as g } from "./Geometry-D3fkwmax.js";
3
- import { S as te, T as _, _ as v, d as y, h as ne, n as re, o as ie, r as ae, s as b, t as oe, w as se, x as ce, y as le } from "./RenderTargetSystem-umK0aqrs.js";
4
- import { a as x, c as ue, f as de, i as fe, n as pe, o as me, s as he, t as ge, u as _e } from "./BufferResource-CKQMSOM4.js";
5
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/graphics/gl/GlGraphicsAdaptor.mjs
6
- var ve = class {
7
- contextChange(e) {
8
- let t = new h({
9
- uColor: {
10
- value: new Float32Array([
11
- 1,
12
- 1,
13
- 1,
14
- 1
15
- ]),
16
- type: "vec4<f32>"
17
- },
18
- uTransformMatrix: {
19
- value: new r(),
20
- type: "mat3x3<f32>"
21
- },
22
- uRound: {
23
- value: 0,
24
- type: "f32"
25
- }
26
- }), n = e.limits.maxBatchableTextures, i = te({
27
- name: "graphics",
28
- bits: [
29
- ce,
30
- le(n),
31
- de,
32
- v
33
- ]
34
- });
35
- this.shader = new f({
36
- glProgram: i,
37
- resources: {
38
- localUniforms: t,
39
- batchSamplers: ne(n)
40
- }
41
- });
42
- }
43
- execute(e, t) {
44
- let n = t.context, r = n.customShader || this.shader, i = e.renderer, { batcher: a, instructions: o } = i.graphicsContext.getContextRenderData(n);
45
- r.groups[0] = i.globalUniforms.bindGroup, i.state.set(e.state), i.shader.bind(r), i.geometry.bind(a.geometry, r.glProgram);
46
- let s = o.instructions;
47
- for (let e = 0; e < o.instructionSize; e++) {
48
- let t = s[e];
49
- if (t.size) {
50
- for (let e = 0; e < t.textures.count; e++) i.texture.bind(t.textures.textures[e], e);
51
- i.geometry.draw(t.topology, t.size, t.start);
52
- }
53
- }
54
- }
55
- destroy() {
56
- this.shader.destroy(!0), this.shader = null;
57
- }
58
- };
59
- ve.extension = {
60
- type: [m.WebGLPipesAdaptor],
61
- name: "graphics"
62
- };
63
- //#endregion
64
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/scene/mesh/gl/GlMeshAdaptor.mjs
65
- var S = class {
66
- init() {
67
- let e = te({
68
- name: "mesh",
69
- bits: [
70
- de,
71
- _e,
72
- v
73
- ]
74
- });
75
- this._shader = new f({
76
- glProgram: e,
77
- resources: {
78
- uTexture: g.EMPTY.source,
79
- textureUniforms: { uTextureMatrix: {
80
- type: "mat3x3<f32>",
81
- value: new r()
82
- } }
83
- }
84
- });
85
- }
86
- execute(e, n) {
87
- let r = e.renderer, i = n._shader;
88
- if (!i) {
89
- i = this._shader;
90
- let e = n.texture, t = e.source;
91
- i.resources.uTexture = t, i.resources.uSampler = t.style, i.resources.textureUniforms.uniforms.uTextureMatrix = e.textureMatrix.mapCoord;
92
- } else if (!i.glProgram) {
93
- t("Mesh shader has no glProgram", n.shader);
94
- return;
95
- }
96
- i.groups[100] = r.globalUniforms.bindGroup, i.groups[101] = e.localUniformsBindGroup, r.encoder.draw({
97
- geometry: n._geometry,
98
- shader: i,
99
- state: n.state
100
- });
101
- }
102
- destroy() {
103
- this._shader.destroy(!0), this._shader = null;
104
- }
105
- };
106
- S.extension = {
107
- type: [m.WebGLPipesAdaptor],
108
- name: "mesh"
109
- };
110
- //#endregion
111
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/batcher/gl/GlBatchAdaptor.mjs
112
- var C = class {
113
- constructor() {
114
- this._tempState = o.for2d(), this._didUploadHash = {};
115
- }
116
- init(e) {
117
- e.renderer.runners.contextChange.add(this);
118
- }
119
- contextChange() {
120
- this._didUploadHash = {};
121
- }
122
- start(e, t, n) {
123
- let r = e.renderer, i = this._didUploadHash[n.uid];
124
- r.shader.bind(n, i), i || (this._didUploadHash[n.uid] = !0), r.shader.updateUniformGroup(r.globalUniforms.uniformGroup), r.geometry.bind(t, n.glProgram);
125
- }
126
- execute(e, t) {
127
- let n = e.renderer;
128
- this._tempState.blendMode = t.blendMode, n.state.set(this._tempState);
129
- let r = t.textures.textures;
130
- for (let e = 0; e < t.textures.count; e++) n.texture.bind(r[e], e);
131
- n.geometry.draw(t.topology, t.size, t.start);
132
- }
133
- };
134
- C.extension = {
135
- type: [m.WebGLPipesAdaptor],
136
- name: "batch"
137
- };
138
- //#endregion
139
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/buffer/const.mjs
140
- var w = /* @__PURE__ */ ((e) => (e[e.ELEMENT_ARRAY_BUFFER = 34963] = "ELEMENT_ARRAY_BUFFER", e[e.ARRAY_BUFFER = 34962] = "ARRAY_BUFFER", e[e.UNIFORM_BUFFER = 35345] = "UNIFORM_BUFFER", e))(w || {}), ye = class {
141
- constructor(e, t) {
142
- this._lastBindBaseLocation = -1, this._lastBindCallId = -1, this.buffer = e || null, this.updateID = -1, this.byteLength = -1, this.type = t;
143
- }
144
- destroy() {
145
- this.buffer = null, this.updateID = -1, this.byteLength = -1, this.type = -1, this._lastBindBaseLocation = -1, this._lastBindCallId = -1;
146
- }
147
- }, T = class {
148
- constructor(e) {
149
- this._boundBufferBases = /* @__PURE__ */ Object.create(null), this._minBaseLocation = 0, this._nextBindBaseIndex = this._minBaseLocation, this._bindCallId = 0, this._renderer = e, this._managedBuffers = new y({
150
- renderer: e,
151
- type: "resource",
152
- onUnload: this.onBufferUnload.bind(this),
153
- name: "glBuffer"
154
- });
155
- }
156
- destroy() {
157
- this._managedBuffers.destroy(), this._renderer = null, this._gl = null, this._boundBufferBases = {};
158
- }
159
- contextChange() {
160
- this._gl = this._renderer.gl, this.destroyAll(!0), this._maxBindings = this._renderer.limits.maxUniformBindings;
161
- }
162
- getGlBuffer(e) {
163
- return e._gcLastUsed = this._renderer.gc.now, e._gpuData[this._renderer.uid] || this.createGLBuffer(e);
164
- }
165
- bind(e) {
166
- let { _gl: t } = this, n = this.getGlBuffer(e);
167
- t.bindBuffer(n.type, n.buffer);
168
- }
169
- bindBufferBase(e, t) {
170
- let { _gl: n } = this;
171
- this._boundBufferBases[t] !== e && (this._boundBufferBases[t] = e, e._lastBindBaseLocation = t, n.bindBufferBase(n.UNIFORM_BUFFER, t, e.buffer));
172
- }
173
- nextBindBase(e) {
174
- this._bindCallId++, this._minBaseLocation = 0, e && (this._boundBufferBases[0] = null, this._minBaseLocation = 1, this._nextBindBaseIndex < 1 && (this._nextBindBaseIndex = 1));
175
- }
176
- freeLocationForBufferBase(e) {
177
- let t = this.getLastBindBaseLocation(e);
178
- if (t >= this._minBaseLocation) return e._lastBindCallId = this._bindCallId, t;
179
- let n = 0, r = this._nextBindBaseIndex;
180
- for (; n < 2;) {
181
- r >= this._maxBindings && (r = this._minBaseLocation, n++);
182
- let e = this._boundBufferBases[r];
183
- if (e && e._lastBindCallId === this._bindCallId) {
184
- r++;
185
- continue;
186
- }
187
- break;
188
- }
189
- return t = r, this._nextBindBaseIndex = r + 1, n >= 2 ? -1 : (e._lastBindCallId = this._bindCallId, this._boundBufferBases[t] = null, t);
190
- }
191
- getLastBindBaseLocation(e) {
192
- let t = e._lastBindBaseLocation;
193
- return this._boundBufferBases[t] === e ? t : -1;
194
- }
195
- bindBufferRange(e, t, n, r) {
196
- let { _gl: i } = this;
197
- n ||= 0, t ||= 0, this._boundBufferBases[t] = null, i.bindBufferRange(i.UNIFORM_BUFFER, t || 0, e.buffer, n * 256, r || 256);
198
- }
199
- updateBuffer(e) {
200
- let { _gl: t } = this, n = this.getGlBuffer(e);
201
- if (e._updateID === n.updateID) return n;
202
- n.updateID = e._updateID, t.bindBuffer(n.type, n.buffer);
203
- let r = e.data, i = e.descriptor.usage & p.STATIC ? t.STATIC_DRAW : t.DYNAMIC_DRAW;
204
- return r ? n.byteLength >= r.byteLength ? t.bufferSubData(n.type, 0, r, 0, e._updateSize / r.BYTES_PER_ELEMENT) : (n.byteLength = r.byteLength, t.bufferData(n.type, r, i)) : (n.byteLength = e.descriptor.size, t.bufferData(n.type, n.byteLength, i)), n;
205
- }
206
- destroyAll(e = !1) {
207
- this._managedBuffers.removeAll(e);
208
- }
209
- onBufferUnload(e, t = !1) {
210
- let n = e._gpuData[this._renderer.uid];
211
- n && (t || this._gl.deleteBuffer(n.buffer));
212
- }
213
- createGLBuffer(e) {
214
- let { _gl: t } = this, n = w.ARRAY_BUFFER;
215
- e.descriptor.usage & p.INDEX ? n = w.ELEMENT_ARRAY_BUFFER : e.descriptor.usage & p.UNIFORM && (n = w.UNIFORM_BUFFER);
216
- let r = new ye(t.createBuffer(), n);
217
- return e._gpuData[this._renderer.uid] = r, this._managedBuffers.add(e), r;
218
- }
219
- resetState() {
220
- this._boundBufferBases = /* @__PURE__ */ Object.create(null);
221
- }
222
- };
223
- T.extension = {
224
- type: [m.WebGLSystem],
225
- name: "buffer"
226
- };
227
- //#endregion
228
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/context/GlContextSystem.mjs
229
- var E = class e {
230
- constructor(e) {
231
- this.supports = {
232
- uint32Indices: !0,
233
- uniformBufferObject: !0,
234
- vertexArrayObject: !0,
235
- srgbTextures: !0,
236
- nonPowOf2wrapping: !0,
237
- msaa: !0,
238
- nonPowOf2mipmaps: !0
239
- }, this._renderer = e, this.extensions = /* @__PURE__ */ Object.create(null), this.handleContextLost = this.handleContextLost.bind(this), this.handleContextRestored = this.handleContextRestored.bind(this);
240
- }
241
- get isLost() {
242
- return !this.gl || this.gl.isContextLost();
243
- }
244
- contextChange(e) {
245
- this.gl = e, this._renderer.gl = e;
246
- }
247
- init(n) {
248
- n = {
249
- ...e.defaultOptions,
250
- ...n
251
- };
252
- let r = this.multiView = n.multiView;
253
- if (n.context && r && (t("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."), r = !1), this.canvas = r ? a.get().createCanvas(this._renderer.canvas.width, this._renderer.canvas.height) : this._renderer.view.canvas, n.context) this.initFromContext(n.context);
254
- else {
255
- let e = this._renderer.background.alpha < 1, t = n.premultipliedAlpha ?? !0, r = n.antialias && !this._renderer.backBuffer.useBackBuffer;
256
- this.createContext(n.preferWebGLVersion, {
257
- alpha: e,
258
- premultipliedAlpha: t,
259
- antialias: r,
260
- stencil: !0,
261
- preserveDrawingBuffer: n.preserveDrawingBuffer,
262
- powerPreference: n.powerPreference ?? "default"
263
- });
264
- }
265
- }
266
- ensureCanvasSize(e) {
267
- if (!this.multiView) {
268
- e !== this.canvas && t("multiView is disabled, but targetCanvas is not the main canvas");
269
- return;
270
- }
271
- let { canvas: n } = this;
272
- (n.width < e.width || n.height < e.height) && (n.width = Math.max(e.width, e.width), n.height = Math.max(e.height, e.height));
273
- }
274
- initFromContext(e) {
275
- this.gl = e, this.webGLVersion = e instanceof a.get().getWebGLRenderingContext() ? 1 : 2, this.getExtensions(), this.validateContext(e), this._renderer.runners.contextChange.emit(e);
276
- let t = this._renderer.view.canvas;
277
- t.addEventListener("webglcontextlost", this.handleContextLost, !1), t.addEventListener("webglcontextrestored", this.handleContextRestored, !1);
278
- }
279
- createContext(e, t) {
280
- let n, r = this.canvas;
281
- if (e === 2 && (n = r.getContext("webgl2", t)), !n && (n = r.getContext("webgl", t), !n)) throw Error("This browser does not support WebGL. Try using the canvas renderer");
282
- this.gl = n, this.initFromContext(this.gl);
283
- }
284
- getExtensions() {
285
- let { gl: e } = this, t = {
286
- anisotropicFiltering: e.getExtension("EXT_texture_filter_anisotropic"),
287
- floatTextureLinear: e.getExtension("OES_texture_float_linear"),
288
- s3tc: e.getExtension("WEBGL_compressed_texture_s3tc"),
289
- s3tc_sRGB: e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),
290
- etc: e.getExtension("WEBGL_compressed_texture_etc"),
291
- etc1: e.getExtension("WEBGL_compressed_texture_etc1"),
292
- pvrtc: e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),
293
- atc: e.getExtension("WEBGL_compressed_texture_atc"),
294
- astc: e.getExtension("WEBGL_compressed_texture_astc"),
295
- bptc: e.getExtension("EXT_texture_compression_bptc"),
296
- rgtc: e.getExtension("EXT_texture_compression_rgtc"),
297
- loseContext: e.getExtension("WEBGL_lose_context")
298
- };
299
- if (this.webGLVersion === 1) this.extensions = {
300
- ...t,
301
- drawBuffers: e.getExtension("WEBGL_draw_buffers"),
302
- depthTexture: e.getExtension("WEBGL_depth_texture"),
303
- vertexArrayObject: e.getExtension("OES_vertex_array_object") || e.getExtension("MOZ_OES_vertex_array_object") || e.getExtension("WEBKIT_OES_vertex_array_object"),
304
- uint32ElementIndex: e.getExtension("OES_element_index_uint"),
305
- floatTexture: e.getExtension("OES_texture_float"),
306
- floatTextureLinear: e.getExtension("OES_texture_float_linear"),
307
- textureHalfFloat: e.getExtension("OES_texture_half_float"),
308
- textureHalfFloatLinear: e.getExtension("OES_texture_half_float_linear"),
309
- vertexAttribDivisorANGLE: e.getExtension("ANGLE_instanced_arrays"),
310
- srgb: e.getExtension("EXT_sRGB")
311
- };
312
- else {
313
- this.extensions = {
314
- ...t,
315
- colorBufferFloat: e.getExtension("EXT_color_buffer_float")
316
- };
317
- let n = e.getExtension("WEBGL_provoking_vertex");
318
- n && n.provokingVertexWEBGL(n.FIRST_VERTEX_CONVENTION_WEBGL);
319
- }
320
- }
321
- handleContextLost(e) {
322
- e.preventDefault(), this._contextLossForced && (this._contextLossForced = !1, setTimeout(() => {
323
- this.gl.isContextLost() && this.extensions.loseContext?.restoreContext();
324
- }, 0));
325
- }
326
- handleContextRestored() {
327
- this.getExtensions(), this._renderer.runners.contextChange.emit(this.gl);
328
- }
329
- destroy() {
330
- let e = this._renderer.view.canvas;
331
- this._renderer = null, e.removeEventListener("webglcontextlost", this.handleContextLost), e.removeEventListener("webglcontextrestored", this.handleContextRestored), this.gl.useProgram(null), this.extensions.loseContext?.loseContext();
332
- }
333
- forceContextLoss() {
334
- this.extensions.loseContext?.loseContext(), this._contextLossForced = !0;
335
- }
336
- validateContext(e) {
337
- let n = e.getContextAttributes();
338
- n && !n.stencil && t("Provided WebGL context does not have a stencil buffer, masks may not render correctly");
339
- let r = this.supports, i = this.webGLVersion === 2, a = this.extensions;
340
- r.uint32Indices = i || !!a.uint32ElementIndex, r.uniformBufferObject = i, r.vertexArrayObject = i || !!a.vertexArrayObject, r.srgbTextures = i || !!a.srgb, r.nonPowOf2wrapping = i, r.nonPowOf2mipmaps = i, r.msaa = i, r.uint32Indices || t("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly");
341
- }
342
- };
343
- E.extension = {
344
- type: [m.WebGLSystem],
345
- name: "context"
346
- }, E.defaultOptions = {
347
- context: null,
348
- premultipliedAlpha: !0,
349
- preserveDrawingBuffer: !1,
350
- powerPreference: void 0,
351
- preferWebGLVersion: 2,
352
- multiView: !1
353
- };
354
- var be = E, D = /* @__PURE__ */ ((e) => (e[e.RGBA = 6408] = "RGBA", e[e.RGB = 6407] = "RGB", e[e.RG = 33319] = "RG", e[e.RED = 6403] = "RED", e[e.RGBA_INTEGER = 36249] = "RGBA_INTEGER", e[e.RGB_INTEGER = 36248] = "RGB_INTEGER", e[e.RG_INTEGER = 33320] = "RG_INTEGER", e[e.RED_INTEGER = 36244] = "RED_INTEGER", e[e.ALPHA = 6406] = "ALPHA", e[e.LUMINANCE = 6409] = "LUMINANCE", e[e.LUMINANCE_ALPHA = 6410] = "LUMINANCE_ALPHA", e[e.DEPTH_COMPONENT = 6402] = "DEPTH_COMPONENT", e[e.DEPTH_STENCIL = 34041] = "DEPTH_STENCIL", e))(D || {}), O = /* @__PURE__ */ ((e) => (e[e.TEXTURE_2D = 3553] = "TEXTURE_2D", e[e.TEXTURE_CUBE_MAP = 34067] = "TEXTURE_CUBE_MAP", e[e.TEXTURE_2D_ARRAY = 35866] = "TEXTURE_2D_ARRAY", e[e.TEXTURE_CUBE_MAP_POSITIVE_X = 34069] = "TEXTURE_CUBE_MAP_POSITIVE_X", e[e.TEXTURE_CUBE_MAP_NEGATIVE_X = 34070] = "TEXTURE_CUBE_MAP_NEGATIVE_X", e[e.TEXTURE_CUBE_MAP_POSITIVE_Y = 34071] = "TEXTURE_CUBE_MAP_POSITIVE_Y", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Y = 34072] = "TEXTURE_CUBE_MAP_NEGATIVE_Y", e[e.TEXTURE_CUBE_MAP_POSITIVE_Z = 34073] = "TEXTURE_CUBE_MAP_POSITIVE_Z", e[e.TEXTURE_CUBE_MAP_NEGATIVE_Z = 34074] = "TEXTURE_CUBE_MAP_NEGATIVE_Z", e))(O || {}), k = /* @__PURE__ */ ((e) => (e[e.UNSIGNED_BYTE = 5121] = "UNSIGNED_BYTE", e[e.UNSIGNED_SHORT = 5123] = "UNSIGNED_SHORT", e[e.UNSIGNED_SHORT_5_6_5 = 33635] = "UNSIGNED_SHORT_5_6_5", e[e.UNSIGNED_SHORT_4_4_4_4 = 32819] = "UNSIGNED_SHORT_4_4_4_4", e[e.UNSIGNED_SHORT_5_5_5_1 = 32820] = "UNSIGNED_SHORT_5_5_5_1", e[e.UNSIGNED_INT = 5125] = "UNSIGNED_INT", e[e.UNSIGNED_INT_10F_11F_11F_REV = 35899] = "UNSIGNED_INT_10F_11F_11F_REV", e[e.UNSIGNED_INT_2_10_10_10_REV = 33640] = "UNSIGNED_INT_2_10_10_10_REV", e[e.UNSIGNED_INT_24_8 = 34042] = "UNSIGNED_INT_24_8", e[e.UNSIGNED_INT_5_9_9_9_REV = 35902] = "UNSIGNED_INT_5_9_9_9_REV", e[e.BYTE = 5120] = "BYTE", e[e.SHORT = 5122] = "SHORT", e[e.INT = 5124] = "INT", e[e.FLOAT = 5126] = "FLOAT", e[e.FLOAT_32_UNSIGNED_INT_24_8_REV = 36269] = "FLOAT_32_UNSIGNED_INT_24_8_REV", e[e.HALF_FLOAT = 36193] = "HALF_FLOAT", e))(k || {}), A = {
355
- uint8x2: k.UNSIGNED_BYTE,
356
- uint8x4: k.UNSIGNED_BYTE,
357
- sint8x2: k.BYTE,
358
- sint8x4: k.BYTE,
359
- unorm8x2: k.UNSIGNED_BYTE,
360
- unorm8x4: k.UNSIGNED_BYTE,
361
- snorm8x2: k.BYTE,
362
- snorm8x4: k.BYTE,
363
- uint16x2: k.UNSIGNED_SHORT,
364
- uint16x4: k.UNSIGNED_SHORT,
365
- sint16x2: k.SHORT,
366
- sint16x4: k.SHORT,
367
- unorm16x2: k.UNSIGNED_SHORT,
368
- unorm16x4: k.UNSIGNED_SHORT,
369
- snorm16x2: k.SHORT,
370
- snorm16x4: k.SHORT,
371
- float16x2: k.HALF_FLOAT,
372
- float16x4: k.HALF_FLOAT,
373
- float32: k.FLOAT,
374
- float32x2: k.FLOAT,
375
- float32x3: k.FLOAT,
376
- float32x4: k.FLOAT,
377
- uint32: k.UNSIGNED_INT,
378
- uint32x2: k.UNSIGNED_INT,
379
- uint32x3: k.UNSIGNED_INT,
380
- uint32x4: k.UNSIGNED_INT,
381
- sint32: k.INT,
382
- sint32x2: k.INT,
383
- sint32x3: k.INT,
384
- sint32x4: k.INT
385
- };
386
- function xe(e) {
387
- return A[e] ?? A.float32;
388
- }
389
- //#endregion
390
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/geometry/GlGeometrySystem.mjs
391
- var Se = {
392
- "point-list": 0,
393
- "line-list": 1,
394
- "line-strip": 3,
395
- "triangle-list": 4,
396
- "triangle-strip": 5
397
- }, Ce = class {
398
- constructor() {
399
- this.vaoCache = /* @__PURE__ */ Object.create(null);
400
- }
401
- destroy() {
402
- this.vaoCache = /* @__PURE__ */ Object.create(null);
403
- }
404
- }, j = class {
405
- constructor(e) {
406
- this._renderer = e, this._activeGeometry = null, this._activeVao = null, this.hasVao = !0, this.hasInstance = !0, this._managedGeometries = new y({
407
- renderer: e,
408
- type: "resource",
409
- onUnload: this.onGeometryUnload.bind(this),
410
- name: "glGeometry"
411
- });
412
- }
413
- contextChange() {
414
- let e = this.gl = this._renderer.gl;
415
- if (!this._renderer.context.supports.vertexArrayObject) throw Error("[PixiJS] Vertex Array Objects are not supported on this device");
416
- this.destroyAll(!0);
417
- let t = this._renderer.context.extensions.vertexArrayObject;
418
- t && (e.createVertexArray = () => t.createVertexArrayOES(), e.bindVertexArray = (e) => t.bindVertexArrayOES(e), e.deleteVertexArray = (e) => t.deleteVertexArrayOES(e));
419
- let n = this._renderer.context.extensions.vertexAttribDivisorANGLE;
420
- n && (e.drawArraysInstanced = (e, t, r, i) => {
421
- n.drawArraysInstancedANGLE(e, t, r, i);
422
- }, e.drawElementsInstanced = (e, t, r, i, a) => {
423
- n.drawElementsInstancedANGLE(e, t, r, i, a);
424
- }, e.vertexAttribDivisor = (e, t) => n.vertexAttribDivisorANGLE(e, t)), this._activeGeometry = null, this._activeVao = null;
425
- }
426
- bind(e, t) {
427
- let n = this.gl;
428
- this._activeGeometry = e;
429
- let r = this.getVao(e, t);
430
- this._activeVao !== r && (this._activeVao = r, n.bindVertexArray(r)), this.updateBuffers();
431
- }
432
- resetState() {
433
- this.unbind();
434
- }
435
- updateBuffers() {
436
- let e = this._activeGeometry, t = this._renderer.buffer;
437
- for (let n = 0; n < e.buffers.length; n++) {
438
- let r = e.buffers[n];
439
- t.updateBuffer(r);
440
- }
441
- e._gcLastUsed = this._renderer.gc.now;
442
- }
443
- checkCompatibility(e, t) {
444
- let n = e.attributes, r = t._attributeData;
445
- for (let e in r) if (!n[e]) throw Error(`shader and geometry incompatible, geometry missing the "${e}" attribute`);
446
- }
447
- getSignature(e, t) {
448
- let n = e.attributes, r = t._attributeData, i = ["g", e.uid];
449
- for (let e in n) r[e] && i.push(e, r[e].location);
450
- return i.join("-");
451
- }
452
- getVao(e, t) {
453
- return e._gpuData[this._renderer.uid]?.vaoCache[t._key] || this.initGeometryVao(e, t);
454
- }
455
- initGeometryVao(e, t, n = !0) {
456
- let r = this._renderer.gl, i = this._renderer.buffer;
457
- this._renderer.shader._getProgramData(t), this.checkCompatibility(e, t);
458
- let a = this.getSignature(e, t), o = e._gpuData[this._renderer.uid];
459
- o || (o = new Ce(), e._gpuData[this._renderer.uid] = o, this._managedGeometries.add(e));
460
- let s = o.vaoCache, c = s[a];
461
- if (c) return s[t._key] = c, c;
462
- ue(e, t._attributeData);
463
- let l = e.buffers;
464
- c = r.createVertexArray(), r.bindVertexArray(c);
465
- for (let e = 0; e < l.length; e++) {
466
- let t = l[e];
467
- i.bind(t);
468
- }
469
- return this.activateVao(e, t), s[t._key] = c, s[a] = c, r.bindVertexArray(null), c;
470
- }
471
- onGeometryUnload(e, t = !1) {
472
- let n = e._gpuData[this._renderer.uid];
473
- if (!n) return;
474
- let r = n.vaoCache;
475
- if (!t) for (let e in r) this._activeVao !== r[e] && this.resetState(), this.gl.deleteVertexArray(r[e]);
476
- }
477
- destroyAll(e = !1) {
478
- this._managedGeometries.removeAll(e);
479
- }
480
- activateVao(e, t) {
481
- let n = this._renderer.gl, r = this._renderer.buffer, i = e.attributes;
482
- e.indexBuffer && r.bind(e.indexBuffer);
483
- let a = null;
484
- for (let e in i) {
485
- let o = i[e], s = o.buffer, l = r.getGlBuffer(s), u = t._attributeData[e];
486
- if (u) {
487
- a !== l && (r.bind(s), a = l);
488
- let e = u.location;
489
- n.enableVertexAttribArray(e);
490
- let t = c(o.format), i = xe(o.format);
491
- if (u.format?.substring(1, 4) === "int" ? n.vertexAttribIPointer(e, t.size, i, o.stride, o.offset) : n.vertexAttribPointer(e, t.size, i, t.normalised, o.stride, o.offset), o.instance) {
492
- if (this.hasInstance) {
493
- let t = o.divisor ?? 1;
494
- n.vertexAttribDivisor(e, t);
495
- } else throw Error("geometry error, GPU Instancing is not supported on this device");
496
- }
497
- }
498
- }
499
- }
500
- draw(e, t, n, r) {
501
- let { gl: i } = this._renderer, a = this._activeGeometry, o = Se[e || a.topology];
502
- if (r ??= a.instanceCount, a.indexBuffer) {
503
- let e = a.indexBuffer.data.BYTES_PER_ELEMENT, s = e === 2 ? i.UNSIGNED_SHORT : i.UNSIGNED_INT;
504
- r === 1 ? i.drawElements(o, t || a.indexBuffer.data.length, s, (n || 0) * e) : i.drawElementsInstanced(o, t || a.indexBuffer.data.length, s, (n || 0) * e, r);
505
- } else r === 1 ? i.drawArrays(o, n || 0, t || a.getSize()) : i.drawArraysInstanced(o, n || 0, t || a.getSize(), r);
506
- return this;
507
- }
508
- unbind() {
509
- this.gl.bindVertexArray(null), this._activeVao = null, this._activeGeometry = null;
510
- }
511
- destroy() {
512
- this._managedGeometries.destroy(), this._renderer = null, this.gl = null, this._activeVao = null, this._activeGeometry = null;
513
- }
514
- };
515
- j.extension = {
516
- type: [m.WebGLSystem],
517
- name: "geometry"
518
- };
519
- //#endregion
520
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/GlBackBufferSystem.mjs
521
- var we = new ee({ attributes: { aPosition: [
522
- -1,
523
- -1,
524
- 3,
525
- -1,
526
- -1,
527
- 3
528
- ] } }), M = class e {
529
- constructor(e) {
530
- this.useBackBuffer = !1, this._useBackBufferThisRender = !1, this._renderer = e;
531
- }
532
- init(n = {}) {
533
- let { useBackBuffer: r, antialias: i } = {
534
- ...e.defaultOptions,
535
- ...n
536
- };
537
- this.useBackBuffer = r, this._antialias = i, this._renderer.context.supports.msaa || (t("antialiasing, is not supported on when using the back buffer"), this._antialias = !1), this._state = o.for2d();
538
- let a = new l({
539
- vertex: "\n attribute vec2 aPosition;\n out vec2 vUv;\n\n void main() {\n gl_Position = vec4(aPosition, 0.0, 1.0);\n\n vUv = (aPosition + 1.0) / 2.0;\n\n // flip dem UVs\n vUv.y = 1.0 - vUv.y;\n }",
540
- fragment: "\n in vec2 vUv;\n out vec4 finalColor;\n\n uniform sampler2D uTexture;\n\n void main() {\n finalColor = texture(uTexture, vUv);\n }",
541
- name: "big-triangle"
542
- });
543
- this._bigTriangleShader = new f({
544
- glProgram: a,
545
- resources: { uTexture: g.WHITE.source }
546
- });
547
- }
548
- renderStart(e) {
549
- let t = this._renderer.renderTarget.getRenderTarget(e.target);
550
- if (this._useBackBufferThisRender = this.useBackBuffer && !!t.isRoot, this._useBackBufferThisRender) {
551
- let t = this._renderer.renderTarget.getRenderTarget(e.target);
552
- this._targetTexture = t.colorTexture, e.target = this._getBackBufferTexture(t.colorTexture);
553
- }
554
- }
555
- renderEnd() {
556
- this._presentBackBuffer();
557
- }
558
- _presentBackBuffer() {
559
- let e = this._renderer;
560
- e.renderTarget.finishRenderPass(), this._useBackBufferThisRender && (e.renderTarget.bind(this._targetTexture, !1), this._bigTriangleShader.resources.uTexture = this._backBufferTexture.source, e.encoder.draw({
561
- geometry: we,
562
- shader: this._bigTriangleShader,
563
- state: this._state
564
- }));
565
- }
566
- _getBackBufferTexture(e) {
567
- return this._backBufferTexture = this._backBufferTexture || new g({ source: new n({
568
- width: e.width,
569
- height: e.height,
570
- resolution: e._resolution,
571
- antialias: this._antialias
572
- }) }), this._backBufferTexture.source.resize(e.width, e.height, e._resolution), this._backBufferTexture;
573
- }
574
- destroy() {
575
- this._backBufferTexture &&= (this._backBufferTexture.destroy(), null);
576
- }
577
- };
578
- M.extension = {
579
- type: [m.WebGLSystem],
580
- name: "backBuffer",
581
- priority: 1
582
- }, M.defaultOptions = { useBackBuffer: !1 };
583
- var Te = M, N = class {
584
- constructor(e) {
585
- this._colorMaskCache = 15, this._renderer = e;
586
- }
587
- setMask(e) {
588
- this._colorMaskCache !== e && (this._colorMaskCache = e, this._renderer.gl.colorMask(!!(e & 8), !!(e & 4), !!(e & 2), !!(e & 1)));
589
- }
590
- };
591
- N.extension = {
592
- type: [m.WebGLSystem],
593
- name: "colorMask"
594
- };
595
- //#endregion
596
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/GlEncoderSystem.mjs
597
- var P = class {
598
- constructor(e) {
599
- this.commandFinished = Promise.resolve(), this._renderer = e;
600
- }
601
- setGeometry(e, t) {
602
- this._renderer.geometry.bind(e, t.glProgram);
603
- }
604
- finishRenderPass() {}
605
- draw(e) {
606
- let t = this._renderer, { geometry: n, shader: r, state: i, skipSync: a, topology: o, size: s, start: c, instanceCount: l } = e;
607
- t.shader.bind(r, a), t.geometry.bind(n, t.shader._activeProgram), i && t.state.set(i), t.geometry.draw(o, s, c, l ?? n.instanceCount);
608
- }
609
- destroy() {
610
- this._renderer = null;
611
- }
612
- };
613
- P.extension = {
614
- type: [m.WebGLSystem],
615
- name: "encoder"
616
- };
617
- //#endregion
618
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/GlLimitsSystem.mjs
619
- var F = class {
620
- constructor(e) {
621
- this._renderer = e;
622
- }
623
- contextChange() {
624
- let e = this._renderer.gl;
625
- this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS), this.maxBatchableTextures = se(this.maxTextures, e);
626
- let t = this._renderer.context.webGLVersion === 2;
627
- this.maxUniformBindings = t ? e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS) : 0;
628
- }
629
- destroy() {}
630
- };
631
- F.extension = {
632
- type: [m.WebGLSystem],
633
- name: "limits"
634
- };
635
- //#endregion
636
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/GlStencilSystem.mjs
637
- var I = class {
638
- constructor(e) {
639
- this._stencilCache = {
640
- enabled: !1,
641
- stencilReference: 0,
642
- stencilMode: _.NONE
643
- }, this._renderTargetStencilState = /* @__PURE__ */ Object.create(null), e.renderTarget.onRenderTargetChange.add(this);
644
- }
645
- contextChange(e) {
646
- this._gl = e, this._comparisonFuncMapping = {
647
- always: e.ALWAYS,
648
- never: e.NEVER,
649
- equal: e.EQUAL,
650
- "not-equal": e.NOTEQUAL,
651
- less: e.LESS,
652
- "less-equal": e.LEQUAL,
653
- greater: e.GREATER,
654
- "greater-equal": e.GEQUAL
655
- }, this._stencilOpsMapping = {
656
- keep: e.KEEP,
657
- zero: e.ZERO,
658
- replace: e.REPLACE,
659
- invert: e.INVERT,
660
- "increment-clamp": e.INCR,
661
- "decrement-clamp": e.DECR,
662
- "increment-wrap": e.INCR_WRAP,
663
- "decrement-wrap": e.DECR_WRAP
664
- }, this.resetState();
665
- }
666
- onRenderTargetChange(e) {
667
- if (this._activeRenderTarget === e) return;
668
- this._activeRenderTarget = e;
669
- let t = this._renderTargetStencilState[e.uid];
670
- t ||= this._renderTargetStencilState[e.uid] = {
671
- stencilMode: _.DISABLED,
672
- stencilReference: 0
673
- }, this.setStencilMode(t.stencilMode, t.stencilReference);
674
- }
675
- resetState() {
676
- this._stencilCache.enabled = !1, this._stencilCache.stencilMode = _.NONE, this._stencilCache.stencilReference = 0;
677
- }
678
- setStencilMode(e, t) {
679
- let n = this._renderTargetStencilState[this._activeRenderTarget.uid], r = this._gl, i = he[e], a = this._stencilCache;
680
- if (n.stencilMode = e, n.stencilReference = t, e === _.DISABLED) {
681
- this._stencilCache.enabled && (this._stencilCache.enabled = !1, r.disable(r.STENCIL_TEST));
682
- return;
683
- }
684
- this._stencilCache.enabled || (this._stencilCache.enabled = !0, r.enable(r.STENCIL_TEST)), (e !== a.stencilMode || a.stencilReference !== t) && (a.stencilMode = e, a.stencilReference = t, r.stencilFunc(this._comparisonFuncMapping[i.stencilBack.compare], t, 255), r.stencilOp(r.KEEP, r.KEEP, this._stencilOpsMapping[i.stencilBack.passOp]));
685
- }
686
- };
687
- I.extension = {
688
- type: [m.WebGLSystem],
689
- name: "stencil"
690
- };
691
- //#endregion
692
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/utils/createUboElementsSTD40.mjs
693
- var L = {
694
- f32: 4,
695
- i32: 4,
696
- "vec2<f32>": 8,
697
- "vec3<f32>": 12,
698
- "vec4<f32>": 16,
699
- "vec2<i32>": 8,
700
- "vec3<i32>": 12,
701
- "vec4<i32>": 16,
702
- "mat2x2<f32>": 32,
703
- "mat3x3<f32>": 48,
704
- "mat4x4<f32>": 64
705
- };
706
- function Ee(e) {
707
- let t = e.map((e) => ({
708
- data: e,
709
- offset: 0,
710
- size: 0
711
- })), n = 0, r = 0;
712
- for (let e = 0; e < t.length; e++) {
713
- let i = t[e];
714
- if (n = L[i.data.type], !n) throw Error(`Unknown type ${i.data.type}`);
715
- i.data.size > 1 && (n = Math.max(n, 16) * i.data.size);
716
- let a = n === 12 ? 16 : n;
717
- i.size = n;
718
- let o = r % 16;
719
- o > 0 && 16 - o < a ? r += (16 - o) % 16 : r += (n - o % n) % n, i.offset = r, r += n;
720
- }
721
- return r = Math.ceil(r / 16) * 16, {
722
- uboElements: t,
723
- size: r
724
- };
725
- }
726
- //#endregion
727
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/utils/generateArraySyncSTD40.mjs
728
- function De(e, t) {
729
- let n = Math.max(L[e.data.type] / 16, 1), r = e.data.value.length / e.data.size, i = (4 - r % 4) % 4, a = e.data.type.indexOf("i32") >= 0 ? "dataInt32" : "data";
730
- return `
731
- v = uv.${e.data.name};
732
- offset += ${t};
733
-
734
- arrayOffset = offset;
735
-
736
- t = 0;
737
-
738
- for(var i=0; i < ${e.data.size * n}; i++)
739
- {
740
- for(var j = 0; j < ${r}; j++)
741
- {
742
- ${a}[arrayOffset++] = v[t++];
743
- }
744
- ${i === 0 ? "" : `arrayOffset += ${i};`}
745
- }
746
- `;
747
- }
748
- //#endregion
749
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/utils/createUboSyncSTD40.mjs
750
- function Oe(e) {
751
- return fe(e, "uboStd40", De, pe);
752
- }
753
- //#endregion
754
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/GlUboSystem.mjs
755
- var R = class extends me {
756
- constructor() {
757
- super({
758
- createUboElements: Ee,
759
- generateUboSync: Oe
760
- });
761
- }
762
- };
763
- R.extension = {
764
- type: [m.WebGLSystem],
765
- name: "ubo"
766
- };
767
- //#endregion
768
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/GlRenderTarget.mjs
769
- var ke = class {
770
- constructor() {
771
- this.width = -1, this.height = -1, this.msaa = !1, this._attachedMipLevel = 0, this._attachedLayer = 0, this.msaaRenderBuffer = [];
772
- }
773
- }, Ae = class {
774
- constructor() {
775
- this._clearColorCache = [
776
- 0,
777
- 0,
778
- 0,
779
- 0
780
- ], this._viewPortCache = new i();
781
- }
782
- init(e, t) {
783
- this._renderer = e, this._renderTargetSystem = t, e.runners.contextChange.add(this);
784
- }
785
- contextChange() {
786
- this._clearColorCache = [
787
- 0,
788
- 0,
789
- 0,
790
- 0
791
- ], this._viewPortCache = new i();
792
- let e = this._renderer.gl;
793
- this._drawBuffersCache = [];
794
- for (let t = 1; t <= 16; t++) this._drawBuffersCache[t] = Array.from({ length: t }, (t, n) => e.COLOR_ATTACHMENT0 + n);
795
- }
796
- copyToTexture(e, t, n, r, i) {
797
- let a = this._renderTargetSystem, o = this._renderer, s = a.getGpuRenderTarget(e), c = o.gl;
798
- return this.finishRenderPass(e), c.bindFramebuffer(c.FRAMEBUFFER, s.resolveTargetFramebuffer), o.texture.bind(t, 0), c.copyTexSubImage2D(c.TEXTURE_2D, 0, i.x, i.y, n.x, n.y, r.width, r.height), t;
799
- }
800
- startRenderPass(e, t = !0, n, r, i = 0, a = 0) {
801
- let o = this._renderTargetSystem, s = e.colorTexture, c = o.getGpuRenderTarget(e);
802
- if (a !== 0 && this._renderer.context.webGLVersion < 2) throw Error("[RenderTargetSystem] Rendering to array layers requires WebGL2.");
803
- if (i > 0) {
804
- if (c.msaa) throw Error("[RenderTargetSystem] Rendering to mip levels is not supported with MSAA render targets.");
805
- if (this._renderer.context.webGLVersion < 2) throw Error("[RenderTargetSystem] Rendering to mip levels requires WebGL2.");
806
- }
807
- let l = r.y;
808
- e.isRoot && (l = s.pixelHeight - r.height - r.y), e.colorTextures.forEach((e) => {
809
- this._renderer.texture.unbind(e);
810
- });
811
- let u = this._renderer.gl;
812
- u.bindFramebuffer(u.FRAMEBUFFER, c.framebuffer), !e.isRoot && (c._attachedMipLevel !== i || c._attachedLayer !== a) && (e.colorTextures.forEach((e, t) => {
813
- let n = this._renderer.texture.getGlSource(e);
814
- if (n.target === u.TEXTURE_2D) {
815
- if (a !== 0) throw Error("[RenderTargetSystem] layer must be 0 when rendering to 2D textures in WebGL.");
816
- u.framebufferTexture2D(u.FRAMEBUFFER, u.COLOR_ATTACHMENT0 + t, u.TEXTURE_2D, n.texture, i);
817
- } else if (n.target === u.TEXTURE_2D_ARRAY) {
818
- if (this._renderer.context.webGLVersion < 2) throw Error("[RenderTargetSystem] Rendering to 2D array textures requires WebGL2.");
819
- u.framebufferTextureLayer(u.FRAMEBUFFER, u.COLOR_ATTACHMENT0 + t, n.texture, i, a);
820
- } else if (n.target === u.TEXTURE_CUBE_MAP) {
821
- if (a < 0 || a > 5) throw Error("[RenderTargetSystem] Cube map layer must be between 0 and 5.");
822
- u.framebufferTexture2D(u.FRAMEBUFFER, u.COLOR_ATTACHMENT0 + t, u.TEXTURE_CUBE_MAP_POSITIVE_X + a, n.texture, i);
823
- } else throw Error("[RenderTargetSystem] Unsupported texture target for render-to-layer in WebGL.");
824
- }), c._attachedMipLevel = i, c._attachedLayer = a), e.colorTextures.length > 1 && this._setDrawBuffers(e, u);
825
- let d = this._viewPortCache;
826
- (d.x !== r.x || d.y !== l || d.width !== r.width || d.height !== r.height) && (d.x = r.x, d.y = l, d.width = r.width, d.height = r.height, u.viewport(r.x, l, r.width, r.height)), !c.depthStencilRenderBuffer && (e.stencil || e.depth) && this._initStencil(c), this.clear(e, t, n);
827
- }
828
- finishRenderPass(e) {
829
- let t = this._renderTargetSystem.getGpuRenderTarget(e);
830
- if (!t.msaa) return;
831
- let n = this._renderer.gl;
832
- n.bindFramebuffer(n.FRAMEBUFFER, t.resolveTargetFramebuffer), n.bindFramebuffer(n.READ_FRAMEBUFFER, t.framebuffer), n.blitFramebuffer(0, 0, t.width, t.height, 0, 0, t.width, t.height, n.COLOR_BUFFER_BIT, n.NEAREST), n.bindFramebuffer(n.FRAMEBUFFER, t.framebuffer);
833
- }
834
- initGpuRenderTarget(e) {
835
- let t = this._renderer.gl, n = new ke();
836
- return n._attachedMipLevel = 0, n._attachedLayer = 0, e.colorTexture instanceof u ? (this._renderer.context.ensureCanvasSize(e.colorTexture.resource), n.framebuffer = null, n) : (this._initColor(e, n), t.bindFramebuffer(t.FRAMEBUFFER, null), n);
837
- }
838
- destroyGpuRenderTarget(e) {
839
- let t = this._renderer.gl;
840
- e.framebuffer &&= (t.deleteFramebuffer(e.framebuffer), null), e.resolveTargetFramebuffer &&= (t.deleteFramebuffer(e.resolveTargetFramebuffer), null), e.depthStencilRenderBuffer &&= (t.deleteRenderbuffer(e.depthStencilRenderBuffer), null), e.msaaRenderBuffer.forEach((e) => {
841
- t.deleteRenderbuffer(e);
842
- }), e.msaaRenderBuffer = null;
843
- }
844
- clear(e, t, n, r, i = 0, a = 0) {
845
- if (!t) return;
846
- if (a !== 0) throw Error("[RenderTargetSystem] Clearing array layers is not supported in WebGL renderer.");
847
- let o = this._renderTargetSystem;
848
- typeof t == "boolean" && (t = t ? b.ALL : b.NONE);
849
- let s = this._renderer.gl;
850
- if (t & b.COLOR) {
851
- n ??= o.defaultClearColor;
852
- let e = this._clearColorCache, t = n;
853
- (e[0] !== t[0] || e[1] !== t[1] || e[2] !== t[2] || e[3] !== t[3]) && (e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], s.clearColor(t[0], t[1], t[2], t[3]));
854
- }
855
- s.clear(t);
856
- }
857
- resizeGpuRenderTarget(e) {
858
- if (e.isRoot) return;
859
- let t = this._renderTargetSystem.getGpuRenderTarget(e);
860
- this._resizeColor(e, t), (e.stencil || e.depth) && this._resizeStencil(t);
861
- }
862
- _initColor(e, n) {
863
- let r = this._renderer, i = r.gl, a = i.createFramebuffer();
864
- if (n.resolveTargetFramebuffer = a, i.bindFramebuffer(i.FRAMEBUFFER, a), n.width = e.colorTexture.source.pixelWidth, n.height = e.colorTexture.source.pixelHeight, e.colorTextures.forEach((e, a) => {
865
- let o = e.source;
866
- o.antialias && (r.context.supports.msaa ? n.msaa = !0 : t("[RenderTexture] Antialiasing on textures is not supported in WebGL1")), r.texture.bindSource(o, 0);
867
- let s = r.texture.getGlSource(o), c = s.texture;
868
- if (s.target === i.TEXTURE_2D) i.framebufferTexture2D(i.FRAMEBUFFER, i.COLOR_ATTACHMENT0 + a, i.TEXTURE_2D, c, 0);
869
- else if (s.target === i.TEXTURE_2D_ARRAY) {
870
- if (r.context.webGLVersion < 2) throw Error("[RenderTargetSystem] TEXTURE_2D_ARRAY requires WebGL2.");
871
- i.framebufferTextureLayer(i.FRAMEBUFFER, i.COLOR_ATTACHMENT0 + a, c, 0, 0);
872
- } else if (s.target === i.TEXTURE_CUBE_MAP) i.framebufferTexture2D(i.FRAMEBUFFER, i.COLOR_ATTACHMENT0 + a, i.TEXTURE_CUBE_MAP_POSITIVE_X, c, 0);
873
- else throw Error("[RenderTargetSystem] Unsupported texture target for framebuffer attachment.");
874
- }), n.msaa) {
875
- let t = i.createFramebuffer();
876
- n.framebuffer = t, i.bindFramebuffer(i.FRAMEBUFFER, t), e.colorTextures.forEach((e, t) => {
877
- let r = i.createRenderbuffer();
878
- n.msaaRenderBuffer[t] = r;
879
- });
880
- } else n.framebuffer = a;
881
- this._resizeColor(e, n);
882
- }
883
- _resizeColor(e, t) {
884
- let n = e.colorTexture.source;
885
- if (t.width = n.pixelWidth, t.height = n.pixelHeight, t._attachedMipLevel = 0, t._attachedLayer = 0, e.colorTextures.forEach((e, t) => {
886
- t !== 0 && e.source.resize(n.width, n.height, n._resolution);
887
- }), t.msaa) {
888
- let n = this._renderer, r = n.gl, i = t.framebuffer;
889
- r.bindFramebuffer(r.FRAMEBUFFER, i), e.colorTextures.forEach((e, i) => {
890
- let a = e.source;
891
- n.texture.bindSource(a, 0);
892
- let o = n.texture.getGlSource(a).internalFormat, s = t.msaaRenderBuffer[i];
893
- r.bindRenderbuffer(r.RENDERBUFFER, s), r.renderbufferStorageMultisample(r.RENDERBUFFER, 4, o, a.pixelWidth, a.pixelHeight), r.framebufferRenderbuffer(r.FRAMEBUFFER, r.COLOR_ATTACHMENT0 + i, r.RENDERBUFFER, s);
894
- });
895
- }
896
- }
897
- _initStencil(e) {
898
- if (e.framebuffer === null) return;
899
- let t = this._renderer.gl, n = t.createRenderbuffer();
900
- e.depthStencilRenderBuffer = n, t.bindRenderbuffer(t.RENDERBUFFER, n), t.framebufferRenderbuffer(t.FRAMEBUFFER, t.DEPTH_STENCIL_ATTACHMENT, t.RENDERBUFFER, n), this._resizeStencil(e);
901
- }
902
- _resizeStencil(e) {
903
- let t = this._renderer.gl;
904
- t.bindRenderbuffer(t.RENDERBUFFER, e.depthStencilRenderBuffer), e.msaa ? t.renderbufferStorageMultisample(t.RENDERBUFFER, 4, t.DEPTH24_STENCIL8, e.width, e.height) : t.renderbufferStorage(t.RENDERBUFFER, this._renderer.context.webGLVersion === 2 ? t.DEPTH24_STENCIL8 : t.DEPTH_STENCIL, e.width, e.height);
905
- }
906
- prerender(e) {
907
- let t = e.colorTexture.resource;
908
- this._renderer.context.multiView && u.test(t) && this._renderer.context.ensureCanvasSize(t);
909
- }
910
- postrender(e) {
911
- if (this._renderer.context.multiView && u.test(e.colorTexture.resource)) {
912
- let t = this._renderer.context.canvas, n = e.colorTexture;
913
- n.context2D.drawImage(t, 0, n.pixelHeight - t.height);
914
- }
915
- }
916
- _setDrawBuffers(e, n) {
917
- let r = e.colorTextures.length, i = this._drawBuffersCache[r];
918
- if (this._renderer.context.webGLVersion === 1) {
919
- let e = this._renderer.context.extensions.drawBuffers;
920
- e ? e.drawBuffersWEBGL(i) : t("[RenderTexture] This WebGL1 context does not support rendering to multiple targets");
921
- } else n.drawBuffers(i);
922
- }
923
- }, z = class extends oe {
924
- constructor(e) {
925
- super(e), this.adaptor = new Ae(), this.adaptor.init(e, this);
926
- }
927
- };
928
- z.extension = {
929
- type: [m.WebGLSystem],
930
- name: "renderTarget"
931
- };
932
- //#endregion
933
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/GenerateShaderSyncCode.mjs
934
- function je(e, t) {
935
- let r = [], i = ["\n var g = s.groups;\n var sS = r.shader;\n var p = s.glProgram;\n var ugS = r.uniformGroup;\n var resources;\n "], a = !1, o = 0, s = t._getProgramData(e.glProgram);
936
- for (let c in e.groups) {
937
- let l = e.groups[c];
938
- r.push(`
939
- resources = g[${c}].resources;
940
- `);
941
- for (let u in l.resources) {
942
- let d = l.resources[u];
943
- if (d instanceof h) {
944
- if (d.ubo) {
945
- let t = e._uniformBindMap[c][Number(u)];
946
- r.push(`
947
- sS.bindUniformBlock(
948
- resources[${u}],
949
- '${t}',
950
- ${e.glProgram._uniformBlockData[t].index}
951
- );
952
- `);
953
- } else r.push(`
954
- ugS.updateUniformGroup(resources[${u}], p, sD);
955
- `);
956
- } else if (d instanceof ge) {
957
- let t = e._uniformBindMap[c][Number(u)];
958
- r.push(`
959
- sS.bindUniformBlock(
960
- resources[${u}],
961
- '${t}',
962
- ${e.glProgram._uniformBlockData[t].index}
963
- );
964
- `);
965
- } else if (d instanceof n) {
966
- let n = e._uniformBindMap[c][u], l = s.uniformData[n];
967
- l && (a || (a = !0, i.push("\n var tS = r.texture;\n ")), t._gl.uniform1i(l.location, o), r.push(`
968
- tS.bind(resources[${u}], ${o});
969
- `), o++);
970
- }
971
- }
972
- }
973
- let c = [...i, ...r].join("\n");
974
- return Function("r", "s", "sD", c);
975
- }
976
- //#endregion
977
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/GlProgramData.mjs
978
- var Me = class {
979
- constructor(e, t) {
980
- this.program = e, this.uniformData = t, this.uniformGroups = {}, this.uniformDirtyGroups = {}, this.uniformBlockBindings = {};
981
- }
982
- destroy() {
983
- this.uniformData = null, this.uniformGroups = null, this.uniformDirtyGroups = null, this.uniformBlockBindings = null, this.program = null;
984
- }
985
- };
986
- //#endregion
987
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/compileShader.mjs
988
- function B(e, t, n) {
989
- let r = e.createShader(t);
990
- return e.shaderSource(r, n), e.compileShader(r), r;
991
- }
992
- //#endregion
993
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/defaultValue.mjs
994
- function V(e) {
995
- let t = Array(e);
996
- for (let e = 0; e < t.length; e++) t[e] = !1;
997
- return t;
998
- }
999
- function H(e, t) {
1000
- switch (e) {
1001
- case "float": return 0;
1002
- case "vec2": return new Float32Array(2 * t);
1003
- case "vec3": return new Float32Array(3 * t);
1004
- case "vec4": return new Float32Array(4 * t);
1005
- case "int":
1006
- case "uint":
1007
- case "sampler2D":
1008
- case "sampler2DArray": return 0;
1009
- case "ivec2": return new Int32Array(2 * t);
1010
- case "ivec3": return new Int32Array(3 * t);
1011
- case "ivec4": return new Int32Array(4 * t);
1012
- case "uvec2": return new Uint32Array(2 * t);
1013
- case "uvec3": return new Uint32Array(3 * t);
1014
- case "uvec4": return new Uint32Array(4 * t);
1015
- case "bool": return !1;
1016
- case "bvec2": return V(2 * t);
1017
- case "bvec3": return V(3 * t);
1018
- case "bvec4": return V(4 * t);
1019
- case "mat2": return new Float32Array([
1020
- 1,
1021
- 0,
1022
- 0,
1023
- 1
1024
- ]);
1025
- case "mat3": return new Float32Array([
1026
- 1,
1027
- 0,
1028
- 0,
1029
- 0,
1030
- 1,
1031
- 0,
1032
- 0,
1033
- 0,
1034
- 1
1035
- ]);
1036
- case "mat4": return new Float32Array([
1037
- 1,
1038
- 0,
1039
- 0,
1040
- 0,
1041
- 0,
1042
- 1,
1043
- 0,
1044
- 0,
1045
- 0,
1046
- 0,
1047
- 1,
1048
- 0,
1049
- 0,
1050
- 0,
1051
- 0,
1052
- 1
1053
- ]);
1054
- }
1055
- return null;
1056
- }
1057
- //#endregion
1058
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/mapType.mjs
1059
- var U = null, W = {
1060
- FLOAT: "float",
1061
- FLOAT_VEC2: "vec2",
1062
- FLOAT_VEC3: "vec3",
1063
- FLOAT_VEC4: "vec4",
1064
- INT: "int",
1065
- INT_VEC2: "ivec2",
1066
- INT_VEC3: "ivec3",
1067
- INT_VEC4: "ivec4",
1068
- UNSIGNED_INT: "uint",
1069
- UNSIGNED_INT_VEC2: "uvec2",
1070
- UNSIGNED_INT_VEC3: "uvec3",
1071
- UNSIGNED_INT_VEC4: "uvec4",
1072
- BOOL: "bool",
1073
- BOOL_VEC2: "bvec2",
1074
- BOOL_VEC3: "bvec3",
1075
- BOOL_VEC4: "bvec4",
1076
- FLOAT_MAT2: "mat2",
1077
- FLOAT_MAT3: "mat3",
1078
- FLOAT_MAT4: "mat4",
1079
- SAMPLER_2D: "sampler2D",
1080
- INT_SAMPLER_2D: "sampler2D",
1081
- UNSIGNED_INT_SAMPLER_2D: "sampler2D",
1082
- SAMPLER_CUBE: "samplerCube",
1083
- INT_SAMPLER_CUBE: "samplerCube",
1084
- UNSIGNED_INT_SAMPLER_CUBE: "samplerCube",
1085
- SAMPLER_2D_ARRAY: "sampler2DArray",
1086
- INT_SAMPLER_2D_ARRAY: "sampler2DArray",
1087
- UNSIGNED_INT_SAMPLER_2D_ARRAY: "sampler2DArray"
1088
- }, Ne = {
1089
- float: "float32",
1090
- vec2: "float32x2",
1091
- vec3: "float32x3",
1092
- vec4: "float32x4",
1093
- int: "sint32",
1094
- ivec2: "sint32x2",
1095
- ivec3: "sint32x3",
1096
- ivec4: "sint32x4",
1097
- uint: "uint32",
1098
- uvec2: "uint32x2",
1099
- uvec3: "uint32x3",
1100
- uvec4: "uint32x4",
1101
- bool: "uint32",
1102
- bvec2: "uint32x2",
1103
- bvec3: "uint32x3",
1104
- bvec4: "uint32x4"
1105
- };
1106
- function G(e, t) {
1107
- if (!U) {
1108
- let t = Object.keys(W);
1109
- U = {};
1110
- for (let n = 0; n < t.length; ++n) {
1111
- let r = t[n];
1112
- U[e[r]] = W[r];
1113
- }
1114
- }
1115
- return U[t];
1116
- }
1117
- function Pe(e, t) {
1118
- return Ne[G(e, t)] || "float32";
1119
- }
1120
- //#endregion
1121
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/extractAttributesFromGlProgram.mjs
1122
- function Fe(e, t, n = !1) {
1123
- let r = {}, i = t.getProgramParameter(e, t.ACTIVE_ATTRIBUTES);
1124
- for (let n = 0; n < i; n++) {
1125
- let i = t.getActiveAttrib(e, n);
1126
- if (i.name.startsWith("gl_")) continue;
1127
- let a = Pe(t, i.type);
1128
- r[i.name] = {
1129
- location: 0,
1130
- format: a,
1131
- stride: c(a).stride,
1132
- offset: 0,
1133
- instance: !1,
1134
- start: 0
1135
- };
1136
- }
1137
- let a = Object.keys(r);
1138
- if (n) {
1139
- a.sort((e, t) => e > t ? 1 : -1);
1140
- for (let n = 0; n < a.length; n++) r[a[n]].location = n, t.bindAttribLocation(e, n, a[n]);
1141
- t.linkProgram(e);
1142
- } else for (let n = 0; n < a.length; n++) r[a[n]].location = t.getAttribLocation(e, a[n]);
1143
- return r;
1144
- }
1145
- //#endregion
1146
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/getUboData.mjs
1147
- function Ie(e, t) {
1148
- if (!t.ACTIVE_UNIFORM_BLOCKS) return {};
1149
- let n = {}, r = t.getProgramParameter(e, t.ACTIVE_UNIFORM_BLOCKS);
1150
- for (let i = 0; i < r; i++) {
1151
- let r = t.getActiveUniformBlockName(e, i);
1152
- n[r] = {
1153
- name: r,
1154
- index: t.getUniformBlockIndex(e, r),
1155
- size: t.getActiveUniformBlockParameter(e, i, t.UNIFORM_BLOCK_DATA_SIZE)
1156
- };
1157
- }
1158
- return n;
1159
- }
1160
- //#endregion
1161
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/getUniformData.mjs
1162
- function Le(e, t) {
1163
- let n = {}, r = t.getProgramParameter(e, t.ACTIVE_UNIFORMS);
1164
- for (let i = 0; i < r; i++) {
1165
- let r = t.getActiveUniform(e, i), a = r.name.replace(/\[.*?\]$/, ""), o = !!r.name.match(/\[.*?\]$/), s = G(t, r.type);
1166
- n[a] = {
1167
- name: a,
1168
- index: i,
1169
- type: s,
1170
- size: r.size,
1171
- isArray: o,
1172
- value: H(s, r.size)
1173
- };
1174
- }
1175
- return n;
1176
- }
1177
- //#endregion
1178
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/logProgramError.mjs
1179
- function K(e, t) {
1180
- let n = e.getShaderSource(t);
1181
- if (n === null) {
1182
- console.error("PixiJS Error: Could not retrieve shader source (WebGL context may be lost).");
1183
- return;
1184
- }
1185
- let r = n.split("\n").map((e, t) => `${t}: ${e}`), i = e.getShaderInfoLog(t) ?? "", a = i.split("\n"), o = {}, s = a.map((e) => parseFloat(e.replace(/^ERROR\: 0\:([\d]+)\:.*$/, "$1"))).filter((e) => e && !o[e] ? (o[e] = !0, !0) : !1), c = [""];
1186
- s.forEach((e) => {
1187
- r[e - 1] = `%c${r[e - 1]}%c`, c.push("background: #FF0000; color:#FFFFFF; font-size: 10px", "font-size: 10px");
1188
- }), c[0] = r.join("\n"), console.error(i), console.groupCollapsed("click to view full shader code"), console.warn(...c), console.groupEnd();
1189
- }
1190
- function Re(e, t, n, r) {
1191
- e.getProgramParameter(t, e.LINK_STATUS) || (e.getShaderParameter(n, e.COMPILE_STATUS) || K(e, n), e.getShaderParameter(r, e.COMPILE_STATUS) || K(e, r), console.error("PixiJS Error: Could not initialize shader."), e.getProgramInfoLog(t) !== "" && console.warn("PixiJS Warning: gl.getProgramInfoLog()", e.getProgramInfoLog(t)));
1192
- }
1193
- //#endregion
1194
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/program/generateProgram.mjs
1195
- function ze(e, n) {
1196
- let r = B(e, e.VERTEX_SHADER, n.vertex), i = B(e, e.FRAGMENT_SHADER, n.fragment), a = e.createProgram();
1197
- e.attachShader(a, r), e.attachShader(a, i);
1198
- let o = n.transformFeedbackVaryings;
1199
- o && (typeof e.transformFeedbackVaryings == "function" ? e.transformFeedbackVaryings(a, o.names, o.bufferMode === "separate" ? e.SEPARATE_ATTRIBS : e.INTERLEAVED_ATTRIBS) : t("TransformFeedback is not supported but TransformFeedbackVaryings are given.")), e.linkProgram(a), e.getProgramParameter(a, e.LINK_STATUS) || Re(e, a, r, i), n._attributeData = Fe(a, e, !/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(n.vertex)), n._uniformData = Le(a, e), n._uniformBlockData = Ie(a, e), e.deleteShader(r), e.deleteShader(i);
1200
- let s = {};
1201
- for (let t in n._uniformData) {
1202
- let r = n._uniformData[t];
1203
- s[t] = {
1204
- location: e.getUniformLocation(a, t),
1205
- value: H(r.type, r.size)
1206
- };
1207
- }
1208
- return new Me(a, s);
1209
- }
1210
- //#endregion
1211
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/GlShaderSystem.mjs
1212
- var q = {
1213
- textureCount: 0,
1214
- blockIndex: 0
1215
- }, J = class {
1216
- constructor(e) {
1217
- this._activeProgram = null, this._programDataHash = /* @__PURE__ */ Object.create(null), this._shaderSyncFunctions = /* @__PURE__ */ Object.create(null), this._renderer = e;
1218
- }
1219
- contextChange(e) {
1220
- this._gl = e, this._programDataHash = /* @__PURE__ */ Object.create(null), this._shaderSyncFunctions = /* @__PURE__ */ Object.create(null), this._activeProgram = null;
1221
- }
1222
- bind(e, t) {
1223
- if (this._setProgram(e.glProgram), t) return;
1224
- q.textureCount = 0, q.blockIndex = 0;
1225
- let n = this._shaderSyncFunctions[e.glProgram._key];
1226
- n ||= this._shaderSyncFunctions[e.glProgram._key] = this._generateShaderSync(e, this), this._renderer.buffer.nextBindBase(!!e.glProgram.transformFeedbackVaryings), n(this._renderer, e, q);
1227
- }
1228
- updateUniformGroup(e) {
1229
- this._renderer.uniformGroup.updateUniformGroup(e, this._activeProgram, q);
1230
- }
1231
- bindUniformBlock(e, t, n = 0) {
1232
- let r = this._renderer.buffer, i = this._getProgramData(this._activeProgram), a = e._bufferResource;
1233
- a || this._renderer.ubo.updateUniformGroup(e);
1234
- let o = e.buffer, s = r.updateBuffer(o), c = r.freeLocationForBufferBase(s);
1235
- if (a) {
1236
- let { offset: t, size: n } = e;
1237
- t === 0 && n === o.data.byteLength ? r.bindBufferBase(s, c) : r.bindBufferRange(s, c, t);
1238
- } else r.getLastBindBaseLocation(s) !== c && r.bindBufferBase(s, c);
1239
- let l = this._activeProgram._uniformBlockData[t].index;
1240
- i.uniformBlockBindings[n] !== c && (i.uniformBlockBindings[n] = c, this._renderer.gl.uniformBlockBinding(i.program, l, c));
1241
- }
1242
- _setProgram(e) {
1243
- if (this._activeProgram === e) return;
1244
- this._activeProgram = e;
1245
- let t = this._getProgramData(e);
1246
- this._gl.useProgram(t.program);
1247
- }
1248
- _getProgramData(e) {
1249
- return this._programDataHash[e._key] || this._createProgramData(e);
1250
- }
1251
- _createProgramData(e) {
1252
- let t = e._key;
1253
- return this._programDataHash[t] = ze(this._gl, e), this._programDataHash[t];
1254
- }
1255
- destroy() {
1256
- for (let e of Object.keys(this._programDataHash)) this._programDataHash[e].destroy();
1257
- this._programDataHash = null, this._shaderSyncFunctions = null, this._activeProgram = null, this._renderer = null, this._gl = null;
1258
- }
1259
- _generateShaderSync(e, t) {
1260
- return je(e, t);
1261
- }
1262
- resetState() {
1263
- this._activeProgram = null;
1264
- }
1265
- };
1266
- J.extension = {
1267
- type: [m.WebGLSystem],
1268
- name: "shader"
1269
- };
1270
- //#endregion
1271
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/utils/generateUniformsSyncTypes.mjs
1272
- var Be = {
1273
- f32: "if (cv !== v) {\n cu.value = v;\n gl.uniform1f(location, v);\n }",
1274
- "vec2<f32>": "if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2f(location, v[0], v[1]);\n }",
1275
- "vec3<f32>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3f(location, v[0], v[1], v[2]);\n }",
1276
- "vec4<f32>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4f(location, v[0], v[1], v[2], v[3]);\n }",
1277
- i32: "if (cv !== v) {\n cu.value = v;\n gl.uniform1i(location, v);\n }",
1278
- "vec2<i32>": "if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2i(location, v[0], v[1]);\n }",
1279
- "vec3<i32>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3i(location, v[0], v[1], v[2]);\n }",
1280
- "vec4<i32>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }",
1281
- u32: "if (cv !== v) {\n cu.value = v;\n gl.uniform1ui(location, v);\n }",
1282
- "vec2<u32>": "if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2ui(location, v[0], v[1]);\n }",
1283
- "vec3<u32>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3ui(location, v[0], v[1], v[2]);\n }",
1284
- "vec4<u32>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4ui(location, v[0], v[1], v[2], v[3]);\n }",
1285
- bool: "if (cv !== v) {\n cu.value = v;\n gl.uniform1i(location, v);\n }",
1286
- "vec2<bool>": "if (cv[0] !== v[0] || cv[1] !== v[1]) {\n cv[0] = v[0];\n cv[1] = v[1];\n gl.uniform2i(location, v[0], v[1]);\n }",
1287
- "vec3<bool>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n gl.uniform3i(location, v[0], v[1], v[2]);\n }",
1288
- "vec4<bool>": "if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {\n cv[0] = v[0];\n cv[1] = v[1];\n cv[2] = v[2];\n cv[3] = v[3];\n gl.uniform4i(location, v[0], v[1], v[2], v[3]);\n }",
1289
- "mat2x2<f32>": "gl.uniformMatrix2fv(location, false, v);",
1290
- "mat3x3<f32>": "gl.uniformMatrix3fv(location, false, v);",
1291
- "mat4x4<f32>": "gl.uniformMatrix4fv(location, false, v);"
1292
- }, Ve = {
1293
- f32: "gl.uniform1fv(location, v);",
1294
- "vec2<f32>": "gl.uniform2fv(location, v);",
1295
- "vec3<f32>": "gl.uniform3fv(location, v);",
1296
- "vec4<f32>": "gl.uniform4fv(location, v);",
1297
- "mat2x2<f32>": "gl.uniformMatrix2fv(location, false, v);",
1298
- "mat3x3<f32>": "gl.uniformMatrix3fv(location, false, v);",
1299
- "mat4x4<f32>": "gl.uniformMatrix4fv(location, false, v);",
1300
- i32: "gl.uniform1iv(location, v);",
1301
- "vec2<i32>": "gl.uniform2iv(location, v);",
1302
- "vec3<i32>": "gl.uniform3iv(location, v);",
1303
- "vec4<i32>": "gl.uniform4iv(location, v);",
1304
- u32: "gl.uniform1iv(location, v);",
1305
- "vec2<u32>": "gl.uniform2iv(location, v);",
1306
- "vec3<u32>": "gl.uniform3iv(location, v);",
1307
- "vec4<u32>": "gl.uniform4iv(location, v);",
1308
- bool: "gl.uniform1iv(location, v);",
1309
- "vec2<bool>": "gl.uniform2iv(location, v);",
1310
- "vec3<bool>": "gl.uniform3iv(location, v);",
1311
- "vec4<bool>": "gl.uniform4iv(location, v);"
1312
- };
1313
- //#endregion
1314
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/utils/generateUniformsSync.mjs
1315
- function He(e, t) {
1316
- let n = ["\n var v = null;\n var cv = null;\n var cu = null;\n var t = 0;\n var gl = renderer.gl;\n var name = null;\n "];
1317
- for (let r in e.uniforms) {
1318
- if (!t[r]) {
1319
- e.uniforms[r] instanceof h ? e.uniforms[r].ubo ? n.push(`
1320
- renderer.shader.bindUniformBlock(uv.${r}, "${r}");
1321
- `) : n.push(`
1322
- renderer.shader.updateUniformGroup(uv.${r});
1323
- `) : e.uniforms[r] instanceof ge && n.push(`
1324
- renderer.shader.bindBufferResource(uv.${r}, "${r}");
1325
- `);
1326
- continue;
1327
- }
1328
- let i = e.uniformStructures[r], a = !1;
1329
- for (let e = 0; e < x.length; e++) {
1330
- let t = x[e];
1331
- if (i.type === t.type && t.test(i)) {
1332
- n.push(`name = "${r}";`, x[e].uniform), a = !0;
1333
- break;
1334
- }
1335
- }
1336
- if (!a) {
1337
- let e = (i.size === 1 ? Be : Ve)[i.type].replace("location", `ud["${r}"].location`);
1338
- n.push(`
1339
- cu = ud["${r}"];
1340
- cv = cu.value;
1341
- v = uv["${r}"];
1342
- ${e};`);
1343
- }
1344
- }
1345
- return Function("ud", "uv", "renderer", "syncData", n.join("\n"));
1346
- }
1347
- //#endregion
1348
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/shader/GlUniformGroupSystem.mjs
1349
- var Y = class {
1350
- constructor(e) {
1351
- this._cache = {}, this._uniformGroupSyncHash = {}, this._renderer = e, this.gl = null, this._cache = {};
1352
- }
1353
- contextChange(e) {
1354
- this.gl = e;
1355
- }
1356
- updateUniformGroup(e, t, n) {
1357
- let r = this._renderer.shader._getProgramData(t);
1358
- (!e.isStatic || e._dirtyId !== r.uniformDirtyGroups[e.uid]) && (r.uniformDirtyGroups[e.uid] = e._dirtyId, this._getUniformSyncFunction(e, t)(r.uniformData, e.uniforms, this._renderer, n));
1359
- }
1360
- _getUniformSyncFunction(e, t) {
1361
- return this._uniformGroupSyncHash[e._signature]?.[t._key] || this._createUniformSyncFunction(e, t);
1362
- }
1363
- _createUniformSyncFunction(e, t) {
1364
- let n = this._uniformGroupSyncHash[e._signature] || (this._uniformGroupSyncHash[e._signature] = {}), r = this._getSignature(e, t._uniformData, "u");
1365
- return this._cache[r] || (this._cache[r] = this._generateUniformsSync(e, t._uniformData)), n[t._key] = this._cache[r], n[t._key];
1366
- }
1367
- _generateUniformsSync(e, t) {
1368
- return He(e, t);
1369
- }
1370
- _getSignature(e, t, n) {
1371
- let r = e.uniforms, i = [`${n}-`];
1372
- for (let e in r) i.push(e), t[e] && i.push(t[e].type);
1373
- return i.join("-");
1374
- }
1375
- destroy() {
1376
- this._renderer = null, this._cache = null;
1377
- }
1378
- };
1379
- Y.extension = {
1380
- type: [m.WebGLSystem],
1381
- name: "uniformGroup"
1382
- };
1383
- //#endregion
1384
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/state/mapWebGLBlendModesToPixi.mjs
1385
- function Ue(e) {
1386
- let t = {};
1387
- if (t.normal = [e.ONE, e.ONE_MINUS_SRC_ALPHA], t.add = [e.ONE, e.ONE], t.multiply = [
1388
- e.DST_COLOR,
1389
- e.ONE_MINUS_SRC_ALPHA,
1390
- e.ONE,
1391
- e.ONE_MINUS_SRC_ALPHA
1392
- ], t.screen = [
1393
- e.ONE,
1394
- e.ONE_MINUS_SRC_COLOR,
1395
- e.ONE,
1396
- e.ONE_MINUS_SRC_ALPHA
1397
- ], t.none = [0, 0], t["normal-npm"] = [
1398
- e.SRC_ALPHA,
1399
- e.ONE_MINUS_SRC_ALPHA,
1400
- e.ONE,
1401
- e.ONE_MINUS_SRC_ALPHA
1402
- ], t["add-npm"] = [
1403
- e.SRC_ALPHA,
1404
- e.ONE,
1405
- e.ONE,
1406
- e.ONE
1407
- ], t["screen-npm"] = [
1408
- e.SRC_ALPHA,
1409
- e.ONE_MINUS_SRC_COLOR,
1410
- e.ONE,
1411
- e.ONE_MINUS_SRC_ALPHA
1412
- ], t.erase = [e.ZERO, e.ONE_MINUS_SRC_ALPHA], !(e instanceof a.get().getWebGLRenderingContext())) t.min = [
1413
- e.ONE,
1414
- e.ONE,
1415
- e.ONE,
1416
- e.ONE,
1417
- e.MIN,
1418
- e.MIN
1419
- ], t.max = [
1420
- e.ONE,
1421
- e.ONE,
1422
- e.ONE,
1423
- e.ONE,
1424
- e.MAX,
1425
- e.MAX
1426
- ];
1427
- else {
1428
- let n = e.getExtension("EXT_blend_minmax");
1429
- n && (t.min = [
1430
- e.ONE,
1431
- e.ONE,
1432
- e.ONE,
1433
- e.ONE,
1434
- n.MIN_EXT,
1435
- n.MIN_EXT
1436
- ], t.max = [
1437
- e.ONE,
1438
- e.ONE,
1439
- e.ONE,
1440
- e.ONE,
1441
- n.MAX_EXT,
1442
- n.MAX_EXT
1443
- ]);
1444
- }
1445
- return t;
1446
- }
1447
- //#endregion
1448
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/state/GlStateSystem.mjs
1449
- var We = 0, Ge = 1, Ke = 2, qe = 3, Je = 4, Ye = 5, X = class e {
1450
- constructor(e) {
1451
- this._invertFrontFace = !1, this.gl = null, this.stateId = 0, this.polygonOffset = 0, this.blendMode = "none", this._blendEq = !1, this.map = [], this.map[We] = this.setBlend, this.map[Ge] = this.setOffset, this.map[Ke] = this.setCullFace, this.map[qe] = this.setDepthTest, this.map[Je] = this.setFrontFace, this.map[Ye] = this.setDepthMask, this.checks = [], this.defaultState = o.for2d(), e.renderTarget.onRenderTargetChange.add(this);
1452
- }
1453
- onRenderTargetChange(e) {
1454
- this._invertFrontFace = !e.isRoot, this._cullFace ? this.setFrontFace(this._frontFace) : this._frontFaceDirty = !0;
1455
- }
1456
- contextChange(e) {
1457
- this.gl = e, this.blendModesMap = Ue(e), this.resetState();
1458
- }
1459
- set(e) {
1460
- if (e ||= this.defaultState, this.stateId !== e.data) {
1461
- let t = this.stateId ^ e.data, n = 0;
1462
- for (; t;) t & 1 && this.map[n].call(this, !!(e.data & 1 << n)), t >>= 1, n++;
1463
- this.stateId = e.data;
1464
- }
1465
- for (let t = 0; t < this.checks.length; t++) this.checks[t](this, e);
1466
- }
1467
- forceState(e) {
1468
- e ||= this.defaultState;
1469
- for (let t = 0; t < this.map.length; t++) this.map[t].call(this, !!(e.data & 1 << t));
1470
- for (let t = 0; t < this.checks.length; t++) this.checks[t](this, e);
1471
- this.stateId = e.data;
1472
- }
1473
- setBlend(t) {
1474
- this._updateCheck(e._checkBlendMode, t), this.gl[t ? "enable" : "disable"](this.gl.BLEND);
1475
- }
1476
- setOffset(t) {
1477
- this._updateCheck(e._checkPolygonOffset, t), this.gl[t ? "enable" : "disable"](this.gl.POLYGON_OFFSET_FILL);
1478
- }
1479
- setDepthTest(e) {
1480
- this.gl[e ? "enable" : "disable"](this.gl.DEPTH_TEST);
1481
- }
1482
- setDepthMask(e) {
1483
- this.gl.depthMask(e);
1484
- }
1485
- setCullFace(e) {
1486
- this._cullFace = e, this.gl[e ? "enable" : "disable"](this.gl.CULL_FACE), this._cullFace && this._frontFaceDirty && this.setFrontFace(this._frontFace);
1487
- }
1488
- setFrontFace(e) {
1489
- this._frontFace = e, this._frontFaceDirty = !1;
1490
- let t = this._invertFrontFace ? !e : e;
1491
- this._glFrontFace !== t && (this._glFrontFace = t, this.gl.frontFace(this.gl[t ? "CW" : "CCW"]));
1492
- }
1493
- setBlendMode(e) {
1494
- if (this.blendModesMap[e] || (e = "normal"), e === this.blendMode) return;
1495
- this.blendMode = e;
1496
- let t = this.blendModesMap[e], n = this.gl;
1497
- t.length === 2 ? n.blendFunc(t[0], t[1]) : n.blendFuncSeparate(t[0], t[1], t[2], t[3]), t.length === 6 ? (this._blendEq = !0, n.blendEquationSeparate(t[4], t[5])) : this._blendEq && (this._blendEq = !1, n.blendEquationSeparate(n.FUNC_ADD, n.FUNC_ADD));
1498
- }
1499
- setPolygonOffset(e, t) {
1500
- this.gl.polygonOffset(e, t);
1501
- }
1502
- resetState() {
1503
- this._glFrontFace = !1, this._frontFace = !1, this._cullFace = !1, this._frontFaceDirty = !1, this._invertFrontFace = !1, this.gl.frontFace(this.gl.CCW), this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, !1), this.forceState(this.defaultState), this._blendEq = !0, this.blendMode = "", this.setBlendMode("normal");
1504
- }
1505
- _updateCheck(e, t) {
1506
- let n = this.checks.indexOf(e);
1507
- t && n === -1 ? this.checks.push(e) : !t && n !== -1 && this.checks.splice(n, 1);
1508
- }
1509
- static _checkBlendMode(e, t) {
1510
- e.setBlendMode(t.blendMode);
1511
- }
1512
- static _checkPolygonOffset(e, t) {
1513
- e.setPolygonOffset(1, t.polygonOffset);
1514
- }
1515
- destroy() {
1516
- this.gl = null, this.checks.length = 0;
1517
- }
1518
- };
1519
- X.extension = {
1520
- type: [m.WebGLSystem],
1521
- name: "state"
1522
- };
1523
- var Xe = X, Ze = class {
1524
- constructor(e) {
1525
- this.target = O.TEXTURE_2D, this._layerInitMask = 0, this.texture = e, this.width = -1, this.height = -1, this.type = k.UNSIGNED_BYTE, this.internalFormat = D.RGBA, this.format = D.RGBA, this.samplerType = 0;
1526
- }
1527
- destroy() {}
1528
- }, Qe = {
1529
- id: "buffer",
1530
- upload(e, t, n, r, i, a = !1) {
1531
- let o = i || t.target;
1532
- !a && t.width === e.width && t.height === e.height ? n.texSubImage2D(o, 0, 0, 0, e.width, e.height, t.format, t.type, e.resource) : n.texImage2D(o, 0, t.internalFormat, e.width, e.height, 0, t.format, t.type, e.resource), t.width = e.width, t.height = e.height;
1533
- }
1534
- }, $e = {
1535
- "bc1-rgba-unorm": !0,
1536
- "bc1-rgba-unorm-srgb": !0,
1537
- "bc2-rgba-unorm": !0,
1538
- "bc2-rgba-unorm-srgb": !0,
1539
- "bc3-rgba-unorm": !0,
1540
- "bc3-rgba-unorm-srgb": !0,
1541
- "bc4-r-unorm": !0,
1542
- "bc4-r-snorm": !0,
1543
- "bc5-rg-unorm": !0,
1544
- "bc5-rg-snorm": !0,
1545
- "bc6h-rgb-ufloat": !0,
1546
- "bc6h-rgb-float": !0,
1547
- "bc7-rgba-unorm": !0,
1548
- "bc7-rgba-unorm-srgb": !0,
1549
- "etc2-rgb8unorm": !0,
1550
- "etc2-rgb8unorm-srgb": !0,
1551
- "etc2-rgb8a1unorm": !0,
1552
- "etc2-rgb8a1unorm-srgb": !0,
1553
- "etc2-rgba8unorm": !0,
1554
- "etc2-rgba8unorm-srgb": !0,
1555
- "eac-r11unorm": !0,
1556
- "eac-r11snorm": !0,
1557
- "eac-rg11unorm": !0,
1558
- "eac-rg11snorm": !0,
1559
- "astc-4x4-unorm": !0,
1560
- "astc-4x4-unorm-srgb": !0,
1561
- "astc-5x4-unorm": !0,
1562
- "astc-5x4-unorm-srgb": !0,
1563
- "astc-5x5-unorm": !0,
1564
- "astc-5x5-unorm-srgb": !0,
1565
- "astc-6x5-unorm": !0,
1566
- "astc-6x5-unorm-srgb": !0,
1567
- "astc-6x6-unorm": !0,
1568
- "astc-6x6-unorm-srgb": !0,
1569
- "astc-8x5-unorm": !0,
1570
- "astc-8x5-unorm-srgb": !0,
1571
- "astc-8x6-unorm": !0,
1572
- "astc-8x6-unorm-srgb": !0,
1573
- "astc-8x8-unorm": !0,
1574
- "astc-8x8-unorm-srgb": !0,
1575
- "astc-10x5-unorm": !0,
1576
- "astc-10x5-unorm-srgb": !0,
1577
- "astc-10x6-unorm": !0,
1578
- "astc-10x6-unorm-srgb": !0,
1579
- "astc-10x8-unorm": !0,
1580
- "astc-10x8-unorm-srgb": !0,
1581
- "astc-10x10-unorm": !0,
1582
- "astc-10x10-unorm-srgb": !0,
1583
- "astc-12x10-unorm": !0,
1584
- "astc-12x10-unorm-srgb": !0,
1585
- "astc-12x12-unorm": !0,
1586
- "astc-12x12-unorm-srgb": !0
1587
- }, et = {
1588
- id: "compressed",
1589
- upload(e, t, n, r, i, a) {
1590
- let o = i ?? t.target;
1591
- n.pixelStorei(n.UNPACK_ALIGNMENT, 4);
1592
- let s = e.pixelWidth, c = e.pixelHeight, l = !!$e[e.format];
1593
- for (let r = 0; r < e.resource.length; r++) {
1594
- let i = e.resource[r];
1595
- l ? n.compressedTexImage2D(o, r, t.internalFormat, s, c, 0, i) : n.texImage2D(o, r, t.internalFormat, s, c, 0, t.format, t.type, i), s = Math.max(s >> 1, 1), c = Math.max(c >> 1, 1);
1596
- }
1597
- }
1598
- }, tt = [
1599
- "right",
1600
- "left",
1601
- "top",
1602
- "bottom",
1603
- "front",
1604
- "back"
1605
- ];
1606
- function nt(e) {
1607
- return {
1608
- id: "cube",
1609
- upload(t, n, r, i) {
1610
- let a = t.faces;
1611
- for (let t = 0; t < tt.length; t++) {
1612
- let o = a[tt[t]];
1613
- (e[o.uploadMethodId] || e.image).upload(o, n, r, i, O.TEXTURE_CUBE_MAP_POSITIVE_X + t, !(n._layerInitMask & 1 << t)), n._layerInitMask |= 1 << t;
1614
- }
1615
- n.width = t.pixelWidth, n.height = t.pixelHeight;
1616
- }
1617
- };
1618
- }
1619
- //#endregion
1620
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/texture/uploaders/glUploadImageResource.mjs
1621
- var rt = {
1622
- id: "image",
1623
- upload(e, t, n, r, i, a = !1) {
1624
- let o = i || t.target, s = e.pixelWidth, c = e.pixelHeight, l = e.resourceWidth, u = e.resourceHeight, d = r === 2, f = a || t.width !== s || t.height !== c, p = l >= s && u >= c, m = e.resource;
1625
- (d ? it : at)(n, o, t, s, c, l, u, m, f, p), t.width = s, t.height = c;
1626
- }
1627
- };
1628
- function it(e, t, n, r, i, a, o, s, c, l) {
1629
- if (!l) {
1630
- c && e.texImage2D(t, 0, n.internalFormat, r, i, 0, n.format, n.type, null), e.texSubImage2D(t, 0, 0, 0, a, o, n.format, n.type, s);
1631
- return;
1632
- }
1633
- if (!c) {
1634
- e.texSubImage2D(t, 0, 0, 0, n.format, n.type, s);
1635
- return;
1636
- }
1637
- e.texImage2D(t, 0, n.internalFormat, r, i, 0, n.format, n.type, s);
1638
- }
1639
- function at(e, t, n, r, i, a, o, s, c, l) {
1640
- if (!l) {
1641
- c && e.texImage2D(t, 0, n.internalFormat, r, i, 0, n.format, n.type, null), e.texSubImage2D(t, 0, 0, 0, n.format, n.type, s);
1642
- return;
1643
- }
1644
- if (!c) {
1645
- e.texSubImage2D(t, 0, 0, 0, n.format, n.type, s);
1646
- return;
1647
- }
1648
- e.texImage2D(t, 0, n.internalFormat, n.format, n.type, s);
1649
- }
1650
- //#endregion
1651
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/utils/browser/isSafari.mjs
1652
- function ot() {
1653
- let { userAgent: e } = a.get().getNavigator();
1654
- return /^((?!chrome|android).)*safari/i.test(e);
1655
- }
1656
- //#endregion
1657
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/texture/uploaders/glUploadVideoResource.mjs
1658
- var st = ot(), ct = {
1659
- id: "video",
1660
- upload(e, t, n, r, i, a = st) {
1661
- if (!e.isValid) {
1662
- let e = i ?? t.target;
1663
- n.texImage2D(e, 0, t.internalFormat, 1, 1, 0, t.format, t.type, null);
1664
- return;
1665
- }
1666
- rt.upload(e, t, n, r, i, a);
1667
- }
1668
- }, lt = {
1669
- linear: 9729,
1670
- nearest: 9728
1671
- }, ut = {
1672
- linear: {
1673
- linear: 9987,
1674
- nearest: 9985
1675
- },
1676
- nearest: {
1677
- linear: 9986,
1678
- nearest: 9984
1679
- }
1680
- }, Z = {
1681
- "clamp-to-edge": 33071,
1682
- repeat: 10497,
1683
- "mirror-repeat": 33648
1684
- }, dt = {
1685
- never: 512,
1686
- less: 513,
1687
- equal: 514,
1688
- "less-equal": 515,
1689
- greater: 516,
1690
- "not-equal": 517,
1691
- "greater-equal": 518,
1692
- always: 519
1693
- };
1694
- //#endregion
1695
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/texture/utils/applyStyleParams.mjs
1696
- function ft(e, t, n, r, i, a, o, s) {
1697
- let c = a;
1698
- if (!s || e.addressModeU !== "repeat" || e.addressModeV !== "repeat" || e.addressModeW !== "repeat") {
1699
- let n = Z[o ? "clamp-to-edge" : e.addressModeU], r = Z[o ? "clamp-to-edge" : e.addressModeV], a = Z[o ? "clamp-to-edge" : e.addressModeW];
1700
- t[i](c, t.TEXTURE_WRAP_S, n), t[i](c, t.TEXTURE_WRAP_T, r), t.TEXTURE_WRAP_R && t[i](c, t.TEXTURE_WRAP_R, a);
1701
- }
1702
- if ((!s || e.magFilter !== "linear") && t[i](c, t.TEXTURE_MAG_FILTER, lt[e.magFilter]), n) {
1703
- if (!s || e.mipmapFilter !== "linear") {
1704
- let n = ut[e.minFilter][e.mipmapFilter];
1705
- t[i](c, t.TEXTURE_MIN_FILTER, n);
1706
- }
1707
- } else t[i](c, t.TEXTURE_MIN_FILTER, lt[e.minFilter]);
1708
- if (r && e.maxAnisotropy > 1) {
1709
- let n = Math.min(e.maxAnisotropy, t.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT));
1710
- t[i](c, r.TEXTURE_MAX_ANISOTROPY_EXT, n);
1711
- }
1712
- e.compare && t[i](c, t.TEXTURE_COMPARE_FUNC, dt[e.compare]);
1713
- }
1714
- //#endregion
1715
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/texture/utils/mapFormatToGlFormat.mjs
1716
- function pt(e) {
1717
- return {
1718
- r8unorm: e.RED,
1719
- r8snorm: e.RED,
1720
- r8uint: e.RED,
1721
- r8sint: e.RED,
1722
- r16uint: e.RED,
1723
- r16sint: e.RED,
1724
- r16float: e.RED,
1725
- rg8unorm: e.RG,
1726
- rg8snorm: e.RG,
1727
- rg8uint: e.RG,
1728
- rg8sint: e.RG,
1729
- r32uint: e.RED,
1730
- r32sint: e.RED,
1731
- r32float: e.RED,
1732
- rg16uint: e.RG,
1733
- rg16sint: e.RG,
1734
- rg16float: e.RG,
1735
- rgba8unorm: e.RGBA,
1736
- "rgba8unorm-srgb": e.RGBA,
1737
- rgba8snorm: e.RGBA,
1738
- rgba8uint: e.RGBA,
1739
- rgba8sint: e.RGBA,
1740
- bgra8unorm: e.RGBA,
1741
- "bgra8unorm-srgb": e.RGBA,
1742
- rgb9e5ufloat: e.RGB,
1743
- rgb10a2unorm: e.RGBA,
1744
- rg11b10ufloat: e.RGB,
1745
- rg32uint: e.RG,
1746
- rg32sint: e.RG,
1747
- rg32float: e.RG,
1748
- rgba16uint: e.RGBA,
1749
- rgba16sint: e.RGBA,
1750
- rgba16float: e.RGBA,
1751
- rgba32uint: e.RGBA,
1752
- rgba32sint: e.RGBA,
1753
- rgba32float: e.RGBA,
1754
- stencil8: e.STENCIL_INDEX8,
1755
- depth16unorm: e.DEPTH_COMPONENT,
1756
- depth24plus: e.DEPTH_COMPONENT,
1757
- "depth24plus-stencil8": e.DEPTH_STENCIL,
1758
- depth32float: e.DEPTH_COMPONENT,
1759
- "depth32float-stencil8": e.DEPTH_STENCIL
1760
- };
1761
- }
1762
- //#endregion
1763
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/texture/utils/mapFormatToGlInternalFormat.mjs
1764
- function mt(e, t) {
1765
- let n = {}, r = e.RGBA;
1766
- return e instanceof a.get().getWebGLRenderingContext() ? t.srgb && (n = {
1767
- "rgba8unorm-srgb": t.srgb.SRGB8_ALPHA8_EXT,
1768
- "bgra8unorm-srgb": t.srgb.SRGB8_ALPHA8_EXT
1769
- }) : (n = {
1770
- "rgba8unorm-srgb": e.SRGB8_ALPHA8,
1771
- "bgra8unorm-srgb": e.SRGB8_ALPHA8
1772
- }, r = e.RGBA8), {
1773
- r8unorm: e.R8,
1774
- r8snorm: e.R8_SNORM,
1775
- r8uint: e.R8UI,
1776
- r8sint: e.R8I,
1777
- r16uint: e.R16UI,
1778
- r16sint: e.R16I,
1779
- r16float: e.R16F,
1780
- rg8unorm: e.RG8,
1781
- rg8snorm: e.RG8_SNORM,
1782
- rg8uint: e.RG8UI,
1783
- rg8sint: e.RG8I,
1784
- r32uint: e.R32UI,
1785
- r32sint: e.R32I,
1786
- r32float: e.R32F,
1787
- rg16uint: e.RG16UI,
1788
- rg16sint: e.RG16I,
1789
- rg16float: e.RG16F,
1790
- rgba8unorm: e.RGBA,
1791
- ...n,
1792
- rgba8snorm: e.RGBA8_SNORM,
1793
- rgba8uint: e.RGBA8UI,
1794
- rgba8sint: e.RGBA8I,
1795
- bgra8unorm: r,
1796
- rgb9e5ufloat: e.RGB9_E5,
1797
- rgb10a2unorm: e.RGB10_A2,
1798
- rg11b10ufloat: e.R11F_G11F_B10F,
1799
- rg32uint: e.RG32UI,
1800
- rg32sint: e.RG32I,
1801
- rg32float: e.RG32F,
1802
- rgba16uint: e.RGBA16UI,
1803
- rgba16sint: e.RGBA16I,
1804
- rgba16float: e.RGBA16F,
1805
- rgba32uint: e.RGBA32UI,
1806
- rgba32sint: e.RGBA32I,
1807
- rgba32float: e.RGBA32F,
1808
- stencil8: e.STENCIL_INDEX8,
1809
- depth16unorm: e.DEPTH_COMPONENT16,
1810
- depth24plus: e.DEPTH_COMPONENT24,
1811
- "depth24plus-stencil8": e.DEPTH24_STENCIL8,
1812
- depth32float: e.DEPTH_COMPONENT32F,
1813
- "depth32float-stencil8": e.DEPTH32F_STENCIL8,
1814
- ...t.s3tc ? {
1815
- "bc1-rgba-unorm": t.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,
1816
- "bc2-rgba-unorm": t.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,
1817
- "bc3-rgba-unorm": t.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT
1818
- } : {},
1819
- ...t.s3tc_sRGB ? {
1820
- "bc1-rgba-unorm-srgb": t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,
1821
- "bc2-rgba-unorm-srgb": t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,
1822
- "bc3-rgba-unorm-srgb": t.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT
1823
- } : {},
1824
- ...t.rgtc ? {
1825
- "bc4-r-unorm": t.rgtc.COMPRESSED_RED_RGTC1_EXT,
1826
- "bc4-r-snorm": t.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,
1827
- "bc5-rg-unorm": t.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,
1828
- "bc5-rg-snorm": t.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT
1829
- } : {},
1830
- ...t.bptc ? {
1831
- "bc6h-rgb-float": t.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,
1832
- "bc6h-rgb-ufloat": t.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,
1833
- "bc7-rgba-unorm": t.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,
1834
- "bc7-rgba-unorm-srgb": t.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT
1835
- } : {},
1836
- ...t.etc ? {
1837
- "etc2-rgb8unorm": t.etc.COMPRESSED_RGB8_ETC2,
1838
- "etc2-rgb8unorm-srgb": t.etc.COMPRESSED_SRGB8_ETC2,
1839
- "etc2-rgb8a1unorm": t.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
1840
- "etc2-rgb8a1unorm-srgb": t.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
1841
- "etc2-rgba8unorm": t.etc.COMPRESSED_RGBA8_ETC2_EAC,
1842
- "etc2-rgba8unorm-srgb": t.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
1843
- "eac-r11unorm": t.etc.COMPRESSED_R11_EAC,
1844
- "eac-rg11unorm": t.etc.COMPRESSED_SIGNED_RG11_EAC
1845
- } : {},
1846
- ...t.astc ? {
1847
- "astc-4x4-unorm": t.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,
1848
- "astc-4x4-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,
1849
- "astc-5x4-unorm": t.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,
1850
- "astc-5x4-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,
1851
- "astc-5x5-unorm": t.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,
1852
- "astc-5x5-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,
1853
- "astc-6x5-unorm": t.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,
1854
- "astc-6x5-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,
1855
- "astc-6x6-unorm": t.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,
1856
- "astc-6x6-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,
1857
- "astc-8x5-unorm": t.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,
1858
- "astc-8x5-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,
1859
- "astc-8x6-unorm": t.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,
1860
- "astc-8x6-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,
1861
- "astc-8x8-unorm": t.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,
1862
- "astc-8x8-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,
1863
- "astc-10x5-unorm": t.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,
1864
- "astc-10x5-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,
1865
- "astc-10x6-unorm": t.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,
1866
- "astc-10x6-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,
1867
- "astc-10x8-unorm": t.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,
1868
- "astc-10x8-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,
1869
- "astc-10x10-unorm": t.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,
1870
- "astc-10x10-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,
1871
- "astc-12x10-unorm": t.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,
1872
- "astc-12x10-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,
1873
- "astc-12x12-unorm": t.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,
1874
- "astc-12x12-unorm-srgb": t.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR
1875
- } : {}
1876
- };
1877
- }
1878
- //#endregion
1879
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/texture/utils/mapFormatToGlType.mjs
1880
- function ht(e) {
1881
- return {
1882
- r8unorm: e.UNSIGNED_BYTE,
1883
- r8snorm: e.BYTE,
1884
- r8uint: e.UNSIGNED_BYTE,
1885
- r8sint: e.BYTE,
1886
- r16uint: e.UNSIGNED_SHORT,
1887
- r16sint: e.SHORT,
1888
- r16float: e.HALF_FLOAT,
1889
- rg8unorm: e.UNSIGNED_BYTE,
1890
- rg8snorm: e.BYTE,
1891
- rg8uint: e.UNSIGNED_BYTE,
1892
- rg8sint: e.BYTE,
1893
- r32uint: e.UNSIGNED_INT,
1894
- r32sint: e.INT,
1895
- r32float: e.FLOAT,
1896
- rg16uint: e.UNSIGNED_SHORT,
1897
- rg16sint: e.SHORT,
1898
- rg16float: e.HALF_FLOAT,
1899
- rgba8unorm: e.UNSIGNED_BYTE,
1900
- "rgba8unorm-srgb": e.UNSIGNED_BYTE,
1901
- rgba8snorm: e.BYTE,
1902
- rgba8uint: e.UNSIGNED_BYTE,
1903
- rgba8sint: e.BYTE,
1904
- bgra8unorm: e.UNSIGNED_BYTE,
1905
- "bgra8unorm-srgb": e.UNSIGNED_BYTE,
1906
- rgb9e5ufloat: e.UNSIGNED_INT_5_9_9_9_REV,
1907
- rgb10a2unorm: e.UNSIGNED_INT_2_10_10_10_REV,
1908
- rg11b10ufloat: e.UNSIGNED_INT_10F_11F_11F_REV,
1909
- rg32uint: e.UNSIGNED_INT,
1910
- rg32sint: e.INT,
1911
- rg32float: e.FLOAT,
1912
- rgba16uint: e.UNSIGNED_SHORT,
1913
- rgba16sint: e.SHORT,
1914
- rgba16float: e.HALF_FLOAT,
1915
- rgba32uint: e.UNSIGNED_INT,
1916
- rgba32sint: e.INT,
1917
- rgba32float: e.FLOAT,
1918
- stencil8: e.UNSIGNED_BYTE,
1919
- depth16unorm: e.UNSIGNED_SHORT,
1920
- depth24plus: e.UNSIGNED_INT,
1921
- "depth24plus-stencil8": e.UNSIGNED_INT_24_8,
1922
- depth32float: e.FLOAT,
1923
- "depth32float-stencil8": e.FLOAT_32_UNSIGNED_INT_24_8_REV
1924
- };
1925
- }
1926
- //#endregion
1927
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/texture/utils/mapViewDimensionToGlTarget.mjs
1928
- function gt(e) {
1929
- return {
1930
- "2d": e.TEXTURE_2D,
1931
- cube: e.TEXTURE_CUBE_MAP,
1932
- "1d": null,
1933
- "3d": e?.TEXTURE_3D || null,
1934
- "2d-array": e?.TEXTURE_2D_ARRAY || null,
1935
- "cube-array": e?.TEXTURE_CUBE_MAP_ARRAY || null
1936
- };
1937
- }
1938
- //#endregion
1939
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/texture/GlTextureSystem.mjs
1940
- var _t = 4, Q = class e {
1941
- constructor(t) {
1942
- this._glSamplers = /* @__PURE__ */ Object.create(null), this._boundTextures = [], this._activeTextureLocation = -1, this._boundSamplers = /* @__PURE__ */ Object.create(null), this._premultiplyAlpha = !1, this._useSeparateSamplers = !1, this._renderer = t, this._managedTextures = new y({
1943
- renderer: t,
1944
- type: "resource",
1945
- onUnload: this.onSourceUnload.bind(this),
1946
- name: "glTexture"
1947
- });
1948
- let n = {
1949
- image: rt,
1950
- buffer: Qe,
1951
- video: ct,
1952
- compressed: et,
1953
- ...e.uploadExtensions
1954
- };
1955
- this._uploads = {
1956
- ...n,
1957
- cube: nt(n)
1958
- };
1959
- }
1960
- get managedTextures() {
1961
- return Object.values(this._managedTextures.items);
1962
- }
1963
- contextChange(e) {
1964
- this._gl = e, this._mapFormatToInternalFormat || (this._mapFormatToInternalFormat = mt(e, this._renderer.context.extensions), this._mapFormatToType = ht(e), this._mapFormatToFormat = pt(e), this._mapViewDimensionToGlTarget = gt(e)), this._managedTextures.removeAll(!0), this._glSamplers = /* @__PURE__ */ Object.create(null), this._boundSamplers = /* @__PURE__ */ Object.create(null), this._premultiplyAlpha = !1;
1965
- for (let e = 0; e < 16; e++) this.bind(g.EMPTY, e);
1966
- }
1967
- initSource(e) {
1968
- this.bind(e);
1969
- }
1970
- bind(e, t = 0) {
1971
- let n = e.source;
1972
- e ? (this.bindSource(n, t), this._useSeparateSamplers && this._bindSampler(n.style, t)) : (this.bindSource(null, t), this._useSeparateSamplers && this._bindSampler(null, t));
1973
- }
1974
- bindSource(e, t = 0) {
1975
- let n = this._gl;
1976
- if (e._gcLastUsed = this._renderer.gc.now, this._boundTextures[t] !== e) {
1977
- this._boundTextures[t] = e, this._activateLocation(t), e ||= g.EMPTY.source;
1978
- let r = this.getGlSource(e);
1979
- n.bindTexture(r.target, r.texture);
1980
- }
1981
- }
1982
- _bindSampler(e, t = 0) {
1983
- let n = this._gl;
1984
- if (!e) {
1985
- this._boundSamplers[t] = null, n.bindSampler(t, null);
1986
- return;
1987
- }
1988
- let r = this._getGlSampler(e);
1989
- this._boundSamplers[t] !== r && (this._boundSamplers[t] = r, n.bindSampler(t, r));
1990
- }
1991
- unbind(e) {
1992
- let t = e.source, n = this._boundTextures, r = this._gl;
1993
- for (let e = 0; e < n.length; e++) if (n[e] === t) {
1994
- this._activateLocation(e);
1995
- let i = this.getGlSource(t);
1996
- r.bindTexture(i.target, null), n[e] = null;
1997
- }
1998
- }
1999
- _activateLocation(e) {
2000
- this._activeTextureLocation !== e && (this._activeTextureLocation = e, this._gl.activeTexture(this._gl.TEXTURE0 + e));
2001
- }
2002
- _initSource(e) {
2003
- let t = this._gl, n = new Ze(t.createTexture());
2004
- if (n.type = this._mapFormatToType[e.format], n.internalFormat = this._mapFormatToInternalFormat[e.format], n.format = this._mapFormatToFormat[e.format], n.target = this._mapViewDimensionToGlTarget[e.viewDimension], n.target === null) throw Error(`Unsupported view dimension: ${e.viewDimension} with this webgl version: ${this._renderer.context.webGLVersion}`);
2005
- if (e.uploadMethodId === "cube" && (n.target = t.TEXTURE_CUBE_MAP), e.autoGenerateMipmaps && (this._renderer.context.supports.nonPowOf2mipmaps || e.isPowerOfTwo)) {
2006
- let t = Math.max(e.width, e.height);
2007
- e.mipLevelCount = Math.floor(Math.log2(t)) + 1;
2008
- }
2009
- return e._gpuData[this._renderer.uid] = n, this._managedTextures.add(e) && (e.on("update", this.onSourceUpdate, this), e.on("resize", this.onSourceUpdate, this), e.on("styleChange", this.onStyleChange, this), e.on("updateMipmaps", this.onUpdateMipmaps, this)), this.onSourceUpdate(e), this.updateStyle(e, !1), n;
2010
- }
2011
- onStyleChange(e) {
2012
- this.updateStyle(e, !1);
2013
- }
2014
- updateStyle(e, t) {
2015
- let n = this._gl, r = this.getGlSource(e);
2016
- n.bindTexture(r.target, r.texture), this._boundTextures[this._activeTextureLocation] = e, ft(e.style, n, e.mipLevelCount > 1, this._renderer.context.extensions.anisotropicFiltering, "texParameteri", r.target, !this._renderer.context.supports.nonPowOf2wrapping && !e.isPowerOfTwo, t);
2017
- }
2018
- onSourceUnload(e, t = !1) {
2019
- let n = e._gpuData[this._renderer.uid];
2020
- n && (t || (this.unbind(e), this._gl.deleteTexture(n.texture)), e.off("update", this.onSourceUpdate, this), e.off("resize", this.onSourceUpdate, this), e.off("styleChange", this.onStyleChange, this), e.off("updateMipmaps", this.onUpdateMipmaps, this));
2021
- }
2022
- onSourceUpdate(e) {
2023
- let t = this._gl, n = this.getGlSource(e);
2024
- t.bindTexture(n.target, n.texture), this._boundTextures[this._activeTextureLocation] = e;
2025
- let r = e.alphaMode === "premultiply-alpha-on-upload";
2026
- if (this._premultiplyAlpha !== r && (this._premultiplyAlpha = r, t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL, r)), this._uploads[e.uploadMethodId]) this._uploads[e.uploadMethodId].upload(e, n, t, this._renderer.context.webGLVersion);
2027
- else if (n.target === t.TEXTURE_2D) this._initEmptyTexture2D(n, e);
2028
- else if (n.target === t.TEXTURE_2D_ARRAY) this._initEmptyTexture2DArray(n, e);
2029
- else if (n.target === t.TEXTURE_CUBE_MAP) this._initEmptyTextureCube(n, e);
2030
- else throw Error("[GlTextureSystem] Unsupported texture target for empty allocation.");
2031
- this._applyMipRange(n, e), e.autoGenerateMipmaps && e.mipLevelCount > 1 && this.onUpdateMipmaps(e, !1);
2032
- }
2033
- onUpdateMipmaps(e, t = !0) {
2034
- t && this.bindSource(e, 0);
2035
- let n = this.getGlSource(e);
2036
- this._gl.generateMipmap(n.target);
2037
- }
2038
- _initEmptyTexture2D(e, t) {
2039
- let n = this._gl;
2040
- n.texImage2D(n.TEXTURE_2D, 0, e.internalFormat, t.pixelWidth, t.pixelHeight, 0, e.format, e.type, null);
2041
- let r = Math.max(t.pixelWidth >> 1, 1), i = Math.max(t.pixelHeight >> 1, 1);
2042
- for (let a = 1; a < t.mipLevelCount; a++) n.texImage2D(n.TEXTURE_2D, a, e.internalFormat, r, i, 0, e.format, e.type, null), r = Math.max(r >> 1, 1), i = Math.max(i >> 1, 1);
2043
- }
2044
- _initEmptyTexture2DArray(e, t) {
2045
- if (this._renderer.context.webGLVersion !== 2) throw Error("[GlTextureSystem] TEXTURE_2D_ARRAY requires WebGL2.");
2046
- let n = this._gl, r = Math.max(t.arrayLayerCount | 0, 1);
2047
- n.texImage3D(n.TEXTURE_2D_ARRAY, 0, e.internalFormat, t.pixelWidth, t.pixelHeight, r, 0, e.format, e.type, null);
2048
- let i = Math.max(t.pixelWidth >> 1, 1), a = Math.max(t.pixelHeight >> 1, 1);
2049
- for (let o = 1; o < t.mipLevelCount; o++) n.texImage3D(n.TEXTURE_2D_ARRAY, o, e.internalFormat, i, a, r, 0, e.format, e.type, null), i = Math.max(i >> 1, 1), a = Math.max(a >> 1, 1);
2050
- }
2051
- _initEmptyTextureCube(e, t) {
2052
- let n = this._gl;
2053
- for (let r = 0; r < 6; r++) n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + r, 0, e.internalFormat, t.pixelWidth, t.pixelHeight, 0, e.format, e.type, null);
2054
- let r = Math.max(t.pixelWidth >> 1, 1), i = Math.max(t.pixelHeight >> 1, 1);
2055
- for (let a = 1; a < t.mipLevelCount; a++) {
2056
- for (let t = 0; t < 6; t++) n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + t, a, e.internalFormat, r, i, 0, e.format, e.type, null);
2057
- r = Math.max(r >> 1, 1), i = Math.max(i >> 1, 1);
2058
- }
2059
- }
2060
- _applyMipRange(e, t) {
2061
- if (this._renderer.context.webGLVersion !== 2 || t.mipLevelCount <= 1) return;
2062
- let n = this._gl, r = Math.max((t.mipLevelCount | 0) - 1, 0);
2063
- n.texParameteri(e.target, n.TEXTURE_BASE_LEVEL, 0), n.texParameteri(e.target, n.TEXTURE_MAX_LEVEL, r);
2064
- }
2065
- _initSampler(e) {
2066
- let t = this._gl, n = this._gl.createSampler();
2067
- return this._glSamplers[e._resourceId] = n, ft(e, t, this._boundTextures[this._activeTextureLocation].mipLevelCount > 1, this._renderer.context.extensions.anisotropicFiltering, "samplerParameteri", n, !1, !0), this._glSamplers[e._resourceId];
2068
- }
2069
- _getGlSampler(e) {
2070
- return this._glSamplers[e._resourceId] || this._initSampler(e);
2071
- }
2072
- getGlSource(e) {
2073
- return e._gcLastUsed = this._renderer.gc.now, e._gpuData[this._renderer.uid] || this._initSource(e);
2074
- }
2075
- generateCanvas(e) {
2076
- let { pixels: t, width: n, height: r } = this.getPixels(e), i = a.get().createCanvas();
2077
- i.width = n, i.height = r;
2078
- let o = i.getContext("2d");
2079
- if (o) {
2080
- let e = o.createImageData(n, r);
2081
- e.data.set(t), o.putImageData(e, 0, 0);
2082
- }
2083
- return i;
2084
- }
2085
- getPixels(e) {
2086
- let t = e.source.resolution, n = e.frame, r = Math.max(Math.round(n.width * t), 1), i = Math.max(Math.round(n.height * t), 1), a = new Uint8Array(_t * r * i), o = this._renderer, s = o.renderTarget.getRenderTarget(e), c = o.renderTarget.getGpuRenderTarget(s), l = o.gl;
2087
- return l.bindFramebuffer(l.FRAMEBUFFER, c.resolveTargetFramebuffer), l.readPixels(Math.round(n.x * t), Math.round(n.y * t), r, i, l.RGBA, l.UNSIGNED_BYTE, a), {
2088
- pixels: new Uint8ClampedArray(a.buffer),
2089
- width: r,
2090
- height: i
2091
- };
2092
- }
2093
- destroy() {
2094
- this._managedTextures.destroy(), this._glSamplers = null, this._boundTextures = null, this._boundSamplers = null, this._mapFormatToInternalFormat = null, this._mapFormatToType = null, this._mapFormatToFormat = null, this._uploads = null, this._renderer = null;
2095
- }
2096
- resetState() {
2097
- this._activeTextureLocation = -1, this._boundTextures.fill(g.EMPTY.source), this._boundSamplers = /* @__PURE__ */ Object.create(null);
2098
- let e = this._gl;
2099
- this._premultiplyAlpha = !1, e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this._premultiplyAlpha);
2100
- }
2101
- };
2102
- Q.extension = {
2103
- type: [m.WebGLSystem],
2104
- name: "texture"
2105
- }, Q.uploadExtensions = /* @__PURE__ */ Object.create(null);
2106
- var vt = Q;
2107
- d.handleByMap(m.TextureUploaderWebGL, vt.uploadExtensions);
2108
- //#endregion
2109
- //#region node_modules/.pnpm/pixi.js@8.19.0/node_modules/pixi.js/lib/rendering/renderers/gl/WebGLRenderer.mjs
2110
- var yt = /* @__PURE__ */ e({ WebGLRenderer: () => Tt }), bt = [
2111
- ...ae,
2112
- R,
2113
- Te,
2114
- be,
2115
- F,
2116
- T,
2117
- vt,
2118
- z,
2119
- j,
2120
- Y,
2121
- J,
2122
- P,
2123
- Xe,
2124
- I,
2125
- N
2126
- ], xt = [...re], St = [
2127
- C,
2128
- S,
2129
- ve
2130
- ], Ct = [], $ = [], wt = [];
2131
- d.handleByNamedList(m.WebGLSystem, Ct), d.handleByNamedList(m.WebGLPipes, $), d.handleByNamedList(m.WebGLPipesAdaptor, wt), d.add(...bt, ...xt, ...St);
2132
- var Tt = class extends ie {
2133
- constructor() {
2134
- let e = {
2135
- name: "webgl",
2136
- type: s.WEBGL,
2137
- systems: Ct,
2138
- renderPipes: $,
2139
- renderPipeAdaptors: wt
2140
- };
2141
- super(e);
2142
- }
2143
- };
2144
- //#endregion
2145
- export { yt as t };