@wemap/viewer 14.8.0-beta.3 → 14.8.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8869,7 +8869,11 @@ var yo = class extends Kt {
8869
8869
  }
8870
8870
  }
8871
8871
  }
8872
- }, Do = class {
8872
+ }, Do = class extends Eo {
8873
+ constructor(e, t) {
8874
+ super(e, t), this.isLineLoop = !0, this.type = "LineLoop";
8875
+ }
8876
+ }, Oo = class {
8873
8877
  constructor() {
8874
8878
  this.type = "Curve", this.arcLengthDivisions = 200;
8875
8879
  }
@@ -8974,7 +8978,7 @@ var yo = class extends Kt {
8974
8978
  fromJSON(e) {
8975
8979
  return this.arcLengthDivisions = e.arcLengthDivisions, this;
8976
8980
  }
8977
- }, Oo = class extends Do {
8981
+ }, ko = class extends Oo {
8978
8982
  constructor(e = 0, t = 0, n = 1, r = 1, i = 0, a = Math.PI * 2, o = !1, s = 0) {
8979
8983
  super(), this.isEllipseCurve = !0, this.type = "EllipseCurve", this.aX = e, this.aY = t, this.xRadius = n, this.yRadius = r, this.aStartAngle = i, this.aEndAngle = a, this.aClockwise = o, this.aRotation = s;
8980
8984
  }
@@ -9000,12 +9004,12 @@ var yo = class extends Kt {
9000
9004
  fromJSON(e) {
9001
9005
  return super.fromJSON(e), this.aX = e.aX, this.aY = e.aY, this.xRadius = e.xRadius, this.yRadius = e.yRadius, this.aStartAngle = e.aStartAngle, this.aEndAngle = e.aEndAngle, this.aClockwise = e.aClockwise, this.aRotation = e.aRotation, this;
9002
9006
  }
9003
- }, ko = class extends Oo {
9007
+ }, Ao = class extends ko {
9004
9008
  constructor(e, t, n, r, i, a) {
9005
9009
  super(e, t, n, n, r, i, a), this.isArcCurve = !0, this.type = "ArcCurve";
9006
9010
  }
9007
9011
  };
9008
- function Ao() {
9012
+ function jo() {
9009
9013
  let e = 0, t = 0, n = 0, r = 0;
9010
9014
  function i(i, a, o, s) {
9011
9015
  e = i, t = o, n = -3 * i + 3 * a - 2 * o - s, r = 2 * i - 2 * a + o + s;
@@ -9024,7 +9028,7 @@ function Ao() {
9024
9028
  }
9025
9029
  };
9026
9030
  }
9027
- var jo = /*@__PURE__*/ new X(), Mo = /*@__PURE__*/ new Ao(), No = /*@__PURE__*/ new Ao(), Po = /*@__PURE__*/ new Ao(), Fo = class extends Do {
9031
+ var Mo = /*@__PURE__*/ new X(), No = /*@__PURE__*/ new jo(), Po = /*@__PURE__*/ new jo(), Fo = /*@__PURE__*/ new jo(), Io = class extends Oo {
9028
9032
  constructor(e = [], t = !1, n = "centripetal", r = .5) {
9029
9033
  super(), this.isCatmullRomCurve3 = !0, this.type = "CatmullRomCurve3", this.points = e, this.closed = t, this.curveType = n, this.tension = r;
9030
9034
  }
@@ -9032,13 +9036,13 @@ var jo = /*@__PURE__*/ new X(), Mo = /*@__PURE__*/ new Ao(), No = /*@__PURE__*/
9032
9036
  let n = t, r = this.points, i = r.length, a = (i - +!this.closed) * e, o = Math.floor(a), s = a - o;
9033
9037
  this.closed ? o += o > 0 ? 0 : (Math.floor(Math.abs(o) / i) + 1) * i : s === 0 && o === i - 1 && (o = i - 2, s = 1);
9034
9038
  let c, l;
9035
- this.closed || o > 0 ? c = r[(o - 1) % i] : (jo.subVectors(r[0], r[1]).add(r[0]), c = jo);
9039
+ this.closed || o > 0 ? c = r[(o - 1) % i] : (Mo.subVectors(r[0], r[1]).add(r[0]), c = Mo);
9036
9040
  let u = r[o % i], d = r[(o + 1) % i];
9037
- if (this.closed || o + 2 < i ? l = r[(o + 2) % i] : (jo.subVectors(r[i - 1], r[i - 2]).add(r[i - 1]), l = jo), this.curveType === "centripetal" || this.curveType === "chordal") {
9041
+ if (this.closed || o + 2 < i ? l = r[(o + 2) % i] : (Mo.subVectors(r[i - 1], r[i - 2]).add(r[i - 1]), l = Mo), this.curveType === "centripetal" || this.curveType === "chordal") {
9038
9042
  let e = this.curveType === "chordal" ? .5 : .25, t = c.distanceToSquared(u) ** +e, n = u.distanceToSquared(d) ** +e, r = d.distanceToSquared(l) ** +e;
9039
- n < 1e-4 && (n = 1), t < 1e-4 && (t = n), r < 1e-4 && (r = n), Mo.initNonuniformCatmullRom(c.x, u.x, d.x, l.x, t, n, r), No.initNonuniformCatmullRom(c.y, u.y, d.y, l.y, t, n, r), Po.initNonuniformCatmullRom(c.z, u.z, d.z, l.z, t, n, r);
9040
- } else this.curveType === "catmullrom" && (Mo.initCatmullRom(c.x, u.x, d.x, l.x, this.tension), No.initCatmullRom(c.y, u.y, d.y, l.y, this.tension), Po.initCatmullRom(c.z, u.z, d.z, l.z, this.tension));
9041
- return n.set(Mo.calc(s), No.calc(s), Po.calc(s)), n;
9043
+ n < 1e-4 && (n = 1), t < 1e-4 && (t = n), r < 1e-4 && (r = n), No.initNonuniformCatmullRom(c.x, u.x, d.x, l.x, t, n, r), Po.initNonuniformCatmullRom(c.y, u.y, d.y, l.y, t, n, r), Fo.initNonuniformCatmullRom(c.z, u.z, d.z, l.z, t, n, r);
9044
+ } else this.curveType === "catmullrom" && (No.initCatmullRom(c.x, u.x, d.x, l.x, this.tension), Po.initCatmullRom(c.y, u.y, d.y, l.y, this.tension), Fo.initCatmullRom(c.z, u.z, d.z, l.z, this.tension));
9045
+ return n.set(No.calc(s), Po.calc(s), Fo.calc(s)), n;
9042
9046
  }
9043
9047
  copy(e) {
9044
9048
  super.copy(e), this.points = [];
@@ -9066,47 +9070,47 @@ var jo = /*@__PURE__*/ new X(), Mo = /*@__PURE__*/ new Ao(), No = /*@__PURE__*/
9066
9070
  return this.closed = e.closed, this.curveType = e.curveType, this.tension = e.tension, this;
9067
9071
  }
9068
9072
  };
9069
- function Io(e, t, n, r, i) {
9073
+ function Lo(e, t, n, r, i) {
9070
9074
  let a = (r - t) * .5, o = (i - n) * .5, s = e * e, c = e * s;
9071
9075
  return (2 * n - 2 * r + a + o) * c + (-3 * n + 3 * r - 2 * a - o) * s + a * e + n;
9072
9076
  }
9073
- function Lo(e, t) {
9077
+ function Ro(e, t) {
9074
9078
  let n = 1 - e;
9075
9079
  return n * n * t;
9076
9080
  }
9077
- function Ro(e, t) {
9081
+ function zo(e, t) {
9078
9082
  return 2 * (1 - e) * e * t;
9079
9083
  }
9080
- function zo(e, t) {
9084
+ function Bo(e, t) {
9081
9085
  return e * e * t;
9082
9086
  }
9083
- function Bo(e, t, n, r) {
9084
- return Lo(e, t) + Ro(e, n) + zo(e, r);
9087
+ function Vo(e, t, n, r) {
9088
+ return Ro(e, t) + zo(e, n) + Bo(e, r);
9085
9089
  }
9086
- function Vo(e, t) {
9090
+ function Ho(e, t) {
9087
9091
  let n = 1 - e;
9088
9092
  return n * n * n * t;
9089
9093
  }
9090
- function Ho(e, t) {
9094
+ function Uo(e, t) {
9091
9095
  let n = 1 - e;
9092
9096
  return 3 * n * n * e * t;
9093
9097
  }
9094
- function Uo(e, t) {
9098
+ function Wo(e, t) {
9095
9099
  return 3 * (1 - e) * e * e * t;
9096
9100
  }
9097
- function Wo(e, t) {
9101
+ function Go(e, t) {
9098
9102
  return e * e * e * t;
9099
9103
  }
9100
- function Go(e, t, n, r, i) {
9101
- return Vo(e, t) + Ho(e, n) + Uo(e, r) + Wo(e, i);
9104
+ function Ko(e, t, n, r, i) {
9105
+ return Ho(e, t) + Uo(e, n) + Wo(e, r) + Go(e, i);
9102
9106
  }
9103
- var Ko = class extends Do {
9107
+ var qo = class extends Oo {
9104
9108
  constructor(e = new K(), t = new K(), n = new K(), r = new K()) {
9105
9109
  super(), this.isCubicBezierCurve = !0, this.type = "CubicBezierCurve", this.v0 = e, this.v1 = t, this.v2 = n, this.v3 = r;
9106
9110
  }
9107
9111
  getPoint(e, t = new K()) {
9108
9112
  let n = t, r = this.v0, i = this.v1, a = this.v2, o = this.v3;
9109
- return n.set(Go(e, r.x, i.x, a.x, o.x), Go(e, r.y, i.y, a.y, o.y)), n;
9113
+ return n.set(Ko(e, r.x, i.x, a.x, o.x), Ko(e, r.y, i.y, a.y, o.y)), n;
9110
9114
  }
9111
9115
  copy(e) {
9112
9116
  return super.copy(e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this.v3.copy(e.v3), this;
@@ -9118,13 +9122,13 @@ var Ko = class extends Do {
9118
9122
  fromJSON(e) {
9119
9123
  return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this.v3.fromArray(e.v3), this;
9120
9124
  }
9121
- }, qo = class extends Do {
9125
+ }, Jo = class extends Oo {
9122
9126
  constructor(e = new X(), t = new X(), n = new X(), r = new X()) {
9123
9127
  super(), this.isCubicBezierCurve3 = !0, this.type = "CubicBezierCurve3", this.v0 = e, this.v1 = t, this.v2 = n, this.v3 = r;
9124
9128
  }
9125
9129
  getPoint(e, t = new X()) {
9126
9130
  let n = t, r = this.v0, i = this.v1, a = this.v2, o = this.v3;
9127
- return n.set(Go(e, r.x, i.x, a.x, o.x), Go(e, r.y, i.y, a.y, o.y), Go(e, r.z, i.z, a.z, o.z)), n;
9131
+ return n.set(Ko(e, r.x, i.x, a.x, o.x), Ko(e, r.y, i.y, a.y, o.y), Ko(e, r.z, i.z, a.z, o.z)), n;
9128
9132
  }
9129
9133
  copy(e) {
9130
9134
  return super.copy(e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this.v3.copy(e.v3), this;
@@ -9136,7 +9140,7 @@ var Ko = class extends Do {
9136
9140
  fromJSON(e) {
9137
9141
  return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this.v3.fromArray(e.v3), this;
9138
9142
  }
9139
- }, Jo = class extends Do {
9143
+ }, Yo = class extends Oo {
9140
9144
  constructor(e = new K(), t = new K()) {
9141
9145
  super(), this.isLineCurve = !0, this.type = "LineCurve", this.v1 = e, this.v2 = t;
9142
9146
  }
@@ -9163,7 +9167,7 @@ var Ko = class extends Do {
9163
9167
  fromJSON(e) {
9164
9168
  return super.fromJSON(e), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this;
9165
9169
  }
9166
- }, Yo = class extends Do {
9170
+ }, Xo = class extends Oo {
9167
9171
  constructor(e = new X(), t = new X()) {
9168
9172
  super(), this.isLineCurve3 = !0, this.type = "LineCurve3", this.v1 = e, this.v2 = t;
9169
9173
  }
@@ -9190,13 +9194,13 @@ var Ko = class extends Do {
9190
9194
  fromJSON(e) {
9191
9195
  return super.fromJSON(e), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this;
9192
9196
  }
9193
- }, Xo = class extends Do {
9197
+ }, Zo = class extends Oo {
9194
9198
  constructor(e = new K(), t = new K(), n = new K()) {
9195
9199
  super(), this.isQuadraticBezierCurve = !0, this.type = "QuadraticBezierCurve", this.v0 = e, this.v1 = t, this.v2 = n;
9196
9200
  }
9197
9201
  getPoint(e, t = new K()) {
9198
9202
  let n = t, r = this.v0, i = this.v1, a = this.v2;
9199
- return n.set(Bo(e, r.x, i.x, a.x), Bo(e, r.y, i.y, a.y)), n;
9203
+ return n.set(Vo(e, r.x, i.x, a.x), Vo(e, r.y, i.y, a.y)), n;
9200
9204
  }
9201
9205
  copy(e) {
9202
9206
  return super.copy(e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this;
@@ -9208,13 +9212,13 @@ var Ko = class extends Do {
9208
9212
  fromJSON(e) {
9209
9213
  return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this;
9210
9214
  }
9211
- }, Zo = class extends Do {
9215
+ }, Qo = class extends Oo {
9212
9216
  constructor(e = new X(), t = new X(), n = new X()) {
9213
9217
  super(), this.isQuadraticBezierCurve3 = !0, this.type = "QuadraticBezierCurve3", this.v0 = e, this.v1 = t, this.v2 = n;
9214
9218
  }
9215
9219
  getPoint(e, t = new X()) {
9216
9220
  let n = t, r = this.v0, i = this.v1, a = this.v2;
9217
- return n.set(Bo(e, r.x, i.x, a.x), Bo(e, r.y, i.y, a.y), Bo(e, r.z, i.z, a.z)), n;
9221
+ return n.set(Vo(e, r.x, i.x, a.x), Vo(e, r.y, i.y, a.y), Vo(e, r.z, i.z, a.z)), n;
9218
9222
  }
9219
9223
  copy(e) {
9220
9224
  return super.copy(e), this.v0.copy(e.v0), this.v1.copy(e.v1), this.v2.copy(e.v2), this;
@@ -9226,13 +9230,13 @@ var Ko = class extends Do {
9226
9230
  fromJSON(e) {
9227
9231
  return super.fromJSON(e), this.v0.fromArray(e.v0), this.v1.fromArray(e.v1), this.v2.fromArray(e.v2), this;
9228
9232
  }
9229
- }, Qo = class extends Do {
9233
+ }, $o = class extends Oo {
9230
9234
  constructor(e = []) {
9231
9235
  super(), this.isSplineCurve = !0, this.type = "SplineCurve", this.points = e;
9232
9236
  }
9233
9237
  getPoint(e, t = new K()) {
9234
9238
  let n = t, r = this.points, i = (r.length - 1) * e, a = Math.floor(i), o = i - a, s = r[a === 0 ? a : a - 1], c = r[a], l = r[a > r.length - 2 ? r.length - 1 : a + 1], u = r[a > r.length - 3 ? r.length - 1 : a + 2];
9235
- return n.set(Io(o, s.x, c.x, l.x, u.x), Io(o, s.y, c.y, l.y, u.y)), n;
9239
+ return n.set(Lo(o, s.x, c.x, l.x, u.x), Lo(o, s.y, c.y, l.y, u.y)), n;
9236
9240
  }
9237
9241
  copy(e) {
9238
9242
  super.copy(e), this.points = [];
@@ -9259,19 +9263,19 @@ var Ko = class extends Do {
9259
9263
  }
9260
9264
  return this;
9261
9265
  }
9262
- }, $o = /*#__PURE__*/ Object.freeze({
9266
+ }, es = /*#__PURE__*/ Object.freeze({
9263
9267
  __proto__: null,
9264
- ArcCurve: ko,
9265
- CatmullRomCurve3: Fo,
9266
- CubicBezierCurve: Ko,
9267
- CubicBezierCurve3: qo,
9268
- EllipseCurve: Oo,
9269
- LineCurve: Jo,
9270
- LineCurve3: Yo,
9271
- QuadraticBezierCurve: Xo,
9272
- QuadraticBezierCurve3: Zo,
9273
- SplineCurve: Qo
9274
- }), es = class extends Do {
9268
+ ArcCurve: Ao,
9269
+ CatmullRomCurve3: Io,
9270
+ CubicBezierCurve: qo,
9271
+ CubicBezierCurve3: Jo,
9272
+ EllipseCurve: ko,
9273
+ LineCurve: Yo,
9274
+ LineCurve3: Xo,
9275
+ QuadraticBezierCurve: Zo,
9276
+ QuadraticBezierCurve3: Qo,
9277
+ SplineCurve: $o
9278
+ }), ts = class extends Oo {
9275
9279
  constructor() {
9276
9280
  super(), this.type = "CurvePath", this.curves = [], this.autoClose = !1;
9277
9281
  }
@@ -9282,7 +9286,7 @@ var Ko = class extends Do {
9282
9286
  let e = this.curves[0].getPoint(0), t = this.curves[this.curves.length - 1].getPoint(1);
9283
9287
  if (!e.equals(t)) {
9284
9288
  let n = e.isVector2 === !0 ? "LineCurve" : "LineCurve3";
9285
- this.curves.push(new $o[n](t, e));
9289
+ this.curves.push(new es[n](t, e));
9286
9290
  }
9287
9291
  return this;
9288
9292
  }
@@ -9347,11 +9351,11 @@ var Ko = class extends Do {
9347
9351
  super.fromJSON(e), this.autoClose = e.autoClose, this.curves = [];
9348
9352
  for (let t = 0, n = e.curves.length; t < n; t++) {
9349
9353
  let n = e.curves[t];
9350
- this.curves.push(new $o[n.type]().fromJSON(n));
9354
+ this.curves.push(new es[n.type]().fromJSON(n));
9351
9355
  }
9352
9356
  return this;
9353
9357
  }
9354
- }, ts = class extends es {
9358
+ }, ns = class extends ts {
9355
9359
  constructor(e) {
9356
9360
  super(), this.type = "Path", this.currentPoint = new K(), e && this.setFromPoints(e);
9357
9361
  }
@@ -9364,19 +9368,19 @@ var Ko = class extends Do {
9364
9368
  return this.currentPoint.set(e, t), this;
9365
9369
  }
9366
9370
  lineTo(e, t) {
9367
- let n = new Jo(this.currentPoint.clone(), new K(e, t));
9371
+ let n = new Yo(this.currentPoint.clone(), new K(e, t));
9368
9372
  return this.curves.push(n), this.currentPoint.set(e, t), this;
9369
9373
  }
9370
9374
  quadraticCurveTo(e, t, n, r) {
9371
- let i = new Xo(this.currentPoint.clone(), new K(e, t), new K(n, r));
9375
+ let i = new Zo(this.currentPoint.clone(), new K(e, t), new K(n, r));
9372
9376
  return this.curves.push(i), this.currentPoint.set(n, r), this;
9373
9377
  }
9374
9378
  bezierCurveTo(e, t, n, r, i, a) {
9375
- let o = new Ko(this.currentPoint.clone(), new K(e, t), new K(n, r), new K(i, a));
9379
+ let o = new qo(this.currentPoint.clone(), new K(e, t), new K(n, r), new K(i, a));
9376
9380
  return this.curves.push(o), this.currentPoint.set(i, a), this;
9377
9381
  }
9378
9382
  splineThru(e) {
9379
- let t = new Qo([this.currentPoint.clone()].concat(e));
9383
+ let t = new $o([this.currentPoint.clone()].concat(e));
9380
9384
  return this.curves.push(t), this.currentPoint.copy(e[e.length - 1]), this;
9381
9385
  }
9382
9386
  arc(e, t, n, r, i, a) {
@@ -9391,7 +9395,7 @@ var Ko = class extends Do {
9391
9395
  return this.absellipse(e + c, t + l, n, r, i, a, o, s), this;
9392
9396
  }
9393
9397
  absellipse(e, t, n, r, i, a, o, s) {
9394
- let c = new Oo(e, t, n, r, i, a, o, s);
9398
+ let c = new ko(e, t, n, r, i, a, o, s);
9395
9399
  if (this.curves.length > 0) {
9396
9400
  let e = c.getPoint(0);
9397
9401
  e.equals(this.currentPoint) || this.lineTo(e.x, e.y);
@@ -9410,7 +9414,7 @@ var Ko = class extends Do {
9410
9414
  fromJSON(e) {
9411
9415
  return super.fromJSON(e), this.currentPoint.fromArray(e.currentPoint), this;
9412
9416
  }
9413
- }, ns = class e extends Dn {
9417
+ }, rs = class e extends Dn {
9414
9418
  constructor(e = 1, t = 32, n = 0, r = Math.PI * 2) {
9415
9419
  super(), this.type = "CircleGeometry", this.parameters = {
9416
9420
  radius: e,
@@ -9433,7 +9437,7 @@ var Ko = class extends Do {
9433
9437
  static fromJSON(t) {
9434
9438
  return new e(t.radius, t.segments, t.thetaStart, t.thetaLength);
9435
9439
  }
9436
- }, rs = class extends ts {
9440
+ }, is = class extends ns {
9437
9441
  constructor(e) {
9438
9442
  super(e), this.uuid = L(), this.type = "Shape", this.holes = [];
9439
9443
  }
@@ -9469,98 +9473,98 @@ var Ko = class extends Do {
9469
9473
  super.fromJSON(e), this.uuid = e.uuid, this.holes = [];
9470
9474
  for (let t = 0, n = e.holes.length; t < n; t++) {
9471
9475
  let n = e.holes[t];
9472
- this.holes.push(new ts().fromJSON(n));
9476
+ this.holes.push(new ns().fromJSON(n));
9473
9477
  }
9474
9478
  return this;
9475
9479
  }
9476
- }, is = { triangulate: function(e, t, n = 2) {
9477
- let r = t && t.length, i = r ? t[0] * n : e.length, a = as(e, 0, i, n, !0), o = [];
9480
+ }, as = { triangulate: function(e, t, n = 2) {
9481
+ let r = t && t.length, i = r ? t[0] * n : e.length, a = os(e, 0, i, n, !0), o = [];
9478
9482
  if (!a || a.next === a.prev) return o;
9479
9483
  let s, c, l, u, d, f, p;
9480
- if (r && (a = fs(e, t, a, n)), e.length > 80 * n) {
9484
+ if (r && (a = ps(e, t, a, n)), e.length > 80 * n) {
9481
9485
  s = l = e[0], c = u = e[1];
9482
9486
  for (let t = n; t < i; t += n) d = e[t], f = e[t + 1], d < s && (s = d), f < c && (c = f), d > l && (l = d), f > u && (u = f);
9483
9487
  p = Math.max(l - s, u - c), p = p === 0 ? 0 : 32767 / p;
9484
9488
  }
9485
- return ss(a, o, n, s, c, p, 0), o;
9489
+ return cs(a, o, n, s, c, p, 0), o;
9486
9490
  } };
9487
- function as(e, t, n, r, i) {
9491
+ function os(e, t, n, r, i) {
9488
9492
  let a, o;
9489
- if (i === Fs(e, t, n, r) > 0) for (a = t; a < n; a += r) o = Ms(a, e[a], e[a + 1], o);
9490
- else for (a = n - r; a >= t; a -= r) o = Ms(a, e[a], e[a + 1], o);
9491
- return o && ws(o, o.next) && (Ns(o), o = o.next), o;
9493
+ if (i === Is(e, t, n, r) > 0) for (a = t; a < n; a += r) o = Ns(a, e[a], e[a + 1], o);
9494
+ else for (a = n - r; a >= t; a -= r) o = Ns(a, e[a], e[a + 1], o);
9495
+ return o && Ts(o, o.next) && (Ps(o), o = o.next), o;
9492
9496
  }
9493
- function os(e, t) {
9497
+ function ss(e, t) {
9494
9498
  if (!e) return e;
9495
9499
  t ||= e;
9496
9500
  let n = e, r;
9497
9501
  do
9498
- if (r = !1, !n.steiner && (ws(n, n.next) || Cs(n.prev, n, n.next) === 0)) {
9499
- if (Ns(n), n = t = n.prev, n === n.next) break;
9502
+ if (r = !1, !n.steiner && (Ts(n, n.next) || ws(n.prev, n, n.next) === 0)) {
9503
+ if (Ps(n), n = t = n.prev, n === n.next) break;
9500
9504
  r = !0;
9501
9505
  } else n = n.next;
9502
9506
  while (r || n !== t);
9503
9507
  return t;
9504
9508
  }
9505
- function ss(e, t, n, r, i, a, o) {
9509
+ function cs(e, t, n, r, i, a, o) {
9506
9510
  if (!e) return;
9507
- !o && a && _s(e, r, i, a);
9511
+ !o && a && vs(e, r, i, a);
9508
9512
  let s = e, c, l;
9509
9513
  for (; e.prev !== e.next;) {
9510
- if (c = e.prev, l = e.next, a ? ls(e, r, i, a) : cs(e)) {
9511
- t.push(c.i / n | 0), t.push(e.i / n | 0), t.push(l.i / n | 0), Ns(e), e = l.next, s = l.next;
9514
+ if (c = e.prev, l = e.next, a ? us(e, r, i, a) : ls(e)) {
9515
+ t.push(c.i / n | 0), t.push(e.i / n | 0), t.push(l.i / n | 0), Ps(e), e = l.next, s = l.next;
9512
9516
  continue;
9513
9517
  }
9514
9518
  if (e = l, e === s) {
9515
- o ? o === 1 ? (e = us(os(e), t, n), ss(e, t, n, r, i, a, 2)) : o === 2 && ds(e, t, n, r, i, a) : ss(os(e), t, n, r, i, a, 1);
9519
+ o ? o === 1 ? (e = ds(ss(e), t, n), cs(e, t, n, r, i, a, 2)) : o === 2 && fs(e, t, n, r, i, a) : cs(ss(e), t, n, r, i, a, 1);
9516
9520
  break;
9517
9521
  }
9518
9522
  }
9519
9523
  }
9520
- function cs(e) {
9524
+ function ls(e) {
9521
9525
  let t = e.prev, n = e, r = e.next;
9522
- if (Cs(t, n, r) >= 0) return !1;
9526
+ if (ws(t, n, r) >= 0) return !1;
9523
9527
  let i = t.x, a = n.x, o = r.x, s = t.y, c = n.y, l = r.y, u = i < a ? i < o ? i : o : a < o ? a : o, d = s < c ? s < l ? s : l : c < l ? c : l, f = i > a ? i > o ? i : o : a > o ? a : o, p = s > c ? s > l ? s : l : c > l ? c : l, m = r.next;
9524
9528
  for (; m !== t;) {
9525
- if (m.x >= u && m.x <= f && m.y >= d && m.y <= p && xs(i, s, a, c, o, l, m.x, m.y) && Cs(m.prev, m, m.next) >= 0) return !1;
9529
+ if (m.x >= u && m.x <= f && m.y >= d && m.y <= p && Ss(i, s, a, c, o, l, m.x, m.y) && ws(m.prev, m, m.next) >= 0) return !1;
9526
9530
  m = m.next;
9527
9531
  }
9528
9532
  return !0;
9529
9533
  }
9530
- function ls(e, t, n, r) {
9534
+ function us(e, t, n, r) {
9531
9535
  let i = e.prev, a = e, o = e.next;
9532
- if (Cs(i, a, o) >= 0) return !1;
9533
- let s = i.x, c = a.x, l = o.x, u = i.y, d = a.y, f = o.y, p = s < c ? s < l ? s : l : c < l ? c : l, m = u < d ? u < f ? u : f : d < f ? d : f, h = s > c ? s > l ? s : l : c > l ? c : l, g = u > d ? u > f ? u : f : d > f ? d : f, _ = ys(p, m, t, n, r), v = ys(h, g, t, n, r), y = e.prevZ, b = e.nextZ;
9536
+ if (ws(i, a, o) >= 0) return !1;
9537
+ let s = i.x, c = a.x, l = o.x, u = i.y, d = a.y, f = o.y, p = s < c ? s < l ? s : l : c < l ? c : l, m = u < d ? u < f ? u : f : d < f ? d : f, h = s > c ? s > l ? s : l : c > l ? c : l, g = u > d ? u > f ? u : f : d > f ? d : f, _ = bs(p, m, t, n, r), v = bs(h, g, t, n, r), y = e.prevZ, b = e.nextZ;
9534
9538
  for (; y && y.z >= _ && b && b.z <= v;) {
9535
- if (y.x >= p && y.x <= h && y.y >= m && y.y <= g && y !== i && y !== o && xs(s, u, c, d, l, f, y.x, y.y) && Cs(y.prev, y, y.next) >= 0 || (y = y.prevZ, b.x >= p && b.x <= h && b.y >= m && b.y <= g && b !== i && b !== o && xs(s, u, c, d, l, f, b.x, b.y) && Cs(b.prev, b, b.next) >= 0)) return !1;
9539
+ if (y.x >= p && y.x <= h && y.y >= m && y.y <= g && y !== i && y !== o && Ss(s, u, c, d, l, f, y.x, y.y) && ws(y.prev, y, y.next) >= 0 || (y = y.prevZ, b.x >= p && b.x <= h && b.y >= m && b.y <= g && b !== i && b !== o && Ss(s, u, c, d, l, f, b.x, b.y) && ws(b.prev, b, b.next) >= 0)) return !1;
9536
9540
  b = b.nextZ;
9537
9541
  }
9538
9542
  for (; y && y.z >= _;) {
9539
- if (y.x >= p && y.x <= h && y.y >= m && y.y <= g && y !== i && y !== o && xs(s, u, c, d, l, f, y.x, y.y) && Cs(y.prev, y, y.next) >= 0) return !1;
9543
+ if (y.x >= p && y.x <= h && y.y >= m && y.y <= g && y !== i && y !== o && Ss(s, u, c, d, l, f, y.x, y.y) && ws(y.prev, y, y.next) >= 0) return !1;
9540
9544
  y = y.prevZ;
9541
9545
  }
9542
9546
  for (; b && b.z <= v;) {
9543
- if (b.x >= p && b.x <= h && b.y >= m && b.y <= g && b !== i && b !== o && xs(s, u, c, d, l, f, b.x, b.y) && Cs(b.prev, b, b.next) >= 0) return !1;
9547
+ if (b.x >= p && b.x <= h && b.y >= m && b.y <= g && b !== i && b !== o && Ss(s, u, c, d, l, f, b.x, b.y) && ws(b.prev, b, b.next) >= 0) return !1;
9544
9548
  b = b.nextZ;
9545
9549
  }
9546
9550
  return !0;
9547
9551
  }
9548
- function us(e, t, n) {
9552
+ function ds(e, t, n) {
9549
9553
  let r = e;
9550
9554
  do {
9551
9555
  let i = r.prev, a = r.next.next;
9552
- !ws(i, a) && Ts(i, r, r.next, a) && ks(i, a) && ks(a, i) && (t.push(i.i / n | 0), t.push(r.i / n | 0), t.push(a.i / n | 0), Ns(r), Ns(r.next), r = e = a), r = r.next;
9556
+ !Ts(i, a) && Es(i, r, r.next, a) && As(i, a) && As(a, i) && (t.push(i.i / n | 0), t.push(r.i / n | 0), t.push(a.i / n | 0), Ps(r), Ps(r.next), r = e = a), r = r.next;
9553
9557
  } while (r !== e);
9554
- return os(r);
9558
+ return ss(r);
9555
9559
  }
9556
- function ds(e, t, n, r, i, a) {
9560
+ function fs(e, t, n, r, i, a) {
9557
9561
  let o = e;
9558
9562
  do {
9559
9563
  let e = o.next.next;
9560
9564
  for (; e !== o.prev;) {
9561
- if (o.i !== e.i && Ss(o, e)) {
9562
- let s = js(o, e);
9563
- o = os(o, o.next), s = os(s, s.next), ss(o, t, n, r, i, a, 0), ss(s, t, n, r, i, a, 0);
9565
+ if (o.i !== e.i && Cs(o, e)) {
9566
+ let s = Ms(o, e);
9567
+ o = ss(o, o.next), s = ss(s, s.next), cs(o, t, n, r, i, a, 0), cs(s, t, n, r, i, a, 0);
9564
9568
  return;
9565
9569
  }
9566
9570
  e = e.next;
@@ -9568,22 +9572,22 @@ function ds(e, t, n, r, i, a) {
9568
9572
  o = o.next;
9569
9573
  } while (o !== e);
9570
9574
  }
9571
- function fs(e, t, n, r) {
9575
+ function ps(e, t, n, r) {
9572
9576
  let i = [], a, o, s, c, l;
9573
- for (a = 0, o = t.length; a < o; a++) s = t[a] * r, c = a < o - 1 ? t[a + 1] * r : e.length, l = as(e, s, c, r, !1), l === l.next && (l.steiner = !0), i.push(bs(l));
9574
- for (i.sort(ps), a = 0; a < i.length; a++) n = ms(i[a], n);
9577
+ for (a = 0, o = t.length; a < o; a++) s = t[a] * r, c = a < o - 1 ? t[a + 1] * r : e.length, l = os(e, s, c, r, !1), l === l.next && (l.steiner = !0), i.push(xs(l));
9578
+ for (i.sort(ms), a = 0; a < i.length; a++) n = hs(i[a], n);
9575
9579
  return n;
9576
9580
  }
9577
- function ps(e, t) {
9581
+ function ms(e, t) {
9578
9582
  return e.x - t.x;
9579
9583
  }
9580
- function ms(e, t) {
9581
- let n = hs(e, t);
9584
+ function hs(e, t) {
9585
+ let n = gs(e, t);
9582
9586
  if (!n) return t;
9583
- let r = js(n, e);
9584
- return os(r, r.next), os(n, n.next);
9587
+ let r = Ms(n, e);
9588
+ return ss(r, r.next), ss(n, n.next);
9585
9589
  }
9586
- function hs(e, t) {
9590
+ function gs(e, t) {
9587
9591
  let n = t, r = -Infinity, i, a = e.x, o = e.y;
9588
9592
  do {
9589
9593
  if (o <= n.y && o >= n.next.y && n.next.y !== n.y) {
@@ -9596,21 +9600,21 @@ function hs(e, t) {
9596
9600
  let s = i, c = i.x, l = i.y, u = Infinity, d;
9597
9601
  n = i;
9598
9602
  do
9599
- a >= n.x && n.x >= c && a !== n.x && xs(o < l ? a : r, o, c, l, o < l ? r : a, o, n.x, n.y) && (d = Math.abs(o - n.y) / (a - n.x), ks(n, e) && (d < u || d === u && (n.x > i.x || n.x === i.x && gs(i, n))) && (i = n, u = d)), n = n.next;
9603
+ a >= n.x && n.x >= c && a !== n.x && Ss(o < l ? a : r, o, c, l, o < l ? r : a, o, n.x, n.y) && (d = Math.abs(o - n.y) / (a - n.x), As(n, e) && (d < u || d === u && (n.x > i.x || n.x === i.x && _s(i, n))) && (i = n, u = d)), n = n.next;
9600
9604
  while (n !== s);
9601
9605
  return i;
9602
9606
  }
9603
- function gs(e, t) {
9604
- return Cs(e.prev, e, t.prev) < 0 && Cs(t.next, e, e.next) < 0;
9607
+ function _s(e, t) {
9608
+ return ws(e.prev, e, t.prev) < 0 && ws(t.next, e, e.next) < 0;
9605
9609
  }
9606
- function _s(e, t, n, r) {
9610
+ function vs(e, t, n, r) {
9607
9611
  let i = e;
9608
9612
  do
9609
- i.z === 0 && (i.z = ys(i.x, i.y, t, n, r)), i.prevZ = i.prev, i.nextZ = i.next, i = i.next;
9613
+ i.z === 0 && (i.z = bs(i.x, i.y, t, n, r)), i.prevZ = i.prev, i.nextZ = i.next, i = i.next;
9610
9614
  while (i !== e);
9611
- i.prevZ.nextZ = null, i.prevZ = null, vs(i);
9615
+ i.prevZ.nextZ = null, i.prevZ = null, ys(i);
9612
9616
  }
9613
- function vs(e) {
9617
+ function ys(e) {
9614
9618
  let t, n, r, i, a, o, s, c, l = 1;
9615
9619
  do {
9616
9620
  for (n = e, e = null, a = null, o = 0; n;) {
@@ -9622,76 +9626,76 @@ function vs(e) {
9622
9626
  } while (o > 1);
9623
9627
  return e;
9624
9628
  }
9625
- function ys(e, t, n, r, i) {
9629
+ function bs(e, t, n, r, i) {
9626
9630
  return e = (e - n) * i | 0, t = (t - r) * i | 0, e = (e | e << 8) & 16711935, e = (e | e << 4) & 252645135, e = (e | e << 2) & 858993459, e = (e | e << 1) & 1431655765, t = (t | t << 8) & 16711935, t = (t | t << 4) & 252645135, t = (t | t << 2) & 858993459, t = (t | t << 1) & 1431655765, e | t << 1;
9627
9631
  }
9628
- function bs(e) {
9632
+ function xs(e) {
9629
9633
  let t = e, n = e;
9630
9634
  do
9631
9635
  (t.x < n.x || t.x === n.x && t.y < n.y) && (n = t), t = t.next;
9632
9636
  while (t !== e);
9633
9637
  return n;
9634
9638
  }
9635
- function xs(e, t, n, r, i, a, o, s) {
9639
+ function Ss(e, t, n, r, i, a, o, s) {
9636
9640
  return (i - o) * (t - s) >= (e - o) * (a - s) && (e - o) * (r - s) >= (n - o) * (t - s) && (n - o) * (a - s) >= (i - o) * (r - s);
9637
9641
  }
9638
- function Ss(e, t) {
9639
- return e.next.i !== t.i && e.prev.i !== t.i && !Os(e, t) && (ks(e, t) && ks(t, e) && As(e, t) && (Cs(e.prev, e, t.prev) || Cs(e, t.prev, t)) || ws(e, t) && Cs(e.prev, e, e.next) > 0 && Cs(t.prev, t, t.next) > 0);
9642
+ function Cs(e, t) {
9643
+ return e.next.i !== t.i && e.prev.i !== t.i && !ks(e, t) && (As(e, t) && As(t, e) && js(e, t) && (ws(e.prev, e, t.prev) || ws(e, t.prev, t)) || Ts(e, t) && ws(e.prev, e, e.next) > 0 && ws(t.prev, t, t.next) > 0);
9640
9644
  }
9641
- function Cs(e, t, n) {
9645
+ function ws(e, t, n) {
9642
9646
  return (t.y - e.y) * (n.x - t.x) - (t.x - e.x) * (n.y - t.y);
9643
9647
  }
9644
- function ws(e, t) {
9648
+ function Ts(e, t) {
9645
9649
  return e.x === t.x && e.y === t.y;
9646
9650
  }
9647
- function Ts(e, t, n, r) {
9648
- let i = Ds(Cs(e, t, n)), a = Ds(Cs(e, t, r)), o = Ds(Cs(n, r, e)), s = Ds(Cs(n, r, t));
9649
- return !!(i !== a && o !== s || i === 0 && Es(e, n, t) || a === 0 && Es(e, r, t) || o === 0 && Es(n, e, r) || s === 0 && Es(n, t, r));
9651
+ function Es(e, t, n, r) {
9652
+ let i = Os(ws(e, t, n)), a = Os(ws(e, t, r)), o = Os(ws(n, r, e)), s = Os(ws(n, r, t));
9653
+ return !!(i !== a && o !== s || i === 0 && Ds(e, n, t) || a === 0 && Ds(e, r, t) || o === 0 && Ds(n, e, r) || s === 0 && Ds(n, t, r));
9650
9654
  }
9651
- function Es(e, t, n) {
9655
+ function Ds(e, t, n) {
9652
9656
  return t.x <= Math.max(e.x, n.x) && t.x >= Math.min(e.x, n.x) && t.y <= Math.max(e.y, n.y) && t.y >= Math.min(e.y, n.y);
9653
9657
  }
9654
- function Ds(e) {
9658
+ function Os(e) {
9655
9659
  return e > 0 ? 1 : e < 0 ? -1 : 0;
9656
9660
  }
9657
- function Os(e, t) {
9661
+ function ks(e, t) {
9658
9662
  let n = e;
9659
9663
  do {
9660
- if (n.i !== e.i && n.next.i !== e.i && n.i !== t.i && n.next.i !== t.i && Ts(n, n.next, e, t)) return !0;
9664
+ if (n.i !== e.i && n.next.i !== e.i && n.i !== t.i && n.next.i !== t.i && Es(n, n.next, e, t)) return !0;
9661
9665
  n = n.next;
9662
9666
  } while (n !== e);
9663
9667
  return !1;
9664
9668
  }
9665
- function ks(e, t) {
9666
- return Cs(e.prev, e, e.next) < 0 ? Cs(e, t, e.next) >= 0 && Cs(e, e.prev, t) >= 0 : Cs(e, t, e.prev) < 0 || Cs(e, e.next, t) < 0;
9667
- }
9668
9669
  function As(e, t) {
9670
+ return ws(e.prev, e, e.next) < 0 ? ws(e, t, e.next) >= 0 && ws(e, e.prev, t) >= 0 : ws(e, t, e.prev) < 0 || ws(e, e.next, t) < 0;
9671
+ }
9672
+ function js(e, t) {
9669
9673
  let n = e, r = !1, i = (e.x + t.x) / 2, a = (e.y + t.y) / 2;
9670
9674
  do
9671
9675
  n.y > a != n.next.y > a && n.next.y !== n.y && i < (n.next.x - n.x) * (a - n.y) / (n.next.y - n.y) + n.x && (r = !r), n = n.next;
9672
9676
  while (n !== e);
9673
9677
  return r;
9674
9678
  }
9675
- function js(e, t) {
9676
- let n = new Ps(e.i, e.x, e.y), r = new Ps(t.i, t.x, t.y), i = e.next, a = t.prev;
9679
+ function Ms(e, t) {
9680
+ let n = new Fs(e.i, e.x, e.y), r = new Fs(t.i, t.x, t.y), i = e.next, a = t.prev;
9677
9681
  return e.next = t, t.prev = e, n.next = i, i.prev = n, r.next = n, n.prev = r, a.next = r, r.prev = a, r;
9678
9682
  }
9679
- function Ms(e, t, n, r) {
9680
- let i = new Ps(e, t, n);
9683
+ function Ns(e, t, n, r) {
9684
+ let i = new Fs(e, t, n);
9681
9685
  return r ? (i.next = r.next, i.prev = r, r.next.prev = i, r.next = i) : (i.prev = i, i.next = i), i;
9682
9686
  }
9683
- function Ns(e) {
9687
+ function Ps(e) {
9684
9688
  e.next.prev = e.prev, e.prev.next = e.next, e.prevZ && (e.prevZ.nextZ = e.nextZ), e.nextZ && (e.nextZ.prevZ = e.prevZ);
9685
9689
  }
9686
- function Ps(e, t, n) {
9690
+ function Fs(e, t, n) {
9687
9691
  this.i = e, this.x = t, this.y = n, this.prev = null, this.next = null, this.z = 0, this.prevZ = null, this.nextZ = null, this.steiner = !1;
9688
9692
  }
9689
- function Fs(e, t, n, r) {
9693
+ function Is(e, t, n, r) {
9690
9694
  let i = 0;
9691
9695
  for (let a = t, o = n - r; a < n; a += r) i += (e[o] - e[a]) * (e[a + 1] + e[o + 1]), o = a;
9692
9696
  return i;
9693
9697
  }
9694
- var Is = class e {
9698
+ var Ls = class e {
9695
9699
  static area(e) {
9696
9700
  let t = e.length, n = 0;
9697
9701
  for (let r = t - 1, i = 0; i < t; r = i++) n += e[r].x * e[i].y - e[i].x * e[r].y;
@@ -9702,23 +9706,23 @@ var Is = class e {
9702
9706
  }
9703
9707
  static triangulateShape(e, t) {
9704
9708
  let n = [], r = [], i = [];
9705
- Ls(e), Rs(n, e);
9709
+ Rs(e), zs(n, e);
9706
9710
  let a = e.length;
9707
- t.forEach(Ls);
9708
- for (let e = 0; e < t.length; e++) r.push(a), a += t[e].length, Rs(n, t[e]);
9709
- let o = is.triangulate(n, r);
9711
+ t.forEach(Rs);
9712
+ for (let e = 0; e < t.length; e++) r.push(a), a += t[e].length, zs(n, t[e]);
9713
+ let o = as.triangulate(n, r);
9710
9714
  for (let e = 0; e < o.length; e += 3) i.push(o.slice(e, e + 3));
9711
9715
  return i;
9712
9716
  }
9713
9717
  };
9714
- function Ls(e) {
9718
+ function Rs(e) {
9715
9719
  let t = e.length;
9716
9720
  t > 2 && e[t - 1].equals(e[0]) && e.pop();
9717
9721
  }
9718
- function Rs(e, t) {
9722
+ function zs(e, t) {
9719
9723
  for (let n = 0; n < t.length; n++) e.push(t[n].x), e.push(t[n].y);
9720
9724
  }
9721
- var zs = class e extends Dn {
9725
+ var Bs = class e extends Dn {
9722
9726
  constructor(e = .5, t = 1, n = 32, r = 1, i = 0, a = Math.PI * 2) {
9723
9727
  super(), this.type = "RingGeometry", this.parameters = {
9724
9728
  innerRadius: e,
@@ -9751,8 +9755,8 @@ var zs = class e extends Dn {
9751
9755
  static fromJSON(t) {
9752
9756
  return new e(t.innerRadius, t.outerRadius, t.thetaSegments, t.phiSegments, t.thetaStart, t.thetaLength);
9753
9757
  }
9754
- }, Bs = class e extends Dn {
9755
- constructor(e = new rs([
9758
+ }, Vs = class e extends Dn {
9759
+ constructor(e = new is([
9756
9760
  new K(0, .5),
9757
9761
  new K(-.5, -.5),
9758
9762
  new K(.5, -.5)
@@ -9767,12 +9771,12 @@ var zs = class e extends Dn {
9767
9771
  this.setIndex(n), this.setAttribute("position", new yn(r, 3)), this.setAttribute("normal", new yn(i, 3)), this.setAttribute("uv", new yn(a, 2));
9768
9772
  function c(e) {
9769
9773
  let o = r.length / 3, c = e.extractPoints(t), l = c.shape, u = c.holes;
9770
- Is.isClockWise(l) === !1 && (l = l.reverse());
9774
+ Ls.isClockWise(l) === !1 && (l = l.reverse());
9771
9775
  for (let e = 0, t = u.length; e < t; e++) {
9772
9776
  let t = u[e];
9773
- Is.isClockWise(t) === !0 && (u[e] = t.reverse());
9777
+ Ls.isClockWise(t) === !0 && (u[e] = t.reverse());
9774
9778
  }
9775
- let d = Is.triangulateShape(l, u);
9779
+ let d = Ls.triangulateShape(l, u);
9776
9780
  for (let e = 0, t = u.length; e < t; e++) {
9777
9781
  let t = u[e];
9778
9782
  l = l.concat(t);
@@ -9792,7 +9796,7 @@ var zs = class e extends Dn {
9792
9796
  }
9793
9797
  toJSON() {
9794
9798
  let e = super.toJSON(), t = this.parameters.shapes;
9795
- return Vs(t, e);
9799
+ return Hs(t, e);
9796
9800
  }
9797
9801
  static fromJSON(t, n) {
9798
9802
  let r = [];
@@ -9803,7 +9807,7 @@ var zs = class e extends Dn {
9803
9807
  return new e(r, t.curveSegments);
9804
9808
  }
9805
9809
  };
9806
- function Vs(e, t) {
9810
+ function Hs(e, t) {
9807
9811
  if (t.shapes = [], Array.isArray(e)) for (let n = 0, r = e.length; n < r; n++) {
9808
9812
  let r = e[n];
9809
9813
  t.shapes.push(r.uuid);
@@ -9811,7 +9815,7 @@ function Vs(e, t) {
9811
9815
  else t.shapes.push(e.uuid);
9812
9816
  return t;
9813
9817
  }
9814
- var Hs = class e extends Dn {
9818
+ var Us = class e extends Dn {
9815
9819
  constructor(e = 1, t = 32, n = 16, r = 0, i = Math.PI * 2, a = 0, o = Math.PI) {
9816
9820
  super(), this.type = "SphereGeometry", this.parameters = {
9817
9821
  radius: e,
@@ -9844,7 +9848,7 @@ var Hs = class e extends Dn {
9844
9848
  static fromJSON(t) {
9845
9849
  return new e(t.radius, t.widthSegments, t.heightSegments, t.phiStart, t.phiLength, t.thetaStart, t.thetaLength);
9846
9850
  }
9847
- }, Us = class extends bo {
9851
+ }, Ws = class extends bo {
9848
9852
  constructor(e) {
9849
9853
  super(), this.isLineDashedMaterial = !0, this.type = "LineDashedMaterial", this.scale = 1, this.dashSize = 3, this.gapSize = 1, this.setValues(e);
9850
9854
  }
@@ -9852,13 +9856,13 @@ var Hs = class e extends Dn {
9852
9856
  return super.copy(e), this.scale = e.scale, this.dashSize = e.dashSize, this.gapSize = e.gapSize, this;
9853
9857
  }
9854
9858
  };
9855
- function Ws(e, t, n) {
9859
+ function Gs(e, t, n) {
9856
9860
  return !e || !n && e.constructor === t ? e : typeof t.BYTES_PER_ELEMENT == "number" ? new t(e) : Array.prototype.slice.call(e);
9857
9861
  }
9858
- function Gs(e) {
9862
+ function Ks(e) {
9859
9863
  return ArrayBuffer.isView(e) && !(e instanceof DataView);
9860
9864
  }
9861
- var Ks = class {
9865
+ var qs = class {
9862
9866
  constructor(e, t, n, r) {
9863
9867
  this.parameterPositions = e, this._cachedIndex = 0, this.resultBuffer = r === void 0 ? new t.constructor(n) : r, this.sampleValues = t, this.valueSize = n, this.settings = null, this.DefaultSettings_ = {};
9864
9868
  }
@@ -9916,7 +9920,7 @@ var Ks = class {
9916
9920
  throw Error("call to abstract method");
9917
9921
  }
9918
9922
  intervalChanged_() {}
9919
- }, qs = class extends Ks {
9923
+ }, Js = class extends qs {
9920
9924
  constructor(e, t, n, r) {
9921
9925
  super(e, t, n, r), this._weightPrev = -0, this._offsetPrev = -0, this._weightNext = -0, this._offsetNext = -0, this.DefaultSettings_ = {
9922
9926
  endingStart: S,
@@ -9951,7 +9955,7 @@ var Ks = class {
9951
9955
  for (let e = 0; e !== o; ++e) i[e] = g * a[l + e] + _ * a[c + e] + v * a[s + e] + y * a[u + e];
9952
9956
  return i;
9953
9957
  }
9954
- }, Js = class extends Ks {
9958
+ }, Ys = class extends qs {
9955
9959
  constructor(e, t, n, r) {
9956
9960
  super(e, t, n, r);
9957
9961
  }
@@ -9960,18 +9964,18 @@ var Ks = class {
9960
9964
  for (let e = 0; e !== o; ++e) i[e] = a[c + e] * u + a[s + e] * l;
9961
9965
  return i;
9962
9966
  }
9963
- }, Ys = class extends Ks {
9967
+ }, Xs = class extends qs {
9964
9968
  constructor(e, t, n, r) {
9965
9969
  super(e, t, n, r);
9966
9970
  }
9967
9971
  interpolate_(e) {
9968
9972
  return this.copySampleValue_(e - 1);
9969
9973
  }
9970
- }, Xs = class {
9974
+ }, Zs = class {
9971
9975
  constructor(e, t, n, r) {
9972
9976
  if (e === void 0) throw Error("THREE.KeyframeTrack: track name is undefined");
9973
9977
  if (t === void 0 || t.length === 0) throw Error("THREE.KeyframeTrack: no keyframes in track named " + e);
9974
- this.name = e, this.times = Ws(t, this.TimeBufferType), this.values = Ws(n, this.ValueBufferType), this.setInterpolation(r || this.DefaultInterpolation);
9978
+ this.name = e, this.times = Gs(t, this.TimeBufferType), this.values = Gs(n, this.ValueBufferType), this.setInterpolation(r || this.DefaultInterpolation);
9975
9979
  }
9976
9980
  static toJSON(e) {
9977
9981
  let t = e.constructor, n;
@@ -9979,8 +9983,8 @@ var Ks = class {
9979
9983
  else {
9980
9984
  n = {
9981
9985
  name: e.name,
9982
- times: Ws(e.times, Array),
9983
- values: Ws(e.values, Array)
9986
+ times: Gs(e.times, Array),
9987
+ values: Gs(e.values, Array)
9984
9988
  };
9985
9989
  let t = e.getInterpolation();
9986
9990
  t !== e.DefaultInterpolation && (n.interpolation = t);
@@ -9988,13 +9992,13 @@ var Ks = class {
9988
9992
  return n.type = e.ValueTypeName, n;
9989
9993
  }
9990
9994
  InterpolantFactoryMethodDiscrete(e) {
9991
- return new Ys(this.times, this.values, this.getValueSize(), e);
9995
+ return new Xs(this.times, this.values, this.getValueSize(), e);
9992
9996
  }
9993
9997
  InterpolantFactoryMethodLinear(e) {
9994
- return new Js(this.times, this.values, this.getValueSize(), e);
9998
+ return new Ys(this.times, this.values, this.getValueSize(), e);
9995
9999
  }
9996
10000
  InterpolantFactoryMethodSmooth(e) {
9997
- return new qs(this.times, this.values, this.getValueSize(), e);
10001
+ return new Js(this.times, this.values, this.getValueSize(), e);
9998
10002
  }
9999
10003
  setInterpolation(e) {
10000
10004
  let t;
@@ -10070,7 +10074,7 @@ var Ks = class {
10070
10074
  }
10071
10075
  a = r;
10072
10076
  }
10073
- if (r !== void 0 && Gs(r)) for (let t = 0, n = r.length; t !== n; ++t) {
10077
+ if (r !== void 0 && Ks(r)) for (let t = 0, n = r.length; t !== n; ++t) {
10074
10078
  let n = r[t];
10075
10079
  if (isNaN(n)) {
10076
10080
  console.error("THREE.KeyframeTrack: Value is not a valid number.", this, t, n), e = !1;
@@ -10115,14 +10119,14 @@ var Ks = class {
10115
10119
  return r.createInterpolant = this.createInterpolant, r;
10116
10120
  }
10117
10121
  };
10118
- Xs.prototype.TimeBufferType = Float32Array, Xs.prototype.ValueBufferType = Float32Array, Xs.prototype.DefaultInterpolation = b;
10119
- var Zs = class extends Xs {};
10120
- Zs.prototype.ValueTypeName = "bool", Zs.prototype.ValueBufferType = Array, Zs.prototype.DefaultInterpolation = y, Zs.prototype.InterpolantFactoryMethodLinear = void 0, Zs.prototype.InterpolantFactoryMethodSmooth = void 0;
10121
- var Qs = class extends Xs {};
10122
- Qs.prototype.ValueTypeName = "color";
10123
- var $s = class extends Xs {};
10124
- $s.prototype.ValueTypeName = "number";
10125
- var ec = class extends Ks {
10122
+ Zs.prototype.TimeBufferType = Float32Array, Zs.prototype.ValueBufferType = Float32Array, Zs.prototype.DefaultInterpolation = b;
10123
+ var Qs = class extends Zs {};
10124
+ Qs.prototype.ValueTypeName = "bool", Qs.prototype.ValueBufferType = Array, Qs.prototype.DefaultInterpolation = y, Qs.prototype.InterpolantFactoryMethodLinear = void 0, Qs.prototype.InterpolantFactoryMethodSmooth = void 0;
10125
+ var $s = class extends Zs {};
10126
+ $s.prototype.ValueTypeName = "color";
10127
+ var ec = class extends Zs {};
10128
+ ec.prototype.ValueTypeName = "number";
10129
+ var tc = class extends qs {
10126
10130
  constructor(e, t, n, r) {
10127
10131
  super(e, t, n, r);
10128
10132
  }
@@ -10131,17 +10135,17 @@ var ec = class extends Ks {
10131
10135
  for (let e = c + o; c !== e; c += 4) Ge.slerpFlat(i, 0, a, c - o, a, c, s);
10132
10136
  return i;
10133
10137
  }
10134
- }, tc = class extends Xs {
10138
+ }, nc = class extends Zs {
10135
10139
  InterpolantFactoryMethodLinear(e) {
10136
- return new ec(this.times, this.values, this.getValueSize(), e);
10140
+ return new tc(this.times, this.values, this.getValueSize(), e);
10137
10141
  }
10138
10142
  };
10139
- tc.prototype.ValueTypeName = "quaternion", tc.prototype.DefaultInterpolation = b, tc.prototype.InterpolantFactoryMethodSmooth = void 0;
10140
- var nc = class extends Xs {};
10141
- nc.prototype.ValueTypeName = "string", nc.prototype.ValueBufferType = Array, nc.prototype.DefaultInterpolation = y, nc.prototype.InterpolantFactoryMethodLinear = void 0, nc.prototype.InterpolantFactoryMethodSmooth = void 0;
10142
- var rc = class extends Xs {};
10143
- rc.prototype.ValueTypeName = "vector";
10144
- var ic = {
10143
+ nc.prototype.ValueTypeName = "quaternion", nc.prototype.DefaultInterpolation = b, nc.prototype.InterpolantFactoryMethodSmooth = void 0;
10144
+ var rc = class extends Zs {};
10145
+ rc.prototype.ValueTypeName = "string", rc.prototype.ValueBufferType = Array, rc.prototype.DefaultInterpolation = y, rc.prototype.InterpolantFactoryMethodLinear = void 0, rc.prototype.InterpolantFactoryMethodSmooth = void 0;
10146
+ var ic = class extends Zs {};
10147
+ ic.prototype.ValueTypeName = "vector";
10148
+ var ac = {
10145
10149
  enabled: !1,
10146
10150
  files: {},
10147
10151
  add: function(e, t) {
@@ -10156,7 +10160,7 @@ var ic = {
10156
10160
  clear: function() {
10157
10161
  this.files = {};
10158
10162
  }
10159
- }, ac = /*@__PURE__*/ new class {
10163
+ }, oc = /*@__PURE__*/ new class {
10160
10164
  constructor(e, t, n) {
10161
10165
  let r = this, i = !1, a = 0, o = 0, s, c = [];
10162
10166
  this.onStart = void 0, this.onLoad = e, this.onProgress = t, this.onError = n, this.itemStart = function(e) {
@@ -10182,9 +10186,9 @@ var ic = {
10182
10186
  return null;
10183
10187
  };
10184
10188
  }
10185
- }(), oc = class {
10189
+ }(), sc = class {
10186
10190
  constructor(e) {
10187
- this.manager = e === void 0 ? ac : e, this.crossOrigin = "anonymous", this.withCredentials = !1, this.path = "", this.resourcePath = "", this.requestHeader = {};
10191
+ this.manager = e === void 0 ? oc : e, this.crossOrigin = "anonymous", this.withCredentials = !1, this.path = "", this.resourcePath = "", this.requestHeader = {};
10188
10192
  }
10189
10193
  load() {}
10190
10194
  loadAsync(e, t) {
@@ -10210,20 +10214,20 @@ var ic = {
10210
10214
  return this.requestHeader = e, this;
10211
10215
  }
10212
10216
  };
10213
- oc.DEFAULT_MATERIAL_NAME = "__DEFAULT";
10214
- var sc = class extends oc {
10217
+ sc.DEFAULT_MATERIAL_NAME = "__DEFAULT";
10218
+ var cc = class extends sc {
10215
10219
  constructor(e) {
10216
10220
  super(e);
10217
10221
  }
10218
10222
  load(e, t, n, r) {
10219
10223
  this.path !== void 0 && (e = this.path + e), e = this.manager.resolveURL(e);
10220
- let i = this, a = ic.get(e);
10224
+ let i = this, a = ac.get(e);
10221
10225
  if (a !== void 0) return i.manager.itemStart(e), setTimeout(function() {
10222
10226
  t && t(a), i.manager.itemEnd(e);
10223
10227
  }, 0), a;
10224
10228
  let o = Ce("img");
10225
10229
  function s() {
10226
- l(), ic.add(e, this), t && t(this), i.manager.itemEnd(e);
10230
+ l(), ac.add(e, this), t && t(this), i.manager.itemEnd(e);
10227
10231
  }
10228
10232
  function c(t) {
10229
10233
  l(), r && r(t), i.manager.itemError(e), i.manager.itemEnd(e);
@@ -10233,24 +10237,24 @@ var sc = class extends oc {
10233
10237
  }
10234
10238
  return o.addEventListener("load", s, !1), o.addEventListener("error", c, !1), e.slice(0, 5) !== "data:" && this.crossOrigin !== void 0 && (o.crossOrigin = this.crossOrigin), i.manager.itemStart(e), o.src = e, o;
10235
10239
  }
10236
- }, cc = class extends oc {
10240
+ }, lc = class extends sc {
10237
10241
  constructor(e) {
10238
10242
  super(e);
10239
10243
  }
10240
10244
  load(e, t, n, r) {
10241
- let i = new ze(), a = new sc(this.manager);
10245
+ let i = new ze(), a = new cc(this.manager);
10242
10246
  return a.setCrossOrigin(this.crossOrigin), a.setPath(this.path), a.load(e, function(e) {
10243
10247
  i.image = e, i.needsUpdate = !0, t !== void 0 && t(i);
10244
10248
  }, n, r), i;
10245
10249
  }
10246
- }, lc = "\\[\\]\\.:\\/", uc = /* @__PURE__ */ RegExp("[\\[\\]\\.:\\/]", "g"), dc = "[^\\[\\]\\.:\\/]", fc = "[^" + lc.replace("\\.", "") + "]", pc = /*@__PURE__*/ "((?:WC+[\\/:])*)".replace("WC", dc), mc = /*@__PURE__*/ "(WCOD+)?".replace("WCOD", fc), hc = /*@__PURE__*/ "(?:\\.(WC+)(?:\\[(.+)\\])?)?".replace("WC", dc), gc = /*@__PURE__*/ "\\.(WC+)(?:\\[(.+)\\])?".replace("WC", dc), _c = RegExp("^" + pc + mc + hc + gc + "$"), vc = [
10250
+ }, uc = "\\[\\]\\.:\\/", dc = /* @__PURE__ */ RegExp("[\\[\\]\\.:\\/]", "g"), fc = "[^\\[\\]\\.:\\/]", pc = "[^" + uc.replace("\\.", "") + "]", mc = /*@__PURE__*/ "((?:WC+[\\/:])*)".replace("WC", fc), hc = /*@__PURE__*/ "(WCOD+)?".replace("WCOD", pc), gc = /*@__PURE__*/ "(?:\\.(WC+)(?:\\[(.+)\\])?)?".replace("WC", fc), _c = /*@__PURE__*/ "\\.(WC+)(?:\\[(.+)\\])?".replace("WC", fc), vc = RegExp("^" + mc + hc + gc + _c + "$"), yc = [
10247
10251
  "material",
10248
10252
  "materials",
10249
10253
  "bones",
10250
10254
  "map"
10251
- ], yc = class {
10255
+ ], bc = class {
10252
10256
  constructor(e, t, n) {
10253
- let r = n || bc.parseTrackName(t);
10257
+ let r = n || xc.parseTrackName(t);
10254
10258
  this._targetGroup = e, this._bindings = e.subscribe_(t, r);
10255
10259
  }
10256
10260
  getValue(e, t) {
@@ -10270,7 +10274,7 @@ var sc = class extends oc {
10270
10274
  let e = this._bindings;
10271
10275
  for (let t = this._targetGroup.nCachedObjects_, n = e.length; t !== n; ++t) e[t].unbind();
10272
10276
  }
10273
- }, bc = class e {
10277
+ }, xc = class e {
10274
10278
  constructor(t, n, r) {
10275
10279
  this.path = n, this.parsedPath = r || e.parseTrackName(n), this.node = e.findNode(t, this.parsedPath.nodeName), this.rootNode = t, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound;
10276
10280
  }
@@ -10278,10 +10282,10 @@ var sc = class extends oc {
10278
10282
  return t && t.isAnimationObjectGroup ? new e.Composite(t, n, r) : new e(t, n, r);
10279
10283
  }
10280
10284
  static sanitizeNodeName(e) {
10281
- return e.replace(/\s/g, "_").replace(uc, "");
10285
+ return e.replace(/\s/g, "_").replace(dc, "");
10282
10286
  }
10283
10287
  static parseTrackName(e) {
10284
- let t = _c.exec(e);
10288
+ let t = vc.exec(e);
10285
10289
  if (t === null) throw Error("PropertyBinding: Cannot parse trackName: " + e);
10286
10290
  let n = {
10287
10291
  nodeName: t[2],
@@ -10292,7 +10296,7 @@ var sc = class extends oc {
10292
10296
  }, r = n.nodeName && n.nodeName.lastIndexOf(".");
10293
10297
  if (r !== void 0 && r !== -1) {
10294
10298
  let e = n.nodeName.substring(r + 1);
10295
- vc.indexOf(e) !== -1 && (n.nodeName = n.nodeName.substring(0, r), n.objectName = e);
10299
+ yc.indexOf(e) !== -1 && (n.nodeName = n.nodeName.substring(0, r), n.objectName = e);
10296
10300
  }
10297
10301
  if (n.propertyName === null || n.propertyName.length === 0) throw Error("PropertyBinding: can not parse propertyName from trackName: " + e);
10298
10302
  return n;
@@ -10469,43 +10473,43 @@ var sc = class extends oc {
10469
10473
  this.node = null, this.getValue = this._getValue_unbound, this.setValue = this._setValue_unbound;
10470
10474
  }
10471
10475
  };
10472
- bc.Composite = yc, bc.prototype.BindingType = {
10476
+ xc.Composite = bc, xc.prototype.BindingType = {
10473
10477
  Direct: 0,
10474
10478
  EntireArray: 1,
10475
10479
  ArrayElement: 2,
10476
10480
  HasFromToArray: 3
10477
- }, bc.prototype.Versioning = {
10481
+ }, xc.prototype.Versioning = {
10478
10482
  None: 0,
10479
10483
  NeedsUpdate: 1,
10480
10484
  MatrixWorldNeedsUpdate: 2
10481
- }, bc.prototype.GetterByBindingType = [
10482
- bc.prototype._getValue_direct,
10483
- bc.prototype._getValue_array,
10484
- bc.prototype._getValue_arrayElement,
10485
- bc.prototype._getValue_toArray
10486
- ], bc.prototype.SetterByBindingTypeAndVersioning = [
10485
+ }, xc.prototype.GetterByBindingType = [
10486
+ xc.prototype._getValue_direct,
10487
+ xc.prototype._getValue_array,
10488
+ xc.prototype._getValue_arrayElement,
10489
+ xc.prototype._getValue_toArray
10490
+ ], xc.prototype.SetterByBindingTypeAndVersioning = [
10487
10491
  [
10488
- bc.prototype._setValue_direct,
10489
- bc.prototype._setValue_direct_setNeedsUpdate,
10490
- bc.prototype._setValue_direct_setMatrixWorldNeedsUpdate
10492
+ xc.prototype._setValue_direct,
10493
+ xc.prototype._setValue_direct_setNeedsUpdate,
10494
+ xc.prototype._setValue_direct_setMatrixWorldNeedsUpdate
10491
10495
  ],
10492
10496
  [
10493
- bc.prototype._setValue_array,
10494
- bc.prototype._setValue_array_setNeedsUpdate,
10495
- bc.prototype._setValue_array_setMatrixWorldNeedsUpdate
10497
+ xc.prototype._setValue_array,
10498
+ xc.prototype._setValue_array_setNeedsUpdate,
10499
+ xc.prototype._setValue_array_setMatrixWorldNeedsUpdate
10496
10500
  ],
10497
10501
  [
10498
- bc.prototype._setValue_arrayElement,
10499
- bc.prototype._setValue_arrayElement_setNeedsUpdate,
10500
- bc.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate
10502
+ xc.prototype._setValue_arrayElement,
10503
+ xc.prototype._setValue_arrayElement_setNeedsUpdate,
10504
+ xc.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate
10501
10505
  ],
10502
10506
  [
10503
- bc.prototype._setValue_fromArray,
10504
- bc.prototype._setValue_fromArray_setNeedsUpdate,
10505
- bc.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate
10507
+ xc.prototype._setValue_fromArray,
10508
+ xc.prototype._setValue_fromArray_setNeedsUpdate,
10509
+ xc.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate
10506
10510
  ]
10507
10511
  ];
10508
- var xc = class {
10512
+ var Sc = class {
10509
10513
  constructor(e, t, n = 0, r = Infinity) {
10510
10514
  this.ray = new bt(e, t), this.near = n, this.far = r, this.camera = null, this.layers = new Mt(), this.params = {
10511
10515
  Mesh: {},
@@ -10522,26 +10526,26 @@ var xc = class {
10522
10526
  t.isPerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(t.matrixWorld), this.ray.direction.set(e.x, e.y, .5).unproject(t).sub(this.ray.origin).normalize(), this.camera = t) : t.isOrthographicCamera ? (this.ray.origin.set(e.x, e.y, (t.near + t.far) / (t.near - t.far)).unproject(t), this.ray.direction.set(0, 0, -1).transformDirection(t.matrixWorld), this.camera = t) : console.error("THREE.Raycaster: Unsupported camera type: " + t.type);
10523
10527
  }
10524
10528
  intersectObject(e, t = !0, n = []) {
10525
- return Cc(e, this, n, t), n.sort(Sc), n;
10529
+ return wc(e, this, n, t), n.sort(Cc), n;
10526
10530
  }
10527
10531
  intersectObjects(e, t = !0, n = []) {
10528
- for (let r = 0, i = e.length; r < i; r++) Cc(e[r], this, n, t);
10529
- return n.sort(Sc), n;
10532
+ for (let r = 0, i = e.length; r < i; r++) wc(e[r], this, n, t);
10533
+ return n.sort(Cc), n;
10530
10534
  }
10531
10535
  };
10532
- function Sc(e, t) {
10536
+ function Cc(e, t) {
10533
10537
  return e.distance - t.distance;
10534
10538
  }
10535
- function Cc(e, t, n, r) {
10539
+ function wc(e, t, n, r) {
10536
10540
  if (e.layers.test(t.layers) && e.raycast(t, n), r === !0) {
10537
10541
  let r = e.children;
10538
- for (let e = 0, i = r.length; e < i; e++) Cc(r[e], t, n, !0);
10542
+ for (let e = 0, i = r.length; e < i; e++) wc(r[e], t, n, !0);
10539
10543
  }
10540
10544
  }
10541
10545
  typeof __THREE_DEVTOOLS__ < "u" && __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register", { detail: { revision: "159" } })), typeof window < "u" && (window.__THREE__ ? console.warn("WARNING: Multiple instances of Three.js being imported.") : window.__THREE__ = "159");
10542
10546
  //#endregion
10543
10547
  //#region ../../node_modules/@tweenjs/tween.js/dist/tween.esm.js
10544
- var wc = {
10548
+ var Tc = {
10545
10549
  Linear: { None: function(e) {
10546
10550
  return e;
10547
10551
  } },
@@ -10649,21 +10653,21 @@ var wc = {
10649
10653
  },
10650
10654
  Bounce: {
10651
10655
  In: function(e) {
10652
- return 1 - wc.Bounce.Out(1 - e);
10656
+ return 1 - Tc.Bounce.Out(1 - e);
10653
10657
  },
10654
10658
  Out: function(e) {
10655
10659
  return e < 1 / 2.75 ? 7.5625 * e * e : e < 2 / 2.75 ? 7.5625 * (e -= 1.5 / 2.75) * e + .75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + .9375 : 7.5625 * (e -= 2.625 / 2.75) * e + .984375;
10656
10660
  },
10657
10661
  InOut: function(e) {
10658
- return e < .5 ? wc.Bounce.In(e * 2) * .5 : wc.Bounce.Out(e * 2 - 1) * .5 + .5;
10662
+ return e < .5 ? Tc.Bounce.In(e * 2) * .5 : Tc.Bounce.Out(e * 2 - 1) * .5 + .5;
10659
10663
  }
10660
10664
  }
10661
- }, Tc = typeof self > "u" && typeof process < "u" && process.hrtime ? function() {
10665
+ }, Ec = typeof self > "u" && typeof process < "u" && process.hrtime ? function() {
10662
10666
  var e = process.hrtime();
10663
10667
  return e[0] * 1e3 + e[1] / 1e6;
10664
10668
  } : typeof self < "u" && self.performance !== void 0 && self.performance.now !== void 0 ? self.performance.now.bind(self.performance) : Date.now === void 0 ? function() {
10665
10669
  return (/* @__PURE__ */ new Date()).getTime();
10666
- } : Date.now, Ec = function() {
10670
+ } : Date.now, Dc = function() {
10667
10671
  function e() {
10668
10672
  this._tweens = {}, this._tweensAddedDuringUpdate = {};
10669
10673
  }
@@ -10679,7 +10683,7 @@ var wc = {
10679
10683
  }, e.prototype.remove = function(e) {
10680
10684
  delete this._tweens[e.getId()], delete this._tweensAddedDuringUpdate[e.getId()];
10681
10685
  }, e.prototype.update = function(e, t) {
10682
- e === void 0 && (e = Tc()), t === void 0 && (t = !1);
10686
+ e === void 0 && (e = Ec()), t === void 0 && (t = !1);
10683
10687
  var n = Object.keys(this._tweens);
10684
10688
  if (n.length === 0) return !1;
10685
10689
  for (; n.length > 0;) {
@@ -10692,17 +10696,17 @@ var wc = {
10692
10696
  }
10693
10697
  return !0;
10694
10698
  }, e;
10695
- }(), Dc = {
10699
+ }(), Oc = {
10696
10700
  Linear: function(e, t) {
10697
- var n = e.length - 1, r = n * t, i = Math.floor(r), a = Dc.Utils.Linear;
10701
+ var n = e.length - 1, r = n * t, i = Math.floor(r), a = Oc.Utils.Linear;
10698
10702
  return t < 0 ? a(e[0], e[1], r) : t > 1 ? a(e[n], e[n - 1], n - r) : a(e[i], e[i + 1 > n ? n : i + 1], r - i);
10699
10703
  },
10700
10704
  Bezier: function(e, t) {
10701
- for (var n = 0, r = e.length - 1, i = Math.pow, a = Dc.Utils.Bernstein, o = 0; o <= r; o++) n += i(1 - t, r - o) * i(t, o) * e[o] * a(r, o);
10705
+ for (var n = 0, r = e.length - 1, i = Math.pow, a = Oc.Utils.Bernstein, o = 0; o <= r; o++) n += i(1 - t, r - o) * i(t, o) * e[o] * a(r, o);
10702
10706
  return n;
10703
10707
  },
10704
10708
  CatmullRom: function(e, t) {
10705
- var n = e.length - 1, r = n * t, i = Math.floor(r), a = Dc.Utils.CatmullRom;
10709
+ var n = e.length - 1, r = n * t, i = Math.floor(r), a = Oc.Utils.CatmullRom;
10706
10710
  return e[0] === e[n] ? (t < 0 && (i = Math.floor(r = n * (1 + t))), a(e[(i - 1 + n) % n], e[i], e[(i + 1) % n], e[(i + 2) % n], r - i)) : t < 0 ? e[0] - (a(e[0], e[0], e[1], e[1], -r) - e[0]) : t > 1 ? e[n] - (a(e[n], e[n], e[n - 1], e[n - 1], r - n) - e[n]) : a(e[i ? i - 1 : 0], e[i], e[n < i + 1 ? n : i + 1], e[n < i + 2 ? n : i + 2], r - i);
10707
10711
  },
10708
10712
  Utils: {
@@ -10710,7 +10714,7 @@ var wc = {
10710
10714
  return (t - e) * n + e;
10711
10715
  },
10712
10716
  Bernstein: function(e, t) {
10713
- var n = Dc.Utils.Factorial;
10717
+ var n = Oc.Utils.Factorial;
10714
10718
  return n(e) / n(t) / n(e - t);
10715
10719
  },
10716
10720
  Factorial: (function() {
@@ -10727,14 +10731,14 @@ var wc = {
10727
10731
  return (2 * t - 2 * n + a + o) * c + (-3 * t + 3 * n - 2 * a - o) * s + a * i + t;
10728
10732
  }
10729
10733
  }
10730
- }, Oc = function() {
10734
+ }, kc = function() {
10731
10735
  function e() {}
10732
10736
  return e.nextId = function() {
10733
10737
  return e._nextId++;
10734
10738
  }, e._nextId = 0, e;
10735
- }(), kc = new Ec(), Ac = function() {
10739
+ }(), Ac = new Dc(), jc = function() {
10736
10740
  function e(e, t) {
10737
- t === void 0 && (t = kc), this._object = e, this._group = t, this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = wc.Linear.None, this._interpolationFunction = Dc.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._id = Oc.nextId(), this._isChainStopped = !1, this._goToEnd = !1;
10741
+ t === void 0 && (t = Ac), this._object = e, this._group = t, this._isPaused = !1, this._pauseStart = 0, this._valuesStart = {}, this._valuesEnd = {}, this._valuesStartRepeat = {}, this._duration = 1e3, this._initialRepeat = 0, this._repeat = 0, this._yoyo = !1, this._isPlaying = !1, this._reversed = !1, this._delayTime = 0, this._startTime = 0, this._easingFunction = Tc.Linear.None, this._interpolationFunction = Oc.Linear, this._chainedTweens = [], this._onStartCallbackFired = !1, this._id = kc.nextId(), this._isChainStopped = !1, this._goToEnd = !1;
10738
10742
  }
10739
10743
  return e.prototype.getId = function() {
10740
10744
  return this._id;
@@ -10749,7 +10753,7 @@ var wc = {
10749
10753
  }, e.prototype.start = function(e) {
10750
10754
  if (this._isPlaying) return this;
10751
10755
  if (this._group && this._group.add(this), this._repeat = this._initialRepeat, this._reversed) for (var t in this._reversed = !1, this._valuesStartRepeat) this._swapEndStartRepeatValues(t), this._valuesStart[t] = this._valuesStartRepeat[t];
10752
- return this._isPlaying = !0, this._isPaused = !1, this._onStartCallbackFired = !1, this._isChainStopped = !1, this._startTime = e === void 0 ? Tc() : typeof e == "string" ? Tc() + parseFloat(e) : e, this._startTime += this._delayTime, this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat), this;
10756
+ return this._isPlaying = !0, this._isPaused = !1, this._onStartCallbackFired = !1, this._isChainStopped = !1, this._startTime = e === void 0 ? Ec() : typeof e == "string" ? Ec() + parseFloat(e) : e, this._startTime += this._delayTime, this._setupProperties(this._object, this._valuesStart, this._valuesEnd, this._valuesStartRepeat), this;
10753
10757
  }, e.prototype._setupProperties = function(e, t, n, r) {
10754
10758
  for (var i in n) {
10755
10759
  var a = e[i], o = Array.isArray(a), s = o ? "array" : typeof a, c = !o && Array.isArray(n[i]);
@@ -10770,9 +10774,9 @@ var wc = {
10770
10774
  }, e.prototype.end = function() {
10771
10775
  return this._goToEnd = !0, this.update(Infinity), this;
10772
10776
  }, e.prototype.pause = function(e) {
10773
- return e === void 0 && (e = Tc()), this._isPaused || !this._isPlaying ? this : (this._isPaused = !0, this._pauseStart = e, this._group && this._group.remove(this), this);
10777
+ return e === void 0 && (e = Ec()), this._isPaused || !this._isPlaying ? this : (this._isPaused = !0, this._pauseStart = e, this._group && this._group.remove(this), this);
10774
10778
  }, e.prototype.resume = function(e) {
10775
- return e === void 0 && (e = Tc()), !this._isPaused || !this._isPlaying ? this : (this._isPaused = !1, this._startTime += e - this._pauseStart, this._pauseStart = 0, this._group && this._group.add(this), this);
10779
+ return e === void 0 && (e = Ec()), !this._isPaused || !this._isPlaying ? this : (this._isPaused = !1, this._startTime += e - this._pauseStart, this._pauseStart = 0, this._group && this._group.add(this), this);
10776
10780
  }, e.prototype.stopChainedTweens = function() {
10777
10781
  for (var e = 0, t = this._chainedTweens.length; e < t; e++) this._chainedTweens[e].stop();
10778
10782
  return this;
@@ -10804,7 +10808,7 @@ var wc = {
10804
10808
  }, e.prototype.onStop = function(e) {
10805
10809
  return this._onStopCallback = e, this;
10806
10810
  }, e.prototype.update = function(e, t) {
10807
- if (e === void 0 && (e = Tc()), t === void 0 && (t = !0), this._isPaused) return !0;
10811
+ if (e === void 0 && (e = Ec()), t === void 0 && (t = !0), this._isPaused) return !0;
10808
10812
  var n, r, i = this._startTime + this._duration;
10809
10813
  if (!this._goToEnd && !this._isPlaying) {
10810
10814
  if (e > i) return !1;
@@ -10834,45 +10838,56 @@ var wc = {
10834
10838
  typeof n == "string" ? this._valuesStartRepeat[e] = this._valuesStartRepeat[e] + parseFloat(n) : this._valuesStartRepeat[e] = this._valuesEnd[e], this._valuesEnd[e] = t;
10835
10839
  }, e;
10836
10840
  }();
10837
- Oc.nextId;
10838
- var jc = kc;
10839
- jc.getAll.bind(jc), jc.removeAll.bind(jc), jc.add.bind(jc), jc.remove.bind(jc), jc.update.bind(jc);
10841
+ kc.nextId;
10842
+ var Mc = Ac;
10843
+ Mc.getAll.bind(Mc), Mc.removeAll.bind(Mc), Mc.add.bind(Mc), Mc.remove.bind(Mc), Mc.update.bind(Mc);
10840
10844
  //#endregion
10841
10845
  //#region src/tweens.ts
10842
- var Mc = new Ec(), Nc = new X(0, -1, 0), Pc = new X(1, 0, 0), Fc = new X(0, 0, -1), Ic = 8, Lc = (e) => (e % 1 + 1) % 1, Rc = (e) => (e % 360 + 360) % 360;
10843
- function zc(e) {
10844
- return Lc(.75 - e / 360);
10846
+ var Nc = new Dc(), Pc = new X(0, -1, 0), Fc = new X(1, 0, 0), Ic = new X(0, 0, -1), Lc = 8, Rc = (e) => (e % 1 + 1) % 1, zc = (e) => (e % 360 + 360) % 360;
10847
+ function Bc(e) {
10848
+ return Rc(.75 - e / 360);
10845
10849
  }
10846
- function Bc(e, t) {
10850
+ function Vc(e, t) {
10847
10851
  let n = e.clone().normalize();
10848
- return [Lc(Math.atan2(n.z, n.x) / (2 * Math.PI) + zc(t)), 1 - Math.acos(xe.clamp(n.y, -1, 1)) / Math.PI];
10852
+ return [Rc(Math.atan2(n.z, n.x) / (2 * Math.PI) + Bc(t)), 1 - Math.acos(xe.clamp(n.y, -1, 1)) / Math.PI];
10849
10853
  }
10850
- function Vc(e, t, n, r) {
10851
- let [i, a] = Bc(e, t);
10854
+ function Hc(e, t, n, r) {
10855
+ let [i, a] = Vc(e, t);
10852
10856
  return [Math.min(n - 1, Math.floor(i * n)), Math.min(r - 1, Math.floor((1 - a) * r))];
10853
10857
  }
10854
- function Hc(e, t = 0, n = new Ge()) {
10855
- return n.setFromAxisAngle(Nc, xe.degToRad(e)).multiply(new Ge().setFromAxisAngle(Pc, xe.degToRad(t)));
10858
+ function Uc(e, t = 0, n = new Ge()) {
10859
+ return n.setFromAxisAngle(Pc, xe.degToRad(e)).multiply(new Ge().setFromAxisAngle(Fc, xe.degToRad(t)));
10856
10860
  }
10857
- function Uc(e) {
10858
- let t = Fc.clone().applyQuaternion(e);
10859
- return Rc(xe.radToDeg(Math.atan2(t.x, -t.z)));
10861
+ function Wc(e) {
10862
+ let t = e.clone().normalize();
10863
+ return {
10864
+ heading: zc(xe.radToDeg(Math.atan2(t.x, -t.z))),
10865
+ pitch: xe.radToDeg(Math.asin(xe.clamp(t.y, -1, 1)))
10866
+ };
10860
10867
  }
10861
- function Wc(e, t, n = new X()) {
10868
+ function Gc(e) {
10869
+ let t = Ic.clone().applyQuaternion(e);
10870
+ return zc(xe.radToDeg(Math.atan2(t.x, -t.z)));
10871
+ }
10872
+ function Kc(e, t, n = new X()) {
10862
10873
  let r = e.distanceTo(t), i = e.bearingTo(t);
10863
10874
  return n.set(r * Math.sin(i), 0, -r * Math.cos(i));
10864
10875
  }
10865
- function Gc(e, t) {
10876
+ function qc(e, t, n = new X()) {
10877
+ if (e.alt === null || t.alt === null) throw Error("Placing a point in the panorama needs its altitude and the node's.");
10878
+ return Kc(e, t, n).setY(t.alt - e.alt);
10879
+ }
10880
+ function Jc(e, t) {
10866
10881
  let n = t.x, r = -t.z;
10867
10882
  return e.destinationPoint(Math.hypot(n, r), Math.atan2(n, r));
10868
10883
  }
10869
- function Kc(e, t) {
10884
+ function Yc(e, t) {
10870
10885
  let n = new X();
10871
- return e && e.level === t.level && Wc(e.coordinates, t.coordinates, n), n.length() > Ic ? n.set(0, 0, 0) : n;
10886
+ return e && e.level === t.level && Kc(e.coordinates, t.coordinates, n), n.length() > Lc ? n.set(0, 0, 0) : n;
10872
10887
  }
10873
10888
  //#endregion
10874
10889
  //#region src/controls/SphereControls.ts
10875
- var qc = 4, Jc = .95, Yc = .01, Xc = .3, Zc = { type: "change" }, Qc = { type: "start" }, $c = { type: "end" }, el = class extends ie {
10890
+ var Xc = 4, Zc = .95, Qc = .01, $c = .3, el = { type: "change" }, tl = { type: "start" }, nl = { type: "end" }, rl = class extends ie {
10876
10891
  config;
10877
10892
  minFov = 20;
10878
10893
  maxFov = 100;
@@ -10926,12 +10941,12 @@ var qc = 4, Jc = .95, Yc = .01, Xc = .3, Zc = { type: "change" }, Qc = { type: "
10926
10941
  }
10927
10942
  updateFov(e) {
10928
10943
  if (this.config.zoomEnable) {
10929
- let t = { fov: this.camera.fov }, n = { fov: e }, r = new Ac(t).to(n, 400).easing(wc.Cubic.InOut).onUpdate((e) => {
10944
+ let t = { fov: this.camera.fov }, n = { fov: e }, r = new jc(t).to(n, 400).easing(Tc.Cubic.InOut).onUpdate((e) => {
10930
10945
  this.camera.fov = e.fov, this.camera.updateProjectionMatrix();
10931
10946
  }).onComplete(() => {
10932
- Mc.remove(r);
10947
+ Nc.remove(r);
10933
10948
  });
10934
- Mc.add(r), r.start();
10949
+ Nc.add(r), r.start();
10935
10950
  }
10936
10951
  }
10937
10952
  retrieveLatLonFromCamera() {
@@ -10941,20 +10956,20 @@ var qc = 4, Jc = .95, Yc = .01, Xc = .3, Zc = { type: "change" }, Qc = { type: "
10941
10956
  onPointerStart = (e) => {
10942
10957
  e.preventDefault(), this.element.focus({ preventScroll: !0 }), this.isUserInteracting = !0;
10943
10958
  let t = e instanceof MouseEvent ? e.clientX : e.touches[0].screenX, n = e instanceof MouseEvent ? e.clientY : e.touches[0].screenY;
10944
- this.onMouseDownMouseX = t, this.onMouseDownMouseY = n, this.retrieveLatLonFromCamera(), this.onMouseDownLon = this._lon, this.onMouseDownLat = this._lat, this.animationFrameId !== null && (cancelAnimationFrame(this.animationFrameId), this.animationFrameId = null), this.velocityLon = 0, this.velocityLat = 0, this.dispatchEvent(Qc);
10959
+ this.onMouseDownMouseX = t, this.onMouseDownMouseY = n, this.retrieveLatLonFromCamera(), this.onMouseDownLon = this._lon, this.onMouseDownLat = this._lat, this.animationFrameId !== null && (cancelAnimationFrame(this.animationFrameId), this.animationFrameId = null), this.velocityLon = 0, this.velocityLat = 0, this.dispatchEvent(tl);
10945
10960
  };
10946
10961
  onPointerMove = (e) => {
10947
10962
  if (e.preventDefault(), e.stopPropagation(), this.isUserInteracting) {
10948
10963
  let t = e instanceof MouseEvent ? e.clientX : e.touches[0].screenX, n = e instanceof MouseEvent ? e.clientY : e.touches[0].screenY, r = performance.now(), i = r - this.lastUpdateTime;
10949
10964
  if (i > 0) {
10950
10965
  let e = t - this.lastMouseX, r = n - this.lastMouseY;
10951
- this.velocityLon = -e / i * Xc, this.velocityLat = r / i * Xc;
10966
+ this.velocityLon = -e / i * $c, this.velocityLat = r / i * $c;
10952
10967
  }
10953
- this._lon = (this.onMouseDownMouseX - t) * this.sensibility + this.onMouseDownLon, this._lat = (n - this.onMouseDownMouseY) * this.sensibility + this.onMouseDownLat, this.lastMouseX = t, this.lastMouseY = n, this.lastUpdateTime = r, this.update(), this.dispatchEvent(Zc);
10968
+ this._lon = (this.onMouseDownMouseX - t) * this.sensibility + this.onMouseDownLon, this._lat = (n - this.onMouseDownMouseY) * this.sensibility + this.onMouseDownLat, this.lastMouseX = t, this.lastMouseY = n, this.lastUpdateTime = r, this.update(), this.dispatchEvent(el);
10954
10969
  }
10955
10970
  };
10956
10971
  onPointerUp = (e) => {
10957
- e.preventDefault(), this.isUserInteracting = !1, (Math.abs(this.velocityLon) > Yc || Math.abs(this.velocityLat) > Yc) && (this.animationFrameId = requestAnimationFrame(this.updateVelocity)), this.dispatchEvent($c);
10972
+ e.preventDefault(), this.isUserInteracting = !1, (Math.abs(this.velocityLon) > Qc || Math.abs(this.velocityLat) > Qc) && (this.animationFrameId = requestAnimationFrame(this.updateVelocity)), this.dispatchEvent(nl);
10958
10973
  };
10959
10974
  onDocumentMouseWheel = (e) => {
10960
10975
  e.preventDefault();
@@ -10965,20 +10980,20 @@ var qc = 4, Jc = .95, Yc = .01, Xc = .3, Zc = { type: "change" }, Qc = { type: "
10965
10980
  let t = !0;
10966
10981
  switch (e.key) {
10967
10982
  case "ArrowLeft":
10968
- this._lon = (this._lon - qc) % 360;
10983
+ this._lon = (this._lon - Xc) % 360;
10969
10984
  break;
10970
10985
  case "ArrowRight":
10971
- this._lon = (this._lon + qc) % 360;
10986
+ this._lon = (this._lon + Xc) % 360;
10972
10987
  break;
10973
10988
  case "ArrowUp":
10974
- this._lat = Math.max(-85, Math.min(85, this._lat + qc));
10989
+ this._lat = Math.max(-85, Math.min(85, this._lat + Xc));
10975
10990
  break;
10976
10991
  case "ArrowDown":
10977
- this._lat = Math.max(-85, Math.min(85, this._lat - qc));
10992
+ this._lat = Math.max(-85, Math.min(85, this._lat - Xc));
10978
10993
  break;
10979
10994
  default: t = !1;
10980
10995
  }
10981
- t && (e.preventDefault(), this.isArrowKeyPressed = !0, this.update(), this.dispatchEvent(Zc));
10996
+ t && (e.preventDefault(), this.isArrowKeyPressed = !0, this.update(), this.dispatchEvent(el));
10982
10997
  };
10983
10998
  update() {
10984
10999
  if (this._autoRotate && !this.isUserInteracting && !this.isArrowKeyPressed) {
@@ -10988,29 +11003,29 @@ var qc = 4, Jc = .95, Yc = .01, Xc = .3, Zc = { type: "change" }, Qc = { type: "
10988
11003
  this._lon = (this._lon + this.autoRotateSpeed * 360 * t) % 360;
10989
11004
  }
10990
11005
  }
10991
- let e = Hc(this._lon, this._lat);
11006
+ let e = Uc(this._lon, this._lat);
10992
11007
  if (this.isArrowKeyPressed) {
10993
11008
  this.isArrowKeyPressed = !1;
10994
11009
  let t = this.camera.quaternion.clone(), n = this.sphere.quaternion.clone().multiply(e), r = { t: 0 };
10995
11010
  this.currentTween && this.currentTween.stop();
10996
- let i = new Ge(), a = new Ac(r).to({ t: 1 }, 400).easing(wc.Cubic.Out).onUpdate(() => {
11011
+ let i = new Ge(), a = new jc(r).to({ t: 1 }, 400).easing(Tc.Cubic.Out).onUpdate(() => {
10997
11012
  i.slerpQuaternions(t, n, r.t), this.camera.quaternion.set(i.x, i.y, i.z, i.w);
10998
11013
  }).start().onStop(() => {
10999
- Mc.remove(a);
11014
+ Nc.remove(a);
11000
11015
  }).onComplete(() => {
11001
- Mc.remove(a);
11016
+ Nc.remove(a);
11002
11017
  });
11003
- Mc.add(a), this.currentTween = a;
11018
+ Nc.add(a), this.currentTween = a;
11004
11019
  } else this.camera.quaternion.copy(this.sphere.quaternion.clone().multiply(e));
11005
11020
  }
11006
11021
  updateVelocity = () => {
11007
- Math.abs(this.velocityLon) > Yc || Math.abs(this.velocityLat) > Yc ? (this._lon = (this._lon + this.velocityLon) % 360, this._lat = Math.max(-85, Math.min(85, this._lat + this.velocityLat)), this.velocityLon *= Jc, this.velocityLat *= Jc, Math.abs(this.velocityLon) < Yc && (this.velocityLon = 0), Math.abs(this.velocityLat) < Yc && (this.velocityLat = 0), this.update(), this.dispatchEvent(Zc), this.animationFrameId = requestAnimationFrame(this.updateVelocity)) : this.animationFrameId = null;
11022
+ Math.abs(this.velocityLon) > Qc || Math.abs(this.velocityLat) > Qc ? (this._lon = (this._lon + this.velocityLon) % 360, this._lat = Math.max(-85, Math.min(85, this._lat + this.velocityLat)), this.velocityLon *= Zc, this.velocityLat *= Zc, Math.abs(this.velocityLon) < Qc && (this.velocityLon = 0), Math.abs(this.velocityLat) < Qc && (this.velocityLat = 0), this.update(), this.dispatchEvent(el), this.animationFrameId = requestAnimationFrame(this.updateVelocity)) : this.animationFrameId = null;
11008
11023
  };
11009
- }, tl = 1.5, nl = 50, rl = 5, il = .01;
11010
- function al(e, t) {
11011
- return new rs().moveTo(-t, -e).lineTo(t, -e).lineTo(t, -t).lineTo(e, -t).lineTo(e, t).lineTo(t, t).lineTo(t, e).lineTo(-t, e).lineTo(-t, t).lineTo(-e, t).lineTo(-e, -t).lineTo(-t, -t).lineTo(-t, -e);
11024
+ }, il = 1.5, al = 50, ol = 5, sl = .01;
11025
+ function cl(e, t) {
11026
+ return new is().moveTo(-t, -e).lineTo(t, -e).lineTo(t, -t).lineTo(e, -t).lineTo(e, t).lineTo(t, t).lineTo(t, e).lineTo(-t, e).lineTo(-t, t).lineTo(-e, t).lineTo(-e, -t).lineTo(-t, -t).lineTo(-t, -e);
11012
11027
  }
11013
- function ol(e, t) {
11028
+ function ll(e, t) {
11014
11029
  return new pn({
11015
11030
  color: e,
11016
11031
  transparent: !0,
@@ -11019,15 +11034,15 @@ function ol(e, t) {
11019
11034
  depthTest: !1
11020
11035
  });
11021
11036
  }
11022
- var sl = class {
11037
+ var ul = class {
11023
11038
  mode = "navigate";
11024
11039
  scene;
11025
11040
  camera;
11026
11041
  element;
11027
11042
  callbacks;
11028
11043
  walk;
11029
- raycaster = new xc();
11030
- floor = new pr(new X(0, 1, 0), tl);
11044
+ raycaster = new Sc();
11045
+ floor = new pr(new X(0, 1, 0), il);
11031
11046
  pointer = new K();
11032
11047
  hit = new X();
11033
11048
  disc;
@@ -11035,10 +11050,10 @@ var sl = class {
11035
11050
  pressedAt = null;
11036
11051
  target = null;
11037
11052
  constructor(e, t, n, r, i = !0) {
11038
- this.scene = e, this.camera = t, this.element = n, this.callbacks = r, this.walk = i, this.disc = new Gn(new ns(.2, 48), ol(5096447, .55)), this.disc.rotation.x = -Math.PI / 2, this.disc.renderOrder = 999;
11039
- let a = new Gn(new Bs(al(.17, .03)), ol(16777215, .5));
11053
+ this.scene = e, this.camera = t, this.element = n, this.callbacks = r, this.walk = i, this.disc = new Gn(new rs(.2, 48), ll(5096447, .55)), this.disc.rotation.x = -Math.PI / 2, this.disc.renderOrder = 999;
11054
+ let a = new Gn(new Vs(cl(.17, .03)), ll(16777215, .5));
11040
11055
  a.renderOrder = 999;
11041
- let o = new Gn(new Bs(al(.16, .02)), ol(7105644, .75));
11056
+ let o = new Gn(new Vs(cl(.16, .02)), ll(7105644, .75));
11042
11057
  o.renderOrder = 1e3, this.cross = new Kt(), this.cross.add(a, o), this.cross.rotation.x = -Math.PI / 2, this.hide(), e.add(this.disc, this.cross), n.addEventListener("pointermove", this.onPointerMove), n.addEventListener("pointerdown", this.onPointerDown), n.addEventListener("pointerup", this.onPointerUp), n.addEventListener("pointerleave", this.onPointerLeave);
11043
11058
  }
11044
11059
  hide() {
@@ -11059,12 +11074,12 @@ var sl = class {
11059
11074
  };
11060
11075
  onPointerUp = (e) => {
11061
11076
  let t = this.pressedAt;
11062
- if (this.pressedAt = null, !(!t || Math.abs(e.clientX - t.x) > rl || Math.abs(e.clientY - t.y) > rl)) {
11077
+ if (this.pressedAt = null, !(!t || Math.abs(e.clientX - t.x) > ol || Math.abs(e.clientY - t.y) > ol)) {
11063
11078
  if (this.mode !== "navigate") {
11064
11079
  this.callbacks.current() && (this.aim(e), this.callbacks.pick(this.raycaster.ray.direction.clone()));
11065
11080
  return;
11066
11081
  }
11067
- this.update(e), this.target && this.callbacks.select(this.target);
11082
+ this.update(e), this.target ? this.callbacks.select(this.target) : this.callbacks.current() && (this.aim(e), this.callbacks.miss(this.raycaster.ray.direction.clone()));
11068
11083
  }
11069
11084
  };
11070
11085
  onPointerLeave = () => {
@@ -11086,19 +11101,19 @@ var sl = class {
11086
11101
  }
11087
11102
  this.aim(e);
11088
11103
  let n = this.raycaster.ray.intersectPlane(this.floor, this.hit);
11089
- if (!t || !n || n.length() > nl) {
11104
+ if (!t || !n || n.length() > al) {
11090
11105
  this.hide();
11091
11106
  return;
11092
11107
  }
11093
- this.disc.position.set(n.x, n.y + il, n.z), this.disc.visible = !0;
11094
- let r = this.callbacks.nearest(Gc(t.coordinates, n));
11108
+ this.disc.position.set(n.x, n.y + sl, n.z), this.disc.visible = !0;
11109
+ let r = this.callbacks.nearest(Jc(t.coordinates, n));
11095
11110
  if (this.target = r, !r) {
11096
11111
  this.cross.visible = !1, this.element.style.cursor = "";
11097
11112
  return;
11098
11113
  }
11099
- Wc(t.coordinates, r.coordinates, this.cross.position).y = -1.49, this.cross.visible = !0, this.element.style.cursor = "pointer";
11114
+ Kc(t.coordinates, r.coordinates, this.cross.position).y = -1.49, this.cross.visible = !0, this.element.style.cursor = "pointer";
11100
11115
  }
11101
- }, cl = 4, ll = .065, ul = .075, dl = 1e3, fl = (e) => (e.depthTest = !1, e.transparent = !0, e), pl = class {
11116
+ }, dl = 4, fl = .065, pl = .075, ml = 1e3, hl = (e) => (e.depthTest = !1, e.transparent = !0, e), gl = class {
11102
11117
  scene;
11103
11118
  group = new uo();
11104
11119
  constructor(e) {
@@ -11108,23 +11123,23 @@ var sl = class {
11108
11123
  return this.group.children.filter((e) => e instanceof uo).length;
11109
11124
  }
11110
11125
  add(e) {
11111
- let t = e.clone().normalize().multiplyScalar(cl), n = new uo(), r = new Gn(new zs(ll, ul, 48), fl(new pn({
11126
+ let t = e.clone().normalize().multiplyScalar(dl), n = new uo(), r = new Gn(new Bs(fl, pl, 48), hl(new pn({
11112
11127
  color: 16777215,
11113
11128
  opacity: .8,
11114
11129
  side: 2
11115
- }))), i = new Gn(new ns(ll, 48), fl(new pn({
11130
+ }))), i = new Gn(new rs(fl, 48), hl(new pn({
11116
11131
  color: 16711680,
11117
11132
  side: 2
11118
11133
  })));
11119
- r.renderOrder = dl, i.renderOrder = dl, n.add(r, i), n.position.copy(t), n.lookAt(0, 0, 0), this.group.add(n);
11134
+ r.renderOrder = ml, i.renderOrder = ml, n.add(r, i), n.position.copy(t), n.lookAt(0, 0, 0), this.group.add(n);
11120
11135
  let a = this.group.children.filter((e) => e instanceof uo);
11121
11136
  if (a.length === 2) {
11122
- let e = new Eo(new Dn().setFromPoints([a[0].position, a[1].position]), fl(new Us({
11137
+ let e = new Eo(new Dn().setFromPoints([a[0].position, a[1].position]), hl(new Ws({
11123
11138
  color: 16711680,
11124
11139
  dashSize: .06,
11125
11140
  gapSize: .04
11126
11141
  })));
11127
- e.computeLineDistances(), e.renderOrder = dl - 1, this.group.add(e);
11142
+ e.computeLineDistances(), e.renderOrder = ml - 1, this.group.add(e);
11128
11143
  }
11129
11144
  }
11130
11145
  clear() {
@@ -11135,10 +11150,62 @@ var sl = class {
11135
11150
  dispose() {
11136
11151
  this.clear(), this.scene.remove(this.group);
11137
11152
  }
11138
- }, ml = 700, hl = 300, gl = 5, _l = (e) => new cc().loadAsync(e).catch(() => {
11153
+ }, _l = "#2F7DE1", vl = .25, yl = 1001;
11154
+ function bl(e) {
11155
+ let t = new X();
11156
+ e.forEach((n, r) => {
11157
+ let i = e[(r + 1) % e.length];
11158
+ t.x += (n.y - i.y) * (n.z + i.z), t.y += (n.z - i.z) * (n.x + i.x), t.z += (n.x - i.x) * (n.y + i.y);
11159
+ }), t.normalize();
11160
+ let n = new X().subVectors(e[1], e[0]).normalize(), r = new X().crossVectors(t, n);
11161
+ return e.map((t) => {
11162
+ let i = new X().subVectors(t, e[0]);
11163
+ return new K(i.dot(n), i.dot(r));
11164
+ });
11165
+ }
11166
+ var xl = class {
11167
+ scene;
11168
+ group = new uo();
11169
+ polygons = [];
11170
+ origin = null;
11171
+ constructor(e) {
11172
+ this.scene = e, e.add(this.group);
11173
+ }
11174
+ set(e) {
11175
+ this.polygons = e, this.build();
11176
+ }
11177
+ placeAt(e) {
11178
+ e !== this.origin && (this.origin = e, this.build());
11179
+ }
11180
+ build() {
11181
+ this.clear();
11182
+ let e = this.origin;
11183
+ if (e) for (let t of this.polygons) {
11184
+ if (t.coordinates.length < 3) continue;
11185
+ let n = t.coordinates.map((t) => qc(e.coordinates, t)), r = new Z(t.color ?? _l), i = Ls.triangulateShape(bl(n), []), a = new Gn(new Dn().setFromPoints(i.flat().map((e) => n[e])), new pn({
11186
+ color: r,
11187
+ opacity: t.fillOpacity ?? vl,
11188
+ transparent: !0,
11189
+ side: 2,
11190
+ depthTest: !1
11191
+ })), o = new Do(new Dn().setFromPoints(n), new bo({
11192
+ color: new Z(t.outlineColor ?? t.color ?? _l),
11193
+ transparent: !0,
11194
+ depthTest: !1
11195
+ }));
11196
+ a.renderOrder = yl, o.renderOrder = yl, this.group.add(a, o);
11197
+ }
11198
+ }
11199
+ clear() {
11200
+ for (let e of [...this.group.children]) (e instanceof Gn || e instanceof Do) && (e.geometry.dispose(), e.material.dispose()), this.group.remove(e);
11201
+ }
11202
+ dispose() {
11203
+ this.clear(), this.scene.remove(this.group);
11204
+ }
11205
+ }, Sl = 700, Cl = 300, wl = 5, Tl = (e) => new lc().loadAsync(e).catch(() => {
11139
11206
  throw Error(`Failed to load panorama image: ${e}`);
11140
- }), vl = (e) => e < .5 ? 2 * e * e : 1 - (-2 * e + 2) ** 2 / 2;
11141
- function yl() {
11207
+ }), El = (e) => e < .5 ? 2 * e * e : 1 - (-2 * e + 2) ** 2 / 2;
11208
+ function Dl() {
11142
11209
  return new nr({
11143
11210
  uniforms: {
11144
11211
  t1: { value: null },
@@ -11146,7 +11213,7 @@ function yl() {
11146
11213
  o1: { value: 0 },
11147
11214
  o2: { value: 0 },
11148
11215
  c2: { value: new X() },
11149
- radius: { value: gl },
11216
+ radius: { value: wl },
11150
11217
  transition: { value: 0 }
11151
11218
  },
11152
11219
  depthWrite: !1,
@@ -11155,15 +11222,15 @@ function yl() {
11155
11222
  fragmentShader: "\n const float PI = 3.141592653589793;\n uniform sampler2D t1;\n uniform sampler2D t2;\n uniform float o1;\n uniform float o2;\n uniform vec3 c2;\n uniform float radius;\n uniform float transition;\n varying vec3 vWorld;\n\n // Where the view ray hits the proxy sphere around `center`, as a direction from it.\n vec3 proxyDirection(vec3 ray, vec3 center) {\n vec3 p = cameraPosition - center;\n float b = dot(p, ray);\n return normalize(p + (-b + sqrt(b * b - dot(p, p) + radius * radius)) * ray);\n }\n\n // Shader twin of SceneFrame.imageUv(): keep the two in step.\n vec2 equirect(vec3 d, float offset) {\n return vec2(atan(d.z, d.x) / (2.0 * PI) + offset, 1.0 - acos(clamp(d.y, -1.0, 1.0)) / PI);\n }\n\n void main() {\n vec3 ray = normalize(vWorld - cameraPosition);\n vec4 tex1 = texture2D(t1, equirect(proxyDirection(ray, vec3(0.0)), o1));\n vec4 tex2 = texture2D(t2, equirect(proxyDirection(ray, c2), o2));\n gl_FragColor = mix(tex1, tex2, transition);\n }\n "
11156
11223
  });
11157
11224
  }
11158
- var bl = class {
11159
- material = yl();
11225
+ var Ol = class {
11226
+ material = Dl();
11160
11227
  shownNode = null;
11161
11228
  pending = null;
11162
11229
  fade = null;
11163
11230
  disposed = !1;
11164
11231
  cameraOffset = new X();
11165
11232
  loadImage;
11166
- constructor(e = _l) {
11233
+ constructor(e = Tl) {
11167
11234
  this.loadImage = e;
11168
11235
  }
11169
11236
  get shown() {
@@ -11190,12 +11257,12 @@ var bl = class {
11190
11257
  }
11191
11258
  if (this.pending !== e || this.disposed) return t.dispose(), !1;
11192
11259
  this.fade && this.settle(), t.wrapS = n, t.generateMipmaps = !1, t.minFilter = c;
11193
- let r = Kc(this.shownNode, e), i = this.material.uniforms;
11194
- return i.t2.value = t, i.o2.value = zc(e.heading), i.c2.value.copy(r), i.radius.value = Math.max(gl, r.length() * 1.5), i.transition.value = 0, this.fade = {
11260
+ let r = Yc(this.shownNode, e), i = this.material.uniforms;
11261
+ return i.t2.value = t, i.o2.value = Bc(e.heading), i.c2.value.copy(r), i.radius.value = Math.max(wl, r.length() * 1.5), i.transition.value = 0, this.fade = {
11195
11262
  node: e,
11196
11263
  texture: t,
11197
11264
  move: r,
11198
- duration: this.shownNode ? ml : hl,
11265
+ duration: this.shownNode ? Sl : Cl,
11199
11266
  start: null
11200
11267
  }, !0;
11201
11268
  }
@@ -11205,7 +11272,7 @@ var bl = class {
11205
11272
  t.start ??= e;
11206
11273
  let n = Math.min(1, (e - t.start) / t.duration);
11207
11274
  if (n >= 1) return this.settle(), this.cameraOffset.set(0, 0, 0);
11208
- let r = vl(n);
11275
+ let r = El(n);
11209
11276
  return this.material.uniforms.transition.value = r, this.cameraOffset.copy(t.move).multiplyScalar(r);
11210
11277
  }
11211
11278
  dispose() {
@@ -11222,12 +11289,12 @@ var bl = class {
11222
11289
  };
11223
11290
  //#endregion
11224
11291
  //#region src/data/ViewerDataClient.ts
11225
- async function xl(e, t) {
11292
+ async function kl(e, t) {
11226
11293
  let n = await fetch(e, t);
11227
11294
  if (!n.ok) throw Error(`Request failed (${n.status}): ${e}`);
11228
11295
  return n.json();
11229
11296
  }
11230
- function Sl(t, n) {
11297
+ function Al(t, n) {
11231
11298
  return t.images.map((t) => ({
11232
11299
  id: t.id,
11233
11300
  coordinates: new e(t.coords.lat, t.coords.lng, t.coords.alt ?? null, t.coords.level),
@@ -11236,7 +11303,7 @@ function Sl(t, n) {
11236
11303
  heading: t.heading
11237
11304
  }));
11238
11305
  }
11239
- var Cl = class {
11306
+ var jl = class {
11240
11307
  endpoint;
11241
11308
  constructor(e) {
11242
11309
  let n = e ?? t.getViewerOptions().vpsEndpoint;
@@ -11247,16 +11314,16 @@ var Cl = class {
11247
11314
  return `${this.endpoint}360-viewer/image/${e}`;
11248
11315
  }
11249
11316
  getGraph() {
11250
- return xl(`${this.endpoint}360-viewer/graph.json`);
11317
+ return kl(`${this.endpoint}360-viewer/graph.json`);
11251
11318
  }
11252
11319
  getGraphGeojson() {
11253
- return xl(`${this.endpoint}360-viewer/graph.geojson`);
11320
+ return kl(`${this.endpoint}360-viewer/graph.geojson`);
11254
11321
  }
11255
11322
  async getNodes() {
11256
- return Sl(await this.getGraph(), (e) => this.imageUrl(e));
11323
+ return Al(await this.getGraph(), (e) => this.imageUrl(e));
11257
11324
  }
11258
11325
  async locate(t, n, r) {
11259
- let i = await xl(`${this.endpoint}360-viewer/image/${t.id}/coordinates`, {
11326
+ let i = await kl(`${this.endpoint}360-viewer/image/${t.id}/coordinates`, {
11260
11327
  method: "POST",
11261
11328
  headers: { "Content-Type": "application/json" },
11262
11329
  body: JSON.stringify({
@@ -11267,7 +11334,7 @@ var Cl = class {
11267
11334
  return new e(i.lat, i.lng, i.alt ?? null, i.level ?? t.level);
11268
11335
  }
11269
11336
  async measure(e, t, n) {
11270
- let r = await xl(`${this.endpoint}360-viewer/image/${e.id}/measure`, {
11337
+ let r = await kl(`${this.endpoint}360-viewer/image/${e.id}/measure`, {
11271
11338
  method: "POST",
11272
11339
  headers: { "Content-Type": "application/json" },
11273
11340
  body: JSON.stringify({
@@ -11280,7 +11347,7 @@ var Cl = class {
11280
11347
  if (typeof i != "number" || !Number.isFinite(i)) throw Error("The VPS returned no distance for this measurement.");
11281
11348
  return i;
11282
11349
  }
11283
- }, wl = 1e4, Tl = 65, El = class {
11350
+ }, Ml = 1e4, Nl = 65, Pl = 80, Fl = class {
11284
11351
  container;
11285
11352
  options;
11286
11353
  scene = new yo();
@@ -11292,6 +11359,7 @@ var Cl = class {
11292
11359
  controls;
11293
11360
  pointer;
11294
11361
  measureOverlay;
11362
+ polygonOverlay;
11295
11363
  measureStart = null;
11296
11364
  measureRun = 0;
11297
11365
  data = null;
@@ -11305,27 +11373,38 @@ var Cl = class {
11305
11373
  heading: /* @__PURE__ */ new Set(),
11306
11374
  ready: /* @__PURE__ */ new Set(),
11307
11375
  locate: /* @__PURE__ */ new Set(),
11308
- measure: /* @__PURE__ */ new Set()
11376
+ measure: /* @__PURE__ */ new Set(),
11377
+ click: /* @__PURE__ */ new Set()
11309
11378
  };
11310
11379
  turn = null;
11311
11380
  readyFired = !1;
11312
11381
  rafId = null;
11313
11382
  resizeObserver;
11314
11383
  constructor(e, t = {}) {
11315
- this.container = e, this.options = t, this.transition = new bl();
11384
+ this.container = e, this.options = t, this.transition = new Ol();
11316
11385
  let { clientWidth: n, clientHeight: r } = e;
11317
- this.camera = new ir(Tl, n / Math.max(r, 1), .1, wl * 2), this.renderer = new _o({ antialias: !0 }), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.setSize(n, r), this.renderer.domElement.classList.add("wemap-viewer__canvas"), e.appendChild(this.renderer.domElement), this.sphere = new Gn(new Hs(wl, 64, 64), this.transition.material), this.sphere.geometry.scale(-1, 1, 1), this.sphereObject.add(this.sphere), this.scene.add(this.sphereObject), this.controls = new el(this.renderer.domElement, this.camera, this.sphereObject, {
11386
+ this.camera = new ir(Nl, n / Math.max(r, 1), .1, Ml * 2), this.renderer = new _o({ antialias: !0 }), this.renderer.setPixelRatio(window.devicePixelRatio), this.renderer.setSize(n, r), this.renderer.domElement.classList.add("wemap-viewer__canvas"), e.appendChild(this.renderer.domElement), this.sphere = new Gn(new Us(Ml, 64, 64), this.transition.material), this.sphere.geometry.scale(-1, 1, 1), this.sphereObject.add(this.sphere), this.scene.add(this.sphereObject), this.controls = new rl(this.renderer.domElement, this.camera, this.sphereObject, {
11318
11387
  zoomEnable: t.zoom ?? !0,
11319
11388
  minFov: 10,
11320
- maxFov: 80
11321
- }), this.controls.addEventListener("change", this.emitHeading), this.controls.addEventListener("end", this.emitHeading), this.controls.addEventListener("start", () => this.turn?.stop()), this.pointer = new sl(this.scene, this.camera, this.renderer.domElement, {
11389
+ maxFov: t.maxFov ?? Pl
11390
+ }), this.controls.addEventListener("change", this.emitHeading), this.controls.addEventListener("end", this.emitHeading), this.controls.addEventListener("start", () => this.turn?.stop()), this.pointer = new ul(this.scene, this.camera, this.renderer.domElement, {
11322
11391
  current: () => this.transition.busy ? null : this.current,
11323
11392
  nearest: (e) => this.closestNode(e, this.current?.level, this.current),
11324
11393
  select: (e) => this.navigateTo(e.id),
11325
11394
  pick: (e) => {
11326
11395
  this.pointer.mode === "measure" ? this.measureAt(e) : this.locateAt(e);
11396
+ },
11397
+ miss: (e) => {
11398
+ let t = this.transition.shown;
11399
+ if (t) {
11400
+ let n = {
11401
+ ...Wc(e),
11402
+ node: t
11403
+ };
11404
+ this.options.onClick?.(n), this.emit("click", n);
11405
+ }
11327
11406
  }
11328
- }, t.navigation ?? !0), this.measureOverlay = new pl(this.scene), this.resizeObserver = new ResizeObserver(() => this.resize()), this.resizeObserver.observe(e), this.rafId = requestAnimationFrame(this.animate);
11407
+ }, t.navigation ?? !0), this.measureOverlay = new gl(this.scene), this.polygonOverlay = new xl(this.scene), this.resizeObserver = new ResizeObserver(() => this.resize()), this.resizeObserver.observe(e), this.rafId = requestAnimationFrame(this.animate);
11329
11408
  }
11330
11409
  async open(e, t = {}) {
11331
11410
  try {
@@ -11339,7 +11418,7 @@ var Cl = class {
11339
11418
  }
11340
11419
  loadGraph() {
11341
11420
  return this.graph ??= (async () => {
11342
- this.data ??= new Cl();
11421
+ this.data ??= new jl();
11343
11422
  let e = await this.data.getNodes();
11344
11423
  if (!e.length) throw Error("The 360° image graph is empty for this livemap.");
11345
11424
  return this.nodes = e, e;
@@ -11361,7 +11440,7 @@ var Cl = class {
11361
11440
  return this.current;
11362
11441
  }
11363
11442
  async getGraphGeojson() {
11364
- return this.data ??= new Cl(), this.geojson ??= await this.data.getGraphGeojson(), this.geojson;
11443
+ return this.data ??= new jl(), this.geojson ??= await this.data.getGraphGeojson(), this.geojson;
11365
11444
  }
11366
11445
  on(e, t) {
11367
11446
  return this.listeners[e].add(t), () => {
@@ -11401,26 +11480,29 @@ var Cl = class {
11401
11480
  }
11402
11481
  return r;
11403
11482
  }
11483
+ setPolygons(e) {
11484
+ this.polygonOverlay.set(e);
11485
+ }
11404
11486
  lookAt(e, t = 0) {
11405
11487
  let n = this.controls;
11406
11488
  this.turn?.stop();
11407
11489
  let r = {
11408
11490
  lon: n.lon,
11409
11491
  lat: n.lat
11410
- }, i = ((e - r.lon) % 360 + 540) % 360 - 180, a = new Ac(r).to({
11492
+ }, i = ((e - r.lon) % 360 + 540) % 360 - 180, a = new jc(r).to({
11411
11493
  lon: r.lon + i,
11412
11494
  lat: t
11413
- }, 800).easing(wc.Cubic.InOut).onUpdate(({ lon: e, lat: t }) => {
11495
+ }, 800).easing(Tc.Cubic.InOut).onUpdate(({ lon: e, lat: t }) => {
11414
11496
  n.lon = e, n.lat = t, this.emitHeading();
11415
- }).onStop(() => Mc.remove(a)).onComplete(() => Mc.remove(a)).start();
11416
- Mc.add(a), this.turn = a;
11497
+ }).onStop(() => Nc.remove(a)).onComplete(() => Nc.remove(a)).start();
11498
+ Nc.add(a), this.turn = a;
11417
11499
  }
11418
11500
  resize() {
11419
11501
  let { clientWidth: e, clientHeight: t } = this.container;
11420
11502
  !e || !t || (this.camera.aspect = e / t, this.camera.updateProjectionMatrix(), this.renderer.setSize(e, t));
11421
11503
  }
11422
11504
  destroy() {
11423
- this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null), this.resizeObserver.disconnect(), this.turn?.stop(), this.controls.dispose(), this.pointer.dispose(), this.measureOverlay.dispose(), this.transition.dispose(), this.sphere.geometry.dispose(), this.renderer.dispose(), this.renderer.domElement.remove();
11505
+ this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null), this.resizeObserver.disconnect(), this.turn?.stop(), this.controls.dispose(), this.pointer.dispose(), this.measureOverlay.dispose(), this.polygonOverlay.dispose(), this.transition.dispose(), this.sphere.geometry.dispose(), this.renderer.dispose(), this.renderer.domElement.remove();
11424
11506
  }
11425
11507
  get clickMode() {
11426
11508
  return this.pointer.mode;
@@ -11435,7 +11517,7 @@ var Cl = class {
11435
11517
  this.clearMeasurement();
11436
11518
  return;
11437
11519
  }
11438
- let r = Vc(e, t.heading, n.width, n.height);
11520
+ let r = Hc(e, t.heading, n.width, n.height);
11439
11521
  if (this.measureOverlay.add(e), !this.measureStart) {
11440
11522
  this.measureStart = r;
11441
11523
  return;
@@ -11459,7 +11541,7 @@ var Cl = class {
11459
11541
  async locateAt(e) {
11460
11542
  let t = this.transition.shown, n = this.transition.shownImageSize;
11461
11543
  if (!(!t || !n || !this.data)) try {
11462
- let [r, i] = Vc(e, t.heading, n.width, n.height), a = {
11544
+ let [r, i] = Hc(e, t.heading, n.width, n.height), a = {
11463
11545
  coordinates: await this.data.locate(t, r, i),
11464
11546
  node: t
11465
11547
  };
@@ -11469,15 +11551,15 @@ var Cl = class {
11469
11551
  }
11470
11552
  }
11471
11553
  getHeading() {
11472
- return Uc(this.camera.quaternion);
11554
+ return Gc(this.camera.quaternion);
11473
11555
  }
11474
11556
  emitHeading = () => {
11475
11557
  let e = this.getHeading();
11476
11558
  this.options.onHeadingChange?.(e), this.emit("heading", e);
11477
11559
  };
11478
11560
  animate = (e) => {
11479
- this.rafId = requestAnimationFrame(this.animate), Mc.update(e), this.camera.position.copy(this.transition.update(e)), this.controls.autoRotate && this.controls.update(), this.renderer.render(this.scene, this.camera);
11561
+ this.rafId = requestAnimationFrame(this.animate), Nc.update(e), this.camera.position.copy(this.transition.update(e)), this.polygonOverlay.placeAt(this.transition.shown), this.controls.autoRotate && this.controls.update(), this.renderer.render(this.scene, this.camera);
11480
11562
  };
11481
11563
  };
11482
11564
  //#endregion
11483
- export { el as SphereControls, Cl as ViewerDataClient, El as WemapViewer, Sl as graphToNodes };
11565
+ export { rl as SphereControls, jl as ViewerDataClient, Fl as WemapViewer, Al as graphToNodes };