@galacean/effects-threejs 2.1.0-alpha.5 → 2.1.0-alpha.6

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
@@ -3,7 +3,7 @@
3
3
  * Description: Galacean Effects runtime threejs plugin for the web
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
6
- * Version: v2.1.0-alpha.5
6
+ * Version: v2.1.0-alpha.6
7
7
  */
8
8
 
9
9
  import * as THREE from 'three';
@@ -3948,6 +3948,12 @@ Euler.tempMat0 = new Matrix4();
3948
3948
  /**
3949
3949
  * 节点元素
3950
3950
  */ ItemType["node"] = "node";
3951
+ /**
3952
+ * 视频元素
3953
+ */ ItemType["video"] = "video";
3954
+ /**
3955
+ * 音频元素
3956
+ */ ItemType["audio"] = "audio";
3951
3957
  })(ItemType || (ItemType = {}));
3952
3958
  /**
3953
3959
  * 渲染模式
@@ -4048,15 +4054,6 @@ var CameraClipMode;
4048
4054
  */ CameraClipMode[CameraClipMode["landscape"] = 0] = "landscape";
4049
4055
  })(CameraClipMode || (CameraClipMode = {}));
4050
4056
 
4051
- /**
4052
- * 动态换图类型
4053
- * @since 1.1.0
4054
- */ var BackgroundType;
4055
- (function(BackgroundType) {
4056
- BackgroundType["video"] = "video";
4057
- BackgroundType["image"] = "image";
4058
- })(BackgroundType || (BackgroundType = {}));
4059
-
4060
4057
  /*********************************************/ /* 基本数值属性参数 */ /*********************************************/ var ValueType;
4061
4058
  (function(ValueType) {
4062
4059
  /**
@@ -4362,6 +4359,8 @@ var DataType;
4362
4359
  DataType["TreeComponent"] = "TreeComponent";
4363
4360
  DataType["AnimationComponent"] = "AnimationComponent";
4364
4361
  DataType["SpineComponent"] = "SpineComponent";
4362
+ DataType["VideoComponent"] = "VideoComponent";
4363
+ DataType["AudioComponent"] = "AudioComponent";
4365
4364
  // Non-EffectObject
4366
4365
  DataType["TimelineClip"] = "TimelineClip";
4367
4366
  })(DataType || (DataType = {}));
@@ -4451,10 +4450,28 @@ var VertexBufferSemantic;
4451
4450
 
4452
4451
  var BuiltinObjectGUID = {
4453
4452
  WhiteTexture: "whitetexture00000000000000000000",
4453
+ TransparentTexture: "transparenttexture00000000000000000000",
4454
4454
  PBRShader: "pbr00000000000000000000000000000",
4455
4455
  UnlitShader: "unlit000000000000000000000000000"
4456
4456
  };
4457
4457
 
4458
+ /**
4459
+ * 动态换图类型
4460
+ * @since 1.1.0
4461
+ */ var BackgroundType;
4462
+ (function(BackgroundType) {
4463
+ BackgroundType["video"] = "video";
4464
+ BackgroundType["image"] = "image";
4465
+ })(BackgroundType || (BackgroundType = {}));
4466
+ /**
4467
+ * 多媒体资源类型
4468
+ * @since 2.1.0
4469
+ */ var MultimediaType;
4470
+ (function(MultimediaType) {
4471
+ MultimediaType["video"] = "video";
4472
+ MultimediaType["audio"] = "audio";
4473
+ })(MultimediaType || (MultimediaType = {}));
4474
+
4458
4475
  var index$1 = /*#__PURE__*/Object.freeze({
4459
4476
  __proto__: null,
4460
4477
  get RenderLevel () { return RenderLevel; },
@@ -4471,7 +4488,6 @@ var index$1 = /*#__PURE__*/Object.freeze({
4471
4488
  get RenderType () { return RenderType; },
4472
4489
  get RenderFace () { return RenderFace; },
4473
4490
  get CameraClipMode () { return CameraClipMode; },
4474
- get BackgroundType () { return BackgroundType; },
4475
4491
  END_BEHAVIOR_DESTROY: END_BEHAVIOR_DESTROY,
4476
4492
  END_BEHAVIOR_PAUSE: END_BEHAVIOR_PAUSE,
4477
4493
  END_BEHAVIOR_FORWARD: END_BEHAVIOR_FORWARD,
@@ -4505,7 +4521,9 @@ var index$1 = /*#__PURE__*/Object.freeze({
4505
4521
  get VertexFormatType () { return VertexFormatType; },
4506
4522
  get IndexFormatType () { return IndexFormatType; },
4507
4523
  get VertexBufferSemantic () { return VertexBufferSemantic; },
4508
- BuiltinObjectGUID: BuiltinObjectGUID
4524
+ BuiltinObjectGUID: BuiltinObjectGUID,
4525
+ get BackgroundType () { return BackgroundType; },
4526
+ get MultimediaType () { return MultimediaType; }
4509
4527
  });
4510
4528
 
4511
4529
  var decoratorInitialStore = new Map();
@@ -8168,11 +8186,11 @@ function _loadMedia() {
8168
8186
  return _loadMedia.apply(this, arguments);
8169
8187
  }
8170
8188
 
8171
- function deserializeMipmapTexture(textureOptions, bins, engine) {
8189
+ function deserializeMipmapTexture(textureOptions, bins, assets) {
8172
8190
  return _deserializeMipmapTexture.apply(this, arguments);
8173
8191
  }
8174
8192
  function _deserializeMipmapTexture() {
8175
- _deserializeMipmapTexture = _async_to_generator(function(textureOptions, bins, engine, files) {
8193
+ _deserializeMipmapTexture = _async_to_generator(function(textureOptions, bins, assets, files) {
8176
8194
  var mipmaps, target, jobs, loadedMipmaps, mipmaps1, target1, jobs1, loadedMipmaps1, bin;
8177
8195
  return __generator(this, function(_state) {
8178
8196
  switch(_state.label){
@@ -8188,9 +8206,8 @@ function _deserializeMipmapTexture() {
8188
8206
  // @ts-expect-error
8189
8207
  if (pointer.id) {
8190
8208
  // @ts-expect-error
8191
- var loadedImageAsset = engine.assetLoader.loadGUID(pointer.id);
8192
- // @ts-expect-error
8193
- return loadedImageAsset.data;
8209
+ var loadedImage = assets[pointer.id];
8210
+ return loadedImage;
8194
8211
  } else {
8195
8212
  return loadMipmapImage(pointer, bins);
8196
8213
  }
@@ -8427,7 +8444,7 @@ var sourceOptions = {
8427
8444
  };
8428
8445
  function generateWhiteTexture(engine) {
8429
8446
  return Texture.create(engine, _extends({
8430
- id: "whitetexture00000000000000000000",
8447
+ id: BuiltinObjectGUID.WhiteTexture,
8431
8448
  data: {
8432
8449
  width: 1,
8433
8450
  height: 1,
@@ -8443,7 +8460,7 @@ function generateWhiteTexture(engine) {
8443
8460
  }
8444
8461
  function generateTransparentTexture(engine) {
8445
8462
  return Texture.create(engine, _extends({
8446
- id: "transparenttexture00000000000000000000",
8463
+ id: BuiltinObjectGUID.TransparentTexture,
8447
8464
  data: {
8448
8465
  width: 1,
8449
8466
  height: 1,
@@ -10802,7 +10819,7 @@ var Shader = /*#__PURE__*/ function(EffectsObject) {
10802
10819
  return Shader;
10803
10820
  }(EffectsObject);
10804
10821
  Shader = __decorate([
10805
- effectsClass("Shader")
10822
+ effectsClass(DataType.Shader)
10806
10823
  ], Shader);
10807
10824
 
10808
10825
  var EFFECTS_COPY_MESH_NAME = "effects-internal-copy";
@@ -12887,7 +12904,7 @@ var GPUCapability = /*#__PURE__*/ function() {
12887
12904
  shaderTextureLod: level2 || !!gl.getExtension("EXT_shader_texture_lod"),
12888
12905
  instanceDraw: level2 || !!gl.getExtension("ANGLE_instanced_arrays"),
12889
12906
  drawBuffers: level2 || !!this.drawBufferExtension,
12890
- asyncShaderCompile: !!gl.getExtension("KHR_parallel_shader_compile"),
12907
+ asyncShaderCompile: !!this.glAsyncCompileExt,
12891
12908
  intIndexElementBuffer: !!gl.getExtension("OES_element_index_uint"),
12892
12909
  standardDerivatives: level2 || !!gl.getExtension("OES_standard_derivatives"),
12893
12910
  readableDepthStencilTextures: level2 || !!depthTextureExtension,
@@ -15791,7 +15808,7 @@ function getGeometryTriangles(geometry, options) {
15791
15808
  */ function getGeometriesByShapeData(shape) {
15792
15809
  var geometries = [];
15793
15810
  // 该版本的单个形状数据可以包含多个形状,可以加个埋点,五福之后没有就可以下掉
15794
- if (shape.gs) {
15811
+ if ("gs" in shape) {
15795
15812
  shape.gs.forEach(function(gs) {
15796
15813
  geometries.push({
15797
15814
  p: [
@@ -15804,7 +15821,7 @@ function getGeometryTriangles(geometry, options) {
15804
15821
  ]
15805
15822
  });
15806
15823
  });
15807
- } else if (shape.g) {
15824
+ } else if ("g" in shape) {
15808
15825
  geometries.push({
15809
15826
  p: [
15810
15827
  ValueType.SHAPE_POINTS,
@@ -16803,6 +16820,7 @@ var ParticleSystem = /*#__PURE__*/ function(Component) {
16803
16820
  });
16804
16821
  this.frozen = false;
16805
16822
  this.ended = false;
16823
+ this.destroyed = false;
16806
16824
  };
16807
16825
  _proto.update = function update(delta) {
16808
16826
  var _this = this;
@@ -19091,7 +19109,7 @@ var TransformPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
19091
19109
  return TransformPlayableAsset;
19092
19110
  }(PlayableAsset);
19093
19111
  TransformPlayableAsset = __decorate([
19094
- effectsClass("TransformPlayableAsset")
19112
+ effectsClass(DataType.TransformPlayableAsset)
19095
19113
  ], TransformPlayableAsset);
19096
19114
  /**
19097
19115
  * @since 2.0.0
@@ -19122,7 +19140,7 @@ var ActivationPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
19122
19140
  return ActivationPlayableAsset;
19123
19141
  }(PlayableAsset);
19124
19142
  ActivationPlayableAsset = __decorate([
19125
- effectsClass("ActivationPlayableAsset")
19143
+ effectsClass(DataType.ActivationPlayableAsset)
19126
19144
  ], ActivationPlayableAsset);
19127
19145
  var AnimationClip = /*#__PURE__*/ function(EffectsObject) {
19128
19146
  _inherits(AnimationClip, EffectsObject);
@@ -19365,7 +19383,7 @@ __decorate([
19365
19383
  serialize()
19366
19384
  ], TrackAsset.prototype, "children", void 0);
19367
19385
  TrackAsset = __decorate([
19368
- effectsClass("TrackAsset")
19386
+ effectsClass(DataType.TrackAsset)
19369
19387
  ], TrackAsset);
19370
19388
  var TrackType;
19371
19389
  (function(TrackType) {
@@ -19460,7 +19478,7 @@ var ObjectBindingTrack = /*#__PURE__*/ function(TrackAsset1) {
19460
19478
  return ObjectBindingTrack;
19461
19479
  }(TrackAsset);
19462
19480
  ObjectBindingTrack = __decorate([
19463
- effectsClass("ObjectBindingTrack")
19481
+ effectsClass(DataType.ObjectBindingTrack)
19464
19482
  ], ObjectBindingTrack);
19465
19483
 
19466
19484
  var TransformTrack = /*#__PURE__*/ function(TrackAsset) {
@@ -19471,7 +19489,7 @@ var TransformTrack = /*#__PURE__*/ function(TrackAsset) {
19471
19489
  return TransformTrack;
19472
19490
  }(TrackAsset);
19473
19491
  TransformTrack = __decorate([
19474
- effectsClass("TransformTrack")
19492
+ effectsClass(DataType.TransformTrack)
19475
19493
  ], TransformTrack);
19476
19494
 
19477
19495
  var ActivationMixerPlayable = /*#__PURE__*/ function(Playable) {
@@ -19532,7 +19550,7 @@ var ActivationTrack = /*#__PURE__*/ function(TrackAsset) {
19532
19550
  return ActivationTrack;
19533
19551
  }(TrackAsset);
19534
19552
  ActivationTrack = __decorate([
19535
- effectsClass("ActivationTrack")
19553
+ effectsClass(DataType.ActivationTrack)
19536
19554
  ], ActivationTrack);
19537
19555
 
19538
19556
  var SpriteColorTrack = /*#__PURE__*/ function(TrackAsset) {
@@ -19543,7 +19561,7 @@ var SpriteColorTrack = /*#__PURE__*/ function(TrackAsset) {
19543
19561
  return SpriteColorTrack;
19544
19562
  }(TrackAsset);
19545
19563
  SpriteColorTrack = __decorate([
19546
- effectsClass("SpriteColorTrack")
19564
+ effectsClass(DataType.SpriteColorTrack)
19547
19565
  ], SpriteColorTrack);
19548
19566
 
19549
19567
  var TimelineAsset = /*#__PURE__*/ function(PlayableAsset) {
@@ -19580,7 +19598,7 @@ __decorate([
19580
19598
  serialize()
19581
19599
  ], TimelineAsset.prototype, "tracks", void 0);
19582
19600
  TimelineAsset = __decorate([
19583
- effectsClass("TimelineAsset")
19601
+ effectsClass(DataType.TimelineAsset)
19584
19602
  ], TimelineAsset);
19585
19603
  var TimelinePlayable = /*#__PURE__*/ function(Playable) {
19586
19604
  _inherits(TimelinePlayable, Playable);
@@ -19945,7 +19963,7 @@ var SubCompositionTrack = /*#__PURE__*/ function(TrackAsset) {
19945
19963
  return SubCompositionTrack;
19946
19964
  }(TrackAsset);
19947
19965
  SubCompositionTrack = __decorate([
19948
- effectsClass("SubCompositionTrack")
19966
+ effectsClass(DataType.SubCompositionTrack)
19949
19967
  ], SubCompositionTrack);
19950
19968
 
19951
19969
  var SubCompositionClipPlayable = /*#__PURE__*/ function(Playable) {
@@ -19975,7 +19993,7 @@ var SubCompositionPlayableAsset = /*#__PURE__*/ function(PlayableAsset) {
19975
19993
  return SubCompositionPlayableAsset;
19976
19994
  }(PlayableAsset);
19977
19995
  SubCompositionPlayableAsset = __decorate([
19978
- effectsClass("SubCompositionPlayableAsset")
19996
+ effectsClass(DataType.SubCompositionPlayableAsset)
19979
19997
  ], SubCompositionPlayableAsset);
19980
19998
 
19981
19999
  function _possible_constructor_return(self, call) {
@@ -20795,6 +20813,1652 @@ PostProcessVolume = __decorate([
20795
20813
  effectsClass("PostProcessVolume")
20796
20814
  ], PostProcessVolume);
20797
20815
 
20816
+ /**
20817
+ * A class to define a shape via user defined coordinates.
20818
+ */ var Polygon = /*#__PURE__*/ function() {
20819
+ function Polygon() {
20820
+ for(var _len = arguments.length, points = new Array(_len), _key = 0; _key < _len; _key++){
20821
+ points[_key] = arguments[_key];
20822
+ }
20823
+ /** An array of the points of this polygon. */ this.points = [];
20824
+ /** `false` after moveTo, `true` after `closePath`. In all other cases it is `true`. */ this.closePath = false;
20825
+ var flat = Array.isArray(points[0]) ? points[0] : points;
20826
+ // if this is an array of points, convert it to a flat array of numbers
20827
+ if (typeof flat[0] !== "number") {
20828
+ var p = [];
20829
+ for(var i = 0, il = flat.length; i < il; i++){
20830
+ p.push(flat[i].x, flat[i].y);
20831
+ }
20832
+ flat = p;
20833
+ }
20834
+ this.points = flat;
20835
+ this.closePath = true;
20836
+ }
20837
+ var _proto = Polygon.prototype;
20838
+ /**
20839
+ * Creates a clone of this polygon.
20840
+ * @returns - A copy of the polygon.
20841
+ */ _proto.clone = function clone() {
20842
+ var points = this.points.slice();
20843
+ var polygon = new Polygon(points);
20844
+ polygon.closePath = this.closePath;
20845
+ return polygon;
20846
+ };
20847
+ /**
20848
+ * Checks whether the x and y coordinates passed to this function are contained within this polygon.
20849
+ * @param x - The X coordinate of the point to test.
20850
+ * @param y - The Y coordinate of the point to test.
20851
+ * @returns - Whether the x/y coordinates are within this polygon.
20852
+ */ _proto.contains = function contains(x, y) {
20853
+ var inside = false;
20854
+ // use some raycasting to test hits
20855
+ // https://github.com/substack/point-in-polygon/blob/master/index.js
20856
+ var length = this.points.length / 2;
20857
+ for(var i = 0, j = length - 1; i < length; j = i++){
20858
+ var xi = this.points[i * 2];
20859
+ var yi = this.points[i * 2 + 1];
20860
+ var xj = this.points[j * 2];
20861
+ var yj = this.points[j * 2 + 1];
20862
+ var intersect = yi > y !== yj > y && x < (xj - xi) * ((y - yi) / (yj - yi)) + xi;
20863
+ if (intersect) {
20864
+ inside = !inside;
20865
+ }
20866
+ }
20867
+ return inside;
20868
+ };
20869
+ /**
20870
+ * Copies another polygon to this one.
20871
+ * @param polygon - The polygon to copy from.
20872
+ * @returns Returns itself.
20873
+ */ _proto.copyFrom = function copyFrom(polygon) {
20874
+ this.points = polygon.points.slice();
20875
+ this.closePath = polygon.closePath;
20876
+ return this;
20877
+ };
20878
+ /**
20879
+ * Copies this polygon to another one.
20880
+ * @param polygon - The polygon to copy to.
20881
+ * @returns Returns given parameter.
20882
+ */ _proto.copyTo = function copyTo(polygon) {
20883
+ polygon.copyFrom(this);
20884
+ return polygon;
20885
+ };
20886
+ _create_class(Polygon, [
20887
+ {
20888
+ key: "lastX",
20889
+ get: /**
20890
+ * Get the last X coordinate of the polygon
20891
+ * @readonly
20892
+ */ function get() {
20893
+ return this.points[this.points.length - 2];
20894
+ }
20895
+ },
20896
+ {
20897
+ key: "lastY",
20898
+ get: /**
20899
+ * Get the last Y coordinate of the polygon
20900
+ * @readonly
20901
+ */ function get() {
20902
+ return this.points[this.points.length - 1];
20903
+ }
20904
+ },
20905
+ {
20906
+ key: "x",
20907
+ get: /**
20908
+ * Get the first X coordinate of the polygon
20909
+ * @readonly
20910
+ */ function get() {
20911
+ return this.points[this.points.length - 2];
20912
+ }
20913
+ },
20914
+ {
20915
+ key: "y",
20916
+ get: /**
20917
+ * Get the first Y coordinate of the polygon
20918
+ * @readonly
20919
+ */ function get() {
20920
+ return this.points[this.points.length - 1];
20921
+ }
20922
+ }
20923
+ ]);
20924
+ return Polygon;
20925
+ }();
20926
+
20927
+ // thanks to https://github.com/mattdesl/adaptive-bezier-curve
20928
+ // for the original code!
20929
+ var RECURSION_LIMIT = 8;
20930
+ var FLT_EPSILON = 1.19209290e-7;
20931
+ var PATH_DISTANCE_EPSILON = 1.0;
20932
+ var defaultBezierSmoothness = 0.5;
20933
+ function buildAdaptiveBezier(points, sX, sY, cp1x, cp1y, cp2x, cp2y, eX, eY, smoothness) {
20934
+ // TODO expose as a parameter
20935
+ var scale = 5;
20936
+ var smoothing = Math.min(0.99, Math.max(0, smoothness != null ? smoothness : defaultBezierSmoothness));
20937
+ var distanceTolerance = (PATH_DISTANCE_EPSILON - smoothing) / scale;
20938
+ distanceTolerance *= distanceTolerance;
20939
+ begin(sX, sY, cp1x, cp1y, cp2x, cp2y, eX, eY, points, distanceTolerance);
20940
+ return points;
20941
+ }
20942
+ //// Based on:
20943
+ //// https://github.com/pelson/antigrain/blob/master/agg-2.4/src/agg_curves.cpp
20944
+ function begin(sX, sY, cp1x, cp1y, cp2x, cp2y, eX, eY, points, distanceTolerance) {
20945
+ // dont need to actually ad this!
20946
+ // points.push(sX, sY);
20947
+ recursive(sX, sY, cp1x, cp1y, cp2x, cp2y, eX, eY, points, distanceTolerance, 0);
20948
+ points.push(eX, eY);
20949
+ }
20950
+ // eslint-disable-next-line max-params
20951
+ function recursive(x1, y1, x2, y2, x3, y3, x4, y4, points, distanceTolerance, level) {
20952
+ if (level > RECURSION_LIMIT) {
20953
+ return;
20954
+ }
20955
+ // Calculate all the mid-points of the line segments
20956
+ // ----------------------
20957
+ var x12 = (x1 + x2) / 2;
20958
+ var y12 = (y1 + y2) / 2;
20959
+ var x23 = (x2 + x3) / 2;
20960
+ var y23 = (y2 + y3) / 2;
20961
+ var x34 = (x3 + x4) / 2;
20962
+ var y34 = (y3 + y4) / 2;
20963
+ var x123 = (x12 + x23) / 2;
20964
+ var y123 = (y12 + y23) / 2;
20965
+ var x234 = (x23 + x34) / 2;
20966
+ var y234 = (y23 + y34) / 2;
20967
+ var x1234 = (x123 + x234) / 2;
20968
+ var y1234 = (y123 + y234) / 2;
20969
+ if (level > 0) {
20970
+ // Try to approximate the full cubic curve by a single straight line
20971
+ // ------------------
20972
+ var dx = x4 - x1;
20973
+ var dy = y4 - y1;
20974
+ var d2 = Math.abs((x2 - x4) * dy - (y2 - y4) * dx);
20975
+ var d3 = Math.abs((x3 - x4) * dy - (y3 - y4) * dx);
20976
+ if (d2 > FLT_EPSILON && d3 > FLT_EPSILON) {
20977
+ // Regular care
20978
+ // -----------------
20979
+ if ((d2 + d3) * (d2 + d3) <= distanceTolerance * (dx * dx + dy * dy)) {
20980
+ // If the curvature doesn't exceed the distanceTolerance value
20981
+ // we tend to finish subdivisions.
20982
+ // ----------------------
20983
+ {
20984
+ points.push(x1234, y1234);
20985
+ return;
20986
+ }
20987
+ }
20988
+ } else if (d2 > FLT_EPSILON) {
20989
+ // p1,p3,p4 are collinear, p2 is considerable
20990
+ // ----------------------
20991
+ if (d2 * d2 <= distanceTolerance * (dx * dx + dy * dy)) {
20992
+ {
20993
+ points.push(x1234, y1234);
20994
+ return;
20995
+ }
20996
+ }
20997
+ } else if (d3 > FLT_EPSILON) {
20998
+ // p1,p2,p4 are collinear, p3 is considerable
20999
+ // ----------------------
21000
+ if (d3 * d3 <= distanceTolerance * (dx * dx + dy * dy)) {
21001
+ {
21002
+ points.push(x1234, y1234);
21003
+ return;
21004
+ }
21005
+ }
21006
+ } else {
21007
+ // Collinear case
21008
+ // -----------------
21009
+ dx = x1234 - (x1 + x4) / 2;
21010
+ dy = y1234 - (y1 + y4) / 2;
21011
+ if (dx * dx + dy * dy <= distanceTolerance) {
21012
+ points.push(x1234, y1234);
21013
+ return;
21014
+ }
21015
+ }
21016
+ }
21017
+ // Continue subdivision
21018
+ // ----------------------
21019
+ recursive(x1, y1, x12, y12, x123, y123, x1234, y1234, points, distanceTolerance, level + 1);
21020
+ recursive(x1234, y1234, x234, y234, x34, y34, x4, y4, points, distanceTolerance, level + 1);
21021
+ }
21022
+
21023
+ var ShapePath = /*#__PURE__*/ function() {
21024
+ function ShapePath(graphicsPath) {
21025
+ this.graphicsPath = graphicsPath;
21026
+ this.currentPoly = null;
21027
+ this.shapePrimitives = [];
21028
+ }
21029
+ var _proto = ShapePath.prototype;
21030
+ /** Builds the path. */ _proto.buildPath = function buildPath() {
21031
+ this.currentPoly = null;
21032
+ this.shapePrimitives.length = 0;
21033
+ var path = this.graphicsPath;
21034
+ for(var _iterator = _create_for_of_iterator_helper_loose(path.instructions), _step; !(_step = _iterator()).done;){
21035
+ var instruction = _step.value;
21036
+ var action = instruction.action;
21037
+ var data = instruction.data;
21038
+ switch(action){
21039
+ case "bezierCurveTo":
21040
+ {
21041
+ this.bezierCurveTo(data[0], data[1], data[2], data[3], data[4], data[5], data[6]);
21042
+ break;
21043
+ }
21044
+ case "moveTo":
21045
+ {
21046
+ this.moveTo(data[0], data[1]);
21047
+ break;
21048
+ }
21049
+ }
21050
+ }
21051
+ this.endPoly();
21052
+ };
21053
+ /**
21054
+ * Adds a cubic Bezier curve to the path.
21055
+ * It requires three points: the first two are control points and the third one is the end point.
21056
+ * The starting point is the last point in the current path.
21057
+ * @param cp1x - The x-coordinate of the first control point.
21058
+ * @param cp1y - The y-coordinate of the first control point.
21059
+ * @param cp2x - The x-coordinate of the second control point.
21060
+ * @param cp2y - The y-coordinate of the second control point.
21061
+ * @param x - The x-coordinate of the end point.
21062
+ * @param y - The y-coordinate of the end point.
21063
+ * @param smoothness - Optional parameter to adjust the smoothness of the curve.
21064
+ * @returns The instance of the current object for chaining.
21065
+ */ _proto.bezierCurveTo = function bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y, smoothness) {
21066
+ this.ensurePoly();
21067
+ var currentPoly = this.currentPoly;
21068
+ buildAdaptiveBezier(currentPoly.points, currentPoly.lastX, currentPoly.lastY, cp1x, cp1y, cp2x, cp2y, x, y, smoothness);
21069
+ return this;
21070
+ };
21071
+ _proto.moveTo = function moveTo(x, y) {
21072
+ this.startPoly(x, y);
21073
+ return this;
21074
+ };
21075
+ /**
21076
+ * Starts a new polygon path from the specified starting point.
21077
+ * This method initializes a new polygon or ends the current one if it exists.
21078
+ * @param x - The x-coordinate of the starting point of the new polygon.
21079
+ * @param y - The y-coordinate of the starting point of the new polygon.
21080
+ * @returns The instance of the current object for chaining.
21081
+ */ _proto.startPoly = function startPoly(x, y) {
21082
+ var currentPoly = this.currentPoly;
21083
+ if (currentPoly) {
21084
+ this.endPoly();
21085
+ }
21086
+ currentPoly = new Polygon();
21087
+ currentPoly.points.push(x, y);
21088
+ this.currentPoly = currentPoly;
21089
+ return this;
21090
+ };
21091
+ /**
21092
+ * Ends the current polygon path. If `closePath` is set to true,
21093
+ * the path is closed by connecting the last point to the first one.
21094
+ * This method finalizes the current polygon and prepares it for drawing or adding to the shape primitives.
21095
+ * @param closePath - A boolean indicating whether to close the polygon by connecting the last point
21096
+ * back to the starting point. False by default.
21097
+ * @returns The instance of the current object for chaining.
21098
+ */ _proto.endPoly = function endPoly(closePath) {
21099
+ if (closePath === void 0) closePath = false;
21100
+ var shape = this.currentPoly;
21101
+ if (shape && shape.points.length > 2) {
21102
+ shape.closePath = closePath;
21103
+ this.shapePrimitives.push({
21104
+ shape: shape
21105
+ });
21106
+ }
21107
+ this.currentPoly = null;
21108
+ return this;
21109
+ };
21110
+ _proto.ensurePoly = function ensurePoly(start) {
21111
+ if (this.currentPoly) {
21112
+ return;
21113
+ }
21114
+ this.currentPoly = new Polygon();
21115
+ this.currentPoly.points.push(0, 0);
21116
+ };
21117
+ return ShapePath;
21118
+ }();
21119
+
21120
+ var GraphicsPath = /*#__PURE__*/ function() {
21121
+ function GraphicsPath() {
21122
+ this.instructions = [];
21123
+ this.dirty = false;
21124
+ }
21125
+ var _proto = GraphicsPath.prototype;
21126
+ /**
21127
+ * Adds a cubic Bezier curve to the path.
21128
+ * It requires three points: the first two are control points and the third one is the end point.
21129
+ * The starting point is the last point in the current path.
21130
+ * @param cp1x - The x-coordinate of the first control point.
21131
+ * @param cp1y - The y-coordinate of the first control point.
21132
+ * @param cp2x - The x-coordinate of the second control point.
21133
+ * @param cp2y - The y-coordinate of the second control point.
21134
+ * @param x - The x-coordinate of the end point.
21135
+ * @param y - The y-coordinate of the end point.
21136
+ * @param smoothness - Optional parameter to adjust the smoothness of the curve.
21137
+ * @returns The instance of the current object for chaining.
21138
+ */ _proto.bezierCurveTo = function bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y, smoothness) {
21139
+ this.instructions.push({
21140
+ action: "bezierCurveTo",
21141
+ data: [
21142
+ cp1x,
21143
+ cp1y,
21144
+ cp2x,
21145
+ cp2y,
21146
+ x,
21147
+ y,
21148
+ smoothness
21149
+ ]
21150
+ });
21151
+ this.dirty = true;
21152
+ return this;
21153
+ };
21154
+ _proto.moveTo = function moveTo(x, y) {
21155
+ this.instructions.push({
21156
+ action: "moveTo",
21157
+ data: [
21158
+ x,
21159
+ y
21160
+ ]
21161
+ });
21162
+ this.dirty = true;
21163
+ return this;
21164
+ };
21165
+ _proto.clear = function clear() {
21166
+ this.instructions.length = 0;
21167
+ this.dirty = true;
21168
+ return this;
21169
+ };
21170
+ _create_class(GraphicsPath, [
21171
+ {
21172
+ key: "shapePath",
21173
+ get: /**
21174
+ * Provides access to the internal shape path, ensuring it is up-to-date with the current instructions.
21175
+ * @returns The `ShapePath` instance associated with this `GraphicsPath`.
21176
+ */ function get() {
21177
+ if (!this._shapePath) {
21178
+ this._shapePath = new ShapePath(this);
21179
+ }
21180
+ if (this.dirty) {
21181
+ this.dirty = false;
21182
+ this._shapePath.buildPath();
21183
+ }
21184
+ return this._shapePath;
21185
+ }
21186
+ }
21187
+ ]);
21188
+ return GraphicsPath;
21189
+ }();
21190
+
21191
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
21192
+
21193
+ var libtess_min = {exports: {}};
21194
+
21195
+ /*
21196
+
21197
+ Copyright 2000, Silicon Graphics, Inc. All Rights Reserved.
21198
+ Copyright 2015, Google Inc. All Rights Reserved.
21199
+
21200
+ Permission is hereby granted, free of charge, to any person obtaining a copy
21201
+ of this software and associated documentation files (the "Software"), to
21202
+ deal in the Software without restriction, including without limitation the
21203
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
21204
+ sell copies of the Software, and to permit persons to whom the Software is
21205
+ furnished to do so, subject to the following conditions:
21206
+
21207
+ The above copyright notice including the dates of first publication and
21208
+ either this permission notice or a reference to http://oss.sgi.com/projects/FreeB/
21209
+ shall be included in all copies or substantial portions of the Software.
21210
+
21211
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21212
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21213
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21214
+ SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21215
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
21216
+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21217
+
21218
+ Original Code. The Original Code is: OpenGL Sample Implementation,
21219
+ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
21220
+ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
21221
+ Copyright in any portions created by third parties is as indicated
21222
+ elsewhere herein. All Rights Reserved.
21223
+ */
21224
+
21225
+ (function (module) {
21226
+ var n;
21227
+ function t(a, b) {
21228
+ return a.b === b.b && a.a === b.a;
21229
+ }
21230
+ function u(a, b) {
21231
+ return a.b < b.b || a.b === b.b && a.a <= b.a;
21232
+ }
21233
+ function v(a, b, c) {
21234
+ var d = b.b - a.b, e = c.b - b.b;
21235
+ return 0 < d + e ? d < e ? b.a - a.a + d / (d + e) * (a.a - c.a) : b.a - c.a + e / (d + e) * (c.a - a.a) : 0;
21236
+ }
21237
+ function x(a, b, c) {
21238
+ var d = b.b - a.b, e = c.b - b.b;
21239
+ return 0 < d + e ? (b.a - c.a) * d + (b.a - a.a) * e : 0;
21240
+ }
21241
+ function z(a, b) {
21242
+ return a.a < b.a || a.a === b.a && a.b <= b.b;
21243
+ }
21244
+ function aa(a, b, c) {
21245
+ var d = b.a - a.a, e = c.a - b.a;
21246
+ return 0 < d + e ? d < e ? b.b - a.b + d / (d + e) * (a.b - c.b) : b.b - c.b + e / (d + e) * (c.b - a.b) : 0;
21247
+ }
21248
+ function ba(a, b, c) {
21249
+ var d = b.a - a.a, e = c.a - b.a;
21250
+ return 0 < d + e ? (b.b - c.b) * d + (b.b - a.b) * e : 0;
21251
+ }
21252
+ function ca(a) {
21253
+ return u(a.b.a, a.a);
21254
+ }
21255
+ function da(a) {
21256
+ return u(a.a, a.b.a);
21257
+ }
21258
+ function A(a, b, c, d) {
21259
+ a = 0 > a ? 0 : a;
21260
+ c = 0 > c ? 0 : c;
21261
+ return a <= c ? 0 === c ? (b + d) / 2 : b + a / (a + c) * (d - b) : d + c / (a + c) * (b - d);
21262
+ }
21263
+ function ea(a) {
21264
+ var b = B(a.b);
21265
+ C(b, a.c);
21266
+ C(b.b, a.c);
21267
+ D(b, a.a);
21268
+ return b;
21269
+ }
21270
+ function E(a, b) {
21271
+ var c = !1, d = !1;
21272
+ a !== b && (b.a !== a.a && (d = !0, F(b.a, a.a)), b.d !== a.d && (c = !0, G(b.d, a.d)), H(b, a), d || (C(b, a.a), a.a.c = a), c || (D(b, a.d), a.d.a = a));
21273
+ }
21274
+ function I(a) {
21275
+ var b = a.b, c = !1;
21276
+ a.d !== a.b.d && (c = !0, G(a.d, a.b.d));
21277
+ a.c === a ? F(a.a, null) : (a.b.d.a = J(a), a.a.c = a.c, H(a, J(a)), c || D(a, a.d));
21278
+ b.c === b ? (F(b.a, null), G(b.d, null)) : (a.d.a = J(b), b.a.c = b.c, H(b, J(b)));
21279
+ fa(a);
21280
+ }
21281
+ function K(a) {
21282
+ var b = B(a), c = b.b;
21283
+ H(b, a.e);
21284
+ b.a = a.b.a;
21285
+ C(c, b.a);
21286
+ b.d = c.d = a.d;
21287
+ b = b.b;
21288
+ H(a.b, J(a.b));
21289
+ H(a.b, b);
21290
+ a.b.a = b.a;
21291
+ b.b.a.c = b.b;
21292
+ b.b.d = a.b.d;
21293
+ b.f = a.f;
21294
+ b.b.f = a.b.f;
21295
+ return b;
21296
+ }
21297
+ function L(a, b) {
21298
+ var c = !1, d = B(a), e = d.b;
21299
+ b.d !== a.d && (c = !0, G(b.d, a.d));
21300
+ H(d, a.e);
21301
+ H(e, b);
21302
+ d.a = a.b.a;
21303
+ e.a = b.a;
21304
+ d.d = e.d = a.d;
21305
+ a.d.a = e;
21306
+ c || D(d, a.d);
21307
+ return d;
21308
+ }
21309
+ function B(a) {
21310
+ var b = new M, c = new M, d = a.b.h;
21311
+ c.h = d;
21312
+ d.b.h = b;
21313
+ b.h = a;
21314
+ a.b.h = c;
21315
+ b.b = c;
21316
+ b.c = b;
21317
+ b.e = c;
21318
+ c.b = b;
21319
+ c.c = c;
21320
+ return c.e = b;
21321
+ }
21322
+ function H(a, b) {
21323
+ var c = a.c, d = b.c;
21324
+ c.b.e = b;
21325
+ d.b.e = a;
21326
+ a.c = d;
21327
+ b.c = c;
21328
+ }
21329
+ function C(a, b) {
21330
+ var c = b.f, d = new N(b, c);
21331
+ c.e = d;
21332
+ b.f = d;
21333
+ c = d.c = a;
21334
+ do c.a = d, c = c.c;
21335
+ while (c !== a);
21336
+ }
21337
+ function D(a, b) {
21338
+ var c = b.d, d = new ga(b, c);
21339
+ c.b = d;
21340
+ b.d = d;
21341
+ d.a = a;
21342
+ d.c = b.c;
21343
+ c = a;
21344
+ do c.d = d, c = c.e;
21345
+ while (c !== a);
21346
+ }
21347
+ function fa(a) {
21348
+ var b = a.h;
21349
+ a = a.b.h;
21350
+ b.b.h = a;
21351
+ a.b.h = b;
21352
+ }
21353
+ function F(a, b) {
21354
+ var c = a.c, d = c;
21355
+ do d.a = b, d = d.c;
21356
+ while (d !== c);
21357
+ c = a.f;
21358
+ d = a.e;
21359
+ d.f = c;
21360
+ c.e = d;
21361
+ }
21362
+ function G(a, b) {
21363
+ var c = a.a, d = c;
21364
+ do d.d = b, d = d.e;
21365
+ while (d !== c);
21366
+ c = a.d;
21367
+ d = a.b;
21368
+ d.d = c;
21369
+ c.b = d;
21370
+ }
21371
+ function ha(a) {
21372
+ var b = 0;
21373
+ Math.abs(a[1]) > Math.abs(a[0]) && (b = 1);
21374
+ Math.abs(a[2]) > Math.abs(a[b]) && (b = 2);
21375
+ return b;
21376
+ }
21377
+ var O = 4 * 1E150;
21378
+ function P(a, b) {
21379
+ a.f += b.f;
21380
+ a.b.f += b.b.f;
21381
+ }
21382
+ function ia(a, b, c) {
21383
+ a = a.a;
21384
+ b = b.a;
21385
+ c = c.a;
21386
+ if (b.b.a === a) return c.b.a === a ? u(b.a, c.a) ? 0 >= x(c.b.a, b.a, c.a) : 0 <= x(b.b.a, c.a, b.a) : 0 >= x(c.b.a, a, c.a);
21387
+ if (c.b.a === a) return 0 <= x(b.b.a, a, b.a);
21388
+ b = v(b.b.a, a, b.a);
21389
+ a = v(c.b.a, a, c.a);
21390
+ return b >= a;
21391
+ }
21392
+ function Q(a) {
21393
+ a.a.i = null;
21394
+ var b = a.e;
21395
+ b.a.c = b.c;
21396
+ b.c.a = b.a;
21397
+ a.e = null;
21398
+ }
21399
+ function ja(a, b) {
21400
+ I(a.a);
21401
+ a.c = !1;
21402
+ a.a = b;
21403
+ b.i = a;
21404
+ }
21405
+ function ka(a) {
21406
+ var b = a.a.a;
21407
+ do a = R(a);
21408
+ while (a.a.a === b);
21409
+ a.c && (b = L(S(a).a.b, a.a.e), ja(a, b), a = R(a));
21410
+ return a;
21411
+ }
21412
+ function la(a, b, c) {
21413
+ var d = new ma;
21414
+ d.a = c;
21415
+ d.e = na(a.f, b.e, d);
21416
+ return c.i = d;
21417
+ }
21418
+ function oa(a, b) {
21419
+ switch(a.s){
21420
+ case 100130:
21421
+ return 0 !== (b & 1);
21422
+ case 100131:
21423
+ return 0 !== b;
21424
+ case 100132:
21425
+ return 0 < b;
21426
+ case 100133:
21427
+ return 0 > b;
21428
+ case 100134:
21429
+ return 2 <= b || -2 >= b;
21430
+ }
21431
+ return !1;
21432
+ }
21433
+ function pa(a) {
21434
+ var b = a.a, c = b.d;
21435
+ c.c = a.d;
21436
+ c.a = b;
21437
+ Q(a);
21438
+ }
21439
+ function T(a, b, c) {
21440
+ a = b;
21441
+ for(b = b.a; a !== c;){
21442
+ a.c = !1;
21443
+ var d = S(a), e = d.a;
21444
+ if (e.a !== b.a) {
21445
+ if (!d.c) {
21446
+ pa(a);
21447
+ break;
21448
+ }
21449
+ e = L(b.c.b, e.b);
21450
+ ja(d, e);
21451
+ }
21452
+ b.c !== e && (E(J(e), e), E(b, e));
21453
+ pa(a);
21454
+ b = d.a;
21455
+ a = d;
21456
+ }
21457
+ return b;
21458
+ }
21459
+ function U(a, b, c, d, e, f) {
21460
+ var g = !0;
21461
+ do la(a, b, c.b), c = c.c;
21462
+ while (c !== d);
21463
+ for(null === e && (e = S(b).a.b.c);;){
21464
+ d = S(b);
21465
+ c = d.a.b;
21466
+ if (c.a !== e.a) break;
21467
+ c.c !== e && (E(J(c), c), E(J(e), c));
21468
+ d.f = b.f - c.f;
21469
+ d.d = oa(a, d.f);
21470
+ b.b = !0;
21471
+ !g && qa(a, b) && (P(c, e), Q(b), I(e));
21472
+ g = !1;
21473
+ b = d;
21474
+ e = c;
21475
+ }
21476
+ b.b = !0;
21477
+ f && ra(a, b);
21478
+ }
21479
+ function sa(a, b, c, d, e) {
21480
+ var f = [
21481
+ b.g[0],
21482
+ b.g[1],
21483
+ b.g[2]
21484
+ ];
21485
+ b.d = null;
21486
+ b.d = a.o ? a.o(f, c, d, a.c) || null : null;
21487
+ null === b.d && (e ? a.n || (V(a, 100156), a.n = !0) : b.d = c[0]);
21488
+ }
21489
+ function ta(a, b, c) {
21490
+ var d = [
21491
+ null,
21492
+ null,
21493
+ null,
21494
+ null
21495
+ ];
21496
+ d[0] = b.a.d;
21497
+ d[1] = c.a.d;
21498
+ sa(a, b.a, d, [
21499
+ .5,
21500
+ .5,
21501
+ 0,
21502
+ 0
21503
+ ], !1);
21504
+ E(b, c);
21505
+ }
21506
+ function ua(a, b, c, d, e) {
21507
+ var f = Math.abs(b.b - a.b) + Math.abs(b.a - a.a), g = Math.abs(c.b - a.b) + Math.abs(c.a - a.a), h = e + 1;
21508
+ d[e] = .5 * g / (f + g);
21509
+ d[h] = .5 * f / (f + g);
21510
+ a.g[0] += d[e] * b.g[0] + d[h] * c.g[0];
21511
+ a.g[1] += d[e] * b.g[1] + d[h] * c.g[1];
21512
+ a.g[2] += d[e] * b.g[2] + d[h] * c.g[2];
21513
+ }
21514
+ function qa(a, b) {
21515
+ var c = S(b), d = b.a, e = c.a;
21516
+ if (u(d.a, e.a)) {
21517
+ if (0 < x(e.b.a, d.a, e.a)) return !1;
21518
+ if (!t(d.a, e.a)) K(e.b), E(d, J(e)), b.b = c.b = !0;
21519
+ else if (d.a !== e.a) {
21520
+ var c = a.e, f = d.a.h;
21521
+ if (0 <= f) {
21522
+ var c = c.b, g = c.d, h = c.e, k = c.c, l = k[f];
21523
+ g[l] = g[c.a];
21524
+ k[g[l]] = l;
21525
+ l <= --c.a && (1 >= l ? W(c, l) : u(h[g[l >> 1]], h[g[l]]) ? W(c, l) : va(c, l));
21526
+ h[f] = null;
21527
+ k[f] = c.b;
21528
+ c.b = f;
21529
+ } else for(c.c[-(f + 1)] = null; 0 < c.a && null === c.c[c.d[c.a - 1]];)--c.a;
21530
+ ta(a, J(e), d);
21531
+ }
21532
+ } else {
21533
+ if (0 > x(d.b.a, e.a, d.a)) return !1;
21534
+ R(b).b = b.b = !0;
21535
+ K(d.b);
21536
+ E(J(e), d);
21537
+ }
21538
+ return !0;
21539
+ }
21540
+ function wa(a, b) {
21541
+ var c = S(b), d = b.a, e = c.a, f = d.a, g = e.a, h = d.b.a, k = e.b.a, l = new N;
21542
+ x(h, a.a, f);
21543
+ x(k, a.a, g);
21544
+ if (f === g || Math.min(f.a, h.a) > Math.max(g.a, k.a)) return !1;
21545
+ if (u(f, g)) {
21546
+ if (0 < x(k, f, g)) return !1;
21547
+ } else if (0 > x(h, g, f)) return !1;
21548
+ var r = h, p = f, q = k, y = g, m, w;
21549
+ u(r, p) || (m = r, r = p, p = m);
21550
+ u(q, y) || (m = q, q = y, y = m);
21551
+ u(r, q) || (m = r, r = q, q = m, m = p, p = y, y = m);
21552
+ u(q, p) ? u(p, y) ? (m = v(r, q, p), w = v(q, p, y), 0 > m + w && (m = -m, w = -w), l.b = A(m, q.b, w, p.b)) : (m = x(r, q, p), w = -x(r, y, p), 0 > m + w && (m = -m, w = -w), l.b = A(m, q.b, w, y.b)) : l.b = (q.b + p.b) / 2;
21553
+ z(r, p) || (m = r, r = p, p = m);
21554
+ z(q, y) || (m = q, q = y, y = m);
21555
+ z(r, q) || (m = r, r = q, q = m, m = p, p = y, y = m);
21556
+ z(q, p) ? z(p, y) ? (m = aa(r, q, p), w = aa(q, p, y), 0 > m + w && (m = -m, w = -w), l.a = A(m, q.a, w, p.a)) : (m = ba(r, q, p), w = -ba(r, y, p), 0 > m + w && (m = -m, w = -w), l.a = A(m, q.a, w, y.a)) : l.a = (q.a + p.a) / 2;
21557
+ u(l, a.a) && (l.b = a.a.b, l.a = a.a.a);
21558
+ r = u(f, g) ? f : g;
21559
+ u(r, l) && (l.b = r.b, l.a = r.a);
21560
+ if (t(l, f) || t(l, g)) return qa(a, b), !1;
21561
+ if (!t(h, a.a) && 0 <= x(h, a.a, l) || !t(k, a.a) && 0 >= x(k, a.a, l)) {
21562
+ if (k === a.a) return K(d.b), E(e.b, d), b = ka(b), d = S(b).a, T(a, S(b), c), U(a, b, J(d), d, d, !0), !0;
21563
+ if (h === a.a) {
21564
+ K(e.b);
21565
+ E(d.e, J(e));
21566
+ f = c = b;
21567
+ g = f.a.b.a;
21568
+ do f = R(f);
21569
+ while (f.a.b.a === g);
21570
+ b = f;
21571
+ f = S(b).a.b.c;
21572
+ c.a = J(e);
21573
+ e = T(a, c, null);
21574
+ U(a, b, e.c, d.b.c, f, !0);
21575
+ return !0;
21576
+ }
21577
+ 0 <= x(h, a.a, l) && (R(b).b = b.b = !0, K(d.b), d.a.b = a.a.b, d.a.a = a.a.a);
21578
+ 0 >= x(k, a.a, l) && (b.b = c.b = !0, K(e.b), e.a.b = a.a.b, e.a.a = a.a.a);
21579
+ return !1;
21580
+ }
21581
+ K(d.b);
21582
+ K(e.b);
21583
+ E(J(e), d);
21584
+ d.a.b = l.b;
21585
+ d.a.a = l.a;
21586
+ d.a.h = xa(a.e, d.a);
21587
+ d = d.a;
21588
+ e = [
21589
+ 0,
21590
+ 0,
21591
+ 0,
21592
+ 0
21593
+ ];
21594
+ l = [
21595
+ f.d,
21596
+ h.d,
21597
+ g.d,
21598
+ k.d
21599
+ ];
21600
+ d.g[0] = d.g[1] = d.g[2] = 0;
21601
+ ua(d, f, h, e, 0);
21602
+ ua(d, g, k, e, 2);
21603
+ sa(a, d, l, e, !0);
21604
+ R(b).b = b.b = c.b = !0;
21605
+ return !1;
21606
+ }
21607
+ function ra(a, b) {
21608
+ for(var c = S(b);;){
21609
+ for(; c.b;)b = c, c = S(c);
21610
+ if (!b.b && (c = b, b = R(b), null === b || !b.b)) break;
21611
+ b.b = !1;
21612
+ var d = b.a, e = c.a, f;
21613
+ if (f = d.b.a !== e.b.a) a: {
21614
+ f = b;
21615
+ var g = S(f), h = f.a, k = g.a, l = void 0;
21616
+ if (u(h.b.a, k.b.a)) {
21617
+ if (0 > x(h.b.a, k.b.a, h.a)) {
21618
+ f = !1;
21619
+ break a;
21620
+ }
21621
+ R(f).b = f.b = !0;
21622
+ l = K(h);
21623
+ E(k.b, l);
21624
+ l.d.c = f.d;
21625
+ } else {
21626
+ if (0 < x(k.b.a, h.b.a, k.a)) {
21627
+ f = !1;
21628
+ break a;
21629
+ }
21630
+ f.b = g.b = !0;
21631
+ l = K(k);
21632
+ E(h.e, k.b);
21633
+ l.b.d.c = f.d;
21634
+ }
21635
+ f = !0;
21636
+ }
21637
+ f && (c.c ? (Q(c), I(e), c = S(b), e = c.a) : b.c && (Q(b), I(d), b = R(c), d = b.a));
21638
+ if (d.a !== e.a) {
21639
+ if (d.b.a === e.b.a || b.c || c.c || d.b.a !== a.a && e.b.a !== a.a) qa(a, b);
21640
+ else if (wa(a, b)) break;
21641
+ }
21642
+ d.a === e.a && d.b.a === e.b.a && (P(e, d), Q(b), I(d), b = R(c));
21643
+ }
21644
+ }
21645
+ function ya(a, b) {
21646
+ a.a = b;
21647
+ for(var c = b.c; null === c.i;)if (c = c.c, c === b.c) {
21648
+ var c = a, d = b, e = new ma;
21649
+ e.a = d.c.b;
21650
+ var f = c.f, g = f.a;
21651
+ do g = g.a;
21652
+ while (null !== g.b && !f.c(f.b, e, g.b));
21653
+ var f = g.b, h = S(f), e = f.a, g = h.a;
21654
+ if (0 === x(e.b.a, d, e.a)) e = f.a, t(e.a, d) || t(e.b.a, d) || (K(e.b), f.c && (I(e.c), f.c = !1), E(d.c, e), ya(c, d));
21655
+ else {
21656
+ var k = u(g.b.a, e.b.a) ? f : h, h = void 0;
21657
+ f.d || k.c ? (k === f ? h = L(d.c.b, e.e) : h = L(g.b.c.b, d.c).b, k.c ? ja(k, h) : (e = c, f = la(c, f, h), f.f = R(f).f + f.a.f, f.d = oa(e, f.f)), ya(c, d)) : U(c, f, d.c, d.c, null, !0);
21658
+ }
21659
+ return;
21660
+ }
21661
+ c = ka(c.i);
21662
+ e = S(c);
21663
+ f = e.a;
21664
+ e = T(a, e, null);
21665
+ if (e.c === f) {
21666
+ var f = e, e = f.c, g = S(c), h = c.a, k = g.a, l = !1;
21667
+ h.b.a !== k.b.a && wa(a, c);
21668
+ t(h.a, a.a) && (E(J(e), h), c = ka(c), e = S(c).a, T(a, S(c), g), l = !0);
21669
+ t(k.a, a.a) && (E(f, J(k)), f = T(a, g, null), l = !0);
21670
+ l ? U(a, c, f.c, e, e, !0) : (u(k.a, h.a) ? d = J(k) : d = h, d = L(f.c.b, d), U(a, c, d, d.c, d.c, !1), d.b.i.c = !0, ra(a, c));
21671
+ } else U(a, c, e.c, f, f, !0);
21672
+ }
21673
+ function za(a, b) {
21674
+ var c = new ma, d = ea(a.b);
21675
+ d.a.b = O;
21676
+ d.a.a = b;
21677
+ d.b.a.b = -O;
21678
+ d.b.a.a = b;
21679
+ a.a = d.b.a;
21680
+ c.a = d;
21681
+ c.f = 0;
21682
+ c.d = !1;
21683
+ c.c = !1;
21684
+ c.h = !0;
21685
+ c.b = !1;
21686
+ d = a.f;
21687
+ d = na(d, d.a, c);
21688
+ c.e = d;
21689
+ }
21690
+ function Aa(a) {
21691
+ this.a = new Ba;
21692
+ this.b = a;
21693
+ this.c = ia;
21694
+ }
21695
+ function na(a, b, c) {
21696
+ do b = b.c;
21697
+ while (null !== b.b && !a.c(a.b, b.b, c));
21698
+ a = new Ba(c, b.a, b);
21699
+ b.a.c = a;
21700
+ return b.a = a;
21701
+ }
21702
+ function Ba(a, b, c) {
21703
+ this.b = a || null;
21704
+ this.a = b || this;
21705
+ this.c = c || this;
21706
+ }
21707
+ function X() {
21708
+ this.d = Y;
21709
+ this.p = this.b = this.q = null;
21710
+ this.j = [
21711
+ 0,
21712
+ 0,
21713
+ 0
21714
+ ];
21715
+ this.s = 100130;
21716
+ this.n = !1;
21717
+ this.o = this.a = this.e = this.f = null;
21718
+ this.m = !1;
21719
+ this.c = this.r = this.i = this.k = this.l = this.h = null;
21720
+ }
21721
+ var Y = 0;
21722
+ n = X.prototype;
21723
+ n.x = function() {
21724
+ Z(this, Y);
21725
+ };
21726
+ n.B = function(a, b) {
21727
+ switch(a){
21728
+ case 100142:
21729
+ return;
21730
+ case 100140:
21731
+ switch(b){
21732
+ case 100130:
21733
+ case 100131:
21734
+ case 100132:
21735
+ case 100133:
21736
+ case 100134:
21737
+ this.s = b;
21738
+ return;
21739
+ }
21740
+ break;
21741
+ case 100141:
21742
+ this.m = !!b;
21743
+ return;
21744
+ default:
21745
+ V(this, 100900);
21746
+ return;
21747
+ }
21748
+ V(this, 100901);
21749
+ };
21750
+ n.y = function(a) {
21751
+ switch(a){
21752
+ case 100142:
21753
+ return 0;
21754
+ case 100140:
21755
+ return this.s;
21756
+ case 100141:
21757
+ return this.m;
21758
+ default:
21759
+ V(this, 100900);
21760
+ }
21761
+ return !1;
21762
+ };
21763
+ n.A = function(a, b, c) {
21764
+ this.j[0] = a;
21765
+ this.j[1] = b;
21766
+ this.j[2] = c;
21767
+ };
21768
+ n.z = function(a, b) {
21769
+ var c = b ? b : null;
21770
+ switch(a){
21771
+ case 100100:
21772
+ case 100106:
21773
+ this.h = c;
21774
+ break;
21775
+ case 100104:
21776
+ case 100110:
21777
+ this.l = c;
21778
+ break;
21779
+ case 100101:
21780
+ case 100107:
21781
+ this.k = c;
21782
+ break;
21783
+ case 100102:
21784
+ case 100108:
21785
+ this.i = c;
21786
+ break;
21787
+ case 100103:
21788
+ case 100109:
21789
+ this.p = c;
21790
+ break;
21791
+ case 100105:
21792
+ case 100111:
21793
+ this.o = c;
21794
+ break;
21795
+ case 100112:
21796
+ this.r = c;
21797
+ break;
21798
+ default:
21799
+ V(this, 100900);
21800
+ }
21801
+ };
21802
+ n.C = function(a, b) {
21803
+ var c = !1, d = [
21804
+ 0,
21805
+ 0,
21806
+ 0
21807
+ ];
21808
+ Z(this, 2);
21809
+ for(var e = 0; 3 > e; ++e){
21810
+ var f = a[e];
21811
+ -1E150 > f && (f = -1E150, c = !0);
21812
+ 1E150 < f && (f = 1E150, c = !0);
21813
+ d[e] = f;
21814
+ }
21815
+ c && V(this, 100155);
21816
+ c = this.q;
21817
+ null === c ? (c = ea(this.b), E(c, c.b)) : (K(c), c = c.e);
21818
+ c.a.d = b;
21819
+ c.a.g[0] = d[0];
21820
+ c.a.g[1] = d[1];
21821
+ c.a.g[2] = d[2];
21822
+ c.f = 1;
21823
+ c.b.f = -1;
21824
+ this.q = c;
21825
+ };
21826
+ n.u = function(a) {
21827
+ Z(this, Y);
21828
+ this.d = 1;
21829
+ this.b = new Ca;
21830
+ this.c = a;
21831
+ };
21832
+ n.t = function() {
21833
+ Z(this, 1);
21834
+ this.d = 2;
21835
+ this.q = null;
21836
+ };
21837
+ n.v = function() {
21838
+ Z(this, 2);
21839
+ this.d = 1;
21840
+ };
21841
+ n.w = function() {
21842
+ Z(this, 1);
21843
+ this.d = Y;
21844
+ var a = this.j[0], b = this.j[1], c = this.j[2], d = !1, e = [
21845
+ a,
21846
+ b,
21847
+ c
21848
+ ];
21849
+ if (0 === a && 0 === b && 0 === c) {
21850
+ for(var b = [
21851
+ -2 * 1E150,
21852
+ -2 * 1E150,
21853
+ -2 * 1E150
21854
+ ], f = [
21855
+ 2 * 1E150,
21856
+ 2 * 1E150,
21857
+ 2 * 1E150
21858
+ ], c = [], g = [], d = this.b.c, a = d.e; a !== d; a = a.e)for(var h = 0; 3 > h; ++h){
21859
+ var k = a.g[h];
21860
+ k < f[h] && (f[h] = k, g[h] = a);
21861
+ k > b[h] && (b[h] = k, c[h] = a);
21862
+ }
21863
+ a = 0;
21864
+ b[1] - f[1] > b[0] - f[0] && (a = 1);
21865
+ b[2] - f[2] > b[a] - f[a] && (a = 2);
21866
+ if (f[a] >= b[a]) e[0] = 0, e[1] = 0, e[2] = 1;
21867
+ else {
21868
+ b = 0;
21869
+ f = g[a];
21870
+ c = c[a];
21871
+ g = [
21872
+ 0,
21873
+ 0,
21874
+ 0
21875
+ ];
21876
+ f = [
21877
+ f.g[0] - c.g[0],
21878
+ f.g[1] - c.g[1],
21879
+ f.g[2] - c.g[2]
21880
+ ];
21881
+ h = [
21882
+ 0,
21883
+ 0,
21884
+ 0
21885
+ ];
21886
+ for(a = d.e; a !== d; a = a.e)h[0] = a.g[0] - c.g[0], h[1] = a.g[1] - c.g[1], h[2] = a.g[2] - c.g[2], g[0] = f[1] * h[2] - f[2] * h[1], g[1] = f[2] * h[0] - f[0] * h[2], g[2] = f[0] * h[1] - f[1] * h[0], k = g[0] * g[0] + g[1] * g[1] + g[2] * g[2], k > b && (b = k, e[0] = g[0], e[1] = g[1], e[2] = g[2]);
21887
+ 0 >= b && (e[0] = e[1] = e[2] = 0, e[ha(f)] = 1);
21888
+ }
21889
+ d = !0;
21890
+ }
21891
+ g = ha(e);
21892
+ a = this.b.c;
21893
+ b = (g + 1) % 3;
21894
+ c = (g + 2) % 3;
21895
+ g = 0 < e[g] ? 1 : -1;
21896
+ for(e = a.e; e !== a; e = e.e)e.b = e.g[b], e.a = g * e.g[c];
21897
+ if (d) {
21898
+ e = 0;
21899
+ d = this.b.a;
21900
+ for(a = d.b; a !== d; a = a.b)if (b = a.a, !(0 >= b.f)) {
21901
+ do e += (b.a.b - b.b.a.b) * (b.a.a + b.b.a.a), b = b.e;
21902
+ while (b !== a.a);
21903
+ }
21904
+ if (0 > e) for(e = this.b.c, d = e.e; d !== e; d = d.e)d.a = -d.a;
21905
+ }
21906
+ this.n = !1;
21907
+ e = this.b.b;
21908
+ for(a = e.h; a !== e; a = d)if (d = a.h, b = a.e, t(a.a, a.b.a) && a.e.e !== a && (ta(this, b, a), I(a), a = b, b = a.e), b.e === a) {
21909
+ if (b !== a) {
21910
+ if (b === d || b === d.b) d = d.h;
21911
+ I(b);
21912
+ }
21913
+ if (a === d || a === d.b) d = d.h;
21914
+ I(a);
21915
+ }
21916
+ this.e = e = new Da;
21917
+ d = this.b.c;
21918
+ for(a = d.e; a !== d; a = a.e)a.h = xa(e, a);
21919
+ Ea(e);
21920
+ this.f = new Aa(this);
21921
+ za(this, -O);
21922
+ for(za(this, O); null !== (e = Fa(this.e));){
21923
+ for(;;){
21924
+ a: if (a = this.e, 0 === a.a) d = Ga(a.b);
21925
+ else if (d = a.c[a.d[a.a - 1]], 0 !== a.b.a && (a = Ga(a.b), u(a, d))) {
21926
+ d = a;
21927
+ break a;
21928
+ }
21929
+ if (null === d || !t(d, e)) break;
21930
+ d = Fa(this.e);
21931
+ ta(this, e.c, d.c);
21932
+ }
21933
+ ya(this, e);
21934
+ }
21935
+ this.a = this.f.a.a.b.a.a;
21936
+ for(e = 0; null !== (d = this.f.a.a.b);)d.h || ++e, Q(d);
21937
+ this.f = null;
21938
+ e = this.e;
21939
+ e.b = null;
21940
+ e.d = null;
21941
+ this.e = e.c = null;
21942
+ e = this.b;
21943
+ for(a = e.a.b; a !== e.a; a = d)d = a.b, a = a.a, a.e.e === a && (P(a.c, a), I(a));
21944
+ if (!this.n) {
21945
+ e = this.b;
21946
+ if (this.m) for(a = e.b.h; a !== e.b; a = d)d = a.h, a.b.d.c !== a.d.c ? a.f = a.d.c ? 1 : -1 : I(a);
21947
+ else for(a = e.a.b; a !== e.a; a = d)if (d = a.b, a.c) {
21948
+ for(a = a.a; u(a.b.a, a.a); a = a.c.b);
21949
+ for(; u(a.a, a.b.a); a = a.e);
21950
+ b = a.c.b;
21951
+ for(c = void 0; a.e !== b;)if (u(a.b.a, b.a)) {
21952
+ for(; b.e !== a && (ca(b.e) || 0 >= x(b.a, b.b.a, b.e.b.a));)c = L(b.e, b), b = c.b;
21953
+ b = b.c.b;
21954
+ } else {
21955
+ for(; b.e !== a && (da(a.c.b) || 0 <= x(a.b.a, a.a, a.c.b.a));)c = L(a, a.c.b), a = c.b;
21956
+ a = a.e;
21957
+ }
21958
+ for(; b.e.e !== a;)c = L(b.e, b), b = c.b;
21959
+ }
21960
+ if (this.h || this.i || this.k || this.l) if (this.m) for(e = this.b, d = e.a.b; d !== e.a; d = d.b){
21961
+ if (d.c) {
21962
+ this.h && this.h(2, this.c);
21963
+ a = d.a;
21964
+ do this.k && this.k(a.a.d, this.c), a = a.e;
21965
+ while (a !== d.a);
21966
+ this.i && this.i(this.c);
21967
+ }
21968
+ }
21969
+ else {
21970
+ e = this.b;
21971
+ d = !!this.l;
21972
+ a = !1;
21973
+ b = -1;
21974
+ for(c = e.a.d; c !== e.a; c = c.d)if (c.c) {
21975
+ a || (this.h && this.h(4, this.c), a = !0);
21976
+ g = c.a;
21977
+ do d && (f = g.b.d.c ? 0 : 1, b !== f && (b = f, this.l && this.l(!!b, this.c))), this.k && this.k(g.a.d, this.c), g = g.e;
21978
+ while (g !== c.a);
21979
+ }
21980
+ a && this.i && this.i(this.c);
21981
+ }
21982
+ if (this.r) {
21983
+ e = this.b;
21984
+ for(a = e.a.b; a !== e.a; a = d)if (d = a.b, !a.c) {
21985
+ b = a.a;
21986
+ c = b.e;
21987
+ g = void 0;
21988
+ do g = c, c = g.e, g.d = null, null === g.b.d && (g.c === g ? F(g.a, null) : (g.a.c = g.c, H(g, J(g))), f = g.b, f.c === f ? F(f.a, null) : (f.a.c = f.c, H(f, J(f))), fa(g));
21989
+ while (g !== b);
21990
+ b = a.d;
21991
+ a = a.b;
21992
+ a.d = b;
21993
+ b.b = a;
21994
+ }
21995
+ this.r(this.b);
21996
+ this.c = this.b = null;
21997
+ return;
21998
+ }
21999
+ }
22000
+ this.b = this.c = null;
22001
+ };
22002
+ function Z(a, b) {
22003
+ if (a.d !== b) for(; a.d !== b;)if (a.d < b) switch(a.d){
22004
+ case Y:
22005
+ V(a, 100151);
22006
+ a.u(null);
22007
+ break;
22008
+ case 1:
22009
+ V(a, 100152), a.t();
22010
+ }
22011
+ else switch(a.d){
22012
+ case 2:
22013
+ V(a, 100154);
22014
+ a.v();
22015
+ break;
22016
+ case 1:
22017
+ V(a, 100153), a.w();
22018
+ }
22019
+ }
22020
+ function V(a, b) {
22021
+ a.p && a.p(b, a.c);
22022
+ }
22023
+ function ga(a, b) {
22024
+ this.b = a || this;
22025
+ this.d = b || this;
22026
+ this.a = null;
22027
+ this.c = !1;
22028
+ }
22029
+ function M() {
22030
+ this.h = this;
22031
+ this.i = this.d = this.a = this.e = this.c = this.b = null;
22032
+ this.f = 0;
22033
+ }
22034
+ function J(a) {
22035
+ return a.b.e;
22036
+ }
22037
+ function Ca() {
22038
+ this.c = new N;
22039
+ this.a = new ga;
22040
+ this.b = new M;
22041
+ this.d = new M;
22042
+ this.b.b = this.d;
22043
+ this.d.b = this.b;
22044
+ }
22045
+ function N(a, b) {
22046
+ this.e = a || this;
22047
+ this.f = b || this;
22048
+ this.d = this.c = null;
22049
+ this.g = [
22050
+ 0,
22051
+ 0,
22052
+ 0
22053
+ ];
22054
+ this.h = this.a = this.b = 0;
22055
+ }
22056
+ function Da() {
22057
+ this.c = [];
22058
+ this.d = null;
22059
+ this.a = 0;
22060
+ this.e = !1;
22061
+ this.b = new Ha;
22062
+ }
22063
+ function Ea(a) {
22064
+ a.d = [];
22065
+ for(var b = 0; b < a.a; b++)a.d[b] = b;
22066
+ a.d.sort(function(a) {
22067
+ return function(b, e) {
22068
+ return u(a[b], a[e]) ? 1 : -1;
22069
+ };
22070
+ }(a.c));
22071
+ a.e = !0;
22072
+ Ia(a.b);
22073
+ }
22074
+ function xa(a, b) {
22075
+ if (a.e) {
22076
+ var c = a.b, d = ++c.a;
22077
+ 2 * d > c.f && (c.f *= 2, c.c = Ja(c.c, c.f + 1));
22078
+ var e;
22079
+ 0 === c.b ? e = d : (e = c.b, c.b = c.c[c.b]);
22080
+ c.e[e] = b;
22081
+ c.c[e] = d;
22082
+ c.d[d] = e;
22083
+ c.h && va(c, d);
22084
+ return e;
22085
+ }
22086
+ c = a.a++;
22087
+ a.c[c] = b;
22088
+ return -(c + 1);
22089
+ }
22090
+ function Fa(a) {
22091
+ if (0 === a.a) return Ka(a.b);
22092
+ var b = a.c[a.d[a.a - 1]];
22093
+ if (0 !== a.b.a && u(Ga(a.b), b)) return Ka(a.b);
22094
+ do --a.a;
22095
+ while (0 < a.a && null === a.c[a.d[a.a - 1]]);
22096
+ return b;
22097
+ }
22098
+ function Ha() {
22099
+ this.d = Ja([
22100
+ 0
22101
+ ], 33);
22102
+ this.e = [
22103
+ null,
22104
+ null
22105
+ ];
22106
+ this.c = [
22107
+ 0,
22108
+ 0
22109
+ ];
22110
+ this.a = 0;
22111
+ this.f = 32;
22112
+ this.b = 0;
22113
+ this.h = !1;
22114
+ this.d[1] = 1;
22115
+ }
22116
+ function Ja(a, b) {
22117
+ for(var c = Array(b), d = 0; d < a.length; d++)c[d] = a[d];
22118
+ for(; d < b; d++)c[d] = 0;
22119
+ return c;
22120
+ }
22121
+ function Ia(a) {
22122
+ for(var b = a.a; 1 <= b; --b)W(a, b);
22123
+ a.h = !0;
22124
+ }
22125
+ function Ga(a) {
22126
+ return a.e[a.d[1]];
22127
+ }
22128
+ function Ka(a) {
22129
+ var b = a.d, c = a.e, d = a.c, e = b[1], f = c[e];
22130
+ 0 < a.a && (b[1] = b[a.a], d[b[1]] = 1, c[e] = null, d[e] = a.b, a.b = e, 0 < --a.a && W(a, 1));
22131
+ return f;
22132
+ }
22133
+ function W(a, b) {
22134
+ for(var c = a.d, d = a.e, e = a.c, f = b, g = c[f];;){
22135
+ var h = f << 1;
22136
+ h < a.a && u(d[c[h + 1]], d[c[h]]) && (h += 1);
22137
+ var k = c[h];
22138
+ if (h > a.a || u(d[g], d[k])) {
22139
+ c[f] = g;
22140
+ e[g] = f;
22141
+ break;
22142
+ }
22143
+ c[f] = k;
22144
+ e[k] = f;
22145
+ f = h;
22146
+ }
22147
+ }
22148
+ function va(a, b) {
22149
+ for(var c = a.d, d = a.e, e = a.c, f = b, g = c[f];;){
22150
+ var h = f >> 1, k = c[h];
22151
+ if (0 === h || u(d[k], d[g])) {
22152
+ c[f] = g;
22153
+ e[g] = f;
22154
+ break;
22155
+ }
22156
+ c[f] = k;
22157
+ e[k] = f;
22158
+ f = h;
22159
+ }
22160
+ }
22161
+ function ma() {
22162
+ this.e = this.a = null;
22163
+ this.f = 0;
22164
+ this.c = this.b = this.h = this.d = !1;
22165
+ }
22166
+ function S(a) {
22167
+ return a.e.c.b;
22168
+ }
22169
+ function R(a) {
22170
+ return a.e.a.b;
22171
+ }
22172
+ commonjsGlobal.libtess = {
22173
+ GluTesselator: X,
22174
+ windingRule: {
22175
+ GLU_TESS_WINDING_ODD: 100130,
22176
+ GLU_TESS_WINDING_NONZERO: 100131,
22177
+ GLU_TESS_WINDING_POSITIVE: 100132,
22178
+ GLU_TESS_WINDING_NEGATIVE: 100133,
22179
+ GLU_TESS_WINDING_ABS_GEQ_TWO: 100134
22180
+ },
22181
+ primitiveType: {
22182
+ GL_LINE_LOOP: 2,
22183
+ GL_TRIANGLES: 4,
22184
+ GL_TRIANGLE_STRIP: 5,
22185
+ GL_TRIANGLE_FAN: 6
22186
+ },
22187
+ errorType: {
22188
+ GLU_TESS_MISSING_BEGIN_POLYGON: 100151,
22189
+ GLU_TESS_MISSING_END_POLYGON: 100153,
22190
+ GLU_TESS_MISSING_BEGIN_CONTOUR: 100152,
22191
+ GLU_TESS_MISSING_END_CONTOUR: 100154,
22192
+ GLU_TESS_COORD_TOO_LARGE: 100155,
22193
+ GLU_TESS_NEED_COMBINE_CALLBACK: 100156
22194
+ },
22195
+ gluEnum: {
22196
+ GLU_TESS_MESH: 100112,
22197
+ GLU_TESS_TOLERANCE: 100142,
22198
+ GLU_TESS_WINDING_RULE: 100140,
22199
+ GLU_TESS_BOUNDARY_ONLY: 100141,
22200
+ GLU_INVALID_ENUM: 100900,
22201
+ GLU_INVALID_VALUE: 100901,
22202
+ GLU_TESS_BEGIN: 100100,
22203
+ GLU_TESS_VERTEX: 100101,
22204
+ GLU_TESS_END: 100102,
22205
+ GLU_TESS_ERROR: 100103,
22206
+ GLU_TESS_EDGE_FLAG: 100104,
22207
+ GLU_TESS_COMBINE: 100105,
22208
+ GLU_TESS_BEGIN_DATA: 100106,
22209
+ GLU_TESS_VERTEX_DATA: 100107,
22210
+ GLU_TESS_END_DATA: 100108,
22211
+ GLU_TESS_ERROR_DATA: 100109,
22212
+ GLU_TESS_EDGE_FLAG_DATA: 100110,
22213
+ GLU_TESS_COMBINE_DATA: 100111
22214
+ }
22215
+ };
22216
+ X.prototype.gluDeleteTess = X.prototype.x;
22217
+ X.prototype.gluTessProperty = X.prototype.B;
22218
+ X.prototype.gluGetTessProperty = X.prototype.y;
22219
+ X.prototype.gluTessNormal = X.prototype.A;
22220
+ X.prototype.gluTessCallback = X.prototype.z;
22221
+ X.prototype.gluTessVertex = X.prototype.C;
22222
+ X.prototype.gluTessBeginPolygon = X.prototype.u;
22223
+ X.prototype.gluTessBeginContour = X.prototype.t;
22224
+ X.prototype.gluTessEndContour = X.prototype.v;
22225
+ X.prototype.gluTessEndPolygon = X.prototype.w;
22226
+ {
22227
+ module.exports = commonjsGlobal.libtess;
22228
+ }
22229
+ }(libtess_min));
22230
+
22231
+ var tessy = function initTesselator() {
22232
+ // function called for each vertex of tesselator output
22233
+ function vertexCallback(data, polyVertArray) {
22234
+ polyVertArray[polyVertArray.length] = data[0];
22235
+ polyVertArray[polyVertArray.length] = data[1];
22236
+ }
22237
+ function begincallback(type) {
22238
+ if (type !== libtess_min.exports.primitiveType.GL_TRIANGLES) {
22239
+ console.info("expected TRIANGLES but got type: " + type);
22240
+ }
22241
+ }
22242
+ function errorcallback(errno) {
22243
+ console.error("error callback, error number: " + errno);
22244
+ }
22245
+ // callback for when segments intersect and must be split
22246
+ function combinecallback(coords, data, weight) {
22247
+ // console.log('combine callback');
22248
+ return [
22249
+ coords[0],
22250
+ coords[1],
22251
+ coords[2]
22252
+ ];
22253
+ }
22254
+ function edgeCallback(flag) {
22255
+ // don't really care about the flag, but need no-strip/no-fan behavior
22256
+ // console.log('edge flag: ' + flag);
22257
+ }
22258
+ var tessy = new libtess_min.exports.GluTesselator();
22259
+ // tessy.gluTessProperty(libtess.gluEnum.GLU_TESS_WINDING_RULE, libtess.windingRule.GLU_TESS_WINDING_POSITIVE);
22260
+ tessy.gluTessCallback(libtess_min.exports.gluEnum.GLU_TESS_VERTEX_DATA, vertexCallback);
22261
+ tessy.gluTessCallback(libtess_min.exports.gluEnum.GLU_TESS_BEGIN, begincallback);
22262
+ tessy.gluTessCallback(libtess_min.exports.gluEnum.GLU_TESS_ERROR, errorcallback);
22263
+ tessy.gluTessCallback(libtess_min.exports.gluEnum.GLU_TESS_COMBINE, combinecallback);
22264
+ tessy.gluTessCallback(libtess_min.exports.gluEnum.GLU_TESS_EDGE_FLAG, edgeCallback);
22265
+ return tessy;
22266
+ }();
22267
+ function triangulate(contours) {
22268
+ // libtess will take 3d verts and flatten to a plane for tesselation
22269
+ // since only doing 2d tesselation here, provide z=1 normal to skip
22270
+ // iterating over verts only to get the same answer.
22271
+ // comment out to test normal-generation code
22272
+ tessy.gluTessNormal(0, 0, 1);
22273
+ var triangleVerts = [];
22274
+ tessy.gluTessBeginPolygon(triangleVerts);
22275
+ for(var i = 0; i < contours.length; i++){
22276
+ tessy.gluTessBeginContour();
22277
+ var contour = contours[i];
22278
+ for(var j = 0; j < contour.length; j += 2){
22279
+ var coords = [
22280
+ contour[j],
22281
+ contour[j + 1],
22282
+ 0
22283
+ ];
22284
+ tessy.gluTessVertex(coords, coords);
22285
+ }
22286
+ tessy.gluTessEndContour();
22287
+ }
22288
+ // finish polygon
22289
+ tessy.gluTessEndPolygon();
22290
+ return triangleVerts;
22291
+ }
22292
+
22293
+ var ShapeComponent = /*#__PURE__*/ function(RendererComponent) {
22294
+ _inherits(ShapeComponent, RendererComponent);
22295
+ function ShapeComponent(engine) {
22296
+ var _this;
22297
+ _this = RendererComponent.call(this, engine) || this;
22298
+ _this.path = new GraphicsPath();
22299
+ _this.curveValues = [];
22300
+ _this.dirty = false;
22301
+ _this.vert = "\nprecision highp float;\n\nattribute vec3 aPos;//x y\n\nvarying vec4 vColor;\n\nuniform vec4 _Color;\nuniform mat4 effects_MatrixVP;\nuniform mat4 effects_MatrixInvV;\nuniform mat4 effects_ObjectToWorld;\n\nvoid main() {\n vColor = _Color;\n vec4 pos = vec4(aPos.xyz, 1.0);\n gl_Position = effects_MatrixVP * effects_ObjectToWorld * pos;\n}\n";
22302
+ _this.frag = "\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main() {\n vec4 color = vec4(1.0,1.0,1.0,1.0);\n gl_FragColor = color;\n}\n";
22303
+ if (!_this.geometry) {
22304
+ _this.geometry = Geometry.create(engine, {
22305
+ attributes: {
22306
+ aPos: {
22307
+ type: glContext.FLOAT,
22308
+ size: 3,
22309
+ data: new Float32Array([
22310
+ -0.5,
22311
+ 0.5,
22312
+ 0,
22313
+ -0.5,
22314
+ -0.5,
22315
+ 0,
22316
+ 0.5,
22317
+ 0.5,
22318
+ 0,
22319
+ 0.5,
22320
+ -0.5,
22321
+ 0
22322
+ ])
22323
+ },
22324
+ aUV: {
22325
+ type: glContext.FLOAT,
22326
+ size: 2,
22327
+ data: new Float32Array()
22328
+ }
22329
+ },
22330
+ mode: glContext.TRIANGLES,
22331
+ drawCount: 4
22332
+ });
22333
+ }
22334
+ if (!_this.material) {
22335
+ var materialProps = {
22336
+ shader: {
22337
+ vertex: _this.vert,
22338
+ fragment: _this.frag,
22339
+ glslVersion: GLSLVersion.GLSL1
22340
+ }
22341
+ };
22342
+ _this.material = Material.create(engine, materialProps);
22343
+ _this.material.setColor("_Color", new Color(1, 1, 1, 1));
22344
+ _this.material.depthMask = true;
22345
+ _this.material.depthTest = true;
22346
+ _this.material.blending = true;
22347
+ }
22348
+ return _this;
22349
+ }
22350
+ var _proto = ShapeComponent.prototype;
22351
+ _proto.onUpdate = function onUpdate(dt) {
22352
+ if (this.dirty) {
22353
+ this.path.clear();
22354
+ this.path.moveTo(this.curveValues[this.curveValues.length - 1].point.x, this.curveValues[this.curveValues.length - 1].point.y);
22355
+ for(var _iterator = _create_for_of_iterator_helper_loose(this.curveValues), _step; !(_step = _iterator()).done;){
22356
+ var curveValue = _step.value;
22357
+ var point = curveValue.point;
22358
+ var control1 = curveValue.controlPoint1;
22359
+ var control2 = curveValue.controlPoint2;
22360
+ this.path.bezierCurveTo(control1.x, control1.y, control2.x, control2.y, point.x, point.y, 1);
22361
+ }
22362
+ this.buildGeometryFromPath(this.path.shapePath);
22363
+ this.dirty = false;
22364
+ }
22365
+ };
22366
+ _proto.render = function render(renderer) {
22367
+ if (renderer.renderingData.currentFrame.globalUniforms) {
22368
+ renderer.setGlobalMatrix("effects_ObjectToWorld", this.transform.getWorldMatrix());
22369
+ }
22370
+ renderer.drawGeometry(this.geometry, this.material);
22371
+ };
22372
+ _proto.buildGeometryFromPath = function buildGeometryFromPath(shapePath) {
22373
+ var shapePrimitives = shapePath.shapePrimitives;
22374
+ var vertices = [];
22375
+ // triangulate shapePrimitive
22376
+ for(var _iterator = _create_for_of_iterator_helper_loose(shapePrimitives), _step; !(_step = _iterator()).done;){
22377
+ var shapePrimitive = _step.value;
22378
+ var _vertices;
22379
+ var shape = shapePrimitive.shape;
22380
+ (_vertices = vertices).push.apply(_vertices, [].concat(triangulate([
22381
+ shape.points
22382
+ ])));
22383
+ }
22384
+ // build vertices and uvs
22385
+ var vertexCount = vertices.length / 2;
22386
+ var positionArray = this.geometry.getAttributeData("aPos");
22387
+ var uvArray = this.geometry.getAttributeData("aUV");
22388
+ if (!positionArray || positionArray.length < vertexCount * 3) {
22389
+ positionArray = new Float32Array(vertexCount * 3);
22390
+ }
22391
+ if (!uvArray || uvArray.length < vertexCount * 2) {
22392
+ uvArray = new Float32Array(vertexCount * 2);
22393
+ }
22394
+ for(var i = 0; i < vertexCount; i++){
22395
+ var pointsOffset = i * 3;
22396
+ var positionArrayOffset = i * 2;
22397
+ var uvOffset = i * 2;
22398
+ positionArray[pointsOffset] = vertices[positionArrayOffset];
22399
+ positionArray[pointsOffset + 1] = vertices[positionArrayOffset + 1];
22400
+ positionArray[pointsOffset + 2] = 0;
22401
+ uvArray[uvOffset] = positionArray[pointsOffset];
22402
+ uvArray[uvOffset + 1] = positionArray[pointsOffset + 1];
22403
+ }
22404
+ this.geometry.setAttributeData("aPos", positionArray);
22405
+ this.geometry.setAttributeData("aUV", uvArray);
22406
+ this.geometry.setDrawCount(vertexCount);
22407
+ };
22408
+ _proto.fromData = function fromData(data) {
22409
+ RendererComponent.prototype.fromData.call(this, data);
22410
+ var points = data.param.points;
22411
+ var easingIns = data.param.easingIn;
22412
+ var easingOuts = data.param.easingOut;
22413
+ for(var _iterator = _create_for_of_iterator_helper_loose(data.param.shapes), _step; !(_step = _iterator()).done;){
22414
+ var shape = _step.value;
22415
+ var indices = shape.indexes;
22416
+ for(var i = 1; i < indices.length; i++){
22417
+ var pointIndex = indices[i];
22418
+ var lastPointIndex = indices[i - 1];
22419
+ this.curveValues.push({
22420
+ point: points[pointIndex.point],
22421
+ controlPoint1: easingOuts[lastPointIndex.easingOut],
22422
+ controlPoint2: easingIns[pointIndex.easingIn]
22423
+ });
22424
+ }
22425
+ // Push the last curve
22426
+ this.curveValues.push({
22427
+ point: points[indices[0].point],
22428
+ controlPoint1: easingOuts[indices[indices.length - 1].easingOut],
22429
+ controlPoint2: easingIns[indices[0].easingIn]
22430
+ });
22431
+ }
22432
+ this.dirty = true;
22433
+ };
22434
+ return ShapeComponent;
22435
+ }(RendererComponent);
22436
+ ShapeComponent = __decorate([
22437
+ effectsClass("ShapeComponent")
22438
+ ], ShapeComponent);
22439
+ var ComponentShapeType;
22440
+ (function(ComponentShapeType) {
22441
+ /**
22442
+ * 自定义图形
22443
+ */ ComponentShapeType[ComponentShapeType["CUSTOM"] = 0] = "CUSTOM";
22444
+ /**
22445
+ * 矩形
22446
+ */ ComponentShapeType[ComponentShapeType["RECTANGLE"] = 1] = "RECTANGLE";
22447
+ /**
22448
+ * 椭圆
22449
+ */ ComponentShapeType[ComponentShapeType["ELLIPSE"] = 2] = "ELLIPSE";
22450
+ /**
22451
+ * 多边形
22452
+ */ ComponentShapeType[ComponentShapeType["POLYGON"] = 3] = "POLYGON";
22453
+ /**
22454
+ * 星形
22455
+ */ ComponentShapeType[ComponentShapeType["STAR"] = 4] = "STAR";
22456
+ })(ComponentShapeType || (ComponentShapeType = {}));
22457
+ var ShapeConnectType;
22458
+ (function(ShapeConnectType) {})(ShapeConnectType || (ShapeConnectType = {}));
22459
+ var ShapePointType;
22460
+ (function(ShapePointType) {})(ShapePointType || (ShapePointType = {}));
22461
+
20798
22462
  var EventEmitter = function EventEmitter() {
20799
22463
  var _this = this;
20800
22464
  var _this1 = this;
@@ -21164,21 +22828,21 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
21164
22828
  return now - this.duration > 0.001;
21165
22829
  };
21166
22830
  _proto.find = function find(name) {
22831
+ var _queue;
21167
22832
  if (this.name === name) {
21168
22833
  return this;
21169
22834
  }
21170
- for(var _iterator = _create_for_of_iterator_helper_loose(this.children), _step; !(_step = _iterator()).done;){
21171
- var child = _step.value;
21172
- if (child.name === name) {
21173
- return child;
21174
- }
21175
- }
21176
- for(var _iterator1 = _create_for_of_iterator_helper_loose(this.children), _step1; !(_step1 = _iterator1()).done;){
21177
- var child1 = _step1.value;
21178
- var res = child1.find(name);
21179
- if (res) {
21180
- return res;
22835
+ var queue = [];
22836
+ (_queue = queue).push.apply(_queue, [].concat(this.children));
22837
+ var index = 0;
22838
+ while(index < queue.length){
22839
+ var _queue1;
22840
+ var item = queue[index];
22841
+ index++;
22842
+ if (item.name === name) {
22843
+ return item;
21181
22844
  }
22845
+ (_queue1 = queue).push.apply(_queue1, [].concat(item.children));
21182
22846
  }
21183
22847
  return undefined;
21184
22848
  };
@@ -23922,15 +25586,22 @@ function passRenderLevel(l, renderLevel) {
23922
25586
  return false;
23923
25587
  }
23924
25588
 
23925
- function isSceneJSON(scene) {
23926
- return isObject(scene) && "jsonScene" in scene;
23927
- }
23928
- function isSceneURL(scene) {
23929
- return isObject(scene) && "url" in scene;
23930
- }
23931
- function isSceneWithOptions(scene) {
23932
- return isObject(scene) && "options" in scene;
23933
- }
25589
+ var Scene;
25590
+ (function(Scene) {
25591
+ function isJSONObject(scene) {
25592
+ return isObject(scene) && "jsonScene" in scene;
25593
+ }
25594
+ // JSON 对象
25595
+ Scene.isJSONObject = isJSONObject;
25596
+ function isURL(scene) {
25597
+ return isObject(scene) && "url" in scene;
25598
+ }
25599
+ Scene.isURL = isURL;
25600
+ function isWithOptions(scene) {
25601
+ return isObject(scene) && "options" in scene;
25602
+ }
25603
+ Scene.isWithOptions = isWithOptions;
25604
+ })(Scene || (Scene = {}));
23934
25605
 
23935
25606
  function getBackgroundImage(template, variables) {
23936
25607
  var templateBackground;
@@ -24055,13 +25726,12 @@ var seed$1 = 1;
24055
25726
  */ _proto.loadScene = function loadScene(url, renderer, options) {
24056
25727
  var _this = this;
24057
25728
  return _async_to_generator(function() {
24058
- var _gpuInstance_detail, rawJSON, assetUrl, startTime, timeInfoMessages, gpuInstance, _gpuInstance_detail_asyncShaderCompile, asyncShaderCompile, _gpuInstance_detail_compressedTexture, compressedTexture, timeInfos, loadTimer, cancelLoading, waitPromise, hookTimeInfo, loadResourcePromise;
25729
+ var rawJSON, assetUrl, startTime, timeInfoMessages, gpuInstance, _gpuInstance_detail_compressedTexture, compressedTexture, timeInfos, loadTimer, cancelLoading, waitPromise, hookTimeInfo, loadResourcePromise;
24059
25730
  return __generator(this, function(_state) {
24060
25731
  assetUrl = isString(url) ? url : _this.id;
24061
25732
  startTime = performance.now();
24062
25733
  timeInfoMessages = [];
24063
25734
  gpuInstance = renderer == null ? void 0 : renderer.engine.gpuCapability;
24064
- asyncShaderCompile = (_gpuInstance_detail_asyncShaderCompile = gpuInstance == null ? void 0 : (_gpuInstance_detail = gpuInstance.detail) == null ? void 0 : _gpuInstance_detail.asyncShaderCompile) != null ? _gpuInstance_detail_asyncShaderCompile : false;
24065
25735
  compressedTexture = (_gpuInstance_detail_compressedTexture = gpuInstance == null ? void 0 : gpuInstance.detail.compressedTexture) != null ? _gpuInstance_detail_compressedTexture : COMPRESSED_TEXTURE.NONE;
24066
25736
  timeInfos = {};
24067
25737
  cancelLoading = false;
@@ -24114,81 +25784,55 @@ var seed$1 = 1;
24114
25784
  });
24115
25785
  });
24116
25786
  loadResourcePromise = /*#__PURE__*/ _async_to_generator(function() {
24117
- var scene, _rawJSON_jsonScene, rawImages, images, i, i1, _ref, usedImages, jsonScene, pluginSystem, _jsonScene_bins, bins, images1, compositions, fonts, _ref1, loadedBins, loadedImages, i2, imageAsset, loadedTextures, totalTime;
25787
+ var scene, link, _ref, jsonScene, pluginSystem, _jsonScene_bins, bins, images, compositions, fonts, _ref1, loadedBins, loadedImages, i, i1, imageAsset, loadedTextures, totalTime;
24118
25788
  return __generator(this, function(_state) {
24119
25789
  switch(_state.label){
24120
25790
  case 0:
24121
- if (!isObject(url)) return [
24122
- 3,
24123
- 1
24124
- ];
24125
- // TODO: 原 JSONLoader contructor 判断是否兼容
24126
- rawJSON = url;
24127
- _this.baseUrl = location.href;
24128
- return [
25791
+ if (!isString(url)) return [
24129
25792
  3,
24130
- 3
25793
+ 2
24131
25794
  ];
24132
- case 1:
24133
25795
  // 兼容相对路径
24134
- url = new URL(url, location.href).href;
24135
- _this.baseUrl = url;
25796
+ link = new URL(url, location.href).href;
25797
+ _this.baseUrl = link;
24136
25798
  return [
24137
25799
  4,
24138
25800
  hookTimeInfo("loadJSON", function() {
24139
- return _this.loadJSON(url);
25801
+ return _this.loadJSON(link);
24140
25802
  })
24141
25803
  ];
24142
- case 2:
25804
+ case 1:
24143
25805
  rawJSON = _state.sent();
25806
+ return [
25807
+ 3,
25808
+ 3
25809
+ ];
25810
+ case 2:
25811
+ // url 为 spec.JSONScene 或 Scene 对象
25812
+ rawJSON = url;
25813
+ _this.baseUrl = location.href;
24144
25814
  _state.label = 3;
24145
25815
  case 3:
24146
- if (!isSceneJSON(rawJSON)) return [
25816
+ if (!Scene.isJSONObject(rawJSON)) return [
24147
25817
  3,
24148
- 6
25818
+ 4
24149
25819
  ];
24150
25820
  // 已经加载过的 可能需要更新数据模板
24151
25821
  scene = _extends({}, rawJSON);
24152
- if (!(_this.options && _this.options.variables && Object.keys(_this.options.variables).length !== 0)) return [
24153
- 3,
24154
- 5
24155
- ];
24156
- _rawJSON_jsonScene = rawJSON.jsonScene, rawImages = _rawJSON_jsonScene.images;
24157
- images = scene.images;
24158
- for(i = 0; i < rawImages.length; i++){
24159
- // 仅重新加载数据模板对应的图片
24160
- if (_instanceof1(images[i], HTMLCanvasElement)) {
24161
- images[i] = rawImages[i];
24162
- }
24163
- }
24164
- return [
24165
- 4,
24166
- hookTimeInfo("processImages", function() {
24167
- return _this.processImages(images, compressedTexture);
24168
- })
24169
- ];
24170
- case 4:
24171
- scene.images = _state.sent();
24172
- // 更新 TextureOptions 中的 image 指向
24173
- for(i1 = 0; i1 < scene.images.length; i1++){
24174
- scene.textureOptions[i1].image = scene.images[i1];
24175
- }
24176
- _state.label = 5;
24177
- case 5:
24178
25822
  return [
24179
25823
  3,
24180
- 12
25824
+ 9
24181
25825
  ];
24182
- case 6:
25826
+ case 4:
24183
25827
  return [
24184
25828
  4,
24185
25829
  hookTimeInfo("processJSON", function() {
24186
25830
  return _this.processJSON(rawJSON);
24187
25831
  })
24188
25832
  ];
24189
- case 7:
24190
- _ref = _state.sent(), usedImages = _ref.usedImages, jsonScene = _ref.jsonScene, pluginSystem = _ref.pluginSystem;
24191
- _jsonScene_bins = jsonScene.bins, bins = _jsonScene_bins === void 0 ? [] : _jsonScene_bins, images1 = jsonScene.images, compositions = jsonScene.compositions, fonts = jsonScene.fonts;
25833
+ case 5:
25834
+ _ref = _state.sent(), jsonScene = _ref.jsonScene, pluginSystem = _ref.pluginSystem;
25835
+ _jsonScene_bins = jsonScene.bins, bins = _jsonScene_bins === void 0 ? [] : _jsonScene_bins, images = jsonScene.images, compositions = jsonScene.compositions, fonts = jsonScene.fonts;
24192
25836
  return [
24193
25837
  4,
24194
25838
  Promise.all([
@@ -24196,38 +25840,36 @@ var seed$1 = 1;
24196
25840
  return _this.processBins(bins);
24197
25841
  }),
24198
25842
  hookTimeInfo("processImages", function() {
24199
- return _this.processImages(images1, compressedTexture);
25843
+ return _this.processImages(images, compressedTexture);
24200
25844
  }),
24201
- hookTimeInfo("" + (asyncShaderCompile ? "async" : "sync") + "Compile", function() {
25845
+ hookTimeInfo("precompile", function() {
24202
25846
  return _this.precompile(compositions, pluginSystem, renderer, options);
25847
+ }),
25848
+ hookTimeInfo("processFontURL", function() {
25849
+ return _this.processFontURL(fonts);
24203
25850
  })
24204
25851
  ])
24205
25852
  ];
24206
- case 8:
25853
+ case 6:
24207
25854
  _ref1 = _state.sent(), loadedBins = _ref1[0], loadedImages = _ref1[1];
25855
+ for(i = 0; i < images.length; i++){
25856
+ _this.assets[images[i].id] = loadedImages[i];
25857
+ }
24208
25858
  if (renderer) {
24209
- for(i2 = 0; i2 < images1.length; i2++){
25859
+ for(i1 = 0; i1 < images.length; i1++){
24210
25860
  imageAsset = new ImageAsset(renderer.engine);
24211
- imageAsset.data = loadedImages[i2];
24212
- imageAsset.setInstanceId(images1[i2].id);
25861
+ imageAsset.data = loadedImages[i1];
25862
+ imageAsset.setInstanceId(images[i1].id);
24213
25863
  renderer.engine.addInstance(imageAsset);
24214
25864
  }
24215
25865
  }
24216
- return [
24217
- 4,
24218
- hookTimeInfo("processFontURL", function() {
24219
- return _this.processFontURL(fonts);
24220
- })
24221
- ];
24222
- case 9:
24223
- _state.sent();
24224
25866
  return [
24225
25867
  4,
24226
25868
  hookTimeInfo("processTextures", function() {
24227
- return _this.processTextures(loadedImages, loadedBins, jsonScene, renderer.engine);
25869
+ return _this.processTextures(loadedImages, loadedBins, jsonScene);
24228
25870
  })
24229
25871
  ];
24230
- case 10:
25872
+ case 7:
24231
25873
  loadedTextures = _state.sent();
24232
25874
  scene = {
24233
25875
  timeInfos: timeInfos,
@@ -24236,7 +25878,6 @@ var seed$1 = 1;
24236
25878
  storage: {},
24237
25879
  pluginSystem: pluginSystem,
24238
25880
  jsonScene: jsonScene,
24239
- usedImages: usedImages,
24240
25881
  images: loadedImages,
24241
25882
  textureOptions: loadedTextures,
24242
25883
  bins: loadedBins
@@ -24248,10 +25889,10 @@ var seed$1 = 1;
24248
25889
  return pluginSystem.loadResources(scene, _this.options);
24249
25890
  })
24250
25891
  ];
24251
- case 11:
25892
+ case 8:
24252
25893
  _state.sent();
24253
- _state.label = 12;
24254
- case 12:
25894
+ _state.label = 9;
25895
+ case 9:
24255
25896
  totalTime = performance.now() - startTime;
24256
25897
  logger.info("Load asset: totalTime: " + totalTime.toFixed(4) + "ms " + timeInfoMessages.join(" ") + ", url: " + assetUrl + ".");
24257
25898
  window.clearTimeout(loadTimer);
@@ -24279,7 +25920,6 @@ var seed$1 = 1;
24279
25920
  };
24280
25921
  _proto.precompile = function precompile(compositions, pluginSystem, renderer, options) {
24281
25922
  return _async_to_generator(function() {
24282
- var shaderLibrary;
24283
25923
  return __generator(this, function(_state) {
24284
25924
  switch(_state.label){
24285
25925
  case 0:
@@ -24288,22 +25928,11 @@ var seed$1 = 1;
24288
25928
  2
24289
25929
  ];
24290
25930
  }
24291
- shaderLibrary = renderer == null ? void 0 : renderer.getShaderLibrary();
24292
25931
  return [
24293
25932
  4,
24294
25933
  pluginSystem == null ? void 0 : pluginSystem.precompile(compositions, renderer, options)
24295
25934
  ];
24296
25935
  case 1:
24297
- _state.sent();
24298
- return [
24299
- 4,
24300
- new Promise(function(resolve) {
24301
- shaderLibrary == null ? void 0 : shaderLibrary.compileAllShaders(function() {
24302
- resolve(null);
24303
- });
24304
- })
24305
- ];
24306
- case 2:
24307
25936
  _state.sent();
24308
25937
  return [
24309
25938
  2
@@ -24315,12 +25944,12 @@ var seed$1 = 1;
24315
25944
  _proto.processJSON = function processJSON(json) {
24316
25945
  var _this = this;
24317
25946
  return _async_to_generator(function() {
24318
- var jsonScene, _jsonScene_plugins, plugins, sceneCompositions, imgUsage, images, pluginSystem, renderLevel, usedImages;
25947
+ var jsonScene, _jsonScene_plugins, plugins, pluginSystem;
24319
25948
  return __generator(this, function(_state) {
24320
25949
  switch(_state.label){
24321
25950
  case 0:
24322
25951
  jsonScene = getStandardJSON(json);
24323
- _jsonScene_plugins = jsonScene.plugins, plugins = _jsonScene_plugins === void 0 ? [] : _jsonScene_plugins, sceneCompositions = jsonScene.compositions, imgUsage = jsonScene.imgUsage, images = jsonScene.images;
25952
+ _jsonScene_plugins = jsonScene.plugins, plugins = _jsonScene_plugins === void 0 ? [] : _jsonScene_plugins;
24324
25953
  pluginSystem = new PluginSystem(plugins);
24325
25954
  return [
24326
25955
  4,
@@ -24328,20 +25957,9 @@ var seed$1 = 1;
24328
25957
  ];
24329
25958
  case 1:
24330
25959
  _state.sent();
24331
- renderLevel = _this.options.renderLevel;
24332
- usedImages = {};
24333
- if (imgUsage) {
24334
- // TODO: 考虑放到独立的 fix 文件
24335
- fixOldImageUsage(usedImages, sceneCompositions, imgUsage, images, renderLevel);
24336
- } else {
24337
- images == null ? void 0 : images.forEach(function(_, i) {
24338
- usedImages[i] = true;
24339
- });
24340
- }
24341
25960
  return [
24342
25961
  2,
24343
25962
  {
24344
- usedImages: usedImages,
24345
25963
  jsonScene: jsonScene,
24346
25964
  pluginSystem: pluginSystem
24347
25965
  }
@@ -24413,7 +26031,6 @@ var seed$1 = 1;
24413
26031
  ];
24414
26032
  case 2:
24415
26033
  _state.sent();
24416
- //@ts-expect-error
24417
26034
  document.fonts.add(fontFace);
24418
26035
  AssetManager.fonts.add(font.fontFamily);
24419
26036
  return [
@@ -24495,6 +26112,10 @@ var seed$1 = 1;
24495
26112
  3,
24496
26113
  3
24497
26114
  ];
26115
+ _this.assets[idx] = {
26116
+ url: resultImage.src,
26117
+ type: TextureSourceType.video
26118
+ };
24498
26119
  return [
24499
26120
  2,
24500
26121
  resultImage
@@ -24504,6 +26125,10 @@ var seed$1 = 1;
24504
26125
  if (background && Array.isArray(url) && variables) {
24505
26126
  variables[background.name] = resultImage.src;
24506
26127
  }
26128
+ _this.assets[idx] = {
26129
+ url: resultImage.src,
26130
+ type: TextureSourceType.image
26131
+ };
24507
26132
  return [
24508
26133
  4,
24509
26134
  combineImageTemplate(resultImage, template, variables)
@@ -24546,12 +26171,6 @@ var seed$1 = 1;
24546
26171
  _this.loadBins(bufferURL)
24547
26172
  ];
24548
26173
  }
24549
- } else if ("sourceType" in img) {
24550
- // TODO: 确定是否有用
24551
- return [
24552
- 2,
24553
- img
24554
- ];
24555
26174
  } else if (_instanceof1(img, HTMLImageElement) || _instanceof1(img, HTMLCanvasElement) || _instanceof1(img, HTMLVideoElement) || _instanceof1(img, Texture)) {
24556
26175
  return [
24557
26176
  2,
@@ -24602,7 +26221,7 @@ var seed$1 = 1;
24602
26221
  });
24603
26222
  })();
24604
26223
  };
24605
- _proto.processTextures = function processTextures(images, bins, jsonScene, engine) {
26224
+ _proto.processTextures = function processTextures(images, bins, jsonScene) {
24606
26225
  var _this = this;
24607
26226
  return _async_to_generator(function() {
24608
26227
  var _jsonScene_textures, textures, jobs;
@@ -24613,7 +26232,7 @@ var seed$1 = 1;
24613
26232
  };
24614
26233
  });
24615
26234
  jobs = textures.map(/*#__PURE__*/ _async_to_generator(function(textureOptions, idx) {
24616
- var e, source, image, texture;
26235
+ var e, source, id, image, texture;
24617
26236
  return __generator(this, function(_state) {
24618
26237
  switch(_state.label){
24619
26238
  case 0:
@@ -24637,7 +26256,7 @@ var seed$1 = 1;
24637
26256
  ]);
24638
26257
  return [
24639
26258
  4,
24640
- deserializeMipmapTexture(textureOptions, bins, engine, jsonScene.bins)
26259
+ deserializeMipmapTexture(textureOptions, bins, _this.assets, jsonScene.bins)
24641
26260
  ];
24642
26261
  case 2:
24643
26262
  return [
@@ -24648,12 +26267,12 @@ var seed$1 = 1;
24648
26267
  e = _state.sent();
24649
26268
  throw new Error("Load texture " + idx + " fails, error message: " + e + ".");
24650
26269
  case 4:
24651
- source = textureOptions.source;
26270
+ source = textureOptions.source, id = textureOptions.id;
24652
26271
  if (!isObject(source)) return [
24653
26272
  3,
24654
26273
  5
24655
26274
  ];
24656
- image = engine.assetLoader.loadGUID(source.id).data;
26275
+ image = _this.assets[source.id];
24657
26276
  return [
24658
26277
  3,
24659
26278
  7
@@ -24672,9 +26291,7 @@ var seed$1 = 1;
24672
26291
  _state.label = 7;
24673
26292
  case 7:
24674
26293
  if (image) {
24675
- texture = createTextureOptionsBySource(image, _this.assets[idx]);
24676
- texture.id = textureOptions.id;
24677
- texture.dataType = DataType.Texture;
26294
+ texture = createTextureOptionsBySource(image, _this.assets[idx], id);
24678
26295
  return [
24679
26296
  2,
24680
26297
  texture.sourceType === TextureSourceType.compressed ? texture : _extends({}, texture, textureOptions)
@@ -24735,11 +26352,6 @@ var seed$1 = 1;
24735
26352
  return window.clearTimeout(id);
24736
26353
  });
24737
26354
  }
24738
- for(var key in this.assets){
24739
- var _asset_dispose;
24740
- var asset = this.assets[key];
24741
- asset == null ? void 0 : (_asset_dispose = asset.dispose) == null ? void 0 : _asset_dispose.call(asset);
24742
- }
24743
26355
  this.assets = {};
24744
26356
  this.timers = [];
24745
26357
  };
@@ -24748,55 +26360,44 @@ var seed$1 = 1;
24748
26360
  /**
24749
26361
  * 自定义文本缓存,随页面销毁而销毁
24750
26362
  */ AssetManager.fonts = new Set();
24751
- function fixOldImageUsage(usedImages, compositions, imgUsage, images, renderLevel) {
24752
- for(var i = 0; i < compositions.length; i++){
24753
- var id = compositions[i].id;
24754
- var ids = imgUsage[id];
24755
- if (ids) {
24756
- for(var j = 0; j < ids.length; j++){
24757
- var id1 = ids[j];
24758
- var tag = images[id1].renderLevel;
24759
- if (passRenderLevel(tag, renderLevel)) {
24760
- usedImages[id1] = true;
24761
- }
24762
- }
24763
- }
24764
- }
24765
- }
24766
- function createTextureOptionsBySource(image, sourceFrom) {
26363
+ function createTextureOptionsBySource(image, sourceFrom, id) {
26364
+ var options = {
26365
+ id: id,
26366
+ dataType: DataType.Texture
26367
+ };
24767
26368
  if (_instanceof1(image, Texture)) {
24768
- return image.source;
26369
+ return _extends({}, image.source, options);
24769
26370
  } else if (_instanceof1(image, HTMLImageElement) || isCanvas(image)) {
24770
- return {
26371
+ return _extends({
24771
26372
  image: image,
24772
26373
  sourceType: TextureSourceType.image,
24773
26374
  sourceFrom: sourceFrom,
24774
26375
  keepImageSource: true,
24775
26376
  minFilter: glContext.LINEAR,
24776
26377
  magFilter: glContext.LINEAR
24777
- };
26378
+ }, options);
24778
26379
  } else if (_instanceof1(image, HTMLVideoElement)) {
24779
26380
  // 视频
24780
- return {
26381
+ return _extends({
24781
26382
  sourceType: TextureSourceType.video,
24782
26383
  video: image,
24783
26384
  minFilter: glContext.LINEAR,
24784
26385
  magFilter: glContext.LINEAR
24785
- };
26386
+ }, options);
24786
26387
  } else if (_instanceof1(image, ArrayBuffer)) {
24787
26388
  // 压缩纹理
24788
26389
  return _extends({}, getKTXTextureOptions(image), {
24789
26390
  sourceFrom: sourceFrom
24790
- });
26391
+ }, options);
24791
26392
  } else if ("width" in image && "height" in image && "data" in image) {
24792
- return {
26393
+ return _extends({
24793
26394
  sourceType: TextureSourceType.data,
24794
26395
  data: image,
24795
26396
  wrapS: glContext.CLAMP_TO_EDGE,
24796
26397
  wrapT: glContext.CLAMP_TO_EDGE,
24797
26398
  minFilter: glContext.NEAREST,
24798
26399
  magFilter: glContext.NEAREST
24799
- };
26400
+ }, options);
24800
26401
  }
24801
26402
  throw new Error("Invalid texture options.");
24802
26403
  }
@@ -25100,11 +26701,12 @@ var listOrder = 0;
25100
26701
  function CompositionSourceManager(scene, engine) {
25101
26702
  this.refCompositions = new Map();
25102
26703
  this.refCompositionProps = new Map();
26704
+ this.imgUsage = {};
25103
26705
  this.mask = 0;
25104
26706
  this.engine = engine;
25105
26707
  // 资源
25106
26708
  var jsonScene = scene.jsonScene, renderLevel = scene.renderLevel, textureOptions = scene.textureOptions, pluginSystem = scene.pluginSystem, totalTime = scene.totalTime;
25107
- var compositions = jsonScene.compositions, imgUsage = jsonScene.imgUsage, compositionId = jsonScene.compositionId;
26709
+ var compositions = jsonScene.compositions, compositionId = jsonScene.compositionId;
25108
26710
  if (!textureOptions) {
25109
26711
  throw new Error("scene.textures expected.");
25110
26712
  }
@@ -25124,7 +26726,6 @@ var listOrder = 0;
25124
26726
  this.renderLevel = renderLevel;
25125
26727
  this.pluginSystem = pluginSystem;
25126
26728
  this.totalTime = totalTime != null ? totalTime : 0;
25127
- this.imgUsage = imgUsage != null ? imgUsage : {};
25128
26729
  this.textures = cachedTextures;
25129
26730
  listOrder = 0;
25130
26731
  this.sourceContent = this.getContent(this.composition);
@@ -25145,11 +26746,12 @@ var listOrder = 0;
25145
26746
  });
25146
26747
  };
25147
26748
  _proto.assembleItems = function assembleItems(composition) {
26749
+ var _this_jsonScene;
25148
26750
  var items = [];
25149
- this.mask++;
25150
26751
  var componentMap = {};
25151
- //@ts-expect-error
25152
- for(var _iterator = _create_for_of_iterator_helper_loose(this.jsonScene.components), _step; !(_step = _iterator()).done;){
26752
+ this.mask++;
26753
+ var _this_jsonScene_components;
26754
+ for(var _iterator = _create_for_of_iterator_helper_loose((_this_jsonScene_components = (_this_jsonScene = this.jsonScene) == null ? void 0 : _this_jsonScene.components) != null ? _this_jsonScene_components : []), _step; !(_step = _iterator()).done;){
25153
26755
  var component = _step.value;
25154
26756
  componentMap[component.id] = component;
25155
26757
  }
@@ -25186,19 +26788,24 @@ var listOrder = 0;
25186
26788
  _proto.preProcessItemContent = function preProcessItemContent(renderContent) {
25187
26789
  if (renderContent.renderer) {
25188
26790
  renderContent.renderer = this.changeTex(renderContent.renderer);
25189
- if (!renderContent.renderer.mask) {
26791
+ if (!("mask" in renderContent.renderer)) {
25190
26792
  this.processMask(renderContent.renderer);
25191
26793
  }
25192
- var split = renderContent.splits && !renderContent.textureSheetAnimation && renderContent.splits[0];
25193
- if (Number.isInteger(renderContent.renderer.shape)) {
26794
+ var split = renderContent.splits && !renderContent.textureSheetAnimation ? renderContent.splits[0] : undefined;
26795
+ var shape = renderContent.renderer.shape;
26796
+ var shapeData;
26797
+ if (Number.isInteger(shape)) {
25194
26798
  var _this_jsonScene;
25195
- // TODO: scene.shapes 类型问题?
25196
- renderContent.renderer.shape = getGeometryByShape((_this_jsonScene = this.jsonScene) == null ? void 0 : _this_jsonScene.shapes[renderContent.renderer.shape], split);
25197
- } else if (renderContent.renderer.shape && isObject(renderContent.renderer.shape)) {
25198
- renderContent.renderer.shape = getGeometryByShape(renderContent.renderer.shape, split);
26799
+ shapeData = (_this_jsonScene = this.jsonScene) == null ? void 0 : _this_jsonScene.shapes[shape];
26800
+ } else {
26801
+ shapeData = shape;
26802
+ }
26803
+ if (shapeData !== undefined) {
26804
+ // @ts-expect-error 类型转换问题
26805
+ renderContent.renderer.shape = getGeometryByShape(shapeData, split);
25199
26806
  }
25200
26807
  }
25201
- if (renderContent.trails) {
26808
+ if ("trails" in renderContent && renderContent.trails !== undefined) {
25202
26809
  renderContent.trails = this.changeTex(renderContent.trails);
25203
26810
  }
25204
26811
  };
@@ -25206,22 +26813,17 @@ var listOrder = 0;
25206
26813
  if (!renderer.texture) {
25207
26814
  return renderer;
25208
26815
  }
25209
- //@ts-expect-error
25210
26816
  var texIdx = renderer.texture.id;
25211
26817
  if (texIdx !== undefined) {
25212
- //@ts-expect-error
25213
- this.addTextureUsage(texIdx) || texIdx;
26818
+ this.addTextureUsage(texIdx);
25214
26819
  }
25215
26820
  return renderer;
25216
26821
  };
25217
- _proto.addTextureUsage = function addTextureUsage(texIdx) {
25218
- var texId = texIdx;
26822
+ _proto.addTextureUsage = function addTextureUsage(texId) {
25219
26823
  var _this_imgUsage;
25220
- // FIXME: imageUsage 取自 scene.imgUsage,类型为 Record<string, number[]>,这里给的 number,类型对不上
25221
26824
  var imageUsage = (_this_imgUsage = this.imgUsage) != null ? _this_imgUsage : {};
25222
26825
  if (texId && imageUsage) {
25223
- // eslint-disable-next-line no-prototype-builtins
25224
- if (!imageUsage.hasOwnProperty(texId)) {
26826
+ if (!Object.prototype.hasOwnProperty.call(imageUsage, texId)) {
25225
26827
  imageUsage[texId] = 0;
25226
26828
  }
25227
26829
  imageUsage[texId]++;
@@ -25392,7 +26994,6 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
25392
26994
  _this.lastVideoUpdateTime = 0;
25393
26995
  var _props_reusable = props.reusable, reusable = _props_reusable === void 0 ? false : _props_reusable, _props_speed = props.speed, speed = _props_speed === void 0 ? 1 : _props_speed, _props_baseRenderOrder = props.baseRenderOrder, baseRenderOrder = _props_baseRenderOrder === void 0 ? 0 : _props_baseRenderOrder, renderer = props.renderer, event = props.event, width = props.width, height = props.height, handleItemMessage = props.handleItemMessage;
25394
26996
  _this.compositionSourceManager = new CompositionSourceManager(scene, renderer.engine);
25395
- scene.jsonScene.imgUsage = undefined;
25396
26997
  if (reusable) {
25397
26998
  _this.keepResource = true;
25398
26999
  scene.textures = undefined;
@@ -25411,24 +27012,23 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
25411
27012
  _this.rootComposition.data = sourceContent;
25412
27013
  _this.rootComposition.item = _this.rootItem;
25413
27014
  _this.rootItem.components.push(_this.rootComposition);
25414
- var imageUsage = !reusable && imgUsage;
25415
27015
  _this.width = width;
25416
27016
  _this.height = height;
25417
27017
  _this.renderOrder = baseRenderOrder;
25418
27018
  _this.id = sourceContent.id;
25419
27019
  _this.renderer = renderer;
25420
- _this.texInfo = imageUsage != null ? imageUsage : {};
27020
+ _this.texInfo = !reusable ? imgUsage : {};
25421
27021
  _this.event = event;
25422
- var _scene_startTime, _scene_timeInfos_asyncCompile;
27022
+ var _scene_startTime;
25423
27023
  _this.statistic = {
25424
- loadTime: totalTime != null ? totalTime : 0,
25425
27024
  loadStart: (_scene_startTime = scene.startTime) != null ? _scene_startTime : 0,
25426
- firstFrameTime: 0,
25427
- precompileTime: (_scene_timeInfos_asyncCompile = scene.timeInfos["asyncCompile"]) != null ? _scene_timeInfos_asyncCompile : scene.timeInfos["syncCompile"]
27025
+ loadTime: totalTime != null ? totalTime : 0,
27026
+ compileTime: 0,
27027
+ firstFrameTime: 0
25428
27028
  };
25429
27029
  _this.reusable = reusable;
25430
27030
  _this.speed = speed;
25431
- _this.autoRefTex = !_this.keepResource && imageUsage && _this.rootItem.endBehavior !== EndBehavior.restart;
27031
+ _this.autoRefTex = !_this.keepResource && _this.texInfo && _this.rootItem.endBehavior !== EndBehavior.restart;
25432
27032
  _this.name = sourceContent.name;
25433
27033
  _this.pluginSystem = pluginSystem;
25434
27034
  _this.pluginSystem.initializeComposition(_assert_this_initialized(_this), scene);
@@ -25600,6 +27200,7 @@ var LateUpdateTickData = /*#__PURE__*/ function(TickData) {
25600
27200
  */ _proto.reset = function reset() {
25601
27201
  this.rendererOptions = null;
25602
27202
  this.rootItem.ended = false;
27203
+ this.rootComposition.time = 0;
25603
27204
  this.pluginSystem.resetComposition(this, this.renderFrame);
25604
27205
  };
25605
27206
  _proto.prepareRender = function prepareRender() {
@@ -28124,7 +29725,7 @@ __decorate([
28124
29725
  serialize()
28125
29726
  ], BinaryAsset.prototype, "buffer", void 0);
28126
29727
  BinaryAsset = __decorate([
28127
- effectsClass("BinaryAsset")
29728
+ effectsClass(DataType.BinaryAsset)
28128
29729
  ], BinaryAsset);
28129
29730
 
28130
29731
  registerPlugin("camera", CameraVFXItemLoader, VFXItem, true);
@@ -28133,7 +29734,7 @@ registerPlugin("sprite", SpriteLoader, VFXItem, true);
28133
29734
  registerPlugin("particle", ParticleLoader, VFXItem, true);
28134
29735
  registerPlugin("cal", CalculateLoader, VFXItem, true);
28135
29736
  registerPlugin("interact", InteractLoader, VFXItem, true);
28136
- var version$1 = "2.1.0-alpha.5";
29737
+ var version$1 = "2.1.0-alpha.6";
28137
29738
  logger.info("Core version: " + version$1 + ".");
28138
29739
 
28139
29740
  var _obj;
@@ -29532,13 +31133,14 @@ var ThreeRenderer = /*#__PURE__*/ function(Renderer) {
29532
31133
  opts = _extends({
29533
31134
  autoplay: true
29534
31135
  }, options);
29535
- if (isSceneURL(url)) {
29536
- source = url.url;
29537
- if (isSceneWithOptions(url)) {
31136
+ source = url;
31137
+ if (Scene.isURL(url)) {
31138
+ if (!Scene.isJSONObject(url)) {
31139
+ source = url.url;
31140
+ }
31141
+ if (Scene.isWithOptions(url)) {
29538
31142
  opts = _extends({}, opts, url.options || {});
29539
31143
  }
29540
- } else {
29541
- source = url;
29542
31144
  }
29543
31145
  if (_this.assetManager) {
29544
31146
  _this.assetManager.updateOptions(opts);
@@ -29814,8 +31416,8 @@ setMaxSpriteMeshItemCount(8);
29814
31416
  */ Mesh.create = function(engine, props) {
29815
31417
  return new ThreeMesh(engine, props);
29816
31418
  };
29817
- var version = "2.1.0-alpha.5";
31419
+ var version = "2.1.0-alpha.6";
29818
31420
  logger.info("THREEJS plugin version: " + version + ".");
29819
31421
 
29820
- export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, AssetLoader, AssetManager, BYTES_TYPE_MAP, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, CONSTANT_MAP_BLEND, CONSTANT_MAP_DEPTH, CONSTANT_MAP_STENCIL_FUNC, CONSTANT_MAP_STENCIL_OP, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, Component, Composition, CompositionComponent, CompositionSourceManager, DEFAULT_FONTS, DEFAULT_FPS, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, EffectsPackage, Engine, EventEmitter, EventSystem, FilterMode, Float16ArrayWrapper, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, Mesh, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, PluginSystem, PostProcessVolume, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderFactory, ShaderType, ShaderVariant, SpriteColorPlayable, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TEXTURE_UNIFORM_MAP, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, ThreeComposition, ThreeDisplayObject, ThreeEngine, ThreeMaterial, ThreeSpriteComponent, ThreeTextComponent, ThreeTexture, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createCopyShader, createGLContext, createKeyFrameMeta, createShape, createValueGetter, decimalEqual, defaultGlobalVolume, defaultPlugins, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureFixedNumber, ensureVec3, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID, generateHalfFloatTexture, generateTransparentTexture, generateWhiteTexture, getBackgroundImage, getColorFromGradientStops, getConfig, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getImageItemRenderInfo, getKTXTextureOptions, getKeyFrameMetaByRawValue, getMergedStore, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, glType2VertexFormatType, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAlipayMiniApp, isAndroid, isArray, isCanvas, isFunction, isIOS, isIOSByUA, isMiniProgram, isObject, isSceneJSON, isSceneURL, isSceneWithOptions, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isValidFontFamily, isWebGL2, isWechatMiniApp, itemFrag, itemFrameFrag, itemVert, loadAVIFOptional, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, maxSpriteMeshItemCount, modifyMaxKeyframeShader, nearestPowerOfTwo, noop, normalizeColor, numberToFix, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap$1 as particleOriginTranslateMap, particleUniformTypeMap, particleVert, pluginLoaderMap, randomInRange, registerPlugin, removeItem, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxItemCountByGPU, setUniformValue, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
31422
+ export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, AssetLoader, AssetManager, BYTES_TYPE_MAP, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, CONSTANT_MAP_BLEND, CONSTANT_MAP_DEPTH, CONSTANT_MAP_STENCIL_FUNC, CONSTANT_MAP_STENCIL_OP, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, Component, ComponentShapeType, Composition, CompositionComponent, CompositionSourceManager, DEFAULT_FONTS, DEFAULT_FPS, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, EffectsPackage, Engine, EventEmitter, EventSystem, FilterMode, Float16ArrayWrapper, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, Mesh, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, PluginSystem, PostProcessVolume, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, Scene, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderFactory, ShaderType, ShaderVariant, ShapeComponent, ShapeConnectType, ShapePointType, SpriteColorPlayable, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TEXTURE_UNIFORM_MAP, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, ThreeComposition, ThreeDisplayObject, ThreeEngine, ThreeMaterial, ThreeSpriteComponent, ThreeTextComponent, ThreeTexture, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createCopyShader, createGLContext, createKeyFrameMeta, createShape, createValueGetter, decimalEqual, defaultGlobalVolume, defaultPlugins, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureFixedNumber, ensureVec3, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID, generateHalfFloatTexture, generateTransparentTexture, generateWhiteTexture, getBackgroundImage, getColorFromGradientStops, getConfig, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getImageItemRenderInfo, getKTXTextureOptions, getKeyFrameMetaByRawValue, getMergedStore, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, glType2VertexFormatType, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAlipayMiniApp, isAndroid, isArray, isCanvas, isFunction, isIOS, isIOSByUA, isMiniProgram, isObject, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isValidFontFamily, isWebGL2, isWechatMiniApp, itemFrag, itemFrameFrag, itemVert, loadAVIFOptional, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, maxSpriteMeshItemCount, modifyMaxKeyframeShader, nearestPowerOfTwo, noop, normalizeColor, numberToFix, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap$1 as particleOriginTranslateMap, particleUniformTypeMap, particleVert, pluginLoaderMap, randomInRange, registerPlugin, removeItem, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxItemCountByGPU, setUniformValue, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
29821
31423
  //# sourceMappingURL=index.mjs.map