modern-canvas 0.11.0 → 0.12.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.
package/dist/index.mjs CHANGED
@@ -2097,13 +2097,13 @@ class Vector3 extends Vector {
2097
2097
  }
2098
2098
  }
2099
2099
 
2100
- var __defProp$R = Object.defineProperty;
2101
- var __decorateClass$V = (decorators, target, key, kind) => {
2100
+ var __defProp$Q = Object.defineProperty;
2101
+ var __decorateClass$U = (decorators, target, key, kind) => {
2102
2102
  var result = void 0 ;
2103
2103
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
2104
2104
  if (decorator = decorators[i])
2105
2105
  result = (decorator(target, key, result) ) || result;
2106
- if (result) __defProp$R(target, key, result);
2106
+ if (result) __defProp$Q(target, key, result);
2107
2107
  return result;
2108
2108
  };
2109
2109
  class MainLoop extends CoreObject {
@@ -2151,20 +2151,20 @@ class MainLoop extends CoreObject {
2151
2151
  super.destroy();
2152
2152
  }
2153
2153
  }
2154
- __decorateClass$V([
2154
+ __decorateClass$U([
2155
2155
  property({ fallback: 60 })
2156
2156
  ], MainLoop.prototype, "fps");
2157
- __decorateClass$V([
2157
+ __decorateClass$U([
2158
2158
  property({ fallback: 1 })
2159
2159
  ], MainLoop.prototype, "speed");
2160
2160
 
2161
- var __defProp$Q = Object.defineProperty;
2162
- var __decorateClass$U = (decorators, target, key, kind) => {
2161
+ var __defProp$P = Object.defineProperty;
2162
+ var __decorateClass$T = (decorators, target, key, kind) => {
2163
2163
  var result = void 0 ;
2164
2164
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
2165
2165
  if (decorator = decorators[i])
2166
2166
  result = (decorator(target, key, result) ) || result;
2167
- if (result) __defProp$Q(target, key, result);
2167
+ if (result) __defProp$P(target, key, result);
2168
2168
  return result;
2169
2169
  };
2170
2170
  class Renderer extends Reactivable {
@@ -2208,10 +2208,10 @@ class Renderer extends Reactivable {
2208
2208
  super.destroy();
2209
2209
  }
2210
2210
  }
2211
- __decorateClass$U([
2211
+ __decorateClass$T([
2212
2212
  property({ fallback: DEVICE_PIXEL_RATIO })
2213
2213
  ], Renderer.prototype, "pixelRatio");
2214
- __decorateClass$U([
2214
+ __decorateClass$T([
2215
2215
  property({ internal: true })
2216
2216
  ], Renderer.prototype, "view");
2217
2217
 
@@ -4408,13 +4408,13 @@ class Geometry extends Resource {
4408
4408
  }
4409
4409
  }
4410
4410
 
4411
- var __defProp$P = Object.defineProperty;
4412
- var __decorateClass$T = (decorators, target, key, kind) => {
4411
+ var __defProp$O = Object.defineProperty;
4412
+ var __decorateClass$S = (decorators, target, key, kind) => {
4413
4413
  var result = void 0 ;
4414
4414
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4415
4415
  if (decorator = decorators[i])
4416
4416
  result = (decorator(target, key, result) ) || result;
4417
- if (result) __defProp$P(target, key, result);
4417
+ if (result) __defProp$O(target, key, result);
4418
4418
  return result;
4419
4419
  };
4420
4420
  class IndexBuffer extends Resource {
@@ -4458,20 +4458,20 @@ class IndexBuffer extends Resource {
4458
4458
  return result;
4459
4459
  }
4460
4460
  }
4461
- __decorateClass$T([
4461
+ __decorateClass$S([
4462
4462
  property({ internal: true, fallback: null })
4463
4463
  ], IndexBuffer.prototype, "data");
4464
- __decorateClass$T([
4464
+ __decorateClass$S([
4465
4465
  property({ internal: true, fallback: false })
4466
4466
  ], IndexBuffer.prototype, "dynamic");
4467
4467
 
4468
- var __defProp$O = Object.defineProperty;
4469
- var __decorateClass$S = (decorators, target, key, kind) => {
4468
+ var __defProp$N = Object.defineProperty;
4469
+ var __decorateClass$R = (decorators, target, key, kind) => {
4470
4470
  var result = void 0 ;
4471
4471
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4472
4472
  if (decorator = decorators[i])
4473
4473
  result = (decorator(target, key, result) ) || result;
4474
- if (result) __defProp$O(target, key, result);
4474
+ if (result) __defProp$N(target, key, result);
4475
4475
  return result;
4476
4476
  };
4477
4477
  class VertexBuffer extends Resource {
@@ -4515,20 +4515,20 @@ class VertexBuffer extends Resource {
4515
4515
  return result;
4516
4516
  }
4517
4517
  }
4518
- __decorateClass$S([
4518
+ __decorateClass$R([
4519
4519
  property({ internal: true, default: null })
4520
4520
  ], VertexBuffer.prototype, "data");
4521
- __decorateClass$S([
4521
+ __decorateClass$R([
4522
4522
  property({ internal: true, fallback: false })
4523
4523
  ], VertexBuffer.prototype, "dynamic");
4524
4524
 
4525
- var __defProp$N = Object.defineProperty;
4526
- var __decorateClass$R = (decorators, target, key, kind) => {
4525
+ var __defProp$M = Object.defineProperty;
4526
+ var __decorateClass$Q = (decorators, target, key, kind) => {
4527
4527
  var result = void 0 ;
4528
4528
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4529
4529
  if (decorator = decorators[i])
4530
4530
  result = (decorator(target, key, result) ) || result;
4531
- if (result) __defProp$N(target, key, result);
4531
+ if (result) __defProp$M(target, key, result);
4532
4532
  return result;
4533
4533
  };
4534
4534
  class VertexAttribute extends Resource {
@@ -4562,25 +4562,25 @@ class VertexAttribute extends Resource {
4562
4562
  return result;
4563
4563
  }
4564
4564
  }
4565
- __decorateClass$R([
4565
+ __decorateClass$Q([
4566
4566
  property({ internal: true })
4567
4567
  ], VertexAttribute.prototype, "buffer");
4568
- __decorateClass$R([
4568
+ __decorateClass$Q([
4569
4569
  property({ fallback: 0 })
4570
4570
  ], VertexAttribute.prototype, "size");
4571
- __decorateClass$R([
4571
+ __decorateClass$Q([
4572
4572
  property({ fallback: false })
4573
4573
  ], VertexAttribute.prototype, "normalized");
4574
- __decorateClass$R([
4574
+ __decorateClass$Q([
4575
4575
  property({ fallback: "float" })
4576
4576
  ], VertexAttribute.prototype, "type");
4577
- __decorateClass$R([
4577
+ __decorateClass$Q([
4578
4578
  property()
4579
4579
  ], VertexAttribute.prototype, "stride");
4580
- __decorateClass$R([
4580
+ __decorateClass$Q([
4581
4581
  property()
4582
4582
  ], VertexAttribute.prototype, "offset");
4583
- __decorateClass$R([
4583
+ __decorateClass$Q([
4584
4584
  property()
4585
4585
  ], VertexAttribute.prototype, "divisor");
4586
4586
 
@@ -4824,13 +4824,13 @@ class UvGeometry extends Geometry {
4824
4824
  }
4825
4825
  }
4826
4826
 
4827
- var __defProp$M = Object.defineProperty;
4828
- var __decorateClass$Q = (decorators, target, key, kind) => {
4827
+ var __defProp$L = Object.defineProperty;
4828
+ var __decorateClass$P = (decorators, target, key, kind) => {
4829
4829
  var result = void 0 ;
4830
4830
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4831
4831
  if (decorator = decorators[i])
4832
4832
  result = (decorator(target, key, result) ) || result;
4833
- if (result) __defProp$M(target, key, result);
4833
+ if (result) __defProp$L(target, key, result);
4834
4834
  return result;
4835
4835
  };
4836
4836
  class Texture2D extends Resource {
@@ -4854,9 +4854,6 @@ class Texture2D extends Resource {
4854
4854
  }
4855
4855
  _isPowerOfTwo = false;
4856
4856
  _needsUpload = false;
4857
- get valid() {
4858
- return Boolean(this.width && this.height);
4859
- }
4860
4857
  get realWidth() {
4861
4858
  return Math.round(this.width * this.pixelRatio);
4862
4859
  }
@@ -4868,6 +4865,9 @@ class Texture2D extends Resource {
4868
4865
  this.source = source;
4869
4866
  this._updateSize();
4870
4867
  }
4868
+ isValid() {
4869
+ return Boolean(this.width && this.height);
4870
+ }
4871
4871
  /** @internal */
4872
4872
  _glTextureOptions(renderer, options) {
4873
4873
  let wrapMode = this.wrapMode;
@@ -4927,7 +4927,7 @@ class Texture2D extends Resource {
4927
4927
  this._needsUpload = true;
4928
4928
  }
4929
4929
  upload(renderer, options) {
4930
- if (this._needsUpload && this.valid) {
4930
+ if (this._needsUpload && this.isValid()) {
4931
4931
  this._needsUpload = false;
4932
4932
  renderer.texture.update(
4933
4933
  this._glTexture(renderer, options),
@@ -4938,7 +4938,7 @@ class Texture2D extends Resource {
4938
4938
  return false;
4939
4939
  }
4940
4940
  activate(renderer, location = 0) {
4941
- if (this.valid) {
4941
+ if (this.isValid()) {
4942
4942
  renderer.texture.bind({
4943
4943
  target: "texture_2d",
4944
4944
  value: this._glTexture(renderer, { location }),
@@ -4958,22 +4958,22 @@ class Texture2D extends Resource {
4958
4958
  }
4959
4959
  }
4960
4960
  }
4961
- __decorateClass$Q([
4961
+ __decorateClass$P([
4962
4962
  property({ internal: true })
4963
4963
  ], Texture2D.prototype, "source");
4964
- __decorateClass$Q([
4964
+ __decorateClass$P([
4965
4965
  property({ fallback: 0 })
4966
4966
  ], Texture2D.prototype, "width");
4967
- __decorateClass$Q([
4967
+ __decorateClass$P([
4968
4968
  property({ fallback: 0 })
4969
4969
  ], Texture2D.prototype, "height");
4970
- __decorateClass$Q([
4970
+ __decorateClass$P([
4971
4971
  property({ fallback: "linear" })
4972
4972
  ], Texture2D.prototype, "filterMode");
4973
- __decorateClass$Q([
4973
+ __decorateClass$P([
4974
4974
  property({ fallback: "clamp_to_edge" })
4975
4975
  ], Texture2D.prototype, "wrapMode");
4976
- __decorateClass$Q([
4976
+ __decorateClass$P([
4977
4977
  property({ fallback: 1 })
4978
4978
  ], Texture2D.prototype, "pixelRatio");
4979
4979
 
@@ -5007,13 +5007,13 @@ class AnimatedTexture extends Resource {
5007
5007
  }
5008
5008
  }
5009
5009
 
5010
- var __defProp$L = Object.defineProperty;
5011
- var __decorateClass$P = (decorators, target, key, kind) => {
5010
+ var __defProp$K = Object.defineProperty;
5011
+ var __decorateClass$O = (decorators, target, key, kind) => {
5012
5012
  var result = void 0 ;
5013
5013
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5014
5014
  if (decorator = decorators[i])
5015
5015
  result = (decorator(target, key, result) ) || result;
5016
- if (result) __defProp$L(target, key, result);
5016
+ if (result) __defProp$K(target, key, result);
5017
5017
  return result;
5018
5018
  };
5019
5019
  class CanvasTexture extends Texture2D {
@@ -5032,7 +5032,7 @@ class CanvasTexture extends Texture2D {
5032
5032
  super._updateProperty(key, value, oldValue);
5033
5033
  }
5034
5034
  }
5035
- __decorateClass$P([
5035
+ __decorateClass$O([
5036
5036
  property({ fallback: 2 })
5037
5037
  ], CanvasTexture.prototype, "pixelRatio");
5038
5038
 
@@ -5254,13 +5254,13 @@ class PixelsTexture extends Texture2D {
5254
5254
  }
5255
5255
  }
5256
5256
 
5257
- var __defProp$K = Object.defineProperty;
5258
- var __decorateClass$O = (decorators, target, key, kind) => {
5257
+ var __defProp$J = Object.defineProperty;
5258
+ var __decorateClass$N = (decorators, target, key, kind) => {
5259
5259
  var result = void 0 ;
5260
5260
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5261
5261
  if (decorator = decorators[i])
5262
5262
  result = (decorator(target, key, result) ) || result;
5263
- if (result) __defProp$K(target, key, result);
5263
+ if (result) __defProp$J(target, key, result);
5264
5264
  return result;
5265
5265
  };
5266
5266
  function resolveOptions(options) {
@@ -5365,7 +5365,7 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
5365
5365
  }
5366
5366
  }
5367
5367
  _onPlayStart = () => {
5368
- if (!this.valid) {
5368
+ if (!this.isValid()) {
5369
5369
  this._onCanPlay();
5370
5370
  }
5371
5371
  this._setupAutoUpdate();
@@ -5377,7 +5377,7 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
5377
5377
  const source = this.source;
5378
5378
  source.removeEventListener("canplay", this._onCanPlay);
5379
5379
  source.removeEventListener("canplaythrough", this._onCanPlay);
5380
- const valid = this.valid;
5380
+ const valid = this.isValid();
5381
5381
  this._nextTime = 0;
5382
5382
  this._updateSize();
5383
5383
  this.requestUpload();
@@ -5476,7 +5476,7 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
5476
5476
  this._onCanPlay();
5477
5477
  }
5478
5478
  this._sourceLoad = new Promise((resolve, reject) => {
5479
- if (this.valid) {
5479
+ if (this.isValid()) {
5480
5480
  this._sourceLoad = void 0;
5481
5481
  resolve(this);
5482
5482
  } else {
@@ -5504,10 +5504,10 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
5504
5504
  }
5505
5505
  }
5506
5506
  };
5507
- __decorateClass$O([
5507
+ __decorateClass$N([
5508
5508
  property({ internal: true, fallback: true })
5509
5509
  ], _VideoTexture.prototype, "autoUpdate");
5510
- __decorateClass$O([
5510
+ __decorateClass$N([
5511
5511
  property({ internal: true, fallback: 0 })
5512
5512
  ], _VideoTexture.prototype, "fps");
5513
5513
  let VideoTexture = _VideoTexture;
@@ -5799,14 +5799,14 @@ class Meta extends CoreObject {
5799
5799
  }
5800
5800
  }
5801
5801
 
5802
- var __defProp$J = Object.defineProperty;
5803
- var __getOwnPropDesc$D = Object.getOwnPropertyDescriptor;
5804
- var __decorateClass$N = (decorators, target, key, kind) => {
5805
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$D(target, key) : target;
5802
+ var __defProp$I = Object.defineProperty;
5803
+ var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
5804
+ var __decorateClass$M = (decorators, target, key, kind) => {
5805
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$C(target, key) : target;
5806
5806
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5807
5807
  if (decorator = decorators[i])
5808
5808
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5809
- if (kind && result) __defProp$J(target, key, result);
5809
+ if (kind && result) __defProp$I(target, key, result);
5810
5810
  return result;
5811
5811
  };
5812
5812
  const iidMap = {};
@@ -5907,9 +5907,6 @@ let Node = class extends CoreObject {
5907
5907
  }
5908
5908
  return this;
5909
5909
  }
5910
- log(...args) {
5911
- this._tree?.log(...args);
5912
- }
5913
5910
  /** Parent */
5914
5911
  _parent;
5915
5912
  get parent() {
@@ -6245,24 +6242,35 @@ let Node = class extends CoreObject {
6245
6242
  remove() {
6246
6243
  this._parent?.removeChild(this);
6247
6244
  }
6248
- forEachChild(callbackfn) {
6249
- this.children.forEach(callbackfn);
6250
- return this;
6245
+ findOne(callbackfn) {
6246
+ for (const child of this._children.default) {
6247
+ const value = callbackfn(child) || child.findOne(callbackfn);
6248
+ if (value) {
6249
+ return value;
6250
+ }
6251
+ }
6252
+ return void 0;
6251
6253
  }
6252
- forEachDescendant(callbackfn) {
6253
- this.children.forEach((child) => {
6254
- callbackfn(child);
6255
- child.forEachDescendant(callbackfn);
6256
- });
6257
- return this;
6254
+ findAll(callbackfn) {
6255
+ const items = [];
6256
+ for (const child of this._children.default) {
6257
+ const value = callbackfn(child);
6258
+ if (value) {
6259
+ items.push(value);
6260
+ }
6261
+ items.push(...child.findAll(callbackfn));
6262
+ }
6263
+ return items;
6258
6264
  }
6259
- forEachAncestor(callbackfn) {
6260
- const parent = this.parent;
6265
+ findAncestor(callbackfn) {
6266
+ const parent = this._parent;
6261
6267
  if (parent) {
6262
- callbackfn(parent);
6263
- parent.forEachAncestor(callbackfn);
6268
+ const value = callbackfn(parent) ?? parent.findAncestor(callbackfn);
6269
+ if (value) {
6270
+ return value;
6271
+ }
6264
6272
  }
6265
- return this;
6273
+ return void 0;
6266
6274
  }
6267
6275
  /** override */
6268
6276
  _ready() {
@@ -6320,42 +6328,42 @@ let Node = class extends CoreObject {
6320
6328
  return node;
6321
6329
  }
6322
6330
  };
6323
- __decorateClass$N([
6331
+ __decorateClass$M([
6324
6332
  property({ fallback: idGenerator() })
6325
6333
  ], Node.prototype, "id", 2);
6326
- __decorateClass$N([
6334
+ __decorateClass$M([
6327
6335
  property({ fallback: idGenerator() })
6328
6336
  ], Node.prototype, "name", 2);
6329
- __decorateClass$N([
6337
+ __decorateClass$M([
6330
6338
  property({ internal: true, fallback: "inherit" })
6331
6339
  ], Node.prototype, "processMode", 2);
6332
- __decorateClass$N([
6340
+ __decorateClass$M([
6333
6341
  property({ internal: true, fallback: "default" })
6334
6342
  ], Node.prototype, "processSortMode", 2);
6335
- __decorateClass$N([
6343
+ __decorateClass$M([
6336
6344
  property({ internal: true, fallback: "inherit" })
6337
6345
  ], Node.prototype, "renderMode", 2);
6338
- __decorateClass$N([
6346
+ __decorateClass$M([
6339
6347
  property({ internal: true, fallback: "inherit" })
6340
6348
  ], Node.prototype, "inputMode", 2);
6341
- __decorateClass$N([
6349
+ __decorateClass$M([
6342
6350
  property({ internal: true, fallback: "default" })
6343
6351
  ], Node.prototype, "internalMode", 2);
6344
- __decorateClass$N([
6352
+ __decorateClass$M([
6345
6353
  property({ internal: true })
6346
6354
  ], Node.prototype, "mask", 2);
6347
- Node = __decorateClass$N([
6355
+ Node = __decorateClass$M([
6348
6356
  customNode("Node")
6349
6357
  ], Node);
6350
6358
 
6351
- var __defProp$I = Object.defineProperty;
6352
- var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
6353
- var __decorateClass$M = (decorators, target, key, kind) => {
6354
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$C(target, key) : target;
6359
+ var __defProp$H = Object.defineProperty;
6360
+ var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor;
6361
+ var __decorateClass$L = (decorators, target, key, kind) => {
6362
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$B(target, key) : target;
6355
6363
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6356
6364
  if (decorator = decorators[i])
6357
6365
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6358
- if (kind && result) __defProp$I(target, key, result);
6366
+ if (kind && result) __defProp$H(target, key, result);
6359
6367
  return result;
6360
6368
  };
6361
6369
  let TimelineNode = class extends Node {
@@ -6403,9 +6411,15 @@ let TimelineNode = class extends Node {
6403
6411
  _updateCurrentTime(force = false) {
6404
6412
  if (force || !this.paused) {
6405
6413
  const parent = this._parent;
6406
- this._startTime = this.delay + this.parentStartTime;
6407
- this.computedDuration = parent?.computedDuration ? Math.min(this._startTime + this.duration, parent.endTime) - this._startTime : this.duration;
6408
- this._currentTime = this.timelineCurrentTime - this._startTime;
6414
+ const startTime = this.delay + this.parentStartTime;
6415
+ const endTime = parent?.computedDuration ? Math.min(startTime + this.duration, parent.endTime) - startTime : this.duration;
6416
+ let currentTime = this.timelineCurrentTime - startTime;
6417
+ if (this.loop) {
6418
+ currentTime = currentTime % endTime;
6419
+ }
6420
+ this._startTime = startTime;
6421
+ this._currentTime = currentTime;
6422
+ this.computedDuration = endTime;
6409
6423
  this.emit("updateCurrentTime", this._currentTime);
6410
6424
  this.insideTimeRange = this.isInsideTimeRange();
6411
6425
  }
@@ -6415,30 +6429,33 @@ let TimelineNode = class extends Node {
6415
6429
  this._updateCurrentTime();
6416
6430
  }
6417
6431
  };
6418
- __decorateClass$M([
6432
+ __decorateClass$L([
6433
+ property({ fallback: false })
6434
+ ], TimelineNode.prototype, "loop", 2);
6435
+ __decorateClass$L([
6419
6436
  property({ fallback: 0 })
6420
6437
  ], TimelineNode.prototype, "delay", 2);
6421
- __decorateClass$M([
6438
+ __decorateClass$L([
6422
6439
  property({ fallback: 0 })
6423
6440
  ], TimelineNode.prototype, "duration", 2);
6424
- __decorateClass$M([
6441
+ __decorateClass$L([
6425
6442
  property({ fallback: false })
6426
6443
  ], TimelineNode.prototype, "paused", 2);
6427
- __decorateClass$M([
6444
+ __decorateClass$L([
6428
6445
  property({ internal: true, fallback: false })
6429
6446
  ], TimelineNode.prototype, "insideTimeRange", 2);
6430
- TimelineNode = __decorateClass$M([
6447
+ TimelineNode = __decorateClass$L([
6431
6448
  customNode("TimelineNode")
6432
6449
  ], TimelineNode);
6433
6450
 
6434
- var __defProp$H = Object.defineProperty;
6435
- var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor;
6436
- var __decorateClass$L = (decorators, target, key, kind) => {
6437
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$B(target, key) : target;
6451
+ var __defProp$G = Object.defineProperty;
6452
+ var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor;
6453
+ var __decorateClass$K = (decorators, target, key, kind) => {
6454
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$A(target, key) : target;
6438
6455
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6439
6456
  if (decorator = decorators[i])
6440
6457
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6441
- if (kind && result) __defProp$H(target, key, result);
6458
+ if (kind && result) __defProp$G(target, key, result);
6442
6459
  return result;
6443
6460
  };
6444
6461
  let CanvasItem = class extends TimelineNode {
@@ -6522,16 +6539,16 @@ let CanvasItem = class extends TimelineNode {
6522
6539
  this.emit("draw");
6523
6540
  }
6524
6541
  _redraw() {
6525
- this.log(this.name, "drawing");
6542
+ this._tree?.log(this.name, "drawing");
6526
6543
  this._draw();
6527
6544
  return this.context.toBatchables();
6528
6545
  }
6529
6546
  _relayout(batchables) {
6530
- this.log(this.name, "layouting");
6547
+ this._tree?.log(this.name, "layouting");
6531
6548
  return batchables;
6532
6549
  }
6533
6550
  _repaint(batchables) {
6534
- this.log(this.name, "painting");
6551
+ this._tree?.log(this.name, "painting");
6535
6552
  const globalOpacity = this.globalOpacity;
6536
6553
  return batchables.map((batchable) => {
6537
6554
  return {
@@ -6591,30 +6608,30 @@ let CanvasItem = class extends TimelineNode {
6591
6608
  super._render(renderer);
6592
6609
  }
6593
6610
  };
6594
- __decorateClass$L([
6611
+ __decorateClass$K([
6595
6612
  property()
6596
6613
  ], CanvasItem.prototype, "modulate", 2);
6597
- __decorateClass$L([
6614
+ __decorateClass$K([
6598
6615
  property()
6599
6616
  ], CanvasItem.prototype, "blendMode", 2);
6600
- __decorateClass$L([
6617
+ __decorateClass$K([
6601
6618
  property({ internal: true, fallback: true })
6602
6619
  ], CanvasItem.prototype, "visible", 2);
6603
- __decorateClass$L([
6620
+ __decorateClass$K([
6604
6621
  property({ internal: true, fallback: 1 })
6605
6622
  ], CanvasItem.prototype, "opacity", 2);
6606
- CanvasItem = __decorateClass$L([
6623
+ CanvasItem = __decorateClass$K([
6607
6624
  customNode("CanvasItem")
6608
6625
  ], CanvasItem);
6609
6626
 
6610
- var __defProp$G = Object.defineProperty;
6611
- var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor;
6612
- var __decorateClass$K = (decorators, target, key, kind) => {
6613
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$A(target, key) : target;
6627
+ var __defProp$F = Object.defineProperty;
6628
+ var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor;
6629
+ var __decorateClass$J = (decorators, target, key, kind) => {
6630
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$z(target, key) : target;
6614
6631
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6615
6632
  if (decorator = decorators[i])
6616
6633
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6617
- if (kind && result) __defProp$G(target, key, result);
6634
+ if (kind && result) __defProp$F(target, key, result);
6618
6635
  return result;
6619
6636
  };
6620
6637
  let Viewport = class extends Node {
@@ -6765,33 +6782,33 @@ let Viewport = class extends Node {
6765
6782
  return this.canvasTransform.apply(globalPos, newPos);
6766
6783
  }
6767
6784
  };
6768
- __decorateClass$K([
6785
+ __decorateClass$J([
6769
6786
  property({ fallback: 0 })
6770
6787
  ], Viewport.prototype, "x", 2);
6771
- __decorateClass$K([
6788
+ __decorateClass$J([
6772
6789
  property({ fallback: 0 })
6773
6790
  ], Viewport.prototype, "y", 2);
6774
- __decorateClass$K([
6791
+ __decorateClass$J([
6775
6792
  property({ fallback: 0 })
6776
6793
  ], Viewport.prototype, "width", 2);
6777
- __decorateClass$K([
6794
+ __decorateClass$J([
6778
6795
  property({ fallback: 0 })
6779
6796
  ], Viewport.prototype, "height", 2);
6780
- __decorateClass$K([
6797
+ __decorateClass$J([
6781
6798
  property({ internal: true, fallback: false })
6782
6799
  ], Viewport.prototype, "msaa", 2);
6783
- Viewport = __decorateClass$K([
6800
+ Viewport = __decorateClass$J([
6784
6801
  customNode("Viewport")
6785
6802
  ], Viewport);
6786
6803
 
6787
- var __defProp$F = Object.defineProperty;
6788
- var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor;
6789
- var __decorateClass$J = (decorators, target, key, kind) => {
6790
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$z(target, key) : target;
6804
+ var __defProp$E = Object.defineProperty;
6805
+ var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
6806
+ var __decorateClass$I = (decorators, target, key, kind) => {
6807
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$y(target, key) : target;
6791
6808
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6792
6809
  if (decorator = decorators[i])
6793
6810
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6794
- if (kind && result) __defProp$F(target, key, result);
6811
+ if (kind && result) __defProp$E(target, key, result);
6795
6812
  return result;
6796
6813
  };
6797
6814
  let Effect = class extends TimelineNode {
@@ -7033,19 +7050,19 @@ let Effect = class extends TimelineNode {
7033
7050
  }
7034
7051
  }
7035
7052
  };
7036
- __decorateClass$J([
7053
+ __decorateClass$I([
7037
7054
  property({ internal: true })
7038
7055
  ], Effect.prototype, "material", 2);
7039
- __decorateClass$J([
7056
+ __decorateClass$I([
7040
7057
  property()
7041
7058
  ], Effect.prototype, "effectMode", 2);
7042
- __decorateClass$J([
7059
+ __decorateClass$I([
7043
7060
  property()
7044
7061
  ], Effect.prototype, "glsl", 2);
7045
- __decorateClass$J([
7062
+ __decorateClass$I([
7046
7063
  property()
7047
7064
  ], Effect.prototype, "glslSrc", 2);
7048
- Effect = __decorateClass$J([
7065
+ Effect = __decorateClass$I([
7049
7066
  customNode("Effect")
7050
7067
  ], Effect);
7051
7068
 
@@ -7075,14 +7092,14 @@ class RenderStack {
7075
7092
  }
7076
7093
  }
7077
7094
 
7078
- var __defProp$E = Object.defineProperty;
7079
- var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
7080
- var __decorateClass$I = (decorators, target, key, kind) => {
7081
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$y(target, key) : target;
7095
+ var __defProp$D = Object.defineProperty;
7096
+ var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor;
7097
+ var __decorateClass$H = (decorators, target, key, kind) => {
7098
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$x(target, key) : target;
7082
7099
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7083
7100
  if (decorator = decorators[i])
7084
7101
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7085
- if (kind && result) __defProp$E(target, key, result);
7102
+ if (kind && result) __defProp$D(target, key, result);
7086
7103
  return result;
7087
7104
  };
7088
7105
  let Timeline = class extends Node {
@@ -7127,48 +7144,48 @@ let Timeline = class extends Node {
7127
7144
  this.addTime(delta);
7128
7145
  }
7129
7146
  };
7130
- __decorateClass$I([
7147
+ __decorateClass$H([
7131
7148
  property({ fallback: 0 })
7132
7149
  ], Timeline.prototype, "startTime", 2);
7133
- __decorateClass$I([
7150
+ __decorateClass$H([
7134
7151
  property({ fallback: 0 })
7135
7152
  ], Timeline.prototype, "currentTime", 2);
7136
- __decorateClass$I([
7153
+ __decorateClass$H([
7137
7154
  property({ fallback: Number.MAX_SAFE_INTEGER })
7138
7155
  ], Timeline.prototype, "endTime", 2);
7139
- __decorateClass$I([
7156
+ __decorateClass$H([
7140
7157
  property({ fallback: false })
7141
7158
  ], Timeline.prototype, "loop", 2);
7142
- Timeline = __decorateClass$I([
7159
+ Timeline = __decorateClass$H([
7143
7160
  customNode("Timeline")
7144
7161
  ], Timeline);
7145
7162
 
7146
- var __defProp$D = Object.defineProperty;
7147
- var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor;
7148
- var __decorateClass$H = (decorators, target, key, kind) => {
7149
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$x(target, key) : target;
7163
+ var __defProp$C = Object.defineProperty;
7164
+ var __getOwnPropDesc$w = Object.getOwnPropertyDescriptor;
7165
+ var __decorateClass$G = (decorators, target, key, kind) => {
7166
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$w(target, key) : target;
7150
7167
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7151
7168
  if (decorator = decorators[i])
7152
7169
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7153
- if (kind && result) __defProp$D(target, key, result);
7170
+ if (kind && result) __defProp$C(target, key, result);
7154
7171
  return result;
7155
7172
  };
7156
7173
  let Window = class extends Viewport {
7157
7174
  };
7158
- __decorateClass$H([
7175
+ __decorateClass$G([
7159
7176
  property({ fallback: false })
7160
7177
  ], Window.prototype, "msaa", 2);
7161
- Window = __decorateClass$H([
7178
+ Window = __decorateClass$G([
7162
7179
  customNode("Window")
7163
7180
  ], Window);
7164
7181
 
7165
- var __defProp$C = Object.defineProperty;
7166
- var __decorateClass$G = (decorators, target, key, kind) => {
7182
+ var __defProp$B = Object.defineProperty;
7183
+ var __decorateClass$F = (decorators, target, key, kind) => {
7167
7184
  var result = void 0 ;
7168
7185
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7169
7186
  if (decorator = decorators[i])
7170
7187
  result = (decorator(target, key, result) ) || result;
7171
- if (result) __defProp$C(target, key, result);
7188
+ if (result) __defProp$B(target, key, result);
7172
7189
  return result;
7173
7190
  };
7174
7191
  class SceneTree extends MainLoop {
@@ -7248,25 +7265,25 @@ class SceneTree extends MainLoop {
7248
7265
  super.destroy();
7249
7266
  }
7250
7267
  }
7251
- __decorateClass$G([
7268
+ __decorateClass$F([
7252
7269
  property()
7253
7270
  ], SceneTree.prototype, "backgroundColor");
7254
- __decorateClass$G([
7271
+ __decorateClass$F([
7255
7272
  property({ internal: true, fallback: false })
7256
7273
  ], SceneTree.prototype, "debug");
7257
- __decorateClass$G([
7274
+ __decorateClass$F([
7258
7275
  property({ internal: true, fallback: false })
7259
7276
  ], SceneTree.prototype, "processPaused");
7260
- __decorateClass$G([
7277
+ __decorateClass$F([
7261
7278
  property({ internal: true, default: () => fonts })
7262
7279
  ], SceneTree.prototype, "fonts");
7263
- __decorateClass$G([
7280
+ __decorateClass$F([
7264
7281
  property({ internal: true, default: () => new Timeline() })
7265
7282
  ], SceneTree.prototype, "timeline");
7266
7283
 
7267
- var __getOwnPropDesc$w = Object.getOwnPropertyDescriptor;
7268
- var __decorateClass$F = (decorators, target, key, kind) => {
7269
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$w(target, key) : target;
7284
+ var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
7285
+ var __decorateClass$E = (decorators, target, key, kind) => {
7286
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$v(target, key) : target;
7270
7287
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7271
7288
  if (decorator = decorators[i])
7272
7289
  result = (decorator(result)) || result;
@@ -7278,7 +7295,7 @@ let Transition = class extends Effect {
7278
7295
  this.setProperties(properties).append(children);
7279
7296
  }
7280
7297
  };
7281
- Transition = __decorateClass$F([
7298
+ Transition = __decorateClass$E([
7282
7299
  customNode("Transition", {
7283
7300
  effectMode: "transition",
7284
7301
  processMode: "pausable",
@@ -7286,14 +7303,14 @@ Transition = __decorateClass$F([
7286
7303
  })
7287
7304
  ], Transition);
7288
7305
 
7289
- var __defProp$B = Object.defineProperty;
7290
- var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
7291
- var __decorateClass$E = (decorators, target, key, kind) => {
7292
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$v(target, key) : target;
7306
+ var __defProp$A = Object.defineProperty;
7307
+ var __getOwnPropDesc$u = Object.getOwnPropertyDescriptor;
7308
+ var __decorateClass$D = (decorators, target, key, kind) => {
7309
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$u(target, key) : target;
7293
7310
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7294
7311
  if (decorator = decorators[i])
7295
7312
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7296
- if (kind && result) __defProp$B(target, key, result);
7313
+ if (kind && result) __defProp$A(target, key, result);
7297
7314
  return result;
7298
7315
  };
7299
7316
  let Node2D = class extends CanvasItem {
@@ -7395,24 +7412,24 @@ let Node2D = class extends CanvasItem {
7395
7412
  return this.globalTransform.apply(localPos, newPos);
7396
7413
  }
7397
7414
  };
7398
- __decorateClass$E([
7415
+ __decorateClass$D([
7399
7416
  property({ internal: true, fallback: 0 })
7400
7417
  ], Node2D.prototype, "rotation", 2);
7401
- __decorateClass$E([
7418
+ __decorateClass$D([
7402
7419
  property({ internal: true, fallback: 0 })
7403
7420
  ], Node2D.prototype, "globalRotation", 2);
7404
- Node2D = __decorateClass$E([
7421
+ Node2D = __decorateClass$D([
7405
7422
  customNode("Node2D")
7406
7423
  ], Node2D);
7407
7424
 
7408
- var __defProp$A = Object.defineProperty;
7409
- var __getOwnPropDesc$u = Object.getOwnPropertyDescriptor;
7410
- var __decorateClass$D = (decorators, target, key, kind) => {
7411
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$u(target, key) : target;
7425
+ var __defProp$z = Object.defineProperty;
7426
+ var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
7427
+ var __decorateClass$C = (decorators, target, key, kind) => {
7428
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$t(target, key) : target;
7412
7429
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7413
7430
  if (decorator = decorators[i])
7414
7431
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7415
- if (kind && result) __defProp$A(target, key, result);
7432
+ if (kind && result) __defProp$z(target, key, result);
7416
7433
  return result;
7417
7434
  };
7418
7435
  let Camera2D = class extends Node2D {
@@ -7574,16 +7591,16 @@ let Camera2D = class extends Node2D {
7574
7591
  };
7575
7592
  }
7576
7593
  };
7577
- __decorateClass$D([
7594
+ __decorateClass$C([
7578
7595
  property({ fallback: 0.02 })
7579
7596
  ], Camera2D.prototype, "wheelSensitivity", 2);
7580
- __decorateClass$D([
7597
+ __decorateClass$C([
7581
7598
  property({ internal: true, fallback: false })
7582
7599
  ], Camera2D.prototype, "spaceKey", 2);
7583
- __decorateClass$D([
7600
+ __decorateClass$C([
7584
7601
  property({ internal: true, fallback: false })
7585
7602
  ], Camera2D.prototype, "grabbing", 2);
7586
- Camera2D = __decorateClass$D([
7603
+ Camera2D = __decorateClass$C([
7587
7604
  customNode("Camera2D", {
7588
7605
  processMode: "disabled",
7589
7606
  renderMode: "disabled"
@@ -7736,15 +7753,15 @@ function parseCSSTransformOrigin(transformOrigin) {
7736
7753
  });
7737
7754
  }
7738
7755
 
7739
- var __defProp$z = Object.defineProperty;
7740
- var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
7741
- var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7742
- var __decorateClass$C = (decorators, target, key, kind) => {
7743
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$t(target, key) : target;
7756
+ var __defProp$y = Object.defineProperty;
7757
+ var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
7758
+ var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7759
+ var __decorateClass$B = (decorators, target, key, kind) => {
7760
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$s(target, key) : target;
7744
7761
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7745
7762
  if (decorator = decorators[i])
7746
7763
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7747
- if (kind && result) __defProp$z(target, key, result);
7764
+ if (kind && result) __defProp$y(target, key, result);
7748
7765
  return result;
7749
7766
  };
7750
7767
  var __publicField$j = (obj, key, value) => __defNormalProp$j(obj, key + "" , value);
@@ -7804,43 +7821,43 @@ void main(void) {
7804
7821
  gl_FragColor = c * alpha;
7805
7822
  }`
7806
7823
  }));
7807
- __decorateClass$C([
7824
+ __decorateClass$B([
7808
7825
  property({ fallback: 1 })
7809
7826
  ], ColorAdjustEffect.prototype, "saturation", 2);
7810
- __decorateClass$C([
7827
+ __decorateClass$B([
7811
7828
  property({ fallback: 1 })
7812
7829
  ], ColorAdjustEffect.prototype, "contrast", 2);
7813
- __decorateClass$C([
7830
+ __decorateClass$B([
7814
7831
  property({ fallback: 1 })
7815
7832
  ], ColorAdjustEffect.prototype, "brightness", 2);
7816
- __decorateClass$C([
7833
+ __decorateClass$B([
7817
7834
  property({ fallback: 1 })
7818
7835
  ], ColorAdjustEffect.prototype, "red", 2);
7819
- __decorateClass$C([
7836
+ __decorateClass$B([
7820
7837
  property({ fallback: 1 })
7821
7838
  ], ColorAdjustEffect.prototype, "green", 2);
7822
- __decorateClass$C([
7839
+ __decorateClass$B([
7823
7840
  property({ fallback: 1 })
7824
7841
  ], ColorAdjustEffect.prototype, "blue", 2);
7825
- __decorateClass$C([
7842
+ __decorateClass$B([
7826
7843
  property({ fallback: 1 })
7827
7844
  ], ColorAdjustEffect.prototype, "alpha", 2);
7828
- __decorateClass$C([
7845
+ __decorateClass$B([
7829
7846
  property({ fallback: 1 })
7830
7847
  ], ColorAdjustEffect.prototype, "gamma", 2);
7831
- ColorAdjustEffect = __decorateClass$C([
7848
+ ColorAdjustEffect = __decorateClass$B([
7832
7849
  customNode("ColorAdjustEffect")
7833
7850
  ], ColorAdjustEffect);
7834
7851
 
7835
- var __defProp$y = Object.defineProperty;
7836
- var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
7837
- var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7838
- var __decorateClass$B = (decorators, target, key, kind) => {
7839
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$s(target, key) : target;
7852
+ var __defProp$x = Object.defineProperty;
7853
+ var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
7854
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7855
+ var __decorateClass$A = (decorators, target, key, kind) => {
7856
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$r(target, key) : target;
7840
7857
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7841
7858
  if (decorator = decorators[i])
7842
7859
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7843
- if (kind && result) __defProp$y(target, key, result);
7860
+ if (kind && result) __defProp$x(target, key, result);
7844
7861
  return result;
7845
7862
  };
7846
7863
  var __publicField$i = (obj, key, value) => __defNormalProp$i(obj, key + "" , value);
@@ -7920,22 +7937,22 @@ void main(void) {
7920
7937
  );
7921
7938
  }`
7922
7939
  }));
7923
- __decorateClass$B([
7940
+ __decorateClass$A([
7924
7941
  property()
7925
7942
  ], ColorFilterEffect.prototype, "filter", 2);
7926
- ColorFilterEffect = __decorateClass$B([
7943
+ ColorFilterEffect = __decorateClass$A([
7927
7944
  customNode("ColorFilterEffect")
7928
7945
  ], ColorFilterEffect);
7929
7946
 
7930
- var __defProp$x = Object.defineProperty;
7931
- var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
7932
- var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7933
- var __decorateClass$A = (decorators, target, key, kind) => {
7934
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$r(target, key) : target;
7947
+ var __defProp$w = Object.defineProperty;
7948
+ var __getOwnPropDesc$q = Object.getOwnPropertyDescriptor;
7949
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7950
+ var __decorateClass$z = (decorators, target, key, kind) => {
7951
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$q(target, key) : target;
7935
7952
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7936
7953
  if (decorator = decorators[i])
7937
7954
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7938
- if (kind && result) __defProp$x(target, key, result);
7955
+ if (kind && result) __defProp$w(target, key, result);
7939
7956
  return result;
7940
7957
  };
7941
7958
  var __publicField$h = (obj, key, value) => __defNormalProp$h(obj, key + "" , value);
@@ -8011,25 +8028,25 @@ void main(void) {
8011
8028
  gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
8012
8029
  }`
8013
8030
  }));
8014
- __decorateClass$A([
8031
+ __decorateClass$z([
8015
8032
  property({ default: () => [] })
8016
8033
  ], ColorOverlayEffect.prototype, "colors", 2);
8017
- __decorateClass$A([
8034
+ __decorateClass$z([
8018
8035
  property({ fallback: 0.5 })
8019
8036
  ], ColorOverlayEffect.prototype, "alpha", 2);
8020
- ColorOverlayEffect = __decorateClass$A([
8037
+ ColorOverlayEffect = __decorateClass$z([
8021
8038
  customNode("ColorOverlayEffect")
8022
8039
  ], ColorOverlayEffect);
8023
8040
 
8024
- var __defProp$w = Object.defineProperty;
8025
- var __getOwnPropDesc$q = Object.getOwnPropertyDescriptor;
8026
- var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8027
- var __decorateClass$z = (decorators, target, key, kind) => {
8028
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$q(target, key) : target;
8041
+ var __defProp$v = Object.defineProperty;
8042
+ var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
8043
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8044
+ var __decorateClass$y = (decorators, target, key, kind) => {
8045
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$p(target, key) : target;
8029
8046
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8030
8047
  if (decorator = decorators[i])
8031
8048
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8032
- if (kind && result) __defProp$w(target, key, result);
8049
+ if (kind && result) __defProp$v(target, key, result);
8033
8050
  return result;
8034
8051
  };
8035
8052
  var __publicField$g = (obj, key, value) => __defNormalProp$g(obj, key + "" , value);
@@ -8096,25 +8113,25 @@ void main(void) {
8096
8113
  gl_FragColor = color;
8097
8114
  }`
8098
8115
  }));
8099
- __decorateClass$z([
8116
+ __decorateClass$y([
8100
8117
  property({ default: () => [] })
8101
8118
  ], ColorRemoveEffect.prototype, "colors", 2);
8102
- __decorateClass$z([
8119
+ __decorateClass$y([
8103
8120
  property({ fallback: 0.5 })
8104
8121
  ], ColorRemoveEffect.prototype, "epsilon", 2);
8105
- ColorRemoveEffect = __decorateClass$z([
8122
+ ColorRemoveEffect = __decorateClass$y([
8106
8123
  customNode("ColorRemoveEffect")
8107
8124
  ], ColorRemoveEffect);
8108
8125
 
8109
- var __defProp$v = Object.defineProperty;
8110
- var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
8111
- var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8112
- var __decorateClass$y = (decorators, target, key, kind) => {
8113
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$p(target, key) : target;
8126
+ var __defProp$u = Object.defineProperty;
8127
+ var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
8128
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8129
+ var __decorateClass$x = (decorators, target, key, kind) => {
8130
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$o(target, key) : target;
8114
8131
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8115
8132
  if (decorator = decorators[i])
8116
8133
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8117
- if (kind && result) __defProp$v(target, key, result);
8134
+ if (kind && result) __defProp$u(target, key, result);
8118
8135
  return result;
8119
8136
  };
8120
8137
  var __publicField$f = (obj, key, value) => __defNormalProp$f(obj, key + "" , value);
@@ -8203,25 +8220,25 @@ void main(void) {
8203
8220
  }
8204
8221
  }`
8205
8222
  }));
8206
- __decorateClass$y([
8223
+ __decorateClass$x([
8207
8224
  property({ default: () => [] })
8208
8225
  ], ColorReplaceEffect.prototype, "colors", 2);
8209
- __decorateClass$y([
8226
+ __decorateClass$x([
8210
8227
  property({ fallback: 0.05 })
8211
8228
  ], ColorReplaceEffect.prototype, "epsilon", 2);
8212
- ColorReplaceEffect = __decorateClass$y([
8229
+ ColorReplaceEffect = __decorateClass$x([
8213
8230
  customNode("ColorReplaceEffect")
8214
8231
  ], ColorReplaceEffect);
8215
8232
 
8216
- var __defProp$u = Object.defineProperty;
8217
- var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
8218
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8219
- var __decorateClass$x = (decorators, target, key, kind) => {
8220
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$o(target, key) : target;
8233
+ var __defProp$t = Object.defineProperty;
8234
+ var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
8235
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8236
+ var __decorateClass$w = (decorators, target, key, kind) => {
8237
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$n(target, key) : target;
8221
8238
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8222
8239
  if (decorator = decorators[i])
8223
8240
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8224
- if (kind && result) __defProp$u(target, key, result);
8241
+ if (kind && result) __defProp$t(target, key, result);
8225
8242
  return result;
8226
8243
  };
8227
8244
  var __publicField$e = (obj, key, value) => __defNormalProp$e(obj, key + "" , value);
@@ -8314,28 +8331,28 @@ void main(void) {
8314
8331
  gl_FragColor = color;
8315
8332
  }`
8316
8333
  }));
8317
- __decorateClass$x([
8334
+ __decorateClass$w([
8318
8335
  property({ fallback: false })
8319
8336
  ], DrawboardEffect.prototype, "checkerboard", 2);
8320
- __decorateClass$x([
8337
+ __decorateClass$w([
8321
8338
  property({ fallback: 1 / 16 })
8322
8339
  ], DrawboardEffect.prototype, "checkerboardScale", 2);
8323
- __decorateClass$x([
8340
+ __decorateClass$w([
8324
8341
  property({ fallback: false })
8325
8342
  ], DrawboardEffect.prototype, "pixelGrid", 2);
8326
- DrawboardEffect = __decorateClass$x([
8343
+ DrawboardEffect = __decorateClass$w([
8327
8344
  customNode("DrawboardEffect")
8328
8345
  ], DrawboardEffect);
8329
8346
 
8330
- var __defProp$t = Object.defineProperty;
8331
- var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
8332
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8333
- var __decorateClass$w = (decorators, target, key, kind) => {
8334
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$n(target, key) : target;
8347
+ var __defProp$s = Object.defineProperty;
8348
+ var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
8349
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8350
+ var __decorateClass$v = (decorators, target, key, kind) => {
8351
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$m(target, key) : target;
8335
8352
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8336
8353
  if (decorator = decorators[i])
8337
8354
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8338
- if (kind && result) __defProp$t(target, key, result);
8355
+ if (kind && result) __defProp$s(target, key, result);
8339
8356
  return result;
8340
8357
  };
8341
8358
  var __publicField$d = (obj, key, value) => __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -8441,25 +8458,25 @@ void main(void) {
8441
8458
  }`,
8442
8459
  frag: frag$2
8443
8460
  }));
8444
- __decorateClass$w([
8461
+ __decorateClass$v([
8445
8462
  property({ fallback: 4 })
8446
8463
  ], GaussianBlurEffect.prototype, "strength", 2);
8447
- __decorateClass$w([
8464
+ __decorateClass$v([
8448
8465
  property({ fallback: 3 })
8449
8466
  ], GaussianBlurEffect.prototype, "quality", 2);
8450
- GaussianBlurEffect = __decorateClass$w([
8467
+ GaussianBlurEffect = __decorateClass$v([
8451
8468
  customNode("GaussianBlurEffect")
8452
8469
  ], GaussianBlurEffect);
8453
8470
 
8454
- var __defProp$s = Object.defineProperty;
8455
- var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
8456
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8457
- var __decorateClass$v = (decorators, target, key, kind) => {
8458
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$m(target, key) : target;
8471
+ var __defProp$r = Object.defineProperty;
8472
+ var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor;
8473
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8474
+ var __decorateClass$u = (decorators, target, key, kind) => {
8475
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$l(target, key) : target;
8459
8476
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8460
8477
  if (decorator = decorators[i])
8461
8478
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8462
- if (kind && result) __defProp$s(target, key, result);
8479
+ if (kind && result) __defProp$r(target, key, result);
8463
8480
  return result;
8464
8481
  };
8465
8482
  var __publicField$c = (obj, key, value) => __defNormalProp$c(obj, key + "" , value);
@@ -8523,34 +8540,34 @@ void main(void) {
8523
8540
  gl_FragColor = sample;
8524
8541
  }`
8525
8542
  }));
8526
- __decorateClass$v([
8543
+ __decorateClass$u([
8527
8544
  property({ fallback: "#000000FF" })
8528
8545
  ], DropShadowEffect.prototype, "color", 2);
8529
- __decorateClass$v([
8546
+ __decorateClass$u([
8530
8547
  property({ fallback: 4 })
8531
8548
  ], DropShadowEffect.prototype, "blur", 2);
8532
- __decorateClass$v([
8549
+ __decorateClass$u([
8533
8550
  property({ fallback: 4 })
8534
8551
  ], DropShadowEffect.prototype, "offsetX", 2);
8535
- __decorateClass$v([
8552
+ __decorateClass$u([
8536
8553
  property({ fallback: 4 })
8537
8554
  ], DropShadowEffect.prototype, "offsetY", 2);
8538
- __decorateClass$v([
8555
+ __decorateClass$u([
8539
8556
  property({ fallback: false })
8540
8557
  ], DropShadowEffect.prototype, "shadowOnly", 2);
8541
- DropShadowEffect = __decorateClass$v([
8558
+ DropShadowEffect = __decorateClass$u([
8542
8559
  customNode("DropShadowEffect")
8543
8560
  ], DropShadowEffect);
8544
8561
 
8545
- var __defProp$r = Object.defineProperty;
8546
- var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor;
8547
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8548
- var __decorateClass$u = (decorators, target, key, kind) => {
8549
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$l(target, key) : target;
8562
+ var __defProp$q = Object.defineProperty;
8563
+ var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
8564
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8565
+ var __decorateClass$t = (decorators, target, key, kind) => {
8566
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$k(target, key) : target;
8550
8567
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8551
8568
  if (decorator = decorators[i])
8552
8569
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8553
- if (kind && result) __defProp$r(target, key, result);
8570
+ if (kind && result) __defProp$q(target, key, result);
8554
8571
  return result;
8555
8572
  };
8556
8573
  var __publicField$b = (obj, key, value) => __defNormalProp$b(obj, key + "" , value);
@@ -8595,22 +8612,22 @@ void main(void) {
8595
8612
  gl_FragColor = vec4(color.rgb * alpha, alpha);
8596
8613
  }`
8597
8614
  }));
8598
- __decorateClass$u([
8615
+ __decorateClass$t([
8599
8616
  property({ fallback: 5 })
8600
8617
  ], EmbossEffect.prototype, "strength", 2);
8601
- EmbossEffect = __decorateClass$u([
8618
+ EmbossEffect = __decorateClass$t([
8602
8619
  customNode("EmbossEffect")
8603
8620
  ], EmbossEffect);
8604
8621
 
8605
- var __defProp$q = Object.defineProperty;
8606
- var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
8607
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8608
- var __decorateClass$t = (decorators, target, key, kind) => {
8609
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$k(target, key) : target;
8622
+ var __defProp$p = Object.defineProperty;
8623
+ var __getOwnPropDesc$j = Object.getOwnPropertyDescriptor;
8624
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8625
+ var __decorateClass$s = (decorators, target, key, kind) => {
8626
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$j(target, key) : target;
8610
8627
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8611
8628
  if (decorator = decorators[i])
8612
8629
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8613
- if (kind && result) __defProp$q(target, key, result);
8630
+ if (kind && result) __defProp$p(target, key, result);
8614
8631
  return result;
8615
8632
  };
8616
8633
  var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, key + "" , value);
@@ -8784,46 +8801,46 @@ void main(void) {
8784
8801
  gl_FragColor.a = texture2D(sampler, coord).a;
8785
8802
  }`
8786
8803
  }));
8787
- __decorateClass$t([
8804
+ __decorateClass$s([
8788
8805
  property({ fallback: 10 })
8789
8806
  ], GlitchEffect.prototype, "slices", 2);
8790
- __decorateClass$t([
8807
+ __decorateClass$s([
8791
8808
  property({ fallback: 512 })
8792
8809
  ], GlitchEffect.prototype, "sampleSize", 2);
8793
- __decorateClass$t([
8810
+ __decorateClass$s([
8794
8811
  property({ fallback: 100 })
8795
8812
  ], GlitchEffect.prototype, "offset", 2);
8796
- __decorateClass$t([
8813
+ __decorateClass$s([
8797
8814
  property({ fallback: 0 })
8798
8815
  ], GlitchEffect.prototype, "direction", 2);
8799
- __decorateClass$t([
8816
+ __decorateClass$s([
8800
8817
  property({ fallback: 2 })
8801
8818
  ], GlitchEffect.prototype, "fillMode", 2);
8802
- __decorateClass$t([
8819
+ __decorateClass$s([
8803
8820
  property({ fallback: 0 })
8804
8821
  ], GlitchEffect.prototype, "seed", 2);
8805
- __decorateClass$t([
8822
+ __decorateClass$s([
8806
8823
  property({ default: () => [2, 2] })
8807
8824
  ], GlitchEffect.prototype, "red", 2);
8808
- __decorateClass$t([
8825
+ __decorateClass$s([
8809
8826
  property({ default: () => [-10, 4] })
8810
8827
  ], GlitchEffect.prototype, "green", 2);
8811
- __decorateClass$t([
8828
+ __decorateClass$s([
8812
8829
  property({ default: () => [10, -4] })
8813
8830
  ], GlitchEffect.prototype, "blue", 2);
8814
- GlitchEffect = __decorateClass$t([
8831
+ GlitchEffect = __decorateClass$s([
8815
8832
  customNode("GlitchEffect")
8816
8833
  ], GlitchEffect);
8817
8834
 
8818
- var __defProp$p = Object.defineProperty;
8819
- var __getOwnPropDesc$j = Object.getOwnPropertyDescriptor;
8820
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8821
- var __decorateClass$s = (decorators, target, key, kind) => {
8822
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$j(target, key) : target;
8835
+ var __defProp$o = Object.defineProperty;
8836
+ var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
8837
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8838
+ var __decorateClass$r = (decorators, target, key, kind) => {
8839
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$i(target, key) : target;
8823
8840
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8824
8841
  if (decorator = decorators[i])
8825
8842
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8826
- if (kind && result) __defProp$p(target, key, result);
8843
+ if (kind && result) __defProp$o(target, key, result);
8827
8844
  return result;
8828
8845
  };
8829
8846
  var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, key + "" , value);
@@ -9001,39 +9018,39 @@ void main(void) {
9001
9018
  gl_FragColor = vec4(color.rgb + mist.rgb, color.a);
9002
9019
  }`
9003
9020
  }));
9004
- __decorateClass$s([
9021
+ __decorateClass$r([
9005
9022
  property({ fallback: 0 })
9006
9023
  ], GodrayEffect.prototype, "time", 2);
9007
- __decorateClass$s([
9024
+ __decorateClass$r([
9008
9025
  property({ fallback: 30 })
9009
9026
  ], GodrayEffect.prototype, "angle", 2);
9010
- __decorateClass$s([
9027
+ __decorateClass$r([
9011
9028
  property({ fallback: 0.5 })
9012
9029
  ], GodrayEffect.prototype, "gain", 2);
9013
- __decorateClass$s([
9030
+ __decorateClass$r([
9014
9031
  property({ fallback: 2.5 })
9015
9032
  ], GodrayEffect.prototype, "lacunarity", 2);
9016
- __decorateClass$s([
9033
+ __decorateClass$r([
9017
9034
  property({ fallback: true })
9018
9035
  ], GodrayEffect.prototype, "parallel", 2);
9019
- __decorateClass$s([
9036
+ __decorateClass$r([
9020
9037
  property({ default: () => [0, 0] })
9021
9038
  ], GodrayEffect.prototype, "center", 2);
9022
- __decorateClass$s([
9039
+ __decorateClass$r([
9023
9040
  property({ fallback: 1 })
9024
9041
  ], GodrayEffect.prototype, "alpha", 2);
9025
- GodrayEffect = __decorateClass$s([
9042
+ GodrayEffect = __decorateClass$r([
9026
9043
  customNode("GodrayEffect")
9027
9044
  ], GodrayEffect);
9028
9045
 
9029
- var __defProp$o = Object.defineProperty;
9030
- var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
9031
- var __decorateClass$r = (decorators, target, key, kind) => {
9032
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$i(target, key) : target;
9046
+ var __defProp$n = Object.defineProperty;
9047
+ var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
9048
+ var __decorateClass$q = (decorators, target, key, kind) => {
9049
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
9033
9050
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9034
9051
  if (decorator = decorators[i])
9035
9052
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9036
- if (kind && result) __defProp$o(target, key, result);
9053
+ if (kind && result) __defProp$n(target, key, result);
9037
9054
  return result;
9038
9055
  };
9039
9056
  const frag$1 = `varying vec2 vUv;
@@ -9123,28 +9140,28 @@ void main() {
9123
9140
  });
9124
9141
  }
9125
9142
  };
9126
- __decorateClass$r([
9143
+ __decorateClass$q([
9127
9144
  property({ fallback: 4 })
9128
9145
  ], KawaseBlurEffect.prototype, "strength", 2);
9129
- __decorateClass$r([
9146
+ __decorateClass$q([
9130
9147
  property({ fallback: 3 })
9131
9148
  ], KawaseBlurEffect.prototype, "quality", 2);
9132
- __decorateClass$r([
9149
+ __decorateClass$q([
9133
9150
  property({ default: () => [1, 1] })
9134
9151
  ], KawaseBlurEffect.prototype, "pixelSize", 2);
9135
- KawaseBlurEffect = __decorateClass$r([
9152
+ KawaseBlurEffect = __decorateClass$q([
9136
9153
  customNode("KawaseBlurEffect")
9137
9154
  ], KawaseBlurEffect);
9138
9155
 
9139
- var __defProp$n = Object.defineProperty;
9140
- var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
9141
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9142
- var __decorateClass$q = (decorators, target, key, kind) => {
9143
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
9156
+ var __defProp$m = Object.defineProperty;
9157
+ var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
9158
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9159
+ var __decorateClass$p = (decorators, target, key, kind) => {
9160
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
9144
9161
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9145
9162
  if (decorator = decorators[i])
9146
9163
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9147
- if (kind && result) __defProp$n(target, key, result);
9164
+ if (kind && result) __defProp$m(target, key, result);
9148
9165
  return result;
9149
9166
  };
9150
9167
  var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, key + "" , value);
@@ -9232,25 +9249,25 @@ void main(void) {
9232
9249
  }
9233
9250
  }`
9234
9251
  }));
9235
- __decorateClass$q([
9252
+ __decorateClass$p([
9236
9253
  property({ internal: true })
9237
9254
  ], MaskEffect.prototype, "texture", 2);
9238
- __decorateClass$q([
9255
+ __decorateClass$p([
9239
9256
  property({ fallback: "" })
9240
9257
  ], MaskEffect.prototype, "src", 2);
9241
- MaskEffect = __decorateClass$q([
9258
+ MaskEffect = __decorateClass$p([
9242
9259
  customNode("MaskEffect")
9243
9260
  ], MaskEffect);
9244
9261
 
9245
- var __defProp$m = Object.defineProperty;
9246
- var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
9247
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9248
- var __decorateClass$p = (decorators, target, key, kind) => {
9249
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
9262
+ var __defProp$l = Object.defineProperty;
9263
+ var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
9264
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9265
+ var __decorateClass$o = (decorators, target, key, kind) => {
9266
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
9250
9267
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9251
9268
  if (decorator = decorators[i])
9252
9269
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9253
- if (kind && result) __defProp$m(target, key, result);
9270
+ if (kind && result) __defProp$l(target, key, result);
9254
9271
  return result;
9255
9272
  };
9256
9273
  var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -9337,40 +9354,40 @@ void main() {
9337
9354
  };
9338
9355
  __publicField$7(OutlineEffect, "MIN_SAMPLES", 1);
9339
9356
  __publicField$7(OutlineEffect, "MAX_SAMPLES", 100);
9340
- __decorateClass$p([
9357
+ __decorateClass$o([
9341
9358
  property({ fallback: "#000000ff" })
9342
9359
  ], OutlineEffect.prototype, "color", 2);
9343
- __decorateClass$p([
9360
+ __decorateClass$o([
9344
9361
  property({ fallback: 1 })
9345
9362
  ], OutlineEffect.prototype, "width", 2);
9346
- __decorateClass$p([
9363
+ __decorateClass$o([
9347
9364
  property({ fallback: "solid" })
9348
9365
  ], OutlineEffect.prototype, "style", 2);
9349
- __decorateClass$p([
9366
+ __decorateClass$o([
9350
9367
  property()
9351
9368
  ], OutlineEffect.prototype, "image", 2);
9352
- __decorateClass$p([
9369
+ __decorateClass$o([
9353
9370
  property({ fallback: 1 })
9354
9371
  ], OutlineEffect.prototype, "opacity", 2);
9355
- __decorateClass$p([
9372
+ __decorateClass$o([
9356
9373
  property({ fallback: 0.1 })
9357
9374
  ], OutlineEffect.prototype, "quality", 2);
9358
- __decorateClass$p([
9375
+ __decorateClass$o([
9359
9376
  property({ fallback: false })
9360
9377
  ], OutlineEffect.prototype, "knockout", 2);
9361
- OutlineEffect = __decorateClass$p([
9378
+ OutlineEffect = __decorateClass$o([
9362
9379
  customNode("OutlineEffect")
9363
9380
  ], OutlineEffect);
9364
9381
 
9365
- var __defProp$l = Object.defineProperty;
9366
- var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
9367
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9368
- var __decorateClass$o = (decorators, target, key, kind) => {
9369
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
9382
+ var __defProp$k = Object.defineProperty;
9383
+ var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
9384
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9385
+ var __decorateClass$n = (decorators, target, key, kind) => {
9386
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
9370
9387
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9371
9388
  if (decorator = decorators[i])
9372
9389
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9373
- if (kind && result) __defProp$l(target, key, result);
9390
+ if (kind && result) __defProp$k(target, key, result);
9374
9391
  return result;
9375
9392
  };
9376
9393
  var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, key + "" , value);
@@ -9426,22 +9443,22 @@ void main(void) {
9426
9443
  gl_FragColor = texture2D(sampler, coord);
9427
9444
  }`
9428
9445
  }));
9429
- __decorateClass$o([
9446
+ __decorateClass$n([
9430
9447
  property({ fallback: 10 })
9431
9448
  ], PixelateEffect.prototype, "strength", 2);
9432
- PixelateEffect = __decorateClass$o([
9449
+ PixelateEffect = __decorateClass$n([
9433
9450
  customNode("PixelateEffect")
9434
9451
  ], PixelateEffect);
9435
9452
 
9436
- var __defProp$k = Object.defineProperty;
9437
- var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
9438
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9439
- var __decorateClass$n = (decorators, target, key, kind) => {
9440
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
9453
+ var __defProp$j = Object.defineProperty;
9454
+ var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
9455
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9456
+ var __decorateClass$m = (decorators, target, key, kind) => {
9457
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
9441
9458
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9442
9459
  if (decorator = decorators[i])
9443
9460
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9444
- if (kind && result) __defProp$k(target, key, result);
9461
+ if (kind && result) __defProp$j(target, key, result);
9445
9462
  return result;
9446
9463
  };
9447
9464
  var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, key + "" , value);
@@ -9554,19 +9571,19 @@ void main() {
9554
9571
  gl_FragColor = color;
9555
9572
  }`
9556
9573
  }));
9557
- __decorateClass$n([
9574
+ __decorateClass$m([
9558
9575
  property()
9559
9576
  ], ZoomBlurEffect.prototype, "center", 2);
9560
- __decorateClass$n([
9577
+ __decorateClass$m([
9561
9578
  property({ fallback: 20 })
9562
9579
  ], ZoomBlurEffect.prototype, "innerRadius", 2);
9563
- __decorateClass$n([
9580
+ __decorateClass$m([
9564
9581
  property({ fallback: -1 })
9565
9582
  ], ZoomBlurEffect.prototype, "radius", 2);
9566
- __decorateClass$n([
9583
+ __decorateClass$m([
9567
9584
  property({ fallback: 0.1 })
9568
9585
  ], ZoomBlurEffect.prototype, "strength", 2);
9569
- ZoomBlurEffect = __decorateClass$n([
9586
+ ZoomBlurEffect = __decorateClass$m([
9570
9587
  customNode("ZoomBlurEffect")
9571
9588
  ], ZoomBlurEffect);
9572
9589
 
@@ -9614,13 +9631,13 @@ function getDrawOptions(fill, box) {
9614
9631
  return { disableWrapMode, uvTransform };
9615
9632
  }
9616
9633
 
9617
- var __defProp$j = Object.defineProperty;
9618
- var __decorateClass$m = (decorators, target, key, kind) => {
9634
+ var __defProp$i = Object.defineProperty;
9635
+ var __decorateClass$l = (decorators, target, key, kind) => {
9619
9636
  var result = void 0 ;
9620
9637
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9621
9638
  if (decorator = decorators[i])
9622
9639
  result = (decorator(target, key, result) ) || result;
9623
- if (result) __defProp$j(target, key, result);
9640
+ if (result) __defProp$i(target, key, result);
9624
9641
  return result;
9625
9642
  };
9626
9643
  class BaseElement2DFill extends CoreObject {
@@ -9678,7 +9695,7 @@ class BaseElement2DFill extends CoreObject {
9678
9695
  await this.loadTexture();
9679
9696
  this.parent.requestRedraw();
9680
9697
  }
9681
- canDraw() {
9698
+ isValid() {
9682
9699
  return Boolean(
9683
9700
  this.enabled && (this._texture || this._animatedTexture || this.color)
9684
9701
  );
@@ -9730,47 +9747,47 @@ class BaseElement2DFill extends CoreObject {
9730
9747
  return this;
9731
9748
  }
9732
9749
  }
9733
- __decorateClass$m([
9750
+ __decorateClass$l([
9734
9751
  property({ fallback: true })
9735
9752
  ], BaseElement2DFill.prototype, "enabled");
9736
- __decorateClass$m([
9753
+ __decorateClass$l([
9737
9754
  property()
9738
9755
  ], BaseElement2DFill.prototype, "color");
9739
- __decorateClass$m([
9756
+ __decorateClass$l([
9740
9757
  property()
9741
9758
  ], BaseElement2DFill.prototype, "image");
9742
- __decorateClass$m([
9759
+ __decorateClass$l([
9743
9760
  property()
9744
9761
  ], BaseElement2DFill.prototype, "linearGradient");
9745
- __decorateClass$m([
9762
+ __decorateClass$l([
9746
9763
  property()
9747
9764
  ], BaseElement2DFill.prototype, "radialGradient");
9748
- __decorateClass$m([
9765
+ __decorateClass$l([
9749
9766
  property()
9750
9767
  ], BaseElement2DFill.prototype, "cropRect");
9751
- __decorateClass$m([
9768
+ __decorateClass$l([
9752
9769
  property()
9753
9770
  ], BaseElement2DFill.prototype, "stretchRect");
9754
- __decorateClass$m([
9771
+ __decorateClass$l([
9755
9772
  property()
9756
9773
  ], BaseElement2DFill.prototype, "dpi");
9757
- __decorateClass$m([
9774
+ __decorateClass$l([
9758
9775
  property()
9759
9776
  ], BaseElement2DFill.prototype, "rotateWithShape");
9760
- __decorateClass$m([
9777
+ __decorateClass$l([
9761
9778
  property()
9762
9779
  ], BaseElement2DFill.prototype, "tile");
9763
- __decorateClass$m([
9780
+ __decorateClass$l([
9764
9781
  property()
9765
9782
  ], BaseElement2DFill.prototype, "opacity");
9766
9783
 
9767
- var __defProp$i = Object.defineProperty;
9768
- var __decorateClass$l = (decorators, target, key, kind) => {
9784
+ var __defProp$h = Object.defineProperty;
9785
+ var __decorateClass$k = (decorators, target, key, kind) => {
9769
9786
  var result = void 0 ;
9770
9787
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9771
9788
  if (decorator = decorators[i])
9772
9789
  result = (decorator(target, key, result) ) || result;
9773
- if (result) __defProp$i(target, key, result);
9790
+ if (result) __defProp$h(target, key, result);
9774
9791
  return result;
9775
9792
  };
9776
9793
  class BaseElement2DBackground extends BaseElement2DFill {
@@ -9788,17 +9805,17 @@ class BaseElement2DBackground extends BaseElement2DFill {
9788
9805
  }
9789
9806
  }
9790
9807
  }
9791
- __decorateClass$l([
9808
+ __decorateClass$k([
9792
9809
  property()
9793
9810
  ], BaseElement2DBackground.prototype, "fillWithShape");
9794
9811
 
9795
- var __defProp$h = Object.defineProperty;
9796
- var __decorateClass$k = (decorators, target, key, kind) => {
9812
+ var __defProp$g = Object.defineProperty;
9813
+ var __decorateClass$j = (decorators, target, key, kind) => {
9797
9814
  var result = void 0 ;
9798
9815
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9799
9816
  if (decorator = decorators[i])
9800
9817
  result = (decorator(target, key, result) ) || result;
9801
- if (result) __defProp$h(target, key, result);
9818
+ if (result) __defProp$g(target, key, result);
9802
9819
  return result;
9803
9820
  };
9804
9821
  class BaseElement2DForeground extends BaseElement2DFill {
@@ -9816,17 +9833,17 @@ class BaseElement2DForeground extends BaseElement2DFill {
9816
9833
  }
9817
9834
  }
9818
9835
  }
9819
- __decorateClass$k([
9836
+ __decorateClass$j([
9820
9837
  property()
9821
9838
  ], BaseElement2DForeground.prototype, "fillWithShape");
9822
9839
 
9823
- var __defProp$g = Object.defineProperty;
9824
- var __decorateClass$j = (decorators, target, key, kind) => {
9840
+ var __defProp$f = Object.defineProperty;
9841
+ var __decorateClass$i = (decorators, target, key, kind) => {
9825
9842
  var result = void 0 ;
9826
9843
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9827
9844
  if (decorator = decorators[i])
9828
9845
  result = (decorator(target, key, result) ) || result;
9829
- if (result) __defProp$g(target, key, result);
9846
+ if (result) __defProp$f(target, key, result);
9830
9847
  return result;
9831
9848
  };
9832
9849
  class BaseElement2DOutline extends BaseElement2DFill {
@@ -9847,9 +9864,9 @@ class BaseElement2DOutline extends BaseElement2DFill {
9847
9864
  break;
9848
9865
  }
9849
9866
  }
9850
- canDraw() {
9867
+ isValid() {
9851
9868
  return Boolean(
9852
- this.enabled && (this.width || this.color || super.canDraw())
9869
+ this.enabled && (this.width || this.color || super.isValid())
9853
9870
  );
9854
9871
  }
9855
9872
  draw() {
@@ -9869,29 +9886,29 @@ class BaseElement2DOutline extends BaseElement2DFill {
9869
9886
  ctx.stroke({ disableWrapMode });
9870
9887
  }
9871
9888
  }
9872
- __decorateClass$j([
9889
+ __decorateClass$i([
9873
9890
  property({ fallback: "#00000000" })
9874
9891
  ], BaseElement2DOutline.prototype, "color");
9875
- __decorateClass$j([
9892
+ __decorateClass$i([
9876
9893
  property({ fallback: 0 })
9877
9894
  ], BaseElement2DOutline.prototype, "width");
9878
- __decorateClass$j([
9895
+ __decorateClass$i([
9879
9896
  property({ fallback: "solid" })
9880
9897
  ], BaseElement2DOutline.prototype, "style");
9881
- __decorateClass$j([
9898
+ __decorateClass$i([
9882
9899
  property({ fallback: "butt" })
9883
9900
  ], BaseElement2DOutline.prototype, "lineCap");
9884
- __decorateClass$j([
9901
+ __decorateClass$i([
9885
9902
  property({ fallback: "miter" })
9886
9903
  ], BaseElement2DOutline.prototype, "lineJoin");
9887
9904
 
9888
- var __defProp$f = Object.defineProperty;
9889
- var __decorateClass$i = (decorators, target, key, kind) => {
9905
+ var __defProp$e = Object.defineProperty;
9906
+ var __decorateClass$h = (decorators, target, key, kind) => {
9890
9907
  var result = void 0 ;
9891
9908
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9892
9909
  if (decorator = decorators[i])
9893
9910
  result = (decorator(target, key, result) ) || result;
9894
- if (result) __defProp$f(target, key, result);
9911
+ if (result) __defProp$e(target, key, result);
9895
9912
  return result;
9896
9913
  };
9897
9914
  class BaseElement2DShadow extends CoreObject {
@@ -9931,29 +9948,29 @@ class BaseElement2DShadow extends CoreObject {
9931
9948
  }
9932
9949
  }
9933
9950
  }
9934
- __decorateClass$i([
9951
+ __decorateClass$h([
9935
9952
  property({ fallback: true })
9936
9953
  ], BaseElement2DShadow.prototype, "enabled");
9937
- __decorateClass$i([
9954
+ __decorateClass$h([
9938
9955
  property({ fallback: "#000000FF" })
9939
9956
  ], BaseElement2DShadow.prototype, "color");
9940
- __decorateClass$i([
9957
+ __decorateClass$h([
9941
9958
  property({ fallback: 0 })
9942
9959
  ], BaseElement2DShadow.prototype, "blur");
9943
- __decorateClass$i([
9960
+ __decorateClass$h([
9944
9961
  property({ fallback: 0 })
9945
9962
  ], BaseElement2DShadow.prototype, "offsetY");
9946
- __decorateClass$i([
9963
+ __decorateClass$h([
9947
9964
  property({ fallback: 0 })
9948
9965
  ], BaseElement2DShadow.prototype, "offsetX");
9949
9966
 
9950
- var __defProp$e = Object.defineProperty;
9951
- var __decorateClass$h = (decorators, target, key, kind) => {
9967
+ var __defProp$d = Object.defineProperty;
9968
+ var __decorateClass$g = (decorators, target, key, kind) => {
9952
9969
  var result = void 0 ;
9953
9970
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9954
9971
  if (decorator = decorators[i])
9955
9972
  result = (decorator(target, key, result) ) || result;
9956
- if (result) __defProp$e(target, key, result);
9973
+ if (result) __defProp$d(target, key, result);
9957
9974
  return result;
9958
9975
  };
9959
9976
  class BaseElement2DShape extends CoreObject {
@@ -10004,18 +10021,18 @@ class BaseElement2DShape extends CoreObject {
10004
10021
  path.applyTransform(new Matrix3$1().translate(-x, -y).scale(1 / w, 1 / h));
10005
10022
  });
10006
10023
  }
10007
- draw() {
10008
- if (this.enabled && this._path2DSet.paths.length) {
10024
+ draw(rect = false) {
10025
+ if (!rect && this.enabled && this._path2DSet.paths.length) {
10009
10026
  const ctx = this.parent.context;
10010
10027
  const { width, height } = this.parent.size;
10011
10028
  this._path2DSet.paths.forEach((path) => {
10012
10029
  ctx.addPath(path.clone().applyTransform(new Matrix3$1().scale(width, height)));
10013
10030
  });
10014
10031
  } else {
10015
- this.drawRect();
10032
+ this._drawRect();
10016
10033
  }
10017
10034
  }
10018
- drawRect() {
10035
+ _drawRect() {
10019
10036
  const ctx = this.parent.context;
10020
10037
  const { width, height } = this.parent.size;
10021
10038
  const { borderRadius } = this.parent.style;
@@ -10028,19 +10045,19 @@ class BaseElement2DShape extends CoreObject {
10028
10045
  }
10029
10046
  }
10030
10047
  }
10031
- __decorateClass$h([
10048
+ __decorateClass$g([
10032
10049
  property({ fallback: true })
10033
10050
  ], BaseElement2DShape.prototype, "enabled");
10034
- __decorateClass$h([
10051
+ __decorateClass$g([
10035
10052
  property()
10036
10053
  ], BaseElement2DShape.prototype, "preset");
10037
- __decorateClass$h([
10054
+ __decorateClass$g([
10038
10055
  property()
10039
10056
  ], BaseElement2DShape.prototype, "svg");
10040
- __decorateClass$h([
10057
+ __decorateClass$g([
10041
10058
  property()
10042
10059
  ], BaseElement2DShape.prototype, "viewBox");
10043
- __decorateClass$h([
10060
+ __decorateClass$g([
10044
10061
  property()
10045
10062
  ], BaseElement2DShape.prototype, "paths");
10046
10063
 
@@ -10056,13 +10073,13 @@ for (const key in defaultStyles$1) {
10056
10073
  defineProperty(BaseElement2DStyle, key, { fallback });
10057
10074
  }
10058
10075
 
10059
- var __defProp$d = Object.defineProperty;
10060
- var __decorateClass$g = (decorators, target, key, kind) => {
10076
+ var __defProp$c = Object.defineProperty;
10077
+ var __decorateClass$f = (decorators, target, key, kind) => {
10061
10078
  var result = void 0 ;
10062
10079
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
10063
10080
  if (decorator = decorators[i])
10064
10081
  result = (decorator(target, key, result) ) || result;
10065
- if (result) __defProp$d(target, key, result);
10082
+ if (result) __defProp$c(target, key, result);
10066
10083
  return result;
10067
10084
  };
10068
10085
  class BaseElement2DText extends CoreObject {
@@ -10074,6 +10091,7 @@ class BaseElement2DText extends CoreObject {
10074
10091
  }
10075
10092
  base;
10076
10093
  measureResult;
10094
+ _texture = new CanvasTexture();
10077
10095
  _textureMap = /* @__PURE__ */ new Map();
10078
10096
  setProperties(properties) {
10079
10097
  return super.setProperties(
@@ -10084,24 +10102,28 @@ class BaseElement2DText extends CoreObject {
10084
10102
  super._updateProperty(key, value, oldValue);
10085
10103
  switch (key) {
10086
10104
  case "enabled":
10105
+ this.parent.requestRedraw();
10106
+ break;
10087
10107
  case "effects":
10088
10108
  case "measureDom":
10089
10109
  case "fonts":
10110
+ this.update();
10090
10111
  this.parent.requestRedraw();
10091
10112
  break;
10092
10113
  case "fill":
10093
10114
  case "outline":
10094
10115
  case "content":
10116
+ this.update();
10095
10117
  this._updateTextureMap();
10118
+ this.parent.requestRedraw();
10096
10119
  break;
10097
10120
  }
10098
10121
  }
10099
- _updateBase() {
10122
+ update() {
10100
10123
  this.base.fonts = this.base.fonts ?? this.parent.tree?.fonts;
10101
10124
  this.base.update();
10102
10125
  }
10103
10126
  _updateTextureMap() {
10104
- this._updateBase();
10105
10127
  this._textureMap.clear();
10106
10128
  const pGlyphBoxs = [];
10107
10129
  this.base.paragraphs.forEach((p, pIndex) => {
@@ -10128,7 +10150,6 @@ class BaseElement2DText extends CoreObject {
10128
10150
  this._updateTexture("fill", this.fill, glyphBox);
10129
10151
  this._updateTexture("outline", this.outline, glyphBox);
10130
10152
  }
10131
- this.parent.requestRedraw();
10132
10153
  }
10133
10154
  async _updateTexture(key, fill, box) {
10134
10155
  if (fill && Object.keys(fill).length > 0) {
@@ -10157,19 +10178,19 @@ class BaseElement2DText extends CoreObject {
10157
10178
  this.content = normalizeTextContent(content);
10158
10179
  }
10159
10180
  measure() {
10160
- this._updateBase();
10181
+ this.update();
10161
10182
  return this.base.measure();
10162
10183
  }
10163
10184
  updateMeasure() {
10164
10185
  this.measureResult = this.measure();
10165
10186
  return this;
10166
10187
  }
10167
- canDraw() {
10188
+ isValid() {
10168
10189
  return Boolean(
10169
10190
  this.enabled && !/^\s*$/.test(this.base.toString())
10170
10191
  );
10171
10192
  }
10172
- _getVertTransform() {
10193
+ _createVertTransform() {
10173
10194
  const parent = this.parent;
10174
10195
  if (parent.scale.x > 0 && parent.scale.y > 0) {
10175
10196
  return void 0;
@@ -10178,9 +10199,12 @@ class BaseElement2DText extends CoreObject {
10178
10199
  const origin = parent.getTransformOrigin();
10179
10200
  return new Transform2D().translate(-origin.x, -origin.y).scale(scale > 0 ? 1 : -1, 1).translate(origin.x, origin.y);
10180
10201
  }
10181
- draw() {
10182
- const ctx = this.parent.context;
10183
- this._updateBase();
10202
+ useTextureDraw() {
10203
+ return !!this.effects?.length || this.content.some((p) => {
10204
+ return p.fragments.some((f) => !!f.highlightImage);
10205
+ });
10206
+ }
10207
+ _pathDraw(ctx) {
10184
10208
  this.base.pathSets.forEach((pathSet) => {
10185
10209
  pathSet.paths.forEach((path) => {
10186
10210
  const meta = path.getMeta();
@@ -10203,13 +10227,13 @@ class BaseElement2DText extends CoreObject {
10203
10227
  ctx.style = { ...path.style };
10204
10228
  ctx.uvTransform = uvTransform;
10205
10229
  ctx.fillStyle = texture?.texture ?? fill.color;
10206
- ctx.vertTransform = this._getVertTransform();
10230
+ ctx.vertTransform = this._createVertTransform();
10207
10231
  ctx.fill({ disableWrapMode });
10208
10232
  }
10209
10233
  } else {
10210
10234
  ctx.addPath(path);
10211
10235
  ctx.style = { ...path.style };
10212
- ctx.vertTransform = this._getVertTransform();
10236
+ ctx.vertTransform = this._createVertTransform();
10213
10237
  ctx.fill();
10214
10238
  }
10215
10239
  }
@@ -10232,54 +10256,70 @@ class BaseElement2DText extends CoreObject {
10232
10256
  ctx.strokeStyle = texture?.texture ?? outline.color;
10233
10257
  ctx.lineCap = outline.lineCap;
10234
10258
  ctx.lineJoin = outline.lineJoin;
10235
- ctx.vertTransform = this._getVertTransform();
10259
+ ctx.vertTransform = this._createVertTransform();
10236
10260
  ctx.stroke({ disableWrapMode });
10237
10261
  }
10238
10262
  } else {
10239
10263
  ctx.addPath(path);
10240
10264
  ctx.style = { ...path.style };
10241
- ctx.vertTransform = this._getVertTransform();
10265
+ ctx.vertTransform = this._createVertTransform();
10242
10266
  ctx.stroke();
10243
10267
  }
10244
10268
  }
10245
10269
  } else {
10246
10270
  ctx.addPath(path);
10247
10271
  ctx.style = { ...path.style };
10248
- ctx.vertTransform = this._getVertTransform();
10272
+ ctx.vertTransform = this._createVertTransform();
10249
10273
  ctx.fill();
10250
10274
  }
10251
10275
  });
10252
10276
  });
10253
10277
  }
10278
+ _textureDraw(ctx) {
10279
+ this._texture.width = Math.round(this.base.boundingBox.width);
10280
+ this._texture.height = Math.round(this.base.boundingBox.height);
10281
+ this.base.render({ view: this._texture.source });
10282
+ ctx.fillStyle = this._texture;
10283
+ ctx.vertTransform = this._createVertTransform();
10284
+ ctx.fill();
10285
+ }
10286
+ draw() {
10287
+ const ctx = this.parent.context;
10288
+ if (this.useTextureDraw()) {
10289
+ this._textureDraw(ctx);
10290
+ } else {
10291
+ this._pathDraw(ctx);
10292
+ }
10293
+ }
10254
10294
  }
10255
- __decorateClass$g([
10295
+ __decorateClass$f([
10256
10296
  property({ fallback: true })
10257
10297
  ], BaseElement2DText.prototype, "enabled");
10258
- __decorateClass$g([
10298
+ __decorateClass$f([
10259
10299
  property({ fallback: () => [] })
10260
10300
  ], BaseElement2DText.prototype, "content");
10261
- __decorateClass$g([
10301
+ __decorateClass$f([
10262
10302
  property({ alias: "parent.style.json" })
10263
10303
  ], BaseElement2DText.prototype, "style");
10264
- __decorateClass$g([
10304
+ __decorateClass$f([
10265
10305
  property()
10266
10306
  ], BaseElement2DText.prototype, "effects");
10267
- __decorateClass$g([
10307
+ __decorateClass$f([
10268
10308
  property()
10269
10309
  ], BaseElement2DText.prototype, "fill");
10270
- __decorateClass$g([
10310
+ __decorateClass$f([
10271
10311
  property()
10272
10312
  ], BaseElement2DText.prototype, "outline");
10273
- __decorateClass$g([
10313
+ __decorateClass$f([
10274
10314
  property({ alias: "base.measureDom" })
10275
10315
  ], BaseElement2DText.prototype, "measureDom");
10276
- __decorateClass$g([
10316
+ __decorateClass$f([
10277
10317
  property({ alias: "base.fonts" })
10278
10318
  ], BaseElement2DText.prototype, "fonts");
10279
10319
 
10280
- var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
10281
- var __decorateClass$f = (decorators, target, key, kind) => {
10282
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
10320
+ var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
10321
+ var __decorateClass$e = (decorators, target, key, kind) => {
10322
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
10283
10323
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
10284
10324
  if (decorator = decorators[i])
10285
10325
  result = (decorator(result)) || result;
@@ -10389,13 +10429,13 @@ let BaseElement2D = class extends Node2D {
10389
10429
  break;
10390
10430
  case "scaleX":
10391
10431
  this.scale.x = this.style.scaleX;
10392
- if (this.text.canDraw() && (value ^ oldValue) < 0) {
10432
+ if (this.text.isValid() && (value ^ oldValue) < 0) {
10393
10433
  this.requestRedraw();
10394
10434
  }
10395
10435
  break;
10396
10436
  case "scaleY":
10397
10437
  this.scale.y = this.style.scaleY;
10398
- if (this.text.canDraw() && (value ^ oldValue) < 0) {
10438
+ if (this.text.isValid() && (value ^ oldValue) < 0) {
10399
10439
  this.requestRedraw();
10400
10440
  }
10401
10441
  break;
@@ -10598,39 +10638,31 @@ let BaseElement2D = class extends Node2D {
10598
10638
  }
10599
10639
  _draw() {
10600
10640
  super._draw();
10601
- if (this._text.canDraw()) {
10602
- this._text.updateMeasure();
10603
- }
10604
- if (this._background.canDraw()) {
10641
+ if (this._background.isValid()) {
10605
10642
  this._tree?.log(this.name, "background drawing");
10606
- if (this._background.fillWithShape) {
10607
- this._shape.draw();
10608
- } else {
10609
- this._shape.drawRect();
10610
- }
10643
+ this._shape.draw(!this._background.fillWithShape);
10611
10644
  this._background.draw();
10612
10645
  }
10613
- if (this._fill.canDraw()) {
10646
+ if (this._fill.isValid()) {
10614
10647
  this._tree?.log(this.name, "fill drawing");
10615
10648
  this._shape.draw();
10616
10649
  this._fill.draw();
10617
10650
  }
10618
- if (this._outline.canDraw()) {
10651
+ if (this._outline.isValid()) {
10619
10652
  this._tree?.log(this.name, "outline drawing");
10620
10653
  this._shape.draw();
10621
10654
  this._outline.draw();
10622
10655
  }
10623
- if (this._foreground.canDraw()) {
10656
+ if (this._foreground.isValid()) {
10624
10657
  this._tree?.log(this.name, "foreground drawing");
10625
- if (this._foreground.fillWithShape) {
10626
- this._shape.draw();
10627
- } else {
10628
- this._shape.drawRect();
10629
- }
10658
+ this._shape.draw(!this._foreground.fillWithShape);
10630
10659
  this._foreground.draw();
10631
10660
  }
10632
- if (this._text.canDraw()) {
10661
+ if (this._text.isValid()) {
10633
10662
  this._tree?.log(this.name, "text drawing");
10663
+ if (this._text.useTextureDraw()) {
10664
+ this._shape.draw(true);
10665
+ }
10634
10666
  this._text.draw();
10635
10667
  }
10636
10668
  this._drawContent();
@@ -10706,7 +10738,7 @@ let BaseElement2D = class extends Node2D {
10706
10738
  });
10707
10739
  }
10708
10740
  };
10709
- BaseElement2D = __decorateClass$f([
10741
+ BaseElement2D = __decorateClass$e([
10710
10742
  customNode("BaseElement2D")
10711
10743
  ], BaseElement2D);
10712
10744
 
@@ -10733,9 +10765,9 @@ class FlexElement2DStyle extends BaseElement2DStyle {
10733
10765
  }
10734
10766
  }
10735
10767
 
10736
- var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
10737
- var __decorateClass$e = (decorators, target, key, kind) => {
10738
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
10768
+ var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
10769
+ var __decorateClass$d = (decorators, target, key, kind) => {
10770
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
10739
10771
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
10740
10772
  if (decorator = decorators[i])
10741
10773
  result = (decorator(result)) || result;
@@ -10786,7 +10818,7 @@ let Element2D = class extends BaseElement2D {
10786
10818
  }
10787
10819
  }
10788
10820
  };
10789
- Element2D = __decorateClass$e([
10821
+ Element2D = __decorateClass$d([
10790
10822
  customNode("Element2D")
10791
10823
  ], Element2D);
10792
10824
 
@@ -11096,9 +11128,9 @@ class FlexLayout {
11096
11128
  }
11097
11129
  }
11098
11130
 
11099
- var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
11100
- var __decorateClass$d = (decorators, target, key, kind) => {
11101
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
11131
+ var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
11132
+ var __decorateClass$c = (decorators, target, key, kind) => {
11133
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
11102
11134
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11103
11135
  if (decorator = decorators[i])
11104
11136
  result = (decorator(result)) || result;
@@ -11175,18 +11207,18 @@ let FlexElement2D = class extends BaseElement2D {
11175
11207
  }
11176
11208
  }
11177
11209
  };
11178
- FlexElement2D = __decorateClass$d([
11210
+ FlexElement2D = __decorateClass$c([
11179
11211
  customNode("FlexElement2D")
11180
11212
  ], FlexElement2D);
11181
11213
 
11182
- var __defProp$c = Object.defineProperty;
11183
- var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
11184
- var __decorateClass$c = (decorators, target, key, kind) => {
11185
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
11214
+ var __defProp$b = Object.defineProperty;
11215
+ var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
11216
+ var __decorateClass$b = (decorators, target, key, kind) => {
11217
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
11186
11218
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11187
11219
  if (decorator = decorators[i])
11188
11220
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11189
- if (kind && result) __defProp$c(target, key, result);
11221
+ if (kind && result) __defProp$b(target, key, result);
11190
11222
  return result;
11191
11223
  };
11192
11224
  let Image2D = class extends Element2D {
@@ -11298,7 +11330,7 @@ let Image2D = class extends Element2D {
11298
11330
  }
11299
11331
  _drawContent() {
11300
11332
  const texture = this.currentFrameTexture;
11301
- if (texture?.valid) {
11333
+ if (texture?.isValid()) {
11302
11334
  const { left = 0, top = 0, right = 0, bottom = 0 } = this.srcRect ?? {};
11303
11335
  const { width, height } = this.size;
11304
11336
  this.context.fillStyle = texture;
@@ -11322,19 +11354,19 @@ let Image2D = class extends Element2D {
11322
11354
  });
11323
11355
  }
11324
11356
  };
11325
- __decorateClass$c([
11357
+ __decorateClass$b([
11326
11358
  property({ internal: true })
11327
11359
  ], Image2D.prototype, "texture", 2);
11328
- __decorateClass$c([
11360
+ __decorateClass$b([
11329
11361
  property({ fallback: "" })
11330
11362
  ], Image2D.prototype, "src", 2);
11331
- __decorateClass$c([
11363
+ __decorateClass$b([
11332
11364
  property()
11333
11365
  ], Image2D.prototype, "srcRect", 2);
11334
- __decorateClass$c([
11366
+ __decorateClass$b([
11335
11367
  property({ fallback: false })
11336
11368
  ], Image2D.prototype, "gif", 2);
11337
- Image2D = __decorateClass$c([
11369
+ Image2D = __decorateClass$b([
11338
11370
  customNode("Image2D")
11339
11371
  ], Image2D);
11340
11372
 
@@ -11345,27 +11377,22 @@ class TextureRect2D extends Element2D {
11345
11377
  this.setProperties(properties).append(children);
11346
11378
  }
11347
11379
  _drawContent() {
11348
- if (this.texture?.valid) {
11349
- const { width, height } = this.size;
11380
+ if (this.texture?.isValid()) {
11381
+ this.shape.draw(true);
11350
11382
  this.context.fillStyle = this.texture;
11351
- this.context.uvTransform = new Transform2D().scale(
11352
- 1 / width,
11353
- 1 / height
11354
- );
11355
- this.shape.drawRect();
11356
11383
  this.context.fill();
11357
11384
  }
11358
11385
  }
11359
11386
  }
11360
11387
 
11361
- var __defProp$b = Object.defineProperty;
11362
- var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
11363
- var __decorateClass$b = (decorators, target, key, kind) => {
11364
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
11388
+ var __defProp$a = Object.defineProperty;
11389
+ var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
11390
+ var __decorateClass$a = (decorators, target, key, kind) => {
11391
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
11365
11392
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11366
11393
  if (decorator = decorators[i])
11367
11394
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11368
- if (kind && result) __defProp$b(target, key, result);
11395
+ if (kind && result) __defProp$a(target, key, result);
11369
11396
  return result;
11370
11397
  };
11371
11398
  let Lottie2D = class extends TextureRect2D {
@@ -11408,20 +11435,20 @@ let Lottie2D = class extends TextureRect2D {
11408
11435
  super._process(delta);
11409
11436
  }
11410
11437
  };
11411
- __decorateClass$b([
11438
+ __decorateClass$a([
11412
11439
  property({ fallback: "" })
11413
11440
  ], Lottie2D.prototype, "src", 2);
11414
- Lottie2D = __decorateClass$b([
11441
+ Lottie2D = __decorateClass$a([
11415
11442
  customNode("Lottie2D")
11416
11443
  ], Lottie2D);
11417
11444
 
11418
- var __defProp$a = Object.defineProperty;
11419
- var __decorateClass$a = (decorators, target, key, kind) => {
11445
+ var __defProp$9 = Object.defineProperty;
11446
+ var __decorateClass$9 = (decorators, target, key, kind) => {
11420
11447
  var result = void 0 ;
11421
11448
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11422
11449
  if (decorator = decorators[i])
11423
11450
  result = (decorator(target, key, result) ) || result;
11424
- if (result) __defProp$a(target, key, result);
11451
+ if (result) __defProp$9(target, key, result);
11425
11452
  return result;
11426
11453
  };
11427
11454
  class TransformRect2D extends Element2D {
@@ -11467,18 +11494,18 @@ class TransformRect2D extends Element2D {
11467
11494
  this._drawEllipse(width, height / 2);
11468
11495
  }
11469
11496
  }
11470
- __decorateClass$a([
11497
+ __decorateClass$9([
11471
11498
  property({ fallback: 6 })
11472
11499
  ], TransformRect2D.prototype, "handleSize");
11473
11500
 
11474
- var __defProp$9 = Object.defineProperty;
11475
- var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
11476
- var __decorateClass$9 = (decorators, target, key, kind) => {
11477
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
11501
+ var __defProp$8 = Object.defineProperty;
11502
+ var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
11503
+ var __decorateClass$8 = (decorators, target, key, kind) => {
11504
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
11478
11505
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11479
11506
  if (decorator = decorators[i])
11480
11507
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11481
- if (kind && result) __defProp$9(target, key, result);
11508
+ if (kind && result) __defProp$8(target, key, result);
11482
11509
  return result;
11483
11510
  };
11484
11511
  let Video2D = class extends TextureRect2D {
@@ -11531,21 +11558,21 @@ let Video2D = class extends TextureRect2D {
11531
11558
  super._process(delta);
11532
11559
  }
11533
11560
  };
11534
- __decorateClass$9([
11561
+ __decorateClass$8([
11535
11562
  property({ fallback: "" })
11536
11563
  ], Video2D.prototype, "src", 2);
11537
- Video2D = __decorateClass$9([
11564
+ Video2D = __decorateClass$8([
11538
11565
  customNode("Video2D")
11539
11566
  ], Video2D);
11540
11567
 
11541
- var __defProp$8 = Object.defineProperty;
11542
- var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
11543
- var __decorateClass$8 = (decorators, target, key, kind) => {
11544
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
11568
+ var __defProp$7 = Object.defineProperty;
11569
+ var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
11570
+ var __decorateClass$7 = (decorators, target, key, kind) => {
11571
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
11545
11572
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11546
11573
  if (decorator = decorators[i])
11547
11574
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11548
- if (kind && result) __defProp$8(target, key, result);
11575
+ if (kind && result) __defProp$7(target, key, result);
11549
11576
  return result;
11550
11577
  };
11551
11578
  const linear = (amount) => amount;
@@ -11864,19 +11891,16 @@ let Animation = class extends TimelineNode {
11864
11891
  });
11865
11892
  }
11866
11893
  };
11867
- __decorateClass$8([
11894
+ __decorateClass$7([
11868
11895
  property({ fallback: "parent" })
11869
11896
  ], Animation.prototype, "effectMode", 2);
11870
- __decorateClass$8([
11871
- property({ fallback: false })
11872
- ], Animation.prototype, "loop", 2);
11873
- __decorateClass$8([
11897
+ __decorateClass$7([
11874
11898
  property({ default: () => [] })
11875
11899
  ], Animation.prototype, "keyframes", 2);
11876
- __decorateClass$8([
11900
+ __decorateClass$7([
11877
11901
  property()
11878
11902
  ], Animation.prototype, "easing", 2);
11879
- Animation = __decorateClass$8([
11903
+ Animation = __decorateClass$7([
11880
11904
  customNode("Animation", {
11881
11905
  renderMode: "disabled",
11882
11906
  processMode: "pausable",
@@ -12757,11 +12781,11 @@ class WebAudio extends AudioPipeline {
12757
12781
  }
12758
12782
  }
12759
12783
 
12760
- var __defProp$7 = Object.defineProperty;
12761
- var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
12762
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12763
- var __decorateClass$7 = (decorators, target, key, kind) => {
12764
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
12784
+ var __defProp$6 = Object.defineProperty;
12785
+ var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
12786
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12787
+ var __decorateClass$6 = (decorators, target, key, kind) => {
12788
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
12765
12789
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
12766
12790
  if (decorator = decorators[i])
12767
12791
  result = (decorator(result)) || result;
@@ -12972,7 +12996,7 @@ let Audio = class extends TimelineNode {
12972
12996
  }
12973
12997
  };
12974
12998
  __publicField$4(Audio, "_soundPool", []);
12975
- Audio = __decorateClass$7([
12999
+ Audio = __decorateClass$6([
12976
13000
  customNode("Audio")
12977
13001
  ], Audio);
12978
13002
 
@@ -12980,14 +13004,14 @@ class AudioSpectrum extends Node2D {
12980
13004
  //
12981
13005
  }
12982
13006
 
12983
- var __defProp$6 = Object.defineProperty;
12984
- var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
12985
- var __decorateClass$6 = (decorators, target, key, kind) => {
12986
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
13007
+ var __defProp$5 = Object.defineProperty;
13008
+ var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
13009
+ var __decorateClass$5 = (decorators, target, key, kind) => {
13010
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
12987
13011
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
12988
13012
  if (decorator = decorators[i])
12989
13013
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
12990
- if (kind && result) __defProp$6(target, key, result);
13014
+ if (kind && result) __defProp$5(target, key, result);
12991
13015
  return result;
12992
13016
  };
12993
13017
  let AudioWaveform = class extends Element2D {
@@ -13069,7 +13093,7 @@ let AudioWaveform = class extends Element2D {
13069
13093
  }
13070
13094
  _drawSrc() {
13071
13095
  const src = this._src;
13072
- if (src?.valid) {
13096
+ if (src?.isValid()) {
13073
13097
  this.context.fillStyle = src;
13074
13098
  this.context.uvTransform = new Transform2D().scale(
13075
13099
  1 / this.style.width,
@@ -13078,109 +13102,19 @@ let AudioWaveform = class extends Element2D {
13078
13102
  }
13079
13103
  }
13080
13104
  };
13081
- __decorateClass$6([
13105
+ __decorateClass$5([
13082
13106
  property()
13083
13107
  ], AudioWaveform.prototype, "src", 2);
13084
- __decorateClass$6([
13108
+ __decorateClass$5([
13085
13109
  property({ fallback: 0 })
13086
13110
  ], AudioWaveform.prototype, "gap", 2);
13087
- __decorateClass$6([
13111
+ __decorateClass$5([
13088
13112
  property({ fallback: "#000000" })
13089
13113
  ], AudioWaveform.prototype, "color", 2);
13090
- AudioWaveform = __decorateClass$6([
13114
+ AudioWaveform = __decorateClass$5([
13091
13115
  customNode("AudioWaveform")
13092
13116
  ], AudioWaveform);
13093
13117
 
13094
- var __defProp$5 = Object.defineProperty;
13095
- var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
13096
- var __decorateClass$5 = (decorators, target, key, kind) => {
13097
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
13098
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
13099
- if (decorator = decorators[i])
13100
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
13101
- if (kind && result) __defProp$5(target, key, result);
13102
- return result;
13103
- };
13104
- let Scaler = class extends Node {
13105
- get target() {
13106
- if (this.parent?.style) {
13107
- return this.parent;
13108
- }
13109
- return void 0;
13110
- }
13111
- constructor(properties, children = []) {
13112
- super();
13113
- this.setProperties(properties);
13114
- this.append(children);
13115
- }
13116
- _updateProperty(key, value, oldValue) {
13117
- super._updateProperty(key, value, oldValue);
13118
- switch (key) {
13119
- case "translateY":
13120
- case "translateX":
13121
- case "scale":
13122
- case "min":
13123
- case "max": {
13124
- this.scale = clamp(this.scale, this.minScale, this.maxScale);
13125
- this._updateTarget();
13126
- break;
13127
- }
13128
- }
13129
- }
13130
- _updateTarget() {
13131
- const target = this.target;
13132
- if (target) {
13133
- target.style.transform = `translate(${this.translateX}px, ${this.translateY}px) scale(${this.scale})`;
13134
- this.emit("updateScale", this.scale);
13135
- }
13136
- }
13137
- _onWheel(e) {
13138
- const target = this.target;
13139
- if (!target)
13140
- return;
13141
- e.preventDefault();
13142
- if (e.ctrlKey) {
13143
- const isTouchPad = e.wheelDeltaY ? Math.abs(Math.abs(e.wheelDeltaY) - Math.abs(3 * e.deltaY)) < 3 : e.deltaMode === 0;
13144
- if (!isTouchPad) {
13145
- e.preventDefault();
13146
- this.scale += e.deltaY * -0.015;
13147
- }
13148
- } else {
13149
- this.translateX -= e.deltaX;
13150
- this.translateY -= e.deltaY;
13151
- }
13152
- }
13153
- _input(event, key) {
13154
- super._input(event, key);
13155
- switch (key) {
13156
- case "wheel":
13157
- this._onWheel(event);
13158
- break;
13159
- }
13160
- }
13161
- };
13162
- __decorateClass$5([
13163
- property({ default: 1 })
13164
- ], Scaler.prototype, "translateX", 2);
13165
- __decorateClass$5([
13166
- property({ default: 1 })
13167
- ], Scaler.prototype, "translateY", 2);
13168
- __decorateClass$5([
13169
- property({ default: 1 })
13170
- ], Scaler.prototype, "scale", 2);
13171
- __decorateClass$5([
13172
- property({ default: 0.05 })
13173
- ], Scaler.prototype, "minScale", 2);
13174
- __decorateClass$5([
13175
- property({ default: 10 })
13176
- ], Scaler.prototype, "maxScale", 2);
13177
- Scaler = __decorateClass$5([
13178
- customNode("Scaler", {
13179
- processMode: "disabled",
13180
- renderMode: "disabled"
13181
- })
13182
- ], Scaler);
13183
-
13184
13118
  var __defProp$4 = Object.defineProperty;
13185
13119
  var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
13186
13120
  var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -14156,4 +14090,4 @@ async function render(options) {
14156
14090
  });
14157
14091
  }
14158
14092
 
14159
- export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DBackground, BaseElement2DFill, BaseElement2DForeground, BaseElement2DOutline, BaseElement2DShadow, BaseElement2DShape, BaseElement2DStyle, BaseElement2DText, Camera2D, CanvasContext, CanvasItem, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DrawboardEffect, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GaussianBlurEffect, Geometry, GifLoader, GlitchEffect, GodrayEffect, GradientTexture, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JsonLoader, KawaseBlurEffect, KawaseTransition, KeyboardInputEvent, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, Meta, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, RawWeakMap, Rect2, RefCounted, Renderer, Resource, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, Scaler, SceneTree, TextLoader, Texture2D, TextureLoader, TextureRect2D, Ticker, TiltShiftTransition, Timeline, TimelineNode, Transform2D, TransformRect2D, Transition, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, Window, ZoomBlurEffect, alignMap, assets, boxSizingMap, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, determineCrossOrigin, directionMap, displayMap, ease, easeIn, easeInOut, easeOut, edgeMap, flexDirectionMap, flexWrapMap, frag$1 as frag, getDefaultCssPropertyValue, gutterMap, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, justifyMap, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, overflowMap, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, positionTypeMap, render, timingFunctions, uid };
14093
+ export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DBackground, BaseElement2DFill, BaseElement2DForeground, BaseElement2DOutline, BaseElement2DShadow, BaseElement2DShape, BaseElement2DStyle, BaseElement2DText, Camera2D, CanvasContext, CanvasItem, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DrawboardEffect, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GaussianBlurEffect, Geometry, GifLoader, GlitchEffect, GodrayEffect, GradientTexture, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JsonLoader, KawaseBlurEffect, KawaseTransition, KeyboardInputEvent, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, Meta, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, RawWeakMap, Rect2, RefCounted, Renderer, Resource, SUPPORTS_AUDIO_CONTEXT, SUPPORTS_CLICK_EVENTS, SUPPORTS_CREATE_IMAGE_BITMAP, SUPPORTS_IMAGE_BITMAP, SUPPORTS_MOUSE_EVENTS, SUPPORTS_OFFLINE_AUDIO_CONTEXT, SUPPORTS_POINTER_EVENTS, SUPPORTS_RESIZE_OBSERVER, SUPPORTS_TOUCH_EVENTS, SUPPORTS_WEBGL2, SUPPORTS_WEBKIT_AUDIO_CONTEXT, SUPPORTS_WEBKIT_OFFLINE_AUDIO_CONTEXT, SUPPORTS_WEB_AUDIO, SUPPORTS_WHEEL_EVENTS, SceneTree, TextLoader, Texture2D, TextureLoader, TextureRect2D, Ticker, TiltShiftTransition, Timeline, TimelineNode, Transform2D, TransformRect2D, Transition, TwistTransition, UvGeometry, UvMaterial, Vector, Vector2, Vector3, Vector4, VertexAttribute, VertexBuffer, Video2D, VideoLoader, VideoTexture, Viewport, ViewportTexture, WebAudio, WebAudioContext, WebGLBatch2DModule, WebGLBlendMode, WebGLBufferModule, WebGLFramebufferModule, WebGLMaskModule, WebGLModule, WebGLProgramModule, WebGLRenderer, WebGLScissorModule, WebGLState, WebGLStateModule, WebGLStencilModule, WebGLTextureModule, WebGLVertexArrayModule, WebGLViewportModule, WebSound, WheelInputEvent, Window, ZoomBlurEffect, alignMap, assets, boxSizingMap, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, determineCrossOrigin, directionMap, displayMap, ease, easeIn, easeInOut, easeOut, edgeMap, flexDirectionMap, flexWrapMap, frag$1 as frag, getDefaultCssPropertyValue, gutterMap, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, justifyMap, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, overflowMap, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, positionTypeMap, render, timingFunctions, uid };