/* 许钟文修改的 标记 xzw
另外 所有"matter"字样已被我删除 原因:删除matterport信息
*/
let highMapAddColor = 0 //true
!(function () {
'use strict'
function t(t, i) {
return typeof t === i
}
function i(t, i) {
return t instanceof i
}
function n(t) {
return t && t.nodeType
}
function e(t) {
return n(t) ? t : i(t, g) ? t[0] : void 0
}
function o(t, i, n) {
return (
g.each(t, function (t, e) {
n = i.call(e, n, t, e)
}),
n
)
}
function r(t, i, n) {
var e, o, r
if (t === i) return !0
if (!t || !i || t.constructor !== i.constructor) return !1
for (e = 0, o = n.length; o > e; e += 1) {
if (((r = n[e]), t[r] && y(t[r].equals) && !t[r].equals(i[r]))) return !1
if (t[r] !== i[r]) return !1
}
return !0
}
function s(t, i, n, e) {
;(this.left = E(t)), (this.top = E(i)), (this.width = E(n)), (this.height = E(e)), (this.right = this.left + this.width), (this.bottom = this.top + this.height)
}
function h(t, i, n, e) {
;(this.visible = t || 0), (this.viewport = i || 0), (this.possible = n || 0), (this.rects = (e && T({}, e)) || null)
}
function l(t, i) {
;(this.els = t), (this.viewport = i)
}
function c(t, i, n) {
var e
return g.inArray(n, q) >= 0 ? (e = s.ofElement(t)) : g.inArray(n, S) >= 0 && (e = h.of(t, i)), e ? e[n] : 0
}
function u(t, i) {
return t.val - i.val
}
function a(t, i) {
return i.val - t.val
}
function f(t) {
var i = s.ofContent(t, !0),
n = s.ofViewport(t, !0),
e = i.width - n.width,
o = i.height - n.height
;(this.content = i),
(this.viewport = n),
(this.width = 0 >= e ? null : n.left / e),
(this.height = 0 >= o ? null : n.top / o),
(this.left = n.left),
(this.top = n.top),
(this.right = i.right - n.right),
(this.bottom = i.bottom - n.bottom)
}
function p(t) {
this.el = t || window
}
function d(t, i) {
;(this.context = t), (this.viewport = i), this.init()
}
function v(t, i, n, e) {
;(this.context = new l(t, i)), (this.property = n), (this.descending = e), this.init()
}
function w(t) {
t && t !== window && t !== document ? ((this.context = t), (this.$autoTarget = g(t))) : (this.context = window), this.init()
}
var g = jQuery,
m = g(window),
b = g(document),
T = g.extend,
y = g.isFunction,
k = Math.max,
V = Math.min,
E = Math.round,
x = (function () {
var t = {},
i = 1
return function (n) {
return n ? (t[n] || ((t[n] = i), (i += 1)), t[n]) : 0
}
})()
T(s.prototype, {
equals: function (t) {
return r(this, t, ['left', 'top', 'width', 'height'])
},
area: function () {
return this.width * this.height
},
relativeTo: function (t) {
return new s(this.left - t.left, this.top - t.top, this.width, this.height)
},
intersection: function (t) {
if (!i(t, s)) return null
var n = k(this.left, t.left),
e = V(this.right, t.right),
o = k(this.top, t.top),
r = V(this.bottom, t.bottom),
h = e - n,
l = r - o
return h >= 0 && l >= 0 ? new s(n, o, h, l) : null
},
envelope: function (t) {
if (!i(t, s)) return this
var n = V(this.left, t.left),
e = k(this.right, t.right),
o = V(this.top, t.top),
r = k(this.bottom, t.bottom),
h = e - n,
l = r - o
return new s(n, o, h, l)
}
}),
T(s, {
ofContent: function (t, i) {
return t && t !== document && t !== window
? i
? new s(0, 0, t.scrollWidth, t.scrollHeight)
: new s(t.offsetLeft - t.scrollLeft, t.offsetTop - t.scrollTop, t.scrollWidth, t.scrollHeight)
: new s(0, 0, b.width(), b.height())
},
ofViewport: function (t, i) {
return t && t !== document && t !== window
? i
? new s(t.scrollLeft, t.scrollTop, t.clientWidth, t.clientHeight)
: new s(t.offsetLeft, t.offsetTop, t.clientWidth, t.clientHeight)
: new s(m.scrollLeft(), m.scrollTop(), m.width(), m.height())
},
ofElement: function (t) {
var i = g(t)
if (!i.is(':visible')) return null
var n = i.offset()
return new s(n.left, n.top, i.outerWidth(), i.outerHeight())
}
}),
T(h.prototype, {
equals: function (t) {
return this.fracsEqual(t) && this.rectsEqual(t)
},
fracsEqual: function (t) {
return r(this, t, ['visible', 'viewport', 'possible'])
},
rectsEqual: function (t) {
return r(this.rects, t.rects, ['document', 'element', 'viewport'])
}
}),
T(h, {
of: function (t, i) {
var e, o, r
return (
(t = (n(t) && s.ofElement(t)) || t),
(i = (n(i) && s.ofViewport(i)) || i || s.ofViewport()),
t instanceof s && (e = t.intersection(i))
? ((o = e.area()),
(r = V(t.width, i.width) * V(t.height, i.height)),
new h(o / t.area(), o / i.area(), o / r, {
document: e,
element: e.relativeTo(t),
viewport: e.relativeTo(i)
}))
: new h()
)
}
})
var q = ['width', 'height', 'left', 'right', 'top', 'bottom'],
S = ['possible', 'visible', 'viewport']
T(l.prototype, {
sorted: function (t, i) {
var n = this.viewport
return g
.map(this.els, function (i) {
return {
el: i,
val: c(i, n, t)
}
})
.sort(i ? a : u)
},
best: function (t, i) {
return this.els.length ? this.sorted(t, i)[0] : null
}
}),
T(f.prototype, {
equals: function (t) {
return r(this, t, ['width', 'height', 'left', 'top', 'right', 'bottom', 'content', 'viewport'])
}
}),
T(p.prototype, {
equals: function (t) {
return r(this, t, ['el'])
},
scrollState: function () {
return new f(this.el)
},
scrollTo: function (t, i, n) {
var e = g(this.el === window ? 'html,body' : this.el)
;(t = t || 0),
(i = i || 0),
(n = isNaN(n) ? 1e3 : n),
e.stop(!0).animate(
{
scrollLeft: t,
scrollTop: i
},
n
)
},
scroll: function (t, i, n) {
var e = this.el === window ? m : g(this.el)
;(t = t || 0), (i = i || 0), this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
},
scrollToRect: function (t, i, n, e) {
;(i = i || 0), (n = n || 0), this.scrollTo(t.left - i, t.top - n, e)
},
scrollToElement: function (t, i, n, e) {
var o = s.ofElement(t).relativeTo(s.ofContent(this.el))
this.scrollToRect(o, i, n, e)
}
})
var C = {
init: function () {
;(this.callbacks = g.Callbacks('memory unique')), (this.currVal = null), (this.prevVal = null), (this.checkProxy = g.proxy(this.check, this)), this.autoCheck()
},
bind: function (t) {
this.callbacks.add(t)
},
unbind: function (t) {
t ? this.callbacks.remove(t) : this.callbacks.empty()
},
trigger: function () {
this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
},
check: function (t) {
var i = this.updatedValue(t)
return void 0 !== i && ((this.prevVal = this.currVal), (this.currVal = i), this.trigger(), !0)
},
$autoTarget: m,
autoEvents: 'load resize scroll',
autoCheck: function (t) {
this.$autoTarget[t === !1 ? 'off' : 'on'](this.autoEvents, this.checkProxy)
}
}
T(d.prototype, C, {
updatedValue: function () {
var t = h.of(this.context, this.viewport)
return this.currVal && this.currVal.equals(t) ? void 0 : t
}
}),
T(v.prototype, C, {
updatedValue: function () {
var t = this.context.best(this.property, this.descending)
return t && ((t = t.val > 0 ? t.el : null), this.currVal !== t) ? t : void 0
}
}),
T(w.prototype, C, {
updatedValue: function () {
var t = new f(this.context)
return this.currVal && this.currVal.equals(t) ? void 0 : t
}
})
var L = function (t, i) {
var n = [].slice,
e = jQuery,
o = e.extend,
r = e.isFunction,
s = o({}, i),
h = function (i, n, o, s) {
return (o = r(o) ? o.apply(i, n) : o), r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
},
l = function () {
return h(this, n.call(arguments), s.defaultStatic, l)
},
c = function (t) {
return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
},
u = function (t) {
t && (o(l, t.statics), o(c, t.methods)), (l.modplug = u)
}
;(u.prev = {
statics: e[t],
methods: e.fn[t]
}),
u(i),
(e[t] = l),
(e.fn[t] = c)
},
M = 'fracs'
L(M, {
statics: {
version: '0.15.0',
Rect: s,
Fractions: h,
Group: l,
ScrollState: f,
Viewport: p,
FracsCallbacks: d,
GroupCallbacks: v,
ScrollStateCallbacks: w,
fracs: function (t, i) {
return h.of(t, i)
}
},
methods: {
content: function (t) {
return this.length ? s.ofContent(this[0], t) : null
},
envelope: function () {
return o(this, function (t) {
var i = s.ofElement(this)
return t ? t.envelope(i) : i
})
},
fracs: function (i, n, o) {
t(i, 'string') || ((o = n), (n = i), (i = null)), y(n) || ((o = n), (n = null)), (o = e(o))
var r = M + '.fracs.' + x(o)
return 'unbind' === i
? this.each(function () {
var t = g(this).data(r)
t && t.unbind(n)
})
: 'check' === i
? this.each(function () {
var t = g(this).data(r)
t && t.check()
})
: y(n)
? this.each(function () {
var t = g(this),
i = t.data(r)
i || ((i = new d(this, o)), t.data(r, i)), i.bind(n)
})
: this.length
? h.of(this[0], o)
: null
},
intersection: function () {
return o(this, function (t) {
var i = s.ofElement(this)
return t ? t.intersection(i) : i
})
},
max: function (t, i, n) {
return y(i) || ((n = i), (i = null)), (n = e(n)), i ? (new v(this, n, t, !0).bind(i), this) : this.pushStack(new l(this, n).best(t, !0).el)
},
min: function (t, i, n) {
return y(i) || ((n = i), (i = null)), (n = e(n)), i ? (new v(this, n, t).bind(i), this) : this.pushStack(new l(this, n).best(t).el)
},
rect: function () {
return this.length ? s.ofElement(this[0]) : null
},
scrollState: function (i, n) {
var e = M + '.scrollState'
return (
t(i, 'string') || ((n = i), (i = null)),
'unbind' === i
? this.each(function () {
var t = g(this).data(e)
t && t.unbind(n)
})
: 'check' === i
? this.each(function () {
var t = g(this).data(e)
t && t.check()
})
: y(n)
? this.each(function () {
var t = g(this),
i = t.data(e)
i || ((i = new w(this)), t.data(e, i)), i.bind(n)
})
: this.length
? new f(this[0])
: null
)
},
scroll: function (t, i, n) {
return this.each(function () {
new p(this).scroll(t, i, n)
})
},
scrollTo: function (t, i, n, o) {
return (
g.isNumeric(t) && ((o = n), (n = i), (i = t), (t = null)),
(t = e(t)),
this.each(function () {
t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
})
)
},
scrollToThis: function (t, i, n, o) {
return (o = new p(e(o))), o.scrollToElement(this[0], t, i, n), this
},
softLink: function (t, i, n, o) {
return (
(o = new p(e(o))),
this.filter('a[href^=#]').each(function () {
var e = g(this)
e.on('click', function () {
o.scrollToElement(g(e.attr('href'))[0], t, i, n)
})
})
)
},
sort: function (i, n, o) {
return (
t(n, 'boolean') || ((o = n), (n = null)),
(o = e(o)),
this.pushStack(
g.map(new l(this, o).sorted(i, !n), function (t) {
return t.el
})
)
)
},
viewport: function (t) {
return this.length ? s.ofViewport(this[0], t) : null
}
},
defaultStatic: 'fracs',
defaultMethod: 'fracs'
})
})()
if ('undefined' == typeof jQuery) throw new Error("Bootstrap's JavaScript requires jQuery")
;+(function (t) {
'use strict'
function e(e) {
return this.each(function () {
var o = t(this),
s = o.data('bs.tooltip'),
n = 'object' == typeof e && e
;(s || 'destroy' != e) && (s || o.data('bs.tooltip', (s = new i(this, n))), 'string' == typeof e && s[e]())
})
}
var i = function (t, e) {
;(this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null), this.init('tooltip', t, e)
}
;(i.VERSION = '3.2.0'),
(i.DEFAULTS = {
animation: !0,
placement: 'top',
selector: !1,
template: '
',
trigger: 'hover focus',
title: '',
delay: 0,
html: !1,
container: !1,
viewport: {
selector: 'body',
padding: 0
}
}),
(i.prototype.init = function (e, i, o) {
;(this.enabled = !0),
(this.type = e),
(this.$element = t(i)),
(this.options = this.getOptions(o)),
(this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport))
for (var s = this.options.trigger.split(' '), n = s.length; n--; ) {
var r = s[n]
if ('click' == r) this.$element.on('click.' + this.type, this.options.selector, t.proxy(this.toggle, this))
else if ('manual' != r) {
var a = 'hover' == r ? 'mouseenter' : 'focusin',
l = 'hover' == r ? 'mouseleave' : 'focusout'
this.$element.on(a + '.' + this.type, this.options.selector, t.proxy(this.enter, this)), this.$element.on(l + '.' + this.type, this.options.selector, t.proxy(this.leave, this))
}
}
this.options.selector
? (this._options = t.extend({}, this.options, {
trigger: 'manual',
selector: ''
}))
: this.fixTitle()
}),
(i.prototype.getDefaults = function () {
return i.DEFAULTS
}),
(i.prototype.getOptions = function (e) {
return (
(e = t.extend({}, this.getDefaults(), this.$element.data(), e)),
e.delay &&
'number' == typeof e.delay &&
(e.delay = {
show: e.delay,
hide: e.delay
}),
e
)
}),
(i.prototype.getDelegateOptions = function () {
var e = {},
i = this.getDefaults()
return (
this._options &&
t.each(this._options, function (t, o) {
i[t] != o && (e[t] = o)
}),
e
)
}),
(i.prototype.enter = function (e) {
var i = e instanceof this.constructor ? e : t(e.currentTarget).data('bs.' + this.type)
return (
i || ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())), t(e.currentTarget).data('bs.' + this.type, i)),
clearTimeout(i.timeout),
(i.hoverState = 'in'),
i.options.delay && i.options.delay.show
? void (i.timeout = setTimeout(function () {
// "in" == i.hoverState && i.show()
}, i.options.delay.show))
: i.show()
)
}),
(i.prototype.leave = function (e) {
var i = e instanceof this.constructor ? e : t(e.currentTarget).data('bs.' + this.type)
return (
i || ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())), t(e.currentTarget).data('bs.' + this.type, i)),
clearTimeout(i.timeout),
(i.hoverState = 'out'),
i.options.delay && i.options.delay.hide
? void (i.timeout = setTimeout(function () {
'out' == i.hoverState && i.hide()
}, i.options.delay.hide))
: i.hide()
)
}),
(i.prototype.show = function () {
var e = t.Event('show.bs.' + this.type)
if (this.hasContent() && this.enabled) {
this.$element.trigger(e)
var i = t.contains(document.documentElement, this.$element[0])
if (e.isDefaultPrevented() || !i) return
var o = this,
s = this.tip(),
n = this.getUID(this.type)
this.setContent(), s.attr('id', n), this.$element.attr('aria-describedby', n), this.options.animation && s.addClass('fade')
var r = 'function' == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement,
a = /\s?auto?\s?/i,
l = a.test(r)
l && (r = r.replace(a, '') || 'top'),
s
.detach()
.css({
top: 0,
left: 0,
display: 'block'
})
.addClass(r)
.data('bs.' + this.type, this),
this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element)
var p = this.getPosition(),
h = s[0].offsetWidth,
f = s[0].offsetHeight
if (l) {
var u = r,
c = this.$element.parent(),
d = this.getPosition(c)
;(r =
'bottom' == r && p.top + p.height + f - d.scroll > d.height
? 'top'
: 'top' == r && p.top - d.scroll - f < 0
? 'bottom'
: 'right' == r && p.right + h > d.width
? 'left'
: 'left' == r && p.left - h < d.left
? 'right'
: r),
s.removeClass(u).addClass(r)
}
var g = this.getCalculatedOffset(r, p, h, f)
this.applyPlacement(g, r)
var y = function () {
o.$element.trigger('shown.bs.' + o.type), (o.hoverState = null)
}
t.support.transition && this.$tip.hasClass('fade') ? s.one('bsTransitionEnd', y).emulateTransitionEnd(150) : y()
}
}),
(i.prototype.applyPlacement = function (e, i) {
var o = this.tip(),
s = o[0].offsetWidth,
n = o[0].offsetHeight,
r = parseInt(o.css('margin-top'), 10),
a = parseInt(o.css('margin-left'), 10)
isNaN(r) && (r = 0),
isNaN(a) && (a = 0),
(e.top = e.top + r),
(e.left = e.left + a),
t.offset.setOffset(
o[0],
t.extend(
{
using: function (t) {
o.css({
top: Math.round(t.top),
left: Math.round(t.left)
})
}
},
e
),
0
),
o.addClass('in')
var l = o[0].offsetWidth,
p = o[0].offsetHeight
'top' == i && p != n && (e.top = e.top + n - p)
var h = this.getViewportAdjustedDelta(i, e, l, p)
h.left ? (e.left += h.left) : (e.top += h.top)
var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p,
u = h.left ? 'left' : 'top',
c = h.left ? 'offsetWidth' : 'offsetHeight'
o.offset(e), this.replaceArrow(f, o[0][c], u)
}),
(i.prototype.replaceArrow = function (t, e, i) {
this.arrow().css(i, t ? 50 * (1 - t / e) + '%' : '')
}),
(i.prototype.setContent = function () {
var t = this.tip(),
e = this.getTitle()
t.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](e), t.removeClass('fade in top bottom left right')
}),
(i.prototype.hide = function () {
function e() {
'in' != i.hoverState && o.detach(), i.$element.trigger('hidden.bs.' + i.type)
}
var i = this,
o = this.tip(),
s = t.Event('hide.bs.' + this.type)
if ((this.$element.removeAttr('aria-describedby'), this.$element.trigger(s), !s.isDefaultPrevented()))
return o.removeClass('in'), t.support.transition && this.$tip.hasClass('fade') ? o.one('bsTransitionEnd', e).emulateTransitionEnd(150) : e(), (this.hoverState = null), this
}),
(i.prototype.fixTitle = function () {
var t = this.$element
;(t.attr('title') || 'string' != typeof t.attr('data-original-title')) && t.attr('data-original-title', t.attr('title') || '').attr('title', '')
}),
(i.prototype.hasContent = function () {
return this.getTitle()
}),
(i.prototype.getPosition = function (e) {
e = e || this.$element
var i = e[0],
o = 'BODY' == i.tagName
return t.extend(
{},
'function' == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null,
{
scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
width: o ? t(window).width() : e.outerWidth(),
height: o ? t(window).height() : e.outerHeight()
},
o
? {
top: 0,
left: 0
}
: e.offset()
)
}),
(i.prototype.getCalculatedOffset = function (t, e, i, o) {
return 'bottom' == t
? {
top: e.top + e.height,
left: e.left + e.width / 2 - i / 2
}
: 'top' == t
? {
top: e.top - o,
left: e.left + e.width / 2 - i / 2
}
: 'left' == t
? {
top: e.top + e.height / 2 - o / 2,
left: e.left - i
}
: {
top: e.top + e.height / 2 - o / 2,
left: e.left + e.width
}
}),
(i.prototype.getViewportAdjustedDelta = function (t, e, i, o) {
var s = {
top: 0,
left: 0
}
if (!this.$viewport) return s
var n = (this.options.viewport && this.options.viewport.padding) || 0,
r = this.getPosition(this.$viewport)
if (/right|left/.test(t)) {
var a = e.top - n - r.scroll,
l = e.top + n - r.scroll + o
a < r.top ? (s.top = r.top - a) : l > r.top + r.height && (s.top = r.top + r.height - l)
} else {
var p = e.left - n,
h = e.left + n + i
p < r.left ? (s.left = r.left - p) : h > r.width && (s.left = r.left + r.width - h)
}
return s
}),
(i.prototype.getTitle = function () {
var t,
e = this.$element,
i = this.options
return (t = e.attr('data-original-title') || ('function' == typeof i.title ? i.title.call(e[0]) : i.title))
}),
(i.prototype.getUID = function (t) {
do t += ~~(1e6 * Math.random())
while (document.getElementById(t))
return t
}),
(i.prototype.tip = function () {
return (this.$tip = this.$tip || t(this.options.template))
}),
(i.prototype.arrow = function () {
return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
}),
(i.prototype.validate = function () {
this.$element[0].parentNode || (this.hide(), (this.$element = null), (this.options = null))
}),
(i.prototype.enable = function () {
this.enabled = !0
}),
(i.prototype.disable = function () {
this.enabled = !1
}),
(i.prototype.toggleEnabled = function () {
this.enabled = !this.enabled
}),
(i.prototype.toggle = function (e) {
var i = this
e && ((i = t(e.currentTarget).data('bs.' + this.type)), i || ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())), t(e.currentTarget).data('bs.' + this.type, i))),
i.tip().hasClass('in') ? i.leave(i) : i.enter(i)
}),
(i.prototype.destroy = function () {
clearTimeout(this.timeout),
this.hide()
.$element.off('.' + this.type)
.removeData('bs.' + this.type)
})
var o = t.fn.tooltip
;(t.fn.tooltip = e),
(t.fn.tooltip.Constructor = i),
(t.fn.tooltip.noConflict = function () {
return (t.fn.tooltip = o), this
})
})(jQuery)
!(function (e, t, n) {
'undefined' != typeof module && module.exports ? (module.exports = n()) : 'function' == typeof define && define.amd ? define(n) : (t[e] = n())
})('Keen', this, function () {
'use strict'
function Keen() {
return _init.apply(this, arguments)
}
function _init(e) {
if (_isUndefined(e)) throw new Error('Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/')
if (_isUndefined(e.projectId) || 'String' !== _type(e.projectId) || e.projectId.length < 1) throw new Error('Please provide a projectId')
this.configure(e)
}
function _extend(e) {
for (var t = 1; t < arguments.length; t++) for (var n in arguments[t]) e[n] = arguments[t][n]
return e
}
function _isUndefined(e) {
return void 0 === e
}
function _type(e) {
var t = e && e.constructor ? e.constructor.toString() : void 0
return t ? t.match(/function (.*)\(/)[1] : 'Null'
}
function _each(e, t, n) {
var r
if (!e) return 0
if (((n = n ? n : e), 'array' === _type(e))) {
for (r = 0; r < e.length; r++) if (t.call(n, e[r], r, e) === !1) return 0
} else for (r in e) if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1) return 0
return 1
}
function _parse_params(e) {
for (
var t,
n = {},
r = /\+/g,
i = /([^&=]+)=?([^&]*)/g,
o = function (e) {
return decodeURIComponent(e.replace(r, ' '))
},
a = e.split('?')[1];
(t = i.exec(a));
)
n[o(t[1])] = o(t[2])
return n
}
function _set_protocol(e) {
switch (e) {
case 'http':
return 'http'
case 'auto':
return location.protocol.replace(/:/g, '')
case 'https':
case void 0:
default:
return 'https'
}
}
function _set_request_type(e) {
var t = e || 'jsonp',
n = !1
return ('Object' === _type(XMLHttpRequest) || 'Function' === _type(XMLHttpRequest)) && 'withCredentials' in new XMLHttpRequest() && (n = !0), null == t || 'xhr' == t ? (n ? 'xhr' : 'jsonp') : t
}
function _build_url(e) {
return this.client.endpoint + '/projects/' + this.client.projectId + e
}
function _uploadEvent(e, t, n, r, i) {
var o = _build_url.apply(this, ['/events/' + e]),
a = {}
;(n = n !== !1), this.client.globalProperties && (a = this.client.globalProperties(e))
for (var c in t) t.hasOwnProperty(c) && (a[c] = t[c])
switch (this.client.requestType) {
case 'xhr':
_request.xhr.apply(this, ['POST', o, null, a, this.client.writeKey, n, r, i])
break
case 'jsonp':
var s = JSON.stringify(a),
l = Keen.Base64.encode(s)
;(o = o + '?api_key=' + this.client.writeKey), (o = o + '&data=' + l), (o = o + '&modified=' + new Date().getTime()), _request.jsonp.apply(this, [o, this.client.writeKey, r, i])
break
case 'beacon':
var s = JSON.stringify(a),
l = Keen.Base64.encode(s)
;(o = o + '?api_key=' + encodeURIComponent(this.client.writeKey)),
(o = o + '&data=' + encodeURIComponent(l)),
(o = o + '&modified=' + encodeURIComponent(new Date().getTime())),
(o += '&c=clv1'),
_request.beacon.apply(this, [o, null, r, i])
}
}
Keen.prototype.configure = function (e) {
return (
(e.host = _isUndefined(e.host) ? 'api.keen.io/3.0' : e.host.replace(/.*?:\/\//g, '')),
(e.protocol = _set_protocol(e.protocol)),
(e.requestType = _set_request_type(e.requestType)),
(this.client = {
projectId: e.projectId,
writeKey: e.writeKey,
readKey: e.readKey,
globalProperties: null,
endpoint: e.protocol + '://' + e.host,
requestType: e.requestType
}),
Keen.trigger('client', this, e),
this.trigger('ready'),
this
)
}
var _request = {
xhr: function (e, t, n, r, i, o, a, c) {
if (!i) return Keen.log('Please provide a writeKey for https://keen.io/project/' + this.client.projectId)
var s = new XMLHttpRequest()
if (
((s.onreadystatechange = function () {
if (4 == s.readyState)
if (s.status >= 200 && s.status < 300) {
var e
try {
e = JSON.parse(s.responseText)
} catch (e) {
Keen.log('Could not JSON parse HTTP response: ' + s.responseText), c && c(s, e)
}
a && e && a(e)
} else Keen.log('HTTP request failed.'), c && c(s, null)
}),
s.open(e, t, o),
i && s.setRequestHeader('Authorization', i),
r && s.setRequestHeader('Content-Type', 'application/json'),
n)
)
for (var l in n) n.hasOwnProperty(l) && s.setRequestHeader(l, n[l])
var u = r ? JSON.stringify(r) : null
s.send(u)
},
jsonp: function (e, t, n, r) {
if (!t) return Keen.log('Please provide a writeKey for https://keen.io/project/' + this.client.projectId)
if (t && e.indexOf('api_key') < 0) {
var i = e.indexOf('?') > 0 ? '&' : '?'
e = e + i + 'api_key=' + t
}
for (var o = 'keenJSONPCallback' + new Date().getTime(); o in window; ) o += 'a'
var a = !1
;(window[o] = function (e) {
;(a = !0), n && e && n(e), (window[o] = void 0)
}),
(e = e + '&jsonp=' + o)
var c = document.createElement('script')
;(c.id = 'keen-jsonp'),
(c.src = e),
document.getElementsByTagName('head')[0].appendChild(c),
(c.onreadystatechange = function () {
a === !1 && 'loaded' === this.readyState && ((a = !0), r && r())
}),
(c.onerror = function () {
a === !1 && ((a = !0), r && r())
})
},
beacon: function (e, t, n, r) {
if (t && e.indexOf('api_key') < 0) {
var i = e.indexOf('?') > 0 ? '&' : '?'
e = e + i + 'api_key=' + t
}
var o = !1,
a = document.createElement('img')
;(a.onload = function () {
if (((o = !0), 'naturalHeight' in this)) {
if (this.naturalHeight + this.naturalWidth === 0) return void this.onerror()
} else if (this.width + this.height === 0) return void this.onerror()
n &&
n({
created: !0
})
}),
(a.onerror = function () {
;(o = !0), r && r()
}),
(a.src = e)
}
},
Events = (Keen.Events = {
on: function (e, t) {
this.listeners || (this.listeners = {})
var n = this.listeners[e] || (this.listeners[e] = [])
return (
n.push({
callback: t
}),
this
)
},
off: function (e, t) {
if (!e && !t) return (this.listeners = void 0), delete this.listeners, this
for (var n = this.listeners[e] || [], r = n.length; r--; )
t && t == n[r].callback && this.listeners[e].splice(r, 1), (t && 0 != n.length) || ((this.listeners[e] = void 0), delete this.listeners[e])
return this
},
trigger: function (e) {
if (!this.listeners) return this
for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++) n[r].callback.apply(this, t)
return this
}
})
_extend(Keen.prototype, Events),
_extend(Keen, Events),
(Keen.loaded = !0),
(Keen.utils = {
each: _each,
extend: _extend,
parseParams: _parse_params
}),
(Keen.ready = function (e) {
Keen.loaded ? e() : Keen.on('ready', e)
}),
(Keen.log = function (e) {
'object' == typeof console && console.log('[Keen IO]', e)
})
var Plugins = (Keen.Plugins = {})
;(Keen.prototype.addEvent = function () {
_uploadEvent.apply(this, arguments)
}),
(Keen.prototype.addEventSync = function (e, t, n, r) {
_uploadEvent.apply(this, [e, t, !1, n, r])
}),
(Keen.prototype.trackExternalLink = function (e, t, n, r, i) {
var o = e,
a = o.metaKey,
c = o.target,
s = !1,
l = function () {}
return (
void 0 === r && (r = 500),
'A' === c.nodeName
? (l = function () {
a || s || ((s = !0), (window.location = c.href))
})
: 'FORM' === c.nodeName &&
(l = function () {
s || ((s = !0), c.submit())
}),
i &&
(l = function () {
s || ((s = !0), i())
}),
_uploadEvent.call(this, t, n, l, l),
setTimeout(function () {
l()
}, r),
!!a && void 0
)
}),
(Keen.prototype.setGlobalProperties = function (e) {
if (!this.client) return Keen.log('Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/')
if (!e || 'function' != typeof e) throw new Error('Invalid value for global properties: ' + e)
this.client.globalProperties = e
}),
(Keen.Base64 = {
map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
encode: function (e) {
var t,
n,
r,
i,
o,
a,
c,
s = '',
l = 0,
u = this.map
for (e = this.utf8.encode(e); l < e.length; )
(t = e.charCodeAt(l++)),
(n = e.charCodeAt(l++)),
(r = e.charCodeAt(l++)),
(i = t >> 2),
(o = ((3 & t) << 4) | (n >> 4)),
(a = isNaN(n) ? 64 : ((15 & n) << 2) | (r >> 6)),
(c = isNaN(n) || isNaN(r) ? 64 : 63 & r),
(s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c))
return s
},
decode: function (e) {
var t,
n,
r,
i,
o,
a,
c,
s = '',
l = 0,
u = this.map,
f = String.fromCharCode
for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ''); l < e.length; )
(t = u.indexOf(e.charAt(l++))),
(n = u.indexOf(e.charAt(l++))),
(r = u.indexOf(e.charAt(l++))),
(i = u.indexOf(e.charAt(l++))),
(o = (t << 2) | (n >> 4)),
(a = ((15 & n) << 4) | (r >> 2)),
(c = ((3 & r) << 6) | i),
(s = s + (f(o) + (64 != r ? f(a) : '')) + (64 != i ? f(c) : ''))
return this.utf8.decode(s)
},
utf8: {
encode: function (e) {
for (var t, n = '', r = 0, i = String.fromCharCode; r < e.length; )
(t = e.charCodeAt(r++)), (n += 128 > t ? i(t) : t > 127 && 2048 > t ? i((t >> 6) | 192) + i((63 & t) | 128) : i((t >> 12) | 224) + i(((t >> 6) & 63) | 128) + i((63 & t) | 128))
return n
},
decode: function (e) {
for (var t, n, r = '', i = 0, o = String.fromCharCode; i < e.length; )
(n = e.charCodeAt(i)),
(r +=
128 > n
? [o(n), i++][0]
: n > 191 && 224 > n
? [o(((31 & n) << 6) | (63 & (t = e.charCodeAt(i + 1)))), (i += 2)][0]
: [o(((15 & n) << 12) | ((63 & (t = e.charCodeAt(i + 1))) << 6) | (63 & (c3 = e.charCodeAt(i + 2)))), (i += 3)][0])
return r
}
}
}),
'object' != typeof JSON && (JSON = {}),
(function () {
function f(e) {
return 10 > e ? '0' + e : e
}
function quote(e) {
return (
(escapable.lastIndex = 0),
escapable.test(e)
? '"' +
e.replace(escapable, function (e) {
var t = meta[e]
return 'string' == typeof t ? t : '\\u' + ('0000' + e.charCodeAt(0).toString(16)).slice(-4)
}) +
'"'
: '"' + e + '"'
)
}
function str(e, t) {
var n,
r,
i,
o,
a,
c = gap,
s = t[e]
switch ((s && 'object' == typeof s && 'function' == typeof s.toJSON && (s = s.toJSON(e)), 'function' == typeof rep && (s = rep.call(t, e, s)), typeof s)) {
case 'string':
return quote(s)
case 'number':
return isFinite(s) ? String(s) : 'null'
case 'boolean':
case 'null':
return String(s)
case 'object':
if (!s) return 'null'
if (((gap += indent), (a = []), '[object Array]' === Object.prototype.toString.apply(s))) {
for (o = s.length, n = 0; o > n; n += 1) a[n] = str(n, s) || 'null'
return (i = 0 === a.length ? '[]' : gap ? '[\n' + gap + a.join(',\n' + gap) + '\n' + c + ']' : '[' + a.join(',') + ']'), (gap = c), i
}
if (rep && 'object' == typeof rep) for (o = rep.length, n = 0; o > n; n += 1) 'string' == typeof rep[n] && ((r = rep[n]), (i = str(r, s)), i && a.push(quote(r) + (gap ? ': ' : ':') + i))
else for (r in s) Object.prototype.hasOwnProperty.call(s, r) && ((i = str(r, s)), i && a.push(quote(r) + (gap ? ': ' : ':') + i))
return (i = 0 === a.length ? '{}' : gap ? '{\n' + gap + a.join(',\n' + gap) + '\n' + c + '}' : '{' + a.join(',') + '}'), (gap = c), i
}
}
'function' != typeof Date.prototype.toJSON &&
((Date.prototype.toJSON = function () {
return isFinite(this.valueOf())
? this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1) + '-' + f(this.getUTCDate()) + 'T' + f(this.getUTCHours()) + ':' + f(this.getUTCMinutes()) + ':' + f(this.getUTCSeconds()) + 'Z'
: null
}),
(String.prototype.toJSON =
Number.prototype.toJSON =
Boolean.prototype.toJSON =
function () {
return this.valueOf()
}))
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
gap,
indent,
meta = {
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"': '\\"',
'\\': '\\\\'
},
rep
'function' != typeof JSON.stringify &&
(JSON.stringify = function (e, t, n) {
var r
if (((gap = ''), (indent = ''), 'number' == typeof n)) for (r = 0; n > r; r += 1) indent += ' '
else 'string' == typeof n && (indent = n)
if (((rep = t), t && 'function' != typeof t && ('object' != typeof t || 'number' != typeof t.length))) throw new Error('JSON.stringify')
return str('', {
'': e
})
}),
'function' != typeof JSON.parse &&
(JSON.parse = function (text, reviver) {
function walk(e, t) {
var n,
r,
i = e[t]
if (i && 'object' == typeof i) for (n in i) Object.prototype.hasOwnProperty.call(i, n) && ((r = walk(i, n)), void 0 !== r ? (i[n] = r) : delete i[n])
return reviver.call(e, t, i)
}
var j
if (
((text = String(text)),
(cx.lastIndex = 0),
cx.test(text) &&
(text = text.replace(cx, function (e) {
return '\\u' + ('0000' + e.charCodeAt(0).toString(16)).slice(-4)
})),
/^[\],:{}\s]*$/.test(
text
.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
.replace(/(?:^|:|,)(?:\s*\[)+/g, '')
))
)
return (
(j = eval('(' + text + ')')),
'function' == typeof reviver
? walk(
{
'': j
},
''
)
: j
)
throw new SyntaxError('JSON.parse')
})
})(),
!(function (e, t, n) {
'undefined' != typeof module && module.exports ? (module.exports = n()) : 'function' == typeof define && define.amd ? define(n) : (t[e] = n())
})('domready', Keen.utils, function (e) {
function t(e) {
for (d = 1; (e = r.shift()); ) e()
}
var n,
r = [],
i = !1,
o = document,
a = o.documentElement,
c = a.doScroll,
s = 'DOMContentLoaded',
l = 'addEventListener',
u = 'onreadystatechange',
f = 'readyState',
p = c ? /^loaded|^c/ : /^loaded|c/,
d = p.test(o[f])
return (
o[l] &&
o[l](
s,
(n = function () {
o.removeEventListener(s, n, i), t()
}),
i
),
c &&
o.attachEvent(
u,
(n = function () {
;/^c/.test(o[f]) && (o.detachEvent(u, n), t())
})
),
(e = c
? function (t) {
self != top
? d
? t()
: r.push(t)
: (function () {
try {
a.doScroll('left')
} catch (n) {
return setTimeout(function () {
e(t)
}, 50)
}
t()
})()
}
: function (e) {
d ? e() : r.push(e)
})
)
})
var loaded = window.Keen,
cached = window._Keen || {},
clients,
ready
if (loaded && cached) {
;(clients = cached.clients || {}), (ready = cached.ready || [])
for (var instance in clients)
if (clients.hasOwnProperty(instance)) {
var client = clients[instance]
for (var method in Keen.prototype) Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method])
if (
((loaded.Query = Keen.Query ? Keen.Query : function () {}),
(loaded.Visualization = Keen.Visualization ? Keen.Visualization : function () {}),
client._config && (client.configure.call(client, client._config), delete client._config),
client._setGlobalProperties)
) {
for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++) client.setGlobalProperties.apply(client, globals[i])
delete client._setGlobalProperties
}
if (client._addEvent) {
for (var queue = client._addEvent || [], i = 0; i < queue.length; i++) client.addEvent.apply(client, queue[i])
delete client._addEvent
}
var callback = client._on || []
if (client._on) {
for (var i = 0; i < callback.length; i++) client.on.apply(client, callback[i])
client.trigger('ready'), delete client._on
}
}
for (var i = 0; i < ready.length; i++) {
var callback = ready[i]
Keen.on('ready', function () {
callback()
})
}
}
return (
Keen.loaded &&
setTimeout(function () {
Keen.utils.domready(function () {
Keen.trigger('ready')
})
}, 0),
Keen
)
})
!(function () {
var t = (window.analytics = window.analytics || [])
if (!t.initialize) {
if (t.invoked) return void (window.console && console.error && console.error('Segment snippet included twice.'))
;(t.invoked = !0),
(t.methods = ['trackSubmit', 'trackClick', 'trackLink', 'trackForm', 'pageview', 'identify', 'reset', 'group', 'track', 'ready', 'alias', 'debug', 'page', 'once', 'off', 'on']),
(t.factory = function (e) {
return function () {
var n = Array.prototype.slice.call(arguments)
return n.unshift(e), t.push(n), t
}
})
for (var e = 0; e < t.methods.length; e++) {
var n = t.methods[e]
t[n] = t.factory(n)
}
;(t.load = function (t) {
var e = document.createElement('script')
;(e.type = 'text/javascript'), (e.async = !0), (e.src = ('https:' === document.location.protocol ? 'https://' : 'http://') + 'cdn.segment.com/analytics.js/v1/' + t + '/analytics.min.js')
var n = document.getElementsByTagName('script')[0]
n.parentNode.insertBefore(e, n)
}),
(t.SNIPPET_VERSION = '4.0.0')
}
})()
!(function (i, e) {
'use strict'
var s = '',
r = '?',
o = 'function',
a = 'undefined',
n = 'object',
t = 'major',
d = 'model',
w = 'name',
l = 'type',
p = 'vendor',
m = 'version',
c = 'architecture',
u = 'console',
g = 'mobile',
f = 'tablet',
h = 'smarttv',
b = {
has: function (i, e) {
return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
},
lowerize: function (i) {
return i.toLowerCase()
}
},
y = {
rgx: function () {
for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
var c = m[p],
u = m[p + 1]
if (typeof i === a) {
i = {}
for (t in u) (d = u[t]), typeof d === n ? (i[d[0]] = e) : (i[d] = e)
}
for (s = r = 0; s < c.length; s++)
if ((w = c[s].exec(this.getUA()))) {
for (t = 0; t < u.length; t++)
(l = w[++r]),
(d = u[t]),
typeof d === n && d.length > 0
? 2 == d.length
? typeof d[1] == o
? (i[d[0]] = d[1].call(this, l))
: (i[d[0]] = d[1])
: 3 == d.length
? typeof d[1] !== o || (d[1].exec && d[1].test)
? (i[d[0]] = l ? l.replace(d[1], d[2]) : e)
: (i[d[0]] = l ? d[1].call(this, l, d[2]) : e)
: 4 == d.length && (i[d[0]] = l ? d[3].call(this, l.replace(d[1], d[2])) : e)
: (i[d] = l ? l : e)
break
}
if (w) break
}
return i
},
str: function (i, s) {
for (var o in s)
if (typeof s[o] === n && s[o].length > 0) {
for (var a = 0; a < s[o].length; a++) if (b.has(s[o][a], i)) return o === r ? e : o
} else if (b.has(s[o], i)) return o === r ? e : o
return i
}
},
v = {
browser: {
oldsafari: {
major: {
1: ['/8', '/1', '/3'],
2: '/4',
'?': '/'
},
version: {
'1.0': '/8',
1.2: '/1',
1.3: '/3',
'2.0': '/412',
'2.0.2': '/416',
'2.0.3': '/417',
'2.0.4': '/419',
'?': '/'
}
}
},
device: {
sprint: {
model: {
'Evo Shift 4G': '7373KT'
},
vendor: {
HTC: 'APA',
Sprint: 'Sprint'
}
}
},
os: {
windows: {
version: {
ME: '4.90',
'NT 3.11': 'NT3.51',
'NT 4.0': 'NT4.0',
2e3: 'NT 5.0',
XP: ['NT 5.1', 'NT 5.2'],
Vista: 'NT 6.0',
7: 'NT 6.1',
8: 'NT 6.2',
8.1: 'NT 6.3',
RT: 'ARM'
}
}
}
},
k = {
browser: [
[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i],
[w, m, t],
[/\s(opr)\/((\d+)?[\w\.]+)/i],
[[w, 'Opera'], m, t],
[
/(kindle)\/((\d+)?[\w\.]+)/i,
/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,
/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i,
/(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i,
/(rekonq)((?:\/)[\w\.]+)*/i,
/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i
],
[w, m, t],
[/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i],
[[w, 'IE'], m, t],
[/(yabrowser)\/((\d+)?[\w\.]+)/i],
[[w, 'Yandex'], m, t],
[/(comodo_dragon)\/((\d+)?[\w\.]+)/i],
[[w, /_/g, ' '], m, t],
[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i],
[w, m, t],
[/(dolfin)\/((\d+)?[\w\.]+)/i],
[[w, 'Dolphin'], m, t],
[/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i],
[[w, 'Chrome'], m, t],
[/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i],
[m, t, [w, 'Mobile Safari']],
[/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i],
[m, t, w],
[/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i],
[w, [t, y.str, v.browser.oldsafari.major], [m, y.str, v.browser.oldsafari.version]],
[/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i],
[w, m, t],
[/(navigator|netscape)\/((\d+)?[\w\.-]+)/i],
[[w, 'Netscape'], m, t],
[
/(swiftfox)/i,
/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,
/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,
/(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i,
/(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i,
/(links)\s\(((\d+)?[\w\.]+)/i,
/(gobrowser)\/?((\d+)?[\w\.]+)*/i,
/(ice\s?browser)\/v?((\d+)?[\w\._]+)/i,
/(mosaic)[\/\s]((\d+)?[\w\.]+)/i
],
[w, m, t],
[/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i],
[w, m, t],
[/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i],
[w, m],
[/(ares|ossproxy)\s((\d+)[\w\.-]+)/i],
[w, m, t],
[
/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i,
/(clementine|music player daemon)\s((\d+)[\w\.-]+)/i,
/(lg player|nexplayer)\s((\d+)[\d\.]+)/i,
/player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i
],
[w, m, t],
[/(nexplayer)\s((\d+)[\w\.-]+)/i],
[w, m, t],
[/(flrp)\/((\d+)[\w\.-]+)/i],
[[w, 'Flip Player'], m, t],
[/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i],
[w],
[/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i],
[w, m, t],
[/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i],
[w, m, t],
[/(htc_one_s)\/((\d+)[\d\.]+)/i],
[[w, /_/g, ' '], m, t],
[/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i],
[w, m],
[/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i],
[w, m, t],
[/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i],
[w],
[/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i],
[w, m, t],
[/(nokia\d+)\/((\d+)[\w\.-]+)/i],
[w, m, t],
[/\s(songbird)\/((\d+)[\w\.-]+)/i],
[w, m, t],
[/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i],
[w, m, t],
[/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i],
[w],
[/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i],
[w, m, t],
[/(smp)((\d+)[\d\.]+)/i],
[w, m, t],
[/(vlc) media player - version ((\d+)[\w\.]+)/i, /(vlc)\/((\d+)[\w\.-]+)/i, /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, /(foobar2000)\/((\d+)[\d\.]+)/i, /(itunes)\/((\d+)[\d\.]+)/i],
[w, m, t],
[/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i],
[[w, /-/g, ' '], m, t],
[/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i],
[m, t, [w, 'Windows']],
[/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i],
[w, m, t],
[/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i],
[[w, 'rad.io'], m, t]
],
cpu: [
[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],
[[c, 'amd64']],
[/(ia32(?=;))/i],
[[c, b.lowerize]],
[/((?:i[346]|x)86)[;\)]/i],
[[c, 'ia32']],
[/windows\s(ce|mobile);\sppc;/i],
[[c, 'arm']],
[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],
[[c, /ower/, '', b.lowerize]],
[/(sun4\w)[;\)]/i],
[[c, 'sparc']],
[/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],
[c, b.lowerize]
],
device: [
[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],
[d, p, [l, f]],
[/applecoremedia\/[\w\.]+ \((ipad)/],
[d, [p, 'Apple'], [l, f]],
[/(apple\s{0,1}tv)/i],
[
[d, 'Apple TV'],
[p, 'Apple']
],
[/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i],
[p, d, [l, f]],
[/\((ip[honed|\s\w*]+);.+(apple)/i],
[d, p, [l, g]],
[/\((ip[honed|\s\w*]+);/i],
[d, [p, 'Apple'], [l, g]],
[/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i],
[p, d, [l, g]],
[/\((bb10);\s(\w+)/i],
[[p, 'BlackBerry'], d, [l, g]],
[/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i],
[[p, 'Asus'], d, [l, f]],
[/(sony)\s(tablet\s[ps])/i],
[p, d, [l, f]],
[/(nintendo)\s([wids3u]+)/i],
[p, d, [l, u]],
[/((playstation)\s[3portablevi]+)/i],
[[p, 'Sony'], d, [l, u]],
[/(sprint\s(\w+))/i],
[
[p, y.str, v.device.sprint.vendor],
[d, y.str, v.device.sprint.model],
[l, g]
],
[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i],
[p, [d, /_/g, ' '], [l, g]],
[/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i],
[[p, 'Motorola'], d, [l, g]],
[/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i],
[[p, 'Motorola'], d, [l, f]],
[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i],
[[p, 'Samsung'], d, [l, f]],
[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i],
[[p, 'Samsung'], d, [l, g]],
[/(sie)-(\w+)*/i],
[[p, 'Siemens'], d, [l, g]],
[/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i],
[[p, 'Nokia'], d, [l, g]],
[/android\s3\.[\s\w-;]{10}((a\d{3}))/i],
[[p, 'Acer'], d, [l, f]],
[/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i],
[[p, 'LG'], d, [l, f]],
[/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i],
[[p, 'LG'], d, [l, g]],
[/android.+((ideatab[a-z0-9\-\s]+))/i],
[[p, 'Lenovo'], d, [l, f]],
[/(lg) netcast\.tv/i],
[p, [l, h]],
[/(mobile|tablet);.+rv\:.+gecko\//i],
[l, p, d]
],
engine: [
[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i],
[w, m],
[/rv\:([\w\.]+).*(gecko)/i],
[m, w]
],
os: [
[/microsoft\s(windows)\s(vista|xp)/i],
[w, m],
[/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],
[w, [m, y.str, v.os.windows.version]],
[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],
[
[w, 'Windows'],
[m, y.str, v.os.windows.version]
],
[/\((bb)(10);/i],
[[w, 'BlackBerry'], m],
[/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i],
[w, m],
[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],
[[w, 'Symbian'], m],
[/mozilla.+\(mobile;.+gecko.+firefox/i],
[[w, 'Firefox OS'], m],
[
/(nintendo|playstation)\s([wids3portablevu]+)/i,
/(mint)[\/\s\(]?(\w+)*/i,
/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i,
/(hurd|linux)\s?([\w\.]+)*/i,
/(gnu)\s?([\w\.]+)*/i
],
[w, m],
[/(cros)\s[\w]+\s([\w\.]+\w)/i],
[[w, 'Chromium OS'], m],
[/(sunos)\s?([\w\.]+\d)*/i],
[[w, 'Solaris'], m],
[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],
[w, m],
[/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],
[
[w, 'iOS'],
[m, /_/g, '.']
],
[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i],
[w, [m, /_/g, '.']],
[/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i],
[w, m]
]
},
x = function (e) {
var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s)
return this instanceof x
? ((this.getBrowser = function () {
return y.rgx.apply(this, k.browser)
}),
(this.getCPU = function () {
return y.rgx.apply(this, k.cpu)
}),
(this.getDevice = function () {
return y.rgx.apply(this, k.device)
}),
(this.getEngine = function () {
return y.rgx.apply(this, k.engine)
}),
(this.getOS = function () {
return y.rgx.apply(this, k.os)
}),
(this.getResult = function () {
return {
ua: this.getUA(),
browser: this.getBrowser(),
engine: this.getEngine(),
os: this.getOS(),
device: this.getDevice(),
cpu: this.getCPU()
}
}),
(this.getUA = function () {
return r
}),
(this.setUA = function (i) {
return (r = i), this
}),
void this.setUA(r))
: new x(e).getResult()
}
if (typeof exports !== a) typeof module !== a && module.exports && (exports = module.exports = x), (exports.UAParser = x)
else if (
((i.UAParser = x),
typeof define === o &&
define.amd &&
define(function () {
return x
}),
typeof i.jQuery !== a)
) {
var A = i.jQuery,
_ = new x()
;(A.ua = _.getResult()),
(A.ua.get = function () {
return _.getUA()
}),
(A.ua.set = function (i) {
_.setUA(i)
var e = _.getResult()
for (var s in e) A.ua[s] = e[s]
})
}
})(this)
window.Modernizr = (function (n, e, t) {
function o(n) {
d.cssText = n
}
function r(n, e) {
return typeof n === e
}
var i,
c,
u,
a = '2.8.2',
f = {},
s = e.documentElement,
l = 'modernizr',
p = e.createElement(l),
d = p.style,
y = ({}.toString, {}),
w = [],
b = w.slice,
v = {}.hasOwnProperty
;(u =
r(v, 'undefined') || r(v.call, 'undefined')
? function (n, e) {
return e in n && r(n.constructor.prototype[e], 'undefined')
}
: function (n, e) {
return v.call(n, e)
}),
Function.prototype.bind ||
(Function.prototype.bind = function (n) {
var e = this
if ('function' != typeof e) throw new TypeError()
var t = b.call(arguments, 1),
o = function () {
if (this instanceof o) {
var r = function () {}
r.prototype = e.prototype
var i = new r(),
c = e.apply(i, t.concat(b.call(arguments)))
return Object(c) === c ? c : i
}
return e.apply(n, t.concat(b.call(arguments)))
}
return o
}),
(y.webgl = function () {
return !!n.WebGLRenderingContext
})
for (var h in y) u(y, h) && ((c = h.toLowerCase()), (f[c] = y[h]()), w.push((f[c] ? '' : 'no-') + c))
return (
(f.addTest = function (n, e) {
if ('object' == typeof n) for (var o in n) u(n, o) && f.addTest(o, n[o])
else {
if (((n = n.toLowerCase()), f[n] !== t)) return f
;(e = 'function' == typeof e ? e() : e), 'undefined' != typeof enableClasses && enableClasses && (s.className += ' ' + (e ? '' : 'no-') + n), (f[n] = e)
}
return f
}),
o(''),
(p = i = null),
(f._version = a),
f
)
})(this, this.document)
!(function (e, t, a) {
'use strict'
function n(t, h, m) {
function H(a) {
var n = 0,
i = Ee.length
if (
((Ce.old = e.extend({}, Ce)),
(Ie = we ? 0 : be[ge.horizontal ? 'width' : 'height']()),
(ke = Be[ge.horizontal ? 'width' : 'height']()),
(ze = we ? t : Pe[ge.horizontal ? 'outerWidth' : 'outerHeight']()),
(Ee.length = 0),
(Ce.start = 0),
(Ce.end = q(ze - Ie, 0)),
Re)
) {
;(n = Ne.length), (qe = Pe.children(ge.itemSelector)), (Ne.length = 0)
var r,
s = c(Pe, ge.horizontal ? 'paddingLeft' : 'paddingTop'),
o = c(Pe, ge.horizontal ? 'paddingRight' : 'paddingBottom'),
l = 'border-box' === e(qe).css('boxSizing'),
u = 'none' !== qe.css('float'),
f = 0,
v = qe.length - 1
;(ze = 0),
qe.each(function (t, a) {
var n = e(a),
i = a.getBoundingClientRect(),
l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top),
d = c(n, ge.horizontal ? 'marginLeft' : 'marginTop'),
p = c(n, ge.horizontal ? 'marginRight' : 'marginBottom'),
h = l + d + p,
m = !d || !p,
g = {}
;(g.el = a),
(g.size = m ? l : h),
(g.half = g.size / 2),
(g.start = ze + (m ? d : 0)),
(g.center = g.start - E(Ie / 2 - g.size / 2)),
(g.end = g.start - Ie + g.size),
t || (ze += s),
(ze += h),
ge.horizontal || u || (p && d && t > 0 && (ze -= N(d, p))),
t === v && ((g.end += o), (ze += o), (f = m ? p : 0)),
Ne.push(g),
(r = g)
}),
(Pe[0].style[ge.horizontal ? 'width' : 'height'] = (l ? ze : ze - s - o) + 'px'),
(ze -= f),
Ne.length ? ((Ce.start = Ne[0][Me ? 'center' : 'start']), (Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start)) : (Ce.start = Ce.end = 0)
}
if (
((Ce.center = E(Ce.end / 2 + Ce.start / 2)),
Q(),
Se.length &&
ke > 0 &&
(ge.dynamicHandle
? ((Te = Ce.start === Ce.end ? ke : E((ke * Ie) / ze)), (Te = d(Te, ge.minHandleSize, ke)), (Se[0].style[ge.horizontal ? 'width' : 'height'] = Te + 'px'))
: (Te = Se[ge.horizontal ? 'outerWidth' : 'outerHeight']()),
(xe.end = ke - Te),
it || j()),
!we && Ie > 0)
) {
var p = Ce.start,
h = ''
if (Re)
e.each(Ne, function (e, t) {
Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && ((p = t.start), Ee.push(p), (p += Ie), p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
})
else for (; p - Ie < Ce.end; ) Ee.push(p), (p += Ie)
if (De[0] && i !== Ee.length) {
for (var m = 0; m < Ee.length; m++) h += ge.pageBuilder.call(ye, m)
;(Ae = De.html(h).children()), Ae.eq(Oe.activePage).addClass(ge.activeClass)
}
}
if (((Oe.slideeSize = ze), (Oe.frameSize = Ie), (Oe.sbSize = ke), (Oe.handleSize = Te), Re)) {
a && null != ge.startAt && (W(ge.startAt), ye[Le ? 'toCenter' : 'toStart'](ge.startAt))
var g = Ne[Oe.activeItem]
X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
} else a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end))
pe('load')
}
function X(e, t, a) {
if (Re && at.released && !a) {
var n = $(e),
i = e > Ce.start && e < Ce.end
Le ? (i && (e = Ne[n.centerItem].center), Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
}
at.init && at.slidee && ge.elasticBounds ? (e > Ce.end ? (e = Ce.end + (e - Ce.end) / 6) : e < Ce.start && (e = Ce.start + (e - Ce.start) / 6)) : (e = d(e, Ce.start, Ce.end)),
(et.start = +new Date()),
(et.time = 0),
(et.from = Ce.cur),
(et.to = e),
(et.delta = e - Ce.cur),
(et.tweesing = at.tweese || (at.init && !at.slidee)),
(et.immediate = !et.tweesing && (t || (at.init && at.slidee) || !ge.speed)),
(at.tweese = 0),
e !== Ce.dest && ((Ce.dest = e), pe('change'), it || Y()),
K(),
Q(),
Z(),
F()
}
function Y() {
if (ye.initialized) {
if (!it) return (it = w(Y)), void (at.released && pe('moveStart'))
et.immediate
? (Ce.cur = et.to)
: et.tweesing
? ((et.tweeseDelta = et.to - Ce.cur), x(et.tweeseDelta) < 0.1 ? (Ce.cur = et.to) : (Ce.cur += et.tweeseDelta * (at.released ? ge.swingSpeed : ge.syncSpeed)))
: ((et.time = N(+new Date() - et.start, ge.speed)), (Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed))),
et.to === Ce.cur ? ((Ce.cur = et.to), (at.tweese = it = 0)) : (it = w(Y)),
pe('move'),
we || (f ? (Pe[0].style[f] = v + (ge.horizontal ? 'translateX' : 'translateY') + '(' + -Ce.cur + 'px)') : (Pe[0].style[ge.horizontal ? 'left' : 'top'] = -E(Ce.cur) + 'px')),
!it && at.released && pe('moveEnd'),
j()
}
}
function j() {
Se.length &&
((xe.cur = Ce.start === Ce.end ? 0 : (((at.init && !at.slidee ? Ce.dest : Ce.cur) - Ce.start) / (Ce.end - Ce.start)) * xe.end),
(xe.cur = d(E(xe.cur), xe.start, xe.end)),
_e.hPos !== xe.cur &&
((_e.hPos = xe.cur), f ? (Se[0].style[f] = v + (ge.horizontal ? 'translateX' : 'translateY') + '(' + xe.cur + 'px)') : (Se[0].style[ge.horizontal ? 'left' : 'top'] = xe.cur + 'px')))
}
function F() {
Ae[0] && _e.page !== Oe.activePage && ((_e.page = Oe.activePage), Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass), pe('activePage', _e.page))
}
function M() {
;(tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start)) || ye.stop(),
(ot = at.init ? w(M) : 0),
(tt.now = +new Date()),
(tt.pos = Ce.cur + ((tt.now - tt.lastTime) / 1e3) * tt.speed),
X(at.init ? tt.pos : E(tt.pos)),
at.init || Ce.cur !== Ce.dest || pe('moveEnd'),
(tt.lastTime = tt.now)
}
function L(e, t, n) {
if (('boolean' === i(t) && ((n = t), (t = a)), t === a)) X(Ce[e], n)
else {
if (Le && 'center' !== e) return
var r = ye.getPos(t)
r && X(r[e], n, !Le)
}
}
function R(e) {
return null != e ? (l(e) ? (e >= 0 && e < Ne.length ? e : -1) : qe.index(e)) : -1
}
function U(e) {
return R(l(e) && 0 > e ? e + Ne.length : e)
}
function W(e, t) {
var a = R(e)
return (
!(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass), qe.eq(a).addClass(ge.activeClass), (_e.active = Oe.activeItem = a), Z(), pe('active', a)), a)
)
}
function $(e) {
e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end)
var t = {},
a = Me ? 0 : Ie / 2
if (!we)
for (var n = 0, i = Ee.length; i > n; n++) {
if (e >= Ce.end || n === Ee.length - 1) {
t.activePage = Ee.length - 1
break
}
if (e <= Ee[n] + a) {
t.activePage = n
break
}
}
if (Re) {
for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
if ((r === !1 && e <= Ne[c].start + Ne[c].half && (r = c), o === !1 && e <= Ne[c].center + Ne[c].half && (o = c), c === u - 1 || e <= Ne[c].end + Ne[c].half)) {
s = c
break
}
;(t.firstItem = l(r) ? r : 0), (t.centerItem = l(o) ? o : t.firstItem), (t.lastItem = l(s) ? s : t.centerItem)
}
return t
}
function Q(t) {
e.extend(Oe, $(t))
}
function Z() {
var e = Ce.dest <= Ce.start,
t = Ce.dest >= Ce.end,
a = (e ? 1 : 0) | (t ? 2 : 0)
if (
(_e.slideePosState !== a &&
((_e.slideePosState = a),
Je.is('button,input') && Je.prop('disabled', e),
Ke.is('button,input') && Ke.prop('disabled', t),
Je.add(Qe)[e ? 'addClass' : 'removeClass'](ge.disabledClass),
Ke.add($e)[t ? 'addClass' : 'removeClass'](ge.disabledClass)),
_e.fwdbwdState !== a && at.released && ((_e.fwdbwdState = a), Qe.is('button,input') && Qe.prop('disabled', e), $e.is('button,input') && $e.prop('disabled', t)),
Re && null != Oe.activeItem)
) {
var n = 0 === Oe.activeItem,
i = Oe.activeItem >= Ne.length - 1,
r = (n ? 1 : 0) | (i ? 2 : 0)
_e.itemsButtonState !== r &&
((_e.itemsButtonState = r),
Ze.is('button,input') && Ze.prop('disabled', n),
Ge.is('button,input') && Ge.prop('disabled', i),
Ze[n ? 'addClass' : 'removeClass'](ge.disabledClass),
Ge[i ? 'addClass' : 'removeClass'](ge.disabledClass))
}
}
function G(e, t, a) {
if (((e = U(e)), (t = U(t)), e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1))) {
qe.eq(e)[a ? 'insertAfter' : 'insertBefore'](Ne[t].el)
var n = t > e ? e : a ? t : t - 1,
i = e > t ? e : a ? t + 1 : t,
r = e > t
null != Oe.activeItem &&
(e === Oe.activeItem ? (_e.active = Oe.activeItem = a ? (r ? t + 1 : t) : r ? t : t - 1) : Oe.activeItem > n && Oe.activeItem < i && (_e.active = Oe.activeItem += r ? 1 : -1)),
H()
}
}
function J(e, t) {
for (var a = 0, n = Ve[e].length; n > a; a++) if (Ve[e][a] === t) return a
return -1
}
function K() {
at.released && !ye.isPaused && ye.resume()
}
function V(e) {
return E((d(e, xe.start, xe.end) / xe.end) * (Ce.end - Ce.start)) + Ce.start
}
function _() {
;(at.history[0] = at.history[1]), (at.history[1] = at.history[2]), (at.history[2] = at.history[3]), (at.history[3] = at.delta)
}
function ee(e) {
;(at.released = 0), (at.source = e), (at.slidee = 'slidee' === e)
}
function te(t) {
var a = 'touchstart' === t.type,
n = t.data.source,
i = 'slidee' === n
at.init ||
(!a && ie(t.target)) ||
(('handle' !== n || (ge.dragHandle && xe.start !== xe.end)) &&
(!i || (a ? ge.touchDragging : ge.mouseDragging && t.which < 2)) &&
(a || r(t),
ee(n),
(at.init = 0),
(at.$source = e(t.target)),
(at.touch = a),
(at.pointer = a ? t.originalEvent.touches[0] : t),
(at.initX = at.pointer.pageX),
(at.initY = at.pointer.pageY),
(at.initPos = i ? Ce.cur : xe.cur),
(at.start = +new Date()),
(at.time = 0),
(at.path = 0),
(at.delta = 0),
(at.locked = 0),
(at.history = [0, 0, 0, 0]),
(at.pathToLock = i ? (a ? 30 : 10) : 0),
b.on(a ? z : I, ae),
ye.pause(1),
(i ? Pe : Se).addClass(ge.draggedClass),
pe('moveStart'),
i && (rt = setInterval(_, 10))))
}
function ae(e) {
if (
((at.released = 'mouseup' === e.type || 'touchend' === e.type),
(at.pointer = at.touch ? e.originalEvent[at.released ? 'changedTouches' : 'touches'][0] : e),
(at.pathX = at.pointer.pageX - at.initX),
(at.pathY = at.pointer.pageY - at.initY),
(at.path = D(A(at.pathX, 2) + A(at.pathY, 2))),
(at.delta = ge.horizontal ? at.pathX : at.pathY),
at.released || !(at.path < 1))
) {
if (!at.init) {
if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY))) return ne()
at.init = 1
}
r(e),
!at.locked && at.path > at.pathToLock && at.slidee && ((at.locked = 1), at.$source.on(B, s)),
at.released && (ne(), ge.releaseSwing && at.slidee && ((at.swing = ((at.delta - at.history[0]) / 40) * 300), (at.delta += at.swing), (at.tweese = x(at.swing) > 10))),
X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
}
}
function ne() {
clearInterval(rt),
(at.released = !0),
b.off(at.touch ? z : I, ae),
(at.slidee ? Pe : Se).removeClass(ge.draggedClass),
setTimeout(function () {
at.$source.off(B, s)
}),
Ce.cur === Ce.dest && at.init && pe('moveEnd'),
ye.resume(1),
(at.init = 0)
}
function ie(t) {
return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
}
function re() {
ye.stop(), b.off('mouseup', re)
}
function se(e) {
switch ((r(e), this)) {
case $e[0]:
case Qe[0]:
ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy), b.on('mouseup', re)
break
case Ze[0]:
ye.prev()
break
case Ge[0]:
ye.next()
break
case Je[0]:
ye.prevPage()
break
case Ke[0]:
ye.nextPage()
}
}
function oe(e) {
return (
(nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta),
(nt.curDelta /= 1 === e.deltaMode ? 3 : 100),
Re
? ((p = +new Date()),
nt.last < p - nt.resetTime && (nt.delta = 0),
(nt.last = p),
(nt.delta += nt.curDelta),
x(nt.delta) < 1 ? (nt.finalDelta = 0) : ((nt.finalDelta = E(nt.delta / 1)), (nt.delta %= 1)),
nt.finalDelta)
: nt.curDelta
)
}
function le(e) {
e.originalEvent[g] = ye
var t = +new Date()
if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window) return void (O = t)
if (ge.scrollBy && Ce.start !== Ce.end) {
var a = oe(e.originalEvent)
;(ge.scrollTrap || (a > 0 && Ce.dest < Ce.end) || (0 > a && Ce.dest > Ce.start)) && r(e, 1), ye.slideBy(ge.scrollBy * a)
}
}
function ce(e) {
ge.clickBar && e.target === Be[0] && (r(e), X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
}
function de(e) {
if (ge.keyboardNavBy)
switch (e.which) {
case ge.horizontal ? 37 : 38:
r(e), ye['pages' === ge.keyboardNavBy ? 'prevPage' : 'prev']()
break
case ge.horizontal ? 39 : 40:
r(e), ye['pages' === ge.keyboardNavBy ? 'nextPage' : 'next']()
}
}
function ue(e) {
return ie(this) ? void (e.originalEvent[g + 'ignore'] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + 'ignore'] || ye.activate(this))
}
function fe() {
this.parentNode === De[0] && ye.activatePage(Ae.index(this))
}
function ve(e) {
ge.pauseOnHover && ye['mouseenter' === e.type ? 'pause' : 'resume'](2)
}
function pe(e, t) {
if (Ve[e]) {
for (me = Ve[e].length, T.length = 0, he = 0; me > he; he++) T.push(Ve[e][he])
for (he = 0; me > he; he++) T[he].call(ye, e, t)
}
}
var he,
me,
ge = e.extend({}, n.defaults, h),
ye = this,
we = l(t),
be = e(t),
Pe = ge.slidee ? e(ge.slidee).eq(0) : be.children().eq(0),
Ie = 0,
ze = 0,
Ce = {
start: 0,
center: 0,
end: 0,
cur: 0,
dest: 0
},
Be = e(ge.scrollBar).eq(0),
Se = Be.children().eq(0),
ke = 0,
Te = 0,
xe = {
start: 0,
end: 0,
cur: 0
},
De = e(ge.pagesBar),
Ae = 0,
Ee = [],
qe = 0,
Ne = [],
Oe = {
firstItem: 0,
lastItem: 0,
centerItem: 0,
activeItem: null,
activePage: 0
},
He = new u(be[0]),
Xe = new u(Pe[0]),
Ye = new u(Be[0]),
je = new u(Se[0]),
Fe = 'basic' === ge.itemNav,
Me = 'forceCentered' === ge.itemNav,
Le = 'centered' === ge.itemNav || Me,
Re = !we && (Fe || Le || Me),
Ue = ge.scrollSource ? e(ge.scrollSource) : be,
We = ge.dragSource ? e(ge.dragSource) : be,
$e = e(ge.forward),
Qe = e(ge.backward),
Ze = e(ge.prev),
Ge = e(ge.next),
Je = e(ge.prevPage),
Ke = e(ge.nextPage),
Ve = {},
_e = {},
et = {},
tt = {},
at = {
released: 1
},
nt = {
last: 0,
delta: 0,
resetTime: 200
},
it = 0,
rt = 0,
st = 0,
ot = 0
we || (t = be[0]),
(ye.initialized = 0),
(ye.frame = t),
(ye.slidee = Pe[0]),
(ye.pos = Ce),
(ye.rel = Oe),
(ye.items = Ne),
(ye.pages = Ee),
(ye.isPaused = 0),
(ye.options = ge),
(ye.dragging = at),
(ye.reload = function () {
H()
}),
(ye.getPos = function (e) {
if (Re) {
var t = R(e)
return -1 !== t && Ne[t]
}
var a = Pe.find(e).eq(0)
if (a[0]) {
var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top,
i = a[ge.horizontal ? 'outerWidth' : 'outerHeight']()
return {
start: n,
center: n - Ie / 2 + i / 2,
end: n - Ie + i,
size: i
}
}
return !1
}),
(ye.moveBy = function (e) {
;(tt.speed = e),
!at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && ((tt.lastTime = +new Date()), (tt.startPos = Ce.cur), ee('button'), (at.init = 1), pe('moveStart'), y(ot), M())
}),
(ye.stop = function () {
'button' === at.source && ((at.init = 0), (at.released = 1))
}),
(ye.prev = function () {
ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
}),
(ye.next = function () {
ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
}),
(ye.prevPage = function () {
ye.activatePage(Oe.activePage - 1)
}),
(ye.nextPage = function () {
ye.activatePage(Oe.activePage + 1)
}),
(ye.slideBy = function (e, t) {
e && (Re ? ye[Le ? 'toCenter' : 'toStart'](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
}),
(ye.slideTo = function (e, t) {
X(e, t)
}),
(ye.toStart = function (e, t) {
L('start', e, t)
}),
(ye.toEnd = function (e, t) {
L('end', e, t)
}),
(ye.toCenter = function (e, t) {
L('center', e, t)
}),
(ye.getIndex = R),
(ye.activate = function (e, t) {
var a = W(e)
ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
}),
(ye.activatePage = function (e, t) {
l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
}),
(ye.resume = function (e) {
ge.cycleBy &&
ge.cycleInterval &&
('items' !== ge.cycleBy || (Ne[0] && null != Oe.activeItem)) &&
!(e < ye.isPaused) &&
((ye.isPaused = 0),
st ? (st = clearTimeout(st)) : pe('resume'),
(st = setTimeout(function () {
switch ((pe('cycle'), ge.cycleBy)) {
case 'items':
ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1)
break
case 'pages':
ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
}
}, ge.cycleInterval)))
}),
(ye.pause = function (e) {
e < ye.isPaused || ((ye.isPaused = e || 100), st && ((st = clearTimeout(st)), pe('pause')))
}),
(ye.toggle = function () {
ye[st ? 'pause' : 'resume']()
}),
(ye.set = function (t, a) {
e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
}),
(ye.add = function (t, a) {
var n = e(t)
Re
? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el), null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length))
: Pe.append(n),
H()
}),
(ye.remove = function (t) {
if (Re) {
var a = U(t)
if (a > -1) {
qe.eq(a).remove()
var n = a === Oe.activeItem
null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem), H(), n && ((_e.active = null), ye.activate(Oe.activeItem))
}
} else e(t).remove(), H()
}),
(ye.moveAfter = function (e, t) {
G(e, t, 1)
}),
(ye.moveBefore = function (e, t) {
G(e, t)
}),
(ye.on = function (e, t) {
if ('object' === i(e)) for (var a in e) e.hasOwnProperty(a) && ye.on(a, e[a])
else if ('function' === i(t)) for (var n = e.split(' '), r = 0, s = n.length; s > r; r++) (Ve[n[r]] = Ve[n[r]] || []), -1 === J(n[r], t) && Ve[n[r]].push(t)
else if ('array' === i(t)) for (var o = 0, l = t.length; l > o; o++) ye.on(e, t[o])
}),
(ye.one = function (e, t) {
function a() {
t.apply(ye, arguments), ye.off(e, a)
}
ye.on(e, a)
}),
(ye.off = function (e, t) {
if (t instanceof Array) for (var a = 0, n = t.length; n > a; a++) ye.off(e, t[a])
else
for (var i = e.split(' '), r = 0, s = i.length; s > r; r++)
if (((Ve[i[r]] = Ve[i[r]] || []), null == t)) Ve[i[r]].length = 0
else {
var o = J(i[r], t)
;-1 !== o && Ve[i[r]].splice(o, 1)
}
}),
(ye.destroy = function () {
return (
Ue.add(Se)
.add(Be)
.add(De)
.add($e)
.add(Qe)
.add(Ze)
.add(Ge)
.add(Je)
.add(Ke)
.off('.' + g),
b.off('keydown', de),
Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
De.empty(),
we || (be.off('.' + g), He.restore(), Xe.restore(), Ye.restore(), je.restore(), e.removeData(t, g)),
(Ne.length = Ee.length = 0),
(_e = {}),
(ye.initialized = 0),
ye
)
}),
(ye.init = function () {
if (!ye.initialized) {
ye.on(m)
var e = ['overflow', 'position'],
t = ['position', 'webkitTransform', 'msTransform', 'transform', 'left', 'top', 'width', 'height']
He.save.apply(He, e), Ye.save.apply(Ye, e), Xe.save.apply(Xe, t), je.save.apply(je, t)
var a = Se
return (
we || ((a = a.add(Pe)), be.css('overflow', 'hidden'), f || 'static' !== be.css('position') || be.css('position', 'relative')),
f
? v && a.css(f, v)
: ('static' === Be.css('position') && Be.css('position', 'relative'),
a.css({
position: 'absolute'
})),
ge.forward && $e.on(S, se),
ge.backward && Qe.on(S, se),
ge.prev && Ze.on(B, se),
ge.next && Ge.on(B, se),
ge.prevPage && Je.on(B, se),
ge.nextPage && Ke.on(B, se),
Ue.on(C, le), // C是 "wheel.sly" 滚动监听
Be[0] && Be.on(B, ce),
Re && ge.activateOn && be.on(ge.activateOn + '.' + g, '*', ue),
De[0] && ge.activatePageOn && De.on(ge.activatePageOn + '.' + g, '*', fe),
We.on(
P,
{
source: 'slidee'
},
te
),
Se &&
Se.on(
P,
{
source: 'handle'
},
te
),
b.on('keydown', de),
we || (be.on('mouseenter.' + g + ' mouseleave.' + g, ve), be.on('scroll.' + g, o)),
(ye.initialized = 1),
H(!0),
ge.cycleBy && !we && ye[ge.startPaused ? 'pause' : 'resume'](),
ye
)
}
})
}
function i(e) {
return null == e
? String(e)
: 'object' == typeof e || 'function' == typeof e
? Object.prototype.toString
.call(e)
.match(/\s([a-z]+)/i)[1]
.toLowerCase() || 'object'
: typeof e
}
function r(e, t) {
e.preventDefault(), t && e.stopPropagation()
}
function s(t) {
r(t, 1), e(this).off(t.type, s)
}
function o() {
;(this.scrollLeft = 0), (this.scrollTop = 0)
}
function l(e) {
return !isNaN(parseFloat(e)) && isFinite(e)
}
function c(e, t) {
return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ''))
}
function d(e, t, a) {
return t > e ? t : e > a ? a : e
}
function u(e) {
var t = {}
return (
(t.style = {}),
(t.save = function () {
if (e && e.nodeType) {
for (var a = 0; a < arguments.length; a++) t.style[arguments[a]] = e.style[arguments[a]]
return t
}
}),
(t.restore = function () {
if (e && e.nodeType) {
for (var a in t.style) t.style.hasOwnProperty(a) && (e.style[a] = t.style[a])
return t
}
}),
t
)
}
var f,
v,
p,
h = 'sly',
m = 'Sly',
g = h,
y = t.cancelAnimationFrame || t.cancelRequestAnimationFrame,
w = t.requestAnimationFrame,
b = e(document),
P = 'touchstart.' + g + ' mousedown.' + g,
I = 'mousemove.' + g + ' mouseup.' + g,
z = 'touchmove.' + g + ' touchend.' + g,
C = (document.implementation.hasFeature('Event.wheel', '3.0') ? 'wheel.' : 'mousewheel.') + g,
B = 'click.' + g,
S = 'mousedown.' + g,
k = ['INPUT', 'SELECT', 'BUTTON', 'TEXTAREA'],
T = [],
x = Math.abs,
D = Math.sqrt,
A = Math.pow,
E = Math.round,
q = Math.max,
N = Math.min,
O = 0
b.on(C, function (e) {
var t = e.originalEvent[g],
a = +new Date()
;(!t || t.options.scrollHijack < a - O) && (O = a)
}),
(function (e) {
function t(e) {
var t = new Date().getTime(),
n = Math.max(0, 16 - (t - a)),
i = setTimeout(e, n)
return (a = t), i
}
w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t
var a = new Date().getTime(),
n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout
y = function (t) {
n.call(e, t)
}
})(window),
(function () {
function e(e) {
for (var n = 0, i = t.length; i > n; n++) {
var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e
if (null != a.style[r]) return r
}
}
var t = ['', 'webkit', 'moz', 'ms', 'o'],
a = document.createElement('div')
;(f = e('transform')), (v = e('perspective') ? 'translateZ(0) ' : '')
})(),
(t[m] = n),
(e.fn[h] = function (t, a) {
var r, s
return (
e.isPlainObject(t) || (('string' === i(t) || t === !1) && ((r = t === !1 ? 'destroy' : t), (s = Array.prototype.slice.call(arguments, 1))), (t = {})),
this.each(function (i, o) {
var l = e.data(o, g)
l || r ? l && r && l[r] && l[r].apply(l, s) : (l = e.data(o, g, new n(o, t, a).init()))
})
)
}),
(n.defaults = {
slidee: null,
horizontal: !1,
itemNav: null,
itemSelector: null,
smart: !1,
activateOn: null,
activateMiddle: !1,
scrollSource: null,
scrollBy: 0,
scrollHijack: 300,
scrollTrap: !1,
dragSource: null,
mouseDragging: !1,
touchDragging: !1,
releaseSwing: !1,
swingSpeed: 0.2,
elasticBounds: !1,
interactive: null,
scrollBar: null,
dragHandle: !1,
dynamicHandle: !1,
minHandleSize: 50,
clickBar: !1,
syncSpeed: 0.5,
pagesBar: null,
activatePageOn: null,
pageBuilder: function (e) {
return '
' + (e + 1) + '
'
},
forward: null,
backward: null,
prev: null,
next: null,
prevPage: null,
nextPage: null,
cycleBy: null,
cycleInterval: 5e3,
pauseOnHover: !1,
startPaused: !1,
moveBy: 300,
speed: 0,
easing: 'swing',
startAt: null,
keyboardNavBy: null,
draggedClass: 'dragged',
activeClass: 'active',
disabledClass: 'disabled'
})
})(jQuery, window)
!(function e(t, i, n) {
function r(a, s) {
if (!i[a]) {
if (!t[a]) {
var l = 'function' == typeof require && require
if (!s && l) return l(a, !0)
if (o) return o(a, !0)
var c = new Error("Cannot find module '" + a + "'")
throw ((c.code = 'MODULE_NOT_FOUND'), c)
}
var h = (i[a] = {
exports: {}
})
t[a][0].call(
h.exports,
function (e) {
var i = t[a][1][e]
return r(i ? i : e)
},
h,
h.exports,
e,
t,
i,
n
)
}
return i[a].exports
}
for (var o = 'function' == typeof require && require, a = 0; a < n.length; a++) r(n[a])
return r
})(
{
1: [
function (e, t, i) {
;(function (i) {
'use strict'
function n(e) {
;(this.player = null),
(this.director = null),
(this.modelManager = null),
(this.container = null),
(this.tagManager = null),
(this.fadeInSpeed = e),
(null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed) || (this.fadeInSpeed = 0)
}
var r = e('three'),
o = e('./util/logger'),
a = (e('./util/common'), e('./enum/PlayerEvents')),
s = e('./enum/DirectorEvents'),
l = e('./settings'),
c = e('./enum/Viewmode'),
h = (e('./enum/WarpStyle'), e('./enum/BlackoutStyle'), e('./enum/ModelManagerEvents')),
u = e('./enum/tagEvents'),
d = e('./util/transitions'),
p = e('./util/lerp'),
f = new o(i)
//window.THREE = r;
;(n.prototype.init = function (e, t, i, n, r) {
window.app = this
;(this.player = t), (this.director = e), (this.modelManager = i), (this.tagManager = n), (this.container = r), this.updateModel(), this.bindEvents()
}),
(n.prototype.bindEvents = function () {
this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
this.player.on(a.StartInside, this.handleStartInside.bind(this)),
this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
}),
(n.prototype.updateModel = function () {
//模型this.model
this.model = this.modelManager.getActiveModel()
}),
(n.prototype.handleWarpStarted = function () {
this.hidePlayerReticule()
}),
(n.prototype.ontagActivated = function () {
this.hidePlayerReticule()
}),
(n.prototype.onNavigationTotag = function () {
this.hidePlayerReticule()
}),
(n.prototype.handlePlayerModeChanging = function (e, t, i) {
var n = this.modelManager.getActiveModel(),
r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity
n.fadePanoMarkers(r), n.setMode(t)
}),
(n.prototype.handlePlayerModeChanged = function (e, t) {
var i = this.modelManager.getActiveModel(),
n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide
i.setSide(n), i.setMode(t)
}),
(n.prototype.handleClosestPanoChanging = function (e, t, i) {
i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i), t && !this.director.tourIsPlaying && t.hoverOn(i))
}),
(n.prototype.handleActionInterruption = function () {}),
(n.prototype.handleStartInside = function (e) {
var t = l[this.player.mode],
i = e ? 0 : t.transitionTime * t.skyboxOpacityLength
this.fadeIn(this.fadeInSpeed), (this.model.alpha = 0), (this.model.skybox.material.uniforms.opacity.value = 1), this.model.fadePanoMarkers(e ? 0 : t.markerOpacity)
var n = this.player.reticule
d.start(p.property(n.material, 'opacity', 0), i, null, 0, null, 'retReOpac')
}),
(n.prototype.handleStartOutside = function (e) {
this.fadeIn(e)
}),
(n.prototype.fadeIn = function (e) {
;(null !== e && void 0 !== e) || ((e = 2e3), f.warn('DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.')), $(this.container).fadeIn(e)
}),
(n.prototype.hidePlayerReticule = function () {
this.player.reticule.hide()
}),
(t.exports = n)
}).call(this, '/js/DisplayController.js')
},
{
'./enum/BlackoutStyle': 18,
'./enum/DirectorEvents': 23,
'./enum/tagEvents': 32,
'./enum/ModelManagerEvents': 33,
'./enum/PlayerEvents': 40,
'./enum/Viewmode': 51,
'./enum/WarpStyle': 52,
'./settings': 166,
'./util/common': 185,
'./util/lerp': 188,
'./util/logger': 189,
'./util/transitions': 195,
three: 217
}
],
2: [
function (e, t, i) {
'use strict'
function n() {
;(this.baseStartTime = performance.timing.navigationStart), (this.loadingStartTime = null), (this.waitingStartTime = null), (this.appReadyTime = null)
}
;(n.prototype.setBaseStartTime = function (e) {
this.baseStartTime = e || Date.now()
}),
(n.prototype.setWaitingStartTime = function (e) {
this.waitingStartTime = e || Date.now()
}),
(n.prototype.setLoadingStartTime = function (e) {
this.loadingStartTime = e || Date.now()
}),
(n.prototype.setAppReadyTime = function (e) {
this.appReadyTime = e || Date.now()
}),
(n.prototype.calcFullLoadingTime = function () {
var e = this.appReadyTime - this.baseStartTime
return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime), e
}),
(t.exports = n)
},
{}
],
3: [
function (e, t, i) {
;(function (i) {
'use strict'
function n() {
return 100 * Math.random()
}
var r = e('./util/logger'),
o = e('./util/browser'),
a = new r(i),
s = (window.MP_AB_TESTS = window.MP_AB_TESTS || {
initialized: !1,
init: function (e, t) {
if (((t = t || {}), !this.initialized)) {
;(this.initialized = !0),
o.valueFromHash('tilegen') && (t.tilegen = 1 === o.valueFromHash('tilegen', 0)),
o.valueFromHash('imgopt') && (t.imgopt = 1 === o.valueFromHash('imgopt', 0))
for (var i in e) {
var r = i.match('^sc_tilegen_([0-9]+)$')
r && (s.tilegen = n() < parseInt(r[1]))
var l = i.match('^sc_imgopt_([0-9]+)$')
l && (s.imgopt = n() < parseInt(l[1]))
}
for (var c in t) (s[c] = t[c]), a.debug('A/B override:', c, s[c])
}
},
changeIfTileGenerating: function (e) {
return s.tilegen && ((e += e.indexOf('?') === -1 ? '?' : '&'), (e += '')), e
},
changeIfImageOptimzing: function (e) {
return s.imgopt && e.indexOf('imgopt=1') === -1 && ((e += e.indexOf('?') === -1 ? '?' : '&'), (e += '')), e
},
tilegen: !1,
imgopt: !1
})
t.exports = s
}).call(this, '/js/ab.js')
},
{
'./util/browser': 182,
'./util/logger': 189
}
],
4: [
function (e, t, i) {
;(function (i) {
'use strict'
function n() {
return {
addons: [
{
name: 'keen:ua_parser',
input: {
ua_string: 'user_agent'
},
output: 'parsed_user_agent'
}
]
}
}
function r(e, t, i, n) {
function r(t) {
l[t.sid] = !0
var i = t.billboard.media && t.billboard.media.type,
n = {
tag_id: t.sid,
tags_visited: Object.keys(l).length,
tag_count: Object.keys(e.tags).length,
tag_view_count: ++E,
has_media: !!i
}
i && (n.media_type = i), u('tag_opened', n)
}
var l = {},
h = Date.now() - N,
f = null
n && (f = Date.now() - window.navigationStart)
var g
try {
g = /* e.data.player_options.highlight_reel && */ e.heroLocations.length > 0
} catch (e) {
g = !1
}
var v,
A = e.supportsVR
A ||
((v = 'VR disabled at the model/account level'),
m.valueFromHash('vr') === _.NONE
? (v = 'VR disabled, using &vr=0')
: m.detectAndroid()
? b.isDeviceSupported(w.Android) || (v = 'VR disabled, unsupported Android version')
: m.detectIOS() && (b.isDeviceSupported(w.IOS) || (v = 'VR disabled, unsupported iOS version'))),
u('model_loaded', {
duration: h,
duration_from_navigation_start: f,
has_hlr: g,
has_vr: A,
vr_reason: v
})
var I = 0
e.panos.forEach(function (e) {
e.on('enter', function () {
c('pano_viewed', {
pano_id: e.id,
pano_view_count: ++I,
alignment_type: e.alignmentType,
interaction_source: O,
navigation_source: p
})
})
})
var E = 0
for (var T in e.tags) e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]))
t.on('tour_auto', function (e) {
p = 'tour_' + e
}),
t.on('tour_manual', function (e) {
;(O = 'gui-' + e), (p = 'tour_manual')
}),
i.on(C.InteractionKey, function () {
t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
}),
i.on(C.InteractionDirect, function () {
t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
}),
o(t),
a(),
s()
}
function o(e) {
I.on(T.OPENED, function () {
c('showcase_share_intent', {
pano_id: e.currentPano && e.currentPano.id
})
}),
I.on(T.LINK_CLICKED, function (t) {
c('showcase_share_action', {
channel: t.channel,
pano_id: e.currentPano && e.currentPano.id
})
}),
E.on(x.ORIGIN_LINK_CLICKED, function () {
c('showcase_share_origin_link_clicked')
})
}
function a() {}
function s() {
b.on(
S.OPENED,
c.bind(this, 'showcase_gui', {
gui_action: 'click_vr_button'
})
),
b.on(S.LAUNCH, function (e) {
c('showcase_gui', {
gui_action: 'launch_vr',
vr_platform: e.vr_platform,
vr_app: e.vr_app
})
}),
b.on(
S.PREV,
c.bind(this, 'showcase_gui', {
gui_action: 'vr_modal_prev'
})
),
b.on(S.NEXT, function (e) {
c('showcase_gui', {
gui_action: e.nextAction
})
}),
b.on(
S.CLOSED,
c.bind(this, 'showcase_gui', {
gui_action: 'vr_modal_close'
})
),
b.on(S.falseICECHOSEN, function (e) {
c('showcase_gui', {
gui_action: e.name + ' '
})
}),
b.on(S.STORE, function (e) {
c('showcase_gui', {
gui_action: 'launch_store',
store: e
})
})
}
function l(e, t) {
if (f)
try {
f.addEvent(
e,
v.extendObject(
{
host: window.location.host,
keen: n(),
user_agent: '${keen.user_agent}',
referrer: {
url: v.normalizeUrl(document.referrer),
domain: v.domainFromUrl(document.referrer),
url_original: document.referrer
},
embedded: m.inIframe(),
is_mobile: m.isMobile(),
version: '2.25.6-0-gd87e5b1'
},
t
)
)
} catch (e) {
P.warn('analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: ' + e)
}
}
function c(e, t) {
if (((t = t || {}), L))
try {
window.analytics.track(e, v.extendObject(t, B), {
context: {
app: {
name: 'showcase',
version: '2.25.6-0-gd87e5b1'
},
screen: {
width: window.screen.width,
height: window.screen.height,
density: window.devicePixelRatio
}
}
})
} catch (t) {
console.warn('Failed to send data to segment for ' + e)
}
}
function h(e, t) {
if (((t = t || {}), navigator.sendBeacon && L))
try {
navigator.sendBeacon(
'https://api.segment.io/v1/t',
JSON.stringify({
event: e,
anonymousId: window.analytics.user().anonymousId(),
properties: v.extendObject(t, B),
writeKey: L,
sentAt: Date.now(),
type: 'track',
context: {
userAgent: m.userAgent(),
library: {
name: 'showcase-beacon',
version: '2.25.6-0-gd87e5b1'
},
app: {
name: 'showcase',
version: '2.25.6-0-gd87e5b1'
}
}
})
)
} catch (e) {
console.warn('Failed to send async segment request')
}
}
function u(e, t) {
;(t = t || {}), c(e, t)
}
function d(e, t) {
;(O = e === C.InteractionGui ? 'gui-' + t : e), (p = 'self_guided')
}
var p,
f,
g = (e('three'), e('./util/ajax'), e('./ab')),
m = e('./util/browser'),
v = e('./util/common'),
A = e('./settings'),
y = (e('./localization/localize'), e('./enum/Viewmode')),
C = e('./enum/ControlEvents'),
I = e('./gui/sharing/modal'),
E = e('./gui/title/titleBar'),
b = e('./gui/vr/vrModal'),
w = e('./enum/VRPlatforms'),
_ = e('./enum/VROption'),
T = e('./gui/sharing/ShareEvents'),
x = e('./gui/title/TitleEvents'),
S = e('./gui/vr/vrEvent'),
M = e('./tag/Billboard/BillboardEvent'),
R = e('./util/logger'),
P = new R(i),
O = (e('./enum/PlayerEvents'), 'direct'),
L = null,
D = !1,
N = null,
B = null,
F = v.uuid4()
t.exports = {
report: function (e, t, i, n) {
l('Session starts', {
model: e,
status: t,
loadtime: Date.now() - (N || Date.now()),
loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
autoplay: i,
quickstart: n,
ab_tilegen: g.tilegen,
ab_imgopt: g.imgopt
})
},
impression: function (e) {
e = e || {}
var t = void 0 === e.isVisible || e.isVisible,
i = (void 0 !== e.immediate && e.immediate, window.location.search.substr(1).split('&'))
u('impression', {
visible: t,
url_params: i
})
},
initKeen: function (e) {
return e.token && e.appId
? void (f = new Keen({
projectId: e.appId,
writeKey: e.token,
readKey: '',
requestType: 'xhr'
}))
: void P.warn('no keen token/appId')
},
initSegment: function (e) {
return e.token
? ((L = e.token),
window.analytics.load(e.token),
(B = {
model_id: e.model,
start_source: e.startSource,
autoplay: e.autoplay,
quickstart: e.quickstart,
language_tag: A.languageTag,
is_mobile: m.isMobile(),
iframe: m.inIframe(),
aspect_ratio: m.aspectRatio(),
session_id: F,
window: {
width: $('#player').width(),
height: $('#player').height()
},
platform: {
browser: {
name: $.ua.browser.name,
major: $.ua.browser.major,
version: $.ua.browser.version
},
os: {
name: $.ua.os.name,
version: $.ua.os.version
},
device: {
vendor: $.ua.device.vendor,
model: $.ua.device.model,
type: $.ua.device.type
}
}
}),
(D = Math.random() < A.analytics.sessionTrackingRate),
P.debug('tracking sample rate = ' + A.analytics.sessionTrackingRate),
void P.debug('tracking this session = ' + D))
: void P.warn('no segment token')
},
sessionStart: function (e) {
P.debug('analytics user_session_start'),
c('session_started'),
(N = Date.now()),
window.addEventListener('unload', function () {
h('session_ended', {
duration: Date.now() - N
})
})
},
modelLoaded: function (e, t, i, n) {
r(e, t, i, n)
},
loadComplete: function (e) {
var t = {
time_to_app_start: e
}
c('load_times', t)
},
track: function (e, t) {
D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + ' )'), c(e, t))
},
trackAlways: function (e, t) {
P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + ' )'), c(e, t)
},
getSessionId: function () {
return F
},
updateInteraction: d
}
}).call(this, '/js/analytics.js')
},
{
'./ab': 3,
'./enum/ControlEvents': 21,
'./enum/PlayerEvents': 40,
'./enum/VROption': 47,
'./enum/VRPlatforms': 49,
'./enum/Viewmode': 51,
'./gui/sharing/ShareEvents': 76,
'./gui/sharing/modal': 77,
'./gui/title/TitleEvents': 80,
'./gui/title/titleBar': 82,
'./gui/vr/vrEvent': 85,
'./gui/vr/vrModal': 87,
'./localization/localize': 108,
'./tag/Billboard/BillboardEvent': 120,
'./settings': 166,
'./util/ajax': 181,
'./util/browser': 182,
'./util/common': 185,
'./util/logger': 189,
three: 217
}
],
5: [
function (e, t, i) {
'use strict'
function n() {
r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $('#player').width() / $('#player').height(), o.dollhouseNear, o.dollhouseFar), (this.controls = null)
}
var r = e('three'),
o = e('../constants'),
a = e('../util/cameraLight')
;(n.prototype = Object.create(r.PerspectiveCamera.prototype)),
(n.prototype.updateAspect = function (e) {
;(this.aspect = e), this.updateProjectionMatrix()
}),
(t.exports = n)
},
{
'../constants': 8,
'../util/cameraLight': 184,
three: 217
}
],
6: [
function (e, t, i) {
'use strict'
function n() {
var e = $('#player').width() / $('#player').height()
r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar), (this.controls = null), this.updateAspect(e)
}
var r = e('three'),
o = e('../constants')
;(n.prototype = Object.create(r.OrthographicCamera.prototype)),
(n.prototype.updateAspect = function (e) {
;(this.aspect = e), (this.top = o.orthoBase / e), (this.bottom = -o.orthoBase / e), this.updateProjectionMatrix()
}),
(t.exports = n)
},
{
'../constants': 8,
three: 217
}
],
7: [
function (e, t, i) {
'use strict'
function n() {
r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $('#player').width() / $('#player').height(), o.insideNear, o.insideFar), (this.controls = null)
}
var r = e('three'),
o = e('../settings'),
a = e('../util/cameraLight')
;(n.prototype = Object.create(r.PerspectiveCamera.prototype)),
(n.prototype.updateAspect = function (e) {
;(this.aspect = e), this.updateProjectionMatrix()
}),
(t.exports = n)
},
{
'../settings': 166,
'../util/cameraLight': 184,
three: 217
}
],
8: [
function (e, t, i) {
'use strict'
t.exports = {
signedUrlDefaultExpireTime: 24e4,
signedUrlCheckInterval: 1e4,
signedUrlRefreshBuffer: 15e3,
dollhouseFOV: 70,
dollhouseNear: 1,
dollhouseFar: 5e3,
insideFOV: 70,
insideFOVMax: 120,
insideNear: 0.1,
insideFar: 5e3,
insideLookSpeed: 0.12,
insideLookLimitUp: 40, //视角
insideLookLimitDown: -40,
orthoNear: 1,
orthoFar: 5e3,
orthoBase: 10,
narrowLandscapeHeight: 290,
reallyNarrowLandscapeHeight: 250,
visionTilingStartDate: new Date('8/26/2016'),
visionTilingStartVersion: '1.1.407.13667',
windowHeightHighQualityThreshold: 900,
tourStepDelayDefault: 3500,
tourStepDelaySlideShow: 5e3,
workshopApsect: 9 / 16,
highQualityMaxZoom: 2,
ultraHighQualityMaxZoom: 3
}
},
{}
],
9: [
function (e, t, i) {
'use strict'
function n() {
;(this.activeControl = null), (this.controls = {}), (this.cameras = {})
}
var r = e('./PanoramaControls'),
o = e('./DollhouseControls'),
a = e('./FloorplanControls'),
s = e('../cameras/PanoramaCamera'),
l = e('../cameras/DollhouseCamera'),
c = e('../cameras/FloorplanCamera'),
h = e('events').EventEmitter,
u = e('../enum/ControlEvents'),
d = e('../enum/ModelManagerEvents'),
p = e('../enum/Viewmode'),
f = e('../settings')
;(n.prototype = Object.create(h.prototype)),
(n.prototype.init = function (e, t) {
this.setUpControls(), this.bindEvents(e, t)
}),
(n.prototype.activateControls = function (e) {
this.activeControl && (this.activeControl.reset(), (this.activeControl.enabled = !1)), this.controls[e] && (this.controls[e].enabled = !0), (this.activeControl = this.controls[e])
}),
(n.prototype.setUpControls = function () {
var e = {},
t = {},
i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN],
n = [s, l, c],
h = [r, o, a]
i.forEach(
function (i, r) {
;(e[i] = new n[r]()),
(t[i] = new h[r](e[i])),
t[i].on(u.Move, this.emit.bind(this, u.Move)),
t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
}.bind(this)
),
(this.controls = t),
(this.cameras = e)
}),
(n.prototype.bindEvents = function (e, t) {
e.addEventListener('mousemove', this.onMouseMove.bind(this)),
e.addEventListener('mousedown', this.onMouseDown.bind(this)),
e.addEventListener('mouseup', this.onMouseUp.bind(this)),
e.addEventListener('mouseover', this.onMouseOver.bind(this)),
f.useWheel && (e.addEventListener('mousewheel', this.onMouseWheel.bind(this), { passive: false }), e.addEventListener('DOMMouseScroll', this.onMouseWheel.bind(this))),
e.addEventListener('touchstart', this.onTouchStart.bind(this)),
e.addEventListener('touchmove', this.onTouchMove.bind(this)),
e.addEventListener('touchend', this.onTouchEnd.bind(this)),
e.addEventListener('contextmenu', function (e) {
e.preventDefault()
}),
e.addEventListener('pointerdown', this.onPointerDown.bind(this)),
e.addEventListener('pointermove', this.onPointerMove.bind(this)),
e.addEventListener('pointerup', this.onPointerUp.bind(this)),
e.addEventListener('pointerout', this.onPointerCancel.bind(this)),
e.addEventListener('pointercancel', this.onPointerCancel.bind(this)),
document.addEventListener('keydown', this.onKeyDown.bind(this)),
document.addEventListener('keyup', this.onKeyUp.bind(this)),
t.on(
d.ActiveModelChanged,
function (e) {
this.setModelForControls(e.model)
}.bind(this)
)
}),
(n.prototype.setModelForControls = function (e) {
this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox)
var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding)
;[p.DOLLHOUSE, p.FLOORPLAN].forEach(
function (e) {
this.controls[e].setBounds(t)
}.bind(this)
)
}),
(n.prototype.onMouseDown = function (e) {
e.preventDefault(), this.activeControl && this.activeControl.onMouseDown(e)
}),
(n.prototype.onMouseMove = function (e) {
e.preventDefault(), this.activeControl && this.activeControl.onMouseMove(e)
}),
(n.prototype.onMouseUp = function (e) {
e.preventDefault(), this.activeControl && this.activeControl.onMouseUp(e)
}),
(n.prototype.onMouseOver = function (e) {
e.preventDefault(), this.activeControl && this.activeControl.onMouseOver(e)
}),
(n.prototype.onMouseWheel = function (e) {
e.preventDefault(), this.activeControl && this.activeControl.onMouseWheel(e)
}),
(n.prototype.onTouchStart = function (e) {
e.preventDefault(), this.activeControl && this.activeControl.onTouchStart(e)
var hotList = $('#hotListWrap')[0]
hotList.classList.remove('hotListActive')
$('#hotListContent ul .active').removeClass('active')
$('#hotList')[0].classList.remove('active')
}),
(n.prototype.onTouchMove = function (e) {
e.preventDefault(), this.activeControl && this.activeControl.onTouchMove(e)
}),
(n.prototype.onTouchEnd = function (e) {
e.preventDefault(), this.activeControl && this.activeControl.onTouchEnd(e)
}),
(n.prototype.onPointerDown = function (e) {
if ((e.preventDefault(), this.activeControl))
switch (e.pointerType) {
case 'mouse':
this.activeControl.onMouseDown(e)
break
default:
this.activeControl.onPointerDown(e)
}
}),
(n.prototype.onPointerMove = function (e) {
if ((e.preventDefault(), this.activeControl))
switch (e.pointerType) {
case 'mouse':
this.activeControl.onMouseMove(e)
break
default:
this.activeControl.onPointerMove(e)
}
}),
(n.prototype.onPointerUp = function (e) {
if ((e.preventDefault(), this.activeControl))
switch (e.pointerType) {
case 'mouse':
this.activeControl.onMouseUp(e)
break
default:
this.activeControl.onPointerUp(e)
}
}),
(n.prototype.onPointerCancel = function (e) {
e.preventDefault(), this.activeControl && 'mouse' !== e.pointerType && this.activeControl.onPointerUp(e)
}),
(n.prototype.onKeyDown = function (e) {
e.metaKey || e.ctrlKey || (e.preventDefault(), this.activeControl && this.activeControl.onKeyDown(e))
}),
(n.prototype.onKeyUp = function (e) {
e.preventDefault(), this.activeControl && this.activeControl.onKeyUp(e)
}),
(t.exports = n)
},
{
'../cameras/DollhouseCamera': 5,
'../cameras/FloorplanCamera': 6,
'../cameras/PanoramaCamera': 7,
'../enum/ControlEvents': 21,
'../enum/ModelManagerEvents': 33,
'../enum/Viewmode': 51,
'../settings': 166,
'./DollhouseControls': 10,
'./FloorplanControls': 11,
'./PanoramaControls': 13,
events: 202
}
],
10: [
function (e, t, i) {
'use strict'
function n(e) {
a.call(this, e),
(this.minPolarAngle = o.dollhouseDefault.minPolarAngle),
(this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle),
(this.minDistance = o.dollhouseDefault.minDistance),
(this.maxDistance = o.dollhouseDefault.maxDistance),
(this.adjustedMinDistance = this.minDistance),
(this.adjustedMaxDistance = this.maxDistance)
}
var r = e('three'),
o = e('../settings'),
a = e('./OutsideControls')
;(n.prototype = Object.create(a.prototype)),
(n.prototype.pan = function (e, t) {
this.camera.updateMatrix()
var i = this.camera.position.clone().sub(this.target).length()
;(i *= Math.tan(((this.camera.fov / 2) * Math.PI) / 180)), this.panLeft((2 * e * i) / $('#player').height()), this.panUp((-2 * t * i) / $('#player').height())
}),
(n.prototype.updateZoom = function () {
var e = this.offset.length()
return e * this.scale
}),
(n.prototype.setZoomBounds = function (e) {
var t = e.min.distanceTo(e.max)
;(this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0)),
(this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius)),
(this.minDistance = this.adjustedMinDistance),
(this.maxDistance = this.adjustedMaxDistance)
}),
(n.prototype.resetRanges = function (e, t) {
e
? ((this.minDistance = Math.min(e, this.minDistance)), (this.maxDistance = Math.max(e, this.maxDistance)))
: ((this.minDistance = this.adjustedMinDistance), (this.maxDistance = this.adjustedMaxDistance)),
t
? ((this.minPolarAngle = r.Math.degToRad(-15)), (this.maxPolarAngle = r.Math.degToRad(89.9)))
: ((this.minPolarAngle = o.dollhouseDefault.minPolarAngle), (this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle))
}),
(n.prototype.toJSON = function () {
return a.prototype.toJSON.call(this)
}),
(t.exports = n)
},
{
'../settings': 166,
'./OutsideControls': 12,
three: 217
}
],
11: [
function (e, t, i) {
'use strict'
function n(e) {
a.call(this, e),
(this.minDistance = 15),
(this.maxDistance = 50),
(this.noRotateUpDown = !0),
(this.minPolarAngle = 0),
(this.maxPolarAngle = 0),
(this.mouseActions[l.LEFT] = s.PAN),
(this.mouseActions[l.MIDDLE] = s.DOLLY),
(this.mouseActions[l.RIGHT] = s.ROTATE),
(this.touchActions[1] = s.PAN),
(this.touchActions[2] = s.ROTATE_DOLLY),
(this.absoluteScale = 1),
(this.currentScale = 1)
}
var r = e('three'),
o = e('../settings'),
a = e('./OutsideControls'),
s = e('../enum/ControlActions'),
l = e('../enum/MouseButton'),
c = e('../util/math'),
h = e('../util/browser')
;(n.prototype = Object.create(a.prototype)),
(n.prototype.zoomToContain = function (e) {
this.absoluteScale = this.getDefaultAbsoluteScale(e)
this.currentScale = this.absoluteScale
}),
(n.prototype.getDefaultAbsoluteScale = function (modelSize, ratio) {
let defaultRatio = 1.2,
absoluteScale
if (_settings.floorPlanAngle) {
//指定了角度的话,就和browser.aspectRatio()无关,总使用纵向
var angle = parseFloat(_settings.floorPlanAngle)
modelSize = modelSize.clone().applyEuler(new THREE.Euler(0, angle, 0))
var n = Math.max(Math.abs(modelSize.x), Math.abs(modelSize.z) * this.camera.aspect) //视口宽高比 >= 1 情况下,模型所占最大视口尺寸
var screenSize = Math.min($('#player').width(), $('#player').height())
var maxSize = 800 //模型最大占据像素
ratio = ratio != void 0 ? ratio : Math.max((screenSize * defaultRatio) / maxSize, defaultRatio)
absoluteScale = (n / 2 / o.orthoBase) * ratio //根据模型所占最大视口尺寸调整缩放
} else {
var t = Math.max(modelSize.x, modelSize.z),
i = Math.min(modelSize.x, modelSize.z),
n = Math.max(t, i * this.camera.aspect),
r = Math.max(i, t * this.camera.aspect)
absoluteScale = ((h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase) * defaultRatio
}
return absoluteScale
}),
/* n.prototype.rotateToView = function(e, t) {
var i = 0
, n = h.aspectRatio() < 1
, r = e.x < e.z;
n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
this.rotateLeft(i),
this.update(0)
},
*/
(n.prototype.rotateToView = function (modelSize, direction) {
let i = 0,
n = h.aspectRatio() < 1 //是否模型尺寸显“细长”
if (_settings.floorPlanAngle) {
//规定了cadImage旋转值的话 (0是无效的,将不设置)
i = parseFloat(_settings.floorPlanAngle)
} else {
let r = modelSize.x < modelSize.z //是否视口为“窄屏”
if (n === r) {
//“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
if (direction.z > 0) {
//(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
i = Math.PI //经度上做180度轨道角位移,使相机移到静止模型的“前面”
}
//(第二种情况) 不做处理
} else if (direction.x > 0) {
i = Math.PI / 2
} else {
i = -Math.PI / 2
}
}
this.rotateLeft(i)
this.update(0)
}),
(n.prototype.rotateToAngle = function (angle) {
//add 旋转到特定角度
this.rotateLeft(angle + this.lon)
this.update(0)
}),
(n.prototype.pan = function (e, t) {
this.camera.updateMatrix(),
this.panLeft((e * (this.camera.right - this.camera.left)) / $('#player').width()),
this.panUp((-t * (this.camera.top - this.camera.bottom)) / $('#player').height())
}),
(n.prototype.updateZoom = function () {
return (
(this.absoluteScale *= this.scale - 0.03 * this.keyboardZoomSpeed),
(this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit))),
(this.currentScale = 0.8 * this.currentScale + 0.2 * this.absoluteScale),
(this.camera.left = -o.orthoBase * this.currentScale),
(this.camera.right = o.orthoBase * this.currentScale),
(this.camera.top = (o.orthoBase * this.currentScale) / this.camera.aspect),
(this.camera.bottom = (-o.orthoBase * this.currentScale) / this.camera.aspect),
this.camera.updateProjectionMatrix(),
this.offset.length()
)
}),
(n.prototype.toJSON = (function () {
var e = new r.Quaternion(),
t = new r.Quaternion().setFromAxisAngle(new r.Vector3(0, 1, 0), r.Math.degToRad(90)),
i = new r.Quaternion()
return function () {
var n = a.prototype.toJSON.call(this)
return (
e.copy(n.camera_quaternion),
i.copy(t),
i.multiply(e),
(n.camera_quaternion.x = c.toPrecision(i.x, 4)),
(n.camera_quaternion.y = c.toPrecision(i.y, 4)),
(n.camera_quaternion.z = c.toPrecision(i.z, 4)),
(n.camera_quaternion.w = c.toPrecision(i.w, 4)),
(n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4)),
n
)
}
})()),
(t.exports = n)
},
{
'../enum/ControlActions': 20,
'../enum/MouseButton': 34,
'../settings': 166,
'../util/browser': 182,
'../util/math': 190,
'./OutsideControls': 12,
three: 217
}
],
12: [
function (e, t, i) {
'use strict'
function n(e) {
;(this.camera = e),
(this.camera.controls = this),
(this.enabled = !1),
(this.target = new r.Vector3()),
(this.targetBounds = new r.Box3()),
(this.zoomSpeed = 1),
(this.minDistance = 0),
(this.maxDistance = 1 / 0),
(this.noRotateUpDown = !1),
(this.rotateSpeed = 1),
(this.keyboardZoomSpeed = 0),
(this.keyPanSpeed = 7),
(this.autoRotate = !1),
(this.autoRotateSpeed = 2),
(this.autoPan = !1),
(this.autoPanPosition = new r.Vector3()),
(this.minPolarAngle = r.Math.degToRad(25)),
(this.maxPolarAngle = r.Math.degToRad(65)),
(this.rotationAcceleration = new r.Vector2()),
(this.rotationSpeed = new r.Vector2()),
(this.panAcceleration = new r.Vector2()),
(this.panSpeed = new r.Vector2()),
(this.rotateStart = new r.Vector2()),
(this.rotateEnd = new r.Vector2()),
(this.rotateDelta = new r.Vector2()),
(this.panStart = new r.Vector2()),
(this.panEnd = new r.Vector2()),
(this.panDelta = new r.Vector2()),
(this.panOffset = new r.Vector3()),
(this.offset = new r.Vector3()),
(this.dollyStart = new r.Vector2()),
(this.dollyEnd = new r.Vector2()),
(this.dollyDelta = new r.Vector2()),
(this.phiDelta = 0),
(this.thetaDelta = 0),
(this.scale = 1),
(this.panVector = new r.Vector3()),
(this.lastPosition = new r.Vector3()),
(this.state = c.NONE),
(this.mouseActions = {}),
(this.mouseActions[h.LEFT] = c.ROTATE),
(this.mouseActions[h.MIDDLE] = c.DOLLY),
(this.mouseActions[h.RIGHT] = c.PAN),
(this.touchActions = {}),
(this.touchActions[1] = c.ROTATE),
(this.touchActions[2] = c.PAN_DOLLY),
(this.lastMoveTime = 0),
(this.pointersLimit = 2),
(this.pointers = [])
}
var r = e('three'),
o = e('../settings'),
a = e('../util/common'),
s = e('../util/math'),
l = e('../enum/Vectors'),
c = e('../enum/ControlActions'),
h = e('../enum/MouseButton'),
u = e('../enum/Keys'),
d = e('../enum/ControlEvents'),
p = e('events').EventEmitter,
f = 1e-6
;(n.prototype = Object.create(p.prototype)),
(n.prototype.setBounds = function (e) {
this.targetBounds = e
}),
(n.prototype.isEngaged = function () {
return this.state !== c.NONE
}),
(n.prototype.rotateLeft = function (e) {
void 0 === e && (e = this.getAutoRotationAngle()), (this.thetaDelta -= e)
}),
(n.prototype.rotateUp = function (e) {
this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()), (this.phiDelta -= e))
}),
(n.prototype.panLeft = function (e) {
var t = this.camera.matrix.elements
this.panOffset.set(t[0], 0, t[2]).normalize(), this.panOffset.multiplyScalar(-e), this.panVector.add(this.panOffset)
}),
(n.prototype.panUp = function (e) {
var t = this.camera.matrix.elements
this.panOffset.set(t[4], 0, t[6]).normalize(), this.panOffset.multiplyScalar(-e), this.panVector.add(this.panOffset)
}),
(n.prototype.startRotating = function (e, t) {
e && this.navRotationAcc('x', e), t && this.navRotationAcc('y', t)
}),
(n.prototype.stopRotating = function (e) {
e && (this.rotationSpeed.x = this.rotationSpeed.y = 0), this.navRotationAcc('x', 0), this.navRotationAcc('y', 0)
}),
(n.prototype.setAutoPanPosition = (function (e, t) {
var i = new r.Vector3(),
n = new r.Vector3()
return function (e, t) {
i.copy(this.camera.position), (void 0 === e && null === e) || i.setX(e), (void 0 === t && null === t) || i.setZ(t)
var r = this.camera.position.distanceTo(this.target),
o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion)
;(this.targetClamped = !1),
n.copy(i).addScaledVector(o, r),
this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n), i.copy(n).addScaledVector(o, -r), (this.targetClamped = !0)),
(this.autoPanPosition.x = i.x),
(this.autoPanPosition.z = i.z),
this.autoPan && this.stopAutoPanning()
}
})()),
(n.prototype.stopAutoPanning = function () {
var e = this.autoPan
;(this.autoPan = !1), this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
}),
(n.prototype.dollyIn = function (e) {
void 0 === e && (e = this.getZoomScale()), (this.scale /= e)
}),
(n.prototype.dollyOut = function (e) {
void 0 === e && (e = this.getZoomScale()), (this.scale *= e)
}),
(n.prototype.updatePan = function (e) {
if ((this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e), this.pan(-this.panSpeed.x, this.panSpeed.y), this.autoPan)) {
var t = new r.Vector3().copy(this.autoPanPosition).sub(this.camera.position)
t.setY(0).clampLength(0, 50 * e),
this.target.add(t),
this.camera.position.add(t),
this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && ((this.autoPan = !1), this.stopAutoPanning())
}
}),
(n.prototype.update = function (e) {
e || (e = 1 / 60)
var friction = Math.min(1, o.rotationFriction * e * 60) //add 如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
this.rotationSpeed.multiplyScalar(1 - friction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
this.rotateLeft(-this.rotationSpeed.x),
this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
this.updatePan(e)
var t = this.camera.position
this.offset.copy(t).sub(this.target)
var i = Math.atan2(this.offset.x, this.offset.z),
n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y)
this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
(i += this.thetaDelta),
(n += this.phiDelta),
(n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n))),
(n = Math.max(f, Math.min(Math.PI - f, n)))
;(this.lon = i), (this.lat = n) //add
var r = this.updateZoom()
;(r = Math.max(this.minDistance, Math.min(this.maxDistance, r))),
this.target.add(this.panVector),
this.targetBounds.clampPoint(this.target, this.target),
(this.offset.x = r * Math.sin(n) * Math.sin(i)),
(this.offset.y = r * Math.cos(n)),
(this.offset.z = r * Math.sin(n) * Math.cos(i)),
t.copy(this.target).add(this.offset),
this.camera.lookAt(this.target),
(this.thetaDelta = 0),
(this.phiDelta = 0),
(this.scale = 1),
this.panVector.set(0, 0, 0),
this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
}),
(n.prototype.getAutoRotationAngle = function () {
return ((2 * Math.PI) / 60 / 60) * this.autoRotateSpeed
}),
(n.prototype.getZoomScale = function () {
return Math.pow(0.95, this.zoomSpeed)
}),
(n.prototype.onMouseDown = function (e) {
if (this.enabled) {
switch ((e.preventDefault(), this.stopAutoPanning(), (this.mouseDown = !0), (this.state = this.mouseActions[e.button]), this.state)) {
case c.ROTATE:
this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY), this.rotationSpeed.set(0, 0)
break
case c.DOLLY:
this.dollyStart.set(e.clientX, e.clientY)
break
case c.PAN:
this.panStart.set(e.clientX, e.clientY)
}
this.emit(d.InputStart, 'mouse')
}
}),
(n.prototype.onMouseMove = function (e) {
if (this.enabled && this.mouseDown && 0 !== e.buttons) {
switch ((e.preventDefault(), this.state)) {
case c.ROTATE:
this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
this.rotateLeft(((2 * Math.PI * this.rotateDelta.x) / $('#player').width()) * this.rotateSpeed),
this.rotateUp(((2 * Math.PI * this.rotateDelta.y) / $('#player').height()) * this.rotateSpeed),
this.rotateStart.copy(this.rotateEnd)
break
case c.DOLLY:
this.dollyEnd.set(e.clientX, e.clientY), this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart)
var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut
t.call(this), this.dollyStart.copy(this.dollyEnd)
break
case c.PAN:
this.panEnd.set(e.clientX, e.clientY), this.panDelta.subVectors(this.panEnd, this.panStart), this.pan(this.panDelta.x, this.panDelta.y), this.panStart.copy(this.panEnd)
}
this.emit(d.Move, 'mouse'), (this.lastMoveTime = e.timeStamp), this.update()
}
}),
(n.prototype.onMouseUp = function (e) {
this.enabled &&
((this.mouseDown = !1),
(this.state = c.NONE),
'mouseover' !== e.type &&
(e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
this.update(),
this.rotationAcceleration.set(0, 0),
this.rotateDelta.set(0, 0)))
}),
(n.prototype.onMouseOver = function (e) {
;(0 !== e.which && 0 !== e.buttons) || this.onMouseUp(e)
}),
(n.prototype.onMouseWheel = function (e) {
if (this.enabled && o.useWheel) {
this.emit(d.Move, 'wheel')
var t = e.wheelDelta || -e.detail,
i = t > 0 ? this.dollyOut : this.dollyIn
i.call(this), this.update()
}
}),
(n.prototype.onKeyDown = function (e) {
this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(), this.handleKeyDown(e.which)))
}),
(n.prototype.navRotationAcc = function (e, t) {
'y' === e ? (this.noRotateUpDown ? (this.keyboardZoomSpeed = t) : (this.rotationAcceleration.y = t)) : (this.rotationAcceleration.x = t)
}),
(n.prototype.navPanAcc = function (e, t) {
this.stopAutoPanning(), (this.panAcceleration[e] = t)
}),
(n.prototype.handleKeyDown = function (e) {
var t = !0
switch (e) {
case u.UPARROW:
case u.I:
this.navRotationAcc('y', 1)
break
case u.DOWNARROW:
case u.K:
this.navRotationAcc('y', -1)
break
case u.LEFTARROW:
case u.J:
this.navRotationAcc('x', -1)
break
case u.RIGHTARROW:
case u.L:
this.navRotationAcc('x', 1)
break
case u.W:
this.navPanAcc('y', 1)
break
case u.S:
this.navPanAcc('y', -1)
break
case u.A:
this.navPanAcc('x', -1)
break
case u.D:
this.navPanAcc('x', 1)
break
default:
t = !1
}
t && this.emit(d.Move, 'key')
}),
(n.prototype.onKeyUp = function (e) {
this.enabled && (e.preventDefault(), e.stopPropagation(), this.handleKeyUp(e.which))
}),
(n.prototype.handleKeyUp = function (e) {
switch (e) {
case u.I:
case u.K:
case u.UPARROW:
case u.DOWNARROW:
;(this.keyboardZoomSpeed = 0), (this.rotationAcceleration.y = 0)
break
case u.J:
case u.L:
case u.LEFTARROW:
case u.RIGHTARROW:
this.rotationAcceleration.x = 0
break
case u.S:
case u.W:
this.panAcceleration.y = 0
break
case u.A:
case u.D:
this.panAcceleration.x = 0
}
}),
(n.prototype.onTouchStart = function (e) {
if (this.enabled || this.state === c.NONE) {
e.preventDefault(), e.stopPropagation(), this.stopAutoPanning()
var t = function () {
if (2 === e.touches.length) {
var t = e.touches[0].pageX - e.touches[1].pageX,
i = e.touches[0].pageY - e.touches[1].pageY
this.dollyStart.set(t, i)
}
}.bind(this),
i = function () {
this.panStart.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY'))
}.bind(this),
n = function () {
this.rotateStart.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY'))
}.bind(this)
switch (((this.state = this.touchActions[e.touches.length]), this.state)) {
case c.PAN_DOLLY:
t()
case c.PAN:
i()
break
case c.ROTATE_DOLLY:
t()
case c.ROTATE:
n()
}
this.rotationSpeed.set(0, 0), this.emit(d.InputStart, 'touch')
}
}),
(n.prototype.onTouchMove = function (e) {
if (this.enabled && this.state !== c.NONE) {
e.preventDefault(), e.stopPropagation()
var t = function () {
var t = e.touches[0].pageX - e.touches[1].pageX,
i = e.touches[0].pageY - e.touches[1].pageY
this.dollyEnd.set(t, i)
var n = this.dollyStart.length() - this.dollyEnd.length()
n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500), this.dollyStart.copy(this.dollyEnd)
}.bind(this),
i = function () {
this.panEnd.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY')),
this.panDelta.subVectors(this.panEnd, this.panStart),
this.pan(this.panDelta.x, this.panDelta.y),
this.panStart.copy(this.panEnd),
this.rotateDelta.set(0, 0)
}.bind(this),
n = function () {
this.rotateEnd.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY')),
this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
this.rotateLeft(((2 * Math.PI * this.rotateDelta.x) / $('#player').width()) * this.rotateSpeed),
this.rotateUp(((2 * Math.PI * this.rotateDelta.y) / $('#player').height()) * this.rotateSpeed),
this.rotateStart.copy(this.rotateEnd)
}.bind(this),
r = function () {
if (2 === e.touches.length) {
var i = window.devicePixelRatio || 1,
r = e.touches[1].pageX - e.touches[0].pageX,
s = e.touches[1].pageY - e.touches[0].pageY,
l = Math.sqrt(r * r + s * s),
h = Math.abs(this.dollyStart.length() - l)
if (h > o.input.touchMoveThreshold * i) (this.state = c.DOLLY), t()
else {
var u = a.average(e.touches, 'pageX'),
d = a.average(e.touches, 'pageY'),
p = this.rotateDelta.set(u, d).sub(this.rotateStart).length()
p > o.input.touchMoveThreshold && ((this.state = c.ROTATE), this.rotateStart.set(u, d), n())
}
}
}.bind(this)
switch (this.state) {
case c.PAN_DOLLY:
t()
case c.PAN:
i()
break
case c.ROTATE_DOLLY:
r()
break
case c.DOLLY:
t()
break
case c.ROTATE:
n()
break
default:
this.state = c.NONE
}
;(this.lastMoveTime = e.timeStamp), this.emit(d.Move, 'touch')
}
}),
(n.prototype.onTouchEnd = function (e) {
this.enabled &&
(this.state === c.ROTATE &&
(e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
(this.state = c.NONE),
this.update(),
this.rotationAcceleration.set(0, 0),
this.rotateDelta.set(0, 0))
}),
(n.prototype.onPointerDown = function (e) {
this.enabled &&
('touch' === e.pointerType &&
(this.pointers.length < this.pointersLimit &&
this.pointers.push({
id: e.pointerId,
pageX: e.pageX,
pageY: e.pageY
}),
(e.touches = this.pointers),
this.onTouchStart(e)),
this.emit(d.InputStart, 'pointer'))
}),
(n.prototype.onPointerMove = function (e) {
this.enabled &&
'touch' === e.pointerType &&
(this.pointers.forEach(function (t) {
e.pointerId === t.id && ((t.pageX = e.pageX), (t.pageY = e.pageY))
}),
(e.touches = this.pointers),
this.onTouchMove(e))
}),
(n.prototype.onPointerUp = function (e) {
this.enabled &&
'touch' === e.pointerType &&
(this.pointers.forEach(
function (t, i) {
e.pointerId === t.id && this.pointers.splice(i, 1)
}.bind(this)
),
(e.touches = this.pointers),
this.onTouchEnd(e))
}),
(n.prototype.reset = function () {
;(this.state = c.NONE), this.stopAutoPanning(), this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0), this.panSpeed.set(0, 0), this.panAcceleration.set(0, 0)
}),
(n.prototype.toJSON = function () {
var e = {
camera_position: {
x: s.toPrecision(this.camera.position.x, 4),
y: s.toPrecision(this.camera.position.y, 4),
z: s.toPrecision(this.camera.position.z, 4)
},
camera_quaternion: {
x: s.toPrecision(this.camera.quaternion.x, 4),
y: s.toPrecision(this.camera.quaternion.y, 4),
z: s.toPrecision(this.camera.quaternion.z, 4),
w: s.toPrecision(this.camera.quaternion.w, 4)
}
}
return e
}),
(t.exports = n)
},
{
'../enum/ControlActions': 20,
'../enum/ControlEvents': 21,
'../enum/Keys': 30,
'../enum/MouseButton': 34,
'../enum/Vectors': 50,
'../settings': 166,
'../util/common': 185,
'../util/math': 190,
events: 202,
three: 217
}
],
13: [
function (e, t, i) {
;(function (i) {
'use strict'
function n(e) {
;(this.camera = e),
(this.camera.controls = this),
(this.target = new r.Vector3(0, 0, 0)),
(this.lookVector = new r.Vector3()),
(this.lookSpeed = 0.05),
(this.rotationAcc = new r.Vector2()),
(this.rotationSpeed = new r.Vector2()),
(this.lat = 0),
(this.lon = 0),
(this.phi = 0),
(this.theta = 0),
(this.enabled = !1),
(this.locked = !1),
(this.pointer = new r.Vector2(0, 0)),
(this.rotationHistory = []),
(this.rotationDifference = new r.Vector2()),
(this.pointerDragOn = !1),
(this.pointerDragStart = new r.Vector2(0, 0)),
(this.pinchDistance = 0),
(this.moveStart = new r.Vector2()),
(this.moveTolerance = 0.01),
(this.pointersLimit = 2),
(this.pointers = [])
}
var r = e('three'),
o = e('../util/logger'),
a = e('../settings'),
s = e('../util/common'),
l = e('../util/math'),
c = (e('../enum/Vectors'), e('../enum/MouseButton')),
h = e('../enum/Keys'),
u = e('../enum/ControlEvents'),
d = e('events').EventEmitter
new o(i)
;(n.prototype = Object.create(d.prototype)),
(n.prototype.usable = function () {
return this.enabled && !this.locked
}),
/* n.prototype.lookAt = function(e) {
var t = this.camera.position.clone().sub(e)
, i = Math.atan(t.z / t.x);
i += t.x < 0 ? Math.PI : 0,
i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
this.lon = r.Math.radToDeg(i) + 180;
var n = Math.sqrt(t.x * t.x + t.z * t.z)
, o = Math.atan(t.y / n);
this.lat = -r.Math.radToDeg(o)
}
*/
(n.prototype.lookAt = function (aim, dir) {
var t = dir || this.camera.position.clone().sub(aim) //aim所指点的笛卡尔坐标系
var i = Math.atan(t.z / t.x)
i += t.x < 0 ? Math.PI : 0
i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0
this.lon = r.Math.radToDeg(i) + 180
var n = Math.sqrt(t.x * t.x + t.z * t.z),
o = Math.atan(t.y / n)
this.lat = -r.Math.radToDeg(o)
}),
(n.prototype.startRotationFrom = function (e, t) {
l.convertScreenPositionToNDC(e, t, this.pointer),
(this.pointerDragOn = !0),
this.pointerDragStart.copy(this.pointer),
this.moveStart.copy(this.pointer),
(this.rotationHistory = []),
this.rotationSpeed.set(0, 0)
}),
(n.prototype.onMouseOver = function (e) {
!this.pointerDragOn || (0 !== e.which && 0 !== e.buttons) || this.onMouseUp(e)
}),
(n.prototype.onTouchStart = function (e) {
if (this.usable()) {
switch ((e.preventDefault(), e.stopPropagation(), e.touches.length)) {
case 1:
this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY)
break
case 2:
var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width(),
i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height()
this.pinchDistance = Math.sqrt(t * t + i * i)
}
this.emit(u.InputStart, 'touch')
}
}),
(n.prototype.onPointerDown = function (e) {
this.usable() &&
'touch' === e.pointerType &&
(this.pointers.length < this.pointersLimit &&
this.pointers.push({
id: e.pointerId,
clientX: e.clientX,
clientY: e.clientY
}),
(e.touches = this.pointers),
this.onTouchStart(e),
this.emit(u.InputStart, 'pointer'))
}),
(n.prototype.onMouseDown = function (e) {
if (this.usable()) {
switch ((e.preventDefault(), e.stopPropagation(), e.button)) {
case c.LEFT:
this.startRotationFrom(e.clientX, e.clientY)
}
SoundManager.pause('tour') // zeg 点击场景时停止语音
this.emit(u.InputStart, 'mouse')
}
}),
(n.prototype.updateRotation = function () {
if (this.usable() && this.pointerDragOn) {
var e = new r.Vector3(this.pointerDragStart.x, this.pointerDragStart.y, -1).unproject(this.camera),
t = new r.Vector3(this.pointer.x, this.pointer.y, -1).unproject(this.camera),
i = Math.sqrt(e.x * e.x + e.z * e.z),
n = Math.sqrt(t.x * t.x + t.z * t.z),
o = Math.atan2(e.y, i),
a = Math.atan2(t.y, n)
;(this.rotationDifference.y = r.Math.radToDeg(o - a)), (e.y = 0), (t.y = 0)
var s = Math.acos(e.dot(t) / e.length() / t.length())
isNaN(s) || ((this.rotationDifference.x = r.Math.radToDeg(s)), this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)), this.pointerDragStart.copy(this.pointer)
}
}),
(n.prototype.onMouseMove = function (e) {
this.usable() &&
(l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
this.pointerDragOn &&
(Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) &&
this.emit(u.Move, 'mouse'))
}),
(n.prototype.onTouchMove = function (e) {
if (this.usable())
switch ((this.emit(u.Move, 'touch'), e.touches.length)) {
case 1:
l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer)
break
case 2:
var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width(),
i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height(),
n = this.pinchDistance - Math.sqrt(t * t + i * i)
Math.abs(n) > 0.01 && (this.emit(u.InteractionDirect), this.emit(u.Pinch, n), (this.pinchDistance -= n))
}
}),
(n.prototype.onPointerMove = function (e) {
this.usable() &&
'touch' === e.pointerType &&
(this.pointers.forEach(function (t) {
e.pointerId === t.id && ((t.clientX = e.clientX), (t.clientY = e.clientY))
}),
(e.touches = this.pointers),
this.onTouchMove(e))
}),
(n.prototype.endRotation = function () {
this.pointerDragOn = !1
var e = s.averageVectors(this.rotationHistory)
this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
}),
(n.prototype.onTouchEnd = function (e) {
this.usable() && (e.preventDefault(), e.stopPropagation(), this.endRotation())
}),
(n.prototype.onMouseUp = function (e) {
this.usable() && (e.preventDefault(), e.stopPropagation(), this.endRotation())
}),
(n.prototype.onPointerUp = function (e) {
this.usable() &&
'touch' === e.pointerType &&
(this.pointers.forEach(
function (t, i) {
e.pointerId === t.id && this.pointers.splice(i, 1)
}.bind(this)
),
(e.touches = this.pointers),
this.onTouchEnd(e))
}),
(n.prototype.update = function (e) {
this.lon, this.lat
for (this.updateRotation(), this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; ) this.rotationHistory.shift()
;(this.lon += this.rotationDifference.x), (this.lat += this.rotationDifference.y), this.rotationDifference.set(0, 0)
//改
var friction = Math.min(1, a.rotationFriction * e * 60) //如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
;(this.rotationSpeed.x = this.rotationSpeed.x * (1 - friction) + this.rotationAcc.x * a.rotationAccelerationInside),
(this.rotationSpeed.y = this.rotationSpeed.y * (1 - friction) + this.rotationAcc.y * a.rotationAccelerationInside),
(this.lon += this.rotationSpeed.x * e),
(this.lat += this.rotationSpeed.y * e)
//this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
let insideLookLimitDown = this.insideLookLimitDown != void 0 ? this.insideLookLimitDown : a.insideLookLimitDown
let insideLookLimitUp = this.insideLookLimitUp != void 0 ? this.insideLookLimitUp : a.insideLookLimitUp
insideLookLimitDown = insideLookLimitDown - a.insideFOV / 2 + this.camera.fov / 2
insideLookLimitUp = insideLookLimitUp + a.insideFOV / 2 - this.camera.fov / 2
this.lat = Math.max(insideLookLimitDown, Math.min(insideLookLimitUp, this.lat)) //通过预定义的俯仰角最大最小范围(insideLookLimitUp、insideLookLimitDown)来限制俯仰角。 注:这种数学计算很常见,因此API也很常见(clamp),等价于 this.lat = THREE.Math.clamp( this.lat, settings.insideLookLimitDown, settings.insideLookLimitUp );
;(this.phi = r.Math.degToRad(90 - this.lat)),
(this.theta = r.Math.degToRad(this.lon)),
(this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta)),
(this.lookVector.y = Math.cos(this.phi)),
(this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta)),
this.target.copy(this.lookVector).add(this.camera.position),
this.camera.lookAt(this.target)
}),
(n.prototype.onMouseWheel = function (e) {
if (this.usable()) {
var t = e.wheelDelta || -e.detail
this.emit(u.InteractionDirect), this.emit(u.Scroll, t)
}
}),
(n.prototype.onKeyDown = function (e) {
this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(), this.handleKeyDown(e.which)))
}),
(n.prototype.handleKeyDown = function (e) {
var t = function (e, t) {
this.rotationAcc[e] = t
}.bind(this)
this.emit(u.InteractionKey)
var i = !0
switch (e) {
case h.LEFTARROW:
case h.J:
t('x', -1)
break
case h.RIGHTARROW:
case h.L:
t('x', 1)
break
case h.I:
t('y', 1)
break
case h.K:
t('y', -1)
break
default:
i = !1
}
i && this.emit(u.Move, 'key')
}),
(n.prototype.onKeyUp = function (e) {
this.usable() && (e.preventDefault(), e.stopPropagation(), this.handleKeyUp(e.which))
}),
(n.prototype.handleKeyUp = function (e) {
switch (e) {
case h.LEFTARROW:
case h.J:
case h.RIGHTARROW:
case h.L:
this.rotationAcc.x = 0
break
case h.I:
case h.K:
this.rotationAcc.y = 0
}
}),
(n.prototype.startRotating = function (e, t) {
e && (this.rotationAcc.x = e), t && (this.rotationAcc.y = t)
}),
(n.prototype.stopRotating = function (e) {
e && (this.rotationSpeed.x = this.rotationSpeed.y = 0), this.rotationAcc.set(0, 0)
}),
(n.prototype.reset = function () {
;(this.pointerDragOn = !1), this.rotationAcc.set(0, 0), this.rotationSpeed.set(0, 0), (this.pointers = [])
}),
(n.prototype.toJSON = function () {
var e = {
camera_position: {
x: l.toPrecision(this.camera.position.x, 4),
y: l.toPrecision(this.camera.position.y, 4),
z: l.toPrecision(this.camera.position.z, 4)
},
camera_quaternion: {
x: l.toPrecision(this.camera.quaternion.x, 4),
y: l.toPrecision(this.camera.quaternion.y, 4),
z: l.toPrecision(this.camera.quaternion.z, 4),
w: l.toPrecision(this.camera.quaternion.w, 4)
}
}
return e
}),
(n.prototype.setStateFromJSON = function (e) {
this.camera.position.copy(e.camera_position), this.camera.quaternion.copy(e.camera_quaternion)
}),
(t.exports = n)
}).call(this, '/js/controls/PanoramaControls.js')
},
{
'../enum/ControlEvents': 21,
'../enum/Keys': 30,
'../enum/MouseButton': 34,
'../enum/Vectors': 50,
'../settings': 166,
'../util/common': 185,
'../util/logger': 189,
'../util/math': 190,
events: 202,
three: 217
}
],
14: [
function (e, t, i) {
;(function (i) {
'use strict'
var n = e('three'),
r = e('../enum/Viewmode'),
o = e('../util/logger'),
a = new o(i)
t.exports = {
serialize: function (e) {
return encodeURI(JSON.stringify(e))
},
deserialize: function (e) {
function t(e) {
function t(e, t) {
return e && 'number' == typeof t && !isNaN(t)
}
return e.reduce(t, !0)
}
try {
var i = JSON.parse(decodeURI(e)),
o = {
mode: r.fromInt(i.camera_mode),
panoId: i.scan_id,
position: new n.Vector3().copy(i.camera_position),
quaternion: new n.Quaternion().copy(i.camera_quaternion),
zoom: i.ortho_zoom,
floorVisibility: i.floor_visibility
},
s = o.position
t([s.x, s.y, s.z]) || o.position.set(0, 0, 0)
var l = o.quaternion
return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1), o
} catch (i) {
a.debug('Not able to parse start location as JSON; falling back to old array style parsing')
try {
var c = e.split(','),
h = {
x: parseFloat(c[2]),
y: parseFloat(c[3]),
z: parseFloat(c[4])
},
u = {
x: parseFloat(c[5]),
y: parseFloat(c[6]),
z: parseFloat(c[7]),
w: parseFloat(c[8])
}
return (
t([h.x, h.y, h.z]) || ((h.x = 0), (h.y = 0), (h.z = 0)),
t([u.x, u.y, u.z, u.w]) || ((u.x = 0), (u.y = 0), (u.z = 0), (u.w = 1)),
{
mode: r.fromInt(c[0]),
panoId: c[1],
position: new n.Vector3().copy(h),
quaternion: new n.Quaternion().copy(u)
}
)
} catch (t) {
a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
}
}
return null
}
}
}).call(this, '/js/controls/serializer.js')
},
{
'../enum/Viewmode': 51,
'../util/logger': 189,
three: 217
}
],
15: [
function (e, t, i) {
;(function (i) {
'use strict'
function n() {
;(this.endlessLoop = a.warp.loop),
(this.clock = new r.Clock(!0)),
(this.model = null),
(this.player = null),
(this.currentItem = null),
(this.destinationItem = null),
(this.tourIsPlaying = !1),
(this.transitionStage = y.None),
(this.nextFunc = null),
(this.onTheBus = !1),
(this.tourInProgress = !1),
(this.reachSource = null),
(this.interrupted = !1),
(this.nItems = 0),
(this.walkingSectionPaused = !1)
}
var r = e('three'),
o = e('./util/logger'),
a = e('./settings'),
s = e('./util/transitions'),
l = e('events').EventEmitter,
c = e('./enum/Viewmode'),
h = e('./analytics'),
u = e('./enum/WarpStyle'),
s = e('./util/transitions'),
d = (e('./model/ModelManager'), e('./enum/ModelManagerEvents')),
p = e('./enum/DirectorEvents'),
f = e('./enum/PlayerEvents'),
g = (e('./enum/ControlEvents'), e('./enum/BlackoutStyle')),
m = e('./enum/PathDiscardMode'),
v = e('./enum/PathDisplayMode'),
A = (e('./player'), new o(i)),
y = Object.freeze({
None: 0,
Moving: 1,
Aiming: 2,
Interlude: 3
}),
C = Object.freeze({
Forward: 1,
NoChange: 0,
Backwards: -1
}),
I = s.getUniqueId()
;(n.prototype = Object.create(l.prototype)),
(n.prototype.init = function (e, t) {
;(this.player = e), (this.modelManager = t), this.updateModel(), this.resetAll(), this.bindEvents()
// // zeg 查询pano对应的导览片段
// if(!this.panoIdMap) {
// this.panoIdMap = new Map()
// this.model.heroLocations.forEach( (value, index) => {
// // value.heroLocations.forEach( hl => {
// if(!value.heroLocations) return
// let hl = value.heroLocations[0]
// let arr = this.panoIdMap.get(hl.panoId)
// if(arr){
// this.panoIdMap.set(hl.panoId, [...arr, index])
// } else {
// this.panoIdMap.set(hl.panoId, [index])
// }
// // })
// })
// }
}),
(n.prototype.resetAll = function () {
if (
((this.currentItem = null),
(this.destinationItem = null),
(this.tourIsPlaying = !1),
//this.bgmReplay(),//xzw
(this.transitionStage = y.None),
(this.nextFunc = null),
(this.onTheBus = !1),
(this.reachSource = null),
(this.interrupted = !1),
this.model)
) {
var e = a.path.typ === u.WALK ? u.WALK : u.STD
this.defaultWarpStyle = this.model.data.hasOwnProperty('player_options') && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
} else (this.defaultWarpStyle = u.BLACK), A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions')
this.resetSpecialTransition()
}),
(n.prototype.updateModel = function () {
;(this.model = this.modelManager.getActiveModel()), (this.nItems = this.model.heroLocations.length)
}),
(n.prototype.bindEvents = function () {
this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
this.player.on(f.Move, this.handlePlayerMove.bind(this)),
this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
this.player.once(f.Move, function () {
s.cancelById(I)
})
}),
(n.prototype.checkAndHandleWalkingtourInterruption = function (e) {
//快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
return /* e === u.WALK && ( */ this.interrupt(g.NONE), this.pauseWalkingSection(), this.player.fastForwardActivePanoFlight(), !0 /* ) */
}),
(n.prototype.handlePlayerMove = function (e) {
this.transitionStage === y.Interlude && this.interrupt(g.NONE), this.emit('update.controls')
}),
(n.prototype.handlePlayerPanoChosen = function (e, t) {
this.intermediateState() || e.id === t.id || ((this.onTheBus = !1), this.emit('update.controls'))
}),
(n.prototype.handlePlayerModeChanged = function (e, t) {
this.intermediateState() || e === t || ((this.onTheBus = !1), this.emit('update.controls'))
}),
(n.prototype.handlePlayerInputStart = function (e) {
this.transitionStage === y.Interlude && this.interrupt(g.NONE)
}),
(n.prototype.handlePlayerFlyingStarted = function () {
this.clearWalkingSectionPaused()
}),
(n.prototype.describe = function () {
return {
nItems: this.nItems,
currentItem: this.currentItem,
destinationItem: this.destinationItem,
tourIsPlaying: this.tourIsPlaying,
onTheBus: this.onTheBus,
endlessLoop: this.endlessLoop,
viewMode: this.player.mode,
inTransition: this._inTransition(),
transitionStage: this.transitionStage,
tourInProgress: this.tourInProgress
}
}),
(n.prototype._inTransition = function () {
return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
}),
(n.prototype.bounceable = function () {
var e = this.clock.getDelta()
return this.isInterrupted() || (e < 0.9 && e > 0.01) || (this.player.flying && !this.player.isWarping())
}),
(n.prototype.itemCompare = function (item1, item2, type) {
//add
if (type == 'equal') {
//==
return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
} else if (type == 'less') {
//<
return (item1 && item2 && item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
}
})
;(n.prototype.currentMoveDirection = function () {
//return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
return null === this.currentItem || void 0 === this.currentItem
? y.Forward
: this.itemCompare(this.destinationItem, this.currentItem, 'equal')
? y.NoChange
: this.itemCompare(this.currentItem, this.destinationItem, 'less')
? y.Forward
: y.Backwards
}),
(n.prototype.clearPath = function () {
this._inTransition() || this.player.path.discardPathObject()
}),
(n.prototype.allFloors = function () {
this.model.toggleAllFloors()
}),
(n.prototype.actionComplete = function (e) {
if (
((this.interrupted = !1),
(this.transitionStage = y.None),
this.resetSpecialTransition(),
null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
this.tourIsPlaying || (this.player.disablePreRendering(), this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
this.emit('update.controls'),
this.nextFunc)
) {
var t = this.nextFunc
;(this.nextFunc = null), t()
}
}),
(n.prototype.awaitCompletion = function (e, t) {
;(this.nextFunc = t), e()
}),
(n.prototype.updateSuccessFunction = function (e) {
this.nextFunc = e
}),
(n.prototype.interrupt = function (e, t) {
//滑动屏幕或按下键盘等
return (
!!this.wouldInterrupt() &&
(this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
(this.tourIsPlaying = !1),
//this.bgmReplay(),//xzw
(this.interrupted = !0),
(this.nextFunc = null),
this.emit(p.ActionInterrupted),
(null !== e && void 0 !== e) || (e = g.BEGINNING),
this.player.interruptAndFastForward(e, t),
!0)
)
}),
(n.prototype.wouldInterrupt = function () {
return this.transitionStage !== y.None
}),
(n.prototype.intermediateState = function () {
return this.transitionStage !== y.None
}),
(n.prototype.isInterrupted = function () {
return this.interrupted
}),
(n.prototype.pauseWalkingSection = function () {
this.walkingSectionPaused = !0
}),
(n.prototype.clearWalkingSectionPaused = function () {
this.walkingSectionPaused = !1
}),
(n.prototype.autoTour = function () {
var e = Date.now()
this.model.auxDataPromise.then(
function () {
e = Date.now() - e
var t = a.warp.auto,
i = this.model.data && this.model.data.player_options /* && this.model.data.player_options.highlight_reel */
t >= 0 &&
this.model.heroCount() > 1 &&
i &&
s.trigger({
duration: Math.max(1e3 * Math.min(300, t) - e, 0),
done: function () {
this.playTour()
}.bind(this),
name: '_atr',
id: I
})
}.bind(this)
)
}),
(n.prototype.atDestinationPano = function (pano) {
if (null === this.destinationItem) return !1
pano = pano || this.player.currentPano
if (!pano) {
return !1
}
var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
return destination && destination.panoId == pano.id
}),
(n.prototype.redirectToItem = function (e, t) {
if (null === e || void 0 === e) return void A.warn('Director.redirectToItem() -> Redirecting to null item.')
if (!this.wouldInterrupt()) return void A.warn('Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.')
if (this.player.mode === c.TRANSITIONING) return void A.debug('Director.redirectToItem() -> Cannot redirect while transitioning.')
A.debug('Director.redirectToItem() -> Redirecting to ' + e + ' via ' + t)
var i = function () {
s.setTimeout(
function () {
this.setDestinationItem(e), this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
}.bind(this),
0
)
}.bind(this)
this.interrupt(g.END, 0), this.updateSuccessFunction(i)
}),
(n.prototype.useSpecialTransition = function (e) {
void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug('useSpecialTransition(): ' + e), (this.nextWarpStyle = u.BLACK)
}),
(n.prototype.resetSpecialTransition = function () {
this.nextWarpStyle = this.defaultWarpStyle
}),
(n.prototype.arrivedAtDestination = function (e) {
if (this.player.flying || this.player.isWarping()) A.warn('Cannot advance to interlude or aiming while player is flying or warping.')
else {
this.transitionStage = y.Aiming
var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null
this.player.model.fadePanoMarkers(0),
this.awaitCompletion(
function () {
this.resetSpecialTransition(), e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
}.bind(this),
t
)
}
}),
(n.prototype.goToDestination = function (e, t, i, n) {
//音频
var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
// zeg 手动导览不播放音频
if (musicInfo && musicInfo.music && !e) {
let musicType = localStorage.getItem('xunirole') || 'male'
let isMale = musicType.indexOf('female') < 0
let fixMusic = isMale ? musicInfo.music : musicInfo.fmusic || musicInfo.music
// let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
let src = fixMusic
let audioObj = SoundManager.list.find(e => e.name == 'tour')
let audioSrc1 = common.getFileNameFromUrl(audioObj.src)
let audioSrc2 = common.getFileNameFromUrl(src)
if (audioSrc1 == audioSrc2) {
//应该是继续播放该folder
if (this.destinationItem[1] == 0) {
//从头开始播放 因为可能暂停后然后再点该缩略图播
SoundManager.play('tour', null, 0) // currentTime = 0;
} else if (audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration) {
//未播完
SoundManager.play('tour') //继续播。为什么会有暂停的情况?如果手动切换到bgm了呢?
}
} else {
//很可能是该folder的起始
SoundManager.play('tour', manage.dealURL(src))
}
}
let oldPos = this.player.position.clone()
let oldPano = this.player.currentPano
if (((this.onTheBus = !0), this.emit('update.controls'), this.player.updateLastView(), !n && this.atDestinationPano())) {
/*
// 原地旋转时, 写到_warpCameraAim里,因那有时间
var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
if(r.zoom && r.zoom != this.player.zoomLevel){//add
this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
} */
return void this.arrivedAtDestination(!0)
}
if (this.player.flying || this.player.isWarping()) A.warn('Cannot go to new destination while player is flying or warping.')
else {
var r = this.model.getHeroDescriptorByIndex(this.destinationItem),
o = null,
a1 = null
if (r.isPano()) {
//var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
//var walk = window.DATA.black ? 'black' : 'walk';
//若是点击item,直接瞬间过渡。
var s = e ? 'black' : this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
if (this.destinationItem[0] == 0 && this.destinationItem[1] == 0)
s = 'black' // 周恩光加 返回最初导览点是瞬间过渡
;(a1 = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, true, i, this.actionComplete.bind(this))),
(o = this.arrivedAtDestination.bind(this, !0))
if (s == 'black' && r.zoom && r.zoom != this.player.zoomLevel) {
//add
this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
}
} else {
;(a1 = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this))), (o = this.arrivedAtDestination.bind(this, !1))
}
;(this.transitionStage = y.Moving),
this.model.fadePanoMarkers(0),
this.awaitCompletion(
function () {
a1()
}.bind(this),
o
),
this.emit('update.controls')
}
}),
(n.prototype.tourInterlude = function () {
if (
(h.trackAlways('reach_highlight', {
reach_source: this.reachSource
}),
this.model.fadePanoMarkers(0),
this.emit('update.controls'),
this.tourIsPlaying)
)
return this.atEndOfTour() && !this.endlessLoop
? ((this.tourInProgress = !1),
void this.awaitCompletion(
function () {
;(this.transitionStage = y.Interlude), this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
}.bind(this),
function () {
;(this.currentItem = [0, 0]), this.stopTour(true), this.emit(p.TourEnd)
}.bind(this)
),
void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity)))
: void this.awaitCompletion(
function () {
;(this.transitionStage = y.Interlude), this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
}.bind(this),
this.goNext.bind(this)
)
}),
(n.prototype.findNearestItem = function (endToStart = true) {
//找到离currentPano最近的导览
/* if(this.atDestinationPano(this.player.currentPano)){//在终点直接从头。但有的场景可能不希望如此,就想跳到所属的展区开始。
return [0,0] //2023.7.7发现在点击item后播放会从头开始
} */
//注:没有判断此刻是否在panorama模式,就使用currentPano
var result = { item: [0, 0], dis: Infinity }
var compare = (location, item) => {
if (location.panoId != void 0 && location.panoId != 'outside') {
var pano = this.model.panos.index[location.panoId]
var dis = pano.position.distanceTo(this.player.currentPano.position)
if (dis < result.dis) {
;(result.item = item), (result.dis = dis)
} else if (dis == result.dis) {
//如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
/* if(this.itemCompare(item, this.currentItem, 'equal')){
result.item = item, result.dis = dis
} */
if (this.currentItem && Math.abs(item[0] - this.currentItem[0]) < Math.abs(result.item[0] - this.currentItem[0])) {
;(result.item = item), (result.dis = dis)
}
}
}
}
this.model.heroLocations.forEach((e, i) => {
if (e.heroLocations) {
/* e.heroLocations.forEach((a,j)=>{
compare(a, [i,j])
}) */
var location = e.heroLocations.find(e => e.panoId != void 0)
location && compare(location, [i, 0]) //跳到此区域开头
} else {
compare(e, [i, 0])
}
})
if (endToStart && this.atEndOfTour(result.item)) {
//如果是最后一个点,直接跳到开头,否则导览开始就在终点的话不会从头开始
return [0, 0] //但注意最后是区域的话result.item是区域开头,除非站在最末最末尾的位置,上面的atDestinationPano直接返回
}
return result.item
})
n.prototype.playTour = function () {
if (!this.bounceable() && this.model.heroLocations.length) {
// ------------这部分处理逻辑目前已由playTourNearBy()取代------------------------------------
// if(!this.currentItem) this.currentItem = []
// if(this.currentItem[0] != 0 || this.destinationItem[0]!= this.nItems-1){
// // zeg 从当前pano进行自动导览
// let currentPanoDestinations = this.panoIdMap.get(this.player.currentPano.id)
// // this.model.heroLocations.forEach( (value, index) => {
// // if(value.heroLocations.find( hl => hl.panoId == this.player.currentPano.id )) {
// // currentPanoDestinations.push(index)
// // }
// // })
// if(!currentPanoDestinations) {
// // let panoIndex = this.model.panos.list.findIndex( pano => pano.id == this.player.currentPano.id )
// let panoIndex = this.model.panos.list.indexOf( this.player.currentPano )
// let neighbourIndex = [ panoIndex + 1, panoIndex - 1, panoIndex + 2, panoIndex - 2, panoIndex + 3, panoIndex - 3 ]
// for(var i = 0; i < neighbourIndex.length; i++) {
// currentPanoDestinations = this.panoIdMap.get(this.model.panos.list[neighbourIndex[i]]&&this.model.panos.list[neighbourIndex[i]].id)
// if(currentPanoDestinations && currentPanoDestinations[0] != 0) break
// }
// if(!currentPanoDestinations) currentPanoDestinations = [0];
// }
// if(currentPanoDestinations.indexOf(this.currentItem[0]) == -1) {
// this.currentItem[0] = currentPanoDestinations[0]
// }
// }
return this.tourIsPlaying
? void A.info('tour is already playing')
: void (
this.wouldInterrupt() ||
(this.player.emit('tour_auto', this.defaultWarpStyle),
(this.tourInProgress = !0),
(this.reachSource = 'play'),
(this.tourIsPlaying = !0),
(this.wasZoomEnabled = this.player.zoomEnabled),
(this.player.zoomEnabled = !1),
this.resetSpecialTransition(),
this.emit('update.controls'),
this.emit(p.TourStart),
this.player.enablePreRendering(),
// this.currentItem[1] = null,
this.walkingSectionPaused ? (this.clearWalkingSectionPaused(), this.goToDestination()) : /* this.goNext() */ (this.tourAdvance(0), this.goToDestination()))
) //xzw: 不要直接跳到下一个点开始,从当前点开始,否则当一段区域内只有一个导览时播放会立刻跳到下一个缩略图进行。
}
}
;(n.prototype.playTourNearBy = function () {
//就近导览
if (!this.bounceable()) {
return this.tourIsPlaying
? void A.info('tour is already playing')
: void (
this.wouldInterrupt() ||
(this.player.emit('tour_auto', this.defaultWarpStyle),
(this.tourInProgress = !0),
(this.reachSource = 'play'),
(this.tourIsPlaying = !0),
(this.wasZoomEnabled = this.player.zoomEnabled),
(this.player.zoomEnabled = !1),
this.resetSpecialTransition(),
this.emit('update.controls'),
this.emit(p.TourStart),
this.player.enablePreRendering(),
/* this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
this.goToDestination()) : this.goNext())) */
this.setDestinationItem(this.findNearestItem()),
this.goToDestination())
)
}
}),
/* n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
} */
(n.prototype.stopTour = function (isAutoStop) {
//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
SoundManager.pause('tour'), // zeg 自动导览暂停时同时停止语音
this.isInterrupted() ||
(this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle)) ||
(this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
(this.tourIsPlaying = !1),
this.interrupt(),
this.clearWalkingSectionPaused(),
this.resetSpecialTransition(),
this.emit('update.controls'))
}),
(n.prototype.endTourProgress = function () {
;(this.tourInProgress = !1), this.emit('update.controls'), this.emit(p.TourEnd)
}),
(n.prototype.goToHighlight = function (e) {
if (this.wouldInterrupt()) this.itemCompare(this.destinationItem, e, 'equal') ? this.interrupt() : this.redirectToItem(e, 'goToHighlight')
else {
if ((A.debug(''), this.isInterrupted())) return
this.clearWalkingSectionPaused(), this.setDestinationItem(e), this.useSpecialTransition('Hilight')
this.goToDestination(true), //add true
h.trackAlways('reach_highlight', {
reach_source: 'thumb'
})
}
}),
(n.prototype.prevHighlight = function () {
this.bounceable() ||
(this.player.emit('tour_manual', 'prev'), this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(), (this.reachSource = 'prev'), this.goPrev()))
}),
(n.prototype.nextHighlight = function () {
this.bounceable() ||
(this.player.emit('tour_manual', 'next'), this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(), (this.reachSource = 'next'), this.goNext()))
}),
(n.prototype.changeMode = function (e) {
var t = $.Deferred(),
i = t.resolve.bind(t),
n = t.reject.bind(t)
this.emit(p.StartModeChange)
var r = function () {
return this.clearWalkingSectionPaused(), !!this.wouldInterrupt() && (this.interrupt(), !0)
}.bind(this)
if (!r()) {
switch (e) {
case c.PANORAMA:
this.player.mode === c.PANORAMA
? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n)
: this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n)
break
case c.DOLLHOUSE:
case c.FLOORPLAN:
this.player
.flyToNewMode({
mode: e
})
.done(i)
.fail(n)
break
case c.OUTDOOR:
this.player.model.has360Views &&
(this.player.mode !== c.PANORAMA || (this.player.mode === c.PANORAMA && this.player.currentPano.isAligned())) &&
this.player.goToLastView(!1).done(i).fail(n)
}
return t.promise()
}
}),
(n.prototype.atEndOfTour = function (currentItem = this.currentItem) {
var end = currentItem && currentItem[0] >= this.nItems - 1
if (end) {
var heroLocations = this.model.heroLocations[this.nItems - 1].heroLocations
if (heroLocations) {
end = currentItem[1] >= heroLocations.length - 1
}
}
return end
}),
(n.prototype.firstDestination = function () {
//return 0 < this.nItems ? 0 : null
return 0 < this.nItems ? [0, 0] : null
}),
(n.prototype.finalDestination = function () {
//return 0 < this.nItems ? this.nItems - 1 : null
return 0 < this.nItems ? [this.nItems - 1, 0] : null
}),
(n.prototype.goPrev = function () {
this.tourAdvance(-1)
}),
(n.prototype.goNext = function () {
this.tourAdvance(1)
}),
(n.prototype.setDestinationItem = function (e) {
;(this.destinationItem = e), this.emit('update.controls')
}),
(n.prototype.setCurrentItem = function (e) {
;(this.currentItem = e), this.emit('update.controls')
}),
(n.prototype.nextItem = function (currentItem) {
//return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
if (currentItem == void 0) return this.firstDestination()
var currentLocation = this.model.heroLocations[currentItem[0]]
var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
var item
if (this.currentItem[1] >= currentChildNum - 1) {
//子目录中最后一个
item = [currentItem[0] + 1, 0] //结果可能超出nItems
} else {
item = [currentItem[0], currentItem[1] + 1]
}
if (item[0] >= this.nItems) {
item = this.firstDestination()
}
return item
//暂时不理会endlessLoop,默认为false
}),
(n.prototype.prevItem = function (currentItem) {
//return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
if (currentItem == void 0) return this.firstDestination()
var item
var lastLocation = this.model.heroLocations[currentItem[0] - 1]
if (!lastLocation) return this.finalDestination() //[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
else {
var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
if (this.currentItem[1] == 0) {
//子目录中第一个
return [currentItem[0] - 1, lastChildNum - 1]
} else {
return [currentItem[0], currentItem[1] - 1]
}
}
}),
(n.prototype.tourAdvance = function (e) {
//e是1或-1 或 0
A.debug('tourAdvance(' + e + ')')
// // zeg改
if (null === this.currentItem || void 0 === this.currentItem) {
// this.setDestinationItem(this.firstDestination())
// this.setDestinationItem([currentPanoDestinations[0], 0])
this.setDestinationItem([this.currentItem[0], 0])
}
// else if(this.currentItem[1] == null) {
// this.setDestinationItem([this.currentItem[0], 0])
// }
else {
var item = this.currentItem
if (e == 1) {
item = this.nextItem(this.currentItem)
} else if (e == -1) {
item = this.prevItem(this.currentItem)
}
this.setDestinationItem(item)
}
if (this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')) {
this.useSpecialTransition('reverse-looping to end')
} else if (this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')) {
this.useSpecialTransition('looping back to start')
}
/* var momentTour = this.getMomentTour(this.destinationItem);
if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
var zoomLevel = this.player.zoomLevel;
this.player.zoomEnabled = true;
var zoom = function(e, d) {
this.player.zoomTo((1-e)*zoomLevel, true)
}.bind(this)
s.start(zoom, 1500, function(){
}, 0, d.easeOutQuad, "zoom")
} */
this.goToDestination()
}),
(n.prototype.getMomentTour = function (destinationItem) {
//add
var wholeMomentTour = window.DATA.momentTour || 'walk' //最外层 还有一种是'std'
if (!destinationItem) return wholeMomentTour
else {
var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem) //最内层。 如果有使用最内层
if (currentLocation.momentTour) return currentLocation.momentTour
var currentLocation_ = this.model.heroLocations[destinationItem[0]]
return currentLocation_.momentTour || wholeMomentTour //若中间层或最内层有就使用,否则使用最外层
}
}),
(t.exports = n)
}).call(this, '/js/director.js')
},
{
'./analytics': 4,
'./enum/BlackoutStyle': 18,
'./enum/ControlEvents': 21,
'./enum/DirectorEvents': 23,
'./enum/ModelManagerEvents': 33,
'./enum/PathDiscardMode': 38,
'./enum/PathDisplayMode': 39,
'./enum/PlayerEvents': 40,
'./enum/Viewmode': 51,
'./enum/WarpStyle': 52,
'./model/ModelManager': 140,
'./player': 155,
'./settings': 166,
'./util/logger': 189,
'./util/transitions': 195,
events: 202,
three: 217
}
],
16: [
function (e, t, i) {
'use strict'
var n = e('three'),
r = e('./enum/Viewmode'),
o = (e('./settings'), e('./util/transitions')),
a = e('./enum/PlayerEvents'),
s = new n.ShaderPass(n.HorizontalBlurShader),
l = new n.ShaderPass(n.VerticalBlurShader)
l.renderToScreen = !0
var c = $('#player').width() / $('#player').height()
isNaN(c) && (c = 1)
var h = {
currentBlur: 0,
aspect: c,
blurStrength: 1,
hblurPass: s,
vblurPass: l,
fastTranMaskPass: new n.TransitionPass(),
bindEvents: function (e) {
e.on(a.ModeChanged, function (e, t) {
e === r.PANORAMA && (o.cancel(h.blur), o.cancel(h.addBlur), o.start(h.removeBlur, 500, null, 0, null, 'deblur'))
})
},
blur: function (e) {
h.currentBlur = e
var t = e * h.blurStrength
;(l.uniforms.v.value = (t / 512) * h.aspect), (s.uniforms.h.value = t / 512)
},
addBlur: function (e) {
;(e = Math.max(e, h.currentBlur)), h.blur(e)
},
removeBlur: function (e) {
;(e = Math.min(1 - e, h.currentBlur)), h.blur(e)
}
}
h.blur(0), (t.exports = h)
},
{
'./enum/PlayerEvents': 40,
'./enum/Viewmode': 51,
'./settings': 166,
'./util/transitions': 195,
three: 217
}
],
17: [
function (e, t, i) {
'use strict'
t.exports = {
UNKNOWN: 0,
ALIGNED: 1,
UNALIGNED: 2,
PLACED: 3
}
},
{}
],
18: [
function (e, t, i) {
'use strict'
t.exports = {
NONE: 0,
MIDDLE: 1,
END: 2,
BEGINNING: 3,
FADEIN: 4
}
},
{}
],
19: [
function (e, t, i) {
'use strict'
var n = e('three')
t.exports = {
newBlue: new n.Color(4967932),
altBlue: new n.Color(47355),
tagDefault: new n.Color(223357),
classicBlue: new n.Color(53759),
mpYellow: new n.Color(16502016),
mpOrange: new n.Color(16428055),
mpBlue: new n.Color(12096),
mpLtGrey: new n.Color(13751252),
mpDkGrey: new n.Color(10000019),
mpRed: new n.Color(12525854),
mpOrangeDesat: new n.Color(16764529),
mpBlueDesat: new n.Color(4034734),
mpRedDesat: new n.Color(14705505),
white: new n.Color(16777215),
black: new n.Color(0),
_desat: function (e, t) {
var i = t || 0.3,
r = new n.Color().copy(e).getHSL()
return new n.Color().setHSL(r.h, r.s * (1 - i), r.l)
},
_darken: function (e, t) {
var i = t || 0.2,
r = e.getHSL()
return new n.Color().setHSL(r.h, r.s, r.l * (1 - i))
}
}
},
{
three: 217
}
],
20: [
function (e, t, i) {
'use strict'
t.exports = {
NONE: -1,
ROTATE: 0,
DOLLY: 1,
PAN: 2,
ROTATE_DOLLY: 3,
PAN_DOLLY: 4
}
},
{}
],
21: [
function (e, t, i) {
'use strict'
t.exports = {
Move: 'move',
InteractionDirect: 'interaction.direct',
InteractionKey: 'interaction.key',
InteractionGui: 'interaction.gui',
FlyInDirection: 'fly.direction',
InputStart: 'input.start',
Pinch: 'input.pinch',
Scroll: 'input.scroll',
AutoPanInterrupt: 'autopan.interrupt',
AutoPanComplete: 'autopan.complete',
AutoPanClamped: 'autopan.clamped',
LongTap: 'longtap'
}
},
{}
],
22: [
function (e, t, i) {
'use strict'
t.exports = Object.freeze({
FORWARD: 'FORWARD',
LEFT: 'LEFT',
RIGHT: 'RIGHT',
BACK: 'BACK',
UP: 'UP',
DOWN: 'DOWN'
})
},
{}
],
23: [
function (e, t, i) {
'use strict'
t.exports = {
ActionInterrupted: 'action.interrupted',
TourStart: 'tour.start',
TourEnd: 'tour.end',
StartModeChange: 'mode.startChange'
}
},
{}
],
24: [
function (e, t, i) {
'use strict'
t.exports = Object.freeze({
None: 0,
Queued: 1,
ForceQueued: 2,
Downloading: 3,
Downloaded: 4,
DownloadFailed: 5
})
},
{}
],
25: [
function (e, t, i) {
'use strict'
t.exports = {
GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
}
},
{}
],
26: [
function (e, t, i) {
'use strict'
t.exports = {
Texture2D: 0,
TextureCube: 1
}
},
{}
],
27: [
function (e, t, i) {
'use strict'
t.exports = {
SMALL: 'small',
LARGE: 'large'
}
},
{}
],
28: [
function (e, t, i) {
'use strict'
var n = e('./Viewmode'),
r = {
LANDING: {},
NAVIGATION: 'navigation',
MORE_HELP: 'moreHelp',
TOUR_INTERACTION: {}
}
;(r.LANDING[n.PANORAMA] = 'panorama.landing'),
(r.LANDING[n.OUTDOOR] = 'outdoor.landing'),
(r.LANDING[n.DOLLHOUSE] = 'dollhouse.landing'),
(r.LANDING[n.FLOORPLAN] = 'floorplan.landing'),
(r.TOUR_INTERACTION.standard = 'standard.tour'),
(r.TOUR_INTERACTION[n.OUTDOOR] = 'outdoor.tour'),
(r.TOUR_INTERACTION[n.FLOORPLAN] = 'floorplan.tour'),
(t.exports = r)
},
{
'./Viewmode': 51
}
],
29: [
function (e, t, i) {
'use strict'
var n = {
UP: 1,
DOWN: -1,
LEFT: 'L',
RIGHT: 'R',
FORWARD: 'F',
BACK: 'B',
reverse: {},
opposite: function (e) {
return this.reverse[e.toString()]
}
}
!(function () {
;(n.reverse[n.UP] = n.DOWN), (n.reverse[n.DOWN] = n.UP), (n.reverse[n.LEFT] = n.RIGHT), (n.reverse[n.RIGHT] = n.LEFT), (n.reverse[n.FORWARD] = n.BACK), (n.reverse[n.BACK] = n.FORWARD)
})(),
(t.exports = n)
},
{}
],
30: [
function (e, t, i) {
'use strict'
var n = e('../util/browser'),
r = {
ZERO: 48,
ONE: 49,
TWO: 50,
THREE: 51,
FOUR: 52,
FIVE: 53,
SIX: 54,
SEVEN: 55,
EIGHT: 56,
NINE: 57,
LEFTARROW: 37,
UPARROW: 38,
RIGHTARROW: 39,
DOWNARROW: 40,
A: 65,
B: 66,
C: 67,
D: 68,
E: 69,
F: 70,
G: 71,
H: 72,
I: 73,
J: 74,
K: 75,
L: 76,
M: 77,
N: 78,
O: 79,
P: 80,
Q: 81,
R: 82,
S: 83,
T: 84,
U: 85,
V: 86,
W: 87,
X: 88,
Y: 89,
Z: 90,
SPACE: 32,
RETURN: 13,
SEMICOLON: 186,
PLUSEQUALS: 187,
DASHUNDERSCORE: 189,
OPENBRACKET: 219
}
n.detectFirefox() && ((r.SEMICOLON = 59), (r.PLUSEQUALS = 61), (r.DASHUNDERSCORE = 173)), (t.exports = r)
},
{
'../util/browser': 182
}
],
31: [
function (e, t, i) {
'use strict'
t.exports = {
EN_US: 'en-US',
ES_MX: 'es-MX',
FR_FR: 'fr-FR',
DE_DE: 'de-DE',
RU_RU: 'ru-RU',
CN_CN: 'cn-CN',
JP_JP: 'jp-JP'
}
},
{}
],
32: [
function (e, t, i) {
'use strict'
t.exports = {
TagActivated: 'tag.activated',
TagDismissed: 'tag.dismissed',
TagNavigation: 'tag.navigation'
}
},
{}
],
33: [
function (e, t, i) {
'use strict'
t.exports = {
ModelAdded: 'model-added',
ActiveModelChanged: 'active-model-changed'
}
},
{}
],
34: [
function (e, t, i) {
'use strict'
t.exports = {
LEFT: 0,
MIDDLE: 1,
RIGHT: 2
}
},
{}
],
35: [
function (e, t, i) {
'use strict'
t.exports = {
PanoRenderComplete: 'panorama.render.complete',
TileRenderFailure: 'panorama.tile.render.failed',
TileRenderSuccess: 'panorama.tile.render.success',
TileUploadAttempted: 'panorama.tile.upload.attempted',
UploadAttemptedForAllTiles: 'panorama.upload.attempted.all.tiles',
ZoomLevelRenderStarted: 'panorama.zoom.render.started'
}
},
{}
],
36: [
function (e, t, i) {
'use strict'
t.exports = {
BASE: 1,
STANDARD: 2,
HIGH: 3,
ULTRAHIGH: 4
}
},
{}
],
37: [
function (e, t, i) {
'use strict'
t.exports = {
LoadComplete: 'panorama.load.complete',
LoadFailed: 'panorama.load.failed',
TileLoaded: 'panorama.tile.loaded'
}
},
{}
],
38: [
function (e, t, i) {
'use strict'
t.exports = Object.freeze({
Standard: 0,
Slow: 1,
Retain: 2
})
},
{}
],
39: [
function (e, t, i) {
'use strict'
t.exports = Object.freeze({
Show: 0,
Hide: 1,
Retain: 2
})
},
{}
],
40: [
function (e, t, i) {
'use strict'
t.exports = {
Move: 'move',
MoveComplete: 'move.complete',
ModeChanged: 'mode.changed',
ModeChanging: 'mode.changing',
PanoChosen: 'pano.chosen',
ClosestPanoChanging: 'closest.pano.changing',
WarpStarted: 'warp.started',
WarpInterrupted: 'warp.interrupted',
WarpEnded: 'warp.ended',
FlyinFinished: 'flyin.finished',
FlyingStarted: 'flying.started',
FlyingInterrupted: 'flying.interrupted',
FlyingEnded: 'flying.ended',
Ready: 'ready',
StartInside: 'start.inside',
StartOutside: 'start.outside',
ViewChanged: 'view.changed',
WarpInterruptedWithFlyTo: 'warp.interrupted.flyto',
InputStart: 'input.start'
}
},
{}
],
41: [
function (e, t, i) {
'use strict'
t.exports = Object.freeze({
DEFAULT: 0,
PANOMARKERS: 1,
RETICULE: 2,
TAG: 3
})
},
{}
],
42: [
function (e, t, i) {
'use strict'
t.exports = {
visibleFloor: 1,
ghostFloor: 3,
boundingSkybox: 1,
panoMarker: 2,
reticule: 3,
tagStem: 4,
tagDisc: 5,
ribbon: 100
}
},
{}
],
43: [
function (e, t, i) {
'use strict'
t.exports = {
ContextCreated: 'scene-renderer-context-created',
AfterRender: 'after-render',
MemoryUsageUpdated: 'scene-renderer-memory-usage-updated'
}
},
{}
],
44: [
function (e, t, i) {
'use strict'
t.exports = {
IDLE: 'idle',
BROWSE: 'browse',
EXAMINE: 'examine'
}
},
{}
],
45: [
function (e, t, i) {
'use strict'
t.exports = {
TileDownloadSuccess: 'tiledownloader.download.success',
TileDownloadFailure: 'tiledownloader.download.failure',
PanoDownloadComplete: 'tiledownloader.pano.download.complete'
}
},
{}
],
46: [
function (e, t, i) {
'use strict'
t.exports = {
CardboardAndroid: 'googlevr',
GearVR: 'gearvr',
CardboardIOS: 'googlevrios',
Cardboard: 'googlevr'
}
},
{}
],
47: [
function (e, t, i) {
'use strict'
t.exports = {
NONE: 0,
CONTEXTUAL: 1,
ANDROID: 2
}
},
{}
],
48: [
function (e, t, i) {
'use strict'
var n = {
Title: 0,
Cardboard: 1
},
r = {
Title: 0,
Cardboard: 1,
Gear: 2
}
!(function () {
;[n, r].forEach(function (e) {
e.pageCount = Object.keys(e).length
})
})(),
(t.exports.ios = n),
(t.exports.standard = r)
},
{}
],
49: [
function (e, t, i) {
'use strict'
t.exports = {
Android: 'android',
IOS: 'ios',
Desktop: 'desktop',
UnsupportedAndroid: 'android-unsupported'
}
},
{}
],
50: [
function (e, t, i) {
'use strict'
var n = e('three')
t.exports = {
UP: new n.Vector3(0, 1, 0),
DOWN: new n.Vector3(0, -1, 0),
LEFT: new n.Vector3(-1, 0, 0),
RIGHT: new n.Vector3(1, 0, 0),
FORWARD: new n.Vector3(0, 0, -1),
BACK: new n.Vector3(0, 0, 1)
}
},
{
three: 217
}
],
51: [
function (e, t, i) {
'use strict'
var n = e('../exception/ViewmodeConvertException'),
r = e('./coreViewmodes'),
o = e('../util/common'),
a = {
MESH: 'mesh',
OUTDOOR: 'outdoor',
TRANSITIONING: 'transitioning',
toInt: function (e) {
switch (e) {
case this.PANORAMA:
return 1
case this.DOLLHOUSE:
return 2
case this.FLOORPLAN:
return 3
case this.OUTDOOR:
return 4
case this.TRANSITIONING:
return -1
}
throw new n('No known conversion for Viewmode to int for mode: ' + e)
},
fromInt: function (e) {
switch (e) {
case '1':
case 1:
return this.PANORAMA
case '2':
case 2:
return this.DOLLHOUSE
case '3':
case 3:
return this.FLOORPLAN
case '4':
case 4:
return this.OUTDOOR
}
throw new n('No known conversion for int to viewmode for int: ' + e)
},
convertWorkshopModeInt: function (e) {
switch (e) {
case '0':
case 0:
case undefined: //xzw add
return this.PANORAMA
case '1':
case 1:
return this.FLOORPLAN
case '2':
case 2:
return this.DOLLHOUSE
case '3':
case 3:
return this.MESH
}
throw new n('No known conversion for Workshop int to viewmode for int: ' + e)
}
}
o.extendObject(a, r), (t.exports = a)
},
{
'../exception/ViewmodeConvertException': 58,
'../util/common': 185,
'./coreViewmodes': 54
}
],
52: [
function (e, t, i) {
'use strict'
t.exports = {
BLACK: 'black',
STD: 'std',
WALK: 'walk'
}
},
{}
],
53: [
function (e, t, i) {
'use strict'
t.exports = {
ZoomIn: 'zoom.in',
ZoomOut: 'zoom.out',
ZoomMax: 'zoom.max',
ZoomMin: 'zoom.min'
}
},
{}
],
54: [
function (e, t, i) {
'use strict'
t.exports = {
PANORAMA: 'panorama',
DOLLHOUSE: 'dollhouse',
FLOORPLAN: 'floorplan'
}
},
{}
],
55: [
function (e, t, i) {
'use strict'
function n(e) {
this.message = e
}
t.exports = n
},
{}
],
56: [
function (e, t, i) {
'use strict'
function n(e) {
r.call(this, e)
}
var r = e('./BasicException')
;(n.prototype = Object.create(r.prototype)), (t.exports = n)
},
{
'./BasicException': 55
}
],
57: [
function (e, t, i) {
'use strict'
function n(e) {
r.call(this, e)
}
var r = e('./BasicException')
;(n.prototype = Object.create(r.prototype)), (t.exports = n)
},
{
'./BasicException': 55
}
],
58: [
function (e, t, i) {
'use strict'
function n(e) {
r.call(this, e)
}
var r = e('./BasicException')
;(n.prototype = Object.create(r.prototype)), (t.exports = n)
},
{
'./BasicException': 55
}
],
59: [
function (e, t, i) {
;(function (i) {
'use strict'
function n(e) {
var t = {}
if (e) {
var i = e.flags
if (i) for (var n in i) i.hasOwnProperty(n) && (t[i[n]] = !0)
return t
}
return l.debug('Feature flags -> parseFeatureFlags: rawData is null.'), null
}
var r = e('./util/ajax'),
o = e('./util/showcase'),
a = e('./util/logger'),
s = '',
l = new a(i),
c = {}
t.exports = {
loadFeatureFlags: function (e) {
var t = $.Deferred()
return (
r
.get(e.urlBase + s, {
responseType: 'json',
prefetchFrom: 'user',
auth: o.getAuthorizationHeader()
})
.done(function (e) {
;(c = n(e)), c ? t.resolve(c) : t.reject('loading-failed')
})
.fail(function () {
l.debug('Retrieval of feature flags failed.'), t.reject('loading-failed')
}),
t.promise()
)
},
getFlags: function () {
return c
},
updateDependentSettings: function (e, t) {
;(e = e || c),
e.labels && (t.labels.enabled = !0),
e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
e.showcase_sdk && (t.sdkInit = !0),
e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
e.showcase_webvr && (t.vr.allowWebVR = !0),
e.uhql && (t.tiling.allowUltraHighResolution = !0),
e.hide_sc_sharing && (t.share.enabled = !1)
}
}
}).call(this, '/js/featureflags.js')
},
{
'./util/ajax': 181,
'./util/logger': 189,
'./util/showcase': 193
}
],
60: [
function (e, t, i) {
'use strict'
var n =
(e('../util/common'),
{
status: 0,
set: function (e) {
if (isNaN(e)) return !1
var t = $('.progressbar')
0 > e && (e = 0)
e > 100 && (e = 100)
var width = parseInt(t.css('width').replace('px', '')) / 100 //获取进度条总长度除以100
var barperc = e * width
var perc = Math.round(e)
var labelpos = parseInt(barperc) - 15
t.find('.bar').css('width', barperc) //已经再跑颜色的百分比
t.find('.label').css('left', labelpos) //上面跟着的字的百分比
t.find('.perc').text(perc + '%') //具体数字的百分比
this.status = e
},
done: function (e) {
return e || this.status ? ((this.status = null), this.set(100)) : this
}
})
t.exports.circleLoader = n
},
{
'../util/common': 185
}
],
61: [
function (e, t, i) {
'use strict'
t.exports = Object.freeze({
CLOSE: 'modal.closer.close'
})
},
{}
],
62: [
function (e, t, i) {
'use strict'
function n(e, t) {
t && (t.stopPropagation(), t.preventDefault()), e && this.emit(l.CLOSE, e), g.reset()
}
function r(e, t) {
function i() {
var t = e.offsetHeight >= $('#player').height() && e.offsetWidth >= $('#player').width()
t !== f && ((f = t), t ? (e.classList.add('closeByFooter'), h.classList.add('closeByFooter')) : (e.classList.remove('closeByFooter'), h.classList.remove('closeByFooter')))
}
t ? setTimeout(i, o.guiAnimationSpeed) : i()
}
var o = e('../../settings'),
a = (e('../../tag/Media/MediaEvent'), e('../../util/browser')),
s = e('../../util/common'),
l = e('./ModalCloserEvent'),
c = e('events').EventEmitter,
h = document.getElementsByClassName('footer')[0],
u = h.querySelectorAll('.close')[0],
d = null,
p = null,
f = null,
g =
(a.isMobile(),
{
open: function (e) {
e &&
(r(e),
d && u.removeEventListener('click', d, !0),
(d = n.bind(this, e.id)),
u.addEventListener('click', d, !0),
p && window.removeEventListener('resize', p, !0),
(p = r.bind(this, e)),
window.addEventListener('resize', p, !0))
},
reset: function () {
h.classList.remove('closeByFooter'), u.removeEventListener('click', d, !0), window.removeEventListener('resize', p, !0), (d = p = f = null)
}
})
s.extendObject(g, c.prototype), (t.exports = g)
},
{
'../../tag/Media/MediaEvent': 131,
'../../settings': 166,
'../../util/browser': 182,
'../../util/common': 185,
'./ModalCloserEvent': 61,
events: 202
}
],
63: [
function (e, t, i) {
'use strict'
function n(e, t, i) {
var n = new r.GUI({
width: 400
}),
u = n.addFolder('Flydown from Dollhouse')
u.add(h.flydown, 'movementEasing', Object.keys(a)),
u.add(h.flydown, 'movementDelay', 0, 1).step(0.01),
u.add(h.flydown, 'rotationEasing', Object.keys(a)),
u.add(h.flydown, 'rotationDelay', 0, 1).step(0.01),
u.add(h.flydown, 'modelTextureDelay', 0, 1).step(0.01),
u.add(h.flydown, 'skyboxDelay', 0, 1).step(0.01),
u.add(h.dollhouseDefault, 'minPolarAngle', 0, o.Math.degToRad(50)),
u.add(h.dollhouseDefault, 'maxPolarAngle', o.Math.degToRad(50), o.Math.degToRad(170))
var d = n.addFolder('Transition between panos')
d.add(h.transition, 'blur', 0, 10).onFinishChange(function () {}),
d
.add(h.transition, 'flySpeed', 0, 10)
.step(0.01)
.onFinishChange(function () {
;(h.transition.flyTime = 0),
d.__controllers.forEach(function (e) {
e.updateDisplay()
})
}),
d.add(h.transition, 'flyTime', 0, 5e3).onFinishChange(function () {
;(h.transition.flySpeed = 0),
d.__controllers.forEach(function (e) {
e.updateDisplay()
})
}),
d.add(h.transition, 'aimTime', 500, 2500).step(50),
d.add(h.transition, 'aimSlowFactor', 1, 3).step(0.1),
d.add(h.transition, 'movementEasing', Object.keys(a))
var p = n.addFolder('Path Display')
p
.add(h.path, 'opacity', 0, 1)
.step(0.01)
.onFinishChange(function () {}),
p
.add(h.path, 'height', 0, 0.2)
.step(0.01)
.onFinishChange(function () {}),
p
.add(h.path, 'outsideHeight', 0, 2)
.step(0.01)
.onFinishChange(function () {}),
p
.add(h.path, 'ribbonWidth', 0.01, 0.35)
.step(0.01)
.onFinishChange(function () {}),
p
.add(h.path, 'waypointRadius', 0.01, 1.2)
.step(0.01)
.onFinishChange(function () {}),
p
.add(h.path, 'waypointPulse', 0, 3600)
.step(20)
.onFinishChange(function () {}),
p
.add(h.path, 'waypointIndoorRadius', 0.01, 1.2)
.step(0.01)
.onFinishChange(function () {}),
p
.add(h.path, 'fadeInTime', 0, 1200)
.step(10)
.onFinishChange(function () {}),
p
.add(h.path, 'fadeOutTime', 0, 1200)
.step(10)
.onFinishChange(function () {}),
p.add(h.path, 'color', Object.keys(l)).onFinishChange(function () {
;(h.path.color = l[h.path.color]), (h.path.colorUp = l._desat(h.path.color)), (h.path.colorDown = l.darken(h.path.color))
}),
p.add(h, 'reticuleColor', Object.keys(l)).onFinishChange(function () {
h.reticuleColor = l[h.reticuleColor]
})
var f = n.addFolder('Warping'),
g = f.addFolder('Warp/Teleport')
g.add(h.warp, 'softPushDist', 0, 2).onFinishChange(function () {}),
g
.add(h.warp, 'softPushEnd', 0, 1)
.step(0.01)
.onFinishChange(function () {}),
g.add(h.warp, 'softBendAngle', 0, 45).onFinishChange(function () {}),
g.add(h.warp, 'softBendTilt', 0, 45).onFinishChange(function () {}),
g
.add(h.warp, 'softBendEnd', 0, 1)
.step(0.01)
.onFinishChange(function () {}),
g.add(h.warp, 'burnsAngle', 0, 30).onFinishChange(function () {}),
g.add(h.warp, 'minBurnsAngle', 0, 10).onFinishChange(function () {}),
g.add(h.warp, 'brakeStrength', 1, 8).onFinishChange(function () {}),
g
.add(h.warp, 'minBrakeAngle', 0, 5)
.step(0.01)
.onFinishChange(function () {}),
g
.add(h.warp, 'maxBrakeAngle', 0, 5)
.step(0.01)
.onFinishChange(function () {}),
g.add(h.path, 'mapGuides').onFinishChange(function () {}),
g
.add(h.warp, 'teleportTime', 0, 5e3)
.step(10)
.onFinishChange(function () {}),
g
.add(h.warp, 'outsideTime', 0, 5e3)
.step(10)
.onFinishChange(function () {}),
g.add(h.path, 'typ', Object.keys(c)).onFinishChange(function () {
h.path.typ = c[h.path.typ]
}),
g
.add(h.warp, 'loop')
.onChange(function () {})
.onFinishChange(function () {
t.endlessLoop = h.warp.loop
}),
g
.add(h.warp, 'walkSlideShowThreshhold', 1, 1e4)
.step(1)
.onFinishChange(function () {}),
g
.add(h.warp, 'walkExtraPanosDistance', 0, 3)
.step(0.1)
.onFinishChange(function () {}),
g
.add(h.transition, 'fastForwardFactor', 1, 10)
.step(1)
.onFinishChange(function () {})
var m = f.addFolder('Long Warp Only')
m
.add(h.warp, 'minWarpTime', 0, 5e3)
.step(10)
.onFinishChange(function () {
;(h.warp.flySpeed = 0),
m.__controllers.forEach(function (e) {
e.updateDisplay()
})
}),
m
.add(h.warp, 'timePerMeter', 0, 5e3)
.step(10)
.onFinishChange(function () {}),
m
.add(h.warp, 'lookAheadMax', 0.01, 1)
.step(0.01)
.onFinishChange(function () {}),
m
.add(h.warp, 'lookAheadDist', 0.01, 4)
.step(0.01)
.onFinishChange(function () {}),
m
.add(h.warp, 'maxTurnPerSec', 0, 720)
.step(1)
.onFinishChange(function () {}),
m
.add(h.warp, 'maxAimPerSec', 0, 720)
.step(1)
.onFinishChange(function () {}),
m
.add(h.warp, 'turnFriction', 0, 1)
.step(0.01)
.onFinishChange(function () {}),
m
.add(h.warp, 'walkDelay', 0, 2e3)
.step(10)
.onFinishChange(function () {}),
m
.add(h.transition, 'flytimeMaxDistanceThreshold', 0, 25)
.step(10)
.onFinishChange(function () {}),
m
.add(h.warp, 'walkMaxDist', 0, 100)
.step(1)
.onFinishChange(function () {})
var v = n.addFolder('Warp Esoterica')
v
.add(h.warp, 'nearPanoDist', 0.01, 12)
.step(0)
.onFinishChange(function () {}),
v.add(h.warp, 'blur', 0.01, 1).onFinishChange(function () {}),
v
.add(h.warp, 'flySpeed', 0, 10)
.step(0.01)
.onFinishChange(function () {
;(h.warp.minWarpTime = 0),
v.__controllers.forEach(function (e) {
e.updateDisplay()
})
}),
v.add(h.warp, 'showBunny').onFinishChange(function () {}),
v
.add(h.warp, 'fastTime', 0, 2500)
.step(10)
.onFinishChange(function () {}),
v.add(h.warp, 'movementEasing', Object.keys(a))
var A = n.addFolder('Misc')
A.add(h, 'dollhouseFOV', 10, 180).onChange(function () {
i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
}),
A.add(h, 'insideFOV', 10, 180).onChange(function () {
i.cameras[s.PANORAMA].fov = h.insideFOV
}),
A.add(h, 'insideLookSpeed', 0.01, 0.3)
.step(0.01)
.onChange(function () {}),
A.add(h, 'rotationAccelerationInside', 0.1, 10)
.step(0.1)
.onChange(function () {}),
A.add(h, 'rotationAccelerationOutside', 0.1, 10)
.step(0.1)
.onChange(function () {})
var y = n.addFolder('Navigation')
y.add(h.navigation, 'panoScores').onFinishChange(function () {
h.navigation.panoScores ||
e.panos.forEach(function (e) {
e.floor.remove(e.text3d), (e.text3d = null)
})
}),
y.add(h.navigation, 'mouseDirection'),
y.add(h.navigation, 'filterStrictness', 0, 1),
y.add(h.navigation, 'angleFactor', -60, 0),
y.add(h.navigation, 'directionFactor', 1, 20),
y.add(h.navigation, 'distanceFactor', -5, 5),
y.add(h.navigation, 'optionalityFactor', 0.1, 10)
var C = n.addFolder('tags'),
I = C.addFolder('Tag Creation')
I.add(h.tags.pole, 'enabled').name('poleEnabled'),
I.add(h.tags.pole, 'height', 0, 2.5).step(0.01).name('poleHeight'),
I.add(h.tags.pole, 'width', 1, 10).step(1).name('poleWidth'),
I.add(h.tags.pole, 'opacity', 0.1, 1).step(0.1).name('poleOpacity')
var E = C.addFolder('Visibility')
E.add(h.tags.visibility, 'anyDistance'),
E.add(h.tags.visibility, 'visibleDistance', 0.1, 30).step(0.1),
E.add(h.tags.visibility, 'cameraClearance', 0, 1).step(0.01),
E.add(h.tags.visibility, 'hideViaFloor'),
E.add(h.tags.visibility, 'hideOffScreenDisc').name('hideEdgeDisc'),
E.add(h.tags.visibility, 'hideOffScreenObject').name('hideEdgeObject')
var b = C.addFolder('Disc Parameters')
b.add(h.tags.disc.scale, 'nearBound', 0.1, 10).step(0.1),
b.add(h.tags.disc.scale, 'farBound', 0.1, 20).step(0.1).listen(),
b.add(h.tags.disc.scale, 'linkFarBound').onChange(function (e) {
e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
}),
b
.add(h.tags.disc.scale, 'linkPercent', 0, 100)
.step(1)
.onChange(function (e) {
h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
}),
b.add(h.tags.disc.scale, 'maxSize', 40, 200).step(1),
b.add(h.tags.disc.scale, 'minSize', 20, 100).step(1),
b.add(h.tags.disc.scale, 'responsiveness', 0, 100).step(1)
var w = C.addFolder('Navigate')
w.add(h.tags.navigate, 'nearestPano').name('nearestPano'),
w.add(h.tags.navigate, 'lineOfSight').name('lineOfSight'),
w.add(h.tags.navigate, 'reactivate').name('reactivate'),
w.add(h.tags.navigate, 'aimAt', ['disc', 'object', 'pole', 'nothing']).name('aim at'),
w.add(h.tags.navigate, 'tiltTolerance', 0, 50).step(1),
w.add(h.tags.navigate, 'rotateSpeedFactor', 0, 5).step(0.1)
var _ = n.addFolder('Debug')
_.add(h, 'wireframe').onFinishChange(function () {
e.chunks.forEach(function (t) {
t.material &&
(t.wireframeTwin ||
((t.wireframeTwin = new o.WireframeHelper(t)),
(t.wireframeTwin.material.depthWrite = !1),
(t.wireframeTwin.material.depthTest = !1),
(t.wireframeTwin.material.opacity = 0.5),
(t.wireframeTwin.material.transparent = !0)),
h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
})
}),
_.add(h, 'skyboxWireframe').onFinishChange(function () {
h.skyboxWireframe ? ((e.skybox.wireframe = new o.WireframeHelper(e.skybox)), e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe), (e.skybox.wireframe = null))
}),
_.add(h, 'showSweeps').onFinishChange(function () {
e.setSweepVisibility(h.showSweeps)
}),
_.add(h, 'showMesh').onFinishChange(function () {
e.chunks.forEach(function (e) {
e.visible = h.showMesh
})
}),
_.add(h, 'showFloors').onFinishChange(function () {
e.floors.forEach(function (e) {
e.collider.children.forEach(function (e) {
e.material.visible = h.showFloors
})
})
}),
_.add(h, 'showSkyboxes').onFinishChange(function () {
e.panos.forEach(function (e) {
e.skyboxMesh.visible = h.showSkyboxes
})
}),
_.add(h, 'showNeighbors').onChange(function () {}),
_.add(e, 'alpha', 0, 1)
}
var r = e('../lib/dat.gui'),
o = e('three'),
a = e('../util/easing'),
s = e('../enum/Viewmode'),
l = e('../enum/Colors'),
c = e('../enum/WarpStyle'),
h = e('../settings')
e('../tag/tag')
;(r.GUI.prototype.removeFolder = function (e) {
var t = this.__folders[e]
t && (t.close(), this.__ul.removeChild(t.domElement.parentNode), delete this.__folders[e], this.onResize())
}),
(t.exports.toggle = n)
},
{
'../enum/Colors': 19,
'../enum/Viewmode': 51,
'../enum/WarpStyle': 52,
'../lib/dat.gui': 93,
'../tag/tag': 123,
'../settings': 166,
'../util/easing': 186,
three: 217
}
],
64: [
function (e, t, i) {
;(function (i) {
'use strict'
function n(e, t, i, n) {
$('.gui-error .error-problem-text').text(e),
$('.gui-error .error-solution-text').text(t),
$('.gui-error .error-explanation').text(i),
$('.gui-error .error-actions').html(n),
$(window).resize(),
$('.gui-error').fadeIn(),
$('#bottom-logo').fadeIn()
}
function r(e) {
var t = [
'
'
].join('')
n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
s.isMobile() ||
$('[rel=tiletip]').tooltip({
placement: 'bottom',
delay: {
show: 50,
hide: 0
},
trigger: 'hover',
viewport: {
selector: 'body',
padding: 10
}
})
}
function o() {
var e = s.isMobile() ? '' : '' + h.ERROR_GENERIC_ACTIONS_2 + '' + h.ERROR_GENERIC_ACTIONS_3,
t = [h.ERROR_GENERIC_ACTIONS_1, e].join('')
n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, '', t),
s.isMobile() ||
$('.install-browser').on('click touchstart', function (e) {
e.preventDefault(), e.stopPropagation(), r(' ')
})
}
function a(e) {
if (
($('head title').text(c.pageTitle),
$('#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo').hide(),
$('#gui-loading').fadeOut(250),
$('#quick-blackout').hide(),
l.track('showcase_error', {
error_key: e
}),
h.locale || h.init(),
'webgl-unsupported' === e)
)
s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM)
else if ('webgl-ios' === e) n(h.ERROR_WEBGL_IOS_PROBLEM, h.ERROR_WEBGL_IOS_SOLUTION, '', h.ERROR_WEBGL_IOS_ACTIONS_1 + '' + h.ERROR_WEBGL_IOS_ACTIONS_2 + '.')
else if ('webgl-safari' === e)
n(
h.ERROR_WEBGL_SAFARI_PROBLEM,
'',
'',
h.ERROR_WEBGL_SAFARI_ACTIONS_1 +
'' +
h.ERROR_WEBGL_SAFARI_ACTIONS_2 +
'. ' +
h.ERROR_WEBGL_SAFARI_ACTIONS_3 +
'' +
h.ERROR_WEBGL_SAFARI_ACTIONS_4 +
'.'
)
else if ('webgl-generic' === e) o()
else if ('missing-urls' === e) n(h.ERROR_MISSING_URLS_PROBLEM, '', h.ERROR_MISSING_URLS_EXPLANATION)
else if ('loading-failed' === e)
n(h.ERROR_LOADING_FAILED_PROBLEM, '', '', h.ERROR_LOADING_FAILED_ACTIONS_1 + '' + h.ERROR_LOADING_FAILED_ACTIONS_2 + '.')
else {
if ('loading-failed-maintenance' !== e) return void d.error('Unhandled error: ' + e)
n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
}
}
var s = e('./../util/browser'),
l = e('./../analytics'),
c = e('./../settings'),
h = e('../localization/localize'),
u = e('./../util/logger'),
d = new u(i),
p = '"https://support.port.com/hc/articles/208220058"'
t.exports.error = a
}).call(this, '/js/gui/error.js')
},
{
'../localization/localize': 108,
'./../analytics': 4,
'./../settings': 166,
'./../util/browser': 182,
'./../util/logger': 189
}
],
65: [
function (e, t, i) {
;(function (i) {
'use strict'
function n() {
;(Ue = []), je.floors.visible && Ue.push('.gui-floor', '.gui-floor-title'), Ue.push('.hideTarget', '.pinTop.right')
}
function r() {
for (var e in je)
if (je.hasOwnProperty(e)) {
var t = je[e]
if (!t.visible) for (var i = 0; i < t.elements.length; i++) $(t.elements[i]).hide()
}
je.highlight.visible && $('.pinBottom').addClass('highlightExists'), je.tourControls.visible === !1 && $('#drawer').addClass('fullWidth'), n()
}
function o(e, t) {
var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying
$('#gui-zoomin').toggle(i), $('#gui-zoomout').toggle(i)
}
function a() {
c(),
$('.pinBottom').toggleClass('open'),
$('#drawer').toggleClass('open'),
$('.footer').toggleClass('open'),
$('#drawer').hasClass('open')
? ($('#pullTab .icon').attr('data-original-title', Re.CLOSE_HIGHLIGHTS), Ze('highlights'))
: ($('#pullTab .icon').attr('data-original-title', Re.OPEN_HIGHLIGHTS), ie.resetDrawer()),
setTimeout(
function () {
$('#pullTab').toggleClass('opened')
},
$('#drawer').hasClass('open') ? 0 : Q.highlightAnimationDuration
),
$('.pinBottom').hasClass('open') && s($('.vr-popup')) && $('.vr-popup').is(':visible') && Ae.dismiss()
}
function s(e) {
var t
'none' !== e.css('display') ? (t = e.position().top + e.outerHeight()) : (e.attr('style', 'visibility: hidden'), (t = e.position().top + e.outerHeight()), e.attr('style', 'display: none'))
var i = $('#player').outerHeight(),
n = i - 130
return n < t + 25
}
function l(e) {
'touchstart' === e.type && e.preventDefault(), e.stopPropagation()
}
function c() {
W && (W.reload(), W.init())
}
function h(e) {
ne.show(e), r()
}
function u(e) {
ne.progress(e)
}
function d(e, t, i) {
var n = t.player
$('#gui-thumb').fadeOut(2500),
ne.hide(function () {
Ge = !1
}),
me.init(e, i),
de.finishSetup(Object.keys(e.tags).length),
i.on(Te.IMAGE_OPENED, Ze.bind(this, 'tag'))
var s = function () {
i.dismissExaminedTag(), i.disableHovering()
}
Ae.on(ye.OPENED, s), Ce.on(Me.OPENED, s), he.on(ue.OPENED, s), fe.on(ge.OPENED, s)
var l = i.enableHovering.bind(i)
if (
(Ae.on(ye.CLOSED, l),
Ce.on(Me.CLOSED, l),
he.on(ue.CLOSED, l),
fe.on(ge.CLOSED, l),
Q.labels.enabled && Object.keys(e.labels).length,
e.floors.length <= 1 || !je.floors.visible ? (je.floors.visible = !1) : (y(e, t), C(e.currentFloor, n.mode)),
getQueryVariable('m') === '372' && ((je.floors.visible = 1), y(e, t)),
r(),
o(t, t.player),
$('#gui').fadeIn(1500),
je.highlight.visible &&
(2 !== Q.startHighlights || e.has360Views) &&
setTimeout(function () {
a(), ((!e.has360Views && 1 !== Q.startHighlights) || (e.has360Views && 0 === Q.startHighlights)) && setTimeout(a, 2e3)
}, 2e3),
!K.isMobile())
)
for (var c = ['a', '#title-toggle', '.next-button', '.prev-button', '.gui-floor', '.meta-toggle', '.thumbImg', 'logo-button'], h = 0; h < c.length; h++) $(c[h]).addClass('hasHover')
O(e), de.setupToggling()
//xzw:
window.editHotPanel && editHotPanel()
//czj
navBorderRadius(e)
//czj 编辑界面
//window.EditingInterface && new EditingInterface(n.sceneRenderer);
window.EditTools && new EditTools(n.sceneRenderer)
}
function navBorderRadius(e) {
var pullTab = $('#pullTab'),
mobileRadius = {
bottom: {
'border-bottom-left-radius': '10px',
'border-bottom-right-radius': '10px'
},
top: { 'border-top-left-radius': '10px', 'border-top-right-radius': '10px' }
},
topRadius = {
bottom: { 'border-top-right-radius': '10px', 'border-bottom-right-radius': '10px' },
top: { 'border-bottom-left-radius': '10px', 'border-top-left-radius': '10px' }
}
function BorderRadius(bottom, top) {
$('#gui-modes-map > div:visible:last').css(bottom)
if (pullTab.is(':visible')) {
$('.viewContainer > div:visible:first').css(top)
} else {
$('#gui-modes-map > div:visible:first').css(top)
}
}
if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
BorderRadius(mobileRadius.bottom, mobileRadius.top)
} else {
BorderRadius(topRadius.bottom, topRadius.top)
}
//判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
if (window.DATA.model.special || window.DATA.special) {
window.specialScene && specialScene.special().afterImplement()
}
}
function p(e) {
e || (e = 0),
(We = !1),
window.setTimeout(
function () {
We || ((ze = !0), $('#gui-spinner').stop(!0, !0).show())
}.bind(this),
e
)
}
function f() {
$('#gui-spinner').stop(!0, !0), $('#gui-spinner').fadeOut(1e3), (We = !0), (ze = !1)
}
function g(e, t) {
var i = e.mode,
n = t || e.currentPano
$('#gui-modes-dollhouse').toggleClass('active', i === _e.DOLLHOUSE),
$('#gui-modes-floorplan').toggleClass('active', i === _e.FLOORPLAN),
$('#gui-modes-inside').toggleClass('active', i === _e.PANORAMA),
i === _e.PANORAMA
? ($('#view-controllers').slideUp(500),
Q.show360Views.enabled && !n.isAligned()
? ($('.gui-floor').addClass('hidden'), $('#gui-modes-outside').addClass('desktop-only'))
: ($('.gui-floor').removeClass('hidden'), $('#gui-modes-outside').removeClass('desktop-only')),
$('#gui-modes-outside').removeClass('hidden'))
: i !== _e.TRANSITIONING &&
(f(),
(Be = i),
$('#gui-modes-outside').addClass('hidden'),
e.model.has360Views && $('.gui-floor').removeClass('hidden'),
$('#view-controllers').is(':visible') || $('#view-controllers').slideDown(Q.guiAnimationSpeed))
}
function m(e, t) {
var i = t.player
$('#gui-modes-inside').on('mousedown touchstart', function (e) {
l(e),
J.updateInteraction(Se.InteractionGui, 'inside-button'),
J.track('USER', {
event_type: 'showcase_gui',
gui_action: 'click_inside_mode_button'
}),
t.changeMode(_e.PANORAMA)
}),
$('#gui-modes-outside')
.find('a')
.on('click', function (e) {
l(e),
J.track('showcase_gui', {
gui_action: 'click_outside_mode_button'
}),
t.changeMode(Be)
}),
$('#gui-modes-floorplan').on('click', function (e) {
l(e),
i.mode !== _e.FLOORPLAN &&
(J.track('showcase_gui', {
gui_action: 'click_floorplan_mode_button'
}),
t.changeMode(_e.FLOORPLAN))
}),
$('#gui-modes-dollhouse').on('click', function (e) {
l(e),
i.mode !== _e.DOLLHOUSE &&
(J.track('showcase_gui', {
gui_action: 'click_dollhouse_mode_button'
}),
t.changeMode(_e.DOLLHOUSE))
})
}
function v(e, t) {
function i() {
document.getElementById('vr').classList.remove('hidden'),
Q.vr.allowWebVR
? K.getVRDisplay().then(
function (e) {
K.supportsFullscreen() ? n(e) : (De.warn('Unable to use WebVR when full screen is not supported'), $('.improper-embed').toggleClass('hidden', !1), r())
},
function (e) {
r()
}
)
: r()
}
function n(i) {
De.info(i.displayName + ' detected, VR button activates WebVR experience'), Ie.init(e.data, t, i, q), Ie.on(Ee.OPENED, Ze.bind(gui, 'vr')), Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
}
function r() {
De.info('WebVR support not found, VR button activates native app VR modal'),
Ae.init(e.data, q),
Ae.on(
ye.OPENED,
(function () {
var e = document.getElementById('vr-modal')
return function () {
Ze('vr'), le.open(e)
}
})()
),
Ae.on(ye.CLOSED, le.reset)
}
if (Q.vr.enabled && e.supportsVR && !K.valueFromHash('mls', 0)) {
/*********************** 方奕卓 VR功能事件监听 ********************/
K.isMobile() && $('#vr').css('display', '') // 显示vr功能按钮
switch (Q.vr.option) {
case Pe.CONTEXTUAL:
i()
break
case Pe.ANDROID:
K.detectAndroid() && i()
break
case Pe.NONE:
}
}
}
function A(e, t) {
$('#play').on('mousedown touchstart', function (e) {
l(e)
Ze('tour')
ve.play()
J.trackAlways('showcase_gui', {
gui_action: 'play_highlights'
})
}),
(window.startAndPlay = function (e) {
// l(e);
Ze('tour')
ve.play()
J.trackAlways('showcase_gui', {
gui_action: 'play_highlights'
})
})
$('#pause').on('mousedown touchstart', function (e) {
l(e),
ve.pause(),
J.trackAlways('showcase_gui', {
gui_action: 'pause_highlights'
})
}),
$('#gui-zoomin')
.find('a')
.on('click', function (e) {
l(e), t.player.zoomInIncrementally()
}),
$('#gui-zoomout')
.find('a')
.on('click', function (e) {
l(e), t.player.zoomOutIncrementally()
})
}
function y(e, t) {
for (var i = $('.gui-floor'), n = 0; n < e.floors.length; n++) {
if (getQueryVariable('m') === '372') continue
var r = $('').text(e.floors.get(n).name)
$('.gui-floor').find('.container').prepend(r)
//cxz 本来一开始是prepend 后来改了append 按顺序插入
}
i.find('.container').prepend('
' + Re.FLOOR_ALL + '
'),
i.on('click', function (e) {
l(e), Ze('floor'), i.toggleClass('open')
}),
$('.floorChoice').on('click', function (e) {
l(e)
var n = $(this).data('index')
'all' !== n
? (J.updateInteraction(Se.InteractionGui, 'floor-control'),
t.player.gotoFloor(n),
J.track('showcase_gui', {
gui_action: 'click_floor_select_button',
interaction_source: 'gui'
}))
: (J.updateInteraction(Se.InteractionGui, 'floor-control'),
Ze('move'),
t.allFloors(),
J.track('showcase_gui', {
gui_action: 'click_toggle_all_floors_button',
interaction_source: 'gui'
})),
i.removeClass('open')
})
}
function C(e, t) {
e &&
(t === _e.DOLLHOUSE || t === _e.FLOORPLAN
? ($('.allFloorBtn').show(), $('.gui-floor-icon').hide(), $('.gui-floor-title').show())
: ($('.allFloorBtn').hide(), $('.gui-floor-icon').show(), $('.gui-floor-title').hide()),
e.model.allFloorsVisible
? ($('.gui-floor-title').text(Re.FLOOR_ALL), $('.gui-floor-number').text(Re.FLOOR_ALL), $('.floorChoice').removeClass('active'), $('.floorChoice[data-index="all"]').addClass('active'))
: ($('.gui-floor-title').text(e.name),
$('.gui-floor-number').text(' ' + (e.floorIndex + 1)),
$('.floorChoice').removeClass('active'),
$('.floorChoice[data-index=' + e.floorIndex + ']').addClass('active')))
}
function I(e) {
return e.describe().inTransition
}
function b(e, t, i) {
Fe = e.heroLocations.length
var n = '
',
r = 100 / Fe + '%',
o = $('#thumb-container'),
a = $('#progressBar')
$('#status').find('.totalSteps').text(Fe)
for (var s = 0; s < Fe; s++) {
var c = e.heroLocations[s],
h = $(n)
var thumbUrl
if (c.heroLocations) {
//有子项,选第一张截图
thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl) //.replace('https://','').replace('http://','')
} else {
thumbUrl = manage.dealURL(c.thumbUrl) //.replace('https://','').replace('http://','')
}
h.attr('data-index', s)
je.highlight.visible && h.find('img').attr('src', thumbUrl)
if (c.name) {
var u = $('').text(c.name)
h.prepend(u)
}
if (e.has360Views && c.cameraMode === _e.PANORAMA) {
var d = e.panos.get(c.panoId),
p = d && !d.isAligned(),
f = p ? '
' : '
'
h.prepend(f)
}
o.append(h), a.append('')
}
;(j = 144 * Fe),
(Y = 111 * Fe),
$('.thumbImg').on('mouseover', function () {
I(t) || i.showPathToHeroLocation([$(this).data('index'), 0]) //改
}),
$('.thumbImg').on('mouseout', function () {
t.clearPath()
}),
$('.thumbImg').on('click', function (e) {
l(e)
var i = $(this)
J.updateInteraction(Se.InteractionGui, 'thumbnail'),
J.trackAlways('showcase_gui', {
gui_action: 'click_highlight'
}),
t.goToHighlight([i.data('index'), 0]) //改
}),
$('.sectionCont').on('click', function (e) {
const imgActIndex = $(this).data('index')
console.log('imgActIndex')
t.goToHighlight([imgActIndex, 0])
}),
$('.previous')
.find('a')
.on('click', function (e) {
l(e),
J.trackAlways('showcase_gui', {
gui_action: 'prev_highlight'
}),
t.prevHighlight()
}),
$('.next')
.find('a')
.on('click', function (e) {
l(e),
J.trackAlways('showcase_gui', {
gui_action: 'next_highlight'
}),
t.nextHighlight()
}),
$('#drawer').on('mouseleave', function (e) {
l(e)
var t
try {
t = new MouseEvent('mouseup', {
clientX: e.clientX,
clientY: e.clientY,
screenX: e.screenX,
screenY: e.screenY
})
} catch (i) {
;(t = document.createEvent('MouseEvents')),
t.initMouseEvent(
'mouseup',
e.bubbles,
e.cancelable,
e.view,
e.detail,
e.screenX,
e.screenY,
e.clientX,
e.clientY,
e.ctrlKey,
e.altKey,
e.shiftKey,
e.metaKey,
e.button,
e.relatedTarget
)
}
document.dispatchEvent(t)
}),
(W = new Sly($('#scrollFrame'), {
horizontal: !0,
itemNav: 'centered',
smart: !0,
scrollTrap: !0,
scrollBy: 1,
mouseDragging: !0,
touchDragging: !0,
speed: 300,
dragHandle: !0,
dynamicHandle: !0,
clickBar: !0,
scrollBar: $('#scroller'),
activateOn: null
}).init()),
W.on('active', function (e, t) {
;(Ve = t),
Ze('tour'),
$('.step').removeClass('active'),
$('#status')
.find('.curIdx')
.text(t + 1)
for (var i = 0; i <= t; i++)
$('#progressBar')
.find("[data-idx='" + i + "']")
.addClass('active')
}),
w()
//add :
let scrollFrame = $(W.frame)
scrollFrame.on('wheel.sly', function () {
lastMoveScrollTime = Date.now()
})
let dragstart
/* scrollFrame.on("pointerdown", function() {
dragstart = true
})
scrollFrame.on("pointerup", function() {
dragstart = false
}) */
scrollFrame.on('pointermove', function () {
//if(dragstart){
lastMoveScrollTime = Date.now()
//}
})
}
function w() {
var e = $('#player').width() - 20,
t = $('#scroller'),
i = $('#drawer'),
n = $('.pinBottom')
if ($('#player').width() < 488 || $('#player').height() < 488) t.addClass('hidden'), i.addClass('noScroll'), n.addClass('noScroll')
else {
var r = j > e,
o = !i.hasClass('noScroll'),
a = r !== o
a && (t.toggleClass('hidden'), i.toggleClass('noScroll'), n.toggleClass('noScroll'))
}
}
function _(e) {
je.tourControls.visible = true //e.tour_buttons && K.valueFromHash("gt", 1),
;(je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash('mls', !1)),
(je.highlight.visible = /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights)
}
function T(e) {
function t(t, i) {
return !!e.player_options[t] && e[i || t]
}
$('.model-title').text(e.name)
var i = Q.pageTitle
// 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
2 !== K.valueFromHash('mls', 0) && e.name && (i = e.name),
(document.title = i),
K.isMobile()
? $('#gui-fullscreen').css('display', 'none')
: ($('[rel=tooltip]').tooltip({
delay: {
show: 50,
hide: 0
},
trigger: 'hover',
html: !1,
viewport: {
selector: 'body',
padding: 10
}
}),
K.inIframe() && document.getElementsByClassName('pinBottom-container')[0].classList.add('embed')),
// t("presented_by") && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", 0) ? document.getElementById("loaderCoBrandName").innerText = t("presented_by") : document.getElementById("loaderCoBrand").classList.add("hidden"),
de.populate({
name: t('model_name', 'name'),
coBrand: t('presented_by'),
description: t('model_summary', 'summary') || '暂无内容',
contactName: t('contact_name'),
address: t('address'),
phone: t('contact_phone'),
formattedPhone: e.formatted_contact_phone,
email: t('contact_email'),
url: t('external_url'),
socialSharing: e.enable_social_sharing && e.is_public
})
}
function x(e, t, i, n, r, o) {
function a() {
o.setLoadingStartTime(), H(), r ? (re.showMessage(t, i, je.coBrand.visible), l()) : h(l)
}
var s = $.Deferred(),
l = s.resolve.bind(s)
return (
(Ge = !0),
O(e),
e.data.player_options && _(e.data.player_options),
1 === Q.specialEdition && $('body').addClass('specialEdition'),
Re.localizeGUI(),
T(e.data),
r || $('.quick').addClass('hidden'),
//e.data.image && !r && E(e.data.image),
n ? (J.impression(), a()) : (o.setWaitingStartTime(), oe.show(r, a)),
s
)
}
function S(e, t, i, n, r, a, s) {
;(q = s),
e.outsideAllowed() || $('#gui-modes-outside').addClass('invisible'),
e.supportedModes[_e.PANORAMA] || $('#gui-modes-inside').addClass('invisible'),
ae.init(),
re.init(e, a),
Oe.init(e, t, n),
$('.icon').on('mouseover', function () {
t.player && t.player.reticule.hide()
}),
m(e, t),
A(e, t),
e.data.enable_social_sharing &&
e.data.is_public &&
Q.share.enabled &&
(Ce.init(window.DATA.name /* e.data.name */),
Ce.on(
Me.OPENED,
(function () {
var e = document.getElementById('share-modal')
return function () {
Ze('share'), le.open(e)
}
})()
),
Ce.on(Me.CLOSED, le.reset)),
e.heroLocations.length > 0 ? b(e, t, i) : ((je.highlight.visible = !1), (je.tourControls.visible = !1)),
de.on(pe.OPEN_INFO, Ze.bind(this, 'info')),
z(),
g(i),
v(e, r),
e.on('floor.changed', C),
e.on('waiting', R.bind(this, e)),
e.on('waiting-done', P.bind(this, e)),
i.on(xe.ModeChanged, function (e, n) {
g(i), o(t, i), n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR), he.updateMode(n)
}),
n.on(Se.Move, Ze.bind(this, 'move')),
i.on(xe.Ready, function () {
ie.init(n, i, i.tagManager, t),
i.on(xe.ModeChanged, function (e, t) {
e !== t && $('.vr-popup').is(':visible') && Ae.dismiss()
})
}),
i.on(xe.PanoChosen, function (e, t) {
g(i, t), he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
}),
le.on(ce.CLOSE, function (e) {
switch (e) {
case 'vr-modal':
Ae.dismiss()
break
case 'share-modal':
Ce.hide()
break
case 'terms-modal':
fe.hide()
}
})
var l = $('#play').eq(0),
c = $('#pause').eq(0),
h = $('.pinBottom').toArray(),
u = $('#drawer').eq(0),
d = $('#playHead').eq(0),
p = $('#progressBar').eq(0),
f = $('#thumb-container').eq(0),
y = f.children(),
I = p.children()
t.on('update.controls', function () {
//导览控制
var n = t.describe()
n.tourIsPlaying || i.isWarping()
? (je.tourControls.visible && (l.hide(), c.show()),
n.tourInProgress &&
(h.forEach(function (e) {
e.classList.add('playing')
}),
u.addClass('playing'),
d.addClass('playing')))
: (je.tourControls.visible && (l.show(), c.hide()),
n.tourInProgress ||
(ve.stopTour(),
h.forEach(function (e) {
e.classList.remove('playing')
}),
u.removeClass('playing'),
d.removeClass('playing')))
var r, a, s
if (null !== n.currentItem) {
var p, f
$('#status')
.find('.curIdx')
.text(n.currentItem[0] + 1),
n.onTheBus ? ((p = 'active'), (f = 'recent')) : ((f = 'active'), (p = 'recent'))
var g = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0]
/* for (r = 0; r < e.heroLocations.length; r += 1)
s = y.eq(r),
a = I.eq(r),
s.removeClass(f),
a.removeClass(f),
n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
a.addClass(p),
W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
a.addClass(p)) : (s.removeClass(p),
a.removeClass(p)) */
for (r = 0; r < e.heroLocations.length; r += 1) {
;(s = y.eq(r)), (a = I.eq(r)), s.removeClass(f), a.removeClass(f)
if (n.onTheBus && r === n.destinationItem[0]) {
s.addClass(p)
a.addClass(p)
if (Date.now() - lastMoveScrollTime > 2000) {
//add 如果一段时间内用户不操作scrollbar,才focus回这个item
W.activate(r) // scrollbar slide to this
}
} else {
n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p), a.addClass(p)) : (s.removeClass(p), a.removeClass(p))
}
}
} else for (r = 0; r < e.heroLocations.length; r += 1) (s = y.eq(r)), (a = I.eq(r)), s.removeClass('active recent'), a.removeClass('active recent')
o(t, i)
}),
document.addEventListener(
'keydown',
function (n) {
switch ((J.updateInteraction(Se.InteractionKey), n.which)) {
case we.ZERO:
Q.debug && e.toggleAlpha()
break
case we.NINE:
Q.debug && se.toggle()
break
case we.ONE:
i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA)
break
case we.TWO:
e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE)
break
case we.THREE:
e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN)
break
case we.FOUR:
i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR)
break
case we.SPACE:
je.tourControls.visible && ($('#playHead').hasClass('playing') || Ze('tour'))
break
case we.RETURN:
Q.debug && e.toggleExplodeUp()
break
case we.P:
k()
break
case we.U:
B()
break
case we.X:
Q.debug && e.toggleExplode()
break
case we.PLUSEQUALS:
t.player.activatePersistentZooming(!0), ie.hideUi()
break
case we.DASHUNDERSCORE:
t.player.activatePersistentZooming(!1), ie.hideUi()
break
case we.SEVEN:
De.info('Zoom level: ' + t.player.zoomLevel + ', FOV: ' + t.player.zoomFov)
break
case we.EIGHT:
t.player.decreaseZoomSpeed()
break
case we.NINE:
t.player.increaseZoomSpeed()
}
return i && i.reticule.hide(), !0
}.bind(this)
),
document.addEventListener(
'keyup',
function (e) {
switch (e.which) {
case we.PLUSEQUALS:
t.player.deactivatePersistentZooming()
break
case we.DASHUNDERSCORE:
t.player.deactivatePersistentZooming()
}
}.bind(this)
),
F(e),
L(e, t.player),
M(i),
te.setAutoPlay(e.heroCount()),
he.init(i, a.mode),
he.on(ue.OPENED, Ze.bind(this, 'help')),
fe.init(),
fe.on(
ge.OPENED,
(function () {
var e = document.getElementById('terms-modal')
return function () {
Ze('terms'), le.open(e)
}
})()
),
fe.on(ge.CLOSED, le.reset),
Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
(Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
Q.profiling.enabled && se.show(),
ve.init(t)
}
function M(e) {
var t = function (e, t) {
$(e)
.find('a')
.each(function (e, i) {
t ? $(i).removeClass('buttonZoomDisabled').addClass('buttonZoomEnabled') : $(i).addClass('buttonZoomDisabled').removeClass('buttonZoomEnabled'),
(i.style.pointerEvents = t ? 'auto' : 'none')
})
},
i = function () {
e.zoomLevel >= Q.zoom.max ? t('#gui-zoomin', !1) : t('#gui-zoomin', !0), e.zoomLevel <= Q.zoom.min ? t('#gui-zoomout', !1) : t('#gui-zoomout', !0)
}
e.on(Ne.ZoomMax, function () {
t('#gui-zoomin', !1), t('#gui-zoomout', !0)
}),
e.on(Ne.ZoomMin, function () {
t('#gui-zoomin', !0), t('#gui-zoomout', !1)
}),
e.on(Ne.ZoomIn, function () {
t('#gui-zoomout', !0)
}),
e.on(Ne.ZoomOut, function () {
t('#gui-zoomin', !0)
}),
i()
}
function R(e) {
O(e)
}
function P(e) {
O(e)
}
function O(e) {
var t = e.waitQueue.length
t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
}
function L(e, t) {
He = {
gui: null,
visible: !1,
model: e,
player: t
}
}
function D(e, t) {
function i() {
var i = t.toJSON()
;(n.linkToLocation = window.location.protocol + '//' + window.location.host + window.location.pathname + '?m=' + e.sid + '&start=' + be.serialize(i)),
t.tagManager.activeTag && (n.linkToLocation += '&tag=' + t.tagManager.activeTag.sid)
}
var n = {},
r = new Le.GUI({
autoPlace: !0,
width: '60%'
})
i(), t.on(xe.ViewChanged, i), r.add(n, 'linkToLocation').name(Re.LINK_TO_LOCATION).listen(), (r.domElement.id = 'datLinks')
var o = [].slice.call(r.domElement.querySelectorAll('.property-name'))
return (
o.forEach(function (e) {
if (!K.detectSafari()) {
var t = document.createElement('button')
t.classList.add('btn-deep-link'), (t.innerText = Re.MENU_COPY), e.nextSibling.appendChild(t)
var i = function () {
alert(Re.LINK_ALERT_COPY), t.hide()
}
t.addEventListener('click', function (e) {
try {
var t = e.target.parentNode.childNodes[0]
t.select()
var n = document.execCommand('copy')
t.blur(), n || i()
} catch (e) {
i()
}
})
}
}),
$(r.__closeButton).hide(),
r
)
}
function N(e) {
He.gui || (He.gui = D(He.model, He.player)), (He.visible = e), e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
}
function B() {
N(!He.visible)
}
function F(e) {
ke = {
gui: null,
visible: !1,
model: e
}
}
function V(e) {
var t = new Le.GUI()
return (
t
.add(Q, 'showSweeps')
.name('Show sweeps')
.onFinishChange(function () {
e.setSweepVisibility(Q.showSweeps)
}),
t.add(Q, 'rotationAccelerationInside', 0.1, 10).name('Rotation speed').step(0.1),
t
.add(Q.transition, 'flyTime', 0, 5e3)
.name('Transition time')
.onFinishChange(function () {
;(Q.transition.flySpeed = 0),
t.__controllers.forEach(function (e) {
e.updateDisplay()
})
}),
t.add(Q.path, 'opacity', 0, 1).name('Path opacity'),
$(t.__closeButton).hide(),
t
)
}
function U(e) {
ke.gui || (ke.gui = V(ke.model)), (ke.visible = e), e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
}
function k() {
U(!ke.visible)
}
function H() {
function e(e) {
e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target) /* || e.preventDefault()*/
}
$('body').css('touch-action', 'none'),
$('#gui-parent')
.find('*:not(#tag-billboards)')
.on('touchmove', function (e) {
// e.preventDefault()
})
var t = document.getElementById('terms-text'),
i = document.getElementById('more-help-wrapper'),
n = (document.getElementById('navigation-help-wrapper'), document.getElementById('help-dialog'), document.getElementById('tag-billboards'))
Q.useWheel && (document.body.addEventListener('mousewheel', e, { passive: false }), document.body.addEventListener('DOMMouseScroll', e)),
$('#terms-text, #more-help-wrapper, #navigation-help-wrapper')
.off('touchmove')
.on('touchmove', function (e) {
e.stopPropagation()
})
}
function G(e, t) {
for (var i = []; e; ) i.push(e), (e = e.parentNode)
for (; t && i.indexOf(t) === -1; ) t = t.parentNode
return t
}
function z() {
var e,
t = function (t) {
e = 0 === t.button || 1 === t.which ? t.target : null
},
i = function (t) {
e !== t.target && (e = G(e, t.target))
var i = document.getElementById('gui-parent')
if ((G(i, e) !== i && (e = null), e)) {
var n
try {
n = new MouseEvent('click', t)
} catch (e) {
;(n = document.createEvent('MouseEvents')),
n.initMouseEvent(
'click',
t.bubbles,
t.cancelable,
t.view,
t.detail,
t.screenX,
t.screenY,
t.clientX,
t.clientY,
t.ctrlKey,
t.altKey,
t.shiftKey,
t.metaKey,
t.button,
t.relatedTarget
)
}
;(n.syntheticClick = !0), e.dispatchEvent(n), (e = null)
}
}
document.body.addEventListener('mousedown', t, !0),
document.body.addEventListener('mouseup', i, !0),
document.getElementById('gui-parent').addEventListener(
'click',
function (e) {
e.syntheticClick || (e.stopPropagation(), 'A' === e.target.nodeName && e.preventDefault())
},
!0
)
}
var lastMoveScrollTime = 0 //add
var W,
j,
Y,
X,
Z,
q,
K = (e('three'), e('../util/ajax'), e('../util/browser')),
Q = e('../settings'),
J = e('../analytics'),
ee = (e('../util/transitions'), e('../util/camera'), e('../util/logger')),
te = (e('../objects/Snapshot'), e('./helpManager')),
ie = e('./immersiveMode'),
ne = e('./loadingScreen'),
re = e('./landingScreen'),
oe = e('./playButton'),
ae = e('./populateModal'),
se = e('./memoryUsage'),
le = e('./closer/modalCloser'),
ce = e('./closer/ModalCloserEvent'),
he = e('./help/help'),
ue = e('./help/HelpEvent'),
de = e('./title/titleBar'),
pe = e('./title/TitleEvents'),
fe = e('./terms/terms'),
ge = e('./terms/TermsEvent'),
me = e('./title/tagToggle'),
ve = e('./tourInteraction'),
Ae = e('./vr/vrModal'),
ye = e('./vr/vrEvent'),
Ce = e('./sharing/modal'),
Ie = e('./webvr/webVRgui'),
Ee = e('./webvr/WebVrEvent'),
be = e('../controls/serializer'),
we = e('../enum/Keys'),
_e = e('../enum/Viewmode'),
Te = (e('../enum/BlackoutStyle'), e('../tag/Media/MediaEvent')),
xe = (e('../enum/PathDiscardMode'), e('../enum/PathDisplayMode'), e('../enum/DirectorEvents'), e('../enum/PlayerEvents')),
Se = e('../enum/ControlEvents'),
Me = e('./sharing/ShareEvents'),
Re = e('../localization/localize'),
Pe = (e('../enum/Vectors'), e('../enum/WarpStyle'), e('../enum/AlignmentType'), e('../enum/VROption')),
Oe = e('./konami'),
Le = e('../lib/dat.gui'),
De = new ee(i),
Ne = (e('../util/showcase'), e('../enum/ZoomEvents')),
Be = _e.DOLLHOUSE,
Fe = 0,
Ve = 0,
Ue = ['.hideTarget'],
ke = null,
He = null,
Ge = !1,
ze = !1,
We = !1,
je = {
coBrand: {
visible: !0,
elements: ['.co-brand', '#loaderCoBrand']
},
help: {
visible: !0,
elements: ['.nav-help', '#nav-help']
},
tourControls: {
visible: !0,
elements: ['.next', '.previous', '#play']
},
highlight: {
visible: !0,
elements: ['#drawer', '#pullTab']
},
share: {
visible: !0,
elements: ['.socialButton', '#share']
},
fullScreen: {
visible: !0,
elements: ['#gui-fullscreen']
},
floors: {
visible: !0,
elements: ['.gui-floor']
}
},
Ye = (function () {
var e = document.getElementById('drawer')
return function () {
$('#player').height() < 400 && e.classList.contains('open') && a()
}
})(),
Xe = (function () {
var e = document.getElementById('meta-info')
return function () {
$('#player').height() < 400 && e.classList.contains('expand') && de.toggleMeta(!0)
}
})(),
Ze = (function (e) {
function t() {
u.classList.contains('expand') && de.toggleMeta(!0)
}
function i() {
fe.hide()
}
function n() {
he.close()
}
function r() {
Ae.dismiss()
}
function o() {
p.hasClass('open') && a(!0)
}
function l() {
Ce.hide()
}
function c() {
f.hasClass('open') && f.removeClass('open')
}
function h() {
d.classList.contains('fadeIn') && (d.classList.contains('landing') ? re.dismissModal() : d.classList.contains('tour') && ve.dismissModal())
}
var u = document.getElementById('meta-info'),
d = document.getElementById('interaction-modal'),
p = $('#drawer').eq(0),
f = $('.gui-floor').eq(0),
g = $('.vr-popup').eq(0)
return function (e) {
switch (e) {
case 'info':
i(), n(), Ye(), l(), c(), r(), h()
break
case 'terms':
t(), n(), o(), l(), c(), r(), h()
break
case 'help':
t(), i(), l(), c(), r(), h()
break
case 'vr':
t(), i(), l(), c(), n(), h(), s(g) && o()
break
case 'highlights':
Xe(), i(), l(), c()
break
case 'share':
t(), i(), n(), c(), r(), h()
break
case 'floor':
i(), l(), r()
break
case 'view':
c(), l(), i(), r()
break
case 'tour':
i(), l(), c(), r()
break
case 'move':
i(), l(), c(), r()
break
case 'resize':
t(), Ye(), c()
break
case 'tag':
i(), n(), l(), c(), r()
}
}
})()
$(document).on('fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange', function (e) {
$('#gui-fullscreen').toggle(!K.isFullscreen()),
$('#gui-fullscreen-exit').toggle(!!K.isFullscreen()),
setTimeout(function () {
$('.icon:visible').hide().show(0)
}, 100)
}),
$('#gui-fullscreen')
.find('a')
.on('click', function (e) {
l(e),
K.requestFullscreen($('body')[0]),
J.track('showcase_gui', {
gui_action: 'click_enter_fullscreen',
interaction_source: 'gui'
})
//czj
//W.reload()
}),
$('#gui-fullscreen-exit')
.find('a')
.on('click', function (e) {
l(e),
K.exitFullscreen(),
J.track('showcase_gui', {
gui_action: 'click_exit_fullscreen',
interaction_source: 'gui'
})
})
$(window)
.on('resize', function (e) {
var t = e.target.innerHeight,
i = e.target.innerWidth
;(t === X && i === Z) || (je.highlight.visible && w(), Ze('resize'), $('.pinTop.right').removeClass('hideUnderMeta'), c(), (X = t), (Z = i))
})
.resize(),
K.supportsFullscreen() || $('#gui-fullscreen').hide(),
$('#pullTab').on('click', function (e) {
l(e),
$('#drawer').hasClass('open')
? (J.trackAlways('showcase_gui', {
gui_action: 'hide_highlight_reel'
}),
$(this).addClass('open').children('img').attr('src', 'images/auto.png'))
: (J.trackAlways('showcase_gui', {
gui_action: 'show_highlight_reel'
}),
$(this).removeClass('open').children('img').attr('src', 'images/auto-suspend.png'))
a()
})
/***********************方奕卓 热点列表事件监听 ************************/
if (window.DATA.showHotListSta) {
$('#hotList').css('display', '')
$('#hotList').on('click', function (e) {
l(e)
var hotList = $('#hotListWrap')[0]
var isActive = hotList.classList.contains('hotListActive')
if (isActive) {
hotList.classList.remove('hotListActive')
this.classList.remove('active')
} else {
hotList.classList.add('hotListActive')
this.classList.add('active')
}
}),
$('#hotListContent ul').on('mouseover', function (e) {
l(e)
var target = e.target
var hotList = document.getElementById('hotListWrap')
if (target.tagName === 'SPAN') {
var targetParent = target.parentElement.parentElement
if (target.offsetWidth + 116 >= targetParent.clientWidth) {
hotList.style.width = target.offsetWidth + 116 + 'px'
} else {
hotList.style.width = ''
}
} else if (target.tagName === 'LI') {
var targetParent = target.parentElement
if (target.children[0].offsetWidth + 116 >= targetParent.clientWidth) {
hotList.style.width = target.children[0].offsetWidth + 116 + 'px'
} else {
hotList.style.width = ''
}
} else {
hotList.style.width = ''
}
})
$('#hotListContent ul').on('click', function (e) {
l(e)
this.preElem && this.preElem.classList.remove('active')
if (e.target.tagName === 'SPAN') {
e.target.parentElement.classList.add('active')
e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player, true) // 打开热点
this.preElem = e.target.parentElement
} else {
e.target.classList.add('active')
e.target.hot && e.target.hot.examine(window.player, true) // 打开热点
this.preElem = e.target
}
})
$('#hotListClose').on('click', function (e) {
l(e)
var hotList = $('#hotListWrap')[0]
hotList.classList.remove('hotListActive')
$('#hotListContent ul .active').removeClass('active')
$('#hotList')[0].classList.remove('active')
})
}
/*****************************************************************/
$('#more-menu-button').on('click', function (e) {
l(e)
var t = $('#more-menu')
t.toggleClass('open')
}),
(t.exports.init = S),
(t.exports.startLoading = x),
(t.exports.endLoading = d),
(t.exports.onProgress = u)
}).call(this, '/js/gui/gui.js')
},
{
'../analytics': 4,
'../controls/serializer': 14,
'../enum/AlignmentType': 17,
'../enum/BlackoutStyle': 18,
'../enum/ControlEvents': 21,
'../enum/DirectorEvents': 23,
'../enum/Keys': 30,
'../enum/PathDiscardMode': 38,
'../enum/PathDisplayMode': 39,
'../enum/PlayerEvents': 40,
'../enum/VROption': 47,
'../enum/Vectors': 50,
'../enum/Viewmode': 51,
'../enum/WarpStyle': 52,
'../enum/ZoomEvents': 53,
'../lib/dat.gui': 93,
'../localization/localize': 108,
'../tag/Media/MediaEvent': 131,
'../objects/Snapshot': 153,
'../settings': 166,
'../util/ajax': 181,
'../util/browser': 182,
'../util/camera': 183,
'../util/logger': 189,
'../util/showcase': 193,
'../util/transitions': 195,
'./closer/ModalCloserEvent': 61,
'./closer/modalCloser': 62,
'./help/HelpEvent': 66,
'./help/help': 67,
'./helpManager': 68,
'./immersiveMode': 69,
'./konami': 70,
'./landingScreen': 71,
'./loadingScreen': 72,
'./memoryUsage': 73,
'./playButton': 74,
'./populateModal': 75,
'./sharing/ShareEvents': 76,
'./sharing/modal': 77,
'./terms/TermsEvent': 78,
'./terms/terms': 79,
'./title/TitleEvents': 80,
'./title/tagToggle': 81,
'./title/titleBar': 82,
'./tourInteraction': 84,
'./vr/vrEvent': 85,
'./vr/vrModal': 87,
'./webvr/WebVrEvent': 88,
'./webvr/webVRgui': 89,
three: 217
}
],
66: [
function (e, t, i) {
'use strict'
t.exports = Object.freeze({
OPENED: 'help.opened',
CLOSED: 'help.closed'
})
},
{}
],
67: [
function (e, t, i) {
'use strict'
function n() {
g.on('click', function (e) {
if (S && S !== l.TRANSITIONING) {
var t = window.getComputedStyle(y).getPropertyValue('opacity') > 0
t && !M ? R.close() : r()
}
}),
w.on('click', function (e) {
R.close()
}),
E.on('click', function (e) {
S && S !== l.TRANSITIONING && (s(), o())
}),
b.on('click', function (e) {
s(), a()
})
}
function r() {
S &&
S !== l.TRANSITIONING &&
((M = !0),
setTimeout(function () {
M = !1
}, d.help.modalStayDuration),
R.emit(h.OPENED),
m.addClass('open ' + S),
g.addClass('open'),
s(),
o(),
y.style.removeProperty ? y.style.removeProperty('display') : y.style.removeAttribute('display'),
y.classList.add('fadeIn'))
}
function o() {
E.addClass('underline-tab'), u.fill(_, c.NAVIGATION, S), m.addClass(S)
}
function a() {
b.addClass('underline-tab'), u.fill(T, c.MORE_HELP), m.addClass('more-help')
}
function s(e, t) {
m.removeClass('more-help ' + l.PANORAMA + ' ' + l.DOLLHOUSE + ' ' + l.FLOORPLAN + ' ' + l.OUTDOOR),
I.forEach(function (e) {
e.classList.remove('underline-tab')
})
}
var l = e('../../enum/Viewmode'),
c = e('../../enum/HelpModalType'),
h = e('./HelpEvent'),
u = (e('../helpManager'), e('./../populateModal')),
d = e('../../settings'),
p = e('../../util/common'),
f = e('events').EventEmitter,
g = $('.footer-help').eq(0),
m = $('#help-dialog').eq(0),
v = document.querySelector('#quick-logo'),
A = document.querySelector('#loaderCoBrand'),
y = document.querySelector('#help-dialog'),
C = document.querySelector('.footer'),
I = $('.help-tabs').children().toArray(),
E = $('.navigation-tab').eq(0),
b = $('.more-help-tab').eq(0),
w = ($('#interaction-modal').eq(0).find('.interaction').toArray(), m.find('.close').eq(0)),
_ = m.find('.interactions').toArray(),
T = m.find('.ui-instructions').toArray(),
x = l.PANORAMA,
S = l.PANORAMA,
M = !1,
R = {
init: function (e, t) {
;(S = t),
(x = t),
[y, A, v, C].forEach(function (e) {
e.classList.add(u.deviceType)
}),
n()
},
close: function () {
if (m.hasClass('open') && (this.emit(h.CLOSED), g.removeClass('open'), m.removeClass('open'), y.classList.contains('fadeIn'))) {
y.classList.remove('fadeIn')
var e = S === l.TRANSITIONING ? x : S
u.clear(_, c.NAVIGATION, e)
}
},
updateMode: function (e) {
;(x = S), (S = e)
}
}
p.extendObject(R, f.prototype), (t.exports = R)
},
{
'../../enum/HelpModalType': 28,
'../../enum/Viewmode': 51,
'../../settings': 166,
'../../util/common': 185,
'../helpManager': 68,
'./../populateModal': 75,
'./HelpEvent': 66,
events: 202
}
],
68: [
function (e, t, i) {
;(function (i) {
'use strict'
var n = e('../util/browser'),
r = e('./../util/logger'),
o = e('./../settings'),
a = new r(i),
s = (function () {
var e
try {
return (e = window.localStorage.getItem('visitCount') || '0'), (e = (parseFloat(e) + 1).toString()), window.localStorage.setItem('visitCount', e), a.debug('visitCount = ' + e), e
} catch (t) {
;(e = '1'), a.debug("couldn't set local storage")
}
})(),
l = !1
t.exports = {
isHelpDisabled: function () {
return '0' === n.valueFromHash('help', null) || l
},
isLargeHelpEnabled: function () {
return ('1' === s || '1' === n.valueFromHash('help', null)) && !this.isHelpDisabled()
},
isSmallHelpEnabled: function () {
return '2' === n.valueFromHash('help', null) && !this.isHelpDisabled()
},
isHelpEnabled: function () {
return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
},
setAutoPlay: function (e) {
l = o.warp.auto >= 0 && e > 1
}
}
}).call(this, '/js/gui/helpManager.js')
},
{
'../util/browser': 182,
'./../settings': 166,
'./../util/logger': 189
}
],
69: [
function (e, t, i) {
'use strict'
function n(e, t, i, n) {
;(F = n), r(e, t, i, F), o(), (N = t.mode)
}
function r(e, t, i, n) {
;[C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function (t) {
e.controls[t].on(v.Move, a), e.controls[t].on(v.LongTap, c)
}),
M.on('mousewheel DOMMouseScroll', a),
i.on(m.TagActivated, a),
i.on(m.TagNavigation, a),
t.on(A.FlyingEnded, s),
t.on(A.ModeChanging, function (e, t) {
B = t !== C.PANORAMA && e !== C.PANORAMA
}),
t.on(A.ModeChanged, function (e, i) {
// 备注sg 漫游状态通信
if (window.threeReact.state3d) window.threeReact.state3d(t.mode)
;(N = t.mode), i !== C.TRANSITIONING ? l() : a('modeChange')
}),
n.on(y.TourStart, function () {
;(L = !0), a()
}),
n.on(y.TourEnd, function () {
;(L = !1), l()
}),
n.on(y.ActionInterrupted, function () {
L = !1
}),
R.addEventListener(
'touchend',
function () {
$('#pullTab').hasClass('opened') && !L && l()
},
!0
)
}
function o() {
p.isMobile()
? (b.forEach(function (e) {
e.classList.add('mobile')
}),
w.click(l))
: (b.forEach(function (e) {
e.addEventListener(
'mouseleave',
function () {
!M.is(':hover') && b[0].classList.contains('detectHover') && l()
},
!0
)
}),
M.mouseleave(function () {
b[0].classList.contains('detectHover') && l()
}))
}
function a(e) {
D ||
(d(e) && _.hasClass('playing')) ||
(clearTimeout(O),
(P = !0),
g.close(),
h(e),
N !== C.DOLLHOUSE &&
N !== C.FLOORPLAN &&
((x.hasClass('expand') && !S.hasClass('closed')) || 2 === p.valueFromHash('title', 1),
_.hasClass('playing') ||
(b.forEach(function (e) {
e.classList.add('detectHover')
}),
(O = setTimeout(l, f.immersive.timeToShowAgain)))))
}
function s() {
_.hasClass('playing') || (clearTimeout(O), (O = setTimeout(l, f.immersive.timeToShowAgain)))
}
function l() {
clearTimeout(O),
(P = !1),
I.forEach(function (e) {
e.classList.remove('drawerOpen')
}),
L ||
E.forEach(function (e) {
e.classList.remove('duringTour')
}),
b.forEach(function (e) {
e.classList.remove('detectHover')
})
}
function c() {
P ? l() : a(),
(D = !0),
setTimeout(function () {
D = !1
}, f.immersive.uiStayDuration)
}
function h(e) {
!d(e) && L
? E.forEach(function (e) {
e.classList.remove('drawerOpen'), e.classList.add('duringTour')
})
: _.hasClass('open')
? E.forEach(function (e) {
e.classList.remove('duringTour'), e.classList.add('drawerOpen')
})
: B ||
N === C.FLOORPLAN ||
N === C.DOLLHOUSE ||
E.forEach(function (e) {
e.classList.add('fadeOut')
})
}
function u() {
T.hasClass('duringTour') || ((L = !1), a('gui'), l())
}
function d(e) {
return 'mouse' === e || 'touch' === e || 'key' === e || 'gui' === e
}
var p = e('../util/browser'),
f = e('../settings'),
g = e('./help/help'),
m = e('../enum/tagEvents'),
v = e('../enum/ControlEvents'),
A = e('../enum/PlayerEvents'),
y = e('../enum/DirectorEvents'),
A = e('../enum/PlayerEvents'),
C = e('../enum/Viewmode'),
I = $('.pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer').toArray(),
E = $('.pinBottom-container, #drawer-container, .footer').toArray(),
b = $('#hover-bottom, #hover-top').toArray(),
w = ($('#pullTab').eq(0), $('#playHead').eq(0), $('.pinBottom-container').eq(0)),
_ = $('#drawer').eq(0),
T = $('#drawer-container').eq(0),
x = $('#meta-info').eq(0),
S = $('.pinTop.left').eq(0),
M = $('#player').eq(0),
R = document.getElementById('pullTab'),
P = !1,
O = null,
L = !1,
D = !1,
N = null,
B = !1,
F = null
;(t.exports.init = n), (t.exports.hideUi = a), (t.exports.resetDrawer = u)
},
{
'../enum/ControlEvents': 21,
'../enum/DirectorEvents': 23,
'../enum/tagEvents': 32,
'../enum/PlayerEvents': 40,
'../enum/Viewmode': 51,
'../settings': 166,
'../util/browser': 182,
'./help/help': 67
}
],
70: [
function (e, t, i) {
;(function (i) {
'use strict'
function n(e, t, i) {
l.debug('konami has the modelInstance')
var n = []
$(window).on('keydown', function (e) {
n.push(e.which), n.length > o.secretPanelWord.length && n.shift(), s.equalLists(n, o.secretPanelWord) && (l.debug('Developer mode active.'), (o.debug = !0))
}),
$(window).on('keydown', function n(r) {
o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i), $(window).off('keydown', n)) : console.warn("sorry we're not ready yet"))
})
}
var r = e('./../util/logger'),
o = e('./../settings'),
a = e('./debug'),
s = e('./../util/common'),
l = (e('./gui'), new r(i))
o.console && $('body').append(''), (t.exports.init = n)
}).call(this, '/js/gui/konami.js')
},
{
'./../settings': 166,
'./../util/common': 185,
'./../util/logger': 189,
'./debug': 63,
'./gui': 65
}
],
71: [
function (e, t, i) {
'use strict'
function n(e, t) {
E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
}
function r(e) {
var t = $.Deferred()
e || t.resolve()
var i = c.startupFlyinDelay
return e === p.PANORAMA && (i += c.dollhouse.transitionTime), setTimeout(t.resolve.bind(t), i), t
}
function o(e, t, i) {
var n = 0
c.quickstart.enabled && (a(i), (n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay))
var r = function () {
e.once(g.Move, l), t.once(f.TourStart, l)
}
s(n, r)
}
function a(e) {
return /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
v.before(y),
A = $(".quick-brand").toArray()),*/
m.addClass('fadeOut'),
setTimeout(function () {
A.forEach(function (e) {
e.classList.add('fadeIn')
})
}, c.quickstart.showTextDelay),
setTimeout(function () {
A.forEach(function (e) {
e.classList.add('fadeOut')
})
}, c.quickstart.fadeOutDelay),
!0
}
function s(e, t) {
setTimeout(function () {
if (h.isHelpEnabled()) {
if ((t(), u.init(), C.addClass('fadeIn landing ' + u.deviceType), h.isSmallHelpEnabled())) return void C.addClass('small')
u.fill(I, d.LANDING[E]), C.addClass(E)
}
}, e)
//csz 用户引导界面
var helpData = {
pc: ['images/pc_step1.png', 'images/pc_step2.png', 'images/pc_step3.png'],
mobile: ['images/phone_step1.png', 'images/phone_step2.png', 'images/phone_step3.png']
}
var navIcon = $('.nav-icon .icon')
if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr('src', helpData.mobile[0])
function paging(id) {
id.on('click', function () {
var navPage = null
$(this).attr('data-id') == 'plus' ? (navPage = +navIcon.attr('data-page') + 1) : (navPage = +navIcon.attr('data-page') - 1)
if (navPage > helpData.length || navPage < 1) return false
if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
navIcon.attr({ 'data-page': navPage, src: helpData.mobile[navPage - 1] })
} else {
navIcon.attr({ 'data-page': navPage, src: helpData.pc[navPage - 1] })
}
})
}
paging($('.next-button'))
paging($('.prev-button'))
}
function l() {
u.clear(I, d.LANDING[E]), C.removeClass('fadeIn')
}
var c = e('../settings'),
h = (e('./help/help'), e('./helpManager')),
u = e('./populateModal'),
d = e('../enum/HelpModalType'),
p = e('../enum/Viewmode'),
f = e('../enum/DirectorEvents'),
g = e('../enum/PlayerEvents'),
m = $('#quick-blackout').eq(0),
v = $('#quick-logo').eq(0),
A = $('.quick-brand').toArray(),
y = $('#loaderCoBrand').eq(0),
C = $('#interaction-modal').eq(0),
I = C.find('.interaction').toArray(),
E = ($('#model-title, .pinBottom-container, #drawer-container, #drawer, .footer').toArray(), '')
;(t.exports.delayLanding = r), (t.exports.showMessage = o), (t.exports.init = n), (t.exports.dismissModal = l)
},
{
'../enum/DirectorEvents': 23,
'../enum/HelpModalType': 28,
'../enum/PlayerEvents': 40,
'../enum/Viewmode': 51,
'../settings': 166,
'./help/help': 67,
'./helpManager': 68,
'./populateModal': 75
}
],
72: [
function (e, t, i) {
'use strict'
var n = e('./circleLoader').circleLoader
t.exports = {
element: $('#gui-loading'),
hide: function (e) {
n.done(), this.element.fadeOut(1500, e)
},
show: function (e) {
this.element.fadeIn(
500,
function () {
this.element.css('display', 'table'), e && e()
}.bind(this)
)
},
progress: function (e) {
n.set(e)
}
}
},
{
'./circleLoader': 60
}
],
73: [
function (e, t, i) {
'use strict'
var n = e('../settings'),
r = $('#memory-info'),
o = r.find('#memory-gpu'),
a = !1
t.exports = {
show: function () {
n.profiling.enabled && (r.show(), (a = !0))
},
hide: function () {
r.hide(), (a = !1)
},
toggle: function () {
a ? this.hide() : this.show()
},
update: function (e) {
n.profiling.enabled && o.text(Math.floor(e / 1e6) + 'MB')
}
}
},
{
'../settings': 166
}
],
74: [
function (e, t, i) {
'use strict'
var n = e('../util/browser'),
r = e('../analytics')
e('../settings')
t.exports = {
show: function (e, t) {
$('#gui-message').fadeOut(500, function () {
t()
})
}
}
},
{
'../analytics': 4,
'../settings': 166,
'../util/browser': 182
}
],
75: [
function (e, t, i) {
'use strict'
function n(e, t, i, n) {
function r(e) {
return e.classList.contains(a)
}
var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
//for (var a in o) {
//var s = e.find(r);
//for (var l in o[a]) {
//var c = o[a][l];
//if ("top-info" === l || "bottom-info" === l) {
//var h = n ? c : "";
//czj 注释掉第一次打开的用户引导
//s.querySelector("." + l).textContent = h
//} else {
//var u = n ? c : "";
//, d = s.querySelector("." + l);
//d.src = u,
//n ? d.classList.remove("hidden") : d.classList.add("hidden")
//}
//}
//}
//var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
// p.forEach(function(e) {
// n ? e.classList.remove("hidden") : e.classList.add("hidden")
// })
}
var r = e('../util/browser'),
o = e('../localization/localize'),
a = e('../enum/HelpModalType'),
s = (e('../enum/HelpModalSize'), e('../enum/Viewmode'))
t.exports = {
init: function () {
if (!this.hasInitialized) {
;(this.hasInitialized = !0),
(this.deviceType = r.isMobile() ? 'mobile' : 'desktop'),
(this.assets = {}),
(this.assets[a.LANDING[s.PANORAMA]] = {
desktop: {
left: {
'top-info': o.ROTATE,
'big-image': 'images/nav_help_mouse_drag_left.png',
keyboard: 'images/nav_help_keyboard_left_right.png'
},
middle: {
'top-info': o.MOVE,
'big-image': 'images/nav_help_mouse_click.png',
keyboard: 'images/nav_help_keyboard_up_down.png'
},
right: {
'top-info': o.ZOOM,
'big-image': 'images/nav_help_mouse_zoom.png',
keyboard: 'images/nav_help_zoom_keys.png'
}
},
mobile: {
left: {
'top-info': o.ROTATE,
'big-image': 'images/nav_help_gesture_drag.png'
},
middle: {
'top-info': o.MOVE,
'big-image': 'images/nav_help_gesture_tap.png'
},
right: {
'top-info': o.ZOOM,
'big-image': 'images/nav_help_gesture_pinch.png'
}
}
}),
(this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]]))),
(this.assets[a.LANDING[s.DOLLHOUSE]] = {
desktop: {
left: {
'top-info': o.ROTATE,
'big-image': 'images/nav_help_mouse_drag_left.png',
keyboard: 'images/nav_help_keyboard_left_right.png'
},
middle: {
'top-info': o.MOVE,
'big-image': 'images/nav_help_mouse_position_right.png'
}
},
mobile: {
left: {
'top-info': o.ROTATE,
'big-image': 'images/nav_help_gesture_drag.png'
},
middle: {
'top-info': o.MOVE,
'big-image': 'images/nav_help_gesture_position_two_finger.png'
}
}
}),
(this.assets[a.LANDING[s.FLOORPLAN]] = {
desktop: {
left: {
'top-info': o.MOVE,
'big-image': 'images/nav_help_mouse_position_left.png'
},
middle: {
'top-info': o.ROTATE,
'big-image': 'images/nav_help_mouse_drag_right.png',
keyboard: 'images/nav_help_keyboard_left_right.png'
}
},
mobile: {
left: {
'top-info': o.MOVE,
'big-image': 'images/nav_help_gesture_position.png'
},
middle: {
'top-info': o.ROTATE,
'big-image': 'images/nav_help_gesture_drag_two_finger.png'
}
}
})
var e = {
'top-info': o.INSIDE,
'big-image': 'images/nav_help_click_inside.png',
keyboard: 'images/nav_help_inside_key.png'
}
;(this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e), (this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e), (this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e)
var t = {
'top-info': o.INSIDE,
'big-image': 'images/nav_help_tap_inside.png'
}
;(this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t),
(this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t),
(this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t),
(this.assets[a.NAVIGATION] = {}),
(this.assets[a.NAVIGATION][s.PANORAMA] = {
desktop: {
left: {
'top-info': o.HELP_DESKTOP_PANORAMA_1A,
'bottom-info': o.HELP_DESKTOP_PANORAMA_1B,
'big-image': 'images/nav_help_mouse_drag_left.png',
keyboard: 'images/nav_help_keyboard_left_right.png'
},
middle: {
'top-info': o.HELP_DESKTOP_PANORAMA_2A,
'bottom-info': o.HELP_DESKTOP_PANORAMA_2B,
'big-image': 'images/nav_help_mouse_click.png',
keyboard: 'images/nav_help_keyboard_up_down.png'
},
right: {
'top-info': o.HELP_DESKTOP_PANORAMA_3A,
'bottom-info': o.HELP_DESKTOP_PANORAMA_3B,
'big-image': 'images/nav_help_mouse_zoom.png',
keyboard: 'images/nav_help_zoom_keys.png'
}
},
mobile: {
left: {
'top-info': o.HELP_MOBILE_PANORAMA_1,
'big-image': 'images/nav_help_gesture_drag.png'
},
middle: {
'top-info': o.HELP_MOBILE_PANORAMA_2,
'big-image': 'images/nav_help_gesture_tap.png'
},
right: {
'top-info': o.HELP_MOBILE_3,
'big-image': 'images/nav_help_gesture_pinch.png'
}
}
}),
(this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
desktop: {
left: {
'top-info': o.HELP_DESKTOP_DOLLHOUSE_1A,
'bottom-info': o.HELP_DESKTOP_DOLLHOUSE_1B,
'big-image': 'images/nav_help_mouse_drag_left.png',
keyboard: 'images/nav_help_keyboard_all.png'
},
middle: {
'top-info': o.HELP_DESKTOP_DOLLHOUSE_2A,
'big-image': 'images/nav_help_mouse_position_right.png'
},
right: {
'top-info': o.HELP_DESKTOP_DOLLHOUSE_3A,
'big-image': 'images/nav_help_mouse_zoom.png'
}
},
mobile: {
left: {
'top-info': o.HELP_MOBILE_DOLLHOUSE_1,
'big-image': 'images/nav_help_gesture_drag.png'
},
middle: {
'top-info': o.HELP_MOBILE_DOLLHOUSE_2,
'big-image': 'images/nav_help_gesture_position_two_finger.png'
},
right: {
'top-info': o.HELP_MOBILE_3,
'big-image': 'images/nav_help_gesture_pinch.png'
}
}
}),
(this.assets[a.NAVIGATION][s.FLOORPLAN] = {
desktop: {
left: {
'top-info': o.HELP_DESKTOP_FLOORPLAN_1A,
'big-image': 'images/nav_help_mouse_position_left.png'
},
middle: {
'top-info': o.HELP_DESKTOP_FLOORPLAN_2A,
'bottom-info': o.HELP_DESKTOP_FLOORPLAN_2B,
'big-image': 'images/nav_help_mouse_drag_right.png',
keyboard: 'images/nav_help_keyboard_left_right.png'
},
right: {
'top-info': o.HELP_DESKTOP_FLOORPLAN_3A,
'bottom-info': o.HELP_DESKTOP_FLOORPLAN_3B,
'big-image': 'images/nav_help_mouse_zoom.png',
keyboard: 'images/nav_help_keyboard_up_down.png'
}
},
mobile: {
left: {
'top-info': o.HELP_MOBILE_FLOORPLAN_1,
'big-image': 'images/nav_help_gesture_position.png'
},
middle: {
'top-info': o.HELP_MOBILE_FLOORPLAN_2,
'big-image': 'images/nav_help_gesture_drag_two_finger.png'
},
right: {
'top-info': o.HELP_MOBILE_3,
'big-image': 'images/nav_help_gesture_pinch.png'
}
}
}),
(this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA]))),
(this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
'top-info': o.HELP_DESKTOP_360_2A,
'bottom-info': o.HELP_DESKTOP_360_2B,
'big-image': 'images/nav_help_click_inside.png',
keyboard: 'images/nav_help_inside_key.png'
}),
(this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
'top-info': o.HELP_MOBILE_360_2,
'big-image': 'images/nav_help_tap_inside.png'
}),
(this.assets[a.MORE_HELP] = {
desktop: {
'more-help-hlr': {
'top-info': o.HELP_MORE_HLR_A,
'big-image': 'images/nav_help_expand.svg',
'bottom-info': o.HELP_DESKTOP_MORE_HLR_B
},
'more-help-dollhouse': {
'top-info': o.HELP_MORE_DOLLHOUSE_A,
'big-image': 'images/nav_help_dollhouse.svg',
'bottom-info': o.HELP_DESKTOP_MORE_DOLLHOUSE_B
},
'more-help-floors': {
'top-info': o.HELP_MORE_FLOORS_A,
'big-image': 'images/nav_help_floor picker.svg',
'bottom-info': o.HELP_DESKTOP_MORE_FLOORS_B
},
'more-help-tag': {
'top-info': o.HELP_MORE_TAG_A,
'big-image': 'images/nav_help_tag.svg',
'bottom-info': o.HELP_DESKTOP_MORE_TAG_B
},
'more-help-zoom': {
'top-info': o.HELP_MORE_ZOOM_A,
'big-image': 'images/nav_help_zoom.svg',
'bottom-info': o.HELP_DESKTOP_MORE_ZOOM_B
},
'more-help-tour': {
'top-info': o.HELP_MORE_TOUR_A,
'big-image': 'images/nav_help_play.png',
'bottom-info': o.HELP_DESKTOP_MORE_TOUR_B
},
'more-help-inside': {
'top-info': o.HELP_MORE_INSIDE_A,
'big-image': 'images/nav_help_inside.svg',
'bottom-info': o.HELP_DESKTOP_MORE_INSIDE_B
},
'more-help-vr': {
'top-info': o.HELP_MORE_VR_A,
'big-image': 'images/nav_help_vr.svg',
'bottom-info': o.HELP_DESKTOP_MORE_VR_B
},
'more-help-360': {
'top-info': o.HELP_MORE_360_A,
'big-image': 'images/nav_help_360.svg',
'bottom-info': o.HELP_DESKTOP_MORE_360_B
},
'more-help-fullscreen': {
'top-info': o.HELP_MORE_FULLSCREEN_A,
'big-image': 'images/nav_help_fullscreen.svg',
'bottom-info': o.HELP_DESKTOP_MORE_FULLSCREEN_B
}
},
mobile: {
'more-help-hlr': {
'top-info': o.HELP_MORE_HLR_A,
'big-image': 'images/nav_help_expand.svg',
'bottom-info': o.HELP_DESKTOP_MORE_HLR_B
},
'more-help-dollhouse': {
'top-info': o.HELP_MORE_DOLLHOUSE_A,
'big-image': 'images/nav_help_dollhouse.svg',
'bottom-info': o.HELP_MOBILE_MORE_DOLLHOUSE_B
},
'more-help-floors': {
'top-info': o.HELP_MORE_FLOORS_A,
'big-image': 'images/nav_help_floor picker.svg',
'bottom-info': o.HELP_DESKTOP_MORE_FLOORS_B
},
'more-help-tag': {
'top-info': o.HELP_MORE_TAG_A,
'big-image': 'images/nav_help_tag.svg',
'bottom-info': o.HELP_MOBILE_MORE_TAG_B
},
'more-help-tour': {
'top-info': o.HELP_MORE_TOUR_A,
'big-image': 'images/nav_help_play.png',
'bottom-info': o.HELP_DESKTOP_MORE_TOUR_B
},
'more-help-inside': {
'top-info': o.HELP_MORE_INSIDE_A,
'big-image': 'images/nav_help_inside.svg',
'bottom-info': o.HELP_MOBILE_MORE_INSIDE_B
},
'more-help-vr': {
'top-info': o.HELP_MORE_VR_A,
'big-image': 'images/webvr.svg',
'bottom-info': o.HELP_MOBILE_MORE_VR_B
},
'more-help-360': {
'top-info': o.HELP_MORE_360_A,
'big-image': 'images/nav_help_360.svg',
'bottom-info': o.HELP_MOBILE_MORE_360_B
}
}
}),
(this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
desktop: {
left: {
'top-info': o.ROTATE,
'big-image': 'images/nav_help_mouse_drag_left.png',
keyboard: 'images/nav_help_keyboard_left_right.png'
},
middle: {
'top-info': o.MOVE,
'big-image': 'images/nav_help_mouse_click.png',
keyboard: 'images/nav_help_keyboard_up_down.png'
},
right: {
'top-info': o.PLAY,
'big-image': 'images/Desktop-help-play-button.svg',
keyboard: 'images/Desktop-help-spacebar-2.svg'
}
},
mobile: {
left: {
'top-info': o.ROTATE,
'big-image': 'images/nav_help_gesture_drag.png'
},
middle: {
'top-info': o.MOVE,
'big-image': 'images/nav_help_gesture_tap.png'
},
right: {
'top-info': o.PLAY,
'big-image': 'images/mobile-help-play-button.svg'
}
}
}),
(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]]))),
(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle),
(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle),
(this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]]))),
(this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left),
(this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left)
}
},
fill: function (e, t, i) {
n.call(this, e, t, i, !0)
},
clear: function (e, t, i) {
n.call(this, e, t, i, !1)
}
}
},
{
'../enum/HelpModalSize': 27,
'../enum/HelpModalType': 28,
'../enum/Viewmode': 51,
'../localization/localize': 108,
'../util/browser': 182
}
],
76: [
function (e, t, i) {
'use strict'
t.exports = Object.freeze({
OPENED: 'share.open',
CLOSED: 'share.closed',
LINK_CLICKED: 'share.linked'
})
},
{}
],
77: [
function (e, t, i) {
'use strict'
function n(e) {
function t(t, i) {
var n = window.screenY + ($('#player').height() - i) / 2,
r = window.screenX + ($('#player').width() - t) / 2,
o = 'top=' + n + ',left=' + r + ',width=' + t + ',height=' + i
I.emit(l.LINK_CLICKED, {
channel: e
}),
window.open(C[e], 'shareWindow', o)
}
switch (e) {
case y.FACEBOOK:
t(580, 420)
break
case y.TWITTER:
t(550, 440)
break
case y.MAIL:
I.emit(l.LINK_CLICKED, {
channel: 'email'
}),
window.open(C[e], '_blank')
break
case y.LINKEDIN:
}
}
function r(e) {
I.emit(l.LINK_CLICKED, {
channel: 'copylink'
})
var t = document.createRange()
t.selectNodeContents(v)
var i = window.getSelection()
i.removeAllRanges(), i.addRange(t), document.execCommand('copy'), A.classList.remove('hidden'), v.classList.add('highlighted')
}
function o(e) {
;(e && (e.stopPropagation(), e.target === v)) || (window.getSelection().removeAllRanges(), v.classList.remove('highlighted'), A.classList.add('hidden'))
}
var a = e('../../util/browser'),
s = e('../../localization/localize'),
l = e('./ShareEvents'),
c = e('../../util/common'),
h = e('events').EventEmitter,
u = document.getElementById('sharing'),
d = document.getElementById('share-modal'),
p = document.getElementById('share-close'),
f = document.getElementById('facebook-share'),
g = document.getElementById('twitter-share'),
m = document.getElementById('mail-share'),
v = document.getElementById('share-url-text'),
A = document.getElementById('copy-success'),
y = Object.freeze({
FACEBOOK: 'facebook',
TWITTER: 'twitter',
MAIL: 'mail',
LINKEDIN: 'linkedin'
}),
C = {}
;(C[y.FACEBOOK] = 'http://www.facebook.com/sharer.php?u=' + encodeURIComponent(window.location.href + '&utm_source=1') + '&t='),
(C[y.TWITTER] = 'http://twitter.com/intent/tweet?text='),
(C[y.MAIL] = 'mailto:?subject=')
var I = {
init: function (e) {
var t = encodeURIComponent(s.SHARE_EXPLORE + e + ' ' + s.SHARE_AT + ' ')
;(C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + '&utm_source=1')),
(C[y.TWITTER] += t + encodeURIComponent(window.location.href + '&utm_source=2 ' + s.SHARE_WITH + ' #port')),
(C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + '&body=' + t + encodeURIComponent(window.location.href + '&utm_source=3')),
u.addEventListener('click', this.toggle.bind(this)),
p.addEventListener('click', this.hide.bind(this)),
v.addEventListener('click', r),
d.addEventListener('click', o),
f.addEventListener('click', n.bind(this, y.FACEBOOK)),
g.addEventListener('click', n.bind(this, y.TWITTER)),
m.addEventListener('click', n.bind(this, y.MAIL)),
(v.textContent = window.location.href + '&utm_source=4'),
d.classList.add(a.isMobile() ? 'mobile' : 'desktop'),
u.classList.remove('hidden')
},
show: function () {
this.emit(l.OPENED), d.classList.add('fadeIn')
},
hide: function () {
d.classList.contains('fadeIn') && (this.emit(l.CLOSED), document.selection && document.selection.empty(), window.getSelection().removeAllRanges(), o(), d.classList.remove('fadeIn'))
},
toggle: function () {
d.classList.contains('fadeIn') ? this.hide() : this.show()
}
}
c.extendObject(I, h.prototype), (t.exports = I)
},
{
'../../localization/localize': 108,
'../../util/browser': 182,
'../../util/common': 185,
'./ShareEvents': 76,
events: 202
}
],
78: [
function (e, t, i) {
'use strict'
t.exports = Object.freeze({
OPENED: 'terms.opened',
CLOSED: 'terms.closed'
})
},
{}
],
79: [
function (e, t, i) {
'use strict'
var n = e('./TermsEvent'),
r = e('../../localization/localize'),
o = e('../../analytics'),
a = e('../../util/ajax'),
s = e('../../util/common'),
l = e('events').EventEmitter,
c = document.getElementById('terms-modal'),
h = {
init: function () {
$('.footer-terms').on(
'click',
function (e) {
e.preventDefault(), this.show()
}.bind(this)
),
$('#terms-modal .close').on('click', this.hide.bind(this))
},
show: function () {
this.emit(n.OPENED),
a
.get('static/' + r.TERMS_TEXT_FILE)
.done(function (e) {
var t = $('#terms-text').html(e)
o.track('showcase_gui', {
gui_action: 'click_terms_button',
interaction_source: 'gui'
}),
t.find('a').attr('target', '_blank')
})
.fail(function () {
$('#terms-text').html('
' + r.TERMS_OF_USE + '
' + r.TERMS_FAIL)
}),
c.classList.add('fadeIn')
},
hide: function (e) {
e && e.preventDefault(), c.classList.contains('fadeIn') && this.emit(n.CLOSED), c.classList.remove('fadeIn')
}
}
s.extendObject(h, l.prototype), (t.exports = h)
},
{
'../../analytics': 4,
'../../localization/localize': 108,
'../../util/ajax': 181,
'../../util/common': 185,
'./TermsEvent': 78,
events: 202
}
],
80: [
function (e, t, i) {
'use strict'
t.exports = Object.freeze({
OPEN_INFO: 'title.open.info',
CLOSE_INFO: 'title.close.info',
SHOW_INFO: 'title.show.info',
HIDE_INFO: 'title.hide.info',
LINK_CLICKED: 'title.link.click',
CONTACT_LINK_CLICKED: 'title.contact.click',
ORIGIN_LINK_CLICKED: 'title.origin.click'
})
},
{}
],
81: [
function (e, t, i) {
'use strict'
function n(e, t) {
o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
}
function r(e, t) {
function i(i) {
;(e.shouldShowtags = 'show' === this.value), e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
}
document.getElementById('tag-toggles').classList.remove('hidden'), (document.getElementById('radio-tag-show').checked = !0)
for (var n = document.getElementById('tag-inputs').querySelectorAll('input'), r = 0; r < n.length; r++) n[r].addEventListener('change', i)
}
var o = e('../../settings')
t.exports.init = n
},
{
'../../settings': 166
}
],
82: [
function (e, t, i) {
;(function (i) {
'use strict'
function n(e, t) {
return e && u.valueFromHash('title', 1) && 2 !== u.valueFromHash('mls', 0)
? ((document.getElementsByClassName('titleText')[0].innerText = e),
(g_weixinObj.title = e),
e.length > g.minTooltipCharacters && I.parentElement.setAttribute('data-original-title', e),
t && 1 !== m.specialEdition && m.brand && !m.mls
? (document.getElementById('cobrandTitle').innerText = t)
: (document.getElementsByClassName('co-brand')[0].classList.add('hidden'),
document.getElementById('gui-name').classList.add('noCoBrand'),
document.getElementById('cobrandTitle').classList.add('hidden')),
!0)
: (document.getElementById('model-title').classList.add('hidden'), !1)
}
function r(e) {
return e ? ((L = !0), void (_.innerHTML = e)) : void _.classList.add('hidden')
}
function o(e, t, i, n) {
if ((!e && !t && !i) || !m.brand || u.valueFromHash('mls', !1)) return void T.classList.add('hidden')
L = !0
var r = [],
o = c(r, ' ')
if ((e && o('' + e + ''), t)) {
var a = n || t,
s = u.isMobile() ? '' + a + '' : '' + a + ''
o(s)
}
i && o('' + i + ''), (r[0] = ''), (x.innerHTML = r.join(''))
}
function a(e) {
if ('string' == typeof e)
try {
e = JSON.parse(e)
} catch (e) {
return y.warn('Unable to parse address data'), void S.parentElement.classList.add('hidden')
}
if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip))) return void S.parentElement.classList.add('hidden')
L = !0
var t = [],
i = c(t, ' ')
e.address_1 && i(e.address_1),
e.address_2 && i(e.address_2),
e.city && i(e.city, ', '),
e.state && i(e.state, ', '),
e.zip && i(e.zip, e.state ? ' ' : ', '),
(t[0] = ''),
(S.innerText = t.join(''))
}
function s(e) {
var t = document.createElement('a')
return (t.id = 'url'), (t.target = '_blank'), (t.href = e), (t.innerText = e), t.addEventListener('click', N.emit.bind(N, v.ORIGIN_LINK_CLICKED)), t
}
function l(e) {
return (
!(!e || (u.inIframe() && document.referrer === e)) &&
(R.classList.remove('hidden'),
(P.innerHTML = f.WEBVR_LEARN_MORE + ': '),
P.appendChild(s(e)),
O.forEach(function (e) {
e.classList.add('share-link')
}),
!0)
)
}
function c(e, t) {
var i = e,
n = t
return function (e, t) {
i.push(t || n, e)
}
}
function h() {
document.getElementById('title-toggle').addEventListener('click', N.toggleTitle.bind(N)), L && I.addEventListener('click', N.toggleMeta.bind(N, !1))
var e = [].slice.call(_.querySelectorAll('a'))
e.forEach(function (e) {
e.addEventListener('click', N.emit.bind(N, v.LINK_CLICKED))
})
var t = [].slice.call(T.querySelectorAll('a'))
t.forEach(function (e) {
e.addEventListener(
'click',
N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
contact_type: e.getAttribute('id')
})
)
})
}
var u = e('../../util/browser'),
d = e('../../util/common'),
p = e('../../util/logger'),
f = e('../../localization/localize'),
g = e('./titleBarSettings'),
m = e('../../settings'),
v = e('./TitleEvents'),
A = e('events').EventEmitter,
y = new p(i),
C = document.querySelector('.pinTop.left'),
I = document.getElementsByClassName('title-container')[0],
E = document.getElementById('title-toggle').querySelector('i'),
b = document.getElementById('meta-info-wrapper'),
w = document.getElementById('meta-info'),
_ = document.getElementById('meta-description'),
T = document.getElementsByClassName('contact-info')[0],
x = document.getElementById('contact-data'),
S = document.getElementById('addressTxt'),
M = document.getElementById('tag-toggles'),
R = document.getElementById('share-origin'),
P = document.getElementById('share-link-wrapper'),
O = [w, b, I],
L = !1,
D = !1,
N = {
populate: function (e) {
if (n(window.DATA.name, e.coBrand)) {
if ((r(e.description), o(e.contactName, e.phone, e.email, e.formatted_contact_phone), a(e.address), L)) {
var t = document.createElement('br')
M.insertBefore(t, M.firstElementChild)
}
e.socialSharing && m.share.enabled && (D = l(e.url))
}
},
finishSetup: function (e) {
;(L = L || !!e), h(), L || (D ? I.classList.add('share-only') : I.classList.add('no-meta'))
},
toggleMeta: function (e, t) {
var title = document.getElementById('model-title')
t && t.preventDefault()
var i = w.classList.contains('expand')
;(e && !i) ||
(i
? (O.forEach(function (e) {
e.classList.remove('expand')
}),
this.emit(v.CLOSE_INFO),
title.classList.remove('expand'))
: (O.forEach(function (e) {
e.classList.add('expand')
}),
title.classList.add('expand'),
this.emit(v.OPEN_INFO)))
},
setupToggling: function () {
;(b.style.height = w.offsetHeight + 'px'),
w.addEventListener('transitionend', function () {
b.style.height = w.offsetHeight + 'px'
})
},
toggleTitle: function (e) {
e && e.preventDefault(),
C.classList.contains('closed')
? (C.classList.add('open'),
E.classList.remove('icon-dpad-right'),
E.classList.add('icon-dpad-left'),
this.emit(v.SHOW_INFO),
setTimeout(function () {
C.classList.remove('closed'), C.classList.remove('open')
}, g.removeAnimationClasses))
: (C.classList.add('closed'), E.classList.remove('icon-dpad-left'), E.classList.add('icon-dpad-right'), this.emit(v.HIDE_INFO))
}
}
d.extendObject(N, A.prototype), (t.exports = N)
}).call(this, '/js/gui/title/titleBar.js')
},
{
'../../localization/localize': 108,
'../../settings': 166,
'../../util/browser': 182,
'../../util/common': 185,
'../../util/logger': 189,
'./TitleEvents': 80,
'./titleBarSettings': 83,
events: 202
}
],
83: [
function (e, t, i) {
'use strict'
t.exports = Object.freeze({
minTooltipCharacters: 19,
removeAnimationClasses: 500
})
},
{}
],
84: [
function (e, t, i) {
'use strict'
function n(e) {
;(C = e),
P.forEach(function (e) {
b.addEventListener(e, u.bind(this, !1), !0), w.addEventListener(e, u.bind(this, !0), !0), E.addEventListener(e, stopTour2, !0)
S.forEach(function (t) {
//会触发导览停止
t.addEventListener(e, stopTour, !0)
})
$('#drawer img').on(e, stopTour)
})
document.addEventListener('keydown', u.bind(this, !1), !0)
C.on(v.TourStart, function () {
E.classList.add('playing')
})
}
function play() {
//r
// C.playTour(),
C.playTourNearBy(), I && clearTimeout(I), d(), _.removeClass('fadeIn')
}
function stopTour2() {
//o
E.classList.contains('playing') &&
(C.stopTour(),
_.addClass('fadeIn'),
setTimeout(function () {
_.removeClass('fadeIn')
}, p.tourInteraction.showPauseButton),
O || (clearTimeout(I), (I = setTimeout(h, p.tourInteraction.showModal))),
setTimeout(function () {
E.classList.remove('playing')
}, p.tourInteraction.allowNextClick))
}
function stopTour() {
//a
C.tourInProgress && (C.stopTour(), C.endTourProgress(), E.classList.remove('playing'))
}
function togglePlay() {
//s
T.is(':visible') ? play() : stopTour2()
}
function l() {
x.hasClass('playing') && (clearTimeout(I), C.atEndOfTour() ? c() : _.removeClass('fadeIn'))
}
function c() {
E.classList.remove('playing'), h()
}
function h() {
//去掉导览结束时的提示
/* if (!p.tourInteraction.disabled) {
M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
M.addClass("fadeIn tour " + m.deviceType);
var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
if (!p.tourInteraction.smallModal) {
var t;
t = C.player.mode === g.PANORAMA && !C.player.currentPano.isAligned() || C.player.mode === g.DOLLHOUSE ? g.OUTDOOR : C.player.mode === g.FLOORPLAN ? g.FLOORPLAN : g.PANORAMA,
m.fill(R, A.TOUR_INTERACTION[t]),
M.addClass(t)
}
M.addClass(e)
} */
}
function u(e, t) {
if (t) {
var i = 'keydown' === t.type,
n = t.which === f.SPACE || C.tourIsPlaying
;(i && n) || e || (O = !0), C.atEndOfTour() && d(), !C.tourIsPlaying && C.tourInProgress && (_.removeClass('fadeIn'), d(), t.which !== f.SPACE && stopTour()), i && n && togglePlay() //空格键播放或暂停
}
}
function d() {
M.removeClass('fadeIn')
}
var p = (e('../util/browser'), e('../settings')),
f = e('../enum/Keys'),
g = e('../enum/Viewmode'),
m = (e('./helpManager'), e('./populateModal')),
v = e('../enum/DirectorEvents'),
A = e('../enum/HelpModalType'),
y = e('../enum/HelpModalSize'),
C = null,
I = null,
E = document.getElementById('pause-overlay'),
b = document.getElementById('player'),
w = document.getElementById('gui'),
_ = $('#pause-icon').eq(0),
T = $('#play').eq(0),
x = $('#playHead').eq(0),
S = $('.rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan').toArray(),
M = $('#interaction-modal').eq(0),
R = $('#interaction-modal .interaction').toArray(),
P = ['touchstart', 'mousedown', 'pointerdown'],
O = !1
;(t.exports.init = n),
(t.exports.play = play),
(t.exports.pause = stopTour2),
(t.exports.pauseWithoutCTA = stopTour),
(t.exports.togglePlay = togglePlay),
(t.exports.stopTour = l),
(t.exports.dismissModal = d)
},
{
'../enum/DirectorEvents': 23,
'../enum/HelpModalSize': 27,
'../enum/HelpModalType': 28,
'../enum/Keys': 30,
'../enum/Viewmode': 51,
'../settings': 166,
'../util/browser': 182,
'./helpManager': 68,
'./populateModal': 75
}
],
85: [
function (e, t, i) {
'use strict'
t.exports = Object.freeze({
OPENED: 'vr.modal.opened',
LAUNCH: 'vr.modal.launch',
CLOSED: 'vr.modal.closed',
NEXT: 'vr.modal.next',
PREV: 'vr.modal.prev',
STORE: 'vr.modal.store',
falseICECHOSEN: 'vr.modal.device'
})
},
{}
],
86: [
function (e, t, i) {
'use strict'
function n(e, t, i) {
function n(e, t, n, r) {
function o() {
return p + '&m=' + t + '&display=' + e
}
function s() {
var e = '&utm_medium=' + (a.inIframe() ? 'embed' : 'direct'),
t = '&utm_source=' + u,
n = '&utm_showcase_session_id=' + i
return e + t + n
}
function l() {
return d + '&sids=' + t + '&lsid=' + t + '&ln=' + encodeURIComponent(n) + '&ld=' + encodeURIComponent(r) + '&display=' + e
}
return a.valueFromHash('vrcoll', !1) ? l() + s() : o() + s()
}
function r(e, t, i, r) {
var o = 'https://api.branch.io/v1/url',
a = n(e, t, i, r),
s = {
responseType: 'json',
data: {
branch_key: h.appConfig.branch_key,
data: {
m: t,
full_url: a,
$desktop_url: m,
$og_app_id: '331853976762864119',
$og_title: i,
$og_description: r,
$og_image_url: location.origin + '/api/v1/player/models/' + t + '/thumb',
$canonical_url: window.location.href
}
}
}
c.post(o, s)
.done(function (t) {
f[e] = t.url
})
.fail(
function (t) {
f[e] = t
}.bind(this, a)
)
}
function o(e, t, i) {
for (var r in s) {
var o = s[r],
a = n(o, e, t, i)
f[o] = a
}
}
var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href),
d = g + '/vr/dlist/?ret=' + u,
p = g + '/vr/show/?ret=' + u,
m = ''
switch (e) {
case l.IOS:
r(s.CardboardIOS, t.sid, t.name, t.summary)
break
default:
o(t.sid, t.name, t.summary)
}
}
function r(e) {
var t = f[e]
window.open(t, '_blank')
}
function o(e) {
var t = u[e]
window.open(t, '_blank')
}
var a = e('../../util/browser'),
s = e('../../enum/VRApps'),
l = e('../../enum/VRPlatforms'),
c = e('../../util/ajax'),
h = e('../../settings'),
u = {}
;(u[s.CardboardAndroid] = 'https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri='),
(u[s.CardboardIOS] = 'https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri='),
(u[s.GearVR] = 'https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=')
for (var d in s) {
var p = s[d]
u[p] += encodeURIComponent(document.referrer + '&display=' + p)
}
var f = {},
g = (function () {
var e = window.location.host
return e.indexOf('.port.com') === -1 && e.indexOf('localhost') === -1 && (e = 'my.port.com'), 'https://' + e
})()
;(t.exports.init = n), (t.exports.launch = r), (t.exports.launchStore = o)
},
{
'../../enum/VRApps': 46,
'../../enum/VRPlatforms': 49,
'../../settings': 166,
'../../util/ajax': 181,
'../../util/browser': 182
}
],
87: [
function (e, t, i) {
'use strict'
function n(e) {
var t
switch (e) {
case m.IOS:
return (t = p.iosVersion()), t.major > 9 || (9 === t.major && t.minor >= 1)
case m.Android:
return (t = p.androidVersion()), t.major > 4 || (4 === t.major && t.minor > 4) || (4 === t.major && 4 === t.minor && t.patch >= 4)
}
return !1
}
function r(e, t) {
function i(e) {
K.emit(A.STORE, {
type: e
}),
f.launchStore(e)
}
function r(e) {
switch ((e !== _.pageCount && (a(e), N.text(e + 1 + ' / ' + _.pageCount)), e)) {
case _.Title:
O.css('display', 'none'), L.text(u[e]), o(s)
break
case _.Cardboard:
O.css('display', 'block'), L.text(u[e]), M.filter('.cardboard').off(), M.filter('.gearvr').off(), c(e, s), h(H, X, Z)
break
case _.Gear:
L.text(u[e]), c(e, s), T.addClass('lastPage'), h(G, X, Z)
break
case _.pageCount:
T.removeClass('fadeIn'), K.emit(A.CLOSED)
}
B.filter("[src='']").hide()
}
var s = (function () {
return p.detectAndroid()
? p.detectAndroidMobile() && n(m.Android)
? (T.addClass('supported'), (w = '.show-supported'), m.Android)
: (T.addClass('unsupported'), (w = '.show-unsupported'), m.UnsupportedAndroid)
: p.detectIPhone() || p.detectIPod()
? (T.addClass('ios'), (w = '.show-ios'), (_ = v.ios), m.IOS)
: (T.addClass('desktop'), (w = '.show-desktop'), m.Desktop)
})()
f.init(s, e, t), s !== m.Desktop && T.addClass('mobile')
var l = function (e) {
K.emit(A.LAUNCH, {
vr_platform: s,
vr_app: e
}),
f.launch(e)
}
;(q.cardboardAndroid = l.bind(this, g.CardboardAndroid)),
(q.gear = l.bind(this, g.GearVR)),
(q.cardboardIOS = l.bind(this, g.CardboardIOS)),
d(),
$('.show-supported, .show-unsupported, .show-ios, .show-desktop').hide(),
$(w).show()
var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS],
y = ['vr_modal_learn_more', 'vr_modal_next', 'vr_modal_done']
s === m.IOS && (u.splice(1, 1), y.splice(1, 1)),
$('#vr').on('click', function (e) {
e.preventDefault()
player.FlyToMode('panorama', () => {
if (!window.vrEnabled) {
// 开启VR
window.vrEnabled = true
this.classList.add('active')
$('#gui div').not('#vrOff').addClass('vrHide')
$('#vrOffImg').css({ display: 'inline-block' })
} else {
}
})
})
let exitVR = function () {
$('#gui div').not('#vrOff').removeClass('vrHide')
$('#vrOffImg').css({ display: 'none' })
$('#player canvas').css({ width: '', height: '' }) // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
$('#vr').removeClass('active') // 清除vr按钮的激活样式
}
$('#vrOff').on('click', function () {
window.vrEnabled = false
exitVR()
})
window.bus.addEventListener('exitWebXR', e => {
exitVR()
})
var I = 'https://my.port.com/vr/show/?m=' + e.sid
s === m.IOS ? $('.cardboardLink').on('click', i.bind(this, g.CardboardIOS)) : $('.cardboardLink').on('click', i.bind(this, g.CardboardAndroid)),
$('.gearLink').on('click', i.bind(this, g.GearVR)),
$('span.modelLink').text(I),
O.on('click', function (e) {
K.emit(A.PREV), b--, r(b)
}),
L.on('click', function (e) {
L.text()
K.emit(A.NEXT, {
nextAction: y[b]
}),
b++,
r(b)
}),
T.find('.close').on('click', K.dismiss)
}
function o(e) {
switch (e) {
case m.Android:
M.filter('.cardboard').off().on('click', q.cardboardAndroid), M.filter('.gearvr').off().on('click', q.gear), s(H, G, 'logo-button', 'same-line')
break
case m.UnsupportedAndroid:
s('', z, '', '')
break
case m.IOS:
M.filter('.cardboard').off().on('click', q.cardboardIOS), s(H, '', 'logo-button', '')
break
case m.Desktop:
M.filter('.cardboard').off().on('click', l.bind(this, null, F, U)), M.filter('.gearvr').off().on('click', l.bind(this, G, V, null)), s(H, G, 'logo-button', 'same-line'), Q.cardboard()
}
}
function a(e) {
$('.p1, .p2, .p3').hide(),
x.insertAfter(S),
T.removeClass('front-page'),
T.removeClass('details-page'),
T.removeClass('lastPage'),
M.removeClass('logo-button'),
M.removeClass('same-line'),
S.removeClass('headsetOptions'),
R.attr('src', ''),
R.filter('.second').removeClass('gear'),
R.css('display', 'inline-block'),
R.off(),
P.filter('.second').css('display', ''),
D.css('display', 'none'),
$('.p' + (e + 1) + w).show(),
R.filter('.third').insertBefore(P.filter('.third'))
}
function s(e, t, i, n) {
T.addClass('front-page'),
R.filter('.first').attr('src', e),
R.filter('.second').attr('src', t),
M.filter('.first').addClass(i),
M.filter('.second').addClass(i),
M.addClass(n),
'.show-desktop' === w && S.insertAfter(x)
}
function l(e, t, i) {
S.addClass('headsetOptions'),
M.off(),
R.filter('.second').attr('src', t),
D.css('display', 'block'),
P.filter('.second').css('display', 'none'),
D.on('click', function () {
a(_.Title), o(m.Desktop)
}),
e &&
(K.emit(A.falseICECHOSEN, {
name: g.GearVR
}),
R.filter('.first').attr('src', e),
R.filter('.second').addClass('gear'),
R.filter('.second').on('click', f.launchStore.bind(this, g.GearVR)),
Q.gearvr()),
i &&
(K.emit(A.falseICECHOSEN, {
name: g.Cardboard
}),
R.filter('.third').attr('src', i),
R.filter('.third').show(),
R.filter('.third').insertAfter(R.filter('.second')),
R.filter('.third').addClass('link'),
R.filter('.second').addClass('link'),
R.filter('.second').on('click', f.launchStore.bind(this, g.CardboardIOS)),
R.filter('.third').on('click', f.launchStore.bind(this, g.CardboardAndroid)),
Q.cardboard())
}
function c(e, t) {
switch (t) {
case m.IOS:
;(X = Y), (Z = j)
break
case m.Desktop:
e === _.Cardboard
? ((X = F), (Z = U), R.filter('.second').on('click', f.launchStore.bind(this, g.CardboardIOS)), R.filter('.third').on('click', f.launchStore.bind(this, g.CardboardAndroid)))
: ((X = V), R.filter('.second').on('click', f.launchStore.bind(this, g.GearVR)), (Z = ''))
break
default:
e === _.Cardboard ? ((X = z), (Z = j)) : ((X = k), (Z = W))
}
}
function h(e, t, i) {
T.find('.inner').addClass('details-page'), T.addClass('details-page'), R.filter('.first').attr('src', e), R.filter('.second').attr('src', t), R.filter('.third').attr('src', i)
}
function u() {
T.hasClass('fadeIn') && (T.removeClass('fadeIn'), K.emit(A.CLOSED))
}
function d() {
var e = p.aspectRatio() > 1 && p.isMobile()
T.toggleClass('landscape', e).toggleClass('portrait', !e),
T.toggleClass('tiny', $('#player').height() <= y.narrowLandscapeHeight),
T.toggleClass('tinier', $('#player').height() <= y.reallyNarrowLandscapeHeight)
}
var p = e('../../util/browser'),
f = e('./vrLink'),
g = e('../../enum/VRApps'),
m = e('../../enum/VRPlatforms'),
v = e('../../enum/VRPages'),
A = e('./vrEvent'),
y = (e('../../settings'), e('../../constants')),
C = e('../../localization/localize'),
I = e('../../util/common'),
E = e('events').EventEmitter,
b = 0,
w = null,
_ = v.standard,
T = $('.vr-popup'),
x = T.find('.vr-popup-body'),
S = T.find('.vr-images'),
M = T.find('.img-container'),
R = T.find('.vr-sm-image'),
P = M.find('.vr-img-caption'),
O = $('.vr-buttons').find('.prev-button'),
L = $('.vr-buttons').find('.next-button'),
D = S.find('.front-close'),
N = $('.vr-page'),
B = T.find('img'),
F = 'images/apple-store.png',
V = 'images/badge-oculus.png',
U = 'images/badge-cardboard.png',
k = 'images/logo-samsung.png',
H = 'images/headset-cardboard.png',
G = 'images/headset-gearvr.png',
z = 'images/ico-android-robot.png',
W = 'images/ico-gearvr.png',
j = 'images/ico-vr.png',
Y = 'images/apple-logo-white.svg',
X = null,
Z = null,
q = {},
K = {
init: r,
dismiss: u,
isDeviceSupported: n
}
I.extendObject(K, E.prototype), $(window).resize(d)
var Q = (function () {
var e = P.filter('.first').find('.cardboard'),
t = P.filter('.first').find('.gearvr')
return {
cardboard: function () {
t.addClass('hidden'), e.removeClass('hidden')
},
gearvr: function () {
e.addClass('hidden'), t.removeClass('hidden')
}
}
})()
t.exports = K
},
{
'../../constants': 8,
'../../enum/VRApps': 46,
'../../enum/VRPages': 48,
'../../enum/VRPlatforms': 49,
'../../localization/localize': 108,
'../../settings': 166,
'../../util/browser': 182,
'../../util/common': 185,
'./vrEvent': 85,
'./vrLink': 86,
events: 202
}
],
88: [
function (e, t, i) {
'use strict'
t.exports = Object.freeze({
OPENED: 'webvr.modal.opened',
SHOW_TERMS: 'webvr.footer.show.terms'
})
},
{}
],
89: [
function (e, t, i) {
;(function (i) {
'use strict'
function n(e, t, i, n) {
function r(e) {
e.preventDefault(), a(e.currentTarget.id)
}
function a(e) {
ne[e](),
Object.keys(ne).map(function (t, i) {
$('#' + t).toggleClass('tabs-underlined', t === e)
})
}
;(y = i), (v = t), w.init(E.Android, e, n), m()
var l = new RegExp('daydream', 'i'),
c = l.test(y.displayName)
c
? (a('tabdaydream'), B.filter('.device-headset-side').attr('src', H), D.find('.title').text(x.localizeText('WEBVR_FOR_DAYDREAM')))
: (a('tabcardboard'), B.filter('.device-headset-side').attr('src', Y), D.find('.title').text(x.localizeText('WEBVR_FOR_CARDBOARD'))),
$('#vr').on('click', function (e) {
e.preventDefault(), g('click_webvr_button'), L.is(':hidden') && (ie.emit(_.OPENED), o())
}),
$('.webvr-popup .close').on('click', function (e) {
e.preventDefault(), D.hasClass('hidden') ? (g('webvr_help_close'), p()) : s()
}),
$('#tabcardboard').on('click', r),
$('#tabdaydream').on('click', r),
$('#tabnative').on('click', r),
$('.webvr-popup .open-with-app').on('click', function (e) {
e.preventDefault(), g('webvr_learn_more'), a('tabnative'), p()
}),
$('.webvr-popup .help').on('click', function (e) {
e.preventDefault(), g(D.hasClass('hidden') ? 'webvr_help_close' : 'webvr_help_show'), p()
}),
$('.webvr-popup .terms').on('click', function (e) {
e.preventDefault(), g('webvr_click_terms'), s(), ie.emit(_.SHOW_TERMS)
}),
F.on('click', function (e) {
e.preventDefault(), g(ee), window.open(J, '_blank')
}),
V.on('click', function (e) {
e.preventDefault(), g('webvr_phone_link'), window.open(te, '_blank')
}),
$('.webvr-popup .badge-cardboard').on('click', function (e) {
e.preventDefault(), g('webvr_cardboard_link'), w.launch(b.CardboardAndroid)
}),
$('.webvr-popup .badge-oculus').on('click', function (e) {
e.preventDefault(), g('webvr_oculus_link'), w.launch(b.GearVR)
})
}
function r() {
function e() {
y.isPresenting || (f(), window.removeEventListener('vrdisplaypresentchange', e))
}
R.info('Headset mounted'), v.suspend()
var t = document.createElement('canvas')
for (t.getContext('webgl'), t.className = 'webvr-canvas', document.bgColor = '#000', document.body.style.backgroundColor = '#000'; document.body.firstChild; )
document.body.removeChild(document.body.firstChild)
document.body.appendChild(t),
g('webvr_enter_app'),
y
.requestPresent([
{
source: t,
predistorted: !0
}
])
.catch(function (t) {
R.error('Failed to present: ' + t), g('webvr_exit_calibrate'), e()
}),
A.then(function () {
window.dispatchEvent(new Event('vrapp-start'))
}),
window.addEventListener('vrdisplaypresentchange', e)
}
function o() {
O.fadeOut(I.guiAnimationSpeed), L.fadeIn(I.guiAnimationSpeed), a()
}
function a() {
if (!A) {
var e = C.valueFromHash('webvr') || I.appConfig.webvr_version,
t = 'https://static.port.com/webvr/' + e + '/js/main.js'
A = new Promise(function (e, i) {
var n = document.createElement('script')
;(n.type = 'text/javascript'), (n.src = t), (n.onload = e), document.head.appendChild(n)
})
}
D.find('.enter-button').on('click', r)
}
function s() {
g('webvr_modal_close'),
D.find('.enter-button').off('click', r),
L.fadeOut(I.guiAnimationSpeed, function () {
D.toggleClass('hidden', !1), N.toggleClass('hidden', !0), C.exitFullscreen()
}),
O.fadeIn(I.guiAnimationSpeed)
}
function l() {
k.toggleClass('hidden', !1), U.toggleClass('hidden', !0)
}
function c() {
k.toggleClass('hidden', !0), U.toggleClass('hidden', !1)
}
function h() {
B.filter('.device-headset').attr('src', G),
B.filter('.device-phone').attr('src', z),
(J = Z),
(ee = K),
F.text(x.localizeText('WEBVR_DAYDREAM_VIEW')),
V.text(x.localizeText('VR_NEED_DAYDREAM_PHONE')),
$('.webvr-popup .detail.daydream-label').toggleClass('hidden', !1),
c()
}
function u() {
B.filter('.badge-cardboard').attr('src', j), B.filter('.badge-oculus').attr('src', X), l()
}
function d() {
B.filter('.device-headset').attr('src', Y),
B.filter('.device-phone').attr('src', W),
(J = q),
(ee = Q),
F.text(x.localizeText('VR_GOOGLE_CARDBOARD')),
V.text(x.localizeText('VR_COMPATIBLE_ANDROID_LONG')),
$('.webvr-popup .detail.daydream-label').toggleClass('hidden', !0),
c()
}
function p() {
D.toggleClass('hidden'), N.toggleClass('hidden')
}
function f() {
R.info('exiting webVR'), g('webvr_exit_app'), window.location.search.indexOf('&qs=1') === -1 ? (window.location = window.location + '&qs=1') : (window.location = window.location)
}
function g(e) {
var t = C.isLandscape() ? 'landscape' : 'portrait'
T.trackAlways('showcase_gui', {
gui_action: e,
orientation: t
})
}
function m() {
var e = C.isLandscape()
L.toggleClass('landscape', e).toggleClass('portrait', !e)
}
var v,
A,
y,
C = e('../../util/browser'),
I = e('../../settings'),
E = (e('./../gui'), e('../../enum/VRPlatforms')),
b = e('../../enum/VRApps'),
w = e('./../vr/vrLink'),
_ = e('./WebVrEvent'),
T = e('../../analytics'),
x = (e('../../constants'), e('../../localization/localize')),
S = e('../../util/common'),
M = e('../../util/logger'),
R = new M(i),
P = e('events').EventEmitter,
O = $('#gui'),
L = $('.webvr-popup'),
D = $('.webvr-popup .page.p1'),
N = $('.webvr-popup .page.p2'),
B = L.find('.image'),
F = $('.webvr-popup .detail.headset'),
V = $('.webvr-popup .detail.phone'),
U = $('.webvr-popup .tab-content.webvr'),
k = $('.webvr-popup .tab-content.native'),
H = 'images/device-daydream-side.png',
G = 'images/device-daydream.png',
z = 'images/device-pixel.png',
W = 'images/ico-android-robot.png',
j = 'images/badge-cardboard.png',
Y = 'images/headset-cardboard.png',
X = 'images/badge-oculus.png',
Z = 'https://madeby.google.com/vr/',
q = 'https://vr.google.com/cardboard/get-cardboard/',
K = 'webvr_daydream_link',
Q = 'webvr_cardboard_link',
J = Z,
ee = K,
te = 'https://vr.google.com/daydream/phones/',
ie = {
init: n
},
ne = {
tabcardboard: d,
tabdaydream: h,
tabnative: u
}
S.extendObject(ie, P.prototype), $(window).resize(m), (t.exports = ie)
}).call(this, '/js/gui/webvr/webVRgui.js')
},
{
'../../analytics': 4,
'../../constants': 8,
'../../enum/VRApps': 46,
'../../enum/VRPlatforms': 49,
'../../localization/localize': 108,
'../../settings': 166,
'../../util/browser': 182,
'../../util/common': 185,
'../../util/logger': 189,
'./../gui': 65,
'./../vr/vrLink': 86,
'./WebVrEvent': 88,
events: 202
}
],
90: [
function (e, t, i) {
'use strict'
function n(e, t, i, n, o) {
n || 0 === n ? (this.floorId = n) : (this.floorId = -1), (this.roomId = o || ''), (this.labelId = e), (this.position = new r.Vector3().copy(t)), (this.text = i)
}
var r = e('three'),
o = e('../util/browser')
;(n.prototype.build = function () {
var e = window.document.createElement('div')
o.isMobile() ? e.setAttribute('class', 'gui-floorplan-label gui-floorplan-label-mobile') : e.setAttribute('class', 'gui-floorplan-label')
var t = window.document.createElement('div')
t.setAttribute('class', 'gui-floorplan-label-text')
var i = window.document.createTextNode(this.text)
t.appendChild(i), e.appendChild(t), window.document.body.appendChild(e), (this.labelGui = e), (this.textBlock = t), $(this.labelGui).hide()
var n = window.getComputedStyle(this.labelGui)
this.initialTransform = n.transform || n.webkitTransform
}),
(t.exports = n)
},
{
'../util/browser': 182,
three: 217
}
],
91: [
function (e, t, i) {
'use strict'
function n() {
;(this.player = null), (this.modelManager = null), (this.container = null)
}
var r = e('three'),
o = (e('../util/common'), e('../enum/PlayerEvents')),
a = (e('../enum/DirectorEvents'), e('../enum/ModelManagerEvents')),
s = e('../settings'),
l = e('../enum/Viewmode'),
c = (e('../enum/WarpStyle'), e('../util/transitions'), e('../util/lerp'), e('../util/browser'))
//场景初始化
;(n.prototype.init = function (e, t, i) {
;(this.player = e), (this.modelManager = t), (this.container = i), this.updateModel(), this.bindEvents()
}),
(n.prototype.bindEvents = function () {
this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
this.player.on(o.StartInside, this.handleStartInside.bind(this)),
this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
}),
(n.prototype.updateModel = function () {
this.model = this.modelManager.getActiveModel()
}),
(n.prototype.handlePlayerViewChanged = function () {
this.updateLabelVisibility(), this.updateLabelDisplay()
}),
(n.prototype.getLabelsForFloor = function (e, t) {
return (
(t = t || []),
(t.length = 0),
this.model.labels.forEach(
function (i) {
this.labelVisibleForFloor(i, e) && t.push(i)
}.bind(this)
),
t
)
}),
(n.prototype.getLabelsForCurrentFloor = function (e) {
return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
}),
(n.prototype.labelVisibleForFloor = function (e, t) {
var i =
(c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile) || (!c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop)
if (!this.model.showingLabels || !e.labelGui || !i) return !1
var n = e.floorId === this.model.floors.size() - 1
return this.model.allFloorsVisible ? n : e.floorId === t
}),
(n.prototype.updateLabelVisibility = function (e) {
this.model.labels.forEach(
function (e) {
this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex)
? this.showLabel(e, s.labels.fadeInDelay, s.labels.fadeInDuration)
: this.hideLabel(e, s.labels.fadeOutDelay, s.labels.fadeOutDuration)
}.bind(this)
)
}),
(n.prototype.showAllLabels = function (e, t) {
this.model.labels.forEach(
function (i) {
this.showLabel(i, e, t)
}.bind(this)
)
}),
(n.prototype.hideAllLabels = function (e, t) {
this.model.labels.forEach(
function (i) {
this.hideLabel(i, e, t)
}.bind(this)
)
}),
(n.prototype.showLabel = function (e, t, i) {
this.model.showingLabels && (e.visible || ((e.visible = !0), (e.labelGui.style.display = 'block'), (e.labelGui.style.opacity = 0), $(e.labelGui).delay(t).fadeTo(i, 1)))
}),
(n.prototype.hideLabel = function (e, t, i) {
e.visible && ((e.visible = !1), c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
}),
(n.prototype.supportedMode = function () {
return this.player.mode === l.FLOORPLAN
}),
(n.prototype.updateLabelDisplay = (function () {
var e = (new r.Vector3(), new r.Vector3(), [])
return function () {
var t = this.player.getLabelScaleFactor(),
i = 0.6,
n = 1.2,
r = (1 - t) * n + i,
o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop
this.getLabelsForCurrentFloor(e)
for (var a = 0; a < e.length; a++) {
var l = e[a]
this.supportedMode() &&
l.labelGui &&
(this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
t >= o && l.text.length >= s.labels.minLengthForTruncate
? (l.textBlock.innerText = l.text.substring(0, s.labels.truncateLength) + s.labels.truncateSuffix)
: (l.textBlock.innerText = l.text))
}
}
})()),
(n.prototype.updateProjectedGuiElement = (function () {
var e = new r.Vector3()
new r.Vector3()
return function (t, i, n, r, o) {
i.style.fontSize = 100 * o + '%'
var a = $('#player').width(),
s = $('#player').height(),
l = 0.5 * a,
c = 0.5 * s
e.copy(n), e.project(this.player.camera)
var h = e.x * l + l,
u = -(e.y * c) + c
;(h -= t.offsetWidth / 2), (u -= t.offsetHeight / 2), (t.style.left = h + 'px'), (t.style.top = u + 'px')
}
})()),
(n.prototype.handleStartInside = function (e) {
this.updateLabelVisibility()
}),
(n.prototype.handleStartOutside = function () {
this.updateLabelVisibility()
}),
(t.exports = n)
},
{
'../enum/DirectorEvents': 23,
'../enum/ModelManagerEvents': 33,
'../enum/PlayerEvents': 40,
'../enum/Viewmode': 51,
'../enum/WarpStyle': 52,
'../settings': 166,
'../util/browser': 182,
'../util/common': 185,
'../util/lerp': 188,
'../util/transitions': 195,
three: 217
}
],
92: [
function (e, t, i) {
'use strict'
Array.prototype.findIndex ||
(Array.prototype.findIndex = function (e) {
if (null == this) throw new TypeError('Array.prototype.findIndex called on null or undefined')
if ('function' != typeof e) throw new TypeError('predicate must be a function')
for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++) if (((t = i[o]), e.call(r, t, o, i))) return o
return -1
}),
Array.prototype.find ||
Object.defineProperty(Array.prototype, 'find', {
value: function (e) {
if (null == this) throw new TypeError('"this" is null or not defined')
var t = Object(this),
i = t.length >>> 0
if ('function' != typeof e) throw new TypeError('predicate must be a function')
for (var n = arguments[1], r = 0; r < i; ) {
var o = t[r]
if (e.call(n, o, r, t)) return o
r++
}
}
})
},
{}
],
93: [
function (e, t, i) {
'use strict'
var n = n || {}
;(t.exports = n),
(n.gui = n.gui || {}),
(n.utils = n.utils || {}),
(n.controllers = n.controllers || {}),
(n.dom = n.dom || {}),
(n.color = n.color || {}),
(n.utils.css = (function () {
return {
load: function (e, t) {
t = t || document
var i = t.createElement('link')
;(i.type = 'text/css'), (i.rel = 'stylesheet'), (i.href = e), t.getElementsByTagName('head')[0].appendChild(i)
},
inject: function (e, t) {
t = t || document
var i = document.createElement('style')
;(i.type = 'text/css'), (i.innerHTML = e), t.getElementsByTagName('head')[0].appendChild(i)
}
}
})()),
(n.utils.common = (function () {
var e = Array.prototype.forEach,
t = Array.prototype.slice
return {
BREAK: {},
extend: function (e) {
return (
this.each(
t.call(arguments, 1),
function (t) {
for (var i in t) this.isUndefined(t[i]) || (e[i] = t[i])
},
this
),
e
)
},
defaults: function (e) {
return (
this.each(
t.call(arguments, 1),
function (t) {
for (var i in t) this.isUndefined(e[i]) && (e[i] = t[i])
},
this
),
e
)
},
compose: function () {
var e = t.call(arguments)
return function () {
for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--) i = [e[n].apply(this, i)]
return i[0]
}
},
each: function (t, i, n) {
if (t)
if (e && t.forEach && t.forEach === e) t.forEach(i, n)
else if (t.length === t.length + 0) {
for (var r = 0, o = t.length; r < o; r++) if (r in t && i.call(n, t[r], r) === this.BREAK) return
} else for (var r in t) if (i.call(n, t[r], r) === this.BREAK) return
},
defer: function (e) {
setTimeout(e, 0)
},
toArray: function (e) {
return e.toArray ? e.toArray() : t.call(e)
},
isUndefined: function (e) {
return void 0 === e
},
isNull: function (e) {
return null === e
},
isNaN: function (e) {
return e !== e
},
isArray:
Array.isArray ||
function (e) {
return e.constructor === Array
},
isObject: function (e) {
return e === Object(e)
},
isNumber: function (e) {
return e === e + 0
},
isString: function (e) {
return e === e + ''
},
isBoolean: function (e) {
return e === !1 || e === !0
},
isFunction: function (e) {
return '[object Function]' === Object.prototype.toString.call(e)
}
}
})()),
(n.controllers.Controller = (function (e) {
var t = function (e, t) {
;(this.initialValue = e[t]), (this.domElement = document.createElement('div')), (this.object = e), (this.property = t), (this.__onChange = void 0), (this.__onFinishChange = void 0)
}
return (
e.extend(t.prototype, {
onChange: function (e) {
return (this.__onChange = e), this
},
onFinishChange: function (e) {
return (this.__onFinishChange = e), this
},
setValue: function (e) {
return (this.object[this.property] = e), this.__onChange && this.__onChange.call(this, e), this.updateDisplay(), this
},
getValue: function () {
return this.object[this.property]
},
updateDisplay: function () {
return this
},
isModified: function () {
return this.initialValue !== this.getValue()
}
}),
t
)
})(n.utils.common)),
(n.dom.dom = (function (e) {
function t(t) {
if ('0' === t || e.isUndefined(t)) return 0
var i = t.match(r)
return e.isNull(i) ? 0 : parseFloat(i[1])
}
var i = {
HTMLEvents: ['change'],
MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'],
KeyboardEvents: ['keydown']
},
n = {}
e.each(i, function (t, i) {
e.each(t, function (e) {
n[e] = i
})
})
var r = /(\d+(\.\d+)?)px/,
o = {
makeSelectable: function (e, t) {
void 0 !== e &&
void 0 !== e.style &&
((e.onselectstart = t
? function () {
return !1
}
: function () {}),
(e.style.MozUserSelect = t ? 'auto' : 'none'),
(e.style.KhtmlUserSelect = t ? 'auto' : 'none'),
(e.unselectable = t ? 'on' : 'off'))
},
makeFullscreen: function (t, i, n) {
e.isUndefined(i) && (i = !0),
e.isUndefined(n) && (n = !0),
(t.style.position = 'absolute'),
i && ((t.style.left = 0), (t.style.right = 0)),
n && ((t.style.top = 0), (t.style.bottom = 0))
},
fakeEvent: function (t, i, r, o) {
r = r || {}
var a = n[i]
if (!a) throw new Error('Event type ' + i + ' not supported.')
var s = document.createEvent(a)
switch (a) {
case 'MouseEvents':
var l = r.x || r.clientX || 0,
c = r.y || r.clientY || 0
s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null)
break
case 'KeyboardEvents':
var h = s.initKeyboardEvent || s.initKeyEvent
e.defaults(r, {
cancelable: !0,
ctrlKey: !1,
altKey: !1,
shiftKey: !1,
metaKey: !1,
keyCode: void 0,
charCode: void 0
}),
h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode)
break
default:
s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
}
e.defaults(s, o), t.dispatchEvent(s)
},
bind: function (e, t, i, n) {
return (n = n || !1), e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent('on' + t, i), o
},
unbind: function (e, t, i, n) {
return (n = n || !1), e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent('on' + t, i), o
},
addClass: function (e, t) {
if (void 0 === e.className) e.className = t
else if (e.className !== t) {
var i = e.className.split(/ +/)
i.indexOf(t) == -1 && (i.push(t), (e.className = i.join(' ').replace(/^\s+/, '').replace(/\s+$/, '')))
}
return o
},
removeClass: function (e, t) {
if (t)
if (void 0 === e.className);
else if (e.className === t) e.removeAttribute('class')
else {
var i = e.className.split(/ +/),
n = i.indexOf(t)
n != -1 && (i.splice(n, 1), (e.className = i.join(' ')))
}
else e.className = void 0
return o
},
hasClass: function (e, t) {
return new RegExp('(?:^|\\s+)' + t + '(?:\\s+|$)').test(e.className) || !1
},
getWidth: function (e) {
var i = getComputedStyle(e)
return t(i['border-left-width']) + t(i['border-right-width']) + t(i['padding-left']) + t(i['padding-right']) + t(i.width)
},
getHeight: function (e) {
var i = getComputedStyle(e)
return t(i['border-top-width']) + t(i['border-bottom-width']) + t(i['padding-top']) + t(i['padding-bottom']) + t(i.height)
},
getOffset: function (e) {
var t = {
left: 0,
top: 0
}
if (e.offsetParent)
do (t.left += e.offsetLeft), (t.top += e.offsetTop)
while ((e = e.offsetParent))
return t
},
isActive: function (e) {
return e === document.activeElement && (e.type || e.href)
}
}
return o
})(n.utils.common)),
(n.controllers.OptionController = (function (e, t, i) {
var n = function (e, r, o) {
n.superclass.call(this, e, r)
var a = this
if (((this.__select = document.createElement('select')), i.isArray(o))) {
var s = {}
i.each(o, function (e) {
s[e] = e
}),
(o = s)
}
i.each(o, function (e, t) {
var i = document.createElement('option')
;(i.innerHTML = t), i.setAttribute('value', e), a.__select.appendChild(i)
}),
this.updateDisplay(),
t.bind(this.__select, 'change', function () {
var e = this.options[this.selectedIndex].value
a.setValue(e)
}),
this.domElement.appendChild(this.__select)
}
return (
(n.superclass = e),
i.extend(n.prototype, e.prototype, {
setValue: function (e) {
var t = n.superclass.prototype.setValue.call(this, e)
return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), t
},
updateDisplay: function () {
return (this.__select.value = this.getValue()), n.superclass.prototype.updateDisplay.call(this)
}
}),
n
)
})(n.controllers.Controller, n.dom.dom, n.utils.common)),
(n.controllers.NumberController = (function (e, t) {
function i(e) {
return (e = e.toString()), e.indexOf('.') > -1 ? e.length - e.indexOf('.') - 1 : 0
}
var n = function (e, r, o) {
n.superclass.call(this, e, r),
(o = o || {}),
(this.__min = o.min),
(this.__max = o.max),
(this.__step = o.step),
t.isUndefined(this.__step)
? 0 == this.initialValue
? (this.__impliedStep = 1)
: (this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10)
: (this.__impliedStep = this.__step),
(this.__precision = i(this.__impliedStep))
}
return (
(n.superclass = e),
t.extend(n.prototype, e.prototype, {
setValue: function (e) {
return (
void 0 !== this.__min && e < this.__min ? (e = this.__min) : void 0 !== this.__max && e > this.__max && (e = this.__max),
void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
n.superclass.prototype.setValue.call(this, e)
)
},
min: function (e) {
return (this.__min = e), this
},
max: function (e) {
return (this.__max = e), this
},
step: function (e) {
return (this.__step = e), (this.__impliedStep = e), (this.__precision = i(e)), this
}
}),
n
)
})(n.controllers.Controller, n.utils.common)),
(n.controllers.NumberControllerBox = (function (e, t, i) {
function n(e, t) {
var i = Math.pow(10, t)
return Math.round(e * i) / i
}
var r = function (e, n, o) {
function a() {
var e = parseFloat(d.__input.value)
i.isNaN(e) || d.setValue(e)
}
function s() {
a(), d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
}
function l(e) {
t.bind(window, 'mousemove', c), t.bind(window, 'mouseup', h), (u = e.clientY)
}
function c(e) {
var t = u - e.clientY
d.setValue(d.getValue() + t * d.__impliedStep), (u = e.clientY)
}
function h() {
t.unbind(window, 'mousemove', c), t.unbind(window, 'mouseup', h)
}
;(this.__truncationSuspended = !1), r.superclass.call(this, e, n, o)
var u,
d = this
;(this.__input = document.createElement('input')),
this.__input.setAttribute('type', 'text'),
t.bind(this.__input, 'change', a),
t.bind(this.__input, 'blur', s),
t.bind(this.__input, 'mousedown', l),
t.bind(this.__input, 'keydown', function (e) {
13 === e.keyCode && ((d.__truncationSuspended = !0), this.blur(), (d.__truncationSuspended = !1))
}),
this.updateDisplay(),
this.domElement.appendChild(this.__input)
}
return (
(r.superclass = e),
i.extend(r.prototype, e.prototype, {
updateDisplay: function () {
return (this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision)), r.superclass.prototype.updateDisplay.call(this)
}
}),
r
)
})(n.controllers.NumberController, n.dom.dom, n.utils.common)),
(n.controllers.NumberControllerSlider = (function (e, t, i, n, r) {
function o(e, t, i, n, r) {
return n + (r - n) * ((e - t) / (i - t))
}
var a = function (e, i, n, r, s) {
function l(e) {
t.bind(window, 'mousemove', c), t.bind(window, 'mouseup', h), c(e)
}
function c(e) {
e.preventDefault()
var i = t.getOffset(u.__background),
n = t.getWidth(u.__background)
return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)), !1
}
function h() {
t.unbind(window, 'mousemove', c), t.unbind(window, 'mouseup', h), u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
}
a.superclass.call(this, e, i, {
min: n,
max: r,
step: s
})
var u = this
;(this.__background = document.createElement('div')),
(this.__foreground = document.createElement('div')),
t.bind(this.__background, 'mousedown', l),
t.addClass(this.__background, 'slider'),
t.addClass(this.__foreground, 'slider-fg'),
this.updateDisplay(),
this.__background.appendChild(this.__foreground),
this.domElement.appendChild(this.__background)
}
return (
(a.superclass = e),
(a.useDefaultStyles = function () {
i.inject(r)
}),
n.extend(a.prototype, e.prototype, {
updateDisplay: function () {
var e = (this.getValue() - this.__min) / (this.__max - this.__min)
return (this.__foreground.style.width = 100 * e + '%'), a.superclass.prototype.updateDisplay.call(this)
}
}),
a
)
})(
n.controllers.NumberController,
n.dom.dom,
n.utils.css,
n.utils.common,
'/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n.slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: \'\';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}'
)),
(n.controllers.FunctionController = (function (e, t, i) {
var n = function (e, i, r) {
n.superclass.call(this, e, i)
var o = this
;(this.__button = document.createElement('div')),
(this.__button.innerHTML = void 0 === r ? 'Fire' : r),
t.bind(this.__button, 'click', function (e) {
return e.preventDefault(), o.fire(), !1
}),
t.addClass(this.__button, 'button'),
this.domElement.appendChild(this.__button)
}
return (
(n.superclass = e),
i.extend(n.prototype, e.prototype, {
fire: function () {
this.__onChange && this.__onChange.call(this), this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), this.getValue().call(this.object)
}
}),
n
)
})(n.controllers.Controller, n.dom.dom, n.utils.common)),
(n.controllers.BooleanController = (function (e, t, i) {
var n = function (e, i) {
function r() {
o.setValue(!o.__prev)
}
n.superclass.call(this, e, i)
var o = this
;(this.__prev = this.getValue()),
(this.__checkbox = document.createElement('input')),
this.__checkbox.setAttribute('type', 'checkbox'),
t.bind(this.__checkbox, 'change', r, !1),
this.domElement.appendChild(this.__checkbox),
this.updateDisplay()
}
return (
(n.superclass = e),
i.extend(n.prototype, e.prototype, {
setValue: function (e) {
var t = n.superclass.prototype.setValue.call(this, e)
return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), (this.__prev = this.getValue()), t
},
updateDisplay: function () {
return (
this.getValue() === !0 ? (this.__checkbox.setAttribute('checked', 'checked'), (this.__checkbox.checked = !0)) : (this.__checkbox.checked = !1),
n.superclass.prototype.updateDisplay.call(this)
)
}
}),
n
)
})(n.controllers.Controller, n.dom.dom, n.utils.common)),
(n.color.toString = (function (e) {
return function (t) {
if (1 == t.a || e.isUndefined(t.a)) {
for (var i = t.hex.toString(16); i.length < 6; ) i = '0' + i
return '#' + i
}
return 'rgba(' + Math.round(t.r) + ',' + Math.round(t.g) + ',' + Math.round(t.b) + ',' + t.a + ')'
}
})(n.utils.common)),
(n.color.interpret = (function (e, t) {
var i,
n,
r = function () {
n = !1
var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0]
return (
t.each(o, function (r) {
if (r.litmus(e))
return (
t.each(r.conversions, function (r, o) {
if (((i = r.read(e)), n === !1 && i !== !1)) return (n = i), (i.conversionName = o), (i.conversion = r), t.BREAK
}),
t.BREAK
)
}),
n
)
},
o = [
{
litmus: t.isString,
conversions: {
THREE_CHAR_HEX: {
read: function (e) {
var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i)
return (
null !== t && {
space: 'HEX',
hex: parseInt('0x' + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
}
)
},
write: e
},
SIX_CHAR_HEX: {
read: function (e) {
var t = e.match(/^#([A-F0-9]{6})$/i)
return (
null !== t && {
space: 'HEX',
hex: parseInt('0x' + t[1].toString())
}
)
},
write: e
},
CSS_RGB: {
read: function (e) {
var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/)
return (
null !== t && {
space: 'RGB',
r: parseFloat(t[1]),
g: parseFloat(t[2]),
b: parseFloat(t[3])
}
)
},
write: e
},
CSS_RGBA: {
read: function (e) {
var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/)
return (
null !== t && {
space: 'RGB',
r: parseFloat(t[1]),
g: parseFloat(t[2]),
b: parseFloat(t[3]),
a: parseFloat(t[4])
}
)
},
write: e
}
}
},
{
litmus: t.isNumber,
conversions: {
HEX: {
read: function (e) {
return {
space: 'HEX',
hex: e,
conversionName: 'HEX'
}
},
write: function (e) {
return e.hex
}
}
}
},
{
litmus: t.isArray,
conversions: {
RGB_ARRAY: {
read: function (e) {
return (
3 == e.length && {
space: 'RGB',
r: e[0],
g: e[1],
b: e[2]
}
)
},
write: function (e) {
return [e.r, e.g, e.b]
}
},
RGBA_ARRAY: {
read: function (e) {
return (
4 == e.length && {
space: 'RGB',
r: e[0],
g: e[1],
b: e[2],
a: e[3]
}
)
},
write: function (e) {
return [e.r, e.g, e.b, e.a]
}
}
}
},
{
litmus: t.isObject,
conversions: {
RGBA_OBJ: {
read: function (e) {
return (
!!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
space: 'RGB',
r: e.r,
g: e.g,
b: e.b,
a: e.a
}
)
},
write: function (e) {
return {
r: e.r,
g: e.g,
b: e.b,
a: e.a
}
}
},
RGB_OBJ: {
read: function (e) {
return (
!!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
space: 'RGB',
r: e.r,
g: e.g,
b: e.b
}
)
},
write: function (e) {
return {
r: e.r,
g: e.g,
b: e.b
}
}
},
HSVA_OBJ: {
read: function (e) {
return (
!!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
space: 'HSV',
h: e.h,
s: e.s,
v: e.v,
a: e.a
}
)
},
write: function (e) {
return {
h: e.h,
s: e.s,
v: e.v,
a: e.a
}
}
},
HSV_OBJ: {
read: function (e) {
return (
!!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
space: 'HSV',
h: e.h,
s: e.s,
v: e.v
}
)
},
write: function (e) {
return {
h: e.h,
s: e.s,
v: e.v
}
}
}
}
}
]
return r
})(n.color.toString, n.utils.common)),
(n.GUI = n.gui.GUI =
(function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
function g(e, t, i, o) {
if (void 0 === t[i]) throw new Error('Object ' + t + ' has no property "' + i + '"')
var a
if (o.color) a = new h(t, i)
else {
var s = [t, i].concat(o.factoryArgs)
a = n.apply(e, s)
}
o.before instanceof r && (o.before = o.before.__li), A(e, a), p.addClass(a.domElement, 'c')
var l = document.createElement('span')
p.addClass(l, 'property-name'), (l.innerHTML = a.property)
var c = document.createElement('div')
c.appendChild(l), c.appendChild(a.domElement)
var u = m(e, c, o.before)
return p.addClass(u, V.CLASS_CONTROLLER_ROW), p.addClass(u, typeof a.getValue()), v(e, u, a), e.__controllers.push(a), a
}
function m(e, t, i) {
var n = document.createElement('li')
return t && n.appendChild(t), i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n), e.onResize(), n
}
function v(e, t, i) {
if (
((i.__li = t),
(i.__gui = e),
f.extend(i, {
options: function (t) {
return arguments.length > 1
? (i.remove(),
g(e, i.object, i.property, {
before: i.__li.nextElementSibling,
factoryArgs: [f.toArray(arguments)]
}))
: f.isArray(t) || f.isObject(t)
? (i.remove(),
g(e, i.object, i.property, {
before: i.__li.nextElementSibling,
factoryArgs: [t]
}))
: void 0
},
name: function (e) {
return (i.__li.firstElementChild.firstElementChild.innerHTML = e), i
},
listen: function () {
return i.__gui.listen(i), i
},
remove: function () {
return i.__gui.remove(i), i
}
}),
i instanceof l)
) {
var n = new s(i.object, i.property, {
min: i.__min,
max: i.__max,
step: i.__step
})
f.each(['updateDisplay', 'onChange', 'onFinishChange'], function (e) {
var t = i[e],
r = n[e]
i[e] = n[e] = function () {
var e = Array.prototype.slice.call(arguments)
return t.apply(i, e), r.apply(n, e)
}
}),
p.addClass(t, 'has-slider'),
i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
} else if (i instanceof s) {
var r = function (t) {
return f.isNumber(i.__min) && f.isNumber(i.__max)
? (i.remove(),
g(e, i.object, i.property, {
before: i.__li.nextElementSibling,
factoryArgs: [i.__min, i.__max, i.__step]
}))
: t
}
;(i.min = f.compose(r, i.min)), (i.max = f.compose(r, i.max))
} else
i instanceof o
? (p.bind(t, 'click', function () {
p.fakeEvent(i.__checkbox, 'click')
}),
p.bind(i.__checkbox, 'click', function (e) {
e.stopPropagation()
}))
: i instanceof a
? (p.bind(t, 'click', function () {
p.fakeEvent(i.__button, 'click')
}),
p.bind(t, 'mouseover', function () {
p.addClass(i.__button, 'hover')
}),
p.bind(t, 'mouseout', function () {
p.removeClass(i.__button, 'hover')
}))
: i instanceof h &&
(p.addClass(t, 'color'),
(i.updateDisplay = f.compose(function (e) {
return (t.style.borderLeftColor = i.__color.toString()), e
}, i.updateDisplay)),
i.updateDisplay())
i.setValue = f.compose(function (t) {
return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0), t
}, i.setValue)
}
function A(e, t) {
var i = e.getRoot(),
n = i.__rememberedObjects.indexOf(t.object)
if (n != -1) {
var r = i.__rememberedObjectIndecesToControllers[n]
if ((void 0 === r && ((r = {}), (i.__rememberedObjectIndecesToControllers[n] = r)), (r[t.property] = t), i.load && i.load.remembered)) {
var o,
a = i.load.remembered
if (a[e.preset]) o = a[e.preset]
else {
if (!a[L]) return
o = a[L]
}
if (o[n] && void 0 !== o[n][t.property]) {
var s = o[n][t.property]
;(t.initialValue = s), t.setValue(s)
}
}
}
}
function y(e, t) {
return document.location.href + '.' + t
}
function C(e) {
var t = (e.__save_row = document.createElement('li'))
p.addClass(e.domElement, 'has-save'), e.__ul.insertBefore(t, e.__ul.firstChild), p.addClass(t, 'save-row')
var i = document.createElement('span')
;(i.innerHTML = ' '), p.addClass(i, 'button gears')
var n = document.createElement('span')
;(n.innerHTML = 'Save'), p.addClass(n, 'button'), p.addClass(n, 'save')
var r = document.createElement('span')
;(r.innerHTML = 'New'), p.addClass(r, 'button'), p.addClass(r, 'save-as')
var o = document.createElement('span')
;(o.innerHTML = 'Revert'), p.addClass(o, 'button'), p.addClass(o, 'revert')
var a = (e.__preset_select = document.createElement('select'))
if (
(e.load && e.load.remembered
? f.each(e.load.remembered, function (t, i) {
w(e, i, i == e.preset)
})
: w(e, L, !1),
p.bind(a, 'change', function () {
for (var t = 0; t < e.__preset_select.length; t++) e.__preset_select[t].innerHTML = e.__preset_select[t].value
e.preset = this.value
}),
t.appendChild(a),
t.appendChild(i),
t.appendChild(n),
t.appendChild(r),
t.appendChild(o),
D)
) {
var s = document.getElementById('dg-save-locally'),
l = document.getElementById('dg-local-explain')
s.style.display = 'block'
var c = document.getElementById('dg-local-storage')
'true' === localStorage.getItem(y(e, 'isLocal')) && c.setAttribute('checked', 'checked')
var h = function () {
l.style.display = e.useLocalStorage ? 'block' : 'none'
}
h(),
p.bind(c, 'change', function () {
;(e.useLocalStorage = !e.useLocalStorage), h()
})
}
var u = document.getElementById('dg-new-constructor')
p.bind(u, 'keydown', function (e) {
!e.metaKey || (67 !== e.which && 67 != e.keyCode) || S.hide()
}),
p.bind(i, 'click', function () {
;(u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2)), S.show(), u.focus(), u.select()
}),
p.bind(n, 'click', function () {
e.save()
}),
p.bind(r, 'click', function () {
var t = prompt('Enter a new preset name.')
t && e.saveAs(t)
}),
p.bind(o, 'click', function () {
e.revert()
})
}
function I(e) {
function t(t) {
return t.preventDefault(), (r = t.clientX), p.addClass(e.__closeButton, V.CLASS_DRAG), p.bind(window, 'mousemove', i), p.bind(window, 'mouseup', n), !1
}
function i(t) {
return t.preventDefault(), (e.width += r - t.clientX), e.onResize(), (r = t.clientX), !1
}
function n() {
p.removeClass(e.__closeButton, V.CLASS_DRAG), p.unbind(window, 'mousemove', i), p.unbind(window, 'mouseup', n)
}
;(e.__resize_handle = document.createElement('div')),
f.extend(e.__resize_handle.style, {
width: '6px',
marginLeft: '-3px',
height: '200px',
cursor: 'ew-resize',
position: 'absolute'
})
var r
p.bind(e.__resize_handle, 'mousedown', t), p.bind(e.__closeButton, 'mousedown', t), e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
}
function E(e, t) {
;(e.domElement.style.width = t + 'px'), e.__save_row && e.autoPlace && (e.__save_row.style.width = t + 'px'), e.__closeButton && (e.__closeButton.style.width = t + 'px')
}
function b(e, t) {
var i = {}
return (
f.each(e.__rememberedObjects, function (n, r) {
var o = {},
a = e.__rememberedObjectIndecesToControllers[r]
f.each(a, function (e, i) {
o[i] = t ? e.initialValue : e.getValue()
}),
(i[r] = o)
}),
i
)
}
function w(e, t, i) {
var n = document.createElement('option')
;(n.innerHTML = t), (n.value = t), e.__preset_select.appendChild(n), i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
}
function _(e) {
for (var t = 0; t < e.__preset_select.length; t++) e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
}
function T(e, t) {
var i = e.__preset_select[e.__preset_select.selectedIndex]
t ? (i.innerHTML = i.value + '*') : (i.innerHTML = i.value)
}
function x(e) {
0 != e.length &&
u(function () {
x(e)
}),
f.each(e, function (e) {
e.updateDisplay()
})
}
e.inject(i)
var S,
M,
R = 'dg',
P = 72,
O = 20,
L = 'Default',
D = (function () {
try {
return 'localStorage' in window && null !== window.localStorage
} catch (e) {
return !1
}
})(),
N = !0,
B = !1,
F = [],
V = function (e) {
function t() {
var e = i.getRoot()
;(e.width += 1),
f.defer(function () {
e.width -= 1
})
}
var i = this
;(this.domElement = document.createElement('div')),
(this.__ul = document.createElement('ul')),
this.domElement.appendChild(this.__ul),
p.addClass(this.domElement, R),
(this.__folders = {}),
(this.__controllers = []),
(this.__rememberedObjects = []),
(this.__rememberedObjectIndecesToControllers = []),
(this.__listening = []),
(e = e || {}),
(e = f.defaults(e, {
autoPlace: !0,
width: V.DEFAULT_WIDTH
})),
(e = f.defaults(e, {
resizable: e.autoPlace,
hideable: e.autoPlace
})),
f.isUndefined(e.load)
? (e.load = {
preset: L
})
: e.preset && (e.load.preset = e.preset),
f.isUndefined(e.parent) && e.hideable && F.push(this),
(e.resizable = f.isUndefined(e.parent) && e.resizable),
e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0)
var n,
r = D && 'true' === localStorage.getItem(y(this, 'isLocal'))
if (
(Object.defineProperties(this, {
parent: {
get: function () {
return e.parent
}
},
scrollable: {
get: function () {
return e.scrollable
}
},
autoPlace: {
get: function () {
return e.autoPlace
}
},
preset: {
get: function () {
return i.parent ? i.getRoot().preset : e.load.preset
},
set: function (t) {
i.parent ? (i.getRoot().preset = t) : (e.load.preset = t), _(this), i.revert()
}
},
width: {
get: function () {
return e.width
},
set: function (t) {
;(e.width = t), E(i, t)
}
},
name: {
get: function () {
return e.name
},
set: function (t) {
;(e.name = t), a && (a.innerHTML = e.name)
}
},
closed: {
get: function () {
return e.closed
},
set: function (t) {
;(e.closed = t),
e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
this.onResize(),
i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
}
},
load: {
get: function () {
return e.load
}
},
useLocalStorage: {
get: function () {
return r
},
set: function (e) {
D && ((r = e), e ? p.bind(window, 'unload', n) : p.unbind(window, 'unload', n), localStorage.setItem(y(i, 'isLocal'), e))
}
}
}),
f.isUndefined(e.parent))
) {
if (((e.closed = !1), p.addClass(this.domElement, V.CLASS_MAIN), p.makeSelectable(this.domElement, !1), D && r)) {
i.useLocalStorage = !0
var o = localStorage.getItem(y(this, 'gui'))
o && (e.load = JSON.parse(o))
}
;(this.__closeButton = document.createElement('div')),
(this.__closeButton.innerHTML = V.TEXT_CLOSED),
p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
this.domElement.appendChild(this.__closeButton),
p.bind(this.__closeButton, 'click', function () {
i.closed = !i.closed
})
} else {
void 0 === e.closed && (e.closed = !0)
var a = document.createTextNode(e.name)
p.addClass(a, 'controller-name')
var s = m(i, a),
l = function (e) {
return e.preventDefault(), (i.closed = !i.closed), !1
}
p.addClass(this.__ul, V.CLASS_CLOSED), p.addClass(s, 'title'), p.bind(s, 'click', l), e.closed || (this.closed = !1)
}
e.autoPlace &&
(f.isUndefined(e.parent) &&
(N && ((M = document.createElement('div')), p.addClass(M, R), p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER), document.body.appendChild(M), (N = !1)),
M.appendChild(this.domElement),
p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
this.parent || E(i, e.width)),
p.bind(window, 'resize', function () {
i.onResize()
}),
p.bind(this.__ul, 'webkitTransitionEnd', function () {
i.onResize()
}),
p.bind(this.__ul, 'transitionend', function () {
i.onResize()
}),
p.bind(this.__ul, 'oTransitionEnd', function () {
i.onResize()
}),
this.onResize(),
e.resizable && I(this),
(n = function () {
D && 'true' === localStorage.getItem(y(i, 'isLocal')) && localStorage.setItem(y(i, 'gui'), JSON.stringify(i.getSaveObject()))
}),
(this.saveToLocalStorageIfPossible = n)
i.getRoot()
e.parent || t()
}
return (
(V.toggleHide = function () {
;(B = !B),
f.each(F, function (e) {
;(e.domElement.style.zIndex = B ? -999 : 999), (e.domElement.style.opacity = B ? 0 : 1)
})
}),
(V.CLASS_AUTO_PLACE = 'a'),
(V.CLASS_AUTO_PLACE_CONTAINER = 'ac'),
(V.CLASS_MAIN = 'main'),
(V.CLASS_CONTROLLER_ROW = 'cr'),
(V.CLASS_TOO_TALL = 'taller-than-window'),
(V.CLASS_CLOSED = 'closed'),
(V.CLASS_CLOSE_BUTTON = 'close-button'),
(V.CLASS_DRAG = 'drag'),
(V.DEFAULT_WIDTH = 245),
(V.TEXT_CLOSED = 'Close Controls'),
(V.TEXT_OPEN = 'Open Controls'),
p.bind(
window,
'keydown',
function (e) {
'text' === document.activeElement.type || (e.which !== P && e.keyCode != P) || V.toggleHide()
},
!1
),
f.extend(V.prototype, {
add: function (e, t) {
return g(this, e, t, {
factoryArgs: Array.prototype.slice.call(arguments, 2)
})
},
addColor: function (e, t) {
return g(this, e, t, {
color: !0
})
},
remove: function (e) {
this.__ul.removeChild(e.__li), this.__controllers.slice(this.__controllers.indexOf(e), 1)
var t = this
f.defer(function () {
t.onResize()
})
},
destroy: function () {
this.autoPlace && M.removeChild(this.domElement)
},
addFolder: function (e) {
if (void 0 !== this.__folders[e]) throw new Error('You already have a folder in this GUI by the name "' + e + '"')
var t = {
name: e,
parent: this
}
;(t.autoPlace = this.autoPlace), this.load && this.load.folders && this.load.folders[e] && ((t.closed = this.load.folders[e].closed), (t.load = this.load.folders[e]))
var i = new V(t)
this.__folders[e] = i
var n = m(this, i.domElement)
return p.addClass(n, 'folder'), i
},
open: function () {
this.closed = !1
},
close: function () {
this.closed = !0
},
onResize: function () {
var e = this.getRoot()
if (e.scrollable) {
var t = p.getOffset(e.__ul).top,
i = 0
f.each(e.__ul.childNodes, function (t) {
;(e.autoPlace && t === e.__save_row) || (i += p.getHeight(t))
}),
$('#player').height() - t - O < i
? (p.addClass(e.domElement, V.CLASS_TOO_TALL), (e.__ul.style.height = $('#player').height() - t - O + 'px'))
: (p.removeClass(e.domElement, V.CLASS_TOO_TALL), (e.__ul.style.height = 'auto'))
}
e.__resize_handle &&
f.defer(function () {
e.__resize_handle.style.height = e.__ul.offsetHeight + 'px'
}),
e.__closeButton && (e.__closeButton.style.width = e.width + 'px')
},
remember: function () {
if ((f.isUndefined(S) && ((S = new d()), (S.domElement.innerHTML = t)), this.parent)) throw new Error('You can only call remember on a top level GUI.')
var e = this
f.each(Array.prototype.slice.call(arguments), function (t) {
0 == e.__rememberedObjects.length && C(e), e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
}),
this.autoPlace && E(this, this.width)
},
getRoot: function () {
for (var e = this; e.parent; ) e = e.parent
return e
},
getSaveObject: function () {
var e = this.load
return (
(e.closed = this.closed),
this.__rememberedObjects.length > 0 && ((e.preset = this.preset), e.remembered || (e.remembered = {}), (e.remembered[this.preset] = b(this))),
(e.folders = {}),
f.each(this.__folders, function (t, i) {
e.folders[i] = t.getSaveObject()
}),
e
)
},
save: function () {
this.load.remembered || (this.load.remembered = {}), (this.load.remembered[this.preset] = b(this)), T(this, !1), this.saveToLocalStorageIfPossible()
},
saveAs: function (e) {
this.load.remembered || ((this.load.remembered = {}), (this.load.remembered[L] = b(this, !0))),
(this.load.remembered[e] = b(this)),
(this.preset = e),
w(this, e, !0),
this.saveToLocalStorageIfPossible()
},
revert: function (e) {
f.each(
this.__controllers,
function (t) {
this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
},
this
),
f.each(this.__folders, function (e) {
e.revert(e)
}),
e || T(this.getRoot(), !1)
},
listen: function (e) {
var t = 0 == this.__listening.length
this.__listening.push(e), t && x(this.__listening)
}
}),
V
)
})(
n.utils.css,
'
\n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n
\n\n Automatically save\n values to localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n \n