@realsee/five 6.2.2 → 6.2.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/plugins/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 11/6/2024
5
- * Version: 6.2.2
4
+ * Generated: 2024/11/11
5
+ * Version: 6.2.4
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,269 +252,268 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */import { Subscribe as $t, AnimationFrameLoop as er, Camera as tr } from "@realsee/five";
256
- import * as g from "three";
257
- import { OrbitControls as rr } from "three/examples/jsm/controls/OrbitControls";
258
- import { CSS3DObject as At, CSS3DRenderer as nr } from "three/examples/jsm/renderers/CSS3DRenderer";
259
- import { BasePlugin as ir } from "@realsee/five/plugins";
260
- function ar(u) {
261
- return /^https?:\/\/|^\/\//.test(u) || /^data:/.test(u);
255
+ */import { Subscribe as hn, AnimationFrameLoop as fn, Camera as pn } from "@realsee/five";
256
+ import * as w from "three";
257
+ import { EventDispatcher as Ht, Vector3 as ve, MOUSE as Oe, TOUCH as Ae, Quaternion as Ft, Spherical as Ut, Vector2 as be, Object3D as jt, Matrix4 as dn } from "three";
258
+ import { BasePlugin as vn } from "@realsee/five/plugins";
259
+ function mn(p) {
260
+ return /^https?:\/\/|^\/\//.test(p) || /^data:/.test(p);
262
261
  }
263
- function or(u, o) {
264
- return ar(o) ? o : "".concat(u).concat(o);
262
+ function gn(p, o) {
263
+ return mn(o) ? o : "".concat(p).concat(o);
265
264
  }
266
- var Ve;
267
- (function(u) {
265
+ var rt;
266
+ (function(p) {
268
267
  var o = (
269
268
  /** @class */
270
269
  function() {
271
- function n(a, t) {
272
- this.hooks = new $t(), this.staticPrefix = "//vr-image-4.realsee-cdn.cn", this.five = a, t != null && t.staticPrefix && (this.staticPrefix = t.staticPrefix);
270
+ function e(i, t) {
271
+ this.hooks = new hn(), this.staticPrefix = "//vr-image-4.realsee-cdn.cn", this.five = i, t != null && t.staticPrefix && (this.staticPrefix = t.staticPrefix);
273
272
  }
274
- return n.prototype.getCurrentState = function() {
273
+ return e.prototype.getCurrentState = function() {
275
274
  return this.state;
276
- }, n.prototype.absoluteUrl = function(a) {
277
- return or(this.staticPrefix, a);
278
- }, n;
275
+ }, e.prototype.absoluteUrl = function(i) {
276
+ return gn(this.staticPrefix, i);
277
+ }, e;
279
278
  }()
280
279
  );
281
- u.Controller = o;
282
- })(Ve || (Ve = {}));
283
- var nt = function(u, o) {
284
- return nt = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, a) {
285
- n.__proto__ = a;
286
- } || function(n, a) {
287
- for (var t in a) Object.prototype.hasOwnProperty.call(a, t) && (n[t] = a[t]);
288
- }, nt(u, o);
280
+ p.Controller = o;
281
+ })(rt || (rt = {}));
282
+ var wt = function(p, o) {
283
+ return wt = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, i) {
284
+ e.__proto__ = i;
285
+ } || function(e, i) {
286
+ for (var t in i) Object.prototype.hasOwnProperty.call(i, t) && (e[t] = i[t]);
287
+ }, wt(p, o);
289
288
  };
290
- function Xe(u, o) {
289
+ function lt(p, o) {
291
290
  if (typeof o != "function" && o !== null)
292
291
  throw new TypeError("Class extends value " + String(o) + " is not a constructor or null");
293
- nt(u, o);
294
- function n() {
295
- this.constructor = u;
292
+ wt(p, o);
293
+ function e() {
294
+ this.constructor = p;
296
295
  }
297
- u.prototype = o === null ? Object.create(o) : (n.prototype = o.prototype, new n());
296
+ p.prototype = o === null ? Object.create(o) : (e.prototype = o.prototype, new e());
298
297
  }
299
- var W = function() {
300
- return W = Object.assign || function(o) {
301
- for (var n, a = 1, t = arguments.length; a < t; a++) {
302
- n = arguments[a];
303
- for (var l in n) Object.prototype.hasOwnProperty.call(n, l) && (o[l] = n[l]);
298
+ var ae = function() {
299
+ return ae = Object.assign || function(o) {
300
+ for (var e, i = 1, t = arguments.length; i < t; i++) {
301
+ e = arguments[i];
302
+ for (var l in e) Object.prototype.hasOwnProperty.call(e, l) && (o[l] = e[l]);
304
303
  }
305
304
  return o;
306
- }, W.apply(this, arguments);
305
+ }, ae.apply(this, arguments);
307
306
  };
308
- function Ge(u, o, n, a) {
307
+ function at(p, o, e, i) {
309
308
  function t(l) {
310
- return l instanceof n ? l : new n(function(h) {
309
+ return l instanceof e ? l : new e(function(h) {
311
310
  h(l);
312
311
  });
313
312
  }
314
- return new (n || (n = Promise))(function(l, h) {
315
- function c(y) {
313
+ return new (e || (e = Promise))(function(l, h) {
314
+ function c(m) {
316
315
  try {
317
- p(a.next(y));
318
- } catch (T) {
319
- h(T);
316
+ d(i.next(m));
317
+ } catch (E) {
318
+ h(E);
320
319
  }
321
320
  }
322
- function m(y) {
321
+ function g(m) {
323
322
  try {
324
- p(a.throw(y));
325
- } catch (T) {
326
- h(T);
323
+ d(i.throw(m));
324
+ } catch (E) {
325
+ h(E);
327
326
  }
328
327
  }
329
- function p(y) {
330
- y.done ? l(y.value) : t(y.value).then(c, m);
328
+ function d(m) {
329
+ m.done ? l(m.value) : t(m.value).then(c, g);
331
330
  }
332
- p((a = a.apply(u, o || [])).next());
331
+ d((i = i.apply(p, o || [])).next());
333
332
  });
334
333
  }
335
- function Ye(u, o) {
336
- var n = { label: 0, sent: function() {
334
+ function it(p, o) {
335
+ var e = { label: 0, sent: function() {
337
336
  if (l[0] & 1) throw l[1];
338
337
  return l[1];
339
- }, trys: [], ops: [] }, a, t, l, h = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
338
+ }, trys: [], ops: [] }, i, t, l, h = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
340
339
  return h.next = c(0), h.throw = c(1), h.return = c(2), typeof Symbol == "function" && (h[Symbol.iterator] = function() {
341
340
  return this;
342
341
  }), h;
343
- function c(p) {
344
- return function(y) {
345
- return m([p, y]);
342
+ function c(d) {
343
+ return function(m) {
344
+ return g([d, m]);
346
345
  };
347
346
  }
348
- function m(p) {
349
- if (a) throw new TypeError("Generator is already executing.");
350
- for (; h && (h = 0, p[0] && (n = 0)), n; ) try {
351
- if (a = 1, t && (l = p[0] & 2 ? t.return : p[0] ? t.throw || ((l = t.return) && l.call(t), 0) : t.next) && !(l = l.call(t, p[1])).done) return l;
352
- switch (t = 0, l && (p = [p[0] & 2, l.value]), p[0]) {
347
+ function g(d) {
348
+ if (i) throw new TypeError("Generator is already executing.");
349
+ for (; h && (h = 0, d[0] && (e = 0)), e; ) try {
350
+ if (i = 1, t && (l = d[0] & 2 ? t.return : d[0] ? t.throw || ((l = t.return) && l.call(t), 0) : t.next) && !(l = l.call(t, d[1])).done) return l;
351
+ switch (t = 0, l && (d = [d[0] & 2, l.value]), d[0]) {
353
352
  case 0:
354
353
  case 1:
355
- l = p;
354
+ l = d;
356
355
  break;
357
356
  case 4:
358
- return n.label++, { value: p[1], done: !1 };
357
+ return e.label++, { value: d[1], done: !1 };
359
358
  case 5:
360
- n.label++, t = p[1], p = [0];
359
+ e.label++, t = d[1], d = [0];
361
360
  continue;
362
361
  case 7:
363
- p = n.ops.pop(), n.trys.pop();
362
+ d = e.ops.pop(), e.trys.pop();
364
363
  continue;
365
364
  default:
366
- if (l = n.trys, !(l = l.length > 0 && l[l.length - 1]) && (p[0] === 6 || p[0] === 2)) {
367
- n = 0;
365
+ if (l = e.trys, !(l = l.length > 0 && l[l.length - 1]) && (d[0] === 6 || d[0] === 2)) {
366
+ e = 0;
368
367
  continue;
369
368
  }
370
- if (p[0] === 3 && (!l || p[1] > l[0] && p[1] < l[3])) {
371
- n.label = p[1];
369
+ if (d[0] === 3 && (!l || d[1] > l[0] && d[1] < l[3])) {
370
+ e.label = d[1];
372
371
  break;
373
372
  }
374
- if (p[0] === 6 && n.label < l[1]) {
375
- n.label = l[1], l = p;
373
+ if (d[0] === 6 && e.label < l[1]) {
374
+ e.label = l[1], l = d;
376
375
  break;
377
376
  }
378
- if (l && n.label < l[2]) {
379
- n.label = l[2], n.ops.push(p);
377
+ if (l && e.label < l[2]) {
378
+ e.label = l[2], e.ops.push(d);
380
379
  break;
381
380
  }
382
- l[2] && n.ops.pop(), n.trys.pop();
381
+ l[2] && e.ops.pop(), e.trys.pop();
383
382
  continue;
384
383
  }
385
- p = o.call(u, n);
386
- } catch (y) {
387
- p = [6, y], t = 0;
384
+ d = o.call(p, e);
385
+ } catch (m) {
386
+ d = [6, m], t = 0;
388
387
  } finally {
389
- a = l = 0;
388
+ i = l = 0;
390
389
  }
391
- if (p[0] & 5) throw p[1];
392
- return { value: p[0] ? p[1] : void 0, done: !0 };
390
+ if (d[0] & 5) throw d[1];
391
+ return { value: d[0] ? d[1] : void 0, done: !0 };
393
392
  }
394
393
  }
395
- function _t(u, o, n) {
396
- if (n || arguments.length === 2) for (var a = 0, t = o.length, l; a < t; a++)
397
- (l || !(a in o)) && (l || (l = Array.prototype.slice.call(o, 0, a)), l[a] = o[a]);
398
- return u.concat(l || Array.prototype.slice.call(o));
394
+ function Bt(p, o, e) {
395
+ if (e || arguments.length === 2) for (var i = 0, t = o.length, l; i < t; i++)
396
+ (l || !(i in o)) && (l || (l = Array.prototype.slice.call(o, 0, i)), l[i] = o[i]);
397
+ return p.concat(l || Array.prototype.slice.call(o));
399
398
  }
400
- function sr(u) {
401
- return new Promise(function(o, n) {
402
- var a = new Image();
403
- a.onload = function() {
404
- a.onload = a.onerror = function() {
405
- }, o(a);
406
- }, a.onerror = function(t) {
407
- a.onload = a.onerror = function() {
408
- }, n(t);
409
- }, a.crossOrigin = "", a.src = u;
399
+ function yn(p) {
400
+ return new Promise(function(o, e) {
401
+ var i = new Image();
402
+ i.onload = function() {
403
+ i.onload = i.onerror = function() {
404
+ }, o(i);
405
+ }, i.onerror = function(t) {
406
+ i.onload = i.onerror = function() {
407
+ }, e(t);
408
+ }, i.crossOrigin = "", i.src = p;
410
409
  });
411
410
  }
412
- var lr = typeof performance != "undefined" && typeof performance.timing != "undefined" ? performance.timing.navigationStart : Date.now(), tt = typeof performance != "undefined" ? function() {
413
- return lr + performance.now();
411
+ var Tn = typeof performance != "undefined" && typeof performance.timing != "undefined" ? performance.timing.navigationStart : Date.now(), Tt = typeof performance != "undefined" ? function() {
412
+ return Tn + performance.now();
414
413
  } : function() {
415
414
  return Date.now();
416
415
  };
417
- function Be(u, o, n) {
418
- return u + (o - u) * n;
416
+ function nt(p, o, e) {
417
+ return p + (o - p) * e;
419
418
  }
420
- function cr(u, o, n, a) {
421
- var t = (o * n + 2 * u) / Math.pow(n, 3), l = -(2 * o * n + 3 * u) / Math.pow(n, 2), h = o, c = u;
422
- return t * Math.pow(a, 3) + l * Math.pow(a, 2) + h * a + c;
419
+ function bn(p, o, e, i) {
420
+ var t = (o * e + 2 * p) / Math.pow(e, 3), l = -(2 * o * e + 3 * p) / Math.pow(e, 2), h = o, c = p;
421
+ return t * Math.pow(i, 3) + l * Math.pow(i, 2) + h * i + c;
423
422
  }
424
- function ur(u, o, n, a) {
425
- var t = (o * n + 2 * u) / Math.pow(n, 3), l = -(2 * o * n + 3 * u) / Math.pow(n, 2), h = o;
426
- return 3 * t * Math.pow(a, 2) + 2 * l * a + h;
423
+ function wn(p, o, e, i) {
424
+ var t = (o * e + 2 * p) / Math.pow(e, 3), l = -(2 * o * e + 3 * p) / Math.pow(e, 2), h = o;
425
+ return 3 * t * Math.pow(i, 2) + 2 * l * i + h;
427
426
  }
428
- function hr(u, o, n, a) {
429
- var t = a[1] - a[0];
430
- return u = He(u, a), o = He(o, a), o - u > t / 2 ? Be(u + t, o, n) : u - o > t / 2 ? Be(u - t, o, n) : Be(u, o, n);
427
+ function En(p, o, e, i) {
428
+ var t = i[1] - i[0];
429
+ return p = ot(p, i), o = ot(o, i), o - p > t / 2 ? nt(p + t, o, e) : p - o > t / 2 ? nt(p - t, o, e) : nt(p, o, e);
431
430
  }
432
- function He(u, o) {
433
- var n = o[1] - o[0];
434
- return u < o[0] ? He(u + n, o) : u >= o[1] ? He(u - n, o) : u;
431
+ function ot(p, o) {
432
+ var e = o[1] - o[0];
433
+ return p < o[0] ? ot(p + e, o) : p >= o[1] ? ot(p - e, o) : p;
435
434
  }
436
- function fr(u, o, n, a) {
437
- return a ? hr(u, o, n, a) : Be(u, o, n);
435
+ function Pn(p, o, e, i) {
436
+ return i ? En(p, o, e, i) : nt(p, o, e);
438
437
  }
439
- var Mt = (
438
+ var Vt = (
440
439
  /** @class */
441
440
  function() {
442
- function u(o) {
443
- this.config = {}, this.progress = 1, this.ended = !0, this.value = {}, this.startTime = tt(), this.startVelocity = 0, this.duration = 0, this.keyframes = [];
444
- for (var n in o) {
445
- var a = o[n];
446
- typeof a == "number" ? (this.value[n] = a, this.config[n] = { circle: !1 }) : (this.value[n] = a.value, this.config[n] = { circle: a.circle });
441
+ function p(o) {
442
+ this.config = {}, this.progress = 1, this.ended = !0, this.value = {}, this.startTime = Tt(), this.startVelocity = 0, this.duration = 0, this.keyframes = [];
443
+ for (var e in o) {
444
+ var i = o[e];
445
+ typeof i == "number" ? (this.value[e] = i, this.config[e] = { circle: !1 }) : (this.value[e] = i.value, this.config[e] = { circle: i.circle });
447
446
  }
448
447
  this.keyframes = [
449
- { progress: 0, value: W({}, this.value) },
450
- { progress: 1, value: W({}, this.value) }
448
+ { progress: 0, value: ae({}, this.value) },
449
+ { progress: 1, value: ae({}, this.value) }
451
450
  ];
452
451
  }
453
- return u.prototype.getProgress = function(o) {
454
- var n = o - this.startTime;
455
- return n < 0 ? 0 : n >= this.duration ? 1 : 1 - cr(1, this.startVelocity, this.duration, n);
456
- }, u.prototype.getValue = function(o) {
457
- for (var n = 1; n < this.keyframes.length; n++)
458
- if (this.keyframes[n].progress > o) {
459
- var a = this.keyframes[n - 1], t = this.keyframes[n], l = {};
452
+ return p.prototype.getProgress = function(o) {
453
+ var e = o - this.startTime;
454
+ return e < 0 ? 0 : e >= this.duration ? 1 : 1 - bn(1, this.startVelocity, this.duration, e);
455
+ }, p.prototype.getValue = function(o) {
456
+ for (var e = 1; e < this.keyframes.length; e++)
457
+ if (this.keyframes[e].progress > o) {
458
+ var i = this.keyframes[e - 1], t = this.keyframes[e], l = {};
460
459
  for (var h in this.config) {
461
- var c = (o - a.progress) / (t.progress - a.progress);
462
- l[h] = fr(a.value[h], t.value[h], c, this.config[h].circle);
460
+ var c = (o - i.progress) / (t.progress - i.progress);
461
+ l[h] = Pn(i.value[h], t.value[h], c, this.config[h].circle);
463
462
  }
464
463
  return l;
465
464
  }
466
- return W({}, this.keyframes[this.keyframes.length - 1].value);
467
- }, u.prototype.getProgressVelocity = function(o) {
468
- var n = o - this.startTime;
469
- return n >= this.duration ? 0 : ur(1, this.startVelocity, this.duration, n);
470
- }, u.prototype.update = function(o) {
465
+ return ae({}, this.keyframes[this.keyframes.length - 1].value);
466
+ }, p.prototype.getProgressVelocity = function(o) {
467
+ var e = o - this.startTime;
468
+ return e >= this.duration ? 0 : wn(1, this.startVelocity, this.duration, e);
469
+ }, p.prototype.update = function(o) {
471
470
  return this.ended ? !0 : (this.progress = Math.min(1, Math.max(0, this.progress, this.getProgress(o))), this.value = this.getValue(this.progress), this.ended = this.progress >= 1, this.ended && this.callbacks && (this.callbacks[0](), this.callbacks = void 0), this.ended);
472
- }, u.prototype.getKeyFrameSegment = function(o) {
473
- for (var n = this.getProgress(o), a = 1; a < this.keyframes.length; a++)
474
- if (this.keyframes[a].progress > n)
475
- return [this.keyframes[a - 1], this.keyframes[a]];
471
+ }, p.prototype.getKeyFrameSegment = function(o) {
472
+ for (var e = this.getProgress(o), i = 1; i < this.keyframes.length; i++)
473
+ if (this.keyframes[i].progress > e)
474
+ return [this.keyframes[i - 1], this.keyframes[i]];
476
475
  return [this.keyframes[this.keyframes.length - 2], this.keyframes[this.keyframes.length - 1]];
477
- }, u.prototype.getTargetKeyframe = function() {
476
+ }, p.prototype.getTargetKeyframe = function() {
478
477
  return this.keyframes[this.keyframes.length - 1];
479
- }, u.prototype.set = function(o, n, a, t) {
478
+ }, p.prototype.set = function(o, e, i, t) {
480
479
  var l;
481
- a === void 0 && (a = 0), isNaN(n) && (n = 0), isNaN(a) && (a = 0), t = t != null ? t : tt();
482
- var h = this.getProgress(t), c = this.getValue(h), m = {};
483
- for (var p in this.config)
484
- m[p] = (l = o[p]) !== null && l !== void 0 ? l : c[p];
485
- var y = [
480
+ i === void 0 && (i = 0), isNaN(e) && (e = 0), isNaN(i) && (i = 0), t = t != null ? t : Tt();
481
+ var h = this.getProgress(t), c = this.getValue(h), g = {};
482
+ for (var d in this.config)
483
+ g[d] = (l = o[d]) !== null && l !== void 0 ? l : c[d];
484
+ var m = [
486
485
  { progress: 0, value: c },
487
- { progress: 1, value: m }
486
+ { progress: 1, value: g }
488
487
  ];
489
- return this.setKeyframes(y, n, a, t);
490
- }, u.prototype.setKeyframes = function(o, n, a, t) {
488
+ return this.setKeyframes(m, e, i, t);
489
+ }, p.prototype.setKeyframes = function(o, e, i, t) {
491
490
  var l = this;
492
- if (a === void 0 && (a = 0), o.length < 2)
491
+ if (i === void 0 && (i = 0), o.length < 2)
493
492
  throw new Error("keyframes invalid.");
494
- return isNaN(n) && (n = 0), isNaN(a) && (a = 0), this.callbacks && (this.callbacks[1](new Error("motion aborted.")), this.callbacks = void 0), new Promise(function(h, c) {
495
- t = t != null ? t : tt(), l.progress = 0, l.ended = !1, l.startTime = t, l.startVelocity = a, l.keyframes = o, l.duration = n, n === 0 ? (l.progress = 1, l.value = W({}, o[o.length - 1].value)) : l.value = W({}, o[0].value), l.callbacks = [h, c];
493
+ return isNaN(e) && (e = 0), isNaN(i) && (i = 0), this.callbacks && (this.callbacks[1](new Error("motion aborted.")), this.callbacks = void 0), new Promise(function(h, c) {
494
+ t = t != null ? t : Tt(), l.progress = 0, l.ended = !1, l.startTime = t, l.startVelocity = i, l.keyframes = o, l.duration = e, e === 0 ? (l.progress = 1, l.value = ae({}, o[o.length - 1].value)) : l.value = ae({}, o[0].value), l.callbacks = [h, c];
496
495
  });
497
- }, u.prototype.dispose = function() {
496
+ }, p.prototype.dispose = function() {
498
497
  this.callbacks && (this.callbacks[1](new Error("motion dispose.")), this.callbacks = void 0);
499
- }, u;
498
+ }, p;
500
499
  }()
501
- ), vr = [
500
+ ), Mn = [
502
501
  { progress: 0, value: { scale: 0, opacity: 0, shadow: 2 } },
503
502
  { progress: 0.2, value: { scale: 0.5, opacity: 1, shadow: 1 } },
504
503
  { progress: 0.8, value: { scale: 2, opacity: 0, shadow: 0.5 } },
505
504
  { progress: 1, value: { scale: 2, opacity: 0, shadow: 0.5 } }
506
- ], pr = [
505
+ ], On = [
507
506
  { progress: 0, value: { scale: 0, opacity: 0, shadow: 2 } },
508
507
  { progress: 0.2, value: { scale: 0.4, opacity: 1, shadow: 2 } },
509
508
  { progress: 0.8, value: { scale: 1.6, opacity: 0.4, shadow: 0.5 } },
510
509
  { progress: 1, value: { scale: 2, opacity: 0, shadow: 0.5 } }
511
- ], dr = `
510
+ ], An = `
512
511
  varying vec2 vUv;
513
512
  void main() {
514
513
  vUv = uv;
515
514
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
516
515
  }
517
- `, mr = `
516
+ `, xn = `
518
517
  varying vec2 vUv;
519
518
  uniform sampler2D map;
520
519
  uniform vec4 color;
@@ -560,22 +559,22 @@ void main() {
560
559
  }
561
560
  }
562
561
  }
563
- `, gr = (
562
+ `, _n = (
564
563
  /** @class */
565
- function(u) {
566
- Xe(o, u);
567
- function o(n, a) {
568
- var t = u.call(this, n) || this;
569
- t.canvas = document.createElement("canvas"), t.group = new g.Group(), t.wrapper = document.createElement("div"), t.style = document.createElement("style"), t.itemMaskMesh = function() {
570
- var c = new g.Mesh(new g.SphereBufferGeometry(1, 60, 40), new g.ShaderMaterial({
571
- vertexShader: dr,
572
- fragmentShader: mr,
564
+ function(p) {
565
+ lt(o, p);
566
+ function o(e, i) {
567
+ var t = p.call(this, e) || this;
568
+ t.canvas = document.createElement("canvas"), t.group = new w.Group(), t.wrapper = document.createElement("div"), t.style = document.createElement("style"), t.itemMaskMesh = function() {
569
+ var c = new w.Mesh(new w.SphereBufferGeometry(1, 60, 40), new w.ShaderMaterial({
570
+ vertexShader: An,
571
+ fragmentShader: xn,
573
572
  uniforms: {
574
573
  map: {
575
- value: new g.Texture()
574
+ value: new w.Texture()
576
575
  },
577
576
  color: {
578
- value: new g.Vector4()
577
+ value: new w.Vector4()
579
578
  }
580
579
  },
581
580
  depthWrite: !1,
@@ -588,19 +587,19 @@ void main() {
588
587
  }, t.onFiveWantsMoveToPano = function(c) {
589
588
  t.state.mode === "box" && t.select();
590
589
  }, t.loadPanoMask = function(c) {
591
- return Ge(t, void 0, void 0, function() {
592
- var m, p, y, T, M, N, C, F, G, O;
593
- return Ye(this, function(z) {
594
- switch (z.label) {
590
+ return at(t, void 0, void 0, function() {
591
+ var g, d, m, E, O, S, A, k, V, y;
592
+ return it(this, function(T) {
593
+ switch (T.label) {
595
594
  case 0:
596
- return m = this, p = m.five, y = m.canvas, T = m.itemMaskMesh, M = m.data, N = y.getContext("2d"), C = p.observers[c], F = (O = M == null ? void 0 : M.object_mask_list.find(function(q) {
597
- return q.derived_id === String(C.derivedId);
598
- })) === null || O === void 0 ? void 0 : O.object_mask_url, F ? [4, sr(F)] : [
595
+ return g = this, d = g.five, m = g.canvas, E = g.itemMaskMesh, O = g.data, S = m.getContext("2d"), A = d.observers[c], k = (y = O == null ? void 0 : O.object_mask_list.find(function(P) {
596
+ return P.derived_id === String(A.derivedId);
597
+ })) === null || y === void 0 ? void 0 : y.object_mask_url, k ? [4, yn(k)] : [
599
598
  2
600
599
  /*return*/
601
600
  ];
602
601
  case 1:
603
- return G = z.sent(), y.width = G.width, y.height = G.height, N == null || N.drawImage(G, 0, 0, G.width, G.height), T.material.uniforms.map.value.image = G, T.material.uniforms.map.value.minFilter = g.LinearFilter, T.material.uniforms.map.value.needsUpdate = !0, T.position.copy(C.position), T.quaternion.copy(C.quaternion), p.scene.add(T), p.needsRender = !0, [
602
+ return V = T.sent(), m.width = V.width, m.height = V.height, S == null || S.drawImage(V, 0, 0, V.width, V.height), E.material.uniforms.map.value.image = V, E.material.uniforms.map.value.minFilter = w.LinearFilter, E.material.uniforms.map.value.needsUpdate = !0, E.position.copy(A.position), E.quaternion.copy(A.quaternion), d.scene.add(E), d.needsRender = !0, [
604
603
  2
605
604
  /*return*/
606
605
  ];
@@ -608,49 +607,49 @@ void main() {
608
607
  });
609
608
  });
610
609
  }, t.onFiveMouseMove = function(c) {
611
- var m;
610
+ var g;
612
611
  if (t.state.mode === "mask" && t.five.state.mode === "Panorama") {
613
- var p = t, y = p.five, T = p.itemMaskMesh, M = y.observers[y.state.panoIndex], N = (m = c.pointers[0]) === null || m === void 0 ? void 0 : m.raycaster;
614
- if (N) {
615
- var C = N.intersectObjects(t.group.children.filter(function(F) {
616
- return F.userData.visible_viewpoint.includes(String(M.derivedId));
612
+ var d = t, m = d.five, E = d.itemMaskMesh, O = m.observers[m.state.panoIndex], S = (g = c.pointers[0]) === null || g === void 0 ? void 0 : g.raycaster;
613
+ if (S) {
614
+ var A = S.intersectObjects(t.group.children.filter(function(k) {
615
+ return k.userData.visible_viewpoint.includes(String(O.derivedId));
617
616
  }), !0)[0];
618
- C ? T.material.uniforms.color.value = C.object.userData.color : T.material.uniforms.color.value = new g.Vector4(0, 0, 0, 1);
617
+ A ? E.material.uniforms.color.value = A.object.userData.color : E.material.uniforms.color.value = new w.Vector4(0, 0, 0, 1);
619
618
  }
620
619
  }
621
620
  }, t.onFiveTapGesture = function(c) {
622
- var m = t.five, p = m.observers[m.state.panoIndex];
621
+ var g = t.five, d = g.observers[g.state.panoIndex];
623
622
  if (c) {
624
- var y = c.intersectObjects(t.group.children.filter(function(N) {
625
- return N.userData.visible_viewpoint.includes(String(p.derivedId));
623
+ var m = c.intersectObjects(t.group.children.filter(function(S) {
624
+ return S.userData.visible_viewpoint.includes(String(d.derivedId));
626
625
  }), !0)[0];
627
- if (y) {
628
- t.select(y.object.name), t.stopAnimation && t.stopAnimation(), t.tapPosition = y.point, t.changeTapScreenPosition();
629
- var T = new Mt({
626
+ if (m) {
627
+ t.select(m.object.name), t.stopAnimation && t.stopAnimation(), t.tapPosition = m.point, t.changeTapScreenPosition();
628
+ var E = new Vt({
630
629
  opacity: 0,
631
630
  scale: 0,
632
631
  shadow: 2
633
- }), M = new Mt({
632
+ }), O = new Vt({
634
633
  opacity: 0,
635
634
  scale: 0,
636
635
  shadow: 2
637
636
  });
638
- return T.setKeyframes(vr, 1e3), M.setKeyframes(pr, 1e3), t.stopAnimation = er.shared.add(function(N, C) {
639
- var F, G = T.update(N), O = M.update(N);
640
- t.wrapper.firstChild.style.opacity = "".concat(T.value.opacity), t.wrapper.firstChild.style.transform = "scale(".concat(T.value.scale, ")"), t.wrapper.firstChild.style.boxShadow = "0 0 0 ".concat(T.value.shadow, "px #fff"), t.wrapper.lastChild.style.opacity = "".concat(M.value.opacity), t.wrapper.lastChild.style.transform = "scale(".concat(M.value.scale, ")"), t.wrapper.lastChild.style.boxShadow = "0 0 0 ".concat(M.value.shadow, "px #fff"), G && O && ((F = t.stopAnimation) === null || F === void 0 || F.call(t), t.stopAnimation = void 0, m.getElement().parentElement.removeChild(t.wrapper));
641
- }, !1, 0, 10), m.getElement().parentElement.appendChild(t.wrapper), !1;
637
+ return E.setKeyframes(Mn, 1e3), O.setKeyframes(On, 1e3), t.stopAnimation = fn.shared.add(function(S, A) {
638
+ var k, V = E.update(S), y = O.update(S);
639
+ t.wrapper.firstChild.style.opacity = "".concat(E.value.opacity), t.wrapper.firstChild.style.transform = "scale(".concat(E.value.scale, ")"), t.wrapper.firstChild.style.boxShadow = "0 0 0 ".concat(E.value.shadow, "px #fff"), t.wrapper.lastChild.style.opacity = "".concat(O.value.opacity), t.wrapper.lastChild.style.transform = "scale(".concat(O.value.scale, ")"), t.wrapper.lastChild.style.boxShadow = "0 0 0 ".concat(O.value.shadow, "px #fff"), V && y && ((k = t.stopAnimation) === null || k === void 0 || k.call(t), t.stopAnimation = void 0, g.getElement().parentElement.removeChild(t.wrapper));
640
+ }, !1, 0, 10), g.getElement().parentElement.appendChild(t.wrapper), !1;
642
641
  }
643
642
  }
644
643
  }, t.changeTapScreenPosition = function() {
645
644
  if (t.tapPosition) {
646
- var c = t.tapPosition.clone().project(t.five.camera), m = (c.x + 1) / 2, p = -(c.y - 1) / 2;
647
- t.wrapper.style.opacity = c.z > 0 && c.z < 1 ? "1" : "0", t.wrapper.style.transform = "translate(".concat(m * 100, "%, ").concat(p * 100, "%)");
645
+ var c = t.tapPosition.clone().project(t.five.camera), g = (c.x + 1) / 2, d = -(c.y - 1) / 2;
646
+ t.wrapper.style.opacity = c.z > 0 && c.z < 1 ? "1" : "0", t.wrapper.style.transform = "translate(".concat(g * 100, "%, ").concat(d * 100, "%)");
648
647
  }
649
648
  }, t.onFiveCameraUpdate = function(c) {
650
649
  t.changeTapScreenPosition();
651
650
  }, t.dispose = function() {
652
651
  t.disable();
653
- }, t.five = n;
652
+ }, t.five = e;
654
653
  var l = {
655
654
  enabled: !0,
656
655
  visible: !0,
@@ -658,8 +657,8 @@ void main() {
658
657
  selectedId: null,
659
658
  selectAll: !1
660
659
  };
661
- t.state = Object.assign(l, a == null ? void 0 : a.initialState);
662
- var h = W({}, a == null ? void 0 : a.config);
660
+ t.state = Object.assign(l, i == null ? void 0 : i.initialState);
661
+ var h = ae({}, i == null ? void 0 : i.config);
663
662
  return t._config = h, t.group.rotateX(Math.PI), t.wrapper.className = "ItemMaskPlugin", t.wrapper.innerHTML = '<span class="ItemMaskPluginCircle"></span><span class="ItemMaskPluginCircle"></span>', t.style.innerHTML = `
664
663
  .ItemMaskPlugin {
665
664
  position: absolute;
@@ -682,23 +681,23 @@ void main() {
682
681
  }
683
682
  return Object.defineProperty(o.prototype, "config", {
684
683
  get: function() {
685
- return W({}, this._config);
684
+ return ae({}, this._config);
686
685
  },
687
686
  enumerable: !1,
688
687
  configurable: !0
689
- }), o.prototype.updateState = function(n, a) {
688
+ }), o.prototype.updateState = function(e, i) {
690
689
  var t = this.state;
691
- this.state = W(W({}, this.state), n), this.hooks.emit("stateChange", { state: this.state, prevState: t, userAction: a });
692
- }, o.prototype.load = function(n) {
693
- return Ge(this, void 0, void 0, function() {
694
- var a, t, l = this;
695
- return Ye(this, function(h) {
696
- return this.data = n, a = n.data_list.map(function(c) {
697
- var m, p = c.position.end.map(function(V) {
698
- return Number(V);
699
- }), y = c.position.start.map(function(V) {
700
- return Number(V);
701
- }), T = Math.abs(p[0] - y[0]), M = Math.abs(p[1] - y[1]), N = Math.abs(p[2] - y[2]), C = p[0] / 2 + y[0] / 2, F = p[1] / 2 + y[1] / 2, G = p[2] / 2 + y[2] / 2, O = new g.Vector3(C, F, G), z = new g.BoxBufferGeometry(T, M, N), q = new g.ShaderMaterial({
690
+ this.state = ae(ae({}, this.state), e), this.hooks.emit("stateChange", { state: this.state, prevState: t, userAction: i });
691
+ }, o.prototype.load = function(e) {
692
+ return at(this, void 0, void 0, function() {
693
+ var i, t, l = this;
694
+ return it(this, function(h) {
695
+ return this.data = e, i = e.data_list.map(function(c) {
696
+ var g, d = c.position.end.map(function(N) {
697
+ return Number(N);
698
+ }), m = c.position.start.map(function(N) {
699
+ return Number(N);
700
+ }), E = Math.abs(d[0] - m[0]), O = Math.abs(d[1] - m[1]), S = Math.abs(d[2] - m[2]), A = d[0] / 2 + m[0] / 2, k = d[1] / 2 + m[1] / 2, V = d[2] / 2 + m[2] / 2, y = new w.Vector3(A, k, V), T = new w.BoxBufferGeometry(E, O, S), P = new w.ShaderMaterial({
702
701
  vertexShader: `
703
702
  varying vec2 vUv;
704
703
  void main() {
@@ -726,7 +725,7 @@ void main() {
726
725
  }
727
726
  }
728
727
  `,
729
- side: g.DoubleSide,
728
+ side: w.DoubleSide,
730
729
  visible: l.state.selectedId === "".concat(c.category_name).concat(c.index),
731
730
  uniforms: {
732
731
  opacity: { value: l.state.mode === "box" ? 1 : 0 }
@@ -734,195 +733,195 @@ void main() {
734
733
  depthWrite: !1,
735
734
  depthTest: !1,
736
735
  transparent: !0
737
- }), f = new g.Mesh(z, q);
738
- return f.position.copy(O), f.name = "".concat(c.category_name).concat(c.index), f.userData.color = new ((m = g.Vector4).bind.apply(m, _t(_t([void 0], c.mask_color.map(function(V) {
739
- return V / 255;
736
+ }), f = new w.Mesh(T, P);
737
+ return f.position.copy(y), f.name = "".concat(c.category_name).concat(c.index), f.userData.color = new ((g = w.Vector4).bind.apply(g, Bt(Bt([void 0], c.mask_color.map(function(N) {
738
+ return N / 255;
740
739
  }).reverse(), !1), [1], !1)))(), f.userData.visible_viewpoint = Object.keys(c.visible_viewpoint), f;
741
- }), (t = this.group).add.apply(t, a), [
740
+ }), (t = this.group).add.apply(t, i), [
742
741
  2
743
742
  /*return*/
744
743
  ];
745
744
  });
746
745
  });
747
- }, o.prototype.setState = function(n, a) {
748
- a === void 0 && (a = {});
749
- var t = this.state, l = a.userAction !== void 0 ? a.userAction : !0;
750
- if (this.updateState(n, l), n.enabled !== void 0 && t.enabled !== n.enabled) {
746
+ }, o.prototype.setState = function(e, i) {
747
+ i === void 0 && (i = {});
748
+ var t = this.state, l = i.userAction !== void 0 ? i.userAction : !0;
749
+ if (this.updateState(e, l), e.enabled !== void 0 && t.enabled !== e.enabled) {
751
750
  var h = { userAction: l };
752
- n.enabled ? this._enable(h) : this._disable(h);
751
+ e.enabled ? this._enable(h) : this._disable(h);
753
752
  }
754
- }, o.prototype.setMode = function(n) {
755
- this.updateState({ mode: n }, !1), n === "mask" ? (this.group.children.forEach(function(a) {
756
- a.material.uniforms.opacity.value = 0;
757
- }), this.loadPanoMask(this.five.state.panoIndex)) : n === "box" && (this.itemMaskMesh.material.uniforms.color.value = new g.Vector4(0, 0, 0, 1), this.group.children.forEach(function(a) {
758
- a.material.uniforms.opacity.value = 1;
753
+ }, o.prototype.setMode = function(e) {
754
+ this.updateState({ mode: e }, !1), e === "mask" ? (this.group.children.forEach(function(i) {
755
+ i.material.uniforms.opacity.value = 0;
756
+ }), this.loadPanoMask(this.five.state.panoIndex)) : e === "box" && (this.itemMaskMesh.material.uniforms.color.value = new w.Vector4(0, 0, 0, 1), this.group.children.forEach(function(i) {
757
+ i.material.uniforms.opacity.value = 1;
759
758
  }), this.five.needsRender = !0);
760
- }, o.prototype.select = function(n, a) {
759
+ }, o.prototype.select = function(e, i) {
761
760
  var t = this, l;
762
- this.updateState({ selectedId: n != null ? n : null }, (l = a == null ? void 0 : a.userAction) !== null && l !== void 0 ? l : !1), this.group.children.forEach(function(h) {
763
- h.material.visible = t.state.selectAll || h.name === n;
761
+ this.updateState({ selectedId: e != null ? e : null }, (l = i == null ? void 0 : i.userAction) !== null && l !== void 0 ? l : !1), this.group.children.forEach(function(h) {
762
+ h.material.visible = t.state.selectAll || h.name === e;
764
763
  }), this.five.needsRender = !0;
765
- }, o.prototype.selectAll = function(n) {
766
- n === void 0 && (n = !0), this.updateState({ selectAll: !!n }, !1), this.select();
767
- }, o.prototype._enable = function(n) {
764
+ }, o.prototype.selectAll = function(e) {
765
+ e === void 0 && (e = !0), this.updateState({ selectAll: !!e }, !1), this.select();
766
+ }, o.prototype._enable = function(e) {
768
767
  this.five.on("panoArrived", this.onFivePanoArrived), this.five.on("wantsMoveToPano", this.onFiveWantsMoveToPano), this.five.on("gesture.mousemove", this.onFiveMouseMove), this.five.on("wantsTapGesture", this.onFiveTapGesture), this.five.on("cameraUpdate", this.onFiveCameraUpdate), this.five.scene.add(this.group), document.head.appendChild(this.style);
769
- }, o.prototype._disable = function(n) {
768
+ }, o.prototype._disable = function(e) {
770
769
  this.five.off("panoArrived", this.onFivePanoArrived), this.five.off("wantsMoveToPano", this.onFiveWantsMoveToPano), this.five.off("gesture.mousemove", this.onFiveMouseMove), this.five.off("wantsTapGesture", this.onFiveTapGesture), this.five.off("cameraUpdate", this.onFiveCameraUpdate), this.five.scene.remove(this.group), document.head.removeChild(this.style);
771
- }, o.prototype.enable = function(n) {
772
- var a;
770
+ }, o.prototype.enable = function(e) {
771
+ var i;
773
772
  if (!this.state.enabled) {
774
- var t = (a = n == null ? void 0 : n.userAction) !== null && a !== void 0 ? a : !0;
773
+ var t = (i = e == null ? void 0 : e.userAction) !== null && i !== void 0 ? i : !0;
775
774
  this.updateState({ enabled: !0 }, t), this._enable({ userAction: t });
776
775
  }
777
- }, o.prototype.disable = function(n) {
778
- var a;
776
+ }, o.prototype.disable = function(e) {
777
+ var i;
779
778
  if (this.state.enabled !== !1) {
780
- var t = (a = n == null ? void 0 : n.userAction) !== null && a !== void 0 ? a : !0;
779
+ var t = (i = e == null ? void 0 : e.userAction) !== null && i !== void 0 ? i : !0;
781
780
  this.updateState({ enabled: !1 }, t), this._disable({ userAction: t });
782
781
  }
783
782
  }, o;
784
- }(Ve.Controller)
785
- ), Cr = function(u, o) {
786
- return new gr(u, o);
783
+ }(rt.Controller)
784
+ ), Fn = function(p, o) {
785
+ return new _n(p, o);
787
786
  };
788
787
  /*! Hammer.JS - v2.0.7 - 2016-04-22
789
788
  * http://hammerjs.github.io/
790
789
  *
791
790
  * Copyright (c) 2016 Jorik Tangelder;
792
791
  * Licensed under the MIT license */
793
- var rt = function(u, o, n, a) {
794
- var t = ["", "webkit", "Moz", "MS", "ms", "o"], l = o.createElement ? o.createElement("div") : a, h = "function", c = Math.round, m = Math.abs, p = Date.now;
795
- function y(e, r, i) {
796
- return setTimeout(z(e, i), r);
797
- }
798
- function T(e, r, i) {
799
- return Array.isArray(e) ? (M(e, i[r], i), !0) : !1;
800
- }
801
- function M(e, r, i) {
802
- var s;
803
- if (e)
804
- if (e.forEach)
805
- e.forEach(r, i);
806
- else if (e.length !== a)
807
- for (s = 0; s < e.length; )
808
- r.call(i, e[s], s, e), s++;
792
+ var bt = function(p, o, e, i) {
793
+ var t = ["", "webkit", "Moz", "MS", "ms", "o"], l = o.createElement ? o.createElement("div") : i, h = "function", c = Math.round, g = Math.abs, d = Date.now;
794
+ function m(n, r, a) {
795
+ return setTimeout(T(n, a), r);
796
+ }
797
+ function E(n, r, a) {
798
+ return Array.isArray(n) ? (O(n, a[r], a), !0) : !1;
799
+ }
800
+ function O(n, r, a) {
801
+ var u;
802
+ if (n)
803
+ if (n.forEach)
804
+ n.forEach(r, a);
805
+ else if (n.length !== i)
806
+ for (u = 0; u < n.length; )
807
+ r.call(a, n[u], u, n), u++;
809
808
  else
810
- for (s in e)
811
- e.hasOwnProperty(s) && r.call(i, e[s], s, e);
809
+ for (u in n)
810
+ n.hasOwnProperty(u) && r.call(a, n[u], u, n);
812
811
  }
813
- function N(e, r, i) {
814
- var s = "DEPRECATED METHOD: " + r + `
815
- ` + i + ` AT
812
+ function S(n, r, a) {
813
+ var u = "DEPRECATED METHOD: " + r + `
814
+ ` + a + ` AT
816
815
  `;
817
816
  return function() {
818
- var v = new Error("get-stack-trace"), d = v && v.stack ? v.stack.replace(/^[^\(]+?[\n$]/gm, "").replace(/^\s+at\s+/gm, "").replace(/^Object.<anonymous>\s*\(/gm, "{anonymous}()@") : "Unknown Stack Trace", b = u.console && (u.console.warn || u.console.log);
819
- return b && b.call(u.console, s, d), e.apply(this, arguments);
817
+ var v = new Error("get-stack-trace"), b = v && v.stack ? v.stack.replace(/^[^\(]+?[\n$]/gm, "").replace(/^\s+at\s+/gm, "").replace(/^Object.<anonymous>\s*\(/gm, "{anonymous}()@") : "Unknown Stack Trace", C = p.console && (p.console.warn || p.console.log);
818
+ return C && C.call(p.console, u, b), n.apply(this, arguments);
820
819
  };
821
820
  }
822
- var C;
823
- typeof Object.assign != "function" ? C = function(r) {
824
- if (r === a || r === null)
821
+ var A;
822
+ typeof Object.assign != "function" ? A = function(r) {
823
+ if (r === i || r === null)
825
824
  throw new TypeError("Cannot convert undefined or null to object");
826
- for (var i = Object(r), s = 1; s < arguments.length; s++) {
827
- var v = arguments[s];
828
- if (v !== a && v !== null)
829
- for (var d in v)
830
- v.hasOwnProperty(d) && (i[d] = v[d]);
825
+ for (var a = Object(r), u = 1; u < arguments.length; u++) {
826
+ var v = arguments[u];
827
+ if (v !== i && v !== null)
828
+ for (var b in v)
829
+ v.hasOwnProperty(b) && (a[b] = v[b]);
831
830
  }
832
- return i;
833
- } : C = Object.assign;
834
- var F = N(function(r, i, s) {
835
- for (var v = Object.keys(i), d = 0; d < v.length; )
836
- (!s || s && r[v[d]] === a) && (r[v[d]] = i[v[d]]), d++;
831
+ return a;
832
+ } : A = Object.assign;
833
+ var k = S(function(r, a, u) {
834
+ for (var v = Object.keys(a), b = 0; b < v.length; )
835
+ (!u || u && r[v[b]] === i) && (r[v[b]] = a[v[b]]), b++;
837
836
  return r;
838
- }, "extend", "Use `assign`."), G = N(function(r, i) {
839
- return F(r, i, !0);
837
+ }, "extend", "Use `assign`."), V = S(function(r, a) {
838
+ return k(r, a, !0);
840
839
  }, "merge", "Use `assign`.");
841
- function O(e, r, i) {
842
- var s = r.prototype, v;
843
- v = e.prototype = Object.create(s), v.constructor = e, v._super = s, i && C(v, i);
840
+ function y(n, r, a) {
841
+ var u = r.prototype, v;
842
+ v = n.prototype = Object.create(u), v.constructor = n, v._super = u, a && A(v, a);
844
843
  }
845
- function z(e, r) {
844
+ function T(n, r) {
846
845
  return function() {
847
- return e.apply(r, arguments);
846
+ return n.apply(r, arguments);
848
847
  };
849
848
  }
850
- function q(e, r) {
851
- return typeof e == h ? e.apply(r && r[0] || a, r) : e;
849
+ function P(n, r) {
850
+ return typeof n == h ? n.apply(r && r[0] || i, r) : n;
852
851
  }
853
- function f(e, r) {
854
- return e === a ? r : e;
852
+ function f(n, r) {
853
+ return n === i ? r : n;
855
854
  }
856
- function V(e, r, i) {
857
- M(fe(r), function(s) {
858
- e.addEventListener(s, i, !1);
855
+ function N(n, r, a) {
856
+ O(ee(r), function(u) {
857
+ n.addEventListener(u, a, !1);
859
858
  });
860
859
  }
861
- function P(e, r, i) {
862
- M(fe(r), function(s) {
863
- e.removeEventListener(s, i, !1);
860
+ function M(n, r, a) {
861
+ O(ee(r), function(u) {
862
+ n.removeEventListener(u, a, !1);
864
863
  });
865
864
  }
866
- function Ce(e, r) {
867
- for (; e; ) {
868
- if (e == r)
865
+ function $(n, r) {
866
+ for (; n; ) {
867
+ if (n == r)
869
868
  return !0;
870
- e = e.parentNode;
869
+ n = n.parentNode;
871
870
  }
872
871
  return !1;
873
872
  }
874
- function ie(e, r) {
875
- return e.indexOf(r) > -1;
873
+ function Z(n, r) {
874
+ return n.indexOf(r) > -1;
876
875
  }
877
- function fe(e) {
878
- return e.trim().split(/\s+/g);
876
+ function ee(n) {
877
+ return n.trim().split(/\s+/g);
879
878
  }
880
- function se(e, r, i) {
881
- if (e.indexOf && !i)
882
- return e.indexOf(r);
883
- for (var s = 0; s < e.length; ) {
884
- if (i && e[s][i] == r || !i && e[s] === r)
885
- return s;
886
- s++;
879
+ function le(n, r, a) {
880
+ if (n.indexOf && !a)
881
+ return n.indexOf(r);
882
+ for (var u = 0; u < n.length; ) {
883
+ if (a && n[u][a] == r || !a && n[u] === r)
884
+ return u;
885
+ u++;
887
886
  }
888
887
  return -1;
889
888
  }
890
- function ve(e) {
891
- return Array.prototype.slice.call(e, 0);
889
+ function me(n) {
890
+ return Array.prototype.slice.call(n, 0);
892
891
  }
893
- function Ae(e, r, i) {
894
- for (var s = [], v = [], d = 0; d < e.length; ) {
895
- var b = e[d][r];
896
- se(v, b) < 0 && s.push(e[d]), v[d] = b, d++;
892
+ function xe(n, r, a) {
893
+ for (var u = [], v = [], b = 0; b < n.length; ) {
894
+ var C = n[b][r];
895
+ le(v, C) < 0 && u.push(n[b]), v[b] = C, b++;
897
896
  }
898
- return s = s.sort(function(K, R) {
899
- return K[r] > R[r];
900
- }), s;
901
- }
902
- function le(e, r) {
903
- for (var i, s, v = r[0].toUpperCase() + r.slice(1), d = 0; d < t.length; ) {
904
- if (i = t[d], s = i ? i + v : r, s in e)
905
- return s;
906
- d++;
897
+ return u = u.sort(function(se, G) {
898
+ return se[r] > G[r];
899
+ }), u;
900
+ }
901
+ function ne(n, r) {
902
+ for (var a, u, v = r[0].toUpperCase() + r.slice(1), b = 0; b < t.length; ) {
903
+ if (a = t[b], u = a ? a + v : r, u in n)
904
+ return u;
905
+ b++;
907
906
  }
908
- return a;
907
+ return i;
909
908
  }
910
- var ee = 1;
911
- function A() {
912
- return ee++;
909
+ var ie = 1;
910
+ function D() {
911
+ return ie++;
913
912
  }
914
- function E(e) {
915
- var r = e.ownerDocument || e;
916
- return r.defaultView || r.parentWindow || u;
913
+ function _(n) {
914
+ var r = n.ownerDocument || n;
915
+ return r.defaultView || r.parentWindow || p;
917
916
  }
918
- var w = /mobile|tablet|ip(ad|hone|od)|android/i, x = "ontouchstart" in u, U = le(u, "PointerEvent") !== a, Z = x && w.test(navigator.userAgent), L = "touch", I = "pen", Y = "mouse", k = "kinect", S = 25, _ = 1, j = 2, D = 4, B = 8, xe = 1, me = 2, ge = 4, ye = 8, Te = 16, te = me | ge, ue = ye | Te, it = te | ue, at = ["x", "y"], Ie = ["clientX", "clientY"];
919
- function J(e, r) {
920
- var i = this;
921
- this.manager = e, this.callback = r, this.element = e.element, this.target = e.options.inputTarget, this.domHandler = function(s) {
922
- q(e.options.enable, [e]) && i.handler(s);
917
+ var x = /mobile|tablet|ip(ad|hone|od)|android/i, R = "ontouchstart" in p, Y = ne(p, "PointerEvent") !== i, te = R && x.test(navigator.userAgent), j = "touch", F = "pen", W = "mouse", B = "kinect", U = 25, I = 1, J = 2, H = 4, z = 8, _e = 1, Ee = 2, Ce = 4, Ne = 8, Pe = 16, oe = Ee | Ce, ue = Ne | Pe, De = oe | ue, Re = ["x", "y"], Ie = ["clientX", "clientY"];
918
+ function re(n, r) {
919
+ var a = this;
920
+ this.manager = n, this.callback = r, this.element = n.element, this.target = n.options.inputTarget, this.domHandler = function(u) {
921
+ P(n.options.enable, [n]) && a.handler(u);
923
922
  }, this.init();
924
923
  }
925
- J.prototype = {
924
+ re.prototype = {
926
925
  /**
927
926
  * should handle the inputEvent data and trigger the callback
928
927
  * @virtual
@@ -933,247 +932,247 @@ var rt = function(u, o, n, a) {
933
932
  * bind the events
934
933
  */
935
934
  init: function() {
936
- this.evEl && V(this.element, this.evEl, this.domHandler), this.evTarget && V(this.target, this.evTarget, this.domHandler), this.evWin && V(E(this.element), this.evWin, this.domHandler);
935
+ this.evEl && N(this.element, this.evEl, this.domHandler), this.evTarget && N(this.target, this.evTarget, this.domHandler), this.evWin && N(_(this.element), this.evWin, this.domHandler);
937
936
  },
938
937
  /**
939
938
  * unbind the events
940
939
  */
941
940
  destroy: function() {
942
- this.evEl && P(this.element, this.evEl, this.domHandler), this.evTarget && P(this.target, this.evTarget, this.domHandler), this.evWin && P(E(this.element), this.evWin, this.domHandler);
941
+ this.evEl && M(this.element, this.evEl, this.domHandler), this.evTarget && M(this.target, this.evTarget, this.domHandler), this.evWin && M(_(this.element), this.evWin, this.domHandler);
943
942
  }
944
943
  };
945
- function xt(e) {
946
- var r, i = e.options.inputClass;
947
- return i ? r = i : U ? r = je : Z ? r = Se : x ? r = We : r = Ne, new r(e, It);
948
- }
949
- function It(e, r, i) {
950
- var s = i.pointers.length, v = i.changedPointers.length, d = r & _ && s - v === 0, b = r & (D | B) && s - v === 0;
951
- i.isFirst = !!d, i.isFinal = !!b, d && (e.session = {}), i.eventType = r, Ot(e, i), e.emit("hammer.input", i), e.recognize(i), e.session.prevInput = i;
952
- }
953
- function Ot(e, r) {
954
- var i = e.session, s = r.pointers, v = s.length;
955
- i.firstInput || (i.firstInput = ot(r)), v > 1 && !i.firstMultiple ? i.firstMultiple = ot(r) : v === 1 && (i.firstMultiple = !1);
956
- var d = i.firstInput, b = i.firstMultiple, H = b ? b.center : d.center, K = r.center = st(s);
957
- r.timeStamp = p(), r.deltaTime = r.timeStamp - d.timeStamp, r.angle = ze(H, K), r.distance = Oe(H, K), Nt(i, r), r.offsetDirection = ct(r.deltaX, r.deltaY);
958
- var R = lt(r.deltaTime, r.deltaX, r.deltaY);
959
- r.overallVelocityX = R.x, r.overallVelocityY = R.y, r.overallVelocity = m(R.x) > m(R.y) ? R.x : R.y, r.scale = b ? Ft(b.pointers, s) : 1, r.rotation = b ? kt(b.pointers, s) : 0, r.maxPointers = i.prevInput ? r.pointers.length > i.prevInput.maxPointers ? r.pointers.length : i.prevInput.maxPointers : r.pointers.length, St(i, r);
960
- var ne = e.element;
961
- Ce(r.srcEvent.target, ne) && (ne = r.srcEvent.target), r.target = ne;
962
- }
963
- function Nt(e, r) {
964
- var i = r.center, s = e.offsetDelta || {}, v = e.prevDelta || {}, d = e.prevInput || {};
965
- (r.eventType === _ || d.eventType === D) && (v = e.prevDelta = {
966
- x: d.deltaX || 0,
967
- y: d.deltaY || 0
968
- }, s = e.offsetDelta = {
969
- x: i.x,
970
- y: i.y
971
- }), r.deltaX = v.x + (i.x - s.x), r.deltaY = v.y + (i.y - s.y);
972
- }
973
- function St(e, r) {
974
- var i = e.lastInterval || r, s = r.timeStamp - i.timeStamp, v, d, b, H;
975
- if (r.eventType != B && (s > S || i.velocity === a)) {
976
- var K = r.deltaX - i.deltaX, R = r.deltaY - i.deltaY, ne = lt(s, K, R);
977
- d = ne.x, b = ne.y, v = m(ne.x) > m(ne.y) ? ne.x : ne.y, H = ct(K, R), e.lastInterval = r;
944
+ function Xe(n) {
945
+ var r, a = n.options.inputClass;
946
+ return a ? r = a : Y ? r = ut : te ? r = Ze : R ? r = ht : r = qe, new r(n, Ge);
947
+ }
948
+ function Ge(n, r, a) {
949
+ var u = a.pointers.length, v = a.changedPointers.length, b = r & I && u - v === 0, C = r & (H | z) && u - v === 0;
950
+ a.isFirst = !!b, a.isFinal = !!C, b && (n.session = {}), a.eventType = r, s(n, a), n.emit("hammer.input", a), n.recognize(a), n.session.prevInput = a;
951
+ }
952
+ function s(n, r) {
953
+ var a = n.session, u = r.pointers, v = u.length;
954
+ a.firstInput || (a.firstInput = q(r)), v > 1 && !a.firstMultiple ? a.firstMultiple = q(r) : v === 1 && (a.firstMultiple = !1);
955
+ var b = a.firstInput, C = a.firstMultiple, K = C ? C.center : b.center, se = r.center = fe(u);
956
+ r.timeStamp = d(), r.deltaTime = r.timeStamp - b.timeStamp, r.angle = ct(K, se), r.distance = We(K, se), L(a, r), r.offsetDirection = ge(r.deltaX, r.deltaY);
957
+ var G = Fe(r.deltaTime, r.deltaX, r.deltaY);
958
+ r.overallVelocityX = G.x, r.overallVelocityY = G.y, r.overallVelocity = g(G.x) > g(G.y) ? G.x : G.y, r.scale = C ? Xt(C.pointers, u) : 1, r.rotation = C ? zt(C.pointers, u) : 0, r.maxPointers = a.prevInput ? r.pointers.length > a.prevInput.maxPointers ? r.pointers.length : a.prevInput.maxPointers : r.pointers.length, X(a, r);
959
+ var de = n.element;
960
+ $(r.srcEvent.target, de) && (de = r.srcEvent.target), r.target = de;
961
+ }
962
+ function L(n, r) {
963
+ var a = r.center, u = n.offsetDelta || {}, v = n.prevDelta || {}, b = n.prevInput || {};
964
+ (r.eventType === I || b.eventType === H) && (v = n.prevDelta = {
965
+ x: b.deltaX || 0,
966
+ y: b.deltaY || 0
967
+ }, u = n.offsetDelta = {
968
+ x: a.x,
969
+ y: a.y
970
+ }), r.deltaX = v.x + (a.x - u.x), r.deltaY = v.y + (a.y - u.y);
971
+ }
972
+ function X(n, r) {
973
+ var a = n.lastInterval || r, u = r.timeStamp - a.timeStamp, v, b, C, K;
974
+ if (r.eventType != z && (u > U || a.velocity === i)) {
975
+ var se = r.deltaX - a.deltaX, G = r.deltaY - a.deltaY, de = Fe(u, se, G);
976
+ b = de.x, C = de.y, v = g(de.x) > g(de.y) ? de.x : de.y, K = ge(se, G), n.lastInterval = r;
978
977
  } else
979
- v = i.velocity, d = i.velocityX, b = i.velocityY, H = i.direction;
980
- r.velocity = v, r.velocityX = d, r.velocityY = b, r.direction = H;
981
- }
982
- function ot(e) {
983
- for (var r = [], i = 0; i < e.pointers.length; )
984
- r[i] = {
985
- clientX: c(e.pointers[i].clientX),
986
- clientY: c(e.pointers[i].clientY)
987
- }, i++;
978
+ v = a.velocity, b = a.velocityX, C = a.velocityY, K = a.direction;
979
+ r.velocity = v, r.velocityX = b, r.velocityY = C, r.direction = K;
980
+ }
981
+ function q(n) {
982
+ for (var r = [], a = 0; a < n.pointers.length; )
983
+ r[a] = {
984
+ clientX: c(n.pointers[a].clientX),
985
+ clientY: c(n.pointers[a].clientY)
986
+ }, a++;
988
987
  return {
989
- timeStamp: p(),
988
+ timeStamp: d(),
990
989
  pointers: r,
991
- center: st(r),
992
- deltaX: e.deltaX,
993
- deltaY: e.deltaY
990
+ center: fe(r),
991
+ deltaX: n.deltaX,
992
+ deltaY: n.deltaY
994
993
  };
995
994
  }
996
- function st(e) {
997
- var r = e.length;
995
+ function fe(n) {
996
+ var r = n.length;
998
997
  if (r === 1)
999
998
  return {
1000
- x: c(e[0].clientX),
1001
- y: c(e[0].clientY)
999
+ x: c(n[0].clientX),
1000
+ y: c(n[0].clientY)
1002
1001
  };
1003
- for (var i = 0, s = 0, v = 0; v < r; )
1004
- i += e[v].clientX, s += e[v].clientY, v++;
1002
+ for (var a = 0, u = 0, v = 0; v < r; )
1003
+ a += n[v].clientX, u += n[v].clientY, v++;
1005
1004
  return {
1006
- x: c(i / r),
1007
- y: c(s / r)
1005
+ x: c(a / r),
1006
+ y: c(u / r)
1008
1007
  };
1009
1008
  }
1010
- function lt(e, r, i) {
1009
+ function Fe(n, r, a) {
1011
1010
  return {
1012
- x: r / e || 0,
1013
- y: i / e || 0
1011
+ x: r / n || 0,
1012
+ y: a / n || 0
1014
1013
  };
1015
1014
  }
1016
- function ct(e, r) {
1017
- return e === r ? xe : m(e) >= m(r) ? e < 0 ? me : ge : r < 0 ? ye : Te;
1015
+ function ge(n, r) {
1016
+ return n === r ? _e : g(n) >= g(r) ? n < 0 ? Ee : Ce : r < 0 ? Ne : Pe;
1018
1017
  }
1019
- function Oe(e, r, i) {
1020
- i || (i = at);
1021
- var s = r[i[0]] - e[i[0]], v = r[i[1]] - e[i[1]];
1022
- return Math.sqrt(s * s + v * v);
1018
+ function We(n, r, a) {
1019
+ a || (a = Re);
1020
+ var u = r[a[0]] - n[a[0]], v = r[a[1]] - n[a[1]];
1021
+ return Math.sqrt(u * u + v * v);
1023
1022
  }
1024
- function ze(e, r, i) {
1025
- i || (i = at);
1026
- var s = r[i[0]] - e[i[0]], v = r[i[1]] - e[i[1]];
1027
- return Math.atan2(v, s) * 180 / Math.PI;
1023
+ function ct(n, r, a) {
1024
+ a || (a = Re);
1025
+ var u = r[a[0]] - n[a[0]], v = r[a[1]] - n[a[1]];
1026
+ return Math.atan2(v, u) * 180 / Math.PI;
1028
1027
  }
1029
- function kt(e, r) {
1030
- return ze(r[1], r[0], Ie) + ze(e[1], e[0], Ie);
1028
+ function zt(n, r) {
1029
+ return ct(r[1], r[0], Ie) + ct(n[1], n[0], Ie);
1031
1030
  }
1032
- function Ft(e, r) {
1033
- return Oe(r[0], r[1], Ie) / Oe(e[0], e[1], Ie);
1031
+ function Xt(n, r) {
1032
+ return We(r[0], r[1], Ie) / We(n[0], n[1], Ie);
1034
1033
  }
1035
- var Ut = {
1036
- mousedown: _,
1037
- mousemove: j,
1038
- mouseup: D
1039
- }, Dt = "mousedown", Lt = "mousemove mouseup";
1040
- function Ne() {
1041
- this.evEl = Dt, this.evWin = Lt, this.pressed = !1, J.apply(this, arguments);
1034
+ var Gt = {
1035
+ mousedown: I,
1036
+ mousemove: J,
1037
+ mouseup: H
1038
+ }, Wt = "mousedown", qt = "mousemove mouseup";
1039
+ function qe() {
1040
+ this.evEl = Wt, this.evWin = qt, this.pressed = !1, re.apply(this, arguments);
1042
1041
  }
1043
- O(Ne, J, {
1042
+ y(qe, re, {
1044
1043
  /**
1045
1044
  * handle mouse events
1046
1045
  * @param {Object} ev
1047
1046
  */
1048
1047
  handler: function(r) {
1049
- var i = Ut[r.type];
1050
- i & _ && (r.button === 0 || r.button === 2) && (this.pressed = !0), i & j && r.which !== 1 && (i = D), this.pressed && (i & D && (this.pressed = !1), this.callback(this.manager, i, {
1048
+ var a = Gt[r.type];
1049
+ a & I && (r.button === 0 || r.button === 2) && (this.pressed = !0), a & J && r.which !== 1 && (a = H), this.pressed && (a & H && (this.pressed = !1), this.callback(this.manager, a, {
1051
1050
  pointers: [r],
1052
1051
  changedPointers: [r],
1053
- pointerType: Y,
1052
+ pointerType: W,
1054
1053
  srcEvent: r
1055
1054
  }));
1056
1055
  }
1057
1056
  });
1058
- var ut = {
1059
- pointerdown: _,
1060
- pointermove: j,
1061
- pointerup: D,
1062
- pointercancel: B,
1063
- pointerout: B
1064
- }, Rt = {
1065
- 2: L,
1066
- 3: I,
1067
- 4: Y,
1068
- 5: k
1057
+ var Pt = {
1058
+ pointerdown: I,
1059
+ pointermove: J,
1060
+ pointerup: H,
1061
+ pointercancel: z,
1062
+ pointerout: z
1063
+ }, Zt = {
1064
+ 2: j,
1065
+ 3: F,
1066
+ 4: W,
1067
+ 5: B
1069
1068
  // see https://twitter.com/jacobrossi/status/480596438489890816
1070
- }, ht = "pointerdown", ft = "pointermove pointerup pointercancel";
1071
- u.MSPointerEvent && !u.PointerEvent && (ht = "MSPointerDown", ft = "MSPointerMove MSPointerUp MSPointerCancel");
1072
- function je() {
1073
- this.evEl = ht, this.evWin = ft, J.apply(this, arguments), this.store = this.manager.session.pointerEvents = [];
1069
+ }, Mt = "pointerdown", Ot = "pointermove pointerup pointercancel";
1070
+ p.MSPointerEvent && !p.PointerEvent && (Mt = "MSPointerDown", Ot = "MSPointerMove MSPointerUp MSPointerCancel");
1071
+ function ut() {
1072
+ this.evEl = Mt, this.evWin = Ot, re.apply(this, arguments), this.store = this.manager.session.pointerEvents = [];
1074
1073
  }
1075
- O(je, J, {
1074
+ y(ut, re, {
1076
1075
  /**
1077
1076
  * handle mouse events
1078
1077
  * @param {Object} ev
1079
1078
  */
1080
1079
  handler: function(r) {
1081
- var i = this.store, s = !1, v = !1, d = r.type.toLowerCase().replace("ms", ""), b = ut[d], H = Rt[r.pointerType] || r.pointerType, K = H == L, R = se(i, r.pointerId, "pointerId");
1082
- b & _ && (r.button === 0 || r.button === 2 || K) ? R < 0 && (i.push(r), R = i.length - 1) : b & (D | B) ? s = !0 : !K && r.buttons === 0 && (s = !0, v = !0, b = ut.pointerup), !(R < 0) && (v || (i[R] = r), this.callback(this.manager, b, {
1083
- pointers: i,
1080
+ var a = this.store, u = !1, v = !1, b = r.type.toLowerCase().replace("ms", ""), C = Pt[b], K = Zt[r.pointerType] || r.pointerType, se = K == j, G = le(a, r.pointerId, "pointerId");
1081
+ C & I && (r.button === 0 || r.button === 2 || se) ? G < 0 && (a.push(r), G = a.length - 1) : C & (H | z) ? u = !0 : !se && r.buttons === 0 && (u = !0, v = !0, C = Pt.pointerup), !(G < 0) && (v || (a[G] = r), this.callback(this.manager, C, {
1082
+ pointers: a,
1084
1083
  changedPointers: [r],
1085
- pointerType: H,
1086
- srcEvent: i[R]
1087
- }), s && i.splice(R, 1));
1084
+ pointerType: K,
1085
+ srcEvent: a[G]
1086
+ }), u && a.splice(G, 1));
1088
1087
  }
1089
1088
  });
1090
- var Bt = {
1091
- touchstart: _,
1092
- touchmove: j,
1093
- touchend: D,
1094
- touchcancel: B
1095
- }, Vt = "touchstart", Gt = "touchstart touchmove touchend touchcancel";
1096
- function vt() {
1097
- this.evTarget = Vt, this.evWin = Gt, this.started = !1, J.apply(this, arguments);
1098
- }
1099
- O(vt, J, {
1089
+ var Kt = {
1090
+ touchstart: I,
1091
+ touchmove: J,
1092
+ touchend: H,
1093
+ touchcancel: z
1094
+ }, Qt = "touchstart", Jt = "touchstart touchmove touchend touchcancel";
1095
+ function At() {
1096
+ this.evTarget = Qt, this.evWin = Jt, this.started = !1, re.apply(this, arguments);
1097
+ }
1098
+ y(At, re, {
1100
1099
  handler: function(r) {
1101
- var i = Bt[r.type];
1102
- if (i === _ && (this.started = !0), !!this.started) {
1103
- var s = Yt.call(this, r, i);
1104
- i & (D | B) && s[0].length - s[1].length === 0 && (this.started = !1), this.callback(this.manager, i, {
1105
- pointers: s[0],
1106
- changedPointers: s[1],
1107
- pointerType: L,
1100
+ var a = Kt[r.type];
1101
+ if (a === I && (this.started = !0), !!this.started) {
1102
+ var u = $t.call(this, r, a);
1103
+ a & (H | z) && u[0].length - u[1].length === 0 && (this.started = !1), this.callback(this.manager, a, {
1104
+ pointers: u[0],
1105
+ changedPointers: u[1],
1106
+ pointerType: j,
1108
1107
  srcEvent: r
1109
1108
  });
1110
1109
  }
1111
1110
  }
1112
1111
  });
1113
- function Yt(e, r) {
1114
- var i = ve(e.touches), s = ve(e.changedTouches);
1115
- return r & (D | B) && (i = Ae(i.concat(s), "identifier")), [i, s];
1116
- }
1117
- var Ht = {
1118
- touchstart: _,
1119
- touchmove: j,
1120
- touchend: D,
1121
- touchcancel: B
1122
- }, Xt = "touchstart touchmove touchend touchcancel";
1123
- function Se() {
1124
- this.evTarget = Xt, this.targetIds = {}, J.apply(this, arguments);
1125
- }
1126
- O(Se, J, {
1112
+ function $t(n, r) {
1113
+ var a = me(n.touches), u = me(n.changedTouches);
1114
+ return r & (H | z) && (a = xe(a.concat(u), "identifier")), [a, u];
1115
+ }
1116
+ var en = {
1117
+ touchstart: I,
1118
+ touchmove: J,
1119
+ touchend: H,
1120
+ touchcancel: z
1121
+ }, tn = "touchstart touchmove touchend touchcancel";
1122
+ function Ze() {
1123
+ this.evTarget = tn, this.targetIds = {}, re.apply(this, arguments);
1124
+ }
1125
+ y(Ze, re, {
1127
1126
  handler: function(r) {
1128
- var i = Ht[r.type], s = zt.call(this, r, i);
1129
- s && this.callback(this.manager, i, {
1130
- pointers: s[0],
1131
- changedPointers: s[1],
1132
- pointerType: L,
1127
+ var a = en[r.type], u = nn.call(this, r, a);
1128
+ u && this.callback(this.manager, a, {
1129
+ pointers: u[0],
1130
+ changedPointers: u[1],
1131
+ pointerType: j,
1133
1132
  srcEvent: r
1134
1133
  });
1135
1134
  }
1136
1135
  });
1137
- function zt(e, r) {
1138
- var i = ve(e.touches), s = this.targetIds;
1139
- if (r & (_ | j) && i.length === 1)
1140
- return s[i[0].identifier] = !0, [i, i];
1141
- var v, d, b = ve(e.changedTouches), H = [], K = this.target;
1142
- if (d = i.filter(function(R) {
1143
- return Ce(R.target, K);
1144
- }), r === _)
1145
- for (v = 0; v < d.length; )
1146
- s[d[v].identifier] = !0, v++;
1147
- for (v = 0; v < b.length; )
1148
- s[b[v].identifier] && H.push(b[v]), r & (D | B) && delete s[b[v].identifier], v++;
1149
- if (H.length)
1136
+ function nn(n, r) {
1137
+ var a = me(n.touches), u = this.targetIds;
1138
+ if (r & (I | J) && a.length === 1)
1139
+ return u[a[0].identifier] = !0, [a, a];
1140
+ var v, b, C = me(n.changedTouches), K = [], se = this.target;
1141
+ if (b = a.filter(function(G) {
1142
+ return $(G.target, se);
1143
+ }), r === I)
1144
+ for (v = 0; v < b.length; )
1145
+ u[b[v].identifier] = !0, v++;
1146
+ for (v = 0; v < C.length; )
1147
+ u[C[v].identifier] && K.push(C[v]), r & (H | z) && delete u[C[v].identifier], v++;
1148
+ if (K.length)
1150
1149
  return [
1151
1150
  // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
1152
- Ae(d.concat(H), "identifier"),
1153
- H
1151
+ xe(b.concat(K), "identifier"),
1152
+ K
1154
1153
  ];
1155
1154
  }
1156
- var jt = 2500, pt = 25;
1157
- function We() {
1158
- J.apply(this, arguments);
1159
- var e = z(this.handler, this);
1160
- this.touch = new Se(this.manager, e), this.mouse = new Ne(this.manager, e), this.primaryTouch = null, this.lastTouches = [];
1155
+ var rn = 2500, xt = 25;
1156
+ function ht() {
1157
+ re.apply(this, arguments);
1158
+ var n = T(this.handler, this);
1159
+ this.touch = new Ze(this.manager, n), this.mouse = new qe(this.manager, n), this.primaryTouch = null, this.lastTouches = [];
1161
1160
  }
1162
- O(We, J, {
1161
+ y(ht, re, {
1163
1162
  /**
1164
1163
  * handle mouse and touch events
1165
1164
  * @param {Hammer} manager
1166
1165
  * @param {String} inputEvent
1167
1166
  * @param {Object} inputData
1168
1167
  */
1169
- handler: function(r, i, s) {
1170
- var v = s.pointerType == L, d = s.pointerType == Y;
1171
- if (!(d && s.sourceCapabilities && s.sourceCapabilities.firesTouchEvents)) {
1168
+ handler: function(r, a, u) {
1169
+ var v = u.pointerType == j, b = u.pointerType == W;
1170
+ if (!(b && u.sourceCapabilities && u.sourceCapabilities.firesTouchEvents)) {
1172
1171
  if (v)
1173
- Wt.call(this, i, s);
1174
- else if (d && qt.call(this, s))
1172
+ an.call(this, a, u);
1173
+ else if (b && on.call(this, u))
1175
1174
  return;
1176
- this.callback(r, i, s);
1175
+ this.callback(r, a, u);
1177
1176
  }
1178
1177
  },
1179
1178
  /**
@@ -1183,40 +1182,40 @@ var rt = function(u, o, n, a) {
1183
1182
  this.touch.destroy(), this.mouse.destroy();
1184
1183
  }
1185
1184
  });
1186
- function Wt(e, r) {
1187
- e & _ ? (this.primaryTouch = r.changedPointers[0].identifier, dt.call(this, r)) : e & (D | B) && dt.call(this, r);
1185
+ function an(n, r) {
1186
+ n & I ? (this.primaryTouch = r.changedPointers[0].identifier, _t.call(this, r)) : n & (H | z) && _t.call(this, r);
1188
1187
  }
1189
- function dt(e) {
1190
- var r = e.changedPointers[0];
1188
+ function _t(n) {
1189
+ var r = n.changedPointers[0];
1191
1190
  if (r.identifier === this.primaryTouch) {
1192
- var i = { x: r.clientX, y: r.clientY };
1193
- this.lastTouches.push(i);
1194
- var s = this.lastTouches, v = function() {
1195
- var d = s.indexOf(i);
1196
- d > -1 && s.splice(d, 1);
1191
+ var a = { x: r.clientX, y: r.clientY };
1192
+ this.lastTouches.push(a);
1193
+ var u = this.lastTouches, v = function() {
1194
+ var b = u.indexOf(a);
1195
+ b > -1 && u.splice(b, 1);
1197
1196
  };
1198
- setTimeout(v, jt);
1197
+ setTimeout(v, rn);
1199
1198
  }
1200
1199
  }
1201
- function qt(e) {
1202
- for (var r = e.srcEvent.clientX, i = e.srcEvent.clientY, s = 0; s < this.lastTouches.length; s++) {
1203
- var v = this.lastTouches[s], d = Math.abs(r - v.x), b = Math.abs(i - v.y);
1204
- if (d <= pt && b <= pt)
1200
+ function on(n) {
1201
+ for (var r = n.srcEvent.clientX, a = n.srcEvent.clientY, u = 0; u < this.lastTouches.length; u++) {
1202
+ var v = this.lastTouches[u], b = Math.abs(r - v.x), C = Math.abs(a - v.y);
1203
+ if (b <= xt && C <= xt)
1205
1204
  return !0;
1206
1205
  }
1207
1206
  return !1;
1208
1207
  }
1209
- var mt = l ? le(l.style, "touchAction") : a, gt = mt !== a, yt = "compute", Tt = "auto", qe = "manipulation", he = "none", we = "pan-x", be = "pan-y", ke = Kt();
1210
- function Ze(e, r) {
1211
- this.manager = e, this.set(r);
1208
+ var Ct = l ? ne(l.style, "touchAction") : i, Nt = Ct !== i, It = "compute", St = "auto", ft = "manipulation", Se = "none", Ue = "pan-x", Be = "pan-y", Ke = ln();
1209
+ function pt(n, r) {
1210
+ this.manager = n, this.set(r);
1212
1211
  }
1213
- Ze.prototype = {
1212
+ pt.prototype = {
1214
1213
  /**
1215
1214
  * set the touchAction value on the element or enable the polyfill
1216
1215
  * @param {String} value
1217
1216
  */
1218
- set: function(e) {
1219
- e == yt && (e = this.compute()), gt && this.manager.element.style && ke[e] && (this.manager.element.style[mt] = e), this.actions = e.toLowerCase().trim();
1217
+ set: function(n) {
1218
+ n == It && (n = this.compute()), Nt && this.manager.element.style && Ke[n] && (this.manager.element.style[Ct] = n), this.actions = n.toLowerCase().trim();
1220
1219
  },
1221
1220
  /**
1222
1221
  * just re-set the touchAction value
@@ -1229,57 +1228,57 @@ var rt = function(u, o, n, a) {
1229
1228
  * @returns {String} value
1230
1229
  */
1231
1230
  compute: function() {
1232
- var e = [];
1233
- return M(this.manager.recognizers, function(r) {
1234
- q(r.options.enable, [r]) && (e = e.concat(r.getTouchAction()));
1235
- }), Zt(e.join(" "));
1231
+ var n = [];
1232
+ return O(this.manager.recognizers, function(r) {
1233
+ P(r.options.enable, [r]) && (n = n.concat(r.getTouchAction()));
1234
+ }), sn(n.join(" "));
1236
1235
  },
1237
1236
  /**
1238
1237
  * this method is called on each input cycle and provides the preventing of the browser behavior
1239
1238
  * @param {Object} input
1240
1239
  */
1241
- preventDefaults: function(e) {
1242
- var r = e.srcEvent, i = e.offsetDirection;
1240
+ preventDefaults: function(n) {
1241
+ var r = n.srcEvent, a = n.offsetDirection;
1243
1242
  if (this.manager.session.prevented) {
1244
1243
  r.preventDefault();
1245
1244
  return;
1246
1245
  }
1247
- var s = this.actions, v = ie(s, he) && !ke[he], d = ie(s, be) && !ke[be], b = ie(s, we) && !ke[we];
1246
+ var u = this.actions, v = Z(u, Se) && !Ke[Se], b = Z(u, Be) && !Ke[Be], C = Z(u, Ue) && !Ke[Ue];
1248
1247
  if (v) {
1249
- var H = e.pointers.length === 1, K = e.distance < 2, R = e.deltaTime < 250;
1250
- if (H && K && R)
1248
+ var K = n.pointers.length === 1, se = n.distance < 2, G = n.deltaTime < 250;
1249
+ if (K && se && G)
1251
1250
  return;
1252
1251
  }
1253
- if (!(b && d) && (v || d && i & te || b && i & ue))
1252
+ if (!(C && b) && (v || b && a & oe || C && a & ue))
1254
1253
  return this.preventSrc(r);
1255
1254
  },
1256
1255
  /**
1257
1256
  * call preventDefault to prevent the browser's default behavior (scrolling in most cases)
1258
1257
  * @param {Object} srcEvent
1259
1258
  */
1260
- preventSrc: function(e) {
1261
- this.manager.session.prevented = !0, e.preventDefault();
1259
+ preventSrc: function(n) {
1260
+ this.manager.session.prevented = !0, n.preventDefault();
1262
1261
  }
1263
1262
  };
1264
- function Zt(e) {
1265
- if (ie(e, he))
1266
- return he;
1267
- var r = ie(e, we), i = ie(e, be);
1268
- return r && i ? he : r || i ? r ? we : be : ie(e, qe) ? qe : Tt;
1269
- }
1270
- function Kt() {
1271
- if (!gt)
1263
+ function sn(n) {
1264
+ if (Z(n, Se))
1265
+ return Se;
1266
+ var r = Z(n, Ue), a = Z(n, Be);
1267
+ return r && a ? Se : r || a ? r ? Ue : Be : Z(n, ft) ? ft : St;
1268
+ }
1269
+ function ln() {
1270
+ if (!Nt)
1272
1271
  return !1;
1273
- var e = {}, r = u.CSS && u.CSS.supports;
1274
- return ["auto", "manipulation", "pan-y", "pan-x", "pan-x pan-y", "none"].forEach(function(i) {
1275
- e[i] = r ? u.CSS.supports("touch-action", i) : !0;
1276
- }), e;
1272
+ var n = {}, r = p.CSS && p.CSS.supports;
1273
+ return ["auto", "manipulation", "pan-y", "pan-x", "pan-x pan-y", "none"].forEach(function(a) {
1274
+ n[a] = r ? p.CSS.supports("touch-action", a) : !0;
1275
+ }), n;
1277
1276
  }
1278
- var Fe = 1, Q = 2, pe = 4, ce = 8, ae = ce, Ee = 16, re = 32;
1279
- function oe(e) {
1280
- this.options = C({}, this.defaults, e || {}), this.id = A(), this.manager = null, this.options.enable = f(this.options.enable, !0), this.state = Fe, this.simultaneous = {}, this.requireFail = [];
1277
+ var Qe = 1, ce = 2, ke = 4, Me = 8, ye = Me, Ve = 16, pe = 32;
1278
+ function Te(n) {
1279
+ this.options = A({}, this.defaults, n || {}), this.id = D(), this.manager = null, this.options.enable = f(this.options.enable, !0), this.state = Qe, this.simultaneous = {}, this.requireFail = [];
1281
1280
  }
1282
- oe.prototype = {
1281
+ Te.prototype = {
1283
1282
  /**
1284
1283
  * @virtual
1285
1284
  * @type {Object}
@@ -1290,49 +1289,49 @@ var rt = function(u, o, n, a) {
1290
1289
  * @param {Object} options
1291
1290
  * @return {Recognizer}
1292
1291
  */
1293
- set: function(e) {
1294
- return C(this.options, e), this.manager && this.manager.touchAction.update(), this;
1292
+ set: function(n) {
1293
+ return A(this.options, n), this.manager && this.manager.touchAction.update(), this;
1295
1294
  },
1296
1295
  /**
1297
1296
  * recognize simultaneous with an other recognizer.
1298
1297
  * @param {Recognizer} otherRecognizer
1299
1298
  * @returns {Recognizer} this
1300
1299
  */
1301
- recognizeWith: function(e) {
1302
- if (T(e, "recognizeWith", this))
1300
+ recognizeWith: function(n) {
1301
+ if (E(n, "recognizeWith", this))
1303
1302
  return this;
1304
1303
  var r = this.simultaneous;
1305
- return e = Ue(e, this), r[e.id] || (r[e.id] = e, e.recognizeWith(this)), this;
1304
+ return n = Je(n, this), r[n.id] || (r[n.id] = n, n.recognizeWith(this)), this;
1306
1305
  },
1307
1306
  /**
1308
1307
  * drop the simultaneous link. it doesnt remove the link on the other recognizer.
1309
1308
  * @param {Recognizer} otherRecognizer
1310
1309
  * @returns {Recognizer} this
1311
1310
  */
1312
- dropRecognizeWith: function(e) {
1313
- return T(e, "dropRecognizeWith", this) ? this : (e = Ue(e, this), delete this.simultaneous[e.id], this);
1311
+ dropRecognizeWith: function(n) {
1312
+ return E(n, "dropRecognizeWith", this) ? this : (n = Je(n, this), delete this.simultaneous[n.id], this);
1314
1313
  },
1315
1314
  /**
1316
1315
  * recognizer can only run when an other is failing
1317
1316
  * @param {Recognizer} otherRecognizer
1318
1317
  * @returns {Recognizer} this
1319
1318
  */
1320
- requireFailure: function(e) {
1321
- if (T(e, "requireFailure", this))
1319
+ requireFailure: function(n) {
1320
+ if (E(n, "requireFailure", this))
1322
1321
  return this;
1323
1322
  var r = this.requireFail;
1324
- return e = Ue(e, this), se(r, e) === -1 && (r.push(e), e.requireFailure(this)), this;
1323
+ return n = Je(n, this), le(r, n) === -1 && (r.push(n), n.requireFailure(this)), this;
1325
1324
  },
1326
1325
  /**
1327
1326
  * drop the requireFailure link. it does not remove the link on the other recognizer.
1328
1327
  * @param {Recognizer} otherRecognizer
1329
1328
  * @returns {Recognizer} this
1330
1329
  */
1331
- dropRequireFailure: function(e) {
1332
- if (T(e, "dropRequireFailure", this))
1330
+ dropRequireFailure: function(n) {
1331
+ if (E(n, "dropRequireFailure", this))
1333
1332
  return this;
1334
- e = Ue(e, this);
1335
- var r = se(this.requireFail, e);
1333
+ n = Je(n, this);
1334
+ var r = le(this.requireFail, n);
1336
1335
  return r > -1 && this.requireFail.splice(r, 1), this;
1337
1336
  },
1338
1337
  /**
@@ -1347,20 +1346,20 @@ var rt = function(u, o, n, a) {
1347
1346
  * @param {Recognizer} otherRecognizer
1348
1347
  * @returns {Boolean}
1349
1348
  */
1350
- canRecognizeWith: function(e) {
1351
- return !!this.simultaneous[e.id];
1349
+ canRecognizeWith: function(n) {
1350
+ return !!this.simultaneous[n.id];
1352
1351
  },
1353
1352
  /**
1354
1353
  * You should use `tryEmit` instead of `emit` directly to check
1355
1354
  * that all the needed recognizers has failed before emitting.
1356
1355
  * @param {Object} input
1357
1356
  */
1358
- emit: function(e) {
1359
- var r = this, i = this.state;
1360
- function s(v) {
1361
- r.manager.emit(v, e);
1357
+ emit: function(n) {
1358
+ var r = this, a = this.state;
1359
+ function u(v) {
1360
+ r.manager.emit(v, n);
1362
1361
  }
1363
- i < ce && s(r.options.event + wt(i)), s(r.options.event), e.additionalEvent && s(e.additionalEvent), i >= ce && s(r.options.event + wt(i));
1362
+ a < Me && u(r.options.event + kt(a)), u(r.options.event), n.additionalEvent && u(n.additionalEvent), a >= Me && u(r.options.event + kt(a));
1364
1363
  },
1365
1364
  /**
1366
1365
  * Check that all the require failure recognizers has failed,
@@ -1368,20 +1367,20 @@ var rt = function(u, o, n, a) {
1368
1367
  * otherwise, setup the state to FAILED.
1369
1368
  * @param {Object} input
1370
1369
  */
1371
- tryEmit: function(e) {
1370
+ tryEmit: function(n) {
1372
1371
  if (this.canEmit())
1373
- return this.emit(e);
1374
- this.state = re;
1372
+ return this.emit(n);
1373
+ this.state = pe;
1375
1374
  },
1376
1375
  /**
1377
1376
  * can we emit?
1378
1377
  * @returns {boolean}
1379
1378
  */
1380
1379
  canEmit: function() {
1381
- for (var e = 0; e < this.requireFail.length; ) {
1382
- if (!(this.requireFail[e].state & (re | Fe)))
1380
+ for (var n = 0; n < this.requireFail.length; ) {
1381
+ if (!(this.requireFail[n].state & (pe | Qe)))
1383
1382
  return !1;
1384
- e++;
1383
+ n++;
1385
1384
  }
1386
1385
  return !0;
1387
1386
  },
@@ -1389,13 +1388,13 @@ var rt = function(u, o, n, a) {
1389
1388
  * update the recognizer
1390
1389
  * @param {Object} inputData
1391
1390
  */
1392
- recognize: function(e) {
1393
- var r = C({}, e);
1394
- if (!q(this.options.enable, [this, r])) {
1395
- this.reset(), this.state = re;
1391
+ recognize: function(n) {
1392
+ var r = A({}, n);
1393
+ if (!P(this.options.enable, [this, r])) {
1394
+ this.reset(), this.state = pe;
1396
1395
  return;
1397
1396
  }
1398
- this.state & (ae | Ee | re) && (this.state = Fe), this.state = this.process(r), this.state & (Q | pe | ce | Ee) && this.tryEmit(r);
1397
+ this.state & (ye | Ve | pe) && (this.state = Qe), this.state = this.process(r), this.state & (ce | ke | Me | Ve) && this.tryEmit(r);
1399
1398
  },
1400
1399
  /**
1401
1400
  * return the state of the recognizer
@@ -1404,7 +1403,7 @@ var rt = function(u, o, n, a) {
1404
1403
  * @param {Object} inputData
1405
1404
  * @returns {Const} STATE
1406
1405
  */
1407
- process: function(e) {
1406
+ process: function(n) {
1408
1407
  },
1409
1408
  // jshint ignore:line
1410
1409
  /**
@@ -1422,20 +1421,20 @@ var rt = function(u, o, n, a) {
1422
1421
  reset: function() {
1423
1422
  }
1424
1423
  };
1425
- function wt(e) {
1426
- return e & Ee ? "cancel" : e & ce ? "end" : e & pe ? "move" : e & Q ? "start" : "";
1424
+ function kt(n) {
1425
+ return n & Ve ? "cancel" : n & Me ? "end" : n & ke ? "move" : n & ce ? "start" : "";
1427
1426
  }
1428
- function bt(e) {
1429
- return e == Te ? "down" : e == ye ? "up" : e == me ? "left" : e == ge ? "right" : "";
1427
+ function Lt(n) {
1428
+ return n == Pe ? "down" : n == Ne ? "up" : n == Ee ? "left" : n == Ce ? "right" : "";
1430
1429
  }
1431
- function Ue(e, r) {
1432
- var i = r.manager;
1433
- return i ? i.get(e) : e;
1430
+ function Je(n, r) {
1431
+ var a = r.manager;
1432
+ return a ? a.get(n) : n;
1434
1433
  }
1435
- function $() {
1436
- oe.apply(this, arguments);
1434
+ function he() {
1435
+ Te.apply(this, arguments);
1437
1436
  }
1438
- O($, oe, {
1437
+ y(he, Te, {
1439
1438
  /**
1440
1439
  * @namespace
1441
1440
  * @memberof AttrRecognizer
@@ -1453,9 +1452,9 @@ var rt = function(u, o, n, a) {
1453
1452
  * @param {Object} input
1454
1453
  * @returns {Boolean} recognized
1455
1454
  */
1456
- attrTest: function(e) {
1455
+ attrTest: function(n) {
1457
1456
  var r = this.options.pointers;
1458
- return r === 0 || e.pointers.length === r;
1457
+ return r === 0 || n.pointers.length === r;
1459
1458
  },
1460
1459
  /**
1461
1460
  * Process the input and return the state for the recognizer
@@ -1463,15 +1462,15 @@ var rt = function(u, o, n, a) {
1463
1462
  * @param {Object} input
1464
1463
  * @returns {*} State
1465
1464
  */
1466
- process: function(e) {
1467
- var r = this.state, i = e.eventType, s = r & (Q | pe), v = this.attrTest(e);
1468
- return s && (i & B || !v) ? r | Ee : s || v ? i & D ? r | ce : r & Q ? r | pe : Q : re;
1465
+ process: function(n) {
1466
+ var r = this.state, a = n.eventType, u = r & (ce | ke), v = this.attrTest(n);
1467
+ return u && (a & z || !v) ? r | Ve : u || v ? a & H ? r | Me : r & ce ? r | ke : ce : pe;
1469
1468
  }
1470
1469
  });
1471
- function De() {
1472
- $.apply(this, arguments), this.pX = null, this.pY = null;
1470
+ function $e() {
1471
+ he.apply(this, arguments), this.pX = null, this.pY = null;
1473
1472
  }
1474
- O(De, $, {
1473
+ y($e, he, {
1475
1474
  /**
1476
1475
  * @namespace
1477
1476
  * @memberof PanRecognizer
@@ -1480,29 +1479,29 @@ var rt = function(u, o, n, a) {
1480
1479
  event: "pan",
1481
1480
  threshold: 10,
1482
1481
  pointers: 1,
1483
- direction: it
1482
+ direction: De
1484
1483
  },
1485
1484
  getTouchAction: function() {
1486
- var e = this.options.direction, r = [];
1487
- return e & te && r.push(be), e & ue && r.push(we), r;
1485
+ var n = this.options.direction, r = [];
1486
+ return n & oe && r.push(Be), n & ue && r.push(Ue), r;
1488
1487
  },
1489
- directionTest: function(e) {
1490
- var r = this.options, i = !0, s = e.distance, v = e.direction, d = e.deltaX, b = e.deltaY;
1491
- return v & r.direction || (r.direction & te ? (v = d === 0 ? xe : d < 0 ? me : ge, i = d != this.pX, s = Math.abs(e.deltaX)) : (v = b === 0 ? xe : b < 0 ? ye : Te, i = b != this.pY, s = Math.abs(e.deltaY))), e.direction = v, i && s > r.threshold && v & r.direction;
1488
+ directionTest: function(n) {
1489
+ var r = this.options, a = !0, u = n.distance, v = n.direction, b = n.deltaX, C = n.deltaY;
1490
+ return v & r.direction || (r.direction & oe ? (v = b === 0 ? _e : b < 0 ? Ee : Ce, a = b != this.pX, u = Math.abs(n.deltaX)) : (v = C === 0 ? _e : C < 0 ? Ne : Pe, a = C != this.pY, u = Math.abs(n.deltaY))), n.direction = v, a && u > r.threshold && v & r.direction;
1492
1491
  },
1493
- attrTest: function(e) {
1494
- return $.prototype.attrTest.call(this, e) && (this.state & Q || !(this.state & Q) && this.directionTest(e));
1492
+ attrTest: function(n) {
1493
+ return he.prototype.attrTest.call(this, n) && (this.state & ce || !(this.state & ce) && this.directionTest(n));
1495
1494
  },
1496
- emit: function(e) {
1497
- this.pX = e.deltaX, this.pY = e.deltaY;
1498
- var r = bt(e.direction);
1499
- r && (e.additionalEvent = this.options.event + r), this._super.emit.call(this, e);
1495
+ emit: function(n) {
1496
+ this.pX = n.deltaX, this.pY = n.deltaY;
1497
+ var r = Lt(n.direction);
1498
+ r && (n.additionalEvent = this.options.event + r), this._super.emit.call(this, n);
1500
1499
  }
1501
1500
  });
1502
- function Ke() {
1503
- $.apply(this, arguments);
1501
+ function dt() {
1502
+ he.apply(this, arguments);
1504
1503
  }
1505
- O(Ke, $, {
1504
+ y(dt, he, {
1506
1505
  /**
1507
1506
  * @namespace
1508
1507
  * @memberof PinchRecognizer
@@ -1513,23 +1512,23 @@ var rt = function(u, o, n, a) {
1513
1512
  pointers: 2
1514
1513
  },
1515
1514
  getTouchAction: function() {
1516
- return [he];
1515
+ return [Se];
1517
1516
  },
1518
- attrTest: function(e) {
1519
- return this._super.attrTest.call(this, e) && (Math.abs(e.scale - 1) > this.options.threshold || this.state & Q);
1517
+ attrTest: function(n) {
1518
+ return this._super.attrTest.call(this, n) && (Math.abs(n.scale - 1) > this.options.threshold || this.state & ce);
1520
1519
  },
1521
- emit: function(e) {
1522
- if (e.scale !== 1) {
1523
- var r = e.scale < 1 ? "in" : "out";
1524
- e.additionalEvent = this.options.event + r;
1520
+ emit: function(n) {
1521
+ if (n.scale !== 1) {
1522
+ var r = n.scale < 1 ? "in" : "out";
1523
+ n.additionalEvent = this.options.event + r;
1525
1524
  }
1526
- this._super.emit.call(this, e);
1525
+ this._super.emit.call(this, n);
1527
1526
  }
1528
1527
  });
1529
- function Je() {
1530
- oe.apply(this, arguments), this._timer = null, this._input = null;
1528
+ function vt() {
1529
+ Te.apply(this, arguments), this._timer = null, this._input = null;
1531
1530
  }
1532
- O(Je, oe, {
1531
+ y(vt, Te, {
1533
1532
  /**
1534
1533
  * @namespace
1535
1534
  * @memberof PressRecognizer
@@ -1543,31 +1542,31 @@ var rt = function(u, o, n, a) {
1543
1542
  // a minimal movement is ok, but keep it low
1544
1543
  },
1545
1544
  getTouchAction: function() {
1546
- return [Tt];
1545
+ return [St];
1547
1546
  },
1548
- process: function(e) {
1549
- var r = this.options, i = e.pointers.length === r.pointers, s = e.distance < r.threshold, v = e.deltaTime > r.time;
1550
- if (this._input = e, !s || !i || e.eventType & (D | B) && !v)
1547
+ process: function(n) {
1548
+ var r = this.options, a = n.pointers.length === r.pointers, u = n.distance < r.threshold, v = n.deltaTime > r.time;
1549
+ if (this._input = n, !u || !a || n.eventType & (H | z) && !v)
1551
1550
  this.reset();
1552
- else if (e.eventType & _)
1553
- this.reset(), this._timer = y(function() {
1554
- this.state = ae, this.tryEmit();
1551
+ else if (n.eventType & I)
1552
+ this.reset(), this._timer = m(function() {
1553
+ this.state = ye, this.tryEmit();
1555
1554
  }, r.time, this);
1556
- else if (e.eventType & D)
1557
- return ae;
1558
- return re;
1555
+ else if (n.eventType & H)
1556
+ return ye;
1557
+ return pe;
1559
1558
  },
1560
1559
  reset: function() {
1561
1560
  clearTimeout(this._timer);
1562
1561
  },
1563
- emit: function(e) {
1564
- this.state === ae && (e && e.eventType & D ? this.manager.emit(this.options.event + "up", e) : (this._input.timeStamp = p(), this.manager.emit(this.options.event, this._input)));
1562
+ emit: function(n) {
1563
+ this.state === ye && (n && n.eventType & H ? this.manager.emit(this.options.event + "up", n) : (this._input.timeStamp = d(), this.manager.emit(this.options.event, this._input)));
1565
1564
  }
1566
1565
  });
1567
- function Qe() {
1568
- $.apply(this, arguments);
1566
+ function mt() {
1567
+ he.apply(this, arguments);
1569
1568
  }
1570
- O(Qe, $, {
1569
+ y(mt, he, {
1571
1570
  /**
1572
1571
  * @namespace
1573
1572
  * @memberof RotateRecognizer
@@ -1578,16 +1577,16 @@ var rt = function(u, o, n, a) {
1578
1577
  pointers: 2
1579
1578
  },
1580
1579
  getTouchAction: function() {
1581
- return [he];
1580
+ return [Se];
1582
1581
  },
1583
- attrTest: function(e) {
1584
- return this._super.attrTest.call(this, e) && (Math.abs(e.rotation) > this.options.threshold || this.state & Q);
1582
+ attrTest: function(n) {
1583
+ return this._super.attrTest.call(this, n) && (Math.abs(n.rotation) > this.options.threshold || this.state & ce);
1585
1584
  }
1586
1585
  });
1587
- function $e() {
1588
- $.apply(this, arguments);
1586
+ function gt() {
1587
+ he.apply(this, arguments);
1589
1588
  }
1590
- O($e, $, {
1589
+ y(gt, he, {
1591
1590
  /**
1592
1591
  * @namespace
1593
1592
  * @memberof SwipeRecognizer
@@ -1596,25 +1595,25 @@ var rt = function(u, o, n, a) {
1596
1595
  event: "swipe",
1597
1596
  threshold: 10,
1598
1597
  velocity: 0.3,
1599
- direction: te | ue,
1598
+ direction: oe | ue,
1600
1599
  pointers: 1
1601
1600
  },
1602
1601
  getTouchAction: function() {
1603
- return De.prototype.getTouchAction.call(this);
1602
+ return $e.prototype.getTouchAction.call(this);
1604
1603
  },
1605
- attrTest: function(e) {
1606
- var r = this.options.direction, i;
1607
- return r & (te | ue) ? i = e.overallVelocity : r & te ? i = e.overallVelocityX : r & ue && (i = e.overallVelocityY), this._super.attrTest.call(this, e) && r & e.offsetDirection && e.distance > this.options.threshold && e.maxPointers == this.options.pointers && m(i) > this.options.velocity && e.eventType & D;
1604
+ attrTest: function(n) {
1605
+ var r = this.options.direction, a;
1606
+ return r & (oe | ue) ? a = n.overallVelocity : r & oe ? a = n.overallVelocityX : r & ue && (a = n.overallVelocityY), this._super.attrTest.call(this, n) && r & n.offsetDirection && n.distance > this.options.threshold && n.maxPointers == this.options.pointers && g(a) > this.options.velocity && n.eventType & H;
1608
1607
  },
1609
- emit: function(e) {
1610
- var r = bt(e.offsetDirection);
1611
- r && this.manager.emit(this.options.event + r, e), this.manager.emit(this.options.event, e);
1608
+ emit: function(n) {
1609
+ var r = Lt(n.offsetDirection);
1610
+ r && this.manager.emit(this.options.event + r, n), this.manager.emit(this.options.event, n);
1612
1611
  }
1613
1612
  });
1614
- function Le() {
1615
- oe.apply(this, arguments), this.pTime = !1, this.pCenter = !1, this._timer = null, this._input = null, this.count = 0;
1613
+ function et() {
1614
+ Te.apply(this, arguments), this.pTime = !1, this.pCenter = !1, this._timer = null, this._input = null, this.count = 0;
1616
1615
  }
1617
- O(Le, oe, {
1616
+ y(et, Te, {
1618
1617
  /**
1619
1618
  * @namespace
1620
1619
  * @memberof PinchRecognizer
@@ -1633,41 +1632,41 @@ var rt = function(u, o, n, a) {
1633
1632
  // a multi-tap can be a bit off the initial position
1634
1633
  },
1635
1634
  getTouchAction: function() {
1636
- return [qe];
1635
+ return [ft];
1637
1636
  },
1638
- process: function(e) {
1639
- var r = this.options, i = e.pointers.length === r.pointers, s = e.distance < r.threshold, v = e.deltaTime < r.time;
1640
- if (this.reset(), e.eventType & _ && this.count === 0)
1637
+ process: function(n) {
1638
+ var r = this.options, a = n.pointers.length === r.pointers, u = n.distance < r.threshold, v = n.deltaTime < r.time;
1639
+ if (this.reset(), n.eventType & I && this.count === 0)
1641
1640
  return this.failTimeout();
1642
- if (s && v && i) {
1643
- if (e.eventType != D)
1641
+ if (u && v && a) {
1642
+ if (n.eventType != H)
1644
1643
  return this.failTimeout();
1645
- var d = this.pTime ? e.timeStamp - this.pTime < r.interval : !0, b = !this.pCenter || Oe(this.pCenter, e.center) < r.posThreshold;
1646
- this.pTime = e.timeStamp, this.pCenter = e.center, !b || !d ? this.count = 1 : this.count += 1, this._input = e;
1647
- var H = this.count % r.taps;
1648
- if (H === 0)
1649
- return this.hasRequireFailures() ? (this._timer = y(function() {
1650
- this.state = ae, this.tryEmit();
1651
- }, r.interval, this), Q) : ae;
1644
+ var b = this.pTime ? n.timeStamp - this.pTime < r.interval : !0, C = !this.pCenter || We(this.pCenter, n.center) < r.posThreshold;
1645
+ this.pTime = n.timeStamp, this.pCenter = n.center, !C || !b ? this.count = 1 : this.count += 1, this._input = n;
1646
+ var K = this.count % r.taps;
1647
+ if (K === 0)
1648
+ return this.hasRequireFailures() ? (this._timer = m(function() {
1649
+ this.state = ye, this.tryEmit();
1650
+ }, r.interval, this), ce) : ye;
1652
1651
  }
1653
- return re;
1652
+ return pe;
1654
1653
  },
1655
1654
  failTimeout: function() {
1656
- return this._timer = y(function() {
1657
- this.state = re;
1658
- }, this.options.interval, this), re;
1655
+ return this._timer = m(function() {
1656
+ this.state = pe;
1657
+ }, this.options.interval, this), pe;
1659
1658
  },
1660
1659
  reset: function() {
1661
1660
  clearTimeout(this._timer);
1662
1661
  },
1663
1662
  emit: function() {
1664
- this.state == ae && (this._input.tapCount = this.count, this.manager.emit(this.options.event, this._input));
1663
+ this.state == ye && (this._input.tapCount = this.count, this.manager.emit(this.options.event, this._input));
1665
1664
  }
1666
1665
  });
1667
- function de(e, r) {
1668
- return r = r || {}, r.recognizers = f(r.recognizers, de.defaults.preset), new et(e, r);
1666
+ function Le(n, r) {
1667
+ return r = r || {}, r.recognizers = f(r.recognizers, Le.defaults.preset), new yt(n, r);
1669
1668
  }
1670
- de.VERSION = "2.0.7", de.defaults = {
1669
+ Le.VERSION = "2.0.7", Le.defaults = {
1671
1670
  /**
1672
1671
  * set if DOM events are being triggered.
1673
1672
  * But this is slower and unused by simple implementations, so disabled by default.
@@ -1681,7 +1680,7 @@ var rt = function(u, o, n, a) {
1681
1680
  * @type {String}
1682
1681
  * @default compute
1683
1682
  */
1684
- touchAction: yt,
1683
+ touchAction: It,
1685
1684
  /**
1686
1685
  * @type {Boolean}
1687
1686
  * @default true
@@ -1708,13 +1707,13 @@ var rt = function(u, o, n, a) {
1708
1707
  */
1709
1708
  preset: [
1710
1709
  // RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
1711
- [Qe, { enable: !1 }],
1712
- [Ke, { enable: !1 }, ["rotate"]],
1713
- [$e, { direction: te }],
1714
- [De, { direction: te }, ["swipe"]],
1715
- [Le],
1716
- [Le, { event: "doubletap", taps: 2 }, ["tap"]],
1717
- [Je]
1710
+ [mt, { enable: !1 }],
1711
+ [dt, { enable: !1 }, ["rotate"]],
1712
+ [gt, { direction: oe }],
1713
+ [$e, { direction: oe }, ["swipe"]],
1714
+ [et],
1715
+ [et, { event: "doubletap", taps: 2 }, ["tap"]],
1716
+ [vt]
1718
1717
  ],
1719
1718
  /**
1720
1719
  * Some CSS properties can be used to improve the working of Hammer.
@@ -1763,21 +1762,21 @@ var rt = function(u, o, n, a) {
1763
1762
  tapHighlightColor: "rgba(0,0,0,0)"
1764
1763
  }
1765
1764
  };
1766
- var Jt = 1, Et = 2;
1767
- function et(e, r) {
1768
- this.options = C({}, de.defaults, r || {}), this.options.inputTarget = this.options.inputTarget || e, this.handlers = {}, this.session = {}, this.recognizers = [], this.oldCssProps = {}, this.element = e, this.input = xt(this), this.touchAction = new Ze(this, this.options.touchAction), Pt(this, !0), M(this.options.recognizers, function(i) {
1769
- var s = this.add(new i[0](i[1]));
1770
- i[2] && s.recognizeWith(i[2]), i[3] && s.requireFailure(i[3]);
1765
+ var cn = 1, Dt = 2;
1766
+ function yt(n, r) {
1767
+ this.options = A({}, Le.defaults, r || {}), this.options.inputTarget = this.options.inputTarget || n, this.handlers = {}, this.session = {}, this.recognizers = [], this.oldCssProps = {}, this.element = n, this.input = Xe(this), this.touchAction = new pt(this, this.options.touchAction), Rt(this, !0), O(this.options.recognizers, function(a) {
1768
+ var u = this.add(new a[0](a[1]));
1769
+ a[2] && u.recognizeWith(a[2]), a[3] && u.requireFailure(a[3]);
1771
1770
  }, this);
1772
1771
  }
1773
- et.prototype = {
1772
+ yt.prototype = {
1774
1773
  /**
1775
1774
  * set options
1776
1775
  * @param {Object} options
1777
1776
  * @returns {Manager}
1778
1777
  */
1779
- set: function(e) {
1780
- return C(this.options, e), e.touchAction && this.touchAction.update(), e.inputTarget && (this.input.destroy(), this.input.target = e.inputTarget, this.input.init()), this;
1778
+ set: function(n) {
1779
+ return A(this.options, n), n.touchAction && this.touchAction.update(), n.inputTarget && (this.input.destroy(), this.input.target = n.inputTarget, this.input.init()), this;
1781
1780
  },
1782
1781
  /**
1783
1782
  * stop recognizing for this session.
@@ -1785,8 +1784,8 @@ var rt = function(u, o, n, a) {
1785
1784
  * When forced, the recognizer cycle is stopped immediately.
1786
1785
  * @param {Boolean} [force]
1787
1786
  */
1788
- stop: function(e) {
1789
- this.session.stopped = e ? Et : Jt;
1787
+ stop: function(n) {
1788
+ this.session.stopped = n ? Dt : cn;
1790
1789
  },
1791
1790
  /**
1792
1791
  * run the recognizers!
@@ -1794,16 +1793,16 @@ var rt = function(u, o, n, a) {
1794
1793
  * it walks through all the recognizers and tries to detect the gesture that is being made
1795
1794
  * @param {Object} inputData
1796
1795
  */
1797
- recognize: function(e) {
1796
+ recognize: function(n) {
1798
1797
  var r = this.session;
1799
1798
  if (!r.stopped) {
1800
- this.touchAction.preventDefaults(e);
1801
- var i, s = this.recognizers, v = r.curRecognizer;
1802
- (!v || v && v.state & ae) && (v = r.curRecognizer = null);
1803
- for (var d = 0; d < s.length; )
1804
- i = s[d], r.stopped !== Et && // 1
1805
- (!v || i == v || // 2
1806
- i.canRecognizeWith(v)) ? i.recognize(e) : i.reset(), !v && i.state & (Q | pe | ce) && (v = r.curRecognizer = i), d++;
1799
+ this.touchAction.preventDefaults(n);
1800
+ var a, u = this.recognizers, v = r.curRecognizer;
1801
+ (!v || v && v.state & ye) && (v = r.curRecognizer = null);
1802
+ for (var b = 0; b < u.length; )
1803
+ a = u[b], r.stopped !== Dt && // 1
1804
+ (!v || a == v || // 2
1805
+ a.canRecognizeWith(v)) ? a.recognize(n) : a.reset(), !v && a.state & (ce | ke | Me) && (v = r.curRecognizer = a), b++;
1807
1806
  }
1808
1807
  },
1809
1808
  /**
@@ -1811,12 +1810,12 @@ var rt = function(u, o, n, a) {
1811
1810
  * @param {Recognizer|String} recognizer
1812
1811
  * @returns {Recognizer|Null}
1813
1812
  */
1814
- get: function(e) {
1815
- if (e instanceof oe)
1816
- return e;
1817
- for (var r = this.recognizers, i = 0; i < r.length; i++)
1818
- if (r[i].options.event == e)
1819
- return r[i];
1813
+ get: function(n) {
1814
+ if (n instanceof Te)
1815
+ return n;
1816
+ for (var r = this.recognizers, a = 0; a < r.length; a++)
1817
+ if (r[a].options.event == n)
1818
+ return r[a];
1820
1819
  return null;
1821
1820
  },
1822
1821
  /**
@@ -1825,23 +1824,23 @@ var rt = function(u, o, n, a) {
1825
1824
  * @param {Recognizer} recognizer
1826
1825
  * @returns {Recognizer|Manager}
1827
1826
  */
1828
- add: function(e) {
1829
- if (T(e, "add", this))
1827
+ add: function(n) {
1828
+ if (E(n, "add", this))
1830
1829
  return this;
1831
- var r = this.get(e.options.event);
1832
- return r && this.remove(r), this.recognizers.push(e), e.manager = this, this.touchAction.update(), e;
1830
+ var r = this.get(n.options.event);
1831
+ return r && this.remove(r), this.recognizers.push(n), n.manager = this, this.touchAction.update(), n;
1833
1832
  },
1834
1833
  /**
1835
1834
  * remove a recognizer by name or instance
1836
1835
  * @param {Recognizer|String} recognizer
1837
1836
  * @returns {Manager}
1838
1837
  */
1839
- remove: function(e) {
1840
- if (T(e, "remove", this))
1838
+ remove: function(n) {
1839
+ if (E(n, "remove", this))
1841
1840
  return this;
1842
- if (e = this.get(e), e) {
1843
- var r = this.recognizers, i = se(r, e);
1844
- i !== -1 && (r.splice(i, 1), this.touchAction.update());
1841
+ if (n = this.get(n), n) {
1842
+ var r = this.recognizers, a = le(r, n);
1843
+ a !== -1 && (r.splice(a, 1), this.touchAction.update());
1845
1844
  }
1846
1845
  return this;
1847
1846
  },
@@ -1851,11 +1850,11 @@ var rt = function(u, o, n, a) {
1851
1850
  * @param {Function} handler
1852
1851
  * @returns {EventEmitter} this
1853
1852
  */
1854
- on: function(e, r) {
1855
- if (e !== a && r !== a) {
1856
- var i = this.handlers;
1857
- return M(fe(e), function(s) {
1858
- i[s] = i[s] || [], i[s].push(r);
1853
+ on: function(n, r) {
1854
+ if (n !== i && r !== i) {
1855
+ var a = this.handlers;
1856
+ return O(ee(n), function(u) {
1857
+ a[u] = a[u] || [], a[u].push(r);
1859
1858
  }), this;
1860
1859
  }
1861
1860
  },
@@ -1865,11 +1864,11 @@ var rt = function(u, o, n, a) {
1865
1864
  * @param {Function} [handler]
1866
1865
  * @returns {EventEmitter} this
1867
1866
  */
1868
- off: function(e, r) {
1869
- if (e !== a) {
1870
- var i = this.handlers;
1871
- return M(fe(e), function(s) {
1872
- r ? i[s] && i[s].splice(se(i[s], r), 1) : delete i[s];
1867
+ off: function(n, r) {
1868
+ if (n !== i) {
1869
+ var a = this.handlers;
1870
+ return O(ee(n), function(u) {
1871
+ r ? a[u] && a[u].splice(le(a[u], r), 1) : delete a[u];
1873
1872
  }), this;
1874
1873
  }
1875
1874
  },
@@ -1878,15 +1877,15 @@ var rt = function(u, o, n, a) {
1878
1877
  * @param {String} event
1879
1878
  * @param {Object} data
1880
1879
  */
1881
- emit: function(e, r) {
1882
- this.options.domEvents && Qt(e, r);
1883
- var i = this.handlers[e] && this.handlers[e].slice();
1884
- if (!(!i || !i.length)) {
1885
- r.type = e, r.preventDefault = function() {
1880
+ emit: function(n, r) {
1881
+ this.options.domEvents && un(n, r);
1882
+ var a = this.handlers[n] && this.handlers[n].slice();
1883
+ if (!(!a || !a.length)) {
1884
+ r.type = n, r.preventDefault = function() {
1886
1885
  r.srcEvent.preventDefault();
1887
1886
  };
1888
- for (var s = 0; s < i.length; )
1889
- i[s](r), s++;
1887
+ for (var u = 0; u < a.length; )
1888
+ a[u](r), u++;
1890
1889
  }
1891
1890
  },
1892
1891
  /**
@@ -1894,133 +1893,529 @@ var rt = function(u, o, n, a) {
1894
1893
  * it doesn't unbind dom events, that is the user own responsibility
1895
1894
  */
1896
1895
  destroy: function() {
1897
- this.element && Pt(this, !1), this.handlers = {}, this.session = {}, this.input.destroy(), this.element = null;
1896
+ this.element && Rt(this, !1), this.handlers = {}, this.session = {}, this.input.destroy(), this.element = null;
1898
1897
  }
1899
1898
  };
1900
- function Pt(e, r) {
1901
- var i = e.element;
1902
- if (i.style) {
1903
- var s;
1904
- M(e.options.cssProps, function(v, d) {
1905
- s = le(i.style, d), r ? (e.oldCssProps[s] = i.style[s], i.style[s] = v) : i.style[s] = e.oldCssProps[s] || "";
1906
- }), r || (e.oldCssProps = {});
1899
+ function Rt(n, r) {
1900
+ var a = n.element;
1901
+ if (a.style) {
1902
+ var u;
1903
+ O(n.options.cssProps, function(v, b) {
1904
+ u = ne(a.style, b), r ? (n.oldCssProps[u] = a.style[u], a.style[u] = v) : a.style[u] = n.oldCssProps[u] || "";
1905
+ }), r || (n.oldCssProps = {});
1907
1906
  }
1908
1907
  }
1909
- function Qt(e, r) {
1910
- var i = o.createEvent("Event");
1911
- i.initEvent(e, !0, !0), i.gesture = r, r.target.dispatchEvent(i);
1912
- }
1913
- return C(de, {
1914
- INPUT_START: _,
1915
- INPUT_MOVE: j,
1916
- INPUT_END: D,
1917
- INPUT_CANCEL: B,
1918
- STATE_POSSIBLE: Fe,
1919
- STATE_BEGAN: Q,
1920
- STATE_CHANGED: pe,
1921
- STATE_ENDED: ce,
1922
- STATE_RECOGNIZED: ae,
1923
- STATE_CANCELLED: Ee,
1924
- STATE_FAILED: re,
1925
- DIRECTION_NONE: xe,
1926
- DIRECTION_LEFT: me,
1927
- DIRECTION_RIGHT: ge,
1928
- DIRECTION_UP: ye,
1929
- DIRECTION_DOWN: Te,
1930
- DIRECTION_HORIZONTAL: te,
1908
+ function un(n, r) {
1909
+ var a = o.createEvent("Event");
1910
+ a.initEvent(n, !0, !0), a.gesture = r, r.target.dispatchEvent(a);
1911
+ }
1912
+ return A(Le, {
1913
+ INPUT_START: I,
1914
+ INPUT_MOVE: J,
1915
+ INPUT_END: H,
1916
+ INPUT_CANCEL: z,
1917
+ STATE_POSSIBLE: Qe,
1918
+ STATE_BEGAN: ce,
1919
+ STATE_CHANGED: ke,
1920
+ STATE_ENDED: Me,
1921
+ STATE_RECOGNIZED: ye,
1922
+ STATE_CANCELLED: Ve,
1923
+ STATE_FAILED: pe,
1924
+ DIRECTION_NONE: _e,
1925
+ DIRECTION_LEFT: Ee,
1926
+ DIRECTION_RIGHT: Ce,
1927
+ DIRECTION_UP: Ne,
1928
+ DIRECTION_DOWN: Pe,
1929
+ DIRECTION_HORIZONTAL: oe,
1931
1930
  DIRECTION_VERTICAL: ue,
1932
- DIRECTION_ALL: it,
1933
- Manager: et,
1934
- Input: J,
1935
- TouchAction: Ze,
1936
- TouchInput: Se,
1937
- MouseInput: Ne,
1938
- PointerEventInput: je,
1939
- TouchMouseInput: We,
1940
- SingleTouchInput: vt,
1941
- Recognizer: oe,
1942
- AttrRecognizer: $,
1943
- Tap: Le,
1944
- Pan: De,
1945
- Swipe: $e,
1946
- Pinch: Ke,
1947
- Rotate: Qe,
1948
- Press: Je,
1949
- on: V,
1950
- off: P,
1951
- each: M,
1952
- merge: G,
1953
- extend: F,
1954
- assign: C,
1955
- inherit: O,
1956
- bindFn: z,
1957
- prefixed: le
1958
- }), de;
1959
- }(typeof window != "undefined" ? window : {}, typeof document != "undefined" ? document : {});
1960
- function Ct(u, o, n) {
1961
- var a = o.getBoundingClientRect(), t = a.top, l = a.left, h = a.width, c = a.height;
1962
- return new g.Vector2((u.x - l) / h * 2 - 1, -(u.y - t) / c * 2 + 1);
1931
+ DIRECTION_ALL: De,
1932
+ Manager: yt,
1933
+ Input: re,
1934
+ TouchAction: pt,
1935
+ TouchInput: Ze,
1936
+ MouseInput: qe,
1937
+ PointerEventInput: ut,
1938
+ TouchMouseInput: ht,
1939
+ SingleTouchInput: At,
1940
+ Recognizer: Te,
1941
+ AttrRecognizer: he,
1942
+ Tap: et,
1943
+ Pan: $e,
1944
+ Swipe: gt,
1945
+ Pinch: dt,
1946
+ Rotate: mt,
1947
+ Press: vt,
1948
+ on: N,
1949
+ off: M,
1950
+ each: O,
1951
+ merge: V,
1952
+ extend: k,
1953
+ assign: A,
1954
+ inherit: y,
1955
+ bindFn: T,
1956
+ prefixed: ne
1957
+ }), Le;
1958
+ }(typeof window != "undefined" ? window : {}, typeof document != "undefined" ? document : {}), ze = function(p, o) {
1959
+ o === void 0 && console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'), o === document && console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'), this.object = p, this.domElement = o, this.enabled = !0, this.target = new ve(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !1, this.keyPanSpeed = 7, this.autoRotate = !1, this.autoRotateSpeed = 2, this.enableKeys = !0, this.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 }, this.mouseButtons = { LEFT: Oe.ROTATE, MIDDLE: Oe.DOLLY, RIGHT: Oe.PAN }, this.touches = { ONE: Ae.ROTATE, TWO: Ae.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this.getPolarAngle = function() {
1960
+ return d.phi;
1961
+ }, this.getAzimuthalAngle = function() {
1962
+ return d.theta;
1963
+ }, this.saveState = function() {
1964
+ e.target0.copy(e.target), e.position0.copy(e.object.position), e.zoom0 = e.object.zoom;
1965
+ }, this.reset = function() {
1966
+ e.target.copy(e.target0), e.object.position.copy(e.position0), e.object.zoom = e.zoom0, e.object.updateProjectionMatrix(), e.dispatchEvent(i), e.update(), c = h.NONE;
1967
+ }, this.update = function() {
1968
+ var s = new ve(), L = new Ft().setFromUnitVectors(p.up, new ve(0, 1, 0)), X = L.clone().inverse(), q = new ve(), fe = new Ft();
1969
+ return function() {
1970
+ var ge = e.object.position;
1971
+ return s.copy(ge).sub(e.target), s.applyQuaternion(L), d.setFromVector3(s), e.autoRotate && c === h.NONE && ee($()), e.enableDamping ? (d.theta += m.theta * e.dampingFactor, d.phi += m.phi * e.dampingFactor) : (d.theta += m.theta, d.phi += m.phi), d.theta = Math.max(e.minAzimuthAngle, Math.min(e.maxAzimuthAngle, d.theta)), d.phi = Math.max(e.minPolarAngle, Math.min(e.maxPolarAngle, d.phi)), d.makeSafe(), d.radius *= E, d.radius = Math.max(e.minDistance, Math.min(e.maxDistance, d.radius)), e.enableDamping === !0 ? e.target.addScaledVector(O, e.dampingFactor) : e.target.add(O), s.setFromSpherical(d), s.applyQuaternion(X), ge.copy(e.target).add(s), e.object.lookAt(e.target), e.enableDamping === !0 ? (m.theta *= 1 - e.dampingFactor, m.phi *= 1 - e.dampingFactor, O.multiplyScalar(1 - e.dampingFactor)) : (m.set(0, 0, 0), O.set(0, 0, 0)), E = 1, S || q.distanceToSquared(e.object.position) > g || 8 * (1 - fe.dot(e.object.quaternion)) > g ? (e.dispatchEvent(i), q.copy(e.object.position), fe.copy(e.object.quaternion), S = !1, !0) : !1;
1972
+ };
1973
+ }(), this.dispose = function() {
1974
+ e.domElement.removeEventListener("contextmenu", Ge, !1), e.domElement.removeEventListener("mousedown", Pe, !1), e.domElement.removeEventListener("wheel", De, !1), e.domElement.removeEventListener("touchstart", Ie, !1), e.domElement.removeEventListener("touchend", Xe, !1), e.domElement.removeEventListener("touchmove", re, !1), document.removeEventListener("mousemove", oe, !1), document.removeEventListener("mouseup", ue, !1), e.domElement.removeEventListener("keydown", Re, !1);
1975
+ };
1976
+ var e = this, i = { type: "change" }, t = { type: "start" }, l = { type: "end" }, h = {
1977
+ NONE: -1,
1978
+ ROTATE: 0,
1979
+ DOLLY: 1,
1980
+ PAN: 2,
1981
+ TOUCH_ROTATE: 3,
1982
+ TOUCH_PAN: 4,
1983
+ TOUCH_DOLLY_PAN: 5,
1984
+ TOUCH_DOLLY_ROTATE: 6
1985
+ }, c = h.NONE, g = 1e-6, d = new Ut(), m = new Ut(), E = 1, O = new ve(), S = !1, A = new be(), k = new be(), V = new be(), y = new be(), T = new be(), P = new be(), f = new be(), N = new be(), M = new be();
1986
+ function $() {
1987
+ return 2 * Math.PI / 60 / 60 * e.autoRotateSpeed;
1988
+ }
1989
+ function Z() {
1990
+ return Math.pow(0.95, e.zoomSpeed);
1991
+ }
1992
+ function ee(s) {
1993
+ m.theta -= s;
1994
+ }
1995
+ function le(s) {
1996
+ m.phi -= s;
1997
+ }
1998
+ var me = function() {
1999
+ var s = new ve();
2000
+ return function(X, q) {
2001
+ s.setFromMatrixColumn(q, 0), s.multiplyScalar(-X), O.add(s);
2002
+ };
2003
+ }(), xe = function() {
2004
+ var s = new ve();
2005
+ return function(X, q) {
2006
+ e.screenSpacePanning === !0 ? s.setFromMatrixColumn(q, 1) : (s.setFromMatrixColumn(q, 0), s.crossVectors(e.object.up, s)), s.multiplyScalar(X), O.add(s);
2007
+ };
2008
+ }(), ne = function() {
2009
+ var s = new ve();
2010
+ return function(X, q) {
2011
+ var fe = e.domElement;
2012
+ if (e.object.isPerspectiveCamera) {
2013
+ var Fe = e.object.position;
2014
+ s.copy(Fe).sub(e.target);
2015
+ var ge = s.length();
2016
+ ge *= Math.tan(e.object.fov / 2 * Math.PI / 180), me(2 * X * ge / fe.clientHeight, e.object.matrix), xe(2 * q * ge / fe.clientHeight, e.object.matrix);
2017
+ } else e.object.isOrthographicCamera ? (me(X * (e.object.right - e.object.left) / e.object.zoom / fe.clientWidth, e.object.matrix), xe(q * (e.object.top - e.object.bottom) / e.object.zoom / fe.clientHeight, e.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), e.enablePan = !1);
2018
+ };
2019
+ }();
2020
+ function ie(s) {
2021
+ e.object.isPerspectiveCamera ? E /= s : e.object.isOrthographicCamera ? (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom * s)), e.object.updateProjectionMatrix(), S = !0) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
2022
+ }
2023
+ function D(s) {
2024
+ e.object.isPerspectiveCamera ? E *= s : e.object.isOrthographicCamera ? (e.object.zoom = Math.max(e.minZoom, Math.min(e.maxZoom, e.object.zoom / s)), e.object.updateProjectionMatrix(), S = !0) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), e.enableZoom = !1);
2025
+ }
2026
+ function _(s) {
2027
+ A.set(s.clientX, s.clientY);
2028
+ }
2029
+ function x(s) {
2030
+ f.set(s.clientX, s.clientY);
2031
+ }
2032
+ function R(s) {
2033
+ y.set(s.clientX, s.clientY);
2034
+ }
2035
+ function Y(s) {
2036
+ k.set(s.clientX, s.clientY), V.subVectors(k, A).multiplyScalar(e.rotateSpeed);
2037
+ var L = e.domElement;
2038
+ ee(2 * Math.PI * V.x / L.clientHeight), le(2 * Math.PI * V.y / L.clientHeight), A.copy(k), e.update();
2039
+ }
2040
+ function te(s) {
2041
+ N.set(s.clientX, s.clientY), M.subVectors(N, f), M.y > 0 ? ie(Z()) : M.y < 0 && D(Z()), f.copy(N), e.update();
2042
+ }
2043
+ function j(s) {
2044
+ T.set(s.clientX, s.clientY), P.subVectors(T, y).multiplyScalar(e.panSpeed), ne(P.x, P.y), y.copy(T), e.update();
2045
+ }
2046
+ function F(s) {
2047
+ s.deltaY < 0 ? D(Z()) : s.deltaY > 0 && ie(Z()), e.update();
2048
+ }
2049
+ function W(s) {
2050
+ var L = !1;
2051
+ switch (s.keyCode) {
2052
+ case e.keys.UP:
2053
+ ne(0, e.keyPanSpeed), L = !0;
2054
+ break;
2055
+ case e.keys.BOTTOM:
2056
+ ne(0, -e.keyPanSpeed), L = !0;
2057
+ break;
2058
+ case e.keys.LEFT:
2059
+ ne(e.keyPanSpeed, 0), L = !0;
2060
+ break;
2061
+ case e.keys.RIGHT:
2062
+ ne(-e.keyPanSpeed, 0), L = !0;
2063
+ break;
2064
+ }
2065
+ L && (s.preventDefault(), e.update());
2066
+ }
2067
+ function B(s) {
2068
+ if (s.touches.length == 1)
2069
+ A.set(s.touches[0].pageX, s.touches[0].pageY);
2070
+ else {
2071
+ var L = 0.5 * (s.touches[0].pageX + s.touches[1].pageX), X = 0.5 * (s.touches[0].pageY + s.touches[1].pageY);
2072
+ A.set(L, X);
2073
+ }
2074
+ }
2075
+ function U(s) {
2076
+ if (s.touches.length == 1)
2077
+ y.set(s.touches[0].pageX, s.touches[0].pageY);
2078
+ else {
2079
+ var L = 0.5 * (s.touches[0].pageX + s.touches[1].pageX), X = 0.5 * (s.touches[0].pageY + s.touches[1].pageY);
2080
+ y.set(L, X);
2081
+ }
2082
+ }
2083
+ function I(s) {
2084
+ var L = s.touches[0].pageX - s.touches[1].pageX, X = s.touches[0].pageY - s.touches[1].pageY, q = Math.sqrt(L * L + X * X);
2085
+ f.set(0, q);
2086
+ }
2087
+ function J(s) {
2088
+ e.enableZoom && I(s), e.enablePan && U(s);
2089
+ }
2090
+ function H(s) {
2091
+ e.enableZoom && I(s), e.enableRotate && B(s);
2092
+ }
2093
+ function z(s) {
2094
+ if (s.touches.length == 1)
2095
+ k.set(s.touches[0].pageX, s.touches[0].pageY);
2096
+ else {
2097
+ var L = 0.5 * (s.touches[0].pageX + s.touches[1].pageX), X = 0.5 * (s.touches[0].pageY + s.touches[1].pageY);
2098
+ k.set(L, X);
2099
+ }
2100
+ V.subVectors(k, A).multiplyScalar(e.rotateSpeed);
2101
+ var q = e.domElement;
2102
+ ee(2 * Math.PI * V.x / q.clientHeight), le(2 * Math.PI * V.y / q.clientHeight), A.copy(k);
2103
+ }
2104
+ function _e(s) {
2105
+ if (s.touches.length == 1)
2106
+ T.set(s.touches[0].pageX, s.touches[0].pageY);
2107
+ else {
2108
+ var L = 0.5 * (s.touches[0].pageX + s.touches[1].pageX), X = 0.5 * (s.touches[0].pageY + s.touches[1].pageY);
2109
+ T.set(L, X);
2110
+ }
2111
+ P.subVectors(T, y).multiplyScalar(e.panSpeed), ne(P.x, P.y), y.copy(T);
2112
+ }
2113
+ function Ee(s) {
2114
+ var L = s.touches[0].pageX - s.touches[1].pageX, X = s.touches[0].pageY - s.touches[1].pageY, q = Math.sqrt(L * L + X * X);
2115
+ N.set(0, q), M.set(0, Math.pow(N.y / f.y, e.zoomSpeed)), ie(M.y), f.copy(N);
2116
+ }
2117
+ function Ce(s) {
2118
+ e.enableZoom && Ee(s), e.enablePan && _e(s);
2119
+ }
2120
+ function Ne(s) {
2121
+ e.enableZoom && Ee(s), e.enableRotate && z(s);
2122
+ }
2123
+ function Pe(s) {
2124
+ if (e.enabled !== !1) {
2125
+ s.preventDefault(), e.domElement.focus ? e.domElement.focus() : window.focus();
2126
+ var L;
2127
+ switch (s.button) {
2128
+ case 0:
2129
+ L = e.mouseButtons.LEFT;
2130
+ break;
2131
+ case 1:
2132
+ L = e.mouseButtons.MIDDLE;
2133
+ break;
2134
+ case 2:
2135
+ L = e.mouseButtons.RIGHT;
2136
+ break;
2137
+ default:
2138
+ L = -1;
2139
+ }
2140
+ switch (L) {
2141
+ case Oe.DOLLY:
2142
+ if (e.enableZoom === !1) return;
2143
+ x(s), c = h.DOLLY;
2144
+ break;
2145
+ case Oe.ROTATE:
2146
+ if (s.ctrlKey || s.metaKey || s.shiftKey) {
2147
+ if (e.enablePan === !1) return;
2148
+ R(s), c = h.PAN;
2149
+ } else {
2150
+ if (e.enableRotate === !1) return;
2151
+ _(s), c = h.ROTATE;
2152
+ }
2153
+ break;
2154
+ case Oe.PAN:
2155
+ if (s.ctrlKey || s.metaKey || s.shiftKey) {
2156
+ if (e.enableRotate === !1) return;
2157
+ _(s), c = h.ROTATE;
2158
+ } else {
2159
+ if (e.enablePan === !1) return;
2160
+ R(s), c = h.PAN;
2161
+ }
2162
+ break;
2163
+ default:
2164
+ c = h.NONE;
2165
+ }
2166
+ c !== h.NONE && (document.addEventListener("mousemove", oe, !1), document.addEventListener("mouseup", ue, !1), e.dispatchEvent(t));
2167
+ }
2168
+ }
2169
+ function oe(s) {
2170
+ if (e.enabled !== !1)
2171
+ switch (s.preventDefault(), c) {
2172
+ case h.ROTATE:
2173
+ if (e.enableRotate === !1) return;
2174
+ Y(s);
2175
+ break;
2176
+ case h.DOLLY:
2177
+ if (e.enableZoom === !1) return;
2178
+ te(s);
2179
+ break;
2180
+ case h.PAN:
2181
+ if (e.enablePan === !1) return;
2182
+ j(s);
2183
+ break;
2184
+ }
2185
+ }
2186
+ function ue(s) {
2187
+ e.enabled !== !1 && (document.removeEventListener("mousemove", oe, !1), document.removeEventListener("mouseup", ue, !1), e.dispatchEvent(l), c = h.NONE);
2188
+ }
2189
+ function De(s) {
2190
+ e.enabled === !1 || e.enableZoom === !1 || c !== h.NONE && c !== h.ROTATE || (s.preventDefault(), s.stopPropagation(), e.dispatchEvent(t), F(s), e.dispatchEvent(l));
2191
+ }
2192
+ function Re(s) {
2193
+ e.enabled === !1 || e.enableKeys === !1 || e.enablePan === !1 || W(s);
2194
+ }
2195
+ function Ie(s) {
2196
+ if (e.enabled !== !1) {
2197
+ switch (s.preventDefault(), s.touches.length) {
2198
+ case 1:
2199
+ switch (e.touches.ONE) {
2200
+ case Ae.ROTATE:
2201
+ if (e.enableRotate === !1) return;
2202
+ B(s), c = h.TOUCH_ROTATE;
2203
+ break;
2204
+ case Ae.PAN:
2205
+ if (e.enablePan === !1) return;
2206
+ U(s), c = h.TOUCH_PAN;
2207
+ break;
2208
+ default:
2209
+ c = h.NONE;
2210
+ }
2211
+ break;
2212
+ case 2:
2213
+ switch (e.touches.TWO) {
2214
+ case Ae.DOLLY_PAN:
2215
+ if (e.enableZoom === !1 && e.enablePan === !1) return;
2216
+ J(s), c = h.TOUCH_DOLLY_PAN;
2217
+ break;
2218
+ case Ae.DOLLY_ROTATE:
2219
+ if (e.enableZoom === !1 && e.enableRotate === !1) return;
2220
+ H(s), c = h.TOUCH_DOLLY_ROTATE;
2221
+ break;
2222
+ default:
2223
+ c = h.NONE;
2224
+ }
2225
+ break;
2226
+ default:
2227
+ c = h.NONE;
2228
+ }
2229
+ c !== h.NONE && e.dispatchEvent(t);
2230
+ }
2231
+ }
2232
+ function re(s) {
2233
+ if (e.enabled !== !1)
2234
+ switch (s.preventDefault(), s.stopPropagation(), c) {
2235
+ case h.TOUCH_ROTATE:
2236
+ if (e.enableRotate === !1) return;
2237
+ z(s), e.update();
2238
+ break;
2239
+ case h.TOUCH_PAN:
2240
+ if (e.enablePan === !1) return;
2241
+ _e(s), e.update();
2242
+ break;
2243
+ case h.TOUCH_DOLLY_PAN:
2244
+ if (e.enableZoom === !1 && e.enablePan === !1) return;
2245
+ Ce(s), e.update();
2246
+ break;
2247
+ case h.TOUCH_DOLLY_ROTATE:
2248
+ if (e.enableZoom === !1 && e.enableRotate === !1) return;
2249
+ Ne(s), e.update();
2250
+ break;
2251
+ default:
2252
+ c = h.NONE;
2253
+ }
2254
+ }
2255
+ function Xe(s) {
2256
+ e.enabled !== !1 && (e.dispatchEvent(l), c = h.NONE);
2257
+ }
2258
+ function Ge(s) {
2259
+ e.enabled !== !1 && s.preventDefault();
2260
+ }
2261
+ e.domElement.addEventListener("contextmenu", Ge, !1), e.domElement.addEventListener("mousedown", Pe, !1), e.domElement.addEventListener("wheel", De, !1), e.domElement.addEventListener("touchstart", Ie, !1), e.domElement.addEventListener("touchend", Xe, !1), e.domElement.addEventListener("touchmove", re, !1), e.domElement.addEventListener("keydown", Re, !1), e.domElement.tabIndex === -1 && (e.domElement.tabIndex = 0), this.update();
2262
+ };
2263
+ ze.prototype = Object.create(Ht.prototype);
2264
+ ze.prototype.constructor = ze;
2265
+ var Et = function(p, o) {
2266
+ ze.call(this, p, o), this.mouseButtons.LEFT = Oe.PAN, this.mouseButtons.RIGHT = Oe.ROTATE, this.touches.ONE = Ae.PAN, this.touches.TWO = Ae.DOLLY_ROTATE;
2267
+ };
2268
+ Et.prototype = Object.create(Ht.prototype);
2269
+ Et.prototype.constructor = Et;
2270
+ var we = function(p) {
2271
+ jt.call(this), this.element = p, this.element.style.position = "absolute", this.element.style.pointerEvents = "auto", this.addEventListener("removed", function() {
2272
+ this.traverse(function(o) {
2273
+ o.element instanceof Element && o.element.parentNode !== null && o.element.parentNode.removeChild(o.element);
2274
+ });
2275
+ });
2276
+ };
2277
+ we.prototype = Object.create(jt.prototype);
2278
+ we.prototype.constructor = we;
2279
+ var st = function(p) {
2280
+ we.call(this, p);
2281
+ };
2282
+ st.prototype = Object.create(we.prototype);
2283
+ st.prototype.constructor = st;
2284
+ var Cn = function() {
2285
+ var p = this, o, e, i, t, l = new dn(), h = {
2286
+ camera: { fov: 0, style: "" },
2287
+ objects: /* @__PURE__ */ new WeakMap()
2288
+ }, c = document.createElement("div");
2289
+ c.style.overflow = "hidden", this.domElement = c;
2290
+ var g = document.createElement("div");
2291
+ g.style.WebkitTransformStyle = "preserve-3d", g.style.transformStyle = "preserve-3d", g.style.pointerEvents = "none", c.appendChild(g);
2292
+ var d = /Trident/i.test(navigator.userAgent);
2293
+ this.getSize = function() {
2294
+ return {
2295
+ width: o,
2296
+ height: e
2297
+ };
2298
+ }, this.setSize = function(y, T) {
2299
+ o = y, e = T, i = o / 2, t = e / 2, c.style.width = y + "px", c.style.height = T + "px", g.style.width = y + "px", g.style.height = T + "px";
2300
+ };
2301
+ function m(y) {
2302
+ return Math.abs(y) < 1e-10 ? 0 : y;
2303
+ }
2304
+ function E(y) {
2305
+ var T = y.elements;
2306
+ return "matrix3d(" + m(T[0]) + "," + m(-T[1]) + "," + m(T[2]) + "," + m(T[3]) + "," + m(T[4]) + "," + m(-T[5]) + "," + m(T[6]) + "," + m(T[7]) + "," + m(T[8]) + "," + m(-T[9]) + "," + m(T[10]) + "," + m(T[11]) + "," + m(T[12]) + "," + m(-T[13]) + "," + m(T[14]) + "," + m(T[15]) + ")";
2307
+ }
2308
+ function O(y, T) {
2309
+ var P = y.elements, f = "matrix3d(" + m(P[0]) + "," + m(P[1]) + "," + m(P[2]) + "," + m(P[3]) + "," + m(-P[4]) + "," + m(-P[5]) + "," + m(-P[6]) + "," + m(-P[7]) + "," + m(P[8]) + "," + m(P[9]) + "," + m(P[10]) + "," + m(P[11]) + "," + m(P[12]) + "," + m(P[13]) + "," + m(P[14]) + "," + m(P[15]) + ")";
2310
+ return d ? "translate(-50%,-50%)translate(" + i + "px," + t + "px)" + T + f : "translate(-50%,-50%)" + f;
2311
+ }
2312
+ function S(y, T, P, f) {
2313
+ if (y instanceof we) {
2314
+ y.onBeforeRender(p, T, P);
2315
+ var N;
2316
+ y instanceof st ? (l.copy(P.matrixWorldInverse), l.transpose(), l.copyPosition(y.matrixWorld), l.scale(y.scale), l.elements[3] = 0, l.elements[7] = 0, l.elements[11] = 0, l.elements[15] = 1, N = O(l, f)) : N = O(y.matrixWorld, f);
2317
+ var M = y.element, $ = h.objects.get(y);
2318
+ if ($ === void 0 || $.style !== N) {
2319
+ M.style.WebkitTransform = N, M.style.transform = N;
2320
+ var Z = { style: N };
2321
+ d && (Z.distanceToCameraSquared = A(P, y)), h.objects.set(y, Z);
2322
+ }
2323
+ M.style.display = y.visible ? "" : "none", M.parentNode !== g && g.appendChild(M), y.onAfterRender(p, T, P);
2324
+ }
2325
+ for (var ee = 0, le = y.children.length; ee < le; ee++)
2326
+ S(y.children[ee], T, P, f);
2327
+ }
2328
+ var A = function() {
2329
+ var y = new ve(), T = new ve();
2330
+ return function(P, f) {
2331
+ return y.setFromMatrixPosition(P.matrixWorld), T.setFromMatrixPosition(f.matrixWorld), y.distanceToSquared(T);
2332
+ };
2333
+ }();
2334
+ function k(y) {
2335
+ var T = [];
2336
+ return y.traverse(function(P) {
2337
+ P instanceof we && T.push(P);
2338
+ }), T;
2339
+ }
2340
+ function V(y) {
2341
+ for (var T = k(y).sort(function(M, $) {
2342
+ var Z = h.objects.get(M).distanceToCameraSquared, ee = h.objects.get($).distanceToCameraSquared;
2343
+ return Z - ee;
2344
+ }), P = T.length, f = 0, N = T.length; f < N; f++)
2345
+ T[f].element.style.zIndex = P - f;
2346
+ }
2347
+ this.render = function(y, T) {
2348
+ var P = T.projectionMatrix.elements[5] * t;
2349
+ if (h.camera.fov !== P && (T.isPerspectiveCamera ? (c.style.WebkitPerspective = P + "px", c.style.perspective = P + "px") : (c.style.WebkitPerspective = "", c.style.perspective = ""), h.camera.fov = P), y.autoUpdate === !0 && y.updateMatrixWorld(), T.parent === null && T.updateMatrixWorld(), T.isOrthographicCamera)
2350
+ var f = -(T.right + T.left) / 2, N = (T.top + T.bottom) / 2;
2351
+ var M = T.isOrthographicCamera ? "scale(" + P + ")translate(" + m(f) + "px," + m(N) + "px)" + E(T.matrixWorldInverse) : "translateZ(" + P + "px)" + E(T.matrixWorldInverse), $ = M + "translate(" + i + "px," + t + "px)";
2352
+ h.camera.style !== $ && !d && (g.style.WebkitTransform = $, g.style.transform = $, h.camera.style = $), S(y, y, T, M), d && V(y);
2353
+ };
2354
+ };
2355
+ function Yt(p, o, e) {
2356
+ var i = o.getBoundingClientRect(), t = i.top, l = i.left, h = i.width, c = i.height;
2357
+ return new w.Vector2((p.x - l) / h * 2 - 1, -(p.y - t) / c * 2 + 1);
1963
2358
  }
1964
- var yr = (
2359
+ var Nn = (
1965
2360
  /** @class */
1966
- function(u) {
1967
- Xe(o, u);
1968
- function o(n, a, t, l, h) {
1969
- var c = u.call(this) || this;
1970
- c.type = "RoundedBoxGeometry", h = isNaN(h) ? 1 : Math.max(1, Math.floor(h)), n = isNaN(n) ? 1 : n, a = isNaN(a) ? 1 : a, t = isNaN(t) ? 1 : t, l = isNaN(l) ? 0.15 : l, l = Math.min(l, Math.min(n, Math.min(a, Math.min(t))) / 2);
1971
- var m = n / 2 - l, p = a / 2 - l, y = t / 2 - l;
2361
+ function(p) {
2362
+ lt(o, p);
2363
+ function o(e, i, t, l, h) {
2364
+ var c = p.call(this) || this;
2365
+ c.type = "RoundedBoxGeometry", h = isNaN(h) ? 1 : Math.max(1, Math.floor(h)), e = isNaN(e) ? 1 : e, i = isNaN(i) ? 1 : i, t = isNaN(t) ? 1 : t, l = isNaN(l) ? 0.15 : l, l = Math.min(l, Math.min(e, Math.min(i, Math.min(t))) / 2);
2366
+ var g = e / 2 - l, d = i / 2 - l, m = t / 2 - l;
1972
2367
  c.parameters = {
1973
- width: n,
1974
- height: a,
2368
+ width: e,
2369
+ height: i,
1975
2370
  depth: t,
1976
2371
  radius: l,
1977
2372
  radiusSegments: h
1978
2373
  };
1979
- var T = h + 1, M = T * h + 1 << 3, N = new g.BufferAttribute(new Float32Array(M * 3), 3), C = new g.BufferAttribute(new Float32Array(M * 3), 3), F = [], G = [];
1980
- new g.Vector3();
1981
- var O = new g.Vector3(), z = [], q = [], f = [], V = T * h, P = T * h + 1;
1982
- Ce(), fe(), ie(), se(), Ae(), ve();
1983
- function Ce() {
1984
- for (var A = [
1985
- new g.Vector3(1, 1, 1),
1986
- new g.Vector3(1, 1, -1),
1987
- new g.Vector3(-1, 1, -1),
1988
- new g.Vector3(-1, 1, 1),
1989
- new g.Vector3(1, -1, 1),
1990
- new g.Vector3(1, -1, -1),
1991
- new g.Vector3(-1, -1, -1),
1992
- new g.Vector3(-1, -1, 1)
1993
- ], E = 0; E < 8; E++)
1994
- F.push([]), G.push([]);
1995
- for (var w = Math.PI / 2, x = new g.Vector3(m, p, y), U = 0; U <= h; U++) {
1996
- var Z = U / h, L = Z * w, I = Math.cos(L), Y = Math.sin(L);
1997
- if (U == h) {
1998
- O.set(0, 1, 0);
1999
- var k = O.clone().multiplyScalar(l).add(x);
2000
- F[0].push(k), z.push(k);
2001
- var S = O.clone();
2002
- G[0].push(S), q.push(S);
2374
+ var E = h + 1, O = E * h + 1 << 3, S = new w.BufferAttribute(new Float32Array(O * 3), 3), A = new w.BufferAttribute(new Float32Array(O * 3), 3), k = [], V = [];
2375
+ new w.Vector3();
2376
+ var y = new w.Vector3(), T = [], P = [], f = [], N = E * h, M = E * h + 1;
2377
+ $(), ee(), Z(), le(), xe(), me();
2378
+ function $() {
2379
+ for (var D = [
2380
+ new w.Vector3(1, 1, 1),
2381
+ new w.Vector3(1, 1, -1),
2382
+ new w.Vector3(-1, 1, -1),
2383
+ new w.Vector3(-1, 1, 1),
2384
+ new w.Vector3(1, -1, 1),
2385
+ new w.Vector3(1, -1, -1),
2386
+ new w.Vector3(-1, -1, -1),
2387
+ new w.Vector3(-1, -1, 1)
2388
+ ], _ = 0; _ < 8; _++)
2389
+ k.push([]), V.push([]);
2390
+ for (var x = Math.PI / 2, R = new w.Vector3(g, d, m), Y = 0; Y <= h; Y++) {
2391
+ var te = Y / h, j = te * x, F = Math.cos(j), W = Math.sin(j);
2392
+ if (Y == h) {
2393
+ y.set(0, 1, 0);
2394
+ var B = y.clone().multiplyScalar(l).add(R);
2395
+ k[0].push(B), T.push(B);
2396
+ var U = y.clone();
2397
+ V[0].push(U), P.push(U);
2003
2398
  continue;
2004
2399
  }
2005
- for (var _ = 0; _ <= h; _++) {
2006
- var j = _ / h, D = j * w;
2007
- O.x = I * Math.cos(D), O.y = Y, O.z = I * Math.sin(D);
2008
- var k = O.clone().multiplyScalar(l).add(x);
2009
- F[0].push(k), z.push(k);
2010
- var S = O.clone().normalize();
2011
- G[0].push(S), q.push(S);
2400
+ for (var I = 0; I <= h; I++) {
2401
+ var J = I / h, H = J * x;
2402
+ y.x = F * Math.cos(H), y.y = W, y.z = F * Math.sin(H);
2403
+ var B = y.clone().multiplyScalar(l).add(R);
2404
+ k[0].push(B), T.push(B);
2405
+ var U = y.clone().normalize();
2406
+ V[0].push(U), P.push(U);
2012
2407
  }
2013
2408
  }
2014
- for (var B = 1; B < 8; B++)
2015
- for (var E = 0; E < F[0].length; E++) {
2016
- var k = F[0][E].clone().multiply(A[B]);
2017
- F[B].push(k), z.push(k);
2018
- var S = G[0][E].clone().multiply(A[B]);
2019
- G[B].push(S), q.push(S);
2409
+ for (var z = 1; z < 8; z++)
2410
+ for (var _ = 0; _ < k[0].length; _++) {
2411
+ var B = k[0][_].clone().multiply(D[z]);
2412
+ k[z].push(B), T.push(B);
2413
+ var U = V[0][_].clone().multiply(D[z]);
2414
+ V[z].push(U), P.push(U);
2020
2415
  }
2021
2416
  }
2022
- function ie() {
2023
- for (var A = [
2417
+ function Z() {
2418
+ for (var D = [
2024
2419
  !0,
2025
2420
  !1,
2026
2421
  !0,
@@ -2029,153 +2424,153 @@ var yr = (
2029
2424
  !0,
2030
2425
  !1,
2031
2426
  !0
2032
- ], E = T * (h - 1), w = 0; w < 8; w++) {
2033
- for (var x = P * w, U = 0; U < h - 1; U++)
2034
- for (var Z = U * T, L = (U + 1) * T, I = 0; I < h; I++) {
2035
- var Y = I + 1, k = x + Z + I, S = x + Z + Y, _ = x + L + I, j = x + L + Y;
2036
- A[w] ? (f.push(k), f.push(_), f.push(S), f.push(S), f.push(_), f.push(j)) : (f.push(k), f.push(S), f.push(_), f.push(S), f.push(j), f.push(_));
2427
+ ], _ = E * (h - 1), x = 0; x < 8; x++) {
2428
+ for (var R = M * x, Y = 0; Y < h - 1; Y++)
2429
+ for (var te = Y * E, j = (Y + 1) * E, F = 0; F < h; F++) {
2430
+ var W = F + 1, B = R + te + F, U = R + te + W, I = R + j + F, J = R + j + W;
2431
+ D[x] ? (f.push(B), f.push(I), f.push(U), f.push(U), f.push(I), f.push(J)) : (f.push(B), f.push(U), f.push(I), f.push(U), f.push(J), f.push(I));
2037
2432
  }
2038
- for (var I = 0; I < h; I++) {
2039
- var k = x + E + I, S = x + E + I + 1, _ = x + V;
2040
- A[w] ? (f.push(k), f.push(_), f.push(S)) : (f.push(k), f.push(S), f.push(_));
2433
+ for (var F = 0; F < h; F++) {
2434
+ var B = R + _ + F, U = R + _ + F + 1, I = R + N;
2435
+ D[x] ? (f.push(B), f.push(I), f.push(U)) : (f.push(B), f.push(U), f.push(I));
2041
2436
  }
2042
2437
  }
2043
2438
  }
2044
- function fe() {
2045
- var A = V, E = V + P, w = V + P * 2, x = V + P * 3;
2046
- f.push(A), f.push(E), f.push(w), f.push(A), f.push(w), f.push(x), A = V + P * 4, E = V + P * 5, w = V + P * 6, x = V + P * 7, f.push(A), f.push(w), f.push(E), f.push(A), f.push(x), f.push(w), A = 0, E = P, w = P * 4, x = P * 5, f.push(A), f.push(w), f.push(E), f.push(E), f.push(w), f.push(x), A = P * 2, E = P * 3, w = P * 6, x = P * 7, f.push(A), f.push(w), f.push(E), f.push(E), f.push(w), f.push(x), A = h, E = h + P * 3, w = h + P * 4, x = h + P * 7, f.push(A), f.push(E), f.push(w), f.push(E), f.push(x), f.push(w), A = h + P, E = h + P * 2, w = h + P * 5, x = h + P * 6, f.push(A), f.push(w), f.push(E), f.push(E), f.push(w), f.push(x);
2439
+ function ee() {
2440
+ var D = N, _ = N + M, x = N + M * 2, R = N + M * 3;
2441
+ f.push(D), f.push(_), f.push(x), f.push(D), f.push(x), f.push(R), D = N + M * 4, _ = N + M * 5, x = N + M * 6, R = N + M * 7, f.push(D), f.push(x), f.push(_), f.push(D), f.push(R), f.push(x), D = 0, _ = M, x = M * 4, R = M * 5, f.push(D), f.push(x), f.push(_), f.push(_), f.push(x), f.push(R), D = M * 2, _ = M * 3, x = M * 6, R = M * 7, f.push(D), f.push(x), f.push(_), f.push(_), f.push(x), f.push(R), D = h, _ = h + M * 3, x = h + M * 4, R = h + M * 7, f.push(D), f.push(_), f.push(x), f.push(_), f.push(R), f.push(x), D = h + M, _ = h + M * 2, x = h + M * 5, R = h + M * 6, f.push(D), f.push(x), f.push(_), f.push(_), f.push(x), f.push(R);
2047
2442
  }
2048
- function se() {
2049
- for (var A = 0; A < 4; A++)
2050
- for (var E = A * P, w = 4 * P + E, x = (A & 1) === 1, U = 0; U < h; U++) {
2051
- var Z = U + 1, L = E + U, I = E + Z, Y = w + U, k = w + Z;
2052
- x ? (f.push(L), f.push(Y), f.push(I), f.push(I), f.push(Y), f.push(k)) : (f.push(L), f.push(I), f.push(Y), f.push(I), f.push(k), f.push(Y));
2443
+ function le() {
2444
+ for (var D = 0; D < 4; D++)
2445
+ for (var _ = D * M, x = 4 * M + _, R = (D & 1) === 1, Y = 0; Y < h; Y++) {
2446
+ var te = Y + 1, j = _ + Y, F = _ + te, W = x + Y, B = x + te;
2447
+ R ? (f.push(j), f.push(W), f.push(F), f.push(F), f.push(W), f.push(B)) : (f.push(j), f.push(F), f.push(W), f.push(F), f.push(B), f.push(W));
2053
2448
  }
2054
2449
  }
2055
- function ve() {
2056
- for (var A = [0, 2, 4, 6], E = [1, 3, 5, 7], w = 0; w < 4; w++)
2057
- for (var x = P * A[w], U = P * E[w], Z = 1 >= w, L = 0; L < h; L++) {
2058
- var I = L * T, Y = (L + 1) * T, k = x + I, S = x + Y, _ = U + I, j = U + Y;
2059
- Z ? (f.push(k), f.push(_), f.push(S), f.push(S), f.push(_), f.push(j)) : (f.push(k), f.push(S), f.push(_), f.push(S), f.push(j), f.push(_));
2450
+ function me() {
2451
+ for (var D = [0, 2, 4, 6], _ = [1, 3, 5, 7], x = 0; x < 4; x++)
2452
+ for (var R = M * D[x], Y = M * _[x], te = 1 >= x, j = 0; j < h; j++) {
2453
+ var F = j * E, W = (j + 1) * E, B = R + F, U = R + W, I = Y + F, J = Y + W;
2454
+ te ? (f.push(B), f.push(I), f.push(U), f.push(U), f.push(I), f.push(J)) : (f.push(B), f.push(U), f.push(I), f.push(U), f.push(J), f.push(I));
2060
2455
  }
2061
2456
  }
2062
- function Ae() {
2063
- for (var A = h - 1, E = [0, 1, 4, 5], w = [3, 2, 7, 6], x = [0, 1, 1, 0], U = 0; U < 4; U++)
2064
- for (var Z = E[U] * P, L = w[U] * P, I = 0; I <= A; I++) {
2065
- var Y = Z + h + I * T, k = Z + (I != A ? h + (I + 1) * T : P - 1), S = L + h + I * T, _ = L + (I != A ? h + (I + 1) * T : P - 1);
2066
- x[U] ? (f.push(Y), f.push(S), f.push(k), f.push(k), f.push(S), f.push(_)) : (f.push(Y), f.push(k), f.push(S), f.push(k), f.push(_), f.push(S));
2457
+ function xe() {
2458
+ for (var D = h - 1, _ = [0, 1, 4, 5], x = [3, 2, 7, 6], R = [0, 1, 1, 0], Y = 0; Y < 4; Y++)
2459
+ for (var te = _[Y] * M, j = x[Y] * M, F = 0; F <= D; F++) {
2460
+ var W = te + h + F * E, B = te + (F != D ? h + (F + 1) * E : M - 1), U = j + h + F * E, I = j + (F != D ? h + (F + 1) * E : M - 1);
2461
+ R[Y] ? (f.push(W), f.push(U), f.push(B), f.push(B), f.push(U), f.push(I)) : (f.push(W), f.push(B), f.push(U), f.push(B), f.push(I), f.push(U));
2067
2462
  }
2068
2463
  }
2069
- for (var le = 0, ee = 0; ee < z.length; ee++)
2070
- N.setXYZ(le, z[ee].x, z[ee].y, z[ee].z), C.setXYZ(le, q[ee].x, q[ee].y, q[ee].z), le++;
2071
- return c.setIndex(new g.BufferAttribute(new Uint16Array(f), 1)), c.setAttribute("position", N), c.setAttribute("normal", C), c;
2464
+ for (var ne = 0, ie = 0; ie < T.length; ie++)
2465
+ S.setXYZ(ne, T[ie].x, T[ie].y, T[ie].z), A.setXYZ(ne, P[ie].x, P[ie].y, P[ie].z), ne++;
2466
+ return c.setIndex(new w.BufferAttribute(new Uint16Array(f), 1)), c.setAttribute("position", S), c.setAttribute("normal", A), c;
2072
2467
  }
2073
2468
  return o;
2074
- }(g.BufferGeometry)
2469
+ }(w.BufferGeometry)
2075
2470
  );
2076
- function Pe(u, o) {
2077
- return typeof u != "number" || typeof o != "number" ? !1 : Math.abs(u - o) < 1e-3;
2471
+ function Ye(p, o) {
2472
+ return typeof p != "number" || typeof o != "number" ? !1 : Math.abs(p - o) < 1e-3;
2078
2473
  }
2079
- function _e(u, o, n, a) {
2080
- a === void 0 && (a = function(l) {
2474
+ function He(p, o, e, i) {
2475
+ i === void 0 && (i = function(l) {
2081
2476
  return l;
2082
2477
  });
2083
- var t = a(n);
2084
- return u * (1 - t) + o * t;
2478
+ var t = i(e);
2479
+ return p * (1 - t) + o * t;
2085
2480
  }
2086
- var X = Number((Math.PI / 2).toFixed(5));
2087
- function Tr(u, o, n) {
2088
- var a = new g.Shape();
2089
- return a.moveTo(n, 0), a.lineTo(u - n, 0), a.absarc(u - n, n, n, -X, 0, !1), a.lineTo(u, o - n), a.absarc(u - n, o - n, n, 0, X, !1), a.lineTo(n, o), a.absarc(n, o - n, n, X, Math.PI, !1), a.lineTo(0, n), a.absarc(n, n, n, Math.PI, Math.PI * 1.5, !1), a;
2481
+ var Q = Number((Math.PI / 2).toFixed(5));
2482
+ function In(p, o, e) {
2483
+ var i = new w.Shape();
2484
+ return i.moveTo(e, 0), i.lineTo(p - e, 0), i.absarc(p - e, e, e, -Q, 0, !1), i.lineTo(p, o - e), i.absarc(p - e, o - e, e, 0, Q, !1), i.lineTo(e, o), i.absarc(e, o - e, e, Q, Math.PI, !1), i.lineTo(0, e), i.absarc(e, e, e, Math.PI, Math.PI * 1.5, !1), i;
2090
2485
  }
2091
- var Me = function(u) {
2486
+ var je = function(p) {
2092
2487
  var o = document.createElement("div");
2093
- o.innerText = u;
2094
- var n = new At(o);
2095
- return n.name = u, n.scale.set(0.3, 0.3, 0.3), o.style.pointerEvents = "none", o.style.backfaceVisibility = "hidden", n;
2096
- }, Re = function(u) {
2097
- var o = new g.PlaneGeometry(5, 5), n = new g.MeshBasicMaterial({
2488
+ o.innerText = p;
2489
+ var e = new we(o);
2490
+ return e.name = p, e.scale.set(0.3, 0.3, 0.3), o.style.pointerEvents = "none", o.style.backfaceVisibility = "hidden", e;
2491
+ }, tt = function(p) {
2492
+ var o = new w.PlaneGeometry(5, 5), e = new w.MeshBasicMaterial({
2098
2493
  transparent: !0,
2099
2494
  opacity: 0
2100
- }), a = new g.Mesh(o, n), t = document.createElement("div");
2101
- t.innerText = u;
2102
- var l = new At(t);
2103
- return l.name = u, l.scale.set(0.3, 0.3, 0.3), t.style.color = "#ffffff", t.style.opacity = "0.5", t.style.pointerEvents = "none", t.style.backfaceVisibility = "hidden", a.rotateX(-X), a.add(l), a;
2104
- }, wr = (
2495
+ }), i = new w.Mesh(o, e), t = document.createElement("div");
2496
+ t.innerText = p;
2497
+ var l = new we(t);
2498
+ return l.name = p, l.scale.set(0.3, 0.3, 0.3), t.style.color = "#ffffff", t.style.opacity = "0.5", t.style.pointerEvents = "none", t.style.backfaceVisibility = "hidden", i.rotateX(-Q), i.add(l), i;
2499
+ }, Sn = (
2105
2500
  /** @class */
2106
- function(u) {
2107
- Xe(o, u);
2108
- function o(n, a) {
2109
- var t = u.call(this, n) || this;
2110
- t.camera = new tr(90), t.scene = new g.Scene(), t.renderer = new g.WebGLRenderer({ antialias: !0, alpha: !0 }), t.css3drenderer = new nr(), t.ambientLight = new g.AmbientLight(16777215, 0.7), t.wrapper = document.createElement("div"), t.arrows = document.createElement("div"), t.arrowLeft = document.createElement("div"), t.arrowRight = document.createElement("div"), t.arrowFront = document.createElement("div"), t.arrowBack = document.createElement("div"), t.arrowTop = document.createElement("div"), t.arrowBottom = document.createElement("div"), t.spherical = null, t.dragging = !1, t.style = document.createElement("style"), t.directionalLight = new g.DirectionalLight(16777215, 0.2), t.box = new g.Mesh(new yr(8, 8, 8, 0.5, 20), new g.MeshPhongMaterial({ color: 16777215 })), t.faces = new g.Group(), t.orient = function(c) {
2111
- var m = c.longitude, p = c.latitude;
2501
+ function(p) {
2502
+ lt(o, p);
2503
+ function o(e, i) {
2504
+ var t = p.call(this, e) || this;
2505
+ t.camera = new pn(90), t.scene = new w.Scene(), t.renderer = new w.WebGLRenderer({ antialias: !0, alpha: !0 }), t.css3drenderer = new Cn(), t.ambientLight = new w.AmbientLight(16777215, 0.7), t.wrapper = document.createElement("div"), t.arrows = document.createElement("div"), t.arrowLeft = document.createElement("div"), t.arrowRight = document.createElement("div"), t.arrowFront = document.createElement("div"), t.arrowBack = document.createElement("div"), t.arrowTop = document.createElement("div"), t.arrowBottom = document.createElement("div"), t.spherical = null, t.dragging = !1, t.style = document.createElement("style"), t.directionalLight = new w.DirectionalLight(16777215, 0.2), t.box = new w.Mesh(new Nn(8, 8, 8, 0.5, 20), new w.MeshPhongMaterial({ color: 16777215 })), t.faces = new w.Group(), t.orient = function(c) {
2506
+ var g = c.longitude, d = c.latitude;
2112
2507
  t.dragging = !1, t.spherical = null, t.controls.enableDamping = !1, t.five.setState(Object.assign({
2113
- latitude: p
2114
- }, m !== void 0 ? {
2115
- longitude: m + t.config.fixedLongitude
2508
+ latitude: d
2509
+ }, g !== void 0 ? {
2510
+ longitude: g + t.config.fixedLongitude
2116
2511
  } : {})), t.five.ready().then(function() {
2117
2512
  t.controls.enableDamping = !0, t.setState({ arrowsVisible: !0 });
2118
2513
  });
2119
2514
  }, t.onRenderFrame = function() {
2120
- var c, m, p, y, T;
2515
+ var c, g, d, m, E;
2121
2516
  if (t.renderer.render(t.scene, t.camera), t.css3drenderer.render(t.scene, t.camera), t.directionalLight.position.copy(t.camera.position), (c = t.controls) === null || c === void 0 || c.update(), t.dragging) {
2122
2517
  t.camera.computePose(), t.updateByCamera();
2123
- var M = t.camera.pose, N = M.longitude, C = M.latitude;
2124
- t.five.setState({ longitude: N, latitude: C }, !0), t.updateArrows({ longitude: N, latitude: C });
2125
- } else if (t.spherical && (!Pe(t.spherical.pi, (m = t.controls) === null || m === void 0 ? void 0 : m.getPolarAngle()) || !Pe(t.spherical.theta, (p = t.controls) === null || p === void 0 ? void 0 : p.getAzimuthalAngle()))) {
2126
- t.spherical = { pi: (y = t.controls) === null || y === void 0 ? void 0 : y.getPolarAngle(), theta: (T = t.controls) === null || T === void 0 ? void 0 : T.getAzimuthalAngle() }, t.camera.computePose(), t.updateByCamera();
2127
- var F = t.camera.pose, N = F.longitude, C = F.latitude;
2128
- t.five.setState({ longitude: N, latitude: C }, !0), t.updateArrows({ longitude: N, latitude: C });
2518
+ var O = t.camera.pose, S = O.longitude, A = O.latitude;
2519
+ t.five.setState({ longitude: S, latitude: A }, !0), t.updateArrows({ longitude: S, latitude: A });
2520
+ } else if (t.spherical && (!Ye(t.spherical.pi, (g = t.controls) === null || g === void 0 ? void 0 : g.getPolarAngle()) || !Ye(t.spherical.theta, (d = t.controls) === null || d === void 0 ? void 0 : d.getAzimuthalAngle()))) {
2521
+ t.spherical = { pi: (m = t.controls) === null || m === void 0 ? void 0 : m.getPolarAngle(), theta: (E = t.controls) === null || E === void 0 ? void 0 : E.getAzimuthalAngle() }, t.camera.computePose(), t.updateByCamera();
2522
+ var k = t.camera.pose, S = k.longitude, A = k.latitude;
2523
+ t.five.setState({ longitude: S, latitude: A }, !0), t.updateArrows({ longitude: S, latitude: A });
2129
2524
  } else
2130
2525
  t.spherical = null;
2131
2526
  }, t.onTapGesture = function(c) {
2132
- var m = c.pointers[0].clientX, p = c.pointers[0].clientY, y = Ct({ x: m, y: p }, t.wrapper), T = new g.Raycaster();
2133
- T.setFromCamera(y, t.camera);
2134
- var M = T.intersectObjects(t.faces.children, !1)[0];
2135
- if (M) {
2136
- var N = M.object.userData, C = N.longitude, F = N.latitude;
2137
- t.orient({ longitude: C, latitude: F });
2527
+ var g = c.pointers[0].clientX, d = c.pointers[0].clientY, m = Yt({ x: g, y: d }, t.wrapper), E = new w.Raycaster();
2528
+ E.setFromCamera(m, t.camera);
2529
+ var O = E.intersectObjects(t.faces.children, !1)[0];
2530
+ if (O) {
2531
+ var S = O.object.userData, A = S.longitude, k = S.latitude;
2532
+ t.orient({ longitude: A, latitude: k });
2138
2533
  }
2139
2534
  }, t.onFiveWantsGesture = function() {
2140
2535
  if (t.spherical)
2141
2536
  return !1;
2142
2537
  }, t.onFiveModeChange = function(c) {
2143
- t.controls && (t.controls.maxPolarAngle = c === "Topview" ? 0 : X);
2538
+ t.controls && (t.controls.maxPolarAngle = c === "Topview" ? 0 : Q);
2144
2539
  }, t.onCameraUpdate = function(c) {
2145
- var m = c.state;
2540
+ var g = c.state;
2146
2541
  if (!t.dragging && !t.spherical) {
2147
- var p = m.longitude, y = m.latitude;
2148
- t.camera.pose.longitude === p && t.camera.pose.latitude === y || (t.camera.setFromPose({ longitude: p, latitude: y, distance: 20, offset: new g.Vector3(0, 0, 0) }), t.updateByCamera(), t.updateArrows({ longitude: p, latitude: y }));
2542
+ var d = g.longitude, m = g.latitude;
2543
+ t.camera.pose.longitude === d && t.camera.pose.latitude === m || (t.camera.setFromPose({ longitude: d, latitude: m, distance: 20, offset: new w.Vector3(0, 0, 0) }), t.updateByCamera(), t.updateArrows({ longitude: d, latitude: m }));
2149
2544
  }
2150
2545
  }, t.onPanStart = function(c) {
2151
2546
  t.dragging = !0, t.spherical = {};
2152
2547
  }, t.onMouseMove = function(c) {
2153
2548
  if (!t.dragging) {
2154
- var m = Ct({ x: c.clientX, y: c.clientY }, t.wrapper), p = new g.Raycaster();
2155
- p.setFromCamera(m, t.camera);
2156
- var y = p.intersectObjects(t.faces.children, !1)[0];
2157
- t.faces.children.forEach(function(T) {
2158
- T.material.opacity = 0, T.children[0].element.style.color = "";
2159
- }), y && (y.object.material.opacity = 0.3, y.object.children[0].element.style.color = "#336dff");
2549
+ var g = Yt({ x: c.clientX, y: c.clientY }, t.wrapper), d = new w.Raycaster();
2550
+ d.setFromCamera(g, t.camera);
2551
+ var m = d.intersectObjects(t.faces.children, !1)[0];
2552
+ t.faces.children.forEach(function(E) {
2553
+ E.material.opacity = 0, E.children[0].element.style.color = "";
2554
+ }), m && (m.object.material.opacity = 0.3, m.object.children[0].element.style.color = "#336dff");
2160
2555
  }
2161
2556
  }, t.onPanEnd = function(c) {
2162
2557
  t.dragging = !1, t.spherical = { pi: t.controls.getPolarAngle(), theta: t.controls.getAzimuthalAngle() };
2163
2558
  }, t.dispose = function() {
2164
2559
  t.disable();
2165
- }, t.five = n;
2560
+ }, t.five = e;
2166
2561
  var l = {
2167
2562
  enabled: !1,
2168
2563
  visible: !0,
2169
2564
  arrowsVisible: !1
2170
2565
  };
2171
- t.state = Object.assign(l, a == null ? void 0 : a.initialState);
2172
- var h = W({ fixedLongitude: 0, orthoView: !0 }, a == null ? void 0 : a.config);
2173
- return t._config = h, t.state.enabled && t._enable({ userAction: !1 }), t.mc = new rt.Manager(t.wrapper), t.mc.add(new rt.Tap({ interval: 410 })), t.mc.add(new rt.Pan({ threshold: 10, pointers: 0 })), t.camera.setFromPose({
2566
+ t.state = Object.assign(l, i == null ? void 0 : i.initialState);
2567
+ var h = ae({ fixedLongitude: 0, orthoView: !0 }, i == null ? void 0 : i.config);
2568
+ return t._config = h, t.state.enabled && t._enable({ userAction: !1 }), t.mc = new bt.Manager(t.wrapper), t.mc.add(new bt.Tap({ interval: 410 })), t.mc.add(new bt.Pan({ threshold: 10, pointers: 0 })), t.camera.setFromPose({
2174
2569
  distance: 20,
2175
- offset: new g.Vector3(0, 0, 0),
2176
- longitude: n.camera.pose.latitude,
2177
- latitude: n.camera.pose.latitude
2178
- }), t.cylinder = new g.Mesh(new g.CylinderGeometry(13.2, 14, 0.01, 50, 1, !0), new g.ShaderMaterial({
2570
+ offset: new w.Vector3(0, 0, 0),
2571
+ longitude: e.camera.pose.latitude,
2572
+ latitude: e.camera.pose.latitude
2573
+ }), t.cylinder = new w.Mesh(new w.CylinderGeometry(13.2, 14, 0.01, 50, 1, !0), new w.ShaderMaterial({
2179
2574
  uniforms: {
2180
2575
  radiusTop: { value: 13.2 },
2181
2576
  radiusBottom: { value: 14 },
@@ -2224,31 +2619,31 @@ var Me = function(u) {
2224
2619
  }
2225
2620
  return Object.defineProperty(o.prototype, "config", {
2226
2621
  get: function() {
2227
- return W({}, this._config);
2622
+ return ae({}, this._config);
2228
2623
  },
2229
2624
  enumerable: !1,
2230
2625
  configurable: !0
2231
- }), o.prototype.updateState = function(n, a) {
2626
+ }), o.prototype.updateState = function(e, i) {
2232
2627
  var t = this.state;
2233
- this.state = W(W({}, this.state), n), typeof n.arrowsVisible == "boolean" && this.handleArrowsVisible(n.arrowsVisible), this.hooks.emit("stateChange", { state: this.state, prevState: t, userAction: a });
2234
- }, o.prototype.appendTo = function(n) {
2235
- if (n) {
2236
- n.appendChild(this.wrapper);
2237
- var a = this.wrapper.getBoundingClientRect(), t = a.width, l = a.height;
2628
+ this.state = ae(ae({}, this.state), e), typeof e.arrowsVisible == "boolean" && this.handleArrowsVisible(e.arrowsVisible), this.hooks.emit("stateChange", { state: this.state, prevState: t, userAction: i });
2629
+ }, o.prototype.appendTo = function(e) {
2630
+ if (e) {
2631
+ e.appendChild(this.wrapper);
2632
+ var i = this.wrapper.getBoundingClientRect(), t = i.width, l = i.height;
2238
2633
  this.renderer.setSize(t, l), this.css3drenderer.setSize(t, l);
2239
2634
  }
2240
2635
  }, o.prototype.init = function() {
2241
2636
  this.renderer.setClearAlpha(0), this.renderer.domElement.style.outline = "none", this.initDom(), this.initFaces(), this.initControls(), this.initLights();
2242
- var n = this.cylinder;
2243
- n.position.y = -3;
2244
- var a = Re("西");
2245
- a.position.set(-19, 0, 0), n.add(a);
2246
- var t = Re("东");
2247
- t.position.set(19, 0, 0), n.add(t);
2248
- var l = Re("北");
2249
- l.position.set(0, 0, -19), n.add(l);
2250
- var h = Re("南");
2251
- h.position.set(0, 0, 19), n.add(h), this.updateByCamera(), this.scene.add(n, this.box, this.faces), this.scene.rotation.y = this.config.fixedLongitude;
2637
+ var e = this.cylinder;
2638
+ e.position.y = -3;
2639
+ var i = tt("西");
2640
+ i.position.set(-19, 0, 0), e.add(i);
2641
+ var t = tt("东");
2642
+ t.position.set(19, 0, 0), e.add(t);
2643
+ var l = tt("北");
2644
+ l.position.set(0, 0, -19), e.add(l);
2645
+ var h = tt("南");
2646
+ h.position.set(0, 0, 19), e.add(h), this.updateByCamera(), this.scene.add(e, this.box, this.faces), this.scene.rotation.y = this.config.fixedLongitude;
2252
2647
  }, o.prototype.initDom = function() {
2253
2648
  this.style.innerHTML = `
2254
2649
  .OrientationPlugin .OrientationArrows {
@@ -2352,61 +2747,61 @@ var Me = function(u) {
2352
2747
  }
2353
2748
  `, this.wrapper.className = "OrientationPlugin", this.arrows.className = "OrientationArrows", this.wrapper.style.cssText = "position: relative; width: 100%; height: 100%", this.wrapper.appendChild(this.arrows), this.arrowLeft.className = this.arrowRight.className = this.arrowTop.className = this.arrowBack.className = this.arrowFront.className = "OrientationArrow", this.arrowBottom.className = "OrientationArrow disabled", this.arrowBack.innerText = "后", this.arrowFront.innerText = "前", this.arrowLeft.innerText = "左", this.arrowRight.innerText = "右", this.arrowTop.innerText = "上", this.arrowBottom.innerText = "下", this.css3drenderer.domElement.style.cssText = "position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; color: #00000090;";
2354
2749
  }, o.prototype.bindEvents = function() {
2355
- var n = this;
2750
+ var e = this;
2356
2751
  this.five.on("renderFrame", this.onRenderFrame), this.five.on("camera.update", this.onCameraUpdate), this.five.on("wantsGesture", this.onFiveWantsGesture), this.five.on("modeChange", this.onFiveModeChange), this.mc.on("tap", this.onTapGesture), this.mc.on("panstart", this.onPanStart), this.mc.on("panend", this.onPanEnd), this.wrapper.addEventListener("mousemove", this.onMouseMove), this.arrowTop.onclick = function() {
2357
- return n.orient({ longitude: 0, latitude: X });
2752
+ return e.orient({ longitude: 0, latitude: Q });
2358
2753
  }, this.arrowLeft.onclick = function() {
2359
- return n.orient({ longitude: -X, latitude: 0 });
2754
+ return e.orient({ longitude: -Q, latitude: 0 });
2360
2755
  }, this.arrowRight.onclick = function() {
2361
- return n.orient({ longitude: X, latitude: 0 });
2756
+ return e.orient({ longitude: Q, latitude: 0 });
2362
2757
  }, this.arrowFront.onclick = function() {
2363
- return n.orient({ longitude: 0, latitude: 0 });
2758
+ return e.orient({ longitude: 0, latitude: 0 });
2364
2759
  }, this.arrowBack.onclick = function() {
2365
- return n.orient({ longitude: Math.PI, latitude: 0 });
2760
+ return e.orient({ longitude: Math.PI, latitude: 0 });
2366
2761
  };
2367
2762
  }, o.prototype.unbindEvents = function() {
2368
2763
  this.five.off("renderFrame", this.onRenderFrame), this.five.off("camera.update", this.onCameraUpdate), this.five.off("wantsGesture", this.onFiveWantsGesture), this.five.off("modeChange", this.onFiveModeChange), this.mc.off("tap", this.onTapGesture), this.mc.off("panstart", this.onPanStart), this.mc.off("panend", this.onPanEnd), this.wrapper.removeEventListener("mousemove", this.onMouseMove), this.arrowTop.onclick = null, this.arrowLeft.onclick = null, this.arrowRight.onclick = null, this.arrowFront.onclick = null, this.arrowBack.onclick = null;
2369
2764
  }, o.prototype.updateByCamera = function() {
2370
- var n = _e(0.2, 1, this.camera.pose.latitude / Math.PI * 2, function(c) {
2765
+ var e = He(0.2, 1, this.camera.pose.latitude / Math.PI * 2, function(c) {
2371
2766
  return c * c;
2372
- }), a = _e(11, 13, this.camera.pose.latitude / Math.PI * 2, function(c) {
2767
+ }), i = He(11, 13, this.camera.pose.latitude / Math.PI * 2, function(c) {
2373
2768
  return c * c;
2374
- }), t = _e(12, 15, this.camera.pose.latitude / Math.PI * 2, function(c) {
2769
+ }), t = He(12, 15, this.camera.pose.latitude / Math.PI * 2, function(c) {
2375
2770
  return c * c;
2376
- }), l = _e(13, 19, this.camera.pose.latitude / Math.PI * 2, function(c) {
2771
+ }), l = He(13, 19, this.camera.pose.latitude / Math.PI * 2, function(c) {
2377
2772
  return c * c;
2378
- }), h = _e(-0.2, 0.5, this.camera.pose.latitude / Math.PI * 2, function(c) {
2773
+ }), h = He(-0.2, 0.5, this.camera.pose.latitude / Math.PI * 2, function(c) {
2379
2774
  return c * c;
2380
2775
  });
2381
- this.cylinder.geometry = new g.CylinderGeometry(a, t, 0.01, 50, 1, !0), this.cylinder.material.uniforms.radiusTop.value = a, this.cylinder.material.uniforms.radiusBottom.value = t, this.cylinder.material.needsUpdate = !0, this.cylinder.children.forEach(function(c) {
2382
- c.position.normalize().multiplyScalar(l), c.scale.set(n, n, n);
2383
- var m = c.children[0];
2384
- m && (m.element.style.opacity = h.toString());
2776
+ this.cylinder.geometry = new w.CylinderGeometry(i, t, 0.01, 50, 1, !0), this.cylinder.material.uniforms.radiusTop.value = i, this.cylinder.material.uniforms.radiusBottom.value = t, this.cylinder.material.needsUpdate = !0, this.cylinder.children.forEach(function(c) {
2777
+ c.position.normalize().multiplyScalar(l), c.scale.set(e, e, e);
2778
+ var g = c.children[0];
2779
+ g && (g.element.style.opacity = h.toString());
2385
2780
  });
2386
- }, o.prototype.updateArrows = function(n) {
2387
- n.longitude;
2388
- var a = n.latitude, t = X - a < 0.02;
2781
+ }, o.prototype.updateArrows = function(e) {
2782
+ e.longitude;
2783
+ var i = e.latitude, t = Q - i < 0.02;
2389
2784
  this.setState({ arrowsVisible: t });
2390
- }, o.prototype.handleArrowsVisible = function(n) {
2391
- var a = this;
2785
+ }, o.prototype.handleArrowsVisible = function(e) {
2786
+ var i = this;
2392
2787
  if (this.state.enabled)
2393
- if (this.cylinder.material.uniforms.opacity.value = n ? 0.4 : 1, this.cylinder.material.needsUpdate = !0, n) {
2788
+ if (this.cylinder.material.uniforms.opacity.value = e ? 0.4 : 1, this.cylinder.material.needsUpdate = !0, e) {
2394
2789
  var t = this.five.getCurrentState(), l = t.longitude, h = t.latitude;
2395
- if (X - h < 0.03)
2790
+ if (Q - h < 0.03)
2396
2791
  this.five.state.mode === "Topview" || this.five.state.mode === "Mapview" ? (this.faces.getObjectByName("上").element.className = "active", this.arrows.innerHTML = "", this.arrows.appendChild(this.arrowBack), this.arrows.appendChild(this.arrowLeft), this.arrows.appendChild(this.arrowRight), this.arrows.appendChild(this.arrowFront), this.arrows.style.transform = "rotate(".concat((l - this.config.fixedLongitude) / Math.PI * 180, "deg)")) : (this.arrows.innerHTML = "", this.faces.getObjectByName("上").element.className = "");
2397
2792
  else {
2398
2793
  switch (this.arrows.innerHTML = "", this.arrows.appendChild(this.arrowTop), this.config.orthoView && this.five.ready().then(function() {
2399
- a.five.controller.cameraType = "orthographic", a.five.ready().then(function() {
2400
- return a.five.controller.cameraMotion.ended = !1;
2794
+ i.five.controller.cameraType = "orthographic", i.five.ready().then(function() {
2795
+ return i.five.controller.cameraMotion.ended = !1;
2401
2796
  });
2402
2797
  }), !0) {
2403
- case Pe(0, l - this.config.fixedLongitude):
2798
+ case Ye(0, l - this.config.fixedLongitude):
2404
2799
  this.arrows.appendChild(this.arrowLeft), this.arrows.appendChild(this.arrowRight), this.arrows.appendChild(this.arrowBottom), this.faces.getObjectByName("前").element.className = "active";
2405
2800
  break;
2406
- case Pe(X, l - this.config.fixedLongitude):
2801
+ case Ye(Q, l - this.config.fixedLongitude):
2407
2802
  this.arrows.appendChild(this.arrowFront), this.arrows.appendChild(this.arrowBack), this.arrows.appendChild(this.arrowBottom), this.faces.getObjectByName("右").element.className = "active";
2408
2803
  break;
2409
- case Pe(Math.PI, l - this.config.fixedLongitude):
2804
+ case Ye(Math.PI, l - this.config.fixedLongitude):
2410
2805
  this.arrows.appendChild(this.arrowRight), this.arrows.appendChild(this.arrowLeft), this.arrows.appendChild(this.arrowBottom), this.faces.getObjectByName("后").element.className = "active";
2411
2806
  break;
2412
2807
  default:
@@ -2418,71 +2813,71 @@ var Me = function(u) {
2418
2813
  this.arrows.style.display = "block";
2419
2814
  } else
2420
2815
  this.config.orthoView && (this.five.controller.cameraType = "auto", this.five.ready().then(function() {
2421
- return a.five.controller.cameraMotion.ended = !1;
2816
+ return i.five.controller.cameraMotion.ended = !1;
2422
2817
  })), this.arrows.style.display = "none", this.faces.children.forEach(function(c) {
2423
2818
  c.children[0].element.className = "";
2424
2819
  });
2425
- }, o.prototype.setState = function(n, a) {
2426
- a === void 0 && (a = {});
2427
- var t = this.state, l = a.userAction !== void 0 ? a.userAction : !0;
2428
- if (this.updateState(n, l), n.enabled !== void 0 && t.enabled !== n.enabled) {
2820
+ }, o.prototype.setState = function(e, i) {
2821
+ i === void 0 && (i = {});
2822
+ var t = this.state, l = i.userAction !== void 0 ? i.userAction : !0;
2823
+ if (this.updateState(e, l), e.enabled !== void 0 && t.enabled !== e.enabled) {
2429
2824
  var h = { userAction: l };
2430
- n.enabled ? this._enable(h) : this._disable(h);
2825
+ e.enabled ? this._enable(h) : this._disable(h);
2431
2826
  }
2432
2827
  }, o.prototype.initLights = function() {
2433
2828
  this.directionalLight.target = this.box, this.scene.add(this.ambientLight, this.directionalLight);
2434
2829
  }, o.prototype.initFaces = function() {
2435
- var n = Tr(7, 7, 0.5), a = new g.ShapeGeometry(n);
2436
- a.translate(-3.5, -3.5, 0);
2437
- var t = new g.Mesh(a, new g.MeshBasicMaterial({ transparent: !0, color: 3370495, opacity: 0 }));
2438
- t.userData = { longitude: 0, latitude: 0 }, t.position.z = 4.1, t.add(Me("前"));
2439
- var l = new g.Mesh(a, new g.MeshBasicMaterial({ transparent: !0, color: 3370495, opacity: 0 }));
2440
- l.rotateY(Math.PI), l.position.z = -4.1, l.add(Me("后")), l.userData = { longitude: Math.PI, latitude: 0 };
2441
- var h = new g.Mesh(a, new g.MeshBasicMaterial({ transparent: !0, color: 3370495, opacity: 0 }));
2442
- h.rotateY(X), h.position.x = 4.1, h.add(Me("右")), h.userData = { longitude: X, latitude: 0 };
2443
- var c = new g.Mesh(a, new g.MeshBasicMaterial({ transparent: !0, color: 3370495, opacity: 0 }));
2444
- c.rotateY(-X), c.position.x = -4.1, c.add(Me("左")), c.userData = { longitude: -X, latitude: 0 };
2445
- var m = new g.Mesh(a, new g.MeshBasicMaterial({ transparent: !0, color: 3370495, opacity: 0 }));
2446
- m.rotateX(-X), m.position.y = 4.1, m.add(Me("上")), m.userData = { longitude: 0, latitude: X }, this.faces.add(t, l, c, h, m);
2830
+ var e = In(7, 7, 0.5), i = new w.ShapeGeometry(e);
2831
+ i.translate(-3.5, -3.5, 0);
2832
+ var t = new w.Mesh(i, new w.MeshBasicMaterial({ transparent: !0, color: 3370495, opacity: 0 }));
2833
+ t.userData = { longitude: 0, latitude: 0 }, t.position.z = 4.1, t.add(je("前"));
2834
+ var l = new w.Mesh(i, new w.MeshBasicMaterial({ transparent: !0, color: 3370495, opacity: 0 }));
2835
+ l.rotateY(Math.PI), l.position.z = -4.1, l.add(je("后")), l.userData = { longitude: Math.PI, latitude: 0 };
2836
+ var h = new w.Mesh(i, new w.MeshBasicMaterial({ transparent: !0, color: 3370495, opacity: 0 }));
2837
+ h.rotateY(Q), h.position.x = 4.1, h.add(je("右")), h.userData = { longitude: Q, latitude: 0 };
2838
+ var c = new w.Mesh(i, new w.MeshBasicMaterial({ transparent: !0, color: 3370495, opacity: 0 }));
2839
+ c.rotateY(-Q), c.position.x = -4.1, c.add(je("左")), c.userData = { longitude: -Q, latitude: 0 };
2840
+ var g = new w.Mesh(i, new w.MeshBasicMaterial({ transparent: !0, color: 3370495, opacity: 0 }));
2841
+ g.rotateX(-Q), g.position.y = 4.1, g.add(je("上")), g.userData = { longitude: 0, latitude: Q }, this.faces.add(t, l, c, h, g);
2447
2842
  }, o.prototype.initControls = function() {
2448
- var n = this.controls = new rr(this.camera, this.renderer.domElement);
2449
- n.enableZoom = !1, n.enableDamping = !0, n.enablePan = !1, n.maxPolarAngle = X, n.dampingFactor = 0.15, n.rotateSpeed = 0.25;
2450
- }, o.prototype.load = function(n) {
2451
- return Ge(this, void 0, void 0, function() {
2452
- return Ye(this, function(a) {
2843
+ var e = this.controls = new ze(this.camera, this.renderer.domElement);
2844
+ e.enableZoom = !1, e.enableDamping = !0, e.enablePan = !1, e.maxPolarAngle = Q, e.dampingFactor = 0.15, e.rotateSpeed = 0.25;
2845
+ }, o.prototype.load = function(e) {
2846
+ return at(this, void 0, void 0, function() {
2847
+ return it(this, function(i) {
2453
2848
  return [
2454
2849
  2
2455
2850
  /*return*/
2456
2851
  ];
2457
2852
  });
2458
2853
  });
2459
- }, o.prototype._enable = function(n) {
2460
- var a = this.five.getCurrentState(), t = a.longitude, l = a.latitude;
2461
- this.camera.setFromPose({ longitude: t, latitude: l, distance: 20, offset: new g.Vector3(0, 0, 0) }), this.updateByCamera(), this.wrapper.appendChild(this.renderer.domElement), this.wrapper.appendChild(this.css3drenderer.domElement), this.bindEvents();
2462
- }, o.prototype._disable = function(n) {
2854
+ }, o.prototype._enable = function(e) {
2855
+ var i = this.five.getCurrentState(), t = i.longitude, l = i.latitude;
2856
+ this.camera.setFromPose({ longitude: t, latitude: l, distance: 20, offset: new w.Vector3(0, 0, 0) }), this.updateByCamera(), this.wrapper.appendChild(this.renderer.domElement), this.wrapper.appendChild(this.css3drenderer.domElement), this.bindEvents();
2857
+ }, o.prototype._disable = function(e) {
2463
2858
  this.wrapper.removeChild(this.renderer.domElement), this.wrapper.removeChild(this.css3drenderer.domElement), this.unbindEvents();
2464
- }, o.prototype.enable = function(n) {
2465
- var a;
2859
+ }, o.prototype.enable = function(e) {
2860
+ var i;
2466
2861
  if (!this.state.enabled) {
2467
- var t = (a = n == null ? void 0 : n.userAction) !== null && a !== void 0 ? a : !0;
2862
+ var t = (i = e == null ? void 0 : e.userAction) !== null && i !== void 0 ? i : !0;
2468
2863
  this.updateState({ enabled: !0 }, t), this._enable({ userAction: t }), document.head.appendChild(this.style);
2469
2864
  }
2470
- }, o.prototype.disable = function(n) {
2471
- var a;
2865
+ }, o.prototype.disable = function(e) {
2866
+ var i;
2472
2867
  if (this.state.enabled !== !1) {
2473
- var t = (a = n == null ? void 0 : n.userAction) !== null && a !== void 0 ? a : !0;
2868
+ var t = (i = e == null ? void 0 : e.userAction) !== null && i !== void 0 ? i : !0;
2474
2869
  this.updateState({ enabled: !1 }, t), this._disable({ userAction: t }), document.head.removeChild(this.style);
2475
2870
  }
2476
2871
  }, o;
2477
- }(Ve.Controller)
2478
- ), Ar = function(u, o) {
2479
- return new wr(u, o);
2480
- }, br = (
2872
+ }(rt.Controller)
2873
+ ), Un = function(p, o) {
2874
+ return new Sn(p, o);
2875
+ }, kn = (
2481
2876
  /** @class */
2482
- function(u) {
2483
- Xe(o, u);
2484
- function o(n, a) {
2485
- var t = u.call(this, n) || this;
2877
+ function(p) {
2878
+ lt(o, p);
2879
+ function o(e, i) {
2880
+ var t = p.call(this, e) || this;
2486
2881
  return t.data = {}, t.pluginName = "BackgroundPlugin", t._onFiveCameraUpdate = function(l) {
2487
2882
  var h = (Math.PI / 2 - Math.max(l.latitude, 0)) / (Math.PI / 2), c = Math.max(0.2 - h, 0) * 10;
2488
2883
  t.gradientBg && (t.gradientBg.style.transform = "translateY(-".concat((1 - h) * 50, "%)")), t.groundBg && (t.groundBg.style.backgroundImage = "radial-gradient(circle, #2E303350 ".concat(c * 100, "%, transparent ").concat(c * 120, "%)"));
@@ -2491,8 +2886,8 @@ var Me = function(u) {
2491
2886
  }, t._removeEventListener = function() {
2492
2887
  t.five.off("cameraUpdate", t._onFiveCameraUpdate);
2493
2888
  }, t.load = function() {
2494
- return Ge(t, void 0, void 0, function() {
2495
- return Ye(this, function(l) {
2889
+ return at(t, void 0, void 0, function() {
2890
+ return it(this, function(l) {
2496
2891
  return [
2497
2892
  2
2498
2893
  /*return*/
@@ -2510,8 +2905,8 @@ var Me = function(u) {
2510
2905
  }
2511
2906
  t.state.enabled || (t._onFiveCameraUpdate(t.five.getPose(), !1), t.gradientBg && h.appendChild(t.gradientBg), t.groundBg && h.appendChild(t.groundBg), t.style && document.head.appendChild(t.style), t._addEventListener(), t.hooks.emit("enable", { userAction: !0 }), t.state.enabled = !0);
2512
2907
  }, t.disable = function(l) {
2513
- var h, c, m, p;
2514
- t.state.enabled && ((c = (h = t.gradientBg) === null || h === void 0 ? void 0 : h.parentNode) === null || c === void 0 || c.removeChild(t.gradientBg), (p = (m = t.groundBg) === null || m === void 0 ? void 0 : m.parentNode) === null || p === void 0 || p.removeChild(t.groundBg), t.style && document.head.removeChild(t.style), t._removeEventListener(), t.hooks.emit("disable", { userAction: !0 }), t.state.enabled = !1);
2908
+ var h, c, g, d;
2909
+ t.state.enabled && ((c = (h = t.gradientBg) === null || h === void 0 ? void 0 : h.parentNode) === null || c === void 0 || c.removeChild(t.gradientBg), (d = (g = t.groundBg) === null || g === void 0 ? void 0 : g.parentNode) === null || d === void 0 || d.removeChild(t.groundBg), t.style && document.head.removeChild(t.style), t._removeEventListener(), t.hooks.emit("disable", { userAction: !0 }), t.state.enabled = !1);
2515
2910
  }, t.dispose = function() {
2516
2911
  t._removeEventListener(), t.hooks.emit("disable", { userAction: !0 }), t.state.enabled = !1;
2517
2912
  }, t.state = {
@@ -2540,14 +2935,14 @@ var Me = function(u) {
2540
2935
  `, t.enable()), t;
2541
2936
  }
2542
2937
  return o;
2543
- }(ir.Controller)
2544
- ), xr = function(u, o) {
2545
- return new br(u, o);
2938
+ }(vn.Controller)
2939
+ ), Bn = function(p, o) {
2940
+ return new kn(p, o);
2546
2941
  };
2547
2942
  export {
2548
- xr as BackgroundPlugin,
2549
- Ve as BasePlugin,
2550
- Cr as ItemMaskPlugin,
2551
- Ar as OrientationPlugin,
2552
- yr as RoundedBoxGeometry
2943
+ Bn as BackgroundPlugin,
2944
+ rt as BasePlugin,
2945
+ Fn as ItemMaskPlugin,
2946
+ Un as OrientationPlugin,
2947
+ Nn as RoundedBoxGeometry
2553
2948
  };