manim-web 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +35 -19
  2. package/dist/animation/transform/MovementTransforms.d.ts.map +1 -1
  3. package/dist/export/chooseExporter.d.ts +19 -0
  4. package/dist/export/chooseExporter.d.ts.map +1 -0
  5. package/dist/export/index.d.ts +1 -0
  6. package/dist/export/index.d.ts.map +1 -1
  7. package/dist/index.d.ts +5 -1
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +3 -3
  10. package/dist/integrations/react.js +16 -16
  11. package/dist/integrations/vue.js +13 -13
  12. package/dist/interaction/DynamicMatrix.d.ts +164 -0
  13. package/dist/interaction/DynamicMatrix.d.ts.map +1 -0
  14. package/dist/interaction/index.d.ts +1 -0
  15. package/dist/interaction/index.d.ts.map +1 -1
  16. package/dist/manim-web.browser.js +1499 -624
  17. package/dist/mobjects/geo/ChoroplethMap.d.ts +72 -0
  18. package/dist/mobjects/geo/ChoroplethMap.d.ts.map +1 -0
  19. package/dist/mobjects/geo/Globe.d.ts +122 -0
  20. package/dist/mobjects/geo/Globe.d.ts.map +1 -0
  21. package/dist/mobjects/geo/colorScale.d.ts +45 -0
  22. package/dist/mobjects/geo/colorScale.d.ts.map +1 -0
  23. package/dist/mobjects/geo/geojson.d.ts +54 -0
  24. package/dist/mobjects/geo/geojson.d.ts.map +1 -0
  25. package/dist/mobjects/geo/index.d.ts +13 -0
  26. package/dist/mobjects/geo/index.d.ts.map +1 -0
  27. package/dist/mobjects/geo/projections.d.ts +53 -0
  28. package/dist/mobjects/geo/projections.d.ts.map +1 -0
  29. package/dist/mobjects/three-d/Line3D.d.ts.map +1 -1
  30. package/dist/player/ExportSettingsUI.d.ts +82 -0
  31. package/dist/player/ExportSettingsUI.d.ts.map +1 -0
  32. package/dist/player/Player.d.ts +50 -2
  33. package/dist/player/Player.d.ts.map +1 -1
  34. package/dist/player/PlayerUI.d.ts +15 -1
  35. package/dist/player/PlayerUI.d.ts.map +1 -1
  36. package/dist/player/SlideInteractionRenderer.d.ts +32 -0
  37. package/dist/player/SlideInteractionRenderer.d.ts.map +1 -0
  38. package/dist/player/index.d.ts +1 -0
  39. package/dist/player/index.d.ts.map +1 -1
  40. package/dist/rate-functions/spring.d.ts.map +1 -1
  41. package/dist/serialization/defaults.d.ts +13 -0
  42. package/dist/serialization/defaults.d.ts.map +1 -0
  43. package/dist/serialization/index.d.ts +15 -0
  44. package/dist/serialization/index.d.ts.map +1 -0
  45. package/dist/serialization/props.d.ts +16 -0
  46. package/dist/serialization/props.d.ts.map +1 -0
  47. package/dist/serialization/registry.d.ts +17 -0
  48. package/dist/serialization/registry.d.ts.map +1 -0
  49. package/dist/serialization/serialize.d.ts +24 -0
  50. package/dist/serialization/serialize.d.ts.map +1 -0
  51. package/dist/serialization/types.d.ts +70 -0
  52. package/dist/serialization/types.d.ts.map +1 -0
  53. package/dist/{src-BcBBUMTP.js → src-Da4luuzD.js} +1481 -606
  54. package/dist/test-setup/TestMobject.d.ts +23 -0
  55. package/dist/test-setup/TestMobject.d.ts.map +1 -0
  56. package/dist/utils/axis.d.ts +0 -1
  57. package/dist/utils/axis.d.ts.map +1 -1
  58. package/package.json +3 -1
@@ -3819,7 +3819,7 @@ var I = class e extends Qi {
3819
3819
  let t = e.stiffness ?? eo, n = e.damping ?? to, r = e.mass ?? no;
3820
3820
  return {
3821
3821
  omega0: Math.sqrt(t / r),
3822
- zeta: n / (2 * Math.sqrt(t * r))
3822
+ zeta: Math.max(n / (2 * Math.sqrt(t * r)), .001)
3823
3823
  };
3824
3824
  }, oo = (e, t) => {
3825
3825
  if (t < .999999) {
@@ -40526,7 +40526,7 @@ var _g = class e {
40526
40526
  if (this.isHeadless) throw Error("export() is not available in headless mode. Create a Scene with a container for rendering and exporting.");
40527
40527
  let n = e.slice(e.lastIndexOf(".")).toLowerCase(), r;
40528
40528
  if (n === ".gif") {
40529
- let { GifExporter: n } = await Promise.resolve().then(() => GD);
40529
+ let { GifExporter: n } = await Promise.resolve().then(() => $D);
40530
40530
  r = await new n(this, {
40531
40531
  fps: t?.fps,
40532
40532
  quality: t?.quality,
@@ -40538,7 +40538,7 @@ var _g = class e {
40538
40538
  workers: t?.workers
40539
40539
  }).exportTimeline(t?.duration), n.download(r, e);
40540
40540
  } else if (n === ".webm" || n === ".mp4" || n === ".mov") {
40541
- let { VideoExporter: i } = await Promise.resolve().then(() => YD), a = n === ".mp4" ? "mp4" : n === ".mov" ? "mov" : "webm";
40541
+ let { VideoExporter: i } = await Promise.resolve().then(() => rO), a = n === ".mp4" ? "mp4" : n === ".mov" ? "mov" : "webm";
40542
40542
  r = await new i(this, {
40543
40543
  fps: t?.fps,
40544
40544
  quality: t?.quality,
@@ -55743,7 +55743,10 @@ var $b = class e extends qb {
55743
55743
  transparent: this._opacity < 1,
55744
55744
  linewidth: this.strokeWidth,
55745
55745
  worldUnits: !1,
55746
- resolution: new a.Vector2(this._resolutionWidth, this._resolutionHeight)
55746
+ resolution: new a.Vector2(this._resolutionWidth, this._resolutionHeight),
55747
+ polygonOffset: !0,
55748
+ polygonOffsetFactor: -1,
55749
+ polygonOffsetUnits: -1
55747
55750
  }));
55748
55751
  return t.frustumCulled = !1, t.computeLineDistances(), t;
55749
55752
  }
@@ -63269,7 +63272,18 @@ var Gw = class extends z {
63269
63272
  function Kw(e, t, n) {
63270
63273
  return new Gw(e, t, n);
63271
63274
  }
63272
- var qw = class extends z {
63275
+ function qw(e, t, n, r) {
63276
+ let i = 1e-6;
63277
+ if (Math.abs(r) < i) return new a.Vector3().lerpVectors(e, t, n);
63278
+ let o = new a.Vector3().subVectors(t, e), s = new a.Vector3().addVectors(e, o.clone().multiplyScalar(.5));
63279
+ if (Math.abs(r - Math.PI) > i) {
63280
+ let e = new a.Vector3(-o.y, o.x, 0);
63281
+ s.add(e.multiplyScalar(1 / (2 * Math.tan(r / 2))));
63282
+ }
63283
+ let c = new a.Vector3().subVectors(e, s), l = n * r, u = Math.cos(l), d = Math.sin(l);
63284
+ return new a.Vector3(s.x + c.x * u - c.y * d, s.y + c.x * d + c.y * u, s.z + c.z);
63285
+ }
63286
+ var Jw = class extends z {
63273
63287
  mobjects;
63274
63288
  pathArc;
63275
63289
  autoCenter;
@@ -63290,10 +63304,9 @@ var qw = class extends z {
63290
63304
  });
63291
63305
  }
63292
63306
  interpolate(e) {
63293
- let t = Math.sin(e * Math.PI) * this.pathArc;
63294
- for (let n = 0; n < this.mobjects.length; n++) {
63295
- let r = this.mobjects[n], i = new a.Vector3().lerpVectors(this._startPositions[n], this._targetPositions[n], e);
63296
- i.y += t * (n % 2 == 0 ? .5 : -.5), r.position.copy(i), r._markDirty();
63307
+ for (let t = 0; t < this.mobjects.length; t++) {
63308
+ let n = this.mobjects[t], r = qw(this._startPositions[t], this._targetPositions[t], e, this.pathArc);
63309
+ n.position.copy(r), n._markDirty();
63297
63310
  }
63298
63311
  }
63299
63312
  finish() {
@@ -63301,12 +63314,12 @@ var qw = class extends z {
63301
63314
  super.finish();
63302
63315
  }
63303
63316
  };
63304
- function Jw(e, t) {
63305
- return new qw(e, t);
63317
+ function Yw(e, t) {
63318
+ return new Jw(e, t);
63306
63319
  }
63307
63320
  //#endregion
63308
63321
  //#region src/animation/transform/SpecialTransforms.ts
63309
- var Yw = class extends z {
63322
+ var Xw = class extends z {
63310
63323
  scaleFactor;
63311
63324
  _initialScale = new a.Vector3();
63312
63325
  _targetScale = new a.Vector3();
@@ -63334,13 +63347,13 @@ var Yw = class extends z {
63334
63347
  this.interpolate(1), super.finish();
63335
63348
  }
63336
63349
  };
63337
- function Xw(e, t, n) {
63338
- return new Yw(e, {
63350
+ function Zw(e, t, n) {
63351
+ return new Xw(e, {
63339
63352
  ...n,
63340
63353
  scaleFactor: t
63341
63354
  });
63342
63355
  }
63343
- var Zw = class extends z {
63356
+ var Qw = class extends z {
63344
63357
  _initialScale = new a.Vector3();
63345
63358
  constructor(e, t = {}) {
63346
63359
  super(e, t);
@@ -63356,19 +63369,19 @@ var Zw = class extends z {
63356
63369
  this.mobject.scaleVector.set(0, 0, 0), this.mobject._markDirty(), super.finish();
63357
63370
  }
63358
63371
  };
63359
- function Qw(e, t) {
63360
- return new Zw(e, t);
63372
+ function $w(e, t) {
63373
+ return new Qw(e, t);
63361
63374
  }
63362
- var $w = class extends kh {
63375
+ var eT = class extends kh {
63363
63376
  constructor(e, t = {}) {
63364
63377
  if (!e.savedState) throw Error("Restore requires mobject.savedState to be set. Use mobject.saveState() first.");
63365
63378
  super(e, e.savedState, t);
63366
63379
  }
63367
63380
  };
63368
- function eT(e, t) {
63369
- return new $w(e, t);
63381
+ function tT(e, t) {
63382
+ return new eT(e, t);
63370
63383
  }
63371
- var tT = class extends z {
63384
+ var nT = class extends z {
63372
63385
  targetColor;
63373
63386
  _startColor = new a.Color();
63374
63387
  _targetColorObj = new a.Color();
@@ -63386,13 +63399,13 @@ var tT = class extends z {
63386
63399
  this.mobject.color = this.targetColor, this.mobject._markDirty(), super.finish();
63387
63400
  }
63388
63401
  };
63389
- function nT(e, t, n) {
63390
- return new tT(e, {
63402
+ function rT(e, t, n) {
63403
+ return new nT(e, {
63391
63404
  ...n,
63392
63405
  color: t
63393
63406
  });
63394
63407
  }
63395
- var rT = class extends z {
63408
+ var iT = class extends z {
63396
63409
  animation1;
63397
63410
  animation2;
63398
63411
  transformRateFunc;
@@ -63425,12 +63438,12 @@ var rT = class extends z {
63425
63438
  e.setPoints(this._anim2EndPoints), e.opacity = t.opacity, this.animation1.finish(), this.animation2.finish(), super.finish();
63426
63439
  }
63427
63440
  };
63428
- function iT(e, t, n) {
63429
- return new rT(e, t, n);
63441
+ function aT(e, t, n) {
63442
+ return new iT(e, t, n);
63430
63443
  }
63431
63444
  //#endregion
63432
63445
  //#region src/animation/transform/TransformMatchingBase.ts
63433
- var aT = class extends z {
63446
+ var oT = class extends z {
63434
63447
  target;
63435
63448
  keyFunc;
63436
63449
  fadeRatio;
@@ -63525,7 +63538,7 @@ var aT = class extends z {
63525
63538
  };
63526
63539
  //#endregion
63527
63540
  //#region src/utils/hungarian.ts
63528
- function oT(e) {
63541
+ function sT(e) {
63529
63542
  let t = e.length;
63530
63543
  if (t === 0) return {
63531
63544
  assignments: [],
@@ -63543,7 +63556,7 @@ function oT(e) {
63543
63556
  let r = 0;
63544
63557
  for (let i = 0; i < t; i++) for (let t = 0; t < n; t++) e[i][t] > r && (r = e[i][t]);
63545
63558
  let i = r * 10 + 1, a = Math.max(t, n), o = Array.from({ length: a }, (r, o) => Array.from({ length: a }, (r, a) => o < t && a < n ? e[o][a] : i)), s = new Float64Array(a + 1), c = new Float64Array(a + 1), l = new Int32Array(a + 1).fill(0), u = new Int32Array(a + 1).fill(0);
63546
- for (let e = 1; e <= a; e++) sT(e, a, o, s, c, l, u);
63559
+ for (let e = 1; e <= a; e++) cT(e, a, o, s, c, l, u);
63547
63560
  let d = Array(t).fill(-1), f = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Set(), m = 0;
63548
63561
  for (let r = 1; r <= a; r++) {
63549
63562
  let i = l[r] - 1, a = r - 1;
@@ -63556,7 +63569,7 @@ function oT(e) {
63556
63569
  assignedCols: p
63557
63570
  };
63558
63571
  }
63559
- function sT(e, t, n, r, i, a, o) {
63572
+ function cT(e, t, n, r, i, a, o) {
63560
63573
  a[0] = e;
63561
63574
  let s = 0, c = new Float64Array(t + 1).fill(Infinity), l = new Uint8Array(t + 1);
63562
63575
  do {
@@ -63575,7 +63588,7 @@ function sT(e, t, n, r, i, a, o) {
63575
63588
  a[s] = a[e], s = e;
63576
63589
  } while (s !== 0);
63577
63590
  }
63578
- function cT(e, t = 0) {
63591
+ function lT(e, t = 0) {
63579
63592
  let n = e.length;
63580
63593
  if (n === 0) return {
63581
63594
  assignments: [],
@@ -63592,7 +63605,7 @@ function cT(e, t = 0) {
63592
63605
  };
63593
63606
  let i = 0;
63594
63607
  for (let t = 0; t < n; t++) for (let n = 0; n < r; n++) e[t][n] > i && (i = e[t][n]);
63595
- let a = i * 10 + 1, o = oT(Array.from({ length: n }, (n, o) => Array.from({ length: r }, (n, r) => e[o][r] >= t ? i - e[o][r] : a)));
63608
+ let a = i * 10 + 1, o = sT(Array.from({ length: n }, (n, o) => Array.from({ length: r }, (n, r) => e[o][r] >= t ? i - e[o][r] : a)));
63596
63609
  for (let r = 0; r < n; r++) {
63597
63610
  let n = o.assignments[r];
63598
63611
  n >= 0 && e[r][n] < t && (o.assignments[r] = -1, o.assignedRows.delete(r), o.assignedCols.delete(n));
@@ -63601,7 +63614,7 @@ function cT(e, t = 0) {
63601
63614
  }
63602
63615
  //#endregion
63603
63616
  //#region src/animation/transform/TransformMatchingShared.ts
63604
- function lT(e) {
63617
+ function uT(e) {
63605
63618
  let t = e.getLocalPoints();
63606
63619
  if (t.length === 0) {
63607
63620
  let t = e.getCenter();
@@ -63641,17 +63654,17 @@ function lT(e) {
63641
63654
  ]
63642
63655
  };
63643
63656
  }
63644
- function uT(e, t) {
63645
- let n = lT(e), r = lT(t), i = Math.sqrt(n.size[0] ** 2 + n.size[1] ** 2), a = Math.sqrt(r.size[0] ** 2 + r.size[1] ** 2), o = Math.max(i, a, .001), s = 1 - Math.abs(i - a) / o, c = n.size[1] === 0 ? 1 : n.size[0] / n.size[1], l = r.size[1] === 0 ? 1 : r.size[0] / r.size[1], u = Math.max(c, l, .001), d = 1 - Math.abs(c - l) / u, f = e.getLocalPoints().length, p = t.getLocalPoints().length, m = Math.max(f, p, 1), h = 1 - Math.abs(f - p) / m;
63657
+ function dT(e, t) {
63658
+ let n = uT(e), r = uT(t), i = Math.sqrt(n.size[0] ** 2 + n.size[1] ** 2), a = Math.sqrt(r.size[0] ** 2 + r.size[1] ** 2), o = Math.max(i, a, .001), s = 1 - Math.abs(i - a) / o, c = n.size[1] === 0 ? 1 : n.size[0] / n.size[1], l = r.size[1] === 0 ? 1 : r.size[0] / r.size[1], u = Math.max(c, l, .001), d = 1 - Math.abs(c - l) / u, f = e.getLocalPoints().length, p = t.getLocalPoints().length, m = Math.max(f, p, 1), h = 1 - Math.abs(f - p) / m;
63646
63659
  return s * .4 + d * .3 + h * .3;
63647
63660
  }
63648
- function dT(e, t) {
63649
- let n = lT(e).center, r = lT(t).center;
63661
+ function fT(e, t) {
63662
+ let n = uT(e).center, r = uT(t).center;
63650
63663
  return Math.sqrt((n[0] - r[0]) ** 2 + (n[1] - r[1]) ** 2 + (n[2] - r[2]) ** 2);
63651
63664
  }
63652
63665
  //#endregion
63653
63666
  //#region src/animation/transform/TransformMatching.ts
63654
- var fT = class extends z {
63667
+ var pT = class extends z {
63655
63668
  target;
63656
63669
  matchThreshold;
63657
63670
  keyFunc;
@@ -63694,7 +63707,7 @@ var fT = class extends z {
63694
63707
  }
63695
63708
  }
63696
63709
  } else {
63697
- let i = cT(Array.from({ length: e.length }, (n, r) => Array.from({ length: t.length }, (n, i) => uT(e[r], t[i]))), this.matchThreshold);
63710
+ let i = lT(Array.from({ length: e.length }, (n, r) => Array.from({ length: t.length }, (n, i) => dT(e[r], t[i]))), this.matchThreshold);
63698
63711
  for (let a = 0; a < e.length; a++) {
63699
63712
  let o = i.assignments[a];
63700
63713
  o >= 0 && (this._addMatchedPart(e[a], t[o]), n.add(a), r.add(o));
@@ -63752,16 +63765,16 @@ var fT = class extends z {
63752
63765
  super.finish();
63753
63766
  }
63754
63767
  };
63755
- function pT(e, t, n) {
63756
- return new fT(e, t, n);
63768
+ function mT(e, t, n) {
63769
+ return new pT(e, t, n);
63757
63770
  }
63758
- function mT(e) {
63771
+ function hT(e) {
63759
63772
  let t = e;
63760
63773
  if (typeof t.getLatex == "function") return t.getLatex();
63761
- let n = lT(e);
63774
+ let n = uT(e);
63762
63775
  return `shape_${`${n.size[0].toFixed(2)}_${n.size[1].toFixed(2)}`}_${e.getLocalPoints().length}`;
63763
63776
  }
63764
- var hT = class extends z {
63777
+ var gT = class extends z {
63765
63778
  target;
63766
63779
  keyFunc;
63767
63780
  fadeRatio;
@@ -63771,7 +63784,7 @@ var hT = class extends z {
63771
63784
  _fadeInParts = [];
63772
63785
  _mismatchedPairs = [];
63773
63786
  constructor(e, t, n = {}) {
63774
- super(e, n), this.target = t, this.keyFunc = n.keyFunc ?? mT, this.fadeRatio = Math.min(.5, Math.max(0, n.fadeRatio ?? .25)), this.transformMismatches = n.transformMismatches ?? !1;
63787
+ super(e, n), this.target = t, this.keyFunc = n.keyFunc ?? hT, this.fadeRatio = Math.min(.5, Math.max(0, n.fadeRatio ?? .25)), this.transformMismatches = n.transformMismatches ?? !1;
63775
63788
  }
63776
63789
  _getTexParts(e) {
63777
63790
  let t = e.children.filter((e) => e instanceof I);
@@ -63814,7 +63827,7 @@ var hT = class extends z {
63814
63827
  for (let t = 0; t < e.length; t++) n.has(t) || o.push(t);
63815
63828
  for (let e = 0; e < t.length; e++) r.has(e) || s.push(e);
63816
63829
  if (this.transformMismatches && o.length > 0 && s.length > 0) {
63817
- let n = o.map((t) => e[t]), r = s.map((e) => t[e]), i = oT(Array.from({ length: n.length }, (e, t) => Array.from({ length: r.length }, (e, i) => dT(n[t], r[i])))), a = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set();
63830
+ let n = o.map((t) => e[t]), r = s.map((e) => t[e]), i = sT(Array.from({ length: n.length }, (e, t) => Array.from({ length: r.length }, (e, i) => fT(n[t], r[i])))), a = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set();
63818
63831
  for (let e = 0; e < n.length; e++) {
63819
63832
  let t = i.assignments[e];
63820
63833
  t >= 0 && t < r.length && (this._addMismatchedPair(n[e], r[t]), a.add(e), c.add(t));
@@ -63919,12 +63932,12 @@ var hT = class extends z {
63919
63932
  super.finish();
63920
63933
  }
63921
63934
  };
63922
- function gT(e, t, n) {
63923
- return new hT(e, t, n);
63935
+ function _T(e, t, n) {
63936
+ return new gT(e, t, n);
63924
63937
  }
63925
63938
  //#endregion
63926
63939
  //#region src/animation/transform/TransformMatchingCode.ts
63927
- var _T = .25, vT = 1, yT = class extends z {
63940
+ var vT = .25, yT = 1, bT = class extends z {
63928
63941
  target;
63929
63942
  keyFunc;
63930
63943
  fadeRatio;
@@ -63936,7 +63949,7 @@ var _T = .25, vT = 1, yT = class extends z {
63936
63949
  _fadeOutParts = [];
63937
63950
  _fadeInParts = [];
63938
63951
  constructor(e, t, n = {}) {
63939
- super(e, n), this.target = t, this.keyFunc = n.keyFunc, this.fadeRatio = Math.min(.5, Math.max(0, n.fadeRatio ?? _T)), this.matchBy = n.matchBy ?? "token", this.transformMismatches = n.transformMismatches ?? !1, this.fadeTransformMismatches = n.fadeTransformMismatches ?? !1;
63952
+ super(e, n), this.target = t, this.keyFunc = n.keyFunc, this.fadeRatio = Math.min(.5, Math.max(0, n.fadeRatio ?? vT)), this.matchBy = n.matchBy ?? "token", this.transformMismatches = n.transformMismatches ?? !1, this.fadeTransformMismatches = n.fadeTransformMismatches ?? !1;
63940
63953
  }
63941
63954
  get matchedParts() {
63942
63955
  return this._matchedParts;
@@ -64012,19 +64025,19 @@ var _T = .25, vT = 1, yT = class extends z {
64012
64025
  }
64013
64026
  _addMatchedPart(e, t, n) {
64014
64027
  let r = this.mobject.makeTokenMobject(e.text, e.type);
64015
- this._place(r, e.position), r.opacity = vT, this._parentAdd(r), n.push({
64028
+ this._place(r, e.position), r.opacity = yT, this._parentAdd(r), n.push({
64016
64029
  mobject: r,
64017
64030
  startPosition: e.position,
64018
64031
  targetPosition: t.position,
64019
- startOpacity: vT,
64020
- targetOpacity: vT
64032
+ startOpacity: yT,
64033
+ targetOpacity: yT
64021
64034
  });
64022
64035
  }
64023
64036
  _addFadeOutPart(e) {
64024
64037
  let t = this.mobject.makeTokenMobject(e.text, e.type);
64025
- this._place(t, e.position), t.opacity = vT, this._parentAdd(t), this._fadeOutParts.push({
64038
+ this._place(t, e.position), t.opacity = yT, this._parentAdd(t), this._fadeOutParts.push({
64026
64039
  mobject: t,
64027
- startOpacity: vT,
64040
+ startOpacity: yT,
64028
64041
  targetOpacity: 0,
64029
64042
  fadeIn: !1
64030
64043
  });
@@ -64034,7 +64047,7 @@ var _T = .25, vT = 1, yT = class extends z {
64034
64047
  this._place(t, e.position), t.opacity = 0, this._parentAdd(t), this._fadeInParts.push({
64035
64048
  mobject: t,
64036
64049
  startOpacity: 0,
64037
- targetOpacity: vT,
64050
+ targetOpacity: yT,
64038
64051
  fadeIn: !0
64039
64052
  });
64040
64053
  }
@@ -64059,16 +64072,16 @@ var _T = .25, vT = 1, yT = class extends z {
64059
64072
  super.finish();
64060
64073
  }
64061
64074
  };
64062
- function bT(e, t, n) {
64063
- return new yT(e, t, n);
64075
+ function xT(e, t, n) {
64076
+ return new bT(e, t, n);
64064
64077
  }
64065
64078
  //#endregion
64066
64079
  //#region src/animation/transform/ApplyPointwiseFunction.ts
64067
- function xT(e) {
64080
+ function ST(e) {
64068
64081
  let t = e;
64069
64082
  return typeof t.getLocalPoints == "function" && typeof t.setPoints == "function";
64070
64083
  }
64071
- var ST = class extends z {
64084
+ var CT = class extends z {
64072
64085
  func;
64073
64086
  _snapshots = [];
64074
64087
  constructor(e, t, n) {
@@ -64077,7 +64090,7 @@ var ST = class extends z {
64077
64090
  begin() {
64078
64091
  super.begin(), this._snapshots = [];
64079
64092
  let e = new a.Vector3();
64080
- for (let t of this.mobject.getFamily()) if (xT(t)) {
64093
+ for (let t of this.mobject.getFamily()) if (ST(t)) {
64081
64094
  let n = t.getLocalPoints();
64082
64095
  if (n.length === 0) continue;
64083
64096
  let r = t._worldMatrix(), i = r.clone().invert(), a = n.map((t) => {
@@ -64113,16 +64126,16 @@ var ST = class extends z {
64113
64126
  this.mobject._markDirtyUpward(), super.finish();
64114
64127
  }
64115
64128
  };
64116
- function CT(e, t, n) {
64117
- return new ST(e, t, n);
64129
+ function wT(e, t, n) {
64130
+ return new CT(e, t, n);
64118
64131
  }
64119
64132
  //#endregion
64120
64133
  //#region src/animation/transform/ApplyPointwiseFunctionToCenter.ts
64121
- function wT(e) {
64134
+ function TT(e) {
64122
64135
  let t = e;
64123
64136
  return typeof t.getLocalPoints == "function" && typeof t.setPoints == "function";
64124
64137
  }
64125
- var TT = class extends z {
64138
+ var ET = class extends z {
64126
64139
  func;
64127
64140
  _snapshots = [];
64128
64141
  constructor(e, t, n) {
@@ -64131,7 +64144,7 @@ var TT = class extends z {
64131
64144
  begin() {
64132
64145
  super.begin(), this._snapshots = [];
64133
64146
  let e = new a.Vector3();
64134
- for (let t of this.mobject.getFamily()) if (wT(t)) {
64147
+ for (let t of this.mobject.getFamily()) if (TT(t)) {
64135
64148
  let n = t.getLocalPoints();
64136
64149
  if (n.length === 0) continue;
64137
64150
  let r = t, i = r._threeObject, a = null, o = null;
@@ -64180,12 +64193,12 @@ var TT = class extends z {
64180
64193
  this.mobject._markDirtyUpward(), super.finish();
64181
64194
  }
64182
64195
  };
64183
- function ET(e, t, n) {
64184
- return new TT(e, t, n);
64196
+ function DT(e, t, n) {
64197
+ return new ET(e, t, n);
64185
64198
  }
64186
64199
  //#endregion
64187
64200
  //#region src/animation/movement/Rotate.ts
64188
- var DT = class extends z {
64201
+ var OT = class extends z {
64189
64202
  angle;
64190
64203
  axis;
64191
64204
  aboutPoint;
@@ -64366,7 +64379,7 @@ var DT = class extends z {
64366
64379
  this.interpolate(1), super.finish();
64367
64380
  }
64368
64381
  };
64369
- function OT(e, t, n) {
64382
+ function kT(e, t, n) {
64370
64383
  if (typeof t != "number") throw TypeError("rotate(): angle must be a number");
64371
64384
  return n && (() => {
64372
64385
  let e = (e) => (e.duration === void 0 || typeof e.duration == "number") && (e.rateFunc === void 0 || !0) && (e.shift === void 0 || Array.isArray(e.shift) && e.shift.length === 3 && typeof e.shift[0] == "number" && typeof e.shift[1] == "number" && typeof e.shift[2] == "number") && (e.axis === void 0 || Array.isArray(e.axis) && e.axis.length === 3 && typeof e.axis[0] == "number" && typeof e.axis[1] == "number" && typeof e.axis[2] == "number") && (e.aboutPoint === void 0 || Array.isArray(e.aboutPoint) && e.aboutPoint.length === 3 && typeof e.aboutPoint[0] == "number" && typeof e.aboutPoint[1] == "number" && typeof e.aboutPoint[2] == "number") && (e.aboutEdge === void 0 || Array.isArray(e.aboutEdge) && e.aboutEdge.length === 3 && typeof e.aboutEdge[0] == "number" && typeof e.aboutEdge[1] == "number" && typeof e.aboutEdge[2] == "number"), t = (e, t, n = !0) => (e.duration === void 0 || typeof e.duration == "number" || F(n, {
@@ -64506,17 +64519,17 @@ function OT(e, t, n) {
64506
64519
  expected: "Omit<RotateOptions, \"angle\">",
64507
64520
  value: e
64508
64521
  }, r))(e, "$input", !0)), e);
64509
- })()(n), new DT(e, {
64522
+ })()(n), new OT(e, {
64510
64523
  ...n,
64511
64524
  angle: t
64512
64525
  });
64513
64526
  }
64514
64527
  //#endregion
64515
64528
  //#region src/animation/movement/Scale.ts
64516
- function kT(e, t, n) {
64529
+ function AT(e, t, n) {
64517
64530
  return new a.Vector3(e.x + (t.x - e.x) * n, e.y + (t.y - e.y) * n, e.z + (t.z - e.z) * n);
64518
64531
  }
64519
- var AT = class extends z {
64532
+ var jT = class extends z {
64520
64533
  scaleFactor;
64521
64534
  aboutPoint;
64522
64535
  _initialScale = new a.Vector3();
@@ -64541,7 +64554,7 @@ var AT = class extends z {
64541
64554
  }
64542
64555
  }
64543
64556
  interpolate(e) {
64544
- let t = kT(this._initialScale, this._targetScale, e);
64557
+ let t = AT(this._initialScale, this._targetScale, e);
64545
64558
  if (this.mobject.scaleVector.copy(t), this._aboutPointVector) {
64546
64559
  let e = new a.Vector3(t.x / this._initialScale.x, t.y / this._initialScale.y, t.z / this._initialScale.z), n = new a.Vector3().copy(this._initialPosition).sub(this._aboutPointVector);
64547
64560
  n.multiply(e);
@@ -64554,13 +64567,13 @@ var AT = class extends z {
64554
64567
  this.interpolate(1), super.finish();
64555
64568
  }
64556
64569
  };
64557
- function jT(e, t, n) {
64558
- return new AT(e, {
64570
+ function MT(e, t, n) {
64571
+ return new jT(e, {
64559
64572
  ...n,
64560
64573
  scaleFactor: t
64561
64574
  });
64562
64575
  }
64563
- var MT = class extends z {
64576
+ var NT = class extends z {
64564
64577
  _targetScale = new a.Vector3();
64565
64578
  constructor(e, t = {}) {
64566
64579
  super(e, t);
@@ -64575,12 +64588,12 @@ var MT = class extends z {
64575
64588
  this.mobject.scaleVector.copy(this._targetScale), this.mobject._markDirty(), super.finish();
64576
64589
  }
64577
64590
  };
64578
- function NT(e, t) {
64579
- return new MT(e, t);
64591
+ function PT(e, t) {
64592
+ return new NT(e, t);
64580
64593
  }
64581
64594
  //#endregion
64582
64595
  //#region src/animation/movement/Shift.ts
64583
- var PT = class extends z {
64596
+ var FT = class extends z {
64584
64597
  direction;
64585
64598
  _initialPosition = new a.Vector3();
64586
64599
  _targetPosition = new a.Vector3();
@@ -64598,13 +64611,13 @@ var PT = class extends z {
64598
64611
  this.mobject.position.set(this._initialPosition.x + this.direction[0] * e, this._initialPosition.y + this.direction[1] * e, this._initialPosition.z + this.direction[2] * e), this.mobject._markDirty(), super.finish();
64599
64612
  }
64600
64613
  };
64601
- function FT(e, t, n) {
64602
- return new PT(e, {
64614
+ function IT(e, t, n) {
64615
+ return new FT(e, {
64603
64616
  ...n,
64604
64617
  direction: t
64605
64618
  });
64606
64619
  }
64607
- var IT = class extends z {
64620
+ var LT = class extends z {
64608
64621
  _initialPosition = new a.Vector3();
64609
64622
  _targetPosition = new a.Vector3();
64610
64623
  constructor(e, t = {}) {
@@ -64622,12 +64635,12 @@ var IT = class extends z {
64622
64635
  this.mobject.position.copy(this._targetPosition), this.mobject._markDirty(), super.finish();
64623
64636
  }
64624
64637
  };
64625
- function LT(e, t) {
64626
- return new IT(e, t);
64638
+ function RT(e, t) {
64639
+ return new LT(e, t);
64627
64640
  }
64628
64641
  //#endregion
64629
64642
  //#region src/animation/movement/MoveAlongPath.ts
64630
- function RT(e, t, n, r, i) {
64643
+ function zT(e, t, n, r, i) {
64631
64644
  let a = 1 - i, o = a * a, s = o * a, c = i * i, l = c * i;
64632
64645
  return [
64633
64646
  s * e[0] + 3 * o * i * t[0] + 3 * a * c * n[0] + l * r[0],
@@ -64635,7 +64648,7 @@ function RT(e, t, n, r, i) {
64635
64648
  s * e[2] + 3 * o * i * t[2] + 3 * a * c * n[2] + l * r[2]
64636
64649
  ];
64637
64650
  }
64638
- function zT(e, t, n, r, i) {
64651
+ function BT(e, t, n, r, i) {
64639
64652
  let a = 1 - i, o = a * a, s = i * i;
64640
64653
  return [
64641
64654
  3 * o * (t[0] - e[0]) + 6 * a * i * (n[0] - t[0]) + 3 * s * (r[0] - n[0]),
@@ -64643,7 +64656,7 @@ function zT(e, t, n, r, i) {
64643
64656
  3 * o * (t[2] - e[2]) + 6 * a * i * (n[2] - t[2]) + 3 * s * (r[2] - n[2])
64644
64657
  ];
64645
64658
  }
64646
- var BT = class extends z {
64659
+ var VT = class extends z {
64647
64660
  path;
64648
64661
  rotateAlongPath;
64649
64662
  _pathPoints = [];
@@ -64685,8 +64698,8 @@ var BT = class extends z {
64685
64698
  e = Math.max(0, Math.min(1, e));
64686
64699
  let t = e * this._numSegments, n = Math.min(Math.floor(t), this._numSegments - 1), r = t - n, i = n * 3, a = this._pathPoints[i], o = this._pathPoints[i + 1], s = this._pathPoints[i + 2], c = this._pathPoints[i + 3];
64687
64700
  return {
64688
- position: RT(a, o, s, c, r),
64689
- tangent: zT(a, o, s, c, r)
64701
+ position: zT(a, o, s, c, r),
64702
+ tangent: BT(a, o, s, c, r)
64690
64703
  };
64691
64704
  }
64692
64705
  interpolate(e) {
@@ -64705,15 +64718,15 @@ var BT = class extends z {
64705
64718
  this.interpolate(1), super.finish();
64706
64719
  }
64707
64720
  };
64708
- function VT(e, t, n) {
64709
- return new BT(e, {
64721
+ function HT(e, t, n) {
64722
+ return new VT(e, {
64710
64723
  ...n,
64711
64724
  path: t
64712
64725
  });
64713
64726
  }
64714
64727
  //#endregion
64715
64728
  //#region src/utils/ode.ts
64716
- function HT(e, t, n, r) {
64729
+ function UT(e, t, n, r) {
64717
64730
  let i = n.length, a = e(t, n), o = Array(i);
64718
64731
  for (let e = 0; e < i; e++) o[e] = n[e] + .5 * r * a[e];
64719
64732
  let s = e(t + .5 * r, o), c = Array(i);
@@ -64724,7 +64737,7 @@ function HT(e, t, n, r) {
64724
64737
  for (let e = 0; e < i; e++) f[e] = n[e] + r / 6 * (a[e] + 2 * s[e] + 2 * l[e] + d[e]);
64725
64738
  return f;
64726
64739
  }
64727
- function UT(e, t, n, r, i = {}) {
64740
+ function WT(e, t, n, r, i = {}) {
64728
64741
  let { recordTrajectory: a = !1 } = i, o, s;
64729
64742
  i.stepSize === void 0 ? (o = i.numSteps ?? 100, s = (r - t) / o) : (s = i.stepSize, o = Math.max(1, Math.ceil(Math.abs(r - t) / Math.abs(s))), s = (r - t) / o);
64730
64743
  let c = [], l = t, u = [...n];
@@ -64732,7 +64745,7 @@ function UT(e, t, n, r, i = {}) {
64732
64745
  t: l,
64733
64746
  y: [...u]
64734
64747
  });
64735
- for (let n = 0; n < o; n++) u = HT(e, l, u, s), l = t + (n + 1) * s, a && c.push({
64748
+ for (let n = 0; n < o; n++) u = UT(e, l, u, s), l = t + (n + 1) * s, a && c.push({
64736
64749
  t: l,
64737
64750
  y: [...u]
64738
64751
  });
@@ -64742,9 +64755,9 @@ function UT(e, t, n, r, i = {}) {
64742
64755
  trajectory: c
64743
64756
  };
64744
64757
  }
64745
- function WT(e, t, n, r = 100) {
64758
+ function GT(e, t, n, r = 100) {
64746
64759
  if (n === 0) return [...t];
64747
- let i = UT((t, n) => {
64760
+ let i = WT((t, n) => {
64748
64761
  let r = e([
64749
64762
  n[0],
64750
64763
  n[1],
@@ -64764,14 +64777,14 @@ function WT(e, t, n, r = 100) {
64764
64777
  }
64765
64778
  //#endregion
64766
64779
  //#region src/animation/movement/Homotopy.ts
64767
- function GT(e) {
64780
+ function KT(e) {
64768
64781
  let t = e._worldMatrix();
64769
64782
  return {
64770
64783
  worldMatrix: t,
64771
64784
  inverseWorld: t.clone().invert()
64772
64785
  };
64773
64786
  }
64774
- function KT(e, t) {
64787
+ function qT(e, t) {
64775
64788
  let n = new a.Vector3(t[0], t[1], t[2]).applyMatrix4(e);
64776
64789
  return [
64777
64790
  n.x,
@@ -64779,7 +64792,7 @@ function KT(e, t) {
64779
64792
  n.z
64780
64793
  ];
64781
64794
  }
64782
- var qT = class extends z {
64795
+ var JT = class extends z {
64783
64796
  homotopyFunc;
64784
64797
  _originalPoints = null;
64785
64798
  _frame = null;
@@ -64788,7 +64801,7 @@ var qT = class extends z {
64788
64801
  super(e, t), this.homotopyFunc = t.homotopyFunc;
64789
64802
  }
64790
64803
  begin() {
64791
- super.begin(), this.mobject instanceof I ? (this._isVMobject = !0, this._originalPoints = this.mobject.getLocalPoints(), this._frame = GT(this.mobject)) : (this._isVMobject = !1, this._originalPoints = null, this._frame = null);
64804
+ super.begin(), this.mobject instanceof I ? (this._isVMobject = !0, this._originalPoints = this.mobject.getLocalPoints(), this._frame = KT(this.mobject)) : (this._isVMobject = !1, this._originalPoints = null, this._frame = null);
64792
64805
  }
64793
64806
  interpolate(e) {
64794
64807
  if (!this._isVMobject || !this._originalPoints || !this._frame) {
@@ -64798,15 +64811,15 @@ var qT = class extends z {
64798
64811
  }
64799
64812
  let t = this.mobject, { worldMatrix: n, inverseWorld: r } = this._frame, i = [];
64800
64813
  for (let t of this._originalPoints) {
64801
- let [a, o, s] = KT(n, t), c = this.homotopyFunc(a, o, s, e);
64802
- i.push(KT(r, c));
64814
+ let [a, o, s] = qT(n, t), c = this.homotopyFunc(a, o, s, e);
64815
+ i.push(qT(r, c));
64803
64816
  }
64804
64817
  t.setPoints3D(i);
64805
64818
  }
64806
64819
  finish() {
64807
64820
  this.interpolate(1), super.finish();
64808
64821
  }
64809
- }, JT = class extends z {
64822
+ }, YT = class extends z {
64810
64823
  complexFunc;
64811
64824
  _originalPoints = null;
64812
64825
  _frame = null;
@@ -64815,7 +64828,7 @@ var qT = class extends z {
64815
64828
  super(e, t), this.complexFunc = t.complexFunc;
64816
64829
  }
64817
64830
  begin() {
64818
- super.begin(), this.mobject instanceof I ? (this._isVMobject = !0, this._originalPoints = this.mobject.getLocalPoints(), this._frame = GT(this.mobject)) : (this._isVMobject = !1, this._originalPoints = null, this._frame = null);
64831
+ super.begin(), this.mobject instanceof I ? (this._isVMobject = !0, this._originalPoints = this.mobject.getLocalPoints(), this._frame = KT(this.mobject)) : (this._isVMobject = !1, this._originalPoints = null, this._frame = null);
64819
64832
  }
64820
64833
  interpolate(e) {
64821
64834
  if (!this._isVMobject || !this._originalPoints || !this._frame) {
@@ -64828,11 +64841,11 @@ var qT = class extends z {
64828
64841
  }
64829
64842
  let t = this.mobject, { worldMatrix: n, inverseWorld: r } = this._frame, i = [];
64830
64843
  for (let t of this._originalPoints) {
64831
- let [a, o, s] = KT(n, t), c = this.complexFunc({
64844
+ let [a, o, s] = qT(n, t), c = this.complexFunc({
64832
64845
  re: a,
64833
64846
  im: o
64834
64847
  }, e);
64835
- i.push(KT(r, [
64848
+ i.push(qT(r, [
64836
64849
  c.re,
64837
64850
  c.im,
64838
64851
  s
@@ -64843,7 +64856,7 @@ var qT = class extends z {
64843
64856
  finish() {
64844
64857
  this.interpolate(1), super.finish();
64845
64858
  }
64846
- }, YT = class extends z {
64859
+ }, XT = class extends z {
64847
64860
  homotopyFunc;
64848
64861
  _originalPoints = null;
64849
64862
  _frame = null;
@@ -64854,9 +64867,9 @@ var qT = class extends z {
64854
64867
  begin() {
64855
64868
  super.begin();
64856
64869
  let e = this.mobject;
64857
- this._frame = GT(e);
64870
+ this._frame = KT(e);
64858
64871
  let { worldMatrix: t } = this._frame;
64859
- this._originalPoints = e.getLocalPoints().map((e) => KT(t, e)), this._anchorIndices = [];
64872
+ this._originalPoints = e.getLocalPoints().map((e) => qT(t, e)), this._anchorIndices = [];
64860
64873
  for (let e = 0; e < this._originalPoints.length; e += 3) this._anchorIndices.push(e);
64861
64874
  let n = this._originalPoints.length - 1;
64862
64875
  n >= 0 && !this._anchorIndices.includes(n) && this._anchorIndices.push(n);
@@ -64873,7 +64886,7 @@ var qT = class extends z {
64873
64886
  }
64874
64887
  for (let t = 0; t < n; t++) i.has(t) || (r[t] = this._transformHandle(t, e, i));
64875
64888
  let { inverseWorld: a } = this._frame;
64876
- t.setPoints3D(r.map((e) => KT(a, e)));
64889
+ t.setPoints3D(r.map((e) => qT(a, e)));
64877
64890
  }
64878
64891
  _transformHandle(e, t, n) {
64879
64892
  let r = this._originalPoints[e], i = -1, a = -1;
@@ -64907,7 +64920,7 @@ var qT = class extends z {
64907
64920
  finish() {
64908
64921
  this.interpolate(1), super.finish();
64909
64922
  }
64910
- }, XT = class extends z {
64923
+ }, ZT = class extends z {
64911
64924
  vectorField;
64912
64925
  virtualTime;
64913
64926
  _originalPoints = null;
@@ -64919,7 +64932,7 @@ var qT = class extends z {
64919
64932
  super(e, t), this.vectorField = t.vectorField, this.virtualTime = t.virtualTime ?? 1, this._integrationSteps = t.integrationSteps ?? 100;
64920
64933
  }
64921
64934
  begin() {
64922
- if (super.begin(), this.mobject instanceof I) this._isVMobject = !0, this._originalPoints = this.mobject.getLocalPoints(), this._frame = GT(this.mobject);
64935
+ if (super.begin(), this.mobject instanceof I) this._isVMobject = !0, this._originalPoints = this.mobject.getLocalPoints(), this._frame = KT(this.mobject);
64923
64936
  else {
64924
64937
  this._isVMobject = !1, this._originalPoints = null, this._frame = null;
64925
64938
  let e = this.mobject.position;
@@ -64937,14 +64950,14 @@ var qT = class extends z {
64937
64950
  this.mobject.position.x,
64938
64951
  this.mobject.position.y,
64939
64952
  this.mobject.position.z
64940
- ], [n, r, i] = WT(this.vectorField, e, t, this._integrationSteps);
64953
+ ], [n, r, i] = GT(this.vectorField, e, t, this._integrationSteps);
64941
64954
  this.mobject.position.set(n, r, i), this.mobject._markDirty();
64942
64955
  return;
64943
64956
  }
64944
64957
  let n = this.mobject, { worldMatrix: r, inverseWorld: i } = this._frame, a = [];
64945
64958
  for (let e of this._originalPoints) {
64946
- let n = WT(this.vectorField, KT(r, e), t, this._integrationSteps);
64947
- a.push(KT(i, n));
64959
+ let n = GT(this.vectorField, qT(r, e), t, this._integrationSteps);
64960
+ a.push(qT(i, n));
64948
64961
  }
64949
64962
  n.setPoints3D(a);
64950
64963
  }
@@ -64952,33 +64965,33 @@ var qT = class extends z {
64952
64965
  this.interpolate(1), super.finish();
64953
64966
  }
64954
64967
  };
64955
- function ZT(e, t, n) {
64956
- return new qT(e, {
64957
- ...n,
64958
- homotopyFunc: t
64959
- });
64960
- }
64961
64968
  function QT(e, t, n) {
64962
64969
  return new JT(e, {
64963
64970
  ...n,
64964
- complexFunc: t
64971
+ homotopyFunc: t
64965
64972
  });
64966
64973
  }
64967
64974
  function $T(e, t, n) {
64968
64975
  return new YT(e, {
64969
64976
  ...n,
64970
- homotopyFunc: t
64977
+ complexFunc: t
64971
64978
  });
64972
64979
  }
64973
64980
  function eE(e, t, n) {
64974
64981
  return new XT(e, {
64982
+ ...n,
64983
+ homotopyFunc: t
64984
+ });
64985
+ }
64986
+ function tE(e, t, n) {
64987
+ return new ZT(e, {
64975
64988
  ...n,
64976
64989
  vectorField: t
64977
64990
  });
64978
64991
  }
64979
64992
  //#endregion
64980
64993
  //#region src/animation/growing/index.ts
64981
- var tE = class extends z {
64994
+ var nE = class extends z {
64982
64995
  _start = new a.Vector3();
64983
64996
  _endShaftPos = new a.Vector3();
64984
64997
  _endTipPos = new a.Vector3();
@@ -65036,10 +65049,10 @@ var tE = class extends z {
65036
65049
  t.position.copy(this._endShaftPos), n.position.copy(this._endTipPos), t.scaleVector.copy(this._endShaftScale), n.scaleVector.copy(this._endTipScale), t._markDirty(), n._markDirty(), this.mobject._markDirty(), super.finish();
65037
65050
  }
65038
65051
  };
65039
- function nE(e, t) {
65040
- return new tE(e, t);
65052
+ function rE(e, t) {
65053
+ return new nE(e, t);
65041
65054
  }
65042
- var rE = class extends z {
65055
+ var iE = class extends z {
65043
65056
  edge;
65044
65057
  _targetScale = new a.Vector3();
65045
65058
  _targetPosition = new a.Vector3();
@@ -65060,13 +65073,13 @@ var rE = class extends z {
65060
65073
  this.mobject.scaleVector.copy(this._targetScale), this.mobject.position.copy(this._targetPosition), this.mobject._markDirty(), super.finish();
65061
65074
  }
65062
65075
  };
65063
- function iE(e, t, n) {
65064
- return new rE(e, {
65076
+ function aE(e, t, n) {
65077
+ return new iE(e, {
65065
65078
  ...n,
65066
65079
  edge: t
65067
65080
  });
65068
65081
  }
65069
- var aE = class extends z {
65082
+ var oE = class extends z {
65070
65083
  point;
65071
65084
  _targetScale = new a.Vector3();
65072
65085
  _targetPosition = new a.Vector3();
@@ -65085,13 +65098,13 @@ var aE = class extends z {
65085
65098
  this.mobject.scaleVector.copy(this._targetScale), this.mobject.position.copy(this._targetPosition), this.mobject._markDirty(), super.finish();
65086
65099
  }
65087
65100
  };
65088
- function oE(e, t, n) {
65089
- return new aE(e, {
65101
+ function sE(e, t, n) {
65102
+ return new oE(e, {
65090
65103
  ...n,
65091
65104
  point: t
65092
65105
  });
65093
65106
  }
65094
- var sE = class extends z {
65107
+ var cE = class extends z {
65095
65108
  angle;
65096
65109
  axis;
65097
65110
  _targetScale = new a.Vector3();
@@ -65119,18 +65132,18 @@ var sE = class extends z {
65119
65132
  this.mobject.scaleVector.copy(this._targetScale), this.mobject.rotation.copy(this._initialRotation), this.mobject._markDirty(), super.finish();
65120
65133
  }
65121
65134
  };
65122
- function cE(e, t) {
65123
- return new sE(e, t);
65135
+ function lE(e, t) {
65136
+ return new cE(e, t);
65124
65137
  }
65125
65138
  //#endregion
65126
65139
  //#region src/animation/LaggedStart.ts
65127
- function lE(e, t) {
65140
+ function uE(e, t) {
65128
65141
  return new rg(e, {
65129
65142
  ...t,
65130
65143
  lagRatio: t?.lagRatio ?? .2
65131
65144
  });
65132
65145
  }
65133
- var uE = class extends rg {
65146
+ var dE = class extends rg {
65134
65147
  constructor(e, t = {}) {
65135
65148
  super(e, {
65136
65149
  ...t,
@@ -65140,13 +65153,13 @@ var uE = class extends rg {
65140
65153
  };
65141
65154
  //#endregion
65142
65155
  //#region src/animation/Succession.ts
65143
- function dE(e, t) {
65156
+ function fE(e, t) {
65144
65157
  return new rg(e, {
65145
65158
  ...t,
65146
65159
  lagRatio: 1
65147
65160
  });
65148
65161
  }
65149
- var fE = class extends rg {
65162
+ var pE = class extends rg {
65150
65163
  constructor(e, t = {}) {
65151
65164
  super(e, {
65152
65165
  ...t,
@@ -65156,14 +65169,14 @@ var fE = class extends rg {
65156
65169
  };
65157
65170
  //#endregion
65158
65171
  //#region src/animation/composition/LaggedStartMap.ts
65159
- function pE(e, t, n) {
65172
+ function mE(e, t, n) {
65160
65173
  let { lagRatio: r = .2, animOptions: i, ...a } = n ?? {};
65161
65174
  return new rg(t.map((t) => new e(t, i)), {
65162
65175
  ...a,
65163
65176
  lagRatio: r
65164
65177
  });
65165
65178
  }
65166
- var mE = class extends rg {
65179
+ var hE = class extends rg {
65167
65180
  constructor(e, t, n = {}) {
65168
65181
  let { lagRatio: r = .2, animOptions: i, ...a } = n, o = t.map((t) => new e(t, i));
65169
65182
  super(o, {
@@ -65171,7 +65184,7 @@ var mE = class extends rg {
65171
65184
  lagRatio: r
65172
65185
  });
65173
65186
  }
65174
- }, hE = class extends z {
65187
+ }, gE = class extends z {
65175
65188
  _func;
65176
65189
  constructor(e, t, n) {
65177
65190
  super(e, n), this._func = t;
@@ -65180,18 +65193,18 @@ var mE = class extends rg {
65180
65193
  this._func(this.mobject, e);
65181
65194
  }
65182
65195
  };
65183
- function gE(e, t, n) {
65184
- return new hE(e, t, n);
65196
+ function _E(e, t, n) {
65197
+ return new gE(e, t, n);
65185
65198
  }
65186
65199
  //#endregion
65187
65200
  //#region src/animation/UpdateFromAlphaFunc.ts
65188
- var _E = class extends hE {};
65189
- function vE(e, t, n) {
65190
- return new _E(e, t, n);
65201
+ var vE = class extends gE {};
65202
+ function yE(e, t, n) {
65203
+ return new vE(e, t, n);
65191
65204
  }
65192
65205
  //#endregion
65193
65206
  //#region src/animation/MaintainPositionRelativeTo.ts
65194
- function yE(e, t) {
65207
+ function bE(e, t) {
65195
65208
  let n = [
65196
65209
  e.position.x - t.position.x,
65197
65210
  e.position.y - t.position.y,
@@ -65207,7 +65220,7 @@ function yE(e, t) {
65207
65220
  }
65208
65221
  //#endregion
65209
65222
  //#region src/animation/AlwaysRedraw.ts
65210
- function bE(e) {
65223
+ function xE(e) {
65211
65224
  let t = e();
65212
65225
  return t.addUpdater((t) => {
65213
65226
  t.become(e());
@@ -65215,24 +65228,24 @@ function bE(e) {
65215
65228
  }
65216
65229
  //#endregion
65217
65230
  //#region src/animation/Always.ts
65218
- function xE(e, t, ...n) {
65231
+ function SE(e, t, ...n) {
65219
65232
  return e.addUpdater(() => {
65220
65233
  e[t].apply(e, n.map((e) => e()));
65221
65234
  }), e;
65222
65235
  }
65223
- function SE(e, t, ...n) {
65236
+ function CE(e, t, ...n) {
65224
65237
  return e.addUpdater(() => {
65225
65238
  e[t].apply(e, n);
65226
65239
  }), e;
65227
65240
  }
65228
- function CE(e, t) {
65241
+ function wE(e, t) {
65229
65242
  if (!(e instanceof kr)) throw Error(`assertIsMobjectMethod: expected a Mobject, got ${e === null ? "null" : typeof e}`);
65230
65243
  if (typeof e[t] != "function") throw Error(`assertIsMobjectMethod: "${t}" is not a method of ${e.constructor.name}`);
65231
65244
  }
65232
65245
  //#endregion
65233
65246
  //#region src/animation/updaters.ts
65234
- var wE = 20 * Math.PI / 180;
65235
- function TE(e, t = _n, n = .1) {
65247
+ var TE = 20 * Math.PI / 180;
65248
+ function EE(e, t = _n, n = .1) {
65236
65249
  let r = Rn(t);
65237
65250
  return e.addUpdater((e, t) => {
65238
65251
  e.shift([
@@ -65242,12 +65255,12 @@ function TE(e, t = _n, n = .1) {
65242
65255
  ]);
65243
65256
  }), e;
65244
65257
  }
65245
- function EE(e, t = wE, n) {
65258
+ function DE(e, t = TE, n) {
65246
65259
  return e.addUpdater((e, r) => {
65247
65260
  e.rotate(r * t, n);
65248
65261
  }), e;
65249
65262
  }
65250
- function DE(e, t = !1, n = 0) {
65263
+ function OE(e, t = !1, n = 0) {
65251
65264
  let r = e.mobject;
65252
65265
  e.begin();
65253
65266
  let i = -n, a = (n, r) => {
@@ -65269,12 +65282,12 @@ function DE(e, t = !1, n = 0) {
65269
65282
  };
65270
65283
  return r.addUpdater(a), r;
65271
65284
  }
65272
- function OE(e, t = 0) {
65273
- return DE(e, !0, t);
65285
+ function kE(e, t = 0) {
65286
+ return OE(e, !0, t);
65274
65287
  }
65275
65288
  //#endregion
65276
65289
  //#region src/animation/numbers/index.ts
65277
- var kE = class extends z {
65290
+ var AE = class extends z {
65278
65291
  decimalNumber;
65279
65292
  _startValue;
65280
65293
  _endValue;
@@ -65296,7 +65309,7 @@ var kE = class extends z {
65296
65309
  getEndValue() {
65297
65310
  return this._endValue;
65298
65311
  }
65299
- }, AE = class extends z {
65312
+ }, jE = class extends z {
65300
65313
  decimalNumber;
65301
65314
  _startValue;
65302
65315
  _targetValue;
@@ -65322,15 +65335,15 @@ var kE = class extends z {
65322
65335
  return this._targetValue;
65323
65336
  }
65324
65337
  };
65325
- function jE(e, t) {
65326
- return new kE(e, t);
65327
- }
65328
65338
  function ME(e, t) {
65329
65339
  return new AE(e, t);
65330
65340
  }
65341
+ function NE(e, t) {
65342
+ return new jE(e, t);
65343
+ }
65331
65344
  //#endregion
65332
65345
  //#region src/animation/changing/index.ts
65333
- var NE = class e extends I {
65346
+ var PE = class e extends I {
65334
65347
  _trackedMobject;
65335
65348
  _dissipatingTime;
65336
65349
  _minDistanceToNewPoint;
@@ -65413,10 +65426,10 @@ var NE = class e extends I {
65413
65426
  })), t._elapsedTime = this._elapsedTime, t._lastPosition = this._lastPosition ? [...this._lastPosition] : null, t;
65414
65427
  }
65415
65428
  };
65416
- function PE(e, t) {
65417
- return new NE(e, t);
65429
+ function FE(e, t) {
65430
+ return new PE(e, t);
65418
65431
  }
65419
- var FE = class e extends I {
65432
+ var IE = class e extends I {
65420
65433
  _boundedMobject;
65421
65434
  _colors;
65422
65435
  _numDashes;
@@ -65540,12 +65553,12 @@ var FE = class e extends I {
65540
65553
  this._dashes = [], super.dispose();
65541
65554
  }
65542
65555
  };
65543
- function IE(e, t) {
65544
- return new FE(e, t);
65556
+ function LE(e, t) {
65557
+ return new IE(e, t);
65545
65558
  }
65546
65559
  //#endregion
65547
65560
  //#region src/animation/speed/index.ts
65548
- var LE = class e extends kr {
65561
+ var RE = class e extends kr {
65549
65562
  normalizeTransform(e = this._ownMatrix()) {
65550
65563
  return this._flattenAsContainer(e);
65551
65564
  }
@@ -65556,7 +65569,7 @@ var LE = class e extends kr {
65556
65569
  return new e();
65557
65570
  }
65558
65571
  };
65559
- function RE(e, t, n = 100) {
65572
+ function zE(e, t, n = 100) {
65560
65573
  let r = 0, i = 1 / n;
65561
65574
  for (let e = 0; e < n; e++) {
65562
65575
  let a = e / n, o = (e + 1) / n, s = Math.max(.001, t(a)), c = Math.max(.001, t(o));
@@ -65564,7 +65577,7 @@ function RE(e, t, n = 100) {
65564
65577
  }
65565
65578
  return e * r;
65566
65579
  }
65567
- function zE(e, t, n = 100) {
65580
+ function BE(e, t, n = 100) {
65568
65581
  let r = 0, i = 1 / n, a = [0];
65569
65582
  for (let e = 0; e < n; e++) {
65570
65583
  let o = e / n, s = (e + 1) / n, c = Math.max(.001, t(o)), l = Math.max(.001, t(s));
@@ -65578,12 +65591,12 @@ function zE(e, t, n = 100) {
65578
65591
  let l = a[s], u = a[Math.min(c, n)], d = u > l ? (o - l) / (u - l) : 0;
65579
65592
  return Math.min(1, Math.max(0, (s + d) / n));
65580
65593
  }
65581
- var BE = class extends z {
65594
+ var VE = class extends z {
65582
65595
  animation;
65583
65596
  speedFunc;
65584
65597
  _numSamples = 200;
65585
65598
  constructor(e, t, n = {}) {
65586
- let r = new LE(), i = RE(e.duration, t);
65599
+ let r = new RE(), i = zE(e.duration, t);
65587
65600
  super(r, {
65588
65601
  duration: i,
65589
65602
  rateFunc: n.rateFunc ?? wo
@@ -65593,7 +65606,7 @@ var BE = class extends z {
65593
65606
  super.begin(), this.animation.begin();
65594
65607
  }
65595
65608
  interpolate(e) {
65596
- let t = zE(e, this.speedFunc, this._numSamples), n = this.animation.rateFunc(t);
65609
+ let t = BE(e, this.speedFunc, this._numSamples), n = this.animation.rateFunc(t);
65597
65610
  this.animation.interpolate(n);
65598
65611
  }
65599
65612
  finish() {
@@ -65603,19 +65616,19 @@ var BE = class extends z {
65603
65616
  super.reset(), this.animation.reset();
65604
65617
  }
65605
65618
  };
65606
- function VE(e, t, n) {
65607
- return new BE(e, t, n);
65619
+ function HE(e, t, n) {
65620
+ return new VE(e, t, n);
65608
65621
  }
65609
- function HE(e, t) {
65622
+ function UE(e, t) {
65610
65623
  return (n) => e + (t - e) * n;
65611
65624
  }
65612
- function UE(e, t, n = 2, r = .5) {
65625
+ function WE(e, t, n = 2, r = .5) {
65613
65626
  return (i) => i >= e && i <= t ? r : n;
65614
65627
  }
65615
- function WE(e, t, n = 1, r = 3) {
65628
+ function GE(e, t, n = 1, r = 3) {
65616
65629
  return (i) => i >= e && i <= t ? r : n;
65617
65630
  }
65618
- function GE(e, t) {
65631
+ function KE(e, t) {
65619
65632
  return (n) => {
65620
65633
  let r = (1 + Math.cos(2 * Math.PI * n)) / 2;
65621
65634
  return e + (t - e) * r;
@@ -65623,7 +65636,7 @@ function GE(e, t) {
65623
65636
  }
65624
65637
  //#endregion
65625
65638
  //#region src/animation/utility/index.ts
65626
- var KE = class extends z {
65639
+ var qE = class extends z {
65627
65640
  constructor(e, t = {}) {
65628
65641
  super(e, {
65629
65642
  ...t,
@@ -65635,10 +65648,10 @@ var KE = class extends z {
65635
65648
  }
65636
65649
  interpolate(e) {}
65637
65650
  };
65638
- function qE(e, t) {
65639
- return new KE(e, t);
65651
+ function JE(e, t) {
65652
+ return new qE(e, t);
65640
65653
  }
65641
- var JE = class extends z {
65654
+ var YE = class extends z {
65642
65655
  constructor(e, t = {}) {
65643
65656
  super(e, {
65644
65657
  ...t,
@@ -65650,10 +65663,10 @@ var JE = class extends z {
65650
65663
  }
65651
65664
  interpolate(e) {}
65652
65665
  };
65653
- function YE(e, t) {
65654
- return new JE(e, t);
65666
+ function XE(e, t) {
65667
+ return new YE(e, t);
65655
65668
  }
65656
- var XE = class extends z {
65669
+ var ZE = class extends z {
65657
65670
  constructor(e, t = {}) {
65658
65671
  super(e, {
65659
65672
  duration: t.duration ?? 1,
@@ -65662,13 +65675,13 @@ var XE = class extends z {
65662
65675
  }
65663
65676
  interpolate(e) {}
65664
65677
  };
65665
- function ZE(e, t, n) {
65666
- return new XE(e, {
65678
+ function QE(e, t, n) {
65679
+ return new ZE(e, {
65667
65680
  ...n,
65668
65681
  duration: t
65669
65682
  });
65670
65683
  }
65671
- var QE = class extends z {
65684
+ var $E = class extends z {
65672
65685
  angle;
65673
65686
  axis;
65674
65687
  aboutPoint;
@@ -65706,10 +65719,10 @@ var QE = class extends z {
65706
65719
  this.mobject._markDirty();
65707
65720
  }
65708
65721
  };
65709
- function $E(e, t) {
65710
- return new QE(e, t);
65722
+ function eD(e, t) {
65723
+ return new $E(e, t);
65711
65724
  }
65712
- var eD = class extends z {
65725
+ var tD = class extends z {
65713
65726
  focalPoint;
65714
65727
  nMobs;
65715
65728
  initialOpacity;
@@ -65768,12 +65781,12 @@ var eD = class extends z {
65768
65781
  this._copies = [], this._parentObject = null, super.finish();
65769
65782
  }
65770
65783
  };
65771
- function tD(e, t) {
65772
- return new eD(e, t);
65784
+ function nD(e, t) {
65785
+ return new tD(e, t);
65773
65786
  }
65774
65787
  //#endregion
65775
65788
  //#region src/animation/indication/Indicate.ts
65776
- var nD = class extends z {
65789
+ var rD = class extends z {
65777
65790
  scaleFactor;
65778
65791
  indicateColor;
65779
65792
  _originalScale = new a.Vector3();
@@ -65797,12 +65810,12 @@ var nD = class extends z {
65797
65810
  this.mobject.scaleVector.copy(this._originalScale), this.mobject.setColor(this._originalColor), this.mobject._markDirty(), super.finish();
65798
65811
  }
65799
65812
  };
65800
- function rD(e, t) {
65801
- return new nD(e, t);
65813
+ function iD(e, t) {
65814
+ return new rD(e, t);
65802
65815
  }
65803
65816
  //#endregion
65804
65817
  //#region src/animation/indication/Flash.ts
65805
- var iD = class extends z {
65818
+ var aD = class extends z {
65806
65819
  flashColor;
65807
65820
  numLines;
65808
65821
  flashRadius;
@@ -65875,12 +65888,12 @@ var iD = class extends z {
65875
65888
  }), this._flashGroup = null), super.finish();
65876
65889
  }
65877
65890
  };
65878
- function aD(e, t) {
65879
- return new iD(e, t);
65891
+ function oD(e, t) {
65892
+ return new aD(e, t);
65880
65893
  }
65881
65894
  //#endregion
65882
65895
  //#region src/animation/indication/Circumscribe.ts
65883
- var oD = class extends z {
65896
+ var sD = class extends z {
65884
65897
  shapeType;
65885
65898
  shapeColor;
65886
65899
  buff;
@@ -65970,12 +65983,12 @@ var oD = class extends z {
65970
65983
  }), this._shapeGroup = null), super.finish();
65971
65984
  }
65972
65985
  };
65973
- function sD(e, t) {
65974
- return new oD(e, t);
65986
+ function cD(e, t) {
65987
+ return new sD(e, t);
65975
65988
  }
65976
65989
  //#endregion
65977
65990
  //#region src/animation/indication/Wiggle.ts
65978
- var cD = class extends z {
65991
+ var lD = class extends z {
65979
65992
  rotationAngle;
65980
65993
  nWiggles;
65981
65994
  scaleFactor;
@@ -66019,12 +66032,12 @@ var cD = class extends z {
66019
66032
  this.mobject.rotation.setFromQuaternion(this._initialQuaternion), this.mobject.scaleVector.copy(this._initialScale), this.mobject.position.copy(this._initialPosition), this.mobject._markDirty(), super.finish();
66020
66033
  }
66021
66034
  };
66022
- function lD(e, t) {
66023
- return new cD(e, t);
66035
+ function uD(e, t) {
66036
+ return new lD(e, t);
66024
66037
  }
66025
66038
  //#endregion
66026
66039
  //#region src/animation/indication/ShowPassingFlash.ts
66027
- var uD = class extends z {
66040
+ var dD = class extends z {
66028
66041
  flashColor;
66029
66042
  timeWidth;
66030
66043
  flashStrokeWidth;
@@ -66125,12 +66138,12 @@ var uD = class extends z {
66125
66138
  }), this._flashGroup = null), super.finish();
66126
66139
  }
66127
66140
  };
66128
- function dD(e, t) {
66129
- return new uD(e, t);
66141
+ function fD(e, t) {
66142
+ return new dD(e, t);
66130
66143
  }
66131
66144
  //#endregion
66132
66145
  //#region src/animation/indication/ApplyWave.ts
66133
- var fD = class extends z {
66146
+ var pD = class extends z {
66134
66147
  direction;
66135
66148
  amplitude;
66136
66149
  wavelength;
@@ -66216,12 +66229,12 @@ var fD = class extends z {
66216
66229
  this._isVMobject && this.mobject.setPoints(this._originalPoints), this.mobject.position.copy(this._originalPosition), this.mobject._markDirty(), super.finish();
66217
66230
  }
66218
66231
  };
66219
- function pD(e, t) {
66220
- return new fD(e, t);
66232
+ function mD(e, t) {
66233
+ return new pD(e, t);
66221
66234
  }
66222
66235
  //#endregion
66223
66236
  //#region src/animation/indication/FocusOn.ts
66224
- var mD = class extends z {
66237
+ var hD = class extends z {
66225
66238
  focusColor;
66226
66239
  startRadius;
66227
66240
  endRadius;
@@ -66293,10 +66306,10 @@ var mD = class extends z {
66293
66306
  }), this._ringsGroup = null), super.finish();
66294
66307
  }
66295
66308
  };
66296
- function hD(e, t) {
66297
- return new mD(e, t);
66309
+ function gD(e, t) {
66310
+ return new hD(e, t);
66298
66311
  }
66299
- var gD = class extends z {
66312
+ var _D = class extends z {
66300
66313
  scaleFactor;
66301
66314
  nPulses;
66302
66315
  _originalScale = new a.Vector3();
@@ -66317,12 +66330,12 @@ var gD = class extends z {
66317
66330
  this.mobject.scaleVector.copy(this._originalScale), this.mobject._markDirty(), super.finish();
66318
66331
  }
66319
66332
  };
66320
- function _D(e, t) {
66321
- return new gD(e, t);
66333
+ function vD(e, t) {
66334
+ return new _D(e, t);
66322
66335
  }
66323
66336
  //#endregion
66324
66337
  //#region src/animation/indication/ShowPassingFlashWithThinningStrokeWidth.ts
66325
- var vD = class extends uD {
66338
+ var yD = class extends dD {
66326
66339
  minStrokeWidthRatio;
66327
66340
  constructor(e, t = {}) {
66328
66341
  super(e, t), this.minStrokeWidthRatio = t.minStrokeWidthRatio ?? .1;
@@ -66363,12 +66376,12 @@ var vD = class extends uD {
66363
66376
  }
66364
66377
  }
66365
66378
  };
66366
- function yD(e, t) {
66367
- return new vD(e, t);
66379
+ function bD(e, t) {
66380
+ return new yD(e, t);
66368
66381
  }
66369
66382
  //#endregion
66370
66383
  //#region src/animation/indication/Blink.ts
66371
- var bD = class extends z {
66384
+ var xD = class extends z {
66372
66385
  nBlinks;
66373
66386
  minOpacity;
66374
66387
  blinkDuration;
@@ -66409,12 +66422,12 @@ var bD = class extends z {
66409
66422
  this.mobject._markDirty(), super.finish();
66410
66423
  }
66411
66424
  };
66412
- function xD(e, t) {
66413
- return new bD(e, t);
66425
+ function SD(e, t) {
66426
+ return new xD(e, t);
66414
66427
  }
66415
66428
  //#endregion
66416
66429
  //#region src/animation/indication/ShowCreationThenDestruction.ts
66417
- var SD = class extends z {
66430
+ var CD = class extends z {
66418
66431
  _totalLength = 0;
66419
66432
  _useDashReveal = !1;
66420
66433
  constructor(e, t = {}) {
@@ -66449,19 +66462,19 @@ var SD = class extends z {
66449
66462
  }) : this.mobject.setStrokeOpacity(0), super.finish();
66450
66463
  }
66451
66464
  };
66452
- function CD(e, t) {
66453
- return new SD(e, t);
66465
+ function wD(e, t) {
66466
+ return new CD(e, t);
66454
66467
  }
66455
66468
  //#endregion
66456
66469
  //#region src/animation/indication/WiggleOutThenIn.ts
66457
- var wD = 2 * Math.PI;
66458
- function TD(e) {
66470
+ var TD = 2 * Math.PI;
66471
+ function ED(e) {
66459
66472
  return Kn(e < .5 ? 2 * e : 2 * (1 - e));
66460
66473
  }
66461
- function ED(e, t) {
66462
- return Math.sin(t * wD * e) * TD(e);
66474
+ function DD(e, t) {
66475
+ return Math.sin(t * TD * e) * ED(e);
66463
66476
  }
66464
- var DD = class extends z {
66477
+ var OD = class extends z {
66465
66478
  scaleValue;
66466
66479
  rotationAngle;
66467
66480
  nWiggles;
@@ -66475,7 +66488,7 @@ var DD = class extends z {
66475
66488
  super(e, {
66476
66489
  duration: t.duration ?? 2,
66477
66490
  rateFunc: t.rateFunc ?? wo
66478
- }), this.scaleValue = t.scaleValue ?? 1.1, this.rotationAngle = t.rotationAngle ?? .01 * wD, this.nWiggles = t.nWiggles ?? 6, this.rotationAxis = t.rotationAxis ?? [
66491
+ }), this.scaleValue = t.scaleValue ?? 1.1, this.rotationAngle = t.rotationAngle ?? .01 * TD, this.nWiggles = t.nWiggles ?? 6, this.rotationAxis = t.rotationAxis ?? [
66479
66492
  0,
66480
66493
  0,
66481
66494
  1
@@ -66487,9 +66500,9 @@ var DD = class extends z {
66487
66500
  this._aboutPoint.set(e[0], e[1], e[2]);
66488
66501
  }
66489
66502
  interpolate(e) {
66490
- let t = TD(e), n = Un(1, this.scaleValue, t);
66503
+ let t = ED(e), n = Un(1, this.scaleValue, t);
66491
66504
  this.mobject.scaleVector.set(this._initialScale.x * n, this._initialScale.y * n, this._initialScale.z * n);
66492
- let r = ED(e, this.nWiggles) * this.rotationAngle, i = new a.Quaternion().setFromAxisAngle(this._axisVector, r), o = new a.Quaternion().copy(this._initialQuaternion);
66505
+ let r = DD(e, this.nWiggles) * this.rotationAngle, i = new a.Quaternion().setFromAxisAngle(this._axisVector, r), o = new a.Quaternion().copy(this._initialQuaternion);
66493
66506
  o.premultiply(i), this.mobject.rotation.setFromQuaternion(o);
66494
66507
  let s = new a.Vector3().copy(this._initialPosition).sub(this._aboutPoint);
66495
66508
  s.applyQuaternion(i);
@@ -66500,12 +66513,12 @@ var DD = class extends z {
66500
66513
  this.mobject.rotation.setFromQuaternion(this._initialQuaternion), this.mobject.scaleVector.copy(this._initialScale), this.mobject.position.copy(this._initialPosition), this.mobject._markDirty(), super.finish();
66501
66514
  }
66502
66515
  };
66503
- function OD(e, t) {
66504
- return new DD(e, t);
66516
+ function kD(e, t) {
66517
+ return new OD(e, t);
66505
66518
  }
66506
66519
  //#endregion
66507
66520
  //#region src/interaction/Draggable.ts
66508
- var kD = class {
66521
+ var AD = class {
66509
66522
  _mobject;
66510
66523
  _scene;
66511
66524
  _options;
@@ -66638,12 +66651,12 @@ var kD = class {
66638
66651
  e.removeEventListener("mousedown", this._onMouseDown), window.removeEventListener("mousemove", this._onMouseMove), window.removeEventListener("mouseup", this._onMouseUp), e.removeEventListener("touchstart", this._onTouchStart), window.removeEventListener("touchmove", this._onTouchMove), window.removeEventListener("touchend", this._onTouchEnd);
66639
66652
  }
66640
66653
  };
66641
- function AD(e, t, n) {
66642
- return new kD(e, t, n);
66654
+ function jD(e, t, n) {
66655
+ return new AD(e, t, n);
66643
66656
  }
66644
66657
  //#endregion
66645
66658
  //#region src/interaction/Hoverable.ts
66646
- var jD = class {
66659
+ var MD = class {
66647
66660
  _mobject;
66648
66661
  _scene;
66649
66662
  _options;
@@ -66726,12 +66739,12 @@ var jD = class {
66726
66739
  e.removeEventListener("mousemove", this._onMouseMove), e.removeEventListener("mouseleave", this._onMouseLeave), this._isHovering && this._endHover();
66727
66740
  }
66728
66741
  };
66729
- function MD(e, t, n) {
66730
- return new jD(e, t, n);
66742
+ function ND(e, t, n) {
66743
+ return new MD(e, t, n);
66731
66744
  }
66732
66745
  //#endregion
66733
66746
  //#region src/interaction/Clickable.ts
66734
- var ND = class {
66747
+ var PD = class {
66735
66748
  _mobject;
66736
66749
  _scene;
66737
66750
  _options;
@@ -66827,12 +66840,12 @@ var ND = class {
66827
66840
  e.removeEventListener("click", this._onClick), e.removeEventListener("dblclick", this._onDblClick), e.removeEventListener("touchstart", this._onTouchStart), e.removeEventListener("touchend", this._onTouchEnd);
66828
66841
  }
66829
66842
  };
66830
- function PD(e, t, n) {
66831
- return new ND(e, t, n);
66843
+ function FD(e, t, n) {
66844
+ return new PD(e, t, n);
66832
66845
  }
66833
66846
  //#endregion
66834
66847
  //#region src/interaction/MovablePoint.ts
66835
- var FD = class extends sv {
66848
+ var ID = class extends sv {
66836
66849
  _draggable;
66837
66850
  _onChange;
66838
66851
  _xTracker;
@@ -66849,7 +66862,7 @@ var FD = class extends sv {
66849
66862
  point: n,
66850
66863
  color: r,
66851
66864
  radius: i
66852
- }), this._onChange = a, this._xTracker = o, this._yTracker = s, this._draggable = new kD(this, e, {
66865
+ }), this._onChange = a, this._xTracker = o, this._yTracker = s, this._draggable = new AD(this, e, {
66853
66866
  autoRender: c,
66854
66867
  onDrag: (e, t) => this._commit(t, !0)
66855
66868
  }), this._syncTrackers(this.getPoint());
@@ -66867,7 +66880,7 @@ var FD = class extends sv {
66867
66880
  constrainToParametric(e, t) {
66868
66881
  let n = t[0], r = t[1], i = t.length > 2 ? Math.max(2, Math.floor(t[2])) : 256;
66869
66882
  return this._constraint = ([t, a, o]) => {
66870
- let s = LD(e, n, r, i, t, a);
66883
+ let s = RD(e, n, r, i, t, a);
66871
66884
  this._parameter = s;
66872
66885
  let [c, l] = e(s);
66873
66886
  return [
@@ -66878,10 +66891,10 @@ var FD = class extends sv {
66878
66891
  }, this._reproject(), this;
66879
66892
  }
66880
66893
  constrainToLine(e, t) {
66881
- return this._constraint = (n) => ID(e, t, n, !1), this._reproject(), this;
66894
+ return this._constraint = (n) => LD(e, t, n, !1), this._reproject(), this;
66882
66895
  }
66883
66896
  constrainToSegment(e, t) {
66884
- return this._constraint = (n) => ID(e, t, n, !0), this._reproject(), this;
66897
+ return this._constraint = (n) => LD(e, t, n, !0), this._reproject(), this;
66885
66898
  }
66886
66899
  clearConstraint() {
66887
66900
  return this._constraint = null, this._parameter = null, this;
@@ -66906,7 +66919,7 @@ var FD = class extends sv {
66906
66919
  this._xTracker?.setValue(e[0]), this._yTracker?.setValue(e[1]);
66907
66920
  }
66908
66921
  };
66909
- function ID(e, t, n, r) {
66922
+ function LD(e, t, n, r) {
66910
66923
  let i = t[0] - e[0], a = t[1] - e[1], o = i * i + a * a, s = o === 0 ? 0 : ((n[0] - e[0]) * i + (n[1] - e[1]) * a) / o;
66911
66924
  return r && (s = Math.max(0, Math.min(1, s))), [
66912
66925
  e[0] + s * i,
@@ -66914,7 +66927,7 @@ function ID(e, t, n, r) {
66914
66927
  n[2]
66915
66928
  ];
66916
66929
  }
66917
- function LD(e, t, n, r, i, a) {
66930
+ function RD(e, t, n, r, i, a) {
66918
66931
  let o = (t) => {
66919
66932
  let [n, r] = e(t), o = n - i, s = r - a;
66920
66933
  return o * o + s * s;
@@ -66930,12 +66943,12 @@ function LD(e, t, n, r, i, a) {
66930
66943
  }
66931
66944
  return (u + d) / 2;
66932
66945
  }
66933
- function RD(e, t) {
66934
- return new FD(e, t);
66946
+ function zD(e, t) {
66947
+ return new ID(e, t);
66935
66948
  }
66936
66949
  //#endregion
66937
66950
  //#region src/interaction/Slider.ts
66938
- var zD = 28, BD = .35, VD = class extends Yh {
66951
+ var BD = 28, VD = .35, HD = class extends Yh {
66939
66952
  _min;
66940
66953
  _max;
66941
66954
  _step;
@@ -66951,7 +66964,7 @@ var zD = 28, BD = .35, VD = class extends Yh {
66951
66964
  _draggable;
66952
66965
  constructor(e, t = {}) {
66953
66966
  super();
66954
- let n = HD(t), { center: r, color: i } = n;
66967
+ let n = UD(t), { center: r, color: i } = n;
66955
66968
  this._min = n.min, this._max = n.max, this._step = n.step, this._length = n.length, this._center = [...r], this._trackY = r[1], this._tracker = n.tracker ?? new gb(n.value), this._onChange = n.onChange, this._value = this._clampAndStep(n.value);
66956
66969
  let a = r[0] - n.length / 2;
66957
66970
  this._track = new s_({
@@ -66974,7 +66987,7 @@ var zD = 28, BD = .35, VD = class extends Yh {
66974
66987
  ],
66975
66988
  color: i,
66976
66989
  radius: n.handleRadius
66977
- }), this.add(this._track), this.add(this._handle), n.showLabel && this._createLabel(n.numDecimalPlaces, i), this._tracker.setValue(this._value), this._draggable = new kD(this._handle, e, {
66990
+ }), this.add(this._track), this.add(this._handle), n.showLabel && this._createLabel(n.numDecimalPlaces, i), this._tracker.setValue(this._value), this._draggable = new AD(this._handle, e, {
66978
66991
  autoRender: n.autoRender,
66979
66992
  onDrag: (e, t) => this.setValue(this._xToValue(t[0]))
66980
66993
  });
@@ -67012,7 +67025,7 @@ var zD = 28, BD = .35, VD = class extends Yh {
67012
67025
  this._label = new pb({
67013
67026
  value: this._value,
67014
67027
  numDecimalPlaces: e,
67015
- fontSize: zD,
67028
+ fontSize: BD,
67016
67029
  color: t
67017
67030
  }), this.add(this._label), this._positionLabel();
67018
67031
  }
@@ -67021,7 +67034,7 @@ var zD = 28, BD = .35, VD = class extends Yh {
67021
67034
  let e = this._valueToX(this._value);
67022
67035
  this._label.moveTo([
67023
67036
  e,
67024
- this._trackY + BD,
67037
+ this._trackY + VD,
67025
67038
  this._center[2]
67026
67039
  ]);
67027
67040
  }
@@ -67038,7 +67051,7 @@ var zD = 28, BD = .35, VD = class extends Yh {
67038
67051
  return this._step > 0 && (t = this._min + Math.round((e - this._min) / this._step) * this._step), Math.max(this._min, Math.min(this._max, t));
67039
67052
  }
67040
67053
  };
67041
- function HD(e) {
67054
+ function UD(e) {
67042
67055
  let t = e.min ?? 0;
67043
67056
  return {
67044
67057
  min: t,
@@ -67061,12 +67074,107 @@ function HD(e) {
67061
67074
  autoRender: e.autoRender
67062
67075
  };
67063
67076
  }
67064
- function UD(e, t) {
67065
- return new VD(e, t);
67077
+ function WD(e, t) {
67078
+ return new HD(e, t);
67079
+ }
67080
+ //#endregion
67081
+ //#region src/interaction/DynamicMatrix.ts
67082
+ function GD() {
67083
+ return [[1, 0], [0, 1]];
67084
+ }
67085
+ function KD(e) {
67086
+ return [[e[0][0], e[0][1]], [e[1][0], e[1][1]]];
67087
+ }
67088
+ function qD(e) {
67089
+ if (typeof e == "function") {
67090
+ let t = e();
67091
+ return [t[0], t[1]];
67092
+ }
67093
+ let t = e.getPoint();
67094
+ return [t[0], t[1]];
67095
+ }
67096
+ var JD = class e {
67097
+ _matrix;
67098
+ _compute;
67099
+ constructor(e = GD()) {
67100
+ this._matrix = KD(e), this._compute = null;
67101
+ }
67102
+ getMatrix() {
67103
+ return KD(this._compute ? this._compute() : this._matrix);
67104
+ }
67105
+ setMatrix(e) {
67106
+ return this._compute = null, this._matrix = KD(e), this;
67107
+ }
67108
+ setColumns(e, t) {
67109
+ return this.setMatrix([[e[0], t[0]], [e[1], t[1]]]);
67110
+ }
67111
+ getColumns() {
67112
+ let e = this.getMatrix();
67113
+ return [[e[0][0], e[1][0]], [e[0][1], e[1][1]]];
67114
+ }
67115
+ transformPoint(e) {
67116
+ let t = this.getMatrix();
67117
+ return [t[0][0] * e[0] + t[0][1] * e[1], t[1][0] * e[0] + t[1][1] * e[1]];
67118
+ }
67119
+ static fromGetter(t) {
67120
+ let n = new e();
67121
+ return n._compute = t, n;
67122
+ }
67123
+ static fromBasisVectors(t, n) {
67124
+ return e.fromGetter(() => {
67125
+ let e = qD(t), r = qD(n);
67126
+ return [[e[0], r[0]], [e[1], r[1]]];
67127
+ });
67128
+ }
67129
+ };
67130
+ function YD(e) {
67131
+ return new JD(e);
67132
+ }
67133
+ function XD(e) {
67134
+ return e instanceof JD ? e : typeof e == "function" ? JD.fromGetter(e) : new JD(e);
67135
+ }
67136
+ function ZD(e, t, n = {}) {
67137
+ let r = XD(t), i = n.aboutPoint ?? [
67138
+ 0,
67139
+ 0,
67140
+ 0
67141
+ ], a = n.onChange, o = n.dependents ? [...n.dependents] : [], s = [];
67142
+ for (let t of e.getFamily()) t instanceof I && t.hasOwnPoints() && s.push({
67143
+ node: t,
67144
+ points: t.getLocalPoints()
67145
+ });
67146
+ let c = () => {
67147
+ let e = r.getMatrix();
67148
+ for (let t of s) t.node.setPoints(t.points.map((t) => Yn(t, e, i)));
67149
+ for (let t of o) {
67150
+ let n = Yn([...t.base], e, i);
67151
+ t.mobject.moveTo([
67152
+ n[0],
67153
+ n[1],
67154
+ n[2]
67155
+ ]);
67156
+ }
67157
+ a?.(e);
67158
+ }, l = () => c();
67159
+ e.addUpdater(l), c();
67160
+ let u = {
67161
+ tracker: r,
67162
+ getMatrix: () => r.getMatrix(),
67163
+ setMatrix: (e) => (r.setMatrix(e), c(), u),
67164
+ addDependentPoint: (e, t) => (o.push({
67165
+ mobject: e,
67166
+ base: t
67167
+ }), u),
67168
+ update: () => (c(), u),
67169
+ remove: () => {
67170
+ e.removeUpdater(l);
67171
+ }
67172
+ };
67173
+ return u;
67066
67174
  }
67067
67175
  //#endregion
67068
67176
  //#region node_modules/gif.js/dist/gif.js
67069
- var WD = /* @__PURE__ */ r(((e, t) => {
67177
+ var QD = /* @__PURE__ */ r(((e, t) => {
67070
67178
  (function(n) {
67071
67179
  if (typeof e == "object" && t !== void 0) t.exports = n();
67072
67180
  else if (typeof define == "function" && define.amd) define([], n);
@@ -67320,10 +67428,10 @@ var WD = /* @__PURE__ */ r(((e, t) => {
67320
67428
  }]
67321
67429
  }, {}, [3])(3);
67322
67430
  });
67323
- })), GD = /* @__PURE__ */ t({
67324
- GifExporter: () => qD,
67325
- createGifExporter: () => JD
67326
- }), KD = /* @__PURE__ */ e(WD(), 1), qD = class e {
67431
+ })), $D = /* @__PURE__ */ t({
67432
+ GifExporter: () => tO,
67433
+ createGifExporter: () => nO
67434
+ }), eO = /* @__PURE__ */ e(QD(), 1), tO = class e {
67327
67435
  _scene;
67328
67436
  _options;
67329
67437
  constructor(e, t) {
@@ -67341,7 +67449,7 @@ var WD = /* @__PURE__ */ r(((e, t) => {
67341
67449
  };
67342
67450
  }
67343
67451
  async exportTimeline(e) {
67344
- let t = (e || this._options.duration || this._getTimelineDuration()) ?? 5, n = Math.ceil(t * this._options.fps), r = Math.round(1e3 / this._options.fps), i = await this._createWorkerBlobUrl(), a = new KD.default({
67452
+ let t = (e || this._options.duration || this._getTimelineDuration()) ?? 5, n = Math.ceil(t * this._options.fps), r = Math.round(1e3 / this._options.fps), i = await this._createWorkerBlobUrl(), a = new eO.default({
67345
67453
  workers: this._options.workers,
67346
67454
  quality: this._options.quality,
67347
67455
  width: this._options.width,
@@ -67400,15 +67508,15 @@ var WD = /* @__PURE__ */ r(((e, t) => {
67400
67508
  e.download(r, t);
67401
67509
  }
67402
67510
  };
67403
- function JD(e, t) {
67404
- return new qD(e, t);
67511
+ function nO(e, t) {
67512
+ return new tO(e, t);
67405
67513
  }
67406
67514
  //#endregion
67407
67515
  //#region src/export/VideoExporter.ts
67408
- var YD = /* @__PURE__ */ t({
67409
- VideoExporter: () => XD,
67410
- createVideoExporter: () => ZD
67411
- }), XD = class e {
67516
+ var rO = /* @__PURE__ */ t({
67517
+ VideoExporter: () => iO,
67518
+ createVideoExporter: () => aO
67519
+ }), iO = class e {
67412
67520
  _scene;
67413
67521
  _options;
67414
67522
  _mediaRecorder = null;
@@ -67500,12 +67608,12 @@ var YD = /* @__PURE__ */ t({
67500
67608
  return { ...this._options };
67501
67609
  }
67502
67610
  };
67503
- function ZD(e, t) {
67504
- return new XD(e, t);
67611
+ function aO(e, t) {
67612
+ return new iO(e, t);
67505
67613
  }
67506
67614
  //#endregion
67507
67615
  //#region src/export/FrameExporter.ts
67508
- function QD(e, t, n) {
67616
+ function oO(e, t, n) {
67509
67617
  return new Promise((r, i) => {
67510
67618
  if (typeof e.toBlob == "function") {
67511
67619
  e.toBlob((e) => {
@@ -67514,40 +67622,40 @@ function QD(e, t, n) {
67514
67622
  return;
67515
67623
  }
67516
67624
  try {
67517
- r($D(e.toDataURL(t, n)));
67625
+ r(sO(e.toDataURL(t, n)));
67518
67626
  } catch (e) {
67519
67627
  i(e instanceof Error ? e : Error(String(e)));
67520
67628
  }
67521
67629
  });
67522
67630
  }
67523
- function $D(e) {
67631
+ function sO(e) {
67524
67632
  let [t, n] = e.split(","), r = t.match(/data:([^;]+)/), i = r ? r[1] : "image/png", a = atob(n), o = new Uint8Array(a.length);
67525
67633
  for (let e = 0; e < a.length; e++) o[e] = a.charCodeAt(e);
67526
67634
  return new Blob([o], { type: i });
67527
67635
  }
67528
- async function eO(e, t) {
67529
- return t?.time !== void 0 && e.seek(t.time), QD(e.getCanvas(), t?.type ?? "image/png", t?.quality);
67636
+ async function cO(e, t) {
67637
+ return t?.time !== void 0 && e.seek(t.time), oO(e.getCanvas(), t?.type ?? "image/png", t?.quality);
67530
67638
  }
67531
- async function tO(e, t) {
67639
+ async function lO(e, t) {
67532
67640
  let n = t.fps, r = t.from ?? 0, i = t.to ?? e.getTimelineDuration() ?? 5, a = t.type ?? "image/png", o = t.onProgress ?? (() => {}), s = Math.max(0, i - r), c = Math.ceil(s * n), l = 1 / n, u = [];
67533
67641
  for (let n = 0; n < c; n++) {
67534
67642
  let i = r + n * l;
67535
67643
  e.seek(i);
67536
67644
  let s = e.getCanvas();
67537
- u.push(await QD(s, a, t.quality)), o((n + 1) / c);
67645
+ u.push(await oO(s, a, t.quality)), o((n + 1) / c);
67538
67646
  }
67539
67647
  return u;
67540
67648
  }
67541
- function nO(e, t) {
67649
+ function uO(e, t) {
67542
67650
  let n = URL.createObjectURL(e), r = document.createElement("a");
67543
67651
  r.href = n, r.download = t, document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(n);
67544
67652
  }
67545
- async function rO(e, t = "frame.png", n) {
67546
- nO(await eO(e, n), t);
67653
+ async function dO(e, t = "frame.png", n) {
67654
+ uO(await cO(e, n), t);
67547
67655
  }
67548
67656
  //#endregion
67549
67657
  //#region src/export/WebCodecsExporter.ts
67550
- var iO = {
67658
+ var fO = {
67551
67659
  avc: {
67552
67660
  encoderCodec: "avc1.42001f",
67553
67661
  mp4Codec: "avc",
@@ -67568,7 +67676,7 @@ var iO = {
67568
67676
  mp4Codec: "av1",
67569
67677
  webmCodec: "V_AV1"
67570
67678
  }
67571
- }, aO = class e {
67679
+ }, pO = class e {
67572
67680
  _scene;
67573
67681
  _options;
67574
67682
  constructor(e, t) {
@@ -67591,7 +67699,7 @@ var iO = {
67591
67699
  }
67592
67700
  async export() {
67593
67701
  if (!e.isSupported()) throw Error("WebCodecs VideoEncoder is not available in this environment. Use VideoExporter (MediaRecorder) instead to export video.");
67594
- let t = this._options, n = t.duration || this._scene.getTimelineDuration() || 5, r = Math.ceil(n * t.fps), a = iO[t.codec], o = await this._createMuxer(a), s = new window.VideoEncoder({
67702
+ let t = this._options, n = t.duration || this._scene.getTimelineDuration() || 5, r = Math.ceil(n * t.fps), a = fO[t.codec], o = await this._createMuxer(a), s = new window.VideoEncoder({
67595
67703
  output: (e, t) => o.addVideoChunk(e, t),
67596
67704
  error: (e) => i.error("WebCodecs encoder error:", e)
67597
67705
  }), c = {
@@ -67652,12 +67760,156 @@ var iO = {
67652
67760
  return { ...this._options };
67653
67761
  }
67654
67762
  };
67655
- function oO(e, t) {
67656
- return new aO(e, t);
67763
+ function mO(e, t) {
67764
+ return new pO(e, t);
67657
67765
  }
67658
67766
  //#endregion
67659
- //#region src/player/PlayerUI.ts
67660
- var sO = class {
67767
+ //#region src/export/chooseExporter.ts
67768
+ function hO(e = pO.isSupported()) {
67769
+ return e ? "webcodecs" : "mediarecorder";
67770
+ }
67771
+ //#endregion
67772
+ //#region src/player/ExportSettingsUI.ts
67773
+ var gO = [
67774
+ {
67775
+ id: "current",
67776
+ label: "Current",
67777
+ width: null,
67778
+ height: null
67779
+ },
67780
+ {
67781
+ id: "480p",
67782
+ label: "480p",
67783
+ width: 854,
67784
+ height: 480
67785
+ },
67786
+ {
67787
+ id: "720p",
67788
+ label: "720p",
67789
+ width: 1280,
67790
+ height: 720
67791
+ },
67792
+ {
67793
+ id: "1080p",
67794
+ label: "1080p",
67795
+ width: 1920,
67796
+ height: 1080
67797
+ },
67798
+ {
67799
+ id: "1440p",
67800
+ label: "1440p",
67801
+ width: 2560,
67802
+ height: 1440
67803
+ },
67804
+ {
67805
+ id: "4k",
67806
+ label: "4K",
67807
+ width: 3840,
67808
+ height: 2160
67809
+ }
67810
+ ], _O = [
67811
+ 24,
67812
+ 30,
67813
+ 60
67814
+ ], vO = [
67815
+ {
67816
+ id: "low",
67817
+ label: "Low",
67818
+ value: .5
67819
+ },
67820
+ {
67821
+ id: "medium",
67822
+ label: "Medium",
67823
+ value: .75
67824
+ },
67825
+ {
67826
+ id: "high",
67827
+ label: "High",
67828
+ value: .9
67829
+ }
67830
+ ], yO = 1e7;
67831
+ function bO(e) {
67832
+ return Math.round(Math.max(0, Math.min(1, e)) * yO);
67833
+ }
67834
+ function xO(e, t, n) {
67835
+ let r = gO.find((t) => t.id === e);
67836
+ return !r || r.width === null || r.height === null ? {
67837
+ width: t,
67838
+ height: n
67839
+ } : {
67840
+ width: r.width,
67841
+ height: r.height
67842
+ };
67843
+ }
67844
+ var SO = class {
67845
+ _element;
67846
+ _fpsSelect;
67847
+ _resolutionSelect;
67848
+ _qualitySelect;
67849
+ _defaults;
67850
+ constructor(e) {
67851
+ this._defaults = e, this._element = document.createElement("div"), Object.assign(this._element.style, {
67852
+ padding: "8px 14px",
67853
+ borderBottom: "1px solid rgba(255,255,255,0.12)",
67854
+ display: "flex",
67855
+ flexDirection: "column",
67856
+ gap: "6px"
67857
+ }), this._element.setAttribute("data-export-settings", ""), this._fpsSelect = this._buildSelect("FPS", _O.map((e) => ({
67858
+ value: String(e),
67859
+ label: `${e} fps`
67860
+ })), String(this._nearestFps(e.fps))), this._resolutionSelect = this._buildSelect("Resolution", gO.map((e) => ({
67861
+ value: e.id,
67862
+ label: e.label
67863
+ })), "current"), this._qualitySelect = this._buildSelect("Quality", vO.map((e) => ({
67864
+ value: String(e.value),
67865
+ label: e.label
67866
+ })), String(vO[vO.length - 1].value));
67867
+ }
67868
+ get element() {
67869
+ return this._element;
67870
+ }
67871
+ getSettings() {
67872
+ let e = parseInt(this._fpsSelect.value, 10), { width: t, height: n } = xO(this._resolutionSelect.value, this._defaults.width, this._defaults.height);
67873
+ return {
67874
+ fps: e,
67875
+ width: t,
67876
+ height: n,
67877
+ quality: parseFloat(this._qualitySelect.value)
67878
+ };
67879
+ }
67880
+ _nearestFps(e) {
67881
+ return _O.reduce((t, n) => Math.abs(n - e) < Math.abs(t - e) ? n : t);
67882
+ }
67883
+ _buildSelect(e, t, n) {
67884
+ let r = document.createElement("label");
67885
+ Object.assign(r.style, {
67886
+ display: "flex",
67887
+ justifyContent: "space-between",
67888
+ alignItems: "center",
67889
+ gap: "10px",
67890
+ fontSize: "12px"
67891
+ });
67892
+ let i = document.createElement("span");
67893
+ i.textContent = e, i.style.opacity = "0.7";
67894
+ let a = document.createElement("select");
67895
+ Object.assign(a.style, {
67896
+ background: "rgba(255,255,255,0.1)",
67897
+ color: "#fff",
67898
+ border: "1px solid rgba(255,255,255,0.2)",
67899
+ borderRadius: "4px",
67900
+ padding: "2px 6px",
67901
+ fontSize: "12px",
67902
+ fontFamily: "inherit",
67903
+ cursor: "pointer",
67904
+ outline: "none"
67905
+ });
67906
+ for (let e of t) {
67907
+ let t = document.createElement("option");
67908
+ t.value = e.value, t.textContent = e.label, t.style.background = "#222", t.style.color = "#fff", a.appendChild(t);
67909
+ }
67910
+ return a.value = n, a.addEventListener("click", (e) => e.stopPropagation()), r.appendChild(i), r.appendChild(a), this._element.appendChild(r), a;
67911
+ }
67912
+ }, CO = class {
67661
67913
  _container;
67662
67914
  _bar;
67663
67915
  _playBtn;
@@ -67677,6 +67929,8 @@ var sO = class {
67677
67929
  _exportBtnWrapper = null;
67678
67930
  _callbacks;
67679
67931
  _autoHideMs;
67932
+ _exportControls;
67933
+ _exportPanel = null;
67680
67934
  _hideTimeout = null;
67681
67935
  _isVisible = !0;
67682
67936
  _isDragging = !1;
@@ -67688,22 +67942,22 @@ var sO = class {
67688
67942
  _onProgressMove;
67689
67943
  _onProgressUp;
67690
67944
  constructor(e, t, n = {}) {
67691
- this._container = e, this._callbacks = t, this._autoHideMs = n.autoHideMs ?? 2500, getComputedStyle(e).position === "static" && (e.style.position = "relative"), e.style.overflow = "hidden", this._bar = this._createBar(), this._playBtn = this._createPlayBtn(), this._prevBtn = this._createNavBtn("prev"), this._nextBtn = this._createNavBtn("next");
67945
+ this._container = e, this._callbacks = t, this._autoHideMs = n.autoHideMs ?? 2500, this._exportControls = n.exportControls ?? !1, getComputedStyle(e).position === "static" && (e.style.position = "relative"), e.style.overflow = "hidden", this._bar = this._createBar(), this._playBtn = this._createPlayBtn(), this._prevBtn = this._createNavBtn("prev"), this._nextBtn = this._createNavBtn("next");
67692
67946
  let r = this._createProgressBar();
67693
67947
  this._progressWrap = r.wrap, this._progressFill = r.fill, this._segmentMarkers = r.markers, this._timeDisplay = this._createTimeDisplay(), this._speedSelect = this._createSpeedSelect(), this._fullscreenBtn = this._createFullscreenBtn(), this._slidesBtn = this._createSlidesBtn(), this._exportBtn = this._createExportBtn();
67694
- let i = cO("div", {
67948
+ let i = wO("div", {
67695
67949
  display: "flex",
67696
67950
  alignItems: "center",
67697
67951
  gap: "4px"
67698
67952
  });
67699
67953
  i.appendChild(this._prevBtn), i.appendChild(this._playBtn), i.appendChild(this._nextBtn);
67700
- let a = cO("div", {
67954
+ let a = wO("div", {
67701
67955
  display: "flex",
67702
67956
  alignItems: "center",
67703
67957
  gap: "8px"
67704
67958
  });
67705
67959
  a.appendChild(this._timeDisplay), a.appendChild(this._speedSelect), a.appendChild(this._slidesBtn), a.appendChild(this._exportBtnWrapper), a.appendChild(this._fullscreenBtn), this._bar.appendChild(this._progressWrap);
67706
- let o = cO("div", {
67960
+ let o = wO("div", {
67707
67961
  display: "flex",
67708
67962
  alignItems: "center",
67709
67963
  justifyContent: "space-between",
@@ -67718,10 +67972,10 @@ var sO = class {
67718
67972
  let n = e / t * 100;
67719
67973
  this._progressFill.style.width = `${n}%`;
67720
67974
  }
67721
- this._timeDisplay.textContent = `${uO(e)} / ${uO(t)}`;
67975
+ this._timeDisplay.textContent = `${EO(e)} / ${EO(t)}`;
67722
67976
  }
67723
67977
  setPlaying(e, t = !1) {
67724
- this._isPlaying = e, t ? (this._playBtn.innerHTML = pO, this._playBtn.title = "Replay (Space)") : (this._playBtn.innerHTML = e ? fO : dO, this._playBtn.title = e ? "Pause (Space)" : "Play (Space)"), e && this._scheduleHide();
67978
+ this._isPlaying = e, t ? (this._playBtn.innerHTML = kO, this._playBtn.title = "Replay (Space)") : (this._playBtn.innerHTML = e ? OO : DO, this._playBtn.title = e ? "Pause (Space)" : "Play (Space)"), e && this._scheduleHide();
67725
67979
  }
67726
67980
  setSlidesMode(e) {
67727
67981
  this._slidesActive = e, this._slidesBtn.style.opacity = e ? "1" : "0.4", this._slidesBtn.style.background = e ? "rgba(74,158,255,0.25)" : "none", this._slidesBtn.title = `Slides mode ${e ? "on" : "off"} (S)`;
@@ -67731,7 +67985,7 @@ var sO = class {
67731
67985
  let t = e.getSlides(), n = e.getDuration();
67732
67986
  if (!(n <= 0)) for (let e of t) {
67733
67987
  if (e.index === 0) continue;
67734
- let t = cO("div", {
67988
+ let t = wO("div", {
67735
67989
  position: "absolute",
67736
67990
  left: `${e.startTime / n * 100}%`,
67737
67991
  top: "50%",
@@ -67746,7 +68000,7 @@ var sO = class {
67746
68000
  }
67747
68001
  }
67748
68002
  _createBar() {
67749
- let e = cO("div", {
68003
+ let e = wO("div", {
67750
68004
  position: "absolute",
67751
68005
  bottom: "0",
67752
68006
  left: "0",
@@ -67764,21 +68018,21 @@ var sO = class {
67764
68018
  }
67765
68019
  _createPlayBtn() {
67766
68020
  let e = document.createElement("button");
67767
- return e.innerHTML = dO, e.title = "Play (Space)", lO(e, "36px", "36px"), e.addEventListener("click", () => this._callbacks.onPlayPause()), e;
68021
+ return e.innerHTML = DO, e.title = "Play (Space)", TO(e, "36px", "36px"), e.addEventListener("click", () => this._callbacks.onPlayPause()), e;
67768
68022
  }
67769
68023
  _createNavBtn(e) {
67770
68024
  let t = document.createElement("button");
67771
- return t.innerHTML = e === "prev" ? mO : hO, t.title = e === "prev" ? "Previous (Left arrow)" : "Next (Right arrow)", lO(t, "28px", "28px"), t.addEventListener("click", () => {
68025
+ return t.innerHTML = e === "prev" ? AO : jO, t.title = e === "prev" ? "Previous (Left arrow)" : "Next (Right arrow)", TO(t, "28px", "28px"), t.addEventListener("click", () => {
67772
68026
  e === "prev" ? this._callbacks.onPrev() : this._callbacks.onNext();
67773
68027
  }), t;
67774
68028
  }
67775
68029
  _createProgressBar() {
67776
- let e = cO("div", {
68030
+ let e = wO("div", {
67777
68031
  position: "relative",
67778
68032
  height: "16px",
67779
68033
  padding: "6px 12px",
67780
68034
  cursor: "pointer"
67781
- }), t = cO("div", {
68035
+ }), t = wO("div", {
67782
68036
  position: "absolute",
67783
68037
  left: "12px",
67784
68038
  right: "12px",
@@ -67788,14 +68042,14 @@ var sO = class {
67788
68042
  background: "rgba(255,255,255,0.2)",
67789
68043
  borderRadius: "2px",
67790
68044
  overflow: "visible"
67791
- }), n = cO("div", {
68045
+ }), n = wO("div", {
67792
68046
  width: "0%",
67793
68047
  height: "100%",
67794
68048
  background: "#4a9eff",
67795
68049
  borderRadius: "2px",
67796
68050
  transition: "none",
67797
68051
  position: "relative"
67798
- }), r = cO("div", {
68052
+ }), r = wO("div", {
67799
68053
  position: "absolute",
67800
68054
  right: "-5px",
67801
68055
  top: "50%",
@@ -67808,7 +68062,7 @@ var sO = class {
67808
68062
  transition: "transform 0.1s"
67809
68063
  });
67810
68064
  n.appendChild(r);
67811
- let i = cO("div", {
68065
+ let i = wO("div", {
67812
68066
  width: "0%",
67813
68067
  height: "100%",
67814
68068
  background: "rgba(255,255,255,0.1)",
@@ -67817,7 +68071,7 @@ var sO = class {
67817
68071
  top: "0",
67818
68072
  left: "0",
67819
68073
  pointerEvents: "none"
67820
- }), a = cO("div", {
68074
+ }), a = wO("div", {
67821
68075
  position: "absolute",
67822
68076
  top: "0",
67823
68077
  left: "0",
@@ -67842,7 +68096,7 @@ var sO = class {
67842
68096
  };
67843
68097
  }
67844
68098
  _createTimeDisplay() {
67845
- let e = cO("span", {
68099
+ let e = wO("span", {
67846
68100
  fontFamily: "\"SF Mono\", Monaco, Consolas, monospace",
67847
68101
  fontSize: "12px",
67848
68102
  opacity: "0.8",
@@ -67884,16 +68138,16 @@ var sO = class {
67884
68138
  }), e;
67885
68139
  }
67886
68140
  _createExportBtn() {
67887
- let e = cO("div", {
68141
+ let e = wO("div", {
67888
68142
  position: "relative",
67889
68143
  display: "inline-block"
67890
68144
  }), t = document.createElement("button");
67891
- return t.innerHTML = gO, t.title = "Export animation", lO(t, "28px", "28px"), t.addEventListener("click", (e) => {
68145
+ return t.innerHTML = MO, t.title = "Export animation", TO(t, "28px", "28px"), t.addEventListener("click", (e) => {
67892
68146
  e.stopPropagation(), this._exportMenu ? this._closeExportMenu() : this._showExportMenu();
67893
68147
  }), e.appendChild(t), this._exportBtnWrapper = e, t;
67894
68148
  }
67895
68149
  _showExportMenu() {
67896
- let e = this._exportBtn.getBoundingClientRect(), t = cO("div", {
68150
+ let e = this._exportBtn.getBoundingClientRect(), t = wO("div", {
67897
68151
  position: "fixed",
67898
68152
  top: "0",
67899
68153
  left: "0",
@@ -67904,7 +68158,7 @@ var sO = class {
67904
68158
  t.setAttribute("data-player-bar", ""), t.addEventListener("mousedown", (e) => {
67905
68159
  e.stopPropagation(), e.preventDefault(), this._closeExportMenu();
67906
68160
  });
67907
- let n = cO("div", {
68161
+ let n = wO("div", {
67908
68162
  position: "fixed",
67909
68163
  bottom: `${window.innerHeight - e.top + 6}px`,
67910
68164
  left: `${e.left - 60}px`,
@@ -67919,7 +68173,14 @@ var sO = class {
67919
68173
  fontFamily: "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif",
67920
68174
  fontSize: "13px"
67921
68175
  });
67922
- n.setAttribute("data-player-bar", "");
68176
+ if (n.setAttribute("data-player-bar", ""), this._exportControls) {
68177
+ let e = this._callbacks.getExportDefaults?.() ?? {
68178
+ width: 1920,
68179
+ height: 1080,
68180
+ fps: 60
68181
+ };
68182
+ this._exportPanel = new SO(e), n.appendChild(this._exportPanel.element);
68183
+ }
67923
68184
  for (let e of [
67924
68185
  {
67925
68186
  ext: "gif",
@@ -67937,7 +68198,7 @@ var sO = class {
67937
68198
  desc: "Video file"
67938
68199
  }
67939
68200
  ]) {
67940
- let t = cO("div", {
68201
+ let t = wO("div", {
67941
68202
  padding: "8px 14px",
67942
68203
  cursor: "pointer",
67943
68204
  fontSize: "13px",
@@ -67951,16 +68212,18 @@ var sO = class {
67951
68212
  }), t.addEventListener("mouseleave", () => {
67952
68213
  t.style.background = "none";
67953
68214
  }), t.addEventListener("click", (t) => {
67954
- t.stopPropagation(), this._closeExportMenu(), this._callbacks.onExport(e.ext);
68215
+ t.stopPropagation();
68216
+ let n = this._exportPanel?.getSettings();
68217
+ this._closeExportMenu(), n ? this._callbacks.onExport(e.ext, n) : this._callbacks.onExport(e.ext);
67955
68218
  }), n.appendChild(t);
67956
68219
  }
67957
68220
  this._exportMenu = n, this._exportMenuBackdrop = t, document.body.appendChild(t), document.body.appendChild(n);
67958
68221
  }
67959
68222
  _closeExportMenu() {
67960
- this._exportMenu &&= (this._exportMenuBackdrop?.remove(), this._exportMenuBackdrop = null, this._exportMenu.remove(), null);
68223
+ this._exportMenu && (this._exportMenuBackdrop?.remove(), this._exportMenuBackdrop = null, this._exportMenu.remove(), this._exportMenu = null, this._exportPanel = null);
67961
68224
  }
67962
68225
  setExportProgress(e) {
67963
- if (e === null) this._exportBtn.innerHTML = gO, this._exportBtn.disabled = !1, this._exportBtn.title = "Export animation";
68226
+ if (e === null) this._exportBtn.innerHTML = MO, this._exportBtn.disabled = !1, this._exportBtn.title = "Export animation";
67964
68227
  else {
67965
68228
  let t = Math.round(e * 100);
67966
68229
  this._exportBtn.innerHTML = `<span style="font-size:10px;font-weight:600">${t}%</span>`, this._exportBtn.disabled = !0, this._exportBtn.title = `Exporting... ${t}%`;
@@ -67968,7 +68231,7 @@ var sO = class {
67968
68231
  }
67969
68232
  _createSlidesBtn() {
67970
68233
  let e = document.createElement("button");
67971
- return e.innerHTML = _O, e.title = "Slides mode off (S)", lO(e, "28px", "28px"), e.style.opacity = "0.4", e.addEventListener("click", () => {
68234
+ return e.innerHTML = NO, e.title = "Slides mode off (S)", TO(e, "28px", "28px"), e.style.opacity = "0.4", e.addEventListener("click", () => {
67972
68235
  this._slidesActive = !this._slidesActive, this.setSlidesMode(this._slidesActive), this._callbacks.onSlidesToggle(this._slidesActive);
67973
68236
  }), e.addEventListener("mouseenter", () => {
67974
68237
  e.style.background = this._slidesActive ? "rgba(74,158,255,0.35)" : "rgba(255,255,255,0.15)";
@@ -67978,7 +68241,7 @@ var sO = class {
67978
68241
  }
67979
68242
  _createFullscreenBtn() {
67980
68243
  let e = document.createElement("button");
67981
- return e.innerHTML = vO, e.title = "Fullscreen (F)", lO(e, "28px", "28px"), e.addEventListener("click", () => this._callbacks.onFullscreen()), e;
68244
+ return e.innerHTML = PO, e.title = "Fullscreen (F)", TO(e, "28px", "28px"), e.addEventListener("click", () => this._callbacks.onFullscreen()), e;
67982
68245
  }
67983
68246
  _showControls() {
67984
68247
  this._isVisible ||= (this._bar.style.opacity = "1", this._bar.style.transform = "translateY(0)", !0), this._scheduleHide();
@@ -68033,11 +68296,11 @@ var sO = class {
68033
68296
  this._hideTimeout && clearTimeout(this._hideTimeout), this._container.removeEventListener("mousemove", this._onMouseMove), this._container.removeEventListener("mouseleave", this._onMouseLeave), this._progressWrap.removeEventListener("mousedown", this._onProgressDown), document.removeEventListener("mousemove", this._onProgressMove), document.removeEventListener("mouseup", this._onProgressUp), this._bar.remove();
68034
68297
  }
68035
68298
  };
68036
- function cO(e, t) {
68299
+ function wO(e, t) {
68037
68300
  let n = document.createElement(e);
68038
68301
  return Object.assign(n.style, t), n;
68039
68302
  }
68040
- function lO(e, t, n) {
68303
+ function TO(e, t, n) {
68041
68304
  Object.assign(e.style, {
68042
68305
  width: t,
68043
68306
  height: n,
@@ -68058,11 +68321,11 @@ function lO(e, t, n) {
68058
68321
  e.style.background = "none";
68059
68322
  });
68060
68323
  }
68061
- function uO(e) {
68324
+ function EO(e) {
68062
68325
  let t = Math.floor(e / 60), n = Math.floor(e % 60);
68063
68326
  return `${t}:${String(n).padStart(2, "0")}`;
68064
68327
  }
68065
- var dO = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"currentColor\"><path d=\"M5 3l10 6-10 6V3z\"/></svg>", fO = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"currentColor\"><rect x=\"4\" y=\"3\" width=\"3.5\" height=\"12\" rx=\"0.5\"/><rect x=\"10.5\" y=\"3\" width=\"3.5\" height=\"12\" rx=\"0.5\"/></svg>", pO = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"currentColor\"><path d=\"M9 3a6 6 0 1 0 6 6h-2a4 4 0 1 1-4-4v3l4-3.5L9 1v2z\"/></svg>", mO = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><rect x=\"2\" y=\"3\" width=\"2\" height=\"10\"/><path d=\"M14 3L6 8l8 5V3z\"/></svg>", hO = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><rect x=\"12\" y=\"3\" width=\"2\" height=\"10\"/><path d=\"M2 3l8 5-8 5V3z\"/></svg>", gO = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M8 1L8 10M8 10L5 7M8 10L11 7\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M3 12v1h10v-1\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\" stroke-linecap=\"round\"/></svg>", _O = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><rect x=\"1\" y=\"2\" width=\"14\" height=\"10\" rx=\"1.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"/><path d=\"M5 14h6\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/><path d=\"M6 6l5 3-5 3V6z\"/></svg>", vO = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M2 2h4v2H4v2H2V2zm8 0h4v4h-2V4h-2V2zM2 10h2v2h2v2H2v-4zm10 2h-2v2h4v-4h-2v2z\"/></svg>", yO = class {
68328
+ var DO = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"currentColor\"><path d=\"M5 3l10 6-10 6V3z\"/></svg>", OO = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"currentColor\"><rect x=\"4\" y=\"3\" width=\"3.5\" height=\"12\" rx=\"0.5\"/><rect x=\"10.5\" y=\"3\" width=\"3.5\" height=\"12\" rx=\"0.5\"/></svg>", kO = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"currentColor\"><path d=\"M9 3a6 6 0 1 0 6 6h-2a4 4 0 1 1-4-4v3l4-3.5L9 1v2z\"/></svg>", AO = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><rect x=\"2\" y=\"3\" width=\"2\" height=\"10\"/><path d=\"M14 3L6 8l8 5V3z\"/></svg>", jO = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><rect x=\"12\" y=\"3\" width=\"2\" height=\"10\"/><path d=\"M2 3l8 5-8 5V3z\"/></svg>", MO = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M8 1L8 10M8 10L5 7M8 10L11 7\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M3 12v1h10v-1\" stroke=\"currentColor\" stroke-width=\"1.5\" fill=\"none\" stroke-linecap=\"round\"/></svg>", NO = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><rect x=\"1\" y=\"2\" width=\"14\" height=\"10\" rx=\"1.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"/><path d=\"M5 14h6\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\"/><path d=\"M6 6l5 3-5 3V6z\"/></svg>", PO = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M2 2h4v2H4v2H2V2zm8 0h4v4h-2V4h-2V2zM2 10h2v2h2v2H2v-4zm10 2h-2v2h4v-4h-2v2z\"/></svg>", FO = class {
68066
68329
  _container;
68067
68330
  _callbacks;
68068
68331
  _onKeyDown;
@@ -68092,7 +68355,7 @@ var dO = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"currentCo
68092
68355
  dispose() {
68093
68356
  this._container.removeEventListener("keydown", this._onKeyDown);
68094
68357
  }
68095
- }, bO = class {
68358
+ }, IO = class {
68096
68359
  _realScene;
68097
68360
  _masterTimeline;
68098
68361
  constructor(e, t) {
@@ -68129,7 +68392,52 @@ var dO = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"currentCo
68129
68392
  for (let n of e) t.push(n), n instanceof rg && t.push(...this._collectAll(n.animations));
68130
68393
  return t;
68131
68394
  }
68132
- }, xO = class {
68395
+ }, LO = [
68396
+ "mousedown",
68397
+ "mousemove",
68398
+ "mouseup",
68399
+ "click",
68400
+ "touchstart",
68401
+ "touchmove",
68402
+ "touchend"
68403
+ ], RO = class {
68404
+ _target;
68405
+ _scene;
68406
+ _isIdle;
68407
+ _onEvent;
68408
+ _attached = !1;
68409
+ _renderScheduled = !1;
68410
+ _renderCount = 0;
68411
+ constructor(e, t, n) {
68412
+ this._target = e, this._scene = t, this._isIdle = n, this._onEvent = () => this._handleEvent();
68413
+ }
68414
+ get isAttached() {
68415
+ return this._attached;
68416
+ }
68417
+ get renderCount() {
68418
+ return this._renderCount;
68419
+ }
68420
+ attach() {
68421
+ if (!this._attached) {
68422
+ for (let e of LO) this._target.addEventListener(e, this._onEvent);
68423
+ this._attached = !0;
68424
+ }
68425
+ }
68426
+ dispose() {
68427
+ if (this._attached) {
68428
+ for (let e of LO) this._target.removeEventListener(e, this._onEvent);
68429
+ this._attached = !1, this._renderScheduled = !1;
68430
+ }
68431
+ }
68432
+ _handleEvent() {
68433
+ this._isIdle() && this._scheduleRender();
68434
+ }
68435
+ _scheduleRender() {
68436
+ this._renderScheduled || (this._renderScheduled = !0, queueMicrotask(() => {
68437
+ this._renderScheduled = !1, !(!this._attached || !this._isIdle()) && (this._scene.render(), this._renderCount++);
68438
+ }));
68439
+ }
68440
+ }, zO = class {
68133
68441
  _scene;
68134
68442
  _masterTimeline;
68135
68443
  _ui;
@@ -68142,22 +68450,34 @@ var dO = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"currentCo
68142
68450
  _loop;
68143
68451
  _autoPlay;
68144
68452
  _slidesMode;
68453
+ _interactiveSlides;
68454
+ _slideInteraction = null;
68455
+ _exportControls;
68456
+ _exportFps;
68145
68457
  _slidesTargetSlideIndex = -1;
68146
68458
  _activeLoopSlideIndex = null;
68147
68459
  _origWidth = 0;
68148
68460
  _origHeight = 0;
68149
68461
  _onFullscreenChange;
68150
68462
  constructor(e, t = {}) {
68151
- this._container = e, this._loop = t.loop ?? !1, this._autoPlay = t.autoPlay ?? !1, this._slidesMode = t.slidesMode ?? !1, this._scene = new _g(e, t), this._masterTimeline = new vw(), this._ui = new sO(e, {
68463
+ this._container = e, this._loop = t.loop ?? !1, this._autoPlay = t.autoPlay ?? !1, this._slidesMode = t.slidesMode ?? !1, this._interactiveSlides = t.interactiveSlides ?? !1, this._exportControls = t.exportControls ?? !1, this._exportFps = t.targetFps ?? 60, this._scene = new _g(e, t), this._masterTimeline = new vw(), this._ui = new CO(e, {
68152
68464
  onPlayPause: () => this.togglePlayPause(),
68153
68465
  onSeek: (e) => this.seek(e),
68154
68466
  onPrev: () => this.prevSegment(),
68155
68467
  onNext: () => this.nextSegment(),
68156
68468
  onSpeedChange: (e) => this.setPlaybackRate(e),
68157
68469
  onFullscreen: () => this.toggleFullscreen(),
68158
- onExport: (e) => this.exportAs(e),
68159
- onSlidesToggle: (e) => this.setSlidesMode(e)
68160
- }, { autoHideMs: t.autoHideMs }), this._ui.setSlidesMode(this._slidesMode), this._ui.enableScrollScrub(() => this._masterTimeline.getCurrentTime()), this._controller = new yO(e, {
68470
+ onExport: (e, t) => this.exportAs(e, t),
68471
+ onSlidesToggle: (e) => this.setSlidesMode(e),
68472
+ getExportDefaults: () => ({
68473
+ width: this._scene.getWidth(),
68474
+ height: this._scene.getHeight(),
68475
+ fps: this._exportFps
68476
+ })
68477
+ }, {
68478
+ autoHideMs: t.autoHideMs,
68479
+ exportControls: this._exportControls
68480
+ }), this._ui.setSlidesMode(this._slidesMode), this._ui.enableScrollScrub(() => this._masterTimeline.getCurrentTime()), this._controller = new FO(e, {
68161
68481
  onPlayPause: () => this.togglePlayPause(),
68162
68482
  onPrev: () => this.prevSegment(),
68163
68483
  onNext: () => this.nextSegment(),
@@ -68168,10 +68488,13 @@ var dO = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"currentCo
68168
68488
  getDuration: () => this._masterTimeline.getDuration()
68169
68489
  }), this._onFullscreenChange = () => {
68170
68490
  document.fullscreenElement === this._container ? this._scene.resize(window.innerWidth, window.innerHeight) : this._origWidth > 0 && this._origHeight > 0 && this._scene.resize(this._origWidth, this._origHeight), this._scene.render();
68171
- }, document.addEventListener("fullscreenchange", this._onFullscreenChange);
68491
+ }, document.addEventListener("fullscreenchange", this._onFullscreenChange), this._interactiveSlides && this._enableSlideInteraction();
68492
+ }
68493
+ _enableSlideInteraction() {
68494
+ this._slideInteraction || (this._slideInteraction = new RO(this._container, this._scene, () => !this._isPlaying), this._slideInteraction.attach());
68172
68495
  }
68173
68496
  async sequence(e) {
68174
- this._masterTimeline = new vw(), this._activeLoopSlideIndex = null, this._slidesTargetSlideIndex = -1, await e(new bO(this._scene, this._masterTimeline)), this._masterTimeline.finalizeSlides(), this._scene.setTimeline(this._masterTimeline), this._masterTimeline.seek(0), this._scene.render(), this._ui.setSegments(this._masterTimeline), this._ui.updateTime(0, this._masterTimeline.getDuration()), this._autoPlay && this.play();
68497
+ this._masterTimeline = new vw(), this._activeLoopSlideIndex = null, this._slidesTargetSlideIndex = -1, await e(new IO(this._scene, this._masterTimeline)), this._masterTimeline.finalizeSlides(), this._scene.setTimeline(this._masterTimeline), this._masterTimeline.seek(0), this._scene.render(), this._ui.setSegments(this._masterTimeline), this._ui.updateTime(0, this._masterTimeline.getDuration()), this._autoPlay && this.play();
68175
68498
  }
68176
68499
  get scene() {
68177
68500
  return this._scene;
@@ -68270,23 +68593,44 @@ var dO = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"currentCo
68270
68593
  setSlidesMode(e) {
68271
68594
  this._slidesMode = e, this._ui.setSlidesMode(e), e || (this._activeLoopSlideIndex = null, this._slidesTargetSlideIndex = -1);
68272
68595
  }
68273
- async exportAs(e) {
68274
- let t = this._isPlaying, n = this._masterTimeline.getCurrentTime();
68275
- t && this.pause();
68276
- let r = `animation.${e}`;
68596
+ get interactiveSlides() {
68597
+ return this._interactiveSlides;
68598
+ }
68599
+ setInteractiveSlides(e) {
68600
+ this._interactiveSlides = e, e ? this._enableSlideInteraction() : this._slideInteraction &&= (this._slideInteraction.dispose(), null);
68601
+ }
68602
+ async exportAs(e, t) {
68603
+ let n = this._isPlaying, r = this._masterTimeline.getCurrentTime();
68604
+ n && this.pause();
68605
+ let a = `animation.${e}`, o = this._masterTimeline.getDuration(), s = (e) => this._ui.setExportProgress(e);
68277
68606
  this._ui.setExportProgress(0);
68278
68607
  try {
68279
- await this._scene.export(r, {
68280
- duration: this._masterTimeline.getDuration(),
68281
- width: this._scene.getWidth(),
68282
- height: this._scene.getHeight(),
68283
- onProgress: (e) => this._ui.setExportProgress(e)
68284
- });
68608
+ (e === "webm" || e === "mp4") && hO() === "webcodecs" ? await this._exportWithWebCodecs(e === "mp4" ? "mp4" : "webm", t, o, s, a) : await this._scene.export(a, this._buildSceneExportOptions(e, t, o, s));
68285
68609
  } catch (e) {
68286
68610
  i.error("Export failed:", e), this._ui.showError(`Export failed: ${e instanceof Error ? e.message : "Unknown error"}`);
68287
68611
  } finally {
68288
- this._ui.setExportProgress(null), this.seek(n), t && this.play();
68289
- }
68612
+ this._ui.setExportProgress(null), this.seek(r), n && this.play();
68613
+ }
68614
+ }
68615
+ async _exportWithWebCodecs(e, t, n, r, i) {
68616
+ uO(await new pO(this._scene, {
68617
+ format: e,
68618
+ fps: t?.fps ?? this._exportFps,
68619
+ width: t?.width ?? this._scene.getWidth(),
68620
+ height: t?.height ?? this._scene.getHeight(),
68621
+ bitrate: bO(t?.quality ?? .9),
68622
+ duration: n,
68623
+ onProgress: r
68624
+ }).export(), i);
68625
+ }
68626
+ _buildSceneExportOptions(e, t, n, r) {
68627
+ let i = {
68628
+ duration: n,
68629
+ width: this._scene.getWidth(),
68630
+ height: this._scene.getHeight(),
68631
+ onProgress: r
68632
+ };
68633
+ return t ? (i.width = t.width, i.height = t.height, i.fps = t.fps, e !== "gif" && (i.quality = t.quality), i) : i;
68290
68634
  }
68291
68635
  toggleFullscreen() {
68292
68636
  document.fullscreenElement === this._container ? document.exitFullscreen() : (this._origWidth = this._scene.getWidth(), this._origHeight = this._scene.getHeight(), this._container.requestFullscreen().catch(() => {
@@ -68294,7 +68638,7 @@ var dO = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"currentCo
68294
68638
  }));
68295
68639
  }
68296
68640
  dispose() {
68297
- this._stopLoop(), document.removeEventListener("fullscreenchange", this._onFullscreenChange), this._ui.dispose(), this._controller.dispose(), this._scene.dispose();
68641
+ this._stopLoop(), this._slideInteraction?.dispose(), this._slideInteraction = null, document.removeEventListener("fullscreenchange", this._onFullscreenChange), this._ui.dispose(), this._controller.dispose(), this._scene.dispose();
68298
68642
  }
68299
68643
  _startLoop() {
68300
68644
  if (this._animFrameId !== null) return;
@@ -68335,31 +68679,31 @@ var dO = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"currentCo
68335
68679
  _stopLoop() {
68336
68680
  this._animFrameId !== null && (cancelAnimationFrame(this._animFrameId), this._animFrameId = null);
68337
68681
  }
68338
- }, SO = {
68682
+ }, BO = {
68339
68683
  EXPERIMENTAL_3D_LIGHTING: !1,
68340
68684
  WEBGPU_RENDERER: !1,
68341
68685
  ADVANCED_TEXT_LAYOUT: !1
68342
- }, CO = { ...SO };
68343
- function wO(e) {
68344
- return CO[e] ?? !1;
68686
+ }, VO = { ...BO };
68687
+ function HO(e) {
68688
+ return VO[e] ?? !1;
68345
68689
  }
68346
- function TO(e) {
68347
- CO = {
68348
- ...CO,
68690
+ function UO(e) {
68691
+ VO = {
68692
+ ...VO,
68349
68693
  ...e
68350
68694
  };
68351
68695
  }
68352
- function EO() {
68353
- CO = { ...SO };
68696
+ function WO() {
68697
+ VO = { ...BO };
68354
68698
  }
68355
- function DO() {
68356
- return { ...CO };
68699
+ function GO() {
68700
+ return { ...VO };
68357
68701
  }
68358
68702
  //#endregion
68359
68703
  //#region src/utils/color.ts
68360
- var OO = /(?:#|0[xX])([A-Fa-f0-9]{3,8})/;
68361
- function kO(e) {
68362
- let t = OO.exec(e);
68704
+ var KO = /(?:#|0[xX])([A-Fa-f0-9]{3,8})/;
68705
+ function qO(e) {
68706
+ let t = KO.exec(e);
68363
68707
  if (t === null) throw Error(`Failed to parse a color from "${e}"`);
68364
68708
  let n = t[1];
68365
68709
  if ((n.length === 3 || n.length === 4) && (n = n.split("").map((e) => e + e).join("")), n.length === 6) n += "FF";
@@ -68371,26 +68715,26 @@ function kO(e) {
68371
68715
  parseInt(n.slice(6, 8), 16) / 255
68372
68716
  ];
68373
68717
  }
68374
- function AO(e) {
68718
+ function JO(e) {
68375
68719
  let t = Math.trunc(e * 255);
68376
68720
  return Math.min(255, Math.max(0, t)).toString(16).toUpperCase().padStart(2, "0");
68377
68721
  }
68378
- function jO(e) {
68379
- return `#${AO(e[0])}${AO(e[1])}${AO(e[2])}`;
68722
+ function YO(e) {
68723
+ return `#${JO(e[0])}${JO(e[1])}${JO(e[2])}`;
68380
68724
  }
68381
- function MO(e) {
68382
- let [t, n, r] = kO(e);
68725
+ function XO(e) {
68726
+ let [t, n, r] = qO(e);
68383
68727
  return [
68384
68728
  t,
68385
68729
  n,
68386
68730
  r
68387
68731
  ];
68388
68732
  }
68389
- function NO(e) {
68390
- return MO(e);
68733
+ function ZO(e) {
68734
+ return XO(e);
68391
68735
  }
68392
- function PO(e, t = 1) {
68393
- let [n, r, i] = NO(e);
68736
+ function QO(e, t = 1) {
68737
+ let [n, r, i] = ZO(e);
68394
68738
  return [
68395
68739
  n,
68396
68740
  r,
@@ -68398,16 +68742,16 @@ function PO(e, t = 1) {
68398
68742
  t
68399
68743
  ];
68400
68744
  }
68401
- function FO(e) {
68402
- let [t, n, r] = NO(e);
68745
+ function $O(e) {
68746
+ let [t, n, r] = ZO(e);
68403
68747
  return [
68404
68748
  Math.trunc(t * 255),
68405
68749
  Math.trunc(n * 255),
68406
68750
  Math.trunc(r * 255)
68407
68751
  ];
68408
68752
  }
68409
- function IO(e, t = 1) {
68410
- let [n, r, i] = FO(e);
68753
+ function ek(e, t = 1) {
68754
+ let [n, r, i] = $O(e);
68411
68755
  return [
68412
68756
  n,
68413
68757
  r,
@@ -68415,33 +68759,33 @@ function IO(e, t = 1) {
68415
68759
  Math.trunc(t * 255)
68416
68760
  ];
68417
68761
  }
68418
- function LO(e) {
68419
- return jO(e);
68762
+ function tk(e) {
68763
+ return YO(e);
68420
68764
  }
68421
- function RO(e) {
68422
- return jO([
68765
+ function nk(e) {
68766
+ return YO([
68423
68767
  e[0],
68424
68768
  e[1],
68425
68769
  e[2]
68426
68770
  ]);
68427
68771
  }
68428
- function zO(e) {
68429
- let [t, n, r] = NO(e);
68430
- return jO([
68772
+ function rk(e) {
68773
+ let [t, n, r] = ZO(e);
68774
+ return YO([
68431
68775
  1 - t,
68432
68776
  1 - n,
68433
68777
  1 - r
68434
68778
  ]);
68435
68779
  }
68436
- function BO(e, t, n) {
68437
- let r = NO(e), i = NO(t);
68438
- return jO([
68780
+ function ik(e, t, n) {
68781
+ let r = ZO(e), i = ZO(t);
68782
+ return YO([
68439
68783
  r[0] * (1 - n) + i[0] * n,
68440
68784
  r[1] * (1 - n) + i[1] * n,
68441
68785
  r[2] * (1 - n) + i[2] * n
68442
68786
  ]);
68443
68787
  }
68444
- function VO(...e) {
68788
+ function ak(...e) {
68445
68789
  if (e.length === 0) throw Error("Expected 1 or more colors. Got 0 colors.");
68446
68790
  let t = [
68447
68791
  0,
@@ -68449,29 +68793,29 @@ function VO(...e) {
68449
68793
  0
68450
68794
  ];
68451
68795
  for (let n of e) {
68452
- let [e, r, i] = NO(n);
68796
+ let [e, r, i] = ZO(n);
68453
68797
  t[0] += e, t[1] += r, t[2] += i;
68454
68798
  }
68455
68799
  let n = e.length;
68456
- return jO([
68800
+ return YO([
68457
68801
  t[0] / n,
68458
68802
  t[1] / n,
68459
68803
  t[2] / n
68460
68804
  ]);
68461
68805
  }
68462
- var HO = Array.from(new Set(Object.values(se)));
68463
- function UO() {
68464
- return HO[Math.floor(Math.random() * HO.length)];
68806
+ var ok = Array.from(new Set(Object.values(se)));
68807
+ function sk() {
68808
+ return ok[Math.floor(Math.random() * ok.length)];
68465
68809
  }
68466
- function WO() {
68467
- let [e, t, n] = NO(UO());
68468
- return jO([
68810
+ function ck() {
68811
+ let [e, t, n] = ZO(sk());
68812
+ return YO([
68469
68813
  .5 * (e + 1),
68470
68814
  .5 * (t + 1),
68471
68815
  .5 * (n + 1)
68472
68816
  ]);
68473
68817
  }
68474
- function GO(e) {
68818
+ function lk(e) {
68475
68819
  let [t, n, r] = e;
68476
68820
  if (n === 0) return [
68477
68821
  r,
@@ -68512,7 +68856,7 @@ function GO(e) {
68512
68856
  ];
68513
68857
  }
68514
68858
  }
68515
- function KO(e) {
68859
+ function uk(e) {
68516
68860
  let [t, n, r] = e, i = Math.max(t, n, r), a = Math.min(t, n, r), o = i;
68517
68861
  if (a === i) return [
68518
68862
  0,
@@ -68528,14 +68872,14 @@ function KO(e) {
68528
68872
  }
68529
68873
  //#endregion
68530
68874
  //#region src/utils/ManimColor.ts
68531
- var qO = /(?:#|0[xX])([A-Fa-f0-9]{3,8})/;
68532
- function JO(e) {
68875
+ var dk = /(?:#|0[xX])([A-Fa-f0-9]{3,8})/;
68876
+ function fk(e) {
68533
68877
  return Math.min(255, Math.max(0, Math.trunc(e * 255)));
68534
68878
  }
68535
- function YO(e) {
68536
- return JO(e).toString(16).toUpperCase().padStart(2, "0");
68879
+ function pk(e) {
68880
+ return fk(e).toString(16).toUpperCase().padStart(2, "0");
68537
68881
  }
68538
- function XO(e, t) {
68882
+ function mk(e, t) {
68539
68883
  let n = e;
68540
68884
  (n.length === 3 || n.length === 4) && (n = n.split("").map((e) => e + e).join(""));
68541
68885
  let r = t;
@@ -68548,14 +68892,14 @@ function XO(e, t) {
68548
68892
  r
68549
68893
  ];
68550
68894
  }
68551
- function ZO(e, t) {
68552
- let n = qO.exec(e);
68553
- if (n !== null) return XO(n[1], t);
68895
+ function hk(e, t) {
68896
+ let n = dk.exec(e);
68897
+ if (n !== null) return mk(n[1], t);
68554
68898
  let r = se[e.toUpperCase()];
68555
- if (typeof r == "string") return ZO(r, t);
68899
+ if (typeof r == "string") return hk(r, t);
68556
68900
  throw Error(`Failed to parse a color from "${e}"`);
68557
68901
  }
68558
- function QO(e, t) {
68902
+ function gk(e, t) {
68559
68903
  return [
68560
68904
  (e >> 16 & 255) / 255,
68561
68905
  (e >> 8 & 255) / 255,
@@ -68563,7 +68907,7 @@ function QO(e, t) {
68563
68907
  t
68564
68908
  ];
68565
68909
  }
68566
- var $O = class e {
68910
+ var _k = class e {
68567
68911
  value;
68568
68912
  constructor(t, n = 1) {
68569
68913
  if (t === null) this.value = [
@@ -68580,8 +68924,8 @@ var $O = class e {
68580
68924
  e[2],
68581
68925
  e[3]
68582
68926
  ];
68583
- } else if (typeof t == "number") this.value = QO(t, n);
68584
- else if (typeof t == "string") this.value = ZO(t, n);
68927
+ } else if (typeof t == "number") this.value = gk(t, n);
68928
+ else if (typeof t == "string") this.value = hk(t, n);
68585
68929
  else if (t.length === 3) this.value = [
68586
68930
  t[0],
68587
68931
  t[1],
@@ -68639,30 +68983,30 @@ var $O = class e {
68639
68983
  toIntRgb() {
68640
68984
  let e = this.internalRgba();
68641
68985
  return [
68642
- JO(e[0]),
68643
- JO(e[1]),
68644
- JO(e[2])
68986
+ fk(e[0]),
68987
+ fk(e[1]),
68988
+ fk(e[2])
68645
68989
  ];
68646
68990
  }
68647
68991
  toIntRgba() {
68648
68992
  let e = this.internalRgba();
68649
68993
  return [
68650
- JO(e[0]),
68651
- JO(e[1]),
68652
- JO(e[2]),
68653
- JO(e[3])
68994
+ fk(e[0]),
68995
+ fk(e[1]),
68996
+ fk(e[2]),
68997
+ fk(e[3])
68654
68998
  ];
68655
68999
  }
68656
69000
  toHex(e = !1) {
68657
- let t = this.internalRgba(), n = jO([
69001
+ let t = this.internalRgba(), n = YO([
68658
69002
  t[0],
68659
69003
  t[1],
68660
69004
  t[2]
68661
69005
  ]);
68662
- return e ? n + YO(t[3]) : n;
69006
+ return e ? n + pk(t[3]) : n;
68663
69007
  }
68664
69008
  toHsv() {
68665
- return KO(this.toRgb());
69009
+ return uk(this.toRgb());
68666
69010
  }
68667
69011
  interpolate(e, t) {
68668
69012
  let n = this.getSpace(), r = e.getSpace();
@@ -68714,12 +69058,12 @@ var $O = class e {
68714
69058
  return new e(t, n);
68715
69059
  }
68716
69060
  static fromHsv(t, n = 1) {
68717
- return new e(GO(t), n);
69061
+ return new e(lk(t), n);
68718
69062
  }
68719
69063
  static parse(t, n = 1) {
68720
69064
  return Array.isArray(t) && t.some((e) => typeof e != "number") ? t.map((t) => new e(t, n)) : new e(t, n);
68721
69065
  }
68722
- }, ek = $O, tk = class e extends $O {
69066
+ }, vk = _k, yk = class e extends _k {
68723
69067
  hsva;
68724
69068
  constructor(e, t = 1) {
68725
69069
  if (super(null), e.length === 3) this.hsva = [
@@ -68737,7 +69081,7 @@ var $O = class e {
68737
69081
  else throw Error("HSV color must be an array of 3 or 4 values");
68738
69082
  }
68739
69083
  internalRgba() {
68740
- let e = GO([
69084
+ let e = lk([
68741
69085
  this.hsva[0],
68742
69086
  this.hsva[1],
68743
69087
  this.hsva[2]
@@ -68766,7 +69110,7 @@ var $O = class e {
68766
69110
  ]);
68767
69111
  }
68768
69112
  fromInternal(t) {
68769
- let n = KO([
69113
+ let n = uk([
68770
69114
  t[0],
68771
69115
  t[1],
68772
69116
  t[2]
@@ -68788,7 +69132,7 @@ var $O = class e {
68788
69132
  return this.hsva[2];
68789
69133
  }
68790
69134
  };
68791
- function nk(e) {
69135
+ function bk(e) {
68792
69136
  let t = e >>> 0;
68793
69137
  return () => {
68794
69138
  t = t + 1831565813 | 0;
@@ -68796,18 +69140,18 @@ function nk(e) {
68796
69140
  return e = e + Math.imul(e ^ e >>> 7, 61 | e) ^ e, ((e ^ e >>> 14) >>> 0) / 4294967296;
68797
69141
  };
68798
69142
  }
68799
- var rk = Array.from(new Set(Object.values(se))).map((e) => new $O(e)), ik = class {
69143
+ var xk = Array.from(new Set(Object.values(se))).map((e) => new _k(e)), Sk = class {
68800
69144
  rng;
68801
69145
  colors;
68802
69146
  constructor(e, t) {
68803
- this.rng = e === void 0 ? Math.random : nk(e), this.colors = t === void 0 ? rk : t.map((e) => e instanceof $O ? e : new $O(e));
69147
+ this.rng = e === void 0 ? Math.random : bk(e), this.colors = t === void 0 ? xk : t.map((e) => e instanceof _k ? e : new _k(e));
68804
69148
  }
68805
69149
  next() {
68806
69150
  let e = Math.floor(this.rng() * this.colors.length);
68807
69151
  return this.colors[e];
68808
69152
  }
68809
69153
  };
68810
- function ak(e, t, n, r) {
69154
+ function Ck(e, t, n, r) {
68811
69155
  let i = .5 * Fn(n, Rn([
68812
69156
  r[0] - t[0],
68813
69157
  r[1] - t[1],
@@ -68821,7 +69165,7 @@ function ak(e, t, n, r) {
68821
69165
  }
68822
69166
  //#endregion
68823
69167
  //#region src/utils/iterables.ts
68824
- function ok(e, t) {
69168
+ function wk(e, t) {
68825
69169
  let n = e.length;
68826
69170
  if (n === 0) return [];
68827
69171
  let r = [];
@@ -68832,10 +69176,10 @@ function ok(e, t) {
68832
69176
  }
68833
69177
  return r;
68834
69178
  }
68835
- function sk(e) {
68836
- return ok(e, 2);
69179
+ function Tk(e) {
69180
+ return wk(e, 2);
68837
69181
  }
68838
- function ck(e) {
69182
+ function Ek(e) {
68839
69183
  let t = [], n = /* @__PURE__ */ new Set();
68840
69184
  for (let r = e.length - 1; r >= 0; r--) {
68841
69185
  let i = e[r];
@@ -68843,7 +69187,7 @@ function ck(e) {
68843
69187
  }
68844
69188
  return t.reverse(), t;
68845
69189
  }
68846
- function lk(e, t, n) {
69190
+ function Dk(e, t, n) {
68847
69191
  if (n === void 0) {
68848
69192
  let n = new Set(t);
68849
69193
  return e.filter((e) => !n.has(e));
@@ -68851,29 +69195,29 @@ function lk(e, t, n) {
68851
69195
  let r = new Set(t.map((e) => n(e)));
68852
69196
  return e.filter((e) => !r.has(n(e)));
68853
69197
  }
68854
- function uk(e, t, n) {
68855
- return lk(e, t, n).concat(t);
69198
+ function Ok(e, t, n) {
69199
+ return Dk(e, t, n).concat(t);
68856
69200
  }
68857
- function dk(e) {
69201
+ function kk(e) {
68858
69202
  return typeof e == "string" ? [e] : typeof e == "object" && e && Symbol.iterator in e ? [...e] : [e];
68859
69203
  }
68860
- function fk(e, t) {
69204
+ function Ak(e, t) {
68861
69205
  let n = e.length, r = t.length, i = Math.max(n, r), a = [], o = [];
68862
69206
  for (let s = 0; s < i; s++) a.push(e[Math.floor(s * n / i)]), o.push(t[Math.floor(s * r / i)]);
68863
69207
  return [a, o];
68864
69208
  }
68865
- function pk(e, t) {
69209
+ function jk(e, t) {
68866
69210
  let n = e.length;
68867
69211
  if (n > t) throw Error("Trying to stretch array to a length shorter than its own");
68868
69212
  let r = [];
68869
69213
  for (let i = 0; i < t; i++) r.push(e[Math.floor(i / t * n)]);
68870
69214
  return r;
68871
69215
  }
68872
- function* mk(...e) {
69216
+ function* Mk(...e) {
68873
69217
  let t = /* @__PURE__ */ new Set();
68874
69218
  for (let n of e) for (let e of n) t.has(e) || (t.add(e), yield e);
68875
69219
  }
68876
- function hk(e) {
69220
+ function Nk(e) {
68877
69221
  let t = [[]];
68878
69222
  for (let n of e) {
68879
69223
  let e = t.length;
@@ -68881,82 +69225,82 @@ function hk(e) {
68881
69225
  }
68882
69226
  return t;
68883
69227
  }
68884
- function gk(e, t) {
69228
+ function Pk(e, t) {
68885
69229
  for (let n of e) if (!(n instanceof t)) return !1;
68886
69230
  return !0;
68887
69231
  }
68888
- function _k(...e) {
69232
+ function Fk(...e) {
68889
69233
  let t = [];
68890
69234
  for (let n of e) for (let e of n) t.push(e);
68891
69235
  return t;
68892
69236
  }
68893
- function vk(e) {
69237
+ function Ik(e) {
68894
69238
  return typeof e == "string" ? [e] : typeof e == "object" && e && Symbol.iterator in e ? [...e] : [e];
68895
69239
  }
68896
- function yk(e) {
69240
+ function Lk(e) {
68897
69241
  let t = [];
68898
69242
  for (let n of e) n && t.push(n);
68899
69243
  return t;
68900
69244
  }
68901
- function bk(e, t) {
69245
+ function Rk(e, t) {
68902
69246
  let n = Math.max(e.length, t.length), r = [], i = [];
68903
69247
  for (let a = 0; a < n; a++) r.push(e[a % e.length]), i.push(t[a % t.length]);
68904
69248
  return [r, i];
68905
69249
  }
68906
- function xk(e) {
68907
- return Ck(Sk(e));
69250
+ function zk(e) {
69251
+ return Vk(Bk(e));
68908
69252
  }
68909
- function Sk(e) {
69253
+ function Bk(e) {
68910
69254
  if (e === null) return "null";
68911
69255
  if (e === void 0) return "undefined";
68912
69256
  let t = typeof e;
68913
69257
  if (t === "string") return `s:${e}`;
68914
69258
  if (t === "number" || t === "boolean" || t === "bigint") return `${t[0]}:${String(e)}`;
68915
- if (e instanceof Set) return `set:[${[...e].map(Sk).sort().join(",")}]`;
68916
- if (e instanceof Map) return `map:{${[...e.entries()].map(([e, t]) => `${Sk(e)}=${Sk(t)}`).sort().join(",")}}`;
68917
- if (Array.isArray(e)) return `arr:[${e.map(Sk).join(",")}]`;
69259
+ if (e instanceof Set) return `set:[${[...e].map(Bk).sort().join(",")}]`;
69260
+ if (e instanceof Map) return `map:{${[...e.entries()].map(([e, t]) => `${Bk(e)}=${Bk(t)}`).sort().join(",")}}`;
69261
+ if (Array.isArray(e)) return `arr:[${e.map(Bk).join(",")}]`;
68918
69262
  if (t === "object") {
68919
69263
  let t = e;
68920
- return `obj:{${Object.keys(t).sort().map((e) => `${e}=${Sk(t[e])}`).join(",")}}`;
69264
+ return `obj:{${Object.keys(t).sort().map((e) => `${e}=${Bk(t[e])}`).join(",")}}`;
68921
69265
  }
68922
69266
  return `${t}:${String(e)}`;
68923
69267
  }
68924
- function Ck(e) {
69268
+ function Vk(e) {
68925
69269
  let t = 2166136261;
68926
69270
  for (let n = 0; n < e.length; n++) t ^= e.charCodeAt(n), t = Math.imul(t, 16777619);
68927
69271
  return t >>> 0;
68928
69272
  }
68929
69273
  //#endregion
68930
69274
  //#region src/utils/unit.ts
68931
- function wk(e) {
69275
+ function Hk(e) {
68932
69276
  return e * Zt / $t;
68933
69277
  }
68934
- function Tk(e) {
69278
+ function Uk(e) {
68935
69279
  return e * Math.PI / 180;
68936
69280
  }
68937
- function Ek(e) {
69281
+ function Wk(e) {
68938
69282
  return e;
68939
69283
  }
68940
- function Dk(e, t) {
69284
+ function Gk(e, t) {
68941
69285
  return e[0] === t[0] && e[1] === t[1] && e[2] === t[2];
68942
69286
  }
68943
- function Ok(e, t) {
69287
+ function Kk(e, t) {
68944
69288
  let n;
68945
- if (Dk(e, _n)) n = Zt;
68946
- else if (Dk(e, mn)) n = 8;
68947
- else if (Dk(e, vn)) throw Error("length of Z axis is undefined");
69289
+ if (Gk(e, _n)) n = Zt;
69290
+ else if (Gk(e, mn)) n = 8;
69291
+ else if (Gk(e, vn)) throw Error("length of Z axis is undefined");
68948
69292
  else throw Error("Percent axis must be the X axis (RIGHT) or Y axis (UP)");
68949
69293
  return t / 100 * n;
68950
69294
  }
68951
69295
  //#endregion
68952
69296
  //#region src/utils/debug.ts
68953
- function kk(e, t = !1) {
69297
+ function qk(e, t = !1) {
68954
69298
  let n = [];
68955
69299
  for (let t of e) n.push(...t.getFamily());
68956
69300
  return t ? n.filter((e) => e instanceof I && e.hasOwnPoints()) : n;
68957
69301
  }
68958
- function Ak(e, t) {
68959
- let n = [], r = new Set(kk(t)), i = (e, t) => {
69302
+ function Jk(e, t) {
69303
+ let n = [], r = new Set(qk(t)), i = (e, t) => {
68960
69304
  for (let r of e) {
68961
69305
  if (t.has(r)) continue;
68962
69306
  let e = new Set(r.getFamily().filter((e) => t.has(e)));
@@ -68965,14 +69309,14 @@ function Ak(e, t) {
68965
69309
  };
68966
69310
  return i(e, r), n;
68967
69311
  }
68968
- function jk(e, t = {}) {
69312
+ function Yk(e, t = {}) {
68969
69313
  let { labelHeight: n = .15 } = t, r = new L();
68970
69314
  return e.children.forEach((e, t) => {
68971
69315
  let i = new mb({ value: t });
68972
69316
  i.setHeight(n), i.moveTo(e), r.add(i);
68973
69317
  }), r;
68974
69318
  }
68975
- function Mk(e, t = 0) {
69319
+ function Xk(e, t = 0) {
68976
69320
  let n = [], r = (e, t) => {
68977
69321
  n.push(" ".repeat(t) + `${e.constructor.name} ${e.id}`);
68978
69322
  for (let n of e.children) r(n, t + 1);
@@ -68983,8 +69327,8 @@ function Mk(e, t = 0) {
68983
69327
  }
68984
69328
  //#endregion
68985
69329
  //#region src/utils/spaceOps.ts
68986
- var Nk = 2 * Math.PI;
68987
- function Pk(e) {
69330
+ var Zk = 2 * Math.PI;
69331
+ function Qk(e) {
68988
69332
  let t = e.length, n = e[0].length, r = [];
68989
69333
  for (let i = 0; i < n; i++) {
68990
69334
  let n = [];
@@ -68993,20 +69337,20 @@ function Pk(e) {
68993
69337
  }
68994
69338
  return r;
68995
69339
  }
68996
- function Fk(e, t) {
69340
+ function $k(e, t) {
68997
69341
  return e.map((e) => e.reduce((e, n, r) => e + n * (t[r] ?? 0), 0));
68998
69342
  }
68999
- function Ik(e) {
69343
+ function eA(e) {
69000
69344
  return e.reduce((e, t) => e + t * t, 0);
69001
69345
  }
69002
- function Lk(e, t) {
69346
+ function tA(e, t) {
69003
69347
  return e[0] * t[1] - e[1] * t[0];
69004
69348
  }
69005
- function Rk(e, t) {
69006
- let n = Math.sqrt(Ik(e));
69349
+ function nA(e, t) {
69350
+ let n = Math.sqrt(eA(e));
69007
69351
  return n > 0 ? e.map((e) => e / n) : t ?? e.map(() => 0);
69008
69352
  }
69009
- function zk(...e) {
69353
+ function rA(...e) {
69010
69354
  if (e.length === 0) return [
69011
69355
  1,
69012
69356
  0,
@@ -69025,8 +69369,8 @@ function zk(...e) {
69025
69369
  }
69026
69370
  return t;
69027
69371
  }
69028
- function Bk(e, t, n = !1) {
69029
- let r = n ? t : Rk(t), i = Math.sin(e / 2);
69372
+ function iA(e, t, n = !1) {
69373
+ let r = n ? t : nA(t), i = Math.sin(e / 2);
69030
69374
  return [
69031
69375
  Math.cos(e / 2),
69032
69376
  i * (r[0] ?? 0),
@@ -69034,19 +69378,19 @@ function Bk(e, t, n = !1) {
69034
69378
  i * (r[2] ?? 0)
69035
69379
  ];
69036
69380
  }
69037
- function Vk(e) {
69038
- let t = Rk(e.slice(1), [
69381
+ function aA(e) {
69382
+ let t = nA(e.slice(1), [
69039
69383
  1,
69040
69384
  0,
69041
69385
  0
69042
69386
  ]), n = 2 * Math.acos(e[0]);
69043
- return n > Nk / 2 && (n = Nk - n, t = [
69387
+ return n > Zk / 2 && (n = Zk - n, t = [
69044
69388
  -t[0],
69045
69389
  -t[1],
69046
69390
  -t[2]
69047
69391
  ]), [n, t];
69048
69392
  }
69049
- function Hk(e) {
69393
+ function oA(e) {
69050
69394
  return [
69051
69395
  e[0],
69052
69396
  -e[1],
@@ -69054,7 +69398,7 @@ function Hk(e) {
69054
69398
  -e[3]
69055
69399
  ];
69056
69400
  }
69057
- function Uk(e, t, n = !1) {
69401
+ function sA(e, t, n = !1) {
69058
69402
  let [r, i, a] = Rn(t), o = Math.cos(e), s = Math.sin(e), c = 1 - o, l = [
69059
69403
  [
69060
69404
  o + r * r * c,
@@ -69084,7 +69428,7 @@ function Uk(e, t, n = !1) {
69084
69428
  ]
69085
69429
  ] : l;
69086
69430
  }
69087
- function Wk(e) {
69431
+ function cA(e) {
69088
69432
  let t = Math.cos(e), n = Math.sin(e);
69089
69433
  return [
69090
69434
  [
@@ -69104,23 +69448,23 @@ function Wk(e) {
69104
69448
  ]
69105
69449
  ];
69106
69450
  }
69107
- function Gk(e, t) {
69108
- return (t[0] ?? 0) === 0 && (t[1] ?? 0) === 0 ? Pk(Wk(e * Math.sign(t[2] ?? 0))) : Pk(Uk(e, t));
69451
+ function lA(e, t) {
69452
+ return (t[0] ?? 0) === 0 && (t[1] ?? 0) === 0 ? Qk(cA(e * Math.sign(t[2] ?? 0))) : Qk(sA(e, t));
69109
69453
  }
69110
- function Kk(e, t, n = vn) {
69454
+ function uA(e, t, n = vn) {
69111
69455
  if (e.length > 3) throw Error("Vector must have the correct dimensions.");
69112
69456
  let r = e.length === 2 ? [
69113
69457
  e[0],
69114
69458
  e[1],
69115
69459
  0
69116
- ] : e, i = Fk(Uk(t, n), r);
69460
+ ] : e, i = $k(sA(t, n), r);
69117
69461
  return [
69118
69462
  i[0],
69119
69463
  i[1],
69120
69464
  i[2]
69121
69465
  ];
69122
69466
  }
69123
- function qk(e) {
69467
+ function dA(e) {
69124
69468
  let t = Rn(e), n = Rn(In(t, _n)), r = In(n, t);
69125
69469
  if (Ln(n) === 0) {
69126
69470
  r = Rn(In(mn, t));
@@ -69131,27 +69475,27 @@ function qk(e) {
69131
69475
  -e[2]
69132
69476
  ];
69133
69477
  }
69134
- return Pk([
69478
+ return Qk([
69135
69479
  r,
69136
69480
  n,
69137
69481
  t
69138
69482
  ]);
69139
69483
  }
69140
- function Jk(e) {
69484
+ function fA(e) {
69141
69485
  return Math.atan2(e[1] ?? 0, e[0] ?? 0);
69142
69486
  }
69143
- function Yk(e, t) {
69144
- let n = Rk(e), r = Rk(t), i = n.map((e, t) => e - r[t]), a = n.map((e, t) => e + r[t]);
69145
- return 2 * Math.atan2(Math.sqrt(Ik(i)), Math.sqrt(Ik(a)));
69487
+ function pA(e, t) {
69488
+ let n = nA(e), r = nA(t), i = n.map((e, t) => e - r[t]), a = n.map((e, t) => e + r[t]);
69489
+ return 2 * Math.atan2(Math.sqrt(eA(i)), Math.sqrt(eA(a)));
69146
69490
  }
69147
- function Xk(e, t, n = 1e-6) {
69491
+ function mA(e, t, n = 1e-6) {
69148
69492
  let r = Math.max(...e.map(Math.abs)), i = Math.max(...t.map(Math.abs)), a;
69149
69493
  if (r === 0) {
69150
69494
  if (i === 0) return hn;
69151
69495
  a = t.map((e) => e / i);
69152
69496
  } else if (i === 0) a = e.map((e) => e / r);
69153
69497
  else {
69154
- let o = e.map((e) => e / r), s = In(o, t.map((e) => e / i)), c = Math.sqrt(Ik(s));
69498
+ let o = e.map((e) => e / r), s = In(o, t.map((e) => e / i)), c = Math.sqrt(eA(s));
69155
69499
  if (c > n) return [
69156
69500
  s[0] / c,
69157
69501
  s[1] / c,
@@ -69164,43 +69508,43 @@ function Xk(e, t, n = 1e-6) {
69164
69508
  -a[0] * a[2],
69165
69509
  -a[1] * a[2],
69166
69510
  a[0] * a[0] + a[1] * a[1]
69167
- ], s = Math.sqrt(Ik(o));
69511
+ ], s = Math.sqrt(eA(o));
69168
69512
  return [
69169
69513
  o[0] / s,
69170
69514
  o[1] / s,
69171
69515
  o[2] / s
69172
69516
  ];
69173
69517
  }
69174
- function Zk(e = 4, t = _n) {
69175
- let n = Nk / e, r = [];
69176
- for (let i = 0; i < e; i++) r.push(Kk(t, i * n));
69518
+ function hA(e = 4, t = _n) {
69519
+ let n = Zk / e, r = [];
69520
+ for (let i = 0; i < e; i++) r.push(uA(t, i * n));
69177
69521
  return r;
69178
69522
  }
69179
- function Qk(e, t = {}) {
69180
- let n = t.radius ?? 1, r = t.startAngle ?? (e % 2 == 0 ? 0 : Nk / 4);
69181
- return [Zk(e, Kk([
69523
+ function gA(e, t = {}) {
69524
+ let n = t.radius ?? 1, r = t.startAngle ?? (e % 2 == 0 ? 0 : Zk / 4);
69525
+ return [hA(e, uA([
69182
69526
  n,
69183
69527
  0,
69184
69528
  0
69185
69529
  ], r)), r];
69186
69530
  }
69187
- function $k(e) {
69531
+ function _A(e) {
69188
69532
  return [
69189
69533
  e.re,
69190
69534
  e.im,
69191
69535
  0
69192
69536
  ];
69193
69537
  }
69194
- function eA(e) {
69538
+ function vA(e) {
69195
69539
  return {
69196
69540
  re: e[0] ?? 0,
69197
69541
  im: e[1] ?? 0
69198
69542
  };
69199
69543
  }
69200
- function tA(e) {
69201
- return (t) => $k(e(eA(t)));
69544
+ function yA(e) {
69545
+ return (t) => _A(e(vA(t)));
69202
69546
  }
69203
- function nA(e) {
69547
+ function bA(e) {
69204
69548
  let t = [
69205
69549
  0,
69206
69550
  0,
@@ -69214,10 +69558,10 @@ function nA(e) {
69214
69558
  t[2] / n
69215
69559
  ];
69216
69560
  }
69217
- function rA(e, t) {
69218
- return nA([e, t]);
69561
+ function xA(e, t) {
69562
+ return bA([e, t]);
69219
69563
  }
69220
- function iA(e, t) {
69564
+ function SA(e, t) {
69221
69565
  for (let n of [e, t]) for (let e of n) if ((e[2] ?? 0) !== 0) throw Error("Coords must be in the xy-plane.");
69222
69566
  let n = (e) => In([
69223
69567
  e[0][0],
@@ -69235,7 +69579,7 @@ function iA(e, t) {
69235
69579
  0
69236
69580
  ];
69237
69581
  }
69238
- function aA(e, t, n, r, i = 1e-5) {
69582
+ function CA(e, t, n, r, i = 1e-5) {
69239
69583
  let a = [];
69240
69584
  for (let o = 0; o < e.length; o++) {
69241
69585
  let s = e[o], c = t[o], l = n[o], u = r[o], d = In(u, In(c, u)), f = c[0] * d[0] + c[1] * d[1] + c[2] * d[2], p = Math.max(f, i), m = [
@@ -69251,15 +69595,15 @@ function aA(e, t, n, r, i = 1e-5) {
69251
69595
  }
69252
69596
  return a;
69253
69597
  }
69254
- function oA(e) {
69598
+ function wA(e) {
69255
69599
  let t = 0;
69256
69600
  for (let n = 0; n < e.length - 1; n++) t += (e[n + 1][0] - e[n][0]) * (e[n][1] + e[n + 1][1]) / 2;
69257
69601
  return t;
69258
69602
  }
69259
- function sA(e) {
69260
- return oA(e) > 0 ? "CW" : "CCW";
69603
+ function TA(e) {
69604
+ return wA(e) > 0 ? "CW" : "CCW";
69261
69605
  }
69262
- function cA(e) {
69606
+ function EA(e) {
69263
69607
  let t = Ln(e);
69264
69608
  if (t === 0) return [
69265
69609
  0,
@@ -69273,7 +69617,7 @@ function cA(e) {
69273
69617
  n
69274
69618
  ];
69275
69619
  }
69276
- function lA(e) {
69620
+ function DA(e) {
69277
69621
  let [t, n, r] = e;
69278
69622
  return [
69279
69623
  t * Math.cos(n) * Math.sin(r),
@@ -69281,12 +69625,12 @@ function lA(e) {
69281
69625
  t * Math.cos(r)
69282
69626
  ];
69283
69627
  }
69284
- function uA(e, t = vn) {
69628
+ function OA(e, t = vn) {
69285
69629
  let n = e[0], r = e[1], i = In([
69286
69630
  n[0] - r[0],
69287
69631
  n[1] - r[1],
69288
69632
  n[2] - r[2]
69289
- ], t), a = rA(n, r);
69633
+ ], t), a = xA(n, r);
69290
69634
  return [[
69291
69635
  a[0] + i[0],
69292
69636
  a[1] + i[1],
@@ -69297,7 +69641,7 @@ function uA(e, t = vn) {
69297
69641
  a[2] - i[2]
69298
69642
  ]];
69299
69643
  }
69300
- function dA(e, t = 2) {
69644
+ function kA(e, t = 2) {
69301
69645
  let n = [];
69302
69646
  for (let r = 0; r < e; r++) {
69303
69647
  let i = [];
@@ -69306,41 +69650,41 @@ function dA(e, t = 2) {
69306
69650
  }
69307
69651
  return n;
69308
69652
  }
69309
- function fA(e) {
69653
+ function AA(e) {
69310
69654
  let t = 0;
69311
- for (let [n, r] of sk(e)) {
69312
- let e = ((Jk(r) - Jk(n) + Math.PI) % Nk + Nk) % Nk - Math.PI;
69655
+ for (let [n, r] of Tk(e)) {
69656
+ let e = ((fA(r) - fA(n) + Math.PI) % Zk + Zk) % Zk - Math.PI;
69313
69657
  t += e;
69314
69658
  }
69315
- return t / Nk;
69659
+ return t / Zk;
69316
69660
  }
69317
69661
  //#endregion
69318
69662
  //#region src/utils/paths.ts
69319
- var pA = .01;
69320
- function mA(e, t, n) {
69663
+ var jA = .01;
69664
+ function MA(e, t, n) {
69321
69665
  return e.map((e, r) => e.map((e, i) => e + n * (t[r][i] - e)));
69322
69666
  }
69323
- function hA(e, t) {
69667
+ function NA(e, t) {
69324
69668
  return t.map((t) => t.reduce((t, n, r) => t + n * e[r], 0));
69325
69669
  }
69326
- function gA() {
69327
- return mA;
69670
+ function PA() {
69671
+ return MA;
69328
69672
  }
69329
- function _A(e, t, n = vn) {
69330
- let r = Rk(n, vn), i = (e) => t[e] ?? t[0];
69673
+ function FA(e, t, n = vn) {
69674
+ let r = nA(n, vn), i = (e) => t[e] ?? t[0];
69331
69675
  return (t, n, a) => {
69332
- let o = Uk(-e, r), s = Uk(a * e, r);
69676
+ let o = sA(-e, r), s = sA(a * e, r);
69333
69677
  return t.map((e, t) => {
69334
- let r = i(t), c = hA(n[t].map((e, t) => e - r[t]), o).map((e, t) => e + r[t]);
69335
- return hA(e.map((e, t) => e + a * (c[t] - e)).map((e, t) => e - r[t]), s).map((e, t) => e + r[t]);
69678
+ let r = i(t), c = NA(n[t].map((e, t) => e - r[t]), o).map((e, t) => e + r[t]);
69679
+ return NA(e.map((e, t) => e + a * (c[t] - e)).map((e, t) => e - r[t]), s).map((e, t) => e + r[t]);
69336
69680
  });
69337
69681
  };
69338
69682
  }
69339
- function vA(e, t = vn) {
69340
- if (Math.abs(e) < pA) return gA();
69341
- let n = Rk(t, vn);
69683
+ function IA(e, t = vn) {
69684
+ if (Math.abs(e) < jA) return PA();
69685
+ let n = nA(t, vn);
69342
69686
  return (t, r, i) => {
69343
- let a = Uk(i * e, n);
69687
+ let a = sA(i * e, n);
69344
69688
  return t.map((t, i) => {
69345
69689
  let o = r[i].map((e, n) => e - t[n]), s = t.map((e, t) => e + .5 * o[t]);
69346
69690
  if (e !== Math.PI) {
@@ -69351,19 +69695,19 @@ function vA(e, t = vn) {
69351
69695
  ], i = 1 / Math.tan(e / 2);
69352
69696
  for (let e = 0; e < s.length; e++) s[e] += r[e] * i;
69353
69697
  }
69354
- return hA(t.map((e, t) => e - s[t]), a).map((e, t) => e + s[t]);
69698
+ return NA(t.map((e, t) => e - s[t]), a).map((e, t) => e + s[t]);
69355
69699
  });
69356
69700
  };
69357
69701
  }
69358
- function yA() {
69359
- return vA(-Math.PI);
69702
+ function LA() {
69703
+ return IA(-Math.PI);
69360
69704
  }
69361
- function bA() {
69362
- return vA(Math.PI);
69705
+ function RA() {
69706
+ return IA(Math.PI);
69363
69707
  }
69364
69708
  //#endregion
69365
69709
  //#region src/utils/simpleFunctions.ts
69366
- function xA(e, t, n, r, i = 1e-4) {
69710
+ function zA(e, t, n, r, i = 1e-4) {
69367
69711
  let a = n, o = r, s = (a + o) / 2;
69368
69712
  for (; Math.abs(o - a) > i;) {
69369
69713
  s = (a + o) / 2;
@@ -69376,7 +69720,7 @@ function xA(e, t, n, r, i = 1e-4) {
69376
69720
  }
69377
69721
  return s;
69378
69722
  }
69379
- function SA(e, t) {
69723
+ function BA(e, t) {
69380
69724
  if (t < 0 || t > e) return 0;
69381
69725
  let n = t;
69382
69726
  n > e - n && (n = e - n);
@@ -69384,30 +69728,30 @@ function SA(e, t) {
69384
69728
  for (let t = 0; t < n; t++) r = r * (e - t) / (t + 1);
69385
69729
  return Math.round(r);
69386
69730
  }
69387
- function CA(e, t, n) {
69731
+ function VA(e, t, n) {
69388
69732
  return e < t ? t : e > n ? n : e;
69389
69733
  }
69390
- function wA(e) {
69734
+ function HA(e) {
69391
69735
  return 1 / (1 + Math.exp(-e));
69392
69736
  }
69393
69737
  //#endregion
69394
69738
  //#region src/utils/bezier.ts
69395
- function TA(e, t, n) {
69739
+ function UA(e, t, n) {
69396
69740
  if (Array.isArray(e) && Array.isArray(t)) return e.map((e, r) => (1 - n) * e + n * t[r]);
69397
69741
  if (typeof e == "number" && typeof t == "number") return (1 - n) * e + n * t;
69398
69742
  throw Error("interpolate: start and end must both be numbers or both be arrays");
69399
69743
  }
69400
- function EA(e, t) {
69744
+ function WA(e, t) {
69401
69745
  if (Array.isArray(e) && Array.isArray(t)) return e.map((e, n) => (e + t[n]) / 2);
69402
69746
  if (typeof e == "number" && typeof t == "number") return (e + t) / 2;
69403
69747
  throw Error("mid: start and end must both be numbers or both be arrays");
69404
69748
  }
69405
- function DA(e, t, n) {
69749
+ function GA(e, t, n) {
69406
69750
  if (Array.isArray(e) && Array.isArray(t) && Array.isArray(n)) return e.map((e, r) => (n[r] - e) / (t[r] - e));
69407
69751
  if (typeof e == "number" && typeof t == "number" && typeof n == "number") return (n - e) / (t - e);
69408
69752
  throw Error("inverse_interpolate: start, end and value must all be numbers or all be arrays");
69409
69753
  }
69410
- function OA(e, t, n, r, i) {
69754
+ function KA(e, t, n, r, i) {
69411
69755
  let a = r - n;
69412
69756
  if (Array.isArray(i)) return i.map((r) => {
69413
69757
  let i = (r - n) / a;
@@ -69416,7 +69760,7 @@ function OA(e, t, n, r, i) {
69416
69760
  let o = (i - n) / a;
69417
69761
  return (1 - o) * e + o * t;
69418
69762
  }
69419
- function kA(e, t) {
69763
+ function qA(e, t) {
69420
69764
  if (e.length === 0) return 0;
69421
69765
  let n = e.slice();
69422
69766
  for (; n.length > 1;) {
@@ -69426,7 +69770,7 @@ function kA(e, t) {
69426
69770
  }
69427
69771
  return n[0];
69428
69772
  }
69429
- function AA(e, t) {
69773
+ function JA(e, t) {
69430
69774
  if (e.length === 0) return [];
69431
69775
  let n = e.map((e) => e.slice());
69432
69776
  for (; n.length > 1;) {
@@ -69436,15 +69780,15 @@ function AA(e, t) {
69436
69780
  }
69437
69781
  return n[0];
69438
69782
  }
69439
- function jA(e) {
69783
+ function YA(e) {
69440
69784
  if (e.length > 0 && Array.isArray(e[0])) {
69441
69785
  let t = e.filter((e) => Array.isArray(e));
69442
- return (e) => AA(t, e);
69786
+ return (e) => JA(t, e);
69443
69787
  }
69444
69788
  let t = e.filter((e) => typeof e == "number");
69445
- return (e) => kA(t, e);
69789
+ return (e) => qA(t, e);
69446
69790
  }
69447
- function MA(e, t) {
69791
+ function XA(e, t) {
69448
69792
  let n = e.length, r = e.map((e) => e.slice()), i = Array(n);
69449
69793
  i[0] = e[0].slice();
69450
69794
  for (let e = 1; e < n; e++) {
@@ -69453,7 +69797,7 @@ function MA(e, t) {
69453
69797
  }
69454
69798
  return [...i, ...r];
69455
69799
  }
69456
- function NA(e, t) {
69800
+ function ZA(e, t) {
69457
69801
  if (t <= 1) return e.map((e) => e.slice());
69458
69802
  let n = [];
69459
69803
  for (let r = 0; r < t; r++) {
@@ -69462,7 +69806,7 @@ function NA(e, t) {
69462
69806
  }
69463
69807
  return n;
69464
69808
  }
69465
- function PA(e, t) {
69809
+ function QA(e, t) {
69466
69810
  let n = e.length;
69467
69811
  if (n === 0) return [];
69468
69812
  let r = e[0].length, i = [];
@@ -69473,12 +69817,12 @@ function PA(e, t) {
69473
69817
  for (let t = 0; t < n; t++) {
69474
69818
  let n = a[t];
69475
69819
  if (n <= 0) continue;
69476
- let i = NA(e[t], n);
69820
+ let i = ZA(e[t], n);
69477
69821
  for (let e = 0; e < n; e++) o.push(i.slice(e * r, e * r + r));
69478
69822
  }
69479
69823
  return o;
69480
69824
  }
69481
- function FA(e) {
69825
+ function $A(e) {
69482
69826
  let t = e[0], n = e[e.length - 1];
69483
69827
  for (let e = 0; e < 3; e++) {
69484
69828
  let r = t[e] ?? 0, i = n[e] ?? 0, a = 1e-8 + 1e-5 * Math.abs(r);
@@ -69486,43 +69830,43 @@ function FA(e) {
69486
69830
  }
69487
69831
  return !0;
69488
69832
  }
69489
- function IA(e, t) {
69833
+ function ej(e, t) {
69490
69834
  return {
69491
69835
  re: e.re + t.re,
69492
69836
  im: e.im + t.im
69493
69837
  };
69494
69838
  }
69495
- function LA(e, t) {
69839
+ function tj(e, t) {
69496
69840
  return {
69497
69841
  re: e.re - t.re,
69498
69842
  im: e.im - t.im
69499
69843
  };
69500
69844
  }
69501
- function RA(e, t) {
69845
+ function nj(e, t) {
69502
69846
  return {
69503
69847
  re: e.re * t.re - e.im * t.im,
69504
69848
  im: e.re * t.im + e.im * t.re
69505
69849
  };
69506
69850
  }
69507
- function zA(e, t) {
69851
+ function rj(e, t) {
69508
69852
  let n = t.re * t.re + t.im * t.im;
69509
69853
  return {
69510
69854
  re: (e.re * t.re + e.im * t.im) / n,
69511
69855
  im: (e.im * t.re - e.re * t.im) / n
69512
69856
  };
69513
69857
  }
69514
- function BA(e, t) {
69858
+ function ij(e, t) {
69515
69859
  let n = {
69516
69860
  re: e[e.length - 1],
69517
69861
  im: 0
69518
69862
  };
69519
- for (let r = e.length - 2; r >= 0; r--) n = IA(RA(n, t), {
69863
+ for (let r = e.length - 2; r >= 0; r--) n = ej(nj(n, t), {
69520
69864
  re: e[r],
69521
69865
  im: 0
69522
69866
  });
69523
69867
  return n;
69524
69868
  }
69525
- function VA(e) {
69869
+ function aj(e) {
69526
69870
  let t = e.slice();
69527
69871
  for (; t.length > 1 && Math.abs(t[t.length - 1]) < 1e-14;) t.pop();
69528
69872
  let n = t.length - 1;
@@ -69537,17 +69881,17 @@ function VA(e) {
69537
69881
  for (let e = 0; e < n; e++) a.push({
69538
69882
  re: s.re,
69539
69883
  im: s.im
69540
- }), s = RA(s, o);
69884
+ }), s = nj(s, o);
69541
69885
  for (let e = 0; e < 200; e++) {
69542
69886
  let e = 0;
69543
69887
  for (let t = 0; t < n; t++) {
69544
- let r = BA(i, a[t]), o = {
69888
+ let r = ij(i, a[t]), o = {
69545
69889
  re: 1,
69546
69890
  im: 0
69547
69891
  };
69548
- for (let e = 0; e < n; e++) e !== t && (o = RA(o, LA(a[t], a[e])));
69549
- let s = zA(r, o);
69550
- a[t] = LA(a[t], s);
69892
+ for (let e = 0; e < n; e++) e !== t && (o = nj(o, tj(a[t], a[e])));
69893
+ let s = rj(r, o);
69894
+ a[t] = tj(a[t], s);
69551
69895
  let c = Math.hypot(s.re, s.im);
69552
69896
  c > e && (e = c);
69553
69897
  }
@@ -69555,98 +69899,98 @@ function VA(e) {
69555
69899
  }
69556
69900
  return a;
69557
69901
  }
69558
- function HA(e, t) {
69902
+ function oj(e, t) {
69559
69903
  if (t < 0 || t > e) return 0;
69560
69904
  let n = 1;
69561
69905
  for (let r = 0; r < t; r++) n = n * (e - r) / (r + 1);
69562
69906
  return Math.round(n);
69563
69907
  }
69564
- function UA(e, t) {
69908
+ function sj(e, t) {
69565
69909
  let n = 10 ** t;
69566
69910
  return Math.round(e * n) / n;
69567
69911
  }
69568
- function WA(e, t, n) {
69912
+ function cj(e, t, n) {
69569
69913
  let r = .5 * 10 ** -n, i = [];
69570
69914
  for (let n of e) t.some((e) => Math.abs(n - e) <= r) && !i.some((e) => Math.abs(n - e) <= r) && i.push(n);
69571
69915
  return i;
69572
69916
  }
69573
- function GA(e, t, n = 1e-6) {
69917
+ function lj(e, t, n = 1e-6) {
69574
69918
  for (let n of t) if (n.length !== e.length) throw Error("proportions_along_bezier_curve_for_point: point and control points have different shapes");
69575
69919
  let r = t.length - 1, i = Math.round(Math.log10(1 / n)), a = [];
69576
69920
  for (let n = 0; n < e.length; n++) {
69577
69921
  let o = e[n], s = t.map((e) => e[n]), c = [];
69578
69922
  for (let e = r; e >= 0; e--) {
69579
- let t = HA(r, e), n = 1, i = 0;
69923
+ let t = oj(r, e), n = 1, i = 0;
69580
69924
  for (let t = e; t >= 0; t--) {
69581
- let r = HA(e, t) * n * s[t];
69925
+ let r = oj(e, t) * n * s[t];
69582
69926
  e === 0 && (r -= o), i += r, n *= -1;
69583
69927
  }
69584
69928
  c.push(t * i);
69585
69929
  }
69586
69930
  if (c.every((e) => e === 0)) continue;
69587
- let l = VA(c.slice().reverse()).filter((e) => Math.abs(e.im) < 1e-9).map((e) => UA(e.re, i));
69931
+ let l = aj(c.slice().reverse()).filter((e) => Math.abs(e.im) < 1e-9).map((e) => sj(e.re, i));
69588
69932
  a.push(l);
69589
69933
  }
69590
69934
  if (a.length === 0) return [];
69591
69935
  let o = a[0];
69592
- for (let e = 1; e < a.length; e++) o = WA(o, a[e], i);
69936
+ for (let e = 1; e < a.length; e++) o = cj(o, a[e], i);
69593
69937
  return o.filter((e) => e >= 0 && e <= 1);
69594
69938
  }
69595
- function KA(e, t, n = 1e-6) {
69596
- return GA(e, t, n).length > 0;
69939
+ function uj(e, t, n = 1e-6) {
69940
+ return lj(e, t, n).length > 0;
69597
69941
  }
69598
69942
  //#endregion
69599
69943
  //#region src/mobjects/three-d/threeDVmobUtils.ts
69600
- function qA(e) {
69944
+ function dj(e) {
69601
69945
  return [
69602
69946
  e[0],
69603
69947
  e[1],
69604
69948
  e[2]
69605
69949
  ];
69606
69950
  }
69607
- function JA(e) {
69951
+ function fj(e) {
69608
69952
  return e.filter((e, t) => t % 3 == 0);
69609
69953
  }
69610
- function YA(e) {
69611
- return [QA(e), $A(e)];
69954
+ function pj(e) {
69955
+ return [gj(e), _j(e)];
69612
69956
  }
69613
- function XA(e) {
69957
+ function mj(e) {
69614
69958
  return 0;
69615
69959
  }
69616
- function ZA(e) {
69960
+ function hj(e) {
69617
69961
  return Math.floor((e.getPoints().length - 1) / 6) * 3;
69618
69962
  }
69619
- function QA(e) {
69963
+ function gj(e) {
69620
69964
  let t = e.getPoints();
69621
- return t.length === 0 ? [...bn] : qA(t[XA(e)]);
69965
+ return t.length === 0 ? [...bn] : dj(t[mj(e)]);
69622
69966
  }
69623
- function $A(e) {
69967
+ function _j(e) {
69624
69968
  let t = e.getPoints();
69625
- return t.length === 0 ? [...bn] : qA(t[ZA(e)]);
69969
+ return t.length === 0 ? [...bn] : dj(t[hj(e)]);
69626
69970
  }
69627
- function ej(e, t) {
69971
+ function vj(e, t) {
69628
69972
  let n = e.getPoints(), r = n.length;
69629
- if (JA(n).length <= 2) return [...mn];
69630
- let i = t, a = i > 2 ? i - 3 : r - 4, o = Xk(n[i < r - 3 ? i + 3 : 3].map((e, t) => e - n[i][t]), n[a].map((e, t) => e - n[i][t]));
69973
+ if (fj(n).length <= 2) return [...mn];
69974
+ let i = t, a = i > 2 ? i - 3 : r - 4, o = mA(n[i < r - 3 ? i + 3 : 3].map((e, t) => e - n[i][t]), n[a].map((e, t) => e - n[i][t]));
69631
69975
  return Math.hypot(...o) === 0 ? [...mn] : o;
69632
69976
  }
69633
- function tj(e) {
69634
- return ej(e, XA(e));
69977
+ function yj(e) {
69978
+ return vj(e, mj(e));
69635
69979
  }
69636
- function nj(e) {
69637
- return ej(e, ZA(e));
69980
+ function bj(e) {
69981
+ return vj(e, hj(e));
69638
69982
  }
69639
69983
  //#endregion
69640
69984
  //#region src/core/SpecialThreeDScene.ts
69641
- var rj = 70 * _t, ij = -110 * _t, aj = 2, oj = 48, sj = class extends Jg {
69985
+ var xj = 70 * _t, Sj = -110 * _t, Cj = 2, wj = 48, Tj = class extends Jg {
69642
69986
  cutAxesAtRadius;
69643
69987
  _threeDAxesConfig;
69644
69988
  _sphereConfig;
69645
69989
  _defaultAngledCameraPosition;
69646
69990
  constructor(e, t = {}) {
69647
69991
  let { cutAxesAtRadius: n = !0, threeDAxesConfig: r = {}, sphereConfig: i = {}, defaultAngledCameraPosition: a = {
69648
- phi: rj,
69649
- theta: ij
69992
+ phi: xj,
69993
+ theta: Sj
69650
69994
  }, phi: o = a.phi, theta: s = a.theta, ...c } = t;
69651
69995
  super(e, {
69652
69996
  ...c,
@@ -69676,8 +70020,8 @@ var rj = 70 * _t, ij = -110 * _t, aj = 2, oj = 48, sj = class extends Jg {
69676
70020
  }
69677
70021
  getDefaultSphereConfig() {
69678
70022
  return {
69679
- radius: aj,
69680
- resolution: oj
70023
+ radius: Cj,
70024
+ resolution: wj
69681
70025
  };
69682
70026
  }
69683
70027
  getAxes() {
@@ -69703,10 +70047,541 @@ var rj = 70 * _t, ij = -110 * _t, aj = 2, oj = 48, sj = class extends Jg {
69703
70047
  };
69704
70048
  //#endregion
69705
70049
  //#region src/mobjects/text/registerFont.ts
69706
- function cj(e, t) {
70050
+ function Ej(e, t) {
69707
70051
  if (typeof document > "u" || typeof FontFace > "u" || document.fonts === void 0) return !1;
69708
70052
  let n = typeof t == "string" && !/^\s*(url|local)\s*\(/i.test(t) ? `url("${t}")` : t, r = new FontFace(e, n);
69709
70053
  return document.fonts.add(r), !0;
69710
70054
  }
69711
70055
  //#endregion
69712
- export { Kk as $, OS as $a, H_ as $c, vr as $d, Lt as $f, Pw as $i, Yh as $l, XE as $n, sx as $o, nt as $p, $T as $r, ay as $s, wO as $t, as as $u, gA as A, IC as Aa, pv as Ac, vo as Ad, Zt as Af, Xw as Ai, Gg as Al, Fe as Am, xD as An, Zx as Ao, Ge as Ap, hE as Ar, lb as As, dk as At, Hp as Au, aA as B, vC as Ba, nv as Bc, Pa as Bd, Et as Bf, Kw as Bi, og as Bl, dD as Bn, wx as Bo, O as Bp, aE as Br, Ty as Bs, NO as Bt, Cs as Bu, SA as C, JC as Ca, bv as Cc, $o as Cd, dn as Cf, tT as Ci, s_ as Cl, Se as Cm, kD as Cn, vS as Co, _e as Cp, SE as Cr, vb as Cs, vk as Ct, cm as Cu, bA as D, LC as Da, gv as Dc, Fo as Dd, Yt as Df, rT as Di, Yg as Dl, Ee as Dm, SD as Dn, $x as Do, xe as Dp, yE as Dr, pb as Ds, ck as Dt, Qp as Du, yA as E, FC as Ea, hv as Ec, zo as Ed, Xt as Ef, Zw as Ei, e_ as El, Te as Em, OD as En, fS as Eo, me as Ep, bE as Er, yb as Es, hk as Et, Jp as Eu, nA as F, OC as Fa, cv as Fc, Co as Fd, Jt as Ff, qw as Fi, hg as Fl, hD as Fn, Hx as Fo, We as Fp, dE as Fr, Qy as Fs, ik as Ft, Ro as Fu, Ik as G, YS as Ga, Y_ as Gc, Cr as Gd, xt as Gf, Rw as Gi, ag as Gl, iD as Gn, vx as Go, Ae as Gp, cE as Gr, xy as Gs, zO as Gt, ms as Gu, fA as H, JS as Ha, Z_ as Hc, La as Hd, qt as Hf, Lw as Hi, ug as Hl, lD as Hn, yx as Ho, Pe as Hp, nE as Hr, Cy as Hs, MO as Ht, Eo as Hu, Zk as I, bC as Ia, ov as Ic, co as Id, on as If, Gw as Ii, fg as Il, _D as In, Vx as Io, pe as Ip, uE as Ir, Xy as Is, ak as It, Do as Iu, Hk as J, US as Ja, K_ as Jc, br as Jd, Vt as Jf, Dw as Ji, eg as Jl, rD as Jn, mx as Jo, k as Jp, XT as Jr, uy as Js, LO as Jt, is as Ju, Rk as K, XS as Ka, J_ as Kc, Tr as Kd, Bt as Kf, Bw as Ki, rg as Kl, aD as Kn, gx as Ko, je as Kp, JT as Kr, yy as Ks, WO as Kt, R as Ku, tA as L, yC as La, av as Lc, L as Ld, an as Lf, Hw as Li, sg as Ll, fD as Ln, Rx as Lo, D as Lp, lE as Lr, Zy as Ls, VO as Lt, vs as Lu, Yk as M, PC as Ma, fv as Mc, bo as Md, cn as Mf, iT as Mi, yg as Ml, Le as Mm, yD as Mn, Yx as Mo, Ve as Mp, mE as Mr, ab as Ms, tk as Mt, Es as Mu, Jk as N, AC as Na, sv as Nc, So as Nd, en as Nf, Vw as Ni, vg as Nl, Re as Nm, mD as Nn, Qx as No, He as Np, pE as Nr, sb as Ns, $O as Nt, z as Nu, vA as O, jC as Oa, mv as Oc, Ko as Od, tn as Of, nT as Oi, Xg as Ol, E as Om, CD as On, eS as Oo, pt as Op, _E as Or, mb as Os, yk as Ot, Kp as Ou, cA as P, kC as Pa, lv as Pc, xo as Pd, $t as Pf, Uw as Pi, _g as Pl, M as Pm, gD as Pn, Jx as Po, Ue as Pp, fE as Pr, nb as Ps, ek as Pt, Vo as Pu, Qk as Q, RS as Qa, V_ as Qc, Sr as Qd, jt as Qf, Ow as Qi, Xh as Ql, QE as Qn, lx as Qo, mt as Qp, eE as Qr, iy as Qs, DO as Qt, ko as Qu, $k as R, _C as Ra, iv as Rc, I as Rd, rn as Rf, Ww as Ri, mg as Rl, pD as Rn, Cx as Ro, ce as Rp, tE as Rr, Wy as Rs, FO as Rt, Po as Ru, xA as S, ew as Sa, wv as Sc, es as Sd, Sn as Sf, aT as Si, p_ as Sl, De as Sm, MD as Sn, cS as So, ge as Sp, DE as Sr, xb as Ss, uk as St, um as Su, wA as T, RC as Ta, vv as Tc, Go as Td, fn as Tf, Yw as Ti, $g as Tl, we as Tm, DD as Tn, mS as To, j as Tp, xE as Tr, bb as Ts, bk as Tt, im as Tu, iA as U, KS as Ua, ev as Uc, Bi as Ud, wt as Uf, zw as Ui, lg as Ul, oD as Un, bx as Uo, Oe as Up, iE as Ur, Sy as Us, GO as Ut, bs as Uu, Xk as V, iC as Va, tv as Vc, Na as Vd, Ft as Vf, Fw as Vi, dg as Vl, cD as Vn, xx as Vo, ue as Vp, sE as Vr, wy as Vs, PO as Vt, jo as Vu, rA as W, qS as Wa, X_ as Wc, kr as Wd, Ct as Wf, Iw as Wi, cg as Wl, sD as Wn, _x as Wo, ke as Wp, oE as Wr, by as Ws, BO as Wt, Ts as Wu, zk as X, HS as Xa, W_ as Xc, xr as Xd, zt as Xf, jw as Xi, Qh as Xl, eD as Xn, dx as Xo, fe as Xp, QT as Xr, ly as Xs, KO as Xt, us as Xu, Bk as Y, VS as Ya, G_ as Yc, yr as Yd, St as Yf, Nw as Yi, $h as Yl, KE as Yn, fx as Yo, ft as Yp, YT as Yr, cy as Ys, jO as Yt, ss as Yu, eA as Z, BS as Za, U_ as Zc, _r as Zd, _t as Zf, Aw as Zi, Zh as Zl, JE as Zn, ux as Zo, ut as Zp, ZT as Zr, oy as Zs, RO as Zt, rs as Zu, EA as _, YC as _a, Ov as _c, qo as _d, bn as _f, bT as _i, __ as _l, Ke as _m, FD as _n, lS as _o, yt as _p, ME as _r, Lb as _s, sk as _t, Hm as _u, nj as a, vw as aa, Vv as ac, ps as ad, Rn as af, FT as ai, P_ as al, dt as am, aO as an, jS as ao, ht as ap, BE as ar, nx as as, lA as at, Rh as au, MA as b, XC as ba, Cv as bc, Wo as bd, xn as bf, pT as bi, d_ as bl, Ye as bm, PD as bn, gS as bo, be as bp, TE as br, Eb as bs, xk as bt, hm as bu, XA as c, _w as ca, qv as cc, Ao as cd, Mn as cf, NT as ci, j_ as cl, Ne as cm, rO as cn, LS as co, Pt as cp, HE as cr, Jb as cs, kk as ct, Ih as cu, jA as d, cw as da, jv as dc, ns as dd, a as df, OT as di, O_ as dl, rt as dm, XD as dn, wS as do, gt as dp, FE as dr, Wb as ds, Ak as dt, jh as du, Mw as ea, ry as ec, cs as ed, Nn as ef, BT as ei, R_ as el, Qe as em, EO as en, AS as eo, Ot as ep, qE as er, cx as es, Wk as et, qh as eu, PA as f, aw as fa, Av as fc, Zo as fd, Cn as ff, TT as fi, D_ as fl, it as fm, ZD as fn, ES as fo, Dt as fp, NE as fr, Vb as fs, Tk as ft, kh as fu, OA as g, tw as ga, kv as gc, Bo as gd, gn as gf, yT as gi, C_ as gl, N as gm, UD as gn, _S as go, vt as gp, kE as gr, zb as gs, ok as gt, ih as gu, FA as h, nw as ha, Dv as hc, Yo as hd, yn as hf, CT as hi, v_ as hl, st as hm, VD as hn, sS as ho, Nt as hp, AE as hr, Bb as hs, wk as ht, Ah as hu, ZA as i, Cw as ia, Uv as ic, No as id, Hn as if, LT as ii, I_ as il, tt as im, sO as in, kS as io, Rt as ip, ZE as ir, rx as is, sA as it, Bh as iu, Vk as j, NC as ja, dv as jc, yo as jd, sn as jf, Qw as ji, bg as jl, Ie as jm, vD as jn, Xx as jo, Be as jp, gE as jr, ib as js, mk as jt, Os as ju, _A as k, MC as ka, uv as kc, Jo as kd, Qt as kf, eT as ki, Jg as kl, ze as km, bD as kn, tS as ko, A as kp, vE as kr, ub as ks, pk as kt, Wp as ku, tj as l, mw as la, Gv as lc, os as ld, Pn as lf, jT as li, N_ as ll, Ze as lm, eO as ln, CS as lo, Wt as lp, WE as lr, $b as ls, jk as lt, Vh as lu, DA as m, rw as ma, Mv as mc, Xo as md, wn as mf, ST as mi, w_ as ml, ot as mm, JD as mn, aS as mo, Mt as mp, PE as mr, Rb as ms, Ok as mt, Mh as mu, sj as n, Tw as na, Iv as nc, Oo as nd, Fn as nf, IT as ni, z_ as nl, $e as nm, xO as nn, PS as no, kt as np, YE as nr, ax as ns, Gk as nt, Kh as nu, YA as o, yw as oa, Bv as oc, ws as od, Vn as of, MT as oi, M_ as ol, lt as om, oO as on, NS as oo, Ut as op, VE as or, tx as os, dA as ot, zh as ou, TA as p, iw as pa, Nv as pc, wo as pd, hn as pf, ET as pi, b_ as pl, at as pm, qD as pn, hS as po, It as pp, IE as pr, Hb as ps, Ek as pt, Ph as pu, uA as q, WS as qa, q_ as qc, wr as qd, Ht as qf, kw as qi, ig as ql, nD as qn, px as qo, Me as qp, qT as qr, vy as qs, UO as qt, ds as qu, $A as r, Sw as ra, Hv as rc, ys as rd, Ln as rf, PT as ri, L_ as rl, et as rm, yO as rn, IS as ro, Tt as rp, $E as rr, ix as rs, oA as rt, Hh as ru, QA as s, gw as sa, Kv as sc, Mo as sd, Bn as sf, AT as si, k_ as sl, ye as sm, nO as sn, FS as so, At as sp, UE as sr, ex as ss, qk as st, Lh as su, cj as t, ww as ta, sy as tc, ts as td, In as tf, VT as ti, B_ as tl, P as tm, TO as tn, MS as to, Kt as tp, tD as tr, ox as ts, Uk as tt, Jh as tu, ej as u, fw as ua, Wv as uc, ls as ud, zn as uf, DT as ui, A_ as ul, ct as um, tO as un, TS as uo, Gt as up, GE as ur, qb as us, Mk as ut, Nh as uu, KA as v, QC as va, Pv as vc, Lo as vd, vn as vf, fT as vi, h_ as vl, qe as vm, RD as vn, pS as vo, bt as vp, jE as vr, Ib as vs, gk as vt, Rm as vu, CA as w, KC as wa, yv as wc, Qo as wd, ln as wf, $w as wi, t_ as wl, Ce as wm, AD as wn, uS as wo, ve as wp, CE as wr, gb as ws, fk as wt, lm as wu, NA as x, $C as xa, Sv as xc, To as xd, mn as xf, gT as xi, f_ as xl, Xe as xm, jD as xn, oS as xo, he as xp, OE as xr, Db as xs, lk as xt, sm as xu, GA as y, ZC as ya, xv as yc, Io as yd, _n as yf, hT as yi, m_ as yl, Je as ym, ND as yn, dS as yo, de as yp, EE as yr, Fb as ys, _k as yt, Im as yu, Lk as z, gC as za, rv as zc, Ua as zd, nn as zf, Jw as zi, pg as zl, uD as zn, Sx as zo, le as zp, rE as zr, Oy as zs, IO as zt, fs as zu };
70056
+ //#region src/serialization/registry.ts
70057
+ var Dj = /* @__PURE__ */ new Map();
70058
+ function Oj(e, t) {
70059
+ Dj.set(e, t);
70060
+ }
70061
+ function kj(e) {
70062
+ Dj.delete(e);
70063
+ }
70064
+ function Aj(e) {
70065
+ return Dj.get(e);
70066
+ }
70067
+ function jj() {
70068
+ return [...Dj.keys()].sort();
70069
+ }
70070
+ //#endregion
70071
+ //#region src/serialization/props.ts
70072
+ function Mj(e, t) {
70073
+ return typeof e == "number" && Number.isFinite(e) ? e : t;
70074
+ }
70075
+ function Nj(e, t) {
70076
+ return typeof e == "string" ? e : t;
70077
+ }
70078
+ function Pj(e, t) {
70079
+ return typeof e == "boolean" ? e : t;
70080
+ }
70081
+ function Fj(e) {
70082
+ return typeof e == "string" ? e : void 0;
70083
+ }
70084
+ function Ij(e) {
70085
+ return Array.isArray(e) && e.length === 3 && e.every((e) => typeof e == "number" && Number.isFinite(e));
70086
+ }
70087
+ function Lj(e, t) {
70088
+ return Ij(e) ? [
70089
+ e[0],
70090
+ e[1],
70091
+ e[2]
70092
+ ] : t;
70093
+ }
70094
+ function Rj(e) {
70095
+ if (!Array.isArray(e)) return [];
70096
+ let t = [];
70097
+ for (let n of e) Ij(n) && t.push([
70098
+ n[0],
70099
+ n[1],
70100
+ n[2]
70101
+ ]);
70102
+ return t;
70103
+ }
70104
+ function zj(e) {
70105
+ return typeof e == "object" && !!e && !Array.isArray(e);
70106
+ }
70107
+ //#endregion
70108
+ //#region src/serialization/defaults.ts
70109
+ function Bj(e) {
70110
+ return typeof e == "number" && Number.isFinite(e) ? e : Nj(e, "normal");
70111
+ }
70112
+ function Vj(e) {
70113
+ return e === "left" || e === "right" ? e : "center";
70114
+ }
70115
+ function Hj() {
70116
+ Oj("Circle", {
70117
+ serialize: (e) => {
70118
+ let t = e;
70119
+ return {
70120
+ radius: t._radius,
70121
+ numPoints: t._numPoints
70122
+ };
70123
+ },
70124
+ deserialize: (e) => new L_({
70125
+ radius: Mj(e.radius, 1),
70126
+ numPoints: Mj(e.numPoints, 64)
70127
+ })
70128
+ }), Oj("Rectangle", {
70129
+ serialize: (e) => {
70130
+ let t = e;
70131
+ return {
70132
+ width: t._width,
70133
+ height: t._height
70134
+ };
70135
+ },
70136
+ deserialize: (e) => new Yg({
70137
+ width: Mj(e.width, 2),
70138
+ height: Mj(e.height, 1)
70139
+ })
70140
+ }), Oj("Square", {
70141
+ serialize: (e) => ({ sideLength: e._width }),
70142
+ deserialize: (e) => new Xg({ sideLength: Mj(e.sideLength, 2) })
70143
+ }), Oj("Line", {
70144
+ serialize: (e) => {
70145
+ let t = e;
70146
+ return {
70147
+ start: [...t._start],
70148
+ end: [...t._end]
70149
+ };
70150
+ },
70151
+ deserialize: (e) => new s_({
70152
+ start: Lj(e.start, [
70153
+ 0,
70154
+ 0,
70155
+ 0
70156
+ ]),
70157
+ end: Lj(e.end, [
70158
+ 1,
70159
+ 0,
70160
+ 0
70161
+ ])
70162
+ })
70163
+ }), Oj("Dot", {
70164
+ serialize: (e) => ({ radius: e._radius }),
70165
+ deserialize: (e) => new sv({ radius: Mj(e.radius, .08) })
70166
+ }), Oj("Polygon", {
70167
+ serialize: (e) => ({
70168
+ vertices: e.getVertices().map((e) => [...e]),
70169
+ closed: e._closed
70170
+ }),
70171
+ deserialize: (e) => {
70172
+ let t = Rj(e.vertices);
70173
+ return new R_({
70174
+ vertices: t.length >= 2 ? t : [[
70175
+ 0,
70176
+ 0,
70177
+ 0
70178
+ ], [
70179
+ 1,
70180
+ 0,
70181
+ 0
70182
+ ]],
70183
+ closed: Pj(e.closed, !0)
70184
+ });
70185
+ }
70186
+ }), Oj("Group", {
70187
+ serialize: () => ({}),
70188
+ deserialize: () => new Yh()
70189
+ }), Oj("VGroup", {
70190
+ serialize: () => ({}),
70191
+ deserialize: () => new L()
70192
+ }), Oj("Text", {
70193
+ serialize: (e) => {
70194
+ let t = e;
70195
+ return {
70196
+ text: e.getText(),
70197
+ fontSize: e.getFontSize(),
70198
+ fontFamily: e.getFontFamily(),
70199
+ fontWeight: t._fontWeight,
70200
+ fontStyle: t._fontStyle,
70201
+ lineHeight: t._lineHeight,
70202
+ letterSpacing: t._letterSpacing,
70203
+ textAlign: t._textAlign
70204
+ };
70205
+ },
70206
+ deserialize: (e) => new ih({
70207
+ text: Nj(e.text, ""),
70208
+ fontSize: Mj(e.fontSize, 48),
70209
+ fontFamily: Nj(e.fontFamily, "CMU Serif, Georgia, Times New Roman, serif"),
70210
+ fontWeight: Bj(e.fontWeight),
70211
+ fontStyle: Nj(e.fontStyle, "normal"),
70212
+ lineHeight: Mj(e.lineHeight, 1.2),
70213
+ letterSpacing: Mj(e.letterSpacing, 0),
70214
+ textAlign: Vj(e.textAlign)
70215
+ })
70216
+ }), Oj("MathTex", {
70217
+ serialize: (e) => {
70218
+ let t = e;
70219
+ return {
70220
+ latex: e.getLatex(),
70221
+ fontSize: t._fontSize,
70222
+ displayMode: t._displayMode
70223
+ };
70224
+ },
70225
+ deserialize: (e) => new Xy({
70226
+ latex: Nj(e.latex, ""),
70227
+ fontSize: Mj(e.fontSize, 1),
70228
+ displayMode: Pj(e.displayMode, !0)
70229
+ })
70230
+ });
70231
+ }
70232
+ //#endregion
70233
+ //#region src/serialization/types.ts
70234
+ var Uj = "manim-web-scene", Wj = {
70235
+ position: [
70236
+ 0,
70237
+ 0,
70238
+ 0
70239
+ ],
70240
+ rotation: [
70241
+ 0,
70242
+ 0,
70243
+ 0
70244
+ ],
70245
+ scale: [
70246
+ 1,
70247
+ 1,
70248
+ 1
70249
+ ]
70250
+ };
70251
+ function Gj(e) {
70252
+ return {
70253
+ position: [
70254
+ e.position.x,
70255
+ e.position.y,
70256
+ e.position.z
70257
+ ],
70258
+ rotation: [
70259
+ e.rotation.x,
70260
+ e.rotation.y,
70261
+ e.rotation.z
70262
+ ],
70263
+ scale: [
70264
+ e.scaleVector.x,
70265
+ e.scaleVector.y,
70266
+ e.scaleVector.z
70267
+ ]
70268
+ };
70269
+ }
70270
+ function Kj(e) {
70271
+ let t = {};
70272
+ return e.strokeColor !== void 0 && (t.strokeColor = e.strokeColor), e.fillColor !== void 0 && (t.fillColor = e.fillColor), typeof e.opacity == "number" && (t.strokeOpacity = e.opacity), typeof e.fillOpacity == "number" && (t.fillOpacity = e.fillOpacity), typeof e.strokeWidth == "number" && (t.strokeWidth = e.strokeWidth), t;
70273
+ }
70274
+ function qj(e, t) {
70275
+ let n = zj(t) ? t : {}, r = Lj(n.position, Wj.position), i = Lj(n.rotation, Wj.rotation), a = Lj(n.scale, Wj.scale);
70276
+ e.position.set(r[0], r[1], r[2]), e.rotation.set(i[0], i[1], i[2]), e.scaleVector.set(a[0], a[1], a[2]);
70277
+ }
70278
+ function Jj(e, t) {
70279
+ let n = zj(t) ? t : {};
70280
+ typeof n.strokeWidth == "number" && e.setStrokeWidth(n.strokeWidth), typeof n.strokeOpacity == "number" && e.setStrokeOpacity(n.strokeOpacity), typeof n.fillOpacity == "number" && e.setFillOpacity(n.fillOpacity);
70281
+ let r = Fj(n.strokeColor), i = Fj(n.fillColor);
70282
+ r !== void 0 && (e.color = r), r !== void 0 && (e.strokeColor = r), i !== void 0 && (e.fillColor = i);
70283
+ }
70284
+ function Yj(e) {
70285
+ let t = e.constructor.name, n = Aj(t), r = {
70286
+ type: t,
70287
+ props: n ? n.serialize(e) : {},
70288
+ transform: Gj(e),
70289
+ style: Kj(e),
70290
+ children: e.children.map(Yj)
70291
+ };
70292
+ return n || (r.unknown = !0), r;
70293
+ }
70294
+ function Xj(e) {
70295
+ if (!zj(e) || e.unknown === !0) return null;
70296
+ let t = Fj(e.type);
70297
+ if (t === void 0) return null;
70298
+ let n = Aj(t);
70299
+ if (!n) return null;
70300
+ let r = zj(e.props) ? e.props : {}, i = n.deserialize(r);
70301
+ if (qj(i, e.transform), Jj(i, e.style), Array.isArray(e.children)) for (let t of e.children) {
70302
+ let e = Xj(t);
70303
+ e && i.add(e);
70304
+ }
70305
+ return i;
70306
+ }
70307
+ function Zj(e) {
70308
+ let t = [];
70309
+ for (let n of e.mobjects) t.push(Yj(n));
70310
+ return {
70311
+ format: Uj,
70312
+ version: 1,
70313
+ mobjects: t
70314
+ };
70315
+ }
70316
+ function Qj(e, t) {
70317
+ if (!zj(e) || !Array.isArray(e.mobjects)) return [];
70318
+ let n = [];
70319
+ for (let r of e.mobjects) {
70320
+ let e = Xj(r);
70321
+ e && (t.add(e), n.push(e));
70322
+ }
70323
+ return n;
70324
+ }
70325
+ //#endregion
70326
+ //#region src/serialization/index.ts
70327
+ Hj();
70328
+ //#endregion
70329
+ //#region src/mobjects/geo/geojson.ts
70330
+ function $j(e) {
70331
+ if (e.type === "Polygon") {
70332
+ let t = e.coordinates[0];
70333
+ return t ? [t] : [];
70334
+ }
70335
+ let t = [];
70336
+ for (let n of e.coordinates) {
70337
+ let e = n[0];
70338
+ e && t.push(e);
70339
+ }
70340
+ return t;
70341
+ }
70342
+ //#endregion
70343
+ //#region src/mobjects/geo/projections.ts
70344
+ var eM = Math.PI / 180;
70345
+ function tM(e = {}) {
70346
+ let { radius: t = 1, centerLon: n = 0, centerLat: r = 0, standardParallel: i = 0 } = e, a = Math.cos(i * eM);
70347
+ return ([e, i]) => [(e - n) * eM * t * a, (i - r) * eM * t];
70348
+ }
70349
+ function nM(e = {}) {
70350
+ let { radius: t = 1, centerLon: n = 0, maxLatitude: r = 85.05112878 } = e;
70351
+ return ([e, i]) => {
70352
+ let a = Math.max(-r, Math.min(r, i)) * eM;
70353
+ return [(e - n) * eM * t, t * Math.log(Math.tan(Math.PI / 4 + a / 2))];
70354
+ };
70355
+ }
70356
+ //#endregion
70357
+ //#region src/mobjects/geo/colorScale.ts
70358
+ var rM = ["#0d1b2a", "#4cc9f0"], iM = class {
70359
+ _palette;
70360
+ _domain;
70361
+ constructor(e = {}) {
70362
+ let { colors: t = rM, domain: n = [0, 1], samples: r = 256 } = e, i = Math.max(2, Math.floor(r));
70363
+ this._palette = Ua(t.length > 0 ? t : rM, i), this._domain = [n[0], n[1]];
70364
+ }
70365
+ setDomainFromValues(e) {
70366
+ let t = Infinity, n = -Infinity;
70367
+ for (let r of e) Number.isFinite(r) && (r < t && (t = r), r > n && (n = r));
70368
+ return Number.isFinite(t) && Number.isFinite(n) && (this._domain = [t, n]), this;
70369
+ }
70370
+ getDomain() {
70371
+ return [this._domain[0], this._domain[1]];
70372
+ }
70373
+ colorFor(e) {
70374
+ let [t, n] = this._domain, r = n - t, i = r === 0 || !Number.isFinite(e) ? 0 : (e - t) / r;
70375
+ i = Math.max(0, Math.min(1, i));
70376
+ let a = Math.round(i * (this._palette.length - 1));
70377
+ return this._palette[a];
70378
+ }
70379
+ }, aM = class extends Yh {
70380
+ _projection;
70381
+ _colorScale;
70382
+ _regions = [];
70383
+ _regionColors = [];
70384
+ _regionPolygons = [];
70385
+ constructor(e) {
70386
+ super();
70387
+ let { geojson: t, value: n, colorScale: r = ["#0d1b2a", "#4cc9f0"], domain: i, fillOpacity: a = 1, noDataColor: o = pe, borderColor: s = "#1b263b", borderWidth: c = 1, projection: l = tM() } = e;
70388
+ this._projection = l;
70389
+ let u = t.features ?? [], d = u.map((e, t) => n(e, t));
70390
+ this._colorScale = new iM({
70391
+ colors: r,
70392
+ domain: i
70393
+ }), i || this._colorScale.setDomainFromValues(d.filter((e) => typeof e == "number" && Number.isFinite(e))), u.forEach((e, t) => {
70394
+ this._buildRegion(e, d[t], {
70395
+ fillOpacity: a,
70396
+ noDataColor: o,
70397
+ borderColor: s,
70398
+ borderWidth: c
70399
+ });
70400
+ });
70401
+ }
70402
+ _buildRegion(e, t, n) {
70403
+ let r = typeof t == "number" && Number.isFinite(t) ? this._colorScale.colorFor(t) : n.noDataColor, i = $j(e.geometry), a = [];
70404
+ for (let e of i) {
70405
+ let t = this._buildPolygon(e, r, n);
70406
+ t && a.push(t);
70407
+ }
70408
+ let o = a.length === 1 ? a[0] : new Yh(...a);
70409
+ this.add(o), this._regions.push(o), this._regionColors.push(r), this._regionPolygons.push(a);
70410
+ }
70411
+ _buildPolygon(e, t, n) {
70412
+ let r = sM(e);
70413
+ if (r.length < 3) return null;
70414
+ let i = new R_({
70415
+ vertices: r.map((e) => {
70416
+ let [t, n] = this._projection(e);
70417
+ return [
70418
+ t,
70419
+ n,
70420
+ 0
70421
+ ];
70422
+ }),
70423
+ color: n.borderColor,
70424
+ strokeWidth: n.borderWidth,
70425
+ fillOpacity: n.fillOpacity,
70426
+ closed: !0
70427
+ });
70428
+ return i.setFill(t, n.fillOpacity), i;
70429
+ }
70430
+ getRegions() {
70431
+ return [...this._regions];
70432
+ }
70433
+ getRegionCount() {
70434
+ return this._regions.length;
70435
+ }
70436
+ getRegionColor(e) {
70437
+ return this._regionColors[e];
70438
+ }
70439
+ getRegionPolygons(e) {
70440
+ return [...this._regionPolygons[e] ?? []];
70441
+ }
70442
+ getProjection() {
70443
+ return this._projection;
70444
+ }
70445
+ getColorScale() {
70446
+ return this._colorScale;
70447
+ }
70448
+ }, oM = aM;
70449
+ function sM(e) {
70450
+ if (e.length < 2) return e;
70451
+ let t = e[0], n = e[e.length - 1];
70452
+ return t[0] === n[0] && t[1] === n[1] ? e.slice(0, -1) : e;
70453
+ }
70454
+ //#endregion
70455
+ //#region src/mobjects/geo/Globe.ts
70456
+ var cM = Math.PI / 180, lM = class extends Yh {
70457
+ _radius;
70458
+ _center;
70459
+ _sphere;
70460
+ _plottedPoints = [];
70461
+ constructor(e = {}) {
70462
+ super();
70463
+ let { radius: t = 1, center: n = [
70464
+ 0,
70465
+ 0,
70466
+ 0
70467
+ ], textureUrl: r, darkTextureUrl: i, color: a = "#2a6f97", opacity: o = 1, resolution: s = 64 } = e;
70468
+ this._radius = t, this._center = [...n], r ? this._sphere = bx({
70469
+ textureUrl: r,
70470
+ darkTextureUrl: i,
70471
+ radius: t,
70472
+ center: n,
70473
+ resolution: s,
70474
+ opacity: o
70475
+ }) : this._sphere = new tx({
70476
+ radius: t,
70477
+ center: n,
70478
+ color: a,
70479
+ opacity: o,
70480
+ resolution: s
70481
+ }), this.add(this._sphere);
70482
+ }
70483
+ getSphere() {
70484
+ return this._sphere;
70485
+ }
70486
+ getRadius() {
70487
+ return this._radius;
70488
+ }
70489
+ latLonToPoint(e, t) {
70490
+ return this._surfacePoint(e, t, this._radius);
70491
+ }
70492
+ plotPoint(e, t, n = {}) {
70493
+ let { size: r = this._radius * .03, color: i = "#ffd166" } = n, a = new Cx({
70494
+ point: this.latLonToPoint(e, t),
70495
+ radius: r,
70496
+ color: i
70497
+ });
70498
+ return this.add(a), this._plottedPoints.push(a), a;
70499
+ }
70500
+ getPlottedPoints() {
70501
+ return [...this._plottedPoints];
70502
+ }
70503
+ arc(e, t, n = {}) {
70504
+ let { segments: r = 64, color: i = "#ef476f", lineWidth: a = 2, altitude: o = 0 } = n, s = this._radius * (1 + o), c = uM(e[0], e[1]), l = uM(t[0], t[1]), u = pM(c[0] * l[0] + c[1] * l[1] + c[2] * l[2], -1, 1), d = Math.acos(u), f = Math.sin(d), p = [];
70505
+ for (let e = 0; e <= r; e++) {
70506
+ let t = dM(c, l, e / r, d, f);
70507
+ p.push([
70508
+ this._center[0] + s * t[0],
70509
+ this._center[1] + s * t[1],
70510
+ this._center[2] + s * t[2]
70511
+ ]);
70512
+ }
70513
+ let m = new R_({
70514
+ vertices: p,
70515
+ color: i,
70516
+ strokeWidth: a,
70517
+ closed: !1
70518
+ });
70519
+ return this.add(m), m;
70520
+ }
70521
+ graticule(e = {}) {
70522
+ let { latStep: t = 30, lonStep: n = 30, segments: r = 48, color: i = "#8d99ae", lineWidth: a = 1 } = e, o = new Yh();
70523
+ for (let e = -180; e < 180; e += n) o.add(this._gridLine(mM(e, r), i, a));
70524
+ for (let e = -90 + t; e < 90; e += t) o.add(this._gridLine(hM(e, r), i, a));
70525
+ return this.add(o), o;
70526
+ }
70527
+ _gridLine(e, t, n) {
70528
+ return new R_({
70529
+ vertices: e.map(([e, t]) => this.latLonToPoint(e, t)),
70530
+ color: t,
70531
+ strokeWidth: n,
70532
+ closed: !1
70533
+ });
70534
+ }
70535
+ _surfacePoint(e, t, n) {
70536
+ let r = uM(e, t);
70537
+ return [
70538
+ this._center[0] + n * r[0],
70539
+ this._center[1] + n * r[1],
70540
+ this._center[2] + n * r[2]
70541
+ ];
70542
+ }
70543
+ };
70544
+ function uM(e, t) {
70545
+ let n = e * cM, r = t * cM, i = Math.cos(n);
70546
+ return [
70547
+ i * Math.cos(r),
70548
+ i * Math.sin(r),
70549
+ Math.sin(n)
70550
+ ];
70551
+ }
70552
+ function dM(e, t, n, r, i) {
70553
+ if (i < 1e-9) return fM([
70554
+ e[0] + (t[0] - e[0]) * n,
70555
+ e[1] + (t[1] - e[1]) * n,
70556
+ e[2] + (t[2] - e[2]) * n
70557
+ ]);
70558
+ let a = Math.sin((1 - n) * r) / i, o = Math.sin(n * r) / i;
70559
+ return [
70560
+ e[0] * a + t[0] * o,
70561
+ e[1] * a + t[1] * o,
70562
+ e[2] * a + t[2] * o
70563
+ ];
70564
+ }
70565
+ function fM(e) {
70566
+ let t = Math.sqrt(e[0] * e[0] + e[1] * e[1] + e[2] * e[2]) || 1;
70567
+ return [
70568
+ e[0] / t,
70569
+ e[1] / t,
70570
+ e[2] / t
70571
+ ];
70572
+ }
70573
+ function pM(e, t, n) {
70574
+ return Math.max(t, Math.min(n, e));
70575
+ }
70576
+ function mM(e, t) {
70577
+ let n = [];
70578
+ for (let r = 0; r <= t; r++) n.push([-90 + 180 * r / t, e]);
70579
+ return n;
70580
+ }
70581
+ function hM(e, t) {
70582
+ let n = [];
70583
+ for (let r = 0; r <= t; r++) n.push([e, -180 + 360 * r / t]);
70584
+ return n;
70585
+ }
70586
+ //#endregion
70587
+ export { _A as $, jC as $a, mv as $c, Ko as $d, tn as $f, rT as $i, Xg as $l, E as $m, wD as $n, eS as $o, pt as $p, vE as $r, mb as $s, $O as $t, Kp as $u, $A as A, vw as Aa, Vv as Ac, ps as Ad, Rn as Af, IT as Ai, P_ as Al, dt as Am, dO as An, jS as Ao, ht as Ap, VE as Ar, nx as As, Hk as At, Rh as Au, HA as B, nw as Ba, Dv as Bc, Yo as Bd, yn as Bf, wT as Bi, v_ as Bl, st as Bm, HD as Bn, sS as Bo, Nt as Bp, jE as Br, Bb as Bs, Rk as Bt, Ah as Bu, mj as C, Ow as Ca, iy as Cc, ko as Cd, Sr as Cf, tE as Ci, V_ as Cl, mt as Cm, gO as Cn, RS as Co, jt as Cp, $E as Cr, lx as Cs, qk as Ct, Xh as Cu, QA as D, Tw as Da, Iv as Dc, Oo as Dd, Fn as Df, LT as Di, z_ as Dl, $e as Dm, pO as Dn, PS as Do, kt as Dp, XE as Dr, ax as Ds, Uk as Dt, Kh as Du, YA as E, ww as Ea, sy as Ec, ts as Ed, In as Ef, HT as Ei, B_ as El, P as Em, hO as En, MS as Eo, Kt as Ep, nD as Er, ox as Es, Jk as Et, Jh as Eu, XA as F, fw as Fa, Wv as Fc, ls as Fd, zn as Ff, OT as Fi, A_ as Fl, ct as Fm, tO as Fn, TS as Fo, Gt as Fp, KE as Fr, qb as Fs, zk as Ft, Nh as Fu, PA as G, XC as Ga, Cv as Gc, Wo as Gd, xn as Gf, mT as Gi, d_ as Gl, Ye as Gm, FD as Gn, gS as Go, be as Gp, EE as Gr, Eb as Gs, kk as Gt, hm as Gu, RA as H, YC as Ha, Ov as Hc, qo as Hd, bn as Hf, xT as Hi, __ as Hl, Ke as Hm, ID as Hn, lS as Ho, yt as Hp, NE as Hr, Lb as Hs, Ek as Ht, Hm as Hu, ZA as I, cw as Ia, jv as Ic, ns as Id, a as If, kT as Ii, O_ as Il, rt as Im, nO as In, wS as Io, gt as Ip, IE as Ir, Wb as Is, Dk as It, jh as Iu, fA as J, JC as Ja, bv as Jc, $o as Jd, dn as Jf, nT as Ji, s_ as Jl, Se as Jm, AD as Jn, vS as Jo, _e as Jp, CE as Jr, vb as Js, _k as Jt, cm as Ju, aA as K, $C as Ka, Sv as Kc, To as Kd, mn as Kf, _T as Ki, f_ as Kl, Xe as Km, MD as Kn, oS as Ko, he as Kp, kE as Kr, Db as Ks, Mk as Kt, sm as Ku, zA as L, aw as La, Av as Lc, Zo as Ld, Cn as Lf, ET as Li, D_ as Ll, it as Lm, JD as Ln, ES as Lo, Dt as Lp, PE as Lr, Vb as Ls, Ok as Lt, kh as Lu, WA as M, gw as Ma, Kv as Mc, Mo as Md, Bn as Mf, jT as Mi, k_ as Ml, ye as Mm, lO as Mn, FS as Mo, At as Mp, WE as Mr, ex as Ms, Tk as Mt, Lh as Mu, uj as N, _w as Na, qv as Nc, Ao as Nd, Mn as Nf, PT as Ni, j_ as Nl, Ne as Nm, iO as Nn, LS as No, Pt as Np, UE as Nr, Jb as Ns, Pk as Nt, Ih as Nu, UA as O, Sw as Oa, Hv as Oc, ys as Od, Ln as Of, FT as Oi, L_ as Ol, et as Om, mO as On, IS as Oo, Tt as Op, eD as Or, ix as Os, Wk as Ot, Hh as Ou, lj as P, mw as Pa, Gv as Pc, os as Pd, Pn as Pf, MT as Pi, N_ as Pl, Ze as Pm, aO as Pn, CS as Po, Wt as Pp, GE as Pr, $b as Ps, Fk as Pt, Vh as Pu, yA as Q, LC as Qa, gv as Qc, Fo as Qd, Yt as Qf, iT as Qi, Yg as Ql, Ee as Qm, CD as Qn, $x as Qo, xe as Qp, bE as Qr, pb as Qs, ak as Qt, Qp as Qu, BA as R, iw as Ra, Nv as Rc, wo as Rd, hn as Rf, DT as Ri, b_ as Rl, at as Rm, ZD as Rn, hS as Ro, It as Rp, LE as Rr, Hb as Rs, Ik as Rt, Ph as Ru, gj as S, Aw as Sa, oy as Sc, rs as Sd, _r as Sf, QT as Si, U_ as Sl, ut as Sm, vO as Sn, BS as So, _t as Sp, YE as Sr, ux as Ss, dA as St, Zh as Su, vj as T, Mw as Ta, ry as Tc, cs as Td, Nn as Tf, VT as Ti, R_ as Tl, Qe as Tm, xO as Tn, AS as To, Ot as Tp, JE as Tr, cx as Ts, Xk as Tt, qh as Tu, IA as U, QC as Ua, Pv as Uc, Lo as Ud, vn as Uf, pT as Ui, h_ as Ul, qe as Um, zD as Un, pS as Uo, bt as Up, ME as Ur, Ib as Us, Lk as Ut, Rm as Uu, LA as V, tw as Va, kv as Vc, Bo as Vd, gn as Vf, bT as Vi, C_ as Vl, N as Vm, WD as Vn, _S as Vo, vt as Vp, AE as Vr, zb as Vs, Nk as Vt, ih as Vu, FA as W, ZC as Wa, xv as Wc, Io as Wd, _n as Wf, gT as Wi, m_ as Wl, Je as Wm, PD as Wn, dS as Wo, de as Wp, DE as Wr, Fb as Ws, jk as Wt, Im as Wu, bA as X, RC as Xa, vv as Xc, Go as Xd, fn as Xf, Xw as Xi, $g as Xl, we as Xm, OD as Xn, mS as Xo, j as Xp, SE as Xr, bb as Xs, Sk as Xt, im as Xu, EA as Y, KC as Ya, yv as Yc, Qo as Yd, ln as Yf, eT as Yi, t_ as Yl, Ce as Ym, jD as Yn, uS as Yo, ve as Yp, wE as Yr, gb as Ys, vk as Yt, lm as Yu, hA as Z, FC as Za, hv as Zc, zo as Zd, Xt as Zf, Qw as Zi, e_ as Zl, Te as Zm, kD as Zn, fS as Zo, me as Zp, xE as Zr, yb as Zs, Ck as Zt, Jp as Zu, Tj as _, Bw as _a, yy as _c, R as _d, Tr as _f, YT as _i, J_ as _l, je as _m, zO as _n, XS as _o, Bt as _p, oD as _r, gx as _s, lA as _t, rg as _u, tM as a, Uw as aa, nb as ac, Vo as ad, xo as af, M as ah, pE as ai, lv as al, Ue as am, ik as an, kC as ao, $t as ap, _D as ar, Jx as as, xA as at, _g as au, bj as b, Nw as ba, cy as bc, ss as bd, yr as bf, XT as bi, G_ as bl, ft as bm, SO as bn, VS as bo, St as bp, qE as br, fx as bs, DA as bt, $h as bu, Xj as c, Hw as ca, Zy as cc, vs as cd, L as cf, uE as ci, av as cl, D as cm, sk as cn, yC as co, an as cp, pD as cr, Rx as cs, OA as ct, sg as cu, Zj as d, Kw as da, Ty as dc, Cs as dd, Pa as df, oE as di, nv as dl, O as dm, uk as dn, vC as do, Et as dp, fD as dr, wx as ds, rA as dt, og as du, tT as ea, ub as ec, Wp as ed, Jo as ef, ze as eh, yE as ei, uv as el, A as em, ek as en, MC as eo, Qt as ep, xD as er, tS as es, tA as et, Jg as eu, jj as f, Fw as fa, wy as fc, jo as fd, Na as ff, cE as fi, tv as fl, ue as fm, nk as fn, iC as fo, Ft as fp, lD as fr, xx as fs, vA as ft, dg as fu, Ej as g, Rw as ga, xy as gc, ms as gd, Cr as gf, lE as gi, Y_ as gl, Ae as gm, UO as gn, YS as go, xt as gp, aD as gr, vx as gs, sA as gt, ag as gu, kj as h, Iw as ha, by as hc, Ts as hd, kr as hf, sE as hi, X_ as hl, ke as hm, WO as hn, qS as ho, Ct as hp, cD as hr, _x as hs, cA as ht, cg as hu, iM as i, Vw as ia, sb as ic, z as id, So as if, Re as ih, mE as ii, sv as il, He as im, lk as in, AC as io, en as ip, hD as ir, Qx as is, SA as it, vg as iu, KA as j, yw as ja, Bv as jc, ws as jd, Vn as jf, NT as ji, M_ as jl, lt as jm, cO as jn, NS as jo, Ut as jp, HE as jr, tx as js, wk as jt, zh as ju, GA as k, Cw as ka, Uv as kc, No as kd, Hn as kf, RT as ki, I_ as kl, tt as km, uO as kn, kS as ko, Rt as kp, QE as kr, rx as ks, Kk as kt, Bh as ku, Qj as l, Ww as la, Wy as lc, Po as ld, I as lf, nE as li, iv as ll, ce as lm, tk as ln, _C as lo, rn as lp, mD as lr, Cx as ls, oA as lt, mg as lu, Oj as m, zw as ma, Sy as mc, bs as md, Bi as mf, aE as mi, ev as ml, Oe as mm, HO as mn, KS as mo, wt as mp, sD as mr, bx as ms, uA as mt, lg as mu, aM as n, $w as na, ib as nc, Os as nd, yo as nf, Ie as nh, _E as ni, dv as nl, Be as nm, QO as nn, NC as no, sn as np, yD as nr, Xx as ns, mA as nt, bg as nu, nM as o, Jw as oa, Qy as oc, Ro as od, Co as of, fE as oi, cv as ol, We as om, rk as on, OC as oo, Jt as op, gD as or, Hx as os, eA as ot, hg as ou, Aj as p, Lw as pa, Cy as pc, Eo as pd, La as pf, rE as pi, Z_ as pl, Pe as pm, GO as pn, JS as po, qt as pp, uD as pr, yx as ps, gA as pt, ug as pu, pA as q, ew as qa, wv as qc, es as qd, Sn as qf, oT as qi, p_ as ql, De as qm, ND as qn, cS as qo, ge as qp, OE as qr, xb as qs, yk as qt, um as qu, oM as r, aT as ra, ab as rc, Es as rd, bo as rf, Le as rh, hE as ri, fv as rl, Ve as rm, XO as rn, PC as ro, cn as rp, bD as rr, Yx as rs, AA as rt, yg as ru, $j as s, Gw as sa, Xy as sc, Do as sd, co as sf, dE as si, ov as sl, pe as sm, ck as sn, bC as so, on as sp, vD as sr, Vx as ss, nA as st, fg as su, lM as t, Zw as ta, lb as tc, Hp as td, vo as tf, Fe as th, gE as ti, pv as tl, Ge as tm, ZO as tn, IC as to, Zt as tp, SD as tr, Zx as ts, CA as tt, Gg as tu, Yj as u, Yw as ua, Oy as uc, fs as ud, Ua as uf, iE as ui, rv as ul, le as um, YO as un, gC as uo, nn as up, dD as ur, Sx as us, iA as ut, pg as uu, _j as v, kw as va, vy as vc, ds as vd, wr as vf, JT as vi, q_ as vl, Me as vm, FO as vn, WS as vo, Ht as vp, rD as vr, px as vs, wA as vt, ig as vu, yj as w, Pw as wa, ay as wc, as as wd, vr as wf, eE as wi, H_ as wl, nt as wm, bO as wn, OS as wo, Lt as wp, ZE as wr, sx as ws, Yk as wt, Yh as wu, pj as x, jw as xa, ly as xc, us as xd, xr as xf, $T as xi, W_ as xl, fe as xm, _O as xn, HS as xo, zt as xp, tD as xr, dx as xs, kA as xt, Qh as xu, hj as y, Dw as ya, uy as yc, is as yd, br as yf, ZT as yi, K_ as yl, k as ym, CO as yn, US as yo, Vt as yp, iD as yr, mx as ys, TA as yt, eg as yu, VA as z, rw as za, Mv as zc, Xo as zd, wn as zf, CT as zi, w_ as zl, ot as zm, YD as zn, aS as zo, Mt as zp, FE as zr, Rb as zs, Ak as zt, Mh as zu };