modern-canvas 0.4.21 → 0.4.23

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
@@ -1,9 +1,9 @@
1
1
  import { colord, extend } from 'colord';
2
2
  import namesPlugin from 'colord/plugins/names';
3
+ import { Path2D, Path2DSet, svgToDOM, svgToPath2DSet, Matrix3 as Matrix3$1, svgPathCommandsAddToPath2D } from 'modern-path2d';
3
4
  import { getDefaultStyle } from 'modern-idoc';
4
- import { Path2D } from 'modern-path2d';
5
- import { loadYoga, BoxSizing, PositionType, Edge, Overflow, Gutter, Justify, Wrap, FlexDirection, Display, Direction, Align } from 'yoga-layout/load';
6
5
  import { Text, textDefaultStyle } from 'modern-text';
6
+ import { loadYoga, BoxSizing, PositionType, Edge, Overflow, Gutter, Justify, Wrap, FlexDirection, Display, Direction, Align } from 'yoga-layout/load';
7
7
 
8
8
  const PI = Math.PI;
9
9
  const PI_2 = PI * 2;
@@ -2149,13 +2149,13 @@ class Vector3 extends Vector {
2149
2149
  }
2150
2150
  }
2151
2151
 
2152
- var __defProp$J = Object.defineProperty;
2153
- var __decorateClass$R = (decorators, target, key, kind) => {
2152
+ var __defProp$O = Object.defineProperty;
2153
+ var __decorateClass$W = (decorators, target, key, kind) => {
2154
2154
  var result = void 0 ;
2155
2155
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
2156
2156
  if (decorator = decorators[i])
2157
2157
  result = (decorator(target, key, result) ) || result;
2158
- if (result) __defProp$J(target, key, result);
2158
+ if (result) __defProp$O(target, key, result);
2159
2159
  return result;
2160
2160
  };
2161
2161
  class MainLoop extends CoreObject {
@@ -2198,10 +2198,10 @@ class MainLoop extends CoreObject {
2198
2198
  this.stop();
2199
2199
  }
2200
2200
  }
2201
- __decorateClass$R([
2201
+ __decorateClass$W([
2202
2202
  property({ default: 24 })
2203
2203
  ], MainLoop.prototype, "fps");
2204
- __decorateClass$R([
2204
+ __decorateClass$W([
2205
2205
  property({ default: 1 })
2206
2206
  ], MainLoop.prototype, "speed");
2207
2207
 
@@ -4503,13 +4503,13 @@ class Geometry extends Resource {
4503
4503
  }
4504
4504
  }
4505
4505
 
4506
- var __defProp$I = Object.defineProperty;
4507
- var __decorateClass$Q = (decorators, target, key, kind) => {
4506
+ var __defProp$N = Object.defineProperty;
4507
+ var __decorateClass$V = (decorators, target, key, kind) => {
4508
4508
  var result = void 0 ;
4509
4509
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4510
4510
  if (decorator = decorators[i])
4511
4511
  result = (decorator(target, key, result) ) || result;
4512
- if (result) __defProp$I(target, key, result);
4512
+ if (result) __defProp$N(target, key, result);
4513
4513
  return result;
4514
4514
  };
4515
4515
  class IndexBuffer extends Resource {
@@ -4553,20 +4553,20 @@ class IndexBuffer extends Resource {
4553
4553
  return result;
4554
4554
  }
4555
4555
  }
4556
- __decorateClass$Q([
4556
+ __decorateClass$V([
4557
4557
  protectedProperty({ default: null })
4558
4558
  ], IndexBuffer.prototype, "data");
4559
- __decorateClass$Q([
4559
+ __decorateClass$V([
4560
4560
  protectedProperty({ default: false })
4561
4561
  ], IndexBuffer.prototype, "dynamic");
4562
4562
 
4563
- var __defProp$H = Object.defineProperty;
4564
- var __decorateClass$P = (decorators, target, key, kind) => {
4563
+ var __defProp$M = Object.defineProperty;
4564
+ var __decorateClass$U = (decorators, target, key, kind) => {
4565
4565
  var result = void 0 ;
4566
4566
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4567
4567
  if (decorator = decorators[i])
4568
4568
  result = (decorator(target, key, result) ) || result;
4569
- if (result) __defProp$H(target, key, result);
4569
+ if (result) __defProp$M(target, key, result);
4570
4570
  return result;
4571
4571
  };
4572
4572
  class VertexBuffer extends Resource {
@@ -4610,20 +4610,20 @@ class VertexBuffer extends Resource {
4610
4610
  return result;
4611
4611
  }
4612
4612
  }
4613
- __decorateClass$P([
4613
+ __decorateClass$U([
4614
4614
  protectedProperty({ default: null })
4615
4615
  ], VertexBuffer.prototype, "data");
4616
- __decorateClass$P([
4616
+ __decorateClass$U([
4617
4617
  protectedProperty({ default: false })
4618
4618
  ], VertexBuffer.prototype, "dynamic");
4619
4619
 
4620
- var __defProp$G = Object.defineProperty;
4621
- var __decorateClass$O = (decorators, target, key, kind) => {
4620
+ var __defProp$L = Object.defineProperty;
4621
+ var __decorateClass$T = (decorators, target, key, kind) => {
4622
4622
  var result = void 0 ;
4623
4623
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4624
4624
  if (decorator = decorators[i])
4625
4625
  result = (decorator(target, key, result) ) || result;
4626
- if (result) __defProp$G(target, key, result);
4626
+ if (result) __defProp$L(target, key, result);
4627
4627
  return result;
4628
4628
  };
4629
4629
  class VertexAttribute extends Resource {
@@ -4660,25 +4660,25 @@ class VertexAttribute extends Resource {
4660
4660
  return result;
4661
4661
  }
4662
4662
  }
4663
- __decorateClass$O([
4663
+ __decorateClass$T([
4664
4664
  protectedProperty()
4665
4665
  ], VertexAttribute.prototype, "buffer");
4666
- __decorateClass$O([
4666
+ __decorateClass$T([
4667
4667
  protectedProperty({ default: 0 })
4668
4668
  ], VertexAttribute.prototype, "size");
4669
- __decorateClass$O([
4669
+ __decorateClass$T([
4670
4670
  protectedProperty({ default: false })
4671
4671
  ], VertexAttribute.prototype, "normalized");
4672
- __decorateClass$O([
4672
+ __decorateClass$T([
4673
4673
  protectedProperty({ default: "float" })
4674
4674
  ], VertexAttribute.prototype, "type");
4675
- __decorateClass$O([
4675
+ __decorateClass$T([
4676
4676
  protectedProperty()
4677
4677
  ], VertexAttribute.prototype, "stride");
4678
- __decorateClass$O([
4678
+ __decorateClass$T([
4679
4679
  protectedProperty()
4680
4680
  ], VertexAttribute.prototype, "offset");
4681
- __decorateClass$O([
4681
+ __decorateClass$T([
4682
4682
  protectedProperty()
4683
4683
  ], VertexAttribute.prototype, "divisor");
4684
4684
 
@@ -4922,13 +4922,13 @@ class UvGeometry extends Geometry {
4922
4922
  }
4923
4923
  }
4924
4924
 
4925
- var __defProp$F = Object.defineProperty;
4926
- var __decorateClass$N = (decorators, target, key, kind) => {
4925
+ var __defProp$K = Object.defineProperty;
4926
+ var __decorateClass$S = (decorators, target, key, kind) => {
4927
4927
  var result = void 0 ;
4928
4928
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4929
4929
  if (decorator = decorators[i])
4930
4930
  result = (decorator(target, key, result) ) || result;
4931
- if (result) __defProp$F(target, key, result);
4931
+ if (result) __defProp$K(target, key, result);
4932
4932
  return result;
4933
4933
  };
4934
4934
  class Texture2D extends Resource {
@@ -5054,22 +5054,22 @@ class Texture2D extends Resource {
5054
5054
  }
5055
5055
  }
5056
5056
  }
5057
- __decorateClass$N([
5057
+ __decorateClass$S([
5058
5058
  protectedProperty()
5059
5059
  ], Texture2D.prototype, "source");
5060
- __decorateClass$N([
5060
+ __decorateClass$S([
5061
5061
  property({ default: 0 })
5062
5062
  ], Texture2D.prototype, "width");
5063
- __decorateClass$N([
5063
+ __decorateClass$S([
5064
5064
  property({ default: 0 })
5065
5065
  ], Texture2D.prototype, "height");
5066
- __decorateClass$N([
5066
+ __decorateClass$S([
5067
5067
  property({ default: "linear" })
5068
5068
  ], Texture2D.prototype, "filterMode");
5069
- __decorateClass$N([
5069
+ __decorateClass$S([
5070
5070
  property({ default: "clamp_to_edge" })
5071
5071
  ], Texture2D.prototype, "wrapMode");
5072
- __decorateClass$N([
5072
+ __decorateClass$S([
5073
5073
  property({ default: 1 })
5074
5074
  ], Texture2D.prototype, "pixelRatio");
5075
5075
 
@@ -5099,13 +5099,13 @@ class AnimatedTexture extends Resource {
5099
5099
  }
5100
5100
  }
5101
5101
 
5102
- var __defProp$E = Object.defineProperty;
5103
- var __decorateClass$M = (decorators, target, key, kind) => {
5102
+ var __defProp$J = Object.defineProperty;
5103
+ var __decorateClass$R = (decorators, target, key, kind) => {
5104
5104
  var result = void 0 ;
5105
5105
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5106
5106
  if (decorator = decorators[i])
5107
5107
  result = (decorator(target, key, result) ) || result;
5108
- if (result) __defProp$E(target, key, result);
5108
+ if (result) __defProp$J(target, key, result);
5109
5109
  return result;
5110
5110
  };
5111
5111
  class CanvasTexture extends Texture2D {
@@ -5124,7 +5124,7 @@ class CanvasTexture extends Texture2D {
5124
5124
  super._updateProperty(key, value, oldValue, declaration);
5125
5125
  }
5126
5126
  }
5127
- __decorateClass$M([
5127
+ __decorateClass$R([
5128
5128
  property({ default: 2 })
5129
5129
  ], CanvasTexture.prototype, "pixelRatio");
5130
5130
 
@@ -5286,13 +5286,13 @@ class PixelsTexture extends Texture2D {
5286
5286
  }
5287
5287
  }
5288
5288
 
5289
- var __defProp$D = Object.defineProperty;
5290
- var __decorateClass$L = (decorators, target, key, kind) => {
5289
+ var __defProp$I = Object.defineProperty;
5290
+ var __decorateClass$Q = (decorators, target, key, kind) => {
5291
5291
  var result = void 0 ;
5292
5292
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5293
5293
  if (decorator = decorators[i])
5294
5294
  result = (decorator(target, key, result) ) || result;
5295
- if (result) __defProp$D(target, key, result);
5295
+ if (result) __defProp$I(target, key, result);
5296
5296
  return result;
5297
5297
  };
5298
5298
  function resolveOptions(options) {
@@ -5536,10 +5536,10 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
5536
5536
  }
5537
5537
  }
5538
5538
  };
5539
- __decorateClass$L([
5539
+ __decorateClass$Q([
5540
5540
  protectedProperty({ default: true })
5541
5541
  ], _VideoTexture.prototype, "autoUpdate");
5542
- __decorateClass$L([
5542
+ __decorateClass$Q([
5543
5543
  protectedProperty({ default: 0 })
5544
5544
  ], _VideoTexture.prototype, "fps");
5545
5545
  let VideoTexture = _VideoTexture;
@@ -5548,14 +5548,14 @@ class ViewportTexture extends PixelsTexture {
5548
5548
  //
5549
5549
  }
5550
5550
 
5551
- var __defProp$C = Object.defineProperty;
5551
+ var __defProp$H = Object.defineProperty;
5552
5552
  var __getOwnPropDesc$I = Object.getOwnPropertyDescriptor;
5553
- var __decorateClass$K = (decorators, target, key, kind) => {
5553
+ var __decorateClass$P = (decorators, target, key, kind) => {
5554
5554
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$I(target, key) : target;
5555
5555
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5556
5556
  if (decorator = decorators[i])
5557
5557
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5558
- if (kind && result) __defProp$C(target, key, result);
5558
+ if (kind && result) __defProp$H(target, key, result);
5559
5559
  return result;
5560
5560
  };
5561
5561
  const tagUidMap = {};
@@ -5732,11 +5732,9 @@ let Node = class extends CoreObject {
5732
5732
  }
5733
5733
  }
5734
5734
  _update(changed) {
5735
- this._tree?.log(this.name, "updating");
5736
5735
  super._update(changed);
5737
5736
  }
5738
5737
  _updateProperty(key, value, oldValue, declaration) {
5739
- this._tree?.log(this.name, `updating [${String(key)}]`);
5740
5738
  super._updateProperty(key, value, oldValue, declaration);
5741
5739
  }
5742
5740
  _onTreeEnter(tree) {
@@ -6060,36 +6058,36 @@ let Node = class extends CoreObject {
6060
6058
  return node;
6061
6059
  }
6062
6060
  };
6063
- __decorateClass$K([
6061
+ __decorateClass$P([
6064
6062
  protectedProperty()
6065
6063
  ], Node.prototype, "name", 2);
6066
- __decorateClass$K([
6064
+ __decorateClass$P([
6067
6065
  property()
6068
6066
  ], Node.prototype, "mask", 2);
6069
- __decorateClass$K([
6067
+ __decorateClass$P([
6070
6068
  property({ default: "inherit" })
6071
6069
  ], Node.prototype, "processMode", 2);
6072
- __decorateClass$K([
6070
+ __decorateClass$P([
6073
6071
  property({ default: "default" })
6074
6072
  ], Node.prototype, "processSortMode", 2);
6075
- __decorateClass$K([
6073
+ __decorateClass$P([
6076
6074
  property({ default: "inherit" })
6077
6075
  ], Node.prototype, "renderMode", 2);
6078
- __decorateClass$K([
6076
+ __decorateClass$P([
6079
6077
  property({ default: "default" })
6080
6078
  ], Node.prototype, "internalMode", 2);
6081
- Node = __decorateClass$K([
6079
+ Node = __decorateClass$P([
6082
6080
  customNode("Node")
6083
6081
  ], Node);
6084
6082
 
6085
- var __defProp$B = Object.defineProperty;
6083
+ var __defProp$G = Object.defineProperty;
6086
6084
  var __getOwnPropDesc$H = Object.getOwnPropertyDescriptor;
6087
- var __decorateClass$J = (decorators, target, key, kind) => {
6085
+ var __decorateClass$O = (decorators, target, key, kind) => {
6088
6086
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$H(target, key) : target;
6089
6087
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6090
6088
  if (decorator = decorators[i])
6091
6089
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6092
- if (kind && result) __defProp$B(target, key, result);
6090
+ if (kind && result) __defProp$G(target, key, result);
6093
6091
  return result;
6094
6092
  };
6095
6093
  let TimelineNode = class extends Node {
@@ -6149,30 +6147,30 @@ let TimelineNode = class extends Node {
6149
6147
  this._updateCurrentTime();
6150
6148
  }
6151
6149
  };
6152
- __decorateClass$J([
6150
+ __decorateClass$O([
6153
6151
  property({ default: 0 })
6154
6152
  ], TimelineNode.prototype, "delay", 2);
6155
- __decorateClass$J([
6153
+ __decorateClass$O([
6156
6154
  property({ default: 0 })
6157
6155
  ], TimelineNode.prototype, "duration", 2);
6158
- __decorateClass$J([
6156
+ __decorateClass$O([
6159
6157
  property({ default: false })
6160
6158
  ], TimelineNode.prototype, "paused", 2);
6161
- __decorateClass$J([
6159
+ __decorateClass$O([
6162
6160
  protectedProperty()
6163
6161
  ], TimelineNode.prototype, "insideTimeRange", 2);
6164
- TimelineNode = __decorateClass$J([
6162
+ TimelineNode = __decorateClass$O([
6165
6163
  customNode("TimelineNode")
6166
6164
  ], TimelineNode);
6167
6165
 
6168
- var __defProp$A = Object.defineProperty;
6166
+ var __defProp$F = Object.defineProperty;
6169
6167
  var __getOwnPropDesc$G = Object.getOwnPropertyDescriptor;
6170
- var __decorateClass$I = (decorators, target, key, kind) => {
6168
+ var __decorateClass$N = (decorators, target, key, kind) => {
6171
6169
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$G(target, key) : target;
6172
6170
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6173
6171
  if (decorator = decorators[i])
6174
6172
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6175
- if (kind && result) __defProp$A(target, key, result);
6173
+ if (kind && result) __defProp$F(target, key, result);
6176
6174
  return result;
6177
6175
  };
6178
6176
  let Viewport = class extends Node {
@@ -6310,30 +6308,30 @@ let Viewport = class extends Node {
6310
6308
  return this._projection.toArray(transpose);
6311
6309
  }
6312
6310
  };
6313
- __decorateClass$I([
6311
+ __decorateClass$N([
6314
6312
  property({ default: 0 })
6315
6313
  ], Viewport.prototype, "x", 2);
6316
- __decorateClass$I([
6314
+ __decorateClass$N([
6317
6315
  property({ default: 0 })
6318
6316
  ], Viewport.prototype, "y", 2);
6319
- __decorateClass$I([
6317
+ __decorateClass$N([
6320
6318
  property({ default: 0 })
6321
6319
  ], Viewport.prototype, "width", 2);
6322
- __decorateClass$I([
6320
+ __decorateClass$N([
6323
6321
  property({ default: 0 })
6324
6322
  ], Viewport.prototype, "height", 2);
6325
- Viewport = __decorateClass$I([
6323
+ Viewport = __decorateClass$N([
6326
6324
  customNode("Viewport")
6327
6325
  ], Viewport);
6328
6326
 
6329
- var __defProp$z = Object.defineProperty;
6327
+ var __defProp$E = Object.defineProperty;
6330
6328
  var __getOwnPropDesc$F = Object.getOwnPropertyDescriptor;
6331
- var __decorateClass$H = (decorators, target, key, kind) => {
6329
+ var __decorateClass$M = (decorators, target, key, kind) => {
6332
6330
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$F(target, key) : target;
6333
6331
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6334
6332
  if (decorator = decorators[i])
6335
6333
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6336
- if (kind && result) __defProp$z(target, key, result);
6334
+ if (kind && result) __defProp$E(target, key, result);
6337
6335
  return result;
6338
6336
  };
6339
6337
  let Effect = class extends TimelineNode {
@@ -6574,151 +6572,34 @@ let Effect = class extends TimelineNode {
6574
6572
  }
6575
6573
  }
6576
6574
  };
6577
- __decorateClass$H([
6575
+ __decorateClass$M([
6578
6576
  protectedProperty()
6579
6577
  ], Effect.prototype, "material", 2);
6580
- __decorateClass$H([
6578
+ __decorateClass$M([
6581
6579
  property()
6582
6580
  ], Effect.prototype, "effectMode", 2);
6583
- __decorateClass$H([
6581
+ __decorateClass$M([
6584
6582
  property({ default: "" })
6585
6583
  ], Effect.prototype, "glsl", 2);
6586
- __decorateClass$H([
6584
+ __decorateClass$M([
6587
6585
  property({ default: "" })
6588
6586
  ], Effect.prototype, "glslSrc", 2);
6589
- Effect = __decorateClass$H([
6587
+ Effect = __decorateClass$M([
6590
6588
  customNode("Effect")
6591
6589
  ], Effect);
6592
6590
 
6593
- var __defProp$y = Object.defineProperty;
6591
+ var __defProp$D = Object.defineProperty;
6594
6592
  var __getOwnPropDesc$E = Object.getOwnPropertyDescriptor;
6595
- var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6596
- var __decorateClass$G = (decorators, target, key, kind) => {
6593
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6594
+ var __decorateClass$L = (decorators, target, key, kind) => {
6597
6595
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$E(target, key) : target;
6598
6596
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6599
6597
  if (decorator = decorators[i])
6600
6598
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6601
- if (kind && result) __defProp$y(target, key, result);
6602
- return result;
6603
- };
6604
- var __publicField$i = (obj, key, value) => __defNormalProp$i(obj, typeof key !== "symbol" ? key + "" : key, value);
6605
- const frag$2 = `varying vec2 vUv[9];
6606
- uniform sampler2D sampler;
6607
-
6608
- void main(void) {
6609
- gl_FragColor = vec4(0.0);
6610
- float flag = 0.0;
6611
- for (int i = 0; i < 9; i++) {
6612
- vec2 uv = vUv[i];
6613
- if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) {
6614
- flag = 1.0;
6615
- break;
6616
- }
6617
- }
6618
- if (flag == 1.0) {
6619
- gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;
6620
- gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;
6621
- gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;
6622
- gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;
6623
- gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;
6624
- gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;
6625
- gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;
6626
- gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;
6627
- gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;
6628
- } else {
6629
- gl_FragColor += texture2D(sampler, vUv[0]) * 0.028532;
6630
- gl_FragColor += texture2D(sampler, vUv[1]) * 0.067234;
6631
- gl_FragColor += texture2D(sampler, vUv[2]) * 0.124009;
6632
- gl_FragColor += texture2D(sampler, vUv[3]) * 0.179044;
6633
- gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;
6634
- gl_FragColor += texture2D(sampler, vUv[5]) * 0.179044;
6635
- gl_FragColor += texture2D(sampler, vUv[6]) * 0.124009;
6636
- gl_FragColor += texture2D(sampler, vUv[7]) * 0.067234;
6637
- gl_FragColor += texture2D(sampler, vUv[8]) * 0.028532;
6638
- }
6639
- }`;
6640
- let BlurEffect = class extends Effect {
6641
- constructor(properties, children = []) {
6642
- super();
6643
- this.setProperties(properties).append(children);
6644
- }
6645
- apply(renderer, source) {
6646
- source.redraw(renderer, () => {
6647
- QuadUvGeometry.draw(renderer, BlurEffect.materialX, {
6648
- sampler: 0,
6649
- strength: 1 / source.width * this.strength / this.quality
6650
- });
6651
- });
6652
- source.redraw(renderer, () => {
6653
- QuadUvGeometry.draw(renderer, BlurEffect.materialY, {
6654
- sampler: 0,
6655
- strength: 1 / source.height * this.strength / this.quality
6656
- });
6657
- });
6658
- }
6659
- };
6660
- __publicField$i(BlurEffect, "materialX", new Material({
6661
- vert: `attribute vec2 position;
6662
- attribute vec2 uv;
6663
- varying vec2 vUv[9];
6664
- uniform float strength;
6665
-
6666
- void main(void) {
6667
- gl_Position = vec4(position, 0, 1);
6668
- vUv[0] = uv + vec2(-4.0 * strength, 0.0);
6669
- vUv[1] = uv + vec2(-3.0 * strength, 0.0);
6670
- vUv[2] = uv + vec2(-2.0 * strength, 0.0);
6671
- vUv[3] = uv + vec2(-1.0 * strength, 0.0);
6672
- vUv[4] = uv + vec2(0.0 * strength, 0.0);
6673
- vUv[5] = uv + vec2(1.0 * strength, 0.0);
6674
- vUv[6] = uv + vec2(2.0 * strength, 0.0);
6675
- vUv[7] = uv + vec2(3.0 * strength, 0.0);
6676
- vUv[8] = uv + vec2(4.0 * strength, 0.0);
6677
- }`,
6678
- frag: frag$2
6679
- }));
6680
- __publicField$i(BlurEffect, "materialY", new Material({
6681
- vert: `attribute vec2 position;
6682
- attribute vec2 uv;
6683
- uniform float strength;
6684
- varying vec2 vUv[9];
6685
-
6686
- void main(void) {
6687
- gl_Position = vec4(position, 0, 1);
6688
- vUv[0] = uv + vec2(0.0, -4.0 * strength);
6689
- vUv[1] = uv + vec2(0.0, -3.0 * strength);
6690
- vUv[2] = uv + vec2(0.0, -2.0 * strength);
6691
- vUv[3] = uv + vec2(0.0, -1.0 * strength);
6692
- vUv[4] = uv + vec2(0.0, 0.0 * strength);
6693
- vUv[5] = uv + vec2(0.0, 1.0 * strength);
6694
- vUv[6] = uv + vec2(0.0, 2.0 * strength);
6695
- vUv[7] = uv + vec2(0.0, 3.0 * strength);
6696
- vUv[8] = uv + vec2(0.0, 4.0 * strength);
6697
- }`,
6698
- frag: frag$2
6699
- }));
6700
- __decorateClass$G([
6701
- property({ default: 4 })
6702
- ], BlurEffect.prototype, "strength", 2);
6703
- __decorateClass$G([
6704
- property({ default: 3 })
6705
- ], BlurEffect.prototype, "quality", 2);
6706
- BlurEffect = __decorateClass$G([
6707
- customNode("BlurEffect")
6708
- ], BlurEffect);
6709
-
6710
- var __defProp$x = Object.defineProperty;
6711
- var __getOwnPropDesc$D = Object.getOwnPropertyDescriptor;
6712
- var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6713
- var __decorateClass$F = (decorators, target, key, kind) => {
6714
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$D(target, key) : target;
6715
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
6716
- if (decorator = decorators[i])
6717
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6718
- if (kind && result) __defProp$x(target, key, result);
6599
+ if (kind && result) __defProp$D(target, key, result);
6719
6600
  return result;
6720
6601
  };
6721
- var __publicField$h = (obj, key, value) => __defNormalProp$h(obj, key + "" , value);
6602
+ var __publicField$i = (obj, key, value) => __defNormalProp$i(obj, key + "" , value);
6722
6603
  let ColorAdjustEffect = class extends Effect {
6723
6604
  constructor(properties, children = []) {
6724
6605
  super();
@@ -6740,7 +6621,7 @@ let ColorAdjustEffect = class extends Effect {
6740
6621
  });
6741
6622
  }
6742
6623
  };
6743
- __publicField$h(ColorAdjustEffect, "material", new Material({
6624
+ __publicField$i(ColorAdjustEffect, "material", new Material({
6744
6625
  vert: `precision mediump float;
6745
6626
  attribute vec2 position;
6746
6627
  attribute vec2 uv;
@@ -6775,46 +6656,46 @@ void main(void) {
6775
6656
  gl_FragColor = c * alpha;
6776
6657
  }`
6777
6658
  }));
6778
- __decorateClass$F([
6659
+ __decorateClass$L([
6779
6660
  property({ default: 1 })
6780
6661
  ], ColorAdjustEffect.prototype, "saturation", 2);
6781
- __decorateClass$F([
6662
+ __decorateClass$L([
6782
6663
  property({ default: 1 })
6783
6664
  ], ColorAdjustEffect.prototype, "contrast", 2);
6784
- __decorateClass$F([
6665
+ __decorateClass$L([
6785
6666
  property({ default: 1 })
6786
6667
  ], ColorAdjustEffect.prototype, "brightness", 2);
6787
- __decorateClass$F([
6668
+ __decorateClass$L([
6788
6669
  property({ default: 1 })
6789
6670
  ], ColorAdjustEffect.prototype, "red", 2);
6790
- __decorateClass$F([
6671
+ __decorateClass$L([
6791
6672
  property({ default: 1 })
6792
6673
  ], ColorAdjustEffect.prototype, "green", 2);
6793
- __decorateClass$F([
6674
+ __decorateClass$L([
6794
6675
  property({ default: 1 })
6795
6676
  ], ColorAdjustEffect.prototype, "blue", 2);
6796
- __decorateClass$F([
6677
+ __decorateClass$L([
6797
6678
  property({ default: 1 })
6798
6679
  ], ColorAdjustEffect.prototype, "alpha", 2);
6799
- __decorateClass$F([
6680
+ __decorateClass$L([
6800
6681
  property({ default: 1 })
6801
6682
  ], ColorAdjustEffect.prototype, "gamma", 2);
6802
- ColorAdjustEffect = __decorateClass$F([
6683
+ ColorAdjustEffect = __decorateClass$L([
6803
6684
  customNode("ColorAdjustEffect")
6804
6685
  ], ColorAdjustEffect);
6805
6686
 
6806
- var __defProp$w = Object.defineProperty;
6807
- var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
6808
- var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6809
- var __decorateClass$E = (decorators, target, key, kind) => {
6810
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$C(target, key) : target;
6687
+ var __defProp$C = Object.defineProperty;
6688
+ var __getOwnPropDesc$D = Object.getOwnPropertyDescriptor;
6689
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6690
+ var __decorateClass$K = (decorators, target, key, kind) => {
6691
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$D(target, key) : target;
6811
6692
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6812
6693
  if (decorator = decorators[i])
6813
6694
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6814
- if (kind && result) __defProp$w(target, key, result);
6695
+ if (kind && result) __defProp$C(target, key, result);
6815
6696
  return result;
6816
6697
  };
6817
- var __publicField$g = (obj, key, value) => __defNormalProp$g(obj, key + "" , value);
6698
+ var __publicField$h = (obj, key, value) => __defNormalProp$h(obj, key + "" , value);
6818
6699
  let ColorFilterEffect = class extends Effect {
6819
6700
  _colorMatrix = new ColorMatrix();
6820
6701
  constructor(properties, children = []) {
@@ -6864,7 +6745,7 @@ let ColorFilterEffect = class extends Effect {
6864
6745
  });
6865
6746
  }
6866
6747
  };
6867
- __publicField$g(ColorFilterEffect, "material", new Material({
6748
+ __publicField$h(ColorFilterEffect, "material", new Material({
6868
6749
  vert: `precision mediump float;
6869
6750
  attribute vec2 position;
6870
6751
  attribute vec2 uv;
@@ -6891,25 +6772,25 @@ void main(void) {
6891
6772
  );
6892
6773
  }`
6893
6774
  }));
6894
- __decorateClass$E([
6775
+ __decorateClass$K([
6895
6776
  property()
6896
6777
  ], ColorFilterEffect.prototype, "filter", 2);
6897
- ColorFilterEffect = __decorateClass$E([
6778
+ ColorFilterEffect = __decorateClass$K([
6898
6779
  customNode("ColorFilterEffect")
6899
6780
  ], ColorFilterEffect);
6900
6781
 
6901
- var __defProp$v = Object.defineProperty;
6902
- var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor;
6903
- var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6904
- var __decorateClass$D = (decorators, target, key, kind) => {
6905
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$B(target, key) : target;
6782
+ var __defProp$B = Object.defineProperty;
6783
+ var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
6784
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6785
+ var __decorateClass$J = (decorators, target, key, kind) => {
6786
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$C(target, key) : target;
6906
6787
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6907
6788
  if (decorator = decorators[i])
6908
6789
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6909
- if (kind && result) __defProp$v(target, key, result);
6790
+ if (kind && result) __defProp$B(target, key, result);
6910
6791
  return result;
6911
6792
  };
6912
- var __publicField$f = (obj, key, value) => __defNormalProp$f(obj, key + "" , value);
6793
+ var __publicField$g = (obj, key, value) => __defNormalProp$g(obj, key + "" , value);
6913
6794
  const MAX_COLORS$1 = 50;
6914
6795
  let ColorOverlayEffect = class extends Effect {
6915
6796
  _color = new Color();
@@ -6935,7 +6816,7 @@ let ColorOverlayEffect = class extends Effect {
6935
6816
  });
6936
6817
  }
6937
6818
  };
6938
- __publicField$f(ColorOverlayEffect, "material", new Material({
6819
+ __publicField$g(ColorOverlayEffect, "material", new Material({
6939
6820
  vert: `precision mediump float;
6940
6821
  attribute vec2 position;
6941
6822
  attribute vec2 uv;
@@ -6982,28 +6863,28 @@ void main(void) {
6982
6863
  gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
6983
6864
  }`
6984
6865
  }));
6985
- __decorateClass$D([
6866
+ __decorateClass$J([
6986
6867
  property({ default: [] })
6987
6868
  ], ColorOverlayEffect.prototype, "colors", 2);
6988
- __decorateClass$D([
6869
+ __decorateClass$J([
6989
6870
  property({ default: 0.5 })
6990
6871
  ], ColorOverlayEffect.prototype, "alpha", 2);
6991
- ColorOverlayEffect = __decorateClass$D([
6872
+ ColorOverlayEffect = __decorateClass$J([
6992
6873
  customNode("ColorOverlayEffect")
6993
6874
  ], ColorOverlayEffect);
6994
6875
 
6995
- var __defProp$u = Object.defineProperty;
6996
- var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor;
6997
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6998
- var __decorateClass$C = (decorators, target, key, kind) => {
6999
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$A(target, key) : target;
6876
+ var __defProp$A = Object.defineProperty;
6877
+ var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor;
6878
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6879
+ var __decorateClass$I = (decorators, target, key, kind) => {
6880
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$B(target, key) : target;
7000
6881
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7001
6882
  if (decorator = decorators[i])
7002
6883
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7003
- if (kind && result) __defProp$u(target, key, result);
6884
+ if (kind && result) __defProp$A(target, key, result);
7004
6885
  return result;
7005
6886
  };
7006
- var __publicField$e = (obj, key, value) => __defNormalProp$e(obj, key + "" , value);
6887
+ var __publicField$f = (obj, key, value) => __defNormalProp$f(obj, key + "" , value);
7007
6888
  let ColorRemoveEffect = class extends Effect {
7008
6889
  _color = new Color();
7009
6890
  constructor(properties, children = []) {
@@ -7034,7 +6915,7 @@ let ColorRemoveEffect = class extends Effect {
7034
6915
  });
7035
6916
  }
7036
6917
  };
7037
- __publicField$e(ColorRemoveEffect, "material", new Material({
6918
+ __publicField$f(ColorRemoveEffect, "material", new Material({
7038
6919
  vert: `precision mediump float;
7039
6920
  attribute vec2 position;
7040
6921
  attribute vec2 uv;
@@ -7067,28 +6948,28 @@ void main(void) {
7067
6948
  gl_FragColor = color;
7068
6949
  }`
7069
6950
  }));
7070
- __decorateClass$C([
6951
+ __decorateClass$I([
7071
6952
  property({ default: [] })
7072
6953
  ], ColorRemoveEffect.prototype, "colors", 2);
7073
- __decorateClass$C([
6954
+ __decorateClass$I([
7074
6955
  property({ default: 0.5 })
7075
6956
  ], ColorRemoveEffect.prototype, "epsilon", 2);
7076
- ColorRemoveEffect = __decorateClass$C([
6957
+ ColorRemoveEffect = __decorateClass$I([
7077
6958
  customNode("ColorRemoveEffect")
7078
6959
  ], ColorRemoveEffect);
7079
6960
 
7080
- var __defProp$t = Object.defineProperty;
7081
- var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor;
7082
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7083
- var __decorateClass$B = (decorators, target, key, kind) => {
7084
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$z(target, key) : target;
6961
+ var __defProp$z = Object.defineProperty;
6962
+ var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor;
6963
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6964
+ var __decorateClass$H = (decorators, target, key, kind) => {
6965
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$A(target, key) : target;
7085
6966
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7086
6967
  if (decorator = decorators[i])
7087
6968
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7088
- if (kind && result) __defProp$t(target, key, result);
6969
+ if (kind && result) __defProp$z(target, key, result);
7089
6970
  return result;
7090
6971
  };
7091
- var __publicField$d = (obj, key, value) => __defNormalProp$d(obj, key + "" , value);
6972
+ var __publicField$e = (obj, key, value) => __defNormalProp$e(obj, key + "" , value);
7092
6973
  const MAX_COLORS = 50;
7093
6974
  let ColorReplaceEffect = class extends Effect {
7094
6975
  _color = new Color();
@@ -7134,7 +7015,7 @@ let ColorReplaceEffect = class extends Effect {
7134
7015
  });
7135
7016
  }
7136
7017
  };
7137
- __publicField$d(ColorReplaceEffect, "material", new Material({
7018
+ __publicField$e(ColorReplaceEffect, "material", new Material({
7138
7019
  vert: `precision mediump float;
7139
7020
  attribute vec2 position;
7140
7021
  attribute vec2 uv;
@@ -7174,13 +7055,13 @@ void main(void) {
7174
7055
  }
7175
7056
  }`
7176
7057
  }));
7177
- __decorateClass$B([
7058
+ __decorateClass$H([
7178
7059
  property({ default: [] })
7179
7060
  ], ColorReplaceEffect.prototype, "colors", 2);
7180
- __decorateClass$B([
7061
+ __decorateClass$H([
7181
7062
  property({ default: 0.05 })
7182
7063
  ], ColorReplaceEffect.prototype, "epsilon", 2);
7183
- ColorReplaceEffect = __decorateClass$B([
7064
+ ColorReplaceEffect = __decorateClass$H([
7184
7065
  customNode("ColorReplaceEffect")
7185
7066
  ], ColorReplaceEffect);
7186
7067
 
@@ -7320,6 +7201,7 @@ class CanvasContext extends Path2D {
7320
7201
  }
7321
7202
  if (vertices.length && oldTexture !== draw.texture && !oldTexture?.is(draw.texture)) {
7322
7203
  push(draw.type);
7204
+ texture = draw.texture;
7323
7205
  }
7324
7206
  const start = vertices.length;
7325
7207
  if (draw.type === "fill") {
@@ -7347,14 +7229,14 @@ class CanvasContext extends Path2D {
7347
7229
  }
7348
7230
  }
7349
7231
 
7350
- var __defProp$s = Object.defineProperty;
7351
- var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
7352
- var __decorateClass$A = (decorators, target, key, kind) => {
7353
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$y(target, key) : target;
7232
+ var __defProp$y = Object.defineProperty;
7233
+ var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor;
7234
+ var __decorateClass$G = (decorators, target, key, kind) => {
7235
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$z(target, key) : target;
7354
7236
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7355
7237
  if (decorator = decorators[i])
7356
7238
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7357
- if (kind && result) __defProp$s(target, key, result);
7239
+ if (kind && result) __defProp$y(target, key, result);
7358
7240
  return result;
7359
7241
  };
7360
7242
  let CanvasItem = class extends TimelineNode {
@@ -7516,19 +7398,19 @@ let CanvasItem = class extends TimelineNode {
7516
7398
  super._render(renderer);
7517
7399
  }
7518
7400
  };
7519
- __decorateClass$A([
7401
+ __decorateClass$G([
7520
7402
  property()
7521
7403
  ], CanvasItem.prototype, "modulate", 2);
7522
- __decorateClass$A([
7404
+ __decorateClass$G([
7523
7405
  property()
7524
7406
  ], CanvasItem.prototype, "blendMode", 2);
7525
- __decorateClass$A([
7407
+ __decorateClass$G([
7526
7408
  protectedProperty({ default: true })
7527
7409
  ], CanvasItem.prototype, "visible", 2);
7528
- __decorateClass$A([
7410
+ __decorateClass$G([
7529
7411
  protectedProperty({ default: 1 })
7530
7412
  ], CanvasItem.prototype, "opacity", 2);
7531
- CanvasItem = __decorateClass$A([
7413
+ CanvasItem = __decorateClass$G([
7532
7414
  customNode("CanvasItem")
7533
7415
  ], CanvasItem);
7534
7416
 
@@ -7558,14 +7440,14 @@ class RenderStack {
7558
7440
  }
7559
7441
  }
7560
7442
 
7561
- var __defProp$r = Object.defineProperty;
7562
- var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor;
7563
- var __decorateClass$z = (decorators, target, key, kind) => {
7564
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$x(target, key) : target;
7443
+ var __defProp$x = Object.defineProperty;
7444
+ var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
7445
+ var __decorateClass$F = (decorators, target, key, kind) => {
7446
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$y(target, key) : target;
7565
7447
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7566
7448
  if (decorator = decorators[i])
7567
7449
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7568
- if (kind && result) __defProp$r(target, key, result);
7450
+ if (kind && result) __defProp$x(target, key, result);
7569
7451
  return result;
7570
7452
  };
7571
7453
  let Timeline = class extends Node {
@@ -7610,29 +7492,29 @@ let Timeline = class extends Node {
7610
7492
  this.addTime(delta);
7611
7493
  }
7612
7494
  };
7613
- __decorateClass$z([
7495
+ __decorateClass$F([
7614
7496
  property({ default: 0 })
7615
7497
  ], Timeline.prototype, "startTime", 2);
7616
- __decorateClass$z([
7498
+ __decorateClass$F([
7617
7499
  property({ default: 0 })
7618
7500
  ], Timeline.prototype, "currentTime", 2);
7619
- __decorateClass$z([
7501
+ __decorateClass$F([
7620
7502
  property({ default: Number.MAX_SAFE_INTEGER })
7621
7503
  ], Timeline.prototype, "endTime", 2);
7622
- __decorateClass$z([
7504
+ __decorateClass$F([
7623
7505
  property({ default: false })
7624
7506
  ], Timeline.prototype, "loop", 2);
7625
- Timeline = __decorateClass$z([
7507
+ Timeline = __decorateClass$F([
7626
7508
  customNode("Timeline")
7627
7509
  ], Timeline);
7628
7510
 
7629
- var __defProp$q = Object.defineProperty;
7630
- var __decorateClass$y = (decorators, target, key, kind) => {
7511
+ var __defProp$w = Object.defineProperty;
7512
+ var __decorateClass$E = (decorators, target, key, kind) => {
7631
7513
  var result = void 0 ;
7632
7514
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7633
7515
  if (decorator = decorators[i])
7634
7516
  result = (decorator(target, key, result) ) || result;
7635
- if (result) __defProp$q(target, key, result);
7517
+ if (result) __defProp$w(target, key, result);
7636
7518
  return result;
7637
7519
  };
7638
7520
  class SceneTree extends MainLoop {
@@ -7705,19 +7587,19 @@ class SceneTree extends MainLoop {
7705
7587
  this.input.removeEventListeners();
7706
7588
  }
7707
7589
  }
7708
- __decorateClass$y([
7590
+ __decorateClass$E([
7709
7591
  property({ default: false })
7710
7592
  ], SceneTree.prototype, "processPaused");
7711
- __decorateClass$y([
7593
+ __decorateClass$E([
7712
7594
  property()
7713
7595
  ], SceneTree.prototype, "backgroundColor");
7714
- __decorateClass$y([
7596
+ __decorateClass$E([
7715
7597
  protectedProperty({ default: false })
7716
7598
  ], SceneTree.prototype, "debug");
7717
7599
 
7718
- var __getOwnPropDesc$w = Object.getOwnPropertyDescriptor;
7719
- var __decorateClass$x = (decorators, target, key, kind) => {
7720
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$w(target, key) : target;
7600
+ var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor;
7601
+ var __decorateClass$D = (decorators, target, key, kind) => {
7602
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$x(target, key) : target;
7721
7603
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7722
7604
  if (decorator = decorators[i])
7723
7605
  result = (decorator(result)) || result;
@@ -7729,7 +7611,7 @@ let Transition = class extends Effect {
7729
7611
  this.setProperties(properties).append(children);
7730
7612
  }
7731
7613
  };
7732
- Transition = __decorateClass$x([
7614
+ Transition = __decorateClass$D([
7733
7615
  customNode("Transition", {
7734
7616
  effectMode: "transition",
7735
7617
  processMode: "pausable",
@@ -7737,156 +7619,144 @@ Transition = __decorateClass$x([
7737
7619
  })
7738
7620
  ], Transition);
7739
7621
 
7740
- var __defProp$p = Object.defineProperty;
7741
- var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
7742
- var __decorateClass$w = (decorators, target, key, kind) => {
7743
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$v(target, key) : target;
7622
+ var __defProp$v = Object.defineProperty;
7623
+ var __getOwnPropDesc$w = Object.getOwnPropertyDescriptor;
7624
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7625
+ var __decorateClass$C = (decorators, target, key, kind) => {
7626
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$w(target, key) : target;
7744
7627
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7745
7628
  if (decorator = decorators[i])
7746
7629
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7747
- if (kind && result) __defProp$p(target, key, result);
7630
+ if (kind && result) __defProp$v(target, key, result);
7748
7631
  return result;
7749
7632
  };
7750
- const frag$1 = `varying vec2 vUv;
7633
+ var __publicField$d = (obj, key, value) => __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
7634
+ const frag$2 = `varying vec2 vUv[9];
7751
7635
  uniform sampler2D sampler;
7752
- uniform vec2 uOffset;
7753
7636
 
7754
7637
  void main(void) {
7755
- vec4 color = vec4(0.0);
7756
- color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y + uOffset.y));
7757
- color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y + uOffset.y));
7758
- color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y - uOffset.y));
7759
- color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y - uOffset.y));
7760
- color *= 0.25;
7761
- gl_FragColor = color;
7762
- }`;
7763
- const clampFrag = `precision highp float;
7764
- varying vec2 vUv;
7765
- uniform sampler2D sampler;
7766
- uniform vec2 uOffset;
7767
- uniform vec4 uInputClamp;
7768
- void main(void) {
7769
- vec4 color = vec4(0.0);
7770
- color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));
7771
- color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));
7772
- color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));
7773
- color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));
7774
- color *= 0.25;
7775
- gl_FragColor = color;
7638
+ gl_FragColor = vec4(0.0);
7639
+ float flag = 0.0;
7640
+ for (int i = 0; i < 9; i++) {
7641
+ vec2 uv = vUv[i];
7642
+ if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) {
7643
+ flag = 1.0;
7644
+ break;
7645
+ }
7646
+ }
7647
+ if (flag == 1.0) {
7648
+ gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;
7649
+ gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;
7650
+ gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;
7651
+ gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;
7652
+ gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;
7653
+ gl_FragColor += texture2D(sampler, vUv[4]) * 0.179044;
7654
+ gl_FragColor += texture2D(sampler, vUv[4]) * 0.124009;
7655
+ gl_FragColor += texture2D(sampler, vUv[4]) * 0.067234;
7656
+ gl_FragColor += texture2D(sampler, vUv[4]) * 0.028532;
7657
+ } else {
7658
+ gl_FragColor += texture2D(sampler, vUv[0]) * 0.028532;
7659
+ gl_FragColor += texture2D(sampler, vUv[1]) * 0.067234;
7660
+ gl_FragColor += texture2D(sampler, vUv[2]) * 0.124009;
7661
+ gl_FragColor += texture2D(sampler, vUv[3]) * 0.179044;
7662
+ gl_FragColor += texture2D(sampler, vUv[4]) * 0.20236;
7663
+ gl_FragColor += texture2D(sampler, vUv[5]) * 0.179044;
7664
+ gl_FragColor += texture2D(sampler, vUv[6]) * 0.124009;
7665
+ gl_FragColor += texture2D(sampler, vUv[7]) * 0.067234;
7666
+ gl_FragColor += texture2D(sampler, vUv[8]) * 0.028532;
7667
+ }
7776
7668
  }`;
7777
- let KawaseBlurEffect = class extends Effect {
7778
- material;
7779
- _kernels = [0];
7669
+ let GaussianBlurEffect = class extends Effect {
7780
7670
  constructor(properties, children = []) {
7781
7671
  super();
7782
- this.material = new Material({
7783
- vert: `precision mediump float;
7784
- attribute vec2 position;
7785
- attribute vec2 uv;
7786
- varying vec2 vUv;
7787
- void main() {
7788
- gl_Position = vec4(position, 0.0, 1.0);
7789
- vUv = uv;
7790
- }`,
7791
- frag: properties?.clamp ? clampFrag : frag$1
7792
- });
7793
7672
  this.setProperties(properties).append(children);
7794
- this._generateKernels();
7795
- }
7796
- _updateProperty(key, value, oldValue, declaration) {
7797
- super._updateProperty(key, value, oldValue, declaration);
7798
- switch (key) {
7799
- case "quality":
7800
- case "strength":
7801
- this._generateKernels();
7802
- break;
7803
- }
7804
- }
7805
- /** Auto generate kernels by blur & quality */
7806
- _generateKernels() {
7807
- const blur = Math.max(1, Math.round(this.strength));
7808
- const quality = Math.max(1, Math.round(this.quality));
7809
- const kernels = [blur];
7810
- if (blur > 0) {
7811
- let k = blur;
7812
- const step = blur / quality;
7813
- for (let i = 1; i < quality; i++) {
7814
- k -= step;
7815
- kernels.push(k);
7816
- }
7817
- }
7818
- this._kernels = kernels;
7819
7673
  }
7820
7674
  apply(renderer, source) {
7821
- const uvX = this.pixelSize[0] / source.width;
7822
- const uvY = this.pixelSize[1] / source.height;
7823
- let offset;
7824
- if (this.quality === 1 || this.strength === 0) {
7825
- offset = this._kernels[0] + 0.5;
7675
+ const sx = 1 / source.width;
7676
+ const sy = 1 / source.height;
7677
+ const quality = Math.max(this.quality, 1);
7678
+ for (let i = 0; i < quality; i++) {
7826
7679
  source.redraw(renderer, () => {
7827
- QuadUvGeometry.draw(renderer, this.material, {
7680
+ QuadUvGeometry.draw(renderer, GaussianBlurEffect.materialX, {
7828
7681
  sampler: 0,
7829
- uOffset: [
7830
- offset * uvX,
7831
- offset * uvY
7832
- ],
7833
- uInputClamp: [0, 0, 1, 1]
7682
+ uStrength: sx * (this.strength / quality)
7834
7683
  });
7835
7684
  });
7836
- } else {
7837
- const last = this.quality - 1;
7838
- for (let i = 0; i < last; i++) {
7839
- offset = this._kernels[i] + 0.5;
7840
- source.redraw(renderer, () => {
7841
- QuadUvGeometry.draw(renderer, this.material, {
7842
- sampler: 0,
7843
- uOffset: [
7844
- offset * uvX,
7845
- offset * uvY
7846
- ],
7847
- uInputClamp: [0, 0, 1, 1]
7848
- });
7685
+ }
7686
+ for (let i = 0; i < quality; i++) {
7687
+ source.redraw(renderer, () => {
7688
+ QuadUvGeometry.draw(renderer, GaussianBlurEffect.materialY, {
7689
+ sampler: 0,
7690
+ uStrength: sy * (this.strength / quality)
7849
7691
  });
7850
- }
7851
- offset = this._kernels[last] + 0.5;
7852
- QuadUvGeometry.draw(renderer, this.material, {
7853
- sampler: 0,
7854
- uOffset: [
7855
- offset * uvX,
7856
- offset * uvY
7857
- ],
7858
- uInputClamp: [0, 0, 1, 1]
7859
7692
  });
7860
7693
  }
7861
7694
  }
7862
7695
  };
7863
- __decorateClass$w([
7696
+ __publicField$d(GaussianBlurEffect, "materialX", new Material({
7697
+ vert: `attribute vec2 position;
7698
+ attribute vec2 uv;
7699
+ uniform float uStrength;
7700
+ varying vec2 vUv[9];
7701
+
7702
+ void main(void) {
7703
+ gl_Position = vec4(position, 0, 1);
7704
+ vUv[0] = uv + vec2(-4.0 * uStrength, 0.0);
7705
+ vUv[1] = uv + vec2(-3.0 * uStrength, 0.0);
7706
+ vUv[2] = uv + vec2(-2.0 * uStrength, 0.0);
7707
+ vUv[3] = uv + vec2(-1.0 * uStrength, 0.0);
7708
+ vUv[4] = uv + vec2(0.0 * uStrength, 0.0);
7709
+ vUv[5] = uv + vec2(1.0 * uStrength, 0.0);
7710
+ vUv[6] = uv + vec2(2.0 * uStrength, 0.0);
7711
+ vUv[7] = uv + vec2(3.0 * uStrength, 0.0);
7712
+ vUv[8] = uv + vec2(4.0 * uStrength, 0.0);
7713
+ }`,
7714
+ frag: frag$2
7715
+ }));
7716
+ __publicField$d(GaussianBlurEffect, "materialY", new Material({
7717
+ vert: `attribute vec2 position;
7718
+ attribute vec2 uv;
7719
+ uniform float uStrength;
7720
+ varying vec2 vUv[9];
7721
+
7722
+ void main(void) {
7723
+ gl_Position = vec4(position, 0, 1);
7724
+ vUv[0] = uv + vec2(0.0, -4.0 * uStrength);
7725
+ vUv[1] = uv + vec2(0.0, -3.0 * uStrength);
7726
+ vUv[2] = uv + vec2(0.0, -2.0 * uStrength);
7727
+ vUv[3] = uv + vec2(0.0, -1.0 * uStrength);
7728
+ vUv[4] = uv + vec2(0.0, 0.0 * uStrength);
7729
+ vUv[5] = uv + vec2(0.0, 1.0 * uStrength);
7730
+ vUv[6] = uv + vec2(0.0, 2.0 * uStrength);
7731
+ vUv[7] = uv + vec2(0.0, 3.0 * uStrength);
7732
+ vUv[8] = uv + vec2(0.0, 4.0 * uStrength);
7733
+ }`,
7734
+ frag: frag$2
7735
+ }));
7736
+ __decorateClass$C([
7864
7737
  property({ default: 4 })
7865
- ], KawaseBlurEffect.prototype, "strength", 2);
7866
- __decorateClass$w([
7738
+ ], GaussianBlurEffect.prototype, "strength", 2);
7739
+ __decorateClass$C([
7867
7740
  property({ default: 3 })
7868
- ], KawaseBlurEffect.prototype, "quality", 2);
7869
- __decorateClass$w([
7870
- property({ default: [1, 1] })
7871
- ], KawaseBlurEffect.prototype, "pixelSize", 2);
7872
- KawaseBlurEffect = __decorateClass$w([
7873
- customNode("KawaseBlurEffect")
7874
- ], KawaseBlurEffect);
7741
+ ], GaussianBlurEffect.prototype, "quality", 2);
7742
+ GaussianBlurEffect = __decorateClass$C([
7743
+ customNode("GaussianBlurEffect")
7744
+ ], GaussianBlurEffect);
7875
7745
 
7876
- var __defProp$o = Object.defineProperty;
7877
- var __getOwnPropDesc$u = Object.getOwnPropertyDescriptor;
7878
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7879
- var __decorateClass$v = (decorators, target, key, kind) => {
7880
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$u(target, key) : target;
7746
+ var __defProp$u = Object.defineProperty;
7747
+ var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
7748
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7749
+ var __decorateClass$B = (decorators, target, key, kind) => {
7750
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$v(target, key) : target;
7881
7751
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7882
7752
  if (decorator = decorators[i])
7883
7753
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7884
- if (kind && result) __defProp$o(target, key, result);
7754
+ if (kind && result) __defProp$u(target, key, result);
7885
7755
  return result;
7886
7756
  };
7887
7757
  var __publicField$c = (obj, key, value) => __defNormalProp$c(obj, key + "" , value);
7888
7758
  let DropShadowEffect = class extends Effect {
7889
- kawaseBlurEffect = new KawaseBlurEffect();
7759
+ blurEffect = new GaussianBlurEffect();
7890
7760
  viewport3 = new Viewport();
7891
7761
  _color = new Color();
7892
7762
  constructor(properties, children = []) {
@@ -7899,16 +7769,14 @@ let DropShadowEffect = class extends Effect {
7899
7769
  this._color.value = this.color;
7900
7770
  QuadUvGeometry.draw(renderer, DropShadowEffect.material, {
7901
7771
  sampler: 0,
7902
- uAlpha: this.alpha,
7772
+ uAlpha: this._color.a,
7903
7773
  uColor: this._color.toArray().slice(0, 3),
7904
- uOffset: [-this.offset[0], this.offset[1]],
7774
+ uOffset: [-this.offsetX, this.offsetY],
7905
7775
  uInputSize: [source.width, source.height, 1 / source.width, 1 / source.height]
7906
7776
  });
7907
7777
  });
7908
- this.kawaseBlurEffect.strength = this.blur;
7909
- this.kawaseBlurEffect.quality = this.quality;
7910
- this.kawaseBlurEffect.pixelSize = this.pixelSize;
7911
- this.kawaseBlurEffect.apply(renderer, this.viewport3);
7778
+ this.blurEffect.strength = this.blur;
7779
+ this.blurEffect.apply(renderer, this.viewport3);
7912
7780
  source.redraw(renderer, () => {
7913
7781
  this.viewport3.texture.activate(renderer, 1);
7914
7782
  QuadUvGeometry.draw(renderer, UvMaterial.instance, {
@@ -7947,40 +7815,34 @@ void main(void) {
7947
7815
  gl_FragColor = sample;
7948
7816
  }`
7949
7817
  }));
7950
- __decorateClass$v([
7951
- property({ default: [4, 4] })
7952
- ], DropShadowEffect.prototype, "offset", 2);
7953
- __decorateClass$v([
7818
+ __decorateClass$B([
7954
7819
  property({ default: 0 })
7955
7820
  ], DropShadowEffect.prototype, "color", 2);
7956
- __decorateClass$v([
7957
- property({ default: 1 })
7958
- ], DropShadowEffect.prototype, "alpha", 2);
7959
- __decorateClass$v([
7960
- property({ default: false })
7961
- ], DropShadowEffect.prototype, "shadowOnly", 2);
7962
- __decorateClass$v([
7963
- property({ default: 2 })
7821
+ __decorateClass$B([
7822
+ property({ default: 4 })
7964
7823
  ], DropShadowEffect.prototype, "blur", 2);
7965
- __decorateClass$v([
7824
+ __decorateClass$B([
7966
7825
  property({ default: 4 })
7967
- ], DropShadowEffect.prototype, "quality", 2);
7968
- __decorateClass$v([
7969
- property({ default: [1, 1] })
7970
- ], DropShadowEffect.prototype, "pixelSize", 2);
7971
- DropShadowEffect = __decorateClass$v([
7826
+ ], DropShadowEffect.prototype, "offsetX", 2);
7827
+ __decorateClass$B([
7828
+ property({ default: 4 })
7829
+ ], DropShadowEffect.prototype, "offsetY", 2);
7830
+ __decorateClass$B([
7831
+ property({ default: false })
7832
+ ], DropShadowEffect.prototype, "shadowOnly", 2);
7833
+ DropShadowEffect = __decorateClass$B([
7972
7834
  customNode("DropShadowEffect")
7973
7835
  ], DropShadowEffect);
7974
7836
 
7975
- var __defProp$n = Object.defineProperty;
7976
- var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
7977
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7978
- var __decorateClass$u = (decorators, target, key, kind) => {
7979
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$t(target, key) : target;
7837
+ var __defProp$t = Object.defineProperty;
7838
+ var __getOwnPropDesc$u = Object.getOwnPropertyDescriptor;
7839
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7840
+ var __decorateClass$A = (decorators, target, key, kind) => {
7841
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$u(target, key) : target;
7980
7842
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7981
7843
  if (decorator = decorators[i])
7982
7844
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7983
- if (kind && result) __defProp$n(target, key, result);
7845
+ if (kind && result) __defProp$t(target, key, result);
7984
7846
  return result;
7985
7847
  };
7986
7848
  var __publicField$b = (obj, key, value) => __defNormalProp$b(obj, key + "" , value);
@@ -8025,22 +7887,22 @@ void main(void) {
8025
7887
  gl_FragColor = vec4(color.rgb * alpha, alpha);
8026
7888
  }`
8027
7889
  }));
8028
- __decorateClass$u([
7890
+ __decorateClass$A([
8029
7891
  property({ default: 5 })
8030
7892
  ], EmbossEffect.prototype, "strength", 2);
8031
- EmbossEffect = __decorateClass$u([
7893
+ EmbossEffect = __decorateClass$A([
8032
7894
  customNode("EmbossEffect")
8033
7895
  ], EmbossEffect);
8034
7896
 
8035
- var __defProp$m = Object.defineProperty;
8036
- var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
8037
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8038
- var __decorateClass$t = (decorators, target, key, kind) => {
8039
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$s(target, key) : target;
7897
+ var __defProp$s = Object.defineProperty;
7898
+ var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
7899
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7900
+ var __decorateClass$z = (decorators, target, key, kind) => {
7901
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$t(target, key) : target;
8040
7902
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8041
7903
  if (decorator = decorators[i])
8042
7904
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8043
- if (kind && result) __defProp$m(target, key, result);
7905
+ if (kind && result) __defProp$s(target, key, result);
8044
7906
  return result;
8045
7907
  };
8046
7908
  var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, key + "" , value);
@@ -8214,46 +8076,46 @@ void main(void) {
8214
8076
  gl_FragColor.a = texture2D(sampler, coord).a;
8215
8077
  }`
8216
8078
  }));
8217
- __decorateClass$t([
8079
+ __decorateClass$z([
8218
8080
  property({ default: 10 })
8219
8081
  ], GlitchEffect.prototype, "slices", 2);
8220
- __decorateClass$t([
8082
+ __decorateClass$z([
8221
8083
  property({ default: 512 })
8222
8084
  ], GlitchEffect.prototype, "sampleSize", 2);
8223
- __decorateClass$t([
8085
+ __decorateClass$z([
8224
8086
  property({ default: 100 })
8225
8087
  ], GlitchEffect.prototype, "offset", 2);
8226
- __decorateClass$t([
8088
+ __decorateClass$z([
8227
8089
  property({ default: 0 })
8228
8090
  ], GlitchEffect.prototype, "direction", 2);
8229
- __decorateClass$t([
8091
+ __decorateClass$z([
8230
8092
  property({ default: 2 })
8231
8093
  ], GlitchEffect.prototype, "fillMode", 2);
8232
- __decorateClass$t([
8094
+ __decorateClass$z([
8233
8095
  property({ default: 0 })
8234
8096
  ], GlitchEffect.prototype, "seed", 2);
8235
- __decorateClass$t([
8097
+ __decorateClass$z([
8236
8098
  property({ default: [2, 2] })
8237
8099
  ], GlitchEffect.prototype, "red", 2);
8238
- __decorateClass$t([
8100
+ __decorateClass$z([
8239
8101
  property({ default: [-10, 4] })
8240
8102
  ], GlitchEffect.prototype, "green", 2);
8241
- __decorateClass$t([
8103
+ __decorateClass$z([
8242
8104
  property({ default: [10, -4] })
8243
8105
  ], GlitchEffect.prototype, "blue", 2);
8244
- GlitchEffect = __decorateClass$t([
8106
+ GlitchEffect = __decorateClass$z([
8245
8107
  customNode("GlitchEffect")
8246
8108
  ], GlitchEffect);
8247
8109
 
8248
- var __defProp$l = Object.defineProperty;
8249
- var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
8250
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8251
- var __decorateClass$s = (decorators, target, key, kind) => {
8252
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$r(target, key) : target;
8110
+ var __defProp$r = Object.defineProperty;
8111
+ var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
8112
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8113
+ var __decorateClass$y = (decorators, target, key, kind) => {
8114
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$s(target, key) : target;
8253
8115
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8254
8116
  if (decorator = decorators[i])
8255
8117
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8256
- if (kind && result) __defProp$l(target, key, result);
8118
+ if (kind && result) __defProp$r(target, key, result);
8257
8119
  return result;
8258
8120
  };
8259
8121
  var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, key + "" , value);
@@ -8431,40 +8293,151 @@ void main(void) {
8431
8293
  gl_FragColor = vec4(color.rgb + mist.rgb, color.a);
8432
8294
  }`
8433
8295
  }));
8434
- __decorateClass$s([
8296
+ __decorateClass$y([
8435
8297
  property({ default: 0 })
8436
8298
  ], GodrayEffect.prototype, "time", 2);
8437
- __decorateClass$s([
8299
+ __decorateClass$y([
8438
8300
  property({ default: 30 })
8439
8301
  ], GodrayEffect.prototype, "angle", 2);
8440
- __decorateClass$s([
8302
+ __decorateClass$y([
8441
8303
  property({ default: 0.5 })
8442
8304
  ], GodrayEffect.prototype, "gain", 2);
8443
- __decorateClass$s([
8305
+ __decorateClass$y([
8444
8306
  property({ default: 2.5 })
8445
8307
  ], GodrayEffect.prototype, "lacunarity", 2);
8446
- __decorateClass$s([
8308
+ __decorateClass$y([
8447
8309
  property({ default: true })
8448
8310
  ], GodrayEffect.prototype, "parallel", 2);
8449
- __decorateClass$s([
8311
+ __decorateClass$y([
8450
8312
  property({ default: [0, 0] })
8451
8313
  ], GodrayEffect.prototype, "center", 2);
8452
- __decorateClass$s([
8314
+ __decorateClass$y([
8453
8315
  property({ default: 1 })
8454
8316
  ], GodrayEffect.prototype, "alpha", 2);
8455
- GodrayEffect = __decorateClass$s([
8317
+ GodrayEffect = __decorateClass$y([
8456
8318
  customNode("GodrayEffect")
8457
8319
  ], GodrayEffect);
8458
8320
 
8459
- var __defProp$k = Object.defineProperty;
8321
+ var __defProp$q = Object.defineProperty;
8322
+ var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
8323
+ var __decorateClass$x = (decorators, target, key, kind) => {
8324
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$r(target, key) : target;
8325
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
8326
+ if (decorator = decorators[i])
8327
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8328
+ if (kind && result) __defProp$q(target, key, result);
8329
+ return result;
8330
+ };
8331
+ const frag$1 = `varying vec2 vUv;
8332
+ uniform sampler2D sampler;
8333
+ uniform vec2 uOffset;
8334
+
8335
+ void main(void) {
8336
+ vec4 color = vec4(0.0);
8337
+ color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y + uOffset.y));
8338
+ color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y + uOffset.y));
8339
+ color += texture2D(sampler, vec2(vUv.x + uOffset.x, vUv.y - uOffset.y));
8340
+ color += texture2D(sampler, vec2(vUv.x - uOffset.x, vUv.y - uOffset.y));
8341
+ color *= 0.25;
8342
+ gl_FragColor = color;
8343
+ }`;
8344
+ const clampFrag = `precision highp float;
8345
+ varying vec2 vUv;
8346
+ uniform sampler2D sampler;
8347
+ uniform vec2 uOffset;
8348
+ uniform vec4 uInputClamp;
8349
+ void main(void) {
8350
+ vec4 color = vec4(0.0);
8351
+ color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));
8352
+ color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y + uOffset.y), uInputClamp.xy, uInputClamp.zw));
8353
+ color += texture2D(sampler, clamp(vec2(vUv.x + uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));
8354
+ color += texture2D(sampler, clamp(vec2(vUv.x - uOffset.x, vUv.y - uOffset.y), uInputClamp.xy, uInputClamp.zw));
8355
+ color *= 0.25;
8356
+ gl_FragColor = color;
8357
+ }`;
8358
+ let KawaseBlurEffect = class extends Effect {
8359
+ material;
8360
+ _kernels = [0];
8361
+ constructor(properties, children = []) {
8362
+ super();
8363
+ this.material = new Material({
8364
+ vert: `precision mediump float;
8365
+ attribute vec2 position;
8366
+ attribute vec2 uv;
8367
+ varying vec2 vUv;
8368
+ void main() {
8369
+ gl_Position = vec4(position, 0.0, 1.0);
8370
+ vUv = uv;
8371
+ }`,
8372
+ frag: properties?.clamp ? clampFrag : frag$1
8373
+ });
8374
+ this.setProperties(properties).append(children);
8375
+ this._generateKernels();
8376
+ }
8377
+ _updateProperty(key, value, oldValue, declaration) {
8378
+ super._updateProperty(key, value, oldValue, declaration);
8379
+ switch (key) {
8380
+ case "quality":
8381
+ case "strength":
8382
+ this._generateKernels();
8383
+ break;
8384
+ }
8385
+ }
8386
+ /** Auto generate kernels by blur & quality */
8387
+ _generateKernels() {
8388
+ const blur = Math.max(1, Math.round(this.strength));
8389
+ const quality = Math.max(1, Math.round(this.quality));
8390
+ const kernels = [blur];
8391
+ if (blur > 0) {
8392
+ let k = blur;
8393
+ const step = blur / quality;
8394
+ for (let i = 1; i < quality; i++) {
8395
+ k -= step;
8396
+ kernels.push(k);
8397
+ }
8398
+ }
8399
+ this._kernels = kernels;
8400
+ }
8401
+ apply(renderer, source) {
8402
+ const uvX = this.pixelSize[0] / source.width;
8403
+ const uvY = this.pixelSize[1] / source.height;
8404
+ this._kernels.forEach((kernel) => {
8405
+ const offset = kernel + 0.5;
8406
+ source.redraw(renderer, () => {
8407
+ QuadUvGeometry.draw(renderer, this.material, {
8408
+ sampler: 0,
8409
+ uOffset: [
8410
+ offset * uvX,
8411
+ offset * uvY
8412
+ ],
8413
+ uInputClamp: [0, 0, 1, 1]
8414
+ });
8415
+ });
8416
+ });
8417
+ }
8418
+ };
8419
+ __decorateClass$x([
8420
+ property({ default: 4 })
8421
+ ], KawaseBlurEffect.prototype, "strength", 2);
8422
+ __decorateClass$x([
8423
+ property({ default: 3 })
8424
+ ], KawaseBlurEffect.prototype, "quality", 2);
8425
+ __decorateClass$x([
8426
+ property({ default: [1, 1] })
8427
+ ], KawaseBlurEffect.prototype, "pixelSize", 2);
8428
+ KawaseBlurEffect = __decorateClass$x([
8429
+ customNode("KawaseBlurEffect")
8430
+ ], KawaseBlurEffect);
8431
+
8432
+ var __defProp$p = Object.defineProperty;
8460
8433
  var __getOwnPropDesc$q = Object.getOwnPropertyDescriptor;
8461
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8462
- var __decorateClass$r = (decorators, target, key, kind) => {
8434
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8435
+ var __decorateClass$w = (decorators, target, key, kind) => {
8463
8436
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$q(target, key) : target;
8464
8437
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8465
8438
  if (decorator = decorators[i])
8466
8439
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8467
- if (kind && result) __defProp$k(target, key, result);
8440
+ if (kind && result) __defProp$p(target, key, result);
8468
8441
  return result;
8469
8442
  };
8470
8443
  var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, key + "" , value);
@@ -8553,25 +8526,25 @@ void main(void) {
8553
8526
  }
8554
8527
  }`
8555
8528
  }));
8556
- __decorateClass$r([
8529
+ __decorateClass$w([
8557
8530
  protectedProperty()
8558
8531
  ], MaskEffect.prototype, "texture", 2);
8559
- __decorateClass$r([
8532
+ __decorateClass$w([
8560
8533
  property({ default: "" })
8561
8534
  ], MaskEffect.prototype, "src", 2);
8562
- MaskEffect = __decorateClass$r([
8535
+ MaskEffect = __decorateClass$w([
8563
8536
  customNode("MaskEffect")
8564
8537
  ], MaskEffect);
8565
8538
 
8566
- var __defProp$j = Object.defineProperty;
8539
+ var __defProp$o = Object.defineProperty;
8567
8540
  var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
8568
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8569
- var __decorateClass$q = (decorators, target, key, kind) => {
8541
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8542
+ var __decorateClass$v = (decorators, target, key, kind) => {
8570
8543
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$p(target, key) : target;
8571
8544
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8572
8545
  if (decorator = decorators[i])
8573
8546
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8574
- if (kind && result) __defProp$j(target, key, result);
8547
+ if (kind && result) __defProp$o(target, key, result);
8575
8548
  return result;
8576
8549
  };
8577
8550
  var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -8645,11 +8618,11 @@ void main() {
8645
8618
  QuadUvGeometry.draw(renderer, this.material, {
8646
8619
  sampler: 0,
8647
8620
  uThickness: [
8648
- this.thickness / source.width,
8649
- this.thickness / source.height
8621
+ this.width / source.width,
8622
+ this.width / source.height
8650
8623
  ],
8651
8624
  uColor: this._color.toArray().slice(0, 3),
8652
- uAlpha: this.alpha,
8625
+ uAlpha: this.opacity !== 1 ? this.opacity : this._color.a,
8653
8626
  uAngleStep: OutlineEffect.getAngleStep(this.quality),
8654
8627
  uKnockout: this.knockout ? 1 : 0,
8655
8628
  uInputClamp: [0, 0, 1, 1]
@@ -8659,34 +8632,40 @@ void main() {
8659
8632
  };
8660
8633
  __publicField$7(OutlineEffect, "MIN_SAMPLES", 1);
8661
8634
  __publicField$7(OutlineEffect, "MAX_SAMPLES", 100);
8662
- __decorateClass$q([
8663
- property({ default: 1 })
8664
- ], OutlineEffect.prototype, "thickness", 2);
8665
- __decorateClass$q([
8635
+ __decorateClass$v([
8666
8636
  property({ default: 0 })
8667
8637
  ], OutlineEffect.prototype, "color", 2);
8668
- __decorateClass$q([
8638
+ __decorateClass$v([
8669
8639
  property({ default: 1 })
8670
- ], OutlineEffect.prototype, "alpha", 2);
8671
- __decorateClass$q([
8640
+ ], OutlineEffect.prototype, "width", 2);
8641
+ __decorateClass$v([
8642
+ property({ default: "solid" })
8643
+ ], OutlineEffect.prototype, "style", 2);
8644
+ __decorateClass$v([
8645
+ property()
8646
+ ], OutlineEffect.prototype, "image", 2);
8647
+ __decorateClass$v([
8648
+ property({ default: 1 })
8649
+ ], OutlineEffect.prototype, "opacity", 2);
8650
+ __decorateClass$v([
8672
8651
  property({ default: 0.1 })
8673
8652
  ], OutlineEffect.prototype, "quality", 2);
8674
- __decorateClass$q([
8653
+ __decorateClass$v([
8675
8654
  property({ default: false })
8676
8655
  ], OutlineEffect.prototype, "knockout", 2);
8677
- OutlineEffect = __decorateClass$q([
8656
+ OutlineEffect = __decorateClass$v([
8678
8657
  customNode("OutlineEffect")
8679
8658
  ], OutlineEffect);
8680
8659
 
8681
- var __defProp$i = Object.defineProperty;
8660
+ var __defProp$n = Object.defineProperty;
8682
8661
  var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
8683
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8684
- var __decorateClass$p = (decorators, target, key, kind) => {
8662
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8663
+ var __decorateClass$u = (decorators, target, key, kind) => {
8685
8664
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$o(target, key) : target;
8686
8665
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8687
8666
  if (decorator = decorators[i])
8688
8667
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8689
- if (kind && result) __defProp$i(target, key, result);
8668
+ if (kind && result) __defProp$n(target, key, result);
8690
8669
  return result;
8691
8670
  };
8692
8671
  var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, key + "" , value);
@@ -8742,22 +8721,22 @@ void main(void) {
8742
8721
  gl_FragColor = texture2D(sampler, coord);
8743
8722
  }`
8744
8723
  }));
8745
- __decorateClass$p([
8724
+ __decorateClass$u([
8746
8725
  property({ default: 10 })
8747
8726
  ], PixelateEffect.prototype, "strength", 2);
8748
- PixelateEffect = __decorateClass$p([
8727
+ PixelateEffect = __decorateClass$u([
8749
8728
  customNode("PixelateEffect")
8750
8729
  ], PixelateEffect);
8751
8730
 
8752
- var __defProp$h = Object.defineProperty;
8731
+ var __defProp$m = Object.defineProperty;
8753
8732
  var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
8754
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8755
- var __decorateClass$o = (decorators, target, key, kind) => {
8733
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8734
+ var __decorateClass$t = (decorators, target, key, kind) => {
8756
8735
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$n(target, key) : target;
8757
8736
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8758
8737
  if (decorator = decorators[i])
8759
8738
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8760
- if (kind && result) __defProp$h(target, key, result);
8739
+ if (kind && result) __defProp$m(target, key, result);
8761
8740
  return result;
8762
8741
  };
8763
8742
  var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, key + "" , value);
@@ -8766,11 +8745,18 @@ let ZoomBlurEffect = class extends Effect {
8766
8745
  super();
8767
8746
  this.setProperties(properties).append(children);
8768
8747
  }
8769
- apply(renderer, source) {
8748
+ apply(renderer, source, context) {
8749
+ let center = this.center;
8750
+ if (context.targetArea) {
8751
+ center = [
8752
+ (context.targetArea[0] + context.targetArea[2] / 2) * source.width,
8753
+ (context.targetArea[1] + context.targetArea[3] / 2) * source.height
8754
+ ];
8755
+ }
8770
8756
  source.redraw(renderer, () => {
8771
8757
  QuadUvGeometry.draw(renderer, ZoomBlurEffect.material, {
8772
8758
  sampler: 0,
8773
- uCenter: this.center ?? [source.width / 2, source.height / 2],
8759
+ uCenter: center ?? [source.width / 2, source.height / 2],
8774
8760
  uInnerRadius: this.innerRadius,
8775
8761
  uRadius: this.radius,
8776
8762
  uStrength: this.strength,
@@ -8863,22 +8849,277 @@ void main() {
8863
8849
  gl_FragColor = color;
8864
8850
  }`
8865
8851
  }));
8866
- __decorateClass$o([
8852
+ __decorateClass$t([
8867
8853
  property()
8868
8854
  ], ZoomBlurEffect.prototype, "center", 2);
8869
- __decorateClass$o([
8855
+ __decorateClass$t([
8870
8856
  property({ default: 20 })
8871
8857
  ], ZoomBlurEffect.prototype, "innerRadius", 2);
8872
- __decorateClass$o([
8858
+ __decorateClass$t([
8873
8859
  property({ default: -1 })
8874
8860
  ], ZoomBlurEffect.prototype, "radius", 2);
8875
- __decorateClass$o([
8861
+ __decorateClass$t([
8876
8862
  property({ default: 0.1 })
8877
8863
  ], ZoomBlurEffect.prototype, "strength", 2);
8878
- ZoomBlurEffect = __decorateClass$o([
8864
+ ZoomBlurEffect = __decorateClass$t([
8879
8865
  customNode("ZoomBlurEffect")
8880
8866
  ], ZoomBlurEffect);
8881
8867
 
8868
+ var __defProp$l = Object.defineProperty;
8869
+ var __decorateClass$s = (decorators, target, key, kind) => {
8870
+ var result = void 0 ;
8871
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
8872
+ if (decorator = decorators[i])
8873
+ result = (decorator(target, key, result) ) || result;
8874
+ if (result) __defProp$l(target, key, result);
8875
+ return result;
8876
+ };
8877
+ class BaseElement2DFill extends CoreObject {
8878
+ constructor(parent, properties) {
8879
+ super();
8880
+ this.parent = parent;
8881
+ this.setProperties(properties);
8882
+ }
8883
+ _image;
8884
+ _updateProperty(key, value, oldValue, declaration) {
8885
+ super._updateProperty(key, value, oldValue, declaration);
8886
+ switch (key) {
8887
+ case "color":
8888
+ case "dpi":
8889
+ case "rotateWithShape":
8890
+ case "tile":
8891
+ this.parent.requestRedraw();
8892
+ break;
8893
+ case "image":
8894
+ this._updateImage();
8895
+ break;
8896
+ }
8897
+ }
8898
+ async loadImage() {
8899
+ if (this.image && this.image !== "none") {
8900
+ return await assets.texture.load(this.image);
8901
+ }
8902
+ }
8903
+ async _updateImage() {
8904
+ this._image = await this.loadImage();
8905
+ this.parent.requestRedraw();
8906
+ }
8907
+ canDraw() {
8908
+ return Boolean(
8909
+ this._image || this.color
8910
+ );
8911
+ }
8912
+ draw() {
8913
+ const ctx = this.parent.context;
8914
+ if (this._image) {
8915
+ const { width, height } = this.parent.size;
8916
+ ctx.textureTransform = new Transform2D().scale(1 / width, 1 / height);
8917
+ ctx.fillStyle = this._image;
8918
+ } else {
8919
+ ctx.fillStyle = this.color;
8920
+ }
8921
+ ctx.fill();
8922
+ }
8923
+ }
8924
+ __decorateClass$s([
8925
+ property()
8926
+ ], BaseElement2DFill.prototype, "color");
8927
+ __decorateClass$s([
8928
+ property()
8929
+ ], BaseElement2DFill.prototype, "image");
8930
+ __decorateClass$s([
8931
+ property()
8932
+ ], BaseElement2DFill.prototype, "dpi");
8933
+ __decorateClass$s([
8934
+ property()
8935
+ ], BaseElement2DFill.prototype, "rotateWithShape");
8936
+ __decorateClass$s([
8937
+ property()
8938
+ ], BaseElement2DFill.prototype, "tile");
8939
+
8940
+ var __defProp$k = Object.defineProperty;
8941
+ var __decorateClass$r = (decorators, target, key, kind) => {
8942
+ var result = void 0 ;
8943
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
8944
+ if (decorator = decorators[i])
8945
+ result = (decorator(target, key, result) ) || result;
8946
+ if (result) __defProp$k(target, key, result);
8947
+ return result;
8948
+ };
8949
+ class BaseElement2DGeometry extends CoreObject {
8950
+ constructor(parent, properties) {
8951
+ super();
8952
+ this.parent = parent;
8953
+ this.setProperties(properties);
8954
+ this._updatePath2DSet();
8955
+ }
8956
+ _path2DSet = new Path2DSet();
8957
+ _updateProperty(key, value, oldValue, declaration) {
8958
+ super._updateProperty(key, value, oldValue, declaration);
8959
+ switch (key) {
8960
+ case "svg":
8961
+ case "data":
8962
+ case "viewBox":
8963
+ this._updatePath2DSet();
8964
+ this.parent.requestRedraw();
8965
+ break;
8966
+ }
8967
+ }
8968
+ _updatePath2DSet() {
8969
+ let viewBox;
8970
+ if (this.svg) {
8971
+ const dom = svgToDOM(this.svg);
8972
+ this._path2DSet = svgToPath2DSet(dom);
8973
+ viewBox = this._path2DSet.viewBox ?? this.viewBox;
8974
+ } else {
8975
+ viewBox = this.viewBox;
8976
+ this.data.forEach((path, i) => {
8977
+ const { data, ...style } = path;
8978
+ const path2D = new Path2D();
8979
+ path2D.style = style;
8980
+ path2D.addData(data);
8981
+ this._path2DSet.paths[i] = path2D;
8982
+ });
8983
+ }
8984
+ const [x, y, w, h] = viewBox;
8985
+ this._path2DSet.paths.forEach((path) => {
8986
+ path.applyTransform(new Matrix3$1().translate(-x, -y).scale(1 / w, 1 / h));
8987
+ });
8988
+ }
8989
+ draw() {
8990
+ const ctx = this.parent.context;
8991
+ const { width, height } = this.parent.size;
8992
+ this._path2DSet.paths.forEach((path) => {
8993
+ svgPathCommandsAddToPath2D(
8994
+ path.clone().applyTransform(new Matrix3$1().scale(width, height)).toCommands(),
8995
+ ctx
8996
+ );
8997
+ });
8998
+ }
8999
+ }
9000
+ __decorateClass$r([
9001
+ property()
9002
+ ], BaseElement2DGeometry.prototype, "name");
9003
+ __decorateClass$r([
9004
+ property()
9005
+ ], BaseElement2DGeometry.prototype, "svg");
9006
+ __decorateClass$r([
9007
+ property({ default: [0, 0, 1, 1] })
9008
+ ], BaseElement2DGeometry.prototype, "viewBox");
9009
+ __decorateClass$r([
9010
+ property({ default: [{ data: "M0,0L0,1L1,1L1,0Z" }] })
9011
+ ], BaseElement2DGeometry.prototype, "data");
9012
+
9013
+ var __defProp$j = Object.defineProperty;
9014
+ var __decorateClass$q = (decorators, target, key, kind) => {
9015
+ var result = void 0 ;
9016
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
9017
+ if (decorator = decorators[i])
9018
+ result = (decorator(target, key, result) ) || result;
9019
+ if (result) __defProp$j(target, key, result);
9020
+ return result;
9021
+ };
9022
+ class BaseElement2DOutline extends CoreObject {
9023
+ constructor(parent, properties) {
9024
+ super();
9025
+ this.parent = parent;
9026
+ this.setProperties(properties);
9027
+ }
9028
+ _updateProperty(key, value, oldValue, declaration) {
9029
+ super._updateProperty(key, value, oldValue, declaration);
9030
+ switch (key) {
9031
+ case "color":
9032
+ case "width":
9033
+ case "style":
9034
+ case "image":
9035
+ case "opacity":
9036
+ this.parent.requestRedraw();
9037
+ break;
9038
+ }
9039
+ }
9040
+ canDraw() {
9041
+ return Boolean(
9042
+ this.width || this.color
9043
+ );
9044
+ }
9045
+ draw() {
9046
+ const ctx = this.parent.context;
9047
+ ctx.lineWidth = this.width;
9048
+ ctx.strokeStyle = this.color;
9049
+ ctx.stroke();
9050
+ }
9051
+ }
9052
+ __decorateClass$q([
9053
+ property({ default: 0 })
9054
+ ], BaseElement2DOutline.prototype, "color");
9055
+ __decorateClass$q([
9056
+ property({ default: 0 })
9057
+ ], BaseElement2DOutline.prototype, "width");
9058
+ __decorateClass$q([
9059
+ property({ default: "solid" })
9060
+ ], BaseElement2DOutline.prototype, "style");
9061
+ __decorateClass$q([
9062
+ property()
9063
+ ], BaseElement2DOutline.prototype, "image");
9064
+ __decorateClass$q([
9065
+ property({ default: 1 })
9066
+ ], BaseElement2DOutline.prototype, "opacity");
9067
+
9068
+ var __defProp$i = Object.defineProperty;
9069
+ var __decorateClass$p = (decorators, target, key, kind) => {
9070
+ var result = void 0 ;
9071
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
9072
+ if (decorator = decorators[i])
9073
+ result = (decorator(target, key, result) ) || result;
9074
+ if (result) __defProp$i(target, key, result);
9075
+ return result;
9076
+ };
9077
+ class BaseElement2DShadow extends CoreObject {
9078
+ constructor(parent, properties) {
9079
+ super();
9080
+ this.parent = parent;
9081
+ this.setProperties(properties);
9082
+ }
9083
+ _updateProperty(key, value, oldValue, declaration) {
9084
+ super._updateProperty(key, value, oldValue, declaration);
9085
+ switch (key) {
9086
+ case "color":
9087
+ case "blur":
9088
+ case "offsetX":
9089
+ case "offsetY":
9090
+ this.updateEffect();
9091
+ break;
9092
+ }
9093
+ }
9094
+ updateEffect() {
9095
+ const name = "__$shadow";
9096
+ let effect = this.parent.getNode(name);
9097
+ if (this.blur || this.offsetX || this.offsetY) {
9098
+ if (!effect) {
9099
+ effect = new DropShadowEffect({ name });
9100
+ this.parent.appendChild(effect, "back");
9101
+ }
9102
+ effect.setProperties(this.getProperties());
9103
+ } else {
9104
+ if (effect) {
9105
+ this.parent.removeChild(effect);
9106
+ }
9107
+ }
9108
+ }
9109
+ }
9110
+ __decorateClass$p([
9111
+ property({ default: "#000000" })
9112
+ ], BaseElement2DShadow.prototype, "color");
9113
+ __decorateClass$p([
9114
+ property({ default: 0 })
9115
+ ], BaseElement2DShadow.prototype, "blur");
9116
+ __decorateClass$p([
9117
+ property({ default: 0 })
9118
+ ], BaseElement2DShadow.prototype, "offsetY");
9119
+ __decorateClass$p([
9120
+ property({ default: 0 })
9121
+ ], BaseElement2DShadow.prototype, "offsetX");
9122
+
8882
9123
  class BaseElement2DStyle extends Resource {
8883
9124
  _backgroundColor = new Color();
8884
9125
  constructor(properties) {
@@ -8913,6 +9154,93 @@ for (const key in defaultStyles$1) {
8913
9154
  });
8914
9155
  }
8915
9156
 
9157
+ var __defProp$h = Object.defineProperty;
9158
+ var __decorateClass$o = (decorators, target, key, kind) => {
9159
+ var result = void 0 ;
9160
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
9161
+ if (decorator = decorators[i])
9162
+ result = (decorator(target, key, result) ) || result;
9163
+ if (result) __defProp$h(target, key, result);
9164
+ return result;
9165
+ };
9166
+ class BaseElement2DText extends CoreObject {
9167
+ constructor(parent, properties) {
9168
+ super();
9169
+ this.parent = parent;
9170
+ this.setProperties(properties);
9171
+ }
9172
+ effects;
9173
+ measureDom;
9174
+ fonts;
9175
+ texture = new CanvasTexture();
9176
+ text = new Text();
9177
+ measureResult;
9178
+ _updateProperty(key, value, oldValue, declaration) {
9179
+ super._updateProperty(key, value, oldValue, declaration);
9180
+ switch (key) {
9181
+ case "content":
9182
+ case "effects":
9183
+ case "measureDom":
9184
+ case "fonts":
9185
+ case "split":
9186
+ this.parent.requestRedraw();
9187
+ break;
9188
+ }
9189
+ }
9190
+ _updateText() {
9191
+ this.text.style = this.parent.style.toJSON();
9192
+ this.text.content = this.content ?? "";
9193
+ this.text.effects = this.effects;
9194
+ this.text.fonts = this.fonts;
9195
+ this.text.measureDom = this.measureDom;
9196
+ this.text.requestUpdate();
9197
+ }
9198
+ measure() {
9199
+ this._updateText();
9200
+ return this.text.measure();
9201
+ }
9202
+ updateMeasure() {
9203
+ this.measureResult = this.measure();
9204
+ const textWidth = this.measureResult.boundingBox.width;
9205
+ const textHeight = this.measureResult.boundingBox.height;
9206
+ const { left, top, width, height = textHeight } = this.parent.style;
9207
+ this.parent.position.x = left + Math.min(0, ((width || textWidth) - textWidth) / 2);
9208
+ this.parent.position.y = top + Math.min(0, ((height || textHeight) - textHeight) / 2);
9209
+ this.parent.size.width = textWidth;
9210
+ this.parent.size.height = textHeight;
9211
+ return this;
9212
+ }
9213
+ canDraw() {
9214
+ return Boolean(
9215
+ this.content && this.texture?.valid
9216
+ );
9217
+ }
9218
+ draw() {
9219
+ const ctx = this.parent.context;
9220
+ this.text.render({
9221
+ pixelRatio: this.texture.pixelRatio,
9222
+ view: this.texture.source
9223
+ });
9224
+ this.texture.requestUpload();
9225
+ const { width, height } = this.parent.size;
9226
+ ctx.fillStyle = this.texture;
9227
+ ctx.textureTransform = new Transform2D().scale(1 / width, 1 / height);
9228
+ ctx.fill();
9229
+ }
9230
+ }
9231
+ __decorateClass$o([
9232
+ property({ default: "" })
9233
+ ], BaseElement2DText.prototype, "content");
9234
+ __decorateClass$o([
9235
+ property()
9236
+ ], BaseElement2DText.prototype, "effects");
9237
+ __decorateClass$o([
9238
+ protectedProperty()
9239
+ ], BaseElement2DText.prototype, "measureDom");
9240
+ __decorateClass$o([
9241
+ protectedProperty()
9242
+ ], BaseElement2DText.prototype, "fonts");
9243
+
8916
9244
  var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
8917
9245
  var __decorateClass$n = (decorators, target, key, kind) => {
8918
9246
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$m(target, key) : target;
@@ -9020,6 +9348,41 @@ let BaseElement2D = class extends Node2D {
9020
9348
  this._style?.off("updateProperty", cb);
9021
9349
  this._style = style;
9022
9350
  }
9351
+ _text = new BaseElement2DText(this);
9352
+ get text() {
9353
+ return this._text;
9354
+ }
9355
+ set text(value) {
9356
+ this._text.setProperties(value);
9357
+ }
9358
+ _geometry = new BaseElement2DGeometry(this);
9359
+ get geometry() {
9360
+ return this._geometry;
9361
+ }
9362
+ set geometry(value) {
9363
+ this._geometry.setProperties(value);
9364
+ }
9365
+ _fill = new BaseElement2DFill(this);
9366
+ get fill() {
9367
+ return this._fill;
9368
+ }
9369
+ set fill(value) {
9370
+ this._fill.setProperties(value);
9371
+ }
9372
+ _outline = new BaseElement2DOutline(this);
9373
+ get outline() {
9374
+ return this._outline;
9375
+ }
9376
+ set outline(value) {
9377
+ this._outline.setProperties(value);
9378
+ }
9379
+ _shadow = new BaseElement2DShadow(this);
9380
+ get shadow() {
9381
+ return this._shadow;
9382
+ }
9383
+ set shadow(value) {
9384
+ this._shadow.setProperties(value);
9385
+ }
9023
9386
  constructor(properties, nodes = []) {
9024
9387
  super();
9025
9388
  this._updateStyleProperty = this._updateStyleProperty.bind(this);
@@ -9028,8 +9391,21 @@ let BaseElement2D = class extends Node2D {
9028
9391
  }
9029
9392
  setProperties(properties) {
9030
9393
  if (properties) {
9031
- const { style, ...restProperties } = properties;
9394
+ const {
9395
+ style,
9396
+ text,
9397
+ geometry,
9398
+ fill,
9399
+ outline,
9400
+ shadow,
9401
+ ...restProperties
9402
+ } = properties;
9032
9403
  style && this.style.setProperties(style);
9404
+ text && this.text.setProperties(text);
9405
+ geometry && this.geometry.setProperties(geometry);
9406
+ fill && this.fill.setProperties(fill);
9407
+ outline && this.outline.setProperties(outline);
9408
+ shadow && this.shadow.setProperties(shadow);
9033
9409
  super.setProperties(restProperties);
9034
9410
  }
9035
9411
  return this;
@@ -9086,9 +9462,6 @@ let BaseElement2D = class extends Node2D {
9086
9462
  case "filter":
9087
9463
  this.requestRepaint();
9088
9464
  break;
9089
- case "boxShadow":
9090
- this._updateBoxShadow();
9091
- break;
9092
9465
  case "maskImage":
9093
9466
  this._updateMaskImage();
9094
9467
  break;
@@ -9097,20 +9470,6 @@ let BaseElement2D = class extends Node2D {
9097
9470
  break;
9098
9471
  }
9099
9472
  }
9100
- _updateBoxShadow() {
9101
- const nodePath = "__$style.shadow";
9102
- if (this.style.boxShadow !== "none") {
9103
- const node = this.getNode(nodePath);
9104
- if (node) ; else {
9105
- this.appendChild(new DropShadowEffect({ name: nodePath }), "back");
9106
- }
9107
- } else {
9108
- const node = this.getNode(nodePath);
9109
- if (node) {
9110
- this.removeChild(node);
9111
- }
9112
- }
9113
- }
9114
9473
  _updateMaskImage() {
9115
9474
  const nodePath = "__$style.maskImage";
9116
9475
  const maskImage = this.style.maskImage;
@@ -9199,10 +9558,34 @@ let BaseElement2D = class extends Node2D {
9199
9558
  }
9200
9559
  _draw() {
9201
9560
  super._draw();
9202
- this._drawBackground();
9203
- this._drawContent();
9204
- this._drawBorder();
9205
- this._drawOutline();
9561
+ let flag = false;
9562
+ if (this.text.canDraw()) {
9563
+ this.text.updateMeasure();
9564
+ }
9565
+ if (this.fill.canDraw()) {
9566
+ this._tree?.log(this.name, "draw fill");
9567
+ this.geometry.draw();
9568
+ this.fill.draw();
9569
+ flag = true;
9570
+ }
9571
+ if (this.outline.canDraw()) {
9572
+ this._tree?.log(this.name, "draw outline");
9573
+ this.geometry.draw();
9574
+ this.outline.draw();
9575
+ flag = true;
9576
+ }
9577
+ if (this.text.canDraw()) {
9578
+ this._tree?.log(this.name, "draw text");
9579
+ this._drawBoundingRect();
9580
+ this.text.draw();
9581
+ flag = true;
9582
+ }
9583
+ if (!flag) {
9584
+ this._drawBackground();
9585
+ this._drawContent();
9586
+ this._drawBorder();
9587
+ this._drawOutline();
9588
+ }
9206
9589
  }
9207
9590
  _drawBackground() {
9208
9591
  const texture = this._backgroundImage;
@@ -9274,13 +9657,6 @@ let BaseElement2D = class extends Node2D {
9274
9657
  this._input(event, key);
9275
9658
  }
9276
9659
  }
9277
- _pointerEntering = false;
9278
- _pointerEntered() {
9279
- this._pointerEntering = true;
9280
- }
9281
- _pointerExited() {
9282
- if (this._pointerEntering) ;
9283
- }
9284
9660
  // eslint-disable-next-line unused-imports/no-unused-vars
9285
9661
  _pointerInput(point, key) {
9286
9662
  const { width, height } = this.size;
@@ -9313,6 +9689,11 @@ let BaseElement2D = class extends Node2D {
9313
9689
  ...json,
9314
9690
  props: {
9315
9691
  style: this.style.toJSON(),
9692
+ text: this.text.toJSON(),
9693
+ geometry: this.geometry.toJSON(),
9694
+ fill: this.fill.toJSON(),
9695
+ outline: this.outline.toJSON(),
9696
+ shadow: this.shadow.toJSON(),
9316
9697
  ...json.props
9317
9698
  }
9318
9699
  };
@@ -9977,12 +10358,12 @@ let Image2D = class extends Element2D {
9977
10358
  __decorateClass$i([
9978
10359
  protectedProperty()
9979
10360
  ], Image2D.prototype, "texture", 2);
9980
- __decorateClass$i([
9981
- property()
9982
- ], Image2D.prototype, "srcRect", 2);
9983
10361
  __decorateClass$i([
9984
10362
  property({ default: "" })
9985
10363
  ], Image2D.prototype, "src", 2);
10364
+ __decorateClass$i([
10365
+ property()
10366
+ ], Image2D.prototype, "srcRect", 2);
9986
10367
  __decorateClass$i([
9987
10368
  property({ default: false })
9988
10369
  ], Image2D.prototype, "gif", 2);
@@ -10082,7 +10463,7 @@ let Text2D = class extends TextureRect2D {
10082
10463
  measureDom;
10083
10464
  fonts;
10084
10465
  texture = new CanvasTexture();
10085
- text = new Text();
10466
+ _baseText = new Text();
10086
10467
  measureResult;
10087
10468
  _subTextsCount = 0;
10088
10469
  constructor(properties, children = []) {
@@ -10109,12 +10490,12 @@ let Text2D = class extends TextureRect2D {
10109
10490
  }
10110
10491
  }
10111
10492
  _updateText() {
10112
- this.text.style = this.style.toJSON();
10113
- this.text.content = this.content ?? "";
10114
- this.text.effects = this.effects;
10115
- this.text.fonts = this.fonts;
10116
- this.text.measureDom = this.measureDom;
10117
- this.text.requestUpdate();
10493
+ this._baseText.style = this.style.toJSON();
10494
+ this._baseText.content = this.content ?? "";
10495
+ this._baseText.effects = this.effects;
10496
+ this._baseText.fonts = this.fonts;
10497
+ this._baseText.measureDom = this.measureDom;
10498
+ this._baseText.requestUpdate();
10118
10499
  }
10119
10500
  _updateStyleProperty(key, value, oldValue) {
10120
10501
  switch (key) {
@@ -10167,7 +10548,7 @@ let Text2D = class extends TextureRect2D {
10167
10548
  }
10168
10549
  measure() {
10169
10550
  this._updateText();
10170
- return this.text.measure();
10551
+ return this._baseText.measure();
10171
10552
  }
10172
10553
  updateMeasure() {
10173
10554
  this.measureResult = this.measure();
@@ -10219,7 +10600,7 @@ let Text2D = class extends TextureRect2D {
10219
10600
  if (onText2DRender) {
10220
10601
  onText2DRender();
10221
10602
  } else {
10222
- this.text.render({
10603
+ this._baseText.render({
10223
10604
  pixelRatio: this.texture.pixelRatio,
10224
10605
  view: this.texture.source
10225
10606
  });
@@ -13531,4 +13912,4 @@ async function render(options) {
13531
13912
  });
13532
13913
  }
13533
13914
 
13534
- export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DStyle, BlurEffect, CanvasContext, CanvasItem, CanvasItemEditor, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, Control, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, EventEmitter, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GIFLoader, Geometry, GlitchEffect, GodrayEffect, Graphics2D, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JSONLoader, KawaseBlurEffect, KawaseTransition, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, RawWeakMap, Rect2, RefCounted, Renderer, Resource, Ruler, 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, ScrollBar, Text2D, 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, XScrollBar, YScrollBar, ZoomBlurEffect, assets, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, frag$1 as frag, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };
13915
+ export { AnimatedTexture, Animation, Assets, Audio, AudioPipeline, AudioProcessor, AudioSpectrum, AudioWaveform, BaseElement2D, BaseElement2DFill, BaseElement2DGeometry, BaseElement2DOutline, BaseElement2DShadow, BaseElement2DStyle, BaseElement2DText, CanvasContext, CanvasItem, CanvasItemEditor, CanvasTexture, Color, ColorAdjustEffect, ColorFilterEffect, ColorMatrix, ColorOverlayEffect, ColorRemoveEffect, ColorReplaceEffect, ColorTexture, Control, CoreObject, DEG_TO_RAD, DEVICE_PIXEL_RATIO, DropShadowEffect, Effect, EffectMaterial, Element2D, Element2DStyle, EmbossEffect, Engine, EventEmitter, FlexElement2D, FlexElement2DStyle, FlexLayout, FontLoader, GIFLoader, GaussianBlurEffect, Geometry, GlitchEffect, GodrayEffect, Graphics2D, HTMLAudio, HTMLAudioContext, HTMLSound, IN_BROWSER, Image2D, ImageTexture, IndexBuffer, Input, InputEvent, JSONLoader, KawaseBlurEffect, KawaseTransition, LeftEraseTransition, Loader, Lottie2D, LottieLoader, MainLoop, MaskEffect, Material, Matrix, Matrix2, Matrix3, Matrix4, MouseInputEvent, Node, Node2D, OutlineEffect, PI, PI_2, PixelateEffect, PixelsTexture, PointerInputEvent, Projection2D, QuadGeometry, QuadUvGeometry, RAD_TO_DEG, Range, RawWeakMap, Rect2, RefCounted, Renderer, Resource, Ruler, 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, ScrollBar, Text2D, 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, XScrollBar, YScrollBar, ZoomBlurEffect, assets, clamp, clampFrag, createHTMLCanvas, createNode, crossOrigin, cubicBezier, curves, customNode, customNodes, defaultOptions, defineProperty, determineCrossOrigin, ease, easeIn, easeInOut, easeOut, frag$1 as frag, getDeclarations, getDefaultCssPropertyValue, isCanvasElement, isElementNode, isImageElement, isPow2, isVideoElement, isWebgl2, lerp, linear, log2, mapWebGLBlendModes, nextPow2, nextTick, parseCSSFilter, parseCSSTransform, parseCSSTransformOrigin, parseCssFunctions, parseCssProperty, property, protectedProperty, render, timingFunctions, uid };