@threepipe/plugin-svg-renderer 0.2.0 → 0.2.2

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.
Files changed (59) hide show
  1. package/dist/BasicSVGRendererPlugin.d.ts +2 -2
  2. package/dist/BasicSVGRendererPlugin.d.ts.map +1 -1
  3. package/dist/ThreeSVGRendererPlugin.d.ts +2 -2
  4. package/dist/ThreeSVGRendererPlugin.d.ts.map +1 -1
  5. package/dist/basic/BasicSVGRenderer.d.ts.map +1 -1
  6. package/dist/dependencies.txt +5 -13
  7. package/dist/index.js +540 -875
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +551 -886
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/three-mesh-halfedge/core/Vertex.d.ts +1 -1
  12. package/dist/three-mesh-halfedge/operations/addEdge.d.ts +3 -3
  13. package/dist/three-mesh-halfedge/operations/addFace.d.ts +3 -3
  14. package/dist/three-mesh-halfedge/operations/addVertex.d.ts +2 -2
  15. package/dist/three-mesh-halfedge/operations/cutFace.d.ts +4 -4
  16. package/dist/three-mesh-halfedge/operations/removeEdge.d.ts +2 -2
  17. package/dist/three-mesh-halfedge/operations/removeFace.d.ts +2 -2
  18. package/dist/three-mesh-halfedge/operations/removeVertex.d.ts +2 -2
  19. package/dist/three-mesh-halfedge/operations/setFromGeometry.d.ts +1 -1
  20. package/dist/three-mesh-halfedge/operations/splitEdge.d.ts +3 -3
  21. package/dist/three-svg-renderer/SVGRenderer.d.ts +0 -1
  22. package/dist/three-svg-renderer/SVGRenderer.d.ts.map +1 -1
  23. package/dist/three-svg-renderer/core/SVGMesh.d.ts +10 -3
  24. package/dist/three-svg-renderer/core/SVGMesh.d.ts.map +1 -1
  25. package/dist/three-svg-renderer/core/index.d.ts +3 -3
  26. package/dist/three-svg-renderer/core/svg/passes/ChainPass.d.ts +0 -1
  27. package/dist/three-svg-renderer/core/svg/passes/ChainPass.d.ts.map +1 -1
  28. package/dist/three-svg-renderer/core/svg/passes/DrawPass.d.ts +0 -1
  29. package/dist/three-svg-renderer/core/svg/passes/DrawPass.d.ts.map +1 -1
  30. package/dist/three-svg-renderer/core/svg/passes/FillPass.d.ts +0 -1
  31. package/dist/three-svg-renderer/core/svg/passes/FillPass.d.ts.map +1 -1
  32. package/dist/three-svg-renderer/core/svg/passes/SingularityPointPass.d.ts +0 -1
  33. package/dist/three-svg-renderer/core/svg/passes/SingularityPointPass.d.ts.map +1 -1
  34. package/dist/three-svg-renderer/core/svg/passes/index.d.ts +4 -4
  35. package/dist/three-svg-renderer/core/svg/svgutils.d.ts +0 -1
  36. package/dist/three-svg-renderer/core/svg/svgutils.d.ts.map +1 -1
  37. package/dist/three-svg-renderer/core/viewmap/Chain.d.ts +1 -1
  38. package/dist/three-svg-renderer/core/viewmap/ViewVertex.d.ts +2 -2
  39. package/dist/three-svg-renderer/core/viewmap/Viewmap.d.ts +1 -1
  40. package/dist/three-svg-renderer/core/viewmap/Viewmap.d.ts.map +1 -1
  41. package/dist/three-svg-renderer/core/viewmap/operations/assignPolygons.d.ts +1 -1
  42. package/dist/three-svg-renderer/core/viewmap/operations/computeChainsVisibility.d.ts +2 -2
  43. package/dist/three-svg-renderer/core/viewmap/operations/computeMeshIntersections.d.ts +2 -2
  44. package/dist/three-svg-renderer/core/viewmap/operations/computePolygons.d.ts +1 -1
  45. package/dist/three-svg-renderer/core/viewmap/operations/createChains.d.ts +4 -4
  46. package/dist/three-svg-renderer/core/viewmap/operations/createViewVertex.d.ts +2 -2
  47. package/dist/three-svg-renderer/core/viewmap/operations/find2dSingularities.d.ts +1 -1
  48. package/dist/three-svg-renderer/core/viewmap/operations/find3dSingularities.d.ts +4 -4
  49. package/dist/three-svg-renderer/core/viewmap/operations/meshIntersectionCb.d.ts +2 -2
  50. package/dist/three-svg-renderer/core/viewmap/operations/setupEdges.d.ts +3 -3
  51. package/dist/three-svg-renderer/core/viewmap/operations/splitEdge.d.ts +3 -3
  52. package/dist/three-svg-renderer/index.d.ts +1 -1
  53. package/dist/three-svg-renderer/utils/buffergeometry.d.ts +1 -1
  54. package/dist/three-svg-renderer/utils/buffergeometry.d.ts.map +1 -1
  55. package/package.json +14 -3
  56. package/src/BasicSVGRendererPlugin.ts +1 -1
  57. package/src/ThreeSVGRendererPlugin.ts +4 -4
  58. package/src/basic/BasicSVGRenderer.ts +4 -4
  59. package/src/three-svg-renderer/core/SVGMesh.ts +17 -1
package/dist/index.js CHANGED
@@ -3,8 +3,8 @@
3
3
  })(this, function(exports2, threepipe, three) {
4
4
  "use strict";/**
5
5
  * @license
6
- * @threepipe/plugin-svg-renderer v0.2.0
7
- * Copyright 2022-2024 repalash <palash@shaders.app>
6
+ * @threepipe/plugin-svg-renderer v0.2.2
7
+ * Copyright 2022-2025 repalash <palash@shaders.app>
8
8
  * GPLV3 License
9
9
  * See ./dependencies.txt for any bundled third-party dependencies and licenses.
10
10
  */
@@ -114,8 +114,7 @@
114
114
  uvs.push(x2, y2);
115
115
  }
116
116
  function checkTriangleVisibility(v1, v2, v3) {
117
- if (v1.visible === true || v2.visible === true || v3.visible === true)
118
- return true;
117
+ if (v1.visible === true || v2.visible === true || v3.visible === true) return true;
119
118
  _points3[0] = v1.positionScreen;
120
119
  _points3[1] = v2.positionScreen;
121
120
  _points3[2] = v3.positionScreen;
@@ -150,8 +149,7 @@
150
149
  const v1 = _vertexPool[a];
151
150
  const v2 = _vertexPool[b];
152
151
  const v3 = _vertexPool[c];
153
- if (checkTriangleVisibility(v1, v2, v3) === false)
154
- return;
152
+ if (checkTriangleVisibility(v1, v2, v3) === false) return;
155
153
  if (material.side === threepipe.DoubleSide || checkBackfaceCulling(v1, v2, v3) === true) {
156
154
  _face = getNextFaceInPool();
157
155
  _face.id = object.id;
@@ -195,21 +193,16 @@
195
193
  }
196
194
  const renderList = new RenderList();
197
195
  function projectObject(object) {
198
- if (object.visible === false)
199
- return;
196
+ if (object.visible === false) return;
200
197
  if (object.isLight) {
201
198
  _renderData.lights.push(object);
202
199
  } else if (object.isMesh || object.isLine || object.isPoints) {
203
- if (object.material.visible === false)
204
- return;
205
- if (object.frustumCulled === true && _frustum.intersectsObject(object) === false)
206
- return;
200
+ if (object.material.visible === false) return;
201
+ if (object.frustumCulled === true && _frustum.intersectsObject(object) === false) return;
207
202
  addObject(object);
208
203
  } else if (object.isSprite) {
209
- if (object.material.visible === false)
210
- return;
211
- if (object.frustumCulled === true && _frustum.intersectsSprite(object) === false)
212
- return;
204
+ if (object.material.visible === false) return;
205
+ if (object.frustumCulled === true && _frustum.intersectsSprite(object) === false) return;
213
206
  addObject(object);
214
207
  }
215
208
  const children = object.children;
@@ -232,10 +225,8 @@
232
225
  _lineCount = 0;
233
226
  _spriteCount = 0;
234
227
  _renderData.elements.length = 0;
235
- if (scene.matrixWorldAutoUpdate === true)
236
- scene.updateMatrixWorld();
237
- if (camera.parent === null && camera.matrixWorldAutoUpdate === true)
238
- camera.updateMatrixWorld();
228
+ if (scene.matrixWorldAutoUpdate === true) scene.updateMatrixWorld();
229
+ if (camera.parent === null && camera.matrixWorldAutoUpdate === true) camera.updateMatrixWorld();
239
230
  _viewMatrix.copy(camera.matrixWorldInverse);
240
231
  _viewProjectionMatrix.multiplyMatrices(camera.projectionMatrix, _viewMatrix);
241
232
  _frustum.setFromProjectionMatrix(_viewProjectionMatrix);
@@ -258,8 +249,7 @@
258
249
  const isMultiMaterial = Array.isArray(material);
259
250
  const attributes = geometry.attributes;
260
251
  const groups = geometry.groups;
261
- if (attributes.position === void 0)
262
- continue;
252
+ if (attributes.position === void 0) continue;
263
253
  const positions = attributes.position.array;
264
254
  for (let i = 0, l = positions.length; i < l; i += 3) {
265
255
  let x2 = positions[i];
@@ -271,8 +261,7 @@
271
261
  const morphInfluences = object.morphTargetInfluences;
272
262
  for (let t = 0, tl = morphTargets.length; t < tl; t++) {
273
263
  const influence = morphInfluences[t];
274
- if (influence === 0)
275
- continue;
264
+ if (influence === 0) continue;
276
265
  const target = morphTargets[t];
277
266
  if (morphTargetsRelative) {
278
267
  x2 += target.getX(i / 3) * influence;
@@ -311,8 +300,7 @@
311
300
  for (let g = 0; g < groups.length; g++) {
312
301
  const group = groups[g];
313
302
  material = isMultiMaterial === true ? object.material[group.materialIndex] : object.material;
314
- if (material === void 0)
315
- continue;
303
+ if (material === void 0) continue;
316
304
  for (let i = group.start, l = group.start + group.count; i < l; i += 3) {
317
305
  renderList.pushTriangle(indices[i], indices[i + 1], indices[i + 2], material);
318
306
  }
@@ -327,8 +315,7 @@
327
315
  for (let g = 0; g < groups.length; g++) {
328
316
  const group = groups[g];
329
317
  material = isMultiMaterial === true ? object.material[group.materialIndex] : object.material;
330
- if (material === void 0)
331
- continue;
318
+ if (material === void 0) continue;
332
319
  for (let i = group.start, l = group.start + group.count; i < l; i += 3) {
333
320
  renderList.pushTriangle(i, i + 1, i + 2, material);
334
321
  }
@@ -505,7 +492,6 @@
505
492
  this.sortObjects = true;
506
493
  this.sortElements = true;
507
494
  this.overdraw = 0.5;
508
- this.outputColorSpace = threepipe.SRGBColorSpace;
509
495
  this.info = {
510
496
  render: {
511
497
  vertices: 0,
@@ -558,7 +544,7 @@
558
544
  }
559
545
  this.clear = function() {
560
546
  removeChildNodes();
561
- _svg.style.backgroundColor = _clearColor.getStyle(_this.outputColorSpace);
547
+ _svg.style.backgroundColor = _clearColor.getStyle();
562
548
  };
563
549
  this.render = function(scene, camera) {
564
550
  if (camera instanceof threepipe.Camera === false) {
@@ -568,7 +554,7 @@
568
554
  const background = scene.background;
569
555
  if (background && background.isColor) {
570
556
  removeChildNodes();
571
- _svg.style.backgroundColor = background.getStyle(_this.outputColorSpace);
557
+ _svg.style.backgroundColor = background.getStyle();
572
558
  } else if (this.autoClear === true) {
573
559
  this.clear();
574
560
  }
@@ -586,8 +572,7 @@
586
572
  for (let e = 0, el = _elements.length; e < el; e++) {
587
573
  const element = _elements[e];
588
574
  const material = element.material;
589
- if (material === void 0 || material.opacity === 0)
590
- continue;
575
+ if (material === void 0 || material.opacity === 0) continue;
591
576
  _elemBox.makeEmpty();
592
577
  if (element instanceof RenderableSprite) {
593
578
  _v1 = element;
@@ -609,12 +594,9 @@
609
594
  _v1 = element.v1;
610
595
  _v22 = element.v2;
611
596
  _v3 = element.v3;
612
- if (_v1.positionScreen.z < -1 || _v1.positionScreen.z > 1)
613
- continue;
614
- if (_v22.positionScreen.z < -1 || _v22.positionScreen.z > 1)
615
- continue;
616
- if (_v3.positionScreen.z < -1 || _v3.positionScreen.z > 1)
617
- continue;
597
+ if (_v1.positionScreen.z < -1 || _v1.positionScreen.z > 1) continue;
598
+ if (_v22.positionScreen.z < -1 || _v22.positionScreen.z > 1) continue;
599
+ if (_v3.positionScreen.z < -1 || _v3.positionScreen.z > 1) continue;
618
600
  _v1.positionScreen.x *= _svgWidthHalf;
619
601
  _v1.positionScreen.y *= -_svgHeightHalf;
620
602
  _v22.positionScreen.x *= _svgWidthHalf;
@@ -641,8 +623,7 @@
641
623
  if (object.isSVGObject) {
642
624
  _vector3.setFromMatrixPosition(object.matrixWorld);
643
625
  _vector3.applyMatrix4(_viewProjectionMatrix);
644
- if (_vector3.z < -1 || _vector3.z > 1)
645
- return;
626
+ if (_vector3.z < -1 || _vector3.z > 1) return;
646
627
  const x2 = _vector3.x * _svgWidthHalf;
647
628
  const y2 = -_vector3.y * _svgHeightHalf;
648
629
  const node = object.node;
@@ -678,10 +659,9 @@
678
659
  const light = lights[l];
679
660
  const lightColor = light.color;
680
661
  if (light.isDirectionalLight) {
681
- const lightPosition = _vector3.setFromMatrixPosition(light.matrixWorld).normalize();
662
+ const lightPosition = _vector3.setFromMatrixPosition(light.matrixWorld).sub(_normal2.setFromMatrixPosition(light.target.matrixWorld)).normalize();
682
663
  let amount = normal.dot(lightPosition);
683
- if (amount <= 0)
684
- continue;
664
+ if (amount <= 0) continue;
685
665
  amount *= light.intensity;
686
666
  color.r += lightColor.r * amount;
687
667
  color.g += lightColor.g * amount;
@@ -689,11 +669,9 @@
689
669
  } else if (light.isPointLight) {
690
670
  const lightPosition = _vector3.setFromMatrixPosition(light.matrixWorld);
691
671
  let amount = normal.dot(_vector3.subVectors(lightPosition, position2).normalize());
692
- if (amount <= 0)
693
- continue;
672
+ if (amount <= 0) continue;
694
673
  amount *= light.distance == 0 ? 1 : 1 - Math.min(position2.distanceTo(lightPosition) / light.distance, 1);
695
- if (amount == 0)
696
- continue;
674
+ if (amount == 0) continue;
697
675
  amount *= light.intensity;
698
676
  color.r += lightColor.r * amount;
699
677
  color.g += lightColor.g * amount;
@@ -711,14 +689,14 @@
711
689
  const path = "M" + convert(v1.x - scaleX * 0.5) + "," + convert(v1.y - scaleY * 0.5) + "h" + convert(scaleX) + "v" + convert(scaleY) + "h" + convert(-scaleX) + "z";
712
690
  let style = "";
713
691
  if (material.isSpriteMaterial || material.isPointsMaterial) {
714
- style = "fill:" + material.color.getStyle(_this.outputColorSpace) + ";fill-opacity:" + material.opacity;
692
+ style = "fill:" + material.color.getStyle() + ";fill-opacity:" + material.opacity;
715
693
  }
716
694
  addPath(style, path);
717
695
  }
718
696
  function renderLine(v1, v2, material) {
719
697
  const path = "M" + convert(v1.positionScreen.x) + "," + convert(v1.positionScreen.y) + "L" + convert(v2.positionScreen.x) + "," + convert(v2.positionScreen.y);
720
698
  if (material.isLineBasicMaterial) {
721
- let style = "fill:none;stroke:" + material.color.getStyle(_this.outputColorSpace) + ";stroke-opacity:" + material.opacity + ";stroke-width:" + material.linewidth + ";stroke-linecap:" + material.linecap;
699
+ let style = "fill:none;stroke:" + material.color.getStyle() + ";stroke-opacity:" + material.opacity + ";stroke-width:" + material.linewidth + ";stroke-linecap:" + material.linecap;
722
700
  if (material.isLineDashedMaterial) {
723
701
  style = style + ";stroke-dasharray:" + material.dashSize + "," + material.gapSize;
724
702
  }
@@ -749,17 +727,16 @@
749
727
  _color2.setRGB(_normal2.x, _normal2.y, _normal2.z).multiplyScalar(0.5).addScalar(0.5);
750
728
  }
751
729
  if (material.wireframe) {
752
- style = "fill:none;stroke:" + _color2.getStyle(_this.outputColorSpace) + ";stroke-opacity:" + material.opacity + ";stroke-width:" + material.wireframeLinewidth + ";stroke-linecap:" + material.wireframeLinecap + ";stroke-linejoin:" + material.wireframeLinejoin;
730
+ style = "fill:none;stroke:" + _color2.getStyle() + ";stroke-opacity:" + material.opacity + ";stroke-width:" + material.wireframeLinewidth + ";stroke-linecap:" + material.wireframeLinecap + ";stroke-linejoin:" + material.wireframeLinejoin;
753
731
  } else {
754
- style = "fill:" + _color2.getStyle(_this.outputColorSpace) + ";fill-opacity:" + material.opacity;
732
+ style = "fill:" + _color2.getStyle() + ";fill-opacity:" + material.opacity;
755
733
  }
756
734
  addPath(style, path);
757
735
  }
758
736
  function expand(v1, v2, pixels) {
759
737
  let x2 = v2.x - v1.x, y2 = v2.y - v1.y;
760
738
  const det = x2 * x2 + y2 * y2;
761
- if (det === 0)
762
- return;
739
+ if (det === 0) return;
763
740
  const idet = pixels / Math.sqrt(det);
764
741
  x2 *= idet;
765
742
  y2 *= idet;
@@ -801,22 +778,18 @@
801
778
  };
802
779
  /**
803
780
  * @license
804
- * uiconfig.js v0.0.12
805
- * Copyright 2022-2024 repalash <palash@shaders.app>
781
+ * uiconfig.js v0.1.3
782
+ * Copyright 2022-2025 repalash <palash@shaders.app>
806
783
  * MIT License
807
784
  */
808
- function getOrCall(s, ...args) {
809
- if (typeof s === "function")
810
- s = s(...args);
811
- return s;
812
- }
813
- function uuidV4() {
814
- const ho = (n, p) => n.toString(16).padStart(p, "0");
815
- const data2 = crypto.getRandomValues(new Uint8Array(16));
816
- data2[6] = data2[6] & 15 | 64;
817
- data2[8] = data2[8] & 63 | 128;
818
- const view = new DataView(data2.buffer);
819
- return `${ho(view.getUint32(0), 8)}-${ho(view.getUint16(4), 4)}-${ho(view.getUint16(6), 4)}-${ho(view.getUint16(8), 4)}-${ho(view.getUint32(10), 8)}${ho(view.getUint16(14), 4)}`;
785
+ function Ee(n, ...e) {
786
+ return typeof n == "function" && (n = n(...e)), n;
787
+ }
788
+ function it() {
789
+ const n = (i, r) => i.toString(16).padStart(r, "0"), e = crypto.getRandomValues(new Uint8Array(16));
790
+ e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128;
791
+ const t = new DataView(e.buffer);
792
+ return `${n(t.getUint32(0), 8)}-${n(t.getUint16(4), 4)}-${n(t.getUint16(6), 4)}-${n(t.getUint16(8), 4)}-${n(t.getUint32(10), 8)}${n(t.getUint16(14), 4)}`;
820
793
  }
821
794
  class UiConfigTypeMap {
822
795
  }
@@ -830,7 +803,7 @@
830
803
  } else {
831
804
  const uiType = valueToUiType(val);
832
805
  if (uiType === "folder") {
833
- result = generateUiFolder(key + "", val);
806
+ result = generateUiFolder(key + "", val, {}, "folder", true);
834
807
  } else if (uiType)
835
808
  result = {
836
809
  type: uiType,
@@ -855,15 +828,14 @@
855
828
  types.push(type);
856
829
  type = Object.getPrototypeOf(type);
857
830
  }
858
- if (!types.length) {
831
+ if (!types.length || Array.isArray(obj)) {
859
832
  const keys = typeof obj === "object" ? Object.keys(obj) : Array.isArray(obj) ? obj.map((_, i) => i) : [];
860
833
  for (const key of keys) {
861
834
  const val = obj[key];
862
835
  if (val === void 0 || val === null)
863
836
  continue;
864
837
  const c = () => generateValueConfig(obj, key, key + "", val);
865
- if (c)
866
- result.push(c);
838
+ result.push(c);
867
839
  }
868
840
  }
869
841
  types.reverse().forEach((t) => {
@@ -896,8 +868,8 @@
896
868
  });
897
869
  return result;
898
870
  }
899
- function generateUiFolder(label, obj, params = {}, type = "folder") {
900
- return Object.assign({ type, label, children: generateUiConfig(obj), uuid: uuidV4() }, params);
871
+ function generateUiFolder(label, obj, params = {}, type = "folder", dynamic = false) {
872
+ return Object.assign({ type, label, children: !dynamic ? generateUiConfig(obj) : () => generateUiConfig(obj), uuid: it() }, params);
901
873
  }
902
874
  function valueToUiType(val) {
903
875
  if (val === null || val === void 0)
@@ -951,7 +923,7 @@
951
923
  return class extends constructor {
952
924
  constructor() {
953
925
  super(...arguments);
954
- this.uiConfig = generateUiFolder(getOrCall(label, this) || "", this, params || {}, type);
926
+ this.uiConfig = generateUiFolder(Ee(label, this) || "", this, {}, type);
955
927
  }
956
928
  };
957
929
  };
@@ -970,62 +942,66 @@
970
942
  function uiFolderContainer(label, params) {
971
943
  return uiContainer(label, params, "folder");
972
944
  }
945
+ typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
946
+ var e = new Error(message);
947
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
948
+ };
973
949
  /**
974
950
  * @license
975
- * ts-browser-helpers v0.12.0
976
- * Copyright 2022-2024 repalash <palash@shaders.app>
951
+ * ts-browser-helpers v0.16.2
952
+ * Copyright 2022-2025 repalash <palash@shaders.app>
977
953
  * MIT License
954
+ * See ./dependencies.txt for bundled third-party dependencies and licenses.
978
955
  */
979
- function onChange(fnKey, paramType = "param") {
980
- if (!fnKey)
981
- throw new Error("onChange: fnKey is undefined, make sure the function exists or provide a string");
982
- return (targetPrototype, propertyKey) => {
983
- Object.defineProperty(targetPrototype, propertyKey, {
956
+ function v(n, e) {
957
+ return Object.hasOwn ? Object.hasOwn(n, e) : n.hasOwnProperty(e);
958
+ }
959
+ const m = class m2 {
960
+ static callFunction(e, t, i = []) {
961
+ if (!t) return e(...i);
962
+ if (e.name && t[e.name] === e) return e.call(t, ...i);
963
+ m2.methodMap.has(t) || m2.methodMap.set(t, /* @__PURE__ */ new WeakMap());
964
+ const r = m2.methodMap.get(t);
965
+ if (!r.has(e)) {
966
+ let s = t;
967
+ for (; s; ) {
968
+ const o = Object.values(Object.getOwnPropertyDescriptors(s));
969
+ for (let c of o)
970
+ if (c.value === e)
971
+ return r.set(e, true), e.call(t, ...i);
972
+ s = Object.getPrototypeOf(s);
973
+ }
974
+ r.set(e, false);
975
+ }
976
+ return r.get(e) ? e.call(t, ...i) : e(...i);
977
+ }
978
+ };
979
+ m.methodMap = /* @__PURE__ */ new WeakMap();
980
+ let E = m;
981
+ function x$4(n, e = "param") {
982
+ if (!n) throw new Error("onChange: fnKey is undefined, make sure the function exists or provide a string");
983
+ return (t, i, r) => {
984
+ const s = {
984
985
  get() {
985
- return this[`_oc_${propertyKey}`];
986
+ return this[`_oc_${i}`];
986
987
  },
987
- set(newVal) {
988
- var _a;
989
- const oldVal = this[`_oc_${propertyKey}`];
990
- if (oldVal === newVal)
991
- return;
992
- this[`_oc_${propertyKey}`] = newVal;
993
- const params = paramType === "param" ? [propertyKey, newVal, oldVal, this] : paramType === "object" ? [{ key: propertyKey, value: newVal, oldValue: oldVal, target: this }] : "";
994
- if (typeof fnKey === "string")
995
- (_a = this[fnKey]) === null || _a === void 0 ? void 0 : _a.call(this, ...params);
996
- else if (typeof fnKey === "function") {
997
- let called = false;
998
- if (fnKey.name) {
999
- let p = this;
1000
- while (p) {
1001
- const fn = p[fnKey.name];
1002
- if (fn === fnKey) {
1003
- fnKey.call(this, ...params);
1004
- called = true;
1005
- break;
1006
- } else if (fn && fn.name && fn.name.endsWith(`bound ${fnKey.name}`)) {
1007
- fn(...params);
1008
- called = true;
1009
- break;
1010
- }
1011
- p = Object.getPrototypeOf(p);
1012
- }
1013
- }
1014
- if (!called) {
1015
- if (fnKey.name && this[fnKey.name].name.endsWith(`bound ${fnKey.name}`))
1016
- this[fnKey.name](...params);
1017
- else
1018
- fnKey(...params);
1019
- }
1020
- }
988
+ set(o) {
989
+ var u;
990
+ const c = this[`_oc_${i}`];
991
+ if (c === o) return;
992
+ this[`_oc_${i}`] = o;
993
+ const a = e === "param" ? [i, o, c, this] : e === "object" ? [{ key: i, value: o, oldValue: c, target: this }] : [];
994
+ typeof n == "string" ? (u = this[n]) == null || u.call(this, ...a) : typeof n == "function" && E.callFunction(n, this, a);
1021
995
  }
1022
- });
996
+ };
997
+ if (r)
998
+ return v(r, "value") && delete r.value, v(r, "writable") && delete r.writable, v(r, "initializer") && delete r.initializer, Object.assign(r, s);
999
+ Object.defineProperty(t, i, s);
1023
1000
  };
1024
1001
  }
1025
- function onChange2(fnKey, paramType = "void") {
1026
- if (!fnKey)
1027
- throw new Error("onChange: fnKey is undefined, make sure the function exists or provide a string");
1028
- return onChange(fnKey, paramType);
1002
+ function ze(n, e = "void") {
1003
+ if (!n) throw new Error("onChange: fnKey is undefined, make sure the function exists or provide a string");
1004
+ return x$4(n, e);
1029
1005
  }
1030
1006
  var __defProp$2 = Object.defineProperty;
1031
1007
  var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
@@ -1034,8 +1010,7 @@
1034
1010
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
1035
1011
  if (decorator = decorators[i])
1036
1012
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1037
- if (kind && result)
1038
- __defProp$2(target, key, result);
1013
+ if (kind && result) __defProp$2(target, key, result);
1039
1014
  return result;
1040
1015
  };
1041
1016
  exports2.BasicSVGRenderer = class BasicSVGRenderer extends SVGRenderer$1 {
@@ -1061,7 +1036,7 @@
1061
1036
  ], exports2.BasicSVGRenderer.prototype, "overdraw", 2);
1062
1037
  __decorateClass$2([
1063
1038
  uiDropdown(void 0, ["low", "high"]),
1064
- onChange2(exports2.BasicSVGRenderer.prototype._refresh)
1039
+ ze(exports2.BasicSVGRenderer.prototype._refresh)
1065
1040
  ], exports2.BasicSVGRenderer.prototype, "quality", 2);
1066
1041
  exports2.BasicSVGRenderer = __decorateClass$2([
1067
1042
  uiFolderContainer("Basic SVG Renderer")
@@ -1073,8 +1048,7 @@
1073
1048
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
1074
1049
  if (decorator = decorators[i])
1075
1050
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1076
- if (kind && result)
1077
- __defProp$1(target, key, result);
1051
+ if (kind && result) __defProp$1(target, key, result);
1078
1052
  return result;
1079
1053
  };
1080
1054
  exports2.BasicSVGRendererPlugin = class BasicSVGRendererPlugin extends threepipe.AViewerPluginSync {
@@ -1091,8 +1065,7 @@
1091
1065
  this.autoRender = true;
1092
1066
  this._viewerListeners = {
1093
1067
  postRender: (_) => {
1094
- if (this.autoRender)
1095
- this.render();
1068
+ if (this.autoRender) this.render();
1096
1069
  }
1097
1070
  };
1098
1071
  this._onResize = this._onResize.bind(this);
@@ -1136,10 +1109,8 @@
1136
1109
  this.renderer.domElement.style.display = "none";
1137
1110
  }
1138
1111
  render() {
1139
- if (!this._viewer)
1140
- return;
1141
- if (this.isDisabled())
1142
- return;
1112
+ if (!this._viewer) return;
1113
+ if (this.isDisabled()) return;
1143
1114
  this.renderer.render(this._viewer.scene, this._viewer.scene.mainCamera);
1144
1115
  }
1145
1116
  download() {
@@ -1152,13 +1123,11 @@
1152
1123
  return this.renderer.domElement;
1153
1124
  }
1154
1125
  _refreshParams() {
1155
- if (this.isDisabled())
1156
- return;
1126
+ if (this.isDisabled()) return;
1157
1127
  this.renderer.setQuality("medium");
1158
1128
  }
1159
1129
  _onResize() {
1160
- if (!this._viewer)
1161
- return;
1130
+ if (!this._viewer) return;
1162
1131
  this.renderer.setSize(this._viewer.canvas.clientWidth, this._viewer.canvas.clientHeight);
1163
1132
  }
1164
1133
  };
@@ -1218,7 +1187,7 @@
1218
1187
  }
1219
1188
  toJSON() {
1220
1189
  return {
1221
- id: [...this.a.vertices].map((v) => v.id).join(",") + "-" + [...this.b.vertices].map((v) => v.id).join(",")
1190
+ id: [...this.a.vertices].map((v2) => v2.id).join(",") + "-" + [...this.b.vertices].map((v2) => v2.id).join(",")
1222
1191
  };
1223
1192
  }
1224
1193
  clone() {
@@ -1486,7 +1455,7 @@
1486
1455
  }
1487
1456
  };
1488
1457
  var Arrangement2D = (() => {
1489
- var _scriptDir = typeof document === "undefined" && typeof location === "undefined" ? require("url").pathToFileURL(__filename).href : typeof document === "undefined" ? location.href : _documentCurrentScript && _documentCurrentScript.src || new URL("index.js", document.baseURI).href;
1458
+ var _scriptDir = typeof document === "undefined" && typeof location === "undefined" ? require("url").pathToFileURL(__filename).href : typeof document === "undefined" ? location.href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("index.js", document.baseURI).href;
1490
1459
  return function(Arrangement2D2) {
1491
1460
  Arrangement2D2 = Arrangement2D2 || {};
1492
1461
  var Module = typeof Arrangement2D2 != "undefined" ? Arrangement2D2 : {};
@@ -1884,8 +1853,7 @@
1884
1853
  }
1885
1854
  var read_, readAsync, readBinary;
1886
1855
  function logExceptionOnExit(e) {
1887
- if (e instanceof ExitStatus)
1888
- return;
1856
+ if (e instanceof ExitStatus) return;
1889
1857
  let toLog = e;
1890
1858
  if (e && typeof e == "object" && e.stack) {
1891
1859
  toLog = [e, e.stack];
@@ -1896,8 +1864,7 @@
1896
1864
  var nodePath;
1897
1865
  var requireNodeFS;
1898
1866
  if (ENVIRONMENT_IS_NODE) {
1899
- if (!(typeof process == "object" && typeof require == "function"))
1900
- throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
1867
+ if (!(typeof process == "object" && typeof require == "function")) throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
1901
1868
  if (ENVIRONMENT_IS_WORKER) {
1902
1869
  scriptDirectory = require("path").dirname(scriptDirectory) + "/";
1903
1870
  } else {
@@ -1934,10 +1901,8 @@
1934
1901
  requireNodeFS();
1935
1902
  filename = nodePath["normalize"](filename);
1936
1903
  fs.readFile(filename, function(err2, data2) {
1937
- if (err2)
1938
- onerror(err2);
1939
- else
1940
- onload(data2.buffer);
1904
+ if (err2) onerror(err2);
1905
+ else onload(data2.buffer);
1941
1906
  });
1942
1907
  };
1943
1908
  if (process["argv"].length > 1) {
@@ -1953,19 +1918,16 @@
1953
1918
  throw reason;
1954
1919
  });
1955
1920
  quit_ = (status, toThrow) => {
1956
- if (keepRuntimeAlive()) {
1921
+ {
1957
1922
  process["exitCode"] = status;
1958
1923
  throw toThrow;
1959
1924
  }
1960
- logExceptionOnExit(toThrow);
1961
- process["exit"](status);
1962
1925
  };
1963
1926
  Module["inspect"] = function() {
1964
1927
  return "[Emscripten Module object]";
1965
1928
  };
1966
1929
  } else if (ENVIRONMENT_IS_SHELL) {
1967
- if (typeof process == "object" && typeof require === "function" || typeof window == "object" || typeof importScripts == "function")
1968
- throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
1930
+ if (typeof process == "object" && typeof require === "function" || typeof window == "object" || typeof importScripts == "function") throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
1969
1931
  if (typeof read != "undefined") {
1970
1932
  read_ = function shell_read(f) {
1971
1933
  const data2 = tryParseAsDataURI(f);
@@ -2001,8 +1963,7 @@
2001
1963
  };
2002
1964
  }
2003
1965
  if (typeof print != "undefined") {
2004
- if (typeof console == "undefined")
2005
- console = {};
1966
+ if (typeof console == "undefined") console = {};
2006
1967
  console.log = print;
2007
1968
  console.warn = console.error = typeof printErr != "undefined" ? printErr : print;
2008
1969
  }
@@ -2020,8 +1981,7 @@
2020
1981
  } else {
2021
1982
  scriptDirectory = "";
2022
1983
  }
2023
- if (!(typeof window == "object" || typeof importScripts == "function"))
2024
- throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
1984
+ if (!(typeof window == "object" || typeof importScripts == "function")) throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
2025
1985
  {
2026
1986
  read_ = (url) => {
2027
1987
  try {
@@ -2082,14 +2042,11 @@
2082
2042
  Object.assign(Module, moduleOverrides);
2083
2043
  moduleOverrides = null;
2084
2044
  checkIncomingModuleAPI();
2085
- if (Module["arguments"])
2086
- Module["arguments"];
2045
+ if (Module["arguments"]) Module["arguments"];
2087
2046
  legacyModuleProp("arguments", "arguments_");
2088
- if (Module["thisProgram"])
2089
- thisProgram = Module["thisProgram"];
2047
+ if (Module["thisProgram"]) thisProgram = Module["thisProgram"];
2090
2048
  legacyModuleProp("thisProgram", "thisProgram");
2091
- if (Module["quit"])
2092
- quit_ = Module["quit"];
2049
+ if (Module["quit"]) quit_ = Module["quit"];
2093
2050
  legacyModuleProp("quit", "quit_");
2094
2051
  assert(typeof Module["memoryInitializerPrefixURL"] == "undefined", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");
2095
2052
  assert(typeof Module["pthreadMainPrefixURL"] == "undefined", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");
@@ -2106,8 +2063,7 @@
2106
2063
  legacyModuleProp("setWindowTitle", "setWindowTitle");
2107
2064
  assert(!ENVIRONMENT_IS_SHELL, "shell environment detected but not enabled at build time. Add 'shell' to `-sENVIRONMENT` to enable.");
2108
2065
  function warnOnce(text) {
2109
- if (!warnOnce.shown)
2110
- warnOnce.shown = {};
2066
+ if (!warnOnce.shown) warnOnce.shown = {};
2111
2067
  if (!warnOnce.shown[text]) {
2112
2068
  warnOnce.shown[text] = 1;
2113
2069
  err(text);
@@ -2145,8 +2101,7 @@
2145
2101
  }
2146
2102
  }
2147
2103
  var wasmBinary;
2148
- if (Module["wasmBinary"])
2149
- wasmBinary = Module["wasmBinary"];
2104
+ if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"];
2150
2105
  legacyModuleProp("wasmBinary", "wasmBinary");
2151
2106
  var noExitRuntime = Module["noExitRuntime"] || true;
2152
2107
  legacyModuleProp("noExitRuntime", "noExitRuntime");
@@ -2164,8 +2119,7 @@
2164
2119
  function UTF8ArrayToString(heapOrArray, idx, maxBytesToRead) {
2165
2120
  var endIdx = idx + maxBytesToRead;
2166
2121
  var endPtr = idx;
2167
- while (heapOrArray[endPtr] && !(endPtr >= endIdx))
2168
- ++endPtr;
2122
+ while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr;
2169
2123
  if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {
2170
2124
  return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));
2171
2125
  } else {
@@ -2185,8 +2139,7 @@
2185
2139
  if ((u0 & 240) == 224) {
2186
2140
  u0 = (u0 & 15) << 12 | u1 << 6 | u2;
2187
2141
  } else {
2188
- if ((u0 & 248) != 240)
2189
- warnOnce("Invalid UTF-8 leading byte 0x" + u0.toString(16) + " encountered when deserializing a UTF-8 string in wasm memory to a JS string!");
2142
+ if ((u0 & 248) != 240) warnOnce("Invalid UTF-8 leading byte 0x" + u0.toString(16) + " encountered when deserializing a UTF-8 string in wasm memory to a JS string!");
2190
2143
  u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[idx++] & 63;
2191
2144
  }
2192
2145
  if (u0 < 65536) {
@@ -2203,8 +2156,7 @@
2203
2156
  return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "";
2204
2157
  }
2205
2158
  function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) {
2206
- if (!(maxBytesToWrite > 0))
2207
- return 0;
2159
+ if (!(maxBytesToWrite > 0)) return 0;
2208
2160
  var startIdx = outIdx;
2209
2161
  var endIdx = outIdx + maxBytesToWrite - 1;
2210
2162
  for (var i = 0; i < str.length; ++i) {
@@ -2214,25 +2166,20 @@
2214
2166
  u = 65536 + ((u & 1023) << 10) | u1 & 1023;
2215
2167
  }
2216
2168
  if (u <= 127) {
2217
- if (outIdx >= endIdx)
2218
- break;
2169
+ if (outIdx >= endIdx) break;
2219
2170
  heap[outIdx++] = u;
2220
2171
  } else if (u <= 2047) {
2221
- if (outIdx + 1 >= endIdx)
2222
- break;
2172
+ if (outIdx + 1 >= endIdx) break;
2223
2173
  heap[outIdx++] = 192 | u >> 6;
2224
2174
  heap[outIdx++] = 128 | u & 63;
2225
2175
  } else if (u <= 65535) {
2226
- if (outIdx + 2 >= endIdx)
2227
- break;
2176
+ if (outIdx + 2 >= endIdx) break;
2228
2177
  heap[outIdx++] = 224 | u >> 12;
2229
2178
  heap[outIdx++] = 128 | u >> 6 & 63;
2230
2179
  heap[outIdx++] = 128 | u & 63;
2231
2180
  } else {
2232
- if (outIdx + 3 >= endIdx)
2233
- break;
2234
- if (u > 1114111)
2235
- warnOnce("Invalid Unicode code point 0x" + u.toString(16) + " encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).");
2181
+ if (outIdx + 3 >= endIdx) break;
2182
+ if (u > 1114111) warnOnce("Invalid Unicode code point 0x" + u.toString(16) + " encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).");
2236
2183
  heap[outIdx++] = 240 | u >> 18;
2237
2184
  heap[outIdx++] = 128 | u >> 12 & 63;
2238
2185
  heap[outIdx++] = 128 | u >> 6 & 63;
@@ -2246,16 +2193,11 @@
2246
2193
  var len = 0;
2247
2194
  for (var i = 0; i < str.length; ++i) {
2248
2195
  var u = str.charCodeAt(i);
2249
- if (u >= 55296 && u <= 57343)
2250
- u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023;
2251
- if (u <= 127)
2252
- ++len;
2253
- else if (u <= 2047)
2254
- len += 2;
2255
- else if (u <= 65535)
2256
- len += 3;
2257
- else
2258
- len += 4;
2196
+ if (u >= 55296 && u <= 57343) u = 65536 + ((u & 1023) << 10) | str.charCodeAt(++i) & 1023;
2197
+ if (u <= 127) ++len;
2198
+ else if (u <= 2047) len += 2;
2199
+ else if (u <= 65535) len += 3;
2200
+ else len += 4;
2259
2201
  }
2260
2202
  return len;
2261
2203
  }
@@ -2269,8 +2211,7 @@
2269
2211
  assert(str.charCodeAt(i) === (str.charCodeAt(i) & 255));
2270
2212
  HEAP8[buffer2++ >> 0] = str.charCodeAt(i);
2271
2213
  }
2272
- if (!dontAddNull)
2273
- HEAP8[buffer2 >> 0] = 0;
2214
+ HEAP8[buffer2 >> 0] = 0;
2274
2215
  }
2275
2216
  var buffer, HEAP8, HEAPU8, HEAP32, HEAPU32;
2276
2217
  function updateGlobalBufferAndViews(buf) {
@@ -2285,8 +2226,7 @@
2285
2226
  Module["HEAPF64"] = new Float64Array(buf);
2286
2227
  }
2287
2228
  var TOTAL_STACK = 5242880;
2288
- if (Module["TOTAL_STACK"])
2289
- assert(TOTAL_STACK === Module["TOTAL_STACK"], "the stack size can no longer be determined at runtime");
2229
+ if (Module["TOTAL_STACK"]) assert(TOTAL_STACK === Module["TOTAL_STACK"], "the stack size can no longer be determined at runtime");
2290
2230
  var INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 16777216;
2291
2231
  legacyModuleProp("INITIAL_MEMORY", "INITIAL_MEMORY");
2292
2232
  assert(INITIAL_MEMORY >= TOTAL_STACK, "INITIAL_MEMORY should be larger than TOTAL_STACK, was " + INITIAL_MEMORY + "! (TOTAL_STACK=" + TOTAL_STACK + ")");
@@ -2302,23 +2242,20 @@
2302
2242
  HEAPU32[0] = 1668509029;
2303
2243
  }
2304
2244
  function checkStackCookie() {
2305
- if (ABORT)
2306
- return;
2245
+ if (ABORT) return;
2307
2246
  var max = _emscripten_stack_get_end();
2308
2247
  var cookie1 = HEAPU32[max >> 2];
2309
2248
  var cookie2 = HEAPU32[max + 4 >> 2];
2310
2249
  if (cookie1 != 34821223 || cookie2 != 2310721022) {
2311
2250
  abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x" + cookie2.toString(16) + " 0x" + cookie1.toString(16));
2312
2251
  }
2313
- if (HEAPU32[0] !== 1668509029)
2314
- abort("Runtime error: The application has corrupted its heap memory area (address zero)!");
2252
+ if (HEAPU32[0] !== 1668509029) abort("Runtime error: The application has corrupted its heap memory area (address zero)!");
2315
2253
  }
2316
2254
  (function() {
2317
2255
  var h16 = new Int16Array(1);
2318
2256
  var h8 = new Int8Array(h16.buffer);
2319
2257
  h16[0] = 25459;
2320
- if (h8[0] !== 115 || h8[1] !== 99)
2321
- throw "Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)";
2258
+ if (h8[0] !== 115 || h8[1] !== 99) throw "Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)";
2322
2259
  })();
2323
2260
  var __ATPRERUN__ = [];
2324
2261
  var __ATINIT__ = [];
@@ -2329,8 +2266,7 @@
2329
2266
  }
2330
2267
  function preRun() {
2331
2268
  if (Module["preRun"]) {
2332
- if (typeof Module["preRun"] == "function")
2333
- Module["preRun"] = [Module["preRun"]];
2269
+ if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]];
2334
2270
  while (Module["preRun"].length) {
2335
2271
  addOnPreRun(Module["preRun"].shift());
2336
2272
  }
@@ -2346,8 +2282,7 @@
2346
2282
  function postRun() {
2347
2283
  checkStackCookie();
2348
2284
  if (Module["postRun"]) {
2349
- if (typeof Module["postRun"] == "function")
2350
- Module["postRun"] = [Module["postRun"]];
2285
+ if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]];
2351
2286
  while (Module["postRun"].length) {
2352
2287
  addOnPostRun(Module["postRun"].shift());
2353
2288
  }
@@ -2376,7 +2311,7 @@
2376
2311
  if (Module["monitorRunDependencies"]) {
2377
2312
  Module["monitorRunDependencies"](runDependencies);
2378
2313
  }
2379
- if (id) {
2314
+ {
2380
2315
  assert(!runDependencyTracking[id]);
2381
2316
  runDependencyTracking[id] = 1;
2382
2317
  if (runDependencyWatcher === null && typeof setInterval != "undefined") {
@@ -2399,8 +2334,6 @@
2399
2334
  }
2400
2335
  }, 1e4);
2401
2336
  }
2402
- } else {
2403
- err("warning: run dependency added without ID");
2404
2337
  }
2405
2338
  }
2406
2339
  function removeRunDependency(id) {
@@ -2408,11 +2341,9 @@
2408
2341
  if (Module["monitorRunDependencies"]) {
2409
2342
  Module["monitorRunDependencies"](runDependencies);
2410
2343
  }
2411
- if (id) {
2344
+ {
2412
2345
  assert(runDependencyTracking[id]);
2413
2346
  delete runDependencyTracking[id];
2414
- } else {
2415
- err("warning: run dependency removed without ID");
2416
2347
  }
2417
2348
  if (runDependencies == 0) {
2418
2349
  if (runDependencyWatcher !== null) {
@@ -2475,7 +2406,7 @@
2475
2406
  return function() {
2476
2407
  var displayName = name;
2477
2408
  var asm = fixedasm;
2478
- if (!fixedasm) {
2409
+ {
2479
2410
  asm = Module["asm"];
2480
2411
  }
2481
2412
  assert(runtimeInitialized, "native function `" + displayName + "` called before runtime initialization");
@@ -2618,8 +2549,7 @@
2618
2549
  function getWasmTableEntry(funcPtr) {
2619
2550
  var func = wasmTableMirror[funcPtr];
2620
2551
  if (!func) {
2621
- if (funcPtr >= wasmTableMirror.length)
2622
- wasmTableMirror.length = funcPtr + 1;
2552
+ if (funcPtr >= wasmTableMirror.length) wasmTableMirror.length = funcPtr + 1;
2623
2553
  wasmTableMirror[funcPtr] = func = wasmTable.get(funcPtr);
2624
2554
  }
2625
2555
  assert(wasmTable.get(funcPtr) == func, "JavaScript-side Wasm function table mirror is out of date!");
@@ -2690,8 +2620,7 @@
2690
2620
  return HEAPU32[this.excPtr >> 2];
2691
2621
  }
2692
2622
  var adjusted = this.get_adjusted_ptr();
2693
- if (adjusted !== 0)
2694
- return adjusted;
2623
+ if (adjusted !== 0) return adjusted;
2695
2624
  return this.excPtr;
2696
2625
  };
2697
2626
  }
@@ -2749,10 +2678,8 @@
2749
2678
  var lang = (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8";
2750
2679
  var env = { "USER": "web_user", "LOGNAME": "web_user", "PATH": "/", "PWD": "/", "HOME": "/home/web_user", "LANG": lang, "_": getExecutableName() };
2751
2680
  for (var x2 in ENV) {
2752
- if (ENV[x2] === void 0)
2753
- delete env[x2];
2754
- else
2755
- env[x2] = ENV[x2];
2681
+ if (ENV[x2] === void 0) delete env[x2];
2682
+ else env[x2] = ENV[x2];
2756
2683
  }
2757
2684
  var strings = [];
2758
2685
  for (var x2 in env) {
@@ -2807,10 +2734,8 @@
2807
2734
  }
2808
2735
  function flush_NO_FILESYSTEM() {
2809
2736
  _fflush(0);
2810
- if (printCharBuffers[1].length)
2811
- printChar(1, 10);
2812
- if (printCharBuffers[2].length)
2813
- printChar(2, 10);
2737
+ if (printCharBuffers[1].length) printChar(1, 10);
2738
+ if (printCharBuffers[2].length) printChar(2, 10);
2814
2739
  }
2815
2740
  function _fd_write(fd, iov, iovcnt, pnum) {
2816
2741
  var num = 0;
@@ -2950,10 +2875,8 @@
2950
2875
  return leadingNulls(date2.tm_hour, 2);
2951
2876
  }, "%I": function(date2) {
2952
2877
  var twelveHour = date2.tm_hour;
2953
- if (twelveHour == 0)
2954
- twelveHour = 12;
2955
- else if (twelveHour > 12)
2956
- twelveHour -= 12;
2878
+ if (twelveHour == 0) twelveHour = 12;
2879
+ else if (twelveHour > 12) twelveHour -= 12;
2957
2880
  return leadingNulls(twelveHour, 2);
2958
2881
  }, "%j": function(date2) {
2959
2882
  return leadingNulls(date2.tm_mday + __arraySum(__isLeapYear(date2.tm_year + 1900) ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR, date2.tm_mon - 1), 3);
@@ -2991,8 +2914,7 @@
2991
2914
  }
2992
2915
  } else if (val == 53) {
2993
2916
  var jan1 = (date2.tm_wday + 371 - date2.tm_yday) % 7;
2994
- if (jan1 != 4 && (jan1 != 3 || !__isLeapYear(date2.tm_year)))
2995
- val = 1;
2917
+ if (jan1 != 4 && (jan1 != 3 || !__isLeapYear(date2.tm_year))) val = 1;
2996
2918
  }
2997
2919
  return leadingNulls(val, 2);
2998
2920
  }, "%w": function(date2) {
@@ -3022,7 +2944,7 @@
3022
2944
  }
3023
2945
  }
3024
2946
  pattern = pattern.replace(/\0\0/g, "%");
3025
- var bytes = intArrayFromString(pattern, false);
2947
+ var bytes = intArrayFromString(pattern);
3026
2948
  if (bytes.length > maxsize) {
3027
2949
  return 0;
3028
2950
  }
@@ -3033,11 +2955,9 @@
3033
2955
  return _strftime(s, maxsize, format, tm);
3034
2956
  }
3035
2957
  function intArrayFromString(stringy, dontAddNull, length2) {
3036
- var len = length2 > 0 ? length2 : lengthBytesUTF8(stringy) + 1;
2958
+ var len = lengthBytesUTF8(stringy) + 1;
3037
2959
  var u8array = new Array(len);
3038
- var numBytesWritten = stringToUTF8Array(stringy, u8array, 0, u8array.length);
3039
- if (dontAddNull)
3040
- u8array.length = numBytesWritten;
2960
+ stringToUTF8Array(stringy, u8array, 0, u8array.length);
3041
2961
  return u8array;
3042
2962
  }
3043
2963
  function intArrayToString(array2) {
@@ -3407,10 +3327,8 @@
3407
3327
  this.status = status;
3408
3328
  }
3409
3329
  dependenciesFulfilled = function runCaller() {
3410
- if (!calledRun)
3411
- run();
3412
- if (!calledRun)
3413
- dependenciesFulfilled = runCaller;
3330
+ if (!calledRun) run();
3331
+ if (!calledRun) dependenciesFulfilled = runCaller;
3414
3332
  };
3415
3333
  function stackCheckInit() {
3416
3334
  _emscripten_stack_init();
@@ -3426,16 +3344,13 @@
3426
3344
  return;
3427
3345
  }
3428
3346
  function doRun() {
3429
- if (calledRun)
3430
- return;
3347
+ if (calledRun) return;
3431
3348
  calledRun = true;
3432
3349
  Module["calledRun"] = true;
3433
- if (ABORT)
3434
- return;
3350
+ if (ABORT) return;
3435
3351
  initRuntime();
3436
3352
  readyPromiseResolve(Module);
3437
- if (Module["onRuntimeInitialized"])
3438
- Module["onRuntimeInitialized"]();
3353
+ if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"]();
3439
3354
  assert(!Module["_main"], 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');
3440
3355
  postRun();
3441
3356
  }
@@ -3473,7 +3388,7 @@
3473
3388
  }
3474
3389
  function exit(status, implicit) {
3475
3390
  checkUnflushedContent();
3476
- if (keepRuntimeAlive() && !implicit) {
3391
+ {
3477
3392
  var msg = "program exited (with status: " + status + "), but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)";
3478
3393
  readyPromiseReject(msg);
3479
3394
  err(msg);
@@ -3482,15 +3397,13 @@
3482
3397
  }
3483
3398
  function procExit(code) {
3484
3399
  if (!keepRuntimeAlive()) {
3485
- if (Module["onExit"])
3486
- Module["onExit"](code);
3400
+ if (Module["onExit"]) Module["onExit"](code);
3487
3401
  ABORT = true;
3488
3402
  }
3489
3403
  quit_(code, new ExitStatus(code));
3490
3404
  }
3491
3405
  if (Module["preInit"]) {
3492
- if (typeof Module["preInit"] == "function")
3493
- Module["preInit"] = [Module["preInit"]];
3406
+ if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]];
3494
3407
  while (Module["preInit"].length > 0) {
3495
3408
  Module["preInit"].pop()();
3496
3409
  }
@@ -3510,8 +3423,7 @@
3510
3423
  function wrapPointer(ptr, __class__) {
3511
3424
  var cache = getCache(__class__);
3512
3425
  var ret = cache[ptr];
3513
- if (ret)
3514
- return ret;
3426
+ if (ret) return ret;
3515
3427
  ret = Object.create((__class__ || WrapperObject).prototype);
3516
3428
  ret.ptr = ptr;
3517
3429
  return cache[ptr] = ret;
@@ -3523,8 +3435,7 @@
3523
3435
  Module["castObject"] = castObject;
3524
3436
  Module["NULL"] = wrapPointer(0);
3525
3437
  function destroy(obj) {
3526
- if (!obj["__destroy__"])
3527
- throw "Error: Cannot destroy object. (Did you create it yourself?)";
3438
+ if (!obj["__destroy__"]) throw "Error: Cannot destroy object. (Did you create it yourself?)";
3528
3439
  obj["__destroy__"]();
3529
3440
  delete getCache(obj.__class__)[obj.ptr];
3530
3441
  }
@@ -3564,8 +3475,7 @@
3564
3475
  Module["ArrangementBuilder"] = ArrangementBuilder;
3565
3476
  ArrangementBuilder.prototype["getPolygons"] = ArrangementBuilder.prototype.getPolygons = function(points) {
3566
3477
  var self2 = this.ptr;
3567
- if (points && typeof points === "object")
3568
- points = points.ptr;
3478
+ if (points && typeof points === "object") points = points.ptr;
3569
3479
  return wrapPointer(_emscripten_bind_ArrangementBuilder_getPolygons_1(self2, points), PolygonList);
3570
3480
  };
3571
3481
  ArrangementBuilder.prototype["__destroy__"] = ArrangementBuilder.prototype.__destroy__ = function() {
@@ -3573,10 +3483,8 @@
3573
3483
  _emscripten_bind_ArrangementBuilder___destroy___0(self2);
3574
3484
  };
3575
3485
  function Point2(x2, y2) {
3576
- if (x2 && typeof x2 === "object")
3577
- x2 = x2.ptr;
3578
- if (y2 && typeof y2 === "object")
3579
- y2 = y2.ptr;
3486
+ if (x2 && typeof x2 === "object") x2 = x2.ptr;
3487
+ if (y2 && typeof y2 === "object") y2 = y2.ptr;
3580
3488
  if (x2 === void 0) {
3581
3489
  this.ptr = _emscripten_bind_Point_Point_0();
3582
3490
  getCache(Point2)[this.ptr] = this;
@@ -3601,8 +3509,7 @@
3601
3509
  };
3602
3510
  Point2.prototype["set_x"] = Point2.prototype.set_x = function(arg0) {
3603
3511
  var self2 = this.ptr;
3604
- if (arg0 && typeof arg0 === "object")
3605
- arg0 = arg0.ptr;
3512
+ if (arg0 && typeof arg0 === "object") arg0 = arg0.ptr;
3606
3513
  _emscripten_bind_Point_set_x_1(self2, arg0);
3607
3514
  };
3608
3515
  Object.defineProperty(Point2.prototype, "x", { get: Point2.prototype.get_x, set: Point2.prototype.set_x });
@@ -3612,8 +3519,7 @@
3612
3519
  };
3613
3520
  Point2.prototype["set_y"] = Point2.prototype.set_y = function(arg0) {
3614
3521
  var self2 = this.ptr;
3615
- if (arg0 && typeof arg0 === "object")
3616
- arg0 = arg0.ptr;
3522
+ if (arg0 && typeof arg0 === "object") arg0 = arg0.ptr;
3617
3523
  _emscripten_bind_Point_set_y_1(self2, arg0);
3618
3524
  };
3619
3525
  Object.defineProperty(Point2.prototype, "y", { get: Point2.prototype.get_y, set: Point2.prototype.set_y });
@@ -3622,10 +3528,8 @@
3622
3528
  _emscripten_bind_Point___destroy___0(self2);
3623
3529
  };
3624
3530
  function Polygon2(contour, holes) {
3625
- if (contour && typeof contour === "object")
3626
- contour = contour.ptr;
3627
- if (holes && typeof holes === "object")
3628
- holes = holes.ptr;
3531
+ if (contour && typeof contour === "object") contour = contour.ptr;
3532
+ if (holes && typeof holes === "object") holes = holes.ptr;
3629
3533
  this.ptr = _emscripten_bind_Polygon_Polygon_2(contour, holes);
3630
3534
  getCache(Polygon2)[this.ptr] = this;
3631
3535
  }
@@ -3636,8 +3540,7 @@
3636
3540
  Module["Polygon"] = Polygon2;
3637
3541
  Polygon2.prototype["getInsidePoint"] = Polygon2.prototype.getInsidePoint = function(point2) {
3638
3542
  var self2 = this.ptr;
3639
- if (point2 && typeof point2 === "object")
3640
- point2 = point2.ptr;
3543
+ if (point2 && typeof point2 === "object") point2 = point2.ptr;
3641
3544
  return !!_emscripten_bind_Polygon_getInsidePoint_1(self2, point2);
3642
3545
  };
3643
3546
  Polygon2.prototype["getPolyTristripArea"] = Polygon2.prototype.getPolyTristripArea = function() {
@@ -3650,8 +3553,7 @@
3650
3553
  };
3651
3554
  Polygon2.prototype["set_contour"] = Polygon2.prototype.set_contour = function(arg0) {
3652
3555
  var self2 = this.ptr;
3653
- if (arg0 && typeof arg0 === "object")
3654
- arg0 = arg0.ptr;
3556
+ if (arg0 && typeof arg0 === "object") arg0 = arg0.ptr;
3655
3557
  _emscripten_bind_Polygon_set_contour_1(self2, arg0);
3656
3558
  };
3657
3559
  Object.defineProperty(Polygon2.prototype, "contour", { get: Polygon2.prototype.get_contour, set: Polygon2.prototype.set_contour });
@@ -3661,8 +3563,7 @@
3661
3563
  };
3662
3564
  Polygon2.prototype["set_holes"] = Polygon2.prototype.set_holes = function(arg0) {
3663
3565
  var self2 = this.ptr;
3664
- if (arg0 && typeof arg0 === "object")
3665
- arg0 = arg0.ptr;
3566
+ if (arg0 && typeof arg0 === "object") arg0 = arg0.ptr;
3666
3567
  _emscripten_bind_Polygon_set_holes_1(self2, arg0);
3667
3568
  };
3668
3569
  Object.defineProperty(Polygon2.prototype, "holes", { get: Polygon2.prototype.get_holes, set: Polygon2.prototype.set_holes });
@@ -3681,8 +3582,7 @@
3681
3582
  Module["PointList"] = PointList;
3682
3583
  PointList.prototype["push_back"] = PointList.prototype.push_back = function(s) {
3683
3584
  var self2 = this.ptr;
3684
- if (s && typeof s === "object")
3685
- s = s.ptr;
3585
+ if (s && typeof s === "object") s = s.ptr;
3686
3586
  _emscripten_bind_PointList_push_back_1(self2, s);
3687
3587
  };
3688
3588
  PointList.prototype["size"] = PointList.prototype.size = function() {
@@ -3691,8 +3591,7 @@
3691
3591
  };
3692
3592
  PointList.prototype["at"] = PointList.prototype.at = function(i) {
3693
3593
  var self2 = this.ptr;
3694
- if (i && typeof i === "object")
3695
- i = i.ptr;
3594
+ if (i && typeof i === "object") i = i.ptr;
3696
3595
  return wrapPointer(_emscripten_bind_PointList_at_1(self2, i), Point2);
3697
3596
  };
3698
3597
  PointList.prototype["clear"] = PointList.prototype.clear = function() {
@@ -3714,8 +3613,7 @@
3714
3613
  Module["PolygonList"] = PolygonList;
3715
3614
  PolygonList.prototype["push_back"] = PolygonList.prototype.push_back = function(s) {
3716
3615
  var self2 = this.ptr;
3717
- if (s && typeof s === "object")
3718
- s = s.ptr;
3616
+ if (s && typeof s === "object") s = s.ptr;
3719
3617
  _emscripten_bind_PolygonList_push_back_1(self2, s);
3720
3618
  };
3721
3619
  PolygonList.prototype["size"] = PolygonList.prototype.size = function() {
@@ -3724,8 +3622,7 @@
3724
3622
  };
3725
3623
  PolygonList.prototype["at"] = PolygonList.prototype.at = function(i) {
3726
3624
  var self2 = this.ptr;
3727
- if (i && typeof i === "object")
3728
- i = i.ptr;
3625
+ if (i && typeof i === "object") i = i.ptr;
3729
3626
  return wrapPointer(_emscripten_bind_PolygonList_at_1(self2, i), Polygon2);
3730
3627
  };
3731
3628
  PolygonList.prototype["clear"] = PolygonList.prototype.clear = function() {
@@ -3747,8 +3644,7 @@
3747
3644
  Module["Contour"] = Contour;
3748
3645
  Contour.prototype["push_back"] = Contour.prototype.push_back = function(s) {
3749
3646
  var self2 = this.ptr;
3750
- if (s && typeof s === "object")
3751
- s = s.ptr;
3647
+ if (s && typeof s === "object") s = s.ptr;
3752
3648
  _emscripten_bind_Contour_push_back_1(self2, s);
3753
3649
  };
3754
3650
  Contour.prototype["size"] = Contour.prototype.size = function() {
@@ -3757,8 +3653,7 @@
3757
3653
  };
3758
3654
  Contour.prototype["at"] = Contour.prototype.at = function(i) {
3759
3655
  var self2 = this.ptr;
3760
- if (i && typeof i === "object")
3761
- i = i.ptr;
3656
+ if (i && typeof i === "object") i = i.ptr;
3762
3657
  return wrapPointer(_emscripten_bind_Contour_at_1(self2, i), Point2);
3763
3658
  };
3764
3659
  Contour.prototype["clear"] = Contour.prototype.clear = function() {
@@ -3780,8 +3675,7 @@
3780
3675
  Module["ContourList"] = ContourList;
3781
3676
  ContourList.prototype["push_back"] = ContourList.prototype.push_back = function(s) {
3782
3677
  var self2 = this.ptr;
3783
- if (s && typeof s === "object")
3784
- s = s.ptr;
3678
+ if (s && typeof s === "object") s = s.ptr;
3785
3679
  _emscripten_bind_ContourList_push_back_1(self2, s);
3786
3680
  };
3787
3681
  ContourList.prototype["size"] = ContourList.prototype.size = function() {
@@ -3790,8 +3684,7 @@
3790
3684
  };
3791
3685
  ContourList.prototype["at"] = ContourList.prototype.at = function(i) {
3792
3686
  var self2 = this.ptr;
3793
- if (i && typeof i === "object")
3794
- i = i.ptr;
3687
+ if (i && typeof i === "object") i = i.ptr;
3795
3688
  return wrapPointer(_emscripten_bind_ContourList_at_1(self2, i), Contour);
3796
3689
  };
3797
3690
  ContourList.prototype["clear"] = ContourList.prototype.clear = function() {
@@ -4083,12 +3976,12 @@
4083
3976
  _tmp1.subVectors(tri.a, tri.b);
4084
3977
  _tmp2.subVectors(tri.a, tri.c);
4085
3978
  _tmp1.cross(_tmp2);
4086
- return _tmp1.x > -EPSILON$1 && _tmp1.x < EPSILON$1 && _tmp1.y > -EPSILON$1 && _tmp1.y < EPSILON$1 && _tmp1.z > -EPSILON$1 && _tmp1.z < EPSILON$1;
3979
+ return _tmp1.x > -1e-10 && _tmp1.x < EPSILON$1 && _tmp1.y > -1e-10 && _tmp1.y < EPSILON$1 && _tmp1.z > -1e-10 && _tmp1.z < EPSILON$1;
4087
3980
  }
4088
3981
  function orient3D$1(a, b, c, d) {
4089
3982
  _matrix4.set(a.x, a.y, a.z, 1, b.x, b.y, b.z, 1, c.x, c.y, c.z, 1, d.x, d.y, d.z, 1);
4090
3983
  const det = _matrix4.determinant();
4091
- if (det < -EPSILON$1)
3984
+ if (det < -1e-10)
4092
3985
  return -1;
4093
3986
  else if (det > EPSILON$1)
4094
3987
  return 1;
@@ -4098,7 +3991,7 @@
4098
3991
  function orient2D(a, b, c) {
4099
3992
  _matrix3.set(a.x, a.y, 1, b.x, b.y, 1, c.x, c.y, 1);
4100
3993
  const det = _matrix3.determinant();
4101
- if (det < -EPSILON$1)
3994
+ if (det < -1e-10)
4102
3995
  return -1;
4103
3996
  else if (det > EPSILON$1)
4104
3997
  return 1;
@@ -4508,8 +4401,8 @@
4508
4401
  _u$2.subVectors(position2, edge.a.pos3d);
4509
4402
  _v$1.subVectors(edge.b.pos3d, edge.a.pos3d);
4510
4403
  const cross = _u$2.cross(_v$1);
4511
- const v = cross.x + cross.y + cross.z;
4512
- if (v > 1e-10 || v < -1e-10) {
4404
+ const v2 = cross.x + cross.y + cross.z;
4405
+ if (v2 > 1e-10 || v2 < -1e-10) {
4513
4406
  return null;
4514
4407
  }
4515
4408
  if (_u$2.dot(_v$1) < -1e-10) {
@@ -4814,24 +4707,24 @@
4814
4707
  }
4815
4708
  return t;
4816
4709
  }
4817
- function split(key, v, comparator) {
4710
+ function split(key, v2, comparator) {
4818
4711
  var left, right;
4819
- if (v === null) {
4712
+ if (v2 === null) {
4820
4713
  left = right = null;
4821
4714
  } else {
4822
- v = splay(key, v, comparator);
4823
- var cmp = comparator(v.key, key);
4715
+ v2 = splay(key, v2, comparator);
4716
+ var cmp = comparator(v2.key, key);
4824
4717
  if (cmp === 0) {
4825
- left = v.left;
4826
- right = v.right;
4718
+ left = v2.left;
4719
+ right = v2.right;
4827
4720
  } else if (cmp < 0) {
4828
- right = v.right;
4829
- v.right = null;
4830
- left = v;
4721
+ right = v2.right;
4722
+ v2.right = null;
4723
+ left = v2;
4831
4724
  } else {
4832
- left = v.left;
4833
- v.left = null;
4834
- right = v;
4725
+ left = v2.left;
4726
+ v2.left = null;
4727
+ right = v2;
4835
4728
  }
4836
4729
  }
4837
4730
  return { left, right };
@@ -4860,8 +4753,7 @@
4860
4753
  }
4861
4754
  }
4862
4755
  var Tree = function Tree2(comparator) {
4863
- if (comparator === void 0)
4864
- comparator = DEFAULT_COMPARE;
4756
+ if (comparator === void 0) comparator = DEFAULT_COMPARE;
4865
4757
  this._comparator = comparator;
4866
4758
  this._root = null;
4867
4759
  this._size = 0;
@@ -5000,8 +4892,7 @@
5000
4892
  return null;
5001
4893
  };
5002
4894
  Tree.prototype.minNode = function minNode(t) {
5003
- if (t === void 0)
5004
- t = this._root;
4895
+ if (t === void 0) t = this._root;
5005
4896
  if (t) {
5006
4897
  while (t.left) {
5007
4898
  t = t.left;
@@ -5010,8 +4901,7 @@
5010
4901
  return t;
5011
4902
  };
5012
4903
  Tree.prototype.maxNode = function maxNode(t) {
5013
- if (t === void 0)
5014
- t = this._root;
4904
+ if (t === void 0) t = this._root;
5015
4905
  if (t) {
5016
4906
  while (t.right) {
5017
4907
  t = t.right;
@@ -5098,12 +4988,9 @@
5098
4988
  return toList(this._root);
5099
4989
  };
5100
4990
  Tree.prototype.load = function load(keys, values, presort) {
5101
- if (keys === void 0)
5102
- keys = [];
5103
- if (values === void 0)
5104
- values = [];
5105
- if (presort === void 0)
5106
- presort = false;
4991
+ if (keys === void 0) keys = [];
4992
+ if (values === void 0) values = [];
4993
+ if (presort === void 0) presort = false;
5107
4994
  var size2 = keys.length;
5108
4995
  var comparator = this._comparator;
5109
4996
  if (presort) {
@@ -5126,13 +5013,12 @@
5126
5013
  return this._size;
5127
5014
  };
5128
5015
  Tree.prototype.toString = function toString(printNode) {
5129
- if (printNode === void 0)
5130
- printNode = function(n) {
5131
- return n.key;
5132
- };
5016
+ if (printNode === void 0) printNode = function(n) {
5017
+ return n.key;
5018
+ };
5133
5019
  var out = [];
5134
- printRow(this._root, "", true, function(v) {
5135
- return out.push(v);
5020
+ printRow(this._root, "", true, function(v2) {
5021
+ return out.push(v2);
5136
5022
  }, printNode);
5137
5023
  return out.join("");
5138
5024
  };
@@ -5210,10 +5096,9 @@
5210
5096
  return null;
5211
5097
  }
5212
5098
  function mergeLists(l1, l2, compare) {
5213
- if (compare === void 0)
5214
- compare = function(a, b) {
5215
- return a - b;
5216
- };
5099
+ if (compare === void 0) compare = function(a, b) {
5100
+ return a - b;
5101
+ };
5217
5102
  var head = {};
5218
5103
  var p = head;
5219
5104
  var p1 = l1;
@@ -5498,19 +5383,19 @@
5498
5383
  values[i] = values[j];
5499
5384
  values[j] = temp5;
5500
5385
  var k = 4 * i;
5501
- var m = 4 * j;
5386
+ var m2 = 4 * j;
5502
5387
  var a = boxes[k];
5503
5388
  var b = boxes[k + 1];
5504
5389
  var c = boxes[k + 2];
5505
5390
  var d = boxes[k + 3];
5506
- boxes[k] = boxes[m];
5507
- boxes[k + 1] = boxes[m + 1];
5508
- boxes[k + 2] = boxes[m + 2];
5509
- boxes[k + 3] = boxes[m + 3];
5510
- boxes[m] = a;
5511
- boxes[m + 1] = b;
5512
- boxes[m + 2] = c;
5513
- boxes[m + 3] = d;
5391
+ boxes[k] = boxes[m2];
5392
+ boxes[k + 1] = boxes[m2 + 1];
5393
+ boxes[k + 2] = boxes[m2 + 2];
5394
+ boxes[k + 3] = boxes[m2 + 3];
5395
+ boxes[m2] = a;
5396
+ boxes[m2 + 1] = b;
5397
+ boxes[m2 + 2] = c;
5398
+ boxes[m2 + 3] = d;
5514
5399
  var e = indices[i];
5515
5400
  indices[i] = indices[j];
5516
5401
  indices[j] = e;
@@ -5562,7 +5447,7 @@
5562
5447
  }
5563
5448
  function bush(lines, options) {
5564
5449
  var results = [];
5565
- var reportIntersection = options && options.onFound || defaultIntersectionReporter;
5450
+ var reportIntersection = defaultIntersectionReporter;
5566
5451
  var asyncState;
5567
5452
  var index = new Flatbush(lines.length);
5568
5453
  lines.forEach(addToIndex);
@@ -5681,11 +5566,10 @@
5681
5566
  }
5682
5567
  }
5683
5568
  }
5684
- if (splitViewVertices.length === 0)
5685
- ;
5569
+ if (splitViewVertices.length === 0) ;
5686
5570
  else if (splitViewVertices.length === 1) {
5687
- const v = splitViewVertices[0];
5688
- v.singularity = ViewVertexSingularity.ImageIntersection;
5571
+ const v2 = splitViewVertices[0];
5572
+ v2.singularity = ViewVertexSingularity.ImageIntersection;
5689
5573
  } else {
5690
5574
  const v1 = splitViewVertices[0];
5691
5575
  const v2 = splitViewVertices[1];
@@ -5874,8 +5758,7 @@
5874
5758
  const res = () => {
5875
5759
  resolve(this.buildAsync(idx + 1, actions, info, progressCallback));
5876
5760
  };
5877
- if (this.skipActions)
5878
- res();
5761
+ if (this.skipActions) res();
5879
5762
  else {
5880
5763
  actions[idx].process().catch((_) => {
5881
5764
  }).then(res);
@@ -6020,10 +5903,10 @@
6020
5903
  }
6021
5904
  const methods$1 = {};
6022
5905
  const names = [];
6023
- function registerMethods(name, m) {
5906
+ function registerMethods(name, m2) {
6024
5907
  if (Array.isArray(name)) {
6025
5908
  for (const _name of name) {
6026
- registerMethods(_name, m);
5909
+ registerMethods(_name, m2);
6027
5910
  }
6028
5911
  return;
6029
5912
  }
@@ -6033,8 +5916,8 @@
6033
5916
  }
6034
5917
  return;
6035
5918
  }
6036
- addMethodNames(Object.getOwnPropertyNames(m));
6037
- methods$1[name] = Object.assign(methods$1[name] || {}, m);
5919
+ addMethodNames(Object.getOwnPropertyNames(m2));
5920
+ methods$1[name] = Object.assign(methods$1[name] || {}, m2);
6038
5921
  }
6039
5922
  function getMethodsFor(name) {
6040
5923
  return methods$1[name] || {};
@@ -6069,12 +5952,12 @@
6069
5952
  return d % 360 * Math.PI / 180;
6070
5953
  }
6071
5954
  function camelCase(s) {
6072
- return s.toLowerCase().replace(/-(.)/g, function(m, g) {
5955
+ return s.toLowerCase().replace(/-(.)/g, function(m2, g) {
6073
5956
  return g.toUpperCase();
6074
5957
  });
6075
5958
  }
6076
5959
  function unCamelCase(s) {
6077
- return s.replace(/([A-Z])/g, function(m, g) {
5960
+ return s.replace(/([A-Z])/g, function(m2, g) {
6078
5961
  return "-" + g.toLowerCase();
6079
5962
  });
6080
5963
  }
@@ -6145,8 +6028,7 @@
6145
6028
  return globals.document.createElementNS(ns, name);
6146
6029
  }
6147
6030
  function makeInstance(element, isHTML = false) {
6148
- if (element instanceof Base)
6149
- return element;
6031
+ if (element instanceof Base) return element;
6150
6032
  if (typeof element === "object") {
6151
6033
  return adopter(element);
6152
6034
  }
@@ -6166,10 +6048,8 @@
6166
6048
  return node && node.ownerDocument && node instanceof node.ownerDocument.defaultView.Node ? node : create(name);
6167
6049
  }
6168
6050
  function adopt(node) {
6169
- if (!node)
6170
- return null;
6171
- if (node.instance instanceof Base)
6172
- return node.instance;
6051
+ if (!node) return null;
6052
+ if (node.instance instanceof Base) return node.instance;
6173
6053
  if (node.nodeName === "#document-fragment") {
6174
6054
  return new elements.Fragment(node);
6175
6055
  }
@@ -6184,8 +6064,7 @@
6184
6064
  let adopter = adopt;
6185
6065
  function register(element, name = element.name, asRoot = false) {
6186
6066
  elements[name] = element;
6187
- if (asRoot)
6188
- elements[root] = element;
6067
+ if (asRoot) elements[root] = element;
6189
6068
  addMethodNames(Object.getOwnPropertyNames(element.prototype));
6190
6069
  return element;
6191
6070
  }
@@ -6391,7 +6270,7 @@
6391
6270
  hide,
6392
6271
  visible
6393
6272
  });
6394
- function data(a, v, r) {
6273
+ function data(a, v2, r) {
6395
6274
  if (a == null) {
6396
6275
  return this.data(map(filter(this.node.attributes, (el) => el.nodeName.indexOf("data-") === 0), (el) => el.nodeName.slice(5)));
6397
6276
  } else if (a instanceof Array) {
@@ -6401,8 +6280,8 @@
6401
6280
  }
6402
6281
  return data2;
6403
6282
  } else if (typeof a === "object") {
6404
- for (v in a) {
6405
- this.data(v, a[v]);
6283
+ for (v2 in a) {
6284
+ this.data(v2, a[v2]);
6406
6285
  }
6407
6286
  } else if (arguments.length < 2) {
6408
6287
  try {
@@ -6411,14 +6290,14 @@
6411
6290
  return this.attr("data-" + a);
6412
6291
  }
6413
6292
  } else {
6414
- this.attr("data-" + a, v === null ? null : r === true || typeof v === "string" || typeof v === "number" ? v : JSON.stringify(v));
6293
+ this.attr("data-" + a, v2 === null ? null : r === true || typeof v2 === "string" || typeof v2 === "number" ? v2 : JSON.stringify(v2));
6415
6294
  }
6416
6295
  return this;
6417
6296
  }
6418
6297
  registerMethods("Dom", {
6419
6298
  data
6420
6299
  });
6421
- function remember(k, v) {
6300
+ function remember(k, v2) {
6422
6301
  if (typeof arguments[0] === "object") {
6423
6302
  for (const key in k) {
6424
6303
  this.remember(key, k[key]);
@@ -6426,7 +6305,7 @@
6426
6305
  } else if (arguments.length === 1) {
6427
6306
  return this.memory()[k];
6428
6307
  } else {
6429
- this.memory()[k] = v;
6308
+ this.memory()[k] = v2;
6430
6309
  }
6431
6310
  return this;
6432
6311
  }
@@ -6519,16 +6398,11 @@
6519
6398
  }
6520
6399
  }
6521
6400
  function hueToRgb(p, q, t) {
6522
- if (t < 0)
6523
- t += 1;
6524
- if (t > 1)
6525
- t -= 1;
6526
- if (t < 1 / 6)
6527
- return p + (q - p) * 6 * t;
6528
- if (t < 1 / 2)
6529
- return q;
6530
- if (t < 2 / 3)
6531
- return p + (q - p) * (2 / 3 - t) * 6;
6401
+ if (t < 0) t += 1;
6402
+ if (t > 1) t -= 1;
6403
+ if (t < 1 / 6) return p + (q - p) * 6 * t;
6404
+ if (t < 1 / 2) return q;
6405
+ if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
6532
6406
  return p;
6533
6407
  }
6534
6408
  class Color {
@@ -6608,15 +6482,15 @@
6608
6482
  _b,
6609
6483
  _c
6610
6484
  } = this.rgb();
6611
- const [r, g, b] = [_a, _b, _c].map((v) => v / 255);
6485
+ const [r, g, b] = [_a, _b, _c].map((v2) => v2 / 255);
6612
6486
  const k = Math.min(1 - r, 1 - g, 1 - b);
6613
6487
  if (k === 1) {
6614
6488
  return new Color(0, 0, 0, 1, "cmyk");
6615
6489
  }
6616
6490
  const c = (1 - r - k) / (1 - k);
6617
- const m = (1 - g - k) / (1 - k);
6491
+ const m2 = (1 - g - k) / (1 - k);
6618
6492
  const y2 = (1 - b - k) / (1 - k);
6619
- const color = new Color(c, m, y2, k, "cmyk");
6493
+ const color = new Color(c, m2, y2, k, "cmyk");
6620
6494
  return color;
6621
6495
  }
6622
6496
  hsl() {
@@ -6625,7 +6499,7 @@
6625
6499
  _b,
6626
6500
  _c
6627
6501
  } = this.rgb();
6628
- const [r, g, b] = [_a, _b, _c].map((v) => v / 255);
6502
+ const [r, g, b] = [_a, _b, _c].map((v2) => v2 / 255);
6629
6503
  const max = Math.max(r, g, b);
6630
6504
  const min = Math.min(r, g, b);
6631
6505
  const l = (max + min) / 2;
@@ -6667,7 +6541,7 @@
6667
6541
  } else if (typeof a === "string") {
6668
6542
  if (isRgb.test(a)) {
6669
6543
  const noWhitespace = a.replace(whitespace, "");
6670
- const [_a2, _b2, _c2] = rgb.exec(noWhitespace).slice(1, 4).map((v) => parseInt(v));
6544
+ const [_a2, _b2, _c2] = rgb.exec(noWhitespace).slice(1, 4).map((v2) => parseInt(v2));
6671
6545
  Object.assign(this, {
6672
6546
  _a: _a2,
6673
6547
  _b: _b2,
@@ -6676,7 +6550,7 @@
6676
6550
  space: "rgb"
6677
6551
  });
6678
6552
  } else if (isHex.test(a)) {
6679
- const hexParse = (v) => parseInt(v, 16);
6553
+ const hexParse = (v2) => parseInt(v2, 16);
6680
6554
  const [, _a2, _b2, _c2] = hex.exec(sixDigitHex(a)).map(hexParse);
6681
6555
  Object.assign(this, {
6682
6556
  _a: _a2,
@@ -6685,8 +6559,7 @@
6685
6559
  _d: 0,
6686
6560
  space: "rgb"
6687
6561
  });
6688
- } else
6689
- throw Error("Unsupported string format, can't construct Color");
6562
+ } else throw Error("Unsupported string format, can't construct Color");
6690
6563
  }
6691
6564
  const {
6692
6565
  _a,
@@ -6820,12 +6693,12 @@
6820
6693
  } else if (this.space === "cmyk") {
6821
6694
  const {
6822
6695
  c,
6823
- m,
6696
+ m: m2,
6824
6697
  y: y2,
6825
6698
  k
6826
6699
  } = this;
6827
6700
  const r = 255 * (1 - Math.min(1, c * (1 - k) + k));
6828
- const g = 255 * (1 - Math.min(1, m * (1 - k) + k));
6701
+ const g = 255 * (1 - Math.min(1, m2 * (1 - k) + k));
6829
6702
  const b = 255 * (1 - Math.min(1, y2 * (1 - k) + k));
6830
6703
  const color = new Color(r, g, b);
6831
6704
  return color;
@@ -6861,7 +6734,7 @@
6861
6734
  _b: g255,
6862
6735
  _c: b255
6863
6736
  } = this.rgb();
6864
- const [r, g, b] = [r255, g255, b255].map((v) => v / 255);
6737
+ const [r, g, b] = [r255, g255, b255].map((v2) => v2 / 255);
6865
6738
  const rL = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92;
6866
6739
  const gL = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92;
6867
6740
  const bL = b > 0.04045 ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92;
@@ -6888,7 +6761,7 @@
6888
6761
  min,
6889
6762
  round: round2
6890
6763
  } = Math;
6891
- const format = (v) => max(0, min(round2(v), 255));
6764
+ const format = (v2) => max(0, min(round2(v2), 255));
6892
6765
  return [_a, _b, _c].map(format);
6893
6766
  }
6894
6767
  /*
@@ -6926,20 +6799,20 @@
6926
6799
  toArray() {
6927
6800
  return [this.x, this.y];
6928
6801
  }
6929
- transform(m) {
6930
- return this.clone().transformO(m);
6802
+ transform(m2) {
6803
+ return this.clone().transformO(m2);
6931
6804
  }
6932
6805
  // Transform point with matrix
6933
- transformO(m) {
6934
- if (!Matrix.isMatrixLike(m)) {
6935
- m = new Matrix(m);
6806
+ transformO(m2) {
6807
+ if (!Matrix.isMatrixLike(m2)) {
6808
+ m2 = new Matrix(m2);
6936
6809
  }
6937
6810
  const {
6938
6811
  x: x2,
6939
6812
  y: y2
6940
6813
  } = this;
6941
- this.x = m.a * x2 + m.c * y2 + m.e;
6942
- this.y = m.b * x2 + m.d * y2 + m.f;
6814
+ this.x = m2.a * x2 + m2.c * y2 + m2.e;
6815
+ this.y = m2.b * x2 + m2.d * y2 + m2.f;
6943
6816
  return this;
6944
6817
  }
6945
6818
  }
@@ -6947,7 +6820,7 @@
6947
6820
  return new Point(x2, y2).transformO(this.screenCTM().inverseO());
6948
6821
  }
6949
6822
  function closeEnough(a, b, threshold) {
6950
- return Math.abs(b - a) < (threshold || 1e-6);
6823
+ return Math.abs(b - a) < 1e-6;
6951
6824
  }
6952
6825
  class Matrix {
6953
6826
  constructor(...args) {
@@ -7074,8 +6947,7 @@
7074
6947
  }
7075
6948
  // Check if two matrices are equal
7076
6949
  equals(other) {
7077
- if (other === this)
7078
- return true;
6950
+ if (other === this) return true;
7079
6951
  const comp = new Matrix(other);
7080
6952
  return closeEnough(this.a, comp.a) && closeEnough(this.b, comp.b) && closeEnough(this.c, comp.c) && closeEnough(this.d, comp.d) && closeEnough(this.e, comp.e) && closeEnough(this.f, comp.f);
7081
6953
  }
@@ -7110,8 +6982,7 @@
7110
6982
  const e = this.e;
7111
6983
  const f = this.f;
7112
6984
  const det = a * d - b * c;
7113
- if (!det)
7114
- throw new Error("Cannot invert " + this);
6985
+ if (!det) throw new Error("Cannot invert " + this);
7115
6986
  const na = d / det;
7116
6987
  const nb = -b / det;
7117
6988
  const nc = -c / det;
@@ -7304,9 +7175,9 @@
7304
7175
  function screenCTM() {
7305
7176
  if (typeof this.isRoot === "function" && !this.isRoot()) {
7306
7177
  const rect = this.rect(1, 1);
7307
- const m = rect.node.getScreenCTM();
7178
+ const m2 = rect.node.getScreenCTM();
7308
7179
  rect.remove();
7309
- return new Matrix(m);
7180
+ return new Matrix(m2);
7310
7181
  }
7311
7182
  return new Matrix(this.node.getScreenCTM());
7312
7183
  }
@@ -7379,9 +7250,9 @@
7379
7250
  toString() {
7380
7251
  return this.x + " " + this.y + " " + this.width + " " + this.height;
7381
7252
  }
7382
- transform(m) {
7383
- if (!(m instanceof Matrix)) {
7384
- m = new Matrix(m);
7253
+ transform(m2) {
7254
+ if (!(m2 instanceof Matrix)) {
7255
+ m2 = new Matrix(m2);
7385
7256
  }
7386
7257
  let xMin = Infinity;
7387
7258
  let xMax = -Infinity;
@@ -7389,7 +7260,7 @@
7389
7260
  let yMax = -Infinity;
7390
7261
  const pts = [new Point(this.x, this.y), new Point(this.x2, this.y), new Point(this.x, this.y2), new Point(this.x2, this.y2)];
7391
7262
  pts.forEach(function(p) {
7392
- p = p.transform(m);
7263
+ p = p.transform(m2);
7393
7264
  xMin = Math.min(xMin, p.x);
7394
7265
  xMax = Math.max(xMax, p.x);
7395
7266
  yMin = Math.min(yMin, p.y);
@@ -7445,8 +7316,7 @@
7445
7316
  registerMethods({
7446
7317
  viewbox: {
7447
7318
  viewbox(x2, y2, width2, height2) {
7448
- if (x2 == null)
7449
- return new Box(this.attr("viewBox"));
7319
+ if (x2 == null) return new Box(this.attr("viewBox"));
7450
7320
  return this.attr("viewBox", new Box(x2, y2, width2, height2));
7451
7321
  },
7452
7322
  zoom(level, point2) {
@@ -7461,18 +7331,17 @@
7461
7331
  if (!width2 || !height2) {
7462
7332
  throw new Error("Impossible to get absolute width and height. Please provide an absolute width and height attribute on the zooming element");
7463
7333
  }
7464
- const v = this.viewbox();
7465
- const zoomX = width2 / v.width;
7466
- const zoomY = height2 / v.height;
7334
+ const v2 = this.viewbox();
7335
+ const zoomX = width2 / v2.width;
7336
+ const zoomY = height2 / v2.height;
7467
7337
  const zoom = Math.min(zoomX, zoomY);
7468
7338
  if (level == null) {
7469
7339
  return zoom;
7470
7340
  }
7471
7341
  let zoomAmount = zoom / level;
7472
- if (zoomAmount === Infinity)
7473
- zoomAmount = Number.MAX_SAFE_INTEGER / 100;
7474
- point2 = point2 || new Point(width2 / 2 / zoomX + v.x, height2 / 2 / zoomY + v.y);
7475
- const box = new Box(v).transform(new Matrix({
7342
+ if (zoomAmount === Infinity) zoomAmount = Number.MAX_SAFE_INTEGER / 100;
7343
+ point2 = point2 || new Point(width2 / 2 / zoomX + v2.x, height2 / 2 / zoomY + v2.y);
7344
+ const box = new Box(v2).transform(new Matrix({
7476
7345
  scale: zoomAmount,
7477
7346
  origin: point2
7478
7347
  }));
@@ -7484,8 +7353,7 @@
7484
7353
  class List extends Array {
7485
7354
  constructor(arr = [], ...args) {
7486
7355
  super(arr, ...args);
7487
- if (typeof arr === "number")
7488
- return this;
7356
+ if (typeof arr === "number") return this;
7489
7357
  this.length = 0;
7490
7358
  this.push(...arr);
7491
7359
  }
@@ -7509,10 +7377,8 @@
7509
7377
  const reserved = ["toArray", "constructor", "each"];
7510
7378
  List.extend = function(methods2) {
7511
7379
  methods2 = methods2.reduce((obj, name) => {
7512
- if (reserved.includes(name))
7513
- return obj;
7514
- if (name[0] === "_")
7515
- return obj;
7380
+ if (reserved.includes(name)) return obj;
7381
+ if (name[0] === "_") return obj;
7516
7382
  obj[name] = function(...attrs2) {
7517
7383
  return this.each(name, ...attrs2);
7518
7384
  };
@@ -7535,10 +7401,8 @@
7535
7401
  const windowEvents = {};
7536
7402
  function getEvents(instance) {
7537
7403
  let n = instance.getEventHolder();
7538
- if (n === globals.window)
7539
- n = windowEvents;
7540
- if (!n.events)
7541
- n.events = {};
7404
+ if (n === globals.window) n = windowEvents;
7405
+ if (!n.events) n.events = {};
7542
7406
  return n.events;
7543
7407
  }
7544
7408
  function getEventTarget(instance) {
@@ -7546,10 +7410,8 @@
7546
7410
  }
7547
7411
  function clearEvents(instance) {
7548
7412
  let n = instance.getEventHolder();
7549
- if (n === globals.window)
7550
- n = windowEvents;
7551
- if (n.events)
7552
- n.events = {};
7413
+ if (n === globals.window) n = windowEvents;
7414
+ if (n.events) n.events = {};
7553
7415
  }
7554
7416
  function on(node, events, listener, binding, options) {
7555
7417
  const l = listener.bind(binding || node);
@@ -7575,8 +7437,7 @@
7575
7437
  const n = getEventTarget(instance);
7576
7438
  if (typeof listener === "function") {
7577
7439
  listener = listener._svgjsListenerId;
7578
- if (!listener)
7579
- return;
7440
+ if (!listener) return;
7580
7441
  }
7581
7442
  events = Array.isArray(events) ? events : (events || "").split(delimiter);
7582
7443
  events.forEach(function(event) {
@@ -7640,8 +7501,7 @@
7640
7501
  }
7641
7502
  dispatchEvent(event) {
7642
7503
  const bag = this.getEventHolder().events;
7643
- if (!bag)
7644
- return true;
7504
+ if (!bag) return true;
7645
7505
  const events = bag[event.type];
7646
7506
  for (const i in events) {
7647
7507
  for (const j in events[i]) {
@@ -7720,16 +7580,14 @@
7720
7580
  return new this.constructor(this);
7721
7581
  }
7722
7582
  init(arr) {
7723
- if (typeof arr === "number")
7724
- return this;
7583
+ if (typeof arr === "number") return this;
7725
7584
  this.length = 0;
7726
7585
  this.push(...this.parse(arr));
7727
7586
  return this;
7728
7587
  }
7729
7588
  // Parse whitespace separated string
7730
7589
  parse(array2 = []) {
7731
- if (array2 instanceof Array)
7732
- return array2;
7590
+ if (array2 instanceof Array) return array2;
7733
7591
  return array2.trim().split(delimiter).map(parseFloat);
7734
7592
  }
7735
7593
  toArray() {
@@ -7833,8 +7691,7 @@
7833
7691
  return last;
7834
7692
  }, {});
7835
7693
  } else if (typeof attr2 === "object" && attr2.constructor === Object) {
7836
- for (val in attr2)
7837
- this.attr(val, attr2[val]);
7694
+ for (val in attr2) this.attr(val, attr2[val]);
7838
7695
  } else if (val === null) {
7839
7696
  this.node.removeAttribute(attr2);
7840
7697
  } else if (val == null) {
@@ -7972,14 +7829,11 @@
7972
7829
  // Returns the parent element instance
7973
7830
  parent(type) {
7974
7831
  let parent = this;
7975
- if (!parent.node.parentNode)
7976
- return null;
7832
+ if (!parent.node.parentNode) return null;
7977
7833
  parent = adopt(parent.node.parentNode);
7978
- if (!type)
7979
- return parent;
7834
+ if (!type) return parent;
7980
7835
  do {
7981
- if (typeof type === "string" ? parent.matches(type) : parent instanceof type)
7982
- return parent;
7836
+ if (typeof type === "string" ? parent.matches(type) : parent instanceof type) return parent;
7983
7837
  } while (parent = adopt(parent.node.parentNode));
7984
7838
  return parent;
7985
7839
  }
@@ -8067,8 +7921,7 @@
8067
7921
  if (outerXML) {
8068
7922
  const result = xmlOrFn(current);
8069
7923
  current = result || current;
8070
- if (result === false)
8071
- return "";
7924
+ if (result === false) return "";
8072
7925
  }
8073
7926
  current.each(function() {
8074
7927
  const result = xmlOrFn(this);
@@ -8173,10 +8026,9 @@
8173
8026
  // Get referenced element form attribute value
8174
8027
  reference(attr2) {
8175
8028
  attr2 = this.attr(attr2);
8176
- if (!attr2)
8177
- return null;
8178
- const m = (attr2 + "").match(reference);
8179
- return m ? makeInstance(m[1]) : null;
8029
+ if (!attr2) return null;
8030
+ const m2 = (attr2 + "").match(reference);
8031
+ return m2 ? makeInstance(m2[1]) : null;
8180
8032
  }
8181
8033
  // Get parent document
8182
8034
  root() {
@@ -8230,19 +8082,19 @@
8230
8082
  return a === "color" ? t : t + "-" + a;
8231
8083
  }
8232
8084
  };
8233
- ["fill", "stroke"].forEach(function(m) {
8085
+ ["fill", "stroke"].forEach(function(m2) {
8234
8086
  const extension = {};
8235
8087
  let i;
8236
- extension[m] = function(o) {
8088
+ extension[m2] = function(o) {
8237
8089
  if (typeof o === "undefined") {
8238
- return this.attr(m);
8090
+ return this.attr(m2);
8239
8091
  }
8240
8092
  if (typeof o === "string" || o instanceof Color || Color.isRgb(o) || o instanceof Element) {
8241
- this.attr(m, o);
8093
+ this.attr(m2, o);
8242
8094
  } else {
8243
- for (i = sugar[m].length - 1; i >= 0; i--) {
8244
- if (o[sugar[m][i]] != null) {
8245
- this.attr(sugar.prefix(m, sugar[m][i]), o[sugar[m][i]]);
8095
+ for (i = sugar[m2].length - 1; i >= 0; i--) {
8096
+ if (o[sugar[m2][i]] != null) {
8097
+ this.attr(sugar.prefix(m2, sugar[m2][i]), o[sugar[m2][i]]);
8246
8098
  }
8247
8099
  }
8248
8100
  }
@@ -8344,13 +8196,12 @@
8344
8196
  });
8345
8197
  registerMethods(["Element", "Runner"], {
8346
8198
  // Set font
8347
- font: function(a, v) {
8199
+ font: function(a, v2) {
8348
8200
  if (typeof a === "object") {
8349
- for (v in a)
8350
- this.font(v, a[v]);
8201
+ for (v2 in a) this.font(v2, a[v2]);
8351
8202
  return this;
8352
8203
  }
8353
- return a === "leading" ? this.leading(v) : a === "anchor" ? this.attr("text-anchor", v) : a === "size" || a === "family" || a === "weight" || a === "stretch" || a === "variant" || a === "style" ? this.attr("font-" + a, v) : this.attr(a, v);
8204
+ return a === "leading" ? this.leading(v2) : a === "anchor" ? this.attr("text-anchor", v2) : a === "size" || a === "family" || a === "weight" || a === "stretch" || a === "variant" || a === "style" ? this.attr("font-" + a, v2) : this.attr(a, v2);
8354
8205
  }
8355
8206
  });
8356
8207
  const methods = ["click", "dblclick", "mousedown", "mouseup", "mouseover", "mouseout", "mousemove", "mouseenter", "mouseleave", "touchstart", "touchmove", "touchleave", "touchend", "touchcancel"].reduce(function(last, event) {
@@ -8384,8 +8235,7 @@
8384
8235
  return matrix;
8385
8236
  }
8386
8237
  function toParent(parent, i) {
8387
- if (this === parent)
8388
- return this;
8238
+ if (this === parent) return this;
8389
8239
  const ctm2 = this.screenCTM();
8390
8240
  const pCtm = parent.screenCTM().inverse();
8391
8241
  this.addTo(parent, i).untransform().transform(pCtm.multiply(ctm2));
@@ -8550,8 +8400,7 @@
8550
8400
  }
8551
8401
  // custom attr to handle transform
8552
8402
  attr(a, b, c) {
8553
- if (a === "transform")
8554
- a = "gradientTransform";
8403
+ if (a === "transform") a = "gradientTransform";
8555
8404
  return super.attr(a, b, c);
8556
8405
  }
8557
8406
  bbox() {
@@ -8600,8 +8449,7 @@
8600
8449
  }
8601
8450
  // custom attr to handle transform
8602
8451
  attr(a, b, c) {
8603
- if (a === "transform")
8604
- a = "patternTransform";
8452
+ if (a === "transform") a = "patternTransform";
8605
8453
  return super.attr(a, b, c);
8606
8454
  }
8607
8455
  bbox() {
@@ -8653,8 +8501,7 @@
8653
8501
  }
8654
8502
  // (re)load image
8655
8503
  load(url, callback) {
8656
- if (!url)
8657
- return this;
8504
+ if (!url) return this;
8658
8505
  const img = new globals.window.Image();
8659
8506
  on(img, "load", function(e) {
8660
8507
  const p = this.parent(Pattern);
@@ -8733,8 +8580,7 @@
8733
8580
  } else {
8734
8581
  array2 = array2.trim().split(delimiter).map(parseFloat);
8735
8582
  }
8736
- if (array2.length % 2 !== 0)
8737
- array2.pop();
8583
+ if (array2.length % 2 !== 0) array2.pop();
8738
8584
  for (let i = 0, len = array2.length; i < len; i = i + 2) {
8739
8585
  points.push([array2[i], array2[i + 1]]);
8740
8586
  }
@@ -8745,10 +8591,8 @@
8745
8591
  let i;
8746
8592
  const box = this.bbox();
8747
8593
  for (i = this.length - 1; i >= 0; i--) {
8748
- if (box.width)
8749
- this[i][0] = (this[i][0] - box.x) * width2 / box.width + box.x;
8750
- if (box.height)
8751
- this[i][1] = (this[i][1] - box.y) * height2 / box.height + box.y;
8594
+ if (box.width) this[i][0] = (this[i][0] - box.x) * width2 / box.width + box.x;
8595
+ if (box.height) this[i][1] = (this[i][1] - box.y) * height2 / box.height + box.y;
8752
8596
  }
8753
8597
  return this;
8754
8598
  }
@@ -8769,18 +8613,18 @@
8769
8613
  }
8770
8614
  return array2.join(" ");
8771
8615
  }
8772
- transform(m) {
8773
- return this.clone().transformO(m);
8616
+ transform(m2) {
8617
+ return this.clone().transformO(m2);
8774
8618
  }
8775
8619
  // transform points with matrix (similar to Point.transform)
8776
- transformO(m) {
8777
- if (!Matrix.isMatrixLike(m)) {
8778
- m = new Matrix(m);
8620
+ transformO(m2) {
8621
+ if (!Matrix.isMatrixLike(m2)) {
8622
+ m2 = new Matrix(m2);
8779
8623
  }
8780
8624
  for (let i = this.length; i--; ) {
8781
8625
  const [x2, y2] = this[i];
8782
- this[i][0] = m.a * x2 + m.c * y2 + m.e;
8783
- this[i][1] = m.b * x2 + m.d * y2 + m.f;
8626
+ this[i][0] = m2.a * x2 + m2.c * y2 + m2.e;
8627
+ this[i][1] = m2.b * x2 + m2.d * y2 + m2.f;
8784
8628
  }
8785
8629
  return this;
8786
8630
  }
@@ -8902,8 +8746,7 @@
8902
8746
  // Create and attach markers
8903
8747
  marker(marker, width2, height2, block) {
8904
8748
  let attr2 = ["marker"];
8905
- if (marker !== "all")
8906
- attr2.push(marker);
8749
+ if (marker !== "all") attr2.push(marker);
8907
8750
  attr2 = attr2.join("-");
8908
8751
  marker = arguments[1] instanceof Marker ? arguments[1] : this.defs().marker(width2, height2, block);
8909
8752
  return this.attr(attr2, marker);
@@ -8912,12 +8755,10 @@
8912
8755
  });
8913
8756
  register(Marker, "Marker");
8914
8757
  function makeSetterGetter(k, f) {
8915
- return function(v) {
8916
- if (v == null)
8917
- return this[k];
8918
- this[k] = v;
8919
- if (f)
8920
- f.call(this);
8758
+ return function(v2) {
8759
+ if (v2 == null) return this[k];
8760
+ this[k] = v2;
8761
+ if (f) f.call(this);
8921
8762
  return this;
8922
8763
  };
8923
8764
  }
@@ -9031,15 +8872,11 @@
9031
8872
  this.duration(duration).overshoot(overshoot);
9032
8873
  }
9033
8874
  step(current, target, dt, c) {
9034
- if (typeof current === "string")
9035
- return current;
8875
+ if (typeof current === "string") return current;
9036
8876
  c.done = dt === Infinity;
9037
- if (dt === Infinity)
9038
- return target;
9039
- if (dt === 0)
9040
- return current;
9041
- if (dt > 100)
9042
- dt = 16;
8877
+ if (dt === Infinity) return target;
8878
+ if (dt === 0) return current;
8879
+ if (dt > 100) dt = 16;
9043
8880
  dt /= 1e3;
9044
8881
  const velocity = c.velocity || 0;
9045
8882
  const acceleration = -this.d * velocity - this.k * (current - target);
@@ -9059,13 +8896,10 @@
9059
8896
  this.p(p).i(i).d(d).windup(windup);
9060
8897
  }
9061
8898
  step(current, target, dt, c) {
9062
- if (typeof current === "string")
9063
- return current;
8899
+ if (typeof current === "string") return current;
9064
8900
  c.done = dt === Infinity;
9065
- if (dt === Infinity)
9066
- return target;
9067
- if (dt === 0)
9068
- return current;
8901
+ if (dt === Infinity) return target;
8902
+ if (dt === 0) return current;
9069
8903
  const p = target - current;
9070
8904
  let i = (c.integral || 0) + p * dt;
9071
8905
  const d = (p - (c.error || 0)) / dt;
@@ -9151,10 +8985,8 @@
9151
8985
  for (let i = 0, il = mlhvqtcsaz.length; i < il; ++i) {
9152
8986
  pathHandlers[mlhvqtcsaz[i]] = /* @__PURE__ */ function(i2) {
9153
8987
  return function(c, p, p0) {
9154
- if (i2 === "H")
9155
- c[0] = c[0] + p.x;
9156
- else if (i2 === "V")
9157
- c[0] = c[0] + p.y;
8988
+ if (i2 === "H") c[0] = c[0] + p.x;
8989
+ else if (i2 === "V") c[0] = c[0] + p.y;
9158
8990
  else if (i2 === "A") {
9159
8991
  c[5] = c[5] + p.x;
9160
8992
  c[6] = c[6] + p.y;
@@ -9190,8 +9022,7 @@
9190
9022
  return pathLetter;
9191
9023
  }
9192
9024
  function finalizeNumber(parser2, inNumber) {
9193
- if (!parser2.inNumber)
9194
- throw new Error("Parser Error");
9025
+ if (!parser2.inNumber) throw new Error("Parser Error");
9195
9026
  parser2.number && parser2.segment.push(parseFloat(parser2.number));
9196
9027
  parser2.inNumber = inNumber;
9197
9028
  parser2.number = "";
@@ -9209,8 +9040,7 @@
9209
9040
  parser2.segments.push(parser2.segment);
9210
9041
  }
9211
9042
  function isArcFlag(parser2) {
9212
- if (!parser2.segment.length)
9213
- return false;
9043
+ if (!parser2.segment.length) return false;
9214
9044
  const isArc = parser2.segment[0].toUpperCase() === "A";
9215
9045
  const length2 = parser2.segment.length;
9216
9046
  return isArc && (length2 === 4 || length2 === 5);
@@ -9465,8 +9295,7 @@
9465
9295
  return this;
9466
9296
  }
9467
9297
  stepper(stepper) {
9468
- if (stepper == null)
9469
- return this._stepper;
9298
+ if (stepper == null) return this._stepper;
9470
9299
  this._stepper = stepper;
9471
9300
  return this;
9472
9301
  }
@@ -9541,8 +9370,8 @@
9541
9370
  return this;
9542
9371
  }
9543
9372
  toArray() {
9544
- const v = this;
9545
- return [v.scaleX, v.scaleY, v.shear, v.rotate, v.translateX, v.translateY, v.originX, v.originY];
9373
+ const v2 = this;
9374
+ return [v2.scaleX, v2.scaleY, v2.shear, v2.rotate, v2.translateX, v2.translateY, v2.originX, v2.originY];
9546
9375
  }
9547
9376
  }
9548
9377
  TransformBag.defaults = {
@@ -9804,24 +9633,18 @@
9804
9633
  }
9805
9634
  // Removes the item that was returned from the push
9806
9635
  remove(item) {
9807
- if (item.prev)
9808
- item.prev.next = item.next;
9809
- if (item.next)
9810
- item.next.prev = item.prev;
9811
- if (item === this._last)
9812
- this._last = item.prev;
9813
- if (item === this._first)
9814
- this._first = item.next;
9636
+ if (item.prev) item.prev.next = item.next;
9637
+ if (item.next) item.next.prev = item.prev;
9638
+ if (item === this._last) this._last = item.prev;
9639
+ if (item === this._first) this._first = item.next;
9815
9640
  item.prev = null;
9816
9641
  item.next = null;
9817
9642
  }
9818
9643
  shift() {
9819
9644
  const remove2 = this._first;
9820
- if (!remove2)
9821
- return null;
9645
+ if (!remove2) return null;
9822
9646
  this._first = remove2.next;
9823
- if (this._first)
9824
- this._first.prev = null;
9647
+ if (this._first) this._first.prev = null;
9825
9648
  this._last = this._first ? this._last : null;
9826
9649
  return remove2.value;
9827
9650
  }
@@ -9879,8 +9702,7 @@
9879
9702
  } else {
9880
9703
  Animator.timeouts.push(nextTimeout);
9881
9704
  }
9882
- if (nextTimeout === lastTimeout)
9883
- break;
9705
+ if (nextTimeout === lastTimeout) break;
9884
9706
  }
9885
9707
  let nextFrame = null;
9886
9708
  const lastFrame = Animator.frames.last();
@@ -9957,8 +9779,7 @@
9957
9779
  return this._continue();
9958
9780
  }
9959
9781
  persist(dtOrForever) {
9960
- if (dtOrForever == null)
9961
- return this._persist;
9782
+ if (dtOrForever == null) return this._persist;
9962
9783
  this._persist = dtOrForever;
9963
9784
  return this;
9964
9785
  }
@@ -9968,8 +9789,7 @@
9968
9789
  }
9969
9790
  reverse(yes) {
9970
9791
  const currentSpeed = this.speed();
9971
- if (yes == null)
9972
- return this.speed(-currentSpeed);
9792
+ if (yes == null) return this.speed(-currentSpeed);
9973
9793
  const positive = Math.abs(currentSpeed);
9974
9794
  return this.speed(yes ? -positive : positive);
9975
9795
  }
@@ -10020,14 +9840,12 @@
10020
9840
  return this.time(this._time + dt);
10021
9841
  }
10022
9842
  source(fn) {
10023
- if (fn == null)
10024
- return this._timeSource;
9843
+ if (fn == null) return this._timeSource;
10025
9844
  this._timeSource = fn;
10026
9845
  return this;
10027
9846
  }
10028
9847
  speed(speed) {
10029
- if (speed == null)
10030
- return this._speed;
9848
+ if (speed == null) return this._speed;
10031
9849
  this._speed = speed;
10032
9850
  return this;
10033
9851
  }
@@ -10036,16 +9854,14 @@
10036
9854
  return this.pause();
10037
9855
  }
10038
9856
  time(time) {
10039
- if (time == null)
10040
- return this._time;
9857
+ if (time == null) return this._time;
10041
9858
  this._time = time;
10042
9859
  return this._continue(true);
10043
9860
  }
10044
9861
  // Remove the runner from this timeline
10045
9862
  unschedule(runner) {
10046
9863
  const index = this._runnerIds.indexOf(runner.id);
10047
- if (index < 0)
10048
- return this;
9864
+ if (index < 0) return this;
10049
9865
  this._runners.splice(index, 1);
10050
9866
  this._runnerIds.splice(index, 1);
10051
9867
  runner.timeline(null);
@@ -10062,18 +9878,15 @@
10062
9878
  _continue(immediateStep = false) {
10063
9879
  Animator.cancelFrame(this._nextFrame);
10064
9880
  this._nextFrame = null;
10065
- if (immediateStep)
10066
- return this._stepImmediate();
10067
- if (this._paused)
10068
- return this;
9881
+ if (immediateStep) return this._stepImmediate();
9882
+ if (this._paused) return this;
10069
9883
  this._nextFrame = Animator.frame(this._step);
10070
9884
  return this;
10071
9885
  }
10072
9886
  _stepFn(immediateStep = false) {
10073
9887
  const time = this._timeSource();
10074
9888
  let dtSource = time - this._lastSourceTime;
10075
- if (immediateStep)
10076
- dtSource = 0;
9889
+ if (immediateStep) dtSource = 0;
10077
9890
  const dtTime = this._speed * dtSource + (this._time - this._lastStepTime);
10078
9891
  this._lastSourceTime = time;
10079
9892
  if (!immediateStep) {
@@ -10102,8 +9915,7 @@
10102
9915
  } else if (dtToStart < dt) {
10103
9916
  dt = dtToStart;
10104
9917
  }
10105
- if (!runner.active())
10106
- continue;
9918
+ if (!runner.active()) continue;
10107
9919
  const finished = runner.step(dt).done;
10108
9920
  if (!finished) {
10109
9921
  runnersLeft = true;
@@ -10192,8 +10004,7 @@
10192
10004
  };
10193
10005
  }
10194
10006
  active(enabled) {
10195
- if (enabled == null)
10196
- return this.enabled;
10007
+ if (enabled == null) return this.enabled;
10197
10008
  this.enabled = enabled;
10198
10009
  return this;
10199
10010
  }
@@ -10212,10 +10023,8 @@
10212
10023
  animate(duration, delay, when) {
10213
10024
  const o = Runner.sanitise(duration, delay, when);
10214
10025
  const runner = new Runner(o.duration);
10215
- if (this._timeline)
10216
- runner.timeline(this._timeline);
10217
- if (this._element)
10218
- runner.element(this._element);
10026
+ if (this._timeline) runner.timeline(this._timeline);
10027
+ if (this._element) runner.element(this._element);
10219
10028
  return runner.loop(o).schedule(o.delay, o.when);
10220
10029
  }
10221
10030
  clearTransform() {
@@ -10250,8 +10059,7 @@
10250
10059
  help us make new runners from the current runner
10251
10060
  */
10252
10061
  element(element) {
10253
- if (element == null)
10254
- return this._element;
10062
+ if (element == null) return this._element;
10255
10063
  this._element = element;
10256
10064
  element._prepareRunner();
10257
10065
  return this;
@@ -10287,8 +10095,7 @@
10287
10095
  return this.time(time);
10288
10096
  }
10289
10097
  persist(dtOrForever) {
10290
- if (dtOrForever == null)
10291
- return this._persist;
10098
+ if (dtOrForever == null) return this._persist;
10292
10099
  this._persist = dtOrForever;
10293
10100
  return this;
10294
10101
  }
@@ -10343,8 +10150,7 @@
10343
10150
  return this;
10344
10151
  }
10345
10152
  reset() {
10346
- if (this._reseted)
10347
- return this;
10153
+ if (this._reseted) return this;
10348
10154
  this.time(0);
10349
10155
  this._reseted = true;
10350
10156
  return this;
@@ -10366,8 +10172,7 @@
10366
10172
  return this;
10367
10173
  }
10368
10174
  step(dt) {
10369
- if (!this.enabled)
10370
- return this;
10175
+ if (!this.enabled) return this;
10371
10176
  dt = dt == null ? 16 : dt;
10372
10177
  this._time += dt;
10373
10178
  const position2 = this.position();
@@ -10410,8 +10215,7 @@
10410
10215
  return this;
10411
10216
  }
10412
10217
  timeline(timeline2) {
10413
- if (typeof timeline2 === "undefined")
10414
- return this._timeline;
10218
+ if (typeof timeline2 === "undefined") return this._timeline;
10415
10219
  this._timeline = timeline2;
10416
10220
  return this;
10417
10221
  }
@@ -10422,8 +10226,7 @@
10422
10226
  }
10423
10227
  // Run each initialise function in the runner if required
10424
10228
  _initialise(running) {
10425
- if (!running && !this._isDeclarative)
10426
- return;
10229
+ if (!running && !this._isDeclarative) return;
10427
10230
  for (let i = 0, len = this._queue.length; i < len; ++i) {
10428
10231
  const current = this._queue[i];
10429
10232
  const needsIt = this._isDeclarative || !current.initialised && running;
@@ -10510,8 +10313,7 @@
10510
10313
  this.ids = [];
10511
10314
  }
10512
10315
  add(runner) {
10513
- if (this.runners.includes(runner))
10514
- return;
10316
+ if (this.runners.includes(runner)) return;
10515
10317
  const id = runner.id + 1;
10516
10318
  this.runners.push(runner);
10517
10319
  this.ids.push(id);
@@ -10593,12 +10395,12 @@
10593
10395
  });
10594
10396
  const difference = (a, b) => a.filter((x2) => !b.includes(x2));
10595
10397
  extend(Runner, {
10596
- attr(a, v) {
10597
- return this.styleAttr("attr", a, v);
10398
+ attr(a, v2) {
10399
+ return this.styleAttr("attr", a, v2);
10598
10400
  },
10599
10401
  // Add animatable styles
10600
- css(s, v) {
10601
- return this.styleAttr("css", s, v);
10402
+ css(s, v2) {
10403
+ return this.styleAttr("css", s, v2);
10602
10404
  },
10603
10405
  styleAttr(type, nameOrAttrs, val) {
10604
10406
  if (typeof nameOrAttrs === "string") {
@@ -10607,8 +10409,7 @@
10607
10409
  });
10608
10410
  }
10609
10411
  let attrs2 = nameOrAttrs;
10610
- if (this._tryRetarget(type, attrs2))
10611
- return this;
10412
+ if (this._tryRetarget(type, attrs2)) return this;
10612
10413
  let morpher = new Morphable(this._stepper).to(attrs2);
10613
10414
  let keys = Object.keys(attrs2);
10614
10415
  this.queue(function() {
@@ -10635,8 +10436,7 @@
10635
10436
  return this;
10636
10437
  },
10637
10438
  zoom(level, point2) {
10638
- if (this._tryRetarget("zoom", level, point2))
10639
- return this;
10439
+ if (this._tryRetarget("zoom", level, point2)) return this;
10640
10440
  let morpher = new Morphable(this._stepper).to(new SVGNumber(level));
10641
10441
  this.queue(function() {
10642
10442
  morpher = morpher.from(this.element().zoom());
@@ -10688,8 +10488,7 @@
10688
10488
  }
10689
10489
  }
10690
10490
  function run(pos) {
10691
- if (!relative)
10692
- this.clearTransform();
10491
+ if (!relative) this.clearTransform();
10693
10492
  const {
10694
10493
  x: x2,
10695
10494
  y: y2
@@ -10759,8 +10558,7 @@
10759
10558
  },
10760
10559
  _queueNumberDelta(method, to2) {
10761
10560
  to2 = new SVGNumber(to2);
10762
- if (this._tryRetarget(method, to2))
10763
- return this;
10561
+ if (this._tryRetarget(method, to2)) return this;
10764
10562
  const morpher = new Morphable(this._stepper).to(to2);
10765
10563
  let from2 = null;
10766
10564
  this.queue(function() {
@@ -10777,8 +10575,7 @@
10777
10575
  return this;
10778
10576
  },
10779
10577
  _queueObject(method, to2) {
10780
- if (this._tryRetarget(method, to2))
10781
- return this;
10578
+ if (this._tryRetarget(method, to2)) return this;
10782
10579
  const morpher = new Morphable(this._stepper).to(to2);
10783
10580
  this.queue(function() {
10784
10581
  morpher.from(this.element()[method]());
@@ -10835,8 +10632,7 @@
10835
10632
  if (arguments.length === 4) {
10836
10633
  return this.plot([a, b, c, d]);
10837
10634
  }
10838
- if (this._tryRetarget("plot", a))
10839
- return this;
10635
+ if (this._tryRetarget("plot", a)) return this;
10840
10636
  const morpher = new Morphable(this._stepper).type(this._element.MorphArray).to(a);
10841
10637
  this.queue(function() {
10842
10638
  morpher.from(this._element.array());
@@ -10863,12 +10659,9 @@
10863
10659
  opacity: arguments[2]
10864
10660
  });
10865
10661
  }
10866
- if (o.opacity != null)
10867
- this.attr("stop-opacity", o.opacity);
10868
- if (o.color != null)
10869
- this.attr("stop-color", o.color);
10870
- if (o.offset != null)
10871
- this.attr("offset", o.offset);
10662
+ if (o.opacity != null) this.attr("stop-opacity", o.opacity);
10663
+ if (o.color != null) this.attr("stop-color", o.color);
10664
+ if (o.offset != null) this.attr("offset", o.offset);
10872
10665
  return this;
10873
10666
  }
10874
10667
  });
@@ -10886,8 +10679,7 @@
10886
10679
  }
10887
10680
  // Creates and returns defs element
10888
10681
  defs() {
10889
- if (!this.isRoot())
10890
- return this.root().defs();
10682
+ if (!this.isRoot()) return this.root().defs();
10891
10683
  return adopt(this.node.querySelector("defs")) || this.put(new Defs());
10892
10684
  }
10893
10685
  isRoot() {
@@ -10895,8 +10687,7 @@
10895
10687
  }
10896
10688
  // Add namespaces
10897
10689
  namespace() {
10898
- if (!this.isRoot())
10899
- return this.root().namespace();
10690
+ if (!this.isRoot()) return this.root().namespace();
10900
10691
  return this.attr({
10901
10692
  xmlns: svg,
10902
10693
  version: "1.1"
@@ -10911,8 +10702,7 @@
10911
10702
  // Check if this is a root svg
10912
10703
  // If not, call root() from this element
10913
10704
  root() {
10914
- if (this.isRoot())
10915
- return this;
10705
+ if (this.isRoot()) return this;
10916
10706
  return super.root();
10917
10707
  }
10918
10708
  }
@@ -11063,8 +10853,7 @@
11063
10853
  text = "";
11064
10854
  for (let i = 0, len = children.length; i < len; ++i) {
11065
10855
  if (children[i].nodeName === "textPath") {
11066
- if (i === 0)
11067
- firstLine = 1;
10856
+ if (i === 0) firstLine = 1;
11068
10857
  continue;
11069
10858
  }
11070
10859
  if (i !== firstLine && children[i].nodeType !== 3 && adopt(children[i]).dom.newLined === true) {
@@ -11128,8 +10917,7 @@
11128
10917
  }
11129
10918
  // Set text content
11130
10919
  text(text) {
11131
- if (text == null)
11132
- return this.node.textContent + (this.dom.newLined ? "\n" : "");
10920
+ if (text == null) return this.node.textContent + (this.dom.newLined ? "\n" : "");
11133
10921
  if (typeof text === "function") {
11134
10922
  this.clear().build(true);
11135
10923
  text.call(this, this);
@@ -11253,8 +11041,8 @@
11253
11041
  } catch (e) {
11254
11042
  return;
11255
11043
  }
11256
- const m = new Matrix(child);
11257
- const matrix = m.translate(dx2, dy2).transform(m.inverse());
11044
+ const m2 = new Matrix(child);
11045
+ const matrix = m2.translate(dx2, dy2).transform(m2.inverse());
11258
11046
  const p = new Point(bbox2.x, bbox2.y).transform(matrix);
11259
11047
  child.move(p.x, p.y);
11260
11048
  });
@@ -11267,8 +11055,7 @@
11267
11055
  return this.dmove(0, dy2);
11268
11056
  }
11269
11057
  function height(height2, box = this.bbox()) {
11270
- if (height2 == null)
11271
- return box.height;
11058
+ if (height2 == null) return box.height;
11272
11059
  return this.size(box.width, height2, box);
11273
11060
  }
11274
11061
  function move(x2 = 0, y2 = 0, box = this.bbox()) {
@@ -11287,18 +11074,15 @@
11287
11074
  return this;
11288
11075
  }
11289
11076
  function width(width2, box = this.bbox()) {
11290
- if (width2 == null)
11291
- return box.width;
11077
+ if (width2 == null) return box.width;
11292
11078
  return this.size(width2, box.height, box);
11293
11079
  }
11294
11080
  function x(x2, box = this.bbox()) {
11295
- if (x2 == null)
11296
- return box.x;
11081
+ if (x2 == null) return box.x;
11297
11082
  return this.move(x2, box.y, box);
11298
11083
  }
11299
11084
  function y(y2, box = this.bbox()) {
11300
- if (y2 == null)
11301
- return box.y;
11085
+ if (y2 == null) return box.y;
11302
11086
  return this.move(box.x, y2, box);
11303
11087
  }
11304
11088
  var containerGeometry = {
@@ -11352,8 +11136,7 @@
11352
11136
  Element: {
11353
11137
  unlink() {
11354
11138
  const link = this.linker();
11355
- if (!link)
11356
- return this;
11139
+ if (!link) return this;
11357
11140
  const parent = link.parent();
11358
11141
  if (!parent) {
11359
11142
  return this.remove();
@@ -11437,12 +11220,9 @@
11437
11220
  opacity: arguments[2]
11438
11221
  };
11439
11222
  }
11440
- if (o.opacity != null)
11441
- this.attr("stop-opacity", o.opacity);
11442
- if (o.color != null)
11443
- this.attr("stop-color", o.color);
11444
- if (o.offset != null)
11445
- this.attr("offset", new SVGNumber(o.offset));
11223
+ if (o.opacity != null) this.attr("stop-opacity", o.opacity);
11224
+ if (o.color != null) this.attr("stop-color", o.color);
11225
+ if (o.offset != null) this.attr("offset", new SVGNumber(o.offset));
11446
11226
  return this;
11447
11227
  }
11448
11228
  }
@@ -11456,10 +11236,8 @@
11456
11236
  });
11457
11237
  register(Stop, "Stop");
11458
11238
  function cssRule(selector, rule) {
11459
- if (!selector)
11460
- return "";
11461
- if (!rule)
11462
- return selector;
11239
+ if (!selector) return "";
11240
+ if (!rule) return selector;
11463
11241
  let ret = selector + "{";
11464
11242
  for (const i in rule) {
11465
11243
  ret += unCamelCase(i) + ":" + rule[i] + ";";
@@ -11623,16 +11401,12 @@
11623
11401
  x: x2,
11624
11402
  y: y2
11625
11403
  } = this.attr(["width", "height", "rx", "ry", "x", "y"]);
11626
- if (rx2 < 0)
11627
- rx2 = 0;
11628
- if (ry2 < 0)
11629
- ry2 = 0;
11404
+ if (rx2 < 0) rx2 = 0;
11405
+ if (ry2 < 0) ry2 = 0;
11630
11406
  rx2 = rx2 || ry2;
11631
11407
  ry2 = ry2 || rx2;
11632
- if (rx2 > w / 2)
11633
- rx2 = w / 2;
11634
- if (ry2 > h / 2)
11635
- ry2 = h / 2;
11408
+ if (rx2 > w / 2) rx2 = w / 2;
11409
+ if (ry2 > h / 2) ry2 = h / 2;
11636
11410
  if (rx2 && ry2) {
11637
11411
  d = [
11638
11412
  ["M", rx2 + x2, y2],
@@ -11796,8 +11570,7 @@
11796
11570
  }
11797
11571
  function mergeOptions(target, source) {
11798
11572
  for (const key of Object.keys(source)) {
11799
- if (source[key] instanceof Object)
11800
- Object.assign(source[key], mergeOptions(target[key], source[key]));
11573
+ if (source[key] instanceof Object) Object.assign(source[key], mergeOptions(target[key], source[key]));
11801
11574
  }
11802
11575
  Object.assign(target || {}, source);
11803
11576
  return target;
@@ -11982,7 +11755,7 @@
11982
11755
  }
11983
11756
  async draw(svg2, viewmap) {
11984
11757
  const chains = viewmap.chains.filter((c) => c.visibility === ChainVisibility.Visible);
11985
- const meshes = Array.from(viewmap.meshes).filter((m) => m.drawVisibleContours);
11758
+ const meshes = Array.from(viewmap.meshes).filter((m2) => m2.drawVisibleContours);
11986
11759
  const group = new G({ id: "visible-contours" });
11987
11760
  drawChains(group, meshes, chains, this.options);
11988
11761
  svg2.add(group);
@@ -12005,7 +11778,7 @@
12005
11778
  const chains = viewmap.chains.filter(
12006
11779
  (c) => c.visibility === ChainVisibility.Hidden
12007
11780
  );
12008
- const meshes = Array.from(viewmap.meshes).filter((m) => m.drawHiddenContours);
11781
+ const meshes = Array.from(viewmap.meshes).filter((m2) => m2.drawHiddenContours);
12009
11782
  const group = new G({ id: "hidden-contours" });
12010
11783
  svg2.add(group);
12011
11784
  drawChains(group, meshes, chains, this.options);
@@ -12093,7 +11866,7 @@
12093
11866
  const det = _matrix.determinant();
12094
11867
  if (det > EPSILON) {
12095
11868
  return 1;
12096
- } else if (det < -EPSILON) {
11869
+ } else if (det < -1e-10) {
12097
11870
  return -1;
12098
11871
  }
12099
11872
  return 0;
@@ -12527,10 +12300,10 @@
12527
12300
  }
12528
12301
  }
12529
12302
  }
12530
- const v = new Vertex();
12531
- v.position.copy(position2);
12532
- struct.vertices.push(v);
12533
- return v;
12303
+ const v2 = new Vertex();
12304
+ v2.position.copy(position2);
12305
+ struct.vertices.push(v2);
12306
+ return v2;
12534
12307
  }
12535
12308
  function removeFace(struct, face) {
12536
12309
  if (!struct.faces.remove(face)) {
@@ -12721,8 +12494,7 @@
12721
12494
  }
12722
12495
  const hash1 = i1 + "-" + i2;
12723
12496
  let h1 = halfedgeMap.get(hash1);
12724
- if (h1 == null ? void 0 : h1.face)
12725
- h1 = void 0;
12497
+ if (h1 == null ? void 0 : h1.face) h1 = void 0;
12726
12498
  if (!h1) {
12727
12499
  try {
12728
12500
  h1 = struct.addEdge(v1, v2);
@@ -12734,14 +12506,11 @@
12734
12506
  } catch (e) {
12735
12507
  }
12736
12508
  }
12737
- if (h1)
12738
- loopHalfedges.push(h1);
12739
- else
12740
- break;
12509
+ if (h1) loopHalfedges.push(h1);
12510
+ else break;
12741
12511
  }
12742
12512
  try {
12743
- if (loopHalfedges.length < 3)
12744
- throw "need 3 for face";
12513
+ if (loopHalfedges.length < 3) throw "need 3 for face";
12745
12514
  struct.addFace(loopHalfedges);
12746
12515
  } catch (e) {
12747
12516
  }
@@ -13014,38 +12783,26 @@
13014
12783
  const hx = triangleBounds[i + 1];
13015
12784
  const lx = cx2 - hx;
13016
12785
  const rx2 = cx2 + hx;
13017
- if (lx < minx)
13018
- minx = lx;
13019
- if (rx2 > maxx)
13020
- maxx = rx2;
13021
- if (cx2 < cminx)
13022
- cminx = cx2;
13023
- if (cx2 > cmaxx)
13024
- cmaxx = cx2;
12786
+ if (lx < minx) minx = lx;
12787
+ if (rx2 > maxx) maxx = rx2;
12788
+ if (cx2 < cminx) cminx = cx2;
12789
+ if (cx2 > cmaxx) cmaxx = cx2;
13025
12790
  const cy2 = triangleBounds[i + 2];
13026
12791
  const hy = triangleBounds[i + 3];
13027
12792
  const ly = cy2 - hy;
13028
12793
  const ry2 = cy2 + hy;
13029
- if (ly < miny)
13030
- miny = ly;
13031
- if (ry2 > maxy)
13032
- maxy = ry2;
13033
- if (cy2 < cminy)
13034
- cminy = cy2;
13035
- if (cy2 > cmaxy)
13036
- cmaxy = cy2;
12794
+ if (ly < miny) miny = ly;
12795
+ if (ry2 > maxy) maxy = ry2;
12796
+ if (cy2 < cminy) cminy = cy2;
12797
+ if (cy2 > cmaxy) cmaxy = cy2;
13037
12798
  const cz = triangleBounds[i + 4];
13038
12799
  const hz = triangleBounds[i + 5];
13039
12800
  const lz = cz - hz;
13040
12801
  const rz = cz + hz;
13041
- if (lz < minz)
13042
- minz = lz;
13043
- if (rz > maxz)
13044
- maxz = rz;
13045
- if (cz < cminz)
13046
- cminz = cz;
13047
- if (cz > cmaxz)
13048
- cmaxz = cz;
12802
+ if (lz < minz) minz = lz;
12803
+ if (rz > maxz) maxz = rz;
12804
+ if (cz < cminz) cminz = cz;
12805
+ if (cz > cmaxz) cmaxz = cz;
13049
12806
  }
13050
12807
  target[0] = minx;
13051
12808
  target[1] = miny;
@@ -13110,15 +12867,11 @@
13110
12867
  c = posArr[ci + el];
13111
12868
  }
13112
12869
  let min = a;
13113
- if (b < min)
13114
- min = b;
13115
- if (c < min)
13116
- min = c;
12870
+ if (b < min) min = b;
12871
+ if (c < min) min = c;
13117
12872
  let max = a;
13118
- if (b > max)
13119
- max = b;
13120
- if (c > max)
13121
- max = c;
12873
+ if (b > max) max = b;
12874
+ if (c > max) max = c;
13122
12875
  const halfExtents = (max - min) / 2;
13123
12876
  const el2 = el * 2;
13124
12877
  triangleBounds[tri6 + el2 + 0] = min + halfExtents;
@@ -13298,8 +13051,7 @@
13298
13051
  const triCenter = triangleBounds[c + 2 * a];
13299
13052
  const relativeCenter = triCenter - axisLeft;
13300
13053
  let binIndex = ~~(relativeCenter / binWidth);
13301
- if (binIndex >= BIN_COUNT)
13302
- binIndex = BIN_COUNT - 1;
13054
+ if (binIndex >= BIN_COUNT) binIndex = BIN_COUNT - 1;
13303
13055
  const bin = sahBins[binIndex];
13304
13056
  bin.count++;
13305
13057
  expandByTriangleBounds(c, triangleBounds, bin.bounds);
@@ -13755,25 +13507,21 @@
13755
13507
  lineTemp.start = a;
13756
13508
  lineTemp.end = b;
13757
13509
  const closestPoint1 = lineTemp.closestPointToPoint(center2, true, closestPointTemp);
13758
- if (closestPoint1.distanceTo(center2) <= radius)
13759
- return true;
13510
+ if (closestPoint1.distanceTo(center2) <= radius) return true;
13760
13511
  lineTemp.start = a;
13761
13512
  lineTemp.end = c;
13762
13513
  const closestPoint2 = lineTemp.closestPointToPoint(center2, true, closestPointTemp);
13763
- if (closestPoint2.distanceTo(center2) <= radius)
13764
- return true;
13514
+ if (closestPoint2.distanceTo(center2) <= radius) return true;
13765
13515
  lineTemp.start = b;
13766
13516
  lineTemp.end = c;
13767
13517
  const closestPoint3 = lineTemp.closestPointToPoint(center2, true, closestPointTemp);
13768
- if (closestPoint3.distanceTo(center2) <= radius)
13769
- return true;
13518
+ if (closestPoint3.distanceTo(center2) <= radius) return true;
13770
13519
  const plane = triangle3.getPlane(planeTemp);
13771
13520
  const dp = Math.abs(plane.distanceToPoint(center2));
13772
13521
  if (dp <= radius) {
13773
13522
  const pp = plane.projectPoint(center2, projectedPointTemp);
13774
13523
  const cp = triangle3.containsPoint(pp);
13775
- if (cp)
13776
- return true;
13524
+ if (cp) return true;
13777
13525
  }
13778
13526
  return false;
13779
13527
  };
@@ -13841,29 +13589,23 @@
13841
13589
  distSq = point1.distanceToSquared(point2);
13842
13590
  if (distSq < closestDistanceSq) {
13843
13591
  closestDistanceSq = distSq;
13844
- if (target1)
13845
- target1.copy(point1);
13846
- if (target2)
13847
- target2.copy(point2);
13592
+ if (target1) target1.copy(point1);
13593
+ if (target2) target2.copy(point2);
13848
13594
  }
13849
13595
  }
13850
13596
  this.closestPointToPoint(start, point1);
13851
13597
  distSq = start.distanceToSquared(point1);
13852
13598
  if (distSq < closestDistanceSq) {
13853
13599
  closestDistanceSq = distSq;
13854
- if (target1)
13855
- target1.copy(point1);
13856
- if (target2)
13857
- target2.copy(start);
13600
+ if (target1) target1.copy(point1);
13601
+ if (target2) target2.copy(start);
13858
13602
  }
13859
13603
  this.closestPointToPoint(end, point1);
13860
13604
  distSq = end.distanceToSquared(point1);
13861
13605
  if (distSq < closestDistanceSq) {
13862
13606
  closestDistanceSq = distSq;
13863
- if (target1)
13864
- target1.copy(point1);
13865
- if (target2)
13866
- target2.copy(end);
13607
+ if (target1) target1.copy(point1);
13608
+ if (target2) target2.copy(end);
13867
13609
  }
13868
13610
  return Math.sqrt(closestDistanceSq);
13869
13611
  };
@@ -13946,8 +13688,7 @@
13946
13688
  const sb = satBounds1[i];
13947
13689
  const sa = satAxes1[i];
13948
13690
  cachedSatBounds.setFromPoints(sa, arr2);
13949
- if (sb.isSeparated(cachedSatBounds))
13950
- return false;
13691
+ if (sb.isSeparated(cachedSatBounds)) return false;
13951
13692
  }
13952
13693
  const satBounds2 = other.satBounds;
13953
13694
  const satAxes2 = other.satAxes;
@@ -13958,8 +13699,7 @@
13958
13699
  const sb = satBounds2[i];
13959
13700
  const sa = satAxes2[i];
13960
13701
  cachedSatBounds.setFromPoints(sa, arr1);
13961
- if (sb.isSeparated(cachedSatBounds))
13962
- return false;
13702
+ if (sb.isSeparated(cachedSatBounds)) return false;
13963
13703
  }
13964
13704
  for (let i = 0; i < 4; i++) {
13965
13705
  const sa1 = satAxes1[i];
@@ -13968,8 +13708,7 @@
13968
13708
  cachedAxis.crossVectors(sa1, sa2);
13969
13709
  cachedSatBounds.setFromPoints(cachedAxis, arr1);
13970
13710
  cachedSatBounds2.setFromPoints(cachedAxis, arr2);
13971
- if (cachedSatBounds.isSeparated(cachedSatBounds2))
13972
- return false;
13711
+ if (cachedSatBounds.isSeparated(cachedSatBounds2)) return false;
13973
13712
  }
13974
13713
  }
13975
13714
  if (target) {
@@ -14052,10 +13791,8 @@
14052
13791
  const lineTarget = target1 || target2 ? line1 : null;
14053
13792
  if (this.intersectsTriangle(other, lineTarget)) {
14054
13793
  if (target1 || target2) {
14055
- if (target1)
14056
- lineTarget.getCenter(target1);
14057
- if (target2)
14058
- lineTarget.getCenter(target2);
13794
+ if (target1) lineTarget.getCenter(target1);
13795
+ if (target2) lineTarget.getCenter(target2);
14059
13796
  }
14060
13797
  return 0;
14061
13798
  }
@@ -14068,20 +13805,16 @@
14068
13805
  dist = otherVec.distanceToSquared(point2);
14069
13806
  if (dist < closestDistanceSq) {
14070
13807
  closestDistanceSq = dist;
14071
- if (target1)
14072
- target1.copy(point2);
14073
- if (target2)
14074
- target2.copy(otherVec);
13808
+ if (target1) target1.copy(point2);
13809
+ if (target2) target2.copy(otherVec);
14075
13810
  }
14076
13811
  const thisVec = this[field];
14077
13812
  other.closestPointToPoint(thisVec, point2);
14078
13813
  dist = thisVec.distanceToSquared(point2);
14079
13814
  if (dist < closestDistanceSq) {
14080
13815
  closestDistanceSq = dist;
14081
- if (target1)
14082
- target1.copy(thisVec);
14083
- if (target2)
14084
- target2.copy(point2);
13816
+ if (target1) target1.copy(thisVec);
13817
+ if (target2) target2.copy(point2);
14085
13818
  }
14086
13819
  }
14087
13820
  for (let i = 0; i < 3; i++) {
@@ -14096,10 +13829,8 @@
14096
13829
  const dist = point2.distanceToSquared(point22);
14097
13830
  if (dist < closestDistanceSq) {
14098
13831
  closestDistanceSq = dist;
14099
- if (target1)
14100
- target1.copy(point2);
14101
- if (target2)
14102
- target2.copy(point22);
13832
+ if (target1) target1.copy(point2);
13833
+ if (target2) target2.copy(point22);
14103
13834
  }
14104
13835
  }
14105
13836
  }
@@ -14118,12 +13849,9 @@
14118
13849
  this.satBounds = new Array(3).fill().map(() => new SeparatingAxisBounds());
14119
13850
  this.alignedSatBounds = new Array(3).fill().map(() => new SeparatingAxisBounds());
14120
13851
  this.needsUpdate = false;
14121
- if (min)
14122
- this.min.copy(min);
14123
- if (max)
14124
- this.max.copy(max);
14125
- if (matrix)
14126
- this.matrix.copy(matrix);
13852
+ if (min) this.min.copy(min);
13853
+ if (max) this.max.copy(max);
13854
+ if (matrix) this.matrix.copy(matrix);
14127
13855
  }
14128
13856
  set(min, max, matrix) {
14129
13857
  this.min.copy(min);
@@ -14148,11 +13876,11 @@
14148
13876
  for (let y2 = 0; y2 <= 1; y2++) {
14149
13877
  for (let z = 0; z <= 1; z++) {
14150
13878
  const i = (1 << 0) * x2 | (1 << 1) * y2 | (1 << 2) * z;
14151
- const v = points[i];
14152
- v.x = x2 ? max.x : min.x;
14153
- v.y = y2 ? max.y : min.y;
14154
- v.z = z ? max.z : min.z;
14155
- v.applyMatrix4(matrix);
13879
+ const v2 = points[i];
13880
+ v2.x = x2 ? max.x : min.x;
13881
+ v2.y = y2 ? max.y : min.y;
13882
+ v2.z = z ? max.z : min.z;
13883
+ v2.applyMatrix4(matrix);
14156
13884
  }
14157
13885
  }
14158
13886
  }
@@ -14188,22 +13916,18 @@
14188
13916
  const alignedSatBounds = this.alignedSatBounds;
14189
13917
  aabbBounds.min = min.x;
14190
13918
  aabbBounds.max = max.x;
14191
- if (alignedSatBounds[0].isSeparated(aabbBounds))
14192
- return false;
13919
+ if (alignedSatBounds[0].isSeparated(aabbBounds)) return false;
14193
13920
  aabbBounds.min = min.y;
14194
13921
  aabbBounds.max = max.y;
14195
- if (alignedSatBounds[1].isSeparated(aabbBounds))
14196
- return false;
13922
+ if (alignedSatBounds[1].isSeparated(aabbBounds)) return false;
14197
13923
  aabbBounds.min = min.z;
14198
13924
  aabbBounds.max = max.z;
14199
- if (alignedSatBounds[2].isSeparated(aabbBounds))
14200
- return false;
13925
+ if (alignedSatBounds[2].isSeparated(aabbBounds)) return false;
14201
13926
  for (let i = 0; i < 3; i++) {
14202
13927
  const axis = satAxes[i];
14203
13928
  const sb = satBounds[i];
14204
13929
  aabbBounds.setFromBox(axis, box);
14205
- if (sb.isSeparated(aabbBounds))
14206
- return false;
13930
+ if (sb.isSeparated(aabbBounds)) return false;
14207
13931
  }
14208
13932
  return true;
14209
13933
  };
@@ -14234,8 +13958,7 @@
14234
13958
  const sb = satBounds[i];
14235
13959
  const sa = satAxes[i];
14236
13960
  cachedSatBounds.setFromPoints(sa, pointsArr);
14237
- if (sb.isSeparated(cachedSatBounds))
14238
- return false;
13961
+ if (sb.isSeparated(cachedSatBounds)) return false;
14239
13962
  }
14240
13963
  const triSatBounds = triangle3.satBounds;
14241
13964
  const triSatAxes = triangle3.satAxes;
@@ -14244,8 +13967,7 @@
14244
13967
  const sb = triSatBounds[i];
14245
13968
  const sa = triSatAxes[i];
14246
13969
  cachedSatBounds.setFromPoints(sa, points);
14247
- if (sb.isSeparated(cachedSatBounds))
14248
- return false;
13970
+ if (sb.isSeparated(cachedSatBounds)) return false;
14249
13971
  }
14250
13972
  for (let i = 0; i < 3; i++) {
14251
13973
  const sa1 = satAxes[i];
@@ -14254,8 +13976,7 @@
14254
13976
  cachedAxis.crossVectors(sa1, sa2);
14255
13977
  cachedSatBounds.setFromPoints(cachedAxis, pointsArr);
14256
13978
  cachedSatBounds2.setFromPoints(cachedAxis, points);
14257
- if (cachedSatBounds.isSeparated(cachedSatBounds2))
14258
- return false;
13979
+ if (cachedSatBounds.isSeparated(cachedSatBounds2)) return false;
14259
13980
  }
14260
13981
  }
14261
13982
  return true;
@@ -14292,10 +14013,8 @@
14292
14013
  box.getCenter(point2);
14293
14014
  this.closestPointToPoint(point2, point1);
14294
14015
  box.closestPointToPoint(point1, point2);
14295
- if (target1)
14296
- target1.copy(point1);
14297
- if (target2)
14298
- target2.copy(point2);
14016
+ if (target1) target1.copy(point1);
14017
+ if (target2) target2.copy(point2);
14299
14018
  }
14300
14019
  return 0;
14301
14020
  }
@@ -14310,12 +14029,9 @@
14310
14029
  const dist = p.distanceToSquared(point2);
14311
14030
  if (dist < closestDistanceSq) {
14312
14031
  closestDistanceSq = dist;
14313
- if (target1)
14314
- target1.copy(p);
14315
- if (target2)
14316
- target2.copy(point2);
14317
- if (dist < threshold2)
14318
- return Math.sqrt(dist);
14032
+ if (target1) target1.copy(p);
14033
+ if (target2) target2.copy(point2);
14034
+ if (dist < threshold2) return Math.sqrt(dist);
14319
14035
  }
14320
14036
  }
14321
14037
  let count = 0;
@@ -14356,12 +14072,9 @@
14356
14072
  const dist = point2.distanceToSquared(point1);
14357
14073
  if (dist < closestDistanceSq) {
14358
14074
  closestDistanceSq = dist;
14359
- if (target1)
14360
- target1.copy(point1);
14361
- if (target2)
14362
- target2.copy(point2);
14363
- if (dist < threshold2)
14364
- return Math.sqrt(dist);
14075
+ if (target1) target1.copy(point1);
14076
+ if (target2) target2.copy(point2);
14077
+ if (dist < threshold2) return Math.sqrt(dist);
14365
14078
  }
14366
14079
  }
14367
14080
  }
@@ -14374,12 +14087,9 @@
14374
14087
  const dist = point1.distanceToSquared(point2);
14375
14088
  if (dist < closestDistanceSq) {
14376
14089
  closestDistanceSq = dist;
14377
- if (target1)
14378
- target1.copy(point1);
14379
- if (target2)
14380
- target2.copy(point2);
14381
- if (dist < threshold2)
14382
- return Math.sqrt(dist);
14090
+ if (target1) target1.copy(point1);
14091
+ if (target2) target2.copy(point2);
14092
+ if (dist < threshold2) return Math.sqrt(dist);
14383
14093
  }
14384
14094
  }
14385
14095
  }
@@ -14530,8 +14240,7 @@
14530
14240
  depth + 1
14531
14241
  );
14532
14242
  }
14533
- if (c1StopTraversal)
14534
- return true;
14243
+ if (c1StopTraversal) return true;
14535
14244
  box2 = _box2;
14536
14245
  arrayToBox(BOUNDING_DATA_INDEX(c2), float32Array2, box2);
14537
14246
  const isC2Leaf = IS_LEAF(c2 * 2, uint16Array2);
@@ -14553,8 +14262,7 @@
14553
14262
  depth + 1
14554
14263
  );
14555
14264
  }
14556
- if (c2StopTraversal)
14557
- return true;
14265
+ if (c2StopTraversal) return true;
14558
14266
  return false;
14559
14267
  }
14560
14268
  }
@@ -14590,13 +14298,10 @@
14590
14298
  }
14591
14299
  }
14592
14300
  );
14593
- if (closestDistanceSq === Infinity)
14594
- return null;
14301
+ if (closestDistanceSq === Infinity) return null;
14595
14302
  const closestDistance = Math.sqrt(closestDistanceSq);
14596
- if (!target.point)
14597
- target.point = temp1$2.clone();
14598
- else
14599
- target.point.copy(temp1$2);
14303
+ if (!target.point) target.point = temp1$2.clone();
14304
+ else target.point.copy(temp1$2);
14600
14305
  target.distance = closestDistance, target.faceIndex = closestDistanceTriIndex;
14601
14306
  return target;
14602
14307
  }
@@ -14617,8 +14322,7 @@
14617
14322
  } else {
14618
14323
  intersect = ray2.intersectTriangle(pA, pB, pC, side !== threepipe.DoubleSide, point2);
14619
14324
  }
14620
- if (intersect === null)
14621
- return null;
14325
+ if (intersect === null) return null;
14622
14326
  const distance = ray2.origin.distanceTo(point2);
14623
14327
  return {
14624
14328
  distance,
@@ -14680,8 +14384,7 @@
14680
14384
  const intersection = checkBufferGeometryIntersection(ray2, position2, normal, uv, uv1, a, b, c, side);
14681
14385
  if (intersection) {
14682
14386
  intersection.faceIndex = tri;
14683
- if (intersections)
14684
- intersections.push(intersection);
14387
+ if (intersections) intersections.push(intersection);
14685
14388
  return intersection;
14686
14389
  }
14687
14390
  return null;
@@ -14778,18 +14481,12 @@
14778
14481
  const x2 = posAttr.getX(index);
14779
14482
  const y2 = posAttr.getY(index);
14780
14483
  const z = posAttr.getZ(index);
14781
- if (x2 < minx)
14782
- minx = x2;
14783
- if (x2 > maxx)
14784
- maxx = x2;
14785
- if (y2 < miny)
14786
- miny = y2;
14787
- if (y2 > maxy)
14788
- maxy = y2;
14789
- if (z < minz)
14790
- minz = z;
14791
- if (z > maxz)
14792
- maxz = z;
14484
+ if (x2 < minx) minx = x2;
14485
+ if (x2 > maxx) maxx = x2;
14486
+ if (y2 < miny) miny = y2;
14487
+ if (y2 > maxy) maxy = y2;
14488
+ if (z < minz) minz = z;
14489
+ if (z > maxz) maxz = z;
14793
14490
  }
14794
14491
  if (float32Array2[node32Index + 0] !== minx || float32Array2[node32Index + 1] !== miny || float32Array2[node32Index + 2] !== minz || float32Array2[node32Index + 3] !== maxx || float32Array2[node32Index + 4] !== maxy || float32Array2[node32Index + 5] !== maxz) {
14795
14492
  float32Array2[node32Index + 0] = minx;
@@ -14873,12 +14570,9 @@
14873
14570
  tymin = (maxy - oy) * invdiry;
14874
14571
  tymax = (miny - oy) * invdiry;
14875
14572
  }
14876
- if (tmin > tymax || tymin > tmax)
14877
- return false;
14878
- if (tymin > tmin || isNaN(tmin))
14879
- tmin = tymin;
14880
- if (tymax < tmax || isNaN(tmax))
14881
- tmax = tymax;
14573
+ if (tmin > tymax || tymin > tmax) return false;
14574
+ if (tymin > tmin || isNaN(tmin)) tmin = tymin;
14575
+ if (tymax < tmax || isNaN(tmax)) tmax = tymax;
14882
14576
  if (invdirz >= 0) {
14883
14577
  tzmin = (minz - oz) * invdirz;
14884
14578
  tzmax = (maxz - oz) * invdirz;
@@ -14886,12 +14580,9 @@
14886
14580
  tzmin = (maxz - oz) * invdirz;
14887
14581
  tzmax = (minz - oz) * invdirz;
14888
14582
  }
14889
- if (tmin > tzmax || tzmin > tmax)
14890
- return false;
14891
- if (tzmax < tmax || tmax !== tmax)
14892
- tmax = tzmax;
14893
- if (tmax < 0)
14894
- return false;
14583
+ if (tmin > tzmax || tzmin > tmax) return false;
14584
+ if (tzmax < tmax || tmax !== tmax) tmax = tzmax;
14585
+ if (tmax < 0) return false;
14895
14586
  return true;
14896
14587
  }
14897
14588
  function intersectTris_indirect(bvh, side, ray2, offset, count, intersections) {
@@ -15078,12 +14769,10 @@
15078
14769
  const right = uint32Array2[nodeIndex32 + 6];
15079
14770
  arrayToBox(BOUNDING_DATA_INDEX(left), float32Array2, boundingBox$1);
15080
14771
  const leftIntersection = cachedObb.intersectsBox(boundingBox$1) && _intersectsGeometry$1(left, bvh, otherGeometry, geometryToBvh, cachedObb);
15081
- if (leftIntersection)
15082
- return true;
14772
+ if (leftIntersection) return true;
15083
14773
  arrayToBox(BOUNDING_DATA_INDEX(right), float32Array2, boundingBox$1);
15084
14774
  const rightIntersection = cachedObb.intersectsBox(boundingBox$1) && _intersectsGeometry$1(right, bvh, otherGeometry, geometryToBvh, cachedObb);
15085
- if (rightIntersection)
15086
- return true;
14775
+ if (rightIntersection) return true;
15087
14776
  return false;
15088
14777
  }
15089
14778
  }
@@ -15215,10 +14904,8 @@
15215
14904
  }
15216
14905
  target1.distance = closestDistance, target1.faceIndex = closestDistanceTriIndex;
15217
14906
  if (target2) {
15218
- if (!target2.point)
15219
- target2.point = tempTargetDest2.clone();
15220
- else
15221
- target2.point.copy(tempTargetDest2);
14907
+ if (!target2.point) target2.point = tempTargetDest2.clone();
14908
+ else target2.point.copy(tempTargetDest2);
15222
14909
  target2.point.applyMatrix4(tempMatrix$1);
15223
14910
  tempTargetDest1.applyMatrix4(tempMatrix$1);
15224
14911
  target2.distance = tempTargetDest1.sub(target2.point).length();
@@ -15264,18 +14951,12 @@
15264
14951
  const x2 = posAttr.getX(index);
15265
14952
  const y2 = posAttr.getY(index);
15266
14953
  const z = posAttr.getZ(index);
15267
- if (x2 < minx)
15268
- minx = x2;
15269
- if (x2 > maxx)
15270
- maxx = x2;
15271
- if (y2 < miny)
15272
- miny = y2;
15273
- if (y2 > maxy)
15274
- maxy = y2;
15275
- if (z < minz)
15276
- minz = z;
15277
- if (z > maxz)
15278
- maxz = z;
14954
+ if (x2 < minx) minx = x2;
14955
+ if (x2 > maxx) maxx = x2;
14956
+ if (y2 < miny) miny = y2;
14957
+ if (y2 > maxy) maxy = y2;
14958
+ if (z < minz) minz = z;
14959
+ if (z > maxz) maxz = z;
15279
14960
  }
15280
14961
  }
15281
14962
  if (float32Array2[node32Index + 0] !== minx || float32Array2[node32Index + 1] !== miny || float32Array2[node32Index + 2] !== minz || float32Array2[node32Index + 3] !== maxx || float32Array2[node32Index + 4] !== maxy || float32Array2[node32Index + 5] !== maxz) {
@@ -15483,12 +15164,10 @@
15483
15164
  const right = uint32Array2[nodeIndex32 + 6];
15484
15165
  arrayToBox(BOUNDING_DATA_INDEX(left), float32Array2, boundingBox);
15485
15166
  const leftIntersection = cachedObb.intersectsBox(boundingBox) && _intersectsGeometry(left, bvh, otherGeometry, geometryToBvh, cachedObb);
15486
- if (leftIntersection)
15487
- return true;
15167
+ if (leftIntersection) return true;
15488
15168
  arrayToBox(BOUNDING_DATA_INDEX(right), float32Array2, boundingBox);
15489
15169
  const rightIntersection = cachedObb.intersectsBox(boundingBox) && _intersectsGeometry(right, bvh, otherGeometry, geometryToBvh, cachedObb);
15490
- if (rightIntersection)
15491
- return true;
15170
+ if (rightIntersection) return true;
15492
15171
  return false;
15493
15172
  }
15494
15173
  }
@@ -15623,10 +15302,8 @@
15623
15302
  }
15624
15303
  target1.distance = closestDistance, target1.faceIndex = closestDistanceTriIndex;
15625
15304
  if (target2) {
15626
- if (!target2.point)
15627
- target2.point = tempTargetDest2.clone();
15628
- else
15629
- target2.point.copy(tempTargetDest2);
15305
+ if (!target2.point) target2.point = tempTargetDest2.clone();
15306
+ else target2.point.copy(tempTargetDest2);
15630
15307
  target2.point.applyMatrix4(tempMatrix);
15631
15308
  tempTargetDest1.applyMatrix4(tempMatrix);
15632
15309
  target2.distance = tempTargetDest1.sub(target2.point).length();
@@ -15644,7 +15321,12 @@
15644
15321
  const _rightBox1 = new threepipe.Box3();
15645
15322
  const _leftBox2 = new threepipe.Box3();
15646
15323
  const _rightBox2 = new threepipe.Box3();
15324
+ let _active = false;
15647
15325
  function bvhcast(bvh, otherBvh, matrixToLocal, intersectsRanges) {
15326
+ if (_active) {
15327
+ throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");
15328
+ }
15329
+ _active = true;
15648
15330
  const roots = bvh._roots;
15649
15331
  const otherRoots = otherBvh._roots;
15650
15332
  let result;
@@ -15684,6 +15366,7 @@
15684
15366
  break;
15685
15367
  }
15686
15368
  }
15369
+ _active = false;
15687
15370
  return result;
15688
15371
  }
15689
15372
  function _traverse(node1Index32, node2Index32, matrix2to1, matrix1to2, intersectsRangesFunc, node1IndexByteOffset = 0, node2IndexByteOffset = 0, depth1 = 0, depth2 = 0, currBox = null, reversed = false) {
@@ -16239,8 +15922,7 @@
16239
15922
  const origMeshRaycastFunc = threepipe.Mesh.prototype.raycast;
16240
15923
  function acceleratedRaycast(raycaster, intersects) {
16241
15924
  if (this.geometry.boundsTree) {
16242
- if (this.material === void 0)
16243
- return;
15925
+ if (this.material === void 0) return;
16244
15926
  tmpInverseMatrix.copy(this.matrixWorld).invert();
16245
15927
  ray.copy(raycaster.ray).applyMatrix4(tmpInverseMatrix);
16246
15928
  const bvh = this.geometry.boundsTree;
@@ -16438,8 +16120,7 @@
16438
16120
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
16439
16121
  if (decorator = decorators[i])
16440
16122
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
16441
- if (kind && result)
16442
- __defProp(target, key, result);
16123
+ if (kind && result) __defProp(target, key, result);
16443
16124
  return result;
16444
16125
  };
16445
16126
  exports2.ThreeSVGRendererPlugin = class ThreeSVGRendererPlugin extends threepipe.AViewerPluginSync {
@@ -16469,8 +16150,7 @@
16469
16150
  this._rendering = false;
16470
16151
  this._viewerListeners = {
16471
16152
  postRender: (_) => {
16472
- if (this.autoRender)
16473
- this.render();
16153
+ if (this.autoRender) this.render();
16474
16154
  }
16475
16155
  };
16476
16156
  this._onResize = this._onResize.bind(this);
@@ -16549,40 +16229,32 @@
16549
16229
  viewer.scene.modelRoot.removeEventListener("objectUpdate", this.updateMeshes);
16550
16230
  }
16551
16231
  _onMeshDispose(ev) {
16552
- if (!ev.target)
16553
- return;
16232
+ if (!ev.target) return;
16554
16233
  const mesh = ev.target;
16555
16234
  const svgMesh = this._meshes.get(mesh.uuid);
16556
- if (!svgMesh)
16557
- return;
16235
+ if (!svgMesh) return;
16558
16236
  svgMesh.dispose();
16559
16237
  this._meshes.delete(mesh.uuid);
16560
16238
  mesh.removeEventListener("dispose", this._onMeshDispose);
16561
16239
  mesh.removeEventListener("objectUpdate", this._onMeshUpdate);
16562
16240
  }
16563
16241
  _onMeshUpdate(ev) {
16564
- if (!ev.target)
16565
- return;
16242
+ if (!ev.target) return;
16566
16243
  const mesh = ev.target;
16567
16244
  const svgMesh = this._meshes.get(mesh.uuid);
16568
- if (!svgMesh)
16569
- return;
16245
+ if (!svgMesh) return;
16570
16246
  svgMesh.updateObject();
16571
16247
  }
16572
16248
  _refreshMeshes(root2) {
16573
- if (!this.autoMakeSvgObjects)
16574
- return [];
16575
- if (!root2 && this._viewer)
16576
- root2 = this._viewer.scene.modelRoot;
16577
- if (!root2)
16578
- return [];
16249
+ if (!this.autoMakeSvgObjects) return [];
16250
+ if (!root2 && this._viewer) root2 = this._viewer.scene.modelRoot;
16251
+ if (!root2) return [];
16579
16252
  root2.traverse((o) => {
16580
16253
  this.makeSVGObject(o);
16581
16254
  });
16582
16255
  }
16583
16256
  makeSVGObject(o) {
16584
- if (!(o.isMesh && !this._meshes.has(o.uuid)))
16585
- return;
16257
+ if (!(o.isMesh && !this._meshes.has(o.uuid))) return;
16586
16258
  const ud = o.userData;
16587
16259
  o.userData = {};
16588
16260
  const svgMesh = new SVGMesh(o);
@@ -16611,12 +16283,9 @@
16611
16283
  }
16612
16284
  }
16613
16285
  async render() {
16614
- if (!this._viewer || !this._viewer.renderEnabled)
16615
- return;
16616
- if (this.isDisabled())
16617
- return;
16618
- if (this._rendering)
16619
- return;
16286
+ if (!this._viewer || !this._viewer.renderEnabled) return;
16287
+ if (this.isDisabled()) return;
16288
+ if (this._rendering) return;
16620
16289
  this._rendering = true;
16621
16290
  this._refreshParams();
16622
16291
  this._refreshMeshes();
@@ -16673,21 +16342,18 @@
16673
16342
  }
16674
16343
  get svgNode() {
16675
16344
  var _a;
16676
- if (!this.svgNodeContainer.children.length)
16677
- return void 0;
16345
+ if (!this.svgNodeContainer.children.length) return void 0;
16678
16346
  if (this.svgNodeContainer.children.length > 1) {
16679
16347
  (_a = this._viewer) == null ? void 0 : _a.console.warn("ThreeSVGRenderer: Multiple svg nodes in container, should not be possible");
16680
16348
  }
16681
16349
  return this.svgNodeContainer.children[0];
16682
16350
  }
16683
16351
  _refreshParams() {
16684
- if (this.isDisabled())
16685
- return;
16352
+ if (this.isDisabled()) return;
16686
16353
  if (this._meshesNeedsUpdate) {
16687
16354
  this.renderer.viewmap.options.updateMeshes = true;
16688
16355
  this._meshesNeedsUpdate = false;
16689
- } else
16690
- this.renderer.viewmap.options.updateMeshes = this.alwaysUpdateMeshes;
16356
+ } else this.renderer.viewmap.options.updateMeshes = this.alwaysUpdateMeshes;
16691
16357
  this.renderer.viewmap.options.creaseAngle.min = this.creaseAngle.x;
16692
16358
  this.renderer.viewmap.options.creaseAngle.max = this.creaseAngle.y;
16693
16359
  const passes = this.renderer.drawHandler.passes;
@@ -16708,8 +16374,7 @@
16708
16374
  }
16709
16375
  }
16710
16376
  _onResize() {
16711
- if (!this._viewer)
16712
- return;
16377
+ if (!this._viewer) return;
16713
16378
  }
16714
16379
  };
16715
16380
  exports2.ThreeSVGRendererPlugin.PluginType = "ThreeSVGRendererPlugin";