modern-canvas 0.9.5 → 0.10.0

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,4 +1,5 @@
1
1
  import { defineProperty, Observable, Reactivable, parseColor, property, RawWeakMap as RawWeakMap$1, isGradient, isColorFillObject, clearUndef, idGenerator, normalizeFill, isNone, normalizeBackground, normalizeForeground, normalizeOutline, normalizeShadow, normalizeShape, getDefaultStyle, normalizeText, normalizeTextContent } from 'modern-idoc';
2
+ import { fonts } from 'modern-font';
2
3
  import { extend } from 'colord';
3
4
  import namesPlugin from 'colord/plugins/names';
4
5
  import { Path2D, Path2DSet, svgToDom, svgToPath2DSet, Matrix3 as Matrix3$1, BoundingBox } from 'modern-path2d';
@@ -865,6 +866,10 @@ class Input extends Observable {
865
866
  this.setCursor(this.event.cursor);
866
867
  }
867
868
  };
869
+ destroy() {
870
+ this.removeEventListeners();
871
+ super.destroy();
872
+ }
868
873
  }
869
874
 
870
875
  let IID = 0;
@@ -2086,13 +2091,13 @@ class Vector3 extends Vector {
2086
2091
  }
2087
2092
  }
2088
2093
 
2089
- var __defProp$Q = Object.defineProperty;
2090
- var __decorateClass$Z = (decorators, target, key, kind) => {
2094
+ var __defProp$T = Object.defineProperty;
2095
+ var __decorateClass$$ = (decorators, target, key, kind) => {
2091
2096
  var result = void 0 ;
2092
2097
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
2093
2098
  if (decorator = decorators[i])
2094
2099
  result = (decorator(target, key, result) ) || result;
2095
- if (result) __defProp$Q(target, key, result);
2100
+ if (result) __defProp$T(target, key, result);
2096
2101
  return result;
2097
2102
  };
2098
2103
  class MainLoop extends CoreObject {
@@ -2105,9 +2110,10 @@ class MainLoop extends CoreObject {
2105
2110
  get spf() {
2106
2111
  return this.fps ? Math.floor(1e3 / this.fps) : 0;
2107
2112
  }
2108
- constructor() {
2113
+ constructor(properties) {
2109
2114
  super();
2110
- this._onNextTick = this._onNextTick.bind(this);
2115
+ this._onTicker = this._onTicker.bind(this);
2116
+ this.setProperties(properties);
2111
2117
  }
2112
2118
  start(process) {
2113
2119
  if (!this._starting) {
@@ -2117,16 +2123,16 @@ class MainLoop extends CoreObject {
2117
2123
  }
2118
2124
  this._startedProcess = process;
2119
2125
  this.on("process", process);
2120
- Ticker.on(this._onNextTick, { sort: 0 });
2126
+ Ticker.on(this._onTicker, { sort: 0 });
2121
2127
  }
2122
2128
  }
2123
2129
  stop() {
2124
2130
  if (this._starting) {
2125
2131
  this._starting = false;
2126
- Ticker.off(this._onNextTick, { sort: 0 });
2132
+ Ticker.off(this._onTicker, { sort: 0 });
2127
2133
  }
2128
2134
  }
2129
- _onNextTick() {
2135
+ _onTicker() {
2130
2136
  const elapsed = Ticker.elapsed * this.speed;
2131
2137
  const time = this._nextDeltaTime -= elapsed;
2132
2138
  if (time <= 0) {
@@ -2135,22 +2141,40 @@ class MainLoop extends CoreObject {
2135
2141
  }
2136
2142
  }
2137
2143
  destroy() {
2138
- super.destroy();
2139
2144
  this.stop();
2145
+ super.destroy();
2140
2146
  }
2141
2147
  }
2142
- __decorateClass$Z([
2148
+ __decorateClass$$([
2143
2149
  property({ fallback: 60 })
2144
2150
  ], MainLoop.prototype, "fps");
2145
- __decorateClass$Z([
2151
+ __decorateClass$$([
2146
2152
  property({ fallback: 1 })
2147
2153
  ], MainLoop.prototype, "speed");
2148
2154
 
2149
- class Renderer {
2150
- view;
2151
- pixelRatio = DEVICE_PIXEL_RATIO;
2155
+ var __defProp$S = Object.defineProperty;
2156
+ var __decorateClass$_ = (decorators, target, key, kind) => {
2157
+ var result = void 0 ;
2158
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
2159
+ if (decorator = decorators[i])
2160
+ result = (decorator(target, key, result) ) || result;
2161
+ if (result) __defProp$S(target, key, result);
2162
+ return result;
2163
+ };
2164
+ class Renderer extends Reactivable {
2152
2165
  screen = { x: 0, y: 0, width: 0, height: 0 };
2153
2166
  related = new RawWeakMap();
2167
+ _updateProperty(key, newValue, oldValue) {
2168
+ super._updateProperty(key, newValue, oldValue);
2169
+ switch (key) {
2170
+ case "view":
2171
+ case "pixelRatio":
2172
+ if (this.view) {
2173
+ this.view.dataset.pixelRatio = String(this.pixelRatio);
2174
+ }
2175
+ break;
2176
+ }
2177
+ }
2154
2178
  getRelated(source, createFn) {
2155
2179
  let related = this.related.get(source);
2156
2180
  if (related)
@@ -2174,7 +2198,16 @@ class Renderer {
2174
2198
  this.view.style.height = `${height}px`;
2175
2199
  }
2176
2200
  }
2201
+ destroy() {
2202
+ super.destroy();
2203
+ }
2177
2204
  }
2205
+ __decorateClass$_([
2206
+ property({ fallback: DEVICE_PIXEL_RATIO })
2207
+ ], Renderer.prototype, "pixelRatio");
2208
+ __decorateClass$_([
2209
+ property({ internal: true })
2210
+ ], Renderer.prototype, "view");
2178
2211
 
2179
2212
  var WebGLBlendMode = /* @__PURE__ */ ((WebGLBlendMode2) => {
2180
2213
  WebGLBlendMode2["NORMAL"] = "normal";
@@ -2881,8 +2914,7 @@ class WebGLFramebufferModule extends WebGLModule {
2881
2914
  throw new Error("Unable to create framebuffer");
2882
2915
  }
2883
2916
  if (options) {
2884
- this.bind(framebuffer);
2885
- this.update(options);
2917
+ this.update(framebuffer, options);
2886
2918
  }
2887
2919
  return framebuffer;
2888
2920
  }
@@ -2892,11 +2924,15 @@ class WebGLFramebufferModule extends WebGLModule {
2892
2924
  width: 0,
2893
2925
  height: 0,
2894
2926
  mipLevel: 0,
2927
+ msaa: false,
2895
2928
  stencil: false,
2896
2929
  depth: false,
2897
2930
  depthTexture: null,
2898
2931
  colorTextures: [],
2899
- multisample: 0
2932
+ multisample: 4,
2933
+ stencilBuffer: null,
2934
+ msaaRenderBuffers: [],
2935
+ framebuffer: null
2900
2936
  };
2901
2937
  });
2902
2938
  }
@@ -2916,6 +2952,7 @@ class WebGLFramebufferModule extends WebGLModule {
2916
2952
  if (!("drawBuffers" in gl)) {
2917
2953
  count = Math.min(count, 1);
2918
2954
  }
2955
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
2919
2956
  for (let i = 0; i < count; i++) {
2920
2957
  const texture = meta.colorTextures[i];
2921
2958
  this._renderer.texture.bind({
@@ -2938,6 +2975,36 @@ class WebGLFramebufferModule extends WebGLModule {
2938
2975
  meta.colorTextures.map((_, i) => gl.COLOR_ATTACHMENT0 + i)
2939
2976
  );
2940
2977
  }
2978
+ if (meta.msaa) {
2979
+ if (!meta.framebuffer) {
2980
+ const gl2 = this._renderer.gl;
2981
+ meta.framebuffer = gl2.createFramebuffer();
2982
+ gl2.bindFramebuffer(gl2.FRAMEBUFFER, meta.framebuffer);
2983
+ meta.colorTextures.forEach((_, i) => {
2984
+ meta.msaaRenderBuffers[i] = gl2.createRenderbuffer();
2985
+ });
2986
+ }
2987
+ gl.bindFramebuffer(gl.FRAMEBUFFER, meta.framebuffer);
2988
+ meta.colorTextures.forEach((texture, i) => {
2989
+ this._renderer.texture.bind({ value: texture, location: 0 });
2990
+ const msaaRenderBuffer = meta.msaaRenderBuffers[i];
2991
+ gl.bindRenderbuffer(gl.RENDERBUFFER, msaaRenderBuffer);
2992
+ gl.renderbufferStorageMultisample(
2993
+ gl.RENDERBUFFER,
2994
+ 4,
2995
+ gl.RGBA8,
2996
+ // TODO
2997
+ meta.width * this._renderer.pixelRatio,
2998
+ meta.height * this._renderer.pixelRatio
2999
+ );
3000
+ gl.framebufferRenderbuffer(
3001
+ gl.FRAMEBUFFER,
3002
+ gl.COLOR_ATTACHMENT0 + i,
3003
+ gl.RENDERBUFFER,
3004
+ msaaRenderBuffer
3005
+ );
3006
+ });
3007
+ }
2941
3008
  if (meta.depthTexture && (this._renderer.version > 1 || this._renderer.extensions.depthTexture)) {
2942
3009
  this._renderer.texture.bind({
2943
3010
  location: 0,
@@ -2958,7 +3025,7 @@ class WebGLFramebufferModule extends WebGLModule {
2958
3025
  meta.stencilBuffer ??= gl.createRenderbuffer();
2959
3026
  gl.bindRenderbuffer(gl.RENDERBUFFER, meta.stencilBuffer);
2960
3027
  const { attachment, format } = this._getAttachmentAndFormat(meta);
2961
- if (meta.msaaBuffer) {
3028
+ if (meta.msaa) {
2962
3029
  gl.renderbufferStorageMultisample(
2963
3030
  gl.RENDERBUFFER,
2964
3031
  meta.multisample,
@@ -3006,7 +3073,7 @@ class WebGLFramebufferModule extends WebGLModule {
3006
3073
  if (meta.stencil) {
3007
3074
  const { format } = this._getAttachmentAndFormat(meta);
3008
3075
  gl.bindRenderbuffer(gl.RENDERBUFFER, meta.stencil);
3009
- if (meta.msaaBuffer) {
3076
+ if (meta.msaa) {
3010
3077
  gl.renderbufferStorageMultisample(
3011
3078
  gl.RENDERBUFFER,
3012
3079
  meta.multisample,
@@ -3018,30 +3085,6 @@ class WebGLFramebufferModule extends WebGLModule {
3018
3085
  gl.renderbufferStorage(gl.RENDERBUFFER, format, meta.width, meta.height);
3019
3086
  }
3020
3087
  }
3021
- let count = meta.colorTextures.length;
3022
- if (!gl.drawBuffers) {
3023
- count = Math.min(count, 1);
3024
- }
3025
- for (let i = 0; i < count; i++) {
3026
- const texture = meta.colorTextures[i];
3027
- this._renderer.texture.update(texture, {
3028
- value: {
3029
- pixels: null,
3030
- width: meta.width,
3031
- height: meta.height
3032
- }
3033
- });
3034
- if (i === 0 && meta.msaaBuffer) {
3035
- gl.bindRenderbuffer(gl.RENDERBUFFER, meta.msaaBuffer);
3036
- gl.renderbufferStorageMultisample(
3037
- gl.RENDERBUFFER,
3038
- meta.multisample,
3039
- gl.RGBA,
3040
- meta.width,
3041
- meta.height
3042
- );
3043
- }
3044
- }
3045
3088
  if (meta.depthTexture) {
3046
3089
  this._renderer.texture.update(meta.depthTexture, {
3047
3090
  value: {
@@ -3052,19 +3095,65 @@ class WebGLFramebufferModule extends WebGLModule {
3052
3095
  });
3053
3096
  }
3054
3097
  }
3098
+ finishRenderPass(framebuffer) {
3099
+ const meta = this.getMeta(framebuffer);
3100
+ if (!meta.msaa || !meta.framebuffer)
3101
+ return;
3102
+ const gl = this._renderer.gl;
3103
+ gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, framebuffer);
3104
+ gl.bindFramebuffer(gl.READ_FRAMEBUFFER, meta.framebuffer);
3105
+ const width = meta.width * this._renderer.pixelRatio;
3106
+ const height = meta.height * this._renderer.pixelRatio;
3107
+ gl.blitFramebuffer(
3108
+ 0,
3109
+ 0,
3110
+ width,
3111
+ height,
3112
+ 0,
3113
+ 0,
3114
+ width,
3115
+ height,
3116
+ gl.COLOR_BUFFER_BIT,
3117
+ gl.NEAREST
3118
+ );
3119
+ gl.bindFramebuffer(gl.FRAMEBUFFER, meta.framebuffer);
3120
+ }
3121
+ copyToTexture(framebuffer, texture) {
3122
+ const gl = this._renderer.gl;
3123
+ const meta = this.getMeta(framebuffer);
3124
+ this.finishRenderPass(framebuffer);
3125
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
3126
+ this._renderer.texture.bind({
3127
+ value: texture,
3128
+ location: 0
3129
+ });
3130
+ gl.copyTexSubImage2D(
3131
+ gl.TEXTURE_2D,
3132
+ 0,
3133
+ 0,
3134
+ 0,
3135
+ 0,
3136
+ 0,
3137
+ meta.width,
3138
+ meta.height
3139
+ );
3140
+ }
3055
3141
  bind(framebuffer) {
3056
3142
  const gl = this._renderer.gl;
3143
+ const meta = framebuffer ? this.getMeta(framebuffer) : void 0;
3057
3144
  const value = framebuffer;
3058
3145
  const oldValue = this.boundFramebuffer;
3059
3146
  const changed = {
3060
3147
  value: oldValue !== value
3061
3148
  };
3062
3149
  if (changed.value) {
3063
- gl.bindFramebuffer(gl.FRAMEBUFFER, value);
3150
+ gl.bindFramebuffer(
3151
+ gl.FRAMEBUFFER,
3152
+ meta?.msaa && meta.framebuffer ? meta.framebuffer : value
3153
+ );
3064
3154
  this.boundFramebuffer = value;
3065
3155
  }
3066
- if (value) {
3067
- const meta = this.getMeta(value);
3156
+ if (meta) {
3068
3157
  for (let i = 0; i < meta.colorTextures.length; i++) {
3069
3158
  this._renderer.texture.unbind(meta.colorTextures[i]);
3070
3159
  }
@@ -3112,7 +3201,7 @@ class WebGLFramebufferModule extends WebGLModule {
3112
3201
  attachment = gl.STENCIL_ATTACHMENT;
3113
3202
  format = gl.STENCIL_INDEX8;
3114
3203
  }
3115
- if (meta.msaaBuffer) {
3204
+ if (meta.msaa) {
3116
3205
  gl.renderbufferStorageMultisample(
3117
3206
  gl.RENDERBUFFER,
3118
3207
  meta.multisample,
@@ -4191,6 +4280,7 @@ class WebGLRenderer extends Renderer {
4191
4280
  this.view?.removeEventListener("webglcontextlost", this._onContextLost, false);
4192
4281
  this.view?.removeEventListener("webglcontextrestored", this._onContextRestored, false);
4193
4282
  this.extensions.loseContext?.loseContext();
4283
+ super.destroy();
4194
4284
  }
4195
4285
  toPixels(x = 0, y = 0, width = this.gl.drawingBufferWidth, height = this.gl.drawingBufferHeight) {
4196
4286
  const length = width * height * 4;
@@ -4315,13 +4405,13 @@ class Geometry extends Resource {
4315
4405
  }
4316
4406
  }
4317
4407
 
4318
- var __defProp$P = Object.defineProperty;
4319
- var __decorateClass$Y = (decorators, target, key, kind) => {
4408
+ var __defProp$R = Object.defineProperty;
4409
+ var __decorateClass$Z = (decorators, target, key, kind) => {
4320
4410
  var result = void 0 ;
4321
4411
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4322
4412
  if (decorator = decorators[i])
4323
4413
  result = (decorator(target, key, result) ) || result;
4324
- if (result) __defProp$P(target, key, result);
4414
+ if (result) __defProp$R(target, key, result);
4325
4415
  return result;
4326
4416
  };
4327
4417
  class IndexBuffer extends Resource {
@@ -4365,20 +4455,20 @@ class IndexBuffer extends Resource {
4365
4455
  return result;
4366
4456
  }
4367
4457
  }
4368
- __decorateClass$Y([
4458
+ __decorateClass$Z([
4369
4459
  property({ internal: true, fallback: null })
4370
4460
  ], IndexBuffer.prototype, "data");
4371
- __decorateClass$Y([
4461
+ __decorateClass$Z([
4372
4462
  property({ internal: true, fallback: false })
4373
4463
  ], IndexBuffer.prototype, "dynamic");
4374
4464
 
4375
- var __defProp$O = Object.defineProperty;
4376
- var __decorateClass$X = (decorators, target, key, kind) => {
4465
+ var __defProp$Q = Object.defineProperty;
4466
+ var __decorateClass$Y = (decorators, target, key, kind) => {
4377
4467
  var result = void 0 ;
4378
4468
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4379
4469
  if (decorator = decorators[i])
4380
4470
  result = (decorator(target, key, result) ) || result;
4381
- if (result) __defProp$O(target, key, result);
4471
+ if (result) __defProp$Q(target, key, result);
4382
4472
  return result;
4383
4473
  };
4384
4474
  class VertexBuffer extends Resource {
@@ -4422,20 +4512,20 @@ class VertexBuffer extends Resource {
4422
4512
  return result;
4423
4513
  }
4424
4514
  }
4425
- __decorateClass$X([
4515
+ __decorateClass$Y([
4426
4516
  property({ internal: true, default: null })
4427
4517
  ], VertexBuffer.prototype, "data");
4428
- __decorateClass$X([
4518
+ __decorateClass$Y([
4429
4519
  property({ internal: true, fallback: false })
4430
4520
  ], VertexBuffer.prototype, "dynamic");
4431
4521
 
4432
- var __defProp$N = Object.defineProperty;
4433
- var __decorateClass$W = (decorators, target, key, kind) => {
4522
+ var __defProp$P = Object.defineProperty;
4523
+ var __decorateClass$X = (decorators, target, key, kind) => {
4434
4524
  var result = void 0 ;
4435
4525
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4436
4526
  if (decorator = decorators[i])
4437
4527
  result = (decorator(target, key, result) ) || result;
4438
- if (result) __defProp$N(target, key, result);
4528
+ if (result) __defProp$P(target, key, result);
4439
4529
  return result;
4440
4530
  };
4441
4531
  class VertexAttribute extends Resource {
@@ -4469,25 +4559,25 @@ class VertexAttribute extends Resource {
4469
4559
  return result;
4470
4560
  }
4471
4561
  }
4472
- __decorateClass$W([
4562
+ __decorateClass$X([
4473
4563
  property({ internal: true })
4474
4564
  ], VertexAttribute.prototype, "buffer");
4475
- __decorateClass$W([
4565
+ __decorateClass$X([
4476
4566
  property({ fallback: 0 })
4477
4567
  ], VertexAttribute.prototype, "size");
4478
- __decorateClass$W([
4568
+ __decorateClass$X([
4479
4569
  property({ fallback: false })
4480
4570
  ], VertexAttribute.prototype, "normalized");
4481
- __decorateClass$W([
4571
+ __decorateClass$X([
4482
4572
  property({ fallback: "float" })
4483
4573
  ], VertexAttribute.prototype, "type");
4484
- __decorateClass$W([
4574
+ __decorateClass$X([
4485
4575
  property()
4486
4576
  ], VertexAttribute.prototype, "stride");
4487
- __decorateClass$W([
4577
+ __decorateClass$X([
4488
4578
  property()
4489
4579
  ], VertexAttribute.prototype, "offset");
4490
- __decorateClass$W([
4580
+ __decorateClass$X([
4491
4581
  property()
4492
4582
  ], VertexAttribute.prototype, "divisor");
4493
4583
 
@@ -4731,13 +4821,13 @@ class UvGeometry extends Geometry {
4731
4821
  }
4732
4822
  }
4733
4823
 
4734
- var __defProp$M = Object.defineProperty;
4735
- var __decorateClass$V = (decorators, target, key, kind) => {
4824
+ var __defProp$O = Object.defineProperty;
4825
+ var __decorateClass$W = (decorators, target, key, kind) => {
4736
4826
  var result = void 0 ;
4737
4827
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4738
4828
  if (decorator = decorators[i])
4739
4829
  result = (decorator(target, key, result) ) || result;
4740
- if (result) __defProp$M(target, key, result);
4830
+ if (result) __defProp$O(target, key, result);
4741
4831
  return result;
4742
4832
  };
4743
4833
  class Texture2D extends Resource {
@@ -4793,7 +4883,9 @@ class Texture2D extends Resource {
4793
4883
  /** @internal */
4794
4884
  _glTexture(renderer, options) {
4795
4885
  return renderer.getRelated(this, () => {
4796
- return renderer.texture.create(this._glTextureOptions(renderer, options));
4886
+ return renderer.texture.create(
4887
+ this._glTextureOptions(renderer, options)
4888
+ );
4797
4889
  });
4798
4890
  }
4799
4891
  _updateProperty(key, value, oldValue) {
@@ -4863,27 +4955,31 @@ class Texture2D extends Resource {
4863
4955
  }
4864
4956
  }
4865
4957
  }
4866
- __decorateClass$V([
4958
+ __decorateClass$W([
4867
4959
  property({ internal: true })
4868
4960
  ], Texture2D.prototype, "source");
4869
- __decorateClass$V([
4961
+ __decorateClass$W([
4870
4962
  property({ fallback: 0 })
4871
4963
  ], Texture2D.prototype, "width");
4872
- __decorateClass$V([
4964
+ __decorateClass$W([
4873
4965
  property({ fallback: 0 })
4874
4966
  ], Texture2D.prototype, "height");
4875
- __decorateClass$V([
4967
+ __decorateClass$W([
4876
4968
  property({ fallback: "linear" })
4877
4969
  ], Texture2D.prototype, "filterMode");
4878
- __decorateClass$V([
4970
+ __decorateClass$W([
4879
4971
  property({ fallback: "clamp_to_edge" })
4880
4972
  ], Texture2D.prototype, "wrapMode");
4881
- __decorateClass$V([
4973
+ __decorateClass$W([
4882
4974
  property({ fallback: 1 })
4883
4975
  ], Texture2D.prototype, "pixelRatio");
4884
4976
 
4885
4977
  class AnimatedTexture extends Resource {
4886
4978
  frames;
4979
+ frameIndex = 0;
4980
+ get currentFrame() {
4981
+ return this.frames[this.frameIndex];
4982
+ }
4887
4983
  constructor(source) {
4888
4984
  super();
4889
4985
  let frames;
@@ -4908,13 +5004,13 @@ class AnimatedTexture extends Resource {
4908
5004
  }
4909
5005
  }
4910
5006
 
4911
- var __defProp$L = Object.defineProperty;
4912
- var __decorateClass$U = (decorators, target, key, kind) => {
5007
+ var __defProp$N = Object.defineProperty;
5008
+ var __decorateClass$V = (decorators, target, key, kind) => {
4913
5009
  var result = void 0 ;
4914
5010
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
4915
5011
  if (decorator = decorators[i])
4916
5012
  result = (decorator(target, key, result) ) || result;
4917
- if (result) __defProp$L(target, key, result);
5013
+ if (result) __defProp$N(target, key, result);
4918
5014
  return result;
4919
5015
  };
4920
5016
  class CanvasTexture extends Texture2D {
@@ -4933,7 +5029,7 @@ class CanvasTexture extends Texture2D {
4933
5029
  super._updateProperty(key, value, oldValue);
4934
5030
  }
4935
5031
  }
4936
- __decorateClass$U([
5032
+ __decorateClass$V([
4937
5033
  property({ fallback: 2 })
4938
5034
  ], CanvasTexture.prototype, "pixelRatio");
4939
5035
 
@@ -5155,13 +5251,13 @@ class PixelsTexture extends Texture2D {
5155
5251
  }
5156
5252
  }
5157
5253
 
5158
- var __defProp$K = Object.defineProperty;
5159
- var __decorateClass$T = (decorators, target, key, kind) => {
5254
+ var __defProp$M = Object.defineProperty;
5255
+ var __decorateClass$U = (decorators, target, key, kind) => {
5160
5256
  var result = void 0 ;
5161
5257
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5162
5258
  if (decorator = decorators[i])
5163
5259
  result = (decorator(target, key, result) ) || result;
5164
- if (result) __defProp$K(target, key, result);
5260
+ if (result) __defProp$M(target, key, result);
5165
5261
  return result;
5166
5262
  };
5167
5263
  function resolveOptions(options) {
@@ -5405,10 +5501,10 @@ const _VideoTexture = class _VideoTexture extends Texture2D {
5405
5501
  }
5406
5502
  }
5407
5503
  };
5408
- __decorateClass$T([
5504
+ __decorateClass$U([
5409
5505
  property({ internal: true, fallback: true })
5410
5506
  ], _VideoTexture.prototype, "autoUpdate");
5411
- __decorateClass$T([
5507
+ __decorateClass$U([
5412
5508
  property({ internal: true, fallback: 0 })
5413
5509
  ], _VideoTexture.prototype, "fps");
5414
5510
  let VideoTexture = _VideoTexture;
@@ -5657,14 +5753,14 @@ class Children {
5657
5753
  }
5658
5754
  }
5659
5755
 
5660
- var __defProp$J = Object.defineProperty;
5756
+ var __defProp$L = Object.defineProperty;
5661
5757
  var __getOwnPropDesc$J = Object.getOwnPropertyDescriptor;
5662
- var __decorateClass$S = (decorators, target, key, kind) => {
5758
+ var __decorateClass$T = (decorators, target, key, kind) => {
5663
5759
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$J(target, key) : target;
5664
5760
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
5665
5761
  if (decorator = decorators[i])
5666
5762
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5667
- if (kind && result) __defProp$J(target, key, result);
5763
+ if (kind && result) __defProp$L(target, key, result);
5668
5764
  return result;
5669
5765
  };
5670
5766
  const iidMap = {};
@@ -6173,45 +6269,45 @@ let Node = class extends CoreObject {
6173
6269
  return node;
6174
6270
  }
6175
6271
  };
6176
- __decorateClass$S([
6272
+ __decorateClass$T([
6177
6273
  property({ fallback: idGenerator() })
6178
6274
  ], Node.prototype, "id", 2);
6179
- __decorateClass$S([
6275
+ __decorateClass$T([
6180
6276
  property({ fallback: idGenerator() })
6181
6277
  ], Node.prototype, "name", 2);
6182
- __decorateClass$S([
6278
+ __decorateClass$T([
6183
6279
  property({ default: () => ({}) })
6184
6280
  ], Node.prototype, "meta", 2);
6185
- __decorateClass$S([
6281
+ __decorateClass$T([
6186
6282
  property({ internal: true, fallback: "inherit" })
6187
6283
  ], Node.prototype, "processMode", 2);
6188
- __decorateClass$S([
6284
+ __decorateClass$T([
6189
6285
  property({ internal: true, fallback: "default" })
6190
6286
  ], Node.prototype, "processSortMode", 2);
6191
- __decorateClass$S([
6287
+ __decorateClass$T([
6192
6288
  property({ internal: true, fallback: "inherit" })
6193
6289
  ], Node.prototype, "renderMode", 2);
6194
- __decorateClass$S([
6290
+ __decorateClass$T([
6195
6291
  property({ internal: true, fallback: "inherit" })
6196
6292
  ], Node.prototype, "inputMode", 2);
6197
- __decorateClass$S([
6293
+ __decorateClass$T([
6198
6294
  property({ internal: true, fallback: "default" })
6199
6295
  ], Node.prototype, "internalMode", 2);
6200
- __decorateClass$S([
6296
+ __decorateClass$T([
6201
6297
  property({ internal: true })
6202
6298
  ], Node.prototype, "mask", 2);
6203
- Node = __decorateClass$S([
6299
+ Node = __decorateClass$T([
6204
6300
  customNode("Node")
6205
6301
  ], Node);
6206
6302
 
6207
- var __defProp$I = Object.defineProperty;
6303
+ var __defProp$K = Object.defineProperty;
6208
6304
  var __getOwnPropDesc$I = Object.getOwnPropertyDescriptor;
6209
- var __decorateClass$R = (decorators, target, key, kind) => {
6305
+ var __decorateClass$S = (decorators, target, key, kind) => {
6210
6306
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$I(target, key) : target;
6211
6307
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6212
6308
  if (decorator = decorators[i])
6213
6309
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6214
- if (kind && result) __defProp$I(target, key, result);
6310
+ if (kind && result) __defProp$K(target, key, result);
6215
6311
  return result;
6216
6312
  };
6217
6313
  let TimelineNode = class extends Node {
@@ -6271,30 +6367,30 @@ let TimelineNode = class extends Node {
6271
6367
  this._updateCurrentTime();
6272
6368
  }
6273
6369
  };
6274
- __decorateClass$R([
6370
+ __decorateClass$S([
6275
6371
  property({ fallback: 0 })
6276
6372
  ], TimelineNode.prototype, "delay", 2);
6277
- __decorateClass$R([
6373
+ __decorateClass$S([
6278
6374
  property({ fallback: 0 })
6279
6375
  ], TimelineNode.prototype, "duration", 2);
6280
- __decorateClass$R([
6376
+ __decorateClass$S([
6281
6377
  property({ fallback: false })
6282
6378
  ], TimelineNode.prototype, "paused", 2);
6283
- __decorateClass$R([
6379
+ __decorateClass$S([
6284
6380
  property({ internal: true, fallback: false })
6285
6381
  ], TimelineNode.prototype, "insideTimeRange", 2);
6286
- TimelineNode = __decorateClass$R([
6382
+ TimelineNode = __decorateClass$S([
6287
6383
  customNode("TimelineNode")
6288
6384
  ], TimelineNode);
6289
6385
 
6290
- var __defProp$H = Object.defineProperty;
6386
+ var __defProp$J = Object.defineProperty;
6291
6387
  var __getOwnPropDesc$H = Object.getOwnPropertyDescriptor;
6292
- var __decorateClass$Q = (decorators, target, key, kind) => {
6388
+ var __decorateClass$R = (decorators, target, key, kind) => {
6293
6389
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$H(target, key) : target;
6294
6390
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6295
6391
  if (decorator = decorators[i])
6296
6392
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6297
- if (kind && result) __defProp$H(target, key, result);
6393
+ if (kind && result) __defProp$J(target, key, result);
6298
6394
  return result;
6299
6395
  };
6300
6396
  let CanvasItem = class extends TimelineNode {
@@ -6388,10 +6484,11 @@ let CanvasItem = class extends TimelineNode {
6388
6484
  }
6389
6485
  _repaint(batchables) {
6390
6486
  this.log(this.name, "painting");
6487
+ const globalOpacity = this.globalOpacity;
6391
6488
  return batchables.map((batchable) => {
6392
6489
  return {
6393
6490
  ...batchable,
6394
- modulate: this._modulate.toInt8Array(),
6491
+ modulate: this._modulate.toInt8Array().map((v) => v * globalOpacity),
6395
6492
  blendMode: this.blendMode
6396
6493
  };
6397
6494
  });
@@ -6446,30 +6543,30 @@ let CanvasItem = class extends TimelineNode {
6446
6543
  super._render(renderer);
6447
6544
  }
6448
6545
  };
6449
- __decorateClass$Q([
6546
+ __decorateClass$R([
6450
6547
  property()
6451
6548
  ], CanvasItem.prototype, "modulate", 2);
6452
- __decorateClass$Q([
6549
+ __decorateClass$R([
6453
6550
  property()
6454
6551
  ], CanvasItem.prototype, "blendMode", 2);
6455
- __decorateClass$Q([
6552
+ __decorateClass$R([
6456
6553
  property({ internal: true, fallback: true })
6457
6554
  ], CanvasItem.prototype, "visible", 2);
6458
- __decorateClass$Q([
6555
+ __decorateClass$R([
6459
6556
  property({ internal: true, fallback: 1 })
6460
6557
  ], CanvasItem.prototype, "opacity", 2);
6461
- CanvasItem = __decorateClass$Q([
6558
+ CanvasItem = __decorateClass$R([
6462
6559
  customNode("CanvasItem")
6463
6560
  ], CanvasItem);
6464
6561
 
6465
- var __defProp$G = Object.defineProperty;
6562
+ var __defProp$I = Object.defineProperty;
6466
6563
  var __getOwnPropDesc$G = Object.getOwnPropertyDescriptor;
6467
- var __decorateClass$P = (decorators, target, key, kind) => {
6564
+ var __decorateClass$Q = (decorators, target, key, kind) => {
6468
6565
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$G(target, key) : target;
6469
6566
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6470
6567
  if (decorator = decorators[i])
6471
6568
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6472
- if (kind && result) __defProp$G(target, key, result);
6569
+ if (kind && result) __defProp$I(target, key, result);
6473
6570
  return result;
6474
6571
  };
6475
6572
  let Viewport = class extends Node {
@@ -6511,6 +6608,7 @@ let Viewport = class extends Node {
6511
6608
  return {
6512
6609
  width,
6513
6610
  height,
6611
+ msaa: this.msaa,
6514
6612
  colorTextures: [this.texture._glTexture(renderer)]
6515
6613
  };
6516
6614
  }
@@ -6537,6 +6635,9 @@ let Viewport = class extends Node {
6537
6635
  this.projection.resize(this.width, this.height);
6538
6636
  this.emit("updateRect");
6539
6637
  break;
6638
+ case "msaa":
6639
+ this.requestUpload();
6640
+ break;
6540
6641
  }
6541
6642
  }
6542
6643
  requestUpload() {
@@ -6616,30 +6717,33 @@ let Viewport = class extends Node {
6616
6717
  return this.canvasTransform.apply(globalPos, newPos);
6617
6718
  }
6618
6719
  };
6619
- __decorateClass$P([
6720
+ __decorateClass$Q([
6620
6721
  property({ fallback: 0 })
6621
6722
  ], Viewport.prototype, "x", 2);
6622
- __decorateClass$P([
6723
+ __decorateClass$Q([
6623
6724
  property({ fallback: 0 })
6624
6725
  ], Viewport.prototype, "y", 2);
6625
- __decorateClass$P([
6726
+ __decorateClass$Q([
6626
6727
  property({ fallback: 0 })
6627
6728
  ], Viewport.prototype, "width", 2);
6628
- __decorateClass$P([
6729
+ __decorateClass$Q([
6629
6730
  property({ fallback: 0 })
6630
6731
  ], Viewport.prototype, "height", 2);
6631
- Viewport = __decorateClass$P([
6732
+ __decorateClass$Q([
6733
+ property({ internal: true, fallback: false })
6734
+ ], Viewport.prototype, "msaa", 2);
6735
+ Viewport = __decorateClass$Q([
6632
6736
  customNode("Viewport")
6633
6737
  ], Viewport);
6634
6738
 
6635
- var __defProp$F = Object.defineProperty;
6739
+ var __defProp$H = Object.defineProperty;
6636
6740
  var __getOwnPropDesc$F = Object.getOwnPropertyDescriptor;
6637
- var __decorateClass$O = (decorators, target, key, kind) => {
6741
+ var __decorateClass$P = (decorators, target, key, kind) => {
6638
6742
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$F(target, key) : target;
6639
6743
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6640
6744
  if (decorator = decorators[i])
6641
6745
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6642
- if (kind && result) __defProp$F(target, key, result);
6746
+ if (kind && result) __defProp$H(target, key, result);
6643
6747
  return result;
6644
6748
  };
6645
6749
  let Effect = class extends TimelineNode {
@@ -6881,19 +6985,19 @@ let Effect = class extends TimelineNode {
6881
6985
  }
6882
6986
  }
6883
6987
  };
6884
- __decorateClass$O([
6988
+ __decorateClass$P([
6885
6989
  property({ internal: true })
6886
6990
  ], Effect.prototype, "material", 2);
6887
- __decorateClass$O([
6991
+ __decorateClass$P([
6888
6992
  property()
6889
6993
  ], Effect.prototype, "effectMode", 2);
6890
- __decorateClass$O([
6994
+ __decorateClass$P([
6891
6995
  property({ fallback: "" })
6892
6996
  ], Effect.prototype, "glsl", 2);
6893
- __decorateClass$O([
6997
+ __decorateClass$P([
6894
6998
  property({ fallback: "" })
6895
6999
  ], Effect.prototype, "glslSrc", 2);
6896
- Effect = __decorateClass$O([
7000
+ Effect = __decorateClass$P([
6897
7001
  customNode("Effect")
6898
7002
  ], Effect);
6899
7003
 
@@ -6923,14 +7027,14 @@ class RenderStack {
6923
7027
  }
6924
7028
  }
6925
7029
 
6926
- var __defProp$E = Object.defineProperty;
7030
+ var __defProp$G = Object.defineProperty;
6927
7031
  var __getOwnPropDesc$E = Object.getOwnPropertyDescriptor;
6928
- var __decorateClass$N = (decorators, target, key, kind) => {
7032
+ var __decorateClass$O = (decorators, target, key, kind) => {
6929
7033
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$E(target, key) : target;
6930
7034
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6931
7035
  if (decorator = decorators[i])
6932
7036
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6933
- if (kind && result) __defProp$E(target, key, result);
7037
+ if (kind && result) __defProp$G(target, key, result);
6934
7038
  return result;
6935
7039
  };
6936
7040
  let Timeline = class extends Node {
@@ -6975,52 +7079,54 @@ let Timeline = class extends Node {
6975
7079
  this.addTime(delta);
6976
7080
  }
6977
7081
  };
6978
- __decorateClass$N([
7082
+ __decorateClass$O([
6979
7083
  property({ fallback: 0 })
6980
7084
  ], Timeline.prototype, "startTime", 2);
6981
- __decorateClass$N([
7085
+ __decorateClass$O([
6982
7086
  property({ fallback: 0 })
6983
7087
  ], Timeline.prototype, "currentTime", 2);
6984
- __decorateClass$N([
7088
+ __decorateClass$O([
6985
7089
  property({ fallback: Number.MAX_SAFE_INTEGER })
6986
7090
  ], Timeline.prototype, "endTime", 2);
6987
- __decorateClass$N([
7091
+ __decorateClass$O([
6988
7092
  property({ fallback: false })
6989
7093
  ], Timeline.prototype, "loop", 2);
6990
- Timeline = __decorateClass$N([
7094
+ Timeline = __decorateClass$O([
6991
7095
  customNode("Timeline")
6992
7096
  ], Timeline);
6993
7097
 
7098
+ var __defProp$F = Object.defineProperty;
6994
7099
  var __getOwnPropDesc$D = Object.getOwnPropertyDescriptor;
6995
- var __decorateClass$M = (decorators, target, key, kind) => {
7100
+ var __decorateClass$N = (decorators, target, key, kind) => {
6996
7101
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$D(target, key) : target;
6997
7102
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
6998
7103
  if (decorator = decorators[i])
6999
- result = (decorator(result)) || result;
7104
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7105
+ if (kind && result) __defProp$F(target, key, result);
7000
7106
  return result;
7001
7107
  };
7002
7108
  let Window = class extends Viewport {
7003
- //
7004
7109
  };
7005
- Window = __decorateClass$M([
7110
+ __decorateClass$N([
7111
+ property({ fallback: false })
7112
+ ], Window.prototype, "msaa", 2);
7113
+ Window = __decorateClass$N([
7006
7114
  customNode("Window")
7007
7115
  ], Window);
7008
7116
 
7009
- var __defProp$D = Object.defineProperty;
7010
- var __decorateClass$L = (decorators, target, key, kind) => {
7117
+ var __defProp$E = Object.defineProperty;
7118
+ var __decorateClass$M = (decorators, target, key, kind) => {
7011
7119
  var result = void 0 ;
7012
7120
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7013
7121
  if (decorator = decorators[i])
7014
7122
  result = (decorator(target, key, result) ) || result;
7015
- if (result) __defProp$D(target, key, result);
7123
+ if (result) __defProp$E(target, key, result);
7016
7124
  return result;
7017
7125
  };
7018
7126
  class SceneTree extends MainLoop {
7019
- fonts;
7020
7127
  input = new Input();
7021
7128
  renderStack = new RenderStack();
7022
7129
  root = new Window(true).setTree(this);
7023
- timeline;
7024
7130
  _backgroundColor = new Color();
7025
7131
  _currentViewport;
7026
7132
  getCurrentViewport() {
@@ -7029,9 +7135,9 @@ class SceneTree extends MainLoop {
7029
7135
  setCurrentViewport(viewport) {
7030
7136
  this._currentViewport = viewport;
7031
7137
  }
7032
- constructor(timeline = new Timeline()) {
7138
+ constructor(properties) {
7033
7139
  super();
7034
- this.timeline = timeline.setTree(this);
7140
+ this.setProperties(properties);
7035
7141
  }
7036
7142
  _updateProperty(key, value, oldValue) {
7037
7143
  super._updateProperty(key, value, oldValue);
@@ -7039,6 +7145,9 @@ class SceneTree extends MainLoop {
7039
7145
  case "backgroundColor":
7040
7146
  this._backgroundColor.value = value;
7041
7147
  break;
7148
+ case "timeline":
7149
+ this.timeline.setTree(this);
7150
+ break;
7042
7151
  }
7043
7152
  }
7044
7153
  log(...args) {
@@ -7059,8 +7168,14 @@ class SceneTree extends MainLoop {
7059
7168
  this.emit("rendered");
7060
7169
  }
7061
7170
  _renderScreen(renderer) {
7171
+ if (this.root.msaa) {
7172
+ renderer.framebuffer.finishRenderPass(
7173
+ this.root._glFramebuffer(renderer)
7174
+ );
7175
+ }
7062
7176
  renderer.state.reset();
7063
7177
  renderer.framebuffer.bind(null);
7178
+ renderer.gl.bindFramebuffer(renderer.gl.FRAMEBUFFER, null);
7064
7179
  renderer.viewport.bind({
7065
7180
  x: 0,
7066
7181
  y: 0,
@@ -7080,23 +7195,29 @@ class SceneTree extends MainLoop {
7080
7195
  renderer.texture.unbind(texture);
7081
7196
  }
7082
7197
  destroy() {
7083
- super.destroy();
7084
7198
  this.root.destroy();
7085
- this.input.removeEventListeners();
7199
+ this.input.destroy();
7200
+ super.destroy();
7086
7201
  }
7087
7202
  }
7088
- __decorateClass$L([
7089
- property({ internal: true, fallback: false })
7090
- ], SceneTree.prototype, "processPaused");
7091
- __decorateClass$L([
7203
+ __decorateClass$M([
7092
7204
  property()
7093
7205
  ], SceneTree.prototype, "backgroundColor");
7094
- __decorateClass$L([
7206
+ __decorateClass$M([
7095
7207
  property({ internal: true, fallback: false })
7096
7208
  ], SceneTree.prototype, "debug");
7209
+ __decorateClass$M([
7210
+ property({ internal: true, fallback: false })
7211
+ ], SceneTree.prototype, "processPaused");
7212
+ __decorateClass$M([
7213
+ property({ internal: true, default: () => fonts })
7214
+ ], SceneTree.prototype, "fonts");
7215
+ __decorateClass$M([
7216
+ property({ internal: true, default: () => new Timeline() })
7217
+ ], SceneTree.prototype, "timeline");
7097
7218
 
7098
7219
  var __getOwnPropDesc$C = Object.getOwnPropertyDescriptor;
7099
- var __decorateClass$K = (decorators, target, key, kind) => {
7220
+ var __decorateClass$L = (decorators, target, key, kind) => {
7100
7221
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$C(target, key) : target;
7101
7222
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7102
7223
  if (decorator = decorators[i])
@@ -7109,7 +7230,7 @@ let Transition = class extends Effect {
7109
7230
  this.setProperties(properties).append(children);
7110
7231
  }
7111
7232
  };
7112
- Transition = __decorateClass$K([
7233
+ Transition = __decorateClass$L([
7113
7234
  customNode("Transition", {
7114
7235
  effectMode: "transition",
7115
7236
  processMode: "pausable",
@@ -7117,14 +7238,14 @@ Transition = __decorateClass$K([
7117
7238
  })
7118
7239
  ], Transition);
7119
7240
 
7120
- var __defProp$C = Object.defineProperty;
7241
+ var __defProp$D = Object.defineProperty;
7121
7242
  var __getOwnPropDesc$B = Object.getOwnPropertyDescriptor;
7122
- var __decorateClass$J = (decorators, target, key, kind) => {
7243
+ var __decorateClass$K = (decorators, target, key, kind) => {
7123
7244
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$B(target, key) : target;
7124
7245
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7125
7246
  if (decorator = decorators[i])
7126
7247
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7127
- if (kind && result) __defProp$C(target, key, result);
7248
+ if (kind && result) __defProp$D(target, key, result);
7128
7249
  return result;
7129
7250
  };
7130
7251
  let Node2D = class extends CanvasItem {
@@ -7228,24 +7349,24 @@ let Node2D = class extends CanvasItem {
7228
7349
  return this.globalTransform.apply(localPos, newPos);
7229
7350
  }
7230
7351
  };
7231
- __decorateClass$J([
7352
+ __decorateClass$K([
7232
7353
  property({ internal: true, fallback: 0 })
7233
7354
  ], Node2D.prototype, "rotation", 2);
7234
- __decorateClass$J([
7355
+ __decorateClass$K([
7235
7356
  property({ internal: true, fallback: 0 })
7236
7357
  ], Node2D.prototype, "globalRotation", 2);
7237
- Node2D = __decorateClass$J([
7358
+ Node2D = __decorateClass$K([
7238
7359
  customNode("Node2D")
7239
7360
  ], Node2D);
7240
7361
 
7241
- var __defProp$B = Object.defineProperty;
7362
+ var __defProp$C = Object.defineProperty;
7242
7363
  var __getOwnPropDesc$A = Object.getOwnPropertyDescriptor;
7243
- var __decorateClass$I = (decorators, target, key, kind) => {
7364
+ var __decorateClass$J = (decorators, target, key, kind) => {
7244
7365
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$A(target, key) : target;
7245
7366
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7246
7367
  if (decorator = decorators[i])
7247
7368
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7248
- if (kind && result) __defProp$B(target, key, result);
7369
+ if (kind && result) __defProp$C(target, key, result);
7249
7370
  return result;
7250
7371
  };
7251
7372
  let Camera2D = class extends Node2D {
@@ -7358,13 +7479,13 @@ let Camera2D = class extends Node2D {
7358
7479
  return viewport.toCanvasScreen(globalPos, newPos);
7359
7480
  }
7360
7481
  };
7361
- __decorateClass$I([
7482
+ __decorateClass$J([
7362
7483
  property({ internal: true, fallback: false })
7363
7484
  ], Camera2D.prototype, "spaceKey", 2);
7364
- __decorateClass$I([
7485
+ __decorateClass$J([
7365
7486
  property({ internal: true, fallback: false })
7366
7487
  ], Camera2D.prototype, "grabbing", 2);
7367
- Camera2D = __decorateClass$I([
7488
+ Camera2D = __decorateClass$J([
7368
7489
  customNode("Camera2D", {
7369
7490
  processMode: "disabled",
7370
7491
  renderMode: "disabled"
@@ -7517,15 +7638,15 @@ function parseCSSTransformOrigin(transformOrigin) {
7517
7638
  });
7518
7639
  }
7519
7640
 
7520
- var __defProp$A = Object.defineProperty;
7641
+ var __defProp$B = Object.defineProperty;
7521
7642
  var __getOwnPropDesc$z = Object.getOwnPropertyDescriptor;
7522
- var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7523
- var __decorateClass$H = (decorators, target, key, kind) => {
7643
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7644
+ var __decorateClass$I = (decorators, target, key, kind) => {
7524
7645
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$z(target, key) : target;
7525
7646
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7526
7647
  if (decorator = decorators[i])
7527
7648
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7528
- if (kind && result) __defProp$A(target, key, result);
7649
+ if (kind && result) __defProp$B(target, key, result);
7529
7650
  return result;
7530
7651
  };
7531
7652
  var __publicField$i = (obj, key, value) => __defNormalProp$i(obj, key + "" , value);
@@ -7585,43 +7706,43 @@ void main(void) {
7585
7706
  gl_FragColor = c * alpha;
7586
7707
  }`
7587
7708
  }));
7588
- __decorateClass$H([
7709
+ __decorateClass$I([
7589
7710
  property({ fallback: 1 })
7590
7711
  ], ColorAdjustEffect.prototype, "saturation", 2);
7591
- __decorateClass$H([
7712
+ __decorateClass$I([
7592
7713
  property({ fallback: 1 })
7593
7714
  ], ColorAdjustEffect.prototype, "contrast", 2);
7594
- __decorateClass$H([
7715
+ __decorateClass$I([
7595
7716
  property({ fallback: 1 })
7596
7717
  ], ColorAdjustEffect.prototype, "brightness", 2);
7597
- __decorateClass$H([
7718
+ __decorateClass$I([
7598
7719
  property({ fallback: 1 })
7599
7720
  ], ColorAdjustEffect.prototype, "red", 2);
7600
- __decorateClass$H([
7721
+ __decorateClass$I([
7601
7722
  property({ fallback: 1 })
7602
7723
  ], ColorAdjustEffect.prototype, "green", 2);
7603
- __decorateClass$H([
7724
+ __decorateClass$I([
7604
7725
  property({ fallback: 1 })
7605
7726
  ], ColorAdjustEffect.prototype, "blue", 2);
7606
- __decorateClass$H([
7727
+ __decorateClass$I([
7607
7728
  property({ fallback: 1 })
7608
7729
  ], ColorAdjustEffect.prototype, "alpha", 2);
7609
- __decorateClass$H([
7730
+ __decorateClass$I([
7610
7731
  property({ fallback: 1 })
7611
7732
  ], ColorAdjustEffect.prototype, "gamma", 2);
7612
- ColorAdjustEffect = __decorateClass$H([
7733
+ ColorAdjustEffect = __decorateClass$I([
7613
7734
  customNode("ColorAdjustEffect")
7614
7735
  ], ColorAdjustEffect);
7615
7736
 
7616
- var __defProp$z = Object.defineProperty;
7737
+ var __defProp$A = Object.defineProperty;
7617
7738
  var __getOwnPropDesc$y = Object.getOwnPropertyDescriptor;
7618
- var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7619
- var __decorateClass$G = (decorators, target, key, kind) => {
7739
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7740
+ var __decorateClass$H = (decorators, target, key, kind) => {
7620
7741
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$y(target, key) : target;
7621
7742
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7622
7743
  if (decorator = decorators[i])
7623
7744
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7624
- if (kind && result) __defProp$z(target, key, result);
7745
+ if (kind && result) __defProp$A(target, key, result);
7625
7746
  return result;
7626
7747
  };
7627
7748
  var __publicField$h = (obj, key, value) => __defNormalProp$h(obj, key + "" , value);
@@ -7701,22 +7822,22 @@ void main(void) {
7701
7822
  );
7702
7823
  }`
7703
7824
  }));
7704
- __decorateClass$G([
7825
+ __decorateClass$H([
7705
7826
  property()
7706
7827
  ], ColorFilterEffect.prototype, "filter", 2);
7707
- ColorFilterEffect = __decorateClass$G([
7828
+ ColorFilterEffect = __decorateClass$H([
7708
7829
  customNode("ColorFilterEffect")
7709
7830
  ], ColorFilterEffect);
7710
7831
 
7711
- var __defProp$y = Object.defineProperty;
7832
+ var __defProp$z = Object.defineProperty;
7712
7833
  var __getOwnPropDesc$x = Object.getOwnPropertyDescriptor;
7713
- var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7714
- var __decorateClass$F = (decorators, target, key, kind) => {
7834
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7835
+ var __decorateClass$G = (decorators, target, key, kind) => {
7715
7836
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$x(target, key) : target;
7716
7837
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7717
7838
  if (decorator = decorators[i])
7718
7839
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7719
- if (kind && result) __defProp$y(target, key, result);
7840
+ if (kind && result) __defProp$z(target, key, result);
7720
7841
  return result;
7721
7842
  };
7722
7843
  var __publicField$g = (obj, key, value) => __defNormalProp$g(obj, key + "" , value);
@@ -7792,25 +7913,25 @@ void main(void) {
7792
7913
  gl_FragColor = vec4(mix(color.rgb, mask.rgb, color.a * mask.a), color.a);
7793
7914
  }`
7794
7915
  }));
7795
- __decorateClass$F([
7916
+ __decorateClass$G([
7796
7917
  property({ default: () => [] })
7797
7918
  ], ColorOverlayEffect.prototype, "colors", 2);
7798
- __decorateClass$F([
7919
+ __decorateClass$G([
7799
7920
  property({ fallback: 0.5 })
7800
7921
  ], ColorOverlayEffect.prototype, "alpha", 2);
7801
- ColorOverlayEffect = __decorateClass$F([
7922
+ ColorOverlayEffect = __decorateClass$G([
7802
7923
  customNode("ColorOverlayEffect")
7803
7924
  ], ColorOverlayEffect);
7804
7925
 
7805
- var __defProp$x = Object.defineProperty;
7926
+ var __defProp$y = Object.defineProperty;
7806
7927
  var __getOwnPropDesc$w = Object.getOwnPropertyDescriptor;
7807
- var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7808
- var __decorateClass$E = (decorators, target, key, kind) => {
7928
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7929
+ var __decorateClass$F = (decorators, target, key, kind) => {
7809
7930
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$w(target, key) : target;
7810
7931
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7811
7932
  if (decorator = decorators[i])
7812
7933
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7813
- if (kind && result) __defProp$x(target, key, result);
7934
+ if (kind && result) __defProp$y(target, key, result);
7814
7935
  return result;
7815
7936
  };
7816
7937
  var __publicField$f = (obj, key, value) => __defNormalProp$f(obj, key + "" , value);
@@ -7877,25 +7998,25 @@ void main(void) {
7877
7998
  gl_FragColor = color;
7878
7999
  }`
7879
8000
  }));
7880
- __decorateClass$E([
8001
+ __decorateClass$F([
7881
8002
  property({ default: () => [] })
7882
8003
  ], ColorRemoveEffect.prototype, "colors", 2);
7883
- __decorateClass$E([
8004
+ __decorateClass$F([
7884
8005
  property({ fallback: 0.5 })
7885
8006
  ], ColorRemoveEffect.prototype, "epsilon", 2);
7886
- ColorRemoveEffect = __decorateClass$E([
8007
+ ColorRemoveEffect = __decorateClass$F([
7887
8008
  customNode("ColorRemoveEffect")
7888
8009
  ], ColorRemoveEffect);
7889
8010
 
7890
- var __defProp$w = Object.defineProperty;
8011
+ var __defProp$x = Object.defineProperty;
7891
8012
  var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
7892
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7893
- var __decorateClass$D = (decorators, target, key, kind) => {
8013
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8014
+ var __decorateClass$E = (decorators, target, key, kind) => {
7894
8015
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$v(target, key) : target;
7895
8016
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
7896
8017
  if (decorator = decorators[i])
7897
8018
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
7898
- if (kind && result) __defProp$w(target, key, result);
8019
+ if (kind && result) __defProp$x(target, key, result);
7899
8020
  return result;
7900
8021
  };
7901
8022
  var __publicField$e = (obj, key, value) => __defNormalProp$e(obj, key + "" , value);
@@ -7984,25 +8105,25 @@ void main(void) {
7984
8105
  }
7985
8106
  }`
7986
8107
  }));
7987
- __decorateClass$D([
8108
+ __decorateClass$E([
7988
8109
  property({ default: () => [] })
7989
8110
  ], ColorReplaceEffect.prototype, "colors", 2);
7990
- __decorateClass$D([
8111
+ __decorateClass$E([
7991
8112
  property({ fallback: 0.05 })
7992
8113
  ], ColorReplaceEffect.prototype, "epsilon", 2);
7993
- ColorReplaceEffect = __decorateClass$D([
8114
+ ColorReplaceEffect = __decorateClass$E([
7994
8115
  customNode("ColorReplaceEffect")
7995
8116
  ], ColorReplaceEffect);
7996
8117
 
7997
- var __defProp$v = Object.defineProperty;
8118
+ var __defProp$w = Object.defineProperty;
7998
8119
  var __getOwnPropDesc$u = Object.getOwnPropertyDescriptor;
7999
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8000
- var __decorateClass$C = (decorators, target, key, kind) => {
8120
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8121
+ var __decorateClass$D = (decorators, target, key, kind) => {
8001
8122
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$u(target, key) : target;
8002
8123
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8003
8124
  if (decorator = decorators[i])
8004
8125
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8005
- if (kind && result) __defProp$v(target, key, result);
8126
+ if (kind && result) __defProp$w(target, key, result);
8006
8127
  return result;
8007
8128
  };
8008
8129
  var __publicField$d = (obj, key, value) => __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -8108,25 +8229,25 @@ void main(void) {
8108
8229
  }`,
8109
8230
  frag: frag$2
8110
8231
  }));
8111
- __decorateClass$C([
8232
+ __decorateClass$D([
8112
8233
  property({ fallback: 4 })
8113
8234
  ], GaussianBlurEffect.prototype, "strength", 2);
8114
- __decorateClass$C([
8235
+ __decorateClass$D([
8115
8236
  property({ fallback: 3 })
8116
8237
  ], GaussianBlurEffect.prototype, "quality", 2);
8117
- GaussianBlurEffect = __decorateClass$C([
8238
+ GaussianBlurEffect = __decorateClass$D([
8118
8239
  customNode("GaussianBlurEffect")
8119
8240
  ], GaussianBlurEffect);
8120
8241
 
8121
- var __defProp$u = Object.defineProperty;
8242
+ var __defProp$v = Object.defineProperty;
8122
8243
  var __getOwnPropDesc$t = Object.getOwnPropertyDescriptor;
8123
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8124
- var __decorateClass$B = (decorators, target, key, kind) => {
8244
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8245
+ var __decorateClass$C = (decorators, target, key, kind) => {
8125
8246
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$t(target, key) : target;
8126
8247
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8127
8248
  if (decorator = decorators[i])
8128
8249
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8129
- if (kind && result) __defProp$u(target, key, result);
8250
+ if (kind && result) __defProp$v(target, key, result);
8130
8251
  return result;
8131
8252
  };
8132
8253
  var __publicField$c = (obj, key, value) => __defNormalProp$c(obj, key + "" , value);
@@ -8190,34 +8311,34 @@ void main(void) {
8190
8311
  gl_FragColor = sample;
8191
8312
  }`
8192
8313
  }));
8193
- __decorateClass$B([
8314
+ __decorateClass$C([
8194
8315
  property({ fallback: "#000000FF" })
8195
8316
  ], DropShadowEffect.prototype, "color", 2);
8196
- __decorateClass$B([
8317
+ __decorateClass$C([
8197
8318
  property({ fallback: 4 })
8198
8319
  ], DropShadowEffect.prototype, "blur", 2);
8199
- __decorateClass$B([
8320
+ __decorateClass$C([
8200
8321
  property({ fallback: 4 })
8201
8322
  ], DropShadowEffect.prototype, "offsetX", 2);
8202
- __decorateClass$B([
8323
+ __decorateClass$C([
8203
8324
  property({ fallback: 4 })
8204
8325
  ], DropShadowEffect.prototype, "offsetY", 2);
8205
- __decorateClass$B([
8326
+ __decorateClass$C([
8206
8327
  property({ fallback: false })
8207
8328
  ], DropShadowEffect.prototype, "shadowOnly", 2);
8208
- DropShadowEffect = __decorateClass$B([
8329
+ DropShadowEffect = __decorateClass$C([
8209
8330
  customNode("DropShadowEffect")
8210
8331
  ], DropShadowEffect);
8211
8332
 
8212
- var __defProp$t = Object.defineProperty;
8333
+ var __defProp$u = Object.defineProperty;
8213
8334
  var __getOwnPropDesc$s = Object.getOwnPropertyDescriptor;
8214
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8215
- var __decorateClass$A = (decorators, target, key, kind) => {
8335
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8336
+ var __decorateClass$B = (decorators, target, key, kind) => {
8216
8337
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$s(target, key) : target;
8217
8338
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8218
8339
  if (decorator = decorators[i])
8219
8340
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8220
- if (kind && result) __defProp$t(target, key, result);
8341
+ if (kind && result) __defProp$u(target, key, result);
8221
8342
  return result;
8222
8343
  };
8223
8344
  var __publicField$b = (obj, key, value) => __defNormalProp$b(obj, key + "" , value);
@@ -8262,22 +8383,22 @@ void main(void) {
8262
8383
  gl_FragColor = vec4(color.rgb * alpha, alpha);
8263
8384
  }`
8264
8385
  }));
8265
- __decorateClass$A([
8386
+ __decorateClass$B([
8266
8387
  property({ fallback: 5 })
8267
8388
  ], EmbossEffect.prototype, "strength", 2);
8268
- EmbossEffect = __decorateClass$A([
8389
+ EmbossEffect = __decorateClass$B([
8269
8390
  customNode("EmbossEffect")
8270
8391
  ], EmbossEffect);
8271
8392
 
8272
- var __defProp$s = Object.defineProperty;
8393
+ var __defProp$t = Object.defineProperty;
8273
8394
  var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
8274
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8275
- var __decorateClass$z = (decorators, target, key, kind) => {
8395
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8396
+ var __decorateClass$A = (decorators, target, key, kind) => {
8276
8397
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$r(target, key) : target;
8277
8398
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8278
8399
  if (decorator = decorators[i])
8279
8400
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8280
- if (kind && result) __defProp$s(target, key, result);
8401
+ if (kind && result) __defProp$t(target, key, result);
8281
8402
  return result;
8282
8403
  };
8283
8404
  var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, key + "" , value);
@@ -8451,46 +8572,46 @@ void main(void) {
8451
8572
  gl_FragColor.a = texture2D(sampler, coord).a;
8452
8573
  }`
8453
8574
  }));
8454
- __decorateClass$z([
8575
+ __decorateClass$A([
8455
8576
  property({ fallback: 10 })
8456
8577
  ], GlitchEffect.prototype, "slices", 2);
8457
- __decorateClass$z([
8578
+ __decorateClass$A([
8458
8579
  property({ fallback: 512 })
8459
8580
  ], GlitchEffect.prototype, "sampleSize", 2);
8460
- __decorateClass$z([
8581
+ __decorateClass$A([
8461
8582
  property({ fallback: 100 })
8462
8583
  ], GlitchEffect.prototype, "offset", 2);
8463
- __decorateClass$z([
8584
+ __decorateClass$A([
8464
8585
  property({ fallback: 0 })
8465
8586
  ], GlitchEffect.prototype, "direction", 2);
8466
- __decorateClass$z([
8587
+ __decorateClass$A([
8467
8588
  property({ fallback: 2 })
8468
8589
  ], GlitchEffect.prototype, "fillMode", 2);
8469
- __decorateClass$z([
8590
+ __decorateClass$A([
8470
8591
  property({ fallback: 0 })
8471
8592
  ], GlitchEffect.prototype, "seed", 2);
8472
- __decorateClass$z([
8593
+ __decorateClass$A([
8473
8594
  property({ default: () => [2, 2] })
8474
8595
  ], GlitchEffect.prototype, "red", 2);
8475
- __decorateClass$z([
8596
+ __decorateClass$A([
8476
8597
  property({ default: () => [-10, 4] })
8477
8598
  ], GlitchEffect.prototype, "green", 2);
8478
- __decorateClass$z([
8599
+ __decorateClass$A([
8479
8600
  property({ default: () => [10, -4] })
8480
8601
  ], GlitchEffect.prototype, "blue", 2);
8481
- GlitchEffect = __decorateClass$z([
8602
+ GlitchEffect = __decorateClass$A([
8482
8603
  customNode("GlitchEffect")
8483
8604
  ], GlitchEffect);
8484
8605
 
8485
- var __defProp$r = Object.defineProperty;
8606
+ var __defProp$s = Object.defineProperty;
8486
8607
  var __getOwnPropDesc$q = Object.getOwnPropertyDescriptor;
8487
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8488
- var __decorateClass$y = (decorators, target, key, kind) => {
8608
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8609
+ var __decorateClass$z = (decorators, target, key, kind) => {
8489
8610
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$q(target, key) : target;
8490
8611
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8491
8612
  if (decorator = decorators[i])
8492
8613
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8493
- if (kind && result) __defProp$r(target, key, result);
8614
+ if (kind && result) __defProp$s(target, key, result);
8494
8615
  return result;
8495
8616
  };
8496
8617
  var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, key + "" , value);
@@ -8668,39 +8789,39 @@ void main(void) {
8668
8789
  gl_FragColor = vec4(color.rgb + mist.rgb, color.a);
8669
8790
  }`
8670
8791
  }));
8671
- __decorateClass$y([
8792
+ __decorateClass$z([
8672
8793
  property({ fallback: 0 })
8673
8794
  ], GodrayEffect.prototype, "time", 2);
8674
- __decorateClass$y([
8795
+ __decorateClass$z([
8675
8796
  property({ fallback: 30 })
8676
8797
  ], GodrayEffect.prototype, "angle", 2);
8677
- __decorateClass$y([
8798
+ __decorateClass$z([
8678
8799
  property({ fallback: 0.5 })
8679
8800
  ], GodrayEffect.prototype, "gain", 2);
8680
- __decorateClass$y([
8801
+ __decorateClass$z([
8681
8802
  property({ fallback: 2.5 })
8682
8803
  ], GodrayEffect.prototype, "lacunarity", 2);
8683
- __decorateClass$y([
8804
+ __decorateClass$z([
8684
8805
  property({ fallback: true })
8685
8806
  ], GodrayEffect.prototype, "parallel", 2);
8686
- __decorateClass$y([
8807
+ __decorateClass$z([
8687
8808
  property({ default: () => [0, 0] })
8688
8809
  ], GodrayEffect.prototype, "center", 2);
8689
- __decorateClass$y([
8810
+ __decorateClass$z([
8690
8811
  property({ fallback: 1 })
8691
8812
  ], GodrayEffect.prototype, "alpha", 2);
8692
- GodrayEffect = __decorateClass$y([
8813
+ GodrayEffect = __decorateClass$z([
8693
8814
  customNode("GodrayEffect")
8694
8815
  ], GodrayEffect);
8695
8816
 
8696
- var __defProp$q = Object.defineProperty;
8817
+ var __defProp$r = Object.defineProperty;
8697
8818
  var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
8698
- var __decorateClass$x = (decorators, target, key, kind) => {
8819
+ var __decorateClass$y = (decorators, target, key, kind) => {
8699
8820
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$p(target, key) : target;
8700
8821
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8701
8822
  if (decorator = decorators[i])
8702
8823
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8703
- if (kind && result) __defProp$q(target, key, result);
8824
+ if (kind && result) __defProp$r(target, key, result);
8704
8825
  return result;
8705
8826
  };
8706
8827
  const frag$1 = `varying vec2 vUv;
@@ -8790,28 +8911,28 @@ void main() {
8790
8911
  });
8791
8912
  }
8792
8913
  };
8793
- __decorateClass$x([
8914
+ __decorateClass$y([
8794
8915
  property({ fallback: 4 })
8795
8916
  ], KawaseBlurEffect.prototype, "strength", 2);
8796
- __decorateClass$x([
8917
+ __decorateClass$y([
8797
8918
  property({ fallback: 3 })
8798
8919
  ], KawaseBlurEffect.prototype, "quality", 2);
8799
- __decorateClass$x([
8920
+ __decorateClass$y([
8800
8921
  property({ default: () => [1, 1] })
8801
8922
  ], KawaseBlurEffect.prototype, "pixelSize", 2);
8802
- KawaseBlurEffect = __decorateClass$x([
8923
+ KawaseBlurEffect = __decorateClass$y([
8803
8924
  customNode("KawaseBlurEffect")
8804
8925
  ], KawaseBlurEffect);
8805
8926
 
8806
- var __defProp$p = Object.defineProperty;
8927
+ var __defProp$q = Object.defineProperty;
8807
8928
  var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
8808
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8809
- var __decorateClass$w = (decorators, target, key, kind) => {
8929
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8930
+ var __decorateClass$x = (decorators, target, key, kind) => {
8810
8931
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$o(target, key) : target;
8811
8932
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8812
8933
  if (decorator = decorators[i])
8813
8934
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8814
- if (kind && result) __defProp$p(target, key, result);
8935
+ if (kind && result) __defProp$q(target, key, result);
8815
8936
  return result;
8816
8937
  };
8817
8938
  var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, key + "" , value);
@@ -8899,25 +9020,25 @@ void main(void) {
8899
9020
  }
8900
9021
  }`
8901
9022
  }));
8902
- __decorateClass$w([
9023
+ __decorateClass$x([
8903
9024
  property({ internal: true })
8904
9025
  ], MaskEffect.prototype, "texture", 2);
8905
- __decorateClass$w([
9026
+ __decorateClass$x([
8906
9027
  property({ fallback: "" })
8907
9028
  ], MaskEffect.prototype, "src", 2);
8908
- MaskEffect = __decorateClass$w([
9029
+ MaskEffect = __decorateClass$x([
8909
9030
  customNode("MaskEffect")
8910
9031
  ], MaskEffect);
8911
9032
 
8912
- var __defProp$o = Object.defineProperty;
9033
+ var __defProp$p = Object.defineProperty;
8913
9034
  var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
8914
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8915
- var __decorateClass$v = (decorators, target, key, kind) => {
9035
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9036
+ var __decorateClass$w = (decorators, target, key, kind) => {
8916
9037
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$n(target, key) : target;
8917
9038
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
8918
9039
  if (decorator = decorators[i])
8919
9040
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8920
- if (kind && result) __defProp$o(target, key, result);
9041
+ if (kind && result) __defProp$p(target, key, result);
8921
9042
  return result;
8922
9043
  };
8923
9044
  var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -9004,40 +9125,40 @@ void main() {
9004
9125
  };
9005
9126
  __publicField$7(OutlineEffect, "MIN_SAMPLES", 1);
9006
9127
  __publicField$7(OutlineEffect, "MAX_SAMPLES", 100);
9007
- __decorateClass$v([
9128
+ __decorateClass$w([
9008
9129
  property({ fallback: "#000000ff" })
9009
9130
  ], OutlineEffect.prototype, "color", 2);
9010
- __decorateClass$v([
9131
+ __decorateClass$w([
9011
9132
  property({ fallback: 1 })
9012
9133
  ], OutlineEffect.prototype, "width", 2);
9013
- __decorateClass$v([
9134
+ __decorateClass$w([
9014
9135
  property({ fallback: "solid" })
9015
9136
  ], OutlineEffect.prototype, "style", 2);
9016
- __decorateClass$v([
9137
+ __decorateClass$w([
9017
9138
  property()
9018
9139
  ], OutlineEffect.prototype, "image", 2);
9019
- __decorateClass$v([
9140
+ __decorateClass$w([
9020
9141
  property({ fallback: 1 })
9021
9142
  ], OutlineEffect.prototype, "opacity", 2);
9022
- __decorateClass$v([
9143
+ __decorateClass$w([
9023
9144
  property({ fallback: 0.1 })
9024
9145
  ], OutlineEffect.prototype, "quality", 2);
9025
- __decorateClass$v([
9146
+ __decorateClass$w([
9026
9147
  property({ fallback: false })
9027
9148
  ], OutlineEffect.prototype, "knockout", 2);
9028
- OutlineEffect = __decorateClass$v([
9149
+ OutlineEffect = __decorateClass$w([
9029
9150
  customNode("OutlineEffect")
9030
9151
  ], OutlineEffect);
9031
9152
 
9032
- var __defProp$n = Object.defineProperty;
9153
+ var __defProp$o = Object.defineProperty;
9033
9154
  var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
9034
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9035
- var __decorateClass$u = (decorators, target, key, kind) => {
9155
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9156
+ var __decorateClass$v = (decorators, target, key, kind) => {
9036
9157
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$m(target, key) : target;
9037
9158
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9038
9159
  if (decorator = decorators[i])
9039
9160
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9040
- if (kind && result) __defProp$n(target, key, result);
9161
+ if (kind && result) __defProp$o(target, key, result);
9041
9162
  return result;
9042
9163
  };
9043
9164
  var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, key + "" , value);
@@ -9093,22 +9214,22 @@ void main(void) {
9093
9214
  gl_FragColor = texture2D(sampler, coord);
9094
9215
  }`
9095
9216
  }));
9096
- __decorateClass$u([
9217
+ __decorateClass$v([
9097
9218
  property({ fallback: 10 })
9098
9219
  ], PixelateEffect.prototype, "strength", 2);
9099
- PixelateEffect = __decorateClass$u([
9220
+ PixelateEffect = __decorateClass$v([
9100
9221
  customNode("PixelateEffect")
9101
9222
  ], PixelateEffect);
9102
9223
 
9103
- var __defProp$m = Object.defineProperty;
9224
+ var __defProp$n = Object.defineProperty;
9104
9225
  var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor;
9105
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9106
- var __decorateClass$t = (decorators, target, key, kind) => {
9226
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9227
+ var __decorateClass$u = (decorators, target, key, kind) => {
9107
9228
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$l(target, key) : target;
9108
9229
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9109
9230
  if (decorator = decorators[i])
9110
9231
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
9111
- if (kind && result) __defProp$m(target, key, result);
9232
+ if (kind && result) __defProp$n(target, key, result);
9112
9233
  return result;
9113
9234
  };
9114
9235
  var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, key + "" , value);
@@ -9221,19 +9342,19 @@ void main() {
9221
9342
  gl_FragColor = color;
9222
9343
  }`
9223
9344
  }));
9224
- __decorateClass$t([
9345
+ __decorateClass$u([
9225
9346
  property()
9226
9347
  ], ZoomBlurEffect.prototype, "center", 2);
9227
- __decorateClass$t([
9348
+ __decorateClass$u([
9228
9349
  property({ fallback: 20 })
9229
9350
  ], ZoomBlurEffect.prototype, "innerRadius", 2);
9230
- __decorateClass$t([
9351
+ __decorateClass$u([
9231
9352
  property({ fallback: -1 })
9232
9353
  ], ZoomBlurEffect.prototype, "radius", 2);
9233
- __decorateClass$t([
9354
+ __decorateClass$u([
9234
9355
  property({ fallback: 0.1 })
9235
9356
  ], ZoomBlurEffect.prototype, "strength", 2);
9236
- ZoomBlurEffect = __decorateClass$t([
9357
+ ZoomBlurEffect = __decorateClass$u([
9237
9358
  customNode("ZoomBlurEffect")
9238
9359
  ], ZoomBlurEffect);
9239
9360
 
@@ -9281,13 +9402,13 @@ function getDrawOptions(fill, box) {
9281
9402
  return { disableWrapMode, uvTransform };
9282
9403
  }
9283
9404
 
9284
- var __defProp$l = Object.defineProperty;
9285
- var __decorateClass$s = (decorators, target, key, kind) => {
9405
+ var __defProp$m = Object.defineProperty;
9406
+ var __decorateClass$t = (decorators, target, key, kind) => {
9286
9407
  var result = void 0 ;
9287
9408
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9288
9409
  if (decorator = decorators[i])
9289
9410
  result = (decorator(target, key, result) ) || result;
9290
- if (result) __defProp$l(target, key, result);
9411
+ if (result) __defProp$m(target, key, result);
9291
9412
  return result;
9292
9413
  };
9293
9414
  class BaseElement2DFill extends CoreObject {
@@ -9296,6 +9417,7 @@ class BaseElement2DFill extends CoreObject {
9296
9417
  this.parent = parent;
9297
9418
  }
9298
9419
  _texture;
9420
+ _animatedTexture;
9299
9421
  _setProperties(properties) {
9300
9422
  return super.setProperties(properties);
9301
9423
  }
@@ -9326,25 +9448,27 @@ class BaseElement2DFill extends CoreObject {
9326
9448
  }
9327
9449
  async loadTexture() {
9328
9450
  if (this.linearGradient || this.radialGradient) {
9329
- return new GradientTexture(
9451
+ this._texture = new GradientTexture(
9330
9452
  this.linearGradient ?? this.radialGradient,
9331
9453
  this.parent.size.width,
9332
9454
  this.parent.size.height
9333
9455
  );
9334
9456
  } else if (!isNone(this.image)) {
9335
9457
  this.parent.tree?.log(`load image ${this.image}`);
9336
- return await assets.texture.load(this.image);
9337
- } else {
9338
- return void 0;
9458
+ if (this.image.split("?")[0].endsWith(".gif")) {
9459
+ this._animatedTexture = await assets.gif.load(this.image);
9460
+ } else {
9461
+ this._texture = await assets.texture.load(this.image);
9462
+ }
9339
9463
  }
9340
9464
  }
9341
9465
  async _updateTexture() {
9342
- this._texture = await this.loadTexture();
9466
+ await this.loadTexture();
9343
9467
  this.parent.requestRedraw();
9344
9468
  }
9345
9469
  canDraw() {
9346
9470
  return Boolean(
9347
- this.enabled && (this._texture || this.color)
9471
+ this.enabled && (this._texture || this._animatedTexture || this.color)
9348
9472
  );
9349
9473
  }
9350
9474
  draw() {
@@ -9357,53 +9481,84 @@ class BaseElement2DFill extends CoreObject {
9357
9481
  }
9358
9482
  );
9359
9483
  ctx.uvTransform = uvTransform;
9360
- ctx.fillStyle = this._texture ?? this.color;
9484
+ ctx.fillStyle = this._animatedTexture?.currentFrame.texture ?? this._texture ?? this.color;
9361
9485
  ctx.fill({
9362
9486
  disableWrapMode
9363
9487
  });
9364
9488
  }
9489
+ _getFrameCurrentTime() {
9490
+ const duration = this._animatedTexture?.duration ?? 0;
9491
+ if (!duration)
9492
+ return 0;
9493
+ const currentTime = this.parent._currentTime;
9494
+ if (currentTime < 0)
9495
+ return 0;
9496
+ return currentTime % duration;
9497
+ }
9498
+ updateFrameIndex() {
9499
+ if (!this._animatedTexture)
9500
+ return this;
9501
+ const currentTime = this._getFrameCurrentTime();
9502
+ const frames = this._animatedTexture.frames;
9503
+ const len = frames.length;
9504
+ if (len <= 1 && this._animatedTexture.frameIndex === 0)
9505
+ return this;
9506
+ let index = len - 1;
9507
+ for (let time = 0, i = 0; i < len; i++) {
9508
+ time += frames[i].duration ?? 0;
9509
+ if (time >= currentTime) {
9510
+ index = i;
9511
+ break;
9512
+ }
9513
+ }
9514
+ if (this._animatedTexture.frameIndex !== index) {
9515
+ this._animatedTexture.frameIndex = index;
9516
+ this.parent.requestRedraw();
9517
+ }
9518
+ return this;
9519
+ }
9365
9520
  }
9366
- __decorateClass$s([
9521
+ __decorateClass$t([
9367
9522
  property({ fallback: true })
9368
9523
  ], BaseElement2DFill.prototype, "enabled");
9369
- __decorateClass$s([
9524
+ __decorateClass$t([
9370
9525
  property()
9371
9526
  ], BaseElement2DFill.prototype, "color");
9372
- __decorateClass$s([
9527
+ __decorateClass$t([
9373
9528
  property()
9374
9529
  ], BaseElement2DFill.prototype, "image");
9375
- __decorateClass$s([
9530
+ __decorateClass$t([
9376
9531
  property()
9377
9532
  ], BaseElement2DFill.prototype, "linearGradient");
9378
- __decorateClass$s([
9533
+ __decorateClass$t([
9379
9534
  property()
9380
9535
  ], BaseElement2DFill.prototype, "radialGradient");
9381
- __decorateClass$s([
9536
+ __decorateClass$t([
9382
9537
  property()
9383
9538
  ], BaseElement2DFill.prototype, "cropRect");
9384
- __decorateClass$s([
9539
+ __decorateClass$t([
9385
9540
  property()
9386
9541
  ], BaseElement2DFill.prototype, "stretchRect");
9387
- __decorateClass$s([
9542
+ __decorateClass$t([
9388
9543
  property()
9389
9544
  ], BaseElement2DFill.prototype, "dpi");
9390
- __decorateClass$s([
9545
+ __decorateClass$t([
9391
9546
  property()
9392
9547
  ], BaseElement2DFill.prototype, "rotateWithShape");
9393
- __decorateClass$s([
9548
+ __decorateClass$t([
9394
9549
  property()
9395
9550
  ], BaseElement2DFill.prototype, "tile");
9396
- __decorateClass$s([
9551
+ __decorateClass$t([
9397
9552
  property()
9398
9553
  ], BaseElement2DFill.prototype, "opacity");
9399
9554
 
9400
- var __defProp$k = Object.defineProperty;
9401
- var __decorateClass$r = (decorators, target, key, kind) => {
9555
+ var __defProp$l = Object.defineProperty;
9556
+ var __decorateClass$s = (decorators, target, key, kind) => {
9402
9557
  var result = void 0 ;
9403
9558
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9404
9559
  if (decorator = decorators[i])
9405
9560
  result = (decorator(target, key, result) ) || result;
9406
- if (result) __defProp$k(target, key, result);
9561
+ if (result) __defProp$l(target, key, result);
9407
9562
  return result;
9408
9563
  };
9409
9564
  class BaseElement2DBackground extends BaseElement2DFill {
@@ -9421,17 +9576,17 @@ class BaseElement2DBackground extends BaseElement2DFill {
9421
9576
  }
9422
9577
  }
9423
9578
  }
9424
- __decorateClass$r([
9579
+ __decorateClass$s([
9425
9580
  property()
9426
9581
  ], BaseElement2DBackground.prototype, "fillWithShape");
9427
9582
 
9428
- var __defProp$j = Object.defineProperty;
9429
- var __decorateClass$q = (decorators, target, key, kind) => {
9583
+ var __defProp$k = Object.defineProperty;
9584
+ var __decorateClass$r = (decorators, target, key, kind) => {
9430
9585
  var result = void 0 ;
9431
9586
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9432
9587
  if (decorator = decorators[i])
9433
9588
  result = (decorator(target, key, result) ) || result;
9434
- if (result) __defProp$j(target, key, result);
9589
+ if (result) __defProp$k(target, key, result);
9435
9590
  return result;
9436
9591
  };
9437
9592
  class BaseElement2DForeground extends BaseElement2DFill {
@@ -9449,17 +9604,17 @@ class BaseElement2DForeground extends BaseElement2DFill {
9449
9604
  }
9450
9605
  }
9451
9606
  }
9452
- __decorateClass$q([
9607
+ __decorateClass$r([
9453
9608
  property()
9454
9609
  ], BaseElement2DForeground.prototype, "fillWithShape");
9455
9610
 
9456
- var __defProp$i = Object.defineProperty;
9457
- var __decorateClass$p = (decorators, target, key, kind) => {
9611
+ var __defProp$j = Object.defineProperty;
9612
+ var __decorateClass$q = (decorators, target, key, kind) => {
9458
9613
  var result = void 0 ;
9459
9614
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9460
9615
  if (decorator = decorators[i])
9461
9616
  result = (decorator(target, key, result) ) || result;
9462
- if (result) __defProp$i(target, key, result);
9617
+ if (result) __defProp$j(target, key, result);
9463
9618
  return result;
9464
9619
  };
9465
9620
  class BaseElement2DOutline extends BaseElement2DFill {
@@ -9502,29 +9657,29 @@ class BaseElement2DOutline extends BaseElement2DFill {
9502
9657
  ctx.stroke({ disableWrapMode });
9503
9658
  }
9504
9659
  }
9505
- __decorateClass$p([
9660
+ __decorateClass$q([
9506
9661
  property({ fallback: "#00000000" })
9507
9662
  ], BaseElement2DOutline.prototype, "color");
9508
- __decorateClass$p([
9663
+ __decorateClass$q([
9509
9664
  property({ fallback: 0 })
9510
9665
  ], BaseElement2DOutline.prototype, "width");
9511
- __decorateClass$p([
9666
+ __decorateClass$q([
9512
9667
  property({ fallback: "solid" })
9513
9668
  ], BaseElement2DOutline.prototype, "style");
9514
- __decorateClass$p([
9669
+ __decorateClass$q([
9515
9670
  property({ fallback: "butt" })
9516
9671
  ], BaseElement2DOutline.prototype, "lineCap");
9517
- __decorateClass$p([
9672
+ __decorateClass$q([
9518
9673
  property({ fallback: "miter" })
9519
9674
  ], BaseElement2DOutline.prototype, "lineJoin");
9520
9675
 
9521
- var __defProp$h = Object.defineProperty;
9522
- var __decorateClass$o = (decorators, target, key, kind) => {
9676
+ var __defProp$i = Object.defineProperty;
9677
+ var __decorateClass$p = (decorators, target, key, kind) => {
9523
9678
  var result = void 0 ;
9524
9679
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9525
9680
  if (decorator = decorators[i])
9526
9681
  result = (decorator(target, key, result) ) || result;
9527
- if (result) __defProp$h(target, key, result);
9682
+ if (result) __defProp$i(target, key, result);
9528
9683
  return result;
9529
9684
  };
9530
9685
  class BaseElement2DShadow extends CoreObject {
@@ -9564,29 +9719,29 @@ class BaseElement2DShadow extends CoreObject {
9564
9719
  }
9565
9720
  }
9566
9721
  }
9567
- __decorateClass$o([
9722
+ __decorateClass$p([
9568
9723
  property({ fallback: true })
9569
9724
  ], BaseElement2DShadow.prototype, "enabled");
9570
- __decorateClass$o([
9725
+ __decorateClass$p([
9571
9726
  property({ fallback: "#000000FF" })
9572
9727
  ], BaseElement2DShadow.prototype, "color");
9573
- __decorateClass$o([
9728
+ __decorateClass$p([
9574
9729
  property({ fallback: 0 })
9575
9730
  ], BaseElement2DShadow.prototype, "blur");
9576
- __decorateClass$o([
9731
+ __decorateClass$p([
9577
9732
  property({ fallback: 0 })
9578
9733
  ], BaseElement2DShadow.prototype, "offsetY");
9579
- __decorateClass$o([
9734
+ __decorateClass$p([
9580
9735
  property({ fallback: 0 })
9581
9736
  ], BaseElement2DShadow.prototype, "offsetX");
9582
9737
 
9583
- var __defProp$g = Object.defineProperty;
9584
- var __decorateClass$n = (decorators, target, key, kind) => {
9738
+ var __defProp$h = Object.defineProperty;
9739
+ var __decorateClass$o = (decorators, target, key, kind) => {
9585
9740
  var result = void 0 ;
9586
9741
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9587
9742
  if (decorator = decorators[i])
9588
9743
  result = (decorator(target, key, result) ) || result;
9589
- if (result) __defProp$g(target, key, result);
9744
+ if (result) __defProp$h(target, key, result);
9590
9745
  return result;
9591
9746
  };
9592
9747
  class BaseElement2DShape extends CoreObject {
@@ -9661,19 +9816,19 @@ class BaseElement2DShape extends CoreObject {
9661
9816
  }
9662
9817
  }
9663
9818
  }
9664
- __decorateClass$n([
9819
+ __decorateClass$o([
9665
9820
  property({ fallback: true })
9666
9821
  ], BaseElement2DShape.prototype, "enabled");
9667
- __decorateClass$n([
9822
+ __decorateClass$o([
9668
9823
  property()
9669
9824
  ], BaseElement2DShape.prototype, "preset");
9670
- __decorateClass$n([
9825
+ __decorateClass$o([
9671
9826
  property()
9672
9827
  ], BaseElement2DShape.prototype, "svg");
9673
- __decorateClass$n([
9828
+ __decorateClass$o([
9674
9829
  property()
9675
9830
  ], BaseElement2DShape.prototype, "viewBox");
9676
- __decorateClass$n([
9831
+ __decorateClass$o([
9677
9832
  property()
9678
9833
  ], BaseElement2DShape.prototype, "paths");
9679
9834
 
@@ -9689,13 +9844,13 @@ for (const key in defaultStyles$1) {
9689
9844
  defineProperty(BaseElement2DStyle, key, { fallback });
9690
9845
  }
9691
9846
 
9692
- var __defProp$f = Object.defineProperty;
9693
- var __decorateClass$m = (decorators, target, key, kind) => {
9847
+ var __defProp$g = Object.defineProperty;
9848
+ var __decorateClass$n = (decorators, target, key, kind) => {
9694
9849
  var result = void 0 ;
9695
9850
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9696
9851
  if (decorator = decorators[i])
9697
9852
  result = (decorator(target, key, result) ) || result;
9698
- if (result) __defProp$f(target, key, result);
9853
+ if (result) __defProp$g(target, key, result);
9699
9854
  return result;
9700
9855
  };
9701
9856
  class BaseElement2DText extends CoreObject {
@@ -9875,38 +10030,43 @@ class BaseElement2DText extends CoreObject {
9875
10030
  ctx.stroke();
9876
10031
  }
9877
10032
  }
10033
+ } else {
10034
+ ctx.addPath(path);
10035
+ ctx.style = { ...path.style };
10036
+ ctx.vertTransform = this._getVertTransform();
10037
+ ctx.fill();
9878
10038
  }
9879
10039
  });
9880
10040
  });
9881
10041
  }
9882
10042
  }
9883
- __decorateClass$m([
10043
+ __decorateClass$n([
9884
10044
  property({ fallback: true })
9885
10045
  ], BaseElement2DText.prototype, "enabled");
9886
- __decorateClass$m([
10046
+ __decorateClass$n([
9887
10047
  property({ fallback: () => [] })
9888
10048
  ], BaseElement2DText.prototype, "content");
9889
- __decorateClass$m([
10049
+ __decorateClass$n([
9890
10050
  property({ alias: "parent.style.json" })
9891
10051
  ], BaseElement2DText.prototype, "style");
9892
- __decorateClass$m([
10052
+ __decorateClass$n([
9893
10053
  property()
9894
10054
  ], BaseElement2DText.prototype, "effects");
9895
- __decorateClass$m([
10055
+ __decorateClass$n([
9896
10056
  property()
9897
10057
  ], BaseElement2DText.prototype, "fill");
9898
- __decorateClass$m([
10058
+ __decorateClass$n([
9899
10059
  property()
9900
10060
  ], BaseElement2DText.prototype, "outline");
9901
- __decorateClass$m([
10061
+ __decorateClass$n([
9902
10062
  property({ alias: "base.measureDom" })
9903
10063
  ], BaseElement2DText.prototype, "measureDom");
9904
- __decorateClass$m([
10064
+ __decorateClass$n([
9905
10065
  property({ alias: "base.fonts" })
9906
10066
  ], BaseElement2DText.prototype, "fonts");
9907
10067
 
9908
10068
  var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
9909
- var __decorateClass$l = (decorators, target, key, kind) => {
10069
+ var __decorateClass$m = (decorators, target, key, kind) => {
9910
10070
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$k(target, key) : target;
9911
10071
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
9912
10072
  if (decorator = decorators[i])
@@ -10074,6 +10234,13 @@ let BaseElement2D = class extends Node2D {
10074
10234
  break;
10075
10235
  }
10076
10236
  }
10237
+ _process(delta) {
10238
+ this.foreground.updateFrameIndex();
10239
+ this.fill.updateFrameIndex();
10240
+ this.outline.updateFrameIndex();
10241
+ this.background.updateFrameIndex();
10242
+ super._process(delta);
10243
+ }
10077
10244
  _updateMaskImage() {
10078
10245
  const nodePath = "__$style.maskImage";
10079
10246
  const maskImage = this.style.maskImage;
@@ -10319,7 +10486,7 @@ let BaseElement2D = class extends Node2D {
10319
10486
  });
10320
10487
  }
10321
10488
  };
10322
- BaseElement2D = __decorateClass$l([
10489
+ BaseElement2D = __decorateClass$m([
10323
10490
  customNode("BaseElement2D")
10324
10491
  ], BaseElement2D);
10325
10492
 
@@ -10347,7 +10514,7 @@ class FlexElement2DStyle extends BaseElement2DStyle {
10347
10514
  }
10348
10515
 
10349
10516
  var __getOwnPropDesc$j = Object.getOwnPropertyDescriptor;
10350
- var __decorateClass$k = (decorators, target, key, kind) => {
10517
+ var __decorateClass$l = (decorators, target, key, kind) => {
10351
10518
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$j(target, key) : target;
10352
10519
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
10353
10520
  if (decorator = decorators[i])
@@ -10399,7 +10566,7 @@ let Element2D = class extends BaseElement2D {
10399
10566
  }
10400
10567
  }
10401
10568
  };
10402
- Element2D = __decorateClass$k([
10569
+ Element2D = __decorateClass$l([
10403
10570
  customNode("Element2D")
10404
10571
  ], Element2D);
10405
10572
 
@@ -10710,7 +10877,7 @@ class FlexLayout {
10710
10877
  }
10711
10878
 
10712
10879
  var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
10713
- var __decorateClass$j = (decorators, target, key, kind) => {
10880
+ var __decorateClass$k = (decorators, target, key, kind) => {
10714
10881
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$i(target, key) : target;
10715
10882
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
10716
10883
  if (decorator = decorators[i])
@@ -10788,18 +10955,18 @@ let FlexElement2D = class extends BaseElement2D {
10788
10955
  }
10789
10956
  }
10790
10957
  };
10791
- FlexElement2D = __decorateClass$j([
10958
+ FlexElement2D = __decorateClass$k([
10792
10959
  customNode("FlexElement2D")
10793
10960
  ], FlexElement2D);
10794
10961
 
10795
- var __defProp$e = Object.defineProperty;
10962
+ var __defProp$f = Object.defineProperty;
10796
10963
  var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
10797
- var __decorateClass$i = (decorators, target, key, kind) => {
10964
+ var __decorateClass$j = (decorators, target, key, kind) => {
10798
10965
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
10799
10966
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
10800
10967
  if (decorator = decorators[i])
10801
10968
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
10802
- if (kind && result) __defProp$e(target, key, result);
10969
+ if (kind && result) __defProp$f(target, key, result);
10803
10970
  return result;
10804
10971
  };
10805
10972
  let Image2D = class extends Element2D {
@@ -10935,19 +11102,19 @@ let Image2D = class extends Element2D {
10935
11102
  });
10936
11103
  }
10937
11104
  };
10938
- __decorateClass$i([
11105
+ __decorateClass$j([
10939
11106
  property({ internal: true })
10940
11107
  ], Image2D.prototype, "texture", 2);
10941
- __decorateClass$i([
11108
+ __decorateClass$j([
10942
11109
  property({ fallback: "" })
10943
11110
  ], Image2D.prototype, "src", 2);
10944
- __decorateClass$i([
11111
+ __decorateClass$j([
10945
11112
  property()
10946
11113
  ], Image2D.prototype, "srcRect", 2);
10947
- __decorateClass$i([
11114
+ __decorateClass$j([
10948
11115
  property({ fallback: false })
10949
11116
  ], Image2D.prototype, "gif", 2);
10950
- Image2D = __decorateClass$i([
11117
+ Image2D = __decorateClass$j([
10951
11118
  customNode("Image2D")
10952
11119
  ], Image2D);
10953
11120
 
@@ -10971,14 +11138,14 @@ class TextureRect2D extends Element2D {
10971
11138
  }
10972
11139
  }
10973
11140
 
10974
- var __defProp$d = Object.defineProperty;
11141
+ var __defProp$e = Object.defineProperty;
10975
11142
  var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
10976
- var __decorateClass$h = (decorators, target, key, kind) => {
11143
+ var __decorateClass$i = (decorators, target, key, kind) => {
10977
11144
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
10978
11145
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
10979
11146
  if (decorator = decorators[i])
10980
11147
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
10981
- if (kind && result) __defProp$d(target, key, result);
11148
+ if (kind && result) __defProp$e(target, key, result);
10982
11149
  return result;
10983
11150
  };
10984
11151
  let Lottie2D = class extends TextureRect2D {
@@ -11021,20 +11188,20 @@ let Lottie2D = class extends TextureRect2D {
11021
11188
  super._process(delta);
11022
11189
  }
11023
11190
  };
11024
- __decorateClass$h([
11191
+ __decorateClass$i([
11025
11192
  property({ fallback: "" })
11026
11193
  ], Lottie2D.prototype, "src", 2);
11027
- Lottie2D = __decorateClass$h([
11194
+ Lottie2D = __decorateClass$i([
11028
11195
  customNode("Lottie2D")
11029
11196
  ], Lottie2D);
11030
11197
 
11031
- var __defProp$c = Object.defineProperty;
11032
- var __decorateClass$g = (decorators, target, key, kind) => {
11198
+ var __defProp$d = Object.defineProperty;
11199
+ var __decorateClass$h = (decorators, target, key, kind) => {
11033
11200
  var result = void 0 ;
11034
11201
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11035
11202
  if (decorator = decorators[i])
11036
11203
  result = (decorator(target, key, result) ) || result;
11037
- if (result) __defProp$c(target, key, result);
11204
+ if (result) __defProp$d(target, key, result);
11038
11205
  return result;
11039
11206
  };
11040
11207
  class TransformRect2D extends Element2D {
@@ -11080,18 +11247,18 @@ class TransformRect2D extends Element2D {
11080
11247
  this._drawEllipse(width, height / 2);
11081
11248
  }
11082
11249
  }
11083
- __decorateClass$g([
11250
+ __decorateClass$h([
11084
11251
  property({ fallback: 6 })
11085
11252
  ], TransformRect2D.prototype, "handleSize");
11086
11253
 
11087
- var __defProp$b = Object.defineProperty;
11254
+ var __defProp$c = Object.defineProperty;
11088
11255
  var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
11089
- var __decorateClass$f = (decorators, target, key, kind) => {
11256
+ var __decorateClass$g = (decorators, target, key, kind) => {
11090
11257
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
11091
11258
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11092
11259
  if (decorator = decorators[i])
11093
11260
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11094
- if (kind && result) __defProp$b(target, key, result);
11261
+ if (kind && result) __defProp$c(target, key, result);
11095
11262
  return result;
11096
11263
  };
11097
11264
  let Video2D = class extends TextureRect2D {
@@ -11144,21 +11311,21 @@ let Video2D = class extends TextureRect2D {
11144
11311
  super._process(delta);
11145
11312
  }
11146
11313
  };
11147
- __decorateClass$f([
11314
+ __decorateClass$g([
11148
11315
  property({ fallback: "" })
11149
11316
  ], Video2D.prototype, "src", 2);
11150
- Video2D = __decorateClass$f([
11317
+ Video2D = __decorateClass$g([
11151
11318
  customNode("Video2D")
11152
11319
  ], Video2D);
11153
11320
 
11154
- var __defProp$a = Object.defineProperty;
11321
+ var __defProp$b = Object.defineProperty;
11155
11322
  var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
11156
- var __decorateClass$e = (decorators, target, key, kind) => {
11323
+ var __decorateClass$f = (decorators, target, key, kind) => {
11157
11324
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
11158
11325
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
11159
11326
  if (decorator = decorators[i])
11160
11327
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
11161
- if (kind && result) __defProp$a(target, key, result);
11328
+ if (kind && result) __defProp$b(target, key, result);
11162
11329
  return result;
11163
11330
  };
11164
11331
  const linear = (amount) => amount;
@@ -11477,19 +11644,19 @@ let Animation = class extends TimelineNode {
11477
11644
  });
11478
11645
  }
11479
11646
  };
11480
- __decorateClass$e([
11647
+ __decorateClass$f([
11481
11648
  property({ fallback: "parent" })
11482
11649
  ], Animation.prototype, "effectMode", 2);
11483
- __decorateClass$e([
11650
+ __decorateClass$f([
11484
11651
  property({ fallback: false })
11485
11652
  ], Animation.prototype, "loop", 2);
11486
- __decorateClass$e([
11653
+ __decorateClass$f([
11487
11654
  property({ default: () => [] })
11488
11655
  ], Animation.prototype, "keyframes", 2);
11489
- __decorateClass$e([
11656
+ __decorateClass$f([
11490
11657
  property()
11491
11658
  ], Animation.prototype, "easing", 2);
11492
- Animation = __decorateClass$e([
11659
+ Animation = __decorateClass$f([
11493
11660
  customNode("Animation", {
11494
11661
  renderMode: "disabled",
11495
11662
  processMode: "pausable",
@@ -12370,10 +12537,10 @@ class WebAudio extends AudioPipeline {
12370
12537
  }
12371
12538
  }
12372
12539
 
12373
- var __defProp$9 = Object.defineProperty;
12540
+ var __defProp$a = Object.defineProperty;
12374
12541
  var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
12375
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12376
- var __decorateClass$d = (decorators, target, key, kind) => {
12542
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12543
+ var __decorateClass$e = (decorators, target, key, kind) => {
12377
12544
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
12378
12545
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
12379
12546
  if (decorator = decorators[i])
@@ -12585,7 +12752,7 @@ let Audio = class extends TimelineNode {
12585
12752
  }
12586
12753
  };
12587
12754
  __publicField$4(Audio, "_soundPool", []);
12588
- Audio = __decorateClass$d([
12755
+ Audio = __decorateClass$e([
12589
12756
  customNode("Audio")
12590
12757
  ], Audio);
12591
12758
 
@@ -12593,14 +12760,14 @@ class AudioSpectrum extends Node2D {
12593
12760
  //
12594
12761
  }
12595
12762
 
12596
- var __defProp$8 = Object.defineProperty;
12763
+ var __defProp$9 = Object.defineProperty;
12597
12764
  var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
12598
- var __decorateClass$c = (decorators, target, key, kind) => {
12765
+ var __decorateClass$d = (decorators, target, key, kind) => {
12599
12766
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
12600
12767
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
12601
12768
  if (decorator = decorators[i])
12602
12769
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
12603
- if (kind && result) __defProp$8(target, key, result);
12770
+ if (kind && result) __defProp$9(target, key, result);
12604
12771
  return result;
12605
12772
  };
12606
12773
  let AudioWaveform = class extends Element2D {
@@ -12691,21 +12858,21 @@ let AudioWaveform = class extends Element2D {
12691
12858
  }
12692
12859
  }
12693
12860
  };
12694
- __decorateClass$c([
12861
+ __decorateClass$d([
12695
12862
  property()
12696
12863
  ], AudioWaveform.prototype, "src", 2);
12697
- __decorateClass$c([
12864
+ __decorateClass$d([
12698
12865
  property({ fallback: 0 })
12699
12866
  ], AudioWaveform.prototype, "gap", 2);
12700
- __decorateClass$c([
12867
+ __decorateClass$d([
12701
12868
  property({ fallback: "#000000" })
12702
12869
  ], AudioWaveform.prototype, "color", 2);
12703
- AudioWaveform = __decorateClass$c([
12870
+ AudioWaveform = __decorateClass$d([
12704
12871
  customNode("AudioWaveform")
12705
12872
  ], AudioWaveform);
12706
12873
 
12707
12874
  var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
12708
- var __decorateClass$b = (decorators, target, key, kind) => {
12875
+ var __decorateClass$c = (decorators, target, key, kind) => {
12709
12876
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
12710
12877
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
12711
12878
  if (decorator = decorators[i])
@@ -12753,18 +12920,18 @@ let Control = class extends Element2D {
12753
12920
  _guiInput(event, key) {
12754
12921
  }
12755
12922
  };
12756
- Control = __decorateClass$b([
12923
+ Control = __decorateClass$c([
12757
12924
  customNode("Control")
12758
12925
  ], Control);
12759
12926
 
12760
- var __defProp$7 = Object.defineProperty;
12927
+ var __defProp$8 = Object.defineProperty;
12761
12928
  var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
12762
- var __decorateClass$a = (decorators, target, key, kind) => {
12929
+ var __decorateClass$b = (decorators, target, key, kind) => {
12763
12930
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
12764
12931
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
12765
12932
  if (decorator = decorators[i])
12766
12933
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
12767
- if (kind && result) __defProp$7(target, key, result);
12934
+ if (kind && result) __defProp$8(target, key, result);
12768
12935
  return result;
12769
12936
  };
12770
12937
  let Range = class extends Control {
@@ -12787,39 +12954,39 @@ let Range = class extends Control {
12787
12954
  }
12788
12955
  }
12789
12956
  };
12790
- __decorateClass$a([
12957
+ __decorateClass$b([
12791
12958
  property({ fallback: false })
12792
12959
  ], Range.prototype, "allowGreater", 2);
12793
- __decorateClass$a([
12960
+ __decorateClass$b([
12794
12961
  property({ fallback: false })
12795
12962
  ], Range.prototype, "allowLesser", 2);
12796
- __decorateClass$a([
12963
+ __decorateClass$b([
12797
12964
  property({ fallback: 1 })
12798
12965
  ], Range.prototype, "page", 2);
12799
- __decorateClass$a([
12966
+ __decorateClass$b([
12800
12967
  property({ fallback: 0 })
12801
12968
  ], Range.prototype, "minValue", 2);
12802
- __decorateClass$a([
12969
+ __decorateClass$b([
12803
12970
  property({ fallback: 100 })
12804
12971
  ], Range.prototype, "maxValue", 2);
12805
- __decorateClass$a([
12972
+ __decorateClass$b([
12806
12973
  property({ fallback: 0.01 })
12807
12974
  ], Range.prototype, "step", 2);
12808
- __decorateClass$a([
12975
+ __decorateClass$b([
12809
12976
  property({ fallback: 0 })
12810
12977
  ], Range.prototype, "value", 2);
12811
- Range = __decorateClass$a([
12978
+ Range = __decorateClass$b([
12812
12979
  customNode("Range")
12813
12980
  ], Range);
12814
12981
 
12815
- var __defProp$6 = Object.defineProperty;
12982
+ var __defProp$7 = Object.defineProperty;
12816
12983
  var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
12817
- var __decorateClass$9 = (decorators, target, key, kind) => {
12984
+ var __decorateClass$a = (decorators, target, key, kind) => {
12818
12985
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
12819
12986
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
12820
12987
  if (decorator = decorators[i])
12821
12988
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
12822
- if (kind && result) __defProp$6(target, key, result);
12989
+ if (kind && result) __defProp$7(target, key, result);
12823
12990
  return result;
12824
12991
  };
12825
12992
  let Ruler = class extends Control {
@@ -12967,45 +13134,45 @@ let Ruler = class extends Control {
12967
13134
  }
12968
13135
  }
12969
13136
  };
12970
- __decorateClass$9([
13137
+ __decorateClass$a([
12971
13138
  property({ fallback: 0 })
12972
13139
  ], Ruler.prototype, "offsetX", 2);
12973
- __decorateClass$9([
13140
+ __decorateClass$a([
12974
13141
  property({ fallback: 0 })
12975
13142
  ], Ruler.prototype, "offsetY", 2);
12976
- __decorateClass$9([
13143
+ __decorateClass$a([
12977
13144
  property({ fallback: 20 })
12978
13145
  ], Ruler.prototype, "thickness", 2);
12979
- __decorateClass$9([
13146
+ __decorateClass$a([
12980
13147
  property({ fallback: 3 })
12981
13148
  ], Ruler.prototype, "markHeight", 2);
12982
- __decorateClass$9([
13149
+ __decorateClass$a([
12983
13150
  property({ fallback: "#b2b6bc" })
12984
13151
  ], Ruler.prototype, "color", 2);
12985
- __decorateClass$9([
13152
+ __decorateClass$a([
12986
13153
  property({ fallback: "#f9f9fa" })
12987
13154
  ], Ruler.prototype, "markBackgroundColor", 2);
12988
- __decorateClass$9([
13155
+ __decorateClass$a([
12989
13156
  property({ fallback: "#b2b6bc" })
12990
13157
  ], Ruler.prototype, "markColor", 2);
12991
- __decorateClass$9([
13158
+ __decorateClass$a([
12992
13159
  property({ fallback: 300 })
12993
13160
  ], Ruler.prototype, "gap", 2);
12994
- __decorateClass$9([
13161
+ __decorateClass$a([
12995
13162
  property({ fallback: 1 })
12996
13163
  ], Ruler.prototype, "gapScale", 2);
12997
- Ruler = __decorateClass$9([
13164
+ Ruler = __decorateClass$a([
12998
13165
  customNode("Ruler")
12999
13166
  ], Ruler);
13000
13167
 
13001
- var __defProp$5 = Object.defineProperty;
13168
+ var __defProp$6 = Object.defineProperty;
13002
13169
  var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
13003
- var __decorateClass$8 = (decorators, target, key, kind) => {
13170
+ var __decorateClass$9 = (decorators, target, key, kind) => {
13004
13171
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
13005
13172
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
13006
13173
  if (decorator = decorators[i])
13007
13174
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
13008
- if (kind && result) __defProp$5(target, key, result);
13175
+ if (kind && result) __defProp$6(target, key, result);
13009
13176
  return result;
13010
13177
  };
13011
13178
  let ScrollBar = class extends Range {
@@ -13064,15 +13231,15 @@ let ScrollBar = class extends Range {
13064
13231
  return false;
13065
13232
  }
13066
13233
  };
13067
- __decorateClass$8([
13234
+ __decorateClass$9([
13068
13235
  property({ fallback: "vertical" })
13069
13236
  ], ScrollBar.prototype, "direction", 2);
13070
- ScrollBar = __decorateClass$8([
13237
+ ScrollBar = __decorateClass$9([
13071
13238
  customNode("ScrollBar")
13072
13239
  ], ScrollBar);
13073
13240
 
13074
13241
  var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
13075
- var __decorateClass$7 = (decorators, target, key, kind) => {
13242
+ var __decorateClass$8 = (decorators, target, key, kind) => {
13076
13243
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
13077
13244
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
13078
13245
  if (decorator = decorators[i])
@@ -13085,14 +13252,14 @@ let XScrollBar = class extends ScrollBar {
13085
13252
  this.setProperties(properties).append(children);
13086
13253
  }
13087
13254
  };
13088
- XScrollBar = __decorateClass$7([
13255
+ XScrollBar = __decorateClass$8([
13089
13256
  customNode("XScrollBar", {
13090
13257
  direction: "horizontal"
13091
13258
  })
13092
13259
  ], XScrollBar);
13093
13260
 
13094
13261
  var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
13095
- var __decorateClass$6 = (decorators, target, key, kind) => {
13262
+ var __decorateClass$7 = (decorators, target, key, kind) => {
13096
13263
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
13097
13264
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
13098
13265
  if (decorator = decorators[i])
@@ -13105,20 +13272,20 @@ let YScrollBar = class extends ScrollBar {
13105
13272
  this.setProperties(properties).append(children);
13106
13273
  }
13107
13274
  };
13108
- YScrollBar = __decorateClass$6([
13275
+ YScrollBar = __decorateClass$7([
13109
13276
  customNode("YScrollBar", {
13110
13277
  direction: "vertical"
13111
13278
  })
13112
13279
  ], YScrollBar);
13113
13280
 
13114
- var __defProp$4 = Object.defineProperty;
13281
+ var __defProp$5 = Object.defineProperty;
13115
13282
  var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
13116
- var __decorateClass$5 = (decorators, target, key, kind) => {
13283
+ var __decorateClass$6 = (decorators, target, key, kind) => {
13117
13284
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
13118
13285
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
13119
13286
  if (decorator = decorators[i])
13120
13287
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
13121
- if (kind && result) __defProp$4(target, key, result);
13288
+ if (kind && result) __defProp$5(target, key, result);
13122
13289
  return result;
13123
13290
  };
13124
13291
  let Scaler = class extends Node {
@@ -13179,32 +13346,32 @@ let Scaler = class extends Node {
13179
13346
  }
13180
13347
  }
13181
13348
  };
13182
- __decorateClass$5([
13349
+ __decorateClass$6([
13183
13350
  property({ default: 1 })
13184
13351
  ], Scaler.prototype, "translateX", 2);
13185
- __decorateClass$5([
13352
+ __decorateClass$6([
13186
13353
  property({ default: 1 })
13187
13354
  ], Scaler.prototype, "translateY", 2);
13188
- __decorateClass$5([
13355
+ __decorateClass$6([
13189
13356
  property({ default: 1 })
13190
13357
  ], Scaler.prototype, "scale", 2);
13191
- __decorateClass$5([
13358
+ __decorateClass$6([
13192
13359
  property({ default: 0.05 })
13193
13360
  ], Scaler.prototype, "minScale", 2);
13194
- __decorateClass$5([
13361
+ __decorateClass$6([
13195
13362
  property({ default: 10 })
13196
13363
  ], Scaler.prototype, "maxScale", 2);
13197
- Scaler = __decorateClass$5([
13364
+ Scaler = __decorateClass$6([
13198
13365
  customNode("Scaler", {
13199
13366
  processMode: "disabled",
13200
13367
  renderMode: "disabled"
13201
13368
  })
13202
13369
  ], Scaler);
13203
13370
 
13204
- var __defProp$3 = Object.defineProperty;
13371
+ var __defProp$4 = Object.defineProperty;
13205
13372
  var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
13206
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13207
- var __decorateClass$4 = (decorators, target, key, kind) => {
13373
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13374
+ var __decorateClass$5 = (decorators, target, key, kind) => {
13208
13375
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
13209
13376
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
13210
13377
  if (decorator = decorators[i])
@@ -13293,14 +13460,14 @@ void main(void) {
13293
13460
  gl_FragColor = color;
13294
13461
  }`
13295
13462
  }));
13296
- KawaseTransition = __decorateClass$4([
13463
+ KawaseTransition = __decorateClass$5([
13297
13464
  customNode("KawaseTransition")
13298
13465
  ], KawaseTransition);
13299
13466
 
13300
- var __defProp$2 = Object.defineProperty;
13467
+ var __defProp$3 = Object.defineProperty;
13301
13468
  var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
13302
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13303
- var __decorateClass$3 = (decorators, target, key, kind) => {
13469
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13470
+ var __decorateClass$4 = (decorators, target, key, kind) => {
13304
13471
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
13305
13472
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
13306
13473
  if (decorator = decorators[i])
@@ -13346,14 +13513,14 @@ void main() {
13346
13513
  gl_FragColor = mix(src2Color, src1Color, mixPercent);
13347
13514
  }`
13348
13515
  }));
13349
- LeftEraseTransition = __decorateClass$3([
13516
+ LeftEraseTransition = __decorateClass$4([
13350
13517
  customNode("LeftEraseTransition")
13351
13518
  ], LeftEraseTransition);
13352
13519
 
13353
- var __defProp$1 = Object.defineProperty;
13520
+ var __defProp$2 = Object.defineProperty;
13354
13521
  var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
13355
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13356
- var __decorateClass$2 = (decorators, target, key, kind) => {
13522
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13523
+ var __decorateClass$3 = (decorators, target, key, kind) => {
13357
13524
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
13358
13525
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
13359
13526
  if (decorator = decorators[i])
@@ -13453,14 +13620,14 @@ void main(void) {
13453
13620
  gl_FragColor = color;
13454
13621
  }`
13455
13622
  }));
13456
- TiltShiftTransition = __decorateClass$2([
13623
+ TiltShiftTransition = __decorateClass$3([
13457
13624
  customNode("TiltShiftTransition")
13458
13625
  ], TiltShiftTransition);
13459
13626
 
13460
- var __defProp = Object.defineProperty;
13627
+ var __defProp$1 = Object.defineProperty;
13461
13628
  var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
13462
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13463
- var __decorateClass$1 = (decorators, target, key, kind) => {
13629
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13630
+ var __decorateClass$2 = (decorators, target, key, kind) => {
13464
13631
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
13465
13632
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
13466
13633
  if (decorator = decorators[i])
@@ -13547,7 +13714,7 @@ void main(void) {
13547
13714
  gl_FragColor = texture2D(sampler, coord);
13548
13715
  }`
13549
13716
  }));
13550
- TwistTransition = __decorateClass$1([
13717
+ TwistTransition = __decorateClass$2([
13551
13718
  customNode("TwistTransition")
13552
13719
  ], TwistTransition);
13553
13720
 
@@ -13912,7 +14079,7 @@ class Assets {
13912
14079
  const assets = new Assets().use(new FontLoader()).use(new GifLoader()).use(new JsonLoader()).use(new LottieLoader()).use(new TextLoader()).use(new TextureLoader()).use(new VideoLoader());
13913
14080
 
13914
14081
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13915
- var __decorateClass = (decorators, target, key, kind) => {
14082
+ var __decorateClass$1 = (decorators, target, key, kind) => {
13916
14083
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
13917
14084
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
13918
14085
  if (decorator = decorators[i])
@@ -14121,10 +14288,19 @@ let CanvasItemEditor = class extends Control {
14121
14288
  }
14122
14289
  }
14123
14290
  };
14124
- CanvasItemEditor = __decorateClass([
14291
+ CanvasItemEditor = __decorateClass$1([
14125
14292
  customNode("CanvasItemEditor")
14126
14293
  ], CanvasItemEditor);
14127
14294
 
14295
+ var __defProp = Object.defineProperty;
14296
+ var __decorateClass = (decorators, target, key, kind) => {
14297
+ var result = void 0 ;
14298
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
14299
+ if (decorator = decorators[i])
14300
+ result = (decorator(target, key, result) ) || result;
14301
+ if (result) __defProp(target, key, result);
14302
+ return result;
14303
+ };
14128
14304
  const defaultOptions = {
14129
14305
  alpha: true,
14130
14306
  stencil: true,
@@ -14156,9 +14332,6 @@ class Engine extends SceneTree {
14156
14332
  set pixelRatio(val) {
14157
14333
  this.renderer.pixelRatio = val;
14158
14334
  this.resize(this.width, this.height);
14159
- if (this.view) {
14160
- this.view.dataset.pixelRatio = String(val);
14161
- }
14162
14335
  }
14163
14336
  _resizeObserver = SUPPORTS_RESIZE_OBSERVER ? new ResizeObserver((entries) => {
14164
14337
  const entry = entries[0];
@@ -14167,36 +14340,30 @@ class Engine extends SceneTree {
14167
14340
  this.resize(width, height);
14168
14341
  }
14169
14342
  }) : void 0;
14170
- constructor(options = {}) {
14343
+ constructor(properties = {}) {
14171
14344
  const {
14172
- debug = false,
14173
14345
  view,
14174
14346
  width,
14175
14347
  height,
14176
14348
  pixelRatio = DEVICE_PIXEL_RATIO,
14177
- backgroundColor = 0,
14178
- fonts,
14179
- autoResize,
14180
- autoStart,
14181
- timeline,
14182
- ...glOptions
14183
- } = options;
14184
- super(timeline);
14185
- this.debug = debug;
14349
+ autoResize
14350
+ } = properties;
14351
+ super();
14186
14352
  this.renderer = new WebGLRenderer(view, {
14187
- ...defaultOptions,
14188
- ...glOptions
14353
+ alpha: defaultOptions.alpha ?? properties.alpha,
14354
+ stencil: defaultOptions.stencil ?? properties.stencil,
14355
+ antialias: defaultOptions.antialias ?? properties.antialias,
14356
+ premultipliedAlpha: defaultOptions.premultipliedAlpha ?? properties.premultipliedAlpha,
14357
+ preserveDrawingBuffer: defaultOptions.preserveDrawingBuffer ?? properties.preserveDrawingBuffer,
14358
+ powerPreference: defaultOptions.powerPreference ?? properties.powerPreference
14189
14359
  });
14190
14360
  this._setupInput();
14191
14361
  this.pixelRatio = pixelRatio;
14192
- this.backgroundColor = backgroundColor;
14193
- this.fonts = fonts;
14194
14362
  if (autoResize) {
14195
14363
  if (!view && this.renderer.view) {
14196
14364
  this.renderer.view.style.width = "100%";
14197
14365
  this.renderer.view.style.height = "100%";
14198
14366
  }
14199
- this.enableAutoResize(autoResize);
14200
14367
  } else {
14201
14368
  this.resize(
14202
14369
  width || this.gl.drawingBufferWidth || this.view?.clientWidth || 200,
@@ -14204,7 +14371,26 @@ class Engine extends SceneTree {
14204
14371
  !view
14205
14372
  );
14206
14373
  }
14207
- autoStart && this.start();
14374
+ this.setProperties(properties);
14375
+ }
14376
+ _updateProperty(key, value, oldValue) {
14377
+ super._updateProperty(key, value, oldValue);
14378
+ switch (key) {
14379
+ case "autoResize":
14380
+ if (this.view) {
14381
+ if (this.autoResize) {
14382
+ this._resizeObserver?.observe(this.view);
14383
+ } else {
14384
+ this._resizeObserver?.unobserve(this.view);
14385
+ }
14386
+ }
14387
+ break;
14388
+ case "autoStart":
14389
+ if (this.autoStart) {
14390
+ this.start();
14391
+ }
14392
+ break;
14393
+ }
14208
14394
  }
14209
14395
  _setupInput() {
14210
14396
  if (this.view) {
@@ -14227,16 +14413,6 @@ class Engine extends SceneTree {
14227
14413
  }
14228
14414
  return this;
14229
14415
  }
14230
- enableAutoResize(enable = true) {
14231
- if (this.view) {
14232
- if (enable) {
14233
- this._resizeObserver?.observe(this.view);
14234
- } else {
14235
- this._resizeObserver?.unobserve(this.view);
14236
- }
14237
- }
14238
- return this;
14239
- }
14240
14416
  resize(width, height, updateCss = false) {
14241
14417
  this.renderer.resize(width, height, updateCss);
14242
14418
  this.root.width = width;
@@ -14269,11 +14445,6 @@ class Engine extends SceneTree {
14269
14445
  this._render(this.renderer);
14270
14446
  });
14271
14447
  }
14272
- destroy() {
14273
- super.destroy();
14274
- this.enableAutoResize(false);
14275
- this.renderer.destroy();
14276
- }
14277
14448
  toPixels() {
14278
14449
  return this.renderer.toPixels();
14279
14450
  }
@@ -14316,7 +14487,21 @@ class Engine extends SceneTree {
14316
14487
  }
14317
14488
  return canvas2;
14318
14489
  }
14490
+ destroy() {
14491
+ this._resizeObserver?.disconnect();
14492
+ this.renderer.destroy();
14493
+ super.destroy();
14494
+ }
14319
14495
  }
14496
+ __decorateClass([
14497
+ property({ alias: "root.msaa" })
14498
+ ], Engine.prototype, "msaa");
14499
+ __decorateClass([
14500
+ property({ fallback: false })
14501
+ ], Engine.prototype, "autoResize");
14502
+ __decorateClass([
14503
+ property({ fallback: false })
14504
+ ], Engine.prototype, "autoStart");
14320
14505
 
14321
14506
  let engine;
14322
14507
  const queue = [];