(function (modules) { var installedModules = {}; function __webpack_require__(moduleId) { if (installedModules[moduleId]) return installedModules[moduleId].exports; var module = installedModules[moduleId] = {exports: {}, id: moduleId, loaded: !1}; modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); module.loaded = !0; return module.exports } __webpack_require__.m = modules; __webpack_require__.c = installedModules; __webpack_require__.p = ""; return __webpack_require__(0) })([function (module, exports, __webpack_require__) { module.exports = __webpack_require__(1) }, function (module, exports, __webpack_require__) { 'use strict'; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {'default': obj} } var _jquery = __webpack_require__(2); var _jquery2 = _interopRequireDefault(_jquery); __webpack_require__(3); __webpack_require__(5); __webpack_require__(10); __webpack_require__(11); __webpack_require__(12); __webpack_require__(13); var _prestashop = __webpack_require__(4); var _prestashop2 = _interopRequireDefault(_prestashop); var _events = __webpack_require__(14); var _events2 = _interopRequireDefault(_events); var _common = __webpack_require__(7); window.$ = _jquery2['default']; window.jQuery = _jquery2['default']; for (var i in _events2['default'].prototype) { _prestashop2['default'][i] = _events2['default'].prototype[i] } (0, _jquery2['default'])(document).ready(function () { (0, _common.psShowHide)() }) }, function (module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__; "use strict"; (function (global, factory) { if (typeof module === "object" && typeof module.exports === "object") { module.exports = global.document ? factory(global, !0) : function (w) { if (!w.document) { throw new Error("jQuery requires a window with a document") } return factory(w) } } else { factory(global) } })(typeof window !== "undefined" ? window : undefined, function (window, noGlobal) { var arr = []; var document = window.document; var _slice = arr.slice; var concat = arr.concat; var push = arr.push; var indexOf = arr.indexOf; var class2type = {}; var toString = class2type.toString; var hasOwn = class2type.hasOwnProperty; var support = {}; var version = "2.2.4", jQuery = function jQuery(selector, context) { return new jQuery.fn.init(selector, context) }, rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, rmsPrefix = /^-ms-/, rdashAlpha = /-([\da-z])/gi, fcamelCase = function fcamelCase(all, letter) { return letter.toUpperCase() }; jQuery.fn = jQuery.prototype = { jquery: version, constructor: jQuery, selector: "", length: 0, toArray: function toArray() { return _slice.call(this) }, get: function get(num) { return num != null ? num < 0 ? this[num + this.length] : this[num] : _slice.call(this) }, pushStack: function pushStack(elems) { var ret = jQuery.merge(this.constructor(), elems); ret.prevObject = this; ret.context = this.context; return ret }, each: function each(callback) { return jQuery.each(this, callback) }, map: function map(callback) { return this.pushStack(jQuery.map(this, function (elem, i) { return callback.call(elem, i, elem) })) }, slice: function slice() { return this.pushStack(_slice.apply(this, arguments)) }, first: function first() { return this.eq(0) }, last: function last() { return this.eq(-1) }, eq: function eq(i) { var len = this.length, j = +i + (i < 0 ? len : 0); return this.pushStack(j >= 0 && j < len ? [this[j]] : []) }, end: function end() { return this.prevObject || this.constructor() }, push: push, sort: arr.sort, splice: arr.splice }; jQuery.extend = jQuery.fn.extend = function () { var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = !1; if (typeof target === "boolean") { deep = target; target = arguments[i] || {}; i++ } if (typeof target !== "object" && !jQuery.isFunction(target)) { target = {} } if (i === length) { target = this; i-- } for (; i < length; i++) { if ((options = arguments[i]) != null) { for (name in options) { src = target[name]; copy = options[name]; if (target === copy) { continue } if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)))) { if (copyIsArray) { copyIsArray = !1; clone = src && jQuery.isArray(src) ? src : [] } else { clone = src && jQuery.isPlainObject(src) ? src : {} } target[name] = jQuery.extend(deep, clone, copy) } else if (copy !== undefined) { target[name] = copy } } } } return target }; jQuery.extend({ expando: "jQuery" + (version + Math.random()).replace(/\D/g, ""), isReady: !0, error: function error(msg) { throw new Error(msg) }, noop: function noop() { }, isFunction: function isFunction(obj) { return jQuery.type(obj) === "function" }, isArray: Array.isArray, isWindow: function isWindow(obj) { return obj != null && obj === obj.window }, isNumeric: function isNumeric(obj) { var realStringObj = obj && obj.toString(); return !jQuery.isArray(obj) && realStringObj - parseFloat(realStringObj) + 1 >= 0 }, isPlainObject: function isPlainObject(obj) { var key; if (jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow(obj)) { return !1 } if (obj.constructor && !hasOwn.call(obj, "constructor") && !hasOwn.call(obj.constructor.prototype || {}, "isPrototypeOf")) { return !1 } for (key in obj) { } return key === undefined || hasOwn.call(obj, key) }, isEmptyObject: function isEmptyObject(obj) { var name; for (name in obj) { return !1 } return !0 }, type: function type(obj) { if (obj == null) { return obj + "" } return typeof obj === "object" || typeof obj === "function" ? class2type[toString.call(obj)] || "object" : typeof obj }, globalEval: function globalEval(code) { var script, indirect = eval; code = jQuery.trim(code); if (code) { if (code.indexOf("use strict") === 1) { script = document.createElement("script"); script.text = code; document.head.appendChild(script).parentNode.removeChild(script) } else { indirect(code) } } }, camelCase: function camelCase(string) { return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase) }, nodeName: function nodeName(elem, name) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase() }, each: function each(obj, callback) { var length, i = 0; if (isArrayLike(obj)) { length = obj.length; for (; i < length; i++) { if (callback.call(obj[i], i, obj[i]) === !1) { break } } } else { for (i in obj) { if (callback.call(obj[i], i, obj[i]) === !1) { break } } } return obj }, trim: function trim(text) { return text == null ? "" : (text + "").replace(rtrim, "") }, makeArray: function makeArray(arr, results) { var ret = results || []; if (arr != null) { if (isArrayLike(Object(arr))) { jQuery.merge(ret, typeof arr === "string" ? [arr] : arr) } else { push.call(ret, arr) } } return ret }, inArray: function inArray(elem, arr, i) { return arr == null ? -1 : indexOf.call(arr, elem, i) }, merge: function merge(first, second) { var len = +second.length, j = 0, i = first.length; for (; j < len; j++) { first[i++] = second[j] } first.length = i; return first }, grep: function grep(elems, callback, invert) { var callbackInverse, matches = [], i = 0, length = elems.length, callbackExpect = !invert; for (; i < length; i++) { callbackInverse = !callback(elems[i], i); if (callbackInverse !== callbackExpect) { matches.push(elems[i]) } } return matches }, map: function map(elems, callback, arg) { var length, value, i = 0, ret = []; if (isArrayLike(elems)) { length = elems.length; for (; i < length; i++) { value = callback(elems[i], i, arg); if (value != null) { ret.push(value) } } } else { for (i in elems) { value = callback(elems[i], i, arg); if (value != null) { ret.push(value) } } } return concat.apply([], ret) }, guid: 1, proxy: function proxy(fn, context) { var tmp, args, proxy; if (typeof context === "string") { tmp = fn[context]; context = fn; fn = tmp } if (!jQuery.isFunction(fn)) { return undefined } args = _slice.call(arguments, 2); proxy = function () { return fn.apply(context || this, args.concat(_slice.call(arguments))) }; proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy }, now: Date.now, support: support }); if (typeof Symbol === "function") { jQuery.fn[Symbol.iterator] = arr[Symbol.iterator] } jQuery.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function (i, name) { class2type["[object " + name + "]"] = name.toLowerCase() }); function isArrayLike(obj) { var length = !!obj && "length" in obj && obj.length, type = jQuery.type(obj); if (type === "function" || jQuery.isWindow(obj)) { return !1 } return type === "array" || length === 0 || typeof length === "number" && length > 0 && length - 1 in obj } var Sizzle = (function (window) { var i, support, Expr, getText, isXML, tokenize, compile, select, outermostContext, sortInput, hasDuplicate, setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, expando = "sizzle" + 1 * new Date(), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), sortOrder = function sortOrder(a, b) { if (a === b) { hasDuplicate = !0 } return 0 }, MAX_NEGATIVE = 1 << 31, hasOwn = ({}).hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, indexOf = function indexOf(list, elem) { var i = 0, len = list.length; for (; i < len; i++) { if (list[i] === elem) { return i } } return -1 }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", whitespace = "[\\x20\\t\\r\\n\\f]", identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + "*([*^$|!~]?=)" + whitespace + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + identifier + ")(?:\\((" + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + ".*" + ")\\)|)", rwhitespace = new RegExp(whitespace + "+", "g"), rtrim = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"), rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"), rcombinators = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"), rattributeQuotes = new RegExp("=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g"), rpseudo = new RegExp(pseudos), ridentifier = new RegExp("^" + identifier + "$"), matchExpr = { "ID": new RegExp("^#(" + identifier + ")"), "CLASS": new RegExp("^\\.(" + identifier + ")"), "TAG": new RegExp("^(" + identifier + "|[*])"), "ATTR": new RegExp("^" + attributes), "PSEUDO": new RegExp("^" + pseudos), "CHILD": new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i"), "bool": new RegExp("^(?:" + booleans + ")$", "i"), "needsContext": new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i") }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rnative = /^[^{]+\{\s*\[native \w/, rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, rescape = /'|\\/g, runescape = new RegExp("\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig"), funescape = function funescape(_, escaped, escapedWhitespace) { var high = "0x" + escaped - 0x10000; return high !== high || escapedWhitespace ? escaped : high < 0 ? String.fromCharCode(high + 0x10000) : String.fromCharCode(high >> 10 | 0xD800, high & 0x3FF | 0xDC00) }, unloadHandler = function unloadHandler() { setDocument() }; try { push.apply(arr = slice.call(preferredDoc.childNodes), preferredDoc.childNodes); arr[preferredDoc.childNodes.length].nodeType } catch (e) { push = { apply: arr.length ? function (target, els) { push_native.apply(target, slice.call(els)) } : function (target, els) { var j = target.length, i = 0; while (target[j++] = els[i++]) { } target.length = j - 1 } } } function Sizzle(selector, context, results, seed) { var m, i, elem, nid, nidselect, match, groups, newSelector, newContext = context && context.ownerDocument, nodeType = context ? context.nodeType : 9; results = results || []; if (typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11) { return results } if (!seed) { if ((context ? context.ownerDocument || context : preferredDoc) !== document) { setDocument(context) } context = context || document; if (documentIsHTML) { if (nodeType !== 11 && (match = rquickExpr.exec(selector))) { if (m = match[1]) { if (nodeType === 9) { if (elem = context.getElementById(m)) { if (elem.id === m) { results.push(elem); return results } } else { return results } } else { if (newContext && (elem = newContext.getElementById(m)) && contains(context, elem) && elem.id === m) { results.push(elem); return results } } } else if (match[2]) { push.apply(results, context.getElementsByTagName(selector)); return results } else if ((m = match[3]) && support.getElementsByClassName && context.getElementsByClassName) { push.apply(results, context.getElementsByClassName(m)); return results } } if (support.qsa && !compilerCache[selector + " "] && (!rbuggyQSA || !rbuggyQSA.test(selector))) { if (nodeType !== 1) { newContext = context; newSelector = selector } else if (context.nodeName.toLowerCase() !== "object") { if (nid = context.getAttribute("id")) { nid = nid.replace(rescape, "\\$&") } else { context.setAttribute("id", nid = expando) } groups = tokenize(selector); i = groups.length; nidselect = ridentifier.test(nid) ? "#" + nid : "[id='" + nid + "']"; while (i--) { groups[i] = nidselect + " " + toSelector(groups[i]) } newSelector = groups.join(","); newContext = rsibling.test(selector) && testContext(context.parentNode) || context } if (newSelector) { try { push.apply(results, newContext.querySelectorAll(newSelector)); return results } catch (qsaError) { } finally { if (nid === expando) { context.removeAttribute("id") } } } } } } return select(selector.replace(rtrim, "$1"), context, results, seed) } function createCache() { var keys = []; function cache(key, value) { if (keys.push(key + " ") > Expr.cacheLength) { delete cache[keys.shift()] } return cache[key + " "] = value } return cache } function markFunction(fn) { fn[expando] = !0; return fn } function assert(fn) { var div = document.createElement("div"); try { return !!fn(div) } catch (e) { return !1 } finally { if (div.parentNode) { div.parentNode.removeChild(div) } div = null } } function addHandle(attrs, handler) { var arr = attrs.split("|"), i = arr.length; while (i--) { Expr.attrHandle[arr[i]] = handler } } function siblingCheck(a, b) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && (~b.sourceIndex || MAX_NEGATIVE) - (~a.sourceIndex || MAX_NEGATIVE); if (diff) { return diff } if (cur) { while (cur = cur.nextSibling) { if (cur === b) { return -1 } } } return a ? 1 : -1 } function createInputPseudo(type) { return function (elem) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type } } function createButtonPseudo(type) { return function (elem) { var name = elem.nodeName.toLowerCase(); return (name === "input" || name === "button") && elem.type === type } } function createPositionalPseudo(fn) { return markFunction(function (argument) { argument = +argument; return markFunction(function (seed, matches) { var j, matchIndexes = fn([], seed.length, argument), i = matchIndexes.length; while (i--) { if (seed[j = matchIndexes[i]]) { seed[j] = !(matches[j] = seed[j]) } } }) }) } function testContext(context) { return context && typeof context.getElementsByTagName !== "undefined" && context } support = Sizzle.support = {}; isXML = Sizzle.isXML = function (elem) { var documentElement = elem && (elem.ownerDocument || elem).documentElement; return documentElement ? documentElement.nodeName !== "HTML" : !1 }; setDocument = Sizzle.setDocument = function (node) { var hasCompare, parent, doc = node ? node.ownerDocument || node : preferredDoc; if (doc === document || doc.nodeType !== 9 || !doc.documentElement) { return document } document = doc; docElem = document.documentElement; documentIsHTML = !isXML(document); if ((parent = document.defaultView) && parent.top !== parent) { if (parent.addEventListener) { parent.addEventListener("unload", unloadHandler, !1) } else if (parent.attachEvent) { parent.attachEvent("onunload", unloadHandler) } } support.attributes = assert(function (div) { div.className = "i"; return !div.getAttribute("className") }); support.getElementsByTagName = assert(function (div) { div.appendChild(document.createComment("")); return !div.getElementsByTagName("*").length }); support.getElementsByClassName = rnative.test(document.getElementsByClassName); support.getById = assert(function (div) { docElem.appendChild(div).id = expando; return !document.getElementsByName || !document.getElementsByName(expando).length }); if (support.getById) { Expr.find.ID = function (id, context) { if (typeof context.getElementById !== "undefined" && documentIsHTML) { var m = context.getElementById(id); return m ? [m] : [] } }; Expr.filter.ID = function (id) { var attrId = id.replace(runescape, funescape); return function (elem) { return elem.getAttribute("id") === attrId } } } else { delete Expr.find.ID; Expr.filter.ID = function (id) { var attrId = id.replace(runescape, funescape); return function (elem) { var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); return node && node.value === attrId } } } Expr.find.TAG = support.getElementsByTagName ? function (tag, context) { if (typeof context.getElementsByTagName !== "undefined") { return context.getElementsByTagName(tag) } else if (support.qsa) { return context.querySelectorAll(tag) } } : function (tag, context) { var elem, tmp = [], i = 0, results = context.getElementsByTagName(tag); if (tag === "*") { while (elem = results[i++]) { if (elem.nodeType === 1) { tmp.push(elem) } } return tmp } return results }; Expr.find.CLASS = support.getElementsByClassName && function (className, context) { if (typeof context.getElementsByClassName !== "undefined" && documentIsHTML) { return context.getElementsByClassName(className) } }; rbuggyMatches = []; rbuggyQSA = []; if (support.qsa = rnative.test(document.querySelectorAll)) { assert(function (div) { docElem.appendChild(div).innerHTML = "" + ""; if (div.querySelectorAll("[msallowcapture^='']").length) { rbuggyQSA.push("[*^$]=" + whitespace + "*(?:''|\"\")") } if (!div.querySelectorAll("[selected]").length) { rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")") } if (!div.querySelectorAll("[id~=" + expando + "-]").length) { rbuggyQSA.push("~=") } if (!div.querySelectorAll(":checked").length) { rbuggyQSA.push(":checked") } if (!div.querySelectorAll("a#" + expando + "+*").length) { rbuggyQSA.push(".#.+[+~]") } }); assert(function (div) { var input = document.createElement("input"); input.setAttribute("type", "hidden"); div.appendChild(input).setAttribute("name", "D"); if (div.querySelectorAll("[name=d]").length) { rbuggyQSA.push("name" + whitespace + "*[*^$|!~]?=") } if (!div.querySelectorAll(":enabled").length) { rbuggyQSA.push(":enabled", ":disabled") } div.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:") }) } if (support.matchesSelector = rnative.test(matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector)) { assert(function (div) { support.disconnectedMatch = matches.call(div, "div"); matches.call(div, "[s!='']:x"); rbuggyMatches.push("!=", pseudos) }) } rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|")); rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join("|")); hasCompare = rnative.test(docElem.compareDocumentPosition); contains = hasCompare || rnative.test(docElem.contains) ? function (a, b) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!(bup && bup.nodeType === 1 && (adown.contains ? adown.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16)) } : function (a, b) { if (b) { while (b = b.parentNode) { if (b === a) { return !0 } } } return !1 }; sortOrder = hasCompare ? function (a, b) { if (a === b) { hasDuplicate = !0; return 0 } var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; if (compare) { return compare } compare = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1; if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) { if (a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a)) { return -1 } if (b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b)) { return 1 } return sortInput ? indexOf(sortInput, a) - indexOf(sortInput, b) : 0 } return compare & 4 ? -1 : 1 } : function (a, b) { if (a === b) { hasDuplicate = !0; return 0 } var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [a], bp = [b]; if (!aup || !bup) { return a === document ? -1 : b === document ? 1 : aup ? -1 : bup ? 1 : sortInput ? indexOf(sortInput, a) - indexOf(sortInput, b) : 0 } else if (aup === bup) { return siblingCheck(a, b) } cur = a; while (cur = cur.parentNode) { ap.unshift(cur) } cur = b; while (cur = cur.parentNode) { bp.unshift(cur) } while (ap[i] === bp[i]) { i++ } return i ? siblingCheck(ap[i], bp[i]) : ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0 }; return document }; Sizzle.matches = function (expr, elements) { return Sizzle(expr, null, null, elements) }; Sizzle.matchesSelector = function (elem, expr) { if ((elem.ownerDocument || elem) !== document) { setDocument(elem) } expr = expr.replace(rattributeQuotes, "='$1']"); if (support.matchesSelector && documentIsHTML && !compilerCache[expr + " "] && (!rbuggyMatches || !rbuggyMatches.test(expr)) && (!rbuggyQSA || !rbuggyQSA.test(expr))) { try { var ret = matches.call(elem, expr); if (ret || support.disconnectedMatch || elem.document && elem.document.nodeType !== 11) { return ret } } catch (e) { } } return Sizzle(expr, document, null, [elem]).length > 0 }; Sizzle.contains = function (context, elem) { if ((context.ownerDocument || context) !== document) { setDocument(context) } return contains(context, elem) }; Sizzle.attr = function (elem, name) { if ((elem.ownerDocument || elem) !== document) { setDocument(elem) } var fn = Expr.attrHandle[name.toLowerCase()], val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : undefined; return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute(name) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null }; Sizzle.error = function (msg) { throw new Error("Syntax error, unrecognized expression: " + msg) }; Sizzle.uniqueSort = function (results) { var elem, duplicates = [], j = 0, i = 0; hasDuplicate = !support.detectDuplicates; sortInput = !support.sortStable && results.slice(0); results.sort(sortOrder); if (hasDuplicate) { while (elem = results[i++]) { if (elem === results[i]) { j = duplicates.push(i) } } while (j--) { results.splice(duplicates[j], 1) } } sortInput = null; return results }; getText = Sizzle.getText = function (elem) { var node, ret = "", i = 0, nodeType = elem.nodeType; if (!nodeType) { while (node = elem[i++]) { ret += getText(node) } } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) { if (typeof elem.textContent === "string") { return elem.textContent } else { for (elem = elem.firstChild; elem; elem = elem.nextSibling) { ret += getText(elem) } } } else if (nodeType === 3 || nodeType === 4) { return elem.nodeValue } return ret }; Expr = Sizzle.selectors = { cacheLength: 50, createPseudo: markFunction, match: matchExpr, attrHandle: {}, find: {}, relative: { ">": {dir: "parentNode", first: !0}, " ": {dir: "parentNode"}, "+": {dir: "previousSibling", first: !0}, "~": {dir: "previousSibling"} }, preFilter: { "ATTR": function ATTR(match) { match[1] = match[1].replace(runescape, funescape); match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape); if (match[2] === "~=") { match[3] = " " + match[3] + " " } return match.slice(0, 4) }, "CHILD": function CHILD(match) { match[1] = match[1].toLowerCase(); if (match[1].slice(0, 3) === "nth") { if (!match[3]) { Sizzle.error(match[0]) } match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd")); match[5] = +(match[7] + match[8] || match[3] === "odd") } else if (match[3]) { Sizzle.error(match[0]) } return match }, "PSEUDO": function PSEUDO(match) { var excess, unquoted = !match[6] && match[2]; if (matchExpr.CHILD.test(match[0])) { return null } if (match[3]) { match[2] = match[4] || match[5] || "" } else if (unquoted && rpseudo.test(unquoted) && (excess = tokenize(unquoted, !0)) && (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) { match[0] = match[0].slice(0, excess); match[2] = unquoted.slice(0, excess) } return match.slice(0, 3) } }, filter: { "TAG": function TAG(nodeNameSelector) { var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase(); return nodeNameSelector === "*" ? function () { return !0 } : function (elem) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName } }, "CLASS": function CLASS(className) { var pattern = classCache[className + " "]; return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) && classCache(className, function (elem) { return pattern.test(typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "") }) }, "ATTR": function ATTR(name, operator, check) { return function (elem) { var result = Sizzle.attr(elem, name); if (result == null) { return operator === "!=" } if (!operator) { return !0 } result += ""; return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf(check) === 0 : operator === "*=" ? check && result.indexOf(check) > -1 : operator === "$=" ? check && result.slice(-check.length) === check : operator === "~=" ? (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1 : operator === "|=" ? result === check || result.slice(0, check.length + 1) === check + "-" : !1 } }, "CHILD": function CHILD(type, what, argument, first, last) { var simple = type.slice(0, 3) !== "nth", forward = type.slice(-4) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? function (elem) { return !!elem.parentNode } : function (elem, context, xml) { var cache, uniqueCache, outerCache, node, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType, diff = !1; if (parent) { if (simple) { while (dir) { node = elem; while (node = node[dir]) { if (ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) { return !1 } } start = dir = type === "only" && !start && "nextSibling" } return !0 } start = [forward ? parent.firstChild : parent.lastChild]; if (forward && useCache) { node = parent; outerCache = node[expando] || (node[expando] = {}); uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {}); cache = uniqueCache[type] || []; nodeIndex = cache[0] === dirruns && cache[1]; diff = nodeIndex && cache[2]; node = nodeIndex && parent.childNodes[nodeIndex]; while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) { if (node.nodeType === 1 && ++diff && node === elem) { uniqueCache[type] = [dirruns, nodeIndex, diff]; break } } } else { if (useCache) { node = elem; outerCache = node[expando] || (node[expando] = {}); uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {}); cache = uniqueCache[type] || []; nodeIndex = cache[0] === dirruns && cache[1]; diff = nodeIndex } if (diff === !1) { while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) { if ((ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) && ++diff) { if (useCache) { outerCache = node[expando] || (node[expando] = {}); uniqueCache = outerCache[node.uniqueID] || (outerCache[node.uniqueID] = {}); uniqueCache[type] = [dirruns, diff] } if (node === elem) { break } } } } } diff -= last; return diff === first || diff % first === 0 && diff / first >= 0 } } }, "PSEUDO": function PSEUDO(pseudo, argument) { var args, fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || Sizzle.error("unsupported pseudo: " + pseudo); if (fn[expando]) { return fn(argument) } if (fn.length > 1) { args = [pseudo, pseudo, "", argument]; return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function (seed, matches) { var idx, matched = fn(seed, argument), i = matched.length; while (i--) { idx = indexOf(seed, matched[i]); seed[idx] = !(matches[idx] = matched[i]) } }) : function (elem) { return fn(elem, 0, args) } } return fn } }, pseudos: { "not": markFunction(function (selector) { var input = [], results = [], matcher = compile(selector.replace(rtrim, "$1")); return matcher[expando] ? markFunction(function (seed, matches, context, xml) { var elem, unmatched = matcher(seed, null, xml, []), i = seed.length; while (i--) { if (elem = unmatched[i]) { seed[i] = !(matches[i] = elem) } } }) : function (elem, context, xml) { input[0] = elem; matcher(input, null, xml, results); input[0] = null; return !results.pop() } }), "has": markFunction(function (selector) { return function (elem) { return Sizzle(selector, elem).length > 0 } }), "contains": markFunction(function (text) { text = text.replace(runescape, funescape); return function (elem) { return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1 } }), "lang": markFunction(function (lang) { if (!ridentifier.test(lang || "")) { Sizzle.error("unsupported lang: " + lang) } lang = lang.replace(runescape, funescape).toLowerCase(); return function (elem) { var elemLang; do { if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf(lang + "-") === 0 } } while ((elem = elem.parentNode) && elem.nodeType === 1); return !1 } }), "target": function target(elem) { var hash = window.location && window.location.hash; return hash && hash.slice(1) === elem.id }, "root": function root(elem) { return elem === docElem }, "focus": function focus(elem) { return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex) }, "enabled": function enabled(elem) { return elem.disabled === !1 }, "disabled": function disabled(elem) { return elem.disabled === !0 }, "checked": function checked(elem) { var nodeName = elem.nodeName.toLowerCase(); return nodeName === "input" && !!elem.checked || nodeName === "option" && !!elem.selected }, "selected": function selected(elem) { if (elem.parentNode) { elem.parentNode.selectedIndex } return elem.selected === !0 }, "empty": function empty(elem) { for (elem = elem.firstChild; elem; elem = elem.nextSibling) { if (elem.nodeType < 6) { return !1 } } return !0 }, "parent": function parent(elem) { return !Expr.pseudos.empty(elem) }, "header": function header(elem) { return rheader.test(elem.nodeName) }, "input": function input(elem) { return rinputs.test(elem.nodeName) }, "button": function button(elem) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button" }, "text": function text(elem) { var attr; return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && ((attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text") }, "first": createPositionalPseudo(function () { return [0] }), "last": createPositionalPseudo(function (matchIndexes, length) { return [length - 1] }), "eq": createPositionalPseudo(function (matchIndexes, length, argument) { return [argument < 0 ? argument + length : argument] }), "even": createPositionalPseudo(function (matchIndexes, length) { var i = 0; for (; i < length; i += 2) { matchIndexes.push(i) } return matchIndexes }), "odd": createPositionalPseudo(function (matchIndexes, length) { var i = 1; for (; i < length; i += 2) { matchIndexes.push(i) } return matchIndexes }), "lt": createPositionalPseudo(function (matchIndexes, length, argument) { var i = argument < 0 ? argument + length : argument; for (; --i >= 0;) { matchIndexes.push(i) } return matchIndexes }), "gt": createPositionalPseudo(function (matchIndexes, length, argument) { var i = argument < 0 ? argument + length : argument; for (; ++i < length;) { matchIndexes.push(i) } return matchIndexes }) } }; Expr.pseudos.nth = Expr.pseudos.eq; for (i in{radio: !0, checkbox: !0, file: !0, password: !0, image: !0}) { Expr.pseudos[i] = createInputPseudo(i) } for (i in{submit: !0, reset: !0}) { Expr.pseudos[i] = createButtonPseudo(i) } function setFilters() { } setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); tokenize = Sizzle.tokenize = function (selector, parseOnly) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[selector + " "]; if (cached) { return parseOnly ? 0 : cached.slice(0) } soFar = selector; groups = []; preFilters = Expr.preFilter; while (soFar) { if (!matched || (match = rcomma.exec(soFar))) { if (match) { soFar = soFar.slice(match[0].length) || soFar } groups.push(tokens = []) } matched = !1; if (match = rcombinators.exec(soFar)) { matched = match.shift(); tokens.push({value: matched, type: match[0].replace(rtrim, " ")}); soFar = soFar.slice(matched.length) } for (type in Expr.filter) { if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) { matched = match.shift(); tokens.push({value: matched, type: type, matches: match}); soFar = soFar.slice(matched.length) } } if (!matched) { break } } return parseOnly ? soFar.length : soFar ? Sizzle.error(selector) : tokenCache(selector, groups).slice(0) }; function toSelector(tokens) { var i = 0, len = tokens.length, selector = ""; for (; i < len; i++) { selector += tokens[i].value } return selector } function addCombinator(matcher, combinator, base) { var dir = combinator.dir, checkNonElements = base && dir === "parentNode", doneName = done++; return combinator.first ? function (elem, context, xml) { while (elem = elem[dir]) { if (elem.nodeType === 1 || checkNonElements) { return matcher(elem, context, xml) } } } : function (elem, context, xml) { var oldCache, uniqueCache, outerCache, newCache = [dirruns, doneName]; if (xml) { while (elem = elem[dir]) { if (elem.nodeType === 1 || checkNonElements) { if (matcher(elem, context, xml)) { return !0 } } } } else { while (elem = elem[dir]) { if (elem.nodeType === 1 || checkNonElements) { outerCache = elem[expando] || (elem[expando] = {}); uniqueCache = outerCache[elem.uniqueID] || (outerCache[elem.uniqueID] = {}); if ((oldCache = uniqueCache[dir]) && oldCache[0] === dirruns && oldCache[1] === doneName) { return newCache[2] = oldCache[2] } else { uniqueCache[dir] = newCache; if (newCache[2] = matcher(elem, context, xml)) { return !0 } } } } } } } function elementMatcher(matchers) { return matchers.length > 1 ? function (elem, context, xml) { var i = matchers.length; while (i--) { if (!matchers[i](elem, context, xml)) { return !1 } } return !0 } : matchers[0] } function multipleContexts(selector, contexts, results) { var i = 0, len = contexts.length; for (; i < len; i++) { Sizzle(selector, contexts[i], results) } return results } function condense(unmatched, map, filter, context, xml) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for (; i < len; i++) { if (elem = unmatched[i]) { if (!filter || filter(elem, context, xml)) { newUnmatched.push(elem); if (mapped) { map.push(i) } } } } return newUnmatched } function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) { if (postFilter && !postFilter[expando]) { postFilter = setMatcher(postFilter) } if (postFinder && !postFinder[expando]) { postFinder = setMatcher(postFinder, postSelector) } return markFunction(function (seed, results, context, xml) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, elems = seed || multipleContexts(selector || "*", context.nodeType ? [context] : context, []), matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems, matcherOut = matcher ? postFinder || (seed ? preFilter : preexisting || postFilter) ? [] : results : matcherIn; if (matcher) { matcher(matcherIn, matcherOut, context, xml) } if (postFilter) { temp = condense(matcherOut, postMap); postFilter(temp, [], context, xml); i = temp.length; while (i--) { if (elem = temp[i]) { matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem) } } } if (seed) { if (postFinder || preFilter) { if (postFinder) { temp = []; i = matcherOut.length; while (i--) { if (elem = matcherOut[i]) { temp.push(matcherIn[i] = elem) } } postFinder(null, matcherOut = [], temp, xml) } i = matcherOut.length; while (i--) { if ((elem = matcherOut[i]) && (temp = postFinder ? indexOf(seed, elem) : preMap[i]) > -1) { seed[temp] = !(results[temp] = elem) } } } } else { matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut); if (postFinder) { postFinder(null, results, matcherOut, xml) } else { push.apply(results, matcherOut) } } }) } function matcherFromTokens(tokens) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[tokens[0].type], implicitRelative = leadingRelative || Expr.relative[" "], i = leadingRelative ? 1 : 0, matchContext = addCombinator(function (elem) { return elem === checkContext }, implicitRelative, !0), matchAnyContext = addCombinator(function (elem) { return indexOf(checkContext, elem) > -1 }, implicitRelative, !0), matchers = [function (elem, context, xml) { var ret = !leadingRelative && (xml || context !== outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml)); checkContext = null; return ret }]; for (; i < len; i++) { if (matcher = Expr.relative[tokens[i].type]) { matchers = [addCombinator(elementMatcher(matchers), matcher)] } else { matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches); if (matcher[expando]) { j = ++i; for (; j < len; j++) { if (Expr.relative[tokens[j].type]) { break } } return setMatcher(i > 1 && elementMatcher(matchers), i > 1 && toSelector(tokens.slice(0, i - 1).concat({value: tokens[i - 2].type === " " ? "*" : ""})).replace(rtrim, "$1"), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens(tokens = tokens.slice(j)), j < len && toSelector(tokens)) } matchers.push(matcher) } } return elementMatcher(matchers) } function matcherFromGroupMatchers(elementMatchers, setMatchers) { var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function superMatcher(seed, context, xml, results, outermost) { var elem, j, matcher, matchedCount = 0, i = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, elems = seed || byElement && Expr.find.TAG("*", outermost), dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1, len = elems.length; if (outermost) { outermostContext = context === document || context || outermost } for (; i !== len && (elem = elems[i]) != null; i++) { if (byElement && elem) { j = 0; if (!context && elem.ownerDocument !== document) { setDocument(elem); xml = !documentIsHTML } while (matcher = elementMatchers[j++]) { if (matcher(elem, context || document, xml)) { results.push(elem); break } } if (outermost) { dirruns = dirrunsUnique } } if (bySet) { if (elem = !matcher && elem) { matchedCount-- } if (seed) { unmatched.push(elem) } } } matchedCount += i; if (bySet && i !== matchedCount) { j = 0; while (matcher = setMatchers[j++]) { matcher(unmatched, setMatched, context, xml) } if (seed) { if (matchedCount > 0) { while (i--) { if (!(unmatched[i] || setMatched[i])) { setMatched[i] = pop.call(results) } } } setMatched = condense(setMatched) } push.apply(results, setMatched); if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) { Sizzle.uniqueSort(results) } } if (outermost) { dirruns = dirrunsUnique; outermostContext = contextBackup } return unmatched }; return bySet ? markFunction(superMatcher) : superMatcher } compile = Sizzle.compile = function (selector, match) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + " "]; if (!cached) { if (!match) { match = tokenize(selector) } i = match.length; while (i--) { cached = matcherFromTokens(match[i]); if (cached[expando]) { setMatchers.push(cached) } else { elementMatchers.push(cached) } } cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers)); cached.selector = selector } return cached }; select = Sizzle.select = function (selector, context, results, seed) { var i, tokens, token, type, find, compiled = typeof selector === "function" && selector, match = !seed && tokenize(selector = compiled.selector || selector); results = results || []; if (match.length === 1) { tokens = match[0] = match[0].slice(0); if (tokens.length > 2 && (token = tokens[0]).type === "ID" && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) { context = (Expr.find.ID(token.matches[0].replace(runescape, funescape), context) || [])[0]; if (!context) { return results } else if (compiled) { context = context.parentNode } selector = selector.slice(tokens.shift().value.length) } i = matchExpr.needsContext.test(selector) ? 0 : tokens.length; while (i--) { token = tokens[i]; if (Expr.relative[type = token.type]) { break } if (find = Expr.find[type]) { if (seed = find(token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && testContext(context.parentNode) || context)) { tokens.splice(i, 1); selector = seed.length && toSelector(tokens); if (!selector) { push.apply(results, seed); return results } break } } } } (compiled || compile(selector, match))(seed, context, !documentIsHTML, results, !context || rsibling.test(selector) && testContext(context.parentNode) || context); return results }; support.sortStable = expando.split("").sort(sortOrder).join("") === expando; support.detectDuplicates = !!hasDuplicate; setDocument(); support.sortDetached = assert(function (div1) { return div1.compareDocumentPosition(document.createElement("div")) & 1 }); if (!assert(function (div) { div.innerHTML = ""; return div.firstChild.getAttribute("href") === "#" })) { addHandle("type|href|height|width", function (elem, name, isXML) { if (!isXML) { return elem.getAttribute(name, name.toLowerCase() === "type" ? 1 : 2) } }) } if (!support.attributes || !assert(function (div) { div.innerHTML = ""; div.firstChild.setAttribute("value", ""); return div.firstChild.getAttribute("value") === "" })) { addHandle("value", function (elem, name, isXML) { if (!isXML && elem.nodeName.toLowerCase() === "input") { return elem.defaultValue } }) } if (!assert(function (div) { return div.getAttribute("disabled") == null })) { addHandle(booleans, function (elem, name, isXML) { var val; if (!isXML) { return elem[name] === !0 ? name.toLowerCase() : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null } }) } return Sizzle })(window); jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; jQuery.expr[":"] = jQuery.expr.pseudos; jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; var dir = function dir(elem, _dir, until) { var matched = [], truncate = until !== undefined; while ((elem = elem[_dir]) && elem.nodeType !== 9) { if (elem.nodeType === 1) { if (truncate && jQuery(elem).is(until)) { break } matched.push(elem) } } return matched }; var _siblings = function _siblings(n, elem) { var matched = []; for (; n; n = n.nextSibling) { if (n.nodeType === 1 && n !== elem) { matched.push(n) } } return matched }; var rneedsContext = jQuery.expr.match.needsContext; var rsingleTag = /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/; var risSimple = /^.[^:#\[\.,]*$/; function winnow(elements, qualifier, not) { if (jQuery.isFunction(qualifier)) { return jQuery.grep(elements, function (elem, i) { return !!qualifier.call(elem, i, elem) !== not }) } if (qualifier.nodeType) { return jQuery.grep(elements, function (elem) { return elem === qualifier !== not }) } if (typeof qualifier === "string") { if (risSimple.test(qualifier)) { return jQuery.filter(qualifier, elements, not) } qualifier = jQuery.filter(qualifier, elements) } return jQuery.grep(elements, function (elem) { return indexOf.call(qualifier, elem) > -1 !== not }) } jQuery.filter = function (expr, elems, not) { var elem = elems[0]; if (not) { expr = ":not(" + expr + ")" } return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector(elem, expr) ? [elem] : [] : jQuery.find.matches(expr, jQuery.grep(elems, function (elem) { return elem.nodeType === 1 })) }; jQuery.fn.extend({ find: function find(selector) { var i, len = this.length, ret = [], self = this; if (typeof selector !== "string") { return this.pushStack(jQuery(selector).filter(function () { for (i = 0; i < len; i++) { if (jQuery.contains(self[i], this)) { return !0 } } })) } for (i = 0; i < len; i++) { jQuery.find(selector, self[i], ret) } ret = this.pushStack(len > 1 ? jQuery.unique(ret) : ret); ret.selector = this.selector ? this.selector + " " + selector : selector; return ret }, filter: function filter(selector) { return this.pushStack(winnow(this, selector || [], !1)) }, not: function not(selector) { return this.pushStack(winnow(this, selector || [], !0)) }, is: function is(selector) { return !!winnow(this, typeof selector === "string" && rneedsContext.test(selector) ? jQuery(selector) : selector || [], !1).length } }); var rootjQuery, rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, init = jQuery.fn.init = function (selector, context, root) { var match, elem; if (!selector) { return this } root = root || rootjQuery; if (typeof selector === "string") { if (selector[0] === "<" && selector[selector.length - 1] === ">" && selector.length >= 3) { match = [null, selector, null] } else { match = rquickExpr.exec(selector) } if (match && (match[1] || !context)) { if (match[1]) { context = context instanceof jQuery ? context[0] : context; jQuery.merge(this, jQuery.parseHTML(match[1], context && context.nodeType ? context.ownerDocument || context : document, !0)); if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) { for (match in context) { if (jQuery.isFunction(this[match])) { this[match](context[match]) } else { this.attr(match, context[match]) } } } return this } else { elem = document.getElementById(match[2]); if (elem && elem.parentNode) { this.length = 1; this[0] = elem } this.context = document; this.selector = selector; return this } } else if (!context || context.jquery) { return (context || root).find(selector) } else { return this.constructor(context).find(selector) } } else if (selector.nodeType) { this.context = this[0] = selector; this.length = 1; return this } else if (jQuery.isFunction(selector)) { return root.ready !== undefined ? root.ready(selector) : selector(jQuery) } if (selector.selector !== undefined) { this.selector = selector.selector; this.context = selector.context } return jQuery.makeArray(selector, this) }; init.prototype = jQuery.fn; rootjQuery = jQuery(document); var rparentsprev = /^(?:parents|prev(?:Until|All))/, guaranteedUnique = {children: !0, contents: !0, next: !0, prev: !0}; jQuery.fn.extend({ has: function has(target) { var targets = jQuery(target, this), l = targets.length; return this.filter(function () { var i = 0; for (; i < l; i++) { if (jQuery.contains(this, targets[i])) { return !0 } } }) }, closest: function closest(selectors, context) { var cur, i = 0, l = this.length, matched = [], pos = rneedsContext.test(selectors) || typeof selectors !== "string" ? jQuery(selectors, context || this.context) : 0; for (; i < l; i++) { for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) { if (cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors))) { matched.push(cur); break } } } return this.pushStack(matched.length > 1 ? jQuery.uniqueSort(matched) : matched) }, index: function index(elem) { if (!elem) { return this[0] && this[0].parentNode ? this.first().prevAll().length : -1 } if (typeof elem === "string") { return indexOf.call(jQuery(elem), this[0]) } return indexOf.call(this, elem.jquery ? elem[0] : elem) }, add: function add(selector, context) { return this.pushStack(jQuery.uniqueSort(jQuery.merge(this.get(), jQuery(selector, context)))) }, addBack: function addBack(selector) { return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector)) } }); function sibling(cur, dir) { while ((cur = cur[dir]) && cur.nodeType !== 1) { } return cur } jQuery.each({ parent: function parent(elem) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null }, parents: function parents(elem) { return dir(elem, "parentNode") }, parentsUntil: function parentsUntil(elem, i, until) { return dir(elem, "parentNode", until) }, next: function next(elem) { return sibling(elem, "nextSibling") }, prev: function prev(elem) { return sibling(elem, "previousSibling") }, nextAll: function nextAll(elem) { return dir(elem, "nextSibling") }, prevAll: function prevAll(elem) { return dir(elem, "previousSibling") }, nextUntil: function nextUntil(elem, i, until) { return dir(elem, "nextSibling", until) }, prevUntil: function prevUntil(elem, i, until) { return dir(elem, "previousSibling", until) }, siblings: function siblings(elem) { return _siblings((elem.parentNode || {}).firstChild, elem) }, children: function children(elem) { return _siblings(elem.firstChild) }, contents: function contents(elem) { return elem.contentDocument || jQuery.merge([], elem.childNodes) } }, function (name, fn) { jQuery.fn[name] = function (until, selector) { var matched = jQuery.map(this, fn, until); if (name.slice(-5) !== "Until") { selector = until } if (selector && typeof selector === "string") { matched = jQuery.filter(selector, matched) } if (this.length > 1) { if (!guaranteedUnique[name]) { jQuery.uniqueSort(matched) } if (rparentsprev.test(name)) { matched.reverse() } } return this.pushStack(matched) } }); var rnotwhite = /\S+/g; function createOptions(options) { var object = {}; jQuery.each(options.match(rnotwhite) || [], function (_, flag) { object[flag] = !0 }); return object } jQuery.Callbacks = function (options) { options = typeof options === "string" ? createOptions(options) : jQuery.extend({}, options); var firing, memory, _fired, _locked, list = [], queue = [], firingIndex = -1, fire = function fire() { _locked = options.once; _fired = firing = !0; for (; queue.length; firingIndex = -1) { memory = queue.shift(); while (++firingIndex < list.length) { if (list[firingIndex].apply(memory[0], memory[1]) === !1 && options.stopOnFalse) { firingIndex = list.length; memory = !1 } } } if (!options.memory) { memory = !1 } firing = !1; if (_locked) { if (memory) { list = [] } else { list = "" } } }, self = { add: function add() { if (list) { if (memory && !firing) { firingIndex = list.length - 1; queue.push(memory) } (function add(args) { jQuery.each(args, function (_, arg) { if (jQuery.isFunction(arg)) { if (!options.unique || !self.has(arg)) { list.push(arg) } } else if (arg && arg.length && jQuery.type(arg) !== "string") { add(arg) } }) })(arguments); if (memory && !firing) { fire() } } return this }, remove: function remove() { jQuery.each(arguments, function (_, arg) { var index; while ((index = jQuery.inArray(arg, list, index)) > -1) { list.splice(index, 1); if (index <= firingIndex) { firingIndex-- } } }); return this }, has: function has(fn) { return fn ? jQuery.inArray(fn, list) > -1 : list.length > 0 }, empty: function empty() { if (list) { list = [] } return this }, disable: function disable() { _locked = queue = []; list = memory = ""; return this }, disabled: function disabled() { return !list }, lock: function lock() { _locked = queue = []; if (!memory) { list = memory = "" } return this }, locked: function locked() { return !!_locked }, fireWith: function fireWith(context, args) { if (!_locked) { args = args || []; args = [context, args.slice ? args.slice() : args]; queue.push(args); if (!firing) { fire() } } return this }, fire: function fire() { self.fireWith(this, arguments); return this }, fired: function fired() { return !!_fired } }; return self }; jQuery.extend({ Deferred: function Deferred(func) { var tuples = [["resolve", "done", jQuery.Callbacks("once memory"), "resolved"], ["reject", "fail", jQuery.Callbacks("once memory"), "rejected"], ["notify", "progress", jQuery.Callbacks("memory")]], _state = "pending", _promise = { state: function state() { return _state }, always: function always() { deferred.done(arguments).fail(arguments); return this }, then: function then() { var fns = arguments; return jQuery.Deferred(function (newDefer) { jQuery.each(tuples, function (i, tuple) { var fn = jQuery.isFunction(fns[i]) && fns[i]; deferred[tuple[1]](function () { var returned = fn && fn.apply(this, arguments); if (returned && jQuery.isFunction(returned.promise)) { returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject) } else { newDefer[tuple[0] + "With"](this === _promise ? newDefer.promise() : this, fn ? [returned] : arguments) } }) }); fns = null }).promise() }, promise: function promise(obj) { return obj != null ? jQuery.extend(obj, _promise) : _promise } }, deferred = {}; _promise.pipe = _promise.then; jQuery.each(tuples, function (i, tuple) { var list = tuple[2], stateString = tuple[3]; _promise[tuple[1]] = list.add; if (stateString) { list.add(function () { _state = stateString }, tuples[i ^ 1][2].disable, tuples[2][2].lock) } deferred[tuple[0]] = function () { deferred[tuple[0] + "With"](this === deferred ? _promise : this, arguments); return this }; deferred[tuple[0] + "With"] = list.fireWith }); _promise.promise(deferred); if (func) { func.call(deferred, deferred) } return deferred }, when: function when(subordinate) { var i = 0, resolveValues = _slice.call(arguments), length = resolveValues.length, remaining = length !== 1 || subordinate && jQuery.isFunction(subordinate.promise) ? length : 0, deferred = remaining === 1 ? subordinate : jQuery.Deferred(), updateFunc = function updateFunc(i, contexts, values) { return function (value) { contexts[i] = this; values[i] = arguments.length > 1 ? _slice.call(arguments) : value; if (values === progressValues) { deferred.notifyWith(contexts, values) } else if (!--remaining) { deferred.resolveWith(contexts, values) } } }, progressValues, progressContexts, resolveContexts; if (length > 1) { progressValues = new Array(length); progressContexts = new Array(length); resolveContexts = new Array(length); for (; i < length; i++) { if (resolveValues[i] && jQuery.isFunction(resolveValues[i].promise)) { resolveValues[i].promise().progress(updateFunc(i, progressContexts, progressValues)).done(updateFunc(i, resolveContexts, resolveValues)).fail(deferred.reject) } else { --remaining } } } if (!remaining) { deferred.resolveWith(resolveContexts, resolveValues) } return deferred.promise() } }); var readyList; jQuery.fn.ready = function (fn) { jQuery.ready.promise().done(fn); return this }; jQuery.extend({ isReady: !1, readyWait: 1, holdReady: function holdReady(hold) { if (hold) { jQuery.readyWait++ } else { jQuery.ready(!0) } }, ready: function ready(wait) { if (wait === !0 ? --jQuery.readyWait : jQuery.isReady) { return } jQuery.isReady = !0; if (wait !== !0 && --jQuery.readyWait > 0) { return } readyList.resolveWith(document, [jQuery]); if (jQuery.fn.triggerHandler) { jQuery(document).triggerHandler("ready"); jQuery(document).off("ready") } } }); function completed() { document.removeEventListener("DOMContentLoaded", completed); window.removeEventListener("load", completed); jQuery.ready() } jQuery.ready.promise = function (obj) { if (!readyList) { readyList = jQuery.Deferred(); if (document.readyState === "complete" || document.readyState !== "loading" && !document.documentElement.doScroll) { window.setTimeout(jQuery.ready) } else { document.addEventListener("DOMContentLoaded", completed); window.addEventListener("load", completed) } } return readyList.promise(obj) }; jQuery.ready.promise(); var access = function access(elems, fn, key, value, chainable, emptyGet, raw) { var i = 0, len = elems.length, bulk = key == null; if (jQuery.type(key) === "object") { chainable = !0; for (i in key) { access(elems, fn, i, key[i], !0, emptyGet, raw) } } else if (value !== undefined) { chainable = !0; if (!jQuery.isFunction(value)) { raw = !0 } if (bulk) { if (raw) { fn.call(elems, value); fn = null } else { bulk = fn; fn = function (elem, key, value) { return bulk.call(jQuery(elem), value) } } } if (fn) { for (; i < len; i++) { fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key))) } } } return chainable ? elems : bulk ? fn.call(elems) : len ? fn(elems[0], key) : emptyGet }; var acceptData = function acceptData(owner) { return owner.nodeType === 1 || owner.nodeType === 9 || !+owner.nodeType }; function Data() { this.expando = jQuery.expando + Data.uid++ } Data.uid = 1; Data.prototype = { register: function register(owner, initial) { var value = initial || {}; if (owner.nodeType) { owner[this.expando] = value } else { Object.defineProperty(owner, this.expando, {value: value, writable: !0, configurable: !0}) } return owner[this.expando] }, cache: function cache(owner) { if (!acceptData(owner)) { return {} } var value = owner[this.expando]; if (!value) { value = {}; if (acceptData(owner)) { if (owner.nodeType) { owner[this.expando] = value } else { Object.defineProperty(owner, this.expando, {value: value, configurable: !0}) } } } return value }, set: function set(owner, data, value) { var prop, cache = this.cache(owner); if (typeof data === "string") { cache[data] = value } else { for (prop in data) { cache[prop] = data[prop] } } return cache }, get: function get(owner, key) { return key === undefined ? this.cache(owner) : owner[this.expando] && owner[this.expando][key] }, access: function access(owner, key, value) { var stored; if (key === undefined || key && typeof key === "string" && value === undefined) { stored = this.get(owner, key); return stored !== undefined ? stored : this.get(owner, jQuery.camelCase(key)) } this.set(owner, key, value); return value !== undefined ? value : key }, remove: function remove(owner, key) { var i, name, camel, cache = owner[this.expando]; if (cache === undefined) { return } if (key === undefined) { this.register(owner) } else { if (jQuery.isArray(key)) { name = key.concat(key.map(jQuery.camelCase)) } else { camel = jQuery.camelCase(key); if (key in cache) { name = [key, camel] } else { name = camel; name = name in cache ? [name] : name.match(rnotwhite) || [] } } i = name.length; while (i--) { delete cache[name[i]] } } if (key === undefined || jQuery.isEmptyObject(cache)) { if (owner.nodeType) { owner[this.expando] = undefined } else { delete owner[this.expando] } } }, hasData: function hasData(owner) { var cache = owner[this.expando]; return cache !== undefined && !jQuery.isEmptyObject(cache) } }; var dataPriv = new Data(); var dataUser = new Data(); var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /[A-Z]/g; function dataAttr(elem, key, data) { var name; if (data === undefined && elem.nodeType === 1) { name = "data-" + key.replace(rmultiDash, "-$&").toLowerCase(); data = elem.getAttribute(name); if (typeof data === "string") { try { data = data === "true" ? true : data === "false" ? false : data === "null" ? null : +data + "" === data ? +data : rbrace.test(data) ? jQuery.parseJSON(data) : data } catch (e) { } dataUser.set(elem, key, data) } else { data = undefined } } return data } jQuery.extend({ hasData: function hasData(elem) { return dataUser.hasData(elem) || dataPriv.hasData(elem) }, data: function data(elem, name, _data) { return dataUser.access(elem, name, _data) }, removeData: function removeData(elem, name) { dataUser.remove(elem, name) }, _data: function _data(elem, name, data) { return dataPriv.access(elem, name, data) }, _removeData: function _removeData(elem, name) { dataPriv.remove(elem, name) } }); jQuery.fn.extend({ data: function data(key, value) { var i, name, data, elem = this[0], attrs = elem && elem.attributes; if (key === undefined) { if (this.length) { data = dataUser.get(elem); if (elem.nodeType === 1 && !dataPriv.get(elem, "hasDataAttrs")) { i = attrs.length; while (i--) { if (attrs[i]) { name = attrs[i].name; if (name.indexOf("data-") === 0) { name = jQuery.camelCase(name.slice(5)); dataAttr(elem, name, data[name]) } } } dataPriv.set(elem, "hasDataAttrs", !0) } } return data } if (typeof key === "object") { return this.each(function () { dataUser.set(this, key) }) } return access(this, function (value) { var data, camelKey; if (elem && value === undefined) { data = dataUser.get(elem, key) || dataUser.get(elem, key.replace(rmultiDash, "-$&").toLowerCase()); if (data !== undefined) { return data } camelKey = jQuery.camelCase(key); data = dataUser.get(elem, camelKey); if (data !== undefined) { return data } data = dataAttr(elem, camelKey, undefined); if (data !== undefined) { return data } return } camelKey = jQuery.camelCase(key); this.each(function () { var data = dataUser.get(this, camelKey); dataUser.set(this, camelKey, value); if (key.indexOf("-") > -1 && data !== undefined) { dataUser.set(this, key, value) } }) }, null, value, arguments.length > 1, null, !0) }, removeData: function removeData(key) { return this.each(function () { dataUser.remove(this, key) }) } }); jQuery.extend({ queue: function queue(elem, type, data) { var queue; if (elem) { type = (type || "fx") + "queue"; queue = dataPriv.get(elem, type); if (data) { if (!queue || jQuery.isArray(data)) { queue = dataPriv.access(elem, type, jQuery.makeArray(data)) } else { queue.push(data) } } return queue || [] } }, dequeue: function dequeue(elem, type) { type = type || "fx"; var queue = jQuery.queue(elem, type), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks(elem, type), next = function next() { jQuery.dequeue(elem, type) }; if (fn === "inprogress") { fn = queue.shift(); startLength-- } if (fn) { if (type === "fx") { queue.unshift("inprogress") } delete hooks.stop; fn.call(elem, next, hooks) } if (!startLength && hooks) { hooks.empty.fire() } }, _queueHooks: function _queueHooks(elem, type) { var key = type + "queueHooks"; return dataPriv.get(elem, key) || dataPriv.access(elem, key, { empty: jQuery.Callbacks("once memory").add(function () { dataPriv.remove(elem, [type + "queue", key]) }) }) } }); jQuery.fn.extend({ queue: function queue(type, data) { var setter = 2; if (typeof type !== "string") { data = type; type = "fx"; setter-- } if (arguments.length < setter) { return jQuery.queue(this[0], type) } return data === undefined ? this : this.each(function () { var queue = jQuery.queue(this, type, data); jQuery._queueHooks(this, type); if (type === "fx" && queue[0] !== "inprogress") { jQuery.dequeue(this, type) } }) }, dequeue: function dequeue(type) { return this.each(function () { jQuery.dequeue(this, type) }) }, clearQueue: function clearQueue(type) { return this.queue(type || "fx", []) }, promise: function promise(type, obj) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function resolve() { if (!--count) { defer.resolveWith(elements, [elements]) } }; if (typeof type !== "string") { obj = type; type = undefined } type = type || "fx"; while (i--) { tmp = dataPriv.get(elements[i], type + "queueHooks"); if (tmp && tmp.empty) { count++; tmp.empty.add(resolve) } } resolve(); return defer.promise(obj) } }); var pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source; var rcssNum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i"); var cssExpand = ["Top", "Right", "Bottom", "Left"]; var isHidden = function isHidden(elem, el) { elem = el || elem; return jQuery.css(elem, "display") === "none" || !jQuery.contains(elem.ownerDocument, elem) }; function adjustCSS(elem, prop, valueParts, tween) { var adjusted, scale = 1, maxIterations = 20, currentValue = tween ? function () { return tween.cur() } : function () { return jQuery.css(elem, prop, "") }, initial = currentValue(), unit = valueParts && valueParts[3] || (jQuery.cssNumber[prop] ? "" : "px"), initialInUnit = (jQuery.cssNumber[prop] || unit !== "px" && +initial) && rcssNum.exec(jQuery.css(elem, prop)); if (initialInUnit && initialInUnit[3] !== unit) { unit = unit || initialInUnit[3]; valueParts = valueParts || []; initialInUnit = +initial || 1; do { scale = scale || ".5"; initialInUnit = initialInUnit / scale; jQuery.style(elem, prop, initialInUnit + unit) } while (scale !== (scale = currentValue() / initial) && scale !== 1 && --maxIterations); } if (valueParts) { initialInUnit = +initialInUnit || +initial || 0; adjusted = valueParts[1] ? initialInUnit + (valueParts[1] + 1) * valueParts[2] : +valueParts[2]; if (tween) { tween.unit = unit; tween.start = initialInUnit; tween.end = adjusted } } return adjusted } var rcheckableType = /^(?:checkbox|radio)$/i; var rtagName = /<([\w:-]+)/; var rscriptType = /^$|\/(?:java|ecma)script/i; var wrapMap = { option: [1, ""], thead: [1, "", "
"], col: [2, "", "
"], tr: [2, "", "
"], td: [3, "", "
"], _default: [0, "", ""] }; wrapMap.optgroup = wrapMap.option; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; function getAll(context, tag) { var ret = typeof context.getElementsByTagName !== "undefined" ? context.getElementsByTagName(tag || "*") : typeof context.querySelectorAll !== "undefined" ? context.querySelectorAll(tag || "*") : []; return tag === undefined || tag && jQuery.nodeName(context, tag) ? jQuery.merge([context], ret) : ret } function setGlobalEval(elems, refElements) { var i = 0, l = elems.length; for (; i < l; i++) { dataPriv.set(elems[i], "globalEval", !refElements || dataPriv.get(refElements[i], "globalEval")) } } var rhtml = /<|&#?\w+;/; function buildFragment(elems, context, scripts, selection, ignored) { var elem, tmp, tag, wrap, contains, j, fragment = context.createDocumentFragment(), nodes = [], i = 0, l = elems.length; for (; i < l; i++) { elem = elems[i]; if (elem || elem === 0) { if (jQuery.type(elem) === "object") { jQuery.merge(nodes, elem.nodeType ? [elem] : elem) } else if (!rhtml.test(elem)) { nodes.push(context.createTextNode(elem)) } else { tmp = tmp || fragment.appendChild(context.createElement("div")); tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase(); wrap = wrapMap[tag] || wrapMap._default; tmp.innerHTML = wrap[1] + jQuery.htmlPrefilter(elem) + wrap[2]; j = wrap[0]; while (j--) { tmp = tmp.lastChild } jQuery.merge(nodes, tmp.childNodes); tmp = fragment.firstChild; tmp.textContent = "" } } } fragment.textContent = ""; i = 0; while (elem = nodes[i++]) { if (selection && jQuery.inArray(elem, selection) > -1) { if (ignored) { ignored.push(elem) } continue } contains = jQuery.contains(elem.ownerDocument, elem); tmp = getAll(fragment.appendChild(elem), "script"); if (contains) { setGlobalEval(tmp) } if (scripts) { j = 0; while (elem = tmp[j++]) { if (rscriptType.test(elem.type || "")) { scripts.push(elem) } } } } return fragment } (function () { var fragment = document.createDocumentFragment(), div = fragment.appendChild(document.createElement("div")), input = document.createElement("input"); input.setAttribute("type", "radio"); input.setAttribute("checked", "checked"); input.setAttribute("name", "t"); div.appendChild(input); support.checkClone = div.cloneNode(!0).cloneNode(!0).lastChild.checked; div.innerHTML = ""; support.noCloneChecked = !!div.cloneNode(!0).lastChild.defaultValue })(); var rkeyEvent = /^key/, rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, rtypenamespace = /^([^.]*)(?:\.(.+)|)/; function returnTrue() { return !0 } function returnFalse() { return !1 } function safeActiveElement() { try { return document.activeElement } catch (err) { } } function _on(elem, types, selector, data, fn, one) { var origFn, type; if (typeof types === "object") { if (typeof selector !== "string") { data = data || selector; selector = undefined } for (type in types) { _on(elem, type, selector, data, types[type], one) } return elem } if (data == null && fn == null) { fn = selector; data = selector = undefined } else if (fn == null) { if (typeof selector === "string") { fn = data; data = undefined } else { fn = data; data = selector; selector = undefined } } if (fn === !1) { fn = returnFalse } else if (!fn) { return elem } if (one === 1) { origFn = fn; fn = function (event) { jQuery().off(event); return origFn.apply(this, arguments) }; fn.guid = origFn.guid || (origFn.guid = jQuery.guid++) } return elem.each(function () { jQuery.event.add(this, types, fn, data, selector) }) } jQuery.event = { global: {}, add: function add(elem, types, handler, data, selector) { var handleObjIn, eventHandle, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.get(elem); if (!elemData) { return } if (handler.handler) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector } if (!handler.guid) { handler.guid = jQuery.guid++ } if (!(events = elemData.events)) { events = elemData.events = {} } if (!(eventHandle = elemData.handle)) { eventHandle = elemData.handle = function (e) { return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply(elem, arguments) : undefined } } types = (types || "").match(rnotwhite) || [""]; t = types.length; while (t--) { tmp = rtypenamespace.exec(types[t]) || []; type = origType = tmp[1]; namespaces = (tmp[2] || "").split(".").sort(); if (!type) { continue } special = jQuery.event.special[type] || {}; type = (selector ? special.delegateType : special.bindType) || type; special = jQuery.event.special[type] || {}; handleObj = jQuery.extend({ type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test(selector), namespace: namespaces.join(".") }, handleObjIn); if (!(handlers = events[type])) { handlers = events[type] = []; handlers.delegateCount = 0; if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === !1) { if (elem.addEventListener) { elem.addEventListener(type, eventHandle) } } } if (special.add) { special.add.call(elem, handleObj); if (!handleObj.handler.guid) { handleObj.handler.guid = handler.guid } } if (selector) { handlers.splice(handlers.delegateCount++, 0, handleObj) } else { handlers.push(handleObj) } jQuery.event.global[type] = !0 } }, remove: function remove(elem, types, handler, selector, mappedTypes) { var j, origCount, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.hasData(elem) && dataPriv.get(elem); if (!elemData || !(events = elemData.events)) { return } types = (types || "").match(rnotwhite) || [""]; t = types.length; while (t--) { tmp = rtypenamespace.exec(types[t]) || []; type = origType = tmp[1]; namespaces = (tmp[2] || "").split(".").sort(); if (!type) { for (type in events) { jQuery.event.remove(elem, type + types[t], handler, selector, !0) } continue } special = jQuery.event.special[type] || {}; type = (selector ? special.delegateType : special.bindType) || type; handlers = events[type] || []; tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)"); origCount = j = handlers.length; while (j--) { handleObj = handlers[j]; if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) { handlers.splice(j, 1); if (handleObj.selector) { handlers.delegateCount-- } if (special.remove) { special.remove.call(elem, handleObj) } } } if (origCount && !handlers.length) { if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === !1) { jQuery.removeEvent(elem, type, elemData.handle) } delete events[type] } } if (jQuery.isEmptyObject(events)) { dataPriv.remove(elem, "handle events") } }, dispatch: function dispatch(event) { event = jQuery.event.fix(event); var i, j, ret, matched, handleObj, handlerQueue = [], args = _slice.call(arguments), handlers = (dataPriv.get(this, "events") || {})[event.type] || [], special = jQuery.event.special[event.type] || {}; args[0] = event; event.delegateTarget = this; if (special.preDispatch && special.preDispatch.call(this, event) === !1) { return } handlerQueue = jQuery.event.handlers.call(this, event, handlers); i = 0; while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) { event.currentTarget = matched.elem; j = 0; while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) { if (!event.rnamespace || event.rnamespace.test(handleObj.namespace)) { event.handleObj = handleObj; event.data = handleObj.data; ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args); if (ret !== undefined) { if ((event.result = ret) === !1) { event.preventDefault(); event.stopPropagation() } } } } } if (special.postDispatch) { special.postDispatch.call(this, event) } return event.result }, handlers: function handlers(event, _handlers) { var i, matches, sel, handleObj, handlerQueue = [], delegateCount = _handlers.delegateCount, cur = event.target; if (delegateCount && cur.nodeType && (event.type !== "click" || isNaN(event.button) || event.button < 1)) { for (; cur !== this; cur = cur.parentNode || this) { if (cur.nodeType === 1 && (cur.disabled !== !0 || event.type !== "click")) { matches = []; for (i = 0; i < delegateCount; i++) { handleObj = _handlers[i]; sel = handleObj.selector + " "; if (matches[sel] === undefined) { matches[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) > -1 : jQuery.find(sel, this, null, [cur]).length } if (matches[sel]) { matches.push(handleObj) } } if (matches.length) { handlerQueue.push({elem: cur, handlers: matches}) } } } } if (delegateCount < _handlers.length) { handlerQueue.push({elem: this, handlers: _handlers.slice(delegateCount)}) } return handlerQueue }, props: ("altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " + "metaKey relatedTarget shiftKey target timeStamp view which").split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function filter(event, original) { if (event.which == null) { event.which = original.charCode != null ? original.charCode : original.keyCode } return event } }, mouseHooks: { props: ("button buttons clientX clientY offsetX offsetY pageX pageY " + "screenX screenY toElement").split(" "), filter: function filter(event, original) { var eventDoc, doc, body, button = original.button; if (event.pageX == null && original.clientX != null) { eventDoc = event.target.ownerDocument || document; doc = eventDoc.documentElement; body = eventDoc.body; event.pageX = original.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); event.pageY = original.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0) } if (!event.which && button !== undefined) { event.which = button & 1 ? 1 : button & 2 ? 3 : button & 4 ? 2 : 0 } return event } }, fix: function fix(event) { if (event[jQuery.expando]) { return event } var i, prop, copy, type = event.type, originalEvent = event, fixHook = this.fixHooks[type]; if (!fixHook) { this.fixHooks[type] = fixHook = rmouseEvent.test(type) ? this.mouseHooks : rkeyEvent.test(type) ? this.keyHooks : {} } copy = fixHook.props ? this.props.concat(fixHook.props) : this.props; event = new jQuery.Event(originalEvent); i = copy.length; while (i--) { prop = copy[i]; event[prop] = originalEvent[prop] } if (!event.target) { event.target = document } if (event.target.nodeType === 3) { event.target = event.target.parentNode } return fixHook.filter ? fixHook.filter(event, originalEvent) : event }, special: { load: {noBubble: !0}, focus: { trigger: function trigger() { if (this !== safeActiveElement() && this.focus) { this.focus(); return !1 } }, delegateType: "focusin" }, blur: { trigger: function trigger() { if (this === safeActiveElement() && this.blur) { this.blur(); return !1 } }, delegateType: "focusout" }, click: { trigger: function trigger() { if (this.type === "checkbox" && this.click && jQuery.nodeName(this, "input")) { this.click(); return !1 } }, _default: function _default(event) { return jQuery.nodeName(event.target, "a") } }, beforeunload: { postDispatch: function postDispatch(event) { if (event.result !== undefined && event.originalEvent) { event.originalEvent.returnValue = event.result } } } } }; jQuery.removeEvent = function (elem, type, handle) { if (elem.removeEventListener) { elem.removeEventListener(type, handle) } }; jQuery.Event = function (src, props) { if (!(this instanceof jQuery.Event)) { return new jQuery.Event(src, props) } if (src && src.type) { this.originalEvent = src; this.type = src.type; this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined && src.returnValue === !1 ? returnTrue : returnFalse } else { this.type = src } if (props) { jQuery.extend(this, props) } this.timeStamp = src && src.timeStamp || jQuery.now(); this[jQuery.expando] = !0 }; jQuery.Event.prototype = { constructor: jQuery.Event, isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, isSimulated: !1, preventDefault: function preventDefault() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if (e && !this.isSimulated) { e.preventDefault() } }, stopPropagation: function stopPropagation() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if (e && !this.isSimulated) { e.stopPropagation() } }, stopImmediatePropagation: function stopImmediatePropagation() { var e = this.originalEvent; this.isImmediatePropagationStopped = returnTrue; if (e && !this.isSimulated) { e.stopImmediatePropagation() } this.stopPropagation() } }; jQuery.each({ mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, function (orig, fix) { jQuery.event.special[orig] = { delegateType: fix, bindType: fix, handle: function handle(event) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; if (!related || related !== target && !jQuery.contains(target, related)) { event.type = handleObj.origType; ret = handleObj.handler.apply(this, arguments); event.type = fix } return ret } } }); jQuery.fn.extend({ on: function on(types, selector, data, fn) { return _on(this, types, selector, data, fn) }, one: function one(types, selector, data, fn) { return _on(this, types, selector, data, fn, 1) }, off: function off(types, selector, fn) { var handleObj, type; if (types && types.preventDefault && types.handleObj) { handleObj = types.handleObj; jQuery(types.delegateTarget).off(handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler); return this } if (typeof types === "object") { for (type in types) { this.off(type, selector, types[type]) } return this } if (selector === !1 || typeof selector === "function") { fn = selector; selector = undefined } if (fn === !1) { fn = returnFalse } return this.each(function () { jQuery.event.remove(this, types, fn, selector) }) } }); var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, rnoInnerhtml = /\s*$/g; function manipulationTarget(elem, content) { return jQuery.nodeName(elem, "table") && jQuery.nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr") ? elem.getElementsByTagName("tbody")[0] || elem.appendChild(elem.ownerDocument.createElement("tbody")) : elem } function disableScript(elem) { elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type; return elem } function restoreScript(elem) { var match = rscriptTypeMasked.exec(elem.type); if (match) { elem.type = match[1] } else { elem.removeAttribute("type") } return elem } function cloneCopyEvent(src, dest) { var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; if (dest.nodeType !== 1) { return } if (dataPriv.hasData(src)) { pdataOld = dataPriv.access(src); pdataCur = dataPriv.set(dest, pdataOld); events = pdataOld.events; if (events) { delete pdataCur.handle; pdataCur.events = {}; for (type in events) { for (i = 0, l = events[type].length; i < l; i++) { jQuery.event.add(dest, type, events[type][i]) } } } } if (dataUser.hasData(src)) { udataOld = dataUser.access(src); udataCur = jQuery.extend({}, udataOld); dataUser.set(dest, udataCur) } } function fixInput(src, dest) { var nodeName = dest.nodeName.toLowerCase(); if (nodeName === "input" && rcheckableType.test(src.type)) { dest.checked = src.checked } else if (nodeName === "input" || nodeName === "textarea") { dest.defaultValue = src.defaultValue } } function domManip(collection, args, callback, ignored) { args = concat.apply([], args); var fragment, first, scripts, hasScripts, node, doc, i = 0, l = collection.length, iNoClone = l - 1, value = args[0], isFunction = jQuery.isFunction(value); if (isFunction || l > 1 && typeof value === "string" && !support.checkClone && rchecked.test(value)) { return collection.each(function (index) { var self = collection.eq(index); if (isFunction) { args[0] = value.call(this, index, self.html()) } domManip(self, args, callback, ignored) }) } if (l) { fragment = buildFragment(args, collection[0].ownerDocument, !1, collection, ignored); first = fragment.firstChild; if (fragment.childNodes.length === 1) { fragment = first } if (first || ignored) { scripts = jQuery.map(getAll(fragment, "script"), disableScript); hasScripts = scripts.length; for (; i < l; i++) { node = fragment; if (i !== iNoClone) { node = jQuery.clone(node, !0, !0); if (hasScripts) { jQuery.merge(scripts, getAll(node, "script")) } } callback.call(collection[i], node, i) } if (hasScripts) { doc = scripts[scripts.length - 1].ownerDocument; jQuery.map(scripts, restoreScript); for (i = 0; i < hasScripts; i++) { node = scripts[i]; if (rscriptType.test(node.type || "") && !dataPriv.access(node, "globalEval") && jQuery.contains(doc, node)) { if (node.src) { if (jQuery._evalUrl) { jQuery._evalUrl(node.src) } } else { jQuery.globalEval(node.textContent.replace(rcleanScript, "")) } } } } } } return collection } function _remove(elem, selector, keepData) { var node, nodes = selector ? jQuery.filter(selector, elem) : elem, i = 0; for (; (node = nodes[i]) != null; i++) { if (!keepData && node.nodeType === 1) { jQuery.cleanData(getAll(node)) } if (node.parentNode) { if (keepData && jQuery.contains(node.ownerDocument, node)) { setGlobalEval(getAll(node, "script")) } node.parentNode.removeChild(node) } } return elem } jQuery.extend({ htmlPrefilter: function htmlPrefilter(html) { return html.replace(rxhtmlTag, "<$1>") }, clone: function clone(elem, dataAndEvents, deepDataAndEvents) { var i, l, srcElements, destElements, clone = elem.cloneNode(!0), inPage = jQuery.contains(elem.ownerDocument, elem); if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) { destElements = getAll(clone); srcElements = getAll(elem); for (i = 0, l = srcElements.length; i < l; i++) { fixInput(srcElements[i], destElements[i]) } } if (dataAndEvents) { if (deepDataAndEvents) { srcElements = srcElements || getAll(elem); destElements = destElements || getAll(clone); for (i = 0, l = srcElements.length; i < l; i++) { cloneCopyEvent(srcElements[i], destElements[i]) } } else { cloneCopyEvent(elem, clone) } } destElements = getAll(clone, "script"); if (destElements.length > 0) { setGlobalEval(destElements, !inPage && getAll(elem, "script")) } return clone }, cleanData: function cleanData(elems) { var data, elem, type, special = jQuery.event.special, i = 0; for (; (elem = elems[i]) !== undefined; i++) { if (acceptData(elem)) { if (data = elem[dataPriv.expando]) { if (data.events) { for (type in data.events) { if (special[type]) { jQuery.event.remove(elem, type) } else { jQuery.removeEvent(elem, type, data.handle) } } } elem[dataPriv.expando] = undefined } if (elem[dataUser.expando]) { elem[dataUser.expando] = undefined } } } } }); jQuery.fn.extend({ domManip: domManip, detach: function detach(selector) { return _remove(this, selector, !0) }, remove: function remove(selector) { return _remove(this, selector) }, text: function text(value) { return access(this, function (value) { return value === undefined ? jQuery.text(this) : this.empty().each(function () { if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { this.textContent = value } }) }, null, value, arguments.length) }, append: function append() { return domManip(this, arguments, function (elem) { if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { var target = manipulationTarget(this, elem); try{ // Error Fix target.appendChild(elem) } catch (e) { console.log(e); } } }) }, prepend: function prepend() { return domManip(this, arguments, function (elem) { if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { var target = manipulationTarget(this, elem); target.insertBefore(elem, target.firstChild) } }) }, before: function before() { return domManip(this, arguments, function (elem) { if (this.parentNode) { this.parentNode.insertBefore(elem, this) } }) }, after: function after() { return domManip(this, arguments, function (elem) { if (this.parentNode) { this.parentNode.insertBefore(elem, this.nextSibling) } }) }, empty: function empty() { var elem, i = 0; for (; (elem = this[i]) != null; i++) { if (elem.nodeType === 1) { jQuery.cleanData(getAll(elem, !1)); elem.textContent = "" } } return this }, clone: function clone(dataAndEvents, deepDataAndEvents) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map(function () { return jQuery.clone(this, dataAndEvents, deepDataAndEvents) }) }, html: function html(value) { return access(this, function (value) { var elem = this[0] || {}, i = 0, l = this.length; if (value === undefined && elem.nodeType === 1) { return elem.innerHTML } if (typeof value === "string" && !rnoInnerhtml.test(value) && !wrapMap[(rtagName.exec(value) || ["", ""])[1].toLowerCase()]) { value = jQuery.htmlPrefilter(value); try { for (; i < l; i++) { elem = this[i] || {}; if (elem.nodeType === 1) { jQuery.cleanData(getAll(elem, !1)); elem.innerHTML = value } } elem = 0 } catch (e) { } } if (elem) { this.empty().append(value) } }, null, value, arguments.length) }, replaceWith: function replaceWith() { var ignored = []; return domManip(this, arguments, function (elem) { var parent = this.parentNode; if (jQuery.inArray(this, ignored) < 0) { jQuery.cleanData(getAll(this)); if (parent) { parent.replaceChild(elem, this) } } }, ignored) } }); jQuery.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (name, original) { jQuery.fn[name] = function (selector) { var elems, ret = [], insert = jQuery(selector), last = insert.length - 1, i = 0; for (; i <= last; i++) { elems = i === last ? this : this.clone(!0); jQuery(insert[i])[original](elems); push.apply(ret, elems.get()) } return this.pushStack(ret) } }); var iframe, elemdisplay = {HTML: "block", BODY: "block"}; function actualDisplay(name, doc) { var elem = jQuery(doc.createElement(name)).appendTo(doc.body), display = jQuery.css(elem[0], "display"); elem.detach(); return display } function defaultDisplay(nodeName) { var doc = document, display = elemdisplay[nodeName]; if (!display) { display = actualDisplay(nodeName, doc); if (display === "none" || !display) { iframe = (iframe || jQuery("' } else if (video.type === 'vimeo') { html = '' } else if (video.type === 'vzaar') { html = '' } $('
' + html + '
').insertAfter(item.find('.owl-video')); this._playing = item.addClass('owl-video-playing') }; Video.prototype.isInFullScreen = function () { var element = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement; return element && $(element).parent().hasClass('owl-video-frame') }; Video.prototype.destroy = function () { var handler, property; this._core.$element.off('click.owl.video'); for (handler in this._handlers) { this._core.$element.off(handler, this._handlers[handler]) } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null) } }; $.fn.owlCarousel.Constructor.Plugins.Video = Video })(window.Zepto || window.jQuery, window, document); (function ($, window, document, undefined) { var Animate = function (scope) { this.core = scope; this.core.options = $.extend({}, Animate.Defaults, this.core.options); this.swapping = !0; this.previous = undefined; this.next = undefined; this.handlers = { 'change.owl.carousel': $.proxy(function (e) { if (e.namespace && e.property.name == 'position') { this.previous = this.core.current(); this.next = e.property.value } }, this), 'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function (e) { if (e.namespace) { this.swapping = e.type == 'translated' } }, this), 'translate.owl.carousel': $.proxy(function (e) { if (e.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn)) { this.swap() } }, this) }; this.core.$element.on(this.handlers) }; Animate.Defaults = {animateOut: !1, animateIn: !1}; Animate.prototype.swap = function () { if (this.core.settings.items !== 1) { return } if (!$.support.animation || !$.support.transition) { return } this.core.speed(0); var left, clear = $.proxy(this.clear, this), previous = this.core.$stage.children().eq(this.previous), next = this.core.$stage.children().eq(this.next), incoming = this.core.settings.animateIn, outgoing = this.core.settings.animateOut; if (this.core.current() === this.previous) { return } if (outgoing) { left = this.core.coordinates(this.previous) - this.core.coordinates(this.next); previous.one($.support.animation.end, clear).css({'left': left + 'px'}).addClass('animated owl-animated-out').addClass(outgoing) } if (incoming) { next.one($.support.animation.end, clear).addClass('animated owl-animated-in').addClass(incoming) } }; Animate.prototype.clear = function (e) { $(e.target).css({'left': ''}).removeClass('animated owl-animated-out owl-animated-in').removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut); this.core.onTransitionEnd() }; Animate.prototype.destroy = function () { var handler, property; for (handler in this.handlers) { this.core.$element.off(handler, this.handlers[handler]) } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null) } }; $.fn.owlCarousel.Constructor.Plugins.Animate = Animate })(window.Zepto || window.jQuery, window, document); (function ($, window, document, undefined) { var Autoplay = function (carousel) { this._core = carousel; this._timeout = null; this._paused = !1; this._handlers = { 'changed.owl.carousel': $.proxy(function (e) { if (e.namespace && e.property.name === 'settings') { if (this._core.settings.autoplay) { this.play() } else { this.stop() } } else if (e.namespace && e.property.name === 'position') { if (this._core.settings.autoplay) { this._setAutoPlayInterval() } } }, this), 'initialized.owl.carousel': $.proxy(function (e) { if (e.namespace && this._core.settings.autoplay) { this.play() } }, this), 'play.owl.autoplay': $.proxy(function (e, t, s) { if (e.namespace) { this.play(t, s) } }, this), 'stop.owl.autoplay': $.proxy(function (e) { if (e.namespace) { this.stop() } }, this), 'mouseover.owl.autoplay': $.proxy(function () { if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { this.pause() } }, this), 'mouseleave.owl.autoplay': $.proxy(function () { if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { this.play() } }, this), 'touchstart.owl.core': $.proxy(function () { if (this._core.settings.autoplayHoverPause && this._core.is('rotating')) { this.pause() } }, this), 'touchend.owl.core': $.proxy(function () { if (this._core.settings.autoplayHoverPause) { this.play() } }, this) }; this._core.$element.on(this._handlers); this._core.options = $.extend({}, Autoplay.Defaults, this._core.options) }; Autoplay.Defaults = {autoplay: !1, autoplayTimeout: 5000, autoplayHoverPause: !1, autoplaySpeed: !1}; Autoplay.prototype.play = function (timeout, speed) { this._paused = !1; if (this._core.is('rotating')) { return } this._core.enter('rotating'); this._setAutoPlayInterval() }; Autoplay.prototype._getNextTimeout = function (timeout, speed) { if (this._timeout) { window.clearTimeout(this._timeout) } return window.setTimeout($.proxy(function () { if (this._paused || this._core.is('busy') || this._core.is('interacting') || document.hidden) { return } this._core.next(speed || this._core.settings.autoplaySpeed) }, this), timeout || this._core.settings.autoplayTimeout) }; Autoplay.prototype._setAutoPlayInterval = function () { this._timeout = this._getNextTimeout() }; Autoplay.prototype.stop = function () { if (!this._core.is('rotating')) { return } window.clearTimeout(this._timeout); this._core.leave('rotating') }; Autoplay.prototype.pause = function () { if (!this._core.is('rotating')) { return } this._paused = !0 }; Autoplay.prototype.destroy = function () { var handler, property; this.stop(); for (handler in this._handlers) { this._core.$element.off(handler, this._handlers[handler]) } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null) } }; $.fn.owlCarousel.Constructor.Plugins.autoplay = Autoplay })(window.Zepto || window.jQuery, window, document); (function ($, window, document, undefined) { 'use strict'; var Navigation = function (carousel) { this._core = carousel; this._initialized = !1; this._pages = []; this._controls = {}; this._templates = []; this.$element = this._core.$element; this._overrides = {next: this._core.next, prev: this._core.prev, to: this._core.to}; this._handlers = { 'prepared.owl.carousel': $.proxy(function (e) { if (e.namespace && this._core.settings.dotsData) { this._templates.push('
' + $(e.content).find('[data-dot]').addBack('[data-dot]').attr('data-dot') + '
') } }, this), 'added.owl.carousel': $.proxy(function (e) { if (e.namespace && this._core.settings.dotsData) { this._templates.splice(e.position, 0, this._templates.pop()) } }, this), 'remove.owl.carousel': $.proxy(function (e) { if (e.namespace && this._core.settings.dotsData) { this._templates.splice(e.position, 1) } }, this), 'changed.owl.carousel': $.proxy(function (e) { if (e.namespace && e.property.name == 'position') { this.draw() } }, this), 'initialized.owl.carousel': $.proxy(function (e) { if (e.namespace && !this._initialized) { this._core.trigger('initialize', null, 'navigation'); this.initialize(); this.update(); this.draw(); this._initialized = !0; this._core.trigger('initialized', null, 'navigation') } }, this), 'refreshed.owl.carousel': $.proxy(function (e) { if (e.namespace && this._initialized) { this._core.trigger('refresh', null, 'navigation'); this.update(); this.draw(); this._core.trigger('refreshed', null, 'navigation') } }, this) }; this._core.options = $.extend({}, Navigation.Defaults, this._core.options); this.$element.on(this._handlers) }; Navigation.Defaults = { nav: !1, navText: ['prev', 'next'], navSpeed: !1, navElement: 'div', navContainer: !1, navContainerClass: 'owl-nav', navClass: ['owl-prev', 'owl-next'], slideBy: 1, dotClass: 'owl-dot', dotsClass: 'owl-dots', dots: !0, dotsEach: !1, dotsData: !1, dotsSpeed: !1, dotsContainer: !1 }; Navigation.prototype.initialize = function () { var override, settings = this._core.settings; this._controls.$relative = (settings.navContainer ? $(settings.navContainer) : $('
').addClass(settings.navContainerClass).appendTo(this.$element)).addClass('disabled'); this._controls.$previous = $('<' + settings.navElement + '>').addClass(settings.navClass[0]).html(settings.navText[0]).prependTo(this._controls.$relative).on('click', $.proxy(function (e) { this.prev(settings.navSpeed) }, this)); this._controls.$next = $('<' + settings.navElement + '>').addClass(settings.navClass[1]).html(settings.navText[1]).appendTo(this._controls.$relative).on('click', $.proxy(function (e) { this.next(settings.navSpeed) }, this)); if (!settings.dotsData) { this._templates = [$('
').addClass(settings.dotClass).append($('')).prop('outerHTML')] } this._controls.$absolute = (settings.dotsContainer ? $(settings.dotsContainer) : $('
').addClass(settings.dotsClass).appendTo(this.$element)).addClass('disabled'); this._controls.$absolute.on('click', 'div', $.proxy(function (e) { var index = $(e.target).parent().is(this._controls.$absolute) ? $(e.target).index() : $(e.target).parent().index(); e.preventDefault(); this.to(index, settings.dotsSpeed) }, this)); for (override in this._overrides) { this._core[override] = $.proxy(this[override], this) } }; Navigation.prototype.destroy = function () { var handler, control, property, override; for (handler in this._handlers) { this.$element.off(handler, this._handlers[handler]) } for (control in this._controls) { this._controls[control].remove() } for (override in this.overides) { this._core[override] = this._overrides[override] } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null) } }; Navigation.prototype.update = function () { var i, j, k, lower = this._core.clones().length / 2, upper = lower + this._core.items().length, maximum = this._core.maximum(!0), settings = this._core.settings, size = settings.center || settings.autoWidth || settings.dotsData ? 1 : settings.dotsEach || settings.items; if (settings.slideBy !== 'page') { settings.slideBy = Math.min(settings.slideBy, settings.items) } if (settings.dots || settings.slideBy == 'page') { this._pages = []; for (i = lower, j = 0, k = 0; i < upper; i++) { if (j >= size || j === 0) { this._pages.push({start: Math.min(maximum, i - lower), end: i - lower + size - 1}); if (Math.min(maximum, i - lower) === maximum) { break } j = 0, ++k } j += this._core.mergers(this._core.relative(i)) } } }; Navigation.prototype.draw = function () { var difference, settings = this._core.settings, disabled = this._core.items().length <= settings.items, index = this._core.relative(this._core.current()), loop = settings.loop || settings.rewind; this._controls.$relative.toggleClass('disabled', !settings.nav || disabled); if (settings.nav) { this._controls.$previous.toggleClass('disabled', !loop && index <= this._core.minimum(!0)); this._controls.$next.toggleClass('disabled', !loop && index >= this._core.maximum(!0)) } this._controls.$absolute.toggleClass('disabled', !settings.dots || disabled); if (settings.dots) { difference = this._pages.length - this._controls.$absolute.children().length; if (settings.dotsData && difference !== 0) { this._controls.$absolute.html(this._templates.join('')) } else if (difference > 0) { this._controls.$absolute.append(new Array(difference + 1).join(this._templates[0])) } else if (difference < 0) { this._controls.$absolute.children().slice(difference).remove() } this._controls.$absolute.find('.active').removeClass('active'); this._controls.$absolute.children().eq($.inArray(this.current(), this._pages)).addClass('active') } }; Navigation.prototype.onTrigger = function (event) { var settings = this._core.settings; event.page = { index: $.inArray(this.current(), this._pages), count: this._pages.length, size: settings && (settings.center || settings.autoWidth || settings.dotsData ? 1 : settings.dotsEach || settings.items) } }; Navigation.prototype.current = function () { var current = this._core.relative(this._core.current()); return $.grep(this._pages, $.proxy(function (page, index) { return page.start <= current && page.end >= current }, this)).pop() }; Navigation.prototype.getPosition = function (successor) { var position, length, settings = this._core.settings; if (settings.slideBy == 'page') { position = $.inArray(this.current(), this._pages); length = this._pages.length; successor ? ++position : --position; position = this._pages[((position % length) + length) % length].start } else { position = this._core.relative(this._core.current()); length = this._core.items().length; successor ? position += settings.slideBy : position -= settings.slideBy } return position }; Navigation.prototype.next = function (speed) { $.proxy(this._overrides.to, this._core)(this.getPosition(!0), speed) }; Navigation.prototype.prev = function (speed) { $.proxy(this._overrides.to, this._core)(this.getPosition(!1), speed) }; Navigation.prototype.to = function (position, speed, standard) { var length; if (!standard && this._pages.length) { length = this._pages.length; $.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed) } else { $.proxy(this._overrides.to, this._core)(position, speed) } }; $.fn.owlCarousel.Constructor.Plugins.Navigation = Navigation })(window.Zepto || window.jQuery, window, document); (function ($, window, document, undefined) { 'use strict'; var Hash = function (carousel) { this._core = carousel; this._hashes = {}; this.$element = this._core.$element; this._handlers = { 'initialized.owl.carousel': $.proxy(function (e) { if (e.namespace && this._core.settings.startPosition === 'URLHash') { $(window).trigger('hashchange.owl.navigation') } }, this), 'prepared.owl.carousel': $.proxy(function (e) { if (e.namespace) { var hash = $(e.content).find('[data-hash]').addBack('[data-hash]').attr('data-hash'); if (!hash) { return } this._hashes[hash] = e.content } }, this), 'changed.owl.carousel': $.proxy(function (e) { if (e.namespace && e.property.name === 'position') { var current = this._core.items(this._core.relative(this._core.current())), hash = $.map(this._hashes, function (item, hash) { return item === current ? hash : null }).join(); if (!hash || window.location.hash.slice(1) === hash) { return } window.location.hash = hash } }, this) }; this._core.options = $.extend({}, Hash.Defaults, this._core.options); this.$element.on(this._handlers); $(window).on('hashchange.owl.navigation', $.proxy(function (e) { var hash = window.location.hash.substring(1), items = this._core.$stage.children(), position = this._hashes[hash] && items.index(this._hashes[hash]); if (position === undefined || position === this._core.current()) { return } this._core.to(this._core.relative(position), !1, !0) }, this)) }; Hash.Defaults = {URLhashListener: !1}; Hash.prototype.destroy = function () { var handler, property; $(window).off('hashchange.owl.navigation'); for (handler in this._handlers) { this._core.$element.off(handler, this._handlers[handler]) } for (property in Object.getOwnPropertyNames(this)) { typeof this[property] != 'function' && (this[property] = null) } }; $.fn.owlCarousel.Constructor.Plugins.Hash = Hash })(window.Zepto || window.jQuery, window, document); (function ($, window, document, undefined) { var style = $('').get(0).style, prefixes = 'Webkit Moz O ms'.split(' '), events = { transition: { end: { WebkitTransition: 'webkitTransitionEnd', MozTransition: 'transitionend', OTransition: 'oTransitionEnd', transition: 'transitionend' } }, animation: { end: { WebkitAnimation: 'webkitAnimationEnd', MozAnimation: 'animationend', OAnimation: 'oAnimationEnd', animation: 'animationend' } } }, tests = { csstransforms: function () { return !!test('transform') }, csstransforms3d: function () { return !!test('perspective') }, csstransitions: function () { return !!test('transition') }, cssanimations: function () { return !!test('animation') } }; function test(property, prefixed) { var result = !1, upper = property.charAt(0).toUpperCase() + property.slice(1); $.each((property + ' ' + prefixes.join(upper + ' ') + upper).split(' '), function (i, property) { if (style[property] !== undefined) { result = prefixed ? property : !0; return !1 } }); return result } function prefixed(property) { return test(property, !0) } if (tests.csstransitions()) { $.support.transition = new String(prefixed('transition')) $.support.transition.end = events.transition.end[$.support.transition] } if (tests.cssanimations()) { $.support.animation = new String(prefixed('animation')) $.support.animation.end = events.animation.end[$.support.animation] } if (tests.csstransforms()) { $.support.transform = new String(prefixed('transform')); $.support.transform3d = tests.csstransforms3d() } })(window.Zepto || window.jQuery, window, document); if (typeof Object.create !== 'function') { Object.create = function (obj) { function F() { };F.prototype = obj; return new F() } } (function ($, window, document, undefined) { var ElevateZoom = { init: function (options, elem) { var self = this; self.elem = elem; self.$elem = $(elem); self.imageSrc = self.$elem.data("zoom-image") ? self.$elem.data("zoom-image") : self.$elem.attr("src"); self.options = $.extend({}, $.fn.elevateZoom.options, options); if (self.options.tint) { self.options.lensColour = "none", self.options.lensOpacity = "1" } if (self.options.zoomType == "inner") { self.options.showLens = !1 } self.$elem.parent().removeAttr('title').removeAttr('alt'); self.zoomImage = self.imageSrc; self.refresh(1); $('#' + self.options.gallery + ' a').click(function (e) { if (self.options.galleryActiveClass) { $('#' + self.options.gallery + ' a').removeClass(self.options.galleryActiveClass); $(this).addClass(self.options.galleryActiveClass) } e.preventDefault(); if ($(this).data("zoom-image")) { self.zoomImagePre = $(this).data("zoom-image") } else { self.zoomImagePre = $(this).data("image") } self.swaptheimage($(this).data("image"), self.zoomImagePre); return !1 }) }, refresh: function (length) { var self = this; setTimeout(function () { self.fetch(self.imageSrc) }, length || self.options.refresh) }, fetch: function (imgsrc) { var self = this; var newImg = new Image(); newImg.onload = function () { self.largeWidth = newImg.width; self.largeHeight = newImg.height; self.startZoom(); self.currentImage = self.imageSrc; self.options.onZoomedImageLoaded(self.$elem) } newImg.src = imgsrc; return }, startZoom: function () { var self = this; self.nzWidth = self.$elem.width(); self.nzHeight = self.$elem.height(); self.isWindowActive = !1; self.isLensActive = !1; self.isTintActive = !1; self.overWindow = !1; if (self.options.imageCrossfade) { self.zoomWrap = self.$elem.wrap('
'); self.$elem.css('position', 'absolute') } self.zoomLock = 1; self.scrollingLock = !1; self.changeBgSize = !1; self.currentZoomLevel = self.options.zoomLevel; self.nzOffset = self.$elem.offset(); self.widthRatio = (self.largeWidth / self.currentZoomLevel) / self.nzWidth; self.heightRatio = (self.largeHeight / self.currentZoomLevel) / self.nzHeight; if (self.options.zoomType == "window") { self.zoomWindowStyle = "overflow: hidden;" + "background-position: 0px 0px;text-align:center;" + "background-color: " + String(self.options.zoomWindowBgColour) + ";width: " + String(self.options.zoomWindowWidth) + "px;" + "height: " + String(self.options.zoomWindowHeight) + "px;float: left;" + "background-size: " + self.largeWidth / self.currentZoomLevel + "px " + self.largeHeight / self.currentZoomLevel + "px;" + "display: none;z-index:100;" + "border: " + String(self.options.borderSize) + "px solid " + self.options.borderColour + ";background-repeat: no-repeat;" + "position: absolute;" } if (self.options.zoomType == "inner") { var borderWidth = self.$elem.css("border-left-width"); self.zoomWindowStyle = "overflow: hidden;" + "margin-left: " + String(borderWidth) + ";" + "margin-top: " + String(borderWidth) + ";" + "background-position: 0px 0px;" + "width: " + String(self.nzWidth) + "px;" + "height: " + String(self.nzHeight) + "px;" + "px;float: left;" + "display: none;" + "cursor:" + (self.options.cursor) + ";" + "px solid " + self.options.borderColour + ";background-repeat: no-repeat;" + "position: absolute;" } if (self.options.zoomType == "window") { if (self.nzHeight < self.options.zoomWindowWidth / self.widthRatio) { lensHeight = self.nzHeight } else { lensHeight = String((self.options.zoomWindowHeight / self.heightRatio)) } if (self.largeWidth < self.options.zoomWindowWidth) { lensWidth = self.nzWidth } else { lensWidth = (self.options.zoomWindowWidth / self.widthRatio) } self.lensStyle = "background-position: 0px 0px;width: " + String((self.options.zoomWindowWidth) / self.widthRatio) + "px;height: " + String((self.options.zoomWindowHeight) / self.heightRatio) + "px;float: right;display: none;" + "overflow: hidden;" + "z-index: 999;" + "-webkit-transform: translateZ(0);" + "opacity:" + (self.options.lensOpacity) + ";filter: alpha(opacity = " + (self.options.lensOpacity * 100) + "); zoom:1;" + "width:" + lensWidth + "px;" + "height:" + lensHeight + "px;" + "background-color:" + (self.options.lensColour) + ";" + "cursor:" + (self.options.cursor) + ";" + "border: " + (self.options.lensBorderSize) + "px" + " solid " + (self.options.lensBorderColour) + ";background-repeat: no-repeat;position: absolute;" } self.tintStyle = "display: block;" + "position: absolute;" + "background-color: " + self.options.tintColour + ";" + "filter:alpha(opacity=0);" + "opacity: 0;" + "width: " + self.nzWidth + "px;" + "height: " + self.nzHeight + "px;"; self.lensRound = ''; if (self.options.zoomType == "lens") { self.lensStyle = "background-position: 0px 0px;" + "float: left;display: none;" + "border: " + String(self.options.borderSize) + "px solid " + self.options.borderColour + ";" + "width:" + String(self.options.lensSize) + "px;" + "height:" + String(self.options.lensSize) + "px;" + "background-repeat: no-repeat;position: absolute;" } if (self.options.lensShape == "round") { self.lensRound = "border-top-left-radius: " + String(self.options.lensSize / 2 + self.options.borderSize) + "px;" + "border-top-right-radius: " + String(self.options.lensSize / 2 + self.options.borderSize) + "px;" + "border-bottom-left-radius: " + String(self.options.lensSize / 2 + self.options.borderSize) + "px;" + "border-bottom-right-radius: " + String(self.options.lensSize / 2 + self.options.borderSize) + "px;" } self.zoomContainer = $('
'); $('body').append(self.zoomContainer); if (self.options.containLensZoom && self.options.zoomType == "lens") { self.zoomContainer.css("overflow", "hidden") } if (self.options.zoomType != "inner") { self.zoomLens = $("
 
").appendTo(self.zoomContainer).click(function () { self.$elem.trigger('click') }); if (self.options.tint) { self.tintContainer = $('
').addClass('tintContainer'); self.zoomTint = $("
"); self.zoomLens.wrap(self.tintContainer); self.zoomTintcss = self.zoomLens.after(self.zoomTint); self.zoomTintImage = $('').appendTo(self.zoomLens).click(function () { self.$elem.trigger('click') }) } } if (isNaN(self.options.zoomWindowPosition)) { self.zoomWindow = $("
 
").appendTo('body').click(function () { self.$elem.trigger('click') }) } else { self.zoomWindow = $("
 
").appendTo(self.zoomContainer).click(function () { self.$elem.trigger('click') }) } self.zoomWindowContainer = $('
').addClass('zoomWindowContainer').css("width", self.options.zoomWindowWidth); self.zoomWindow.wrap(self.zoomWindowContainer); if (self.options.zoomType == "lens") { self.zoomLens.css({backgroundImage: "url('" + self.imageSrc + "')"}) } if (self.options.zoomType == "window") { self.zoomWindow.css({backgroundImage: "url('" + self.imageSrc + "')"}) } if (self.options.zoomType == "inner") { self.zoomWindow.css({backgroundImage: "url('" + self.imageSrc + "')"}) } self.$elem.bind('touchmove', function (e) { e.preventDefault(); var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; self.setPosition(touch) }); self.zoomContainer.bind('touchmove', function (e) { if (self.options.zoomType == "inner") { self.showHideWindow("show") } e.preventDefault(); var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; self.setPosition(touch) }); self.zoomContainer.bind('touchend', function (e) { self.showHideWindow("hide"); if (self.options.showLens) { self.showHideLens("hide") } if (self.options.tint && self.options.zoomType != "inner") { self.showHideTint("hide") } }); self.$elem.bind('touchend', function (e) { self.showHideWindow("hide"); if (self.options.showLens) { self.showHideLens("hide") } if (self.options.tint && self.options.zoomType != "inner") { self.showHideTint("hide") } }); if (self.options.showLens) { self.zoomLens.bind('touchmove', function (e) { e.preventDefault(); var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; self.setPosition(touch) }); self.zoomLens.bind('touchend', function (e) { self.showHideWindow("hide"); if (self.options.showLens) { self.showHideLens("hide") } if (self.options.tint && self.options.zoomType != "inner") { self.showHideTint("hide") } }) } self.$elem.bind('mousemove', function (e) { if (self.overWindow == !1) { self.setElements("show") } if (self.lastX !== e.clientX || self.lastY !== e.clientY) { self.setPosition(e); self.currentLoc = e } self.lastX = e.clientX; self.lastY = e.clientY }); self.zoomContainer.bind('mousemove', function (e) { if (self.overWindow == !1) { self.setElements("show") } if (self.lastX !== e.clientX || self.lastY !== e.clientY) { self.setPosition(e); self.currentLoc = e } self.lastX = e.clientX; self.lastY = e.clientY }); if (self.options.zoomType != "inner") { self.zoomLens.bind('mousemove', function (e) { if (self.lastX !== e.clientX || self.lastY !== e.clientY) { self.setPosition(e); self.currentLoc = e } self.lastX = e.clientX; self.lastY = e.clientY }) } if (self.options.tint && self.options.zoomType != "inner") { self.zoomTint.bind('mousemove', function (e) { if (self.lastX !== e.clientX || self.lastY !== e.clientY) { self.setPosition(e); self.currentLoc = e } self.lastX = e.clientX; self.lastY = e.clientY }) } if (self.options.zoomType == "inner") { self.zoomWindow.bind('mousemove', function (e) { if (self.lastX !== e.clientX || self.lastY !== e.clientY) { self.setPosition(e); self.currentLoc = e } self.lastX = e.clientX; self.lastY = e.clientY }) } self.zoomContainer.add(self.$elem).mouseenter(function () { if (self.overWindow == !1) { self.setElements("show") } }).mouseleave(function () { if (!self.scrollLock) { self.setElements("hide"); self.options.onDestroy(self.$elem) } }); if (self.options.zoomType != "inner") { self.zoomWindow.mouseenter(function () { self.overWindow = !0; self.setElements("hide") }).mouseleave(function () { self.overWindow = !1 }) } if (self.options.zoomLevel != 1) { } if (self.options.minZoomLevel) { self.minZoomLevel = self.options.minZoomLevel } else { self.minZoomLevel = self.options.scrollZoomIncrement * 2 } if (self.options.scrollZoom) { self.zoomContainer.add(self.$elem).bind('mousewheel DOMMouseScroll MozMousePixelScroll', function (e) { self.scrollLock = !0; clearTimeout($.data(this, 'timer')); $.data(this, 'timer', setTimeout(function () { self.scrollLock = !1 }, 250)); var theEvent = e.originalEvent.wheelDelta || e.originalEvent.detail * -1 e.stopImmediatePropagation(); e.stopPropagation(); e.preventDefault(); if (theEvent / 120 > 0) { if (self.currentZoomLevel >= self.minZoomLevel) { self.changeZoomLevel(self.currentZoomLevel - self.options.scrollZoomIncrement) } } else { if (self.options.maxZoomLevel) { if (self.currentZoomLevel <= self.options.maxZoomLevel) { self.changeZoomLevel(parseFloat(self.currentZoomLevel) + self.options.scrollZoomIncrement) } } else { self.changeZoomLevel(parseFloat(self.currentZoomLevel) + self.options.scrollZoomIncrement) } } return !1 }) } }, setElements: function (type) { var self = this; if (!self.options.zoomEnabled) { return !1 } if (type == "show") { if (self.isWindowSet) { if (self.options.zoomType == "inner") { self.showHideWindow("show") } if (self.options.zoomType == "window") { self.showHideWindow("show") } if (self.options.showLens) { self.showHideLens("show") } if (self.options.tint && self.options.zoomType != "inner") { self.showHideTint("show") } } } if (type == "hide") { if (self.options.zoomType == "window") { self.showHideWindow("hide") } if (!self.options.tint) { self.showHideWindow("hide") } if (self.options.showLens) { self.showHideLens("hide") } if (self.options.tint) { self.showHideTint("hide") } } }, setPosition: function (e) { var self = this; if (!self.options.zoomEnabled) { return !1 } self.nzHeight = self.$elem.height(); self.nzWidth = self.$elem.width(); self.nzOffset = self.$elem.offset(); if (self.options.tint && self.options.zoomType != "inner") { self.zoomTint.css({top: 0}); self.zoomTint.css({left: 0}) } if (self.options.responsive && !self.options.scrollZoom) { if (self.options.showLens) { if (self.nzHeight < self.options.zoomWindowWidth / self.widthRatio) { lensHeight = self.nzHeight } else { lensHeight = String((self.options.zoomWindowHeight / self.heightRatio)) } if (self.largeWidth < self.options.zoomWindowWidth) { lensWidth = self.nzWidth } else { lensWidth = (self.options.zoomWindowWidth / self.widthRatio) } self.widthRatio = self.largeWidth / self.nzWidth; self.heightRatio = self.largeHeight / self.nzHeight; if (self.options.zoomType != "lens") { if (self.nzHeight < self.options.zoomWindowWidth / self.widthRatio) { lensHeight = self.nzHeight } else { lensHeight = String((self.options.zoomWindowHeight / self.heightRatio)) } if (self.nzWidth < self.options.zoomWindowHeight / self.heightRatio) { lensWidth = self.nzWidth } else { lensWidth = String((self.options.zoomWindowWidth / self.widthRatio)) } self.zoomLens.css('width', lensWidth); self.zoomLens.css('height', lensHeight); if (self.options.tint) { self.zoomTintImage.css('width', self.nzWidth); self.zoomTintImage.css('height', self.nzHeight) } } if (self.options.zoomType == "lens") { self.zoomLens.css({ width: String(self.options.lensSize) + 'px', height: String(self.options.lensSize) + 'px' }) } } } self.zoomContainer.css({top: self.nzOffset.top}); self.zoomContainer.css({left: self.nzOffset.left}); self.mouseLeft = parseInt(e.pageX - self.nzOffset.left); self.mouseTop = parseInt(e.pageY - self.nzOffset.top); if (self.options.zoomType == "window") { self.Etoppos = (self.mouseTop < (self.zoomLens.height() / 2)); self.Eboppos = (self.mouseTop > self.nzHeight - (self.zoomLens.height() / 2) - (self.options.lensBorderSize * 2)); self.Eloppos = (self.mouseLeft < 0 + ((self.zoomLens.width() / 2))); self.Eroppos = (self.mouseLeft > (self.nzWidth - (self.zoomLens.width() / 2) - (self.options.lensBorderSize * 2))) } if (self.options.zoomType == "inner") { self.Etoppos = (self.mouseTop < ((self.nzHeight / 2) / self.heightRatio)); self.Eboppos = (self.mouseTop > (self.nzHeight - ((self.nzHeight / 2) / self.heightRatio))); self.Eloppos = (self.mouseLeft < 0 + (((self.nzWidth / 2) / self.widthRatio))); self.Eroppos = (self.mouseLeft > (self.nzWidth - (self.nzWidth / 2) / self.widthRatio - (self.options.lensBorderSize * 2))) } if (self.mouseLeft < 0 || self.mouseTop < 0 || self.mouseLeft > self.nzWidth || self.mouseTop > self.nzHeight) { self.setElements("hide"); return } else { if (self.options.showLens) { self.lensLeftPos = String(Math.floor(self.mouseLeft - self.zoomLens.width() / 2)); self.lensTopPos = String(Math.floor(self.mouseTop - self.zoomLens.height() / 2)) } if (self.Etoppos) { self.lensTopPos = 0 } if (self.Eloppos) { self.windowLeftPos = 0; self.lensLeftPos = 0; self.tintpos = 0 } if (self.options.zoomType == "window") { if (self.Eboppos) { self.lensTopPos = Math.max((self.nzHeight) - self.zoomLens.height() - (self.options.lensBorderSize * 2), 0) } if (self.Eroppos) { self.lensLeftPos = (self.nzWidth - (self.zoomLens.width()) - (self.options.lensBorderSize * 2)) } } if (self.options.zoomType == "inner") { if (self.Eboppos) { self.lensTopPos = Math.max(((self.nzHeight) - (self.options.lensBorderSize * 2)), 0) } if (self.Eroppos) { self.lensLeftPos = (self.nzWidth - (self.nzWidth) - (self.options.lensBorderSize * 2)) } } if (self.options.zoomType == "lens") { self.windowLeftPos = String(((e.pageX - self.nzOffset.left) * self.widthRatio - self.zoomLens.width() / 2) * (-1)); self.windowTopPos = String(((e.pageY - self.nzOffset.top) * self.heightRatio - self.zoomLens.height() / 2) * (-1)); self.zoomLens.css({backgroundPosition: self.windowLeftPos + 'px ' + self.windowTopPos + 'px'}); if (self.changeBgSize) { if (self.nzHeight > self.nzWidth) { if (self.options.zoomType == "lens") { self.zoomLens.css({"background-size": self.largeWidth / self.newvalueheight + 'px ' + self.largeHeight / self.newvalueheight + 'px'}) } self.zoomWindow.css({"background-size": self.largeWidth / self.newvalueheight + 'px ' + self.largeHeight / self.newvalueheight + 'px'}) } else { if (self.options.zoomType == "lens") { self.zoomLens.css({"background-size": self.largeWidth / self.newvaluewidth + 'px ' + self.largeHeight / self.newvaluewidth + 'px'}) } self.zoomWindow.css({"background-size": self.largeWidth / self.newvaluewidth + 'px ' + self.largeHeight / self.newvaluewidth + 'px'}) } self.changeBgSize = !1 } self.setWindowPostition(e) } if (self.options.tint && self.options.zoomType != "inner") { self.setTintPosition(e) } if (self.options.zoomType == "window") { self.setWindowPostition(e) } if (self.options.zoomType == "inner") { self.setWindowPostition(e) } if (self.options.showLens) { if (self.fullwidth && self.options.zoomType != "lens") { self.lensLeftPos = 0 } self.zoomLens.css({left: self.lensLeftPos + 'px', top: self.lensTopPos + 'px'}) } } }, showHideWindow: function (change) { var self = this; if (change == "show") { if (!self.isWindowActive) { if (self.options.zoomWindowFadeIn) { self.zoomWindow.stop(!0, !0, !1).fadeIn(self.options.zoomWindowFadeIn) } else { self.zoomWindow.show() } self.isWindowActive = !0 } } if (change == "hide") { if (self.isWindowActive) { if (self.options.zoomWindowFadeOut) { self.zoomWindow.stop(!0, !0).fadeOut(self.options.zoomWindowFadeOut, function () { if (self.loop) { clearInterval(self.loop); self.loop = !1 } }) } else { self.zoomWindow.hide() } self.isWindowActive = !1 } } }, showHideLens: function (change) { var self = this; if (change == "show") { if (!self.isLensActive) { if (self.options.lensFadeIn) { self.zoomLens.stop(!0, !0, !1).fadeIn(self.options.lensFadeIn) } else { self.zoomLens.show() } self.isLensActive = !0 } } if (change == "hide") { if (self.isLensActive) { if (self.options.lensFadeOut) { self.zoomLens.stop(!0, !0).fadeOut(self.options.lensFadeOut) } else { self.zoomLens.hide() } self.isLensActive = !1 } } }, showHideTint: function (change) { var self = this; if (change == "show") { if (!self.isTintActive) { if (self.options.zoomTintFadeIn) { self.zoomTint.css({opacity: self.options.tintOpacity}).animate().stop(!0, !0).fadeIn("slow") } else { self.zoomTint.css({opacity: self.options.tintOpacity}).animate(); self.zoomTint.show() } self.isTintActive = !0 } } if (change == "hide") { if (self.isTintActive) { if (self.options.zoomTintFadeOut) { self.zoomTint.stop(!0, !0).fadeOut(self.options.zoomTintFadeOut) } else { self.zoomTint.hide() } self.isTintActive = !1 } } }, setLensPostition: function (e) { }, setWindowPostition: function (e) { var self = this; if (!isNaN(self.options.zoomWindowPosition)) { switch (self.options.zoomWindowPosition) { case 1: self.windowOffsetTop = (self.options.zoomWindowOffety); self.windowOffsetLeft = (+self.nzWidth); break; case 2: if (self.options.zoomWindowHeight > self.nzHeight) { self.windowOffsetTop = ((self.options.zoomWindowHeight / 2) - (self.nzHeight / 2)) * (-1); self.windowOffsetLeft = (self.nzWidth) } else { } break; case 3: self.windowOffsetTop = (self.nzHeight - self.zoomWindow.height() - (self.options.borderSize * 2)); self.windowOffsetLeft = (self.nzWidth); break; case 4: self.windowOffsetTop = (self.nzHeight); self.windowOffsetLeft = (self.nzWidth); break; case 5: self.windowOffsetTop = (self.nzHeight); self.windowOffsetLeft = (self.nzWidth - self.zoomWindow.width() - (self.options.borderSize * 2)); break; case 6: if (self.options.zoomWindowHeight > self.nzHeight) { self.windowOffsetTop = (self.nzHeight); self.windowOffsetLeft = ((self.options.zoomWindowWidth / 2) - (self.nzWidth / 2) + (self.options.borderSize * 2)) * (-1) } else { } break; case 7: self.windowOffsetTop = (self.nzHeight); self.windowOffsetLeft = 0; break; case 8: self.windowOffsetTop = (self.nzHeight); self.windowOffsetLeft = (self.zoomWindow.width() + (self.options.borderSize * 2)) * (-1); break; case 9: self.windowOffsetTop = (self.nzHeight - self.zoomWindow.height() - (self.options.borderSize * 2)); self.windowOffsetLeft = (self.zoomWindow.width() + (self.options.borderSize * 2)) * (-1); break; case 10: if (self.options.zoomWindowHeight > self.nzHeight) { self.windowOffsetTop = ((self.options.zoomWindowHeight / 2) - (self.nzHeight / 2)) * (-1); self.windowOffsetLeft = (self.zoomWindow.width() + (self.options.borderSize * 2)) * (-1) } else { } break; case 11: self.windowOffsetTop = (self.options.zoomWindowOffety); self.windowOffsetLeft = (self.zoomWindow.width() + (self.options.borderSize * 2)) * (-1); break; case 12: self.windowOffsetTop = (self.zoomWindow.height() + (self.options.borderSize * 2)) * (-1); self.windowOffsetLeft = (self.zoomWindow.width() + (self.options.borderSize * 2)) * (-1); break; case 13: self.windowOffsetTop = (self.zoomWindow.height() + (self.options.borderSize * 2)) * (-1); self.windowOffsetLeft = (0); break; case 14: if (self.options.zoomWindowHeight > self.nzHeight) { self.windowOffsetTop = (self.zoomWindow.height() + (self.options.borderSize * 2)) * (-1); self.windowOffsetLeft = ((self.options.zoomWindowWidth / 2) - (self.nzWidth / 2) + (self.options.borderSize * 2)) * (-1) } else { } break; case 15: self.windowOffsetTop = (self.zoomWindow.height() + (self.options.borderSize * 2)) * (-1); self.windowOffsetLeft = (self.nzWidth - self.zoomWindow.width() - (self.options.borderSize * 2)); break; case 16: self.windowOffsetTop = (self.zoomWindow.height() + (self.options.borderSize * 2)) * (-1); self.windowOffsetLeft = (self.nzWidth); break; default: self.windowOffsetTop = (self.options.zoomWindowOffety); self.windowOffsetLeft = (self.nzWidth) } } else { self.externalContainer = $('#' + self.options.zoomWindowPosition); self.externalContainerWidth = self.externalContainer.width(); self.externalContainerHeight = self.externalContainer.height(); self.externalContainerOffset = self.externalContainer.offset(); self.windowOffsetTop = self.externalContainerOffset.top; self.windowOffsetLeft = self.externalContainerOffset.left } self.isWindowSet = !0; self.windowOffsetTop = self.windowOffsetTop + self.options.zoomWindowOffety; self.windowOffsetLeft = self.windowOffsetLeft + self.options.zoomWindowOffetx; self.zoomWindow.css({top: self.windowOffsetTop}); self.zoomWindow.css({left: self.windowOffsetLeft}); if (self.options.zoomType == "inner") { self.zoomWindow.css({top: 0}); self.zoomWindow.css({left: 0}) } self.windowLeftPos = String(((e.pageX - self.nzOffset.left) * self.widthRatio - self.zoomWindow.width() / 2) * (-1)); self.windowTopPos = String(((e.pageY - self.nzOffset.top) * self.heightRatio - self.zoomWindow.height() / 2) * (-1)); if (self.Etoppos) { self.windowTopPos = 0 } if (self.Eloppos) { self.windowLeftPos = 0 } if (self.Eboppos) { self.windowTopPos = (self.largeHeight / self.currentZoomLevel - self.zoomWindow.height()) * (-1) } if (self.Eroppos) { self.windowLeftPos = ((self.largeWidth / self.currentZoomLevel - self.zoomWindow.width()) * (-1)) } if (self.fullheight) { self.windowTopPos = 0 } if (self.fullwidth) { self.windowLeftPos = 0 } if (self.options.zoomType == "window" || self.options.zoomType == "inner") { if (self.zoomLock == 1) { if (self.widthRatio <= 1) { self.windowLeftPos = 0 } if (self.heightRatio <= 1) { self.windowTopPos = 0 } } if (self.options.zoomType == "window") { if (self.largeHeight < self.options.zoomWindowHeight) { self.windowTopPos = 0 } if (self.largeWidth < self.options.zoomWindowWidth) { self.windowLeftPos = 0 } } if (self.options.easing) { if (!self.xp) { self.xp = 0 } if (!self.yp) { self.yp = 0 } if (!self.loop) { self.loop = setInterval(function () { self.xp += (self.windowLeftPos - self.xp) / self.options.easingAmount; self.yp += (self.windowTopPos - self.yp) / self.options.easingAmount; if (self.scrollingLock) { clearInterval(self.loop); self.xp = self.windowLeftPos; self.yp = self.windowTopPos self.xp = ((e.pageX - self.nzOffset.left) * self.widthRatio - self.zoomWindow.width() / 2) * (-1); self.yp = (((e.pageY - self.nzOffset.top) * self.heightRatio - self.zoomWindow.height() / 2) * (-1)); if (self.changeBgSize) { if (self.nzHeight > self.nzWidth) { if (self.options.zoomType == "lens") { self.zoomLens.css({"background-size": self.largeWidth / self.newvalueheight + 'px ' + self.largeHeight / self.newvalueheight + 'px'}) } self.zoomWindow.css({"background-size": self.largeWidth / self.newvalueheight + 'px ' + self.largeHeight / self.newvalueheight + 'px'}) } else { if (self.options.zoomType != "lens") { self.zoomLens.css({"background-size": self.largeWidth / self.newvaluewidth + 'px ' + self.largeHeight / self.newvalueheight + 'px'}) } self.zoomWindow.css({"background-size": self.largeWidth / self.newvaluewidth + 'px ' + self.largeHeight / self.newvaluewidth + 'px'}) } self.changeBgSize = !1 } self.zoomWindow.css({backgroundPosition: self.windowLeftPos + 'px ' + self.windowTopPos + 'px'}); self.scrollingLock = !1; self.loop = !1 } else if (Math.round(Math.abs(self.xp - self.windowLeftPos) + Math.abs(self.yp - self.windowTopPos)) < 1) { clearInterval(self.loop); self.zoomWindow.css({backgroundPosition: self.windowLeftPos + 'px ' + self.windowTopPos + 'px'}); self.loop = !1 } else { if (self.changeBgSize) { if (self.nzHeight > self.nzWidth) { if (self.options.zoomType == "lens") { self.zoomLens.css({"background-size": self.largeWidth / self.newvalueheight + 'px ' + self.largeHeight / self.newvalueheight + 'px'}) } self.zoomWindow.css({"background-size": self.largeWidth / self.newvalueheight + 'px ' + self.largeHeight / self.newvalueheight + 'px'}) } else { if (self.options.zoomType != "lens") { self.zoomLens.css({"background-size": self.largeWidth / self.newvaluewidth + 'px ' + self.largeHeight / self.newvaluewidth + 'px'}) } self.zoomWindow.css({"background-size": self.largeWidth / self.newvaluewidth + 'px ' + self.largeHeight / self.newvaluewidth + 'px'}) } self.changeBgSize = !1 } self.zoomWindow.css({backgroundPosition: self.xp + 'px ' + self.yp + 'px'}) } }, 16) } } else { if (self.changeBgSize) { if (self.nzHeight > self.nzWidth) { if (self.options.zoomType == "lens") { self.zoomLens.css({"background-size": self.largeWidth / self.newvalueheight + 'px ' + self.largeHeight / self.newvalueheight + 'px'}) } self.zoomWindow.css({"background-size": self.largeWidth / self.newvalueheight + 'px ' + self.largeHeight / self.newvalueheight + 'px'}) } else { if (self.options.zoomType == "lens") { self.zoomLens.css({"background-size": self.largeWidth / self.newvaluewidth + 'px ' + self.largeHeight / self.newvaluewidth + 'px'}) } if ((self.largeHeight / self.newvaluewidth) < self.options.zoomWindowHeight) { self.zoomWindow.css({"background-size": self.largeWidth / self.newvaluewidth + 'px ' + self.largeHeight / self.newvaluewidth + 'px'}) } else { self.zoomWindow.css({"background-size": self.largeWidth / self.newvalueheight + 'px ' + self.largeHeight / self.newvalueheight + 'px'}) } } self.changeBgSize = !1 } self.zoomWindow.css({backgroundPosition: self.windowLeftPos + 'px ' + self.windowTopPos + 'px'}) } } }, setTintPosition: function (e) { var self = this; self.nzOffset = self.$elem.offset(); self.tintpos = String(((e.pageX - self.nzOffset.left) - (self.zoomLens.width() / 2)) * (-1)); self.tintposy = String(((e.pageY - self.nzOffset.top) - self.zoomLens.height() / 2) * (-1)); if (self.Etoppos) { self.tintposy = 0 } if (self.Eloppos) { self.tintpos = 0 } if (self.Eboppos) { self.tintposy = (self.nzHeight - self.zoomLens.height() - (self.options.lensBorderSize * 2)) * (-1) } if (self.Eroppos) { self.tintpos = ((self.nzWidth - self.zoomLens.width() - (self.options.lensBorderSize * 2)) * (-1)) } if (self.options.tint) { if (self.fullheight) { self.tintposy = 0 } if (self.fullwidth) { self.tintpos = 0 } self.zoomTintImage.css({'left': self.tintpos + 'px'}); self.zoomTintImage.css({'top': self.tintposy + 'px'}) } }, swaptheimage: function (smallimage, largeimage) { var self = this; var newImg = new Image(); if (self.options.loadingIcon) { self.spinner = $('
'); self.$elem.after(self.spinner) } self.options.onImageSwap(self.$elem); newImg.onload = function () { self.largeWidth = newImg.width; self.largeHeight = newImg.height; self.zoomImage = largeimage; self.zoomWindow.css({"background-size": self.largeWidth + 'px ' + self.largeHeight + 'px'}); self.swapAction(smallimage, largeimage); return } newImg.src = largeimage }, swapAction: function (smallimage, largeimage) { var self = this; var newImg2 = new Image(); newImg2.onload = function () { self.nzHeight = newImg2.height; self.nzWidth = newImg2.width; self.options.onImageSwapComplete(self.$elem); self.doneCallback(); return } newImg2.src = smallimage; self.currentZoomLevel = self.options.zoomLevel; self.options.maxZoomLevel = !1; if (self.options.zoomType == "lens") { self.zoomLens.css({backgroundImage: "url('" + largeimage + "')"}) } if (self.options.zoomType == "window") { self.zoomWindow.css({backgroundImage: "url('" + largeimage + "')"}) } if (self.options.zoomType == "inner") { self.zoomWindow.css({backgroundImage: "url('" + largeimage + "')"}) } self.currentImage = largeimage; if (self.options.imageCrossfade) { var oldImg = self.$elem; var newImg = oldImg.clone(); self.$elem.attr("src", smallimage) self.$elem.after(newImg); newImg.stop(!0).fadeOut(self.options.imageCrossfade, function () { $(this).remove() }); self.$elem.width("auto").removeAttr("width"); self.$elem.height("auto").removeAttr("height"); oldImg.fadeIn(self.options.imageCrossfade); if (self.options.tint && self.options.zoomType != "inner") { var oldImgTint = self.zoomTintImage; var newImgTint = oldImgTint.clone(); self.zoomTintImage.attr("src", largeimage) self.zoomTintImage.after(newImgTint); newImgTint.stop(!0).fadeOut(self.options.imageCrossfade, function () { $(this).remove() }); oldImgTint.fadeIn(self.options.imageCrossfade); self.zoomTint.css({height: self.$elem.height()}); self.zoomTint.css({width: self.$elem.width()}) } self.zoomContainer.css("height", self.$elem.height()); self.zoomContainer.css("width", self.$elem.width()); if (self.options.zoomType == "inner") { if (!self.options.constrainType) { self.zoomWrap.parent().css("height", self.$elem.height()); self.zoomWrap.parent().css("width", self.$elem.width()); self.zoomWindow.css("height", self.$elem.height()); self.zoomWindow.css("width", self.$elem.width()) } } if (self.options.imageCrossfade) { self.zoomWrap.css("height", self.$elem.height()); self.zoomWrap.css("width", self.$elem.width()) } } else { self.$elem.attr("src", smallimage); if (self.options.tint) { self.zoomTintImage.attr("src", largeimage); self.zoomTintImage.attr("height", self.$elem.height()); self.zoomTintImage.css({height: self.$elem.height()}); self.zoomTint.css({height: self.$elem.height()}) } self.zoomContainer.css("height", self.$elem.height()); self.zoomContainer.css("width", self.$elem.width()); if (self.options.imageCrossfade) { self.zoomWrap.css("height", self.$elem.height()); self.zoomWrap.css("width", self.$elem.width()) } } if (self.options.constrainType) { if (self.options.constrainType == "height") { self.zoomContainer.css("height", self.options.constrainSize); self.zoomContainer.css("width", "auto"); if (self.options.imageCrossfade) { self.zoomWrap.css("height", self.options.constrainSize); self.zoomWrap.css("width", "auto"); self.constwidth = self.zoomWrap.width() } else { self.$elem.css("height", self.options.constrainSize); self.$elem.css("width", "auto"); self.constwidth = self.$elem.width() } if (self.options.zoomType == "inner") { self.zoomWrap.parent().css("height", self.options.constrainSize); self.zoomWrap.parent().css("width", self.constwidth); self.zoomWindow.css("height", self.options.constrainSize); self.zoomWindow.css("width", self.constwidth) } if (self.options.tint) { self.tintContainer.css("height", self.options.constrainSize); self.tintContainer.css("width", self.constwidth); self.zoomTint.css("height", self.options.constrainSize); self.zoomTint.css("width", self.constwidth); self.zoomTintImage.css("height", self.options.constrainSize); self.zoomTintImage.css("width", self.constwidth) } } if (self.options.constrainType == "width") { self.zoomContainer.css("height", "auto"); self.zoomContainer.css("width", self.options.constrainSize); if (self.options.imageCrossfade) { self.zoomWrap.css("height", "auto"); self.zoomWrap.css("width", self.options.constrainSize); self.constheight = self.zoomWrap.height() } else { self.$elem.css("height", "auto"); self.$elem.css("width", self.options.constrainSize); self.constheight = self.$elem.height() } if (self.options.zoomType == "inner") { self.zoomWrap.parent().css("height", self.constheight); self.zoomWrap.parent().css("width", self.options.constrainSize); self.zoomWindow.css("height", self.constheight); self.zoomWindow.css("width", self.options.constrainSize) } if (self.options.tint) { self.tintContainer.css("height", self.constheight); self.tintContainer.css("width", self.options.constrainSize); self.zoomTint.css("height", self.constheight); self.zoomTint.css("width", self.options.constrainSize); self.zoomTintImage.css("height", self.constheight); self.zoomTintImage.css("width", self.options.constrainSize) } } } }, doneCallback: function () { var self = this; if (self.options.loadingIcon) { self.spinner.hide() } self.nzOffset = self.$elem.offset(); self.nzWidth = self.$elem.width(); self.nzHeight = self.$elem.height(); self.currentZoomLevel = self.options.zoomLevel; self.widthRatio = self.largeWidth / self.nzWidth; self.heightRatio = self.largeHeight / self.nzHeight; if (self.options.zoomType == "window") { if (self.nzHeight < self.options.zoomWindowWidth / self.widthRatio) { lensHeight = self.nzHeight } else { lensHeight = String((self.options.zoomWindowHeight / self.heightRatio)) } if (self.options.zoomWindowWidth < self.options.zoomWindowWidth) { lensWidth = self.nzWidth } else { lensWidth = (self.options.zoomWindowWidth / self.widthRatio) } if (self.zoomLens) { self.zoomLens.css('width', lensWidth); self.zoomLens.css('height', lensHeight) } } }, getCurrentImage: function () { var self = this; return self.zoomImage }, getGalleryList: function () { var self = this; self.gallerylist = []; if (self.options.gallery) { $('#' + self.options.gallery + ' a').each(function () { var img_src = ''; if ($(this).data("zoom-image")) { img_src = $(this).data("zoom-image") } else if ($(this).data("image")) { img_src = $(this).data("image") } if (img_src == self.zoomImage) { self.gallerylist.unshift({href: '' + img_src + '', title: $(this).find('img').attr("title")}) } else { self.gallerylist.push({href: '' + img_src + '', title: $(this).find('img').attr("title")}) } }) } else { self.gallerylist.push({href: '' + self.zoomImage + '', title: $(this).find('img').attr("title")}) } return self.gallerylist }, changeZoomLevel: function (value) { var self = this; self.scrollingLock = !0; self.newvalue = parseFloat(value).toFixed(2); newvalue = parseFloat(value).toFixed(2); maxheightnewvalue = self.largeHeight / ((self.options.zoomWindowHeight / self.nzHeight) * self.nzHeight); maxwidthtnewvalue = self.largeWidth / ((self.options.zoomWindowWidth / self.nzWidth) * self.nzWidth); if (self.options.zoomType != "inner") { if (maxheightnewvalue <= newvalue) { self.heightRatio = (self.largeHeight / maxheightnewvalue) / self.nzHeight; self.newvalueheight = maxheightnewvalue; self.fullheight = !0 } else { self.heightRatio = (self.largeHeight / newvalue) / self.nzHeight; self.newvalueheight = newvalue; self.fullheight = !1 } if (maxwidthtnewvalue <= newvalue) { self.widthRatio = (self.largeWidth / maxwidthtnewvalue) / self.nzWidth; self.newvaluewidth = maxwidthtnewvalue; self.fullwidth = !0 } else { self.widthRatio = (self.largeWidth / newvalue) / self.nzWidth; self.newvaluewidth = newvalue; self.fullwidth = !1 } if (self.options.zoomType == "lens") { if (maxheightnewvalue <= newvalue) { self.fullwidth = !0; self.newvaluewidth = maxheightnewvalue } else { self.widthRatio = (self.largeWidth / newvalue) / self.nzWidth; self.newvaluewidth = newvalue; self.fullwidth = !1 } } } if (self.options.zoomType == "inner") { maxheightnewvalue = parseFloat(self.largeHeight / self.nzHeight).toFixed(2); maxwidthtnewvalue = parseFloat(self.largeWidth / self.nzWidth).toFixed(2); if (newvalue > maxheightnewvalue) { newvalue = maxheightnewvalue } if (newvalue > maxwidthtnewvalue) { newvalue = maxwidthtnewvalue } if (maxheightnewvalue <= newvalue) { self.heightRatio = (self.largeHeight / newvalue) / self.nzHeight; if (newvalue > maxheightnewvalue) { self.newvalueheight = maxheightnewvalue } else { self.newvalueheight = newvalue } self.fullheight = !0 } else { self.heightRatio = (self.largeHeight / newvalue) / self.nzHeight; if (newvalue > maxheightnewvalue) { self.newvalueheight = maxheightnewvalue } else { self.newvalueheight = newvalue } self.fullheight = !1 } if (maxwidthtnewvalue <= newvalue) { self.widthRatio = (self.largeWidth / newvalue) / self.nzWidth; if (newvalue > maxwidthtnewvalue) { self.newvaluewidth = maxwidthtnewvalue } else { self.newvaluewidth = newvalue } self.fullwidth = !0 } else { self.widthRatio = (self.largeWidth / newvalue) / self.nzWidth; self.newvaluewidth = newvalue; self.fullwidth = !1 } } scrcontinue = !1; if (self.options.zoomType == "inner") { if (self.nzWidth >= self.nzHeight) { if (self.newvaluewidth <= maxwidthtnewvalue) { scrcontinue = !0 } else { scrcontinue = !1; self.fullheight = !0; self.fullwidth = !0 } } if (self.nzHeight > self.nzWidth) { if (self.newvaluewidth <= maxwidthtnewvalue) { scrcontinue = !0 } else { scrcontinue = !1; self.fullheight = !0; self.fullwidth = !0 } } } if (self.options.zoomType != "inner") { scrcontinue = !0 } if (scrcontinue) { self.zoomLock = 0; self.changeZoom = !0; if (((self.options.zoomWindowHeight) / self.heightRatio) <= self.nzHeight) { self.currentZoomLevel = self.newvalueheight; if (self.options.zoomType != "lens" && self.options.zoomType != "inner") { self.changeBgSize = !0; self.zoomLens.css({height: String((self.options.zoomWindowHeight) / self.heightRatio) + 'px'}) } if (self.options.zoomType == "lens" || self.options.zoomType == "inner") { self.changeBgSize = !0 } } if ((self.options.zoomWindowWidth / self.widthRatio) <= self.nzWidth) { if (self.options.zoomType != "inner") { if (self.newvaluewidth > self.newvalueheight) { self.currentZoomLevel = self.newvaluewidth } } if (self.options.zoomType != "lens" && self.options.zoomType != "inner") { self.changeBgSize = !0; self.zoomLens.css({width: String((self.options.zoomWindowWidth) / self.widthRatio) + 'px'}) } if (self.options.zoomType == "lens" || self.options.zoomType == "inner") { self.changeBgSize = !0 } } if (self.options.zoomType == "inner") { self.changeBgSize = !0; if (self.nzWidth > self.nzHeight) { self.currentZoomLevel = self.newvaluewidth } if (self.nzHeight > self.nzWidth) { self.currentZoomLevel = self.newvaluewidth } } } self.setPosition(self.currentLoc) }, closeAll: function () { if (self.zoomWindow) { self.zoomWindow.hide() } if (self.zoomLens) { self.zoomLens.hide() } if (self.zoomTint) { self.zoomTint.hide() } }, changeState: function (value) { var self = this; if (value == 'enable') { self.options.zoomEnabled = !0 } if (value == 'disable') { self.options.zoomEnabled = !1 } } }; $.fn.elevateZoom = function (options) { return this.each(function () { var elevate = Object.create(ElevateZoom); elevate.init(options, this); $.data(this, 'elevateZoom', elevate) }) }; $.fn.elevateZoom.options = { zoomActivation: "hover", zoomEnabled: !0, preloading: 1, zoomLevel: 1, scrollZoom: !1, scrollZoomIncrement: 0.1, minZoomLevel: !1, maxZoomLevel: !1, easing: !0, easingAmount: 18, lensSize: 180, zoomWindowWidth: 300, zoomWindowHeight: 300, zoomWindowOffetx: 2, zoomWindowOffety: 0, zoomWindowPosition: 1, zoomWindowBgColour: "#fff", lensFadeIn: !1, lensFadeOut: !1, debug: !1, zoomWindowFadeIn: !1, zoomWindowFadeOut: !1, zoomWindowAlwaysShow: !1, zoomTintFadeIn: !1, zoomTintFadeOut: !1, borderSize: 1, showLens: !0, borderColour: "#f2f2f2", lensBorderSize: 1, lensBorderColour: "#ef4749", lensShape: "square", zoomType: "window", containLensZoom: !1, lensColour: "#ef4749", lensOpacity: 0.3, lenszoom: !0, tint: !1, tintColour: "#333", tintOpacity: 0.4, gallery: !1, galleryActiveClass: "zoomGalleryActive", imageCrossfade: !1, constrainType: !1, constrainSize: !1, loadingIcon: !1, cursor: "default", responsive: !0, onComplete: $.noop, onDestroy: function () { }, onZoomedImageLoaded: function () { }, onImageSwap: $.noop, onImageSwapComplete: $.noop } })(jQuery, window, document); $(document).ready(function () { function productZoom() { if ($(document).width() >= 768) { $('.product-cover img').elevateZoom({ zoomType: "window", cursor: "crosshair", galleryActiveClass: "active", zoomWindowFadeIn: 200, zoomWindowFadeOut: 200 }); $('body').on('mouseenter', '.product-cover .js-qv-product-cover', function () { $('.zoomContainer').remove(); $(this).removeData('elevateZoom'); $(this).attr('src', $(this).attr('src')); $(this).data('zoom-image', $(this).data('zoom-image')); $(this).elevateZoom({zoomType: 'window'}) }); $('body').on('click', ('.js-qv-product-images .js-thumb'), function (e) { e.preventDefault(); var zoom_val = $(this).attr('src'); $(".zoomLens img").attr('src', $(this).attr('data-image-large-src')); $('.zoomWindowContainer div').css("background-image", "url(" + $(this).attr('data-image-large-src') + ")") }) } } $(document).ready(function () { productZoom() }); $(window).resize(function () { productZoom() }) }); (function () { "use strict"; function e() { } function t(e, t) { for (var n = e.length; n--;) if (e[n].listener === t) return n; return -1 } var n = e.prototype; n.getListeners = function (e) { var t, n, i = this._getEvents(); if ("object" == typeof e) { t = {}; for (n in i) i.hasOwnProperty(n) && e.test(n) && (t[n] = i[n]) } else t = i[e] || (i[e] = []); return t }, n.flattenListeners = function (e) { var t, n = []; for (t = 0; e.length > t; t += 1) n.push(e[t].listener); return n }, n.getListenersAsObject = function (e) { var t, n = this.getListeners(e); return n instanceof Array && (t = {}, t[e] = n), t || n }, n.addListener = function (e, n) { var i, r = this.getListenersAsObject(e), o = "object" == typeof n; for (i in r) r.hasOwnProperty(i) && -1 === t(r[i], n) && r[i].push(o ? n : {listener: n, once: !1}); return this }, n.on = n.addListener, n.addOnceListener = function (e, t) { return this.addListener(e, {listener: t, once: !0}) }, n.once = n.addOnceListener, n.defineEvent = function (e) { return this.getListeners(e), this }, n.defineEvents = function (e) { for (var t = 0; e.length > t; t += 1) this.defineEvent(e[t]); return this }, n.removeListener = function (e, n) { var i, r, o = this.getListenersAsObject(e); for (r in o) o.hasOwnProperty(r) && (i = t(o[r], n), -1 !== i && o[r].splice(i, 1)); return this }, n.off = n.removeListener, n.addListeners = function (e, t) { return this.manipulateListeners(!1, e, t) }, n.removeListeners = function (e, t) { return this.manipulateListeners(!0, e, t) }, n.manipulateListeners = function (e, t, n) { var i, r, o = e ? this.removeListener : this.addListener, s = e ? this.removeListeners : this.addListeners; if ("object" != typeof t || t instanceof RegExp) for (i = n.length; i--;) o.call(this, t, n[i]); else for (i in t) t.hasOwnProperty(i) && (r = t[i]) && ("function" == typeof r ? o.call(this, i, r) : s.call(this, i, r)); return this }, n.removeEvent = function (e) { var t, n = typeof e, i = this._getEvents(); if ("string" === n) delete i[e]; else if ("object" === n) for (t in i) i.hasOwnProperty(t) && e.test(t) && delete i[t]; else delete this._events; return this }, n.emitEvent = function (e, t) { var n, i, r, o, s = this.getListenersAsObject(e); for (r in s) if (s.hasOwnProperty(r)) for (i = s[r].length; i--;) n = s[r][i], o = n.listener.apply(this, t || []), (o === this._getOnceReturnValue() || n.once === !0) && this.removeListener(e, s[r][i].listener); return this }, n.trigger = n.emitEvent, n.emit = function (e) { var t = Array.prototype.slice.call(arguments, 1); return this.emitEvent(e, t) }, n.setOnceReturnValue = function (e) { return this._onceReturnValue = e, this }, n._getOnceReturnValue = function () { return this.hasOwnProperty("_onceReturnValue") ? this._onceReturnValue : !0 }, n._getEvents = function () { return this._events || (this._events = {}) }, "function" == typeof define && define.amd ? define(function () { return e }) : "undefined" != typeof module && module.exports ? module.exports = e : this.EventEmitter = e }).call(this), function (e) { "use strict"; var t = document.documentElement, n = function () { }; t.addEventListener ? n = function (e, t, n) { e.addEventListener(t, n, !1) } : t.attachEvent && (n = function (t, n, i) { t[n + i] = i.handleEvent ? function () { var t = e.event; t.target = t.target || t.srcElement, i.handleEvent.call(i, t) } : function () { var n = e.event; n.target = n.target || n.srcElement, i.call(t, n) }, t.attachEvent("on" + n, t[n + i]) }); var i = function () { }; t.removeEventListener ? i = function (e, t, n) { e.removeEventListener(t, n, !1) } : t.detachEvent && (i = function (e, t, n) { e.detachEvent("on" + t, e[t + n]); try { delete e[t + n] } catch (i) { e[t + n] = void 0 } }); var r = {bind: n, unbind: i}; "function" == typeof define && define.amd ? define(r) : e.eventie = r }(this), function (e) { "use strict"; function t(e, t) { for (var n in t) e[n] = t[n]; return e } function n(e) { return "[object Array]" === c.call(e) } function i(e) { var t = []; if (n(e)) t = e; else if ("number" == typeof e.length) for (var i = 0, r = e.length; r > i; i++) t.push(e[i]); else t.push(e); return t } function r(e, n) { function r(e, n, s) { if (!(this instanceof r)) return new r(e, n); "string" == typeof e && (e = document.querySelectorAll(e)), this.elements = i(e), this.options = t({}, this.options), "function" == typeof n ? s = n : t(this.options, n), s && this.on("always", s), this.getImages(), o && (this.jqDeferred = new o.Deferred); var a = this; setTimeout(function () { a.check() }) } function c(e) { this.img = e } r.prototype = new e, r.prototype.options = {}, r.prototype.getImages = function () { this.images = []; for (var e = 0, t = this.elements.length; t > e; e++) { var n = this.elements[e]; "IMG" === n.nodeName && this.addImage(n); for (var i = n.querySelectorAll("img"), r = 0, o = i.length; o > r; r++) { var s = i[r]; this.addImage(s) } } }, r.prototype.addImage = function (e) { var t = new c(e); this.images.push(t) }, r.prototype.check = function () { function e(e, r) { return t.options.debug && a && s.log("confirm", e, r), t.progress(e), n++, n === i && t.complete(), !0 } var t = this, n = 0, i = this.images.length; if (this.hasAnyBroken = !1, !i) return this.complete(), void 0; for (var r = 0; i > r; r++) { var o = this.images[r]; o.on("confirm", e), o.check() } }, r.prototype.progress = function (e) { this.hasAnyBroken = this.hasAnyBroken || !e.isLoaded; var t = this; setTimeout(function () { t.emit("progress", t, e), t.jqDeferred && t.jqDeferred.notify(t, e) }) }, r.prototype.complete = function () { var e = this.hasAnyBroken ? "fail" : "done"; this.isComplete = !0; var t = this; setTimeout(function () { if (t.emit(e, t), t.emit("always", t), t.jqDeferred) { var n = t.hasAnyBroken ? "reject" : "resolve"; t.jqDeferred[n](t) } }) }, o && (o.fn.imagesLoaded = function (e, t) { var n = new r(this, e, t); return n.jqDeferred.promise(o(this)) }); var f = {}; return c.prototype = new e, c.prototype.check = function () { var e = f[this.img.src]; if (e) return this.useCached(e), void 0; if (f[this.img.src] = this, this.img.complete && void 0 !== this.img.naturalWidth) return this.confirm(0 !== this.img.naturalWidth, "naturalWidth"), void 0; var t = this.proxyImage = new Image; n.bind(t, "load", this), n.bind(t, "error", this), t.src = this.img.src }, c.prototype.useCached = function (e) { if (e.isConfirmed) this.confirm(e.isLoaded, "cached was confirmed"); else { var t = this; e.on("confirm", function (e) { return t.confirm(e.isLoaded, "cache emitted confirmed"), !0 }) } }, c.prototype.confirm = function (e, t) { this.isConfirmed = !0, this.isLoaded = e, this.emit("confirm", this, t) }, c.prototype.handleEvent = function (e) { var t = "on" + e.type; this[t] && this[t](e) }, c.prototype.onload = function () { this.confirm(!0, "onload"), this.unbindProxyEvents() }, c.prototype.onerror = function () { this.confirm(!1, "onerror"), this.unbindProxyEvents() }, c.prototype.unbindProxyEvents = function () { n.unbind(this.proxyImage, "load", this), n.unbind(this.proxyImage, "error", this) }, r } var o = e.jQuery, s = e.console, a = s !== void 0, c = Object.prototype.toString; "function" == typeof define && define.amd ? define(["eventEmitter/EventEmitter", "eventie/eventie"], r) : e.imagesLoaded = r(e.EventEmitter, e.eventie) }(window); (function () { var b, d, c; b = jQuery; c = (function () { function b() { this.fadeDuration = 500; this.fitImagesInViewport = !0; this.resizeDuration = 700; this.showImageNumberLabel = !0; this.wrapAround = !1 } b.prototype.albumLabel = function (b, c) { return "Image " + b + " of " + c }; return b })(); d = (function () { function c(b) { this.options = b; this.album = []; this.currentImageIndex = void 0; this.init() } c.prototype.init = function () { this.enable(); return this.build() }; c.prototype.enable = function () { var c = this; return b('body').on('click', 'a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]', function (d) { c.start(b(d.currentTarget)); return !1 }) }; c.prototype.build = function () { var c = this; b("
").appendTo(b('body')); this.$lightbox = b('#lightbox'); this.$overlay = b('#lightboxOverlay'); this.$outerContainer = this.$lightbox.find('.lb-outerContainer'); this.$container = this.$lightbox.find('.lb-container'); this.containerTopPadding = parseInt(this.$container.css('padding-top'), 10); this.containerRightPadding = parseInt(this.$container.css('padding-right'), 10); this.containerBottomPadding = parseInt(this.$container.css('padding-bottom'), 10); this.containerLeftPadding = parseInt(this.$container.css('padding-left'), 10); this.$overlay.hide().on('click', function () { c.end(); return !1 }); this.$lightbox.hide().on('click', function (d) { if (b(d.target).attr('id') === 'lightbox') { c.end() } return !1 }); this.$outerContainer.on('click', function (d) { if (b(d.target).attr('id') === 'lightbox') { c.end() } return !1 }); this.$lightbox.find('.lb-prev').on('click', function () { if (c.currentImageIndex === 0) { c.changeImage(c.album.length - 1) } else { c.changeImage(c.currentImageIndex - 1) } return !1 }); this.$lightbox.find('.lb-next').on('click', function () { if (c.currentImageIndex === c.album.length - 1) { c.changeImage(0) } else { c.changeImage(c.currentImageIndex + 1) } return !1 }); return this.$lightbox.find('.lb-loader, .lb-close').on('click', function () { c.end(); return !1 }) }; c.prototype.start = function (c) { var f, e, j, d, g, n, o, k, l, m, p, h, i; b(window).on("resize", this.sizeOverlay); b('select, object, embed').css({visibility: "hidden"}); this.$overlay.width(b(document).width()).height(b(document).height()).fadeIn(this.options.fadeDuration); this.album = []; g = 0; j = c.attr('data-lightbox'); if (j) { h = b(c.prop("tagName") + '[data-lightbox="' + j + '"]'); for (d = k = 0, m = h.length; k < m; d = ++k) { e = h[d]; this.album.push({link: b(e).attr('href'), title: b(e).attr('title')}); if (b(e).attr('href') === c.attr('href')) { g = d } } } else { if (c.attr('rel') === 'lightbox') { this.album.push({link: c.attr('href'), title: c.attr('title')}) } else { i = b(c.prop("tagName") + '[rel="' + c.attr('rel') + '"]'); for (d = l = 0, p = i.length; l < p; d = ++l) { e = i[d]; this.album.push({link: b(e).attr('href'), title: b(e).attr('title')}); if (b(e).attr('href') === c.attr('href')) { g = d } } } } f = b(window); o = f.scrollTop() + f.height() / 10; n = f.scrollLeft(); this.$lightbox.css({top: o + 'px', left: n + 'px'}).fadeIn(this.options.fadeDuration); this.changeImage(g) }; c.prototype.changeImage = function (f) { var d, c, e = this; this.disableKeyboardNav(); d = this.$lightbox.find('.lb-image'); this.sizeOverlay(); this.$overlay.fadeIn(this.options.fadeDuration); b('.lb-loader').fadeIn('slow'); this.$lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide(); this.$outerContainer.addClass('animating'); c = new Image(); c.onload = function () { var m, g, h, i, j, k, l; d.attr('src', e.album[f].link); m = b(c); d.width(c.width); d.height(c.height); if (e.options.fitImagesInViewport) { l = b(window).width(); k = b(window).height(); j = l - e.containerLeftPadding - e.containerRightPadding - 20; i = k - e.containerTopPadding - e.containerBottomPadding - 110; if ((c.width > j) || (c.height > i)) { if ((c.width / j) > (c.height / i)) { h = j; g = parseInt(c.height / (c.width / h), 10); d.width(h); d.height(g) } else { g = i; h = parseInt(c.width / (c.height / g), 10); d.width(h); d.height(g) } } } return e.sizeContainer(d.width(), d.height()) }; c.src = this.album[f].link; this.currentImageIndex = f }; c.prototype.sizeOverlay = function () { return b('#lightboxOverlay').width(b(document).width()).height(b(document).height()) }; c.prototype.sizeContainer = function (f, g) { var b, d, e, h, c = this; h = this.$outerContainer.outerWidth(); e = this.$outerContainer.outerHeight(); d = f + this.containerLeftPadding + this.containerRightPadding; b = g + this.containerTopPadding + this.containerBottomPadding; this.$outerContainer.animate({width: d, height: b}, this.options.resizeDuration, 'swing'); setTimeout(function () { c.$lightbox.find('.lb-dataContainer').width(d); c.$lightbox.find('.lb-prevLink').height(b); c.$lightbox.find('.lb-nextLink').height(b); c.showImage() }, this.options.resizeDuration) }; c.prototype.showImage = function () { this.$lightbox.find('.lb-loader').hide(); this.$lightbox.find('.lb-image').fadeIn('slow'); this.updateNav(); this.updateDetails(); this.preloadNeighboringImages(); this.enableKeyboardNav() }; c.prototype.updateNav = function () { this.$lightbox.find('.lb-nav').show(); if (this.album.length > 1) { if (this.options.wrapAround) { this.$lightbox.find('.lb-prev, .lb-next').show() } else { if (this.currentImageIndex > 0) { this.$lightbox.find('.lb-prev').show() } if (this.currentImageIndex < this.album.length - 1) { this.$lightbox.find('.lb-next').show() } } } }; c.prototype.updateDetails = function () { var b = this; if (typeof this.album[this.currentImageIndex].title !== 'undefined' && this.album[this.currentImageIndex].title !== "") { this.$lightbox.find('.lb-caption').html(this.album[this.currentImageIndex].title).fadeIn('fast') } if (this.album.length > 1 && this.options.showImageNumberLabel) { this.$lightbox.find('.lb-number').text(this.options.albumLabel(this.currentImageIndex + 1, this.album.length)).fadeIn('fast') } else { this.$lightbox.find('.lb-number').hide() } this.$outerContainer.removeClass('animating'); this.$lightbox.find('.lb-dataContainer').fadeIn(this.resizeDuration, function () { return b.sizeOverlay() }) }; c.prototype.preloadNeighboringImages = function () { var c, b; if (this.album.length > this.currentImageIndex + 1) { c = new Image(); c.src = this.album[this.currentImageIndex + 1].link } if (this.currentImageIndex > 0) { b = new Image(); b.src = this.album[this.currentImageIndex - 1].link } }; c.prototype.enableKeyboardNav = function () { b(document).on('keyup.keyboard', b.proxy(this.keyboardAction, this)) }; c.prototype.disableKeyboardNav = function () { b(document).off('.keyboard') }; c.prototype.keyboardAction = function (g) { var d, e, f, c, b; d = 27; e = 37; f = 39; b = g.keyCode; c = String.fromCharCode(b).toLowerCase(); if (b === d || c.match(/x|o|c/)) { this.end() } else if (c === 'p' || b === e) { if (this.currentImageIndex !== 0) { this.changeImage(this.currentImageIndex - 1) } } else if (c === 'n' || b === f) { if (this.currentImageIndex !== this.album.length - 1) { this.changeImage(this.currentImageIndex + 1) } } }; c.prototype.end = function () { this.disableKeyboardNav(); b(window).off("resize", this.sizeOverlay); this.$lightbox.fadeOut(this.options.fadeDuration); this.$overlay.fadeOut(this.options.fadeDuration); return b('select, object, embed').css({visibility: "visible"}) }; return c })(); b(function () { var e, b; b = new c(); return e = new d(b) }) }).call(this); !function (a, b) { "function" == typeof define && define.amd ? define(["jquery"], function (a) { return b(a) }) : "object" == typeof module && module.exports ? module.exports = b(require("jquery")) : b(a.jQuery) }(this, function (a) { !function (a) { "use strict"; function b(b) { var c = [{re: /[\xC0-\xC6]/g, ch: "A"}, {re: /[\xE0-\xE6]/g, ch: "a"}, { re: /[\xC8-\xCB]/g, ch: "E" }, {re: /[\xE8-\xEB]/g, ch: "e"}, {re: /[\xCC-\xCF]/g, ch: "I"}, { re: /[\xEC-\xEF]/g, ch: "i" }, {re: /[\xD2-\xD6]/g, ch: "O"}, {re: /[\xF2-\xF6]/g, ch: "o"}, { re: /[\xD9-\xDC]/g, ch: "U" }, {re: /[\xF9-\xFC]/g, ch: "u"}, {re: /[\xC7-\xE7]/g, ch: "c"}, {re: /[\xD1]/g, ch: "N"}, { re: /[\xF1]/g, ch: "n" }]; return a.each(c, function () { b = b ? b.replace(this.re, this.ch) : "" }), b } function c(b) { var c = arguments, d = b; [].shift.apply(c); var e, f = this.each(function () { var b = a(this); if (b.is("select")) { var f = b.data("selectpicker"), g = "object" == typeof d && d; if (f) { if (g) for (var h in g) g.hasOwnProperty(h) && (f.options[h] = g[h]) } else { var i = a.extend({}, l.DEFAULTS, a.fn.selectpicker.defaults || {}, b.data(), g); i.template = a.extend({}, l.DEFAULTS.template, a.fn.selectpicker.defaults ? a.fn.selectpicker.defaults.template : {}, b.data().template, g.template), b.data("selectpicker", f = new l(this, i)) } "string" == typeof d && (e = f[d] instanceof Function ? f[d].apply(f, c) : f.options[d]) } }); return "undefined" != typeof e ? e : f } String.prototype.includes || !function () { var a = {}.toString, b = function () { try { var a = {}, b = Object.defineProperty, c = b(a, a, a) && b } catch (a) { } return c }(), c = "".indexOf, d = function (b) { if (null == this) throw new TypeError; var d = String(this); if (b && "[object RegExp]" == a.call(b)) throw new TypeError; var e = d.length, f = String(b), g = f.length, h = arguments.length > 1 ? arguments[1] : void 0, i = h ? Number(h) : 0; i != i && (i = 0); var j = Math.min(Math.max(i, 0), e); return !(g + j > e) && c.call(d, f, i) != -1 }; b ? b(String.prototype, "includes", { value: d, configurable: !0, writable: !0 }) : String.prototype.includes = d }(), String.prototype.startsWith || !function () { var a = function () { try { var a = {}, b = Object.defineProperty, c = b(a, a, a) && b } catch (a) { } return c }(), b = {}.toString, c = function (a) { if (null == this) throw new TypeError; var c = String(this); if (a && "[object RegExp]" == b.call(a)) throw new TypeError; var d = c.length, e = String(a), f = e.length, g = arguments.length > 1 ? arguments[1] : void 0, h = g ? Number(g) : 0; h != h && (h = 0); var i = Math.min(Math.max(h, 0), d); if (f + i > d) return !1; for (var j = -1; ++j < f;) if (c.charCodeAt(i + j) != e.charCodeAt(j)) return !1; return !0 }; a ? a(String.prototype, "startsWith", { value: c, configurable: !0, writable: !0 }) : String.prototype.startsWith = c }(), Object.keys || (Object.keys = function (a, b, c) { c = []; for (b in a) c.hasOwnProperty.call(a, b) && c.push(b); return c }); var d = {useDefault: !1, _set: a.valHooks.select.set}; a.valHooks.select.set = function (b, c) { return c && !d.useDefault && a(b).data("selected", !0), d._set.apply(this, arguments) }; var e = null, f = function () { try { return new Event("change"), !0 } catch (a) { return !1 } }(); a.fn.triggerNative = function (a) { var b, c = this[0]; c.dispatchEvent ? (f ? b = new Event(a, {bubbles: !0}) : (b = document.createEvent("Event"), b.initEvent(a, !0, !1)), c.dispatchEvent(b)) : c.fireEvent ? (b = document.createEventObject(), b.eventType = a, c.fireEvent("on" + a, b)) : this.trigger(a) }, a.expr.pseudos.icontains = function (b, c, d) { var e = a(b).find("a"), f = (e.data("tokens") || e.text()).toString().toUpperCase(); return f.includes(d[3].toUpperCase()) }, a.expr.pseudos.ibegins = function (b, c, d) { var e = a(b).find("a"), f = (e.data("tokens") || e.text()).toString().toUpperCase(); return f.startsWith(d[3].toUpperCase()) }, a.expr.pseudos.aicontains = function (b, c, d) { var e = a(b).find("a"), f = (e.data("tokens") || e.data("normalizedText") || e.text()).toString().toUpperCase(); return f.includes(d[3].toUpperCase()) }, a.expr.pseudos.aibegins = function (b, c, d) { var e = a(b).find("a"), f = (e.data("tokens") || e.data("normalizedText") || e.text()).toString().toUpperCase(); return f.startsWith(d[3].toUpperCase()) }; var g = {"&": "&", "<": "<", ">": ">", '"': """, "'": "'", "`": "`"}, h = {"&": "&", "<": "<", ">": ">", """: '"', "'": "'", "`": "`"}, i = function (a) { var b = function (b) { return a[b] }, c = "(?:" + Object.keys(a).join("|") + ")", d = RegExp(c), e = RegExp(c, "g"); return function (a) { return a = null == a ? "" : "" + a, d.test(a) ? a.replace(e, b) : a } }, j = i(g), k = i(h), l = function (b, c) { d.useDefault || (a.valHooks.select.set = d._set, d.useDefault = !0), this.$element = a(b), this.$newElement = null, this.$button = null, this.$menu = null, this.$lis = null, this.options = c, null === this.options.title && (this.options.title = this.$element.attr("title")); var e = this.options.windowPadding; "number" == typeof e && (this.options.windowPadding = [e, e, e, e]), this.val = l.prototype.val, this.render = l.prototype.render, this.refresh = l.prototype.refresh, this.setStyle = l.prototype.setStyle, this.selectAll = l.prototype.selectAll, this.deselectAll = l.prototype.deselectAll, this.destroy = l.prototype.destroy, this.remove = l.prototype.remove, this.show = l.prototype.show, this.hide = l.prototype.hide, this.init() }; l.VERSION = "1.12.4", l.DEFAULTS = { noneSelectedText: "Nothing selected", noneResultsText: "No results matched {0}", countSelectedText: function (a, b) { return 1 == a ? "{0} item selected" : "{0} items selected" }, maxOptionsText: function (a, b) { return [1 == a ? "Limit reached ({n} item max)" : "Limit reached ({n} items max)", 1 == b ? "Group limit reached ({n} item max)" : "Group limit reached ({n} items max)"] }, selectAllText: "Select All", deselectAllText: "Deselect All", doneButton: !1, doneButtonText: "Close", multipleSeparator: ", ", styleBase: "btn", style: "btn-default", size: "auto", title: null, selectedTextFormat: "values", width: !1, container: !1, hideDisabled: !1, showSubtext: !1, showIcon: !0, showContent: !0, dropupAuto: !0, header: !1, liveSearch: !1, liveSearchPlaceholder: null, liveSearchNormalize: !1, liveSearchStyle: "contains", actionsBox: !1, iconBase: "glyphicon", tickIcon: "glyphicon-ok", showTick: !1, template: {caret: ''}, maxOptions: !1, mobile: !1, selectOnTab: !1, dropdownAlignRight: !1, windowPadding: 0 }, l.prototype = { constructor: l, init: function () { var b = this, c = this.$element.attr("id"); this.$element.addClass("bs-select-hidden"), this.liObj = {}, this.multiple = this.$element.prop("multiple"), this.autofocus = this.$element.prop("autofocus"), this.$newElement = this.createView(), this.$element.after(this.$newElement).appendTo(this.$newElement), this.$button = this.$newElement.children("button"), this.$menu = this.$newElement.children(".dropdown-menu"), this.$menuInner = this.$menu.children(".inner"), this.$searchbox = this.$menu.find("input"), this.$element.removeClass("bs-select-hidden"), this.options.dropdownAlignRight === !0 && this.$menu.addClass("dropdown-menu-right"), "undefined" != typeof c && (this.$button.attr("data-id", c), a('label[for="' + c + '"]').click(function (a) { a.preventDefault(), b.$button.focus() })), this.checkDisabled(), this.clickListener(), this.options.liveSearch && this.liveSearchListener(), this.render(), this.setStyle(), this.setWidth(), this.options.container && this.selectPosition(), this.$menu.data("this", this), this.$newElement.data("this", this), this.options.mobile && this.mobile(), this.$newElement.on({ "hide.bs.dropdown": function (a) { b.$menuInner.attr("aria-expanded", !1), b.$element.trigger("hide.bs.select", a) }, "hidden.bs.dropdown": function (a) { b.$element.trigger("hidden.bs.select", a) }, "show.bs.dropdown": function (a) { b.$menuInner.attr("aria-expanded", !0), b.$element.trigger("show.bs.select", a) }, "shown.bs.dropdown": function (a) { b.$element.trigger("shown.bs.select", a) } }), b.$element[0].hasAttribute("required") && this.$element.on("invalid", function () { b.$button.addClass("bs-invalid"), b.$element.on({ "focus.bs.select": function () { b.$button.focus(), b.$element.off("focus.bs.select") }, "shown.bs.select": function () { b.$element.val(b.$element.val()).off("shown.bs.select") }, "rendered.bs.select": function () { this.validity.valid && b.$button.removeClass("bs-invalid"), b.$element.off("rendered.bs.select") } }), b.$button.on("blur.bs.select", function () { b.$element.focus().blur(), b.$button.off("blur.bs.select") }) }), setTimeout(function () { b.$element.trigger("loaded.bs.select") }) }, createDropdown: function () { var b = this.multiple || this.options.showTick ? " show-tick" : "", c = this.$element.parent().hasClass("input-group") ? " input-group-btn" : "", d = this.autofocus ? " autofocus" : "", e = this.options.header ? '
' + this.options.header + "
" : "", f = this.options.liveSearch ? '' : "", g = this.multiple && this.options.actionsBox ? '
" : "", h = this.multiple && this.options.doneButton ? '
" : "", i = '
"; return a(i) }, createView: function () { var a = this.createDropdown(), b = this.createLi(); return a.find("ul")[0].innerHTML = b, a }, reloadLi: function () { var a = this.createLi(); this.$menuInner[0].innerHTML = a }, createLi: function () { var c = this, d = [], e = 0, f = document.createElement("option"), g = -1, h = function (a, b, c, d) { return "" + a + "" }, i = function (d, e, f, g) { return '' + d + '' }; if (this.options.title && !this.multiple && (g--, !this.$element.find(".bs-title-option").length)) { var k = this.$element[0]; f.className = "bs-title-option", f.innerHTML = this.options.title, f.value = "", k.insertBefore(f, k.firstChild); var l = a(k.options[k.selectedIndex]); void 0 === l.attr("selected") && void 0 === this.$element.data("selected") && (f.selected = !0) } var m = this.$element.find("option"); return m.each(function (b) { var f = a(this); if (g++, !f.hasClass("bs-title-option")) { var k, l = this.className || "", n = j(this.style.cssText), o = f.data("content") ? f.data("content") : f.html(), p = f.data("tokens") ? f.data("tokens") : null, q = "undefined" != typeof f.data("subtext") ? '' + f.data("subtext") + "" : "", r = "undefined" != typeof f.data("icon") ? ' ' : "", s = f.parent(), t = "OPTGROUP" === s[0].tagName, u = t && s[0].disabled, v = this.disabled || u; if ("" !== r && v && (r = "" + r + ""), c.options.hideDisabled && (v && !t || u)) return k = f.data("prevHiddenIndex"), f.next().data("prevHiddenIndex", void 0 !== k ? k : b), void g--; if (f.data("content") || (o = r + '' + o + q + ""), t && f.data("divider") !== !0) { if (c.options.hideDisabled && v) { if (void 0 === s.data("allOptionsDisabled")) { var w = s.children(); s.data("allOptionsDisabled", w.filter(":disabled").length === w.length) } if (s.data("allOptionsDisabled")) return void g-- } var x = " " + s[0].className || ""; if (0 === f.index()) { e += 1; var y = s[0].label, z = "undefined" != typeof s.data("subtext") ? '' + s.data("subtext") + "" : "", A = s.data("icon") ? ' ' : ""; y = A + '' + j(y) + z + "", 0 !== b && d.length > 0 && (g++, d.push(h("", null, "divider", e + "div"))), g++, d.push(h(y, null, "dropdown-header" + x, e)) } if (c.options.hideDisabled && v) return void g--; d.push(h(i(o, "opt " + l + x, n, p), b, "", e)) } else if (f.data("divider") === !0) d.push(h("", b, "divider")); else if (f.data("hidden") === !0) k = f.data("prevHiddenIndex"), f.next().data("prevHiddenIndex", void 0 !== k ? k : b), d.push(h(i(o, l, n, p), b, "hidden is-hidden")); else { var B = this.previousElementSibling && "OPTGROUP" === this.previousElementSibling.tagName; if (!B && c.options.hideDisabled && (k = f.data("prevHiddenIndex"), void 0 !== k)) { var C = m.eq(k)[0].previousElementSibling; C && "OPTGROUP" === C.tagName && !C.disabled && (B = !0) } B && (g++, d.push(h("", null, "divider", e + "div"))), d.push(h(i(o, l, n, p), b)) } c.liObj[b] = g } }), this.multiple || 0 !== this.$element.find("option:selected").length || this.options.title || this.$element.find("option").eq(0).prop("selected", !0).attr("selected", "selected"), d.join("") }, findLis: function () { return null == this.$lis && (this.$lis = this.$menu.find("li")), this.$lis }, render: function (b) { var c, d = this, e = this.$element.find("option"); b !== !1 && e.each(function (a) { var b = d.findLis().eq(d.liObj[a]); d.setDisabled(a, this.disabled || "OPTGROUP" === this.parentNode.tagName && this.parentNode.disabled, b), d.setSelected(a, this.selected, b) }), this.togglePlaceholder(), this.tabIndex(); var f = e.map(function () { if (this.selected) { if (d.options.hideDisabled && (this.disabled || "OPTGROUP" === this.parentNode.tagName && this.parentNode.disabled)) return; var b, c = a(this), e = c.data("icon") && d.options.showIcon ? ' ' : ""; return b = d.options.showSubtext && c.data("subtext") && !d.multiple ? ' ' + c.data("subtext") + "" : "", "undefined" != typeof c.attr("title") ? c.attr("title") : c.data("content") && d.options.showContent ? c.data("content").toString() : e + c.html() + b } }).toArray(), g = this.multiple ? f.join(this.options.multipleSeparator) : f[0]; if (this.multiple && this.options.selectedTextFormat.indexOf("count") > -1) { var h = this.options.selectedTextFormat.split(">"); if (h.length > 1 && f.length > h[1] || 1 == h.length && f.length >= 2) { c = this.options.hideDisabled ? ", [disabled]" : ""; var i = e.not('[data-divider="true"], [data-hidden="true"]' + c).length, j = "function" == typeof this.options.countSelectedText ? this.options.countSelectedText(f.length, i) : this.options.countSelectedText; g = j.replace("{0}", f.length.toString()).replace("{1}", i.toString()) } } void 0 == this.options.title && (this.options.title = this.$element.attr("title")), "static" == this.options.selectedTextFormat && (g = this.options.title), g || (g = "undefined" != typeof this.options.title ? this.options.title : this.options.noneSelectedText), this.$button.attr("title", k(a.trim(g.replace(/<[^>]*>?/g, "")))), this.$button.children(".filter-option").html(g), this.$element.trigger("rendered.bs.select") }, setStyle: function (a, b) { this.$element.attr("class") && this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi, "")); var c = a ? a : this.options.style; "add" == b ? this.$button.addClass(c) : "remove" == b ? this.$button.removeClass(c) : (this.$button.removeClass(this.options.style), this.$button.addClass(c)) }, liHeight: function (b) { if (b || this.options.size !== !1 && !this.sizeInfo) { var c = document.createElement("div"), d = document.createElement("div"), e = document.createElement("ul"), f = document.createElement("li"), g = document.createElement("li"), h = document.createElement("a"), i = document.createElement("span"), j = this.options.header && this.$menu.find(".popover-title").length > 0 ? this.$menu.find(".popover-title")[0].cloneNode(!0) : null, k = this.options.liveSearch ? document.createElement("div") : null, l = this.options.actionsBox && this.multiple && this.$menu.find(".bs-actionsbox").length > 0 ? this.$menu.find(".bs-actionsbox")[0].cloneNode(!0) : null, m = this.options.doneButton && this.multiple && this.$menu.find(".bs-donebutton").length > 0 ? this.$menu.find(".bs-donebutton")[0].cloneNode(!0) : null; if (i.className = "text", c.className = this.$menu[0].parentNode.className + " open", d.className = "dropdown-menu open", e.className = "dropdown-menu inner", f.className = "divider", i.appendChild(document.createTextNode("Inner text")), h.appendChild(i), g.appendChild(h), e.appendChild(g), e.appendChild(f), j && d.appendChild(j), k) { var n = document.createElement("input"); k.className = "bs-searchbox", n.className = "form-control", k.appendChild(n), d.appendChild(k) } l && d.appendChild(l), d.appendChild(e), m && d.appendChild(m), c.appendChild(d), document.body.appendChild(c); var o = h.offsetHeight, p = j ? j.offsetHeight : 0, q = k ? k.offsetHeight : 0, r = l ? l.offsetHeight : 0, s = m ? m.offsetHeight : 0, t = a(f).outerHeight(!0), u = "function" == typeof getComputedStyle && getComputedStyle(d), v = u ? null : a(d), w = { vert: parseInt(u ? u.paddingTop : v.css("paddingTop")) + parseInt(u ? u.paddingBottom : v.css("paddingBottom")) + parseInt(u ? u.borderTopWidth : v.css("borderTopWidth")) + parseInt(u ? u.borderBottomWidth : v.css("borderBottomWidth")), horiz: parseInt(u ? u.paddingLeft : v.css("paddingLeft")) + parseInt(u ? u.paddingRight : v.css("paddingRight")) + parseInt(u ? u.borderLeftWidth : v.css("borderLeftWidth")) + parseInt(u ? u.borderRightWidth : v.css("borderRightWidth")) }, x = { vert: w.vert + parseInt(u ? u.marginTop : v.css("marginTop")) + parseInt(u ? u.marginBottom : v.css("marginBottom")) + 2, horiz: w.horiz + parseInt(u ? u.marginLeft : v.css("marginLeft")) + parseInt(u ? u.marginRight : v.css("marginRight")) + 2 }; document.body.removeChild(c), this.sizeInfo = { liHeight: o, headerHeight: p, searchHeight: q, actionsHeight: r, doneButtonHeight: s, dividerHeight: t, menuPadding: w, menuExtras: x } } }, setSize: function () { if (this.findLis(), this.liHeight(), this.options.header && this.$menu.css("padding-top", 0), this.options.size !== !1) { var b, c, d, e, f, g, h, i, j = this, k = this.$menu, l = this.$menuInner, m = a(window), n = this.$newElement[0].offsetHeight, o = this.$newElement[0].offsetWidth, p = this.sizeInfo.liHeight, q = this.sizeInfo.headerHeight, r = this.sizeInfo.searchHeight, s = this.sizeInfo.actionsHeight, t = this.sizeInfo.doneButtonHeight, u = this.sizeInfo.dividerHeight, v = this.sizeInfo.menuPadding, w = this.sizeInfo.menuExtras, x = this.options.hideDisabled ? ".disabled" : "", y = function () { var b, c = j.$newElement.offset(), d = a(j.options.container); j.options.container && !d.is("body") ? (b = d.offset(), b.top += parseInt(d.css("borderTopWidth")), b.left += parseInt(d.css("borderLeftWidth"))) : b = { top: 0, left: 0 }; var e = j.options.windowPadding; f = c.top - b.top - m.scrollTop(), g = m.height() - f - n - b.top - e[2], h = c.left - b.left - m.scrollLeft(), i = m.width() - h - o - b.left - e[1], f -= e[0], h -= e[3] }; if (y(), "auto" === this.options.size) { var z = function () { var m, n = function (b, c) { return function (d) { return c ? d.classList ? d.classList.contains(b) : a(d).hasClass(b) : !(d.classList ? d.classList.contains(b) : a(d).hasClass(b)) } }, u = j.$menuInner[0].getElementsByTagName("li"), x = Array.prototype.filter ? Array.prototype.filter.call(u, n("hidden", !1)) : j.$lis.not(".hidden"), z = Array.prototype.filter ? Array.prototype.filter.call(x, n("dropdown-header", !0)) : x.filter(".dropdown-header"); y(), b = g - w.vert, c = i - w.horiz, j.options.container ? (k.data("height") || k.data("height", k.height()), d = k.data("height"), k.data("width") || k.data("width", k.width()), e = k.data("width")) : (d = k.height(), e = k.width()), j.options.dropupAuto && j.$newElement.toggleClass("dropup", f > g && b - w.vert < d), j.$newElement.hasClass("dropup") && (b = f - w.vert), "auto" === j.options.dropdownAlignRight && k.toggleClass("dropdown-menu-right", h > i && c - w.horiz < e - o), m = x.length + z.length > 3 ? 3 * p + w.vert - 2 : 0, k.css({ "max-height": b + "px", overflow: "hidden", "min-height": m + q + r + s + t + "px" }), l.css({ "max-height": b - q - r - s - t - v.vert + "px", "overflow-y": "auto", "min-height": Math.max(m - v.vert, 0) + "px" }) }; z(), this.$searchbox.off("input.getSize propertychange.getSize").on("input.getSize propertychange.getSize", z), m.off("resize.getSize scroll.getSize").on("resize.getSize scroll.getSize", z) } else if (this.options.size && "auto" != this.options.size && this.$lis.not(x).length > this.options.size) { var A = this.$lis.not(".divider").not(x).children().slice(0, this.options.size).last().parent().index(), B = this.$lis.slice(0, A + 1).filter(".divider").length; b = p * this.options.size + B * u + v.vert, j.options.container ? (k.data("height") || k.data("height", k.height()), d = k.data("height")) : d = k.height(), j.options.dropupAuto && this.$newElement.toggleClass("dropup", f > g && b - w.vert < d), k.css({ "max-height": b + q + r + s + t + "px", overflow: "hidden", "min-height": "" }), l.css({"max-height": b - v.vert + "px", "overflow-y": "auto", "min-height": ""}) } } }, setWidth: function () { if ("auto" === this.options.width) { this.$menu.css("min-width", "0"); var a = this.$menu.parent().clone().appendTo("body"), b = this.options.container ? this.$newElement.clone().appendTo("body") : a, c = a.children(".dropdown-menu").outerWidth(), d = b.css("width", "auto").children("button").outerWidth(); a.remove(), b.remove(), this.$newElement.css("width", Math.max(c, d) + "px") } else "fit" === this.options.width ? (this.$menu.css("min-width", ""), this.$newElement.css("width", "").addClass("fit-width")) : this.options.width ? (this.$menu.css("min-width", ""), this.$newElement.css("width", this.options.width)) : (this.$menu.css("min-width", ""), this.$newElement.css("width", "")); this.$newElement.hasClass("fit-width") && "fit" !== this.options.width && this.$newElement.removeClass("fit-width") }, selectPosition: function () { this.$bsContainer = a('
'); var b, c, d, e = this, f = a(this.options.container), g = function (a) { e.$bsContainer.addClass(a.attr("class").replace(/form-control|fit-width/gi, "")).toggleClass("dropup", a.hasClass("dropup")), b = a.offset(), f.is("body") ? c = { top: 0, left: 0 } : (c = f.offset(), c.top += parseInt(f.css("borderTopWidth")) - f.scrollTop(), c.left += parseInt(f.css("borderLeftWidth")) - f.scrollLeft()), d = a.hasClass("dropup") ? 0 : a[0].offsetHeight, e.$bsContainer.css({ top: b.top - c.top + d, left: b.left - c.left, width: a[0].offsetWidth }) }; this.$button.on("click", function () { var b = a(this); e.isDisabled() || (g(e.$newElement), e.$bsContainer.appendTo(e.options.container).toggleClass("open", !b.hasClass("open")).append(e.$menu)) }), a(window).on("resize scroll", function () { g(e.$newElement) }), this.$element.on("hide.bs.select", function () { e.$menu.data("height", e.$menu.height()), e.$bsContainer.detach() }) }, setSelected: function (a, b, c) { c || (this.togglePlaceholder(), c = this.findLis().eq(this.liObj[a])), c.toggleClass("selected", b).find("a").attr("aria-selected", b) }, setDisabled: function (a, b, c) { c || (c = this.findLis().eq(this.liObj[a])), b ? c.addClass("disabled").children("a").attr("href", "#").attr("tabindex", -1).attr("aria-disabled", !0) : c.removeClass("disabled").children("a").removeAttr("href").attr("tabindex", 0).attr("aria-disabled", !1) }, isDisabled: function () { return this.$element[0].disabled }, checkDisabled: function () { var a = this; this.isDisabled() ? (this.$newElement.addClass("disabled"), this.$button.addClass("disabled").attr("tabindex", -1).attr("aria-disabled", !0)) : (this.$button.hasClass("disabled") && (this.$newElement.removeClass("disabled"), this.$button.removeClass("disabled").attr("aria-disabled", !1)), this.$button.attr("tabindex") != -1 || this.$element.data("tabindex") || this.$button.removeAttr("tabindex")), this.$button.click(function () { return !a.isDisabled() }) }, togglePlaceholder: function () { var a = this.$element.val(); this.$button.toggleClass("bs-placeholder", null === a || "" === a || a.constructor === Array && 0 === a.length) }, tabIndex: function () { this.$element.data("tabindex") !== this.$element.attr("tabindex") && this.$element.attr("tabindex") !== -98 && "-98" !== this.$element.attr("tabindex") && (this.$element.data("tabindex", this.$element.attr("tabindex")), this.$button.attr("tabindex", this.$element.data("tabindex"))), this.$element.attr("tabindex", -98) }, clickListener: function () { var b = this, c = a(document); c.data("spaceSelect", !1), this.$button.on("keyup", function (a) { /(32)/.test(a.keyCode.toString(10)) && c.data("spaceSelect") && (a.preventDefault(), c.data("spaceSelect", !1)) }), this.$button.on("click", function () { b.setSize() }), this.$element.on("shown.bs.select", function () { if (b.options.liveSearch || b.multiple) { if (!b.multiple) { var a = b.liObj[b.$element[0].selectedIndex]; if ("number" != typeof a || b.options.size === !1) return; var c = b.$lis.eq(a)[0].offsetTop - b.$menuInner[0].offsetTop; c = c - b.$menuInner[0].offsetHeight / 2 + b.sizeInfo.liHeight / 2, b.$menuInner[0].scrollTop = c } } else b.$menuInner.find(".selected a").focus() }), this.$menuInner.on("click", "li a", function (c) { var d = a(this), f = d.parent().data("originalIndex"), g = b.$element.val(), h = b.$element.prop("selectedIndex"), i = !0; if (b.multiple && 1 !== b.options.maxOptions && c.stopPropagation(), c.preventDefault(), !b.isDisabled() && !d.parent().hasClass("disabled")) { var j = b.$element.find("option"), k = j.eq(f), l = k.prop("selected"), m = k.parent("optgroup"), n = b.options.maxOptions, o = m.data("maxOptions") || !1; if (b.multiple) { if (k.prop("selected", !l), b.setSelected(f, !l), d.blur(), n !== !1 || o !== !1) { var p = n < j.filter(":selected").length, q = o < m.find("option:selected").length; if (n && p || o && q) if (n && 1 == n) j.prop("selected", !1), k.prop("selected", !0), b.$menuInner.find(".selected").removeClass("selected"), b.setSelected(f, !0); else if (o && 1 == o) { m.find("option:selected").prop("selected", !1), k.prop("selected", !0); var r = d.parent().data("optgroup"); b.$menuInner.find('[data-optgroup="' + r + '"]').removeClass("selected"), b.setSelected(f, !0) } else { var s = "string" == typeof b.options.maxOptionsText ? [b.options.maxOptionsText, b.options.maxOptionsText] : b.options.maxOptionsText, t = "function" == typeof s ? s(n, o) : s, u = t[0].replace("{n}", n), v = t[1].replace("{n}", o), w = a('
'); t[2] && (u = u.replace("{var}", t[2][n > 1 ? 0 : 1]), v = v.replace("{var}", t[2][o > 1 ? 0 : 1])), k.prop("selected", !1), b.$menu.append(w), n && p && (w.append(a("
" + u + "
")), i = !1, b.$element.trigger("maxReached.bs.select")), o && q && (w.append(a("
" + v + "
")), i = !1, b.$element.trigger("maxReachedGrp.bs.select")), setTimeout(function () { b.setSelected(f, !1) }, 10), w.delay(750).fadeOut(300, function () { a(this).remove() }) } } } else j.prop("selected", !1), k.prop("selected", !0), b.$menuInner.find(".selected").removeClass("selected").find("a").attr("aria-selected", !1), b.setSelected(f, !0); !b.multiple || b.multiple && 1 === b.options.maxOptions ? b.$button.focus() : b.options.liveSearch && b.$searchbox.focus(), i && (g != b.$element.val() && b.multiple || h != b.$element.prop("selectedIndex") && !b.multiple) && (e = [f, k.prop("selected"), l], b.$element.triggerNative("change")) } }), this.$menu.on("click", "li.disabled a, .popover-title, .popover-title :not(.close)", function (c) { c.currentTarget == this && (c.preventDefault(), c.stopPropagation(), b.options.liveSearch && !a(c.target).hasClass("close") ? b.$searchbox.focus() : b.$button.focus()) }), this.$menuInner.on("click", ".divider, .dropdown-header", function (a) { a.preventDefault(), a.stopPropagation(), b.options.liveSearch ? b.$searchbox.focus() : b.$button.focus() }), this.$menu.on("click", ".popover-title .close", function () { b.$button.click() }), this.$searchbox.on("click", function (a) { a.stopPropagation() }), this.$menu.on("click", ".actions-btn", function (c) { b.options.liveSearch ? b.$searchbox.focus() : b.$button.focus(), c.preventDefault(), c.stopPropagation(), a(this).hasClass("bs-select-all") ? b.selectAll() : b.deselectAll() }), this.$element.change(function () { b.render(!1), b.$element.trigger("changed.bs.select", e), e = null }) }, liveSearchListener: function () { var c = this, d = a('
  • '); this.$button.on("click.dropdown.data-api", function () { c.$menuInner.find(".active").removeClass("active"), c.$searchbox.val() && (c.$searchbox.val(""), c.$lis.not(".is-hidden").removeClass("hidden"), d.parent().length && d.remove()), c.multiple || c.$menuInner.find(".selected").addClass("active"), setTimeout(function () { c.$searchbox.focus() }, 10) }), this.$searchbox.on("click.dropdown.data-api focus.dropdown.data-api touchend.dropdown.data-api", function (a) { a.stopPropagation() }), this.$searchbox.on("input propertychange", function () { if (c.$lis.not(".is-hidden").removeClass("hidden"), c.$lis.filter(".active").removeClass("active"), d.remove(), c.$searchbox.val()) { var e, f = c.$lis.not(".is-hidden, .divider, .dropdown-header"); if (e = c.options.liveSearchNormalize ? f.not(":a" + c._searchStyle() + '("' + b(c.$searchbox.val()) + '")') : f.not(":" + c._searchStyle() + '("' + c.$searchbox.val() + '")'), e.length === f.length) d.html(c.options.noneResultsText.replace("{0}", '"' + j(c.$searchbox.val()) + '"')), c.$menuInner.append(d), c.$lis.addClass("hidden"); else { e.addClass("hidden"); var g, h = c.$lis.not(".hidden"); h.each(function (b) { var c = a(this); c.hasClass("divider") ? void 0 === g ? c.addClass("hidden") : (g && g.addClass("hidden"), g = c) : c.hasClass("dropdown-header") && h.eq(b + 1).data("optgroup") !== c.data("optgroup") ? c.addClass("hidden") : g = null }), g && g.addClass("hidden"), f.not(".hidden").first().addClass("active"), c.$menuInner.scrollTop(0) } } }) }, _searchStyle: function () { var a = {begins: "ibegins", startsWith: "ibegins"}; return a[this.options.liveSearchStyle] || "icontains" }, val: function (a) { return "undefined" != typeof a ? (this.$element.val(a), this.render(), this.$element) : this.$element.val() }, changeAll: function (b) { if (this.multiple) { "undefined" == typeof b && (b = !0), this.findLis(); var c = this.$element.find("option"), d = this.$lis.not(".divider, .dropdown-header, .disabled, .hidden"), e = d.length, f = []; if (b) { if (d.filter(".selected").length === d.length) return } else if (0 === d.filter(".selected").length) return; d.toggleClass("selected", b); for (var g = 0; g < e; g++) { var h = d[g].getAttribute("data-original-index"); f[f.length] = c.eq(h)[0] } a(f).prop("selected", b), this.render(!1), this.togglePlaceholder(), this.$element.triggerNative("change") } }, selectAll: function () { return this.changeAll(!0) }, deselectAll: function () { return this.changeAll(!1) }, toggle: function (a) { a = a || window.event, a && a.stopPropagation(), this.$button.trigger("click") }, keydown: function (b) { var c, d, e, f, g = a(this), h = g.is("input") ? g.parent().parent() : g.parent(), i = h.data("this"), j = ":not(.disabled, .hidden, .dropdown-header, .divider)", k = { 32: " ", 48: "0", 49: "1", 50: "2", 51: "3", 52: "4", 53: "5", 54: "6", 55: "7", 56: "8", 57: "9", 59: ";", 65: "a", 66: "b", 67: "c", 68: "d", 69: "e", 70: "f", 71: "g", 72: "h", 73: "i", 74: "j", 75: "k", 76: "l", 77: "m", 78: "n", 79: "o", 80: "p", 81: "q", 82: "r", 83: "s", 84: "t", 85: "u", 86: "v", 87: "w", 88: "x", 89: "y", 90: "z", 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7", 104: "8", 105: "9" }; if (f = i.$newElement.hasClass("open"), !f && (b.keyCode >= 48 && b.keyCode <= 57 || b.keyCode >= 96 && b.keyCode <= 105 || b.keyCode >= 65 && b.keyCode <= 90)) return i.options.container ? i.$button.trigger("click") : (i.setSize(), i.$menu.parent().addClass("open"), f = !0), void i.$searchbox.focus(); if (i.options.liveSearch && /(^9$|27)/.test(b.keyCode.toString(10)) && f && (b.preventDefault(), b.stopPropagation(), i.$menuInner.click(), i.$button.focus()), /(38|40)/.test(b.keyCode.toString(10))) { if (c = i.$lis.filter(j), !c.length) return; d = i.options.liveSearch ? c.index(c.filter(".active")) : c.index(c.find("a").filter(":focus").parent()), e = i.$menuInner.data("prevIndex"), 38 == b.keyCode ? (!i.options.liveSearch && d != e || d == -1 || d--, d < 0 && (d += c.length)) : 40 == b.keyCode && ((i.options.liveSearch || d == e) && d++, d %= c.length), i.$menuInner.data("prevIndex", d), i.options.liveSearch ? (b.preventDefault(), g.hasClass("dropdown-toggle") || (c.removeClass("active").eq(d).addClass("active").children("a").focus(), g.focus())) : c.eq(d).children("a").focus() } else if (!g.is("input")) { var l, m, n = []; c = i.$lis.filter(j), c.each(function (c) { a.trim(a(this).children("a").text().toLowerCase()).substring(0, 1) == k[b.keyCode] && n.push(c) }), l = a(document).data("keycount"), l++, a(document).data("keycount", l), m = a.trim(a(":focus").text().toLowerCase()).substring(0, 1), m != k[b.keyCode] ? (l = 1, a(document).data("keycount", l)) : l >= n.length && (a(document).data("keycount", 0), l > n.length && (l = 1)), c.eq(n[l - 1]).children("a").focus() } if ((/(13|32)/.test(b.keyCode.toString(10)) || /(^9$)/.test(b.keyCode.toString(10)) && i.options.selectOnTab) && f) { if (/(32)/.test(b.keyCode.toString(10)) || b.preventDefault(), i.options.liveSearch) /(32)/.test(b.keyCode.toString(10)) || (i.$menuInner.find(".active a").click(), g.focus()); else { var o = a(":focus"); o.click(), o.focus(), b.preventDefault(), a(document).data("spaceSelect", !0) } a(document).data("keycount", 0) } (/(^9$|27)/.test(b.keyCode.toString(10)) && f && (i.multiple || i.options.liveSearch) || /(27)/.test(b.keyCode.toString(10)) && !f) && (i.$menu.parent().removeClass("open"), i.options.container && i.$newElement.removeClass("open"), i.$button.focus()) }, mobile: function () { this.$element.addClass("mobile-device") }, refresh: function () { this.$lis = null, this.liObj = {}, this.reloadLi(), this.render(), this.checkDisabled(), this.liHeight(!0), this.setStyle(), this.setWidth(), this.$lis && this.$searchbox.trigger("propertychange"), this.$element.trigger("refreshed.bs.select") }, hide: function () { this.$newElement.hide() }, show: function () { this.$newElement.show() }, remove: function () { this.$newElement.remove(), this.$element.remove() }, destroy: function () { this.$newElement.before(this.$element).remove(), this.$bsContainer ? this.$bsContainer.remove() : this.$menu.remove(), this.$element.off(".bs.select").removeData("selectpicker").removeClass("bs-select-hidden selectpicker") } }; var m = a.fn.selectpicker; a.fn.selectpicker = c, a.fn.selectpicker.Constructor = l, a.fn.selectpicker.noConflict = function () { return a.fn.selectpicker = m, this }, a(document).data("keycount", 0).on("keydown.bs.select", '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="listbox"], .bs-searchbox input', l.prototype.keydown).on("focusin.modal", '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="listbox"], .bs-searchbox input', function (a) { a.stopPropagation() }), a(window).on("load.bs.select.data-api", function () { a(".selectpicker").each(function () { var b = a(this); c.call(b, b.data()) }) }) }(a) }); (function ($) { var NivoSlider = function (element, options) { var settings = $.extend({}, $.fn.nivoSlider.defaults, options); var vars = { currentSlide: 0, currentImage: '', totalSlides: 0, running: !1, paused: !1, stop: !1, controlNavEl: !1 }; var slider = $(element); slider.data('nivo:vars', vars).addClass('nivoSlider'); var kids = slider.children(); kids.each(function () { var child = $(this); var link = ''; if (!child.is('img')) { if (child.is('a')) { child.addClass('nivo-imageLink'); link = child } child = child.find('img:first') } var childWidth = (childWidth === 0) ? child.attr('width') : child.width(), childHeight = (childHeight === 0) ? child.attr('height') : child.height(); if (link !== '') { link.css('display', 'none') } child.css('display', 'none'); vars.totalSlides++ }); if (settings.randomStart) { settings.startSlide = Math.floor(Math.random() * vars.totalSlides) } if (settings.startSlide > 0) { if (settings.startSlide >= vars.totalSlides) { settings.startSlide = vars.totalSlides - 1 } vars.currentSlide = settings.startSlide } if ($(kids[vars.currentSlide]).is('img')) { vars.currentImage = $(kids[vars.currentSlide]) } else { vars.currentImage = $(kids[vars.currentSlide]).find('img:first') } if ($(kids[vars.currentSlide]).is('a')) { $(kids[vars.currentSlide]).css('display', 'block') } var sliderImg = $('').addClass('nivo-main-image'); sliderImg.attr('src', vars.currentImage.attr('src')).show(); slider.append(sliderImg); $(window).resize(function () { slider.children('img').width(slider.width()); sliderImg.attr('src', vars.currentImage.attr('src')); sliderImg.stop().height('auto'); $('.nivo-slice').remove(); $('.nivo-box').remove() }); slider.append($('
    ')); var processCaption = function (settings) { var nivoCaption = $('.nivo-caption', slider); if (vars.currentImage.attr('title') != '' && vars.currentImage.attr('title') != undefined) { var title = vars.currentImage.attr('title'); if (title.substr(0, 1) == '#') title = $(title).html(); if (nivoCaption.css('display') == 'block') { setTimeout(function () { nivoCaption.html(title) }, settings.animSpeed) } else { nivoCaption.html(title); nivoCaption.stop().fadeIn(settings.animSpeed) } } else { nivoCaption.stop().fadeOut(settings.animSpeed) } } processCaption(settings); var timer = 0; if (!settings.manualAdvance && kids.length > 1) { timer = setInterval(function () { nivoRun(slider, kids, settings, !1) }, settings.pauseTime) } if (settings.directionNav) { slider.append('
    '); $(slider).on('click', 'a.nivo-prevNav', function () { if (vars.running) { return !1 } clearInterval(timer); timer = ''; vars.currentSlide -= 2; nivoRun(slider, kids, settings, 'prev') }); $(slider).on('click', 'a.nivo-nextNav', function () { if (vars.running) { return !1 } clearInterval(timer); timer = ''; nivoRun(slider, kids, settings, 'next') }) } if (settings.controlNav) { vars.controlNavEl = $('
    '); slider.after(vars.controlNavEl); for (var i = 0; i < kids.length; i++) { if (settings.controlNavThumbs) { vars.controlNavEl.addClass('nivo-thumbs-enabled'); var child = kids.eq(i); if (!child.is('img')) { child = child.find('img:first') } if (child.attr('data-thumb')) vars.controlNavEl.append('') } else { vars.controlNavEl.append('' + (i + 1) + '') } } $('a:eq(' + vars.currentSlide + ')', vars.controlNavEl).addClass('active'); $('a', vars.controlNavEl).bind('click', function () { if (vars.running) return !1; if ($(this).hasClass('active')) return !1; clearInterval(timer); timer = ''; sliderImg.attr('src', vars.currentImage.attr('src')); vars.currentSlide = $(this).attr('rel') - 1; nivoRun(slider, kids, settings, 'control') }) } if (settings.pauseOnHover) { slider.hover(function () { vars.paused = !0; clearInterval(timer); timer = '' }, function () { vars.paused = !1; if (timer === '' && !settings.manualAdvance) { timer = setInterval(function () { nivoRun(slider, kids, settings, !1) }, settings.pauseTime) } }) } slider.bind('nivo:animFinished', function () { sliderImg.attr('src', vars.currentImage.attr('src')); vars.running = !1; $(kids).each(function () { if ($(this).is('a')) { $(this).css('display', 'none') } }); if ($(kids[vars.currentSlide]).is('a')) { $(kids[vars.currentSlide]).css('display', 'block') } if (timer === '' && !vars.paused && !settings.manualAdvance) { timer = setInterval(function () { nivoRun(slider, kids, settings, !1) }, settings.pauseTime) } settings.afterChange.call(this) }); var createSlices = function (slider, settings, vars) { if ($(vars.currentImage).parent().is('a')) $(vars.currentImage).parent().css('display', 'block'); $('img[src="' + vars.currentImage.attr('src') + '"]', slider).not('.nivo-main-image,.nivo-control img').width(slider.width()).css('visibility', 'hidden').show(); var sliceHeight = ($('img[src="' + vars.currentImage.attr('src') + '"]', slider).not('.nivo-main-image,.nivo-control img').parent().is('a')) ? $('img[src="' + vars.currentImage.attr('src') + '"]', slider).not('.nivo-main-image,.nivo-control img').parent().height() : $('img[src="' + vars.currentImage.attr('src') + '"]', slider).not('.nivo-main-image,.nivo-control img').height(); for (var i = 0; i < settings.slices; i++) { var sliceWidth = Math.round(slider.width() / settings.slices); if (i === settings.slices - 1) { slider.append($('
    ').css({ left: (sliceWidth * i) + 'px', width: (slider.width() - (sliceWidth * i)) + 'px', height: sliceHeight + 'px', opacity: '0', overflow: 'hidden' })) } else { slider.append($('
    ').css({ left: (sliceWidth * i) + 'px', width: sliceWidth + 'px', height: sliceHeight + 'px', opacity: '0', overflow: 'hidden' })) } } $('.nivo-slice', slider).height(sliceHeight); sliderImg.stop().animate({height: $(vars.currentImage).height()}, settings.animSpeed) }; var createBoxes = function (slider, settings, vars) { if ($(vars.currentImage).parent().is('a')) $(vars.currentImage).parent().css('display', 'block'); $('img[src="' + vars.currentImage.attr('src') + '"]', slider).not('.nivo-main-image,.nivo-control img').width(slider.width()).css('visibility', 'hidden').show(); var boxWidth = Math.round(slider.width() / settings.boxCols), boxHeight = Math.round($('img[src="' + vars.currentImage.attr('src') + '"]', slider).not('.nivo-main-image,.nivo-control img').height() / settings.boxRows); for (var rows = 0; rows < settings.boxRows; rows++) { for (var cols = 0; cols < settings.boxCols; cols++) { if (cols === settings.boxCols - 1) { slider.append($('
    ').css({ opacity: 0, left: (boxWidth * cols) + 'px', top: (boxHeight * rows) + 'px', width: (slider.width() - (boxWidth * cols)) + 'px' })); $('.nivo-box[name="' + cols + '"]', slider).height($('.nivo-box[name="' + cols + '"] img', slider).height() + 'px') } else { slider.append($('
    ').css({ opacity: 0, left: (boxWidth * cols) + 'px', top: (boxHeight * rows) + 'px', width: boxWidth + 'px' })); $('.nivo-box[name="' + cols + '"]', slider).height($('.nivo-box[name="' + cols + '"] img', slider).height() + 'px') } } } sliderImg.stop().animate({height: $(vars.currentImage).height()}, settings.animSpeed) }; var nivoRun = function (slider, kids, settings, nudge) { var vars = slider.data('nivo:vars'); if (vars && (vars.currentSlide === vars.totalSlides - 1)) { settings.lastSlide.call(this) } if ((!vars || vars.stop) && !nudge) { return !1 } settings.beforeChange.call(this); if (!nudge) { sliderImg.attr('src', vars.currentImage.attr('src')) } else { if (nudge === 'prev') { sliderImg.attr('src', vars.currentImage.attr('src')) } if (nudge === 'next') { sliderImg.attr('src', vars.currentImage.attr('src')) } } vars.currentSlide++; if (vars.currentSlide === vars.totalSlides) { vars.currentSlide = 0; settings.slideshowEnd.call(this) } if (vars.currentSlide < 0) { vars.currentSlide = (vars.totalSlides - 1) } if ($(kids[vars.currentSlide]).is('img')) { vars.currentImage = $(kids[vars.currentSlide]) } else { vars.currentImage = $(kids[vars.currentSlide]).find('img:first') } if (settings.controlNav) { $('a', vars.controlNavEl).removeClass('active'); $('a:eq(' + vars.currentSlide + ')', vars.controlNavEl).addClass('active') } processCaption(settings); $('.nivo-slice', slider).remove(); $('.nivo-box', slider).remove(); var currentEffect = settings.effect, anims = ''; if (settings.effect === 'random') { anims = new Array('sliceDownRight', 'sliceDownLeft', 'sliceUpRight', 'sliceUpLeft', 'sliceUpDown', 'sliceUpDownLeft', 'fold', 'fade', 'boxRandom', 'boxRain', 'boxRainReverse', 'boxRainGrow', 'boxRainGrowReverse'); currentEffect = anims[Math.floor(Math.random() * (anims.length + 1))]; if (currentEffect === undefined) { currentEffect = 'fade' } } if (settings.effect.indexOf(',') !== -1) { anims = settings.effect.split(','); currentEffect = anims[Math.floor(Math.random() * (anims.length))]; if (currentEffect === undefined) { currentEffect = 'fade' } } if (vars.currentImage.attr('data-transition')) { currentEffect = vars.currentImage.attr('data-transition') } vars.running = !0; var timeBuff = 0, i = 0, slices = '', firstSlice = '', totalBoxes = '', boxes = ''; if (currentEffect === 'sliceDown' || currentEffect === 'sliceDownRight' || currentEffect === 'sliceDownLeft') { createSlices(slider, settings, vars); timeBuff = 0; i = 0; slices = $('.nivo-slice', slider); if (currentEffect === 'sliceDownLeft') { slices = $('.nivo-slice', slider)._reverse() } slices.each(function () { var slice = $(this); slice.css({'top': '0px'}); if (i === settings.slices - 1) { setTimeout(function () { slice.animate({opacity: '1.0'}, settings.animSpeed, '', function () { slider.trigger('nivo:animFinished') }) }, (100 + timeBuff)) } else { setTimeout(function () { slice.animate({opacity: '1.0'}, settings.animSpeed) }, (100 + timeBuff)) } timeBuff += 50; i++ }) } else if (currentEffect === 'sliceUp' || currentEffect === 'sliceUpRight' || currentEffect === 'sliceUpLeft') { createSlices(slider, settings, vars); timeBuff = 0; i = 0; slices = $('.nivo-slice', slider); if (currentEffect === 'sliceUpLeft') { slices = $('.nivo-slice', slider)._reverse() } slices.each(function () { var slice = $(this); slice.css({'bottom': '0px'}); if (i === settings.slices - 1) { setTimeout(function () { slice.animate({opacity: '1.0'}, settings.animSpeed, '', function () { slider.trigger('nivo:animFinished') }) }, (100 + timeBuff)) } else { setTimeout(function () { slice.animate({opacity: '1.0'}, settings.animSpeed) }, (100 + timeBuff)) } timeBuff += 50; i++ }) } else if (currentEffect === 'sliceUpDown' || currentEffect === 'sliceUpDownRight' || currentEffect === 'sliceUpDownLeft') { createSlices(slider, settings, vars); timeBuff = 0; i = 0; var v = 0; slices = $('.nivo-slice', slider); if (currentEffect === 'sliceUpDownLeft') { slices = $('.nivo-slice', slider)._reverse() } slices.each(function () { var slice = $(this); if (i === 0) { slice.css('top', '0px'); i++ } else { slice.css('bottom', '0px'); i = 0 } if (v === settings.slices - 1) { setTimeout(function () { slice.animate({opacity: '1.0'}, settings.animSpeed, '', function () { slider.trigger('nivo:animFinished') }) }, (100 + timeBuff)) } else { setTimeout(function () { slice.animate({opacity: '1.0'}, settings.animSpeed) }, (100 + timeBuff)) } timeBuff += 50; v++ }) } else if (currentEffect === 'fold') { createSlices(slider, settings, vars); timeBuff = 0; i = 0; $('.nivo-slice', slider).each(function () { var slice = $(this); var origWidth = slice.width(); slice.css({top: '0px', width: '0px'}); if (i === settings.slices - 1) { setTimeout(function () { slice.animate({width: origWidth, opacity: '1.0'}, settings.animSpeed, '', function () { slider.trigger('nivo:animFinished') }) }, (100 + timeBuff)) } else { setTimeout(function () { slice.animate({width: origWidth, opacity: '1.0'}, settings.animSpeed) }, (100 + timeBuff)) } timeBuff += 50; i++ }) } else if (currentEffect === 'fade') { createSlices(slider, settings, vars); firstSlice = $('.nivo-slice:first', slider); firstSlice.css({'width': slider.width() + 'px'}); firstSlice.animate({opacity: '1.0'}, (settings.animSpeed * 2), '', function () { slider.trigger('nivo:animFinished') }) } else if (currentEffect === 'slideInRight') { createSlices(slider, settings, vars); firstSlice = $('.nivo-slice:first', slider); firstSlice.css({'width': '0px', 'opacity': '1'}); firstSlice.animate({width: slider.width() + 'px'}, (settings.animSpeed * 2), '', function () { slider.trigger('nivo:animFinished') }) } else if (currentEffect === 'slideInLeft') { createSlices(slider, settings, vars); firstSlice = $('.nivo-slice:first', slider); firstSlice.css({'width': '0px', 'opacity': '1', 'left': '', 'right': '0px'}); firstSlice.animate({width: slider.width() + 'px'}, (settings.animSpeed * 2), '', function () { firstSlice.css({'left': '0px', 'right': ''}); slider.trigger('nivo:animFinished') }) } else if (currentEffect === 'boxRandom') { createBoxes(slider, settings, vars); totalBoxes = settings.boxCols * settings.boxRows; i = 0; timeBuff = 0; boxes = shuffle($('.nivo-box', slider)); boxes.each(function () { var box = $(this); if (i === totalBoxes - 1) { setTimeout(function () { box.animate({opacity: '1'}, settings.animSpeed, '', function () { slider.trigger('nivo:animFinished') }) }, (100 + timeBuff)) } else { setTimeout(function () { box.animate({opacity: '1'}, settings.animSpeed) }, (100 + timeBuff)) } timeBuff += 20; i++ }) } else if (currentEffect === 'boxRain' || currentEffect === 'boxRainReverse' || currentEffect === 'boxRainGrow' || currentEffect === 'boxRainGrowReverse') { createBoxes(slider, settings, vars); totalBoxes = settings.boxCols * settings.boxRows; i = 0; timeBuff = 0; var rowIndex = 0; var colIndex = 0; var box2Darr = []; box2Darr[rowIndex] = []; boxes = $('.nivo-box', slider); if (currentEffect === 'boxRainReverse' || currentEffect === 'boxRainGrowReverse') { boxes = $('.nivo-box', slider)._reverse() } boxes.each(function () { box2Darr[rowIndex][colIndex] = $(this); colIndex++; if (colIndex === settings.boxCols) { rowIndex++; colIndex = 0; box2Darr[rowIndex] = [] } }); for (var cols = 0; cols < (settings.boxCols * 2); cols++) { var prevCol = cols; for (var rows = 0; rows < settings.boxRows; rows++) { if (prevCol >= 0 && prevCol < settings.boxCols) { (function (row, col, time, i, totalBoxes) { var box = $(box2Darr[row][col]); var w = box.width(); var h = box.height(); if (currentEffect === 'boxRainGrow' || currentEffect === 'boxRainGrowReverse') { box.width(0).height(0) } if (i === totalBoxes - 1) { setTimeout(function () { box.animate({ opacity: '1', width: w, height: h }, settings.animSpeed / 1.3, '', function () { slider.trigger('nivo:animFinished') }) }, (100 + time)) } else { setTimeout(function () { box.animate({opacity: '1', width: w, height: h}, settings.animSpeed / 1.3) }, (100 + time)) } })(rows, prevCol, timeBuff, i, totalBoxes); i++ } prevCol-- } timeBuff += 100 } } }; var shuffle = function (arr) { for (var j, x, i = arr.length; i; j = parseInt(Math.random() * i, 10), x = arr[--i], arr[i] = arr[j], arr[j] = x) ; return arr }; var trace = function (msg) { if (this.console && typeof console.log !== 'undefined') { console.log(msg) } }; this.stop = function () { if (!$(element).data('nivo:vars').stop) { $(element).data('nivo:vars').stop = !0; trace('Stop Slider') } }; this.start = function () { if ($(element).data('nivo:vars').stop) { $(element).data('nivo:vars').stop = !1; trace('Start Slider') } }; settings.afterLoad.call(this); return this }; $.fn.nivoSlider = function (options) { return this.each(function (key, value) { var element = $(this); if (element.data('nivoslider')) { return element.data('nivoslider') } var nivoslider = new NivoSlider(this, options); element.data('nivoslider', nivoslider) }) }; $.fn.nivoSlider.defaults = { effect: 'random', slices: 15, boxCols: 8, boxRows: 4, animSpeed: 500, pauseTime: 3000, startSlide: 0, directionNav: !0, controlNav: !0, controlNavThumbs: !1, pauseOnHover: !0, manualAdvance: !1, prevText: 'Prev', nextText: 'Next', randomStart: !1, beforeChange: function () { }, afterChange: function () { }, slideshowEnd: function () { }, lastSlide: function () { }, afterLoad: function () { } }; $.fn._reverse = [].reverse })(jQuery); (function (e) { var t = function (t, n) { var r = e.extend({}, e.fn.nivoSlider.defaults, n); var i = { currentSlide: 0, currentImage: "", totalSlides: 0, running: !1, paused: !1, stop: !1, controlNavEl: !1 }; var s = e(t); s.data("nivo:vars", i).addClass("nivoSlider"); var o = s.children(); o.each(function () { var t = e(this); var n = ""; if (!t.is("img")) { if (t.is("a")) { t.addClass("nivo-imageLink"); n = t } t = t.find("img:first") } var r = r === 0 ? t.attr("width") : t.width(), s = s === 0 ? t.attr("height") : t.height(); if (n !== "") { n.css("display", "none") } t.css("display", "none"); i.totalSlides++ }); if (r.randomStart) { r.startSlide = Math.floor(Math.random() * i.totalSlides) } if (r.startSlide > 0) { if (r.startSlide >= i.totalSlides) { r.startSlide = i.totalSlides - 1 } i.currentSlide = r.startSlide } if (e(o[i.currentSlide]).is("img")) { i.currentImage = e(o[i.currentSlide]) } else { i.currentImage = e(o[i.currentSlide]).find("img:first") } if (e(o[i.currentSlide]).is("a")) { e(o[i.currentSlide]).css("display", "block") } var u = e("").addClass("nivo-main-image"); u.attr("src", i.currentImage.attr("src")).show(); s.append(u); e(window).resize(function () { s.children("img").width(s.width()); u.attr("src", i.currentImage.attr("src")); u.stop().height("auto"); e(".nivo-slice").remove(); e(".nivo-box").remove() }); s.append(e('
    ')); var a = function (t) { var n = e(".nivo-caption", s); if (i.currentImage.attr("title") != "" && i.currentImage.attr("title") != undefined) { var r = i.currentImage.attr("title"); if (r.substr(0, 1) == "#") r = e(r).html(); if (n.css("display") == "block") { setTimeout(function () { n.html(r) }, t.animSpeed) } else { n.html(r); n.stop().fadeIn(t.animSpeed) } } else { n.stop().fadeOut(t.animSpeed) } }; a(r); var f = 0; if (!r.manualAdvance && o.length > 1) { f = setInterval(function () { d(s, o, r, !1) }, r.pauseTime) } if (r.directionNav) { s.append('
    '); e(s).on("click", "a.nivo-prevNav", function () { if (i.running) { return !1 } clearInterval(f); f = ""; i.currentSlide -= 2; d(s, o, r, "prev") }); e(s).on("click", "a.nivo-nextNav", function () { if (i.running) { return !1 } clearInterval(f); f = ""; d(s, o, r, "next") }) } if (r.controlNav) { i.controlNavEl = e('
    '); s.after(i.controlNavEl); for (var l = 0; l < o.length; l++) { if (r.controlNavThumbs) { i.controlNavEl.addClass("nivo-thumbs-enabled"); var c = o.eq(l); if (!c.is("img")) { c = c.find("img:first") } if (c.attr("data-thumb")) i.controlNavEl.append('') } else { i.controlNavEl.append('' + (l + 1) + "") } } e("a:eq(" + i.currentSlide + ")", i.controlNavEl).addClass("active"); e("a", i.controlNavEl).bind("click", function () { if (i.running) return !1; if (e(this).hasClass("active")) return !1; clearInterval(f); f = ""; u.attr("src", i.currentImage.attr("src")); i.currentSlide = e(this).attr("rel") - 1; d(s, o, r, "control") }) } if (r.pauseOnHover) { s.hover(function () { i.paused = !0; clearInterval(f); f = "" }, function () { i.paused = !1; if (f === "" && !r.manualAdvance) { f = setInterval(function () { d(s, o, r, !1) }, r.pauseTime) } }) } s.bind("nivo:animFinished", function () { u.attr("src", i.currentImage.attr("src")); i.running = !1; e(o).each(function () { if (e(this).is("a")) { e(this).css("display", "none") } }); if (e(o[i.currentSlide]).is("a")) { e(o[i.currentSlide]).css("display", "block") } if (f === "" && !i.paused && !r.manualAdvance) { f = setInterval(function () { d(s, o, r, !1) }, r.pauseTime) } r.afterChange.call(this) }); var h = function (t, n, r) { if (e(r.currentImage).parent().is("a")) e(r.currentImage).parent().css("display", "block"); e('img[src="' + r.currentImage.attr("src") + '"]', t).not(".nivo-main-image,.nivo-control img").width(t.width()).css("visibility", "hidden").show(); var i = e('img[src="' + r.currentImage.attr("src") + '"]', t).not(".nivo-main-image,.nivo-control img").parent().is("a") ? e('img[src="' + r.currentImage.attr("src") + '"]', t).not(".nivo-main-image,.nivo-control img").parent().height() : e('img[src="' + r.currentImage.attr("src") + '"]', t).not(".nivo-main-image,.nivo-control img").height(); for (var s = 0; s < n.slices; s++) { var o = Math.round(t.width() / n.slices); if (s === n.slices - 1) { t.append(e('
    ').css({ left: o * s + "px", width: t.width() - o * s + "px", height: i + "px", opacity: "0", overflow: "hidden" })) } else { t.append(e('
    ').css({ left: o * s + "px", width: o + "px", height: i + "px", opacity: "0", overflow: "hidden" })) } } e(".nivo-slice", t).height(i); u.stop().animate({height: e(r.currentImage).height()}, n.animSpeed) }; var p = function (t, n, r) { if (e(r.currentImage).parent().is("a")) e(r.currentImage).parent().css("display", "block"); e('img[src="' + r.currentImage.attr("src") + '"]', t).not(".nivo-main-image,.nivo-control img").width(t.width()).css("visibility", "hidden").show(); var i = Math.round(t.width() / n.boxCols), s = Math.round(e('img[src="' + r.currentImage.attr("src") + '"]', t).not(".nivo-main-image,.nivo-control img").height() / n.boxRows); for (var o = 0; o < n.boxRows; o++) { for (var a = 0; a < n.boxCols; a++) { if (a === n.boxCols - 1) { t.append(e('
    ').css({ opacity: 0, left: i * a + "px", top: s * o + "px", width: t.width() - i * a + "px" })); e('.nivo-box[name="' + a + '"]', t).height(e('.nivo-box[name="' + a + '"] img', t).height() + "px") } else { t.append(e('
    ').css({ opacity: 0, left: i * a + "px", top: s * o + "px", width: i + "px" })); e('.nivo-box[name="' + a + '"]', t).height(e('.nivo-box[name="' + a + '"] img', t).height() + "px") } } } u.stop().animate({height: e(r.currentImage).height()}, n.animSpeed) }; var d = function (t, n, r, i) { var s = t.data("nivo:vars"); if (s && s.currentSlide === s.totalSlides - 1) { r.lastSlide.call(this) } if ((!s || s.stop) && !i) { return !1 } r.beforeChange.call(this); if (!i) { u.attr("src", s.currentImage.attr("src")) } else { if (i === "prev") { u.attr("src", s.currentImage.attr("src")) } if (i === "next") { u.attr("src", s.currentImage.attr("src")) } } s.currentSlide++; if (s.currentSlide === s.totalSlides) { s.currentSlide = 0; r.slideshowEnd.call(this) } if (s.currentSlide < 0) { s.currentSlide = s.totalSlides - 1 } if (e(n[s.currentSlide]).is("img")) { s.currentImage = e(n[s.currentSlide]) } else { s.currentImage = e(n[s.currentSlide]).find("img:first") } if (r.controlNav) { e("a", s.controlNavEl).removeClass("active"); e("a:eq(" + s.currentSlide + ")", s.controlNavEl).addClass("active") } a(r); e(".nivo-slice", t).remove(); e(".nivo-box", t).remove(); var o = r.effect, f = ""; if (r.effect === "random") { f = new Array("sliceDownRight", "sliceDownLeft", "sliceUpRight", "sliceUpLeft", "sliceUpDown", "sliceUpDownLeft", "fold", "fade", "boxRandom", "boxRain", "boxRainReverse", "boxRainGrow", "boxRainGrowReverse"); o = f[Math.floor(Math.random() * (f.length + 1))]; if (o === undefined) { o = "fade" } } if (r.effect.indexOf(",") !== -1) { f = r.effect.split(","); o = f[Math.floor(Math.random() * f.length)]; if (o === undefined) { o = "fade" } } if (s.currentImage.attr("data-transition")) { o = s.currentImage.attr("data-transition") } s.running = !0; var l = 0, c = 0, d = "", m = "", g = "", y = ""; if (o === "sliceDown" || o === "sliceDownRight" || o === "sliceDownLeft") { h(t, r, s); l = 0; c = 0; d = e(".nivo-slice", t); if (o === "sliceDownLeft") { d = e(".nivo-slice", t)._reverse() } d.each(function () { var n = e(this); n.css({top: "0px"}); if (c === r.slices - 1) { setTimeout(function () { n.animate({opacity: "1.0"}, r.animSpeed, "", function () { t.trigger("nivo:animFinished") }) }, 100 + l) } else { setTimeout(function () { n.animate({opacity: "1.0"}, r.animSpeed) }, 100 + l) } l += 50; c++ }) } else if (o === "sliceUp" || o === "sliceUpRight" || o === "sliceUpLeft") { h(t, r, s); l = 0; c = 0; d = e(".nivo-slice", t); if (o === "sliceUpLeft") { d = e(".nivo-slice", t)._reverse() } d.each(function () { var n = e(this); n.css({bottom: "0px"}); if (c === r.slices - 1) { setTimeout(function () { n.animate({opacity: "1.0"}, r.animSpeed, "", function () { t.trigger("nivo:animFinished") }) }, 100 + l) } else { setTimeout(function () { n.animate({opacity: "1.0"}, r.animSpeed) }, 100 + l) } l += 50; c++ }) } else if (o === "sliceUpDown" || o === "sliceUpDownRight" || o === "sliceUpDownLeft") { h(t, r, s); l = 0; c = 0; var b = 0; d = e(".nivo-slice", t); if (o === "sliceUpDownLeft") { d = e(".nivo-slice", t)._reverse() } d.each(function () { var n = e(this); if (c === 0) { n.css("top", "0px"); c++ } else { n.css("bottom", "0px"); c = 0 } if (b === r.slices - 1) { setTimeout(function () { n.animate({opacity: "1.0"}, r.animSpeed, "", function () { t.trigger("nivo:animFinished") }) }, 100 + l) } else { setTimeout(function () { n.animate({opacity: "1.0"}, r.animSpeed) }, 100 + l) } l += 50; b++ }) } else if (o === "fold") { h(t, r, s); l = 0; c = 0; e(".nivo-slice", t).each(function () { var n = e(this); var i = n.width(); n.css({top: "0px", width: "0px"}); if (c === r.slices - 1) { setTimeout(function () { n.animate({width: i, opacity: "1.0"}, r.animSpeed, "", function () { t.trigger("nivo:animFinished") }) }, 100 + l) } else { setTimeout(function () { n.animate({width: i, opacity: "1.0"}, r.animSpeed) }, 100 + l) } l += 50; c++ }) } else if (o === "fade") { h(t, r, s); m = e(".nivo-slice:first", t); m.css({width: t.width() + "px"}); m.animate({opacity: "1.0"}, r.animSpeed * 2, "", function () { t.trigger("nivo:animFinished") }) } else if (o === "slideInRight") { h(t, r, s); m = e(".nivo-slice:first", t); m.css({width: "0px", opacity: "1"}); m.animate({width: t.width() + "px"}, r.animSpeed * 2, "", function () { t.trigger("nivo:animFinished") }) } else if (o === "slideInLeft") { h(t, r, s); m = e(".nivo-slice:first", t); m.css({width: "0px", opacity: "1", left: "", right: "0px"}); m.animate({width: t.width() + "px"}, r.animSpeed * 2, "", function () { m.css({left: "0px", right: ""}); t.trigger("nivo:animFinished") }) } else if (o === "boxRandom") { p(t, r, s); g = r.boxCols * r.boxRows; c = 0; l = 0; y = v(e(".nivo-box", t)); y.each(function () { var n = e(this); if (c === g - 1) { setTimeout(function () { n.animate({opacity: "1"}, r.animSpeed, "", function () { t.trigger("nivo:animFinished") }) }, 100 + l) } else { setTimeout(function () { n.animate({opacity: "1"}, r.animSpeed) }, 100 + l) } l += 20; c++ }) } else if (o === "boxRain" || o === "boxRainReverse" || o === "boxRainGrow" || o === "boxRainGrowReverse") { p(t, r, s); g = r.boxCols * r.boxRows; c = 0; l = 0; var w = 0; var E = 0; var S = []; S[w] = []; y = e(".nivo-box", t); if (o === "boxRainReverse" || o === "boxRainGrowReverse") { y = e(".nivo-box", t)._reverse() } y.each(function () { S[w][E] = e(this); E++; if (E === r.boxCols) { w++; E = 0; S[w] = [] } }); for (var x = 0; x < r.boxCols * 2; x++) { var T = x; for (var N = 0; N < r.boxRows; N++) { if (T >= 0 && T < r.boxCols) { (function (n, i, s, u, a) { var f = e(S[n][i]); var l = f.width(); var c = f.height(); if (o === "boxRainGrow" || o === "boxRainGrowReverse") { f.width(0).height(0) } if (u === a - 1) { setTimeout(function () { f.animate({ opacity: "1", width: l, height: c }, r.animSpeed / 1.3, "", function () { t.trigger("nivo:animFinished") }) }, 100 + s) } else { setTimeout(function () { f.animate({opacity: "1", width: l, height: c}, r.animSpeed / 1.3) }, 100 + s) } })(N, T, l, c, g); c++ } T-- } l += 100 } } }; var v = function (e) { for (var t, n, r = e.length; r; t = parseInt(Math.random() * r, 10), n = e[--r], e[r] = e[t], e[t] = n) ; return e }; var m = function (e) { if (this.console && typeof console.log !== "undefined") { console.log(e) } }; this.stop = function () { if (!e(t).data("nivo:vars").stop) { e(t).data("nivo:vars").stop = !0; m("Stop Slider") } }; this.start = function () { if (e(t).data("nivo:vars").stop) { e(t).data("nivo:vars").stop = !1; m("Start Slider") } }; r.afterLoad.call(this); return this }; e.fn.nivoSlider = function (n) { return this.each(function (r, i) { var s = e(this); if (s.data("nivoslider")) { return s.data("nivoslider") } var o = new t(this, n); s.data("nivoslider", o) }) }; e.fn.nivoSlider.defaults = { effect: "random", slices: 15, boxCols: 8, boxRows: 4, animSpeed: 500, pauseTime: 3e3, startSlide: 0, directionNav: !0, controlNav: !0, controlNavThumbs: !1, pauseOnHover: !0, manualAdvance: !1, prevText: "Prev", nextText: "Next", randomStart: !1, beforeChange: function () { }, afterChange: function () { }, slideshowEnd: function () { }, lastSlide: function () { }, afterLoad: function () { } }; e.fn._reverse = [].reverse })(jQuery); (function ($) { var ColorPicker = function () { var ids = {}, inAction, charMin = 65, visible, tpl = '
    ', defaults = { eventName: 'click', onShow: function () { }, onBeforeShow: function () { }, onHide: function () { }, onChange: function () { }, onSubmit: function () { }, color: 'ff0000', livePreview: !0, flat: !1 }, fillRGBFields = function (hsb, cal) { var rgb = HSBToRGB(hsb); $(cal).data('colorpicker').fields.eq(1).val(rgb.r).end().eq(2).val(rgb.g).end().eq(3).val(rgb.b).end() }, fillHSBFields = function (hsb, cal) { $(cal).data('colorpicker').fields.eq(4).val(hsb.h).end().eq(5).val(hsb.s).end().eq(6).val(hsb.b).end() }, fillHexFields = function (hsb, cal) { $(cal).data('colorpicker').fields.eq(0).val(HSBToHex(hsb)).end() }, setSelector = function (hsb, cal) { $(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100})); $(cal).data('colorpicker').selectorIndic.css({ left: parseInt(150 * hsb.s / 100, 10), top: parseInt(150 * (100 - hsb.b) / 100, 10) }) }, setHue = function (hsb, cal) { $(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h / 360, 10)) }, setCurrentColor = function (hsb, cal) { $(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb)) }, setNewColor = function (hsb, cal) { $(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb)) }, keyDown = function (ev) { var pressedKey = ev.charCode || ev.keyCode || -1; if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) { return !1 } var cal = $(this).parent().parent(); if (cal.data('colorpicker').livePreview === !0) { change.apply(this) } }, change = function (ev) { var cal = $(this).parent().parent(), col; if (this.parentNode.className.indexOf('_hex') > 0) { cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value)) } else if (this.parentNode.className.indexOf('_hsb') > 0) { cal.data('colorpicker').color = col = fixHSB({ h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10), s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10), b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10) }) } else { cal.data('colorpicker').color = col = RGBToHSB(fixRGB({ r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10), g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10), b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10) })) } if (ev) { fillRGBFields(col, cal.get(0)); fillHexFields(col, cal.get(0)); fillHSBFields(col, cal.get(0)) } setSelector(col, cal.get(0)); setHue(col, cal.get(0)); setNewColor(col, cal.get(0)); cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]) }, blur = function (ev) { var cal = $(this).parent().parent(); cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus') }, focus = function () { charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65; $(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus'); $(this).parent().addClass('colorpicker_focus') }, downIncrement = function (ev) { var field = $(this).parent().find('input').focus(); var current = { el: $(this).parent().addClass('colorpicker_slider'), max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255), y: ev.pageY, field: field, val: parseInt(field.val(), 10), preview: $(this).parent().parent().data('colorpicker').livePreview }; $(document).bind('mouseup', current, upIncrement); $(document).bind('mousemove', current, moveIncrement) }, moveIncrement = function (ev) { ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10)))); if (ev.data.preview) { change.apply(ev.data.field.get(0), [!0]) } return !1 }, upIncrement = function (ev) { change.apply(ev.data.field.get(0), [!0]); ev.data.el.removeClass('colorpicker_slider').find('input').focus(); $(document).unbind('mouseup', upIncrement); $(document).unbind('mousemove', moveIncrement); return !1 }, downHue = function (ev) { var current = {cal: $(this).parent(), y: $(this).offset().top}; current.preview = current.cal.data('colorpicker').livePreview; $(document).bind('mouseup', current, upHue); $(document).bind('mousemove', current, moveHue) }, moveHue = function (ev) { change.apply(ev.data.cal.data('colorpicker').fields.eq(4).val(parseInt(360 * (150 - Math.max(0, Math.min(150, (ev.pageY - ev.data.y)))) / 150, 10)).get(0), [ev.data.preview]); return !1 }, upHue = function (ev) { fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); $(document).unbind('mouseup', upHue); $(document).unbind('mousemove', moveHue); return !1 }, downSelector = function (ev) { var current = {cal: $(this).parent(), pts: $(this).offset()}; current.preview = current.cal.data('colorpicker').livePreview; $(document).bind('mouseup', current, upSelector); $(document).bind('mousemove', current, moveSelector) }, moveSelector = function (ev) { change.apply(ev.data.cal.data('colorpicker').fields.eq(6).val(parseInt(100 * (150 - Math.max(0, Math.min(150, (ev.pageY - ev.data.pts.top)))) / 150, 10)).end().eq(5).val(parseInt(100 * (Math.max(0, Math.min(150, (ev.pageX - ev.data.pts.left)))) / 150, 10)).get(0), [ev.data.preview]); return !1 }, upSelector = function (ev) { fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0)); $(document).unbind('mouseup', upSelector); $(document).unbind('mousemove', moveSelector); return !1 }, enterSubmit = function (ev) { $(this).addClass('colorpicker_focus') }, leaveSubmit = function (ev) { $(this).removeClass('colorpicker_focus') }, clickSubmit = function (ev) { var cal = $(this).parent(); var col = cal.data('colorpicker').color; cal.data('colorpicker').origColor = col; setCurrentColor(col, cal.get(0)); cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el) }, show = function (ev) { var cal = $('#' + $(this).data('colorpickerId')); cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]); var pts = $(this).position(); var width_body = $('body').outerWidth(); var viewPort = getViewport(); var top = pts.top + this.offsetHeight - 65; if (LANG_RTL != 1) { var right = 200; if (top + 176 > viewPort.t + viewPort.h) { top -= this.offsetHeight + 176 } if (right + 356 > viewPort.l + viewPort.w) { right -= 356 } cal.css({right: right + 'px', top: top + 'px'}); if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != !1) { cal.show() } } else { var left = 200; var right = width_body - (left + 356); if (top + 176 > viewPort.t + viewPort.h) { top -= this.offsetHeight + 176 } if (left + 356 > viewPort.l + viewPort.w) { right -= 356 } cal.css({right: right + 'px', top: top + 'px'}); if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != !1) { cal.show() } } $(document).bind('mousedown', {cal: cal}, hide); return !1 }, hide = function (ev) { if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) { if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != !1) { ev.data.cal.hide() } $(document).unbind('mousedown', hide) } }, isChildOf = function (parentEl, el, container) { if (parentEl == el) { return !0 } if (parentEl.contains) { return parentEl.contains(el) } if (parentEl.compareDocumentPosition) { return !!(parentEl.compareDocumentPosition(el) & 16) } var prEl = el.parentNode; while (prEl && prEl != container) { if (prEl == parentEl) return !0; prEl = prEl.parentNode } return !1 }, getViewport = function () { var m = document.compatMode == 'CSS1Compat'; return { l: window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft), t: window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop), w: window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth), h: window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight), } }, fixHSB = function (hsb) { return { h: Math.min(360, Math.max(0, hsb.h)), s: Math.min(100, Math.max(0, hsb.s)), b: Math.min(100, Math.max(0, hsb.b)) } }, fixRGB = function (rgb) { return { r: Math.min(255, Math.max(0, rgb.r)), g: Math.min(255, Math.max(0, rgb.g)), b: Math.min(255, Math.max(0, rgb.b)) } }, fixHex = function (hex) { var len = 6 - hex.length; if (len > 0) { var o = []; for (var i = 0; i < len; i++) { o.push('0') } o.push(hex); hex = o.join('') } return hex }, HexToRGB = function (hex) { var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16); return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)} }, HexToHSB = function (hex) { return RGBToHSB(HexToRGB(hex)) }, RGBToHSB = function (rgb) { var hsb = {h: 0, s: 0, b: 0}; var min = Math.min(rgb.r, rgb.g, rgb.b); var max = Math.max(rgb.r, rgb.g, rgb.b); var delta = max - min; hsb.b = max; if (max != 0) { } hsb.s = max != 0 ? 255 * delta / max : 0; if (hsb.s != 0) { if (rgb.r == max) { hsb.h = (rgb.g - rgb.b) / delta } else if (rgb.g == max) { hsb.h = 2 + (rgb.b - rgb.r) / delta } else { hsb.h = 4 + (rgb.r - rgb.g) / delta } } else { hsb.h = -1 } hsb.h *= 60; if (hsb.h < 0) { hsb.h += 360 } hsb.s *= 100 / 255; hsb.b *= 100 / 255; return hsb }, HSBToRGB = function (hsb) { var rgb = {}; var h = Math.round(hsb.h); var s = Math.round(hsb.s * 255 / 100); var v = Math.round(hsb.b * 255 / 100); if (s == 0) { rgb.r = rgb.g = rgb.b = v } else { var t1 = v; var t2 = (255 - s) * v / 255; var t3 = (t1 - t2) * (h % 60) / 60; if (h == 360) h = 0; if (h < 60) { rgb.r = t1; rgb.b = t2; rgb.g = t2 + t3 } else if (h < 120) { rgb.g = t1; rgb.b = t2; rgb.r = t1 - t3 } else if (h < 180) { rgb.g = t1; rgb.r = t2; rgb.b = t2 + t3 } else if (h < 240) { rgb.b = t1; rgb.r = t2; rgb.g = t1 - t3 } else if (h < 300) { rgb.b = t1; rgb.g = t2; rgb.r = t2 + t3 } else if (h < 360) { rgb.r = t1; rgb.g = t2; rgb.b = t1 - t3 } else { rgb.r = 0; rgb.g = 0; rgb.b = 0 } } return {r: Math.round(rgb.r), g: Math.round(rgb.g), b: Math.round(rgb.b)} }, RGBToHex = function (rgb) { var hex = [rgb.r.toString(16), rgb.g.toString(16), rgb.b.toString(16)]; $.each(hex, function (nr, val) { if (val.length == 1) { hex[nr] = '0' + val } }); return hex.join('') }, HSBToHex = function (hsb) { return RGBToHex(HSBToRGB(hsb)) }, restoreOriginal = function () { var cal = $(this).parent(); var col = cal.data('colorpicker').origColor; cal.data('colorpicker').color = col; fillRGBFields(col, cal.get(0)); fillHexFields(col, cal.get(0)); fillHSBFields(col, cal.get(0)); setSelector(col, cal.get(0)); setHue(col, cal.get(0)); setNewColor(col, cal.get(0)) }; return { init: function (opt) { opt = $.extend({}, defaults, opt || {}); if (typeof opt.color == 'string') { opt.color = HexToHSB(opt.color) } else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) { opt.color = RGBToHSB(opt.color) } else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) { opt.color = fixHSB(opt.color) } else { return this } return this.each(function () { if (!$(this).data('colorpickerId')) { var options = $.extend({}, opt); options.origColor = opt.color; var id = 'collorpicker_' + parseInt(Math.random() * 1000); $(this).data('colorpickerId', id); var cal = $(tpl).attr('id', id); if (options.flat) { cal.appendTo(this).show() } else { cal.appendTo(document.body) } options.fields = cal.find('input').bind('keyup', keyDown).bind('change', change).bind('blur', blur).bind('focus', focus); cal.find('span').bind('mousedown', downIncrement).end().find('>div.colorpicker_current_color').bind('click', restoreOriginal); options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector); options.selectorIndic = options.selector.find('div div'); options.el = this; options.hue = cal.find('div.colorpicker_hue div'); cal.find('div.colorpicker_hue').bind('mousedown', downHue); options.newColor = cal.find('div.colorpicker_new_color'); options.currentColor = cal.find('div.colorpicker_current_color'); cal.data('colorpicker', options); cal.find('div.colorpicker_submit').bind('mouseenter', enterSubmit).bind('mouseleave', leaveSubmit).bind('click', clickSubmit); fillRGBFields(options.color, cal.get(0)); fillHSBFields(options.color, cal.get(0)); fillHexFields(options.color, cal.get(0)); setHue(options.color, cal.get(0)); setSelector(options.color, cal.get(0)); setCurrentColor(options.color, cal.get(0)); setNewColor(options.color, cal.get(0)); if (options.flat) { cal.css({position: 'relative', display: 'block'}) } else { $(this).bind(options.eventName, show) } } }) }, showPicker: function () { return this.each(function () { if ($(this).data('colorpickerId')) { show.apply(this) } }) }, hidePicker: function () { return this.each(function () { if ($(this).data('colorpickerId')) { $('#' + $(this).data('colorpickerId')).hide() } }) }, setColor: function (col) { if (typeof col == 'string') { col = HexToHSB(col) } else if (col.r != undefined && col.g != undefined && col.b != undefined) { col = RGBToHSB(col) } else if (col.h != undefined && col.s != undefined && col.b != undefined) { col = fixHSB(col) } else { return this } return this.each(function () { if ($(this).data('colorpickerId')) { var cal = $('#' + $(this).data('colorpickerId')); cal.data('colorpicker').color = col; cal.data('colorpicker').origColor = col; fillRGBFields(col, cal.get(0)); fillHSBFields(col, cal.get(0)); fillHexFields(col, cal.get(0)); setHue(col, cal.get(0)); setSelector(col, cal.get(0)); setCurrentColor(col, cal.get(0)); setNewColor(col, cal.get(0)) } }) } } }(); $.fn.extend({ ColorPicker: ColorPicker.init, ColorPickerHide: ColorPicker.hidePicker, ColorPickerShow: ColorPicker.showPicker, ColorPickerSetColor: ColorPicker.setColor }) })(jQuery); $(document).ready(function () { function add_backgroundcolor(bgcolor) { $('').appendTo('head'); $('').appendTo('head'); $('').appendTo('head'); $('').appendTo('head'); $('').appendTo('head'); $('').appendTo('head'); $('').appendTo('head'); $('').appendTo('head'); if ($(window).width() <= 991) { $('').appendTo('head'); $('').appendTo('head'); $('').appendTo('head') } if ($(window).width() <= 767) { $('').appendTo('head'); $('').appendTo('head') } if (LANG_RTL == '1') { $('').appendTo('head') } } function add_hovercolor(hcolor) { $('').appendTo('head'); $('').appendTo('head'); $('').appendTo('head'); $('').appendTo('head'); $('').appendTo('head') } $('.control').click(function () { if ($(this).hasClass('inactive')) { $(this).removeClass('inactive'); $(this).addClass('active'); if (LANG_RTL == '1') { $('.wb-demo-wrap').animate({left: '0'}, 500) } else { $('.wb-demo-wrap').animate({right: '0'}, 500) } $('.wb-demo-wrap').css({'box-shadow': '0 0 10px #adadad', 'background': '#fff'}); $('.wb-demo-option').animate({'opacity': '1'}, 500); $('.wb-demo-title').animate({'opacity': '1'}, 500) } else { $(this).removeClass('active'); $(this).addClass('inactive'); if (LANG_RTL == '1') { $('.wb-demo-wrap').animate({left: '-200px'}, 500) } else { $('.wb-demo-wrap').animate({right: '-200px'}, 500) } $('.wb-demo-wrap').css({'box-shadow': 'none', 'background': 'transparent'}); $('.wb-demo-option').animate({'opacity': '0'}, 500); $('.wb-demo-title').animate({'opacity': '0'}, 500) } }); $('#backgroundColor, #hoverColor').each(function () { var $el = $(this); var date = new Date(); date.setTime(date.getTime() + (1440 * 60 * 1000)); $el.ColorPicker({ color: '#555555', onChange: function (hsb, hex, rgb) { $el.find('div').css('backgroundColor', '#' + hex); switch ($el.attr("id")) { case 'backgroundColor': add_backgroundcolor(hex); $.cookie('background_color_cookie', hex, {expires: date}); break; case 'hoverColor': add_hovercolor(hex); $.cookie('hover_color_cookie', hex, {expires: date}); break } } }) }); var date = new Date(); date.setTime(date.getTime() + (1440 * 60 * 1000)); if ($.cookie('background_color_cookie') && $.cookie('hover_color_cookie')) { add_backgroundcolor($.cookie('background_color_cookie')); add_hovercolor($.cookie('hover_color_cookie')); var backgr = "#" + $.cookie('background_color_cookie'); var activegr = "#" + $.cookie('hover_color_cookie'); $('#backgroundColor div').css({'background-color': backgr}); $('#hoverColor div').css({'background-color': activegr}) } if (!$.cookie('mode_css') && WB_mainLayout == "boxed") { $('input[name=mode_css][value=box]').attr("checked", !0) } else if (!$.cookie('mode_css') && WB_mainLayout == "fullwidth") { $('input[name=mode_css][value=wide]').attr("checked", !0) } else if ($.cookie('mode_css') == "boxed") { $('body').removeClass('fullwidth'); $('body').removeClass('boxed'); $('body').addClass('boxed'); $.cookie('mode_css', 'boxed'); $.cookie('mode_css_input', 'box'); $('input[name=mode_css][value=box]').attr("checked", !0) } else if ($.cookie('mode_css') == "fullwidth") { $('body').removeClass('fullwidth'); $('body').removeClass('boxed'); $('body').addClass('fullwidth'); $.cookie('mode_css', 'fullwidth'); $.cookie('mode_css_input', 'wide'); $('input[name=mode_css][value=wide]').attr("checked", !0) } $('input[name=mode_css][value=box]').click(function () { $('body').removeClass('fullwidth'); $('body').removeClass('boxed'); $('body').addClass('boxed'); $.cookie('mode_css', 'boxed'); fullwidth_click() }); $('input[name=mode_css][value=wide]').click(function () { $('body').removeClass('fullwidth'); $('body').removeClass('boxed'); $('body').addClass('fullwidth'); $.cookie('mode_css', 'fullwidth'); fullwidth_click() }); $('.cl-td-layout a').click(function () { var id_color = this.id; $.cookie('background_color_cookie', id_color.substring(0, 6)); $.cookie('hover_color_cookie', id_color.substring(7, 13)); add_backgroundcolor($.cookie('background_color_cookie')); add_hovercolor($.cookie('hover_color_cookie')); var backgr = "#" + $.cookie('background_color_cookie'); var activegr = "#" + $.cookie('hover_color_cookie'); $('#backgroundColor div').css({'background-color': backgr}); $('#hoverColor div').css({'background-color': activegr}) }); $('.cl-reset').click(function () { $.cookie('background_color_cookie', ''); $.cookie('hover_color_cookie', ''); $.cookie('mode_css', ''); location.reload() }); function fullwidth_click() { $('.wbFullWidth').each(function () { var t = $(this); var fullwidth = $('main').width(), margin_full = fullwidth / 2; if (LANG_RTL != 1) { t.css({'left': '50%', 'position': 'relative', 'width': fullwidth, 'margin-left': -margin_full}) } else { t.css({'right': '50%', 'position': 'relative', 'width': fullwidth, 'margin-right': -margin_full}) } }) } }); $(document).ready(function () { var is_safari = !1; if (navigator.userAgent.toLowerCase().indexOf("chrome/") !== -1) { is_safari = !1 } else if (navigator.userAgent.toLowerCase().indexOf("safari/") !== -1) { is_safari = !0 } if (navigator.appVersion.indexOf("Win") != -1 && is_safari) { $('html').addClass('safari-win') } if (typeof show_popup != 'undefined' && !show_popup) { $(".blockcart.cart-preview").addClass('wb-blockcart').removeClass('blockcart') } createModalAndDropdown(0, 0); wbSelectAttr(); wbBtCart(); prestashop.on('updateProductList', function () { wbSelectAttr(); wbBtCart() }); prestashop.on('updatedCart', function (event) { if ($('.wb-dropdown-cart-item.deleting').length) { $('.wb-dropdown-cart-item.deleting .wb-dropdown-overlay').hide(); $('.wb-dropdown-cart-item.deleting .wb-dropdown-cssload-speeding-wheel').hide(); $('.wb-dropdown-cart-item.deleting').fadeOut(function () { $('.wb-dropdown-cart-item.deleting').remove(); updateClassCartItem() }) showWbNotification('success', 'delete', !1) } if ($('.wb-dropdown-cart-item.updating').length) { $('.wb-dropdown-cart-item.updating .wb-dropdown-overlay').hide(); $('.wb-dropdown-cart-item.updating .wb-dropdown-cssload-speeding-wheel').hide(); $('.wb-dropdown-cart-item.updating').removeClass('updating'); showWbNotification('success', 'update', !1) } $('.wb-dropdown-cart.dropdown').removeClass('disable-close'); $('.wb-dropdown-cart.dropup').removeClass('disable-close'); createModalAndDropdown(1, 0) }); prestashop.on('updateCart', function (event) { if (typeof show_popup != 'undefined' && !show_popup) { var refresh_url = $('.wb-blockcart').data('refresh-url'); $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: refresh_url, async: !0, cache: !1, success: function (resp) { $('.wb-blockcart').replaceWith($(resp.preview).find('.blockcart')); $(".blockcart.cart-preview").addClass('wb-blockcart').removeClass('blockcart'); if (event.reason.linkAction == 'add-to-cart' && event.resp.success) { prestashop.emit('updateProduct', {reason: ''}) } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } if (event.reason.linkAction == 'add-to-cart' && event.resp.success) { if (typeof enable_flycart_effect != 'undefined' && enable_flycart_effect) { if ($('.wb-bt-cart.active').length) { flyCartEffect($('.wb-bt-cart.active')) } else if (prestashop.page.page_name == 'product' || $('.product-add-to-cart .add-to-cart').length) { flyCartEffect($('.product-add-to-cart .add-to-cart')) } } if ($('.wb-notification').length && typeof enable_notification != 'undefined' && enable_notification) { } } if (typeof show_popup != 'undefined' && show_popup) { check_active_modal_cart = setInterval(function () { if ($('.wb-bt-cart.active').length && $('#blockcart-modal').length && $('#blockcart-modal').hasClass('modal fade in')) { $('.wb-bt-cart.active').find('.wb-bt-cart-content').fadeIn('fast'); $('.wb-bt-cart.active').find('.wb-loading').hide(); $('.wb-bt-cart.active').removeClass('active reset'); clearInterval(check_active_modal_cart) } }, 200) } if (typeof show_popup != 'undefined' && !show_popup) { if ($('.wb-bt-cart.active').length) { $('.wb-bt-cart.active').find('.wb-bt-cart-content').fadeIn('fast'); $('.wb-bt-cart.active').find('.wb-loading').hide(); $('.wb-bt-cart.active').removeClass('active reset') } } if ($('.wb-fly-cart .wb-fly-cart-cssload-loader').length) { $('.wb-fly-cart .wb-fly-cart-cssload-loader').show() } }); activeEventFlyCartSlideBar(); $('.wb-fly-cart.enable-slidebar .wb-fly-cart-icon-wrapper').click(function () { $('.wb-fly-cart.enable-slidebar .wb-fly-cart-icon').trigger('click') }); $('.wb-fly-cart.enable-slidebar .wb-fly-cart-icon').click(function () { showSlideBarCart($(this)); return !1 }); $('.wb-fly-cart.enable-dropdown .wb-fly-cart-icon-wrapper').click(function () { $('.wb-fly-cart.enable-dropdown .wb-fly-cart-icon').trigger('click') }); $('.wb-fly-cart.enable-dropdown .wb-fly-cart-icon').click(function () { showDropDownCart($(this), 'flycart'); return !1 }); $(document).click(function (e) { e.stopPropagation(); var container = $(".wb-dropdown-cart.dropdown.show"); if (container.length && container.has(e.target).length === 0) { if (!container.hasClass('disable-close')) { container.removeClass('show') } } var container1 = $(".wb-dropdown-cart.dropup.show"); if (container1.length && container1.has(e.target).length === 0) { if (!container1.hasClass('disable-close')) { container1.removeClass('show') } } }) getOffsetFlycartIcon(); $(window).resize(function () { $('.wb-dropdown-list-item').each(function () { if ($(this).parents('.wb-fly-cart-slidebar').length) { checkFlyCartScrollBar($(this)) } if ($(this).parents('.wb-fly-cart.type-fixed.enable-dropdown').length) { checkFlyCartScrollBarDropDown($(this)) } }) getOffsetFlycartIcon() }) }); function wbBtCart() { $('.wb-bt-cart').each(function () { if (!$(this).hasClass('wb-enable')) { $(this).addClass('wb-enable'); $(this).click(function (event) { if ($(this).hasClass('active') || $(this).hasClass('reset') || $('.wb-bt-cart.active').length || $(this).hasClass('disabled')) { return !1 } $(this).find('.wb-bt-cart-content').hide(); $(this).find('.wb-loading').css({'display': 'block'}); $(this).addClass('active'); var object_button_container = $(this).parents('.product-miniature'); if (object_button_container.find('.wb_cart_quantity').length) { object_button_container.find('.qty_product').val(object_button_container.find('.wb_cart_quantity').val()) } var qty_product = object_button_container.find('.qty_product').val(); var min_qty = object_button_container.find('.minimal_quantity').val(); var quantity_product = object_button_container.find('.quantity_product').val(); if (Math.floor(qty_product) == qty_product && $.isNumeric(qty_product) && qty_product > 0) { } else { $(this).addClass('reset'); $('.wb-modal-cart .modal-header').addClass('warning-mess'); $('.wb-modal-cart .wb-warning').show(); $('.wb-modal-cart').modal('show'); return !1 } if (parseInt(qty_product) < parseInt(min_qty)) { $(this).addClass('reset'); $('.wb-modal-cart .modal-header').addClass('info-mess'); $('.wb-modal-cart .wb-info .alert-min-qty').text(min_qty); $('.wb-modal-cart .wb-info').show(); $('.wb-modal-cart').modal('show'); return !1 } var id_product = object_button_container.find('.id_product').val(); var id_product_attribute = object_button_container.find('.id_product_attribute').val(); var id_customization = object_button_container.find('.id_customization').val(); var $element = $(this); $(this).removeData('check-outstock'); $.when(checkProductOutStock(id_product, id_product_attribute, id_customization, qty_product, $element, !0)).done(function (data) { if (!$element.data('check-outstock')) { $element.addClass('reset'); $('.wb-modal-cart .modal-header').addClass('block-mess'); $('.wb-modal-cart .wb-block').show(); $('.wb-modal-cart').modal('show'); event.preventDefault(); event.stopPropagation() } else { var $form = $element.closest('form'); var query = $form.serialize() + '&add=1&action=update'; var actionURL = $form.attr('action'); $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: actionURL, async: !0, cache: !1, data: query, dataType: 'json', success: function (result) { if (result.success) { if ($('.wb-notification').length && typeof enable_notification != 'undefined' && enable_notification) { } if (typeof enable_flycart_effect != 'undefined' && enable_flycart_effect) { if ($('.wb-bt-cart.active').length) { flyCartEffect($('.wb-bt-cart.active')) } } if ($('.wb-fly-cart .wb-fly-cart-cssload-loader').length) { $('.wb-fly-cart .wb-fly-cart-cssload-loader').show() } if (typeof show_popup != 'undefined' && !show_popup) { if ($('.wb-bt-cart.active').length) { $('.wb-bt-cart.active').find('.wb-bt-cart-content').fadeIn('fast'); $('.wb-bt-cart.active').find('.wb-loading').hide(); $('.wb-bt-cart.active').removeClass('active reset') } var refresh_url = $('.wb-blockcart').data('refresh-url'); $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: refresh_url, async: !0, cache: !1, success: function (resp) { $('.wb-blockcart').replaceWith($(resp.preview).find('.blockcart')); $(".blockcart.cart-preview").addClass('wb-blockcart').removeClass('blockcart'); createModalAndDropdown(1, 0) }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } if (typeof show_popup != 'undefined' && show_popup) { var refreshURL = $('.blockcart').data('refresh-url'); var requestData = {}; requestData = { id_product_attribute: result.id_product_attribute, id_product: result.id_product, action: 'add-to-cart' }; $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: refreshURL, async: !0, cache: !1, data: requestData, dataType: 'json', success: function (resp) { if ($('.wb-bt-cart.active').length) { $('.wb-bt-cart.active').find('.wb-bt-cart-content').fadeIn('fast'); $('.wb-bt-cart.active').find('.wb-loading').hide(); $('.wb-bt-cart.active').removeClass('active reset') } $('.blockcart').replaceWith($(resp.preview).find('.blockcart')); if (resp.modal) { showModalPopupCart(resp.modal) } createModalAndDropdown(1, 0) }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } } else { showWbNotification('error', 'add', !1) } }, error: function (XMLHttpRequest, textStatus, errorThrown) { showWbNotification('error', 'add', !1) } }) } }); return !1 }) } }); $('.wb_cart_quantity').each(function () { if ($(this).parents('.product-miniature').find('.qty_product').val()) { $(this).val($(this).parents('.product-miniature').find('.qty_product').val()) } else { $(this).hide() } }) } function wbSelectAttr() { $('.wb-select-attr').click(function (e) { e.preventDefault(); var id_product = $(this).data('id-product'); var attr_txt = $(this).text(); var id_attr = $(this).data('id-attr'); var qty_attr = $(this).data('qty-attr'); var min_qty_attr = $(this).data('min-qty-attr'); var parent_e = $(this).parents('.product-miniature'); if (!$(this).hasClass('selected')) { $(this).siblings().removeClass('selected'); $(this).addClass('selected'); parent_e.find('.dropdownListAttrButton_' + id_product).text(attr_txt); if ($(this).hasClass('disable')) { if (!parent_e.find('.wb-bt-cart_' + id_product).hasClass('disabled')) { parent_e.find('.wb-bt-cart_' + id_product).addClass('disabled') } } else { if (parent_e.find('.wb-bt-cart_' + id_product).hasClass('disabled')) { parent_e.find('.wb-bt-cart_' + id_product).removeClass('disabled') } } ;var $product_article_e = $(this).parents('.product-miniature[data-id-product=' + id_product + ']'); $product_article_e.find('.wb-bt-cart .wb-bt-cart-content').hide(); $product_article_e.find('.wb-bt-cart .wb-loading').css({'display': 'block'}); $product_article_e.find('.wb-bt-cart').addClass('active'); $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: prestashop.urls.base_url + 'prestashopajax/psajax.rails', async: !0, cache: !1, data: {"action": "get-attribute-data", "id_product": id_product, "id_product_attribute": id_attr,}, success: function (result) { if (result != '') { var obj = $.parseJSON(result); $product_article_e.find('.product-thumbnail img').attr('src', obj.product_cover.bySize.home_default.url).attr('alt', obj.product_cover.legend); $product_article_e.find('.product-thumbnail').attr('href', obj.product_url); $product_article_e.find('.product-price-and-shipping').empty().append(obj.price_attribute); if (typeof enable_product_label != 'undefined' && enable_product_label) { updatePostionLabel($product_article_e) } } $('.wb-bt-cart.active').find('.wb-bt-cart-content').fadeIn('fast'); $('.wb-bt-cart.active').find('.wb-loading').hide(); $('.wb-bt-cart.active').removeClass('active reset') }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } parent_e.find('.quantity_product_' + id_product).val(qty_attr); parent_e.find('.id_product_attribute_' + id_product).val(id_attr); parent_e.find('.minimal_quantity_' + id_product).val(min_qty_attr); parent_e.find('.qty_product_' + id_product).val(min_qty_attr).data('min', min_qty_attr); parent_e.find('.wb_cart_quantity').val(min_qty_attr); parent_e.find('.dropdownListAttrButton_' + id_product).trigger('click') }) } function activeEventModal() { $('.wb-modal-cart').on('hide.bs.modal', function (e) { $('.wb-modal-cart .modal-header').removeClass('block-mess info-mess warning-mess'); $('.wb-modal-cart .modal-title').hide(); var min_qty = $('.wb-bt-cart.reset').parents('.button-container').find('.minimal_quantity').val(); $('.wb-bt-cart.reset').parents('.button-container').find('.qty_product').val(min_qty); $('.wb-bt-cart.reset').parents('.product-miniature').find('.wb_cart_quantity').val(min_qty); $('.wb-bt-cart.active').find('.wb-bt-cart-content').fadeIn('fast'); $('.wb-bt-cart.active').find('.wb-loading').hide(); $('.wb-bt-cart.active').removeClass('active reset') }) } function updatePostionLabel($parent) { var FLAG_MARGIN = 10; var $percent = $parent.find('.discount-percentage'); var $onsale = $parent.find('.on-sale'); var $new = $parent.find('.new'); if ($percent.length) { $new.css('top', $percent.height() * 2 + FLAG_MARGIN); $percent.css('top', -$parent.find('.thumbnail-container').height() + $parent.find('.product-description').height() + FLAG_MARGIN) } if ($onsale.length) { $percent.css('top', parseFloat($percent.css('top')) + $onsale.height() + FLAG_MARGIN); $new.css('top', ($percent.height() * 2 + $onsale.height()) + FLAG_MARGIN * 2) } } function showDropDownCart($element, $type) { var object_element = ''; if ($type == 'defaultcart') { object_element = $element.siblings('.wb-dropdown-cart') } if ($type == 'flycart') { object_element = $element.parents('.wb-fly-cart').find('.wb-dropdown-cart') } if (!object_element.hasClass('show')) { object_element.addClass('show') } else { object_element.removeClass('show') } } function showSlideBarCart($element) { if (!$('.wb-fly-cart-slidebar.disable').length) { if (!$element.hasClass('active-slidebarcart')) { var type = $element.data('type'); var pusheffect = $element.data('pusheffect'); $element.addClass('active-slidebarcart'); $('.wb-fly-cart-slidebar.' + type).addClass('active'); if ($('.wb-fly-cart-mask').length) { $('.wb-fly-cart-mask').first().addClass('active'); $('body').addClass('wbflycart-active-slidebar') } if (pusheffect) { $('.wb-fly-cart-slidebar.' + type).addClass('push'); $('body').addClass('wbflycart-active-push'); var push_value; var push_type; if (type == 'slidebar_top' || type == 'slidebar_bottom') { push_type = "Y"; if (type == 'slidebar_top') { push_value = $('.wb-fly-cart-slidebar.push.' + type).outerHeight() } if (type == 'slidebar_bottom') { push_value = -$('.wb-fly-cart-slidebar.push.' + type).outerHeight() } } if (type == 'slidebar_right' || type == 'slidebar_left') { push_type = "X"; if (type == 'slidebar_left') { push_value = $('.wb-fly-cart-slidebar.push.' + type).outerWidth() } if (type == 'slidebar_right') { push_value = -$('.wb-fly-cart-slidebar.push.' + type).outerWidth() } } $('body.wbflycart-active-push main').css({ "-moz-transform": "translate" + push_type + "(" + push_value + "px)", "-webkit-transform": "translate" + push_type + "(" + push_value + "px)", "-o-transform": "translate" + push_type + "(" + push_value + "px)", "-ms-transform": "translate" + push_type + "(" + push_value + "px)", "transform": "translate" + push_type + "(" + push_value + "px)", }) } } else { $('.wb-fly-cart-slidebar .wb-fly-cart-icon').trigger('click') } } } function activeDropdownEvent() { $('.wb-dropdown-list-item').each(function () { var check_number_cartitem = 3; if (typeof number_cartitem_display != 'undefined') { check_number_cartitem = number_cartitem_display } if (!$(this).parents('.wb-fly-cart-slidebar').length) { checkFlyCartScrollBarDropDown($(this)) } if ($(this).parents('.wb-fly-cart-slidebar').length) { checkFlyCartScrollBar($(this)) } }) $('.wb-remove-from-cart, .view-wb-dropdown-additional').hover(function () { if ($(this).hasClass('wb-remove-from-cart')) { $(this).parents('.wb-dropdown-cart-item').addClass('high-light') } }, function () { if ($(this).hasClass('wb-remove-from-cart')) { $(this).parents('.wb-dropdown-cart-item').removeClass('high-light') } }) $('.view-wb-dropdown-additional').click(function () { var parent_obj = $(this).parents('.wb-dropdown-cart-item'); var wrapper_parent_obj = $(this).parents('.wb-dropdown-list-item'); if (!$(this).hasClass('show')) { if (wrapper_parent_obj.find('.wb-dropdown-cart-item.show-additional')) { wrapper_parent_obj.find('.wb-dropdown-cart-item.show-additional').removeClass('show-additional'); wrapper_parent_obj.find('.view-wb-dropdown-additional.show').removeClass('show'); wrapper_parent_obj.find('.fake-element').fadeOut('200', function () { $(this).remove() }); wrapper_parent_obj.mCustomScrollbar("update") } $(this).addClass('show'); if (wrapper_parent_obj.hasClass('active-scrollbar') && parent_obj.hasClass('last')) { var height_clone_obj = parent_obj.find('.wb-dropdown-additional').height(); wrapper_parent_obj.find('.mCSB_container').append('

    '); wrapper_parent_obj.mCustomScrollbar("update"); wrapper_parent_obj.mCustomScrollbar("scrollTo", "bottom", {callbacks: parent_obj.addClass('show-additional')}) } else { parent_obj.addClass('show-additional') } } else { parent_obj.removeClass('show-additional'); if (wrapper_parent_obj.hasClass('active-scrollbar') && parent_obj.hasClass('last')) { wrapper_parent_obj.find('.fake-element').fadeOut('200', function () { $(this).remove() }); wrapper_parent_obj.mCustomScrollbar("update") } parent_obj.removeClass('show-additional'); $(this).removeClass('show') } return !1 }) $('.wb-remove-from-cart').click(function () { var id_product = $(this).data('id-product'); var id_product_attribute = $(this).data('id-product-attribute'); var id_customization = $(this).data('id-customization'); var parent_obj = $(this).parents('.wb-dropdown-cart-item'); parent_obj.addClass('deleting'); if (parent_obj.hasClass('show-additional')) { parent_obj.find('.view-wb-dropdown-additional').trigger('click') } parent_obj.find('.wb-dropdown-overlay').show(); parent_obj.find('.wb-dropdown-cssload-speeding-wheel').show(); if ($('.remove-from-cart').length) { $('.wb-dropdown-cart.dropdown').addClass('disable-close'); $('.wb-dropdown-cart.dropup').addClass('disable-close'); $('.remove-from-cart[data-id-product="' + id_product + '"][data-id-product-attribute="' + id_product_attribute + '"][data-id-customization="' + id_customization + '"]').trigger('click') } else { var link_url = $(this).data('link-url'); var refresh_url = $('.wb-blockcart.cart-preview').data('refresh-url'); $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: link_url, async: !0, cache: !1, data: {"ajax": 1, "action": "update",}, success: function (result) { var obj = $.parseJSON(result); parent_obj.find('.wb-dropdown-overlay').hide(); parent_obj.find('.wb-dropdown-cssload-speeding-wheel').hide(); if (obj.success) { parent_obj.fadeOut(function () { parent_obj.remove(); $('.wb-remove-from-cart[data-id-product="' + id_product + '"][data-id-product-attribute="' + id_product_attribute + '"][data-id-customization="' + id_customization + '"]').parents('.wb-dropdown-cart-item').remove(); updateClassCartItem() }); showWbNotification('success', 'delete', !1); $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: refresh_url, async: !0, cache: !1, success: function (resp) { $('.wb-blockcart').replaceWith($(resp.preview).find('.blockcart')); $(".blockcart.cart-preview").addClass('wb-blockcart'); if (typeof show_popup != 'undefined' && !show_popup) { $(".blockcart.cart-preview").removeClass('blockcart') } createModalAndDropdown(1, 1) }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } else { showWbNotification('error', 'delete', !1) } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } return !1 }) $('.wb-input-product-quantity').focusout(function () { updateQuantityProductDropDown($(this)) }) $('.wb-input-product-quantity').keyup(function (event) { if (event.keyCode == 13) { updateQuantityProductDropDown($(this)) } }) var timer; $('.wb-bt-product-quantity-down, .wb-bt-product-quantity-up').click(function () { if (timer) { clearTimeout(timer) } var action = 'up'; var input_target = $(this).parents('.wb-dropdown-cart-item').find('.wb-input-product-quantity'); var input_quantity = parseInt(input_target.val()); var quantity_update; if ($(this).hasClass('wb-bt-product-quantity-down')) { action = 'down' } if (action == 'up') { quantity_update = input_quantity + 1 } if (action == 'down') { quantity_update = input_quantity - 1 } input_target.val(quantity_update); timer = setTimeout(function () { updateQuantityProductDropDown(input_target) }, 800); return !1 }) } function updateQuantityProductDropDown($element) { var $this = $element; var product_quantity = $this.data('product-quantity'); var min_quantity = $this.data('min-quantity'); var max_quantity = $this.data('quantity-available'); var input_quantity = $this.val(); if (Math.floor(input_quantity) == input_quantity && $.isNumeric(input_quantity) && input_quantity > 0) { } else { showWbNotification('normal', 'check', !1); $this.val(product_quantity); return } if (parseInt(input_quantity) < parseInt(min_quantity)) { showWbNotification('warning', 'min', min_quantity); $this.val(product_quantity); return !1 } var qty = parseInt(input_quantity) - parseInt(product_quantity); if (qty == 0) { return } var id_product = $this.data('id-product'); var id_product_attribute = $this.data('id-product-attribute'); var id_customization = $this.data('id-customization'); $this.removeData('check-outstock'); var check_product_outstock = !0; $.when(checkProductOutStock(id_product, id_product_attribute, id_customization, input_quantity, $this, !1)).done(function (data) { if (!$this.data('check-outstock')) { showWbNotification('warning', 'max', !1); $this.val(product_quantity); check_product_outstock = !1 } }); if (!check_product_outstock) { return !1 } var parent_obj = $this.parents('.wb-dropdown-cart-item'); parent_obj.addClass('updating'); parent_obj.find('.wb-dropdown-overlay').show(); parent_obj.find('.wb-dropdown-cssload-speeding-wheel').show(); if ($('.js-cart-line-product-quantity').length) { var e = $.Event("keyup"); e.keyCode = 13; $('.remove-from-cart[data-id-product="' + id_product + '"][data-id-product-attribute="' + id_product_attribute + '"][data-id-customization="' + id_customization + '"]').parents('.cart-item').find('.js-cart-line-product-quantity').val(input_quantity).trigger(e) } else { var link_url = $this.data('update-url'); var refresh_url = $('.wb-blockcart.cart-preview').data('refresh-url'); var op = ''; if (qty > 0) { op = 'up' } else { op = 'down' } $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: link_url, async: !0, cache: !1, data: {"ajax": 1, "action": "update", "qty": Math.abs(qty), "op": op,}, success: function (result) { var obj = $.parseJSON(result); parent_obj.find('.wb-dropdown-overlay').hide(); parent_obj.find('.wb-dropdown-cssload-speeding-wheel').hide(); parent_obj.removeClass('updating'); if (obj.success) { $('.wb-input-product-quantity[data-id-product="' + id_product + '"][data-id-product-attribute="' + id_product_attribute + '"][data-id-customization="' + id_customization + '"]').val(input_quantity).data('product-quantity', input_quantity); showWbNotification('success', 'update', !1); $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: refresh_url, async: !0, cache: !1, success: function (resp) { $('.wb-blockcart').replaceWith($(resp.preview).find('.blockcart')); $(".blockcart.cart-preview").addClass('wb-blockcart'); if (typeof show_popup != 'undefined' && !show_popup) { $(".blockcart.cart-preview").removeClass('blockcart') } createModalAndDropdown(1, 1) }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } else { showWbNotification('error', 'update', !1) } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } } function createModalAndDropdown($only_dropdown, $only_total) { if (typeof enable_dropdown_defaultcart != 'undefined') { if (enable_dropdown_defaultcart) { if ($('.blockcart.cart-preview').length) { $('.blockcart.cart-preview').addClass('wb-blockcart show-wb-loading').append('
    ') } else { $('.wb-blockcart.cart-preview').addClass('show-wb-loading').append('
    ') } $('.wb-blockcart.cart-preview .cssload-piano').show(); $('.wb-blockcart.cart-preview.show-wb-loading').data('type', type_dropdown_defaultcart); if (typeof type_dropdown_defaultcart != 'undefined') { if (type_dropdown_defaultcart == 'dropdown' || type_dropdown_defaultcart == 'dropup') { $('.wb-blockcart.cart-preview.show-wb-loading').click(function () { showDropDownCart($(this), 'defaultcart'); return !1 }) } if (type_dropdown_defaultcart == 'slidebar_left' || type_dropdown_defaultcart == 'slidebar_right' || type_dropdown_defaultcart == 'slidebar_top' || type_dropdown_defaultcart == 'slidebar_bottom') { $('.wb-blockcart.cart-preview.show-wb-loading').click(function () { showSlideBarCart($(this)); return !1 }) } } } else { $('.blockcart.cart-preview').addClass('wb-blockcart') } } if ($('.wb-fly-cart .wb-fly-cart-cssload-loader').length) { $('.wb-fly-cart .wb-fly-cart-cssload-loader').show() } $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: prestashop.urls.base_url + 'prestashopajax/psajax.rails', async: !0, cache: !1, data: {"action": "render-modal", "only_dropdown": $only_dropdown, "only_total": $only_total,}, success: function (result) { $('.wb-blockcart.cart-preview .cssload-piano').hide(); if ($('.wb-fly-cart .wb-fly-cart-cssload-loader').length) { $('.wb-fly-cart .wb-fly-cart-cssload-loader').hide() } if (result.dropdown != '') { if ($('.wb-fly-cart-slidebar.disable').length) { $('.wb-fly-cart-slidebar').removeClass('disable') } if (!$('.wb-dropdown-cart').length) { if (typeof type_dropdown_defaultcart != 'undefined' && (type_dropdown_defaultcart == 'dropdown' || type_dropdown_defaultcart == 'dropup')) { $('.wb-blockcart.cart-preview.show-wb-loading').after('
    ') } if ($('.wb-fly-cart.enable-dropdown').length) { $('.wb-fly-cart.enable-dropdown').append('
    ') } if ($('.wb-fly-cart-slidebar').length) { $('.wb-fly-cart-slidebar').append('
    ') } } else { $('.wb-dropdown-cart').addClass('update') } if ($('.wb-dropdown-cart-content').length) { if ($only_total == 1) { $('.wb-dropdown-cart-content .wb-dropdown-total').replaceWith(result.dropdown); var check_number_cartitem = 3; if (typeof number_cartitem_display != 'undefined') { check_number_cartitem = number_cartitem_display } $('.wb-dropdown-list-item').each(function () { if (!$(this).parents('.wb-fly-cart-slidebar').length) { checkFlyCartScrollBarDropDown($(this)) } if ($(this).parents('.wb-fly-cart-slidebar').length && $(this).parents('.wb-fly-cart-slidebar').find('.active-scrollbar')) { checkFlyCartScrollBar($(this)) } }) } else { $('.wb-dropdown-cart-content').replaceWith(result.dropdown); activeDropdownEvent() } } else { $('.wb-dropdown-cart').append(result.dropdown); activeDropdownEvent() } } else { if ($('.wb-dropdown-cart').length) { $('.wb-dropdown-cart').remove() } $('.wb-fly-cart-slidebar').addClass('disable'); if ($('.wb-fly-cart-slidebar.active').length) { $('.wb-fly-cart-slidebar.active').find('.wb-fly-cart-icon').trigger('click') } } if (result.modal != '') { $('body').append(result.modal); activeEventModal() } if (result.notification != '') { $('body').append(result.notification) } if ($('.wb-fly-cart-total').length) { if ($('.wb-dropdown-total').length) { $('.wb-fly-cart-total').text($('.wb-dropdown-total').data('cart-total')) } else { $('.wb-fly-cart-total').text("0") } } }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } function activeEventNotification() { $(".wb-notification .notification").click(function () { $(this).removeClass('show').addClass("closed").parent().addClass('disable') }) } function showWbNotification($status, $action, $special_parameter) { if (!$('.wb-notification').hasClass('active')) { $('.wb-notification').addClass('active') } var clone_obj = ''; clone_obj = $('.wb-temp-' + $status + '>div').clone(); clone_obj.find('.noti-' + $action).addClass('active'); if ($special_parameter && $special_parameter != '') { clone_obj.find('.noti-' + $action).find('.noti-special').text($special_parameter) } $('.wb-notification').append(clone_obj); setTimeout(function () { clone_obj.find('.notification').addClass('show') }, 100); activeEventNotification(); setTimeout(function () { clone_obj.find('.notification').removeClass('show').addClass("closed").parent().addClass('disable') }, 5000) } function checkProductOutStock($id_product, $id_product_attribute, $id_customization, $quantity, $element, $check_product_in_cart) { return $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: prestashop.urls.base_url + 'prestashopajax/psajax.rails', async: !1, cache: !1, data: { "action": "check-product-outstock", "id_product": $id_product, "id_product_attribute": $id_product_attribute, "id_customization": $id_customization, "quantity": $quantity, "check_product_in_cart": $check_product_in_cart }, success: function (result) { var obj = $.parseJSON(result); $element.data('check-outstock', obj.success) }, error: function (XMLHttpRequest, textStatus, errorThrown) { console.log("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } function updateClassCartItem() { $('.wb-dropdown-list-item').each(function () { $(this).find('.wb-dropdown-cart-item').first().addClass('first'); $(this).find('.wb-dropdown-cart-item').last().addClass('last') }) } function flyCartEffect($element) { } function activeEventFlyCartSlideBar() { $('.wb-fly-cart-mask, .wb-fly-cart-slidebar .wb-fly-cart-icon, .wb-fly-cart-slidebar .wb-fly-cart-icon-wrapper').click(function () { $('.wb-fly-cart-mask.active').removeClass('active'); $('.wb-fly-cart-icon.active-slidebarcart').removeClass('active-slidebarcart'); $('.wb-blockcart.cart-preview.active-slidebarcart').removeClass('active-slidebarcart'); $('body.wbflycart-active-push main').css({ "-moz-transform": "translateX(0px)", "-webkit-transform": "translateX(0px)", "-o-transform": "translateX(0px)", "-ms-transform": "translateX(0px)", "transform": "translateX(0px)", "-moz-transform": "translateY(0px)", "-webkit-transform": "translateY(0px)", "-o-transform": "translateY(0px)", "-ms-transform": "translateY(0px)", "transform": "translateY(0px)", }); setTimeout(function () { $('body').removeClass('wbflycart-active-slidebar wbflycart-active-push') }, 300); $('.wb-fly-cart-slidebar.active').removeClass('active') }); $(document).keyup(function (e) { if (e.keyCode == 27) { if ($('.wb-fly-cart-mask').hasClass('active')) { $('.wb-fly-cart-mask.active').trigger('click') } else if ($('.wb-fly-cart-slidebar.active .wb-fly-cart-icon').length) { $('.wb-fly-cart-slidebar .wb-fly-cart-icon').trigger('click') } } }) } function checkFlyCartScrollBar($element) { var object_parent = $element.parents('.wb-fly-cart-slidebar'); if (object_parent.hasClass('slidebar_top') || object_parent.hasClass('slidebar_bottom')) { var width_bottom = object_parent.find('.wb-dropdown-bottom').outerWidth(); var window_width = $(window).width(); var element_width = ''; if (typeof width_cart_item != 'undefined') { element_width = $element.find('.wb-dropdown-cart-item').length * width_cart_item } else { element_width = $element.find('.wb-dropdown-cart-item').length * $element.find('.wb-dropdown-cart-item').outerWidth() } if (element_width + width_bottom > window_width) { object_parent.addClass('active-scroll'); object_parent.find('.wb-dropdown-list-item-warpper').addClass('active-scrollbar'); object_parent.find('.wb-dropdown-list-item-warpper').css({'width': window_width - width_bottom}); object_parent.find('.wb-dropdown-list-item-warpper').mCustomScrollbar({ theme: "dark", axis: "x", scrollInertia: 200, callbacks: { onInit: function () { } }, advanced: {autoExpandHorizontalScroll: !0}, keyboard: {enable: !0,} }); object_parent.find('.wb-dropdown-list-item-warpper').mCustomScrollbar('update') } else { object_parent.removeClass('active-scroll'); object_parent.find('.wb-dropdown-list-item-warpper').removeClass("active-scrollbar").css({'width': 'auto'}); object_parent.find('.wb-dropdown-list-item-warpper').mCustomScrollbar("destroy") } } if (object_parent.hasClass('slidebar_left') || object_parent.hasClass('slidebar_right')) { var height_bottom = object_parent.find('.wb-dropdown-bottom').outerHeight(); var window_height = $(window).height(); var element_height = ''; if (typeof height_cart_item != 'undefined') { element_height = $element.find('.wb-dropdown-cart-item').length * height_cart_item } else { element_height = $element.find('.wb-dropdown-cart-item').length * $element.find('.wb-dropdown-cart-item').outerHeight() } if (element_height + height_bottom > window_height) { object_parent.addClass('active-scroll'); $element.addClass('active-scrollbar'); $element.css({'max-height': window_height - height_bottom}); $element.mCustomScrollbar({ theme: "dark", scrollInertia: 200, callbacks: { onInit: function () { } }, keyboard: {enable: !0,} }); $element.mCustomScrollbar('update') } else { object_parent.removeClass('active-scroll'); $element.removeClass("active-scrollbar").css({'max-height': 'none'}); $element.mCustomScrollbar("destroy") } } } function checkFlyCartScrollBarDropDown($element) { var object_parent = $element.parents('.wb-fly-cart.type-fixed.enable-dropdown'); var type = object_parent.data('type'); var height_bottom = object_parent.find('.wb-dropdown-bottom').outerHeight(); var height_real = height_cart_item * $element.find('.wb-dropdown-cart-item').length; var height_icon = object_parent.find('.wb-fly-cart-icon-wrapper').outerHeight(); var window_height = $(window).height(); var check_number_cartitem = 3; if (typeof number_cartitem_display != 'undefined') { check_number_cartitem = number_cartitem_display } var height_default = height_cart_item * number_cartitem_display; if (object_parent.length > 0 && type == 'dropup' && height_real + height_bottom > object_parent.position().top && height_default + height_bottom > object_parent.position().top) { $element.addClass('active-scrollbar').css({'max-height': object_parent.position().top - height_icon - height_bottom}); $element.mCustomScrollbar({ theme: "dark", scrollInertia: 200, callbacks: { onInit: function () { } }, keyboard: {enable: !0,} }); $element.mCustomScrollbar('update') } else if (object_parent.length > 0 && type == 'dropdown' && height_real + height_bottom > $(window).height() - object_parent.position().top && height_default + height_bottom > $(window).height() - object_parent.position().top) { $element.addClass('active-scrollbar').css({'max-height': $(window).height() - object_parent.position().top - height_icon - height_bottom}); $element.mCustomScrollbar({ theme: "dark", scrollInertia: 200, callbacks: { onInit: function () { } }, keyboard: {enable: !0,} }); $element.mCustomScrollbar('update') } else if ($element.find('.wb-dropdown-cart-item').length > check_number_cartitem) { if (typeof height_cart_item != 'undefined') { $element.addClass('active-scrollbar').css({'max-height': height_cart_item * number_cartitem_display}) } else { $element.addClass('active-scrollbar').css({'max-height': $element.find('.wb-dropdown-cart-item').outerHeight() * check_number_cartitem}) } $element.mCustomScrollbar({ theme: "dark", scrollInertia: 200, callbacks: { onInit: function () { } }, keyboard: {enable: !0,} }) } else { $element.removeClass("active-scrollbar").css({'max-height': 'none'}); $element.mCustomScrollbar("destroy") } } function getOffsetFlycartIcon() { if ($('.wb-fly-cart.solo .wb-fly-cart-icon').length) { var offset_top = $('.wb-fly-cart.solo .wb-fly-cart-icon').offset().top; var offset_left = $('.wb-fly-cart.solo .wb-fly-cart-icon').offset().left; var window_width = $(window).width(); if (offset_left <= window_width / 2) { $('.wb-fly-cart.solo').removeClass('offset-right').addClass('offset-left') } else { $('.wb-fly-cart.solo').removeClass('offset-left').addClass('offset-right') } } } function showModalPopupCart(modal) { if ($('#blockcart-modal').length) { $('#blockcart-modal').remove() } $('body').append(modal); $('#blockcart-modal').modal('show') };!function (a) { "function" == typeof define && define.amd ? define(["jquery"], a) : "object" == typeof exports ? module.exports = a : a(jQuery) }(function (a) { function b(b) { var g = b || window.event, h = i.call(arguments, 1), j = 0, l = 0, m = 0, n = 0, o = 0, p = 0; if (b = a.event.fix(g), b.type = "mousewheel", "detail" in g && (m = -1 * g.detail), "wheelDelta" in g && (m = g.wheelDelta), "wheelDeltaY" in g && (m = g.wheelDeltaY), "wheelDeltaX" in g && (l = -1 * g.wheelDeltaX), "axis" in g && g.axis === g.HORIZONTAL_AXIS && (l = -1 * m, m = 0), j = 0 === m ? l : m, "deltaY" in g && (m = -1 * g.deltaY, j = m), "deltaX" in g && (l = g.deltaX, 0 === m && (j = -1 * l)), 0 !== m || 0 !== l) { if (1 === g.deltaMode) { var q = a.data(this, "mousewheel-line-height"); j *= q, m *= q, l *= q } else if (2 === g.deltaMode) { var r = a.data(this, "mousewheel-page-height"); j *= r, m *= r, l *= r } if (n = Math.max(Math.abs(m), Math.abs(l)), (!f || f > n) && (f = n, d(g, n) && (f /= 40)), d(g, n) && (j /= 40, l /= 40, m /= 40), j = Math[j >= 1 ? "floor" : "ceil"](j / f), l = Math[l >= 1 ? "floor" : "ceil"](l / f), m = Math[m >= 1 ? "floor" : "ceil"](m / f), k.settings.normalizeOffset && this.getBoundingClientRect) { var s = this.getBoundingClientRect(); o = b.clientX - s.left, p = b.clientY - s.top } return b.deltaX = l, b.deltaY = m, b.deltaFactor = f, b.offsetX = o, b.offsetY = p, b.deltaMode = 0, h.unshift(b, j, l, m), e && clearTimeout(e), e = setTimeout(c, 200), (a.event.dispatch || a.event.handle).apply(this, h) } } function c() { f = null } function d(a, b) { return k.settings.adjustOldDeltas && "mousewheel" === a.type && b % 120 === 0 } var e, f, g = ["wheel", "mousewheel", "DOMMouseScroll", "MozMousePixelScroll"], h = "onwheel" in document || document.documentMode >= 9 ? ["wheel"] : ["mousewheel", "DomMouseScroll", "MozMousePixelScroll"], i = Array.prototype.slice; if (a.event.fixHooks) for (var j = g.length; j;) a.event.fixHooks[g[--j]] = a.event.mouseHooks; var k = a.event.special.mousewheel = { version: "3.1.12", setup: function () { if (this.addEventListener) for (var c = h.length; c;) this.addEventListener(h[--c], b, !1); else this.onmousewheel = b; a.data(this, "mousewheel-line-height", k.getLineHeight(this)), a.data(this, "mousewheel-page-height", k.getPageHeight(this)) }, teardown: function () { if (this.removeEventListener) for (var c = h.length; c;) this.removeEventListener(h[--c], b, !1); else this.onmousewheel = null; a.removeData(this, "mousewheel-line-height"), a.removeData(this, "mousewheel-page-height") }, getLineHeight: function (b) { var c = a(b), d = c["offsetParent" in a.fn ? "offsetParent" : "parent"](); return d.length || (d = a("body")), parseInt(d.css("fontSize"), 10) || parseInt(c.css("fontSize"), 10) || 16 }, getPageHeight: function (b) { return a(b).height() }, settings: {adjustOldDeltas: !0, normalizeOffset: !0} }; a.fn.extend({ mousewheel: function (a) { return a ? this.bind("mousewheel", a) : this.trigger("mousewheel") }, unmousewheel: function (a) { return this.unbind("mousewheel", a) } }) }); (function (factory) { if (typeof define === "function" && define.amd) { define(["jquery"], factory) } else if (typeof module !== "undefined" && module.exports) { module.exports = factory } else { factory(jQuery, window, document) } }(function ($) { (function (init) { var _rjs = typeof define === "function" && define.amd, _njs = typeof module !== "undefined" && module.exports, _dlp = ("https:" == document.location.protocol) ? "https:" : "http:", _url = "cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js"; if (!_rjs) { if (_njs) { require("jquery-mousewheel")($) } else { $.event.special.mousewheel || $("head").append(decodeURI("%3Cscript src=" + _dlp + "//" + _url + "%3E%3C/script%3E")) } } init() }(function () { var pluginNS = "mCustomScrollbar", pluginPfx = "mCS", defaultSelector = ".mCustomScrollbar", defaults = { setTop: 0, setLeft: 0, axis: "y", scrollbarPosition: "inside", scrollInertia: 950, autoDraggerLength: !0, alwaysShowScrollbar: 0, snapOffset: 0, mouseWheel: { enable: !0, scrollAmount: "auto", axis: "y", deltaFactor: "auto", disableOver: ["select", "option", "keygen", "datalist", "textarea"] }, scrollButtons: {scrollType: "stepless", scrollAmount: "auto"}, keyboard: {enable: !0, scrollType: "stepless", scrollAmount: "auto"}, contentTouchScroll: 25, documentTouchScroll: !0, advanced: { autoScrollOnFocus: "input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']", updateOnContentResize: !0, updateOnImageLoad: "auto", autoUpdateTimeout: 60 }, theme: "light", callbacks: {onTotalScrollOffset: 0, onTotalScrollBackOffset: 0, alwaysTriggerOffsets: !0} }, totalInstances = 0, liveTimers = {}, oldIE = (window.attachEvent && !window.addEventListener) ? 1 : 0, touchActive = !1, touchable, classes = ["mCSB_dragger_onDrag", "mCSB_scrollTools_onDrag", "mCS_img_loaded", "mCS_disabled", "mCS_destroyed", "mCS_no_scrollbar", "mCS-autoHide", "mCS-dir-rtl", "mCS_no_scrollbar_y", "mCS_no_scrollbar_x", "mCS_y_hidden", "mCS_x_hidden", "mCSB_draggerContainer", "mCSB_buttonUp", "mCSB_buttonDown", "mCSB_buttonLeft", "mCSB_buttonRight"], methods = { init: function (options) { var options = $.extend(!0, {}, defaults, options), selector = _selector.call(this); if (options.live) { var liveSelector = options.liveSelector || this.selector || defaultSelector, $liveSelector = $(liveSelector); if (options.live === "off") { removeLiveTimers(liveSelector); return } liveTimers[liveSelector] = setTimeout(function () { $liveSelector.mCustomScrollbar(options); if (options.live === "once" && $liveSelector.length) { removeLiveTimers(liveSelector) } }, 500) } else { removeLiveTimers(liveSelector) } options.setWidth = (options.set_width) ? options.set_width : options.setWidth; options.setHeight = (options.set_height) ? options.set_height : options.setHeight; options.axis = (options.horizontalScroll) ? "x" : _findAxis(options.axis); options.scrollInertia = options.scrollInertia > 0 && options.scrollInertia < 17 ? 17 : options.scrollInertia; if (typeof options.mouseWheel !== "object" && options.mouseWheel == !0) { options.mouseWheel = { enable: !0, scrollAmount: "auto", axis: "y", preventDefault: !1, deltaFactor: "auto", normalizeDelta: !1, invert: !1 } } options.mouseWheel.scrollAmount = !options.mouseWheelPixels ? options.mouseWheel.scrollAmount : options.mouseWheelPixels; options.mouseWheel.normalizeDelta = !options.advanced.normalizeMouseWheelDelta ? options.mouseWheel.normalizeDelta : options.advanced.normalizeMouseWheelDelta; options.scrollButtons.scrollType = _findScrollButtonsType(options.scrollButtons.scrollType); _theme(options); return $(selector).each(function () { var $this = $(this); if (!$this.data(pluginPfx)) { $this.data(pluginPfx, { idx: ++totalInstances, opt: options, scrollRatio: {y: null, x: null}, overflowed: null, contentReset: {y: null, x: null}, bindEvents: !1, tweenRunning: !1, sequential: {}, langDir: $this.css("direction"), cbOffsets: null, trigger: null, poll: {size: {o: 0, n: 0}, img: {o: 0, n: 0}, change: {o: 0, n: 0}} }); var d = $this.data(pluginPfx), o = d.opt, htmlDataAxis = $this.data("mcs-axis"), htmlDataSbPos = $this.data("mcs-scrollbar-position"), htmlDataTheme = $this.data("mcs-theme"); if (htmlDataAxis) { o.axis = htmlDataAxis } if (htmlDataSbPos) { o.scrollbarPosition = htmlDataSbPos } if (htmlDataTheme) { o.theme = htmlDataTheme; _theme(o) } _pluginMarkup.call(this); if (d && o.callbacks.onCreate && typeof o.callbacks.onCreate === "function") { o.callbacks.onCreate.call(this) } $("#mCSB_" + d.idx + "_container img:not(." + classes[2] + ")").addClass(classes[2]); methods.update.call(null, $this) } }) }, update: function (el, cb) { var selector = el || _selector.call(this); return $(selector).each(function () { var $this = $(this); if ($this.data(pluginPfx)) { var d = $this.data(pluginPfx), o = d.opt, mCSB_container = $("#mCSB_" + d.idx + "_container"), mCustomScrollBox = $("#mCSB_" + d.idx), mCSB_dragger = [$("#mCSB_" + d.idx + "_dragger_vertical"), $("#mCSB_" + d.idx + "_dragger_horizontal")]; if (!mCSB_container.length) { return } if (d.tweenRunning) { _stop($this) } if (cb && d && o.callbacks.onBeforeUpdate && typeof o.callbacks.onBeforeUpdate === "function") { o.callbacks.onBeforeUpdate.call(this) } if ($this.hasClass(classes[3])) { $this.removeClass(classes[3]) } if ($this.hasClass(classes[4])) { $this.removeClass(classes[4]) } mCustomScrollBox.css("max-height", "none"); if (mCustomScrollBox.height() !== $this.height()) { mCustomScrollBox.css("max-height", $this.height()) } _expandContentHorizontally.call(this); if (o.axis !== "y" && !o.advanced.autoExpandHorizontalScroll) { mCSB_container.css("width", _contentWidth(mCSB_container)) } d.overflowed = _overflowed.call(this); _scrollbarVisibility.call(this); if (o.autoDraggerLength) { _setDraggerLength.call(this) } _scrollRatio.call(this); _bindEvents.call(this); var to = [Math.abs(mCSB_container[0].offsetTop), Math.abs(mCSB_container[0].offsetLeft)]; if (o.axis !== "x") { if (!d.overflowed[0]) { _resetContentPosition.call(this); if (o.axis === "y") { _unbindEvents.call(this) } else if (o.axis === "yx" && d.overflowed[1]) { _scrollTo($this, to[1].toString(), {dir: "x", dur: 0, overwrite: "none"}) } } else if (mCSB_dragger[0].height() > mCSB_dragger[0].parent().height()) { _resetContentPosition.call(this) } else { _scrollTo($this, to[0].toString(), {dir: "y", dur: 0, overwrite: "none"}); d.contentReset.y = null } } if (o.axis !== "y") { if (!d.overflowed[1]) { _resetContentPosition.call(this); if (o.axis === "x") { _unbindEvents.call(this) } else if (o.axis === "yx" && d.overflowed[0]) { _scrollTo($this, to[0].toString(), {dir: "y", dur: 0, overwrite: "none"}) } } else if (mCSB_dragger[1].width() > mCSB_dragger[1].parent().width()) { _resetContentPosition.call(this) } else { _scrollTo($this, to[1].toString(), {dir: "x", dur: 0, overwrite: "none"}); d.contentReset.x = null } } if (cb && d) { if (cb === 2 && o.callbacks.onImageLoad && typeof o.callbacks.onImageLoad === "function") { o.callbacks.onImageLoad.call(this) } else if (cb === 3 && o.callbacks.onSelectorChange && typeof o.callbacks.onSelectorChange === "function") { o.callbacks.onSelectorChange.call(this) } else if (o.callbacks.onUpdate && typeof o.callbacks.onUpdate === "function") { o.callbacks.onUpdate.call(this) } } _autoUpdate.call(this) } }) }, scrollTo: function (val, options) { if (typeof val == "undefined" || val == null) { return } var selector = _selector.call(this); return $(selector).each(function () { var $this = $(this); if ($this.data(pluginPfx)) { var d = $this.data(pluginPfx), o = d.opt, methodDefaults = { trigger: "external", scrollInertia: o.scrollInertia, scrollEasing: "mcsEaseInOut", moveDragger: !1, timeout: 60, callbacks: !0, onStart: !0, onUpdate: !0, onComplete: !0 }, methodOptions = $.extend(!0, {}, methodDefaults, options), to = _arr.call(this, val), dur = methodOptions.scrollInertia > 0 && methodOptions.scrollInertia < 17 ? 17 : methodOptions.scrollInertia; to[0] = _to.call(this, to[0], "y"); to[1] = _to.call(this, to[1], "x"); if (methodOptions.moveDragger) { to[0] *= d.scrollRatio.y; to[1] *= d.scrollRatio.x } methodOptions.dur = _isTabHidden() ? 0 : dur; setTimeout(function () { if (to[0] !== null && typeof to[0] !== "undefined" && o.axis !== "x" && d.overflowed[0]) { methodOptions.dir = "y"; methodOptions.overwrite = "all"; _scrollTo($this, to[0].toString(), methodOptions) } if (to[1] !== null && typeof to[1] !== "undefined" && o.axis !== "y" && d.overflowed[1]) { methodOptions.dir = "x"; methodOptions.overwrite = "none"; _scrollTo($this, to[1].toString(), methodOptions) } }, methodOptions.timeout) } }) }, stop: function () { var selector = _selector.call(this); return $(selector).each(function () { var $this = $(this); if ($this.data(pluginPfx)) { _stop($this) } }) }, disable: function (r) { var selector = _selector.call(this); return $(selector).each(function () { var $this = $(this); if ($this.data(pluginPfx)) { var d = $this.data(pluginPfx); _autoUpdate.call(this, "remove"); _unbindEvents.call(this); if (r) { _resetContentPosition.call(this) } _scrollbarVisibility.call(this, !0); $this.addClass(classes[3]) } }) }, destroy: function () { var selector = _selector.call(this); return $(selector).each(function () { var $this = $(this); if ($this.data(pluginPfx)) { var d = $this.data(pluginPfx), o = d.opt, mCustomScrollBox = $("#mCSB_" + d.idx), mCSB_container = $("#mCSB_" + d.idx + "_container"), scrollbar = $(".mCSB_" + d.idx + "_scrollbar"); if (o.live) { removeLiveTimers(o.liveSelector || $(selector).selector) } _autoUpdate.call(this, "remove"); _unbindEvents.call(this); _resetContentPosition.call(this); $this.removeData(pluginPfx); _delete(this, "mcs"); scrollbar.remove(); mCSB_container.find("img." + classes[2]).removeClass(classes[2]); mCustomScrollBox.replaceWith(mCSB_container.contents()); $this.removeClass(pluginNS + " _" + pluginPfx + "_" + d.idx + " " + classes[6] + " " + classes[7] + " " + classes[5] + " " + classes[3]).addClass(classes[4]) } }) } }, _selector = function () { return (typeof $(this) !== "object" || $(this).length < 1) ? defaultSelector : this }, _theme = function (obj) { var fixedSizeScrollbarThemes = ["rounded", "rounded-dark", "rounded-dots", "rounded-dots-dark"], nonExpandedScrollbarThemes = ["rounded-dots", "rounded-dots-dark", "3d", "3d-dark", "3d-thick", "3d-thick-dark", "inset", "inset-dark", "inset-2", "inset-2-dark", "inset-3", "inset-3-dark"], disabledScrollButtonsThemes = ["minimal", "minimal-dark"], enabledAutoHideScrollbarThemes = ["minimal", "minimal-dark"], scrollbarPositionOutsideThemes = ["minimal", "minimal-dark"]; obj.autoDraggerLength = $.inArray(obj.theme, fixedSizeScrollbarThemes) > -1 ? !1 : obj.autoDraggerLength; obj.autoExpandScrollbar = $.inArray(obj.theme, nonExpandedScrollbarThemes) > -1 ? !1 : obj.autoExpandScrollbar; obj.scrollButtons.enable = $.inArray(obj.theme, disabledScrollButtonsThemes) > -1 ? !1 : obj.scrollButtons.enable; obj.autoHideScrollbar = $.inArray(obj.theme, enabledAutoHideScrollbarThemes) > -1 ? !0 : obj.autoHideScrollbar; obj.scrollbarPosition = $.inArray(obj.theme, scrollbarPositionOutsideThemes) > -1 ? "outside" : obj.scrollbarPosition }, removeLiveTimers = function (selector) { if (liveTimers[selector]) { clearTimeout(liveTimers[selector]); _delete(liveTimers, selector) } }, _findAxis = function (val) { return (val === "yx" || val === "xy" || val === "auto") ? "yx" : (val === "x" || val === "horizontal") ? "x" : "y" }, _findScrollButtonsType = function (val) { return (val === "stepped" || val === "pixels" || val === "step" || val === "click") ? "stepped" : "stepless" }, _pluginMarkup = function () { var $this = $(this), d = $this.data(pluginPfx), o = d.opt, expandClass = o.autoExpandScrollbar ? " " + classes[1] + "_expand" : "", scrollbar = ["
    ", "
    "], wrapperClass = o.axis === "yx" ? "mCSB_vertical_horizontal" : o.axis === "x" ? "mCSB_horizontal" : "mCSB_vertical", scrollbars = o.axis === "yx" ? scrollbar[0] + scrollbar[1] : o.axis === "x" ? scrollbar[1] : scrollbar[0], contentWrapper = o.axis === "yx" ? "
    " : "", autoHideClass = o.autoHideScrollbar ? " " + classes[6] : "", scrollbarDirClass = (o.axis !== "x" && d.langDir === "rtl") ? " " + classes[7] : ""; if (o.setWidth) { $this.css("width", o.setWidth) } if (o.setHeight) { $this.css("height", o.setHeight) } o.setLeft = (o.axis !== "y" && d.langDir === "rtl") ? "989999px" : o.setLeft; $this.addClass(pluginNS + " _" + pluginPfx + "_" + d.idx + autoHideClass + scrollbarDirClass).wrapInner("
    "); var mCustomScrollBox = $("#mCSB_" + d.idx), mCSB_container = $("#mCSB_" + d.idx + "_container"); if (o.axis !== "y" && !o.advanced.autoExpandHorizontalScroll) { mCSB_container.css("width", _contentWidth(mCSB_container)) } if (o.scrollbarPosition === "outside") { if ($this.css("position") === "static") { $this.css("position", "relative") } $this.css("overflow", "visible"); mCustomScrollBox.addClass("mCSB_outside").after(scrollbars) } else { mCustomScrollBox.addClass("mCSB_inside").append(scrollbars); mCSB_container.wrap(contentWrapper) } _scrollButtons.call(this); var mCSB_dragger = [$("#mCSB_" + d.idx + "_dragger_vertical"), $("#mCSB_" + d.idx + "_dragger_horizontal")]; mCSB_dragger[0].css("min-height", mCSB_dragger[0].height()); mCSB_dragger[1].css("min-width", mCSB_dragger[1].width()) }, _contentWidth = function (el) { var val = [el[0].scrollWidth, Math.max.apply(Math, el.children().map(function () { return $(this).outerWidth(!0) }).get())], w = el.parent().width(); return val[0] > w ? val[0] : val[1] > w ? val[1] : "100%" }, _expandContentHorizontally = function () { var $this = $(this), d = $this.data(pluginPfx), o = d.opt, mCSB_container = $("#mCSB_" + d.idx + "_container"); if (o.advanced.autoExpandHorizontalScroll && o.axis !== "y") { mCSB_container.css({"width": "auto", "min-width": 0, "overflow-x": "scroll"}); var w = Math.ceil(mCSB_container[0].scrollWidth); if (o.advanced.autoExpandHorizontalScroll === 3 || (o.advanced.autoExpandHorizontalScroll !== 2 && w > mCSB_container.parent().width())) { mCSB_container.css({"width": w, "min-width": "100%", "overflow-x": "inherit"}) } else { mCSB_container.css({ "overflow-x": "inherit", "position": "absolute" }).wrap("
    ").css({ "width": (Math.ceil(mCSB_container[0].getBoundingClientRect().right + 0.4) - Math.floor(mCSB_container[0].getBoundingClientRect().left)), "min-width": "100%", "position": "relative" }).unwrap() } } }, _scrollButtons = function () { var $this = $(this), d = $this.data(pluginPfx), o = d.opt, mCSB_scrollTools = $(".mCSB_" + d.idx + "_scrollbar:first"), tabindex = !_isNumeric(o.scrollButtons.tabindex) ? "" : "tabindex='" + o.scrollButtons.tabindex + "'", btnHTML = ["", "", "", ""], btn = [(o.axis === "x" ? btnHTML[2] : btnHTML[0]), (o.axis === "x" ? btnHTML[3] : btnHTML[1]), btnHTML[2], btnHTML[3]]; if (o.scrollButtons.enable) { mCSB_scrollTools.prepend(btn[0]).append(btn[1]).next(".mCSB_scrollTools").prepend(btn[2]).append(btn[3]) } }, _setDraggerLength = function () { var $this = $(this), d = $this.data(pluginPfx), mCustomScrollBox = $("#mCSB_" + d.idx), mCSB_container = $("#mCSB_" + d.idx + "_container"), mCSB_dragger = [$("#mCSB_" + d.idx + "_dragger_vertical"), $("#mCSB_" + d.idx + "_dragger_horizontal")], ratio = [mCustomScrollBox.height() / mCSB_container.outerHeight(!1), mCustomScrollBox.width() / mCSB_container.outerWidth(!1)], l = [parseInt(mCSB_dragger[0].css("min-height")), Math.round(ratio[0] * mCSB_dragger[0].parent().height()), parseInt(mCSB_dragger[1].css("min-width")), Math.round(ratio[1] * mCSB_dragger[1].parent().width())], h = oldIE && (l[1] < l[0]) ? l[0] : l[1], w = oldIE && (l[3] < l[2]) ? l[2] : l[3]; mCSB_dragger[0].css({ "height": h, "max-height": (mCSB_dragger[0].parent().height() - 10) }).find(".mCSB_dragger_bar").css({"line-height": l[0] + "px"}); mCSB_dragger[1].css({"width": w, "max-width": (mCSB_dragger[1].parent().width() - 10)}) }, _scrollRatio = function () { var $this = $(this), d = $this.data(pluginPfx), mCustomScrollBox = $("#mCSB_" + d.idx), mCSB_container = $("#mCSB_" + d.idx + "_container"), mCSB_dragger = [$("#mCSB_" + d.idx + "_dragger_vertical"), $("#mCSB_" + d.idx + "_dragger_horizontal")], scrollAmount = [mCSB_container.outerHeight(!1) - mCustomScrollBox.height(), mCSB_container.outerWidth(!1) - mCustomScrollBox.width()], ratio = [scrollAmount[0] / (mCSB_dragger[0].parent().height() - mCSB_dragger[0].height()), scrollAmount[1] / (mCSB_dragger[1].parent().width() - mCSB_dragger[1].width())]; d.scrollRatio = {y: ratio[0], x: ratio[1]} }, _onDragClasses = function (el, action, xpnd) { var expandClass = xpnd ? classes[0] + "_expanded" : "", scrollbar = el.closest(".mCSB_scrollTools"); if (action === "active") { el.toggleClass(classes[0] + " " + expandClass); scrollbar.toggleClass(classes[1]); el[0]._draggable = el[0]._draggable ? 0 : 1 } else { if (!el[0]._draggable) { if (action === "hide") { el.removeClass(classes[0]); scrollbar.removeClass(classes[1]) } else { el.addClass(classes[0]); scrollbar.addClass(classes[1]) } } } }, _overflowed = function () { var $this = $(this), d = $this.data(pluginPfx), mCustomScrollBox = $("#mCSB_" + d.idx), mCSB_container = $("#mCSB_" + d.idx + "_container"), contentHeight = d.overflowed == null ? mCSB_container.height() : mCSB_container.outerHeight(!1), contentWidth = d.overflowed == null ? mCSB_container.width() : mCSB_container.outerWidth(!1), h = mCSB_container[0].scrollHeight, w = mCSB_container[0].scrollWidth; if (h > contentHeight) { contentHeight = h } if (w > contentWidth) { contentWidth = w } return [contentHeight > mCustomScrollBox.height(), contentWidth > mCustomScrollBox.width()] }, _resetContentPosition = function () { var $this = $(this), d = $this.data(pluginPfx), o = d.opt, mCustomScrollBox = $("#mCSB_" + d.idx), mCSB_container = $("#mCSB_" + d.idx + "_container"), mCSB_dragger = [$("#mCSB_" + d.idx + "_dragger_vertical"), $("#mCSB_" + d.idx + "_dragger_horizontal")]; _stop($this); if ((o.axis !== "x" && !d.overflowed[0]) || (o.axis === "y" && d.overflowed[0])) { mCSB_dragger[0].add(mCSB_container).css("top", 0); _scrollTo($this, "_resetY") } if ((o.axis !== "y" && !d.overflowed[1]) || (o.axis === "x" && d.overflowed[1])) { var cx = dx = 0; if (d.langDir === "rtl") { cx = mCustomScrollBox.width() - mCSB_container.outerWidth(!1); dx = Math.abs(cx / d.scrollRatio.x) } mCSB_container.css("left", cx); mCSB_dragger[1].css("left", dx); _scrollTo($this, "_resetX") } }, _bindEvents = function () { var $this = $(this), d = $this.data(pluginPfx), o = d.opt; if (!d.bindEvents) { _draggable.call(this); if (o.contentTouchScroll) { _contentDraggable.call(this) } _selectable.call(this); if (o.mouseWheel.enable) { function _mwt() { mousewheelTimeout = setTimeout(function () { if (!$.event.special.mousewheel) { _mwt() } else { clearTimeout(mousewheelTimeout); _mousewheel.call($this[0]) } }, 100) } var mousewheelTimeout; _mwt() } _draggerRail.call(this); _wrapperScroll.call(this); if (o.advanced.autoScrollOnFocus) { _focus.call(this) } if (o.scrollButtons.enable) { _buttons.call(this) } if (o.keyboard.enable) { _keyboard.call(this) } d.bindEvents = !0 } }, _unbindEvents = function () { var $this = $(this), d = $this.data(pluginPfx), o = d.opt, namespace = pluginPfx + "_" + d.idx, sb = ".mCSB_" + d.idx + "_scrollbar", sel = $("#mCSB_" + d.idx + ",#mCSB_" + d.idx + "_container,#mCSB_" + d.idx + "_container_wrapper," + sb + " ." + classes[12] + ",#mCSB_" + d.idx + "_dragger_vertical,#mCSB_" + d.idx + "_dragger_horizontal," + sb + ">a"), mCSB_container = $("#mCSB_" + d.idx + "_container"); if (o.advanced.releaseDraggableSelectors) { sel.add($(o.advanced.releaseDraggableSelectors)) } if (o.advanced.extraDraggableSelectors) { sel.add($(o.advanced.extraDraggableSelectors)) } if (d.bindEvents) { $(document).add($(!_canAccessIFrame() || top.document)).unbind("." + namespace); sel.each(function () { $(this).unbind("." + namespace) }); clearTimeout($this[0]._focusTimeout); _delete($this[0], "_focusTimeout"); clearTimeout(d.sequential.step); _delete(d.sequential, "step"); clearTimeout(mCSB_container[0].onCompleteTimeout); _delete(mCSB_container[0], "onCompleteTimeout"); d.bindEvents = !1 } }, _scrollbarVisibility = function (disabled) { var $this = $(this), d = $this.data(pluginPfx), o = d.opt, contentWrapper = $("#mCSB_" + d.idx + "_container_wrapper"), content = contentWrapper.length ? contentWrapper : $("#mCSB_" + d.idx + "_container"), scrollbar = [$("#mCSB_" + d.idx + "_scrollbar_vertical"), $("#mCSB_" + d.idx + "_scrollbar_horizontal")], mCSB_dragger = [scrollbar[0].find(".mCSB_dragger"), scrollbar[1].find(".mCSB_dragger")]; if (o.axis !== "x") { if (d.overflowed[0] && !disabled) { scrollbar[0].add(mCSB_dragger[0]).add(scrollbar[0].children("a")).css("display", "block"); content.removeClass(classes[8] + " " + classes[10]) } else { if (o.alwaysShowScrollbar) { if (o.alwaysShowScrollbar !== 2) { mCSB_dragger[0].css("display", "none") } content.removeClass(classes[10]) } else { scrollbar[0].css("display", "none"); content.addClass(classes[10]) } content.addClass(classes[8]) } } if (o.axis !== "y") { if (d.overflowed[1] && !disabled) { scrollbar[1].add(mCSB_dragger[1]).add(scrollbar[1].children("a")).css("display", "block"); content.removeClass(classes[9] + " " + classes[11]) } else { if (o.alwaysShowScrollbar) { if (o.alwaysShowScrollbar !== 2) { mCSB_dragger[1].css("display", "none") } content.removeClass(classes[11]) } else { scrollbar[1].css("display", "none"); content.addClass(classes[11]) } content.addClass(classes[9]) } } if (!d.overflowed[0] && !d.overflowed[1]) { $this.addClass(classes[5]) } else { $this.removeClass(classes[5]) } }, _coordinates = function (e) { var t = e.type, o = e.target.ownerDocument !== document && frameElement !== null ? [$(frameElement).offset().top, $(frameElement).offset().left] : null, io = _canAccessIFrame() && e.target.ownerDocument !== top.document && frameElement !== null ? [$(e.view.frameElement).offset().top, $(e.view.frameElement).offset().left] : [0, 0]; switch (t) { case "pointerdown": case "MSPointerDown": case "pointermove": case "MSPointerMove": case "pointerup": case "MSPointerUp": return o ? [e.originalEvent.pageY - o[0] + io[0], e.originalEvent.pageX - o[1] + io[1], !1] : [e.originalEvent.pageY, e.originalEvent.pageX, !1]; break; case "touchstart": case "touchmove": case "touchend": var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0], touches = e.originalEvent.touches.length || e.originalEvent.changedTouches.length; return e.target.ownerDocument !== document ? [touch.screenY, touch.screenX, touches > 1] : [touch.pageY, touch.pageX, touches > 1]; break; default: return o ? [e.pageY - o[0] + io[0], e.pageX - o[1] + io[1], !1] : [e.pageY, e.pageX, !1] } }, _draggable = function () { var $this = $(this), d = $this.data(pluginPfx), o = d.opt, namespace = pluginPfx + "_" + d.idx, draggerId = ["mCSB_" + d.idx + "_dragger_vertical", "mCSB_" + d.idx + "_dragger_horizontal"], mCSB_container = $("#mCSB_" + d.idx + "_container"), mCSB_dragger = $("#" + draggerId[0] + ",#" + draggerId[1]), draggable, dragY, dragX, rds = o.advanced.releaseDraggableSelectors ? mCSB_dragger.add($(o.advanced.releaseDraggableSelectors)) : mCSB_dragger, eds = o.advanced.extraDraggableSelectors ? $(!_canAccessIFrame() || top.document).add($(o.advanced.extraDraggableSelectors)) : $(!_canAccessIFrame() || top.document); mCSB_dragger.bind("contextmenu." + namespace, function (e) { e.preventDefault() }).bind("mousedown." + namespace + " touchstart." + namespace + " pointerdown." + namespace + " MSPointerDown." + namespace, function (e) { e.stopImmediatePropagation(); e.preventDefault(); if (!_mouseBtnLeft(e)) { return } touchActive = !0; if (oldIE) { document.onselectstart = function () { return !1 } } _iframe.call(mCSB_container, !1); _stop($this); draggable = $(this); var offset = draggable.offset(), y = _coordinates(e)[0] - offset.top, x = _coordinates(e)[1] - offset.left, h = draggable.height() + offset.top, w = draggable.width() + offset.left; if (y < h && y > 0 && x < w && x > 0) { dragY = y; dragX = x } _onDragClasses(draggable, "active", o.autoExpandScrollbar) }).bind("touchmove." + namespace, function (e) { e.stopImmediatePropagation(); e.preventDefault(); var offset = draggable.offset(), y = _coordinates(e)[0] - offset.top, x = _coordinates(e)[1] - offset.left; _drag(dragY, dragX, y, x) }); $(document).add(eds).bind("mousemove." + namespace + " pointermove." + namespace + " MSPointerMove." + namespace, function (e) { if (draggable) { var offset = draggable.offset(), y = _coordinates(e)[0] - offset.top, x = _coordinates(e)[1] - offset.left; if (dragY === y && dragX === x) { return } _drag(dragY, dragX, y, x) } }).add(rds).bind("mouseup." + namespace + " touchend." + namespace + " pointerup." + namespace + " MSPointerUp." + namespace, function (e) { if (draggable) { _onDragClasses(draggable, "active", o.autoExpandScrollbar); draggable = null } touchActive = !1; if (oldIE) { document.onselectstart = null } _iframe.call(mCSB_container, !0) }); function _drag(dragY, dragX, y, x) { mCSB_container[0].idleTimer = o.scrollInertia < 233 ? 250 : 0; if (draggable.attr("id") === draggerId[1]) { var dir = "x", to = ((draggable[0].offsetLeft - dragX) + x) * d.scrollRatio.x } else { var dir = "y", to = ((draggable[0].offsetTop - dragY) + y) * d.scrollRatio.y } _scrollTo($this, to.toString(), {dir: dir, drag: !0}) } }, _contentDraggable = function () { var $this = $(this), d = $this.data(pluginPfx), o = d.opt, namespace = pluginPfx + "_" + d.idx, mCustomScrollBox = $("#mCSB_" + d.idx), mCSB_container = $("#mCSB_" + d.idx + "_container"), mCSB_dragger = [$("#mCSB_" + d.idx + "_dragger_vertical"), $("#mCSB_" + d.idx + "_dragger_horizontal")], draggable, dragY, dragX, touchStartY, touchStartX, touchMoveY = [], touchMoveX = [], startTime, runningTime, endTime, distance, speed, amount, durA = 0, durB, overwrite = o.axis === "yx" ? "none" : "all", touchIntent = [], touchDrag, docDrag, iframe = mCSB_container.find("iframe"), events = ["touchstart." + namespace + " pointerdown." + namespace + " MSPointerDown." + namespace, "touchmove." + namespace + " pointermove." + namespace + " MSPointerMove." + namespace, "touchend." + namespace + " pointerup." + namespace + " MSPointerUp." + namespace], touchAction = document.body.style.touchAction !== undefined && document.body.style.touchAction !== ""; mCSB_container.bind(events[0], function (e) { _onTouchstart(e) }).bind(events[1], function (e) { _onTouchmove(e) }); mCustomScrollBox.bind(events[0], function (e) { _onTouchstart2(e) }).bind(events[2], function (e) { _onTouchend(e) }); if (iframe.length) { iframe.each(function () { $(this).bind("load", function () { if (_canAccessIFrame(this)) { $(this.contentDocument || this.contentWindow.document).bind(events[0], function (e) { _onTouchstart(e); _onTouchstart2(e) }).bind(events[1], function (e) { _onTouchmove(e) }).bind(events[2], function (e) { _onTouchend(e) }) } }) }) } function _onTouchstart(e) { if (!_pointerTouch(e) || touchActive || _coordinates(e)[2]) { touchable = 0; return } touchable = 1; touchDrag = 0; docDrag = 0; draggable = 1; $this.removeClass("mCS_touch_action"); var offset = mCSB_container.offset(); dragY = _coordinates(e)[0] - offset.top; dragX = _coordinates(e)[1] - offset.left; touchIntent = [_coordinates(e)[0], _coordinates(e)[1]] } function _onTouchmove(e) { if (!_pointerTouch(e) || touchActive || _coordinates(e)[2]) { return } if (!o.documentTouchScroll) { e.preventDefault() } e.stopImmediatePropagation(); if (docDrag && !touchDrag) { return } if (draggable) { runningTime = _getTime(); var offset = mCustomScrollBox.offset(), y = _coordinates(e)[0] - offset.top, x = _coordinates(e)[1] - offset.left, easing = "mcsLinearOut"; touchMoveY.push(y); touchMoveX.push(x); touchIntent[2] = Math.abs(_coordinates(e)[0] - touchIntent[0]); touchIntent[3] = Math.abs(_coordinates(e)[1] - touchIntent[1]); if (d.overflowed[0]) { var limit = mCSB_dragger[0].parent().height() - mCSB_dragger[0].height(), prevent = ((dragY - y) > 0 && (y - dragY) > -(limit * d.scrollRatio.y) && (touchIntent[3] * 2 < touchIntent[2] || o.axis === "yx")) } if (d.overflowed[1]) { var limitX = mCSB_dragger[1].parent().width() - mCSB_dragger[1].width(), preventX = ((dragX - x) > 0 && (x - dragX) > -(limitX * d.scrollRatio.x) && (touchIntent[2] * 2 < touchIntent[3] || o.axis === "yx")) } if (prevent || preventX) { if (!touchAction) { e.preventDefault() } touchDrag = 1 } else { docDrag = 1; $this.addClass("mCS_touch_action") } if (touchAction) { e.preventDefault() } amount = o.axis === "yx" ? [(dragY - y), (dragX - x)] : o.axis === "x" ? [null, (dragX - x)] : [(dragY - y), null]; mCSB_container[0].idleTimer = 250; if (d.overflowed[0]) { _drag(amount[0], durA, easing, "y", "all", !0) } if (d.overflowed[1]) { _drag(amount[1], durA, easing, "x", overwrite, !0) } } } function _onTouchstart2(e) { if (!_pointerTouch(e) || touchActive || _coordinates(e)[2]) { touchable = 0; return } touchable = 1; e.stopImmediatePropagation(); _stop($this); startTime = _getTime(); var offset = mCustomScrollBox.offset(); touchStartY = _coordinates(e)[0] - offset.top; touchStartX = _coordinates(e)[1] - offset.left; touchMoveY = []; touchMoveX = [] } function _onTouchend(e) { if (!_pointerTouch(e) || touchActive || _coordinates(e)[2]) { return } draggable = 0; e.stopImmediatePropagation(); touchDrag = 0; docDrag = 0; endTime = _getTime(); var offset = mCustomScrollBox.offset(), y = _coordinates(e)[0] - offset.top, x = _coordinates(e)[1] - offset.left; if ((endTime - runningTime) > 30) { return } speed = 1000 / (endTime - startTime); var easing = "mcsEaseOut", slow = speed < 2.5, diff = slow ? [touchMoveY[touchMoveY.length - 2], touchMoveX[touchMoveX.length - 2]] : [0, 0]; distance = slow ? [(y - diff[0]), (x - diff[1])] : [y - touchStartY, x - touchStartX]; var absDistance = [Math.abs(distance[0]), Math.abs(distance[1])]; speed = slow ? [Math.abs(distance[0] / 4), Math.abs(distance[1] / 4)] : [speed, speed]; var a = [Math.abs(mCSB_container[0].offsetTop) - (distance[0] * _m((absDistance[0] / speed[0]), speed[0])), Math.abs(mCSB_container[0].offsetLeft) - (distance[1] * _m((absDistance[1] / speed[1]), speed[1]))]; amount = o.axis === "yx" ? [a[0], a[1]] : o.axis === "x" ? [null, a[1]] : [a[0], null]; durB = [(absDistance[0] * 4) + o.scrollInertia, (absDistance[1] * 4) + o.scrollInertia]; var md = parseInt(o.contentTouchScroll) || 0; amount[0] = absDistance[0] > md ? amount[0] : 0; amount[1] = absDistance[1] > md ? amount[1] : 0; if (d.overflowed[0]) { _drag(amount[0], durB[0], easing, "y", overwrite, !1) } if (d.overflowed[1]) { _drag(amount[1], durB[1], easing, "x", overwrite, !1) } } function _m(ds, s) { var r = [s * 1.5, s * 2, s / 1.5, s / 2]; if (ds > 90) { return s > 4 ? r[0] : r[3] } else if (ds > 60) { return s > 3 ? r[3] : r[2] } else if (ds > 30) { return s > 8 ? r[1] : s > 6 ? r[0] : s > 4 ? s : r[2] } else { return s > 8 ? s : r[3] } } function _drag(amount, dur, easing, dir, overwrite, drag) { if (!amount) { return } _scrollTo($this, amount.toString(), { dur: dur, scrollEasing: easing, dir: dir, overwrite: overwrite, drag: drag }) } }, _selectable = function () { var $this = $(this), d = $this.data(pluginPfx), o = d.opt, seq = d.sequential, namespace = pluginPfx + "_" + d.idx, mCSB_container = $("#mCSB_" + d.idx + "_container"), wrapper = mCSB_container.parent(), action; mCSB_container.bind("mousedown." + namespace, function (e) { if (touchable) { return } if (!action) { action = 1; touchActive = !0 } }).add(document).bind("mousemove." + namespace, function (e) { if (!touchable && action && _sel()) { var offset = mCSB_container.offset(), y = _coordinates(e)[0] - offset.top + mCSB_container[0].offsetTop, x = _coordinates(e)[1] - offset.left + mCSB_container[0].offsetLeft; if (y > 0 && y < wrapper.height() && x > 0 && x < wrapper.width()) { if (seq.step) { _seq("off", null, "stepped") } } else { if (o.axis !== "x" && d.overflowed[0]) { if (y < 0) { _seq("on", 38) } else if (y > wrapper.height()) { _seq("on", 40) } } if (o.axis !== "y" && d.overflowed[1]) { if (x < 0) { _seq("on", 37) } else if (x > wrapper.width()) { _seq("on", 39) } } } } }).bind("mouseup." + namespace + " dragend." + namespace, function (e) { if (touchable) { return } if (action) { action = 0; _seq("off", null) } touchActive = !1 }); function _sel() { return window.getSelection ? window.getSelection().toString() : document.selection && document.selection.type != "Control" ? document.selection.createRange().text : 0 } function _seq(a, c, s) { seq.type = s && action ? "stepped" : "stepless"; seq.scrollAmount = 10; _sequentialScroll($this, a, c, "mcsLinearOut", s ? 60 : null) } }, _mousewheel = function () { if (!$(this).data(pluginPfx)) { return } var $this = $(this), d = $this.data(pluginPfx), o = d.opt, namespace = pluginPfx + "_" + d.idx, mCustomScrollBox = $("#mCSB_" + d.idx), mCSB_dragger = [$("#mCSB_" + d.idx + "_dragger_vertical"), $("#mCSB_" + d.idx + "_dragger_horizontal")], iframe = $("#mCSB_" + d.idx + "_container").find("iframe"); if (iframe.length) { iframe.each(function () { $(this).bind("load", function () { if (_canAccessIFrame(this)) { $(this.contentDocument || this.contentWindow.document).bind("mousewheel." + namespace, function (e, delta) { _onMousewheel(e, delta) }) } }) }) } mCustomScrollBox.bind("mousewheel." + namespace, function (e, delta) { _onMousewheel(e, delta) }); function _onMousewheel(e, delta) { _stop($this); if (_disableMousewheel($this, e.target)) { return } var deltaFactor = o.mouseWheel.deltaFactor !== "auto" ? parseInt(o.mouseWheel.deltaFactor) : (oldIE && e.deltaFactor < 100) ? 100 : e.deltaFactor || 100, dur = o.scrollInertia; if (o.axis === "x" || o.mouseWheel.axis === "x") { var dir = "x", px = [Math.round(deltaFactor * d.scrollRatio.x), parseInt(o.mouseWheel.scrollAmount)], amount = o.mouseWheel.scrollAmount !== "auto" ? px[1] : px[0] >= mCustomScrollBox.width() ? mCustomScrollBox.width() * 0.9 : px[0], contentPos = Math.abs($("#mCSB_" + d.idx + "_container")[0].offsetLeft), draggerPos = mCSB_dragger[1][0].offsetLeft, limit = mCSB_dragger[1].parent().width() - mCSB_dragger[1].width(), dlt = o.mouseWheel.axis === "y" ? (e.deltaY || delta) : e.deltaX } else { var dir = "y", px = [Math.round(deltaFactor * d.scrollRatio.y), parseInt(o.mouseWheel.scrollAmount)], amount = o.mouseWheel.scrollAmount !== "auto" ? px[1] : px[0] >= mCustomScrollBox.height() ? mCustomScrollBox.height() * 0.9 : px[0], contentPos = Math.abs($("#mCSB_" + d.idx + "_container")[0].offsetTop), draggerPos = mCSB_dragger[0][0].offsetTop, limit = mCSB_dragger[0].parent().height() - mCSB_dragger[0].height(), dlt = e.deltaY || delta } if ((dir === "y" && !d.overflowed[0]) || (dir === "x" && !d.overflowed[1])) { return } if (o.mouseWheel.invert || e.webkitDirectionInvertedFromDevice) { dlt = -dlt } if (o.mouseWheel.normalizeDelta) { dlt = dlt < 0 ? -1 : 1 } if ((dlt > 0 && draggerPos !== 0) || (dlt < 0 && draggerPos !== limit) || o.mouseWheel.preventDefault) { e.stopImmediatePropagation(); e.preventDefault() } if (e.deltaFactor < 5 && !o.mouseWheel.normalizeDelta) { amount = e.deltaFactor; dur = 17 } _scrollTo($this, (contentPos - (dlt * amount)).toString(), {dir: dir, dur: dur}) } }, _canAccessIFrameCache = new Object(), _canAccessIFrame = function (iframe) { var result = !1, cacheKey = !1, html = null; if (iframe === undefined) { cacheKey = "#empty" } else if ($(iframe).attr("id") !== undefined) { cacheKey = $(iframe).attr("id") } if (cacheKey !== !1 && _canAccessIFrameCache[cacheKey] !== undefined) { return _canAccessIFrameCache[cacheKey] } if (!iframe) { try { var doc = top.document; html = doc.body.innerHTML } catch (err) { } result = (html !== null) } else { try { var doc = iframe.contentDocument || iframe.contentWindow.document; html = doc.body.innerHTML } catch (err) { } result = (html !== null) } if (cacheKey !== !1) { _canAccessIFrameCache[cacheKey] = result } return result }, _iframe = function (evt) { var el = this.find("iframe"); if (!el.length) { return } var val = !evt ? "none" : "auto"; el.css("pointer-events", val) }, _disableMousewheel = function (el, target) { var tag = target.nodeName.toLowerCase(), tags = el.data(pluginPfx).opt.mouseWheel.disableOver, focusTags = ["select", "textarea"]; return $.inArray(tag, tags) > -1 && !($.inArray(tag, focusTags) > -1 && !$(target).is(":focus")) }, _draggerRail = function () { var $this = $(this), d = $this.data(pluginPfx), namespace = pluginPfx + "_" + d.idx, mCSB_container = $("#mCSB_" + d.idx + "_container"), wrapper = mCSB_container.parent(), mCSB_draggerContainer = $(".mCSB_" + d.idx + "_scrollbar ." + classes[12]), clickable; mCSB_draggerContainer.bind("mousedown." + namespace + " touchstart." + namespace + " pointerdown." + namespace + " MSPointerDown." + namespace, function (e) { touchActive = !0; if (!$(e.target).hasClass("mCSB_dragger")) { clickable = 1 } }).bind("touchend." + namespace + " pointerup." + namespace + " MSPointerUp." + namespace, function (e) { touchActive = !1 }).bind("click." + namespace, function (e) { if (!clickable) { return } clickable = 0; if ($(e.target).hasClass(classes[12]) || $(e.target).hasClass("mCSB_draggerRail")) { _stop($this); var el = $(this), mCSB_dragger = el.find(".mCSB_dragger"); if (el.parent(".mCSB_scrollTools_horizontal").length > 0) { if (!d.overflowed[1]) { return } var dir = "x", clickDir = e.pageX > mCSB_dragger.offset().left ? -1 : 1, to = Math.abs(mCSB_container[0].offsetLeft) - (clickDir * (wrapper.width() * 0.9)) } else { if (!d.overflowed[0]) { return } var dir = "y", clickDir = e.pageY > mCSB_dragger.offset().top ? -1 : 1, to = Math.abs(mCSB_container[0].offsetTop) - (clickDir * (wrapper.height() * 0.9)) } _scrollTo($this, to.toString(), {dir: dir, scrollEasing: "mcsEaseInOut"}) } }) }, _focus = function () { var $this = $(this), d = $this.data(pluginPfx), o = d.opt, namespace = pluginPfx + "_" + d.idx, mCSB_container = $("#mCSB_" + d.idx + "_container"), wrapper = mCSB_container.parent(); mCSB_container.bind("focusin." + namespace, function (e) { var el = $(document.activeElement), nested = mCSB_container.find(".mCustomScrollBox").length, dur = 0; if (!el.is(o.advanced.autoScrollOnFocus)) { return } _stop($this); clearTimeout($this[0]._focusTimeout); $this[0]._focusTimer = nested ? (dur + 17) * nested : 0; $this[0]._focusTimeout = setTimeout(function () { var to = [_childPos(el)[0], _childPos(el)[1]], contentPos = [mCSB_container[0].offsetTop, mCSB_container[0].offsetLeft], isVisible = [(contentPos[0] + to[0] >= 0 && contentPos[0] + to[0] < wrapper.height() - el.outerHeight(!1)), (contentPos[1] + to[1] >= 0 && contentPos[0] + to[1] < wrapper.width() - el.outerWidth(!1))], overwrite = (o.axis === "yx" && !isVisible[0] && !isVisible[1]) ? "none" : "all"; if (o.axis !== "x" && !isVisible[0]) { _scrollTo($this, to[0].toString(), { dir: "y", scrollEasing: "mcsEaseInOut", overwrite: overwrite, dur: dur }) } if (o.axis !== "y" && !isVisible[1]) { _scrollTo($this, to[1].toString(), { dir: "x", scrollEasing: "mcsEaseInOut", overwrite: overwrite, dur: dur }) } }, $this[0]._focusTimer) }) }, _wrapperScroll = function () { var $this = $(this), d = $this.data(pluginPfx), namespace = pluginPfx + "_" + d.idx, wrapper = $("#mCSB_" + d.idx + "_container").parent(); wrapper.bind("scroll." + namespace, function (e) { if (wrapper.scrollTop() !== 0 || wrapper.scrollLeft() !== 0) { $(".mCSB_" + d.idx + "_scrollbar").css("visibility", "hidden") } }) }, _buttons = function () { var $this = $(this), d = $this.data(pluginPfx), o = d.opt, seq = d.sequential, namespace = pluginPfx + "_" + d.idx, sel = ".mCSB_" + d.idx + "_scrollbar", btn = $(sel + ">a"); btn.bind("contextmenu." + namespace, function (e) { e.preventDefault() }).bind("mousedown." + namespace + " touchstart." + namespace + " pointerdown." + namespace + " MSPointerDown." + namespace + " mouseup." + namespace + " touchend." + namespace + " pointerup." + namespace + " MSPointerUp." + namespace + " mouseout." + namespace + " pointerout." + namespace + " MSPointerOut." + namespace + " click." + namespace, function (e) { e.preventDefault(); if (!_mouseBtnLeft(e)) { return } var btnClass = $(this).attr("class"); seq.type = o.scrollButtons.scrollType; switch (e.type) { case "mousedown": case "touchstart": case "pointerdown": case "MSPointerDown": if (seq.type === "stepped") { return } touchActive = !0; d.tweenRunning = !1; _seq("on", btnClass); break; case "mouseup": case "touchend": case "pointerup": case "MSPointerUp": case "mouseout": case "pointerout": case "MSPointerOut": if (seq.type === "stepped") { return } touchActive = !1; if (seq.dir) { _seq("off", btnClass) } break; case "click": if (seq.type !== "stepped" || d.tweenRunning) { return } _seq("on", btnClass); break } function _seq(a, c) { seq.scrollAmount = o.scrollButtons.scrollAmount; _sequentialScroll($this, a, c) } }) }, _keyboard = function () { var $this = $(this), d = $this.data(pluginPfx), o = d.opt, seq = d.sequential, namespace = pluginPfx + "_" + d.idx, mCustomScrollBox = $("#mCSB_" + d.idx), mCSB_container = $("#mCSB_" + d.idx + "_container"), wrapper = mCSB_container.parent(), editables = "input,textarea,select,datalist,keygen,[contenteditable='true']", iframe = mCSB_container.find("iframe"), events = ["blur." + namespace + " keydown." + namespace + " keyup." + namespace]; if (iframe.length) { iframe.each(function () { $(this).bind("load", function () { if (_canAccessIFrame(this)) { $(this.contentDocument || this.contentWindow.document).bind(events[0], function (e) { _onKeyboard(e) }) } }) }) } mCustomScrollBox.attr("tabindex", "0").bind(events[0], function (e) { _onKeyboard(e) }); function _onKeyboard(e) { switch (e.type) { case "blur": if (d.tweenRunning && seq.dir) { _seq("off", null) } break; case "keydown": case "keyup": var code = e.keyCode ? e.keyCode : e.which, action = "on"; if ((o.axis !== "x" && (code === 38 || code === 40)) || (o.axis !== "y" && (code === 37 || code === 39))) { if (((code === 38 || code === 40) && !d.overflowed[0]) || ((code === 37 || code === 39) && !d.overflowed[1])) { return } if (e.type === "keyup") { action = "off" } if (!$(document.activeElement).is(editables)) { e.preventDefault(); e.stopImmediatePropagation(); _seq(action, code) } } else if (code === 33 || code === 34) { if (d.overflowed[0] || d.overflowed[1]) { e.preventDefault(); e.stopImmediatePropagation() } if (e.type === "keyup") { _stop($this); var keyboardDir = code === 34 ? -1 : 1; if (o.axis === "x" || (o.axis === "yx" && d.overflowed[1] && !d.overflowed[0])) { var dir = "x", to = Math.abs(mCSB_container[0].offsetLeft) - (keyboardDir * (wrapper.width() * 0.9)) } else { var dir = "y", to = Math.abs(mCSB_container[0].offsetTop) - (keyboardDir * (wrapper.height() * 0.9)) } _scrollTo($this, to.toString(), {dir: dir, scrollEasing: "mcsEaseInOut"}) } } else if (code === 35 || code === 36) { if (!$(document.activeElement).is(editables)) { if (d.overflowed[0] || d.overflowed[1]) { e.preventDefault(); e.stopImmediatePropagation() } if (e.type === "keyup") { if (o.axis === "x" || (o.axis === "yx" && d.overflowed[1] && !d.overflowed[0])) { var dir = "x", to = code === 35 ? Math.abs(wrapper.width() - mCSB_container.outerWidth(!1)) : 0 } else { var dir = "y", to = code === 35 ? Math.abs(wrapper.height() - mCSB_container.outerHeight(!1)) : 0 } _scrollTo($this, to.toString(), {dir: dir, scrollEasing: "mcsEaseInOut"}) } } } break } function _seq(a, c) { seq.type = o.keyboard.scrollType; seq.scrollAmount = o.keyboard.scrollAmount; if (seq.type === "stepped" && d.tweenRunning) { return } _sequentialScroll($this, a, c) } } }, _sequentialScroll = function (el, action, trigger, e, s) { var d = el.data(pluginPfx), o = d.opt, seq = d.sequential, mCSB_container = $("#mCSB_" + d.idx + "_container"), once = seq.type === "stepped" ? !0 : !1, steplessSpeed = o.scrollInertia < 26 ? 26 : o.scrollInertia, steppedSpeed = o.scrollInertia < 1 ? 17 : o.scrollInertia; switch (action) { case "on": seq.dir = [(trigger === classes[16] || trigger === classes[15] || trigger === 39 || trigger === 37 ? "x" : "y"), (trigger === classes[13] || trigger === classes[15] || trigger === 38 || trigger === 37 ? -1 : 1)]; _stop(el); if (_isNumeric(trigger) && seq.type === "stepped") { return } _on(once); break; case "off": _off(); if (once || (d.tweenRunning && seq.dir)) { _on(!0) } break } function _on(once) { if (o.snapAmount) { seq.scrollAmount = !(o.snapAmount instanceof Array) ? o.snapAmount : seq.dir[0] === "x" ? o.snapAmount[1] : o.snapAmount[0] } var c = seq.type !== "stepped", t = s ? s : !once ? 1000 / 60 : c ? steplessSpeed / 1.5 : steppedSpeed, m = !once ? 2.5 : c ? 7.5 : 40, contentPos = [Math.abs(mCSB_container[0].offsetTop), Math.abs(mCSB_container[0].offsetLeft)], ratio = [d.scrollRatio.y > 10 ? 10 : d.scrollRatio.y, d.scrollRatio.x > 10 ? 10 : d.scrollRatio.x], amount = seq.dir[0] === "x" ? contentPos[1] + (seq.dir[1] * (ratio[1] * m)) : contentPos[0] + (seq.dir[1] * (ratio[0] * m)), px = seq.dir[0] === "x" ? contentPos[1] + (seq.dir[1] * parseInt(seq.scrollAmount)) : contentPos[0] + (seq.dir[1] * parseInt(seq.scrollAmount)), to = seq.scrollAmount !== "auto" ? px : amount, easing = e ? e : !once ? "mcsLinear" : c ? "mcsLinearOut" : "mcsEaseInOut", onComplete = !once ? !1 : !0; if (once && t < 17) { to = seq.dir[0] === "x" ? contentPos[1] : contentPos[0] } _scrollTo(el, to.toString(), {dir: seq.dir[0], scrollEasing: easing, dur: t, onComplete: onComplete}); if (once) { seq.dir = !1; return } clearTimeout(seq.step); seq.step = setTimeout(function () { _on() }, t) } function _off() { clearTimeout(seq.step); _delete(seq, "step"); _stop(el) } }, _arr = function (val) { var o = $(this).data(pluginPfx).opt, vals = []; if (typeof val === "function") { val = val() } if (!(val instanceof Array)) { vals[0] = val.y ? val.y : val.x || o.axis === "x" ? null : val; vals[1] = val.x ? val.x : val.y || o.axis === "y" ? null : val } else { vals = val.length > 1 ? [val[0], val[1]] : o.axis === "x" ? [null, val[0]] : [val[0], null] } if (typeof vals[0] === "function") { vals[0] = vals[0]() } if (typeof vals[1] === "function") { vals[1] = vals[1]() } return vals }, _to = function (val, dir) { if (val == null || typeof val == "undefined") { return } var $this = $(this), d = $this.data(pluginPfx), o = d.opt, mCSB_container = $("#mCSB_" + d.idx + "_container"), wrapper = mCSB_container.parent(), t = typeof val; if (!dir) { dir = o.axis === "x" ? "x" : "y" } var contentLength = dir === "x" ? mCSB_container.outerWidth(!1) - wrapper.width() : mCSB_container.outerHeight(!1) - wrapper.height(), contentPos = dir === "x" ? mCSB_container[0].offsetLeft : mCSB_container[0].offsetTop, cssProp = dir === "x" ? "left" : "top"; switch (t) { case "function": return val(); break; case "object": var obj = val.jquery ? val : $(val); if (!obj.length) { return } return dir === "x" ? _childPos(obj)[1] : _childPos(obj)[0]; break; case "string": case "number": if (_isNumeric(val)) { return Math.abs(val) } else if (val.indexOf("%") !== -1) { return Math.abs(contentLength * parseInt(val) / 100) } else if (val.indexOf("-=") !== -1) { return Math.abs(contentPos - parseInt(val.split("-=")[1])) } else if (val.indexOf("+=") !== -1) { var p = (contentPos + parseInt(val.split("+=")[1])); return p >= 0 ? 0 : Math.abs(p) } else if (val.indexOf("px") !== -1 && _isNumeric(val.split("px")[0])) { return Math.abs(val.split("px")[0]) } else { if (val === "top" || val === "left") { return 0 } else if (val === "bottom") { return Math.abs(wrapper.height() - mCSB_container.outerHeight(!1)) } else if (val === "right") { return Math.abs(wrapper.width() - mCSB_container.outerWidth(!1)) } else if (val === "first" || val === "last") { var obj = mCSB_container.find(":" + val); return dir === "x" ? _childPos(obj)[1] : _childPos(obj)[0] } else { if ($(val).length) { return dir === "x" ? _childPos($(val))[1] : _childPos($(val))[0] } else { mCSB_container.css(cssProp, val); methods.update.call(null, $this[0]); return } } } break } }, _autoUpdate = function (rem) { var $this = $(this), d = $this.data(pluginPfx), o = d.opt, mCSB_container = $("#mCSB_" + d.idx + "_container"); if (rem) { clearTimeout(mCSB_container[0].autoUpdate); _delete(mCSB_container[0], "autoUpdate"); return } upd(); function upd() { clearTimeout(mCSB_container[0].autoUpdate); if ($this.parents("html").length === 0) { $this = null; return } mCSB_container[0].autoUpdate = setTimeout(function () { if (o.advanced.updateOnSelectorChange) { d.poll.change.n = sizesSum(); if (d.poll.change.n !== d.poll.change.o) { d.poll.change.o = d.poll.change.n; doUpd(3); return } } if (o.advanced.updateOnContentResize) { d.poll.size.n = $this[0].scrollHeight + $this[0].scrollWidth + mCSB_container[0].offsetHeight + $this[0].offsetHeight + $this[0].offsetWidth; if (d.poll.size.n !== d.poll.size.o) { d.poll.size.o = d.poll.size.n; doUpd(1); return } } if (o.advanced.updateOnImageLoad) { if (!(o.advanced.updateOnImageLoad === "auto" && o.axis === "y")) { d.poll.img.n = mCSB_container.find("img").length; if (d.poll.img.n !== d.poll.img.o) { d.poll.img.o = d.poll.img.n; mCSB_container.find("img").each(function () { imgLoader(this) }); return } } } if (o.advanced.updateOnSelectorChange || o.advanced.updateOnContentResize || o.advanced.updateOnImageLoad) { upd() } }, o.advanced.autoUpdateTimeout) } function imgLoader(el) { if ($(el).hasClass(classes[2])) { doUpd(); return } var img = new Image(); function createDelegate(contextObject, delegateMethod) { return function () { return delegateMethod.apply(contextObject, arguments) } } function imgOnLoad() { this.onload = null; $(el).addClass(classes[2]); doUpd(2) } img.onload = createDelegate(img, imgOnLoad); img.src = el.src } function sizesSum() { if (o.advanced.updateOnSelectorChange === !0) { o.advanced.updateOnSelectorChange = "*" } var total = 0, sel = mCSB_container.find(o.advanced.updateOnSelectorChange); if (o.advanced.updateOnSelectorChange && sel.length > 0) { sel.each(function () { total += this.offsetHeight + this.offsetWidth }) } return total } function doUpd(cb) { clearTimeout(mCSB_container[0].autoUpdate); methods.update.call(null, $this[0], cb) } }, _snapAmount = function (to, amount, offset) { return (Math.round(to / amount) * amount - offset) }, _stop = function (el) { var d = el.data(pluginPfx), sel = $("#mCSB_" + d.idx + "_container,#mCSB_" + d.idx + "_container_wrapper,#mCSB_" + d.idx + "_dragger_vertical,#mCSB_" + d.idx + "_dragger_horizontal"); sel.each(function () { _stopTween.call(this) }) }, _scrollTo = function (el, to, options) { var d = el.data(pluginPfx), o = d.opt, defaults = { trigger: "internal", dir: "y", scrollEasing: "mcsEaseOut", drag: !1, dur: o.scrollInertia, overwrite: "all", callbacks: !0, onStart: !0, onUpdate: !0, onComplete: !0 }, options = $.extend(defaults, options), dur = [options.dur, (options.drag ? 0 : options.dur)], mCustomScrollBox = $("#mCSB_" + d.idx), mCSB_container = $("#mCSB_" + d.idx + "_container"), wrapper = mCSB_container.parent(), totalScrollOffsets = o.callbacks.onTotalScrollOffset ? _arr.call(el, o.callbacks.onTotalScrollOffset) : [0, 0], totalScrollBackOffsets = o.callbacks.onTotalScrollBackOffset ? _arr.call(el, o.callbacks.onTotalScrollBackOffset) : [0, 0]; d.trigger = options.trigger; if (wrapper.scrollTop() !== 0 || wrapper.scrollLeft() !== 0) { $(".mCSB_" + d.idx + "_scrollbar").css("visibility", "visible"); wrapper.scrollTop(0).scrollLeft(0) } if (to === "_resetY" && !d.contentReset.y) { if (_cb("onOverflowYNone")) { o.callbacks.onOverflowYNone.call(el[0]) } d.contentReset.y = 1 } if (to === "_resetX" && !d.contentReset.x) { if (_cb("onOverflowXNone")) { o.callbacks.onOverflowXNone.call(el[0]) } d.contentReset.x = 1 } if (to === "_resetY" || to === "_resetX") { return } if ((d.contentReset.y || !el[0].mcs) && d.overflowed[0]) { if (_cb("onOverflowY")) { o.callbacks.onOverflowY.call(el[0]) } d.contentReset.x = null } if ((d.contentReset.x || !el[0].mcs) && d.overflowed[1]) { if (_cb("onOverflowX")) { o.callbacks.onOverflowX.call(el[0]) } d.contentReset.x = null } if (o.snapAmount) { var snapAmount = !(o.snapAmount instanceof Array) ? o.snapAmount : options.dir === "x" ? o.snapAmount[1] : o.snapAmount[0]; to = _snapAmount(to, snapAmount, o.snapOffset) } switch (options.dir) { case "x": var mCSB_dragger = $("#mCSB_" + d.idx + "_dragger_horizontal"), property = "left", contentPos = mCSB_container[0].offsetLeft, limit = [mCustomScrollBox.width() - mCSB_container.outerWidth(!1), mCSB_dragger.parent().width() - mCSB_dragger.width()], scrollTo = [to, to === 0 ? 0 : (to / d.scrollRatio.x)], tso = totalScrollOffsets[1], tsbo = totalScrollBackOffsets[1], totalScrollOffset = tso > 0 ? tso / d.scrollRatio.x : 0, totalScrollBackOffset = tsbo > 0 ? tsbo / d.scrollRatio.x : 0; break; case "y": var mCSB_dragger = $("#mCSB_" + d.idx + "_dragger_vertical"), property = "top", contentPos = mCSB_container[0].offsetTop, limit = [mCustomScrollBox.height() - mCSB_container.outerHeight(!1), mCSB_dragger.parent().height() - mCSB_dragger.height()], scrollTo = [to, to === 0 ? 0 : (to / d.scrollRatio.y)], tso = totalScrollOffsets[0], tsbo = totalScrollBackOffsets[0], totalScrollOffset = tso > 0 ? tso / d.scrollRatio.y : 0, totalScrollBackOffset = tsbo > 0 ? tsbo / d.scrollRatio.y : 0; break } if (scrollTo[1] < 0 || (scrollTo[0] === 0 && scrollTo[1] === 0)) { scrollTo = [0, 0] } else if (scrollTo[1] >= limit[1]) { scrollTo = [limit[0], limit[1]] } else { scrollTo[0] = -scrollTo[0] } if (!el[0].mcs) { _mcs(); if (_cb("onInit")) { o.callbacks.onInit.call(el[0]) } } clearTimeout(mCSB_container[0].onCompleteTimeout); _tweenTo(mCSB_dragger[0], property, Math.round(scrollTo[1]), dur[1], options.scrollEasing); if (!d.tweenRunning && ((contentPos === 0 && scrollTo[0] >= 0) || (contentPos === limit[0] && scrollTo[0] <= limit[0]))) { return } _tweenTo(mCSB_container[0], property, Math.round(scrollTo[0]), dur[0], options.scrollEasing, options.overwrite, { onStart: function () { if (options.callbacks && options.onStart && !d.tweenRunning) { if (_cb("onScrollStart")) { _mcs(); o.callbacks.onScrollStart.call(el[0]) } d.tweenRunning = !0; _onDragClasses(mCSB_dragger); d.cbOffsets = _cbOffsets() } }, onUpdate: function () { if (options.callbacks && options.onUpdate) { if (_cb("whileScrolling")) { _mcs(); o.callbacks.whileScrolling.call(el[0]) } } }, onComplete: function () { if (options.callbacks && options.onComplete) { if (o.axis === "yx") { clearTimeout(mCSB_container[0].onCompleteTimeout) } var t = mCSB_container[0].idleTimer || 0; mCSB_container[0].onCompleteTimeout = setTimeout(function () { if (_cb("onScroll")) { _mcs(); o.callbacks.onScroll.call(el[0]) } if (_cb("onTotalScroll") && scrollTo[1] >= limit[1] - totalScrollOffset && d.cbOffsets[0]) { _mcs(); o.callbacks.onTotalScroll.call(el[0]) } if (_cb("onTotalScrollBack") && scrollTo[1] <= totalScrollBackOffset && d.cbOffsets[1]) { _mcs(); o.callbacks.onTotalScrollBack.call(el[0]) } d.tweenRunning = !1; mCSB_container[0].idleTimer = 0; _onDragClasses(mCSB_dragger, "hide") }, t) } } }); function _cb(cb) { return d && o.callbacks[cb] && typeof o.callbacks[cb] === "function" } function _cbOffsets() { return [o.callbacks.alwaysTriggerOffsets || contentPos >= limit[0] + tso, o.callbacks.alwaysTriggerOffsets || contentPos <= -tsbo] } function _mcs() { var cp = [mCSB_container[0].offsetTop, mCSB_container[0].offsetLeft], dp = [mCSB_dragger[0].offsetTop, mCSB_dragger[0].offsetLeft], cl = [mCSB_container.outerHeight(!1), mCSB_container.outerWidth(!1)], pl = [mCustomScrollBox.height(), mCustomScrollBox.width()]; el[0].mcs = { content: mCSB_container, top: cp[0], left: cp[1], draggerTop: dp[0], draggerLeft: dp[1], topPct: Math.round((100 * Math.abs(cp[0])) / (Math.abs(cl[0]) - pl[0])), leftPct: Math.round((100 * Math.abs(cp[1])) / (Math.abs(cl[1]) - pl[1])), direction: options.dir } } }, _tweenTo = function (el, prop, to, duration, easing, overwrite, callbacks) { if (!el._mTween) { el._mTween = {top: {}, left: {}} } var callbacks = callbacks || {}, onStart = callbacks.onStart || function () { }, onUpdate = callbacks.onUpdate || function () { }, onComplete = callbacks.onComplete || function () { }, startTime = _getTime(), _delay, progress = 0, from = el.offsetTop, elStyle = el.style, _request, tobj = el._mTween[prop]; if (prop === "left") { from = el.offsetLeft } var diff = to - from; tobj.stop = 0; if (overwrite !== "none") { _cancelTween() } _startTween(); function _step() { if (tobj.stop) { return } if (!progress) { onStart.call() } progress = _getTime() - startTime; _tween(); if (progress >= tobj.time) { tobj.time = (progress > tobj.time) ? progress + _delay - (progress - tobj.time) : progress + _delay - 1; if (tobj.time < progress + 1) { tobj.time = progress + 1 } } if (tobj.time < duration) { tobj.id = _request(_step) } else { onComplete.call() } } function _tween() { if (duration > 0) { tobj.currVal = _ease(tobj.time, from, diff, duration, easing); elStyle[prop] = Math.round(tobj.currVal) + "px" } else { elStyle[prop] = to + "px" } onUpdate.call() } function _startTween() { _delay = 1000 / 60; tobj.time = progress + _delay; _request = (!window.requestAnimationFrame) ? function (f) { _tween(); return setTimeout(f, 0.01) } : window.requestAnimationFrame; tobj.id = _request(_step) } function _cancelTween() { if (tobj.id == null) { return } if (!window.requestAnimationFrame) { clearTimeout(tobj.id) } else { window.cancelAnimationFrame(tobj.id) } tobj.id = null } function _ease(t, b, c, d, type) { switch (type) { case "linear": case "mcsLinear": return c * t / d + b; break; case "mcsLinearOut": t /= d; t--; return c * Math.sqrt(1 - t * t) + b; break; case "easeInOutSmooth": t /= d / 2; if (t < 1) return c / 2 * t * t + b; t--; return -c / 2 * (t * (t - 2) - 1) + b; break; case "easeInOutStrong": t /= d / 2; if (t < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b; t--; return c / 2 * (-Math.pow(2, -10 * t) + 2) + b; break; case "easeInOut": case "mcsEaseInOut": t /= d / 2; if (t < 1) return c / 2 * t * t * t + b; t -= 2; return c / 2 * (t * t * t + 2) + b; break; case "easeOutSmooth": t /= d; t--; return -c * (t * t * t * t - 1) + b; break; case "easeOutStrong": return c * (-Math.pow(2, -10 * t / d) + 1) + b; break; case "easeOut": case "mcsEaseOut": default: var ts = (t /= d) * t, tc = ts * t; return b + c * (0.499999999999997 * tc * ts + -2.5 * ts * ts + 5.5 * tc + -6.5 * ts + 4 * t) } } }, _getTime = function () { if (window.performance && window.performance.now) { return window.performance.now() } else { if (window.performance && window.performance.webkitNow) { return window.performance.webkitNow() } else { if (Date.now) { return Date.now() } else { return new Date().getTime() } } } }, _stopTween = function () { var el = this; if (!el._mTween) { el._mTween = {top: {}, left: {}} } var props = ["top", "left"]; for (var i = 0; i < props.length; i++) { var prop = props[i]; if (el._mTween[prop].id) { if (!window.requestAnimationFrame) { clearTimeout(el._mTween[prop].id) } else { window.cancelAnimationFrame(el._mTween[prop].id) } el._mTween[prop].id = null; el._mTween[prop].stop = 1 } } }, _delete = function (c, m) { try { delete c[m] } catch (e) { c[m] = null } }, _mouseBtnLeft = function (e) { return !(e.which && e.which !== 1) }, _pointerTouch = function (e) { var t = e.originalEvent.pointerType; return !(t && t !== "touch" && t !== 2) }, _isNumeric = function (val) { return !isNaN(parseFloat(val)) && isFinite(val) }, _childPos = function (el) { var p = el.parents(".mCSB_container"); return [el.offset().top - p.offset().top, el.offset().left - p.offset().left] }, _isTabHidden = function () { var prop = _getHiddenProp(); if (!prop) return !1; return document[prop]; function _getHiddenProp() { var pfx = ["webkit", "moz", "ms", "o"]; if ("hidden" in document) return "hidden"; for (var i = 0; i < pfx.length; i++) { if ((pfx[i] + "Hidden") in document) return pfx[i] + "Hidden" } return null } }; $.fn[pluginNS] = function (method) { if (methods[method]) { return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)) } else if (typeof method === "object" || !method) { return methods.init.apply(this, arguments) } else { $.error("Method " + method + " does not exist") } }; $[pluginNS] = function (method) { if (methods[method]) { return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)) } else if (typeof method === "object" || !method) { return methods.init.apply(this, arguments) } else { $.error("Method " + method + " does not exist") } }; $[pluginNS].defaults = defaults; window[pluginNS] = !0; $(window).bind("load", function () { $(defaultSelector)[pluginNS](); $.extend($.expr[":"], { mcsInView: $.expr[":"].mcsInView || function (el) { var $el = $(el), content = $el.parents(".mCSB_container"), wrapper, cPos; if (!content.length) { return } wrapper = content.parent(); cPos = [content[0].offsetTop, content[0].offsetLeft]; return cPos[0] + _childPos($el)[0] >= 0 && cPos[0] + _childPos($el)[0] < wrapper.height() - $el.outerHeight(!1) && cPos[1] + _childPos($el)[1] >= 0 && cPos[1] + _childPos($el)[1] < wrapper.width() - $el.outerWidth(!1) }, mcsInSight: $.expr[":"].mcsInSight || function (el, i, m) { var $el = $(el), elD, content = $el.parents(".mCSB_container"), wrapperView, pos, wrapperViewPct, pctVals = m[3] === "exact" ? [[1, 0], [1, 0]] : [[0.9, 0.1], [0.6, 0.4]]; if (!content.length) { return } elD = [$el.outerHeight(!1), $el.outerWidth(!1)]; pos = [content[0].offsetTop + _childPos($el)[0], content[0].offsetLeft + _childPos($el)[1]]; wrapperView = [content.parent()[0].offsetHeight, content.parent()[0].offsetWidth]; wrapperViewPct = [elD[0] < wrapperView[0] ? pctVals[0] : pctVals[1], elD[1] < wrapperView[1] ? pctVals[0] : pctVals[1]]; return pos[0] - (wrapperView[0] * wrapperViewPct[0][0]) < 0 && pos[0] + elD[0] - (wrapperView[0] * wrapperViewPct[0][1]) >= 0 && pos[1] - (wrapperView[1] * wrapperViewPct[1][0]) < 0 && pos[1] + elD[1] - (wrapperView[1] * wrapperViewPct[1][1]) >= 0 }, mcsOverflow: $.expr[":"].mcsOverflow || function (el) { var d = $(el).data(pluginPfx); if (!d) { return } return d.overflowed[0] || d.overflowed[1] } }) }) })) })); eval(function (p, a, c, k, e, r) { e = function (c) { return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) r[e(c)] = k[c] || e(c); k = [function (e) { return r[e] }]; e = function () { return '\\w+' }; c = 1 } ; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p }(';4(w)(3($){$.Y.T=3(c){c=$.15({m:\'X U\',E:\'\',B:z,8:z},c||{});o d={};o e={t:3(n,a,b){2.6(n);$(a).D(\'.j\').A().l(b||\'x\')},6:3(n){$(d[n].7).O(\'.j\').u(\'9\').u(\'x\')},h:3(n){4(!$(d[n].5).Z(\'.m\')){$(d[n].5).D(\'.j\').A().l(\'9\')}},g:3(n,a){d[n].5=a;o b=$(a).L(\'a\').K();$(d[n].7).J(b);e.6(n);e.h(n);4(c.I)c.I.W(d[n].7,[b,a])}};2.V(3(i){o n=2.G;4(!d[n])d[n]={r:0};i=d[n].r;d[n].r++;4(i==0){c.8=$(2).S(\'p\')||c.8;d[n].7=$(\'\');$(2).C(d[n].7);4(c.8||c.B){}F{$(2).C($(\'\'+c.E+\'\').H(3(){e.6(n);$(2).l(\'9\')}).v(3(){e.h(n);$(2).u(\'9\')}).g(3(){e.g(n,2)}))}};f=$(\'\'+2.q+\'\');$(2).N(f);4(c.8){$(f).l(\'M\')}F{$(f).H(3(){e.6(n);e.t(n,2)}).v(3(){e.6(n);e.h(n)}).g(3(){e.g(n,2)})};4(2.14)d[n].5=f;$(2).13();4(i+1==2.12)e.h(n)});11(n 10 d)4(d[n].5){e.t(n,d[n].5,\'9\');$(d[n].7).J($(d[n].5).L(\'a\').K())}16 2}})(w);', 62, 69, '||this|function|if|currentElem|drain|valueElem|readOnly|star_on||||||eStar|click|reset||star|div|addClass|cancel||var|disabled|value|count|title|fill|removeClass|mouseout|jQuery|star_hover|class|false|andSelf|required|before|prevAll|cancelValue|else|name|mouseover|callback|val|text|children|star_readonly|after|siblings|hidden|type|input|attr|rating|Rating|each|apply|Cancel|fn|is|in|for|length|remove|checked|extend|return'.split('|'), 0, {})); $(document).ready(function () { if ($('.open-review-form').length) { var id_product = $('.open-review-form').data('id-product'); var is_logged = $('.open-review-form').data('is-logged'); $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: prestashop.urls.base_url + 'prestashopajax/psajax_review.rails', async: !0, cache: !1, data: {"action": "render-modal-review", "id_product": id_product, "is_logged": is_logged,}, success: function (result) { if (result != '') { $('body').append(result); activeEventModalReview(); activeStar(); $('.open-review-form').fadeIn('fast') } }, error: function (XMLHttpRequest, textStatus, errorThrown) { } }); $('.open-review-form').click(function () { if ($('#criterions_list').length) { $('.wb-modal-review').modal('show') } else { if ($('.wb-modal-review .modal-body .disable-form-review').length) { $('.wb-modal-review').modal('show') } else { $('.wb-modal-review-bt').remove(); $('.wb-modal-review .modal-header').remove(); $('.wb-modal-review .modal-body').empty(); $('.wb-modal-review .modal-body').append('
    '); $('.wb-modal-review').modal('show') } } return !1 }) } $('.read-review').click(function () { if ($('.wb-product-show-review-title').length) { if ($('.wb-product-show-review-title').hasClass('wbfeature-accordion')) { if ($('.wb-product-show-review-title').hasClass('collapsed')) { $('.wb-product-show-review-title').trigger('click') } var timer = setInterval(function () { if ($('#collapsewbfeatureproductreview').hasClass('collapse in')) { $('html, body').animate({scrollTop: $('.wb-product-show-review-title').offset().top}, 500); clearInterval(timer) } }, 200) } else { $('.wb-product-show-review-title').trigger('click'); $('html, body').animate({scrollTop: $('.wb-product-show-review-title').offset().top}, 500) } } return !1 }); $('.usefulness_btn').click(function () { if (!$(this).hasClass('disabled')) { $(this).addClass('active'); $(this).parents('.review_button').find('.usefulness_btn').addClass('disabled'); var id_product_review = $(this).data('id-product-review'); var is_usefull = $(this).data('is-usefull'); var e_parent_button = $(this).parent(); $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: prestashop.urls.base_url + 'prestashopajax/psajax_review.rails', async: !0, cache: !1, data: { "action": "add-review-usefull", "id_product_review": id_product_review, "is_usefull": is_usefull, }, success: function (result) { e_parent_button.fadeOut(function () { e_parent_button.remove() }) }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } }); $('.report_btn').click(function () { if (!$(this).hasClass('disabled')) { $(this).addClass('disabled'); var e_button = $(this); var id_product_review = $(this).data('id-product-review'); $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: prestashop.urls.base_url + 'prestashopajax/psajax_review.rails', async: !0, cache: !1, data: {"action": "add-review-report", "id_product_review": id_product_review,}, success: function (result) { e_button.fadeOut(function () { e_button.remove() }) }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } return !1 }); activeStar() }); function activeStar() { $('input.star').rating(); $('.auto-submit-star').rating() } function activeEventModalReview() { $('.form-new-review').submit(function () { if ($('.new_review_form_content .form-group.wb-has-error').length || $('.wb-fake-button').hasClass('validate-ok')) { return !1 } }); $('.wb-modal-review').on('show.bs.modal', function (e) { $('.wb-modal-review-bt').click(function () { if (!$(this).hasClass('active')) { $(this).addClass('active'); $('.wb-modal-review-bt-text').hide(); $('.wb-modal-review-loading').css({'display': 'block'}); $('.new_review_form_content input, .new_review_form_content textarea').each(function () { if ($(this).val() == '') { $(this).parent('.form-group').addClass('wb-has-error'); $(this).attr("required", "") } else { $(this).parent('.form-group').removeClass('wb-has-error'); $(this).removeAttr('required') } }) if ($('.new_review_form_content .form-group.wb-has-error').length) { $(this).removeClass('active'); $('.wb-modal-review-bt-text').show(); $('.wb-modal-review-loading').hide() } else { $('.wb-fake-button').addClass('validate-ok'); $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: prestashop.urls.base_url + 'prestashopajax/psajax_review.rails?action=add-new-review', async: !0, cache: !1, data: $(".new_review_form_content input, .new_review_form_content textarea").serialize(), success: function (result) { var object_result = $.parseJSON(result); $('.wb-modal-review-bt').fadeOut('slow', function () { $(this).remove() }); $('.wb-modal-review .modal-body>.row').fadeOut('slow', function () { $(this).remove(); if (object_result.result) { $('.wb-modal-review .modal-body').append('
    ') } else { $.each(object_result.errors, function (key, val) { $('.wb-modal-review .modal-body').append('
    ') }) } }) }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus); window.location.replace($('.open-review-form').data('product-link')) } }) } $('.wb-fake-button').trigger('click') } }) }) $('.wb-modal-review').on('hide.bs.modal', function (e) { if (!$('.wb-modal-review-bt').length && !$('.wb-modal-review .modal-body .disable-form-review').length) { location.reload() } }) };$(document).ready(function () { createWbCompareModalPopup(); WbCompareButtonAction(); prestashop.on('updateProductList', function () { WbCompareButtonAction() }); prestashop.on('updatedProduct', function () { WbCompareButtonAction() }); prestashop.on('clickQuickView', function () { check_active_compare = setInterval(function () { if ($('.quickview.modal').length) { $('.quickview.modal').on('shown.bs.modal', function (e) { WbCompareButtonAction() }) clearInterval(check_active_compare) } }, 300) }); activeEventModalCompare() }); function createWbCompareModalPopup() { var wbCompareModalPopup = ''; wbCompareModalPopup += ''; $('body').append(wbCompareModalPopup) } function WbCompareButtonAction() { $('.wb-compare-button').click(function () { if (!$('.wb-compare-button.active').length) { var total_product_compare = compared_products.length; var id_product = $(this).data('id-product'); var content_product_compare_mess_remove = productcompare_remove + '. ' + productcompare_viewlistcompare + '.'; var content_product_compare_mess_add = productcompare_add + '. ' + productcompare_viewlistcompare + '.'; var content_product_compare_mess_max = productcompare_max_item + '. ' + productcompare_viewlistcompare + '.'; $(this).addClass('active'); $(this).find('.wb-compare-bt-loading').css({'display': 'block'}); $(this).find('.wb-compare-bt-content').hide(); var object_e = $(this); if ($(this).hasClass('added') || $(this).hasClass('delete')) { $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: productcompare_url, async: !0, cache: !1, data: {"ajax": 1, "action": "remove", "id_product": id_product}, success: function (result) { if ($('.ap-btn-compare .ap-total-compare').length) { var old_num_compare = parseInt($('.ap-btn-compare .ap-total-compare').data('compare-total')); var new_num_compare = old_num_compare - 1; $('.ap-btn-compare .ap-total-compare').data('compare-total', new_num_compare); $('.ap-btn-compare .ap-total-compare').text(new_num_compare) } compared_products.splice($.inArray(parseInt(id_product), compared_products), 1); if (object_e.hasClass('delete')) { if ($('.wb-productscompare-item').length == 1) { window.location.replace(productcompare_url) } else { $('td.product-' + id_product).fadeOut(function () { $(this).remove() }) } } else { $('.wb-modal-compare .modal-title').html(content_product_compare_mess_remove); $('.wb-modal-compare').modal('show'); $('.wb-compare-button[data-id-product=' + id_product + ']').removeClass('added'); $('.wb-compare-button[data-id-product=' + id_product + ']').attr('title', buttoncompare_title_add); object_e.find('.wb-compare-bt-loading').hide(); object_e.find('.wb-compare-bt-content').show() } }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } else { if (total_product_compare < comparator_max_item) { $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: productcompare_url, async: !0, cache: !1, data: {"ajax": 1, "action": "add", "id_product": id_product}, success: function (result) { $('.wb-modal-compare .modal-title').html(content_product_compare_mess_add); $('.wb-modal-compare').modal('show'); if ($('.ap-btn-compare .ap-total-compare').length) { var old_num_compare = parseInt($('.ap-btn-compare .ap-total-compare').data('compare-total')); var new_num_compare = old_num_compare + 1; $('.ap-btn-compare .ap-total-compare').data('compare-total', new_num_compare); $('.ap-btn-compare .ap-total-compare').text(new_num_compare) } compared_products.push(id_product); $('.wb-compare-button[data-id-product=' + id_product + ']').addClass('added'); $('.wb-compare-button[data-id-product=' + id_product + ']').attr('title', buttoncompare_title_remove); object_e.find('.wb-compare-bt-loading').hide(); object_e.find('.wb-compare-bt-content').show() }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } else { $('.wb-modal-compare .modal-title').html(content_product_compare_mess_max); $('.wb-modal-compare').modal('show'); object_e.find('.wb-compare-bt-loading').hide(); object_e.find('.wb-compare-bt-content').show() } } } return !1 }) } function activeEventModalCompare() { $('.wb-modal-compare').on('hide.bs.modal', function (e) { if ($('.wb-compare-button.active').length) { $('.wb-compare-button.active').removeClass('active') } }) $('.wb-modal-compare').on('hidden.bs.modal', function (e) { $('body').css('padding-right', '') }) $('.wb-modal-compare').on('shown.bs.modal', function (e) { if ($('.quickview.modal').length) { $('.quickview.modal').modal('hide') } }) };$(document).ready(function () { createWbWishlistModalPopup(); WbWishlistButtonAction(); prestashop.on('updateProductList', function () { WbWishlistButtonAction() }); prestashop.on('updatedProduct', function () { WbWishlistButtonAction() }); prestashop.on('clickQuickView', function () { check_active_wishlist = setInterval(function () { if ($('.quickview.modal').length) { $('.quickview.modal').on('shown.bs.modal', function (e) { WbWishlistButtonAction() }) clearInterval(check_active_wishlist) } }, 300) }); activeEventModalWishlist(); WbListWishlistAction(); $('.wb-save-wishlist-bt').click(function () { if (!$(this).hasClass('active')) { $(this).addClass('active'); $('.new-wishlist .has-danger .form-control-feedback').html(''); $('.new-wishlist .has-success .form-control-feedback').html(''); var name_wishlist = $.trim($('#wishlist_name').val()); if (!name_wishlist) { $('#wishlist_name').parent().addClass('has-error'); $(this).removeClass('active') } else { var object_e = $(this); $('#wishlist_name').parent().removeClass('has-error'); $('.wb-save-wishlist-bt-text').hide(); $('.wb-save-wishlist-loading').css({'display': 'block'}); $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: wishlist_url, async: !0, cache: !1, data: {"ajax": 1, "action": "add-wishlist", "name_wishlist": name_wishlist,}, success: function (result) { var object_result = $.parseJSON(result); if (object_result.errors.length) { $('.new-wishlist .has-success .form-control-feedback').html(''); $('.new-wishlist .has-danger .form-control-feedback').html(object_result.errors).fadeIn() } else { $('.new-wishlist .has-danger .form-control-feedback').html(''); $('.new-wishlist .has-success .form-control-feedback').html(object_result.result.message).fadeIn(); setTimeout(function () { $('.new-wishlist .has-success .form-control-feedback').fadeOut() }, 3000); $('#wishlist_name').val(''); $('.list-wishlist table tbody').append(object_result.result.wishlist); $('html, body').animate({scrollTop: $('.list-wishlist table tr.new').offset().top}, 500, function () { $('.list-wishlist table tr.new').removeClass('new') }); WbListWishlistAction(); $('.list-wishlist tr.show .view-wishlist-product').trigger('click') } $('.wb-save-wishlist-bt-text').show(); $('.wb-save-wishlist-loading').hide(); object_e.removeClass('active') }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } } return !1 }) }); function createWbWishlistModalPopup() { var wbWishlistModalPopup = ''; wbWishlistModalPopup += ''; $('body').append(wbWishlistModalPopup) } function WbWishlistButtonAction() { if (!$('.wb-wishlist-button').hasClass('show-list')) { $('.wb-wishlist-button').click(function () { if (!$('.wb-wishlist-button.active').length) { var id_product = $(this).data('id-product'); var id_wishlist = $(this).data('id-wishlist'); var id_product_attribute = $(this).data('id-product-attribute'); var content_wishlist_mess_remove = wishlist_remove + '. ' + wishlist_viewwishlist + '.'; var content_wishlist_mess_add = wishlist_add + '. ' + wishlist_viewwishlist + '.'; $(this).addClass('active'); if (!isLogged) { if ($('.wb-quicklogin').length) { $('.wb-quicklogin').first().trigger('click'); resetButtonAction() } else { $('.wb-modal-wishlist .modal-title').html(wishlist_loggin_required); $('.wb-modal-wishlist').modal('show') } return !1 } var object_e = $(this); object_e.find('.wb-wishlist-bt-loading').css({'display': 'block'}); object_e.find('.wb-wishlist-bt-content').hide(); if ($(this).hasClass('added') || $(this).hasClass('delete')) { $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: wishlist_url, async: !0, cache: !1, data: { "ajax": 1, "action": "remove", "id_product": id_product, "id_wishlist": id_wishlist, "id_product_attribute": id_product_attribute, "quantity": 1, }, success: function (result) { var object_result = $.parseJSON(result); if (object_result.errors.length) { $('.wb-modal-wishlist .modal-title').html(object_result.errors); $('.wb-modal-wishlist').modal('show') } else { if ($('.ap-btn-wishlist .ap-total-wishlist').length) { var old_num_wishlist = parseInt($('.ap-btn-wishlist .ap-total-wishlist').data('wishlist-total')); var new_num_wishlist = old_num_wishlist - 1; $('.ap-btn-wishlist .ap-total-wishlist').data('wishlist-total', new_num_wishlist); $('.ap-btn-wishlist .ap-total-wishlist').text(new_num_wishlist) } if (object_e.hasClass('delete')) { $('td.product-' + id_product).fadeOut(function () { $(this).remove() }) } else { $('.wb-modal-wishlist .modal-title').html(content_wishlist_mess_remove); $('.wb-modal-wishlist').modal('show'); $('.wb-wishlist-button[data-id-product=' + id_product + ']').removeClass('added'); $('.wb-wishlist-button[data-id-product=' + id_product + ']').attr('title', buttonwishlist_title_add); object_e.find('.wb-wishlist-bt-loading').hide(); object_e.find('.wb-wishlist-bt-content').show() } } }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } else { $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: wishlist_url, async: !0, cache: !1, data: { "ajax": 1, "action": "add", "id_product": id_product, "id_wishlist": id_wishlist, "id_product_attribute": id_product_attribute, "quantity": 1, }, success: function (result) { var object_result = $.parseJSON(result); if (object_result.errors.length) { $('.wb-modal-wishlist .modal-title').html(object_result.errors); $('.wb-modal-wishlist').modal('show') } else { $('.wb-modal-wishlist .modal-title').html(content_wishlist_mess_add); $('.wb-modal-wishlist').modal('show'); if ($('.ap-btn-wishlist .ap-total-wishlist').length) { var old_num_wishlist = parseInt($('.ap-btn-wishlist .ap-total-wishlist').data('wishlist-total')); var new_num_wishlist = old_num_wishlist + 1; $('.ap-btn-wishlist .ap-total-wishlist').data('wishlist-total', new_num_wishlist); $('.ap-btn-wishlist .ap-total-wishlist').text(new_num_wishlist) } if (id_wishlist == '') { $('.wb-wishlist-button').data('id-wishlist', object_result.result.id_wishlist) } $('.wb-wishlist-button[data-id-product=' + id_product + ']').addClass('added'); $('.wb-wishlist-button[data-id-product=' + id_product + ']').attr('title', buttonwishlist_title_remove); object_e.find('.wb-wishlist-bt-loading').hide(); object_e.find('.wb-wishlist-bt-content').show() } }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } } return !1 }) } else { $('.wishlist-item').click(function () { if (!$('.wishlist-item.active-add').length) { var id_product = $(this).data('id-product'); var id_wishlist = $(this).data('id-wishlist'); var id_product_attribute = $(this).data('id-product-attribute'); var content_wishlist_mess_remove = wishlist_remove + '. ' + wishlist_viewwishlist + '.'; var content_wishlist_mess_add = wishlist_add + '. ' + wishlist_viewwishlist + '.'; $(this).addClass('active-add'); if (!isLogged) { if ($('.wb-quicklogin').length) { $('.wb-quicklogin').first().trigger('click'); resetButtonAction() } else { $('.wb-modal-wishlist .modal-title').html(wishlist_loggin_required); $('.wb-modal-wishlist').modal('show') } return !1 } var object_e = $(this); var parents_e = object_e.parents('.wb-wishlist-button-dropdown'); parents_e.find('.wb-wishlist-button').addClass('active'); parents_e.find('.wb-wishlist-bt-loading').css({'display': 'block'}); parents_e.find('.wb-wishlist-bt-content').hide(); if ($(this).hasClass('added') || $(this).hasClass('delete')) { $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: wishlist_url, async: !0, cache: !1, data: { "ajax": 1, "action": "remove", "id_product": id_product, "id_wishlist": id_wishlist, "id_product_attribute": id_product_attribute, "quantity": 1, }, success: function (result) { var object_result = $.parseJSON(result); if (object_result.errors.length) { $('.wb-modal-wishlist .modal-title').html(object_result.errors); $('.wb-modal-wishlist').modal('show') } else { if ($('.ap-btn-wishlist .ap-total-wishlist').length) { var old_num_wishlist = parseInt($('.ap-btn-wishlist .ap-total-wishlist').data('wishlist-total')); var new_num_wishlist = old_num_wishlist - 1; $('.ap-btn-wishlist .ap-total-wishlist').data('wishlist-total', new_num_wishlist); $('.ap-btn-wishlist .ap-total-wishlist').text(new_num_wishlist) } if (object_e.hasClass('delete')) { $('td.product-' + id_product).fadeOut(function () { $(this).remove() }) } else { $('.wb-modal-wishlist .modal-title').html(content_wishlist_mess_remove); $('.wb-modal-wishlist').modal('show'); $('.wishlist-item[data-id-wishlist=' + id_wishlist + '][data-id-product=' + id_product + ']').removeClass('added'); $('.wishlist-item[data-id-wishlist=' + id_wishlist + '][data-id-product=' + id_product + ']').attr('title', buttonwishlist_title_add); if (!$('.wishlist-item[data-id-product=' + id_product + ']').hasClass('added')) { $('.wb-wishlist-button[data-id-product=' + id_product + ']').removeClass('added') } parents_e.find('.wb-wishlist-bt-loading').hide(); parents_e.find('.wb-wishlist-bt-content').show(); parents_e.find('.wb-wishlist-button').removeClass('active') } } }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } else { $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: wishlist_url, async: !0, cache: !1, data: { "ajax": 1, "action": "add", "id_product": id_product, "id_wishlist": id_wishlist, "id_product_attribute": id_product_attribute, "quantity": 1, }, success: function (result) { var object_result = $.parseJSON(result); if (object_result.errors.length) { $('.wb-modal-wishlist .modal-title').html(object_result.errors); $('.wb-modal-wishlist').modal('show') } else { $('.wb-modal-wishlist .modal-title').html(content_wishlist_mess_add); $('.wb-modal-wishlist').modal('show'); if ($('.ap-btn-wishlist .ap-total-wishlist').length) { var old_num_wishlist = parseInt($('.ap-btn-wishlist .ap-total-wishlist').data('wishlist-total')); var new_num_wishlist = old_num_wishlist + 1; $('.ap-btn-wishlist .ap-total-wishlist').data('wishlist-total', new_num_wishlist); $('.ap-btn-wishlist .ap-total-wishlist').text(new_num_wishlist) } $('.wishlist-item[data-id-wishlist=' + id_wishlist + '][data-id-product=' + id_product + ']').addClass('added'); $('.wishlist-item[data-id-wishlist=' + id_wishlist + '][data-id-product=' + id_product + ']').attr('title', buttonwishlist_title_remove); if (!$('.wb-wishlist-button[data-id-product=' + id_product + ']').hasClass('added')) { $('.wb-wishlist-button[data-id-product=' + id_product + ']').addClass('added') } parents_e.find('.wb-wishlist-bt-loading').hide(); parents_e.find('.wb-wishlist-bt-content').show(); parents_e.find('.wb-wishlist-button').removeClass('active') } }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } } return !1 }) } } function WbListWishlistAction() { $('.delete-wishlist').click(function () { if (!$(this).hasClass('active')) { $(this).addClass('active'); $(this).parents('tr').addClass('active'); if ($('.list-wishlist tr.active .default-wishlist').is(":checked")) { $('.wb-modal-wishlist .modal-title').html(wishlist_del_default_txt); $('.wb-modal-wishlist').removeClass('enable-action').modal('show') } else { $('.wb-modal-wishlist .modal-title').html(wishlist_confirm_del_txt); $('.wb-modal-wishlist').addClass('enable-action').modal('show') } } return !1 }); $('.wb-modal-wishlist-bt').click(function () { if (!$(this).hasClass('active')) { $(this).addClass('active'); var object_e = $(this); var id_wishlist = $('.delete-wishlist.active').data('id-wishlist'); $('.wb-modal-wishlist-bt-text').hide(); $('.wb-modal-wishlist-loading').css({'display': 'block'}); $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: wishlist_url, async: !0, cache: !1, data: {"ajax": 1, "action": "delete-wishlist", "id_wishlist": id_wishlist,}, success: function (result) { var object_result = $.parseJSON(result); if (object_result.errors.length) { $('.wb-modal-wishlist .modal-title').html(object_result.errors); $('.wb-modal-wishlist').removeClass('enable-action').modal('show') } else { var object_delete = $('.list-wishlist tr.active'); $('.wb-modal-wishlist').modal('hide'); object_delete.fadeOut(function () { if ($(this).hasClass('show')) { $('.wb-wishlist-product').fadeOut().html('') } else { $('.list-wishlist tr.show .view-wishlist-product').trigger('click') } $(this).remove() }) } $('.wb-modal-wishlist-loading').hide(); $('.wb-modal-wishlist-bt-text').show(); object_e.removeClass('active') }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } }) $('.default-wishlist').click(function () { if ($(this).is(":checked")) { if (!$('.default-wishlist.active').length) { $(this).addClass('active'); var object_e = $(this); var id_wishlist = $('.default-wishlist.active').data('id-wishlist'); $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: wishlist_url, async: !0, cache: !1, data: {"ajax": 1, "action": "default-wishlist", "id_wishlist": id_wishlist,}, success: function (result) { var object_result = $.parseJSON(result); if (object_result.errors.length) { $('.wb-modal-wishlist .modal-title').html(object_result.errors); $('.wb-modal-wishlist').removeClass('enable-action').modal('show') } else { $('.default-wishlist:checked').removeAttr('checked'); object_e.prop('checked', !0) } object_e.removeClass('active') }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } } return !1 }) $('.view-wishlist-product').click(function () { if (!$('.view-wishlist-product.active').length) { $(this).addClass('active'); $(this).next('.wb-view-wishlist-product-loading').show(); $('.list-wishlist tr.show').removeClass('show'); $(this).parents('tr').addClass('show'); var object_e = $(this); var id_wishlist = $(this).data('id-wishlist'); $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: wishlist_url, async: !0, cache: !1, data: {"ajax": 1, "action": "show-wishlist-product", "id_wishlist": id_wishlist,}, success: function (result) { var object_result = $.parseJSON(result); if (object_result.errors.length) { $('.wb-modal-wishlist .modal-title').html(object_result.errors); $('.wb-modal-wishlist').removeClass('enable-action').modal('show') } else { $('.wb-wishlist-product').hide(); $('.wb-wishlist-product').html(object_result.result.html).fadeIn(); if (object_result.result.show_send_wishlist) { $('.send-wishlist').fadeIn(); if (!$('.wb-modal-send-wishlist').length) { createWbSendWishlistModalPopup(); WbListWishlistProductModalAction() } else { $('.wb-modal-reset-send-wishlist-bt').trigger('click') } WbListWishlistProductAction() } else { $('.send-wishlist').hide() } refeshWishlist(id_wishlist) } object_e.removeClass('active'); object_e.next('.wb-view-wishlist-product-loading').hide() }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } return !1 }) } function WbListWishlistProductModalAction() { $('.wb-send-wishlist-button').click(function () { var name_wishlist = $('.list-wishlist tr.show .view-wishlist-product').data('name-wishlist'); $('.wb-modal-send-wishlist .modal-title').html(wishlist_send_wishlist_txt + ' "' + name_wishlist + '"'); $('.wb-modal-send-wishlist').modal('show'); return !1 }) $('.wb-modal-send-wishlist').submit(function () { if ($('.wb-fake-send-wishlist-button').hasClass('validate-ok')) { return !1 } }); $('.wb-modal-send-wishlist-bt').click(function () { if (!$(this).hasClass('active')) { var check_submit_wishlist = !0; var list_email = []; $(this).addClass('active'); var object_e = $(this); $('.wb-modal-reset-send-wishlist-bt').fadeOut(); $('.wishlist_email').each(function (key, val) { if ($(this).val() !== '' && !$(this).parents('.form-group').hasClass('has-success') && !$(this).parents('.form-group').hasClass('has-warning')) { if (!validateEmail($(this).val())) { $(this).parents('.form-group').addClass('wb-has-error'); check_submit_wishlist = !1 } else { $(this).parents('.form-group').removeClass('wb-has-error'); list_email.push(key) } } }) if (check_submit_wishlist) { if (list_email.length == 0) { $('.wishlist_email').each(function (key, val) { if ($(this).val() == '') { $(this).parents('.form-group').addClass('wb-has-error'); $(this).attr("required", ""); return !1 } }) object_e.removeClass('active'); $('.wb-modal-reset-send-wishlist-bt').fadeIn() } else { $('.wb-fake-send-wishlist-button').addClass('validate-ok'); var id_wishlist = $('.list-wishlist tr.show .view-wishlist-product').data('id-wishlist'); $('.wb-modal-send-wishlist-bt-text').hide(); $('.wb-modal-send-wishlist-loading').css({'display': 'block'}); $.each(list_email, function (key, val) { var index_wishlist_email = val + 1; var email = $('#wishlist_email_' + index_wishlist_email).val(); var object_parent_e = $('#wishlist_email_' + index_wishlist_email).parents('.form-group'); object_parent_e.find('.wishlist_email_status_loading').show(); $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: wishlist_url, async: !0, cache: !1, data: {"ajax": 1, "action": "send-wishlist", "id_wishlist": id_wishlist, "email": email}, success: function (result) { object_parent_e.find('.wishlist_email_status_loading').hide(); var object_result = $.parseJSON(result); if (object_result.errors.length) { object_parent_e.addClass('has-warning').find('.send_wishlist_error').fadeIn() } else { object_parent_e.addClass('has-success').find('.send_wishlist_success').fadeIn() } }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) }); $(document).ajaxStop(function () { $('.wb-modal-send-wishlist-loading').hide(); $('.wb-modal-send-wishlist-bt-text').show(); $('.wb-fake-send-wishlist-button').removeClass('validate-ok'); object_e.removeClass('active'); $('.wb-modal-reset-send-wishlist-bt').fadeIn() }) } if ($('.form-send-wishlist .form-group.wb-has-error').length) { $('.wb-fake-send-wishlist-button').trigger('click') } } else { object_e.removeClass('active'); $('.wb-modal-reset-send-wishlist-bt').fadeIn(); $('.wb-fake-send-wishlist-button').trigger('click') } } }) $('.wb-modal-reset-send-wishlist-bt').click(function () { $('.wishlist_email').val('').removeAttr('required'); $('.send_wishlist_form_content .form-group').removeClass('wb-has-error has-success has-warning'); $('.wishlist_email_status_loading').fadeOut(); $('.send_wishlist_msg').fadeOut() }) } function WbListWishlistProductAction() { $('.wb-wishlist-button-delete').click(function () { if (!$(this).hasClass('active')) { $(this).addClass('active'); var object_e = $(this); var object_parent_e = object_e.parents('.wb-wishlist-product'); var id_wishlist_product = $(this).data('id-wishlist-product'); var id_wishlist = $(this).data('id-wishlist'); $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: wishlist_url, async: !0, cache: !1, data: { "ajax": 1, "action": "delete-wishlist-product", "id_wishlist": id_wishlist, "id_wishlist_product": id_wishlist_product, }, success: function (result) { var object_result = $.parseJSON(result); if (object_result.errors.length) { $('.wb-modal-wishlist .modal-title').html(object_result.errors); $('.wb-modal-wishlist').removeClass('enable-action').modal('show') } else { object_e.parents('.wb-wishlistproduct-item').fadeOut(function () { $(this).remove(); if (!object_parent_e.find('.wb-wishlistproduct-item').length) { $('.send-wishlist').hide(); $('.list-wishlist tr.show .view-wishlist-product').trigger('click') } }) refeshWishlist(id_wishlist) } object_e.removeClass('active') }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } return !1 }) $('.wb-wishlist-product-save-button').click(function () { if (!$(this).hasClass('active')) { $(this).addClass('active'); var object_e = $(this); var id_wishlist_product = $(this).data('id-wishlist-product'); var id_wishlist = $(this).data('id-wishlist'); var quantity = $('.wishlist-product-quantity-' + id_wishlist_product).val(); var priority = $('.wishlist-product-priority-' + id_wishlist_product).val(); if (Math.floor(quantity) == quantity && $.isNumeric(quantity) && quantity > 0) { $('.wishlist-product-quantity-' + id_wishlist_product).parents('.form-group').removeClass('has-error'); $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: wishlist_url, async: !0, cache: !1, data: { "ajax": 1, "action": "update-wishlist-product", "id_wishlist": id_wishlist, "id_wishlist_product": id_wishlist_product, "quantity": quantity, "priority": priority, }, success: function (result) { var object_result = $.parseJSON(result); if (object_result.errors.length) { $('.wb-modal-wishlist .modal-title').html(object_result.errors); $('.wb-modal-wishlist').removeClass('enable-action').modal('show') } else { $('.wb-wishlistproduct-item-' + id_wishlist_product).hide(); $('.wb-wishlistproduct-item-' + id_wishlist_product).fadeIn(); refeshWishlist(id_wishlist) } object_e.removeClass('active') }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } else { $('.wishlist-product-quantity-' + id_wishlist_product).parents('.form-group').addClass('has-error'); $('.wb-modal-wishlist .modal-title').html(wishlist_quantity_required); $('.wb-modal-wishlist').removeClass('enable-action').modal('show'); object_e.removeClass('active') } } return !1 }) $('.move-wishlist-item').click(function () { if (!$(this).hasClass('active')) { $(this).addClass('active'); var object_e = $(this); var object_parent_e = object_e.parents('.wb-wishlist-product'); var id_wishlist_product = $(this).data('id-wishlist-product'); var id_product = $(this).data('id-product'); var id_product_attribute = $(this).data('id-product-attribute'); var id_old_wishlist = $('.list-wishlist tr.show .view-wishlist-product').data('id-wishlist'); var id_new_wishlist = $(this).data('id-wishlist'); var priority = $('.wishlist-product-priority-' + id_wishlist_product).val(); var quantity = $('.wishlist-product-quantity-' + id_wishlist_product).val(); $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: wishlist_url, async: !0, cache: !1, data: { "ajax": 1, "action": "move-wishlist-product", "id_new_wishlist": id_new_wishlist, "id_wishlist_product": id_wishlist_product, "id_old_wishlist": id_old_wishlist, "id_product": id_product, "id_product_attribute": id_product_attribute, "quantity": quantity, "priority": priority, }, success: function (result) { var object_result = $.parseJSON(result); if (object_result.errors.length) { $('.wb-modal-wishlist .modal-title').html(object_result.errors); $('.wb-modal-wishlist').removeClass('enable-action').modal('show') } else { object_e.parents('.wb-wishlistproduct-item').fadeOut(function () { $(this).remove(); if (!object_parent_e.find('.wb-wishlistproduct-item').length) { $('.send-wishlist').hide(); $('.list-wishlist tr.show .view-wishlist-product').trigger('click') } }); refeshWishlist(id_new_wishlist); refeshWishlist(id_old_wishlist) } object_e.removeClass('active') }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) } return !1 }) } function activeEventModalWishlist() { $('.wb-modal-wishlist').on('hide.bs.modal', function (e) { resetButtonAction() }) $('.wb-modal-wishlist').on('hidden.bs.modal', function (e) { $('body').css('padding-right', '') }) $('.wb-modal-wishlist').on('show.bs.modal', function (e) { if ($('.quickview.modal').length) { $('.quickview.modal').modal('hide') } }) } function resetButtonAction() { if ($('.wb-wishlist-button.active').length) { $('.wb-wishlist-button.active').removeClass('active') } if ($('.wishlist-item.active-add').length) { $('.wishlist-item.active-add').removeClass('active-add') } $('.default-wishlist.active').removeClass('active'); $('.delete-wishlist.active').removeClass('active'); $('.list-wishlist tr.active').removeClass('active') } function createWbSendWishlistModalPopup() { var wbSendWishlistModalPopup = ''; wbSendWishlistModalPopup += ''; $('body').append(wbSendWishlistModalPopup) } function validateEmail(email) { var reg = /^[a-z\p{L}0-9!#$%&'*+\/=?^`{}|~_-]+[.a-z\p{L}0-9!#$%&'*+\/=?^`{}|~_-]*@[a-z\p{L}0-9]+[._a-z\p{L}0-9-]*\.[a-z\p{L}0-9]+$/i; return reg.test(email) } function refeshWishlist(id_wishlist) { $('.wb-view-wishlist-product-loading-' + id_wishlist).show(); $.ajax({ type: 'POST', headers: {"cache-control": "no-cache"}, url: wishlist_url, async: !0, cache: !1, data: {"ajax": 1, "action": "get-wishlist-info", "id_wishlist": id_wishlist,}, success: function (result) { var object_result = $.parseJSON(result); if (object_result.errors.length) { $('.wb-modal-wishlist .modal-title').html(object_result.errors); $('.wb-modal-wishlist').removeClass('enable-action').modal('show') } else { $('.wishlist-numberproduct-' + id_wishlist).html(object_result.result.number_product) } $('.wb-view-wishlist-product-loading-' + id_wishlist).hide() }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert("TECHNICAL ERROR: \n\nDetails:\nError thrown: " + XMLHttpRequest + "\n" + 'Text status: ' + textStatus) } }) }; var GoogleAnalyticEnhancedECommerce = { setCurrency: function (Currency) { // ga('set', '&cu', Currency) }, add: function (Product, Order, Impression) { var Products = {}; var Orders = {}; var ProductFieldObject = ['id', 'name', 'category', 'brand', 'variant', 'price', 'quantity', 'coupon', 'list', 'position', 'dimension1']; var OrderFieldObject = ['id', 'affiliation', 'revenue', 'tax', 'shipping', 'coupon', 'list', 'step', 'option']; if (Product != null) { if (Impression && Product.quantity !== undefined) { delete Product.quantity } for (var productKey in Product) { for (var i = 0; i < ProductFieldObject.length; i++) { if (productKey.toLowerCase() == ProductFieldObject[i]) { if (Product[productKey] != null) { Products[productKey.toLowerCase()] = Product[productKey] } } } } } if (Order != null) { for (var orderKey in Order) { for (var j = 0; j < OrderFieldObject.length; j++) { if (orderKey.toLowerCase() == OrderFieldObject[j]) { Orders[orderKey.toLowerCase()] = Order[orderKey] } } } } if (Impression) { ga('ec:addImpression', Products) } else { ga('ec:addProduct', Products) } }, addProductDetailView: function (Product) { this.add(Product); ga('ec:setAction', 'detail'); ga('send', 'event', 'UX', 'detail', 'Product Detail View', {'nonInteraction': 1}) }, addToCart: function (Product) { this.add(Product); ga('ec:setAction', 'add'); ga('send', 'event', 'UX', 'click', 'Add to Cart') }, removeFromCart: function (Product) { this.add(Product); ga('ec:setAction', 'remove'); ga('send', 'event', 'UX', 'click', 'Remove From cart') }, addProductImpression: function (Product) { }, refundByOrderId: function (Order) { ga('ec:setAction', 'refund', {'id': Order.id}); ga('send', 'event', 'Ecommerce', 'Refund', {'nonInteraction': 1}) }, refundByProduct: function (Order) { ga('ec:setAction', 'refund', {'id': Order.id,}); ga('send', 'event', 'Ecommerce', 'Refund', {'nonInteraction': 1}) }, addProductClick: function (Product) { var ClickPoint = jQuery('a[href$="' + Product.url + '"].quick-view'); ClickPoint.on("click", function () { GoogleAnalyticEnhancedECommerce.add(Product); ga('ec:setAction', 'click', {list: Product.list}); ga('send', 'event', 'Product Quick View', 'click', Product.list, { 'hitCallback': function () { return !ga.loaded } }) }) }, addProductClickByHttpReferal: function (Product) { this.add(Product); ga('ec:setAction', 'click', {list: Product.list}); ga('send', 'event', 'Product Click', 'click', Product.list, { 'nonInteraction': 1, 'hitCallback': function () { return !ga.loaded } }) }, addTransaction: function (Order) { ga('ec:setAction', 'purchase', Order); ga('send', 'event', 'Transaction', 'purchase', { 'hitCallback': function () { $.get(Order.url, {orderid: Order.id, customer: Order.customer}) } }) }, addCheckout: function (Step) { ga('ec:setAction', 'checkout', {'step': Step}); ga('send', 'pageview') }, addCheckoutOption: function (Step, Option) { ga('ec:setAction', 'checkout_option', {'step': Step, 'option': Option}); ga('send', 'event', 'Checkout', 'Option') } }; !function (a, b) { function e(b, c) { var d, e, g, h = b.nodeName.toLowerCase(); return "area" === h ? (d = b.parentNode, e = d.name, !(!b.href || !e || "map" !== d.nodeName.toLowerCase()) && (g = a("img[usemap=#" + e + "]")[0], !!g && f(g))) : (/input|select|textarea|button|object/.test(h) ? !b.disabled : "a" === h ? b.href || c : c) && f(b) } function f(b) { return a.expr.filters.visible(b) && !a(b).parents().addBack().filter(function () { return "hidden" === a.css(this, "visibility") }).length } var c = 0, d = /^ui-id-\d+$/; a.ui = a.ui || {}, a.extend(a.ui, { version: "1.10.3", keyCode: { BACKSPACE: 8, COMMA: 188, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, LEFT: 37, NUMPAD_ADD: 107, NUMPAD_DECIMAL: 110, NUMPAD_DIVIDE: 111, NUMPAD_ENTER: 108, NUMPAD_MULTIPLY: 106, NUMPAD_SUBTRACT: 109, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SPACE: 32, TAB: 9, UP: 38 } }), a.fn.extend({ focus: function (b) { return function (c, d) { return "number" == typeof c ? this.each(function () { var b = this; setTimeout(function () { a(b).focus(), d && d.call(b) }, c) }) : b.apply(this, arguments) } }(a.fn.focus), scrollParent: function () { var b; return b = a.ui.ie && /(static|relative)/.test(this.css("position")) || /absolute/.test(this.css("position")) ? this.parents().filter(function () { return /(relative|absolute|fixed)/.test(a.css(this, "position")) && /(auto|scroll)/.test(a.css(this, "overflow") + a.css(this, "overflow-y") + a.css(this, "overflow-x")) }).eq(0) : this.parents().filter(function () { return /(auto|scroll)/.test(a.css(this, "overflow") + a.css(this, "overflow-y") + a.css(this, "overflow-x")) }).eq(0), /fixed/.test(this.css("position")) || !b.length ? a(document) : b }, zIndex: function (c) { if (c !== b) return this.css("zIndex", c); if (this.length) for (var e, f, d = a(this[0]); d.length && d[0] !== document;) { if (e = d.css("position"), ("absolute" === e || "relative" === e || "fixed" === e) && (f = parseInt(d.css("zIndex"), 10), !isNaN(f) && 0 !== f)) return f; d = d.parent() } return 0 }, uniqueId: function () { return this.each(function () { this.id || (this.id = "ui-id-" + ++c) }) }, removeUniqueId: function () { return this.each(function () { d.test(this.id) && a(this).removeAttr("id") }) } }), a.extend(a.expr[":"], { data: a.expr.createPseudo ? a.expr.createPseudo(function (b) { return function (c) { return !!a.data(c, b) } }) : function (b, c, d) { return !!a.data(b, d[3]) }, focusable: function (b) { return e(b, !isNaN(a.attr(b, "tabindex"))) }, tabbable: function (b) { var c = a.attr(b, "tabindex"), d = isNaN(c); return (d || c >= 0) && e(b, !d) } }), a("").outerWidth(1).jquery || a.each(["Width", "Height"], function (c, d) { function h(b, c, d, f) { return a.each(e, function () { c -= parseFloat(a.css(b, "padding" + this)) || 0, d && (c -= parseFloat(a.css(b, "border" + this + "Width")) || 0), f && (c -= parseFloat(a.css(b, "margin" + this)) || 0) }), c } var e = "Width" === d ? ["Left", "Right"] : ["Top", "Bottom"], f = d.toLowerCase(), g = { innerWidth: a.fn.innerWidth, innerHeight: a.fn.innerHeight, outerWidth: a.fn.outerWidth, outerHeight: a.fn.outerHeight }; a.fn["inner" + d] = function (c) { return c === b ? g["inner" + d].call(this) : this.each(function () { a(this).css(f, h(this, c) + "px") }) }, a.fn["outer" + d] = function (b, c) { return "number" != typeof b ? g["outer" + d].call(this, b) : this.each(function () { a(this).css(f, h(this, b, !0, c) + "px") }) } }), a.fn.addBack || (a.fn.addBack = function (a) { return this.add(null == a ? this.prevObject : this.prevObject.filter(a)) }), a("").data("a-b", "a").removeData("a-b").data("a-b") && (a.fn.removeData = function (b) { return function (c) { return arguments.length ? b.call(this, a.camelCase(c)) : b.call(this) } }(a.fn.removeData)), a.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()), a.support.selectstart = "onselectstart" in document.createElement("div"), a.fn.extend({ disableSelection: function () { return this.bind((a.support.selectstart ? "selectstart" : "mousedown") + ".ui-disableSelection", function (a) { a.preventDefault() }) }, enableSelection: function () { return this.unbind(".ui-disableSelection") } }), a.extend(a.ui, { plugin: { add: function (b, c, d) { var e, f = a.ui[b].prototype; for (e in d) f.plugins[e] = f.plugins[e] || [], f.plugins[e].push([c, d[e]]) }, call: function (a, b, c) { var d, e = a.plugins[b]; if (e && a.element[0].parentNode && 11 !== a.element[0].parentNode.nodeType) for (d = 0; d < e.length; d++) a.options[e[d][0]] && e[d][1].apply(a.element, c) } }, hasScroll: function (b, c) { if ("hidden" === a(b).css("overflow")) return !1; var d = c && "left" === c ? "scrollLeft" : "scrollTop", e = !1; return b[d] > 0 || (b[d] = 1, e = b[d] > 0, b[d] = 0, e) } }) }(jQuery), function (a, b) { var c = 0, d = Array.prototype.slice, e = a.cleanData; a.cleanData = function (b) { for (var d, c = 0; null != (d = b[c]); c++) try { a(d).triggerHandler("remove") } catch (a) { } e(b) }, a.widget = function (b, c, d) { var e, f, g, h, i = {}, j = b.split(".")[0]; b = b.split(".")[1], e = j + "-" + b, d || (d = c, c = a.Widget), a.expr[":"][e.toLowerCase()] = function (b) { return !!a.data(b, e) }, a[j] = a[j] || {}, f = a[j][b], g = a[j][b] = function (a, b) { return this._createWidget ? void(arguments.length && this._createWidget(a, b)) : new g(a, b) }, a.extend(g, f, { version: d.version, _proto: a.extend({}, d), _childConstructors: [] }), h = new c, h.options = a.widget.extend({}, h.options), a.each(d, function (b, d) { return a.isFunction(d) ? void(i[b] = function () { var a = function () { return c.prototype[b].apply(this, arguments) }, e = function (a) { return c.prototype[b].apply(this, a) }; return function () { var f, b = this._super, c = this._superApply; return this._super = a, this._superApply = e, f = d.apply(this, arguments), this._super = b, this._superApply = c, f } }()) : void(i[b] = d) }), g.prototype = a.widget.extend(h, {widgetEventPrefix: f ? h.widgetEventPrefix : b}, i, { constructor: g, namespace: j, widgetName: b, widgetFullName: e }), f ? (a.each(f._childConstructors, function (b, c) { var d = c.prototype; a.widget(d.namespace + "." + d.widgetName, g, c._proto) }), delete f._childConstructors) : c._childConstructors.push(g), a.widget.bridge(b, g) }, a.widget.extend = function (c) { for (var h, i, e = d.call(arguments, 1), f = 0, g = e.length; f < g; f++) for (h in e[f]) i = e[f][h], e[f].hasOwnProperty(h) && i !== b && (a.isPlainObject(i) ? c[h] = a.isPlainObject(c[h]) ? a.widget.extend({}, c[h], i) : a.widget.extend({}, i) : c[h] = i); return c }, a.widget.bridge = function (c, e) { var f = e.prototype.widgetFullName || c; a.fn[c] = function (g) { var h = "string" == typeof g, i = d.call(arguments, 1), j = this; return g = !h && i.length ? a.widget.extend.apply(null, [g].concat(i)) : g, h ? this.each(function () { var d, e = a.data(this, f); return e ? a.isFunction(e[g]) && "_" !== g.charAt(0) ? (d = e[g].apply(e, i), d !== e && d !== b ? (j = d && d.jquery ? j.pushStack(d.get()) : d, !1) : void 0) : a.error("no such method '" + g + "' for " + c + " widget instance") : a.error("cannot call methods on " + c + " prior to initialization; attempted to call method '" + g + "'") }) : this.each(function () { var b = a.data(this, f); b ? b.option(g || {})._init() : a.data(this, f, new e(g, this)) }), j } }, a.Widget = function () { }, a.Widget._childConstructors = [], a.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", defaultElement: "
    ", options: {disabled: !1, create: null}, _createWidget: function (b, d) { d = a(d || this.defaultElement || this)[0], this.element = a(d), this.uuid = c++, this.eventNamespace = "." + this.widgetName + this.uuid, this.options = a.widget.extend({}, this.options, this._getCreateOptions(), b), this.bindings = a(), this.hoverable = a(), this.focusable = a(), d !== this && (a.data(d, this.widgetFullName, this), this._on(!0, this.element, { remove: function (a) { a.target === d && this.destroy() } }), this.document = a(d.style ? d.ownerDocument : d.document || d), this.window = a(this.document[0].defaultView || this.document[0].parentWindow)), this._create(), this._trigger("create", null, this._getCreateEventData()), this._init() }, _getCreateOptions: a.noop, _getCreateEventData: a.noop, _create: a.noop, _init: a.noop, destroy: function () { this._destroy(), this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(a.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: a.noop, widget: function () { return this.element }, option: function (c, d) { var f, g, h, e = c; if (0 === arguments.length) return a.widget.extend({}, this.options); if ("string" == typeof c) if (e = {}, f = c.split("."), c = f.shift(), f.length) { for (g = e[c] = a.widget.extend({}, this.options[c]), h = 0; h < f.length - 1; h++) g[f[h]] = g[f[h]] || {}, g = g[f[h]]; if (c = f.pop(), d === b) return g[c] === b ? null : g[c]; g[c] = d } else { if (d === b) return this.options[c] === b ? null : this.options[c]; e[c] = d } return this._setOptions(e), this }, _setOptions: function (a) { var b; for (b in a) this._setOption(b, a[b]); return this }, _setOption: function (a, b) { return this.options[a] = b, "disabled" === a && (this.widget().toggleClass(this.widgetFullName + "-disabled ui-state-disabled", !!b).attr("aria-disabled", b), this.hoverable.removeClass("ui-state-hover"), this.focusable.removeClass("ui-state-focus")), this }, enable: function () { return this._setOption("disabled", !1) }, disable: function () { return this._setOption("disabled", !0) }, _on: function (b, c, d) { var e, f = this; "boolean" != typeof b && (d = c, c = b, b = !1), d ? (c = e = a(c), this.bindings = this.bindings.add(c)) : (d = c, c = this.element, e = this.widget()), a.each(d, function (d, g) { function h() { if (b || f.options.disabled !== !0 && !a(this).hasClass("ui-state-disabled")) return ("string" == typeof g ? f[g] : g).apply(f, arguments) } "string" != typeof g && (h.guid = g.guid = g.guid || h.guid || a.guid++); var i = d.match(/^(\w+)\s*(.*)$/), j = i[1] + f.eventNamespace, k = i[2]; k ? e.delegate(k, j, h) : c.bind(j, h) }) }, _off: function (a, b) { b = (b || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace, a.unbind(b).undelegate(b) }, _delay: function (a, b) { function c() { return ("string" == typeof a ? d[a] : a).apply(d, arguments) } var d = this; return setTimeout(c, b || 0) }, _hoverable: function (b) { this.hoverable = this.hoverable.add(b), this._on(b, { mouseenter: function (b) { a(b.currentTarget).addClass("ui-state-hover") }, mouseleave: function (b) { a(b.currentTarget).removeClass("ui-state-hover") } }) }, _focusable: function (b) { this.focusable = this.focusable.add(b), this._on(b, { focusin: function (b) { a(b.currentTarget).addClass("ui-state-focus") }, focusout: function (b) { a(b.currentTarget).removeClass("ui-state-focus") } }) }, _trigger: function (b, c, d) { var e, f, g = this.options[b]; if (d = d || {}, c = a.Event(c), c.type = (b === this.widgetEventPrefix ? b : this.widgetEventPrefix + b).toLowerCase(), c.target = this.element[0], f = c.originalEvent) for (e in f) e in c || (c[e] = f[e]); return this.element.trigger(c, d), !(a.isFunction(g) && g.apply(this.element[0], [c].concat(d)) === !1 || c.isDefaultPrevented()) } }, a.each({show: "fadeIn", hide: "fadeOut"}, function (b, c) { a.Widget.prototype["_" + b] = function (d, e, f) { "string" == typeof e && (e = {effect: e}); var g, h = e ? e === !0 || "number" == typeof e ? c : e.effect || c : b; e = e || {}, "number" == typeof e && (e = {duration: e}), g = !a.isEmptyObject(e), e.complete = f, e.delay && d.delay(e.delay), g && a.effects && a.effects.effect[h] ? d[b](e) : h !== b && d[h] ? d[h](e.duration, e.easing, f) : d.queue(function (c) { a(this)[b](), f && f.call(d[0]), c() }) } }) }(jQuery), function (a, b) { var c = !1; a(document).mouseup(function () { c = !1 }), a.widget("ui.mouse", { version: "1.10.3", options: {cancel: "input,textarea,button,select,option", distance: 1, delay: 0}, _mouseInit: function () { var b = this; this.element.bind("mousedown." + this.widgetName, function (a) { return b._mouseDown(a) }).bind("click." + this.widgetName, function (c) { if (!0 === a.data(c.target, b.widgetName + ".preventClickEvent")) return a.removeData(c.target, b.widgetName + ".preventClickEvent"), c.stopImmediatePropagation(), !1 }), this.started = !1 }, _mouseDestroy: function () { this.element.unbind("." + this.widgetName), this._mouseMoveDelegate && a(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate) }, _mouseDown: function (b) { if (!c) { this._mouseStarted && this._mouseUp(b), this._mouseDownEvent = b; var d = this, e = 1 === b.which, f = !("string" != typeof this.options.cancel || !b.target.nodeName) && a(b.target).closest(this.options.cancel).length; return !(e && !f && this._mouseCapture(b)) || (this.mouseDelayMet = !this.options.delay, this.mouseDelayMet || (this._mouseDelayTimer = setTimeout(function () { d.mouseDelayMet = !0 }, this.options.delay)), this._mouseDistanceMet(b) && this._mouseDelayMet(b) && (this._mouseStarted = this._mouseStart(b) !== !1, !this._mouseStarted) ? (b.preventDefault(), !0) : (!0 === a.data(b.target, this.widgetName + ".preventClickEvent") && a.removeData(b.target, this.widgetName + ".preventClickEvent"), this._mouseMoveDelegate = function (a) { return d._mouseMove(a) }, this._mouseUpDelegate = function (a) { return d._mouseUp(a) }, a(document).bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate), b.preventDefault(), c = !0, !0)) } }, _mouseMove: function (b) { return a.ui.ie && (!document.documentMode || document.documentMode < 9) && !b.button ? this._mouseUp(b) : this._mouseStarted ? (this._mouseDrag(b), b.preventDefault()) : (this._mouseDistanceMet(b) && this._mouseDelayMet(b) && (this._mouseStarted = this._mouseStart(this._mouseDownEvent, b) !== !1, this._mouseStarted ? this._mouseDrag(b) : this._mouseUp(b)), !this._mouseStarted) }, _mouseUp: function (b) { return a(document).unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate), this._mouseStarted && (this._mouseStarted = !1, b.target === this._mouseDownEvent.target && a.data(b.target, this.widgetName + ".preventClickEvent", !0), this._mouseStop(b)), !1 }, _mouseDistanceMet: function (a) { return Math.max(Math.abs(this._mouseDownEvent.pageX - a.pageX), Math.abs(this._mouseDownEvent.pageY - a.pageY)) >= this.options.distance }, _mouseDelayMet: function () { return this.mouseDelayMet }, _mouseStart: function () { }, _mouseDrag: function () { }, _mouseStop: function () { }, _mouseCapture: function () { return !0 } }) }(jQuery), function (a, b) { a.widget("ui.draggable", a.ui.mouse, { version: "1.10.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 || /^(?:r|a|f)/.test(this.element.css("position")) || (this.element[0].style.position = "relative"), this.options.addClasses && this.element.addClass("ui-draggable"), this.options.disabled && this.element.addClass("ui-draggable-disabled"), this._mouseInit() }, _destroy: function () { this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"), this._mouseDestroy() }, _mouseCapture: function (b) { var c = this.options; return !(this.helper || c.disabled || a(b.target).closest(".ui-resizable-handle").length > 0) && (this.handle = this._getHandle(b), !!this.handle && (a(c.iframeFix === !0 ? "iframe" : c.iframeFix).each(function () { a("
    ").css({ width: this.offsetWidth + "px", height: this.offsetHeight + "px", position: "absolute", opacity: "0.001", zIndex: 1e3 }).css(a(this).offset()).appendTo("body") }), !0)) }, _mouseStart: function (b) { var c = this.options; return this.helper = this._createHelper(b), this.helper.addClass("ui-draggable-dragging"), this._cacheHelperProportions(), a.ui.ddmanager && (a.ui.ddmanager.current = this), this._cacheMargins(), this.cssPosition = this.helper.css("position"), this.scrollParent = this.helper.scrollParent(), this.offsetParent = this.helper.offsetParent(), this.offsetParentCssPosition = this.offsetParent.css("position"), this.offset = this.positionAbs = this.element.offset(), this.offset = { top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left }, this.offset.scroll = !1, a.extend(this.offset, { click: { left: b.pageX - this.offset.left, top: b.pageY - this.offset.top }, parent: this._getParentOffset(), relative: this._getRelativeOffset() }), this.originalPosition = this.position = this._generatePosition(b), this.originalPageX = b.pageX, this.originalPageY = b.pageY, c.cursorAt && this._adjustOffsetFromHelper(c.cursorAt), this._setContainment(), this._trigger("start", b) === !1 ? (this._clear(), !1) : (this._cacheHelperProportions(), a.ui.ddmanager && !c.dropBehaviour && a.ui.ddmanager.prepareOffsets(this, b), this._mouseDrag(b, !0), a.ui.ddmanager && a.ui.ddmanager.dragStart(this, b), !0) }, _mouseDrag: function (b, c) { if ("fixed" === this.offsetParentCssPosition && (this.offset.parent = this._getParentOffset()), this.position = this._generatePosition(b), this.positionAbs = this._convertPositionTo("absolute"), !c) { var d = this._uiHash(); if (this._trigger("drag", b, d) === !1) return this._mouseUp({}), !1; this.position = d.position } return 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"), a.ui.ddmanager && a.ui.ddmanager.drag(this, b), !1 }, _mouseStop: function (b) { var c = this, d = !1; return a.ui.ddmanager && !this.options.dropBehaviour && (d = a.ui.ddmanager.drop(this, b)), this.dropped && (d = this.dropped, this.dropped = !1), !("original" === this.options.helper && !a.contains(this.element[0].ownerDocument, this.element[0])) && ("invalid" === this.options.revert && !d || "valid" === this.options.revert && d || this.options.revert === !0 || a.isFunction(this.options.revert) && this.options.revert.call(this.element, d) ? a(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function () { c._trigger("stop", b) !== !1 && c._clear() }) : this._trigger("stop", b) !== !1 && this._clear(), !1) }, _mouseUp: function (b) { return a("div.ui-draggable-iframeFix").each(function () { this.parentNode.removeChild(this) }), a.ui.ddmanager && a.ui.ddmanager.dragStop(this, b), a.ui.mouse.prototype._mouseUp.call(this, b) }, cancel: function () { return this.helper.is(".ui-draggable-dragging") ? this._mouseUp({}) : this._clear(), this }, _getHandle: function (b) { return !this.options.handle || !!a(b.target).closest(this.element.find(this.options.handle)).length }, _createHelper: function (b) { var c = this.options, d = a.isFunction(c.helper) ? a(c.helper.apply(this.element[0], [b])) : "clone" === c.helper ? this.element.clone().removeAttr("id") : this.element; return d.parents("body").length || d.appendTo("parent" === c.appendTo ? this.element[0].parentNode : c.appendTo), d[0] === this.element[0] || /(fixed|absolute)/.test(d.css("position")) || d.css("position", "absolute"), d }, _adjustOffsetFromHelper: function (b) { "string" == typeof b && (b = b.split(" ")), a.isArray(b) && (b = { left: +b[0], top: +b[1] || 0 }), "left" in b && (this.offset.click.left = b.left + this.margins.left), "right" in b && (this.offset.click.left = this.helperProportions.width - b.right + this.margins.left), "top" in b && (this.offset.click.top = b.top + this.margins.top), "bottom" in b && (this.offset.click.top = this.helperProportions.height - b.bottom + this.margins.top) }, _getParentOffset: function () { var b = this.offsetParent.offset(); return "absolute" === this.cssPosition && this.scrollParent[0] !== document && a.contains(this.scrollParent[0], this.offsetParent[0]) && (b.left += this.scrollParent.scrollLeft(), b.top += this.scrollParent.scrollTop()), (this.offsetParent[0] === document.body || this.offsetParent[0].tagName && "html" === this.offsetParent[0].tagName.toLowerCase() && a.ui.ie) && (b = { top: 0, left: 0 }), { top: b.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: b.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0) } }, _getRelativeOffset: function () { if ("relative" === this.cssPosition) { var a = this.element.position(); return { top: a.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: a.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft() } } return {top: 0, left: 0} }, _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 b, c, d, e = this.options; return e.containment ? "window" === e.containment ? void(this.containment = [a(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, a(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, a(window).scrollLeft() + a(window).width() - this.helperProportions.width - this.margins.left, a(window).scrollTop() + (a(window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]) : "document" === e.containment ? void(this.containment = [0, 0, a(document).width() - this.helperProportions.width - this.margins.left, (a(document).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]) : e.containment.constructor === Array ? void(this.containment = e.containment) : ("parent" === e.containment && (e.containment = this.helper[0].parentNode), c = a(e.containment), d = c[0], void(d && (b = "hidden" !== c.css("overflow"), this.containment = [(parseInt(c.css("borderLeftWidth"), 10) || 0) + (parseInt(c.css("paddingLeft"), 10) || 0), (parseInt(c.css("borderTopWidth"), 10) || 0) + (parseInt(c.css("paddingTop"), 10) || 0), (b ? Math.max(d.scrollWidth, d.offsetWidth) : d.offsetWidth) - (parseInt(c.css("borderRightWidth"), 10) || 0) - (parseInt(c.css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (b ? Math.max(d.scrollHeight, d.offsetHeight) : d.offsetHeight) - (parseInt(c.css("borderBottomWidth"), 10) || 0) - (parseInt(c.css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom], this.relative_container = c))) : void(this.containment = null) }, _convertPositionTo: function (b, c) { c || (c = this.position); var d = "absolute" === b ? 1 : -1, e = "absolute" !== this.cssPosition || this.scrollParent[0] !== document && a.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent; return this.offset.scroll || (this.offset.scroll = { top: e.scrollTop(), left: e.scrollLeft() }), { top: c.top + this.offset.relative.top * d + this.offset.parent.top * d - ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : this.offset.scroll.top) * d, left: c.left + this.offset.relative.left * d + this.offset.parent.left * d - ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : this.offset.scroll.left) * d } }, _generatePosition: function (b) { var c, d, e, f, g = this.options, h = "absolute" !== this.cssPosition || this.scrollParent[0] !== document && a.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent, i = b.pageX, j = b.pageY; return this.offset.scroll || (this.offset.scroll = { top: h.scrollTop(), left: h.scrollLeft() }), this.originalPosition && (this.containment && (this.relative_container ? (d = this.relative_container.offset(), c = [this.containment[0] + d.left, this.containment[1] + d.top, this.containment[2] + d.left, this.containment[3] + d.top]) : c = this.containment, b.pageX - this.offset.click.left < c[0] && (i = c[0] + this.offset.click.left), b.pageY - this.offset.click.top < c[1] && (j = c[1] + this.offset.click.top), b.pageX - this.offset.click.left > c[2] && (i = c[2] + this.offset.click.left), b.pageY - this.offset.click.top > c[3] && (j = c[3] + this.offset.click.top)), g.grid && (e = g.grid[1] ? this.originalPageY + Math.round((j - this.originalPageY) / g.grid[1]) * g.grid[1] : this.originalPageY, j = c ? e - this.offset.click.top >= c[1] || e - this.offset.click.top > c[3] ? e : e - this.offset.click.top >= c[1] ? e - g.grid[1] : e + g.grid[1] : e, f = g.grid[0] ? this.originalPageX + Math.round((i - this.originalPageX) / g.grid[0]) * g.grid[0] : this.originalPageX, i = c ? f - this.offset.click.left >= c[0] || f - this.offset.click.left > c[2] ? f : f - this.offset.click.left >= c[0] ? f - g.grid[0] : f + g.grid[0] : f)), { top: j - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : this.offset.scroll.top), left: i - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : 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 }, _trigger: function (b, c, d) { return d = d || this._uiHash(), a.ui.plugin.call(this, b, [c, d]), "drag" === b && (this.positionAbs = this._convertPositionTo("absolute")), a.Widget.prototype._trigger.call(this, b, c, d) }, plugins: {}, _uiHash: function () { return { helper: this.helper, position: this.position, originalPosition: this.originalPosition, offset: this.positionAbs } } }), a.ui.plugin.add("draggable", "connectToSortable", { start: function (b, c) { var d = a(this).data("ui-draggable"), e = d.options, f = a.extend({}, c, {item: d.element}); d.sortables = [], a(e.connectToSortable).each(function () { var c = a.data(this, "ui-sortable"); c && !c.options.disabled && (d.sortables.push({ instance: c, shouldRevert: c.options.revert }), c.refreshPositions(), c._trigger("activate", b, f)) }) }, stop: function (b, c) { var d = a(this).data("ui-draggable"), e = a.extend({}, c, {item: d.element}); a.each(d.sortables, function () { this.instance.isOver ? (this.instance.isOver = 0, d.cancelHelperRemoval = !0, this.instance.cancelHelperRemoval = !1, this.shouldRevert && (this.instance.options.revert = this.shouldRevert), this.instance._mouseStop(b), this.instance.options.helper = this.instance.options._helper, "original" === d.options.helper && this.instance.currentItem.css({ top: "auto", left: "auto" })) : (this.instance.cancelHelperRemoval = !1, this.instance._trigger("deactivate", b, e)) }) }, drag: function (b, c) { var d = a(this).data("ui-draggable"), e = this; a.each(d.sortables, function () { var f = !1, g = this; this.instance.positionAbs = d.positionAbs, this.instance.helperProportions = d.helperProportions, this.instance.offset.click = d.offset.click, this.instance._intersectsWith(this.instance.containerCache) && (f = !0, a.each(d.sortables, function () { return this.instance.positionAbs = d.positionAbs, this.instance.helperProportions = d.helperProportions, this.instance.offset.click = d.offset.click, this !== g && this.instance._intersectsWith(this.instance.containerCache) && a.contains(g.instance.element[0], this.instance.element[0]) && (f = !1), f })), f ? (this.instance.isOver || (this.instance.isOver = 1, this.instance.currentItem = a(e).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item", !0), this.instance.options._helper = this.instance.options.helper, this.instance.options.helper = function () { return c.helper[0] }, b.target = this.instance.currentItem[0], this.instance._mouseCapture(b, !0), this.instance._mouseStart(b, !0, !0), this.instance.offset.click.top = d.offset.click.top, this.instance.offset.click.left = d.offset.click.left, this.instance.offset.parent.left -= d.offset.parent.left - this.instance.offset.parent.left, this.instance.offset.parent.top -= d.offset.parent.top - this.instance.offset.parent.top, d._trigger("toSortable", b), d.dropped = this.instance.element, d.currentItem = d.element, this.instance.fromOutside = d), this.instance.currentItem && this.instance._mouseDrag(b)) : this.instance.isOver && (this.instance.isOver = 0, this.instance.cancelHelperRemoval = !0, this.instance.options.revert = !1, this.instance._trigger("out", b, this.instance._uiHash(this.instance)), this.instance._mouseStop(b, !0), this.instance.options.helper = this.instance.options._helper, this.instance.currentItem.remove(), this.instance.placeholder && this.instance.placeholder.remove(), d._trigger("fromSortable", b), d.dropped = !1) }) } }), a.ui.plugin.add("draggable", "cursor", { start: function () { var b = a("body"), c = a(this).data("ui-draggable").options; b.css("cursor") && (c._cursor = b.css("cursor")), b.css("cursor", c.cursor) }, stop: function () { var b = a(this).data("ui-draggable").options; b._cursor && a("body").css("cursor", b._cursor) } }), a.ui.plugin.add("draggable", "opacity", { start: function (b, c) { var d = a(c.helper), e = a(this).data("ui-draggable").options; d.css("opacity") && (e._opacity = d.css("opacity")), d.css("opacity", e.opacity) }, stop: function (b, c) { var d = a(this).data("ui-draggable").options; d._opacity && a(c.helper).css("opacity", d._opacity) } }), a.ui.plugin.add("draggable", "scroll", { start: function () { var b = a(this).data("ui-draggable"); b.scrollParent[0] !== document && "HTML" !== b.scrollParent[0].tagName && (b.overflowOffset = b.scrollParent.offset()) }, drag: function (b) { var c = a(this).data("ui-draggable"), d = c.options, e = !1; c.scrollParent[0] !== document && "HTML" !== c.scrollParent[0].tagName ? (d.axis && "x" === d.axis || (c.overflowOffset.top + c.scrollParent[0].offsetHeight - b.pageY < d.scrollSensitivity ? c.scrollParent[0].scrollTop = e = c.scrollParent[0].scrollTop + d.scrollSpeed : b.pageY - c.overflowOffset.top < d.scrollSensitivity && (c.scrollParent[0].scrollTop = e = c.scrollParent[0].scrollTop - d.scrollSpeed)), d.axis && "y" === d.axis || (c.overflowOffset.left + c.scrollParent[0].offsetWidth - b.pageX < d.scrollSensitivity ? c.scrollParent[0].scrollLeft = e = c.scrollParent[0].scrollLeft + d.scrollSpeed : b.pageX - c.overflowOffset.left < d.scrollSensitivity && (c.scrollParent[0].scrollLeft = e = c.scrollParent[0].scrollLeft - d.scrollSpeed))) : (d.axis && "x" === d.axis || (b.pageY - a(document).scrollTop() < d.scrollSensitivity ? e = a(document).scrollTop(a(document).scrollTop() - d.scrollSpeed) : a(window).height() - (b.pageY - a(document).scrollTop()) < d.scrollSensitivity && (e = a(document).scrollTop(a(document).scrollTop() + d.scrollSpeed))), d.axis && "y" === d.axis || (b.pageX - a(document).scrollLeft() < d.scrollSensitivity ? e = a(document).scrollLeft(a(document).scrollLeft() - d.scrollSpeed) : a(window).width() - (b.pageX - a(document).scrollLeft()) < d.scrollSensitivity && (e = a(document).scrollLeft(a(document).scrollLeft() + d.scrollSpeed)))), e !== !1 && a.ui.ddmanager && !d.dropBehaviour && a.ui.ddmanager.prepareOffsets(c, b) } }), a.ui.plugin.add("draggable", "snap", { start: function () { var b = a(this).data("ui-draggable"), c = b.options; b.snapElements = [], a(c.snap.constructor !== String ? c.snap.items || ":data(ui-draggable)" : c.snap).each(function () { var c = a(this), d = c.offset(); this !== b.element[0] && b.snapElements.push({ item: this, width: c.outerWidth(), height: c.outerHeight(), top: d.top, left: d.left }) }) }, drag: function (b, c) { var d, e, f, g, h, i, j, k, l, m, n = a(this).data("ui-draggable"), o = n.options, p = o.snapTolerance, q = c.offset.left, r = q + n.helperProportions.width, s = c.offset.top, t = s + n.helperProportions.height; for (l = n.snapElements.length - 1; l >= 0; l--) h = n.snapElements[l].left, i = h + n.snapElements[l].width, j = n.snapElements[l].top, k = j + n.snapElements[l].height, r < h - p || q > i + p || t < j - p || s > k + p || !a.contains(n.snapElements[l].item.ownerDocument, n.snapElements[l].item) ? (n.snapElements[l].snapping && n.options.snap.release && n.options.snap.release.call(n.element, b, a.extend(n._uiHash(), {snapItem: n.snapElements[l].item})), n.snapElements[l].snapping = !1) : ("inner" !== o.snapMode && (d = Math.abs(j - t) <= p, e = Math.abs(k - s) <= p, f = Math.abs(h - r) <= p, g = Math.abs(i - q) <= p, d && (c.position.top = n._convertPositionTo("relative", { top: j - n.helperProportions.height, left: 0 }).top - n.margins.top), e && (c.position.top = n._convertPositionTo("relative", { top: k, left: 0 }).top - n.margins.top), f && (c.position.left = n._convertPositionTo("relative", { top: 0, left: h - n.helperProportions.width }).left - n.margins.left), g && (c.position.left = n._convertPositionTo("relative", { top: 0, left: i }).left - n.margins.left)), m = d || e || f || g, "outer" !== o.snapMode && (d = Math.abs(j - s) <= p, e = Math.abs(k - t) <= p, f = Math.abs(h - q) <= p, g = Math.abs(i - r) <= p, d && (c.position.top = n._convertPositionTo("relative", { top: j, left: 0 }).top - n.margins.top), e && (c.position.top = n._convertPositionTo("relative", { top: k - n.helperProportions.height, left: 0 }).top - n.margins.top), f && (c.position.left = n._convertPositionTo("relative", { top: 0, left: h }).left - n.margins.left), g && (c.position.left = n._convertPositionTo("relative", { top: 0, left: i - n.helperProportions.width }).left - n.margins.left)), !n.snapElements[l].snapping && (d || e || f || g || m) && n.options.snap.snap && n.options.snap.snap.call(n.element, b, a.extend(n._uiHash(), {snapItem: n.snapElements[l].item})), n.snapElements[l].snapping = d || e || f || g || m) } }), a.ui.plugin.add("draggable", "stack", { start: function () { var b, c = this.data("ui-draggable").options, d = a.makeArray(a(c.stack)).sort(function (b, c) { return (parseInt(a(b).css("zIndex"), 10) || 0) - (parseInt(a(c).css("zIndex"), 10) || 0) }); d.length && (b = parseInt(a(d[0]).css("zIndex"), 10) || 0, a(d).each(function (c) { a(this).css("zIndex", b + c) }), this.css("zIndex", b + d.length)) } }), a.ui.plugin.add("draggable", "zIndex", { start: function (b, c) { var d = a(c.helper), e = a(this).data("ui-draggable").options; d.css("zIndex") && (e._zIndex = d.css("zIndex")), d.css("zIndex", e.zIndex) }, stop: function (b, c) { var d = a(this).data("ui-draggable").options; d._zIndex && a(c.helper).css("zIndex", d._zIndex) } }) }(jQuery), function (a, b) { function c(a, b, c) { return a > b && a < b + c } a.widget("ui.droppable", { version: "1.10.3", widgetEventPrefix: "drop", options: { accept: "*", activeClass: !1, addClasses: !0, greedy: !1, hoverClass: !1, scope: "default", tolerance: "intersect", activate: null, deactivate: null, drop: null, out: null, over: null }, _create: function () { var b = this.options, c = b.accept; this.isover = !1, this.isout = !0, this.accept = a.isFunction(c) ? c : function (a) { return a.is(c) }, this.proportions = { width: this.element[0].offsetWidth, height: this.element[0].offsetHeight }, a.ui.ddmanager.droppables[b.scope] = a.ui.ddmanager.droppables[b.scope] || [], a.ui.ddmanager.droppables[b.scope].push(this), b.addClasses && this.element.addClass("ui-droppable") }, _destroy: function () { for (var b = 0, c = a.ui.ddmanager.droppables[this.options.scope]; b < c.length; b++) c[b] === this && c.splice(b, 1); this.element.removeClass("ui-droppable ui-droppable-disabled") }, _setOption: function (b, c) { "accept" === b && (this.accept = a.isFunction(c) ? c : function (a) { return a.is(c) }), a.Widget.prototype._setOption.apply(this, arguments) }, _activate: function (b) { var c = a.ui.ddmanager.current; this.options.activeClass && this.element.addClass(this.options.activeClass), c && this._trigger("activate", b, this.ui(c)) }, _deactivate: function (b) { var c = a.ui.ddmanager.current; this.options.activeClass && this.element.removeClass(this.options.activeClass), c && this._trigger("deactivate", b, this.ui(c)) }, _over: function (b) { var c = a.ui.ddmanager.current; c && (c.currentItem || c.element)[0] !== this.element[0] && this.accept.call(this.element[0], c.currentItem || c.element) && (this.options.hoverClass && this.element.addClass(this.options.hoverClass), this._trigger("over", b, this.ui(c))) }, _out: function (b) { var c = a.ui.ddmanager.current; c && (c.currentItem || c.element)[0] !== this.element[0] && this.accept.call(this.element[0], c.currentItem || c.element) && (this.options.hoverClass && this.element.removeClass(this.options.hoverClass), this._trigger("out", b, this.ui(c))) }, _drop: function (b, c) { var d = c || a.ui.ddmanager.current, e = !1; return !(!d || (d.currentItem || d.element)[0] === this.element[0]) && (this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function () { var b = a.data(this, "ui-droppable"); if (b.options.greedy && !b.options.disabled && b.options.scope === d.options.scope && b.accept.call(b.element[0], d.currentItem || d.element) && a.ui.intersect(d, a.extend(b, {offset: b.element.offset()}), b.options.tolerance)) return e = !0, !1 }), !e && (!!this.accept.call(this.element[0], d.currentItem || d.element) && (this.options.activeClass && this.element.removeClass(this.options.activeClass), this.options.hoverClass && this.element.removeClass(this.options.hoverClass), this._trigger("drop", b, this.ui(d)), this.element))) }, ui: function (a) { return { draggable: a.currentItem || a.element, helper: a.helper, position: a.position, offset: a.positionAbs } } }), a.ui.intersect = function (a, b, d) { if (!b.offset) return !1; var e, f, g = (a.positionAbs || a.position.absolute).left, h = g + a.helperProportions.width, i = (a.positionAbs || a.position.absolute).top, j = i + a.helperProportions.height, k = b.offset.left, l = k + b.proportions.width, m = b.offset.top, n = m + b.proportions.height; switch (d) { case"fit": return k <= g && h <= l && m <= i && j <= n; case"intersect": return k < g + a.helperProportions.width / 2 && h - a.helperProportions.width / 2 < l && m < i + a.helperProportions.height / 2 && j - a.helperProportions.height / 2 < n; case"pointer": return e = (a.positionAbs || a.position.absolute).left + (a.clickOffset || a.offset.click).left, f = (a.positionAbs || a.position.absolute).top + (a.clickOffset || a.offset.click).top, c(f, m, b.proportions.height) && c(e, k, b.proportions.width); case"touch": return (i >= m && i <= n || j >= m && j <= n || i < m && j > n) && (g >= k && g <= l || h >= k && h <= l || g < k && h > l); default: return !1 } }, a.ui.ddmanager = { current: null, droppables: {default: []}, prepareOffsets: function (b, c) { var d, e, f = a.ui.ddmanager.droppables[b.options.scope] || [], g = c ? c.type : null, h = (b.currentItem || b.element).find(":data(ui-droppable)").addBack(); a:for (d = 0; d < f.length; d++) if (!(f[d].options.disabled || b && !f[d].accept.call(f[d].element[0], b.currentItem || b.element))) { for (e = 0; e < h.length; e++) if (h[e] === f[d].element[0]) { f[d].proportions.height = 0; continue a } f[d].visible = "none" !== f[d].element.css("display"), f[d].visible && ("mousedown" === g && f[d]._activate.call(f[d], c), f[d].offset = f[d].element.offset(), f[d].proportions = { width: f[d].element[0].offsetWidth, height: f[d].element[0].offsetHeight }) } }, drop: function (b, c) { var d = !1; return a.each((a.ui.ddmanager.droppables[b.options.scope] || []).slice(), function () { this.options && (!this.options.disabled && this.visible && a.ui.intersect(b, this, this.options.tolerance) && (d = this._drop.call(this, c) || d), !this.options.disabled && this.visible && this.accept.call(this.element[0], b.currentItem || b.element) && (this.isout = !0, this.isover = !1, this._deactivate.call(this, c))) }), d }, dragStart: function (b, c) { b.element.parentsUntil("body").bind("scroll.droppable", function () { b.options.refreshPositions || a.ui.ddmanager.prepareOffsets(b, c) }) }, drag: function (b, c) { b.options.refreshPositions && a.ui.ddmanager.prepareOffsets(b, c), a.each(a.ui.ddmanager.droppables[b.options.scope] || [], function () { if (!this.options.disabled && !this.greedyChild && this.visible) { var d, e, f, g = a.ui.intersect(b, this, this.options.tolerance), h = !g && this.isover ? "isout" : g && !this.isover ? "isover" : null; h && (this.options.greedy && (e = this.options.scope, f = this.element.parents(":data(ui-droppable)").filter(function () { return a.data(this, "ui-droppable").options.scope === e }), f.length && (d = a.data(f[0], "ui-droppable"), d.greedyChild = "isover" === h)), d && "isover" === h && (d.isover = !1, d.isout = !0, d._out.call(d, c)), this[h] = !0, this["isout" === h ? "isover" : "isout"] = !1, this["isover" === h ? "_over" : "_out"].call(this, c), d && "isout" === h && (d.isout = !1, d.isover = !0, d._over.call(d, c))) } }) }, dragStop: function (b, c) { b.element.parentsUntil("body").unbind("scroll.droppable"), b.options.refreshPositions || a.ui.ddmanager.prepareOffsets(b, c) } } }(jQuery), function (a, b) { function c(a) { return parseInt(a, 10) || 0 } function d(a) { return !isNaN(parseInt(a, 10)) } a.widget("ui.resizable", a.ui.mouse, { version: "1.10.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 }, _create: function () { var b, c, d, e, f, g = this, h = this.options; if (this.element.addClass("ui-resizable"), a.extend(this, { _aspectRatio: !!h.aspectRatio, aspectRatio: h.aspectRatio, originalElement: this.element, _proportionallyResizeElements: [], _helper: h.helper || h.ghost || h.animate ? h.helper || "ui-resizable-helper" : null }), this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i) && (this.element.wrap(a("
    ").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.data("ui-resizable")), 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 = h.handles || (a(".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"), b = this.handles.split(","), this.handles = {}, c = 0; c < b.length; c++) d = a.trim(b[c]), f = "ui-resizable-" + d, e = a("
    "), e.css({zIndex: h.zIndex}), "se" === d && e.addClass("ui-icon ui-icon-gripsmall-diagonal-se"), this.handles[d] = ".ui-resizable-" + d, this.element.append(e); this._renderAxis = function (b) { var c, d, e, f; b = b || this.element; for (c in this.handles) this.handles[c].constructor === String && (this.handles[c] = a(this.handles[c], this.element).show()), this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i) && (d = a(this.handles[c], this.element), f = /sw|ne|nw|se|n|s/.test(c) ? d.outerHeight() : d.outerWidth(), e = ["padding", /ne|nw|n/.test(c) ? "Top" : /se|sw|s/.test(c) ? "Bottom" : /^e$/.test(c) ? "Right" : "Left"].join(""), b.css(e, f), this._proportionallyResize()), a(this.handles[c]).length }, this._renderAxis(this.element), this._handles = a(".ui-resizable-handle", this.element).disableSelection(), this._handles.mouseover(function () { g.resizing || (this.className && (e = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)), g.axis = e && e[1] ? e[1] : "se") }), h.autoHide && (this._handles.hide(), a(this.element).addClass("ui-resizable-autohide").mouseenter(function () { h.disabled || (a(this).removeClass("ui-resizable-autohide"), g._handles.show()) }).mouseleave(function () { h.disabled || g.resizing || (a(this).addClass("ui-resizable-autohide"), g._handles.hide()) })), this._mouseInit() }, _destroy: function () { this._mouseDestroy(); var b, c = function (b) { a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove() }; return this.elementIsWrapper && (c(this.element), b = this.element, this.originalElement.css({ position: b.css("position"), width: b.outerWidth(), height: b.outerHeight(), top: b.css("top"), left: b.css("left") }).insertAfter(b), b.remove()), this.originalElement.css("resize", this.originalResizeStyle), c(this.originalElement), this }, _mouseCapture: function (b) { var c, d, e = !1; for (c in this.handles) d = a(this.handles[c])[0], (d === b.target || a.contains(d, b.target)) && (e = !0); return !this.options.disabled && e }, _mouseStart: function (b) { var d, e, f, g = this.options, h = this.element.position(), i = this.element; return this.resizing = !0, /absolute/.test(i.css("position")) ? i.css({ position: "absolute", top: i.css("top"), left: i.css("left") }) : i.is(".ui-draggable") && i.css({ position: "absolute", top: h.top, left: h.left }), this._renderProxy(), d = c(this.helper.css("left")), e = c(this.helper.css("top")), g.containment && (d += a(g.containment).scrollLeft() || 0, e += a(g.containment).scrollTop() || 0), this.offset = this.helper.offset(), this.position = { left: d, top: e }, this.size = this._helper ? {width: i.outerWidth(), height: i.outerHeight()} : { width: i.width(), height: i.height() }, this.originalSize = this._helper ? {width: i.outerWidth(), height: i.outerHeight()} : { width: i.width(), height: i.height() }, this.originalPosition = {left: d, top: e}, this.sizeDiff = { width: i.outerWidth() - i.width(), height: i.outerHeight() - i.height() }, this.originalMousePosition = { left: b.pageX, top: b.pageY }, this.aspectRatio = "number" == typeof g.aspectRatio ? g.aspectRatio : this.originalSize.width / this.originalSize.height || 1, f = a(".ui-resizable-" + this.axis).css("cursor"), a("body").css("cursor", "auto" === f ? this.axis + "-resize" : f), i.addClass("ui-resizable-resizing"), this._propagate("start", b), !0 }, _mouseDrag: function (b) { var c, d = this.helper, e = {}, f = this.originalMousePosition, g = this.axis, h = this.position.top, i = this.position.left, j = this.size.width, k = this.size.height, l = b.pageX - f.left || 0, m = b.pageY - f.top || 0, n = this._change[g]; return !!n && (c = n.apply(this, [b, l, m]), this._updateVirtualBoundaries(b.shiftKey), (this._aspectRatio || b.shiftKey) && (c = this._updateRatio(c, b)), c = this._respectSize(c, b), this._updateCache(c), this._propagate("resize", b), this.position.top !== h && (e.top = this.position.top + "px"), this.position.left !== i && (e.left = this.position.left + "px"), this.size.width !== j && (e.width = this.size.width + "px"), this.size.height !== k && (e.height = this.size.height + "px"), d.css(e), !this._helper && this._proportionallyResizeElements.length && this._proportionallyResize(), a.isEmptyObject(e) || this._trigger("resize", b, this.ui()), !1) }, _mouseStop: function (b) { this.resizing = !1; var c, d, e, f, g, h, i, j = this.options, k = this; return this._helper && (c = this._proportionallyResizeElements, d = c.length && /textarea/i.test(c[0].nodeName), e = d && a.ui.hasScroll(c[0], "left") ? 0 : k.sizeDiff.height, f = d ? 0 : k.sizeDiff.width, g = { width: k.helper.width() - f, height: k.helper.height() - e }, h = parseInt(k.element.css("left"), 10) + (k.position.left - k.originalPosition.left) || null, i = parseInt(k.element.css("top"), 10) + (k.position.top - k.originalPosition.top) || null, j.animate || this.element.css(a.extend(g, { top: i, left: h })), k.helper.height(k.size.height), k.helper.width(k.size.width), this._helper && !j.animate && this._proportionallyResize()), a("body").css("cursor", "auto"), this.element.removeClass("ui-resizable-resizing"), this._propagate("stop", b), this._helper && this.helper.remove(), !1 }, _updateVirtualBoundaries: function (a) { var b, c, e, f, g, h = this.options; g = { minWidth: d(h.minWidth) ? h.minWidth : 0, maxWidth: d(h.maxWidth) ? h.maxWidth : 1 / 0, minHeight: d(h.minHeight) ? h.minHeight : 0, maxHeight: d(h.maxHeight) ? h.maxHeight : 1 / 0 }, (this._aspectRatio || a) && (b = g.minHeight * this.aspectRatio, e = g.minWidth / this.aspectRatio, c = g.maxHeight * this.aspectRatio, f = g.maxWidth / this.aspectRatio, b > g.minWidth && (g.minWidth = b), e > g.minHeight && (g.minHeight = e), c < g.maxWidth && (g.maxWidth = c), f < g.maxHeight && (g.maxHeight = f)), this._vBoundaries = g }, _updateCache: function (a) { this.offset = this.helper.offset(), d(a.left) && (this.position.left = a.left), d(a.top) && (this.position.top = a.top), d(a.height) && (this.size.height = a.height), d(a.width) && (this.size.width = a.width) }, _updateRatio: function (a) { var b = this.position, c = this.size, e = this.axis; return d(a.height) ? a.width = a.height * this.aspectRatio : d(a.width) && (a.height = a.width / this.aspectRatio), "sw" === e && (a.left = b.left + (c.width - a.width), a.top = null), "nw" === e && (a.top = b.top + (c.height - a.height), a.left = b.left + (c.width - a.width)), a }, _respectSize: function (a) { var b = this._vBoundaries, c = this.axis, e = d(a.width) && b.maxWidth && b.maxWidth < a.width, f = d(a.height) && b.maxHeight && b.maxHeight < a.height, g = d(a.width) && b.minWidth && b.minWidth > a.width, h = d(a.height) && b.minHeight && b.minHeight > a.height, i = this.originalPosition.left + this.originalSize.width, j = this.position.top + this.size.height, k = /sw|nw|w/.test(c), l = /nw|ne|n/.test(c); return g && (a.width = b.minWidth), h && (a.height = b.minHeight), e && (a.width = b.maxWidth), f && (a.height = b.maxHeight), g && k && (a.left = i - b.minWidth), e && k && (a.left = i - b.maxWidth), h && l && (a.top = j - b.minHeight), f && l && (a.top = j - b.maxHeight), a.width || a.height || a.left || !a.top ? a.width || a.height || a.top || !a.left || (a.left = null) : a.top = null, a }, _proportionallyResize: function () { if (this._proportionallyResizeElements.length) { var a, b, c, d, e, f = this.helper || this.element; for (a = 0; a < this._proportionallyResizeElements.length; a++) { if (e = this._proportionallyResizeElements[a], !this.borderDif) for (this.borderDif = [], c = [e.css("borderTopWidth"), e.css("borderRightWidth"), e.css("borderBottomWidth"), e.css("borderLeftWidth")], d = [e.css("paddingTop"), e.css("paddingRight"), e.css("paddingBottom"), e.css("paddingLeft")], b = 0; b < c.length; b++) this.borderDif[b] = (parseInt(c[b], 10) || 0) + (parseInt(d[b], 10) || 0); e.css({ height: f.height() - this.borderDif[0] - this.borderDif[2] || 0, width: f.width() - this.borderDif[1] - this.borderDif[3] || 0 }) } } }, _renderProxy: function () { var b = this.element, c = this.options; this.elementOffset = b.offset(), this._helper ? (this.helper = this.helper || a("
    "), 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: ++c.zIndex }), this.helper.appendTo("body").disableSelection()) : this.helper = this.element }, _change: { e: function (a, b) { return {width: this.originalSize.width + b} }, w: function (a, b) { var c = this.originalSize, d = this.originalPosition; return {left: d.left + b, width: c.width - b} }, n: function (a, b, c) { var d = this.originalSize, e = this.originalPosition; return {top: e.top + c, height: d.height - c} }, s: function (a, b, c) { return {height: this.originalSize.height + c} }, se: function (b, c, d) { return a.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [b, c, d])) }, sw: function (b, c, d) { return a.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [b, c, d])) }, ne: function (b, c, d) { return a.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [b, c, d])) }, nw: function (b, c, d) { return a.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [b, c, d])) } }, _propagate: function (b, c) { a.ui.plugin.call(this, b, [c, this.ui()]), "resize" !== b && this._trigger(b, c, 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 } } }), a.ui.plugin.add("resizable", "animate", { stop: function (b) { var c = a(this).data("ui-resizable"), d = c.options, e = c._proportionallyResizeElements, f = e.length && /textarea/i.test(e[0].nodeName), g = f && a.ui.hasScroll(e[0], "left") ? 0 : c.sizeDiff.height, h = f ? 0 : c.sizeDiff.width, i = {width: c.size.width - h, height: c.size.height - g}, j = parseInt(c.element.css("left"), 10) + (c.position.left - c.originalPosition.left) || null, k = parseInt(c.element.css("top"), 10) + (c.position.top - c.originalPosition.top) || null; c.element.animate(a.extend(i, k && j ? {top: k, left: j} : {}), { duration: d.animateDuration, easing: d.animateEasing, step: function () { var d = { width: parseInt(c.element.css("width"), 10), height: parseInt(c.element.css("height"), 10), top: parseInt(c.element.css("top"), 10), left: parseInt(c.element.css("left"), 10) }; e && e.length && a(e[0]).css({ width: d.width, height: d.height }), c._updateCache(d), c._propagate("resize", b) } }) } }), a.ui.plugin.add("resizable", "containment", { start: function () { var b, d, e, f, g, h, i, j = a(this).data("ui-resizable"), k = j.options, l = j.element, m = k.containment, n = m instanceof a ? m.get(0) : /parent/.test(m) ? l.parent().get(0) : m; n && (j.containerElement = a(n), /document/.test(m) || m === document ? (j.containerOffset = { left: 0, top: 0 }, j.containerPosition = {left: 0, top: 0}, j.parentData = { element: a(document), left: 0, top: 0, width: a(document).width(), height: a(document).height() || document.body.parentNode.scrollHeight }) : (b = a(n), d = [], a(["Top", "Right", "Left", "Bottom"]).each(function (a, e) { d[a] = c(b.css("padding" + e)) }), j.containerOffset = b.offset(), j.containerPosition = b.position(), j.containerSize = { height: b.innerHeight() - d[3], width: b.innerWidth() - d[1] }, e = j.containerOffset, f = j.containerSize.height, g = j.containerSize.width, h = a.ui.hasScroll(n, "left") ? n.scrollWidth : g, i = a.ui.hasScroll(n) ? n.scrollHeight : f, j.parentData = { element: n, left: e.left, top: e.top, width: h, height: i })) }, resize: function (b) { var c, d, e, f, g = a(this).data("ui-resizable"), h = g.options, i = g.containerOffset, j = g.position, k = g._aspectRatio || b.shiftKey, l = {top: 0, left: 0}, m = g.containerElement; m[0] !== document && /static/.test(m.css("position")) && (l = i), j.left < (g._helper ? i.left : 0) && (g.size.width = g.size.width + (g._helper ? g.position.left - i.left : g.position.left - l.left), k && (g.size.height = g.size.width / g.aspectRatio), g.position.left = h.helper ? i.left : 0), j.top < (g._helper ? i.top : 0) && (g.size.height = g.size.height + (g._helper ? g.position.top - i.top : g.position.top), k && (g.size.width = g.size.height * g.aspectRatio), g.position.top = g._helper ? i.top : 0), g.offset.left = g.parentData.left + g.position.left, g.offset.top = g.parentData.top + g.position.top, c = Math.abs((g._helper ? g.offset.left - l.left : g.offset.left - l.left) + g.sizeDiff.width), d = Math.abs((g._helper ? g.offset.top - l.top : g.offset.top - i.top) + g.sizeDiff.height), e = g.containerElement.get(0) === g.element.parent().get(0), f = /relative|absolute/.test(g.containerElement.css("position")), e && f && (c -= g.parentData.left), c + g.size.width >= g.parentData.width && (g.size.width = g.parentData.width - c, k && (g.size.height = g.size.width / g.aspectRatio)), d + g.size.height >= g.parentData.height && (g.size.height = g.parentData.height - d, k && (g.size.width = g.size.height * g.aspectRatio)) }, stop: function () { var b = a(this).data("ui-resizable"), c = b.options, d = b.containerOffset, e = b.containerPosition, f = b.containerElement, g = a(b.helper), h = g.offset(), i = g.outerWidth() - b.sizeDiff.width, j = g.outerHeight() - b.sizeDiff.height; b._helper && !c.animate && /relative/.test(f.css("position")) && a(this).css({ left: h.left - e.left - d.left, width: i, height: j }), b._helper && !c.animate && /static/.test(f.css("position")) && a(this).css({ left: h.left - e.left - d.left, width: i, height: j }) } }), a.ui.plugin.add("resizable", "alsoResize", { start: function () { var b = a(this).data("ui-resizable"), c = b.options, d = function (b) { a(b).each(function () { var b = a(this); b.data("ui-resizable-alsoresize", { width: parseInt(b.width(), 10), height: parseInt(b.height(), 10), left: parseInt(b.css("left"), 10), top: parseInt(b.css("top"), 10) }) }) }; "object" != typeof c.alsoResize || c.alsoResize.parentNode ? d(c.alsoResize) : c.alsoResize.length ? (c.alsoResize = c.alsoResize[0], d(c.alsoResize)) : a.each(c.alsoResize, function (a) { d(a) }) }, resize: function (b, c) { var d = a(this).data("ui-resizable"), e = d.options, f = d.originalSize, g = d.originalPosition, h = { height: d.size.height - f.height || 0, width: d.size.width - f.width || 0, top: d.position.top - g.top || 0, left: d.position.left - g.left || 0 }, i = function (b, d) { a(b).each(function () { var b = a(this), e = a(this).data("ui-resizable-alsoresize"), f = {}, g = d && d.length ? d : b.parents(c.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"]; a.each(g, function (a, b) { var c = (e[b] || 0) + (h[b] || 0); c && c >= 0 && (f[b] = c || null) }), b.css(f) }) }; "object" != typeof e.alsoResize || e.alsoResize.nodeType ? i(e.alsoResize) : a.each(e.alsoResize, function (a, b) { i(a, b) }) }, stop: function () { a(this).removeData("resizable-alsoresize") } }), a.ui.plugin.add("resizable", "ghost", { start: function () { var b = a(this).data("ui-resizable"), c = b.options, d = b.size; b.ghost = b.originalElement.clone(), b.ghost.css({ opacity: .25, display: "block", position: "relative", height: d.height, width: d.width, margin: 0, left: 0, top: 0 }).addClass("ui-resizable-ghost").addClass("string" == typeof c.ghost ? c.ghost : ""), b.ghost.appendTo(b.helper) }, resize: function () { var b = a(this).data("ui-resizable"); b.ghost && b.ghost.css({position: "relative", height: b.size.height, width: b.size.width}) }, stop: function () { var b = a(this).data("ui-resizable"); b.ghost && b.helper && b.helper.get(0).removeChild(b.ghost.get(0)) } }), a.ui.plugin.add("resizable", "grid", { resize: function () { var b = a(this).data("ui-resizable"), c = b.options, d = b.size, e = b.originalSize, f = b.originalPosition, g = b.axis, h = "number" == typeof c.grid ? [c.grid, c.grid] : c.grid, i = h[0] || 1, j = h[1] || 1, k = Math.round((d.width - e.width) / i) * i, l = Math.round((d.height - e.height) / j) * j, m = e.width + k, n = e.height + l, o = c.maxWidth && c.maxWidth < m, p = c.maxHeight && c.maxHeight < n, q = c.minWidth && c.minWidth > m, r = c.minHeight && c.minHeight > n; c.grid = h, q && (m += i), r && (n += j), o && (m -= i), p && (n -= j), /^(se|s|e)$/.test(g) ? (b.size.width = m, b.size.height = n) : /^(ne)$/.test(g) ? (b.size.width = m, b.size.height = n, b.position.top = f.top - l) : /^(sw)$/.test(g) ? (b.size.width = m, b.size.height = n, b.position.left = f.left - k) : (b.size.width = m, b.size.height = n, b.position.top = f.top - l, b.position.left = f.left - k) } }) }(jQuery), function (a, b) { a.widget("ui.selectable", a.ui.mouse, { version: "1.10.3", options: { appendTo: "body", autoRefresh: !0, distance: 0, filter: "*", tolerance: "touch", selected: null, selecting: null, start: null, stop: null, unselected: null, unselecting: null }, _create: function () { var b, c = this; this.element.addClass("ui-selectable"), this.dragged = !1, this.refresh = function () { b = a(c.options.filter, c.element[0]), b.addClass("ui-selectee"), b.each(function () { var b = a(this), c = b.offset(); a.data(this, "selectable-item", { element: this, $element: b, left: c.left, top: c.top, right: c.left + b.outerWidth(), bottom: c.top + b.outerHeight(), startselected: !1, selected: b.hasClass("ui-selected"), selecting: b.hasClass("ui-selecting"), unselecting: b.hasClass("ui-unselecting") }) }) }, this.refresh(), this.selectees = b.addClass("ui-selectee"), this._mouseInit(), this.helper = a("
    ") }, _destroy: function () { this.selectees.removeClass("ui-selectee").removeData("selectable-item"), this.element.removeClass("ui-selectable ui-selectable-disabled"), this._mouseDestroy() }, _mouseStart: function (b) { var c = this, d = this.options; this.opos = [b.pageX, b.pageY], this.options.disabled || (this.selectees = a(d.filter, this.element[0]), this._trigger("start", b), a(d.appendTo).append(this.helper), this.helper.css({ left: b.pageX, top: b.pageY, width: 0, height: 0 }), d.autoRefresh && this.refresh(), this.selectees.filter(".ui-selected").each(function () { var d = a.data(this, "selectable-item"); d.startselected = !0, b.metaKey || b.ctrlKey || (d.$element.removeClass("ui-selected"), d.selected = !1, d.$element.addClass("ui-unselecting"), d.unselecting = !0, c._trigger("unselecting", b, {unselecting: d.element})) }), a(b.target).parents().addBack().each(function () { var d, e = a.data(this, "selectable-item"); if (e) return d = !b.metaKey && !b.ctrlKey || !e.$element.hasClass("ui-selected"), e.$element.removeClass(d ? "ui-unselecting" : "ui-selected").addClass(d ? "ui-selecting" : "ui-unselecting"), e.unselecting = !d, e.selecting = d, e.selected = d, d ? c._trigger("selecting", b, {selecting: e.element}) : c._trigger("unselecting", b, {unselecting: e.element}), !1 })) }, _mouseDrag: function (b) { if (this.dragged = !0, !this.options.disabled) { var c, d = this, e = this.options, f = this.opos[0], g = this.opos[1], h = b.pageX, i = b.pageY; return f > h && (c = h, h = f, f = c), g > i && (c = i, i = g, g = c), this.helper.css({ left: f, top: g, width: h - f, height: i - g }), this.selectees.each(function () { var c = a.data(this, "selectable-item"), j = !1; c && c.element !== d.element[0] && ("touch" === e.tolerance ? j = !(c.left > h || c.right < f || c.top > i || c.bottom < g) : "fit" === e.tolerance && (j = c.left > f && c.right < h && c.top > g && c.bottom < i), j ? (c.selected && (c.$element.removeClass("ui-selected"), c.selected = !1), c.unselecting && (c.$element.removeClass("ui-unselecting"), c.unselecting = !1), c.selecting || (c.$element.addClass("ui-selecting"), c.selecting = !0, d._trigger("selecting", b, {selecting: c.element}))) : (c.selecting && ((b.metaKey || b.ctrlKey) && c.startselected ? (c.$element.removeClass("ui-selecting"), c.selecting = !1, c.$element.addClass("ui-selected"), c.selected = !0) : (c.$element.removeClass("ui-selecting"), c.selecting = !1, c.startselected && (c.$element.addClass("ui-unselecting"), c.unselecting = !0), d._trigger("unselecting", b, {unselecting: c.element}))), c.selected && (b.metaKey || b.ctrlKey || c.startselected || (c.$element.removeClass("ui-selected"), c.selected = !1, c.$element.addClass("ui-unselecting"), c.unselecting = !0, d._trigger("unselecting", b, {unselecting: c.element}))))) }), !1 } }, _mouseStop: function (b) { var c = this; return this.dragged = !1, a(".ui-unselecting", this.element[0]).each(function () { var d = a.data(this, "selectable-item"); d.$element.removeClass("ui-unselecting"), d.unselecting = !1, d.startselected = !1, c._trigger("unselected", b, {unselected: d.element}) }), a(".ui-selecting", this.element[0]).each(function () { var d = a.data(this, "selectable-item"); d.$element.removeClass("ui-selecting").addClass("ui-selected"), d.selecting = !1, d.selected = !0, d.startselected = !0, c._trigger("selected", b, {selected: d.element}) }), this._trigger("stop", b), this.helper.remove(), !1 } }) }(jQuery), function (a, b) { function c(a, b, c) { return a > b && a < b + c } function d(a) { return /left|right/.test(a.css("float")) || /inline|table-cell/.test(a.css("display")) } a.widget("ui.sortable", a.ui.mouse, { version: "1.10.3", 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 }, _create: function () { var a = this.options; this.containerCache = {}, this.element.addClass("ui-sortable"), this.refresh(), this.floating = !!this.items.length && ("x" === a.axis || d(this.items[0].item)), this.offset = this.element.offset(), this._mouseInit(), this.ready = !0 }, _destroy: function () { this.element.removeClass("ui-sortable ui-sortable-disabled"), this._mouseDestroy(); for (var a = this.items.length - 1; a >= 0; a--) this.items[a].item.removeData(this.widgetName + "-item"); return this }, _setOption: function (b, c) { "disabled" === b ? (this.options[b] = c, this.widget().toggleClass("ui-sortable-disabled", !!c)) : a.Widget.prototype._setOption.apply(this, arguments) }, _mouseCapture: function (b, c) { var d = null, e = !1, f = this; return !this.reverting && (!this.options.disabled && "static" !== this.options.type && (this._refreshItems(b), a(b.target).parents().each(function () { if (a.data(this, f.widgetName + "-item") === f) return d = a(this), !1 }), a.data(b.target, f.widgetName + "-item") === f && (d = a(b.target)), !!d && (!(this.options.handle && !c && (a(this.options.handle, d).find("*").addBack().each(function () { this === b.target && (e = !0) }), !e)) && (this.currentItem = d, this._removeCurrentsFromItems(), !0)))) }, _mouseStart: function (b, c, d) { var e, f, g = this.options; if (this.currentContainer = this, this.refreshPositions(), this.helper = this._createHelper(b), this._cacheHelperProportions(), this._cacheMargins(), this.scrollParent = this.helper.scrollParent(), this.offset = this.currentItem.offset(), this.offset = { top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left }, a.extend(this.offset, { click: {left: b.pageX - this.offset.left, top: b.pageY - this.offset.top}, parent: this._getParentOffset(), relative: this._getRelativeOffset() }), this.helper.css("position", "absolute"), this.cssPosition = this.helper.css("position"), this.originalPosition = this._generatePosition(b), this.originalPageX = b.pageX, this.originalPageY = b.pageY, g.cursorAt && this._adjustOffsetFromHelper(g.cursorAt), this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] }, this.helper[0] !== this.currentItem[0] && this.currentItem.hide(), this._createPlaceholder(), g.containment && this._setContainment(), g.cursor && "auto" !== g.cursor && (f = this.document.find("body"), this.storedCursor = f.css("cursor"), f.css("cursor", g.cursor), this.storedStylesheet = a("").appendTo(f)), g.opacity && (this.helper.css("opacity") && (this._storedOpacity = this.helper.css("opacity")), this.helper.css("opacity", g.opacity)), g.zIndex && (this.helper.css("zIndex") && (this._storedZIndex = this.helper.css("zIndex")), this.helper.css("zIndex", g.zIndex)), this.scrollParent[0] !== document && "HTML" !== this.scrollParent[0].tagName && (this.overflowOffset = this.scrollParent.offset()), this._trigger("start", b, this._uiHash()), this._preserveHelperProportions || this._cacheHelperProportions(), !d) for (e = this.containers.length - 1; e >= 0; e--) this.containers[e]._trigger("activate", b, this._uiHash(this)); return a.ui.ddmanager && (a.ui.ddmanager.current = this), a.ui.ddmanager && !g.dropBehaviour && a.ui.ddmanager.prepareOffsets(this, b), this.dragging = !0, this.helper.addClass("ui-sortable-helper"), this._mouseDrag(b), !0 }, _mouseDrag: function (b) { var c, d, e, f, g = this.options, h = !1; for (this.position = this._generatePosition(b), this.positionAbs = this._convertPositionTo("absolute"), this.lastPositionAbs || (this.lastPositionAbs = this.positionAbs), this.options.scroll && (this.scrollParent[0] !== document && "HTML" !== this.scrollParent[0].tagName ? (this.overflowOffset.top + this.scrollParent[0].offsetHeight - b.pageY < g.scrollSensitivity ? this.scrollParent[0].scrollTop = h = this.scrollParent[0].scrollTop + g.scrollSpeed : b.pageY - this.overflowOffset.top < g.scrollSensitivity && (this.scrollParent[0].scrollTop = h = this.scrollParent[0].scrollTop - g.scrollSpeed), this.overflowOffset.left + this.scrollParent[0].offsetWidth - b.pageX < g.scrollSensitivity ? this.scrollParent[0].scrollLeft = h = this.scrollParent[0].scrollLeft + g.scrollSpeed : b.pageX - this.overflowOffset.left < g.scrollSensitivity && (this.scrollParent[0].scrollLeft = h = this.scrollParent[0].scrollLeft - g.scrollSpeed)) : (b.pageY - a(document).scrollTop() < g.scrollSensitivity ? h = a(document).scrollTop(a(document).scrollTop() - g.scrollSpeed) : a(window).height() - (b.pageY - a(document).scrollTop()) < g.scrollSensitivity && (h = a(document).scrollTop(a(document).scrollTop() + g.scrollSpeed)), b.pageX - a(document).scrollLeft() < g.scrollSensitivity ? h = a(document).scrollLeft(a(document).scrollLeft() - g.scrollSpeed) : a(window).width() - (b.pageX - a(document).scrollLeft()) < g.scrollSensitivity && (h = a(document).scrollLeft(a(document).scrollLeft() + g.scrollSpeed))), h !== !1 && a.ui.ddmanager && !g.dropBehaviour && a.ui.ddmanager.prepareOffsets(this, b)), 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"), c = this.items.length - 1; c >= 0; c--) if (d = this.items[c], e = d.item[0], f = this._intersectsWithPointer(d), f && d.instance === this.currentContainer && !(e === this.currentItem[0] || this.placeholder[1 === f ? "next" : "prev"]()[0] === e || a.contains(this.placeholder[0], e) || "semi-dynamic" === this.options.type && a.contains(this.element[0], e))) { if (this.direction = 1 === f ? "down" : "up", "pointer" !== this.options.tolerance && !this._intersectsWithSides(d)) break; this._rearrange(b, d), this._trigger("change", b, this._uiHash()); break } return this._contactContainers(b), a.ui.ddmanager && a.ui.ddmanager.drag(this, b), this._trigger("sort", b, this._uiHash()), this.lastPositionAbs = this.positionAbs, !1 }, _mouseStop: function (b, c) { if (b) { if (a.ui.ddmanager && !this.options.dropBehaviour && a.ui.ddmanager.drop(this, b), this.options.revert) { var d = this, e = this.placeholder.offset(), f = this.options.axis, g = {}; f && "x" !== f || (g.left = e.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft)), f && "y" !== f || (g.top = e.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop)), this.reverting = !0, a(this.helper).animate(g, parseInt(this.options.revert, 10) || 500, function () { d._clear(b) }) } else this._clear(b, c); return !1 } }, cancel: function () { if (this.dragging) { this._mouseUp({target: null}), "original" === this.options.helper ? this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper") : this.currentItem.show(); for (var b = this.containers.length - 1; b >= 0; b--) this.containers[b]._trigger("deactivate", null, this._uiHash(this)), this.containers[b].containerCache.over && (this.containers[b]._trigger("out", null, this._uiHash(this)), this.containers[b].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(), a.extend(this, { helper: null, dragging: !1, reverting: !1, _noFinalSort: null }), this.domPosition.prev ? a(this.domPosition.prev).after(this.currentItem) : a(this.domPosition.parent).prepend(this.currentItem)), this }, serialize: function (b) { var c = this._getItemsAsjQuery(b && b.connected), d = []; return b = b || {}, a(c).each(function () { var c = (a(b.item || this).attr(b.attribute || "id") || "").match(b.expression || /(.+)[\-=_](.+)/); c && d.push((b.key || c[1] + "[]") + "=" + (b.key && b.expression ? c[1] : c[2])) }), !d.length && b.key && d.push(b.key + "="), d.join("&") }, toArray: function (b) { var c = this._getItemsAsjQuery(b && b.connected), d = []; return b = b || {}, c.each(function () { d.push(a(b.item || this).attr(b.attribute || "id") || "") }), d }, _intersectsWith: function (a) { var b = this.positionAbs.left, c = b + this.helperProportions.width, d = this.positionAbs.top, e = d + this.helperProportions.height, f = a.left, g = f + a.width, h = a.top, i = h + a.height, j = this.offset.click.top, k = this.offset.click.left, l = "x" === this.options.axis || d + j > h && d + j < i, m = "y" === this.options.axis || b + k > f && b + k < g, n = l && m; return "pointer" === this.options.tolerance || this.options.forcePointerForContainers || "pointer" !== this.options.tolerance && this.helperProportions[this.floating ? "width" : "height"] > a[this.floating ? "width" : "height"] ? n : f < b + this.helperProportions.width / 2 && c - this.helperProportions.width / 2 < g && h < d + this.helperProportions.height / 2 && e - this.helperProportions.height / 2 < i }, _intersectsWithPointer: function (a) { var b = "x" === this.options.axis || c(this.positionAbs.top + this.offset.click.top, a.top, a.height), d = "y" === this.options.axis || c(this.positionAbs.left + this.offset.click.left, a.left, a.width), e = b && d, f = this._getDragVerticalDirection(), g = this._getDragHorizontalDirection(); return !!e && (this.floating ? g && "right" === g || "down" === f ? 2 : 1 : f && ("down" === f ? 2 : 1)) }, _intersectsWithSides: function (a) { var b = c(this.positionAbs.top + this.offset.click.top, a.top + a.height / 2, a.height), d = c(this.positionAbs.left + this.offset.click.left, a.left + a.width / 2, a.width), e = this._getDragVerticalDirection(), f = this._getDragHorizontalDirection(); return this.floating && f ? "right" === f && d || "left" === f && !d : e && ("down" === e && b || "up" === e && !b) }, _getDragVerticalDirection: function () { var a = this.positionAbs.top - this.lastPositionAbs.top; return 0 !== a && (a > 0 ? "down" : "up") }, _getDragHorizontalDirection: function () { var a = this.positionAbs.left - this.lastPositionAbs.left; return 0 !== a && (a > 0 ? "right" : "left") }, refresh: function (a) { return this._refreshItems(a), this.refreshPositions(), this }, _connectWith: function () { var a = this.options; return a.connectWith.constructor === String ? [a.connectWith] : a.connectWith }, _getItemsAsjQuery: function (b) { var c, d, e, f, g = [], h = [], i = this._connectWith(); if (i && b) for (c = i.length - 1; c >= 0; c--) for (e = a(i[c]), d = e.length - 1; d >= 0; d--) f = a.data(e[d], this.widgetFullName), f && f !== this && !f.options.disabled && h.push([a.isFunction(f.options.items) ? f.options.items.call(f.element) : a(f.options.items, f.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), f]); for (h.push([a.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : a(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]), c = h.length - 1; c >= 0; c--) h[c][0].each(function () { g.push(this) }); return a(g) }, _removeCurrentsFromItems: function () { var b = this.currentItem.find(":data(" + this.widgetName + "-item)"); this.items = a.grep(this.items, function (a) { for (var c = 0; c < b.length; c++) if (b[c] === a.item[0]) return !1; return !0 }) }, _refreshItems: function (b) { this.items = [], this.containers = [this]; var c, d, e, f, g, h, i, j, k = this.items, l = [[a.isFunction(this.options.items) ? this.options.items.call(this.element[0], b, {item: this.currentItem}) : a(this.options.items, this.element), this]], m = this._connectWith(); if (m && this.ready) for (c = m.length - 1; c >= 0; c--) for (e = a(m[c]), d = e.length - 1; d >= 0; d--) f = a.data(e[d], this.widgetFullName), f && f !== this && !f.options.disabled && (l.push([a.isFunction(f.options.items) ? f.options.items.call(f.element[0], b, {item: this.currentItem}) : a(f.options.items, f.element), f]), this.containers.push(f)); for (c = l.length - 1; c >= 0; c--) for (g = l[c][1], h = l[c][0], d = 0, j = h.length; d < j; d++) i = a(h[d]), i.data(this.widgetName + "-item", g), k.push({ item: i, instance: g, width: 0, height: 0, left: 0, top: 0 }) }, refreshPositions: function (b) { this.offsetParent && this.helper && (this.offset.parent = this._getParentOffset()); var c, d, e, f; for (c = this.items.length - 1; c >= 0; c--) d = this.items[c], d.instance !== this.currentContainer && this.currentContainer && d.item[0] !== this.currentItem[0] || (e = this.options.toleranceElement ? a(this.options.toleranceElement, d.item) : d.item, b || (d.width = e.outerWidth(), d.height = e.outerHeight()), f = e.offset(), d.left = f.left, d.top = f.top); if (this.options.custom && this.options.custom.refreshContainers) this.options.custom.refreshContainers.call(this); else for (c = this.containers.length - 1; c >= 0; c--) f = this.containers[c].element.offset(), this.containers[c].containerCache.left = f.left, this.containers[c].containerCache.top = f.top, this.containers[c].containerCache.width = this.containers[c].element.outerWidth(), this.containers[c].containerCache.height = this.containers[c].element.outerHeight(); return this }, _createPlaceholder: function (b) { b = b || this; var c, d = b.options; d.placeholder && d.placeholder.constructor !== String || (c = d.placeholder, d.placeholder = { element: function () { var d = b.currentItem[0].nodeName.toLowerCase(), e = a("<" + d + ">", b.document[0]).addClass(c || b.currentItem[0].className + " ui-sortable-placeholder").removeClass("ui-sortable-helper"); return "tr" === d ? b.currentItem.children().each(function () { a(" ", b.document[0]).attr("colspan", a(this).attr("colspan") || 1).appendTo(e) }) : "img" === d && e.attr("src", b.currentItem.attr("src")), c || e.css("visibility", "hidden"), e }, update: function (a, e) { c && !d.forcePlaceholderSize || (e.height() || e.height(b.currentItem.innerHeight() - parseInt(b.currentItem.css("paddingTop") || 0, 10) - parseInt(b.currentItem.css("paddingBottom") || 0, 10)), e.width() || e.width(b.currentItem.innerWidth() - parseInt(b.currentItem.css("paddingLeft") || 0, 10) - parseInt(b.currentItem.css("paddingRight") || 0, 10))) } }), b.placeholder = a(d.placeholder.element.call(b.element, b.currentItem)), b.currentItem.after(b.placeholder), d.placeholder.update(b, b.placeholder) }, _contactContainers: function (b) { var e, f, g, h, i, j, k, l, m, n, o = null, p = null; for (e = this.containers.length - 1; e >= 0; e--) if (!a.contains(this.currentItem[0], this.containers[e].element[0])) if (this._intersectsWith(this.containers[e].containerCache)) { if (o && a.contains(this.containers[e].element[0], o.element[0])) continue; o = this.containers[e], p = e } else this.containers[e].containerCache.over && (this.containers[e]._trigger("out", b, this._uiHash(this)), this.containers[e].containerCache.over = 0); if (o) if (1 === this.containers.length) this.containers[p].containerCache.over || (this.containers[p]._trigger("over", b, this._uiHash(this)), this.containers[p].containerCache.over = 1); else { for (g = 1e4, h = null, n = o.floating || d(this.currentItem), i = n ? "left" : "top", j = n ? "width" : "height", k = this.positionAbs[i] + this.offset.click[i], f = this.items.length - 1; f >= 0; f--) a.contains(this.containers[p].element[0], this.items[f].item[0]) && this.items[f].item[0] !== this.currentItem[0] && (n && !c(this.positionAbs.top + this.offset.click.top, this.items[f].top, this.items[f].height) || (l = this.items[f].item.offset()[i], m = !1, Math.abs(l - k) > Math.abs(l + this.items[f][j] - k) && (m = !0, l += this.items[f][j]), Math.abs(l - k) < g && (g = Math.abs(l - k), h = this.items[f], this.direction = m ? "up" : "down"))); if (!h && !this.options.dropOnEmpty) return; if (this.currentContainer === this.containers[p]) return; h ? this._rearrange(b, h, null, !0) : this._rearrange(b, null, this.containers[p].element, !0), this._trigger("change", b, this._uiHash()), this.containers[p]._trigger("change", b, this._uiHash(this)), this.currentContainer = this.containers[p], this.options.placeholder.update(this.currentContainer, this.placeholder), this.containers[p]._trigger("over", b, this._uiHash(this)), this.containers[p].containerCache.over = 1 } }, _createHelper: function (b) { var c = this.options, d = a.isFunction(c.helper) ? a(c.helper.apply(this.element[0], [b, this.currentItem])) : "clone" === c.helper ? this.currentItem.clone() : this.currentItem; return d.parents("body").length || a("parent" !== c.appendTo ? c.appendTo : this.currentItem[0].parentNode)[0].appendChild(d[0]), d[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") }), d[0].style.width && !c.forceHelperSize || d.width(this.currentItem.width()), d[0].style.height && !c.forceHelperSize || d.height(this.currentItem.height()), d }, _adjustOffsetFromHelper: function (b) { "string" == typeof b && (b = b.split(" ")), a.isArray(b) && (b = { left: +b[0], top: +b[1] || 0 }), "left" in b && (this.offset.click.left = b.left + this.margins.left), "right" in b && (this.offset.click.left = this.helperProportions.width - b.right + this.margins.left), "top" in b && (this.offset.click.top = b.top + this.margins.top), "bottom" in b && (this.offset.click.top = this.helperProportions.height - b.bottom + this.margins.top) }, _getParentOffset: function () { this.offsetParent = this.helper.offsetParent(); var b = this.offsetParent.offset(); return "absolute" === this.cssPosition && this.scrollParent[0] !== document && a.contains(this.scrollParent[0], this.offsetParent[0]) && (b.left += this.scrollParent.scrollLeft(), b.top += this.scrollParent.scrollTop()), (this.offsetParent[0] === document.body || this.offsetParent[0].tagName && "html" === this.offsetParent[0].tagName.toLowerCase() && a.ui.ie) && (b = { top: 0, left: 0 }), { top: b.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0), left: b.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0) } }, _getRelativeOffset: function () { if ("relative" === this.cssPosition) { var a = this.currentItem.position(); return { top: a.top - (parseInt(this.helper.css("top"), 10) || 0) + this.scrollParent.scrollTop(), left: a.left - (parseInt(this.helper.css("left"), 10) || 0) + this.scrollParent.scrollLeft() } } return {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 b, c, d, e = this.options; "parent" === e.containment && (e.containment = this.helper[0].parentNode), "document" !== e.containment && "window" !== e.containment || (this.containment = [0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, a("document" === e.containment ? document : window).width() - this.helperProportions.width - this.margins.left, (a("document" === e.containment ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top]), /^(document|window|parent)$/.test(e.containment) || (b = a(e.containment)[0], c = a(e.containment).offset(), d = "hidden" !== a(b).css("overflow"), this.containment = [c.left + (parseInt(a(b).css("borderLeftWidth"), 10) || 0) + (parseInt(a(b).css("paddingLeft"), 10) || 0) - this.margins.left, c.top + (parseInt(a(b).css("borderTopWidth"), 10) || 0) + (parseInt(a(b).css("paddingTop"), 10) || 0) - this.margins.top, c.left + (d ? Math.max(b.scrollWidth, b.offsetWidth) : b.offsetWidth) - (parseInt(a(b).css("borderLeftWidth"), 10) || 0) - (parseInt(a(b).css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left, c.top + (d ? Math.max(b.scrollHeight, b.offsetHeight) : b.offsetHeight) - (parseInt(a(b).css("borderTopWidth"), 10) || 0) - (parseInt(a(b).css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top]) }, _convertPositionTo: function (b, c) { c || (c = this.position); var d = "absolute" === b ? 1 : -1, e = "absolute" !== this.cssPosition || this.scrollParent[0] !== document && a.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent, f = /(html|body)/i.test(e[0].tagName); return { top: c.top + this.offset.relative.top * d + this.offset.parent.top * d - ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : f ? 0 : e.scrollTop()) * d, left: c.left + this.offset.relative.left * d + this.offset.parent.left * d - ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : f ? 0 : e.scrollLeft()) * d } }, _generatePosition: function (b) { var c, d, e = this.options, f = b.pageX, g = b.pageY, h = "absolute" !== this.cssPosition || this.scrollParent[0] !== document && a.contains(this.scrollParent[0], this.offsetParent[0]) ? this.scrollParent : this.offsetParent, i = /(html|body)/i.test(h[0].tagName); return "relative" !== this.cssPosition || this.scrollParent[0] !== document && this.scrollParent[0] !== this.offsetParent[0] || (this.offset.relative = this._getRelativeOffset()), this.originalPosition && (this.containment && (b.pageX - this.offset.click.left < this.containment[0] && (f = this.containment[0] + this.offset.click.left), b.pageY - this.offset.click.top < this.containment[1] && (g = this.containment[1] + this.offset.click.top), b.pageX - this.offset.click.left > this.containment[2] && (f = this.containment[2] + this.offset.click.left), b.pageY - this.offset.click.top > this.containment[3] && (g = this.containment[3] + this.offset.click.top)), e.grid && (c = this.originalPageY + Math.round((g - this.originalPageY) / e.grid[1]) * e.grid[1], g = this.containment ? c - this.offset.click.top >= this.containment[1] && c - this.offset.click.top <= this.containment[3] ? c : c - this.offset.click.top >= this.containment[1] ? c - e.grid[1] : c + e.grid[1] : c, d = this.originalPageX + Math.round((f - this.originalPageX) / e.grid[0]) * e.grid[0], f = this.containment ? d - this.offset.click.left >= this.containment[0] && d - this.offset.click.left <= this.containment[2] ? d : d - this.offset.click.left >= this.containment[0] ? d - e.grid[0] : d + e.grid[0] : d)), { top: g - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + ("fixed" === this.cssPosition ? -this.scrollParent.scrollTop() : i ? 0 : h.scrollTop()), left: f - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + ("fixed" === this.cssPosition ? -this.scrollParent.scrollLeft() : i ? 0 : h.scrollLeft()) } }, _rearrange: function (a, b, c, d) { c ? c[0].appendChild(this.placeholder[0]) : b.item[0].parentNode.insertBefore(this.placeholder[0], "down" === this.direction ? b.item[0] : b.item[0].nextSibling), this.counter = this.counter ? ++this.counter : 1; var e = this.counter; this._delay(function () { e === this.counter && this.refreshPositions(!d) }) }, _clear: function (a, b) { this.reverting = !1; var c, d = []; if (!this._noFinalSort && this.currentItem.parent().length && this.placeholder.before(this.currentItem), this._noFinalSort = null, this.helper[0] === this.currentItem[0]) { for (c in this._storedCSS) "auto" !== this._storedCSS[c] && "static" !== this._storedCSS[c] || (this._storedCSS[c] = ""); this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper") } else this.currentItem.show(); for (this.fromOutside && !b && d.push(function (a) { this._trigger("receive", a, this._uiHash(this.fromOutside)) }), !this.fromOutside && this.domPosition.prev === this.currentItem.prev().not(".ui-sortable-helper")[0] && this.domPosition.parent === this.currentItem.parent()[0] || b || d.push(function (a) { this._trigger("update", a, this._uiHash()) }), this !== this.currentContainer && (b || (d.push(function (a) { this._trigger("remove", a, this._uiHash()) }), d.push(function (a) { return function (b) { a._trigger("receive", b, this._uiHash(this)) } }.call(this, this.currentContainer)), d.push(function (a) { return function (b) { a._trigger("update", b, this._uiHash(this)) } }.call(this, this.currentContainer)))), c = this.containers.length - 1; c >= 0; c--) b || d.push(function (a) { return function (b) { a._trigger("deactivate", b, this._uiHash(this)) } }.call(this, this.containers[c])), this.containers[c].containerCache.over && (d.push(function (a) { return function (b) { a._trigger("out", b, this._uiHash(this)) } }.call(this, this.containers[c])), this.containers[c].containerCache.over = 0); if (this.storedCursor && (this.document.find("body").css("cursor", this.storedCursor), this.storedStylesheet.remove()), this._storedOpacity && this.helper.css("opacity", this._storedOpacity), this._storedZIndex && this.helper.css("zIndex", "auto" === this._storedZIndex ? "" : this._storedZIndex), this.dragging = !1, this.cancelHelperRemoval) { if (!b) { for (this._trigger("beforeStop", a, this._uiHash()), c = 0; c < d.length; c++) d[c].call(this, a); this._trigger("stop", a, this._uiHash()) } return this.fromOutside = !1, !1 } if (b || this._trigger("beforeStop", a, this._uiHash()), this.placeholder[0].parentNode.removeChild(this.placeholder[0]), this.helper[0] !== this.currentItem[0] && this.helper.remove(), this.helper = null, !b) { for (c = 0; c < d.length; c++) d[c].call(this, a); this._trigger("stop", a, this._uiHash()) } return this.fromOutside = !1, !0 }, _trigger: function () { a.Widget.prototype._trigger.apply(this, arguments) === !1 && this.cancel() }, _uiHash: function (b) { var c = b || this; return { helper: c.helper, placeholder: c.placeholder || a([]), position: c.position, originalPosition: c.originalPosition, offset: c.positionAbs, item: c.currentItem, sender: b ? b.element : null } } }) }(jQuery), function (a, b) { var c = "ui-effects-"; a.effects = {effect: {}}, function (a, b) { function m(a, b, c) { var d = h[b.type] || {}; return null == a ? c || !b.def ? null : b.def : (a = d.floor ? ~~a : parseFloat(a), isNaN(a) ? b.def : d.mod ? (a + d.mod) % d.mod : 0 > a ? 0 : d.max < a ? d.max : a) } function n(b) { var c = f(), d = c._rgba = []; return b = b.toLowerCase(), l(e, function (a, e) { var f, h = e.re.exec(b), i = h && e.parse(h), j = e.space || "rgba"; if (i) return f = c[j](i), c[g[j].cache] = f[g[j].cache], d = c._rgba = f._rgba, !1 }), d.length ? ("0,0,0,0" === d.join() && a.extend(d, k.transparent), c) : k[b] } function o(a, b, c) { return c = (c + 1) % 1, 6 * c < 1 ? a + (b - a) * c * 6 : 2 * c < 1 ? b : 3 * c < 2 ? a + (b - a) * (2 / 3 - c) * 6 : a } var k, c = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor", d = /^([\-+])=\s*(\d+\.?\d*)/, e = [{ re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, parse: function (a) { return [a[1], a[2], a[3], a[4]] } }, { re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, parse: function (a) { return [2.55 * a[1], 2.55 * a[2], 2.55 * a[3], a[4]] } }, { re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/, parse: function (a) { return [parseInt(a[1], 16), parseInt(a[2], 16), parseInt(a[3], 16)] } }, { re: /#([a-f0-9])([a-f0-9])([a-f0-9])/, parse: function (a) { return [parseInt(a[1] + a[1], 16), parseInt(a[2] + a[2], 16), parseInt(a[3] + a[3], 16)] } }, { re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, space: "hsla", parse: function (a) { return [a[1], a[2] / 100, a[3] / 100, a[4]] } }], f = a.Color = function (b, c, d, e) { return new a.Color.fn.parse(b, c, d, e) }, g = { rgba: { props: { red: {idx: 0, type: "byte"}, green: {idx: 1, type: "byte"}, blue: {idx: 2, type: "byte"} } }, hsla: { props: { hue: {idx: 0, type: "degrees"}, saturation: {idx: 1, type: "percent"}, lightness: {idx: 2, type: "percent"} } } }, h = {byte: {floor: !0, max: 255}, percent: {max: 1}, degrees: {mod: 360, floor: !0}}, i = f.support = {}, j = a("

    ")[0], l = a.each; j.style.cssText = "background-color:rgba(1,1,1,.5)", i.rgba = j.style.backgroundColor.indexOf("rgba") > -1, l(g, function (a, b) { b.cache = "_" + a, b.props.alpha = {idx: 3, type: "percent", def: 1} }), f.fn = a.extend(f.prototype, { parse: function (c, d, e, h) { if (c === b) return this._rgba = [null, null, null, null], this; (c.jquery || c.nodeType) && (c = a(c).css(d), d = b); var i = this, j = a.type(c), o = this._rgba = []; return d !== b && (c = [c, d, e, h], j = "array"), "string" === j ? this.parse(n(c) || k._default) : "array" === j ? (l(g.rgba.props, function (a, b) { o[b.idx] = m(c[b.idx], b) }), this) : "object" === j ? (c instanceof f ? l(g, function (a, b) { c[b.cache] && (i[b.cache] = c[b.cache].slice()) }) : l(g, function (b, d) { var e = d.cache; l(d.props, function (a, b) { if (!i[e] && d.to) { if ("alpha" === a || null == c[a]) return; i[e] = d.to(i._rgba) } i[e][b.idx] = m(c[a], b, !0) }), i[e] && a.inArray(null, i[e].slice(0, 3)) < 0 && (i[e][3] = 1, d.from && (i._rgba = d.from(i[e]))) }), this) : void 0 }, is: function (a) { var b = f(a), c = !0, d = this; return l(g, function (a, e) { var f, g = b[e.cache]; return g && (f = d[e.cache] || e.to && e.to(d._rgba) || [], l(e.props, function (a, b) { if (null != g[b.idx]) return c = g[b.idx] === f[b.idx] })), c }), c }, _space: function () { var a = [], b = this; return l(g, function (c, d) { b[d.cache] && a.push(c) }), a.pop() }, transition: function (a, b) { var c = f(a), d = c._space(), e = g[d], i = 0 === this.alpha() ? f("transparent") : this, j = i[e.cache] || e.to(i._rgba), k = j.slice(); return c = c[e.cache], l(e.props, function (a, d) { var e = d.idx, f = j[e], g = c[e], i = h[d.type] || {}; null !== g && (null === f ? k[e] = g : (i.mod && (g - f > i.mod / 2 ? f += i.mod : f - g > i.mod / 2 && (f -= i.mod)), k[e] = m((g - f) * b + f, d))) }), this[d](k) }, blend: function (b) { if (1 === this._rgba[3]) return this; var c = this._rgba.slice(), d = c.pop(), e = f(b)._rgba; return f(a.map(c, function (a, b) { return (1 - d) * e[b] + d * a })) }, toRgbaString: function () { var b = "rgba(", c = a.map(this._rgba, function (a, b) { return null == a ? b > 2 ? 1 : 0 : a }); return 1 === c[3] && (c.pop(), b = "rgb("), b + c.join() + ")" }, toHslaString: function () { var b = "hsla(", c = a.map(this.hsla(), function (a, b) { return null == a && (a = b > 2 ? 1 : 0), b && b < 3 && (a = Math.round(100 * a) + "%"), a }); return 1 === c[3] && (c.pop(), b = "hsl("), b + c.join() + ")" }, toHexString: function (b) { var c = this._rgba.slice(), d = c.pop(); return b && c.push(~~(255 * d)), "#" + a.map(c, function (a) { return a = (a || 0).toString(16), 1 === a.length ? "0" + a : a }).join("") }, toString: function () { return 0 === this._rgba[3] ? "transparent" : this.toRgbaString() } }), f.fn.parse.prototype = f.fn, g.hsla.to = function (a) { if (null == a[0] || null == a[1] || null == a[2]) return [null, null, null, a[3]]; var k, l, b = a[0] / 255, c = a[1] / 255, d = a[2] / 255, e = a[3], f = Math.max(b, c, d), g = Math.min(b, c, d), h = f - g, i = f + g, j = .5 * i; return k = g === f ? 0 : b === f ? 60 * (c - d) / h + 360 : c === f ? 60 * (d - b) / h + 120 : 60 * (b - c) / h + 240, l = 0 === h ? 0 : j <= .5 ? h / i : h / (2 - i), [Math.round(k) % 360, l, j, null == e ? 1 : e] }, g.hsla.from = function (a) { if (null == a[0] || null == a[1] || null == a[2]) return [null, null, null, a[3]]; var b = a[0] / 360, c = a[1], d = a[2], e = a[3], f = d <= .5 ? d * (1 + c) : d + c - d * c, g = 2 * d - f; return [Math.round(255 * o(g, f, b + 1 / 3)), Math.round(255 * o(g, f, b)), Math.round(255 * o(g, f, b - 1 / 3)), e] }, l(g, function (c, e) { var g = e.props, h = e.cache, i = e.to, j = e.from; f.fn[c] = function (c) { if (i && !this[h] && (this[h] = i(this._rgba)), c === b) return this[h].slice(); var d, e = a.type(c), k = "array" === e || "object" === e ? c : arguments, n = this[h].slice(); return l(g, function (a, b) { var c = k["object" === e ? a : b.idx]; null == c && (c = n[b.idx]), n[b.idx] = m(c, b) }), j ? (d = f(j(n)), d[h] = n, d) : f(n) }, l(g, function (b, e) { f.fn[b] || (f.fn[b] = function (f) { var k, g = a.type(f), h = "alpha" === b ? this._hsla ? "hsla" : "rgba" : c, i = this[h](), j = i[e.idx]; return "undefined" === g ? j : ("function" === g && (f = f.call(this, j), g = a.type(f)), null == f && e.empty ? this : ("string" === g && (k = d.exec(f), k && (f = j + parseFloat(k[2]) * ("+" === k[1] ? 1 : -1))), i[e.idx] = f, this[h](i))) }) }) }), f.hook = function (b) { var c = b.split(" "); l(c, function (b, c) { a.cssHooks[c] = { set: function (b, d) { var e, g, h = ""; if ("transparent" !== d && ("string" !== a.type(d) || (e = n(d)))) { if (d = f(e || d), !i.rgba && 1 !== d._rgba[3]) { for (g = "backgroundColor" === c ? b.parentNode : b; ("" === h || "transparent" === h) && g && g.style;) try { h = a.css(g, "backgroundColor"), g = g.parentNode } catch (a) { } d = d.blend(h && "transparent" !== h ? h : "_default") } d = d.toRgbaString() } try { b.style[c] = d } catch (a) { } } }, a.fx.step[c] = function (b) { b.colorInit || (b.start = f(b.elem, c), b.end = f(b.end), b.colorInit = !0), a.cssHooks[c].set(b.elem, b.start.transition(b.end, b.pos)) } }) }, f.hook(c), a.cssHooks.borderColor = { expand: function (a) { var b = {}; return l(["Top", "Right", "Bottom", "Left"], function (c, d) { b["border" + d + "Color"] = a }), b } }, k = a.Color.names = { aqua: "#00ffff", black: "#000000", blue: "#0000ff", fuchsia: "#ff00ff", gray: "#808080", green: "#008000", lime: "#00ff00", maroon: "#800000", navy: "#000080", olive: "#808000", purple: "#800080", red: "#ff0000", silver: "#c0c0c0", teal: "#008080", white: "#ffffff", yellow: "#ffff00", transparent: [null, null, null, 0], _default: "#ffffff" } }(jQuery), function () { function e(b) { var c, d, e = b.ownerDocument.defaultView ? b.ownerDocument.defaultView.getComputedStyle(b, null) : b.currentStyle, f = {}; if (e && e.length && e[0] && e[e[0]]) for (d = e.length; d--;) c = e[d], "string" == typeof e[c] && (f[a.camelCase(c)] = e[c]); else for (c in e) "string" == typeof e[c] && (f[c] = e[c]); return f } function f(b, c) { var f, g, e = {}; for (f in c) g = c[f], b[f] !== g && (d[f] || !a.fx.step[f] && isNaN(parseFloat(g)) || (e[f] = g)); return e } var c = ["add", "remove", "toggle"], d = { border: 1, borderBottom: 1, borderColor: 1, borderLeft: 1, borderRight: 1, borderTop: 1, borderWidth: 1, margin: 1, padding: 1 }; a.each(["borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle"], function (b, c) { a.fx.step[c] = function (a) { ("none" !== a.end && !a.setAttr || 1 === a.pos && !a.setAttr) && (jQuery.style(a.elem, c, a.end), a.setAttr = !0) } }), a.fn.addBack || (a.fn.addBack = function (a) { return this.add(null == a ? this.prevObject : this.prevObject.filter(a)) }), a.effects.animateClass = function (b, d, g, h) { var i = a.speed(d, g, h); return this.queue(function () { var h, d = a(this), g = d.attr("class") || "", j = i.children ? d.find("*").addBack() : d; j = j.map(function () { var b = a(this); return {el: b, start: e(this)} }), h = function () { a.each(c, function (a, c) { b[c] && d[c + "Class"](b[c]) }) }, h(), j = j.map(function () { return this.end = e(this.el[0]), this.diff = f(this.start, this.end), this }), d.attr("class", g), j = j.map(function () { var b = this, c = a.Deferred(), d = a.extend({}, i, { queue: !1, complete: function () { c.resolve(b) } }); return this.el.animate(this.diff, d), c.promise() }), a.when.apply(a, j.get()).done(function () { h(), a.each(arguments, function () { var b = this.el; a.each(this.diff, function (a) { b.css(a, "") }) }), i.complete.call(d[0]) }) }) }, a.fn.extend({ addClass: function (b) { return function (c, d, e, f) { return d ? a.effects.animateClass.call(this, {add: c}, d, e, f) : b.apply(this, arguments) } }(a.fn.addClass), removeClass: function (b) { return function (c, d, e, f) { return arguments.length > 1 ? a.effects.animateClass.call(this, {remove: c}, d, e, f) : b.apply(this, arguments) } }(a.fn.removeClass), toggleClass: function (c) { return function (d, e, f, g, h) { return "boolean" == typeof e || e === b ? f ? a.effects.animateClass.call(this, e ? {add: d} : {remove: d}, f, g, h) : c.apply(this, arguments) : a.effects.animateClass.call(this, {toggle: d}, e, f, g) } }(a.fn.toggleClass), switchClass: function (b, c, d, e, f) { return a.effects.animateClass.call(this, {add: c, remove: b}, d, e, f) } }) }(), function () { function d(b, c, d, e) { return a.isPlainObject(b) && (c = b, b = b.effect), b = {effect: b}, null == c && (c = {}), a.isFunction(c) && (e = c, d = null, c = {}), ("number" == typeof c || a.fx.speeds[c]) && (e = d, d = c, c = {}), a.isFunction(d) && (e = d, d = null), c && a.extend(b, c), d = d || c.duration, b.duration = a.fx.off ? 0 : "number" == typeof d ? d : d in a.fx.speeds ? a.fx.speeds[d] : a.fx.speeds._default, b.complete = e || c.complete, b } function e(b) { return !(b && "number" != typeof b && !a.fx.speeds[b]) || ("string" == typeof b && !a.effects.effect[b] || (!!a.isFunction(b) || "object" == typeof b && !b.effect)) } a.extend(a.effects, { version: "1.10.3", save: function (a, b) { for (var d = 0; d < b.length; d++) null !== b[d] && a.data(c + b[d], a[0].style[b[d]]) }, restore: function (a, d) { var e, f; for (f = 0; f < d.length; f++) null !== d[f] && (e = a.data(c + d[f]), e === b && (e = ""), a.css(d[f], e)) }, setMode: function (a, b) { return "toggle" === b && (b = a.is(":hidden") ? "show" : "hide"), b }, getBaseline: function (a, b) { var c, d; switch (a[0]) { case"top": c = 0; break; case"middle": c = .5; break; case"bottom": c = 1; break; default: c = a[0] / b.height } switch (a[1]) { case"left": d = 0; break; case"center": d = .5; break; case"right": d = 1; break; default: d = a[1] / b.width } return {x: d, y: c} }, createWrapper: function (b) { if (b.parent().is(".ui-effects-wrapper")) return b.parent(); var c = {width: b.outerWidth(!0), height: b.outerHeight(!0), float: b.css("float")}, d = a("

    ").addClass("ui-effects-wrapper").css({ fontSize: "100%", background: "transparent", border: "none", margin: 0, padding: 0 }), e = {width: b.width(), height: b.height()}, f = document.activeElement; try { f.id } catch (a) { f = document.body } return b.wrap(d), (b[0] === f || a.contains(b[0], f)) && a(f).focus(), d = b.parent(), "static" === b.css("position") ? (d.css({position: "relative"}), b.css({position: "relative"})) : (a.extend(c, { position: b.css("position"), zIndex: b.css("z-index") }), a.each(["top", "left", "bottom", "right"], function (a, d) { c[d] = b.css(d), isNaN(parseInt(c[d], 10)) && (c[d] = "auto") }), b.css({ position: "relative", top: 0, left: 0, right: "auto", bottom: "auto" })), b.css(e), d.css(c).show() }, removeWrapper: function (b) { var c = document.activeElement; return b.parent().is(".ui-effects-wrapper") && (b.parent().replaceWith(b), (b[0] === c || a.contains(b[0], c)) && a(c).focus()), b }, setTransition: function (b, c, d, e) { return e = e || {}, a.each(c, function (a, c) { var f = b.cssUnit(c); f[0] > 0 && (e[c] = f[0] * d + f[1]) }), e } }), a.fn.extend({ effect: function () { function g(c) { function h() { a.isFunction(e) && e.call(d[0]), a.isFunction(c) && c() } var d = a(this), e = b.complete, g = b.mode; (d.is(":hidden") ? "hide" === g : "show" === g) ? (d[g](), h()) : f.call(d[0], b, h) } var b = d.apply(this, arguments), c = b.mode, e = b.queue, f = a.effects.effect[b.effect]; return a.fx.off || !f ? c ? this[c](b.duration, b.complete) : this.each(function () { b.complete && b.complete.call(this) }) : e === !1 ? this.each(g) : this.queue(e || "fx", g) }, show: function (a) { return function (b) { if (e(b)) return a.apply(this, arguments); var c = d.apply(this, arguments); return c.mode = "show", this.effect.call(this, c) } }(a.fn.show), hide: function (a) { return function (b) { if (e(b)) return a.apply(this, arguments); var c = d.apply(this, arguments); return c.mode = "hide", this.effect.call(this, c) } }(a.fn.hide), toggle: function (a) { return function (b) { if (e(b) || "boolean" == typeof b) return a.apply(this, arguments); var c = d.apply(this, arguments); return c.mode = "toggle", this.effect.call(this, c) } }(a.fn.toggle), cssUnit: function (b) { var c = this.css(b), d = []; return a.each(["em", "px", "%", "pt"], function (a, b) { c.indexOf(b) > 0 && (d = [parseFloat(c), b]) }), d } }) }(), function () { var b = {}; a.each(["Quad", "Cubic", "Quart", "Quint", "Expo"], function (a, c) { b[c] = function (b) { return Math.pow(b, a + 2) } }), a.extend(b, { Sine: function (a) { return 1 - Math.cos(a * Math.PI / 2) }, Circ: function (a) { return 1 - Math.sqrt(1 - a * a) }, Elastic: function (a) { return 0 === a || 1 === a ? a : -Math.pow(2, 8 * (a - 1)) * Math.sin((80 * (a - 1) - 7.5) * Math.PI / 15) }, Back: function (a) { return a * a * (3 * a - 2) }, Bounce: function (a) { for (var b, c = 4; a < ((b = Math.pow(2, --c)) - 1) / 11;) ; return 1 / Math.pow(4, 3 - c) - 7.5625 * Math.pow((3 * b - 2) / 22 - a, 2) } }), a.each(b, function (b, c) { a.easing["easeIn" + b] = c, a.easing["easeOut" + b] = function (a) { return 1 - c(1 - a) }, a.easing["easeInOut" + b] = function (a) { return a < .5 ? c(2 * a) / 2 : 1 - c(a * -2 + 2) / 2 } }) }() }(jQuery), function (a, b) { var c = 0, d = {}, e = {}; d.height = d.paddingTop = d.paddingBottom = d.borderTopWidth = d.borderBottomWidth = "hide", e.height = e.paddingTop = e.paddingBottom = e.borderTopWidth = e.borderBottomWidth = "show", a.widget("ui.accordion", { version: "1.10.3", options: { active: 0, animate: {}, collapsible: !1, event: "click", header: "> li > :first-child,> :not(li):even", heightStyle: "auto", icons: {activeHeader: "ui-icon-triangle-1-s", header: "ui-icon-triangle-1-e"}, activate: null, beforeActivate: null }, _create: function () { var b = this.options; this.prevShow = this.prevHide = a(), this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role", "tablist"), b.collapsible || b.active !== !1 && null != b.active || (b.active = 0), this._processPanels(), b.active < 0 && (b.active += this.headers.length), this._refresh() }, _getCreateEventData: function () { return { header: this.active, panel: this.active.length ? this.active.next() : a(), content: this.active.length ? this.active.next() : a() } }, _createIcons: function () { var b = this.options.icons; b && (a("").addClass("ui-accordion-header-icon ui-icon " + b.header).prependTo(this.headers), this.active.children(".ui-accordion-header-icon").removeClass(b.header).addClass(b.activeHeader), this.headers.addClass("ui-accordion-icons")) }, _destroyIcons: function () { this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove() }, _destroy: function () { var a; this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"), this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function () { /^ui-accordion/.test(this.id) && this.removeAttribute("id") }), this._destroyIcons(), a = this.headers.next().css("display", "").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function () { /^ui-accordion/.test(this.id) && this.removeAttribute("id") }), "content" !== this.options.heightStyle && a.css("height", "") }, _setOption: function (a, b) { return "active" === a ? void this._activate(b) : ("event" === a && (this.options.event && this._off(this.headers, this.options.event), this._setupEvents(b)), this._super(a, b), "collapsible" !== a || b || this.options.active !== !1 || this._activate(0), "icons" === a && (this._destroyIcons(), b && this._createIcons()), void("disabled" === a && this.headers.add(this.headers.next()).toggleClass("ui-state-disabled", !!b))) }, _keydown: function (b) { if (!b.altKey && !b.ctrlKey) { var c = a.ui.keyCode, d = this.headers.length, e = this.headers.index(b.target), f = !1; switch (b.keyCode) { case c.RIGHT: case c.DOWN: f = this.headers[(e + 1) % d]; break; case c.LEFT: case c.UP: f = this.headers[(e - 1 + d) % d]; break; case c.SPACE: case c.ENTER: this._eventHandler(b); break; case c.HOME: f = this.headers[0]; break; case c.END: f = this.headers[d - 1] } f && (a(b.target).attr("tabIndex", -1), a(f).attr("tabIndex", 0), f.focus(), b.preventDefault()) } }, _panelKeyDown: function (b) { b.keyCode === a.ui.keyCode.UP && b.ctrlKey && a(b.currentTarget).prev().focus() }, refresh: function () { var b = this.options; this._processPanels(), b.active === !1 && b.collapsible === !0 || !this.headers.length ? (b.active = !1, this.active = a()) : b.active === !1 ? this._activate(0) : this.active.length && !a.contains(this.element[0], this.active[0]) ? this.headers.length === this.headers.find(".ui-state-disabled").length ? (b.active = !1, this.active = a()) : this._activate(Math.max(0, b.active - 1)) : b.active = this.headers.index(this.active), this._destroyIcons(), this._refresh() }, _processPanels: function () { this.headers = this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"), this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide() }, _refresh: function () { var b, d = this.options, e = d.heightStyle, f = this.element.parent(), g = this.accordionId = "ui-accordion-" + (this.element.attr("id") || ++c); this.active = this._findActive(d.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"), this.active.next().addClass("ui-accordion-content-active").show(), this.headers.attr("role", "tab").each(function (b) { var c = a(this), d = c.attr("id"), e = c.next(), f = e.attr("id"); d || (d = g + "-header-" + b, c.attr("id", d)), f || (f = g + "-panel-" + b, e.attr("id", f)), c.attr("aria-controls", f), e.attr("aria-labelledby", d) }).next().attr("role", "tabpanel"), this.headers.not(this.active).attr({ "aria-selected": "false", tabIndex: -1 }).next().attr({ "aria-expanded": "false", "aria-hidden": "true" }).hide(), this.active.length ? this.active.attr({ "aria-selected": "true", tabIndex: 0 }).next().attr({ "aria-expanded": "true", "aria-hidden": "false" }) : this.headers.eq(0).attr("tabIndex", 0), this._createIcons(), this._setupEvents(d.event), "fill" === e ? (b = f.height(), this.element.siblings(":visible").each(function () { var c = a(this), d = c.css("position"); "absolute" !== d && "fixed" !== d && (b -= c.outerHeight(!0)) }), this.headers.each(function () { b -= a(this).outerHeight(!0) }), this.headers.next().each(function () { a(this).height(Math.max(0, b - a(this).innerHeight() + a(this).height())) }).css("overflow", "auto")) : "auto" === e && (b = 0, this.headers.next().each(function () { b = Math.max(b, a(this).css("height", "").height()) }).height(b)) }, _activate: function (b) { var c = this._findActive(b)[0]; c !== this.active[0] && (c = c || this.active[0], this._eventHandler({ target: c, currentTarget: c, preventDefault: a.noop })) }, _findActive: function (b) { return "number" == typeof b ? this.headers.eq(b) : a() }, _setupEvents: function (b) { var c = {keydown: "_keydown"}; b && a.each(b.split(" "), function (a, b) { c[b] = "_eventHandler" }), this._off(this.headers.add(this.headers.next())), this._on(this.headers, c), this._on(this.headers.next(), {keydown: "_panelKeyDown"}), this._hoverable(this.headers), this._focusable(this.headers) }, _eventHandler: function (b) { var c = this.options, d = this.active, e = a(b.currentTarget), f = e[0] === d[0], g = f && c.collapsible, h = g ? a() : e.next(), i = d.next(), j = {oldHeader: d, oldPanel: i, newHeader: g ? a() : e, newPanel: h}; b.preventDefault(), f && !c.collapsible || this._trigger("beforeActivate", b, j) === !1 || (c.active = !g && this.headers.index(e), this.active = f ? a() : e, this._toggle(j), d.removeClass("ui-accordion-header-active ui-state-active"), c.icons && d.children(".ui-accordion-header-icon").removeClass(c.icons.activeHeader).addClass(c.icons.header), f || (e.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"), c.icons && e.children(".ui-accordion-header-icon").removeClass(c.icons.header).addClass(c.icons.activeHeader), e.next().addClass("ui-accordion-content-active"))) }, _toggle: function (b) { var c = b.newPanel, d = this.prevShow.length ? this.prevShow : b.oldPanel; this.prevShow.add(this.prevHide).stop(!0, !0), this.prevShow = c, this.prevHide = d, this.options.animate ? this._animate(c, d, b) : (d.hide(), c.show(), this._toggleComplete(b)), d.attr({ "aria-expanded": "false", "aria-hidden": "true" }), d.prev().attr("aria-selected", "false"), c.length && d.length ? d.prev().attr("tabIndex", -1) : c.length && this.headers.filter(function () { return 0 === a(this).attr("tabIndex") }).attr("tabIndex", -1), c.attr({ "aria-expanded": "true", "aria-hidden": "false" }).prev().attr({"aria-selected": "true", tabIndex: 0}) }, _animate: function (a, b, c) { var f, g, h, i = this, j = 0, k = a.length && (!b.length || a.index() < b.index()), l = this.options.animate || {}, m = k && l.down || l, n = function () { i._toggleComplete(c) }; return "number" == typeof m && (h = m), "string" == typeof m && (g = m), g = g || m.easing || l.easing, h = h || m.duration || l.duration, b.length ? a.length ? (f = a.show().outerHeight(), b.animate(d, { duration: h, easing: g, step: function (a, b) { b.now = Math.round(a) } }), void a.hide().animate(e, { duration: h, easing: g, complete: n, step: function (a, c) { c.now = Math.round(a), "height" !== c.prop ? j += c.now : "content" !== i.options.heightStyle && (c.now = Math.round(f - b.outerHeight() - j), j = 0) } })) : b.animate(d, h, g, n) : a.animate(e, h, g, n) }, _toggleComplete: function (a) { var b = a.oldPanel; b.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"), b.length && (b.parent()[0].className = b.parent()[0].className), this._trigger("activate", null, a) } }) }(jQuery), function (a, b) { var c = 0; a.widget("ui.autocomplete", { version: "1.10.3", defaultElement: "", options: { appendTo: null, autoFocus: !1, delay: 300, minLength: 1, position: {my: "left top", at: "left bottom", collision: "none"}, source: null, change: null, close: null, focus: null, open: null, response: null, search: null, select: null }, pending: 0, _create: function () { var b, c, d, e = this.element[0].nodeName.toLowerCase(), f = "textarea" === e, g = "input" === e; this.isMultiLine = !!f || !g && this.element.prop("isContentEditable"), this.valueMethod = this.element[f || g ? "val" : "text"], this.isNewMenu = !0, this.element.addClass("ui-autocomplete-input").attr("autocomplete", "off"), this._on(this.element, { keydown: function (e) { if (this.element.prop("readOnly")) return b = !0, d = !0, void(c = !0); b = !1, d = !1, c = !1; var f = a.ui.keyCode; switch (e.keyCode) { case f.PAGE_UP: b = !0, this._move("previousPage", e); break; case f.PAGE_DOWN: b = !0, this._move("nextPage", e); break; case f.UP: b = !0, this._keyEvent("previous", e); break; case f.DOWN: b = !0, this._keyEvent("next", e); break; case f.ENTER: case f.NUMPAD_ENTER: this.menu.active && (b = !0, e.preventDefault(), this.menu.select(e)); break; case f.TAB: this.menu.active && this.menu.select(e); break; case f.ESCAPE: this.menu.element.is(":visible") && (this._value(this.term), this.close(e), e.preventDefault()); break; default: c = !0, this._searchTimeout(e) } }, keypress: function (d) { if (b) return b = !1, void(this.isMultiLine && !this.menu.element.is(":visible") || d.preventDefault()); if (!c) { var e = a.ui.keyCode; switch (d.keyCode) { case e.PAGE_UP: this._move("previousPage", d); break; case e.PAGE_DOWN: this._move("nextPage", d); break; case e.UP: this._keyEvent("previous", d); break; case e.DOWN: this._keyEvent("next", d) } } }, input: function (a) { return d ? (d = !1, void a.preventDefault()) : void this._searchTimeout(a) }, focus: function () { this.selectedItem = null, this.previous = this._value() }, blur: function (a) { return this.cancelBlur ? void delete this.cancelBlur : (clearTimeout(this.searching), this.close(a), void this._change(a)) } }), this._initSource(), this.menu = a("