", { title: e.element.attr("title") });
return (
e.disabled && this._addClass(i, null, "ui-state-disabled"),
e.hidden ? i.prop("hidden", !0) : this._setText(s, e.label),
i.append(s).appendTo(t)
);
},
_setText: function (t, e) {
e ? t.text(e) : t.html(" ");
},
_move: function (t, e) {
var i,
s = ".ui-menu-item";
this.isOpen
? (i = this.menuItems.eq(this.focusIndex).parent("li"))
: ((i = this.menuItems
.eq(this.element[0].selectedIndex)
.parent("li")),
(s += ":not(.ui-state-disabled)")),
(i =
"first" === t || "last" === t
? i["first" === t ? "prevAll" : "nextAll"](s).eq(-1)
: i[t + "All"](s).eq(0)).length &&
this.menuInstance.focus(e, i);
},
_getSelectedItem: function () {
return this.menuItems.eq(this.element[0].selectedIndex).parent("li");
},
_toggle: function (t) {
this[this.isOpen ? "close" : "open"](t);
},
_setSelection: function () {
var t;
this.range &&
((t = window.getSelection()).removeAllRanges(),
t.addRange(this.range));
},
_documentClick: {
mousedown: function (t) {
!this.isOpen ||
V(t.target).closest(
".ui-selectmenu-menu, #" + CSS.escape(this.ids.button)
).length ||
this.close(t);
},
},
_buttonEvents: {
mousedown: function () {
var t = window.getSelection();
t.rangeCount && (this.range = t.getRangeAt(0));
},
click: function (t) {
this._setSelection(), this._toggle(t);
},
keydown: function (t) {
var e = !0;
switch (t.keyCode) {
case V.ui.keyCode.TAB:
case V.ui.keyCode.ESCAPE:
this.close(t), (e = !1);
break;
case V.ui.keyCode.ENTER:
this.isOpen && this._selectFocusedItem(t);
break;
case V.ui.keyCode.UP:
t.altKey ? this._toggle(t) : this._move("prev", t);
break;
case V.ui.keyCode.DOWN:
t.altKey ? this._toggle(t) : this._move("next", t);
break;
case V.ui.keyCode.SPACE:
this.isOpen ? this._selectFocusedItem(t) : this._toggle(t);
break;
case V.ui.keyCode.LEFT:
this._move("prev", t);
break;
case V.ui.keyCode.RIGHT:
this._move("next", t);
break;
case V.ui.keyCode.HOME:
case V.ui.keyCode.PAGE_UP:
this._move("first", t);
break;
case V.ui.keyCode.END:
case V.ui.keyCode.PAGE_DOWN:
this._move("last", t);
break;
default:
this.menu.trigger(t), (e = !1);
}
e && t.preventDefault();
},
},
_selectFocusedItem: function (t) {
var e = this.menuItems.eq(this.focusIndex).parent("li");
e.hasClass("ui-state-disabled") ||
this._select(e.data("ui-selectmenu-item"), t);
},
_select: function (t, e) {
var i = this.element[0].selectedIndex;
(this.element[0].selectedIndex = t.index),
this.buttonItem.replaceWith(
(this.buttonItem = this._renderButtonItem(t))
),
this._setAria(t),
this._trigger("select", e, { item: t }),
t.index !== i && this._trigger("change", e, { item: t }),
this.close(e);
},
_setAria: function (t) {
t = this.menuItems.eq(t.index).attr("id");
this.button.attr({
"aria-labelledby": t,
"aria-activedescendant": t,
}),
this.menu.attr("aria-activedescendant", t);
},
_setOption: function (t, e) {
var i;
"icons" === t &&
((i = this.button.find("span.ui-icon")),
this._removeClass(i, null, this.options.icons.button)._addClass(
i,
null,
e.button
)),
this._super(t, e),
"appendTo" === t && this.menuWrap.appendTo(this._appendTo()),
"width" === t && this._resizeButton();
},
_setOptionDisabled: function (t) {
this._super(t),
this.menuInstance.option("disabled", t),
this.button.attr("aria-disabled", t),
this._toggleClass(this.button, null, "ui-state-disabled", t),
this.element.prop("disabled", t),
t
? (this.button.attr("tabindex", -1), this.close())
: this.button.attr("tabindex", 0);
},
_appendTo: function () {
var t = this.options.appendTo;
return (t = (t =
(t =
t &&
(t.jquery || t.nodeType ? V(t) : this.document.find(t).eq(0))) &&
t[0]
? t
: this.element.closest(".ui-front, dialog")).length
? t
: this.document[0].body);
},
_toggleAttr: function () {
this.button.attr("aria-expanded", this.isOpen),
this._removeClass(
this.button,
"ui-selectmenu-button-" + (this.isOpen ? "closed" : "open")
)
._addClass(
this.button,
"ui-selectmenu-button-" + (this.isOpen ? "open" : "closed")
)
._toggleClass(
this.menuWrap,
"ui-selectmenu-open",
null,
this.isOpen
),
this.menu.attr("aria-hidden", !this.isOpen);
},
_resizeButton: function () {
var t = this.options.width;
!1 === t
? this.button.css("width", "")
: (null === t &&
((t = this.element.show().outerWidth()), this.element.hide()),
this.button.outerWidth(t));
},
_resizeMenu: function () {
this.menu.outerWidth(
Math.max(this.button.outerWidth(), this.menu.width("").outerWidth())
);
},
_getCreateOptions: function () {
var t = this._super();
return (t.disabled = this.element.prop("disabled")), t;
},
_parseOptions: function (t) {
var i = this,
s = [];
t.each(function (t, e) {
s.push(i._parseOption(V(e), t));
}),
(this.items = s);
},
_parseOption: function (t, e) {
var i = t.parent("optgroup");
return {
element: t,
index: e,
value: t.val(),
label: t.text(),
hidden: i.prop("hidden") || t.prop("hidden"),
optgroup: i.attr("label") || "",
disabled: i.prop("disabled") || t.prop("disabled"),
};
},
_destroy: function () {
this._unbindFormResetHandler(),
this.menuWrap.remove(),
this.button.remove(),
this.element.show(),
this.element.removeUniqueId(),
this.labels.attr("for", this.ids.element);
},
},
]),
V.widget("ui.slider", V.ui.mouse, {
version: "1.14.1",
widgetEventPrefix: "slide",
options: {
animate: !1,
classes: {
"ui-slider": "ui-corner-all",
"ui-slider-handle": "ui-corner-all",
"ui-slider-range": "ui-corner-all ui-widget-header",
},
distance: 0,
max: 100,
min: 0,
orientation: "horizontal",
range: !1,
step: 1,
value: 0,
values: null,
change: null,
slide: null,
start: null,
stop: null,
},
numPages: 5,
_create: function () {
(this._keySliding = !1),
(this._mouseSliding = !1),
(this._animateOff = !0),
(this._handleIndex = null),
this._detectOrientation(),
this._mouseInit(),
this._calculateNewMax(),
this._addClass(
"ui-slider ui-slider-" + this.orientation,
"ui-widget ui-widget-content"
),
this._refresh(),
(this._animateOff = !1);
},
_refresh: function () {
this._createRange(),
this._createHandles(),
this._setupEvents(),
this._refreshValue();
},
_createHandles: function () {
var t,
e = this.options,
i = this.element.find(".ui-slider-handle"),
s = [],
n = (e.values && e.values.length) || 1;
for (
i.length > n && (i.slice(n).remove(), (i = i.slice(0, n))),
t = i.length;
t < n;
t++
)
s.push("
");
(this.handles = i.add(V(s.join("")).appendTo(this.element))),
this._addClass(this.handles, "ui-slider-handle", "ui-state-default"),
(this.handle = this.handles.eq(0)),
this.handles.each(function (t) {
V(this).data("ui-slider-handle-index", t).attr("tabIndex", 0);
});
},
_createRange: function () {
var t = this.options;
t.range
? (!0 === t.range &&
(t.values
? t.values.length && 2 !== t.values.length
? (t.values = [t.values[0], t.values[0]])
: Array.isArray(t.values) && (t.values = t.values.slice(0))
: (t.values = [this._valueMin(), this._valueMin()])),
this.range && this.range.length
? (this._removeClass(
this.range,
"ui-slider-range-min ui-slider-range-max"
),
this.range.css({ left: "", bottom: "" }))
: ((this.range = V("
").appendTo(this.element)),
this._addClass(this.range, "ui-slider-range")),
("min" !== t.range && "max" !== t.range) ||
this._addClass(this.range, "ui-slider-range-" + t.range))
: (this.range && this.range.remove(), (this.range = null));
},
_setupEvents: function () {
this._off(this.handles),
this._on(this.handles, this._handleEvents),
this._hoverable(this.handles),
this._focusable(this.handles);
},
_destroy: function () {
this.handles.remove(),
this.range && this.range.remove(),
this._mouseDestroy();
},
_mouseCapture: function (t) {
var i,
s,
n,
o,
e,
a,
r = this,
l = this.options;
return (
!l.disabled &&
((this.elementSize = {
width: this.element.outerWidth(),
height: this.element.outerHeight(),
}),
(this.elementOffset = this.element.offset()),
(e = { x: t.pageX, y: t.pageY }),
(i = this._normValueFromMouse(e)),
(s = this._valueMax() - this._valueMin() + 1),
this.handles.each(function (t) {
var e = Math.abs(i - r.values(t));
(e < s ||
(s === e &&
(t === r._lastChangedValue || r.values(t) === l.min))) &&
((s = e), (n = V(this)), (o = t));
}),
!1 !== this._start(t, o)) &&
((this._mouseSliding = !0),
(this._handleIndex = o),
this._addClass(n, null, "ui-state-active"),
n.trigger("focus"),
(e = n.offset()),
(a = !V(t.target).parents().addBack().is(".ui-slider-handle")),
(this._clickOffset = a
? { left: 0, top: 0 }
: {
left: t.pageX - e.left - n.width() / 2,
top:
t.pageY -
e.top -
n.height() / 2 -
(parseInt(n.css("borderTopWidth"), 10) || 0) -
(parseInt(n.css("borderBottomWidth"), 10) || 0) +
(parseInt(n.css("marginTop"), 10) || 0),
}),
this.handles.hasClass("ui-state-hover") || this._slide(t, o, i),
(this._animateOff = !0))
);
},
_mouseStart: function () {
return !0;
},
_mouseDrag: function (t) {
var e = { x: t.pageX, y: t.pageY },
e = this._normValueFromMouse(e);
return this._slide(t, this._handleIndex, e), !1;
},
_mouseStop: function (t) {
return (
this._removeClass(this.handles, null, "ui-state-active"),
(this._mouseSliding = !1),
this._stop(t, this._handleIndex),
this._change(t, this._handleIndex),
(this._handleIndex = null),
(this._clickOffset = null),
(this._animateOff = !1)
);
},
_detectOrientation: function () {
this.orientation =
"vertical" === this.options.orientation ? "vertical" : "horizontal";
},
_normValueFromMouse: function (t) {
var e,
t =
"horizontal" === this.orientation
? ((e = this.elementSize.width),
t.x -
this.elementOffset.left -
(this._clickOffset ? this._clickOffset.left : 0))
: ((e = this.elementSize.height),
t.y -
this.elementOffset.top -
(this._clickOffset ? this._clickOffset.top : 0)),
t = t / e;
return (
(t = 1 < t ? 1 : t) < 0 && (t = 0),
"vertical" === this.orientation && (t = 1 - t),
(e = this._valueMax() - this._valueMin()),
(t = this._valueMin() + t * e),
this._trimAlignValue(t)
);
},
_uiHash: function (t, e, i) {
var s = {
handle: this.handles[t],
handleIndex: t,
value: void 0 !== e ? e : this.value(),
};
return (
this._hasMultipleValues() &&
((s.value = void 0 !== e ? e : this.values(t)),
(s.values = i || this.values())),
s
);
},
_hasMultipleValues: function () {
return this.options.values && this.options.values.length;
},
_start: function (t, e) {
return this._trigger("start", t, this._uiHash(e));
},
_slide: function (t, e, i) {
var s,
n = this.value(),
o = this.values();
this._hasMultipleValues() &&
((s = this.values(e ? 0 : 1)),
(n = this.values(e)),
2 === this.options.values.length &&
!0 === this.options.range &&
(i = 0 === e ? Math.min(s, i) : Math.max(s, i)),
(o[e] = i)),
i !== n &&
!1 !== this._trigger("slide", t, this._uiHash(e, i, o)) &&
(this._hasMultipleValues() ? this.values(e, i) : this.value(i));
},
_stop: function (t, e) {
this._trigger("stop", t, this._uiHash(e));
},
_change: function (t, e) {
this._keySliding ||
this._mouseSliding ||
((this._lastChangedValue = e),
this._trigger("change", t, this._uiHash(e)));
},
value: function (t) {
if (!arguments.length) return this._value();
(this.options.value = this._trimAlignValue(t)),
this._refreshValue(),
this._change(null, 0);
},
values: function (t, e) {
var i, s, n;
if (1 < arguments.length)
(this.options.values[t] = this._trimAlignValue(e)),
this._refreshValue(),
this._change(null, t);
else {
if (!arguments.length) return this._values();
if (!Array.isArray(t))
return this._hasMultipleValues() ? this._values(t) : this.value();
for (i = this.options.values, s = t, n = 0; n < i.length; n += 1)
(i[n] = this._trimAlignValue(s[n])), this._change(null, n);
this._refreshValue();
}
},
_setOption: function (t, e) {
var i,
s = 0;
switch (
("range" === t &&
!0 === this.options.range &&
("min" === e
? ((this.options.value = this._values(0)),
(this.options.values = null))
: "max" === e &&
((this.options.value = this._values(
this.options.values.length - 1
)),
(this.options.values = null))),
Array.isArray(this.options.values) &&
(s = this.options.values.length),
this._super(t, e),
t)
) {
case "orientation":
this._detectOrientation(),
this._removeClass(
"ui-slider-horizontal ui-slider-vertical"
)._addClass("ui-slider-" + this.orientation),
this._refreshValue(),
this.options.range && this._refreshRange(e),
this.handles.css("horizontal" === e ? "bottom" : "left", "");
break;
case "value":
(this._animateOff = !0),
this._refreshValue(),
this._change(null, 0),
(this._animateOff = !1);
break;
case "values":
for (
this._animateOff = !0, this._refreshValue(), i = s - 1;
0 <= i;
i--
)
this._change(null, i);
this._animateOff = !1;
break;
case "step":
case "min":
case "max":
(this._animateOff = !0),
this._calculateNewMax(),
this._refreshValue(),
(this._animateOff = !1);
break;
case "range":
(this._animateOff = !0), this._refresh(), (this._animateOff = !1);
}
},
_setOptionDisabled: function (t) {
this._super(t), this._toggleClass(null, "ui-state-disabled", !!t);
},
_value: function () {
var t = this.options.value;
return this._trimAlignValue(t);
},
_values: function (t) {
var e, i;
if (arguments.length)
return (t = this.options.values[t]), this._trimAlignValue(t);
if (this._hasMultipleValues()) {
for (e = this.options.values.slice(), i = 0; i < e.length; i += 1)
e[i] = this._trimAlignValue(e[i]);
return e;
}
return [];
},
_trimAlignValue: function (t) {
var e, i;
return t <= this._valueMin()
? this._valueMin()
: t >= this._valueMax()
? this._valueMax()
: ((e = 0 < this.options.step ? this.options.step : 1),
(i = t - (t = (t - this._valueMin()) % e)),
2 * Math.abs(t) >= e && (i += 0 < t ? e : -e),
parseFloat(i.toFixed(5)));
},
_calculateNewMax: function () {
var t = this.options.max,
e = this._valueMin(),
i = this.options.step;
(t = Math.round((t - e) / i) * i + e) > this.options.max && (t -= i),
(this.max = parseFloat(t.toFixed(this._precision())));
},
_precision: function () {
var t = this._precisionOf(this.options.step);
return (t =
null !== this.options.min
? Math.max(t, this._precisionOf(this.options.min))
: t);
},
_precisionOf: function (t) {
var t = t.toString(),
e = t.indexOf(".");
return -1 === e ? 0 : t.length - e - 1;
},
_valueMin: function () {
return this.options.min;
},
_valueMax: function () {
return this.max;
},
_refreshRange: function (t) {
"vertical" === t && this.range.css({ width: "", left: "" }),
"horizontal" === t && this.range.css({ height: "", bottom: "" });
},
_refreshValue: function () {
var e,
i,
t,
s,
n,
o = this.options.range,
a = this.options,
r = this,
l = !this._animateOff && a.animate,
h = {};
this._hasMultipleValues()
? this.handles.each(function (t) {
(i =
((r.values(t) - r._valueMin()) /
(r._valueMax() - r._valueMin())) *
100),
(h["horizontal" === r.orientation ? "left" : "bottom"] =
i + "%"),
V(this).stop(1, 1)[l ? "animate" : "css"](h, a.animate),
!0 === r.options.range &&
("horizontal" === r.orientation
? (0 === t &&
r.range
.stop(1, 1)
[l ? "animate" : "css"]({ left: i + "%" }, a.animate),
1 === t &&
r.range[l ? "animate" : "css"](
{ width: i - e + "%" },
{ queue: !1, duration: a.animate }
))
: (0 === t &&
r.range
.stop(1, 1)
[l ? "animate" : "css"](
{ bottom: i + "%" },
a.animate
),
1 === t &&
r.range[l ? "animate" : "css"](
{ height: i - e + "%" },
{ queue: !1, duration: a.animate }
))),
(e = i);
})
: ((t = this.value()),
(s = this._valueMin()),
(n = this._valueMax()),
(i = n !== s ? ((t - s) / (n - s)) * 100 : 0),
(h["horizontal" === this.orientation ? "left" : "bottom"] =
i + "%"),
this.handle.stop(1, 1)[l ? "animate" : "css"](h, a.animate),
"min" === o &&
"horizontal" === this.orientation &&
this.range
.stop(1, 1)
[l ? "animate" : "css"]({ width: i + "%" }, a.animate),
"max" === o &&
"horizontal" === this.orientation &&
this.range
.stop(1, 1)
[l ? "animate" : "css"]({ width: 100 - i + "%" }, a.animate),
"min" === o &&
"vertical" === this.orientation &&
this.range
.stop(1, 1)
[l ? "animate" : "css"]({ height: i + "%" }, a.animate),
"max" === o &&
"vertical" === this.orientation &&
this.range
.stop(1, 1)
[l ? "animate" : "css"]({ height: 100 - i + "%" }, a.animate));
},
_handleEvents: {
keydown: function (t) {
var e,
i,
s,
n = V(t.target).data("ui-slider-handle-index");
switch (t.keyCode) {
case V.ui.keyCode.HOME:
case V.ui.keyCode.END:
case V.ui.keyCode.PAGE_UP:
case V.ui.keyCode.PAGE_DOWN:
case V.ui.keyCode.UP:
case V.ui.keyCode.RIGHT:
case V.ui.keyCode.DOWN:
case V.ui.keyCode.LEFT:
if (
(t.preventDefault(),
this._keySliding ||
((this._keySliding = !0),
this._addClass(V(t.target), null, "ui-state-active"),
!1 !== this._start(t, n)))
)
break;
return;
}
switch (
((s = this.options.step),
(e = i = this._hasMultipleValues() ? this.values(n) : this.value()),
t.keyCode)
) {
case V.ui.keyCode.HOME:
i = this._valueMin();
break;
case V.ui.keyCode.END:
i = this._valueMax();
break;
case V.ui.keyCode.PAGE_UP:
i = this._trimAlignValue(
e + (this._valueMax() - this._valueMin()) / this.numPages
);
break;
case V.ui.keyCode.PAGE_DOWN:
i = this._trimAlignValue(
e - (this._valueMax() - this._valueMin()) / this.numPages
);
break;
case V.ui.keyCode.UP:
case V.ui.keyCode.RIGHT:
if (e === this._valueMax()) return;
i = this._trimAlignValue(e + s);
break;
case V.ui.keyCode.DOWN:
case V.ui.keyCode.LEFT:
if (e === this._valueMin()) return;
i = this._trimAlignValue(e - s);
}
this._slide(t, n, i);
},
keyup: function (t) {
var e = V(t.target).data("ui-slider-handle-index");
this._keySliding &&
((this._keySliding = !1),
this._stop(t, e),
this._change(t, e),
this._removeClass(V(t.target), null, "ui-state-active"));
},
},
}),
V.widget("ui.sortable", V.ui.mouse, {
version: "1.14.1",
widgetEventPrefix: "sort",
ready: !1,
options: {
appendTo: "parent",
axis: !1,
connectWith: !1,
containment: !1,
cursor: "auto",
cursorAt: !1,
dropOnEmpty: !0,
forcePlaceholderSize: !1,
forceHelperSize: !1,
grid: !1,
handle: !1,
helper: "original",
items: "> *",
opacity: !1,
placeholder: !1,
revert: !1,
scroll: !0,
scrollSensitivity: 20,
scrollSpeed: 20,
scope: "default",
tolerance: "intersect",
zIndex: 1e3,
activate: null,
beforeStop: null,
change: null,
deactivate: null,
out: null,
over: null,
receive: null,
remove: null,
sort: null,
start: null,
stop: null,
update: null,
},
_isOverAxis: function (t, e, i) {
return e <= t && t < e + i;
},
_isFloating: function (t) {
return (
/left|right/.test(t.css("float")) ||
/inline|table-cell/.test(t.css("display"))
);
},
_create: function () {
(this.containerCache = {}),
this._addClass("ui-sortable"),
this.refresh(),
(this.offset = this.element.offset()),
this._mouseInit(),
this._setHandleClassName(),
(this.ready = !0);
},
_setOption: function (t, e) {
this._super(t, e), "handle" === t && this._setHandleClassName();
},
_setHandleClassName: function () {
var t = this;
this._removeClass(
this.element.find(".ui-sortable-handle"),
"ui-sortable-handle"
),
V.each(this.items, function () {
t._addClass(
this.instance.options.handle
? this.item.find(this.instance.options.handle)
: this.item,
"ui-sortable-handle"
);
});
},
_destroy: function () {
this._mouseDestroy();
for (var t = this.items.length - 1; 0 <= t; t--)
this.items[t].item.removeData(this.widgetName + "-item");
return this;
},
_mouseCapture: function (t, e) {
var i = null,
s = !1,
n = this;
return !(
this.reverting ||
this.options.disabled ||
"static" === this.options.type ||
(this._refreshItems(t),
V(t.target)
.parents()
.each(function () {
if (V.data(this, n.widgetName + "-item") === n)
return (i = V(this)), !1;
}),
!(i =
V.data(t.target, n.widgetName + "-item") === n
? V(t.target)
: i)) ||
(this.options.handle &&
!e &&
(V(this.options.handle, i)
.find("*")
.addBack()
.each(function () {
this === t.target && (s = !0);
}),
!s)) ||
((this.currentItem = i), this._removeCurrentsFromItems(), 0)
);
},
_mouseStart: function (t, e, i) {
var s,
n,
o = this.options;
if (
((this.currentContainer = this).refreshPositions(),
(this.appendTo = V(
"parent" !== o.appendTo ? o.appendTo : this.currentItem.parent()
)),
(this.helper = this._createHelper(t)),
this._cacheHelperProportions(),
this._cacheMargins(),
(this.offset = this.currentItem.offset()),
(this.offset = {
top: this.offset.top - this.margins.top,
left: this.offset.left - this.margins.left,
}),
V.extend(this.offset, {
click: {
left: t.pageX - this.offset.left,
top: t.pageY - this.offset.top,
},
relative: this._getRelativeOffset(),
}),
this.helper.css("position", "absolute"),
(this.cssPosition = this.helper.css("position")),
o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt),
(this.domPosition = {
prev: this.currentItem.prev()[0],
parent: this.currentItem.parent()[0],
}),
this.helper[0] !== this.currentItem[0] && this.currentItem.hide(),
this._createPlaceholder(),
(this.scrollParent = this.placeholder.scrollParent()),
V.extend(this.offset, { parent: this._getParentOffset() }),
o.containment && this._setContainment(),
o.cursor &&
"auto" !== o.cursor &&
((n = this.document.find("body")),
(this._storedStylesheet = V(
""
).appendTo(n))),
o.zIndex &&
(this.helper.css("zIndex") &&
(this._storedZIndex = this.helper.css("zIndex")),
this.helper.css("zIndex", o.zIndex)),
o.opacity &&
(this.helper.css("opacity") &&
(this._storedOpacity = this.helper.css("opacity")),
this.helper.css("opacity", o.opacity)),
this.scrollParent[0] !== this.document[0] &&
"HTML" !== this.scrollParent[0].tagName &&
(this.overflowOffset = this.scrollParent.offset()),
this._trigger("start", t, this._uiHash()),
this._preserveHelperProportions || this._cacheHelperProportions(),
!i)
)
for (s = this.containers.length - 1; 0 <= s; s--)
this.containers[s]._trigger("activate", t, this._uiHash(this));
return (
V.ui.ddmanager && (V.ui.ddmanager.current = this),
V.ui.ddmanager &&
!o.dropBehaviour &&
V.ui.ddmanager.prepareOffsets(this, t),
(this.dragging = !0),
this._addClass(this.helper, "ui-sortable-helper"),
this.helper.parent().is(this.appendTo) ||
(this.helper.detach().appendTo(this.appendTo),
(this.offset.parent = this._getParentOffset())),
(this.position = this.originalPosition = this._generatePosition(t)),
(this.originalPageX = t.pageX),
(this.originalPageY = t.pageY),
(this.lastPositionAbs = this.positionAbs =
this._convertPositionTo("absolute")),
this._mouseDrag(t),
!0
);
},
_scroll: function (t) {
var e = this.options,
i = !1;
return (
this.scrollParent[0] !== this.document[0] &&
"HTML" !== this.scrollParent[0].tagName
? (this.overflowOffset.top +
this.scrollParent[0].offsetHeight -
t.pageY <
e.scrollSensitivity
? (this.scrollParent[0].scrollTop = i =
this.scrollParent[0].scrollTop + e.scrollSpeed)
: t.pageY - this.overflowOffset.top < e.scrollSensitivity &&
(this.scrollParent[0].scrollTop = i =
this.scrollParent[0].scrollTop - e.scrollSpeed),
this.overflowOffset.left +
this.scrollParent[0].offsetWidth -
t.pageX <
e.scrollSensitivity
? (this.scrollParent[0].scrollLeft = i =
this.scrollParent[0].scrollLeft + e.scrollSpeed)
: t.pageX - this.overflowOffset.left < e.scrollSensitivity &&
(this.scrollParent[0].scrollLeft = i =
this.scrollParent[0].scrollLeft - e.scrollSpeed))
: (t.pageY - this.document.scrollTop() < e.scrollSensitivity
? (i = this.document.scrollTop(
this.document.scrollTop() - e.scrollSpeed
))
: this.window.height() - (t.pageY - this.document.scrollTop()) <
e.scrollSensitivity &&
(i = this.document.scrollTop(
this.document.scrollTop() + e.scrollSpeed
)),
t.pageX - this.document.scrollLeft() < e.scrollSensitivity
? (i = this.document.scrollLeft(
this.document.scrollLeft() - e.scrollSpeed
))
: this.window.width() - (t.pageX - this.document.scrollLeft()) <
e.scrollSensitivity &&
(i = this.document.scrollLeft(
this.document.scrollLeft() + e.scrollSpeed
))),
i
);
},
_mouseDrag: function (t) {
var e,
i,
s,
n,
o = this.options;
for (
this.position = this._generatePosition(t),
this.positionAbs = this._convertPositionTo("absolute"),
(this.options.axis && "y" === this.options.axis) ||
(this.helper[0].style.left = this.position.left + "px"),
(this.options.axis && "x" === this.options.axis) ||
(this.helper[0].style.top = this.position.top + "px"),
o.scroll &&
!1 !== this._scroll(t) &&
(this._refreshItemPositions(!0), V.ui.ddmanager) &&
!o.dropBehaviour &&
V.ui.ddmanager.prepareOffsets(this, t),
this.dragDirection = {
vertical: this._getDragVerticalDirection(),
horizontal: this._getDragHorizontalDirection(),
},
e = this.items.length - 1;
0 <= e;
e--
)
if (
((s = (i = this.items[e]).item[0]),
(n = this._intersectsWithPointer(i)) &&
i.instance === this.currentContainer &&
!(
s === this.currentItem[0] ||
this.placeholder[1 === n ? "next" : "prev"]()[0] === s ||
V.contains(this.placeholder[0], s) ||
("semi-dynamic" === this.options.type &&
V.contains(this.element[0], s))
))
) {
if (
((this.direction = 1 === n ? "down" : "up"),
"pointer" !== this.options.tolerance &&
!this._intersectsWithSides(i))
)
break;
this._rearrange(t, i), this._trigger("change", t, this._uiHash());
break;
}
return (
this._contactContainers(t),
V.ui.ddmanager && V.ui.ddmanager.drag(this, t),
this._trigger("sort", t, this._uiHash()),
(this.lastPositionAbs = this.positionAbs),
!1
);
},
_mouseStop: function (t, e) {
var i, s, n, o;
if (t)
return (
V.ui.ddmanager &&
!this.options.dropBehaviour &&
V.ui.ddmanager.drop(this, t),
this.options.revert
? ((s = (i = this).placeholder.offset()),
(o = {}),
((n = this.options.axis) && "x" !== n) ||
(o.left =
s.left -
this.offset.parent.left -
this.margins.left +
(this.offsetParent[0] === this.document[0].body
? 0
: this.offsetParent[0].scrollLeft)),
(n && "y" !== n) ||
(o.top =
s.top -
this.offset.parent.top -
this.margins.top +
(this.offsetParent[0] === this.document[0].body
? 0
: this.offsetParent[0].scrollTop)),
(this.reverting = !0),
V(this.helper).animate(
o,
parseInt(this.options.revert, 10) || 500,
function () {
i._clear(t);
}
))
: this._clear(t, e),
!1
);
},
cancel: function () {
if (this.dragging) {
this._mouseUp(new V.Event("mouseup", { target: null })),
"original" === this.options.helper
? (this.currentItem.css(this._storedCSS),
this._removeClass(this.currentItem, "ui-sortable-helper"))
: this.currentItem.show();
for (var t = this.containers.length - 1; 0 <= t; t--)
this.containers[t]._trigger("deactivate", null, this._uiHash(this)),
this.containers[t].containerCache.over &&
(this.containers[t]._trigger("out", null, this._uiHash(this)),
(this.containers[t].containerCache.over = 0));
}
return (
this.placeholder &&
(this.placeholder[0].parentNode &&
this.placeholder[0].parentNode.removeChild(this.placeholder[0]),
"original" !== this.options.helper &&
this.helper &&
this.helper[0].parentNode &&
this.helper.remove(),
V.extend(this, {
helper: null,
dragging: !1,
reverting: !1,
_noFinalSort: null,
}),
this.domPosition.prev
? V(this.domPosition.prev).after(this.currentItem)
: V(this.domPosition.parent).prepend(this.currentItem)),
this
);
},
serialize: function (e) {
var t = this._getItemsAsjQuery(e && e.connected),
i = [];
return (
(e = e || {}),
V(t).each(function () {
var t = (V(e.item || this).attr(e.attribute || "id") || "").match(
e.expression || /(.+)[\-=_](.+)/
);
t &&
i.push(
(e.key || t[1] + "[]") +
"=" +
(e.key && e.expression ? t[1] : t[2])
);
}),
!i.length && e.key && i.push(e.key + "="),
i.join("&")
);
},
toArray: function (t) {
var e = this._getItemsAsjQuery(t && t.connected),
i = [];
return (
(t = t || {}),
e.each(function () {
i.push(V(t.item || this).attr(t.attribute || "id") || "");
}),
i
);
},
_intersectsWith: function (t) {
var e = this.positionAbs.left,
i = e + this.helperProportions.width,
s = this.positionAbs.top,
n = s + this.helperProportions.height,
o = t.left,
a = o + t.width,
r = t.top,
l = r + t.height,
h = this.offset.click.top,
c = this.offset.click.left,
h = "x" === this.options.axis || (r < s + h && s + h < l),
c = "y" === this.options.axis || (o < e + c && e + c < a);
return "pointer" === this.options.tolerance ||
this.options.forcePointerForContainers ||
("pointer" !== this.options.tolerance &&
this.helperProportions[this.floating ? "width" : "height"] >
t[this.floating ? "width" : "height"])
? h && c
: o < e + this.helperProportions.width / 2 &&
i - this.helperProportions.width / 2 < a &&
r < s + this.helperProportions.height / 2 &&
n - this.helperProportions.height / 2 < l;
},
_intersectsWithPointer: function (t) {
var e =
"x" === this.options.axis ||
this._isOverAxis(
this.positionAbs.top + this.offset.click.top,
t.top,
t.height
),
t =
"y" === this.options.axis ||
this._isOverAxis(
this.positionAbs.left + this.offset.click.left,
t.left,
t.width
);
return (
!(!e || !t) &&
((e = this.dragDirection.vertical),
(t = this.dragDirection.horizontal),
this.floating
? "right" === t || "down" === e
? 2
: 1
: e && ("down" === e ? 2 : 1))
);
},
_intersectsWithSides: function (t) {
var e = this._isOverAxis(
this.positionAbs.top + this.offset.click.top,
t.top + t.height / 2,
t.height
),
t = this._isOverAxis(
this.positionAbs.left + this.offset.click.left,
t.left + t.width / 2,
t.width
),
i = this.dragDirection.vertical,
s = this.dragDirection.horizontal;
return this.floating && s
? ("right" === s && t) || ("left" === s && !t)
: i && (("down" === i && e) || ("up" === i && !e));
},
_getDragVerticalDirection: function () {
var t = this.positionAbs.top - this.lastPositionAbs.top;
return 0 != t && (0 < t ? "down" : "up");
},
_getDragHorizontalDirection: function () {
var t = this.positionAbs.left - this.lastPositionAbs.left;
return 0 != t && (0 < t ? "right" : "left");
},
refresh: function (t) {
return (
this._refreshItems(t),
this._setHandleClassName(),
this.refreshPositions(),
this
);
},
_connectWith: function () {
var t = this.options;
return t.connectWith.constructor === String
? [t.connectWith]
: t.connectWith;
},
_getItemsAsjQuery: function (t) {
var e,
i,
s,
n,
o = [],
a = [],
r = this._connectWith();
if (r && t)
for (e = r.length - 1; 0 <= e; e--)
for (i = (s = V(r[e], this.document[0])).length - 1; 0 <= i; i--)
(n = V.data(s[i], this.widgetFullName)) &&
n !== this &&
!n.options.disabled &&
a.push([
"function" == typeof n.options.items
? n.options.items.call(n.element)
: V(n.options.items, n.element)
.not(".ui-sortable-helper")
.not(".ui-sortable-placeholder"),
n,
]);
function l() {
o.push(this);
}
for (
a.push([
"function" == typeof this.options.items
? this.options.items.call(this.element, null, {
options: this.options,
item: this.currentItem,
})
: V(this.options.items, this.element)
.not(".ui-sortable-helper")
.not(".ui-sortable-placeholder"),
this,
]),
e = a.length - 1;
0 <= e;
e--
)
a[e][0].each(l);
return V(o);
},
_removeCurrentsFromItems: function () {
var i = this.currentItem.find(":data(" + this.widgetName + "-item)");
this.items = V.grep(this.items, function (t) {
for (var e = 0; e < i.length; e++) if (i[e] === t.item[0]) return !1;
return !0;
});
},
_refreshItems: function (t) {
(this.items = []), (this.containers = [this]);
var e,
i,
s,
n,
o,
a,
r,
l,
h = this.items,
c = [
[
"function" == typeof this.options.items
? this.options.items.call(this.element[0], t, {
item: this.currentItem,
})
: V(this.options.items, this.element),
this,
],
],
u = this._connectWith();
if (u && this.ready)
for (e = u.length - 1; 0 <= e; e--)
for (i = (s = V(u[e], this.document[0])).length - 1; 0 <= i; i--)
(n = V.data(s[i], this.widgetFullName)) &&
n !== this &&
!n.options.disabled &&
(c.push([
"function" == typeof n.options.items
? n.options.items.call(n.element[0], t, {
item: this.currentItem,
})
: V(n.options.items, n.element),
n,
]),
this.containers.push(n));
for (e = c.length - 1; 0 <= e; e--)
for (o = c[e][1], l = (a = c[e][(i = 0)]).length; i < l; i++)
(r = V(a[i])).data(this.widgetName + "-item", o),
h.push({
item: r,
instance: o,
width: 0,
height: 0,
left: 0,
top: 0,
});
},
_refreshItemPositions: function (t) {
for (var e, i, s = this.items.length - 1; 0 <= s; s--)
(e = this.items[s]),
(this.currentContainer &&
e.instance !== this.currentContainer &&
e.item[0] !== this.currentItem[0]) ||
((i = this.options.toleranceElement
? V(this.options.toleranceElement, e.item)
: e.item),
t || ((e.width = i.outerWidth()), (e.height = i.outerHeight())),
(i = i.offset()),
(e.left = i.left),
(e.top = i.top));
},
refreshPositions: function (t) {
var e, i;
if (
((this.floating =
!!this.items.length &&
("x" === this.options.axis ||
this._isFloating(this.items[0].item))),
this.offsetParent &&
this.helper &&
(this.offset.parent = this._getParentOffset()),
this._refreshItemPositions(t),
this.options.custom && this.options.custom.refreshContainers)
)
this.options.custom.refreshContainers.call(this);
else
for (e = this.containers.length - 1; 0 <= e; e--)
(i = this.containers[e].element.offset()),
(this.containers[e].containerCache.left = i.left),
(this.containers[e].containerCache.top = i.top),
(this.containers[e].containerCache.width =
this.containers[e].element.outerWidth()),
(this.containers[e].containerCache.height =
this.containers[e].element.outerHeight());
return this;
},
_createPlaceholder: function (i) {
var s,
n,
o = (i = i || this).options;
(o.placeholder && o.placeholder.constructor !== String) ||
((s = o.placeholder),
(n = i.currentItem[0].nodeName.toLowerCase()),
(o.placeholder = {
element: function () {
var t = V("<" + n + ">", i.document[0]);
return (
i
._addClass(
t,
"ui-sortable-placeholder",
s || i.currentItem[0].className
)
._removeClass(t, "ui-sortable-helper"),
"tbody" === n
? i._createTrPlaceholder(
i.currentItem.find("tr").eq(0),
V("
", i.document[0]).appendTo(t)
)
: "tr" === n
? i._createTrPlaceholder(i.currentItem, t)
: "img" === n && t.attr("src", i.currentItem.attr("src")),
s || t.css("visibility", "hidden"),
t
);
},
update: function (t, e) {
(s && !o.forcePlaceholderSize) ||
((e.height() &&
(!o.forcePlaceholderSize || ("tbody" !== n && "tr" !== n))) ||
e.height(
i.currentItem.innerHeight() -
parseInt(i.currentItem.css("paddingTop") || 0, 10) -
parseInt(i.currentItem.css("paddingBottom") || 0, 10)
),
e.width()) ||
e.width(
i.currentItem.innerWidth() -
parseInt(i.currentItem.css("paddingLeft") || 0, 10) -
parseInt(i.currentItem.css("paddingRight") || 0, 10)
);
},
})),
(i.placeholder = V(
o.placeholder.element.call(i.element, i.currentItem)
)),
i.currentItem.after(i.placeholder),
o.placeholder.update(i, i.placeholder);
},
_createTrPlaceholder: function (t, e) {
var i = this;
t.children().each(function () {
V(" | ", i.document[0])
.attr("colspan", V(this).attr("colspan") || 1)
.appendTo(e);
});
},
_contactContainers: function (t) {
for (
var e,
i,
s,
n,
o,
a,
r,
l,
h,
c = null,
u = null,
d = this.containers.length - 1;
0 <= d;
d--
)
V.contains(this.currentItem[0], this.containers[d].element[0]) ||
(this._intersectsWith(this.containers[d].containerCache)
? (c &&
V.contains(this.containers[d].element[0], c.element[0])) ||
((c = this.containers[d]), (u = d))
: this.containers[d].containerCache.over &&
(this.containers[d]._trigger("out", t, this._uiHash(this)),
(this.containers[d].containerCache.over = 0)));
if (c)
if (1 === this.containers.length)
this.containers[u].containerCache.over ||
(this.containers[u]._trigger("over", t, this._uiHash(this)),
(this.containers[u].containerCache.over = 1));
else {
for (
i = 1e4,
s = null,
n = (l = c.floating || this._isFloating(this.currentItem))
? "left"
: "top",
o = l ? "width" : "height",
h = l ? "pageX" : "pageY",
e = this.items.length - 1;
0 <= e;
e--
)
V.contains(
this.containers[u].element[0],
this.items[e].item[0]
) &&
this.items[e].item[0] !== this.currentItem[0] &&
((a = this.items[e].item.offset()[n]),
(r = !1),
t[h] - a > this.items[e][o] / 2 && (r = !0),
Math.abs(t[h] - a) < i) &&
((i = Math.abs(t[h] - a)),
(s = this.items[e]),
(this.direction = r ? "up" : "down"));
(s || this.options.dropOnEmpty) &&
(this.currentContainer === this.containers[u]
? this.currentContainer.containerCache.over ||
(this.containers[u]._trigger("over", t, this._uiHash()),
(this.currentContainer.containerCache.over = 1))
: (s
? this._rearrange(t, s, null, !0)
: this._rearrange(t, null, this.containers[u].element, !0),
this._trigger("change", t, this._uiHash()),
this.containers[u]._trigger("change", t, this._uiHash(this)),
(this.currentContainer = this.containers[u]),
this.options.placeholder.update(
this.currentContainer,
this.placeholder
),
(this.scrollParent = this.placeholder.scrollParent()),
this.scrollParent[0] !== this.document[0] &&
"HTML" !== this.scrollParent[0].tagName &&
(this.overflowOffset = this.scrollParent.offset()),
this.containers[u]._trigger("over", t, this._uiHash(this)),
(this.containers[u].containerCache.over = 1)));
}
},
_createHelper: function (t) {
var e = this.options,
t =
"function" == typeof e.helper
? V(e.helper.apply(this.element[0], [t, this.currentItem]))
: "clone" === e.helper
? this.currentItem.clone()
: this.currentItem;
return (
t.parents("body").length || this.appendTo[0].appendChild(t[0]),
t[0] === this.currentItem[0] &&
(this._storedCSS = {
width: this.currentItem[0].style.width,
height: this.currentItem[0].style.height,
position: this.currentItem.css("position"),
top: this.currentItem.css("top"),
left: this.currentItem.css("left"),
}),
(t[0].style.width && !e.forceHelperSize) ||
t.width(this.currentItem.width()),
(t[0].style.height && !e.forceHelperSize) ||
t.height(this.currentItem.height()),
t
);
},
_adjustOffsetFromHelper: function (t) {
"string" == typeof t && (t = t.split(" ")),
"left" in
(t = Array.isArray(t) ? { left: +t[0], top: +t[1] || 0 } : t) &&
(this.offset.click.left = t.left + this.margins.left),
"right" in t &&
(this.offset.click.left =
this.helperProportions.width - t.right + this.margins.left),
"top" in t && (this.offset.click.top = t.top + this.margins.top),
"bottom" in t &&
(this.offset.click.top =
this.helperProportions.height - t.bottom + this.margins.top);
},
_getParentOffset: function () {
this.offsetParent = this.helper.offsetParent();
var t = this.offsetParent.offset();
return (
"absolute" === this.cssPosition &&
this.scrollParent[0] !== this.document[0] &&
V.contains(this.scrollParent[0], this.offsetParent[0]) &&
((t.left += this.scrollParent.scrollLeft()),
(t.top += this.scrollParent.scrollTop())),
{
top:
(t =
this.offsetParent[0] === this.document[0].body
? { top: 0, left: 0 }
: t).top +
(parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
left:
t.left +
(parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0),
}
);
},
_getRelativeOffset: function () {
var t;
return "relative" === this.cssPosition
? {
top:
(t = this.currentItem.position()).top -
(parseInt(this.helper.css("top"), 10) || 0) +
this.scrollParent.scrollTop(),
left:
t.left -
(parseInt(this.helper.css("left"), 10) || 0) +
this.scrollParent.scrollLeft(),
}
: { top: 0, left: 0 };
},
_cacheMargins: function () {
this.margins = {
left: parseInt(this.currentItem.css("marginLeft"), 10) || 0,
top: parseInt(this.currentItem.css("marginTop"), 10) || 0,
};
},
_cacheHelperProportions: function () {
this.helperProportions = {
width: this.helper.outerWidth(),
height: this.helper.outerHeight(),
};
},
_setContainment: function () {
var t,
e,
i = this.options;
"parent" === i.containment &&
(i.containment = this.helper[0].parentNode),
("document" !== i.containment && "window" !== i.containment) ||
(this.containment = [
0 - this.offset.relative.left - this.offset.parent.left,
0 - this.offset.relative.top - this.offset.parent.top,
"document" === i.containment
? this.document.width()
: this.window.width() -
this.helperProportions.width -
this.margins.left,
("document" === i.containment
? this.document.height() ||
document.body.parentNode.scrollHeight
: this.window.height() ||
this.document[0].body.parentNode.scrollHeight) -
this.helperProportions.height -
this.margins.top,
]),
/^(document|window|parent)$/.test(i.containment) ||
((t = V(i.containment)[0]),
(i = V(i.containment).offset()),
(e = "hidden" !== V(t).css("overflow")),
(this.containment = [
i.left +
(parseInt(V(t).css("borderLeftWidth"), 10) || 0) +
(parseInt(V(t).css("paddingLeft"), 10) || 0) -
this.margins.left,
i.top +
(parseInt(V(t).css("borderTopWidth"), 10) || 0) +
(parseInt(V(t).css("paddingTop"), 10) || 0) -
this.margins.top,
i.left +
(e ? Math.max(t.scrollWidth, t.offsetWidth) : t.offsetWidth) -
(parseInt(V(t).css("borderLeftWidth"), 10) || 0) -
(parseInt(V(t).css("paddingRight"), 10) || 0) -
this.helperProportions.width -
this.margins.left,
i.top +
(e
? Math.max(t.scrollHeight, t.offsetHeight)
: t.offsetHeight) -
(parseInt(V(t).css("borderTopWidth"), 10) || 0) -
(parseInt(V(t).css("paddingBottom"), 10) || 0) -
this.helperProportions.height -
this.margins.top,
]));
},
_convertPositionTo: function (t, e) {
e = e || this.position;
var t = "absolute" === t ? 1 : -1,
i =
"absolute" !== this.cssPosition ||
(this.scrollParent[0] !== this.document[0] &&
V.contains(this.scrollParent[0], this.offsetParent[0]))
? this.scrollParent
: this.offsetParent,
s = /(html|body)/i.test(i[0].tagName);
return {
top:
e.top +
this.offset.relative.top * t +
this.offset.parent.top * t -
("fixed" === this.cssPosition
? -this.scrollParent.scrollTop()
: s
? 0
: i.scrollTop()) *
t,
left:
e.left +
this.offset.relative.left * t +
this.offset.parent.left * t -
("fixed" === this.cssPosition
? -this.scrollParent.scrollLeft()
: s
? 0
: i.scrollLeft()) *
t,
};
},
_generatePosition: function (t) {
var e = this.options,
i = t.pageX,
s = t.pageY,
n =
"absolute" !== this.cssPosition ||
(this.scrollParent[0] !== this.document[0] &&
V.contains(this.scrollParent[0], this.offsetParent[0]))
? this.scrollParent
: this.offsetParent,
o = /(html|body)/i.test(n[0].tagName);
return (
"relative" !== this.cssPosition ||
(this.scrollParent[0] !== this.document[0] &&
this.scrollParent[0] !== this.offsetParent[0]) ||
(this.offset.relative = this._getRelativeOffset()),
this.originalPosition &&
(this.containment &&
(t.pageX - this.offset.click.left < this.containment[0] &&
(i = this.containment[0] + this.offset.click.left),
t.pageY - this.offset.click.top < this.containment[1] &&
(s = this.containment[1] + this.offset.click.top),
t.pageX - this.offset.click.left > this.containment[2] &&
(i = this.containment[2] + this.offset.click.left),
t.pageY - this.offset.click.top > this.containment[3]) &&
(s = this.containment[3] + this.offset.click.top),
e.grid) &&
((t =
this.originalPageY +
Math.round((s - this.originalPageY) / e.grid[1]) * e.grid[1]),
(s =
!this.containment ||
(t - this.offset.click.top >= this.containment[1] &&
t - this.offset.click.top <= this.containment[3])
? t
: t - this.offset.click.top >= this.containment[1]
? t - e.grid[1]
: t + e.grid[1]),
(t =
this.originalPageX +
Math.round((i - this.originalPageX) / e.grid[0]) * e.grid[0]),
(i =
!this.containment ||
(t - this.offset.click.left >= this.containment[0] &&
t - this.offset.click.left <= this.containment[2])
? t
: t - this.offset.click.left >= this.containment[0]
? t - e.grid[0]
: t + e.grid[0])),
{
top:
s -
this.offset.click.top -
this.offset.relative.top -
this.offset.parent.top +
("fixed" === this.cssPosition
? -this.scrollParent.scrollTop()
: o
? 0
: n.scrollTop()),
left:
i -
this.offset.click.left -
this.offset.relative.left -
this.offset.parent.left +
("fixed" === this.cssPosition
? -this.scrollParent.scrollLeft()
: o
? 0
: n.scrollLeft()),
}
);
},
_rearrange: function (t, e, i, s) {
i
? i[0].appendChild(this.placeholder[0])
: e.item[0].parentNode.insertBefore(
this.placeholder[0],
"down" === this.direction ? e.item[0] : e.item[0].nextSibling
),
(this.counter = this.counter ? ++this.counter : 1);
var n = this.counter;
this._delay(function () {
n === this.counter && this.refreshPositions(!s);
});
},
_clear: function (t, e) {
this.reverting = !1;
var i,
s = [];
if (
(!this._noFinalSort &&
this.currentItem.parent().length &&
this.placeholder.before(this.currentItem),
(this._noFinalSort = null),
this.helper[0] === this.currentItem[0])
) {
for (i in this._storedCSS)
("auto" !== this._storedCSS[i] &&
"static" !== this._storedCSS[i]) ||
(this._storedCSS[i] = "");
this.currentItem.css(this._storedCSS),
this._removeClass(this.currentItem, "ui-sortable-helper");
} else this.currentItem.show();
function n(e, i, s) {
return function (t) {
s._trigger(e, t, i._uiHash(i));
};
}
for (
this.fromOutside &&
!e &&
s.push(function (t) {
this._trigger("receive", t, this._uiHash(this.fromOutside));
}),
(!this.fromOutside &&
this.domPosition.prev ===
this.currentItem.prev().not(".ui-sortable-helper")[0] &&
this.domPosition.parent === this.currentItem.parent()[0]) ||
e ||
s.push(function (t) {
this._trigger("update", t, this._uiHash());
}),
this === this.currentContainer ||
e ||
(s.push(function (t) {
this._trigger("remove", t, this._uiHash());
}),
s.push(
function (e) {
return function (t) {
e._trigger("receive", t, this._uiHash(this));
};
}.call(this, this.currentContainer)
),
s.push(
function (e) {
return function (t) {
e._trigger("update", t, this._uiHash(this));
};
}.call(this, this.currentContainer)
)),
i = this.containers.length - 1;
0 <= i;
i--
)
e || s.push(n("deactivate", this, this.containers[i])),
this.containers[i].containerCache.over &&
(s.push(n("out", this, this.containers[i])),
(this.containers[i].containerCache.over = 0));
if (
(this._storedStylesheet &&
(this._storedStylesheet.remove(), (this._storedStylesheet = null)),
this._storedOpacity &&
this.helper.css("opacity", this._storedOpacity),
this._storedZIndex &&
this.helper.css(
"zIndex",
"auto" === this._storedZIndex ? "" : this._storedZIndex
),
(this.dragging = !1),
e || this._trigger("beforeStop", t, this._uiHash()),
this.placeholder[0].parentNode.removeChild(this.placeholder[0]),
this.cancelHelperRemoval ||
(this.helper[0] !== this.currentItem[0] && this.helper.remove(),
(this.helper = null)),
!e)
) {
for (i = 0; i < s.length; i++) s[i].call(this, t);
this._trigger("stop", t, this._uiHash());
}
return (this.fromOutside = !1), !this.cancelHelperRemoval;
},
_trigger: function () {
!1 === V.Widget.prototype._trigger.apply(this, arguments) &&
this.cancel();
},
_uiHash: function (t) {
var e = t || this;
return {
helper: e.helper,
placeholder: e.placeholder || V([]),
position: e.position,
originalPosition: e.originalPosition,
offset: e.positionAbs,
item: e.currentItem,
sender: t ? t.element : null,
};
},
});
function O(e) {
return function () {
var t = this.element.val();
e.apply(this, arguments),
this._refresh(),
t !== this.element.val() && this._trigger("change");
};
}
V.widget("ui.spinner", {
version: "1.14.1",
defaultElement: "",
widgetEventPrefix: "spin",
options: {
classes: {
"ui-spinner": "ui-corner-all",
"ui-spinner-down": "ui-corner-br",
"ui-spinner-up": "ui-corner-tr",
},
culture: null,
icons: { down: "ui-icon-triangle-1-s", up: "ui-icon-triangle-1-n" },
incremental: !0,
max: null,
min: null,
numberFormat: null,
page: 10,
step: 1,
change: null,
spin: null,
start: null,
stop: null,
},
_create: function () {
this._setOption("max", this.options.max),
this._setOption("min", this.options.min),
this._setOption("step", this.options.step),
"" !== this.value() && this._value(this.element.val(), !0),
this._draw(),
this._on(this._events),
this._refresh(),
this._on(this.window, {
beforeunload: function () {
this.element.removeAttr("autocomplete");
},
});
},
_getCreateOptions: function () {
var s = this._super(),
n = this.element;
return (
V.each(["min", "max", "step"], function (t, e) {
var i = n.attr(e);
null != i && i.length && (s[e] = i);
}),
s
);
},
_events: {
keydown: function (t) {
this._start(t) && this._keydown(t) && t.preventDefault();
},
keyup: "_stop",
focus: function () {
this.previous = this.element.val();
},
blur: function (t) {
this._stop(),
this._refresh(),
this.previous !== this.element.val() && this._trigger("change", t);
},
mousewheel: function (t, e) {
var i = this.document[0].activeElement;
if (this.element[0] === i && e) {
if (!this.spinning && !this._start(t)) return !1;
this._spin((0 < e ? 1 : -1) * this.options.step, t),
clearTimeout(this.mousewheelTimer),
(this.mousewheelTimer = this._delay(function () {
this.spinning && this._stop(t);
}, 100)),
t.preventDefault();
}
},
"mousedown .ui-spinner-button": function (t) {
var e;
(e =
this.element[0] === this.document[0].activeElement
? this.previous
: this.element.val()),
t.preventDefault(),
function () {
this.element[0] !== this.document[0].activeElement &&
(this.element.trigger("focus"), (this.previous = e));
}.call(this),
!1 !== this._start(t) &&
this._repeat(
null,
V(t.currentTarget).hasClass("ui-spinner-up") ? 1 : -1,
t
);
},
"mouseup .ui-spinner-button": "_stop",
"mouseenter .ui-spinner-button": function (t) {
if (V(t.currentTarget).hasClass("ui-state-active"))
return (
!1 !== this._start(t) &&
void this._repeat(
null,
V(t.currentTarget).hasClass("ui-spinner-up") ? 1 : -1,
t
)
);
},
"mouseleave .ui-spinner-button": "_stop",
},
_enhance: function () {
this.uiSpinner = this.element
.attr("autocomplete", "off")
.wrap("")
.parent()
.append("");
},
_draw: function () {
this._enhance(),
this._addClass(
this.uiSpinner,
"ui-spinner",
"ui-widget ui-widget-content"
),
this._addClass("ui-spinner-input"),
this.element.attr("role", "spinbutton"),
(this.buttons = this.uiSpinner
.children("a")
.attr("tabIndex", -1)
.attr("aria-hidden", !0)
.button({ classes: { "ui-button": "" } })),
this._removeClass(this.buttons, "ui-corner-all"),
this._addClass(this.buttons.first(), "ui-spinner-button ui-spinner-up"),
this._addClass(
this.buttons.last(),
"ui-spinner-button ui-spinner-down"
),
this.buttons
.first()
.button({ icon: this.options.icons.up, showLabel: !1 }),
this.buttons
.last()
.button({ icon: this.options.icons.down, showLabel: !1 }),
this.buttons.height() > Math.ceil(0.5 * this.uiSpinner.height()) &&
0 < this.uiSpinner.height() &&
this.uiSpinner.height(this.uiSpinner.height());
},
_keydown: function (t) {
var e = this.options,
i = V.ui.keyCode;
switch (t.keyCode) {
case i.UP:
return this._repeat(null, 1, t), !0;
case i.DOWN:
return this._repeat(null, -1, t), !0;
case i.PAGE_UP:
return this._repeat(null, e.page, t), !0;
case i.PAGE_DOWN:
return this._repeat(null, -e.page, t), !0;
}
return !1;
},
_start: function (t) {
return (
!(!this.spinning && !1 === this._trigger("start", t)) &&
(this.counter || (this.counter = 1), (this.spinning = !0))
);
},
_repeat: function (t, e, i) {
(t = t || 500),
clearTimeout(this.timer),
(this.timer = this._delay(function () {
this._repeat(40, e, i);
}, t)),
this._spin(e * this.options.step, i);
},
_spin: function (t, e) {
var i = this.value() || 0;
this.counter || (this.counter = 1),
(i = this._adjustValue(i + t * this._increment(this.counter))),
(this.spinning && !1 === this._trigger("spin", e, { value: i })) ||
(this._value(i), this.counter++);
},
_increment: function (t) {
var e = this.options.incremental;
return e
? "function" == typeof e
? e(t)
: Math.floor((t * t * t) / 5e4 - (t * t) / 500 + (17 * t) / 200 + 1)
: 1;
},
_precision: function () {
var t = this._precisionOf(this.options.step);
return (t =
null !== this.options.min
? Math.max(t, this._precisionOf(this.options.min))
: t);
},
_precisionOf: function (t) {
var t = t.toString(),
e = t.indexOf(".");
return -1 === e ? 0 : t.length - e - 1;
},
_adjustValue: function (t) {
var e = this.options,
i = null !== e.min ? e.min : 0,
s = t - i;
return (
(t = i + Math.round(s / e.step) * e.step),
(t = parseFloat(t.toFixed(this._precision()))),
null !== e.max && t > e.max
? e.max
: null !== e.min && t < e.min
? e.min
: t
);
},
_stop: function (t) {
this.spinning &&
(clearTimeout(this.timer),
clearTimeout(this.mousewheelTimer),
(this.counter = 0),
(this.spinning = !1),
this._trigger("stop", t));
},
_setOption: function (t, e) {
var i;
"culture" === t || "numberFormat" === t
? ((i = this._parse(this.element.val())),
(this.options[t] = e),
this.element.val(this._format(i)))
: (("max" !== t && "min" !== t && "step" !== t) ||
("string" == typeof e && (e = this._parse(e))),
"icons" === t &&
((i = this.buttons.first().find(".ui-icon")),
this._removeClass(i, null, this.options.icons.up),
this._addClass(i, null, e.up),
(i = this.buttons.last().find(".ui-icon")),
this._removeClass(i, null, this.options.icons.down),
this._addClass(i, null, e.down)),
this._super(t, e));
},
_setOptionDisabled: function (t) {
this._super(t),
this._toggleClass(this.uiSpinner, null, "ui-state-disabled", !!t),
this.element.prop("disabled", !!t),
this.buttons.button(t ? "disable" : "enable");
},
_setOptions: O(function (t) {
this._super(t);
}),
_parse: function (t) {
return "" ===
(t =
"string" == typeof t && "" !== t
? window.Globalize && this.options.numberFormat
? Globalize.parseFloat(t, 10, this.options.culture)
: +t
: t) || isNaN(t)
? null
: t;
},
_format: function (t) {
return "" === t
? ""
: window.Globalize && this.options.numberFormat
? Globalize.format(t, this.options.numberFormat, this.options.culture)
: t;
},
_refresh: function () {
this.element.attr({
"aria-valuemin": this.options.min,
"aria-valuemax": this.options.max,
"aria-valuenow": this._parse(this.element.val()),
});
},
isValid: function () {
var t = this.value();
return null !== t && t === this._adjustValue(t);
},
_value: function (t, e) {
var i;
"" !== t &&
null !== (i = this._parse(t)) &&
(e || (i = this._adjustValue(i)), (t = this._format(i))),
this.element.val(t),
this._refresh();
},
_destroy: function () {
this.element
.prop("disabled", !1)
.removeAttr(
"autocomplete role aria-valuemin aria-valuemax aria-valuenow"
),
this.uiSpinner.replaceWith(this.element);
},
stepUp: O(function (t) {
this._stepUp(t);
}),
_stepUp: function (t) {
this._start() && (this._spin((t || 1) * this.options.step), this._stop());
},
stepDown: O(function (t) {
this._stepDown(t);
}),
_stepDown: function (t) {
this._start() &&
(this._spin((t || 1) * -this.options.step), this._stop());
},
pageUp: O(function (t) {
this._stepUp((t || 1) * this.options.page);
}),
pageDown: O(function (t) {
this._stepDown((t || 1) * this.options.page);
}),
value: function (t) {
if (!arguments.length) return this._parse(this.element.val());
O(this._value).call(this, t);
},
widget: function () {
return this.uiSpinner;
},
}),
!0 === V.uiBackCompat &&
V.widget("ui.spinner", V.ui.spinner, {
_enhance: function () {
this.uiSpinner = this.element
.attr("autocomplete", "off")
.wrap(this._uiSpinnerHtml())
.parent()
.append(this._buttonHtml());
},
_uiSpinnerHtml: function () {
return "";
},
_buttonHtml: function () {
return "";
},
});
var A;
V.ui.spinner,
V.widget("ui.tabs", {
version: "1.14.1",
delay: 300,
options: {
active: null,
classes: {
"ui-tabs": "ui-corner-all",
"ui-tabs-nav": "ui-corner-all",
"ui-tabs-panel": "ui-corner-bottom",
"ui-tabs-tab": "ui-corner-top",
},
collapsible: !1,
event: "click",
heightStyle: "content",
hide: null,
show: null,
activate: null,
beforeActivate: null,
beforeLoad: null,
load: null,
},
_isLocal:
((A = /#.*$/),
function (t) {
var e = t.href.replace(A, ""),
i = location.href.replace(A, "");
try {
e = decodeURIComponent(e);
} catch (t) {}
try {
i = decodeURIComponent(i);
} catch (t) {}
return 1 < t.hash.length && e === i;
}),
_create: function () {
var e = this,
t = this.options;
(this.running = !1),
this._addClass("ui-tabs", "ui-widget ui-widget-content"),
this._toggleClass("ui-tabs-collapsible", null, t.collapsible),
this._processTabs(),
(t.active = this._initialActive()),
Array.isArray(t.disabled) &&
(t.disabled = V.uniqueSort(
t.disabled.concat(
V.map(this.tabs.filter(".ui-state-disabled"), function (t) {
return e.tabs.index(t);
})
)
).sort()),
!1 !== this.options.active && this.anchors.length
? (this.active = this._findActive(t.active))
: (this.active = V()),
this._refresh(),
this.active.length && this.load(t.active);
},
_initialActive: function () {
var i = this.options.active,
t = this.options.collapsible,
s = decodeURIComponent(location.hash.substring(1));
return (
null === i &&
(s &&
this.tabs.each(function (t, e) {
if (V(e).attr("aria-controls") === s) return (i = t), !1;
}),
(null !==
(i =
null === i
? this.tabs.index(this.tabs.filter(".ui-tabs-active"))
: i) &&
-1 !== i) ||
(i = !!this.tabs.length && 0)),
!1 !== i &&
-1 === (i = this.tabs.index(this.tabs.eq(i))) &&
(i = !t && 0),
(i = !t && !1 === i && this.anchors.length ? 0 : i)
);
},
_getCreateEventData: function () {
return {
tab: this.active,
panel: this.active.length ? this._getPanelForTab(this.active) : V(),
};
},
_tabKeydown: function (t) {
var e = V(this.document[0].activeElement).closest("li"),
i = this.tabs.index(e),
s = !0;
if (!this._handlePageNav(t)) {
switch (t.keyCode) {
case V.ui.keyCode.RIGHT:
case V.ui.keyCode.DOWN:
i++;
break;
case V.ui.keyCode.UP:
case V.ui.keyCode.LEFT:
(s = !1), i--;
break;
case V.ui.keyCode.END:
i = this.anchors.length - 1;
break;
case V.ui.keyCode.HOME:
i = 0;
break;
case V.ui.keyCode.SPACE:
return (
t.preventDefault(),
clearTimeout(this.activating),
void this._activate(i)
);
case V.ui.keyCode.ENTER:
return (
t.preventDefault(),
clearTimeout(this.activating),
void this._activate(i !== this.options.active && i)
);
default:
return;
}
t.preventDefault(),
clearTimeout(this.activating),
(i = this._focusNextTab(i, s)),
t.ctrlKey ||
t.metaKey ||
(e.attr("aria-selected", "false"),
this.tabs.eq(i).attr("aria-selected", "true"),
(this.activating = this._delay(function () {
this.option("active", i);
}, this.delay)));
}
},
_panelKeydown: function (t) {
this._handlePageNav(t) ||
(t.ctrlKey &&
t.keyCode === V.ui.keyCode.UP &&
(t.preventDefault(), this.active.trigger("focus")));
},
_handlePageNav: function (t) {
return t.altKey && t.keyCode === V.ui.keyCode.PAGE_UP
? (this._activate(this._focusNextTab(this.options.active - 1, !1)),
!0)
: t.altKey && t.keyCode === V.ui.keyCode.PAGE_DOWN
? (this._activate(this._focusNextTab(this.options.active + 1, !0)),
!0)
: void 0;
},
_findNextTab: function (t, e) {
var i = this.tabs.length - 1;
for (
;
-1 !==
V.inArray(
(t = (t = i < t ? 0 : t) < 0 ? i : t),
this.options.disabled
);
)
t = e ? t + 1 : t - 1;
return t;
},
_focusNextTab: function (t, e) {
return (
(t = this._findNextTab(t, e)), this.tabs.eq(t).trigger("focus"), t
);
},
_setOption: function (t, e) {
"active" === t
? this._activate(e)
: (this._super(t, e),
"collapsible" === t &&
(this._toggleClass("ui-tabs-collapsible", null, e),
e || !1 !== this.options.active || this._activate(0)),
"event" === t && this._setupEvents(e),
"heightStyle" === t && this._setupHeightStyle(e));
},
refresh: function () {
var t = this.options,
e = this.tablist.children(":has(a[href])");
(t.disabled = V.map(e.filter(".ui-state-disabled"), function (t) {
return e.index(t);
})),
this._processTabs(),
!1 !== t.active && this.anchors.length
? this.active.length && !V.contains(this.tablist[0], this.active[0])
? this.tabs.length === t.disabled.length
? ((t.active = !1), (this.active = V()))
: this._activate(
this._findNextTab(Math.max(0, t.active - 1), !1)
)
: (t.active = this.tabs.index(this.active))
: ((t.active = !1), (this.active = V())),
this._refresh();
},
_refresh: function () {
this._setOptionDisabled(this.options.disabled),
this._setupEvents(this.options.event),
this._setupHeightStyle(this.options.heightStyle),
this.tabs
.not(this.active)
.attr({
"aria-selected": "false",
"aria-expanded": "false",
tabIndex: -1,
}),
this.panels
.not(this._getPanelForTab(this.active))
.hide()
.attr({ "aria-hidden": "true" }),
this.active.length
? (this.active.attr({
"aria-selected": "true",
"aria-expanded": "true",
tabIndex: 0,
}),
this._addClass(this.active, "ui-tabs-active", "ui-state-active"),
this._getPanelForTab(this.active)
.show()
.attr({ "aria-hidden": "false" }))
: this.tabs.eq(0).attr("tabIndex", 0);
},
_processTabs: function () {
var r = this,
t = this.tabs,
e = this.anchors,
i = this.panels;
(this.tablist = this._getList().attr("role", "tablist")),
this._addClass(
this.tablist,
"ui-tabs-nav",
"ui-helper-reset ui-helper-clearfix ui-widget-header"
),
this.tablist.on(
"mousedown" + this.eventNamespace,
"> li",
function (t) {
V(this).is(".ui-state-disabled") && t.preventDefault();
}
),
(this.tabs = this.tablist
.find("> li:has(a[href])")
.attr({ role: "tab", tabIndex: -1 })),
this._addClass(this.tabs, "ui-tabs-tab", "ui-state-default"),
(this.anchors = this.tabs
.map(function () {
return V("a", this)[0];
})
.attr({ tabIndex: -1 })),
this._addClass(this.anchors, "ui-tabs-anchor"),
(this.panels = V()),
this.anchors.each(function (t, e) {
var i,
s,
n = V(e).uniqueId().attr("id"),
o = V(e).closest("li"),
a = o.attr("aria-controls");
r._isLocal(e)
? ((s = decodeURIComponent(e.hash).substring(1)),
(i = r.element.find("#" + CSS.escape(s))))
: ((s = o.attr("aria-controls") || V({}).uniqueId()[0].id),
(i = r.element.find("#" + s)).length ||
(i = r._createPanel(s)).insertAfter(
r.panels[t - 1] || r.tablist
),
i.attr("aria-live", "polite")),
i.length && (r.panels = r.panels.add(i)),
a && o.data("ui-tabs-aria-controls", a),
o.attr({ "aria-controls": s, "aria-labelledby": n }),
i.attr("aria-labelledby", n);
}),
this.panels.attr("role", "tabpanel"),
this._addClass(this.panels, "ui-tabs-panel", "ui-widget-content"),
t &&
(this._off(t.not(this.tabs)),
this._off(e.not(this.anchors)),
this._off(i.not(this.panels)));
},
_getList: function () {
return this.tablist || this.element.find("ol, ul").eq(0);
},
_createPanel: function (t) {
return V("").attr("id", t).data("ui-tabs-destroy", !0);
},
_setOptionDisabled: function (t) {
var e, i;
for (
Array.isArray(t) &&
(t.length
? t.length === this.anchors.length && (t = !0)
: (t = !1)),
i = 0;
(e = this.tabs[i]);
i++
)
(e = V(e)),
!0 === t || -1 !== V.inArray(i, t)
? (e.attr("aria-disabled", "true"),
this._addClass(e, null, "ui-state-disabled"))
: (e.removeAttr("aria-disabled"),
this._removeClass(e, null, "ui-state-disabled"));
(this.options.disabled = t),
this._toggleClass(
this.widget(),
this.widgetFullName + "-disabled",
null,
!0 === t
);
},
_setupEvents: function (t) {
var i = {};
t &&
V.each(t.split(" "), function (t, e) {
i[e] = "_eventHandler";
}),
this._off(this.anchors.add(this.tabs).add(this.panels)),
this._on(!0, this.anchors, {
click: function (t) {
t.preventDefault();
},
}),
this._on(this.anchors, i),
this._on(this.tabs, { keydown: "_tabKeydown" }),
this._on(this.panels, { keydown: "_panelKeydown" }),
this._focusable(this.tabs),
this._hoverable(this.tabs);
},
_setupHeightStyle: function (t) {
var i,
e = this.element.parent();
"fill" === t
? ((i = e.height()),
(i -= this.element.outerHeight() - this.element.height()),
this.element.siblings(":visible").each(function () {
var t = V(this),
e = t.css("position");
"absolute" !== e && "fixed" !== e && (i -= t.outerHeight(!0));
}),
this.element
.children()
.not(this.panels)
.each(function () {
i -= V(this).outerHeight(!0);
}),
this.panels
.each(function () {
V(this).height(
Math.max(0, i - V(this).innerHeight() + V(this).height())
);
})
.css("overflow", "auto"))
: "auto" === t &&
((i = 0),
this.panels
.each(function () {
i = Math.max(i, V(this).height("").height());
})
.height(i));
},
_eventHandler: function (t) {
var e = this.options,
i = this.active,
s = V(t.currentTarget).closest("li"),
n = s[0] === i[0],
o = n && e.collapsible,
a = o ? V() : this._getPanelForTab(s),
r = i.length ? this._getPanelForTab(i) : V(),
i = { oldTab: i, oldPanel: r, newTab: o ? V() : s, newPanel: a };
t.preventDefault(),
s.hasClass("ui-state-disabled") ||
s.hasClass("ui-tabs-loading") ||
this.running ||
(n && !e.collapsible) ||
!1 === this._trigger("beforeActivate", t, i) ||
((e.active = !o && this.tabs.index(s)),
(this.active = n ? V() : s),
this.xhr && this.xhr.abort(),
r.length ||
a.length ||
V.error("jQuery UI Tabs: Mismatching fragment identifier."),
a.length && this.load(this.tabs.index(s), t),
this._toggle(t, i));
},
_toggle: function (t, e) {
var i = this,
s = e.newPanel,
n = e.oldPanel;
function o() {
(i.running = !1), i._trigger("activate", t, e);
}
function a() {
i._addClass(
e.newTab.closest("li"),
"ui-tabs-active",
"ui-state-active"
),
s.length && i.options.show
? i._show(s, i.options.show, o)
: (s.show(), o());
}
(this.running = !0),
n.length && this.options.hide
? this._hide(n, this.options.hide, function () {
i._removeClass(
e.oldTab.closest("li"),
"ui-tabs-active",
"ui-state-active"
),
a();
})
: (this._removeClass(
e.oldTab.closest("li"),
"ui-tabs-active",
"ui-state-active"
),
n.hide(),
a()),
n.attr("aria-hidden", "true"),
e.oldTab.attr({ "aria-selected": "false", "aria-expanded": "false" }),
s.length && n.length
? e.oldTab.attr("tabIndex", -1)
: s.length &&
this.tabs
.filter(function () {
return 0 === V(this).attr("tabIndex");
})
.attr("tabIndex", -1),
s.attr("aria-hidden", "false"),
e.newTab.attr({
"aria-selected": "true",
"aria-expanded": "true",
tabIndex: 0,
});
},
_activate: function (t) {
var t = this._findActive(t);
t[0] !== this.active[0] &&
((t = (t = t.length ? t : this.active).find(".ui-tabs-anchor")[0]),
this._eventHandler({
target: t,
currentTarget: t,
preventDefault: V.noop,
}));
},
_findActive: function (t) {
return !1 === t ? V() : this.tabs.eq(t);
},
_getIndex: function (t) {
return (t =
"string" == typeof t
? this.anchors.index(
this.anchors.filter("[href$='" + CSS.escape(t) + "']")
)
: t);
},
_destroy: function () {
this.xhr && this.xhr.abort(),
this.tablist.removeAttr("role").off(this.eventNamespace),
this.anchors.removeAttr("role tabIndex").removeUniqueId(),
this.tabs.add(this.panels).each(function () {
V.data(this, "ui-tabs-destroy")
? V(this).remove()
: V(this).removeAttr(
"role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded"
);
}),
this.tabs.each(function () {
var t = V(this),
e = t.data("ui-tabs-aria-controls");
e
? t.attr("aria-controls", e).removeData("ui-tabs-aria-controls")
: t.removeAttr("aria-controls");
}),
this.panels.show(),
"content" !== this.options.heightStyle &&
this.panels.css("height", "");
},
enable: function (i) {
var t = this.options.disabled;
!1 !== t &&
((t =
void 0 !== i &&
((i = this._getIndex(i)),
Array.isArray(t)
? V.map(t, function (t) {
return t !== i ? t : null;
})
: V.map(this.tabs, function (t, e) {
return e !== i ? e : null;
}))),
this._setOptionDisabled(t));
},
disable: function (t) {
var e = this.options.disabled;
if (!0 !== e) {
if (void 0 === t) e = !0;
else {
if (((t = this._getIndex(t)), -1 !== V.inArray(t, e))) return;
e = Array.isArray(e) ? V.merge([t], e).sort() : [t];
}
this._setOptionDisabled(e);
}
},
load: function (t, s) {
t = this._getIndex(t);
function n(t, e) {
"abort" === e && o.panels.stop(!1, !0),
o._removeClass(i, "ui-tabs-loading"),
a.removeAttr("aria-busy"),
t === o.xhr && delete o.xhr;
}
var o = this,
i = this.tabs.eq(t),
t = i.find(".ui-tabs-anchor"),
a = this._getPanelForTab(i),
r = { tab: i, panel: a };
this._isLocal(t[0]) ||
((this.xhr = V.ajax(this._ajaxSettings(t, s, r))),
"canceled" !== this.xhr.statusText &&
(this._addClass(i, "ui-tabs-loading"),
a.attr("aria-busy", "true"),
this.xhr
.done(function (t, e, i) {
a.html(t), o._trigger("load", s, r), n(i, e);
})
.fail(function (t, e) {
n(t, e);
})));
},
_ajaxSettings: function (t, i, s) {
var n = this;
return {
url: t.attr("href"),
beforeSend: function (t, e) {
return n._trigger(
"beforeLoad",
i,
V.extend({ jqXHR: t, ajaxSettings: e }, s)
);
},
};
},
_getPanelForTab: function (t) {
t = V(t).attr("aria-controls");
return this.element.find("#" + CSS.escape(t));
},
}),
!0 === V.uiBackCompat &&
V.widget("ui.tabs", V.ui.tabs, {
_processTabs: function () {
this._superApply(arguments), this._addClass(this.tabs, "ui-tab");
},
}),
V.ui.tabs,
V.widget("ui.tooltip", {
version: "1.14.1",
options: {
classes: { "ui-tooltip": "ui-corner-all ui-widget-shadow" },
content: function () {
var t = V(this).attr("title");
return V("
").text(t).html();
},
hide: !0,
items: "[title]:not([disabled])",
position: {
my: "left top+15",
at: "left bottom",
collision: "flipfit flip",
},
show: !0,
track: !1,
close: null,
open: null,
},
_addDescribedBy: function (t, e) {
var i = (t.attr("aria-describedby") || "").split(/\s+/);
i.push(e),
t
.data("ui-tooltip-id", e)
.attr("aria-describedby", String.prototype.trim.call(i.join(" ")));
},
_removeDescribedBy: function (t) {
var e = t.data("ui-tooltip-id"),
i = (t.attr("aria-describedby") || "").split(/\s+/),
e = V.inArray(e, i);
-1 !== e && i.splice(e, 1),
t.removeData("ui-tooltip-id"),
(i = String.prototype.trim.call(i.join(" ")))
? t.attr("aria-describedby", i)
: t.removeAttr("aria-describedby");
},
_create: function () {
this._on({ mouseover: "open", focusin: "open" }),
(this.tooltips = {}),
(this.parents = {}),
(this.liveRegion = V("")
.attr({
role: "log",
"aria-live": "assertive",
"aria-relevant": "additions",
})
.appendTo(this.document[0].body)),
this._addClass(this.liveRegion, null, "ui-helper-hidden-accessible"),
(this.disabledTitles = V([]));
},
_setOption: function (t, e) {
var i = this;
this._super(t, e),
"content" === t &&
V.each(this.tooltips, function (t, e) {
i._updateContent(e.element);
});
},
_setOptionDisabled: function (t) {
this[t ? "_disable" : "_enable"]();
},
_disable: function () {
var s = this;
V.each(this.tooltips, function (t, e) {
var i = V.Event("blur");
(i.target = i.currentTarget = e.element[0]), s.close(i, !0);
}),
(this.disabledTitles = this.disabledTitles.add(
this.element
.find(this.options.items)
.addBack()
.filter(function () {
var t = V(this);
if (t.is("[title]"))
return t
.data("ui-tooltip-title", t.attr("title"))
.removeAttr("title");
})
));
},
_enable: function () {
this.disabledTitles.each(function () {
var t = V(this);
t.data("ui-tooltip-title") &&
t.attr("title", t.data("ui-tooltip-title"));
}),
(this.disabledTitles = V([]));
},
open: function (t) {
var i = this,
e = V(t ? t.target : this.element).closest(this.options.items);
e.length &&
!e.data("ui-tooltip-id") &&
(e.attr("title") && e.data("ui-tooltip-title", e.attr("title")),
e.data("ui-tooltip-open", !0),
t &&
"mouseover" === t.type &&
e.parents().each(function () {
var t,
e = V(this);
e.data("ui-tooltip-open") &&
(((t = V.Event("blur")).target = t.currentTarget = this),
i.close(t, !0)),
e.attr("title") &&
(e.uniqueId(),
(i.parents[this.id] = {
element: this,
title: e.attr("title"),
}),
e.attr("title", ""));
}),
this._registerCloseHandlers(t, e),
this._updateContent(e, t));
},
_updateContent: function (e, i) {
var t = this.options.content,
s = this,
n = i ? i.type : null;
if ("string" == typeof t || t.nodeType || t.jquery)
return this._open(i, e, t);
(t = t.call(e[0], function (t) {
e.data("ui-tooltip-open") && (i && (i.type = n), s._open(i, e, t));
})) && this._open(i, e, t);
},
_open: function (t, e, i) {
var s,
n,
o,
a = V.extend({}, this.options.position);
function r(t) {
(a.of = t), s.is(":hidden") || s.position(a);
}
i &&
((o = this._find(e))
? o.tooltip.find(".ui-tooltip-content").html(i)
: (e.is("[title]") &&
(t && "mouseover" === t.type
? e.attr("title", "")
: e.removeAttr("title")),
(o = this._tooltip(e)),
(s = o.tooltip),
this._addDescribedBy(e, s.attr("id")),
s.find(".ui-tooltip-content").html(i),
this.liveRegion.children().hide(),
(o = V("
").html(s.find(".ui-tooltip-content").html()))
.removeAttr("name")
.find("[name]")
.removeAttr("name"),
o.removeAttr("id").find("[id]").removeAttr("id"),
o.appendTo(this.liveRegion),
this.options.track && t && /^mouse/.test(t.type)
? (this._on(this.document, { mousemove: r }), r(t))
: s.position(V.extend({ of: e }, this.options.position)),
s.hide(),
this._show(s, this.options.show),
this.options.track &&
this.options.show &&
this.options.show.delay &&
(n = this.delayedShow =
setInterval(function () {
s.is(":visible") && (r(a.of), clearInterval(n));
}, 13)),
this._trigger("open", t, { tooltip: s })));
},
_registerCloseHandlers: function (t, e) {
var i = {
keyup: function (t) {
t.keyCode === V.ui.keyCode.ESCAPE &&
(((t = V.Event(t)).currentTarget = e[0]), this.close(t, !0));
},
};
e[0] !== this.element[0] &&
(i.remove = function () {
var t = this._find(e);
t && this._removeTooltip(t.tooltip);
}),
(t && "mouseover" !== t.type) || (i.mouseleave = "close"),
(t && "focusin" !== t.type) || (i.focusout = "close"),
this._on(!0, e, i);
},
close: function (t) {
var e,
i = this,
s = V(t ? t.currentTarget : this.element),
n = this._find(s);
n
? ((e = n.tooltip),
n.closing ||
(clearInterval(this.delayedShow),
s.data("ui-tooltip-title") &&
!s.attr("title") &&
s.attr("title", s.data("ui-tooltip-title")),
this._removeDescribedBy(s),
(n.hiding = !0),
e.stop(!0),
this._hide(e, this.options.hide, function () {
i._removeTooltip(V(this));
}),
s.removeData("ui-tooltip-open"),
this._off(s, "mouseleave focusout keyup"),
s[0] !== this.element[0] && this._off(s, "remove"),
this._off(this.document, "mousemove"),
t &&
"mouseleave" === t.type &&
V.each(this.parents, function (t, e) {
V(e.element).attr("title", e.title), delete i.parents[t];
}),
(n.closing = !0),
this._trigger("close", t, { tooltip: e }),
n.hiding) ||
(n.closing = !1))
: s.removeData("ui-tooltip-open");
},
_tooltip: function (t) {
var e = V("
").attr("role", "tooltip"),
i = V("
").appendTo(e),
s = e.uniqueId().attr("id");
return (
this._addClass(i, "ui-tooltip-content"),
this._addClass(e, "ui-tooltip", "ui-widget ui-widget-content"),
e.appendTo(this._appendTo(t)),
(this.tooltips[s] = { element: t, tooltip: e })
);
},
_find: function (t) {
t = t.data("ui-tooltip-id");
return t ? this.tooltips[t] : null;
},
_removeTooltip: function (t) {
clearInterval(this.delayedShow),
t.remove(),
delete this.tooltips[t.attr("id")];
},
_appendTo: function (t) {
t = t.closest(".ui-front, dialog");
return (t = t.length ? t : this.document[0].body);
},
_destroy: function () {
var s = this;
V.each(this.tooltips, function (t, e) {
var i = V.Event("blur"),
e = e.element;
(i.target = i.currentTarget = e[0]),
s.close(i, !0),
V("#" + t).remove(),
e.data("ui-tooltip-title") &&
(e.attr("title") || e.attr("title", e.data("ui-tooltip-title")),
e.removeData("ui-tooltip-title"));
}),
this.liveRegion.remove();
},
}),
!0 === V.uiBackCompat &&
V.widget("ui.tooltip", V.ui.tooltip, {
options: { tooltipClass: null },
_tooltip: function () {
var t = this._superApply(arguments);
return (
this.options.tooltipClass &&
t.tooltip.addClass(this.options.tooltipClass),
t
);
},
}),
V.ui.tooltip;
});