@micjanic/recursive-grid 1.0.2 → 1.0.4

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.
@@ -1,6 +1,6 @@
1
- import { F as Ge, u as De, l as se, M as v, G as Ee, v as Oe, S as Fe, x as ae, E as u, e as E, y as S, z as Le, H as O, I as b, R as F, J as ne, K as He, t as m, b as f, i as B, w as L, L as Y, N as ze, c as J, B as k, j as U, O as M, k as T, Q as w, V as We, a as Ve, W as ie, X as oe, Y as le, Z as ue, C as P, _ as Ne, $ as A, D as H, a0 as je, P as $e, d as qe, T as X, a1 as Q, a2 as Ke, a3 as Ye, a4 as Je } from "./PixiApp-D4xu0PT4.js";
2
- import { B as de, c as Xe } from "./colorToUniform-C2jGzNe1.js";
3
- var Qe = `in vec2 vMaskCoord;
1
+ import { F as Ee, u as De, l as ae, M as v, v as Oe, x as Fe, S as Le, y as ne, E as u, e as D, z as S, H as He, I as O, J as b, R as F, K as ie, L as ze, t as m, b as f, i as B, w as L, N as Y, O as We, c as J, B as k, j as U, G as Ve, Q as M, k as T, V as w, W as Ne, a as je, X as oe, Y as le, Z as ue, _ as de, C as P, $ as $e, a0 as A, a1 as X, D as H, a2 as qe, P as Ke, d as Ye, T as Q, a3 as Z, a4 as Je, a5 as Xe, a6 as Qe } from "./PixiApp-BHmY2ZMg.js";
2
+ import { B as ce, c as Ze } from "./colorToUniform-C2jGzNe1.js";
3
+ var et = `in vec2 vMaskCoord;
4
4
  in vec2 vTextureCoord;
5
5
 
6
6
  uniform sampler2D uTexture;
@@ -34,7 +34,7 @@ void main(void)
34
34
 
35
35
  finalColor = original * a;
36
36
  }
37
- `, Ze = `in vec2 aPosition;
37
+ `, tt = `in vec2 aPosition;
38
38
 
39
39
  out vec2 vTextureCoord;
40
40
  out vec2 vMaskCoord;
@@ -71,7 +71,7 @@ void main(void)
71
71
  vTextureCoord = filterTextureCoord(aPosition);
72
72
  vMaskCoord = getFilterCoord(aPosition);
73
73
  }
74
- `, Z = `struct GlobalFilterUniforms {
74
+ `, ee = `struct GlobalFilterUniforms {
75
75
  uInputSize:vec4<f32>,
76
76
  uInputPixel:vec4<f32>,
77
77
  uInputClamp:vec4<f32>,
@@ -170,25 +170,25 @@ fn mainFragment(
170
170
  return source * a;
171
171
  }
172
172
  `;
173
- class et extends Ge {
173
+ class rt extends Ee {
174
174
  constructor(e) {
175
- const { sprite: t, ...r } = e, s = new De(t.texture), n = new se({
175
+ const { sprite: t, ...r } = e, s = new De(t.texture), n = new ae({
176
176
  uFilterMatrix: { value: new v(), type: "mat3x3<f32>" },
177
177
  uMaskClamp: { value: s.uClampFrame, type: "vec4<f32>" },
178
178
  uAlpha: { value: 1, type: "f32" },
179
179
  uInverse: { value: e.inverse ? 1 : 0, type: "f32" }
180
- }), i = Ee.from({
180
+ }), i = Oe.from({
181
181
  vertex: {
182
- source: Z,
182
+ source: ee,
183
183
  entryPoint: "mainVertex"
184
184
  },
185
185
  fragment: {
186
- source: Z,
186
+ source: ee,
187
187
  entryPoint: "mainFragment"
188
188
  }
189
- }), o = Oe.from({
190
- vertex: Ze,
191
- fragment: Qe,
189
+ }), o = Fe.from({
190
+ vertex: tt,
191
+ fragment: et,
192
192
  name: "mask-filter"
193
193
  });
194
194
  super({
@@ -215,17 +215,17 @@ class et extends Ge {
215
215
  ).prepend(this._textureMatrix.mapCoord), this.resources.uMaskTexture = this.sprite.texture.source, e.applyFilter(this, t, r, s);
216
216
  }
217
217
  }
218
- const z = class ce {
218
+ const z = class he {
219
219
  constructor(e, t) {
220
220
  var r, s;
221
- this.state = Fe.for2d(), this._batchersByInstructionSet = /* @__PURE__ */ Object.create(null), this._activeBatches = /* @__PURE__ */ Object.create(null), this.renderer = e, this._adaptor = t, (s = (r = this._adaptor).init) == null || s.call(r, this);
221
+ this.state = Le.for2d(), this._batchersByInstructionSet = /* @__PURE__ */ Object.create(null), this._activeBatches = /* @__PURE__ */ Object.create(null), this.renderer = e, this._adaptor = t, (s = (r = this._adaptor).init) == null || s.call(r, this);
222
222
  }
223
223
  static getBatcher(e) {
224
224
  return new this._availableBatchers[e]();
225
225
  }
226
226
  buildStart(e) {
227
227
  let t = this._batchersByInstructionSet[e.uid];
228
- t || (t = this._batchersByInstructionSet[e.uid] = /* @__PURE__ */ Object.create(null), t.default || (t.default = new ae({
228
+ t || (t = this._batchersByInstructionSet[e.uid] = /* @__PURE__ */ Object.create(null), t.default || (t.default = new ne({
229
229
  maxTextures: this.renderer.limits.maxBatchableTextures
230
230
  }))), this._activeBatches = t, this._activeBatch = this._activeBatches.default;
231
231
  for (const r in this._activeBatches)
@@ -235,7 +235,7 @@ const z = class ce {
235
235
  if (this._activeBatch.name !== e.batcherName) {
236
236
  this._activeBatch.break(t);
237
237
  let r = this._activeBatches[e.batcherName];
238
- r || (r = this._activeBatches[e.batcherName] = ce.getBatcher(e.batcherName), r.begin()), this._activeBatch = r;
238
+ r || (r = this._activeBatches[e.batcherName] = he.getBatcher(e.batcherName), r.begin()), this._activeBatch = r;
239
239
  }
240
240
  this._activeBatch.add(e);
241
241
  }
@@ -280,10 +280,10 @@ z.extension = {
280
280
  name: "batch"
281
281
  };
282
282
  z._availableBatchers = /* @__PURE__ */ Object.create(null);
283
- let he = z;
284
- E.handleByMap(u.Batcher, he._availableBatchers);
285
- E.add(ae);
286
- const Pt = {
283
+ let fe = z;
284
+ D.handleByMap(u.Batcher, fe._availableBatchers);
285
+ D.add(ne);
286
+ const Bt = {
287
287
  name: "texture-bit",
288
288
  vertex: {
289
289
  header: (
@@ -321,7 +321,7 @@ const Pt = {
321
321
  `
322
322
  )
323
323
  }
324
- }, Rt = {
324
+ }, Ut = {
325
325
  name: "texture-bit",
326
326
  vertex: {
327
327
  header: (
@@ -353,11 +353,11 @@ const Pt = {
353
353
  `
354
354
  )
355
355
  }
356
- }, tt = new O();
357
- class rt extends ne {
356
+ }, st = new O();
357
+ class at extends ie {
358
358
  constructor() {
359
- super(), this.filters = [new et({
360
- sprite: new He(m.EMPTY),
359
+ super(), this.filters = [new rt({
360
+ sprite: new ze(m.EMPTY),
361
361
  inverse: !1,
362
362
  resolution: "inherit",
363
363
  antialias: "inherit"
@@ -376,7 +376,7 @@ class rt extends ne {
376
376
  this.filters[0].inverse = e;
377
377
  }
378
378
  }
379
- class fe {
379
+ class pe {
380
380
  constructor(e) {
381
381
  this._activeMaskStage = [], this._renderer = e;
382
382
  }
@@ -418,10 +418,10 @@ class fe {
418
418
  execute(e) {
419
419
  const t = this._renderer, r = e.mask.renderMaskToTexture;
420
420
  if (e.action === "pushMaskBegin") {
421
- const s = S.get(rt);
421
+ const s = S.get(at);
422
422
  if (s.inverse = e.inverse, r) {
423
423
  e.mask.mask.measurable = !0;
424
- const n = Le(e.mask.mask, !0, tt);
424
+ const n = He(e.mask.mask, !0, st);
425
425
  e.mask.mask.measurable = !1, n.ceil();
426
426
  const i = t.renderTarget.renderTarget.colorTexture.source, o = b.getOptimalTexture(
427
427
  n.width,
@@ -463,7 +463,7 @@ class fe {
463
463
  this._renderer = null, this._activeMaskStage = null;
464
464
  }
465
465
  }
466
- fe.extension = {
466
+ pe.extension = {
467
467
  type: [
468
468
  u.WebGLPipes,
469
469
  u.WebGPUPipes,
@@ -471,7 +471,7 @@ fe.extension = {
471
471
  ],
472
472
  name: "alphaMask"
473
473
  };
474
- class pe {
474
+ class me {
475
475
  constructor(e) {
476
476
  this._colorStack = [], this._colorStackIndex = 0, this._currentColor = 0, this._renderer = e;
477
477
  }
@@ -504,10 +504,10 @@ class pe {
504
504
  this._renderer.colorMask.setMask(e.colorMask);
505
505
  }
506
506
  destroy() {
507
- this._colorStack = null;
507
+ this._renderer = null, this._colorStack = null;
508
508
  }
509
509
  }
510
- pe.extension = {
510
+ me.extension = {
511
511
  type: [
512
512
  u.WebGLPipes,
513
513
  u.WebGPUPipes,
@@ -515,7 +515,7 @@ pe.extension = {
515
515
  ],
516
516
  name: "colorMask"
517
517
  };
518
- class me {
518
+ class ve {
519
519
  constructor(e) {
520
520
  this._maskStackHash = {}, this._maskHash = /* @__PURE__ */ new WeakMap(), this._renderer = e;
521
521
  }
@@ -578,7 +578,7 @@ class me {
578
578
  this._renderer = null, this._maskStackHash = null, this._maskHash = null;
579
579
  }
580
580
  }
581
- me.extension = {
581
+ ve.extension = {
582
582
  type: [
583
583
  u.WebGLPipes,
584
584
  u.WebGPUPipes,
@@ -586,14 +586,14 @@ me.extension = {
586
586
  ],
587
587
  name: "stencilMask"
588
588
  };
589
- function Bt(a, e) {
589
+ function At(a, e) {
590
590
  for (const t in a.attributes) {
591
591
  const r = a.attributes[t], s = e[t];
592
592
  s ? (r.format ?? (r.format = s.format), r.offset ?? (r.offset = s.offset), r.instance ?? (r.instance = s.instance)) : L(`Attribute ${t} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`);
593
593
  }
594
- st(a);
594
+ nt(a);
595
595
  }
596
- function st(a) {
596
+ function nt(a) {
597
597
  const { buffers: e, attributes: t } = a, r = {}, s = {};
598
598
  for (const n in e) {
599
599
  const i = e[n];
@@ -608,13 +608,13 @@ function st(a) {
608
608
  i.stride ?? (i.stride = r[i.buffer.uid]), i.start ?? (i.start = s[i.buffer.uid]), s[i.buffer.uid] += Y(i.format).stride;
609
609
  }
610
610
  }
611
- const g = [];
612
- g[f.NONE] = void 0;
613
- g[f.DISABLED] = {
611
+ const _ = [];
612
+ _[f.NONE] = void 0;
613
+ _[f.DISABLED] = {
614
614
  stencilWriteMask: 0,
615
615
  stencilReadMask: 0
616
616
  };
617
- g[f.RENDERING_MASK_ADD] = {
617
+ _[f.RENDERING_MASK_ADD] = {
618
618
  stencilFront: {
619
619
  compare: "equal",
620
620
  passOp: "increment-clamp"
@@ -624,7 +624,7 @@ g[f.RENDERING_MASK_ADD] = {
624
624
  passOp: "increment-clamp"
625
625
  }
626
626
  };
627
- g[f.RENDERING_MASK_REMOVE] = {
627
+ _[f.RENDERING_MASK_REMOVE] = {
628
628
  stencilFront: {
629
629
  compare: "equal",
630
630
  passOp: "decrement-clamp"
@@ -634,7 +634,7 @@ g[f.RENDERING_MASK_REMOVE] = {
634
634
  passOp: "decrement-clamp"
635
635
  }
636
636
  };
637
- g[f.MASK_ACTIVE] = {
637
+ _[f.MASK_ACTIVE] = {
638
638
  stencilWriteMask: 0,
639
639
  stencilFront: {
640
640
  compare: "equal",
@@ -645,7 +645,7 @@ g[f.MASK_ACTIVE] = {
645
645
  passOp: "keep"
646
646
  }
647
647
  };
648
- g[f.INVERSE_MASK_ACTIVE] = {
648
+ _[f.INVERSE_MASK_ACTIVE] = {
649
649
  stencilWriteMask: 0,
650
650
  stencilFront: {
651
651
  compare: "not-equal",
@@ -656,7 +656,7 @@ g[f.INVERSE_MASK_ACTIVE] = {
656
656
  passOp: "keep"
657
657
  }
658
658
  };
659
- class Ut {
659
+ class It {
660
660
  constructor(e) {
661
661
  this._syncFunctionHash = /* @__PURE__ */ Object.create(null), this._adaptor = e, this._systemCheck();
662
662
  }
@@ -666,7 +666,7 @@ class Ut {
666
666
  * @private
667
667
  */
668
668
  _systemCheck() {
669
- if (!ze())
669
+ if (!We())
670
670
  throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.");
671
671
  }
672
672
  ensureUniformGroup(e) {
@@ -822,7 +822,7 @@ const C = [
822
822
  `
823
823
  }
824
824
  ];
825
- function At(a, e, t, r) {
825
+ function Gt(a, e, t, r) {
826
826
  const s = [`
827
827
  var v = null;
828
828
  var v2 = null;
@@ -870,14 +870,14 @@ function At(a, e, t, r) {
870
870
  i
871
871
  );
872
872
  }
873
- function x(a, e) {
873
+ function g(a, e) {
874
874
  return `
875
875
  for (let i = 0; i < ${a * e}; i++) {
876
876
  data[offset + (((i / ${a})|0) * 4) + (i % ${a})] = v[i];
877
877
  }
878
878
  `;
879
879
  }
880
- const at = {
880
+ const it = {
881
881
  f32: `
882
882
  data[offset] = v;`,
883
883
  i32: `
@@ -925,14 +925,14 @@ const at = {
925
925
  for (let i = 0; i < 16; i++) {
926
926
  data[offset + i] = v[i];
927
927
  }`,
928
- "mat3x2<f32>": x(3, 2),
929
- "mat4x2<f32>": x(4, 2),
930
- "mat2x3<f32>": x(2, 3),
931
- "mat4x3<f32>": x(4, 3),
932
- "mat2x4<f32>": x(2, 4),
933
- "mat3x4<f32>": x(3, 4)
934
- }, It = {
935
- ...at,
928
+ "mat3x2<f32>": g(3, 2),
929
+ "mat4x2<f32>": g(4, 2),
930
+ "mat2x3<f32>": g(2, 3),
931
+ "mat4x3<f32>": g(4, 3),
932
+ "mat2x4<f32>": g(2, 4),
933
+ "mat3x4<f32>": g(3, 4)
934
+ }, Et = {
935
+ ...it,
936
936
  "mat2x2<f32>": `
937
937
  data[offset] = v[0];
938
938
  data[offset + 1] = v[1];
@@ -940,35 +940,36 @@ const at = {
940
940
  data[offset + 3] = v[3];
941
941
  `
942
942
  };
943
- function nt(a, e, t, r, s, n) {
943
+ function ot(a, e, t, r, s, n) {
944
944
  const i = n ? 1 : -1;
945
945
  return a.identity(), a.a = 1 / r * 2, a.d = i * (1 / s * 2), a.tx = -1 - e * a.a, a.ty = -i - t * a.d, a;
946
946
  }
947
- const _ = /* @__PURE__ */ new Map();
948
- function ve(a, e) {
949
- if (!_.has(a)) {
947
+ const x = /* @__PURE__ */ new Map();
948
+ Ve.register(x);
949
+ function ge(a, e) {
950
+ if (!x.has(a)) {
950
951
  const t = new m({
951
952
  source: new U({
952
953
  resource: a,
953
954
  ...e
954
955
  })
955
956
  }), r = () => {
956
- _.get(a) === t && _.delete(a);
957
+ x.get(a) === t && x.delete(a);
957
958
  };
958
- t.once("destroy", r), t.source.once("destroy", r), _.set(a, t);
959
+ t.once("destroy", r), t.source.once("destroy", r), x.set(a, t);
959
960
  }
960
- return _.get(a);
961
+ return x.get(a);
961
962
  }
962
- function it(a) {
963
+ function lt(a) {
963
964
  const e = a.colorTexture.source.resource;
964
965
  return globalThis.HTMLCanvasElement && e instanceof HTMLCanvasElement && document.body.contains(e);
965
966
  }
966
- const xe = class ge {
967
+ const xe = class _e {
967
968
  /**
968
969
  * @param [descriptor] - Options for creating a render target.
969
970
  */
970
971
  constructor(e = {}) {
971
- if (this.uid = M("renderTarget"), this.colorTextures = [], this.dirtyId = 0, this.isRoot = !1, this._size = new Float32Array(2), this._managedColorTextures = !1, e = { ...ge.defaultOptions, ...e }, this.stencil = e.stencil, this.depth = e.depth, this.isRoot = e.isRoot, typeof e.colorTextures == "number") {
972
+ if (this.uid = M("renderTarget"), this.colorTextures = [], this.dirtyId = 0, this.isRoot = !1, this._size = new Float32Array(2), this._managedColorTextures = !1, e = { ..._e.defaultOptions, ...e }, this.stencil = e.stencil, this.depth = e.depth, this.isRoot = e.isRoot, typeof e.colorTextures == "number") {
972
973
  this._managedColorTextures = !0;
973
974
  for (let t = 0; t < e.colorTextures; t++)
974
975
  this.colorTextures.push(
@@ -1059,9 +1060,9 @@ xe.defaultOptions = {
1059
1060
  isRoot: !1
1060
1061
  };
1061
1062
  let I = xe;
1062
- class Gt {
1063
+ class Dt {
1063
1064
  constructor(e) {
1064
- this.rootViewPort = new w(), this.viewport = new w(), this.onRenderTargetChange = new We("onRenderTargetChange"), this.projectionMatrix = new v(), this.defaultClearColor = [0, 0, 0, 0], this._renderSurfaceToRenderTargetHash = /* @__PURE__ */ new Map(), this._gpuRenderTargetHash = /* @__PURE__ */ Object.create(null), this._renderTargetStack = [], this._renderer = e, e.renderableGC.addManagedHash(this, "_gpuRenderTargetHash");
1065
+ this.rootViewPort = new w(), this.viewport = new w(), this.onRenderTargetChange = new Ne("onRenderTargetChange"), this.projectionMatrix = new v(), this.defaultClearColor = [0, 0, 0, 0], this._renderSurfaceToRenderTargetHash = /* @__PURE__ */ new Map(), this._gpuRenderTargetHash = /* @__PURE__ */ Object.create(null), this._renderTargetStack = [], this._renderer = e, e.renderableGC.addManagedHash(this, "_gpuRenderTargetHash");
1065
1066
  }
1066
1067
  /** called when dev wants to finish a render pass */
1067
1068
  finishRenderPass() {
@@ -1087,7 +1088,7 @@ class Gt {
1087
1088
  t,
1088
1089
  r,
1089
1090
  s
1090
- ), this.rootViewPort.copyFrom(this.viewport), this.rootRenderTarget = this.renderTarget, this.renderingToScreen = it(this.rootRenderTarget), (i = (n = this.adaptor).prerender) == null || i.call(n, this.rootRenderTarget);
1091
+ ), this.rootViewPort.copyFrom(this.viewport), this.rootRenderTarget = this.renderTarget, this.renderingToScreen = lt(this.rootRenderTarget), (i = (n = this.adaptor).prerender) == null || i.call(n, this.rootRenderTarget);
1091
1092
  }
1092
1093
  postrender() {
1093
1094
  var e, t;
@@ -1116,7 +1117,7 @@ class Gt {
1116
1117
  d.x = s.x * p + 0.5 | 0, d.y = s.y * p + 0.5 | 0, d.width = s.width * p + 0.5 | 0, d.height = s.height * p + 0.5 | 0;
1117
1118
  } else
1118
1119
  d.x = 0, d.y = 0, d.width = c, d.height = h;
1119
- return nt(
1120
+ return ot(
1120
1121
  this.projectionMatrix,
1121
1122
  0,
1122
1123
  0,
@@ -1231,7 +1232,7 @@ class Gt {
1231
1232
  }
1232
1233
  _initRenderTarget(e) {
1233
1234
  let t = null;
1234
- return U.test(e) && (e = ve(e).source), e instanceof I ? t = e : e instanceof T && (t = new I({
1235
+ return U.test(e) && (e = ge(e).source), e instanceof I ? t = e : e instanceof T && (t = new I({
1235
1236
  colorTextures: [e]
1236
1237
  }), e.source instanceof U && (t.isRoot = !0), e.once("destroy", () => {
1237
1238
  t.destroy(), this._renderSurfaceToRenderTargetHash.delete(e);
@@ -1246,7 +1247,7 @@ class Gt {
1246
1247
  this.renderTarget = null, this.renderSurface = null;
1247
1248
  }
1248
1249
  }
1249
- class Dt extends Ve {
1250
+ class Ot extends je {
1250
1251
  /**
1251
1252
  * Create a new Buffer Resource.
1252
1253
  * @param options - The options for the buffer resource
@@ -1271,7 +1272,7 @@ class Dt extends Ve {
1271
1272
  this.destroyed = !0, e && this.buffer.destroy(), this.emit("change", this), this.buffer = null;
1272
1273
  }
1273
1274
  }
1274
- class _e {
1275
+ class be {
1275
1276
  constructor(e) {
1276
1277
  this._renderer = e;
1277
1278
  }
@@ -1292,7 +1293,7 @@ class _e {
1292
1293
  this._renderer = null;
1293
1294
  }
1294
1295
  }
1295
- _e.extension = {
1296
+ be.extension = {
1296
1297
  type: [
1297
1298
  u.WebGLPipes,
1298
1299
  u.WebGPUPipes,
@@ -1307,8 +1308,8 @@ function G(a, e) {
1307
1308
  e[n.renderPipeId].execute(n);
1308
1309
  }
1309
1310
  }
1310
- const ot = new v();
1311
- class be {
1311
+ const ut = new v();
1312
+ class Te {
1312
1313
  constructor(e) {
1313
1314
  this._renderer = e;
1314
1315
  }
@@ -1325,19 +1326,20 @@ class be {
1325
1326
  this._renderer.renderPipes.batch.break(t), e._batchableRenderGroup && (S.return(e._batchableRenderGroup), e._batchableRenderGroup = null), t.add(e);
1326
1327
  }
1327
1328
  _addRenderableCacheAsTexture(e, t) {
1328
- const r = e._batchableRenderGroup ?? (e._batchableRenderGroup = S.get(de));
1329
- r.renderable = e.root, r.transform = e.root.relativeGroupTransform, r.texture = e.texture, r.bounds = e._textureBounds, t.add(e), this._renderer.renderPipes.batch.addToBatch(r, t);
1329
+ const r = e._batchableRenderGroup ?? (e._batchableRenderGroup = S.get(ce));
1330
+ r.renderable = e.root, r.transform = e.root.relativeGroupTransform, r.texture = e.texture, r.bounds = e._textureBounds, t.add(e), this._renderer.renderPipes.blendMode.pushBlendMode(e, e.root.groupBlendMode, t), this._renderer.renderPipes.batch.addToBatch(r, t), this._renderer.renderPipes.blendMode.popBlendMode(t);
1330
1331
  }
1331
1332
  _executeCacheAsTexture(e) {
1332
1333
  if (e.textureNeedsUpdate) {
1333
1334
  e.textureNeedsUpdate = !1;
1334
- const t = ot.identity().translate(
1335
+ const t = ut.identity().translate(
1335
1336
  -e._textureBounds.x,
1336
1337
  -e._textureBounds.y
1337
1338
  );
1338
1339
  this._renderer.renderTarget.push(e.texture, !0, null, e.texture.frame), this._renderer.globalUniforms.push({
1339
1340
  worldTransformMatrix: t,
1340
- worldColor: 4294967295
1341
+ worldColor: 4294967295,
1342
+ offset: { x: 0, y: 0 }
1341
1343
  }), G(e, this._renderer.renderPipes), this._renderer.renderTarget.finishRenderPass(), this._renderer.renderTarget.pop(), this._renderer.globalUniforms.pop();
1342
1344
  }
1343
1345
  e._batchableRenderGroup._batcher.updateElement(e._batchableRenderGroup), e._batchableRenderGroup._batcher.geometry.buffers[0].update();
@@ -1349,7 +1351,7 @@ class be {
1349
1351
  }), G(e, this._renderer.renderPipes), this._renderer.globalUniforms.pop();
1350
1352
  }
1351
1353
  }
1352
- be.extension = {
1354
+ Te.extension = {
1353
1355
  type: [
1354
1356
  u.WebGLPipes,
1355
1357
  u.WebGPUPipes,
@@ -1357,28 +1359,28 @@ be.extension = {
1357
1359
  ],
1358
1360
  name: "renderGroup"
1359
1361
  };
1360
- function D(a, e) {
1362
+ function E(a, e) {
1361
1363
  e || (e = 0);
1362
1364
  for (let t = e; t < a.length && a[t]; t++)
1363
1365
  a[t] = null;
1364
1366
  }
1365
- const lt = new P(), ee = oe | le | ue;
1366
- function Te(a, e = !1) {
1367
- ut(a);
1367
+ const dt = new P(), te = le | ue | de;
1368
+ function ye(a, e = !1) {
1369
+ ct(a);
1368
1370
  const t = a.childrenToUpdate, r = a.updateTick++;
1369
1371
  for (const s in t) {
1370
1372
  const n = Number(s), i = t[s], o = i.list, l = i.index;
1371
1373
  for (let d = 0; d < l; d++) {
1372
1374
  const c = o[d];
1373
- c.parentRenderGroup === a && c.relativeRenderGroupDepth === n && ye(c, r, 0);
1375
+ c.parentRenderGroup === a && c.relativeRenderGroupDepth === n && ke(c, r, 0);
1374
1376
  }
1375
- D(o, l), i.index = 0;
1377
+ E(o, l), i.index = 0;
1376
1378
  }
1377
1379
  if (e)
1378
1380
  for (let s = 0; s < a.renderGroupChildren.length; s++)
1379
- Te(a.renderGroupChildren[s], e);
1381
+ ye(a.renderGroupChildren[s], e);
1380
1382
  }
1381
- function ut(a) {
1383
+ function ct(a) {
1382
1384
  const e = a.root;
1383
1385
  let t;
1384
1386
  if (a.renderGroupParent) {
@@ -1386,7 +1388,7 @@ function ut(a) {
1386
1388
  a.worldTransform.appendFrom(
1387
1389
  e.relativeGroupTransform,
1388
1390
  r.worldTransform
1389
- ), a.worldColor = ie(
1391
+ ), a.worldColor = oe(
1390
1392
  e.groupColor,
1391
1393
  r.worldColor
1392
1394
  ), t = e.groupAlpha * r.worldAlpha;
@@ -1394,7 +1396,7 @@ function ut(a) {
1394
1396
  a.worldTransform.copyFrom(e.localTransform), a.worldColor = e.localColor, t = e.localAlpha;
1395
1397
  t = t < 0 ? 0 : t > 1 ? 1 : t, a.worldAlpha = t, a.worldColorAlpha = a.worldColor + ((t * 255 | 0) << 24);
1396
1398
  }
1397
- function ye(a, e, t) {
1399
+ function ke(a, e, t) {
1398
1400
  if (e === a.updateTick)
1399
1401
  return;
1400
1402
  a.updateTick = e, a.didChange = !1;
@@ -1404,46 +1406,45 @@ function ye(a, e, t) {
1404
1406
  if (s && !s.renderGroup ? (t |= a._updateFlags, a.relativeGroupTransform.appendFrom(
1405
1407
  r,
1406
1408
  s.relativeGroupTransform
1407
- ), t & ee && te(a, s, t)) : (t = a._updateFlags, a.relativeGroupTransform.copyFrom(r), t & ee && te(a, lt, t)), !a.renderGroup) {
1409
+ ), t & te && re(a, s, t)) : (t = a._updateFlags, a.relativeGroupTransform.copyFrom(r), t & te && re(a, dt, t)), !a.renderGroup) {
1408
1410
  const n = a.children, i = n.length;
1409
1411
  for (let d = 0; d < i; d++)
1410
- ye(n[d], e, t);
1412
+ ke(n[d], e, t);
1411
1413
  const o = a.parentRenderGroup, l = a;
1412
1414
  l.renderPipeId && !o.structureDidChange && o.updateRenderable(l);
1413
1415
  }
1414
1416
  }
1415
- function te(a, e, t) {
1416
- if (t & le) {
1417
- a.groupColor = ie(
1417
+ function re(a, e, t) {
1418
+ if (t & ue) {
1419
+ a.groupColor = oe(
1418
1420
  a.localColor,
1419
1421
  e.groupColor
1420
1422
  );
1421
1423
  let r = a.localAlpha * e.groupAlpha;
1422
1424
  r = r < 0 ? 0 : r > 1 ? 1 : r, a.groupAlpha = r, a.groupColorAlpha = a.groupColor + ((r * 255 | 0) << 24);
1423
1425
  }
1424
- t & ue && (a.groupBlendMode = a.localBlendMode === "inherit" ? e.groupBlendMode : a.localBlendMode), t & oe && (a.globalDisplayStatus = a.localDisplayStatus & e.globalDisplayStatus), a._updateFlags = 0;
1426
+ t & de && (a.groupBlendMode = a.localBlendMode === "inherit" ? e.groupBlendMode : a.localBlendMode), t & le && (a.globalDisplayStatus = a.localDisplayStatus & e.globalDisplayStatus), a._updateFlags = 0;
1425
1427
  }
1426
- function dt(a, e) {
1427
- const { list: t, index: r } = a.childrenRenderablesToUpdate;
1428
- let s = !1;
1429
- for (let n = 0; n < r; n++) {
1430
- const i = t[n];
1431
- if (s = e[i.renderPipeId].validateRenderable(i), s)
1428
+ function ht(a, e) {
1429
+ const { list: t } = a.childrenRenderablesToUpdate;
1430
+ let r = !1;
1431
+ for (let s = 0; s < a.childrenRenderablesToUpdate.index; s++) {
1432
+ const n = t[s];
1433
+ if (r = e[n.renderPipeId].validateRenderable(n), r)
1432
1434
  break;
1433
1435
  }
1434
- return a.structureDidChange = s, s;
1436
+ return a.structureDidChange = r, r;
1435
1437
  }
1436
- const ct = new v();
1437
- class ke {
1438
+ const ft = new v();
1439
+ class Ce {
1438
1440
  constructor(e) {
1439
1441
  this._renderer = e;
1440
1442
  }
1441
1443
  render({ container: e, transform: t }) {
1442
1444
  const r = e.parent, s = e.renderGroup.renderGroupParent;
1443
1445
  e.parent = null, e.renderGroup.renderGroupParent = null;
1444
- const n = this._renderer;
1445
- let i = ct;
1446
- t && (i = i.copyFrom(e.renderGroup.localTransform), e.renderGroup.localTransform.copyFrom(t));
1446
+ const n = this._renderer, i = ft;
1447
+ t && (i.copyFrom(e.renderGroup.localTransform), e.renderGroup.localTransform.copyFrom(t));
1447
1448
  const o = n.renderPipes;
1448
1449
  this._updateCachedRenderGroups(e.renderGroup, null), this._updateRenderGroups(e.renderGroup), n.globalUniforms.start({
1449
1450
  worldTransformMatrix: t ? e.renderGroup.localTransform : e.renderGroup.worldTransform,
@@ -1454,12 +1455,11 @@ class ke {
1454
1455
  this._renderer = null;
1455
1456
  }
1456
1457
  _updateCachedRenderGroups(e, t) {
1457
- if (e.isCachedAsTexture) {
1458
- if (!e.updateCacheTexture)
1458
+ if (e._parentCacheAsTextureRenderGroup = t, e.isCachedAsTexture) {
1459
+ if (!e.textureNeedsUpdate)
1459
1460
  return;
1460
1461
  t = e;
1461
1462
  }
1462
- e._parentCacheAsTextureRenderGroup = t;
1463
1463
  for (let r = e.renderGroupChildren.length - 1; r >= 0; r--)
1464
1464
  this._updateCachedRenderGroups(e.renderGroupChildren[r], t);
1465
1465
  if (e.invalidateMatrices(), e.isCachedAsTexture) {
@@ -1474,13 +1474,13 @@ class ke {
1474
1474
  i,
1475
1475
  o
1476
1476
  );
1477
- d._source.style = new Ne({ scaleMode: l }), e.texture = d, e._textureBounds || (e._textureBounds = new O()), e._textureBounds.copyFrom(r), s !== e.texture && e.renderGroupParent && (e.renderGroupParent.structureDidChange = !0);
1477
+ d._source.style = new $e({ scaleMode: l }), e.texture = d, e._textureBounds || (e._textureBounds = new O()), e._textureBounds.copyFrom(r), s !== e.texture && e.renderGroupParent && (e.renderGroupParent.structureDidChange = !0);
1478
1478
  }
1479
1479
  } else e.texture && (b.returnTexture(e.texture, !0), e.texture = null);
1480
1480
  }
1481
1481
  _updateRenderGroups(e) {
1482
1482
  const t = this._renderer, r = t.renderPipes;
1483
- if (e.runOnRender(t), e.instructionSet.renderPipes = r, e.structureDidChange ? D(e.childrenRenderablesToUpdate.list, 0) : dt(e, r), Te(e), e.structureDidChange ? (e.structureDidChange = !1, this._buildInstructions(e, t)) : this._updateRenderables(e), e.childrenRenderablesToUpdate.index = 0, t.renderPipes.batch.upload(e.instructionSet), !(e.isCachedAsTexture && !e.textureNeedsUpdate))
1483
+ if (e.runOnRender(t), e.instructionSet.renderPipes = r, e.structureDidChange ? E(e.childrenRenderablesToUpdate.list, 0) : ht(e, r), ye(e), e.structureDidChange ? (e.structureDidChange = !1, this._buildInstructions(e, t)) : this._updateRenderables(e), e.childrenRenderablesToUpdate.index = 0, t.renderPipes.batch.upload(e.instructionSet), !(e.isCachedAsTexture && !e.textureNeedsUpdate))
1484
1484
  for (let s = 0; s < e.renderGroupChildren.length; s++)
1485
1485
  this._updateRenderGroups(e.renderGroupChildren[s]);
1486
1486
  }
@@ -1490,7 +1490,7 @@ class ke {
1490
1490
  const n = t[s];
1491
1491
  n.didViewUpdate && e.updateRenderable(n);
1492
1492
  }
1493
- D(t, r);
1493
+ E(t, r);
1494
1494
  }
1495
1495
  _buildInstructions(e, t) {
1496
1496
  const r = e.root, s = e.instructionSet;
@@ -1499,7 +1499,7 @@ class ke {
1499
1499
  i.batch.buildStart(s), i.blendMode.buildStart(), i.colorMask.buildStart(), r.sortableChildren && r.sortChildren(), r.collectRenderablesWithEffects(s, n, null), i.batch.buildEnd(s), i.blendMode.buildEnd(s);
1500
1500
  }
1501
1501
  }
1502
- ke.extension = {
1502
+ Ce.extension = {
1503
1503
  type: [
1504
1504
  u.WebGLSystem,
1505
1505
  u.WebGPUSystem,
@@ -1507,7 +1507,7 @@ ke.extension = {
1507
1507
  ],
1508
1508
  name: "renderGroup"
1509
1509
  };
1510
- class Ce {
1510
+ class Me {
1511
1511
  constructor(e) {
1512
1512
  this._renderer = e;
1513
1513
  }
@@ -1533,14 +1533,14 @@ class Ce {
1533
1533
  return e._gpuData[this._renderer.uid] || this._initGPUSprite(e);
1534
1534
  }
1535
1535
  _initGPUSprite(e) {
1536
- const t = new de();
1536
+ const t = new ce();
1537
1537
  return t.renderable = e, t.transform = e.groupTransform, t.texture = e._texture, t.bounds = e.visualBounds, t.roundPixels = this._renderer._roundPixels | e._roundPixels, e._gpuData[this._renderer.uid] = t, t;
1538
1538
  }
1539
1539
  destroy() {
1540
1540
  this._renderer = null;
1541
1541
  }
1542
1542
  }
1543
- Ce.extension = {
1543
+ Me.extension = {
1544
1544
  type: [
1545
1545
  u.WebGLPipes,
1546
1546
  u.WebGPUPipes,
@@ -1548,7 +1548,7 @@ Ce.extension = {
1548
1548
  ],
1549
1549
  name: "sprite"
1550
1550
  };
1551
- const W = class Me {
1551
+ const W = class Se {
1552
1552
  constructor() {
1553
1553
  this.clearBeforeRender = !0, this._backgroundColor = new A(0), this.color = this._backgroundColor, this.alpha = 1;
1554
1554
  }
@@ -1557,7 +1557,7 @@ const W = class Me {
1557
1557
  * @param options - the options for the background colors
1558
1558
  */
1559
1559
  init(e) {
1560
- e = { ...Me.defaultOptions, ...e }, this.clearBeforeRender = e.clearBeforeRender, this.color = e.background || e.backgroundColor || this._backgroundColor, this.alpha = e.backgroundAlpha, this._backgroundColor.setAlpha(e.backgroundAlpha);
1560
+ e = { ...Se.defaultOptions, ...e }, this.clearBeforeRender = e.clearBeforeRender, this.color = e.background || e.backgroundColor || this._backgroundColor, this.alpha = e.backgroundAlpha, this._backgroundColor.setAlpha(e.backgroundAlpha);
1561
1561
  }
1562
1562
  /** The background color to fill if not transparent */
1563
1563
  get color() {
@@ -1612,55 +1612,80 @@ W.defaultOptions = {
1612
1612
  */
1613
1613
  clearBeforeRender: !0
1614
1614
  };
1615
- let ht = W;
1615
+ let pt = W;
1616
1616
  const y = {};
1617
- E.handle(u.BlendMode, (a) => {
1617
+ D.handle(u.BlendMode, (a) => {
1618
1618
  if (!a.name)
1619
1619
  throw new Error("BlendMode extension must have a name property");
1620
1620
  y[a.name] = a.ref;
1621
1621
  }, (a) => {
1622
1622
  delete y[a.name];
1623
1623
  });
1624
- class Se {
1624
+ class we {
1625
1625
  constructor(e) {
1626
- this._isAdvanced = !1, this._filterHash = /* @__PURE__ */ Object.create(null), this._renderer = e, this._renderer.runners.prerender.add(this);
1626
+ this._blendModeStack = [], this._isAdvanced = !1, this._filterHash = /* @__PURE__ */ Object.create(null), this._renderer = e, this._renderer.runners.prerender.add(this);
1627
1627
  }
1628
1628
  prerender() {
1629
1629
  this._activeBlendMode = "normal", this._isAdvanced = !1;
1630
1630
  }
1631
1631
  /**
1632
- * This ensures that a blendMode switch is added to the instruction set if the blend mode has changed.
1633
- * @param renderable - The renderable we are adding to the instruction set
1634
- * @param blendMode - The blend mode of the renderable
1635
- * @param instructionSet - The instruction set we are adding to
1632
+ * Push a blend mode onto the internal stack and apply it to the instruction set if needed.
1633
+ * @param renderable - The renderable or {@link RenderGroup} associated with the change.
1634
+ * @param blendMode - The blend mode to activate.
1635
+ * @param instructionSet - The instruction set being built.
1636
+ */
1637
+ pushBlendMode(e, t, r) {
1638
+ this._blendModeStack.push(t), this.setBlendMode(e, t, r);
1639
+ }
1640
+ /**
1641
+ * Pop the last blend mode from the stack and apply the new top-of-stack mode.
1642
+ * @param instructionSet - The instruction set being built.
1643
+ */
1644
+ popBlendMode(e) {
1645
+ this._blendModeStack.pop();
1646
+ const t = this._blendModeStack[this._activeBlendMode.length - 1] ?? "normal";
1647
+ this.setBlendMode(null, t, e);
1648
+ }
1649
+ /**
1650
+ * Ensure a blend mode switch is added to the instruction set when the mode changes.
1651
+ * If an advanced blend mode is active, subsequent renderables will be collected so they can be
1652
+ * rendered within a single filter pass.
1653
+ * @param renderable - The renderable or {@link RenderGroup} to associate with the change, or null when unwinding.
1654
+ * @param blendMode - The target blend mode.
1655
+ * @param instructionSet - The instruction set being built.
1636
1656
  */
1637
1657
  setBlendMode(e, t, r) {
1658
+ var n;
1659
+ const s = e instanceof X;
1638
1660
  if (this._activeBlendMode === t) {
1639
- this._isAdvanced && this._renderableList.push(e);
1661
+ this._isAdvanced && e && !s && ((n = this._renderableList) == null || n.push(e));
1640
1662
  return;
1641
1663
  }
1642
- this._activeBlendMode = t, this._isAdvanced && this._endAdvancedBlendMode(r), this._isAdvanced = !!y[t], this._isAdvanced && (this._beginAdvancedBlendMode(r), this._renderableList.push(e));
1664
+ this._isAdvanced && this._endAdvancedBlendMode(r), this._activeBlendMode = t, e && (this._isAdvanced = !!y[t], this._isAdvanced && this._beginAdvancedBlendMode(e, r));
1643
1665
  }
1644
- _beginAdvancedBlendMode(e) {
1645
- this._renderer.renderPipes.batch.break(e);
1646
- const t = this._activeBlendMode;
1647
- if (!y[t]) {
1648
- L(`Unable to assign BlendMode: '${t}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);
1666
+ _beginAdvancedBlendMode(e, t) {
1667
+ this._renderer.renderPipes.batch.break(t);
1668
+ const r = this._activeBlendMode;
1669
+ if (!y[r]) {
1670
+ L(`Unable to assign BlendMode: '${r}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);
1649
1671
  return;
1650
1672
  }
1651
- let r = this._filterHash[t];
1652
- r || (r = this._filterHash[t] = new ne(), r.filters = [new y[t]()]);
1653
- const s = {
1673
+ const s = this._ensureFilterEffect(r), n = e instanceof X, i = {
1654
1674
  renderPipeId: "filter",
1655
1675
  action: "pushFilter",
1656
- renderables: [],
1657
- filterEffect: r,
1676
+ filterEffect: s,
1677
+ renderables: n ? null : [e],
1678
+ container: n ? e.root : null,
1658
1679
  canBundle: !1
1659
1680
  };
1660
- this._renderableList = s.renderables, e.add(s);
1681
+ this._renderableList = i.renderables, t.add(i);
1682
+ }
1683
+ _ensureFilterEffect(e) {
1684
+ let t = this._filterHash[e];
1685
+ return t || (t = this._filterHash[e] = new ie(), t.filters = [new y[e]()]), t;
1661
1686
  }
1662
1687
  _endAdvancedBlendMode(e) {
1663
- this._renderableList = null, this._renderer.renderPipes.batch.break(e), e.add({
1688
+ this._isAdvanced = !1, this._renderableList = null, this._renderer.renderPipes.batch.break(e), e.add({
1664
1689
  renderPipeId: "filter",
1665
1690
  action: "popFilter",
1666
1691
  canBundle: !1
@@ -1690,7 +1715,7 @@ class Se {
1690
1715
  this._filterHash = null;
1691
1716
  }
1692
1717
  }
1693
- Se.extension = {
1718
+ we.extension = {
1694
1719
  type: [
1695
1720
  u.WebGLPipes,
1696
1721
  u.WebGPUPipes,
@@ -1702,7 +1727,7 @@ const R = {
1702
1727
  png: "image/png",
1703
1728
  jpg: "image/jpeg",
1704
1729
  webp: "image/webp"
1705
- }, V = class we {
1730
+ }, V = class Pe {
1706
1731
  /** @param renderer - The renderer this System works for. */
1707
1732
  constructor(e) {
1708
1733
  this._renderer = e;
@@ -1787,7 +1812,7 @@ const R = {
1787
1812
  async base64(e) {
1788
1813
  e = this._normalizeOptions(
1789
1814
  e,
1790
- we.defaultImageOptions
1815
+ Pe.defaultImageOptions
1791
1816
  );
1792
1817
  const { format: t, quality: r } = e, s = this.canvas(e);
1793
1818
  if (s.toBlob !== void 0)
@@ -2034,7 +2059,7 @@ V.defaultImageOptions = {
2034
2059
  format: "png",
2035
2060
  quality: 1
2036
2061
  };
2037
- let ft = V;
2062
+ let mt = V;
2038
2063
  class N extends m {
2039
2064
  static create(e) {
2040
2065
  return new N({
@@ -2052,8 +2077,8 @@ class N extends m {
2052
2077
  return this.source.resize(e, t, r), this;
2053
2078
  }
2054
2079
  }
2055
- const pt = new w(), mt = new O(), vt = [0, 0, 0, 0];
2056
- class Pe {
2080
+ const vt = new w(), gt = new O(), xt = [0, 0, 0, 0];
2081
+ class Re {
2057
2082
  constructor(e) {
2058
2083
  this._renderer = e;
2059
2084
  }
@@ -2103,8 +2128,8 @@ class Pe {
2103
2128
  });
2104
2129
  const t = e.resolution || this._renderer.resolution, r = e.antialias || this._renderer.view.antialias, s = e.target;
2105
2130
  let n = e.clearColor;
2106
- n ? n = Array.isArray(n) && n.length === 4 ? n : A.shared.setValue(n).toArray() : n = vt;
2107
- const i = ((d = e.frame) == null ? void 0 : d.copyTo(pt)) || je(s, mt).rectangle;
2131
+ n ? n = Array.isArray(n) && n.length === 4 ? n : A.shared.setValue(n).toArray() : n = xt;
2132
+ const i = ((d = e.frame) == null ? void 0 : d.copyTo(vt)) || qe(s, gt).rectangle;
2108
2133
  i.width = Math.max(i.width, 1 / t) | 0, i.height = Math.max(i.height, 1 / t) | 0;
2109
2134
  const o = N.create({
2110
2135
  ...e.textureSourceOptions,
@@ -2124,14 +2149,14 @@ class Pe {
2124
2149
  this._renderer = null;
2125
2150
  }
2126
2151
  }
2127
- Pe.extension = {
2152
+ Re.extension = {
2128
2153
  type: [
2129
2154
  u.WebGLSystem,
2130
2155
  u.WebGPUSystem
2131
2156
  ],
2132
2157
  name: "textureGenerator"
2133
2158
  };
2134
- class Re {
2159
+ class Be {
2135
2160
  constructor(e) {
2136
2161
  this._stackIndex = 0, this._globalUniformDataStack = [], this._uniformsPool = [], this._activeUniforms = [], this._bindGroupPool = [], this._activeBindGroups = [], this._renderer = e;
2137
2162
  }
@@ -2156,7 +2181,7 @@ class Re {
2156
2181
  const i = this._renderer.renderTarget.renderTarget, o = this._stackIndex ? this._globalUniformDataStack[this._stackIndex - 1] : {
2157
2182
  worldTransformMatrix: new v(),
2158
2183
  worldColor: 4294967295,
2159
- offset: new $e()
2184
+ offset: new Ke()
2160
2185
  }, l = {
2161
2186
  projectionMatrix: t || this._renderer.renderTarget.projectionMatrix,
2162
2187
  resolution: e || i.size,
@@ -2167,13 +2192,13 @@ class Re {
2167
2192
  }, d = this._uniformsPool.pop() || this._createUniforms();
2168
2193
  this._activeUniforms.push(d);
2169
2194
  const c = d.uniforms;
2170
- c.uProjectionMatrix = l.projectionMatrix, c.uResolution = l.resolution, c.uWorldTransformMatrix.copyFrom(l.worldTransformMatrix), c.uWorldTransformMatrix.tx -= l.offset.x, c.uWorldTransformMatrix.ty -= l.offset.y, Xe(
2195
+ c.uProjectionMatrix = l.projectionMatrix, c.uResolution = l.resolution, c.uWorldTransformMatrix.copyFrom(l.worldTransformMatrix), c.uWorldTransformMatrix.tx -= l.offset.x, c.uWorldTransformMatrix.ty -= l.offset.y, Ze(
2171
2196
  l.worldColor,
2172
2197
  c.uWorldColorAlpha,
2173
2198
  0
2174
2199
  ), d.update();
2175
2200
  let h;
2176
- this._renderer.renderPipes.uniformBatch ? h = this._renderer.renderPipes.uniformBatch.getUniformBindGroup(d, !1) : (h = this._bindGroupPool.pop() || new qe(), this._activeBindGroups.push(h), h.setResource(d, 0)), l.bindGroup = h, this._currentGlobalUniformData = l;
2201
+ this._renderer.renderPipes.uniformBatch ? h = this._renderer.renderPipes.uniformBatch.getUniformBindGroup(d, !1) : (h = this._bindGroupPool.pop() || new Ye(), this._activeBindGroups.push(h), h.setResource(d, 0)), l.bindGroup = h, this._currentGlobalUniformData = l;
2177
2202
  }
2178
2203
  push(e) {
2179
2204
  this.bind(e), this._globalUniformDataStack[this._stackIndex++] = this._currentGlobalUniformData;
@@ -2191,7 +2216,7 @@ class Re {
2191
2216
  return this._currentGlobalUniformData.bindGroup.resources[0];
2192
2217
  }
2193
2218
  _createUniforms() {
2194
- return new se({
2219
+ return new ae({
2195
2220
  uProjectionMatrix: { value: new v(), type: "mat3x3<f32>" },
2196
2221
  uWorldTransformMatrix: { value: new v(), type: "mat3x3<f32>" },
2197
2222
  // TODO - someone smart - set this to be a unorm8x4 rather than a vec4<f32>
@@ -2202,10 +2227,10 @@ class Re {
2202
2227
  });
2203
2228
  }
2204
2229
  destroy() {
2205
- this._renderer = null;
2230
+ this._renderer = null, this._globalUniformDataStack.length = 0, this._uniformsPool.length = 0, this._activeUniforms.length = 0, this._bindGroupPool.length = 0, this._activeBindGroups.length = 0, this._currentGlobalUniformData = null;
2206
2231
  }
2207
2232
  }
2208
- Re.extension = {
2233
+ Be.extension = {
2209
2234
  type: [
2210
2235
  u.WebGLSystem,
2211
2236
  u.WebGPUSystem,
@@ -2213,14 +2238,14 @@ Re.extension = {
2213
2238
  ],
2214
2239
  name: "globalUniforms"
2215
2240
  };
2216
- let xt = 1;
2217
- class Be {
2241
+ let _t = 1;
2242
+ class Ue {
2218
2243
  constructor() {
2219
2244
  this._tasks = [], this._offset = 0;
2220
2245
  }
2221
2246
  /** Initializes the scheduler system and starts the ticker. */
2222
2247
  init() {
2223
- X.system.add(this._update, this);
2248
+ Q.system.add(this._update, this);
2224
2249
  }
2225
2250
  /**
2226
2251
  * Schedules a repeating task.
@@ -2230,7 +2255,7 @@ class Be {
2230
2255
  * @returns The unique identifier for the scheduled task.
2231
2256
  */
2232
2257
  repeat(e, t, r = !0) {
2233
- const s = xt++;
2258
+ const s = _t++;
2234
2259
  let n = 0;
2235
2260
  return r && (this._offset += 1e3, n = this._offset), this._tasks.push({
2236
2261
  func: e,
@@ -2272,10 +2297,10 @@ class Be {
2272
2297
  * @internal
2273
2298
  */
2274
2299
  destroy() {
2275
- X.system.remove(this._update, this), this._tasks.length = 0;
2300
+ Q.system.remove(this._update, this), this._tasks.length = 0;
2276
2301
  }
2277
2302
  }
2278
- Be.extension = {
2303
+ Ue.extension = {
2279
2304
  type: [
2280
2305
  u.WebGLSystem,
2281
2306
  u.WebGPUSystem,
@@ -2284,12 +2309,12 @@ Be.extension = {
2284
2309
  name: "scheduler",
2285
2310
  priority: 0
2286
2311
  };
2287
- let re = !1;
2288
- function gt(a) {
2289
- if (!re) {
2312
+ let se = !1;
2313
+ function bt(a) {
2314
+ if (!se) {
2290
2315
  if (H.get().getNavigator().userAgent.toLowerCase().indexOf("chrome") > -1) {
2291
2316
  const e = [
2292
- `%c %c %c %c %c PixiJS %c v${Q} (${a}) http://www.pixijs.com/
2317
+ `%c %c %c %c %c PixiJS %c v${Z} (${a}) http://www.pixijs.com/
2293
2318
 
2294
2319
  `,
2295
2320
  "background: #E72264; padding:5px 0;",
@@ -2300,8 +2325,8 @@ function gt(a) {
2300
2325
  "color: #E72264; background: #FFFFFF; padding:5px 0;"
2301
2326
  ];
2302
2327
  globalThis.console.log(...e);
2303
- } else globalThis.console && globalThis.console.log(`PixiJS ${Q} - ${a} - http://www.pixijs.com/`);
2304
- re = !0;
2328
+ } else globalThis.console && globalThis.console.log(`PixiJS ${Z} - ${a} - http://www.pixijs.com/`);
2329
+ se = !0;
2305
2330
  }
2306
2331
  }
2307
2332
  class j {
@@ -2315,7 +2340,7 @@ class j {
2315
2340
  init(e) {
2316
2341
  if (e.hello) {
2317
2342
  let t = this._renderer.name;
2318
- this._renderer.type === F.WEBGL && (t += ` ${this._renderer.context.webGLVersion}`), gt(t);
2343
+ this._renderer.type === F.WEBGL && (t += ` ${this._renderer.context.webGLVersion}`), bt(t);
2319
2344
  }
2320
2345
  }
2321
2346
  }
@@ -2332,7 +2357,7 @@ j.defaultOptions = {
2332
2357
  /** {@link WebGLOptions.hello} */
2333
2358
  hello: !1
2334
2359
  };
2335
- function _t(a) {
2360
+ function Tt(a) {
2336
2361
  let e = !1;
2337
2362
  for (const r in a)
2338
2363
  if (a[r] == null) {
@@ -2348,14 +2373,14 @@ function _t(a) {
2348
2373
  }
2349
2374
  return t;
2350
2375
  }
2351
- function bt(a) {
2376
+ function yt(a) {
2352
2377
  let e = 0;
2353
2378
  for (let t = 0; t < a.length; t++)
2354
2379
  a[t] == null ? e++ : a[t - e] = a[t];
2355
2380
  return a.length -= e, a;
2356
2381
  }
2357
- let Tt = 0;
2358
- const $ = class Ue {
2382
+ let kt = 0;
2383
+ const $ = class Ae {
2359
2384
  /**
2360
2385
  * Creates a new RenderableGCSystem instance.
2361
2386
  * @param renderer - The renderer this garbage collection system works for
@@ -2368,7 +2393,7 @@ const $ = class Ue {
2368
2393
  * @param options - Configuration options for the renderer
2369
2394
  */
2370
2395
  init(e) {
2371
- e = { ...Ue.defaultOptions, ...e }, this.maxUnusedTime = e.renderableGCMaxUnusedTime, this._frequency = e.renderableGCFrequency, this.enabled = e.renderableGCActive;
2396
+ e = { ...Ae.defaultOptions, ...e }, this.maxUnusedTime = e.renderableGCMaxUnusedTime, this._frequency = e.renderableGCFrequency, this.enabled = e.renderableGCActive;
2372
2397
  }
2373
2398
  /**
2374
2399
  * Gets whether the garbage collection system is currently enabled.
@@ -2390,13 +2415,13 @@ const $ = class Ue {
2390
2415
  ), this._hashHandler = this._renderer.scheduler.repeat(
2391
2416
  () => {
2392
2417
  for (const t of this._managedHashes)
2393
- t.context[t.hash] = _t(t.context[t.hash]);
2418
+ t.context[t.hash] = Tt(t.context[t.hash]);
2394
2419
  },
2395
2420
  this._frequency
2396
2421
  ), this._arrayHandler = this._renderer.scheduler.repeat(
2397
2422
  () => {
2398
2423
  for (const t of this._managedArrays)
2399
- bt(t.context[t.hash]);
2424
+ yt(t.context[t.hash]);
2400
2425
  },
2401
2426
  this._frequency
2402
2427
  )) : (this._renderer.scheduler.cancel(this._handler), this._renderer.scheduler.cancel(this._hashHandler), this._renderer.scheduler.cancel(this._arrayHandler)));
@@ -2425,7 +2450,7 @@ const $ = class Ue {
2425
2450
  prerender({
2426
2451
  container: e
2427
2452
  }) {
2428
- this._now = performance.now(), e.renderGroup.gcTick = Tt++, this._updateInstructionGCTick(e.renderGroup, e.renderGroup.gcTick);
2453
+ this._now = performance.now(), e.renderGroup.gcTick = kt++, this._updateInstructionGCTick(e.renderGroup, e.renderGroup.gcTick);
2429
2454
  }
2430
2455
  /**
2431
2456
  * Starts tracking a renderable for garbage collection.
@@ -2499,14 +2524,14 @@ $.defaultOptions = {
2499
2524
  /** How often to run garbage collection in ms (default 30 seconds) */
2500
2525
  renderableGCFrequency: 3e4
2501
2526
  };
2502
- let yt = $;
2503
- const q = class Ae {
2527
+ let Ct = $;
2528
+ const q = class Ie {
2504
2529
  /** @param renderer - The renderer this System works for. */
2505
2530
  constructor(e) {
2506
2531
  this._renderer = e, this.count = 0, this.checkCount = 0;
2507
2532
  }
2508
2533
  init(e) {
2509
- e = { ...Ae.defaultOptions, ...e }, this.checkCountMax = e.textureGCCheckCountMax, this.maxIdle = e.textureGCAMaxIdle ?? e.textureGCMaxIdle, this.active = e.textureGCActive;
2534
+ e = { ...Ie.defaultOptions, ...e }, this.checkCountMax = e.textureGCCheckCountMax, this.maxIdle = e.textureGCAMaxIdle ?? e.textureGCMaxIdle, this.active = e.textureGCActive;
2510
2535
  }
2511
2536
  /**
2512
2537
  * Checks to see when the last time a texture was used.
@@ -2559,8 +2584,8 @@ q.defaultOptions = {
2559
2584
  */
2560
2585
  textureGCCheckCountMax: 600
2561
2586
  };
2562
- let kt = q;
2563
- const K = class Ie {
2587
+ let Mt = q;
2588
+ const K = class Ge {
2564
2589
  /**
2565
2590
  * Whether CSS dimensions of canvas view should be resized to screen dimensions automatically.
2566
2591
  * This is only supported for HTMLCanvasElement and will be ignored if the canvas is an OffscreenCanvas.
@@ -2589,9 +2614,9 @@ const K = class Ie {
2589
2614
  */
2590
2615
  init(e) {
2591
2616
  e = {
2592
- ...Ie.defaultOptions,
2617
+ ...Ge.defaultOptions,
2593
2618
  ...e
2594
- }, e.view && (Ke(Ye, "ViewSystem.view has been renamed to ViewSystem.canvas"), e.canvas = e.view), this.screen = new w(0, 0, e.width, e.height), this.canvas = e.canvas || H.get().createCanvas(), this.antialias = !!e.antialias, this.texture = ve(this.canvas, e), this.renderTarget = new I({
2619
+ }, e.view && (Je(Xe, "ViewSystem.view has been renamed to ViewSystem.canvas"), e.canvas = e.view), this.screen = new w(0, 0, e.width, e.height), this.canvas = e.canvas || H.get().createCanvas(), this.antialias = !!e.antialias, this.texture = ge(this.canvas, e), this.renderTarget = new I({
2595
2620
  colorTextures: [this.texture],
2596
2621
  depth: !!e.depth,
2597
2622
  isRoot: !0
@@ -2615,7 +2640,7 @@ const K = class Ie {
2615
2640
  * viewSystem.destroy({ removeView: true });
2616
2641
  */
2617
2642
  destroy(e = !1) {
2618
- (typeof e == "boolean" ? e : !!(e != null && e.removeView)) && this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas);
2643
+ (typeof e == "boolean" ? e : !!(e != null && e.removeView)) && this.canvas.parentNode && this.canvas.parentNode.removeChild(this.canvas), this.texture.destroy();
2619
2644
  }
2620
2645
  };
2621
2646
  K.extension = {
@@ -2649,42 +2674,42 @@ K.defaultOptions = {
2649
2674
  */
2650
2675
  antialias: !1
2651
2676
  };
2652
- let Ct = K;
2653
- const Et = [
2654
- ht,
2655
- Re,
2677
+ let St = K;
2678
+ const Ft = [
2679
+ pt,
2680
+ Be,
2656
2681
  j,
2657
- Ct,
2658
- ke,
2659
- kt,
2660
- Pe,
2661
- ft,
2662
- Je,
2663
- yt,
2664
- Be
2665
- ], Ot = [
2666
- Se,
2667
- he,
2682
+ St,
2668
2683
  Ce,
2669
- be,
2684
+ Mt,
2685
+ Re,
2686
+ mt,
2687
+ Qe,
2688
+ Ct,
2689
+ Ue
2690
+ ], Lt = [
2691
+ we,
2670
2692
  fe,
2671
- me,
2693
+ Me,
2694
+ Te,
2672
2695
  pe,
2673
- _e
2696
+ ve,
2697
+ me,
2698
+ be
2674
2699
  ];
2675
2700
  export {
2676
- Dt as B,
2677
- g as G,
2678
- Gt as R,
2679
- Et as S,
2680
- Ut as U,
2681
- Ot as a,
2682
- at as b,
2683
- At as c,
2701
+ Ot as B,
2702
+ _ as G,
2703
+ Dt as R,
2704
+ Ft as S,
2705
+ It as U,
2706
+ Lt as a,
2707
+ it as b,
2708
+ Gt as c,
2684
2709
  C as d,
2685
- Bt as e,
2686
- Rt as f,
2687
- Pt as t,
2688
- It as u
2710
+ At as e,
2711
+ Ut as f,
2712
+ Bt as t,
2713
+ Et as u
2689
2714
  };
2690
- //# sourceMappingURL=SharedSystems-CZFehVPl.js.map
2715
+ //# sourceMappingURL=SharedSystems-D2AiAlOX.js.map