",
options: {
disabled: !1,
create: null
},
_createWidget: function (e, i) {
i = t(i || this.defaultElement || this)[0], this.element = t(i), this.uuid = s++, this.eventNamespace = "." + this.widgetName + this.uuid, this.bindings = t(), this.hoverable = t(), this.focusable = t(), i !== this && (t.data(i, this.widgetFullName, this), this._on(!0, this.element, {
remove: function (t) {
t.target === i && this.destroy()
}
}), this.document = t(i.style ? i.ownerDocument : i.document || i), this.window = t(this.document[0].defaultView || this.document[0].parentWindow)), this.options = t.widget.extend({}, this.options, this._getCreateOptions(), e), this._create(), this._trigger("create", null, this._getCreateEventData()), this._init()
},
_getCreateOptions: t.noop,
_getCreateEventData: t.noop,
_create: t.noop,
_init: t.noop,
destroy: function () {
this._destroy(), this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)), this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName + "-disabled ui-state-disabled"), this.bindings.unbind(this.eventNamespace), this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus")
},
_destroy: t.noop,
widget: function () {
return this.element
},
option: function (e, i) {
var s, n, o, a = e;
if (0 === arguments.length) return t.widget.extend({}, this.options);
if ("string" == typeof e)
if (a = {}, s = e.split("."), e = s.shift(), s.length) {
for (n = a[e] = t.widget.extend({}, this.options[e]), o = 0; o < s.length - 1; o++) n[s[o]] = n[s[o]] || {}, n = n[s[o]];
if (e = s.pop(), 1 === arguments.length) return void 0 === n[e] ? null : n[e];
n[e] = i
} else {
if (1 === arguments.length) return void 0 === this.options[e] ? null : this.options[e];
a[e] = i
}
return this._setOptions(a), this
},
_setOptions: function (t) {
var e;
for (e in t) this._setOption(e, t[e]);
return this
},
_setOption: function (t, e) {
return this.options[t] = e, "disabled" === t && (this.widget().toggleClass(this.widgetFullName + "-disabled", !!e), e && (this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus"))), this
},
enable: function () {
return this._setOptions({
disabled: !1
})
},
disable: function () {
return this._setOptions({
disabled: !0
})
},
_on: function (e, i, s) {
var n, o = this;
"boolean" != typeof e && (s = i, i = e, e = !1), s ? (i = n = t(i), this.bindings = this.bindings.add(i)) : (s = i, i = this.element, n = this.widget()), t.each(s, function (s, a) {
function r() {
if (e || o.options.disabled !== !0 && !t(this).hasClass("ui-state-disabled")) return ("string" == typeof a ? o[a] : a).apply(o, arguments)
}
"string" != typeof a && (r.guid = a.guid = a.guid || r.guid || t.guid++);
var l = s.match(/^([\w:-]*)\s*(.*)$/),
h = l[1] + o.eventNamespace,
c = l[2];
c ? n.delegate(c, h, r) : i.bind(h, r)
})
},
_off: function (e, i) {
i = (i || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace, e.unbind(i).undelegate(i), this.bindings = t(this.bindings.not(e).get()), this.focusable = t(this.focusable.not(e).get()), this.hoverable = t(this.hoverable.not(e).get())
},
_delay: function (t, e) {
function i() {
return ("string" == typeof t ? s[t] : t).apply(s, arguments)
}
var s = this;
return setTimeout(i, e || 0)
},
_hoverable: function (e) {
this.hoverable = this.hoverable.add(e), this._on(e, {
mouseenter: function (e) {
t(e.currentTarget).addClass("ui-state-hover")
},
mouseleave: function (e) {
t(e.currentTarget).removeClass("ui-state-hover")
}
})
},
_focusable: function (e) {
this.focusable = this.focusable.add(e), this._on(e, {
focusin: function (e) {
t(e.currentTarget).addClass("ui-state-focus")
},
focusout: function (e) {
t(e.currentTarget).removeClass("ui-state-focus")
}
})
},
_trigger: function (e, i, s) {
var n, o, a = this.options[e];
if (s = s || {}, i = t.Event(i), i.type = (e === this.widgetEventPrefix ? e : this.widgetEventPrefix + e).toLowerCase(), i.target = this.element[0], o = i.originalEvent)
for (n in o) n in i || (i[n] = o[n]);
return this.element.trigger(i, s), !(t.isFunction(a) && a.apply(this.element[0], [i].concat(s)) === !1 || i.isDefaultPrevented())
}
}, t.each({
show: "fadeIn",
hide: "fadeOut"
}, function (e, i) {
t.Widget.prototype["_" + e] = function (s, n, o) {
"string" == typeof n && (n = {
effect: n
});
var a, r = n ? n === !0 || "number" == typeof n ? i : n.effect || i : e;
n = n || {}, "number" == typeof n && (n = {
duration: n
}), a = !t.isEmptyObject(n), n.complete = o, n.delay && s.delay(n.delay), a && t.effects && t.effects.effect[r] ? s[e](n) : r !== e && s[r] ? s[r](n.duration, n.easing, o) : s.queue(function (i) {
t(this)[e](), o && o.call(s[0]), i()
})
}
});
var o = (t.widget, !1);
t(document).mouseup(function () {
o = !1
});
t.widget("ui.mouse", {
version: "1.11.3",
options: {
cancel: "input,textarea,button,select,option",
distance: 1,
delay: 0
},
_mouseInit: function () {
var e = this;
this.element.bind("mousedown." + this.widgetName, function (t) {
return e._mouseDown(t)
}).bind("click." + this.widgetName, function (i) {
if (!0 === t.data(i.target, e.widgetName + ".preventClickEvent")) return t.removeData(i.target, e.widgetName + ".preventClickEvent"), i.stopImmediatePropagation(), !1
}), this.started = !1
},
_mouseDestroy: function () {
this.element.unbind("." + this.widgetName), this._mouseMoveDelegate && this.document.unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate)
},
_mouseDown: function (e) {
if (!o) {
this._mouseMoved = !1, this._mouseStarted && this._mouseUp(e), this._mouseDownEvent = e;
var i = this,
s = 1 === e.which,
n = !("string" != typeof this.options.cancel || !e.target.nodeName) && t(e.target).closest(this.options.cancel).length;
return !(s && !n && this._mouseCapture(e)) || (this.mouseDelayMet = !this.options.delay, this.mouseDelayMet || (this._mouseDelayTimer = setTimeout(function () {
i.mouseDelayMet = !0
}, this.options.delay)), this._mouseDistanceMet(e) && this._mouseDelayMet(e) && (this._mouseStarted = this._mouseStart(e) !== !1, !this._mouseStarted) ? (e.preventDefault(), !0) : (!0 === t.data(e.target, this.widgetName + ".preventClickEvent") && t.removeData(e.target, this.widgetName + ".preventClickEvent"), this._mouseMoveDelegate = function (t) {
return i._mouseMove(t)
}, this._mouseUpDelegate = function (t) {
return i._mouseUp(t)
}, this.document.bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate), e.preventDefault(), o = !0, !0))
}
},
_mouseMove: function (e) {
if (this._mouseMoved) {
if (t.ui.ie && (!document.documentMode || document.documentMode < 9) && !e.button) return this._mouseUp(e);
if (!e.which) return this._mouseUp(e)
}
return (e.which || e.button) && (this._mouseMoved = !0), this._mouseStarted ? (this._mouseDrag(e), e.preventDefault()) : (this._mouseDistanceMet(e) && this._mouseDelayMet(e) && (this._mouseStarted = this._mouseStart(this._mouseDownEvent, e) !== !1, this._mouseStarted ? this._mouseDrag(e) : this._mouseUp(e)), !this._mouseStarted)
},
_mouseUp: function (e) {
return this.document.unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate), this._mouseStarted && (this._mouseStarted = !1, e.target === this._mouseDownEvent.target && t.data(e.target, this.widgetName + ".preventClickEvent", !0), this._mouseStop(e)), o = !1, !1
},
_mouseDistanceMet: function (t) {
return Math.max(Math.abs(this._mouseDownEvent.pageX - t.pageX), Math.abs(this._mouseDownEvent.pageY - t.pageY)) >= this.options.distance
},
_mouseDelayMet: function () {
return this.mouseDelayMet
},
_mouseStart: function () { },
_mouseDrag: function () { },
_mouseStop: function () { },
_mouseCapture: function () {
return !0
}
});
! function () {
function e(t, e, i) {
return [parseFloat(t[0]) * (u.test(t[0]) ? e / 100 : 1), parseFloat(t[1]) * (u.test(t[1]) ? i / 100 : 1)]
}
function i(e, i) {
return parseInt(t.css(e, i), 10) || 0
}
function s(e) {
var i = e[0];
return 9 === i.nodeType ? {
width: e.width(),
height: e.height(),
offset: {
top: 0,
left: 0
}
} : t.isWindow(i) ? {
width: e.width(),
height: e.height(),
offset: {
top: e.scrollTop(),
left: e.scrollLeft()
}
} : i.preventDefault ? {
width: 0,
height: 0,
offset: {
top: i.pageY,
left: i.pageX
}
} : {
width: e.outerWidth(),
height: e.outerHeight(),
offset: e.offset()
}
}
t.ui = t.ui || {};
var n, o, a = Math.max,
r = Math.abs,
l = Math.round,
h = /left|center|right/,
c = /top|center|bottom/,
p = /[\+\-]\d+(\.[\d]+)?%?/,
d = /^\w+/,
u = /%$/,
f = t.fn.position;
t.position = {
scrollbarWidth: function () {
if (void 0 !== n) return n;
var e, i, s = t("
"),
o = s.children()[0];
return t("body").append(s), e = o.offsetWidth, s.css("overflow", "scroll"), i = o.offsetWidth, e === i && (i = s[0].clientWidth), s.remove(), n = e - i
},
getScrollInfo: function (e) {
var i = e.isWindow || e.isDocument ? "" : e.element.css("overflow-x"),
s = e.isWindow || e.isDocument ? "" : e.element.css("overflow-y"),
n = "scroll" === i || "auto" === i && e.width < e.element[0].scrollWidth,
o = "scroll" === s || "auto" === s && e.height < e.element[0].scrollHeight;
return {
width: o ? t.position.scrollbarWidth() : 0,
height: n ? t.position.scrollbarWidth() : 0
}
},
getWithinInfo: function (e) {
var i = t(e || window),
s = t.isWindow(i[0]),
n = !!i[0] && 9 === i[0].nodeType;
return {
element: i,
isWindow: s,
isDocument: n,
offset: i.offset() || {
left: 0,
top: 0
},
scrollLeft: i.scrollLeft(),
scrollTop: i.scrollTop(),
width: s || n ? i.width() : i.outerWidth(),
height: s || n ? i.height() : i.outerHeight()
}
}
}, t.fn.position = function (n) {
if (!n || !n.of) return f.apply(this, arguments);
n = t.extend({}, n);
var u, g, m, v, w, b, _ = t(n.of),
y = t.position.getWithinInfo(n.within),
z = t.position.getScrollInfo(y),
P = (n.collision || "flip").split(" "),
x = {};
return b = s(_), _[0].preventDefault && (n.at = "left top"), g = b.width, m = b.height, v = b.offset, w = t.extend({}, v), t.each(["my", "at"], function () {
var t, e, i = (n[this] || "").split(" ");
1 === i.length && (i = h.test(i[0]) ? i.concat(["center"]) : c.test(i[0]) ? ["center"].concat(i) : ["center", "center"]), i[0] = h.test(i[0]) ? i[0] : "center", i[1] = c.test(i[1]) ? i[1] : "center", t = p.exec(i[0]), e = p.exec(i[1]), x[this] = [t ? t[0] : 0, e ? e[0] : 0], n[this] = [d.exec(i[0])[0], d.exec(i[1])[0]]
}), 1 === P.length && (P[1] = P[0]), "right" === n.at[0] ? w.left += g : "center" === n.at[0] && (w.left += g / 2), "bottom" === n.at[1] ? w.top += m : "center" === n.at[1] && (w.top += m / 2), u = e(x.at, g, m), w.left += u[0], w.top += u[1], this.each(function () {
var s, h, c = t(this),
p = c.outerWidth(),
d = c.outerHeight(),
f = i(this, "marginLeft"),
b = i(this, "marginTop"),
S = p + f + i(this, "marginRight") + z.width,
C = d + b + i(this, "marginBottom") + z.height,
I = t.extend({}, w),
N = e(x.my, c.outerWidth(), c.outerHeight());
"right" === n.my[0] ? I.left -= p : "center" === n.my[0] && (I.left -= p / 2), "bottom" === n.my[1] ? I.top -= d : "center" === n.my[1] && (I.top -= d / 2), I.left += N[0], I.top += N[1], o || (I.left = l(I.left), I.top = l(I.top)), s = {
marginLeft: f,
marginTop: b
}, t.each(["left", "top"], function (e, i) {
t.ui.position[P[e]] && t.ui.position[P[e]][i](I, {
targetWidth: g,
targetHeight: m,
elemWidth: p,
elemHeight: d,
collisionPosition: s,
collisionWidth: S,
collisionHeight: C,
offset: [u[0] + N[0], u[1] + N[1]],
my: n.my,
at: n.at,
within: y,
elem: c
})
}), n.using && (h = function (t) {
var e = v.left - I.left,
i = e + g - p,
s = v.top - I.top,
o = s + m - d,
l = {
target: {
element: _,
left: v.left,
top: v.top,
width: g,
height: m
},
element: {
element: c,
left: I.left,
top: I.top,
width: p,
height: d
},
horizontal: i < 0 ? "left" : e > 0 ? "right" : "center",
vertical: o < 0 ? "top" : s > 0 ? "bottom" : "middle"
};
g < p && r(e + i) < g && (l.horizontal = "center"), m < d && r(s + o) < m && (l.vertical = "middle"), a(r(e), r(i)) > a(r(s), r(o)) ? l.important = "horizontal" : l.important = "vertical", n.using.call(this, t, l)
}), c.offset(t.extend(I, {
using: h
}))
})
}, t.ui.position = {
fit: {
left: function (t, e) {
var i, s = e.within,
n = s.isWindow ? s.scrollLeft : s.offset.left,
o = s.width,
r = t.left - e.collisionPosition.marginLeft,
l = n - r,
h = r + e.collisionWidth - o - n;
e.collisionWidth > o ? l > 0 && h <= 0 ? (i = t.left + l + e.collisionWidth - o - n, t.left += l - i) : h > 0 && l <= 0 ? t.left = n : l > h ? t.left = n + o - e.collisionWidth : t.left = n : l > 0 ? t.left += l : h > 0 ? t.left -= h : t.left = a(t.left - r, t.left)
},
top: function (t, e) {
var i, s = e.within,
n = s.isWindow ? s.scrollTop : s.offset.top,
o = e.within.height,
r = t.top - e.collisionPosition.marginTop,
l = n - r,
h = r + e.collisionHeight - o - n;
e.collisionHeight > o ? l > 0 && h <= 0 ? (i = t.top + l + e.collisionHeight - o - n, t.top += l - i) : h > 0 && l <= 0 ? t.top = n : l > h ? t.top = n + o - e.collisionHeight : t.top = n : l > 0 ? t.top += l : h > 0 ? t.top -= h : t.top = a(t.top - r, t.top)
}
},
flip: {
left: function (t, e) {
var i, s, n = e.within,
o = n.offset.left + n.scrollLeft,
a = n.width,
l = n.isWindow ? n.scrollLeft : n.offset.left,
h = t.left - e.collisionPosition.marginLeft,
c = h - l,
p = h + e.collisionWidth - a - l,
d = "left" === e.my[0] ? -e.elemWidth : "right" === e.my[0] ? e.elemWidth : 0,
u = "left" === e.at[0] ? e.targetWidth : "right" === e.at[0] ? -e.targetWidth : 0,
f = -2 * e.offset[0];
c < 0 ? (i = t.left + d + u + f + e.collisionWidth - a - o, (i < 0 || i < r(c)) && (t.left += d + u + f)) : p > 0 && (s = t.left - e.collisionPosition.marginLeft + d + u + f - l, (s > 0 || r(s) < p) && (t.left += d + u + f))
},
top: function (t, e) {
var i, s, n = e.within,
o = n.offset.top + n.scrollTop,
a = n.height,
l = n.isWindow ? n.scrollTop : n.offset.top,
h = t.top - e.collisionPosition.marginTop,
c = h - l,
p = h + e.collisionHeight - a - l,
d = "top" === e.my[1],
u = d ? -e.elemHeight : "bottom" === e.my[1] ? e.elemHeight : 0,
f = "top" === e.at[1] ? e.targetHeight : "bottom" === e.at[1] ? -e.targetHeight : 0,
g = -2 * e.offset[1];
c < 0 ? (s = t.top + u + f + g + e.collisionHeight - a - o, (s < 0 || s < r(c)) && (t.top += u + f + g)) : p > 0 && (i = t.top - e.collisionPosition.marginTop + u + f + g - l, (i > 0 || r(i) < p) && (t.top += u + f + g))
}
},
flipfit: {
left: function () {
t.ui.position.flip.left.apply(this, arguments), t.ui.position.fit.left.apply(this, arguments)
},
top: function () {
t.ui.position.flip.top.apply(this, arguments), t.ui.position.fit.top.apply(this, arguments)
}
}
},
function () {
var e, i, s, n, a, r = document.getElementsByTagName("body")[0],
l = document.createElement("div");
e = document.createElement(r ? "div" : "body"), s = {
visibility: "hidden",
width: 0,
height: 0,
border: 0,
margin: 0,
background: "none"
}, r && t.extend(s, {
position: "absolute",
left: "-1000px",
top: "-1000px"
});
for (a in s) e.style[a] = s[a];
e.appendChild(l), i = r || document.documentElement, i.insertBefore(e, i.firstChild), l.style.cssText = "position: absolute; left: 10.7432222px;", n = t(l).offset().left, o = n > 10 && n < 11, e.innerHTML = "", i.removeChild(e)
}()
}();
t.ui.position;
t.widget("ui.draggable", t.ui.mouse, {
version: "1.11.3",
widgetEventPrefix: "drag",
options: {
addClasses: !0,
appendTo: "parent",
axis: !1,
connectToSortable: !1,
containment: !1,
cursor: "auto",
cursorAt: !1,
grid: !1,
handle: !1,
helper: "original",
iframeFix: !1,
opacity: !1,
refreshPositions: !1,
revert: !1,
revertDuration: 500,
scope: "default",
scroll: !0,
scrollSensitivity: 20,
scrollSpeed: 20,
snap: !1,
snapMode: "both",
snapTolerance: 20,
stack: !1,
zIndex: !1,
drag: null,
start: null,
stop: null
},
_create: function () {
"original" === this.options.helper && this._setPositionRelative(), this.options.addClasses && this.element.addClass("ui-draggable"), this.options.disabled && this.element.addClass("ui-draggable-disabled"), this._setHandleClassName(), this._mouseInit()
},
_setOption: function (t, e) {
this._super(t, e), "handle" === t && (this._removeHandleClassName(), this._setHandleClassName())
},
_destroy: function () {
return (this.helper || this.element).is(".ui-draggable-dragging") ? void (this.destroyOnClear = !0) : (this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"), this._removeHandleClassName(), void this._mouseDestroy())
},
_mouseCapture: function (e) {
var i = this.options;
return this._blurActiveElement(e), !(this.helper || i.disabled || t(e.target).closest(".ui-resizable-handle").length > 0) && (this.handle = this._getHandle(e), !!this.handle && (this._blockFrames(i.iframeFix === !0 ? "iframe" : i.iframeFix), !0))
},
_blockFrames: function (e) {
this.iframeBlocks = this.document.find(e).map(function () {
var e = t(this);
return t("
").css("position", "absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]
})
},
_unblockFrames: function () {
this.iframeBlocks && (this.iframeBlocks.remove(), delete this.iframeBlocks)
},
_blurActiveElement: function (e) {
var i = this.document[0];
if (this.handleElement.is(e.target)) try {
i.activeElement && "body" !== i.activeElement.nodeName.toLowerCase() && t(i.activeElement).blur()
} catch (s) { }
},
_mouseStart: function (e) {
var i = this.options;
return this.helper = this._createHelper(e), this.helper.addClass("ui-draggable-dragging"), this._cacheHelperProportions(), t.ui.ddmanager && (t.ui.ddmanager.current = this), this._cacheMargins(), this.cssPosition = this.helper.css("position"), this.scrollParent = this.helper.scrollParent(!0), this.offsetParent = this.helper.offsetParent(), this.hasFixedAncestor = this.helper.parents().filter(function () {
return "fixed" === t(this).css("position")
}).length > 0, this.positionAbs = this.element.offset(), this._refreshOffsets(e), this.originalPosition = this.position = this._generatePosition(e, !1), this.originalPageX = e.pageX, this.originalPageY = e.pageY, i.cursorAt && this._adjustOffsetFromHelper(i.cursorAt), this._setContainment(), this._trigger("start", e) === !1 ? (this._clear(), !1) : (this._cacheHelperProportions(), t.ui.ddmanager && !i.dropBehaviour && t.ui.ddmanager.prepareOffsets(this, e), this._normalizeRightBottom(), this._mouseDrag(e, !0), t.ui.ddmanager && t.ui.ddmanager.dragStart(this, e), !0)
},
_refreshOffsets: function (t) {
this.offset = {
top: this.positionAbs.top - this.margins.top,
left: this.positionAbs.left - this.margins.left,
scroll: !1,
parent: this._getParentOffset(),
relative: this._getRelativeOffset()
}, this.offset.click = {
left: t.pageX - this.offset.left,
top: t.pageY - this.offset.top
}
},
_mouseDrag: function (e, i) {
if (this.hasFixedAncestor && (this.offset.parent = this._getParentOffset()), this.position = this._generatePosition(e, !0), this.positionAbs = this._convertPositionTo("absolute"), !i) {
var s = this._uiHash();
if (this._trigger("drag", e, s) === !1) return this._mouseUp({}), !1;
this.position = s.position
}
return this.helper[0].style.left = this.position.left + "px", this.helper[0].style.top = this.position.top + "px", t.ui.ddmanager && t.ui.ddmanager.drag(this, e), !1
},
_mouseStop: function (e) {
var i = this,
s = !1;
return t.ui.ddmanager && !this.options.dropBehaviour && (s = t.ui.ddmanager.drop(this, e)), this.dropped && (s = this.dropped, this.dropped = !1), "invalid" === this.options.revert && !s || "valid" === this.options.revert && s || this.options.revert === !0 || t.isFunction(this.options.revert) && this.options.revert.call(this.element, s) ? t(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function () {
i._trigger("stop", e) !== !1 && i._clear()
}) : this._trigger("stop", e) !== !1 && this._clear(), !1
},
_mouseUp: function (e) {
return this._unblockFrames(), t.ui.ddmanager && t.ui.ddmanager.dragStop(this, e), this.handleElement.is(e.target) && this.element.focus(), t.ui.mouse.prototype._mouseUp.call(this, e)
},
cancel: function () {
return this.helper.is(".ui-draggable-dragging") ? this._mouseUp({}) : this._clear(), this
},
_getHandle: function (e) {
return !this.options.handle || !!t(e.target).closest(this.element.find(this.options.handle)).length
},
_setHandleClassName: function () {
this.handleElement = this.options.handle ? this.element.find(this.options.handle) : this.element, this.handleElement.addClass("ui-draggable-handle")
},
_removeHandleClassName: function () {
this.handleElement.removeClass("ui-draggable-handle")
},
_createHelper: function (e) {
var i = this.options,
s = t.isFunction(i.helper),
n = s ? t(i.helper.apply(this.element[0], [e])) : "clone" === i.helper ? this.element.clone().removeAttr("id") : this.element;
return n.parents("body").length || n.appendTo("parent" === i.appendTo ? this.element[0].parentNode : i.appendTo), s && n[0] === this.element[0] && this._setPositionRelative(), n[0] === this.element[0] || /(fixed|absolute)/.test(n.css("position")) || n.css("position", "absolute"), n
},
_setPositionRelative: function () {
/^(?:r|a|f)/.test(this.element.css("position")) || (this.element[0].style.position = "relative")
},
_adjustOffsetFromHelper: function (e) {
"string" == typeof e && (e = e.split(" ")), t.isArray(e) && (e = {
left: +e[0],
top: +e[1] || 0
}), "left" in e && (this.offset.click.left = e.left + this.margins.left), "right" in e && (this.offset.click.left = this.helperProportions.width - e.right + this.margins.left), "top" in e && (this.offset.click.top = e.top + this.margins.top), "bottom" in e && (this.offset.click.top = this.helperProportions.height - e.bottom + this.margins.top)
},
_isRootNode: function (t) {
return /(html|body)/i.test(t.tagName) || t === this.document[0]
},
_getParentOffset: function () {
var e = this.offsetParent.offset(),
i = this.document[0];
return "absolute" === this.cssPosition && this.scrollParent[0] !== i && t.contains(this.scrollParent[0], this.offsetParent[0]) && (e.left += this.scrollParent.scrollLeft(), e.top += this.scrollParent.scrollTop()), this._isRootNode(this.offsetParent[0]) && (e = {
top: 0,
left: 0
}), {
top: e.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
left: e.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
}
},
_getRelativeOffset: function () {
if ("relative" !== this.cssPosition) return {
top: 0,
left: 0
};
var t = this.element.position(),
e = this._isRootNode(this.scrollParent[0]);
return {
top: t.top - (parseInt(this.helper.css("top"), 10) || 0) + (e ? 0 : this.scrollParent.scrollTop()),
left: t.left - (parseInt(this.helper.css("left"), 10) || 0) + (e ? 0 : this.scrollParent.scrollLeft())
}
},
_cacheMargins: function () {
this.margins = {
left: parseInt(this.element.css("marginLeft"), 10) || 0,
top: parseInt(this.element.css("marginTop"), 10) || 0,
right: parseInt(this.element.css("marginRight"), 10) || 0,
bottom: parseInt(this.element.css("marginBottom"), 10) || 0
}
},
_cacheHelperProportions: function () {
this.helperProportions = {
width: this.helper.outerWidth(),
height: this.helper.outerHeight()
}
},
_setContainment: function () {
var e, i, s, n = this.options,
o = this.document[0];
return this.relativeContainer = null, n.containment ? "window" === n.containment ? void (this.containment = [t(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, t(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, t(window).scrollLeft() + t(window).width() - this.helperProportions.width - this.margins.left, t(window).scrollTop() + (t(window).height() || o.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]) : "document" === n.containment ? void (this.containment = [0, 0, t(o).width() - this.helperProportions.width - this.margins.left, (t(o).height() || o.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]) : n.containment.constructor === Array ? void (this.containment = n.containment) : ("parent" === n.containment && (n.containment = this.helper[0].parentNode), i = t(n.containment), s = i[0], void (s && (e = /(scroll|auto)/.test(i.css("overflow")), this.containment = [(parseInt(i.css("borderLeftWidth"), 10) || 0) + (parseInt(i.css("paddingLeft"), 10) || 0), (parseInt(i.css("borderTopWidth"), 10) || 0) + (parseInt(i.css("paddingTop"), 10) || 0), (e ? Math.max(s.scrollWidth, s.offsetWidth) : s.offsetWidth) - (parseInt(i.css("borderRightWidth"), 10) || 0) - (parseInt(i.css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (e ? Math.max(s.scrollHeight, s.offsetHeight) : s.offsetHeight) - (parseInt(i.css("borderBottomWidth"), 10) || 0) - (parseInt(i.css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom], this.relativeContainer = i))) : void (this.containment = null)
},
_convertPositionTo: function (t, e) {
e || (e = this.position);
var i = "absolute" === t ? 1 : -1,
s = this._isRootNode(this.scrollParent[0]);
return {
top: e.top + this.offset.relative.top * i + this.offset.parent.top * i - ("fixed" === this.cssPosition ? -this.offset.scroll.top : s ? 0 : this.offset.scroll.top) * i,
left: e.left + this.offset.relative.left * i + this.offset.parent.left * i - ("fixed" === this.cssPosition ? -this.offset.scroll.left : s ? 0 : this.offset.scroll.left) * i
}
},
_generatePosition: function (t, e) {
var i, s, n, o, a = this.options,
r = this._isRootNode(this.scrollParent[0]),
l = t.pageX,
h = t.pageY;
return r && this.offset.scroll || (this.offset.scroll = {
top: this.scrollParent.scrollTop(),
left: this.scrollParent.scrollLeft()
}), e && (this.containment && (this.relativeContainer ? (s = this.relativeContainer.offset(), i = [this.containment[0] + s.left, this.containment[1] + s.top, this.containment[2] + s.left, this.containment[3] + s.top]) : i = this.containment, t.pageX - this.offset.click.left < i[0] && (l = i[0] + this.offset.click.left), t.pageY - this.offset.click.top < i[1] && (h = i[1] + this.offset.click.top), t.pageX - this.offset.click.left > i[2] && (l = i[2] + this.offset.click.left), t.pageY - this.offset.click.top > i[3] && (h = i[3] + this.offset.click.top)), a.grid && (n = a.grid[1] ? this.originalPageY + Math.round((h - this.originalPageY) / a.grid[1]) * a.grid[1] : this.originalPageY, h = i ? n - this.offset.click.top >= i[1] || n - this.offset.click.top > i[3] ? n : n - this.offset.click.top >= i[1] ? n - a.grid[1] : n + a.grid[1] : n, o = a.grid[0] ? this.originalPageX + Math.round((l - this.originalPageX) / a.grid[0]) * a.grid[0] : this.originalPageX, l = i ? o - this.offset.click.left >= i[0] || o - this.offset.click.left > i[2] ? o : o - this.offset.click.left >= i[0] ? o - a.grid[0] : o + a.grid[0] : o), "y" === a.axis && (l = this.originalPageX), "x" === a.axis && (h = this.originalPageY)), {
top: h - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + ("fixed" === this.cssPosition ? -this.offset.scroll.top : r ? 0 : this.offset.scroll.top),
left: l - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + ("fixed" === this.cssPosition ? -this.offset.scroll.left : r ? 0 : this.offset.scroll.left)
}
},
_clear: function () {
this.helper.removeClass("ui-draggable-dragging"), this.helper[0] === this.element[0] || this.cancelHelperRemoval || this.helper.remove(), this.helper = null, this.cancelHelperRemoval = !1, this.destroyOnClear && this.destroy()
},
_normalizeRightBottom: function () {
"y" !== this.options.axis && "auto" !== this.helper.css("right") && (this.helper.width(this.helper.width()), this.helper.css("right", "auto")), "x" !== this.options.axis && "auto" !== this.helper.css("bottom") && (this.helper.height(this.helper.height()), this.helper.css("bottom", "auto"))
},
_trigger: function (e, i, s) {
return s = s || this._uiHash(), t.ui.plugin.call(this, e, [i, s, this], !0), /^(drag|start|stop)/.test(e) && (this.positionAbs = this._convertPositionTo("absolute"), s.offset = this.positionAbs), t.Widget.prototype._trigger.call(this, e, i, s)
},
plugins: {},
_uiHash: function () {
return {
helper: this.helper,
position: this.position,
originalPosition: this.originalPosition,
offset: this.positionAbs
}
}
}), t.ui.plugin.add("draggable", "connectToSortable", {
start: function (e, i, s) {
var n = t.extend({}, i, {
item: s.element
});
s.sortables = [], t(s.options.connectToSortable).each(function () {
var i = t(this).sortable("instance");
i && !i.options.disabled && (s.sortables.push(i), i.refreshPositions(), i._trigger("activate", e, n))
})
},
stop: function (e, i, s) {
var n = t.extend({}, i, {
item: s.element
});
s.cancelHelperRemoval = !1, t.each(s.sortables, function () {
var t = this;
t.isOver ? (t.isOver = 0, s.cancelHelperRemoval = !0, t.cancelHelperRemoval = !1, t._storedCSS = {
position: t.placeholder.css("position"),
top: t.placeholder.css("top"),
left: t.placeholder.css("left")
}, t._mouseStop(e), t.options.helper = t.options._helper) : (t.cancelHelperRemoval = !0, t._trigger("deactivate", e, n))
})
},
drag: function (e, i, s) {
t.each(s.sortables, function () {
var n = !1,
o = this;
o.positionAbs = s.positionAbs, o.helperProportions = s.helperProportions, o.offset.click = s.offset.click, o._intersectsWith(o.containerCache) && (n = !0, t.each(s.sortables, function () {
return this.positionAbs = s.positionAbs, this.helperProportions = s.helperProportions, this.offset.click = s.offset.click, this !== o && this._intersectsWith(this.containerCache) && t.contains(o.element[0], this.element[0]) && (n = !1), n
})), n ? (o.isOver || (o.isOver = 1, o.currentItem = i.helper.appendTo(o.element).data("ui-sortable-item", !0), o.options._helper = o.options.helper, o.options.helper = function () {
return i.helper[0]
}, e.target = o.currentItem[0], o._mouseCapture(e, !0), o._mouseStart(e, !0, !0), o.offset.click.top = s.offset.click.top, o.offset.click.left = s.offset.click.left, o.offset.parent.left -= s.offset.parent.left - o.offset.parent.left, o.offset.parent.top -= s.offset.parent.top - o.offset.parent.top, s._trigger("toSortable", e), s.dropped = o.element, t.each(s.sortables, function () {
this.refreshPositions()
}), s.currentItem = s.element, o.fromOutside = s), o.currentItem && (o._mouseDrag(e), i.position = o.position)) : o.isOver && (o.isOver = 0, o.cancelHelperRemoval = !0, o.options._revert = o.options.revert, o.options.revert = !1, o._trigger("out", e, o._uiHash(o)), o._mouseStop(e, !0), o.options.revert = o.options._revert, o.options.helper = o.options._helper, o.placeholder && o.placeholder.remove(), s._refreshOffsets(e), i.position = s._generatePosition(e, !0), s._trigger("fromSortable", e), s.dropped = !1, t.each(s.sortables, function () {
this.refreshPositions()
}))
})
}
}), t.ui.plugin.add("draggable", "cursor", {
start: function (e, i, s) {
var n = t("body"),
o = s.options;
n.css("cursor") && (o._cursor = n.css("cursor")), n.css("cursor", o.cursor)
},
stop: function (e, i, s) {
var n = s.options;
n._cursor && t("body").css("cursor", n._cursor)
}
}), t.ui.plugin.add("draggable", "opacity", {
start: function (e, i, s) {
var n = t(i.helper),
o = s.options;
n.css("opacity") && (o._opacity = n.css("opacity")), n.css("opacity", o.opacity)
},
stop: function (e, i, s) {
var n = s.options;
n._opacity && t(i.helper).css("opacity", n._opacity)
}
}), t.ui.plugin.add("draggable", "scroll", {
start: function (t, e, i) {
i.scrollParentNotHidden || (i.scrollParentNotHidden = i.helper.scrollParent(!1)), i.scrollParentNotHidden[0] !== i.document[0] && "HTML" !== i.scrollParentNotHidden[0].tagName && (i.overflowOffset = i.scrollParentNotHidden.offset())
},
drag: function (e, i, s) {
var n = s.options,
o = !1,
a = s.scrollParentNotHidden[0],
r = s.document[0];
a !== r && "HTML" !== a.tagName ? (n.axis && "x" === n.axis || (s.overflowOffset.top + a.offsetHeight - e.pageY < n.scrollSensitivity ? a.scrollTop = o = a.scrollTop + n.scrollSpeed : e.pageY - s.overflowOffset.top < n.scrollSensitivity && (a.scrollTop = o = a.scrollTop - n.scrollSpeed)), n.axis && "y" === n.axis || (s.overflowOffset.left + a.offsetWidth - e.pageX < n.scrollSensitivity ? a.scrollLeft = o = a.scrollLeft + n.scrollSpeed : e.pageX - s.overflowOffset.left < n.scrollSensitivity && (a.scrollLeft = o = a.scrollLeft - n.scrollSpeed))) : (n.axis && "x" === n.axis || (e.pageY - t(r).scrollTop() < n.scrollSensitivity ? o = t(r).scrollTop(t(r).scrollTop() - n.scrollSpeed) : t(window).height() - (e.pageY - t(r).scrollTop()) < n.scrollSensitivity && (o = t(r).scrollTop(t(r).scrollTop() + n.scrollSpeed))), n.axis && "y" === n.axis || (e.pageX - t(r).scrollLeft() < n.scrollSensitivity ? o = t(r).scrollLeft(t(r).scrollLeft() - n.scrollSpeed) : t(window).width() - (e.pageX - t(r).scrollLeft()) < n.scrollSensitivity && (o = t(r).scrollLeft(t(r).scrollLeft() + n.scrollSpeed)))), o !== !1 && t.ui.ddmanager && !n.dropBehaviour && t.ui.ddmanager.prepareOffsets(s, e)
}
}), t.ui.plugin.add("draggable", "snap", {
start: function (e, i, s) {
var n = s.options;
s.snapElements = [], t(n.snap.constructor !== String ? n.snap.items || ":data(ui-draggable)" : n.snap).each(function () {
var e = t(this),
i = e.offset();
this !== s.element[0] && s.snapElements.push({
item: this,
width: e.outerWidth(),
height: e.outerHeight(),
top: i.top,
left: i.left
})
})
},
drag: function (e, i, s) {
var n, o, a, r, l, h, c, p, d, u, f = s.options,
g = f.snapTolerance,
m = i.offset.left,
v = m + s.helperProportions.width,
w = i.offset.top,
b = w + s.helperProportions.height;
for (d = s.snapElements.length - 1; d >= 0; d--) l = s.snapElements[d].left - s.margins.left, h = l + s.snapElements[d].width, c = s.snapElements[d].top - s.margins.top, p = c + s.snapElements[d].height, v < l - g || m > h + g || b < c - g || w > p + g || !t.contains(s.snapElements[d].item.ownerDocument, s.snapElements[d].item) ? (s.snapElements[d].snapping && s.options.snap.release && s.options.snap.release.call(s.element, e, t.extend(s._uiHash(), {
snapItem: s.snapElements[d].item
})), s.snapElements[d].snapping = !1) : ("inner" !== f.snapMode && (n = Math.abs(c - b) <= g, o = Math.abs(p - w) <= g, a = Math.abs(l - v) <= g, r = Math.abs(h - m) <= g, n && (i.position.top = s._convertPositionTo("relative", {
top: c - s.helperProportions.height,
left: 0
}).top), o && (i.position.top = s._convertPositionTo("relative", {
top: p,
left: 0
}).top), a && (i.position.left = s._convertPositionTo("relative", {
top: 0,
left: l - s.helperProportions.width
}).left), r && (i.position.left = s._convertPositionTo("relative", {
top: 0,
left: h
}).left)), u = n || o || a || r, "outer" !== f.snapMode && (n = Math.abs(c - w) <= g, o = Math.abs(p - b) <= g, a = Math.abs(l - m) <= g, r = Math.abs(h - v) <= g, n && (i.position.top = s._convertPositionTo("relative", {
top: c,
left: 0
}).top), o && (i.position.top = s._convertPositionTo("relative", {
top: p - s.helperProportions.height,
left: 0
}).top), a && (i.position.left = s._convertPositionTo("relative", {
top: 0,
left: l
}).left), r && (i.position.left = s._convertPositionTo("relative", {
top: 0,
left: h - s.helperProportions.width
}).left)), !s.snapElements[d].snapping && (n || o || a || r || u) && s.options.snap.snap && s.options.snap.snap.call(s.element, e, t.extend(s._uiHash(), {
snapItem: s.snapElements[d].item
})), s.snapElements[d].snapping = n || o || a || r || u)
}
}), t.ui.plugin.add("draggable", "stack", {
start: function (e, i, s) {
var n, o = s.options,
a = t.makeArray(t(o.stack)).sort(function (e, i) {
return (parseInt(t(e).css("zIndex"), 10) || 0) - (parseInt(t(i).css("zIndex"), 10) || 0)
});
a.length && (n = parseInt(t(a[0]).css("zIndex"), 10) || 0, t(a).each(function (e) {
t(this).css("zIndex", n + e)
}), this.css("zIndex", n + a.length))
}
}), t.ui.plugin.add("draggable", "zIndex", {
start: function (e, i, s) {
var n = t(i.helper),
o = s.options;
n.css("zIndex") && (o._zIndex = n.css("zIndex")), n.css("zIndex", o.zIndex)
},
stop: function (e, i, s) {
var n = s.options;
n._zIndex && t(i.helper).css("zIndex", n._zIndex)
}
});
t.ui.draggable;
t.widget("ui.resizable", t.ui.mouse, {
version: "1.11.3",
widgetEventPrefix: "resize",
options: {
alsoResize: !1,
animate: !1,
animateDuration: "slow",
animateEasing: "swing",
aspectRatio: !1,
autoHide: !1,
containment: !1,
ghost: !1,
grid: !1,
handles: "e,s,se",
helper: !1,
maxHeight: null,
maxWidth: null,
minHeight: 10,
minWidth: 10,
zIndex: 90,
resize: null,
start: null,
stop: null
},
_num: function (t) {
return parseInt(t, 10) || 0
},
_isNumber: function (t) {
return !isNaN(parseInt(t, 10))
},
_hasScroll: function (e, i) {
if ("hidden" === t(e).css("overflow")) return !1;
var s = i && "left" === i ? "scrollLeft" : "scrollTop",
n = !1;
return e[s] > 0 || (e[s] = 1, n = e[s] > 0, e[s] = 0, n)
},
_create: function () {
var e, i, s, n, o, a = this,
r = this.options;
if (this.element.addClass("ui-resizable"), t.extend(this, {
_aspectRatio: !!r.aspectRatio,
aspectRatio: r.aspectRatio,
originalElement: this.element,
_proportionallyResizeElements: [],
_helper: r.helper || r.ghost || r.animate ? r.helper || "ui-resizable-helper" : null
}), this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i) && (this.element.wrap(t("
").css({
position: this.element.css("position"),
width: this.element.outerWidth(),
height: this.element.outerHeight(),
top: this.element.css("top"),
left: this.element.css("left")
})), this.element = this.element.parent().data("ui-resizable", this.element.resizable("instance")), this.elementIsWrapper = !0, this.element.css({
marginLeft: this.originalElement.css("marginLeft"),
marginTop: this.originalElement.css("marginTop"),
marginRight: this.originalElement.css("marginRight"),
marginBottom: this.originalElement.css("marginBottom")
}), this.originalElement.css({
marginLeft: 0,
marginTop: 0,
marginRight: 0,
marginBottom: 0
}), this.originalResizeStyle = this.originalElement.css("resize"), this.originalElement.css("resize", "none"), this._proportionallyResizeElements.push(this.originalElement.css({
position: "static",
zoom: 1,
display: "block"
})), this.originalElement.css({
margin: this.originalElement.css("margin")
}), this._proportionallyResize()), this.handles = r.handles || (t(".ui-resizable-handle", this.element).length ? {
n: ".ui-resizable-n",
e: ".ui-resizable-e",
s: ".ui-resizable-s",
w: ".ui-resizable-w",
se: ".ui-resizable-se",
sw: ".ui-resizable-sw",
ne: ".ui-resizable-ne",
nw: ".ui-resizable-nw"
} : "e,s,se"), this.handles.constructor === String)
for ("all" === this.handles && (this.handles = "n,e,s,w,se,sw,ne,nw"), e = this.handles.split(","), this.handles = {}, i = 0; i < e.length; i++) s = t.trim(e[i]), o = "ui-resizable-" + s, n = t("
"), n.css({
zIndex: r.zIndex
}), "se" === s && n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"), this.handles[s] = ".ui-resizable-" + s, this.element.append(n);
this._renderAxis = function (e) {
var i, s, n, o;
e = e || this.element;
for (i in this.handles) this.handles[i].constructor === String && (this.handles[i] = this.element.children(this.handles[i]).first().show()), this.elementIsWrapper && this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i) && (s = t(this.handles[i], this.element), o = /sw|ne|nw|se|n|s/.test(i) ? s.outerHeight() : s.outerWidth(), n = ["padding", /ne|nw|n/.test(i) ? "Top" : /se|sw|s/.test(i) ? "Bottom" : /^e$/.test(i) ? "Right" : "Left"].join(""), e.css(n, o), this._proportionallyResize()), t(this.handles[i]).length
}, this._renderAxis(this.element), this._handles = t(".ui-resizable-handle", this.element).disableSelection(), this._handles.mouseover(function () {
a.resizing || (this.className && (n = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)), a.axis = n && n[1] ? n[1] : "se")
}), r.autoHide && (this._handles.hide(), t(this.element).addClass("ui-resizable-autohide").mouseenter(function () {
r.disabled || (t(this).removeClass("ui-resizable-autohide"), a._handles.show())
}).mouseleave(function () {
r.disabled || a.resizing || (t(this).addClass("ui-resizable-autohide"), a._handles.hide())
})), this._mouseInit()
},
_destroy: function () {
this._mouseDestroy();
var e, i = function (e) {
t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()
};
return this.elementIsWrapper && (i(this.element), e = this.element, this.originalElement.css({
position: e.css("position"),
width: e.outerWidth(),
height: e.outerHeight(),
top: e.css("top"),
left: e.css("left")
}).insertAfter(e), e.remove()), this.originalElement.css("resize", this.originalResizeStyle), i(this.originalElement), this
},
_mouseCapture: function (e) {
var i, s, n = !1;
for (i in this.handles) s = t(this.handles[i])[0], (s === e.target || t.contains(s, e.target)) && (n = !0);
return !this.options.disabled && n
},
_mouseStart: function (e) {
var i, s, n, o = this.options,
a = this.element;
return this.resizing = !0, this._renderProxy(), i = this._num(this.helper.css("left")), s = this._num(this.helper.css("top")), o.containment && (i += t(o.containment).scrollLeft() || 0, s += t(o.containment).scrollTop() || 0), this.offset = this.helper.offset(), this.position = {
left: i,
top: s
}, this.size = this._helper ? {
width: this.helper.width(),
height: this.helper.height()
} : {
width: a.width(),
height: a.height()
}, this.originalSize = this._helper ? {
width: a.outerWidth(),
height: a.outerHeight()
} : {
width: a.width(),
height: a.height()
}, this.sizeDiff = {
width: a.outerWidth() - a.width(),
height: a.outerHeight() - a.height()
}, this.originalPosition = {
left: i,
top: s
}, this.originalMousePosition = {
left: e.pageX,
top: e.pageY
}, this.aspectRatio = "number" == typeof o.aspectRatio ? o.aspectRatio : this.originalSize.width / this.originalSize.height || 1, n = t(".ui-resizable-" + this.axis).css("cursor"), t("body").css("cursor", "auto" === n ? this.axis + "-resize" : n), a.addClass("ui-resizable-resizing"), this._propagate("start", e), !0
},
_mouseDrag: function (e) {
var i, s, n = this.originalMousePosition,
o = this.axis,
a = e.pageX - n.left || 0,
r = e.pageY - n.top || 0,
l = this._change[o];
return this._updatePrevProperties(), !!l && (i = l.apply(this, [e, a, r]), this._updateVirtualBoundaries(e.shiftKey), (this._aspectRatio || e.shiftKey) && (i = this._updateRatio(i, e)), i = this._respectSize(i, e), this._updateCache(i), this._propagate("resize", e), s = this._applyChanges(), !this._helper && this._proportionallyResizeElements.length && this._proportionallyResize(), t.isEmptyObject(s) || (this._updatePrevProperties(), this._trigger("resize", e, this.ui()), this._applyChanges()), !1)
},
_mouseStop: function (e) {
this.resizing = !1;
var i, s, n, o, a, r, l, h = this.options,
c = this;
return this._helper && (i = this._proportionallyResizeElements, s = i.length && /textarea/i.test(i[0].nodeName), n = s && this._hasScroll(i[0], "left") ? 0 : c.sizeDiff.height, o = s ? 0 : c.sizeDiff.width, a = {
width: c.helper.width() - o,
height: c.helper.height() - n
}, r = parseInt(c.element.css("left"), 10) + (c.position.left - c.originalPosition.left) || null, l = parseInt(c.element.css("top"), 10) + (c.position.top - c.originalPosition.top) || null, h.animate || this.element.css(t.extend(a, {
top: l,
left: r
})), c.helper.height(c.size.height), c.helper.width(c.size.width), this._helper && !h.animate && this._proportionallyResize()), t("body").css("cursor", "auto"), this.element.removeClass("ui-resizable-resizing"), this._propagate("stop", e), this._helper && this.helper.remove(), !1
},
_updatePrevProperties: function () {
this.prevPosition = {
top: this.position.top,
left: this.position.left
}, this.prevSize = {
width: this.size.width,
height: this.size.height
}
},
_applyChanges: function () {
var t = {};
return this.position.top !== this.prevPosition.top && (t.top = this.position.top + "px"), this.position.left !== this.prevPosition.left && (t.left = this.position.left + "px"), this.size.width !== this.prevSize.width && (t.width = this.size.width + "px"), this.size.height !== this.prevSize.height && (t.height = this.size.height + "px"), this.helper.css(t), t
},
_updateVirtualBoundaries: function (t) {
var e, i, s, n, o, a = this.options;
o = {
minWidth: this._isNumber(a.minWidth) ? a.minWidth : 0,
maxWidth: this._isNumber(a.maxWidth) ? a.maxWidth : 1 / 0,
minHeight: this._isNumber(a.minHeight) ? a.minHeight : 0,
maxHeight: this._isNumber(a.maxHeight) ? a.maxHeight : 1 / 0
}, (this._aspectRatio || t) && (e = o.minHeight * this.aspectRatio, s = o.minWidth / this.aspectRatio, i = o.maxHeight * this.aspectRatio, n = o.maxWidth / this.aspectRatio, e > o.minWidth && (o.minWidth = e), s > o.minHeight && (o.minHeight = s), i < o.maxWidth && (o.maxWidth = i), n < o.maxHeight && (o.maxHeight = n)), this._vBoundaries = o
},
_updateCache: function (t) {
this.offset = this.helper.offset(), this._isNumber(t.left) && (this.position.left = t.left), this._isNumber(t.top) && (this.position.top = t.top), this._isNumber(t.height) && (this.size.height = t.height), this._isNumber(t.width) && (this.size.width = t.width)
},
_updateRatio: function (t) {
var e = this.position,
i = this.size,
s = this.axis;
return this._isNumber(t.height) ? t.width = t.height * this.aspectRatio : this._isNumber(t.width) && (t.height = t.width / this.aspectRatio), "sw" === s && (t.left = e.left + (i.width - t.width), t.top = null), "nw" === s && (t.top = e.top + (i.height - t.height), t.left = e.left + (i.width - t.width)), t
},
_respectSize: function (t) {
var e = this._vBoundaries,
i = this.axis,
s = this._isNumber(t.width) && e.maxWidth && e.maxWidth < t.width,
n = this._isNumber(t.height) && e.maxHeight && e.maxHeight < t.height,
o = this._isNumber(t.width) && e.minWidth && e.minWidth > t.width,
a = this._isNumber(t.height) && e.minHeight && e.minHeight > t.height,
r = this.originalPosition.left + this.originalSize.width,
l = this.position.top + this.size.height,
h = /sw|nw|w/.test(i),
c = /nw|ne|n/.test(i);
return o && (t.width = e.minWidth), a && (t.height = e.minHeight), s && (t.width = e.maxWidth), n && (t.height = e.maxHeight), o && h && (t.left = r - e.minWidth), s && h && (t.left = r - e.maxWidth), a && c && (t.top = l - e.minHeight), n && c && (t.top = l - e.maxHeight), t.width || t.height || t.left || !t.top ? t.width || t.height || t.top || !t.left || (t.left = null) : t.top = null, t
},
_getPaddingPlusBorderDimensions: function (t) {
for (var e = 0, i = [], s = [t.css("borderTopWidth"), t.css("borderRightWidth"), t.css("borderBottomWidth"), t.css("borderLeftWidth")], n = [t.css("paddingTop"), t.css("paddingRight"), t.css("paddingBottom"), t.css("paddingLeft")]; e < 4; e++) i[e] = parseInt(s[e], 10) || 0, i[e] += parseInt(n[e], 10) || 0;
return {
height: i[0] + i[2],
width: i[1] + i[3]
}
},
_proportionallyResize: function () {
if (this._proportionallyResizeElements.length)
for (var t, e = 0, i = this.helper || this.element; e < this._proportionallyResizeElements.length; e++) t = this._proportionallyResizeElements[e], this.outerDimensions || (this.outerDimensions = this._getPaddingPlusBorderDimensions(t)), t.css({
height: i.height() - this.outerDimensions.height || 0,
width: i.width() - this.outerDimensions.width || 0
})
},
_renderProxy: function () {
var e = this.element,
i = this.options;
this.elementOffset = e.offset(), this._helper ? (this.helper = this.helper || t("
"), this.helper.addClass(this._helper).css({
width: this.element.outerWidth() - 1,
height: this.element.outerHeight() - 1,
position: "absolute",
left: this.elementOffset.left + "px",
top: this.elementOffset.top + "px",
zIndex: ++i.zIndex
}), this.helper.appendTo("body").disableSelection()) : this.helper = this.element
},
_change: {
e: function (t, e) {
return {
width: this.originalSize.width + e
}
},
w: function (t, e) {
var i = this.originalSize,
s = this.originalPosition;
return {
left: s.left + e,
width: i.width - e
}
},
n: function (t, e, i) {
var s = this.originalSize,
n = this.originalPosition;
return {
top: n.top + i,
height: s.height - i
}
},
s: function (t, e, i) {
return {
height: this.originalSize.height + i
}
},
se: function (e, i, s) {
return t.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [e, i, s]))
},
sw: function (e, i, s) {
return t.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [e, i, s]))
},
ne: function (e, i, s) {
return t.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [e, i, s]))
},
nw: function (e, i, s) {
return t.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [e, i, s]))
}
},
_propagate: function (e, i) {
t.ui.plugin.call(this, e, [i, this.ui()]), "resize" !== e && this._trigger(e, i, this.ui())
},
plugins: {},
ui: function () {
return {
originalElement: this.originalElement,
element: this.element,
helper: this.helper,
position: this.position,
size: this.size,
originalSize: this.originalSize,
originalPosition: this.originalPosition
}
}
}), t.ui.plugin.add("resizable", "animate", {
stop: function (e) {
var i = t(this).resizable("instance"),
s = i.options,
n = i._proportionallyResizeElements,
o = n.length && /textarea/i.test(n[0].nodeName),
a = o && i._hasScroll(n[0], "left") ? 0 : i.sizeDiff.height,
r = o ? 0 : i.sizeDiff.width,
l = {
width: i.size.width - r,
height: i.size.height - a
},
h = parseInt(i.element.css("left"), 10) + (i.position.left - i.originalPosition.left) || null,
c = parseInt(i.element.css("top"), 10) + (i.position.top - i.originalPosition.top) || null;
i.element.animate(t.extend(l, c && h ? {
top: c,
left: h
} : {}), {
duration: s.animateDuration,
easing: s.animateEasing,
step: function () {
var s = {
width: parseInt(i.element.css("width"), 10),
height: parseInt(i.element.css("height"), 10),
top: parseInt(i.element.css("top"), 10),
left: parseInt(i.element.css("left"), 10)
};
n && n.length && t(n[0]).css({
width: s.width,
height: s.height
}), i._updateCache(s), i._propagate("resize", e)
}
})
}
}), t.ui.plugin.add("resizable", "containment", {
start: function () {
var e, i, s, n, o, a, r, l = t(this).resizable("instance"),
h = l.options,
c = l.element,
p = h.containment,
d = p instanceof t ? p.get(0) : /parent/.test(p) ? c.parent().get(0) : p;
d && (l.containerElement = t(d), /document/.test(p) || p === document ? (l.containerOffset = {
left: 0,
top: 0
}, l.containerPosition = {
left: 0,
top: 0
}, l.parentData = {
element: t(document),
left: 0,
top: 0,
width: t(document).width(),
height: t(document).height() || document.body.parentNode.scrollHeight
}) : (e = t(d), i = [], t(["Top", "Right", "Left", "Bottom"]).each(function (t, s) {
i[t] = l._num(e.css("padding" + s))
}), l.containerOffset = e.offset(), l.containerPosition = e.position(), l.containerSize = {
height: e.innerHeight() - i[3],
width: e.innerWidth() - i[1]
}, s = l.containerOffset, n = l.containerSize.height, o = l.containerSize.width, a = l._hasScroll(d, "left") ? d.scrollWidth : o, r = l._hasScroll(d) ? d.scrollHeight : n, l.parentData = {
element: d,
left: s.left,
top: s.top,
width: a,
height: r
}))
},
resize: function (e) {
var i, s, n, o, a = t(this).resizable("instance"),
r = a.options,
l = a.containerOffset,
h = a.position,
c = a._aspectRatio || e.shiftKey,
p = {
top: 0,
left: 0
},
d = a.containerElement,
u = !0;
d[0] !== document && /static/.test(d.css("position")) && (p = l), h.left < (a._helper ? l.left : 0) && (a.size.width = a.size.width + (a._helper ? a.position.left - l.left : a.position.left - p.left), c && (a.size.height = a.size.width / a.aspectRatio, u = !1), a.position.left = r.helper ? l.left : 0), h.top < (a._helper ? l.top : 0) && (a.size.height = a.size.height + (a._helper ? a.position.top - l.top : a.position.top), c && (a.size.width = a.size.height * a.aspectRatio, u = !1), a.position.top = a._helper ? l.top : 0), n = a.containerElement.get(0) === a.element.parent().get(0), o = /relative|absolute/.test(a.containerElement.css("position")), n && o ? (a.offset.left = a.parentData.left + a.position.left, a.offset.top = a.parentData.top + a.position.top) : (a.offset.left = a.element.offset().left, a.offset.top = a.element.offset().top), i = Math.abs(a.sizeDiff.width + (a._helper ? a.offset.left - p.left : a.offset.left - l.left)), s = Math.abs(a.sizeDiff.height + (a._helper ? a.offset.top - p.top : a.offset.top - l.top)), i + a.size.width >= a.parentData.width && (a.size.width = a.parentData.width - i, c && (a.size.height = a.size.width / a.aspectRatio, u = !1)), s + a.size.height >= a.parentData.height && (a.size.height = a.parentData.height - s, c && (a.size.width = a.size.height * a.aspectRatio, u = !1)), u || (a.position.left = a.prevPosition.left, a.position.top = a.prevPosition.top, a.size.width = a.prevSize.width, a.size.height = a.prevSize.height)
},
stop: function () {
var e = t(this).resizable("instance"),
i = e.options,
s = e.containerOffset,
n = e.containerPosition,
o = e.containerElement,
a = t(e.helper),
r = a.offset(),
l = a.outerWidth() - e.sizeDiff.width,
h = a.outerHeight() - e.sizeDiff.height;
e._helper && !i.animate && /relative/.test(o.css("position")) && t(this).css({
left: r.left - n.left - s.left,
width: l,
height: h
}), e._helper && !i.animate && /static/.test(o.css("position")) && t(this).css({
left: r.left - n.left - s.left,
width: l,
height: h
})
}
}), t.ui.plugin.add("resizable", "alsoResize", {
start: function () {
var e = t(this).resizable("instance"),
i = e.options,
s = function (e) {
t(e).each(function () {
var e = t(this);
e.data("ui-resizable-alsoresize", {
width: parseInt(e.width(), 10),
height: parseInt(e.height(), 10),
left: parseInt(e.css("left"), 10),
top: parseInt(e.css("top"), 10)
})
})
};
"object" != typeof i.alsoResize || i.alsoResize.parentNode ? s(i.alsoResize) : i.alsoResize.length ? (i.alsoResize = i.alsoResize[0], s(i.alsoResize)) : t.each(i.alsoResize, function (t) {
s(t)
})
},
resize: function (e, i) {
var s = t(this).resizable("instance"),
n = s.options,
o = s.originalSize,
a = s.originalPosition,
r = {
height: s.size.height - o.height || 0,
width: s.size.width - o.width || 0,
top: s.position.top - a.top || 0,
left: s.position.left - a.left || 0
},
l = function (e, s) {
t(e).each(function () {
var e = t(this),
n = t(this).data("ui-resizable-alsoresize"),
o = {},
a = s && s.length ? s : e.parents(i.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"];
t.each(a, function (t, e) {
var i = (n[e] || 0) + (r[e] || 0);
i && i >= 0 && (o[e] = i || null)
}), e.css(o)
})
};
"object" != typeof n.alsoResize || n.alsoResize.nodeType ? l(n.alsoResize) : t.each(n.alsoResize, function (t, e) {
l(t, e)
})
},
stop: function () {
t(this).removeData("resizable-alsoresize")
}
}), t.ui.plugin.add("resizable", "ghost", {
start: function () {
var e = t(this).resizable("instance"),
i = e.options,
s = e.size;
e.ghost = e.originalElement.clone(), e.ghost.css({
opacity: .25,
display: "block",
position: "relative",
height: s.height,
width: s.width,
margin: 0,
left: 0,
top: 0
}).addClass("ui-resizable-ghost").addClass("string" == typeof i.ghost ? i.ghost : ""), e.ghost.appendTo(e.helper)
},
resize: function () {
var e = t(this).resizable("instance");
e.ghost && e.ghost.css({
position: "relative",
height: e.size.height,
width: e.size.width
})
},
stop: function () {
var e = t(this).resizable("instance");
e.ghost && e.helper && e.helper.get(0).removeChild(e.ghost.get(0))
}
}), t.ui.plugin.add("resizable", "grid", {
resize: function () {
var e, i = t(this).resizable("instance"),
s = i.options,
n = i.size,
o = i.originalSize,
a = i.originalPosition,
r = i.axis,
l = "number" == typeof s.grid ? [s.grid, s.grid] : s.grid,
h = l[0] || 1,
c = l[1] || 1,
p = Math.round((n.width - o.width) / h) * h,
d = Math.round((n.height - o.height) / c) * c,
u = o.width + p,
f = o.height + d,
g = s.maxWidth && s.maxWidth < u,
m = s.maxHeight && s.maxHeight < f,
v = s.minWidth && s.minWidth > u,
w = s.minHeight && s.minHeight > f;
s.grid = l, v && (u += h), w && (f += c), g && (u -= h), m && (f -= c), /^(se|s|e)$/.test(r) ? (i.size.width = u, i.size.height = f) : /^(ne)$/.test(r) ? (i.size.width = u, i.size.height = f, i.position.top = a.top - d) : /^(sw)$/.test(r) ? (i.size.width = u, i.size.height = f, i.position.left = a.left - p) : ((f - c <= 0 || u - h <= 0) && (e = i._getPaddingPlusBorderDimensions(this)), f - c > 0 ? (i.size.height = f, i.position.top = a.top - d) : (f = c - e.height, i.size.height = f, i.position.top = a.top + o.height - f), u - h > 0 ? (i.size.width = u, i.position.left = a.left - p) : (u = h - e.width, i.size.width = u, i.position.left = a.left + o.width - u))
}
});
t.ui.resizable
}), jQuery.easing.jswing = jQuery.easing.swing, jQuery.extend(jQuery.easing, {
def: "easeOutQuad",
swing: function (t, e, i, s, n) {
return jQuery.easing[jQuery.easing.def](t, e, i, s, n)
},
easeInQuad: function (t, e, i, s, n) {
return s * (e /= n) * e + i
},
easeOutQuad: function (t, e, i, s, n) {
return -s * (e /= n) * (e - 2) + i
},
easeInOutQuad: function (t, e, i, s, n) {
return (e /= n / 2) < 1 ? s / 2 * e * e + i : -s / 2 * (--e * (e - 2) - 1) + i
},
easeInCubic: function (t, e, i, s, n) {
return s * (e /= n) * e * e + i
},
easeOutCubic: function (t, e, i, s, n) {
return s * ((e = e / n - 1) * e * e + 1) + i
},
easeInOutCubic: function (t, e, i, s, n) {
return (e /= n / 2) < 1 ? s / 2 * e * e * e + i : s / 2 * ((e -= 2) * e * e + 2) + i
},
easeInQuart: function (t, e, i, s, n) {
return s * (e /= n) * e * e * e + i
},
easeOutQuart: function (t, e, i, s, n) {
return -s * ((e = e / n - 1) * e * e * e - 1) + i
},
easeInOutQuart: function (t, e, i, s, n) {
return (e /= n / 2) < 1 ? s / 2 * e * e * e * e + i : -s / 2 * ((e -= 2) * e * e * e - 2) + i
},
easeInQuint: function (t, e, i, s, n) {
return s * (e /= n) * e * e * e * e + i
},
easeOutQuint: function (t, e, i, s, n) {
return s * ((e = e / n - 1) * e * e * e * e + 1) + i
},
easeInOutQuint: function (t, e, i, s, n) {
return (e /= n / 2) < 1 ? s / 2 * e * e * e * e * e + i : s / 2 * ((e -= 2) * e * e * e * e + 2) + i
},
easeInSine: function (t, e, i, s, n) {
return -s * Math.cos(e / n * (Math.PI / 2)) + s + i
},
easeOutSine: function (t, e, i, s, n) {
return s * Math.sin(e / n * (Math.PI / 2)) + i
},
easeInOutSine: function (t, e, i, s, n) {
return -s / 2 * (Math.cos(Math.PI * e / n) - 1) + i
},
easeInExpo: function (t, e, i, s, n) {
return 0 == e ? i : s * Math.pow(2, 10 * (e / n - 1)) + i
},
easeOutExpo: function (t, e, i, s, n) {
return e == n ? i + s : s * (-Math.pow(2, -10 * e / n) + 1) + i
},
easeInOutExpo: function (t, e, i, s, n) {
return 0 == e ? i : e == n ? i + s : (e /= n / 2) < 1 ? s / 2 * Math.pow(2, 10 * (e - 1)) + i : s / 2 * (-Math.pow(2, -10 * --e) + 2) + i
},
easeInCirc: function (t, e, i, s, n) {
return -s * (Math.sqrt(1 - (e /= n) * e) - 1) + i
},
easeOutCirc: function (t, e, i, s, n) {
return s * Math.sqrt(1 - (e = e / n - 1) * e) + i
},
easeInOutCirc: function (t, e, i, s, n) {
return (e /= n / 2) < 1 ? -s / 2 * (Math.sqrt(1 - e * e) - 1) + i : s / 2 * (Math.sqrt(1 - (e -= 2) * e) + 1) + i
},
easeInElastic: function (t, e, i, s, n) {
var o = 1.70158,
a = 0,
r = s;
if (0 == e) return i;
if (1 == (e /= n)) return i + s;
if (a || (a = .3 * n), r < Math.abs(s)) {
r = s;
var o = a / 4
} else var o = a / (2 * Math.PI) * Math.asin(s / r);
return -(r * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - o) * (2 * Math.PI) / a)) + i
},
easeOutElastic: function (t, e, i, s, n) {
var o = 1.70158,
a = 0,
r = s;
if (0 == e) return i;
if (1 == (e /= n)) return i + s;
if (a || (a = .3 * n), r < Math.abs(s)) {
r = s;
var o = a / 4
} else var o = a / (2 * Math.PI) * Math.asin(s / r);
return r * Math.pow(2, -10 * e) * Math.sin((e * n - o) * (2 * Math.PI) / a) + s + i
},
easeInOutElastic: function (t, e, i, s, n) {
var o = 1.70158,
a = 0,
r = s;
if (0 == e) return i;
if (2 == (e /= n / 2)) return i + s;
if (a || (a = n * (.3 * 1.5)), r < Math.abs(s)) {
r = s;
var o = a / 4
} else var o = a / (2 * Math.PI) * Math.asin(s / r);
return e < 1 ? -.5 * (r * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - o) * (2 * Math.PI) / a)) + i : r * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * n - o) * (2 * Math.PI) / a) * .5 + s + i
},
easeInBack: function (t, e, i, s, n, o) {
return void 0 == o && (o = 1.70158), s * (e /= n) * e * ((o + 1) * e - o) + i
},
easeOutBack: function (t, e, i, s, n, o) {
return void 0 == o && (o = 1.70158), s * ((e = e / n - 1) * e * ((o + 1) * e + o) + 1) + i
},
easeInOutBack: function (t, e, i, s, n, o) {
return void 0 == o && (o = 1.70158), (e /= n / 2) < 1 ? s / 2 * (e * e * (((o *= 1.525) + 1) * e - o)) + i : s / 2 * ((e -= 2) * e * (((o *= 1.525) + 1) * e + o) + 2) + i
},
easeInBounce: function (t, e, i, s, n) {
return s - jQuery.easing.easeOutBounce(t, n - e, 0, s, n) + i
},
easeOutBounce: function (t, e, i, s, n) {
return (e /= n) < 1 / 2.75 ? s * (7.5625 * e * e) + i : e < 2 / 2.75 ? s * (7.5625 * (e -= 1.5 / 2.75) * e + .75) + i : e < 2.5 / 2.75 ? s * (7.5625 * (e -= 2.25 / 2.75) * e + .9375) + i : s * (7.5625 * (e -= 2.625 / 2.75) * e + .984375) + i
},
easeInOutBounce: function (t, e, i, s, n) {
return e < n / 2 ? .5 * jQuery.easing.easeInBounce(t, 2 * e, 0, s, n) + i : .5 * jQuery.easing.easeOutBounce(t, 2 * e - n, 0, s, n) + .5 * s + i
}
}),
function (t) {
function e(t, e) {
if (!(t.originalEvent.touches.length > 1)) {
t.preventDefault();
var i = t.originalEvent.changedTouches[0],
s = document.createEvent("MouseEvents");
s.initMouseEvent(e, !0, !0, window, 1, i.screenX, i.screenY, i.clientX, i.clientY, !1, !1, !1, !1, 0, null), t.target.dispatchEvent(s)
}
}
if (t.support.touch = "ontouchend" in document, t.support.touch) {
var i, s = t.ui.mouse.prototype,
n = s._mouseInit,
o = s._mouseDestroy;
s._touchStart = function (t) {
var s = this;
!i && s._mouseCapture(t.originalEvent.changedTouches[0]) && (i = !0, s._touchMoved = !1, e(t, "mouseover"), e(t, "mousemove"), e(t, "mousedown"))
}, s._touchMove = function (t) {
i && (this._touchMoved = !0, e(t, "mousemove"))
}, s._touchEnd = function (t) {
i && (e(t, "mouseup"), e(t, "mouseout"), this._touchMoved || e(t, "click"), i = !1)
}, s._mouseInit = function () {
var e = this;
e.element.bind({
touchstart: t.proxy(e, "_touchStart"),
touchmove: t.proxy(e, "_touchMove"),
touchend: t.proxy(e, "_touchEnd")
}), n.call(e)
}, s._mouseDestroy = function () {
var e = this;
e.element.unbind({
touchstart: t.proxy(e, "_touchStart"),
touchmove: t.proxy(e, "_touchMove"),
touchend: t.proxy(e, "_touchEnd")
}), o.call(e)
}
}
}(jQuery),
function (t, e, i) {
function s(t, e, i) {
t.addEventListener ? t.addEventListener(e, i, !1) : t.attachEvent("on" + e, i)
}
function n(t) {
if ("keypress" == t.type) {
var e = String.fromCharCode(t.which);
return t.shiftKey || (e = e.toLowerCase()), e
}
return m[t.which] ? m[t.which] : v[t.which] ? v[t.which] : String.fromCharCode(t.which).toLowerCase()
}
function o(t) {
t = t || {};
var e, i = !1;
for (e in z) t[e] ? i = !0 : z[e] = 0;
i || (S = !1)
}
function a(t, e, i, s, n, o) {
var a, r, l = [],
h = i.type;
if (!_[t]) return [];
for ("keyup" == h && c(t) && (e = [t]), a = 0; a < _[t].length; ++a)
if (r = _[t][a], !(!s && r.seq && z[r.seq] != r.level || h != r.action || ("keypress" != h || i.metaKey || i.ctrlKey) && e.sort().join(",") !== r.modifiers.sort().join(","))) {
var p = s && r.seq == s && r.level == o;
(!s && r.combo == n || p) && _[t].splice(a, 1), l.push(r)
}
return l
}
function r(t) {
var e = [];
return t.shiftKey && e.push("shift"), t.altKey && e.push("alt"), t.ctrlKey && e.push("ctrl"), t.metaKey && e.push("meta"), e
}
function l(t, e, i, s) {
C.stopCallback(e, e.target || e.srcElement, i, s) || !1 !== t(e, i) || (e.preventDefault ? e.preventDefault() : e.returnValue = !1, e.stopPropagation ? e.stopPropagation() : e.cancelBubble = !0)
}
function h(t) {
"number" != typeof t.which && (t.which = t.keyCode);
var e = n(t);
e && ("keyup" == t.type && P === e ? P = !1 : C.handleKey(e, r(t), t))
}
function c(t) {
return "shift" == t || "ctrl" == t || "alt" == t || "meta" == t
}
function p(t, e, i, s) {
function a(e) {
return function () {
S = e, ++z[t], clearTimeout(g), g = setTimeout(o, 1e3)
}
}
function r(e) {
l(i, e, t), "keyup" !== s && (P = n(e)), setTimeout(o, 10)
}
for (var h = z[t] = 0; h < e.length; ++h) {
var c = h + 1 === e.length ? r : a(s || d(e[h + 1]).action);
u(e[h], c, s, t, h)
}
}
function d(t, e) {
var i, s, n, o = [];
for (i = "+" === t ? ["+"] : t.split("+"), n = 0; n < i.length; ++n) s = i[n], b[s] && (s = b[s]), e && "keypress" != e && w[s] && (s = w[s], o.push("shift")), c(s) && o.push(s);
if (i = s, n = e, !n) {
if (!f) {
f = {};
for (var a in m) 95 < a && 112 > a || m.hasOwnProperty(a) && (f[m[a]] = a)
}
n = f[i] ? "keydown" : "keypress"
}
return "keypress" == n && o.length && (n = "keydown"), {
key: s,
modifiers: o,
action: n
}
}
function u(t, e, i, s, n) {
y[t + ":" + i] = e, t = t.replace(/\s+/g, " ");
var o = t.split(" ");
1 < o.length ? p(t, o, e, i) : (i = d(t, i), _[i.key] = _[i.key] || [], a(i.key, i.modifiers, {
type: i.action
}, s, t, n), _[i.key][s ? "unshift" : "push"]({
callback: e,
modifiers: i.modifiers,
action: i.action,
seq: s,
level: n,
combo: t
}))
}
var f, g, m = {
8: "backspace",
9: "tab",
13: "enter",
16: "shift",
17: "ctrl",
18: "alt",
20: "capslock",
27: "esc",
32: "space",
33: "pageup",
34: "pagedown",
35: "end",
36: "home",
37: "left",
38: "up",
39: "right",
40: "down",
45: "ins",
46: "del",
91: "meta",
93: "meta",
224: "meta"
},
v = {
106: "*",
107: "+",
109: "-",
110: ".",
111: "/",
186: ";",
187: "=",
188: ",",
189: "-",
190: ".",
191: "/",
192: "`",
219: "[",
220: "\\",
221: "]",
222: "'"
},
w = {
"~": "`",
"!": "1",
"@": "2",
"#": "3",
$: "4",
"%": "5",
"^": "6",
"&": "7",
"*": "8",
"(": "9",
")": "0",
_: "-",
"+": "=",
":": ";",
'"': "'",
"<": ",",
">": ".",
"?": "/",
"|": "\\"
},
b = {
option: "alt",
command: "meta",
"return": "enter",
escape: "esc",
mod: /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? "meta" : "ctrl"
},
_ = {},
y = {},
z = {},
P = !1,
x = !1,
S = !1;
for (i = 1; 20 > i; ++i) m[111 + i] = "f" + i;
for (i = 0; 9 >= i; ++i) m[i + 96] = i;
s(e, "keypress", h), s(e, "keydown", h), s(e, "keyup", h);
var C = {
bind: function (t, e, i) {
t = t instanceof Array ? t : [t];
for (var s = 0; s < t.length; ++s) u(t[s], e, i);
return this
},
unbind: function (t, e) {
return C.bind(t, function () { }, e)
},
trigger: function (t, e) {
return y[t + ":" + e] && y[t + ":" + e]({}, t), this
},
reset: function () {
return _ = {}, y = {}, this
},
stopCallback: function (t, e) {
return !(-1 < (" " + e.className + " ").indexOf(" mousetrap ")) && ("INPUT" == e.tagName || "SELECT" == e.tagName || "TEXTAREA" == e.tagName || e.isContentEditable)
},
handleKey: function (t, e, i) {
var s, n = a(t, e, i);
e = {};
var r = 0,
h = !1;
for (s = 0; s < n.length; ++s) n[s].seq && (r = Math.max(r, n[s].level));
for (s = 0; s < n.length; ++s) n[s].seq ? n[s].level == r && (h = !0,
e[n[s].seq] = 1, l(n[s].callback, i, n[s].combo, n[s].seq)) : h || l(n[s].callback, i, n[s].combo);
n = "keypress" == i.type && x, i.type != S || c(t) || n || o(e), x = h && "keydown" == i.type
}
};
t.Mousetrap = C, "function" == typeof define && define.amd && define(C)
}(window, document),
function (t, e, i) {
t.tapHandling = !1;
var s = function (i) {
return i.each(function () {
function i(t) {
e(t.target).trigger("tap", [t, e(t.target).attr("href")]), t.stopImmediatePropagation()
}
function s(t) {
var e = t.originalEvent || t,
i = e.touches || e.targetTouches;
return i ? [i[0].pageX, i[0].pageY] : null
}
function n(t) {
if (t.touches && t.touches.length > 1 || t.targetTouches && t.targetTouches.length > 1) return !1;
var e = s(t);
h = e[0], l = e[1]
}
function o(t) {
if (!c) {
var e = s(t);
e && (Math.abs(l - e[1]) > d || Math.abs(h - e[0]) > d) && (c = !0)
}
}
function a(e) {
if (clearTimeout(r), r = setTimeout(function () {
t.tapHandling = !1, c = !1
}, 1e3), !(e.which && e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {
if (e.preventDefault(), c || t.tapHandling && t.tapHandling !== e.type) return void (c = !1);
t.tapHandling = e.type, i(e)
}
}
var r, l, h, c, p = e(this),
d = 10;
p.bind("touchstart.tappy MSPointerDown.tappy", n).bind("touchmove.tappy MSPointerMove.tappy", o).bind("touchend.tappy MSPointerUp.tappy", a).bind("click.tappy", a)
})
},
n = function (t) {
return t.unbind(".tappy")
};
if (e.event && e.event.special) e.event.special.tap = {
add: function (t) {
s(e(this))
},
remove: function (t) {
n(e(this))
}
};
else {
var o = e.fn.bind,
a = e.fn.unbind;
e.fn.bind = function (t) {
return /(^| )tap( |$)/.test(t) && s(this), o.apply(this, arguments)
}, e.fn.unbind = function (t) {
return /(^| )tap( |$)/.test(t) && n(this), a.apply(this, arguments)
}
}
}(this, jQuery);
var AmenitiesMap = {
settings: {
legendNav: $(".map-legend li a"),
amensMap: $(".amenities-map")
},
init: function () {
var t = this.settings;
AmenitiesMap.UIActions(t)
},
UIActions: function (t) {
$(".amenities-map li").hover(function () {
$(this).addClass("on")
}, function () {
$(this).removeClass("on")
}), t.legendNav.click(function (e) {
if (e.preventDefault(), $(this).hasClass("active")) return !1;
t.legendNav.removeClass("active"), $(this).addClass("active");
var i = $(this).attr("href").split("#")[1];
"all" === i ? t.amensMap.find("ul").fadeIn(500) : (t.amensMap.find("ul").fadeOut(500), t.amensMap.find("ul." + i).fadeIn(500))
})
}
},
AvailableSpace = {
settings: {
tabBtn: $(".tab-nav a"),
space: $(".avail-space h3"),
floorplans: $(".floorplans img")
},
init: function () {
var t = this.settings;
AvailableSpace.tabTap(t), AvailableSpace.spaceTap(t), AvailableSpace.onWindowResize(t), AvailableSpace.hoverSpace(t)
},
tabTap: function (t) {
t.tabBtn.click(function (e) {
$(".avail-space li.on").removeClass("on").addClass("off").attr("style", " "), t.floorplans.removeClass("on")
})
},
spaceTap: function (t) {
t.space.click(function (e) {
AvailableSpace.toggleSpace(t, $(this))
})
},
onWindowResize: function (t) {
$(window).resize(function () {
var t = $(".avail-space li.on").find("h3").outerHeight() + $(".avail-space li.on").find(".details").outerHeight();
$(".avail-space li.on").css("height", t)
})
},
toggleSpace: function (t, e) {
var i = e.parent();
if (t.floorplans.removeClass("on"), i.hasClass("on")) {
var s = e.outerHeight() + 5;
i.toggleClass("off on"), i.animate({
height: s
}, 300, "easeInOutQuad")
} else {
var n = $(".avail-space li.on"),
s = n.find("h3").outerHeight() + 5;
n.animate({
height: s
}, 300, "easeInOutQuad"), n.toggleClass("off on");
var o = e.outerHeight() + e.siblings().outerHeight();
i.css("height", s).animate({
height: o
}, 300, "easeInOutQuad"), i.toggleClass("off on"), $(".tab.active .floorplans img." + e.parent().attr("class").split(" ")[0]).addClass("on")
}
},
hoverSpace: function (t) {
t.space.hover(function () {
$(".tab.active .floorplans img." + $(this).parent().attr("class").split(" ")[0]).addClass("hovered")
}, function () {
$(".tab.active .floorplans img." + $(this).parent().attr("class").split(" ")[0]).removeClass("hovered")
})
}
},
Gallery = {
settings: {
launcher: $(".gallery-launcher"),
gallery: $(".gallery"),
nav: $(".gallery__btn-nav"),
close: $(".gallery__btn-close"),
caption: $(".gallery__caption")
},
init: function () {
var t = this.settings;
Gallery.bindUIActions(t)
},
bindUIActions: function (t) {
t.launcher.click(function (e) {
e.preventDefault(), Gallery.setup(t, $(this).attr("href"))
}), t.close.click(function (e) {
e.preventDefault(), t.gallery.fadeOut(500), t.nav.unbind(), t.slider.hide(), t.dotNav.parents(".gallery__dot-nav").remove(), $("body").css("overflow", "visible")
})
},
setup: function (t, e) {
t.current = 0, t.id = e, t.slider = $(".gallery__slider").filter(t.id), t.slides = t.slider.find(".gallery__slide"), t.numSlides = t.slides.length, t.slider.show(), t.slider.css("width", 100 * t.numSlides + "%"), t.slides.css("width", 100 / t.numSlides + "%"), Gallery.dotNav(t), $(t.id + " li").length < 2 ? t.nav.add(t.dotNav).css("display", "none") : t.nav.add(t.dotNav).attr("style", ""), Gallery.runGallery(t), t.dotNav.eq(0).click()
},
dotNav: function (t) {
$(".gallery__dot-nav").remove();
var e = '
';
t.slides.each(function (t) {
e += '- •
'
}), e += "
", t.gallery.find(".gallery__wrapper").append(e), t.dotNav = $(".gallery__dot-nav li a")
},
runGallery: function (t) {
t.gallery.fadeIn(500), t.slideInterval = 100 / t.numSlides, $("body").css("overflow", "hidden"), t.nav.click(function (e) {
e.preventDefault(), $(this).hasClass("-next") ? t.current < t.numSlides - 1 ? (t.slidePosition = -(t.current + 1) * t.slideInterval, t.current += 1) : (t.slidePosition = 0, t.current = 0) : 0 === t.current ? (t.slidePosition = -(t.numSlides - 1) * t.slideInterval, t.current = t.numSlides - 1) : (t.slidePosition = -(t.current - 1) * t.slideInterval, t.current -= 1), Gallery.moveSlider(t)
}), t.dotNav.click(function (e) {
e.preventDefault();
var i = parseInt($(this).attr("href").split("#")[1]);
t.slidePosition = -i * t.slideInterval, t.current = i, Gallery.moveSlider(t)
}), Mousetrap.bind("right", function (e) {
t.dotNav.filter(".-active").parent().next().find("a").click()
}), Mousetrap.bind("left", function (e) {
t.dotNav.filter(".-active").parent().prev().find("a").click()
}), t.slider.draggable({
distance: 10,
axis: "x",
start: function (e, i) {
t.slider.removeClass("-done")
},
stop: function (e, i) {
var s = i.position.left;
s < -25 && t.current < t.numSlides - 1 ? t.dotNav[t.current + 1].click() : s > 25 && t.current > 0 ? t.dotNav[t.current - 1].click() : t.slider.addClass("-done").css({
left: "0"
})
}
})
},
moveSlider: function (t) {
var e = t.slides.eq(t.current).find("img").attr("alt");
t.dotNav.add(t.slides).removeClass("-active"), t.slider.addClass("-done").css({
left: "0",
transform: "translateX(" + t.slidePosition + "%)"
}).css({
left: "0",
transform: "translate3d(" + t.slidePosition + "%, 0, 0)"
}), t.dotNav.eq(t.current).add(t.slides.eq(t.current)).addClass("-active"), "undefined" != typeof e && e.length > 0 ? t.caption.html(e).fadeIn(500) : t.caption.fadeOut(500)
}
},
LocationMap = {
settings: {
subjectProp: "Property Name",
subjectLoc: [34.0515967, -118.2591709],
subjectMapsURL: "https://www.google.com/maps/place/515+S+Flower+St,+Los+Angeles,+CA+90071/@34.0515967,-118.2591709,17z/data=!3m1!4b1!4m5!3m4!1s0x80c2c7b3b745579b:0x843a8d9db4d0686c!8m2!3d34.0515967!4d-118.2569769",
mapZoom: 13
},
init: function () {
var t = this.settings;
LocationMap.loadMap(t)
},
loadMap: function (t) {
var e = new google.maps.LatLng(t.subjectLoc[0], t.subjectLoc[1]),
i = e,
s = t.mapZoom,
n = {
center: i,
zoom: s,
panControl: !1,
draggable: !0,
scrollwheel: !1,
streetViewControl: !1,
mapTypeId: google.maps.MapTypeId.TERRAIN,
mapTypeControlOptions: {
mapTypeIds: []
},
zoomControlOptions: {
style: google.maps.ZoomControlStyle.SMALL,
position: google.maps.ControlPosition.TOP_RIGHT
}
};
t.map = new google.maps.Map(document.getElementById("map"), n), google.maps.event.addDomListener(window, "resize", function () {
t.map.setCenter(i)
});
var o = {
url: "../assets/img/subject-marker.svg",
scaledSize: new google.maps.Size(60, 80),
anchor: new google.maps.Point(30, 80)
},
a = new google.maps.Marker({
position: e,
map: t.map,
icon: o,
optimized: !1,
title: t.subjectProp,
url: t.subjectMapsURL,
animation: google.maps.Animation.DROP
});
google.maps.event.addListener(a, "click", function () {
window.open(a.url)
})
}
},
PageIntro = {
settings: {
sail: $(".modern .sail"),
main: $(".modern .main-content"),
hero: $(".modern .hero img").eq(0)
},
init: function () {
var t = this.settings;
t.hero.animate({
"margin-left": "0",
opacity: "1"
}, 500), t.sail.animate({
left: "0",
opacity: "1"
}, 500), t.main.delay(300).animate({
left: "0",
opacity: "1"
}, 500), $(window).scroll(function () {
x = .075 * $(window).scrollTop(), t.sail.css("left", -x)
})
}
},
PageSetUp = {
settings: {
pageName: $("body").attr("class")
},
init: function () {
var t = this.settings;
SiteNav.init(), Gallery.init(), PageIntro.init(), "page-home" == t.pageName || ("page-property" == t.pageName ? $(".buildings li").hover(function () {
$(this).addClass("on")
}, function () {
$(this).removeClass("on")
}) : "page-availability" == t.pageName ? (TabNav.init(), AvailableSpace.init()) : "page-sustainability" == t.pageName ? TabNav.init() : "page-location" == t.pageName ? (TabNav.init(), AmenitiesMap.init(), LocationMap.init()) : "page-amenities" == t.pageName ? (TabNav.init(), Slideshow.init(5e3), Gallery.init()) : "page-contact" == t.pageName && TabNav.init())
}
},
SiteNav = {
settings: {
navTrigger: $("a.nav-trigger"),
siteHeader: $(".site-header"),
siteNav: $(".site-nav")
},
init: function () {
var t = this.settings;
SiteNav.triggerMenu(t), SiteNav.shrinkHeader(t)
},
triggerMenu: function (t) {
t.navTrigger.bind("tap", function (e) {
e.preventDefault(), t.navTrigger.add(t.siteNav).toggleClass("off on")
})
},
shrinkHeader: function (t) {
var e = t.siteHeader.height();
$(window).resize(function () {
t.siteHeader.height()
}), $(window).scroll(function () {
if ($(window).scrollTop() > e) {
if (t.siteHeader.hasClass("shrinked")) return !1;
t.siteHeader.addClass("shrinked"), t.siteHeader.animate({
top: "0"
}, 500)
} else {
if (!t.siteHeader.hasClass("shrinked")) return !1;
t.siteHeader.removeClass("shrinked").attr("style", " ")
}
})
}
},
SlideShow = {
settings: {
slides: $(".slideshow img"),
timer: 5e3
},
init: function () {
var t = this.settings;
SlideShow.runGallery(t)
},
runGallery: function (t) {
var e = t.slides.length,
i = 0;
setInterval(function () {
if (i < e - 1) var s = i + 1;
else var s = 0;
t.slides.eq(i).fadeTo(1e3, 0), t.slides.eq(s).fadeTo(1e3, 1), i = s
}, t.timer)
}
},
Slideshow = {
settings: {
slideshow: $(".slideshow"),
slider: $(".slideshow__slider"),
sliderID: document.getElementById("slider"),
slides: $(".slideshow__slide"),
numSlides: $(".slideshow__slide").length,
currentSlide: 0
},
init: function (t) {
var e = this.settings;
e.timeInterval = t, Slideshow.setUp(e), Slideshow.loadSlideNav(e), Slideshow.bindUIActions(e), Slideshow.counter(e)
},
setUp: function (t) {
var e = 100 * t.numSlides;
t.slider.css("width", e + "%"), t.slideWidth = 100 / t.numSlides, t.slides.css("width", t.slideWidth + "%")
},
loadSlideNav: function (t) {
var e = '
';
t.slides.each(function (t) {
e += '- •
'
}), e += "
", t.slideshow.append(e), t.slideNav = $(".slideshow__nav a"), t.slideNav.eq(0).addClass("-active");
var i = '
';
i += '
', t.slideshow.append(i), t.arrowNav = $(".slideshow__btn")
},
bindUIActions: function (t) {
if (t.slideNav.click(function (e) {
return e.preventDefault(), !$(this).hasClass("-active") && (t.slideNav.removeClass("-active"), clearTimeout(t.timer), Slideshow.goToSlide(t, $(this).attr("href").split("#")[1]), $(this).addClass("-active"), Slideshow.counter(t), void 0)
}), t.arrowNav.click(function (e) {
e.preventDefault(), $(this).hasClass("-next") ? t.currentSlide == t.numSlides - 1 ? t.slideNav.eq(0).click() : t.slideNav.eq(parseInt(t.currentSlide) + 1).click() : 0 == t.currentSlide ? t.slideNav.eq(t.numSlides - 1).click() : t.slideNav.eq(parseInt(t.currentSlide) - 1).click()
}), $("body").hasClass("page-home"));
else;
var e = 0,
i = 0;
if(t.sliderID) //Add by Ian Chan for iframes
t.sliderID.addEventListener("touchstart", function (i) {
var s = i.changedTouches[0];
e = parseInt(s.clientX), t.slider.removeClass("-done")
}, !1), t.sliderID.addEventListener("touchmove", function (s) {
var n = s.changedTouches[0];
i = parseInt(n.clientX) - e, (i > 10 || i < -10) && (s.preventDefault(), (i < 800 && i > 15 || i > -800 && i < -15) && t.slider.css("left", i))
}, !1), t.sliderID.addEventListener("touchend", function (e) {
e.changedTouches[0];
e.preventDefault(), i < -50 && t.currentSlide < t.numSlides - 1 ? t.slideNav.eq(parseInt(t.currentSlide) + 1).click() : i > 50 && t.currentSlide > 0 ? t.slideNav.eq(parseInt(t.currentSlide) - 1).click() : t.slider.addClass("-done").css({
left: "0"
})
}, !1)
},
counter: function (t) {
t.timer = setTimeout(function () {
t.currentSlide == t.numSlides - 1 ? t.slideNav.eq(0).click() : t.slideNav.eq(parseInt(t.currentSlide) + 1).click()
}, t.timeInterval)
},
goToSlide: function (t, e) {
var i = t.slideWidth * e;
t.slides.removeClass("-active").eq(e).addClass("-active"), t.slider.addClass("-done"), t.slider.css({
left: "0",
transform: "translateX(-" + i + "%)"
}), t.slider.css({
left: "0",
transform: "translate3d(-" + i + "%, 0, 0)"
}), t.currentSlide = e
}
},
TabNav = {
settings: {
tabBtn: $(".tab-nav a"),
tabs: $(".tab")
},
init: function () {
var t = this.settings;
if(t.tabBtn.length > 0) //added by Ian Chan to make iframe of tabs work
TabNav.UIActions(t), "undefined" != typeof window.location.hash.split("#")[1] ? t.currentTab = window.location.hash.split("#")[1] : t.currentTab = t.tabBtn.eq(0).attr("href").split("#")[1], $(".tab-nav a." + t.currentTab).click()
},
UIActions: function (t) {
t.tabBtn.click(function (e) {
if (e.preventDefault(), $(this).hasClass("active")) return !1;
var i = $(this).attr("href");
return t.tabBtn.removeClass("active"), $(this).addClass("active"), $(".tab.active").removeClass("active"), $(i).addClass("active"), !!history.pushState && void history.pushState(null, null, i)
})
}
};
! function () {
PageSetUp.init(), $("footer p.copyright span").prepend("©" + (new Date).getFullYear() + " ")
}();
function resizeIframe(obj) {
var DivHeight;
DivHeight = obj.contentWindow.document.body.scrollHeight - 1;
obj.style.height = DivHeight + 'px';
//console.log(DivHeight);
}