Free javascript Hosting


init-min.js

Uploaded on Mar 25 2022 19:56 by alakusomer

/*!
* SellerRunning v1.0.0 (https://sellerrunning.com/)
* Kazim Aydin - aydinkazim@gmail.com
* Copyright 2018-2020 Boleni LLC
*/
function Widget(n, t) {
this.outer = document.createElement("x-sellerrunning");
this.inner = this.outer.attachShadow({
mode: "open"
});
(t || document.body).appendChild(this.outer)
}
var $sllrrnngWidget, PU;
! function(n, t) {
"use strict";
"object" == typeof module && "object" == typeof module.exports ? module.exports = n.document ? t(n, !0) : function(n) {
if (!n.document) throw new Error("jQuery requires a window with a document");
return t(n)
} : t(n)
}("undefined" != typeof window ? window : this, function(n, t) {
"use strict";

function hr(n, t, i) {
var r, u = (t = t || f).createElement("script");
if (u.text = n, i)
for (r in gf) i[r] && (u[r] = i[r]);
t.head.appendChild(u).parentNode.removeChild(u)
}

function it(n) {
return null == n ? n + "" : "object" == typeof n || "function" == typeof n ? bt[or.call(n)] || "object" : typeof n
}

function hi(n) {
var t = !!n && "length" in n && n.length,
i = it(n);
return !u(n) && !tt(n) && ("array" === i || 0 === t || "number" == typeof t && t > 0 && t - 1 in n)
}

function v(n, t) {
return n.nodeName && n.nodeName.toLowerCase() === t.toLowerCase()
}

function li(n, t, r) {
return u(t) ? i.grep(n, function(n, i) {
return !!t.call(n, i, n) !== r
}) : t.nodeType ? i.grep(n, function(n) {
return n === t !== r
}) : "string" != typeof t ? i.grep(n, function(n) {
return wt.call(t, n) > -1 !== r
}) : i.filter(t, n, r)
}

function wr(n, t) {
while ((n = n[t]) && 1 !== n.nodeType);
return n
}

function te(n) {
var t = {};
return i.each(n.match(l) || [], function(n, i) {
t[i] = !0
}), t
}

function ut(n) {
return n
}

function dt(n) {
throw n;
}

function br(n, t, i, r) {
var f;
try {
n && u(f = n.promise) ? f.call(n).done(t).fail(i) : n && u(f = n.then) ? f.call(n, t, i) : t.apply(void 0, [n].slice(r))
} catch (n) {
i.apply(void 0, [n])
}
}

function ni() {
f.removeEventListener("DOMContentLoaded", ni);
n.removeEventListener("load", ni);
i.ready()
}

function ue(n, t) {
return t.toUpperCase()
}

function y(n) {
return n.replace(ie, "ms-").replace(re, ue)
}

function at() {
this.expando = i.expando + at.uid++
}

function oe(n) {
return "true" === n || "false" !== n && ("null" === n ? null : n === +n + "" ? +n : fe.test(n) ? JSON.parse(n) : n)
}

function dr(n, t, i) {
var r;
if (void 0 === i && 1 === n.nodeType)
if (r = "data-" + t.replace(ee, "-$&").toLowerCase(), "string" == typeof(i = n.getAttribute(r))) {
try {
i = oe(i)
} catch (n) {}
o.set(n, t, i)
} else i = void 0;
return i
}

function tu(n, t, r, u) {
var s, h, c = 20,
l = u ? function() {
return u.cur()
} : function() {
return i.css(n, t, "")
},
o = l(),
e = r && r[3] || (i.cssNumber[t] ? "" : "px"),
f = (i.cssNumber[t] || "px" !== e && +o) && vt.exec(i.css(n, t));
if (f && f[3] !== e) {
for (o /= 2, e = e || f[3], f = +o || 1; c--;) i.style(n, t, f + e), (1 - h) * (1 - (h = l() / o || .5)) <= 0 && (c = 0), f /= h;
f *= 2;
i.style(n, t, f + e);
r = r || []
}
return r && (f = +f || +o || 0, s = r[1] ? f + (r[1] + 1) * r[2] : +r[2], u && (u.unit = e, u.start = f, u.end = s)), s
}

function se(n) {
var r, f = n.ownerDocument,
u = n.nodeName,
t = ai[u];
return t || (r = f.body.appendChild(f.createElement(u)), t = i.css(r, "display"), r.parentNode.removeChild(r), "none" === t && (t = "block"), ai[u] = t, t)
}

function ft(n, t) {
for (var e, u, f = [], i = 0, o = n.length; i < o; i++)(u = n[i]).style && (e = u.style.display, t ? ("none" === e && (f[i] = r.get(u, "display") || null, f[i] || (u.style.display = "")), "" === u.style.display && ti(u) && (f[i] = se(u))) : "none" !== e && (f[i] = "none", r.set(u, "display", e)));
for (i = 0; i < o; i++) null != f[i] && (n[i].style.display = f[i]);
return n
}

function s(n, t) {
var r;
return r = "undefined" != typeof n.getElementsByTagName ? n.getElementsByTagName(t || "*") : "undefined" != typeof n.querySelectorAll ? n.querySelectorAll(t || "*") : [], void 0 === t || t && v(n, t) ? i.merge([n], r) : r
}

function vi(n, t) {
for (var i = 0, u = n.length; i < u; i++) r.set(n[i], "globalEval", !t || r.get(t[i], "globalEval"))
}

function eu(n, t, r, u, f) {
for (var e, o, p, a, w, v, h = t.createDocumentFragment(), y = [], l = 0, b = n.length; l < b; l++)
if ((e = n[l]) || 0 === e)
if ("object" === it(e)) i.merge(y, e.nodeType ? [e] : e);
else if (fu.test(e)) {
for (o = o || h.appendChild(t.createElement("div")), p = (ru.exec(e) || ["", ""])[1].toLowerCase(), a = c[p] || c._default, o.innerHTML = a[1] + i.htmlPrefilter(e) + a[2], v = a[0]; v--;) o = o.lastChild;
i.merge(y, o.childNodes);
(o = h.firstChild).textContent = ""
} else y.push(t.createTextNode(e));
for (h.textContent = "", l = 0; e = y[l++];)
if (u && i.inArray(e, u) > -1) f && f.push(e);
else if (w = i.contains(e.ownerDocument, e), o = s(h.appendChild(e), "script"), w && vi(o), r)
for (v = 0; e = o[v++];) uu.test(e.type || "") && r.push(e);
return h
}

function ri() {
return !0
}

function et() {
return !1
}

function su() {
try {
return f.activeElement
} catch (n) {}
}

function yi(n, t, r, u, f, e) {
var o, s;
if ("object" == typeof t) {
"string" != typeof r && (u = u || r, r = void 0);
for (s in t) yi(n, s, r, u, t[s], e);
return n
}
if (null == u && null == f ? (f = r, u = r = void 0) : null == f && ("string" == typeof r ? (f = u, u = void 0) : (f = u, u = r, r = void 0)), !1 === f) f = et;
else if (!f) return n;
return 1 === e && (o = f, (f = function(n) {
return i().off(n), o.apply(this, arguments)
}).guid = o.guid || (o.guid = i.guid++)), n.each(function() {
i.event.add(this, t, f, u, r)
})
}

function hu(n, t) {
return v(n, "table") && v(11 !== t.nodeType ? t : t.firstChild, "tr") ? i(n).children("tbody")[0] || n : n
}

function pe(n) {
return n.type = (null !== n.getAttribute("type")) + "/" + n.type, n
}

function we(n) {
return "true/" === (n.type || "").slice(0, 5) ? n.type = n.type.slice(5) : n.removeAttribute("type"), n
}

function cu(n, t) {
var u, c, f, s, h, l, a, e;
if (1 === t.nodeType) {
if (r.hasData(n) && (s = r.access(n), h = r.set(t, s), e = s.events)) {
delete h.handle;
h.events = {};
for (f in e)
for (u = 0, c = e[f].length; u < c; u++) i.event.add(t, f, e[f][u])
}
o.hasData(n) && (l = o.access(n), a = i.extend({}, l), o.set(t, a))
}
}

function be(n, t) {
var i = t.nodeName.toLowerCase();
"input" === i && iu.test(n.type) ? t.checked = n.checked : "input" !== i && "textarea" !== i || (t.defaultValue = n.defaultValue)
}

function ot(n, t, f, o) {
t = er.apply([], t);
var l, w, a, v, h, b, c = 0,
y = n.length,
d = y - 1,
p = t[0],
k = u(p);
if (k || y > 1 && "string" == typeof p && !e.checkClone && ve.test(p)) return n.each(function(i) {
var r = n.eq(i);
k && (t[0] = p.call(this, i, r.html()));
ot(r, t, f, o)
});
if (y && (l = eu(t, n[0].ownerDocument, !1, n, o), w = l.firstChild, 1 === l.childNodes.length && (l = w), w || o)) {
for (v = (a = i.map(s(l, "script"), pe)).length; c < y; c++) h = l, c !== d && (h = i.clone(h, !0, !0), v && i.merge(a, s(h, "script"))), f.call(n[c], h, c);
if (v)
for (b = a[a.length - 1].ownerDocument, i.map(a, we), c = 0; c < v; c++) h = a[c], uu.test(h.type || "") && !r.access(h, "globalEval") && i.contains(b, h) && (h.src && "module" !== (h.type || "").toLowerCase() ? i._evalUrl && i._evalUrl(h.src) : hr(h.textContent.replace(ye, ""), b, h))
}
return n
}

function lu(n, t, r) {
for (var u, e = t ? i.filter(t, n) : n, f = 0; null != (u = e[f]); f++) r || 1 !== u.nodeType || i.cleanData(s(u)), u.parentNode && (r && i.contains(u.ownerDocument, u) && vi(s(u, "script")), u.parentNode.removeChild(u));
return n
}

function yt(n, t, r) {
var o, s, h, f, u = n.style;
return (r = r || ui(n)) && ("" !== (f = r.getPropertyValue(t) || r[t]) || i.contains(n.ownerDocument, n) || (f = i.style(n, t)), !e.pixelBoxStyles() && pi.test(f) && ke.test(t) && (o = u.width, s = u.minWidth, h = u.maxWidth, u.minWidth = u.maxWidth = u.width = f, f = r.width, u.width = o, u.minWidth = s, u.maxWidth = h)), void 0 !== f ? f + "" : f
}

function au(n, t) {
return {
get: function() {
if (!n()) return (this.get = t).apply(this, arguments);
delete this.get
}
}
}

function no(n) {
if (n in wu) return n;
for (var i = n[0].toUpperCase() + n.slice(1), t = pu.length; t--;)
if ((n = pu[t] + i) in wu) return n
}

function bu(n) {
var t = i.cssProps[n];
return t || (t = i.cssProps[n] = no(n) || n), t
}

function ku(n, t, i) {
var r = vt.exec(t);
return r ? Math.max(0, r[2] - (i || 0)) + (r[3] || "px") : t
}

function wi(n, t, r, u, f, e) {
var o = "width" === t ? 1 : 0,
h = 0,
s = 0;
if (r === (u ? "border" : "content")) return 0;
for (; o < 4; o += 2) "margin" === r && (s += i.css(n, r + w[o], !0, f)), u ? ("content" === r && (s -= i.css(n, "padding" + w[o], !0, f)), "margin" !== r && (s -= i.css(n, "border" + w[o] + "Width", !0, f))) : (s += i.css(n, "padding" + w[o], !0, f), "padding" !== r ? s += i.css(n, "border" + w[o] + "Width", !0, f) : h += i.css(n, "border" + w[o] + "Width", !0, f));
return !u && e >= 0 && (s += Math.max(0, Math.ceil(n["offset" + t[0].toUpperCase() + t.slice(1)] - e - s - h - .5))), s
}

function du(n, t, r) {
var f = ui(n),
u = yt(n, t, f),
s = "border-box" === i.css(n, "boxSizing", !1, f),
o = s;
if (pi.test(u)) {
if (!r) return u;
u = "auto"
}
return o = o && (e.boxSizingReliable() || u === n.style[t]), ("auto" === u || !parseFloat(u) && "inline" === i.css(n, "display", !1, f)) && (u = n["offset" + t[0].toUpperCase() + t.slice(1)], o = !0), (u = parseFloat(u) || 0) + wi(n, t, r || (s ? "border" : "content"), o, f, u) + "px"
}

function h(n, t, i, r, u) {
return new h.prototype.init(n, t, i, r, u)
}

function bi() {
fi && (!1 === f.hidden && n.requestAnimationFrame ? n.requestAnimationFrame(bi) : n.setTimeout(bi, i.fx.interval), i.fx.tick())
}

function tf() {
return n.setTimeout(function() {
st = void 0
}), st = Date.now()
}

function ei(n, t) {
var u, r = 0,
i = {
height: n
};
for (t = t ? 1 : 0; r < 4; r += 2 - t) i["margin" + (u = w[r])] = i["padding" + u] = n;
return t && (i.opacity = i.width = n), i
}

function rf(n, t, i) {
for (var u, f = (a.tweeners[t] || []).concat(a.tweeners["*"]), r = 0, e = f.length; r < e; r++)
if (u = f[r].call(i, t, n)) return u
}

function to(n, t, u) {
var f, y, w, c, b, h, o, l, k = "width" in t || "height" in t,
v = this,
p = {},
s = n.style,
a = n.nodeType && ti(n),
e = r.get(n, "fxshow");
u.queue || (null == (c = i._queueHooks(n, "fx")).unqueued && (c.unqueued = 0, b = c.empty.fire, c.empty.fire = function() {
c.unqueued || b()
}), c.unqueued++, v.always(function() {
v.always(function() {
c.unqueued--;
i.queue(n, "fx").length || c.empty.fire()
})
}));
for (f in t)
if (y = t[f], gu.test(y)) {
if (delete t[f], w = w || "toggle" === y, y === (a ? "hide" : "show")) {
if ("show" !== y || !e || void 0 === e[f]) continue;
a = !0
}
p[f] = e && e[f] || i.style(n, f)
} if ((h = !i.isEmptyObject(t)) || !i.isEmptyObject(p)) {
k && 1 === n.nodeType && (u.overflow = [s.overflow, s.overflowX, s.overflowY], null == (o = e && e.display) && (o = r.get(n, "display")), "none" === (l = i.css(n, "display")) && (o ? l = o : (ft([n], !0), o = n.style.display || o, l = i.css(n, "display"), ft([n]))), ("inline" === l || "inline-block" === l && null != o) && "none" === i.css(n, "float") && (h || (v.done(function() {
s.display = o
}), null == o && (l = s.display, o = "none" === l ? "" : l)), s.display = "inline-block"));
u.overflow && (s.overflow = "hidden", v.always(function() {
s.overflow = u.overflow[0];
s.overflowX = u.overflow[1];
s.overflowY = u.overflow[2]
}));
h = !1;
for (f in p) h || (e ? "hidden" in e && (a = e.hidden) : e = r.access(n, "fxshow", {
display: o
}), w && (e.hidden = !a), a && ft([n], !0), v.done(function() {
a || ft([n]);
r.remove(n, "fxshow");
for (f in p) i.style(n, f, p[f])
})), h = rf(a ? e[f] : 0, f, v), f in e || (e[f] = h.start, a && (h.end = h.start, h.start = 0))
}
}

function io(n, t) {
var r, f, e, u, o;
for (r in n)
if (f = y(r), e = t[f], u = n[r], Array.isArray(u) && (e = u[1], u = n[r] = u[0]), r !== f && (n[f] = u, delete n[r]), (o = i.cssHooks[f]) && "expand" in o) {
u = o.expand(u);
delete n[f];
for (r in u) r in n || (n[r] = u[r], t[r] = e)
} else t[f] = e
}

function a(n, t, r) {
var o, s, h = 0,
v = a.prefilters.length,
e = i.Deferred().always(function() {
delete l.elem
}),
l = function() {
if (s) return !1;
for (var o = st || tf(), t = Math.max(0, f.startTime + f.duration - o), i = 1 - (t / f.duration || 0), r = 0, u = f.tweens.length; r < u; r++) f.tweens[r].run(i);
return e.notifyWith(n, [f, i, t]), i < 1 && u ? t : (u || e.notifyWith(n, [f, 1, 0]), e.resolveWith(n, [f]), !1)
},
f = e.promise({
elem: n,
props: i.extend({}, t),
opts: i.extend(!0, {
specialEasing: {},
easing: i.easing._default
}, r),
originalProperties: t,
originalOptions: r,
startTime: st || tf(),
duration: r.duration,
tweens: [],
createTween: function(t, r) {
var u = i.Tween(n, f.opts, t, r, f.opts.specialEasing[t] || f.opts.easing);
return f.tweens.push(u), u
},
stop: function(t) {
var i = 0,
r = t ? f.tweens.length : 0;
if (s) return this;
for (s = !0; i < r; i++) f.tweens[i].run(1);
return t ? (e.notifyWith(n, [f, 1, 0]), e.resolveWith(n, [f, t])) : e.rejectWith(n, [f, t]), this
}
}),
c = f.props;
for (io(c, f.opts.specialEasing); h < v; h++)
if (o = a.prefilters[h].call(f, n, c, f.opts)) return u(o.stop) && (i._queueHooks(f.elem, f.opts.queue).stop = o.stop.bind(o)), o;
return i.map(c, rf, f), u(f.opts.start) && f.opts.start.call(n, f), f.progress(f.opts.progress).done(f.opts.done, f.opts.complete).fail(f.opts.fail).always(f.opts.always), i.fx.timer(i.extend(l, {
elem: n,
anim: f,
queue: f.opts.queue
})), f
}

function g(n) {
return (n.match(l) || []).join(" ")
}

function nt(n) {
return n.getAttribute && n.getAttribute("class") || ""
}

function ki(n) {
return Array.isArray(n) ? n : "string" == typeof n ? n.match(l) || [] : []
}

function tr(n, t, r, u) {
var f;
if (Array.isArray(t)) i.each(t, function(t, i) {
r || ro.test(n) ? u(n, i) : tr(n + "[" + ("object" == typeof i && null != i ? t : "") + "]", i, r, u)
});
else if (r || "object" !== it(t)) u(n, t);
else
for (f in t) tr(n + "[" + f + "]", t[f], r, u)
}

function vf(n) {
return function(t, i) {
"string" != typeof t && (i = t, t = "*");
var r, f = 0,
e = t.toLowerCase().match(l) || [];
if (u(i))
while (r = e[f++]) "+" === r[0] ? (r = r.slice(1) || "*", (n[r] = n[r] || []).unshift(i)) : (n[r] = n[r] || []).push(i)
}
}

function yf(n, t, r, u) {
function e(s) {
var h;
return f[s] = !0, i.each(n[s] || [], function(n, i) {
var s = i(t, r, u);
return "string" != typeof s || o || f[s] ? o ? !(h = s) : void 0 : (t.dataTypes.unshift(s), e(s), !1)
}), h
}
var f = {},
o = n === ir;
return e(t.dataTypes[0]) || !f["*"] && e("*")
}

function ur(n, t) {
var r, u, f = i.ajaxSettings.flatOptions || {};
for (r in t) void 0 !== t[r] && ((f[r] ? n : u || (u = {}))[r] = t[r]);
return u && i.extend(!0, n, u), n
}

function ao(n, t, i) {
for (var e, u, f, o, s = n.contents, r = n.dataTypes;
"*" === r[0];) r.shift(), void 0 === e && (e = n.mimeType || t.getResponseHeader("Content-Type"));
if (e)
for (u in s)
if (s[u] && s[u].test(e)) {
r.unshift(u);
break
} if (r[0] in i) f = r[0];
else {
for (u in i) {
if (!r[0] || n.converters[u + " " + r[0]]) {
f = u;
break
}
o || (o = u)
}
f = f || o
}
if (f) return f !== r[0] && r.unshift(f), i[f]
}

function vo(n, t, i, r) {
var h, u, f, s, e, o = {},
c = n.dataTypes.slice();
if (c[1])
for (f in n.converters) o[f.toLowerCase()] = n.converters[f];
for (u = c.shift(); u;)
if (n.responseFields[u] && (i[n.responseFields[u]] = t), !e && r && n.dataFilter && (t = n.dataFilter(t, n.dataType)), e = u, u = c.shift())
if ("*" === u) u = e;
else if ("*" !== e && e !== u) {
if (!(f = o[e + " " + u] || o["* " + u]))
for (h in o)
if ((s = h.split(" "))[1] === u && (f = o[e + " " + s[0]] || o["* " + s[0]])) {
!0 === f ? f = o[h] : !0 !== o[h] && (u = s[0], c.unshift(s[1]));
break
} if (!0 !== f)
if (f && n.throws) t = f(t);
else try {
t = f(t)
} catch (n) {
return {
state: "parsererror",
error: f ? n : "No conversion from " + e + " to " + u
}
}
}
return {
state: "success",
data: t
}
}
var k = [],
f = n.document,
kf = Object.getPrototypeOf,
d = k.slice,
er = k.concat,
si = k.push,
wt = k.indexOf,
bt = {},
or = bt.toString,
kt = bt.hasOwnProperty,
sr = kt.toString,
df = sr.call(Object),
e = {},
u = function(n) {
return "function" == typeof n && "number" != typeof n.nodeType
},
tt = function(n) {
return null != n && n === n.window
},
gf = {
type: !0,
src: !0,
noModule: !0
},
i = function(n, t) {
return new i.fn.init(n, t)
},
ne = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
b, ci, ar, vr, yr, pr, l, kr, gt, lt, ai, fu, st, fi, gu, nf, uf, ht, ff, ef, sf, di, gi, pf, ct, fr, oi, wf, bf;
i.fn = i.prototype = {
jquery: "3.3.1",
constructor: i,
length: 0,
toArray: function() {
return d.call(this)
},
get: function(n) {
return null == n ? d.call(this) : n < 0 ? this[n + this.length] : this[n]
},
pushStack: function(n) {
var t = i.merge(this.constructor(), n);
return t.prevObject = this, t
},
each: function(n) {
return i.each(this, n)
},
map: function(n) {
return this.pushStack(i.map(this, function(t, i) {
return n.call(t, i, t)
}))
},
slice: function() {
return this.pushStack(d.apply(this, arguments))
},
first: function() {
return this.eq(0)
},
last: function() {
return this.eq(-1)
},
eq: function(n) {
var i = this.length,
t = +n + (n < 0 ? i : 0);
return this.pushStack(t >= 0 && t < i ? [this[t]] : [])
},
end: function() {
return this.prevObject || this.constructor()
},
push: si,
sort: k.sort,
splice: k.splice
};
i.extend = i.fn.extend = function() {
var o, e, t, r, s, h, n = arguments[0] || {},
f = 1,
l = arguments.length,
c = !1;
for ("boolean" == typeof n && (c = n, n = arguments[f] || {}, f++), "object" == typeof n || u(n) || (n = {}), f === l && (n = this, f--); f < l; f++)
if (null != (o = arguments[f]))
for (e in o) t = n[e], n !== (r = o[e]) && (c && r && (i.isPlainObject(r) || (s = Array.isArray(r))) ? (s ? (s = !1, h = t && Array.isArray(t) ? t : []) : h = t && i.isPlainObject(t) ? t : {}, n[e] = i.extend(c, h, r)) : void 0 !== r && (n[e] = r));
return n
};
i.extend({
expando: "jQuery" + ("3.3.1" + Math.random()).replace(/\D/g, ""),
isReady: !0,
error: function(n) {
throw new Error(n);
},
noop: function() {},
isPlainObject: function(n) {
var t, i;
return !(!n || "[object Object]" !== or.call(n)) && (!(t = kf(n)) || "function" == typeof(i = kt.call(t, "constructor") && t.constructor) && sr.call(i) === df)
},
isEmptyObject: function(n) {
for (var t in n) return !1;
return !0
},
globalEval: function(n) {
hr(n)
},
each: function(n, t) {
var r, i = 0;
if (hi(n)) {
for (r = n.length; i < r; i++)
if (!1 === t.call(n[i], i, n[i])) break
} else
for (i in n)
if (!1 === t.call(n[i], i, n[i])) break;
return n
},
trim: function(n) {
return null == n ? "" : (n + "").replace(ne, "")
},
makeArray: function(n, t) {
var r = t || [];
return null != n && (hi(Object(n)) ? i.merge(r, "string" == typeof n ? [n] : n) : si.call(r, n)), r
},
inArray: function(n, t, i) {
return null == t ? -1 : wt.call(t, n, i)
},
merge: function(n, t) {
for (var u = +t.length, i = 0, r = n.length; i < u; i++) n[r++] = t[i];
return n.length = r, n
},
grep: function(n, t, i) {
for (var f, u = [], r = 0, e = n.length, o = !i; r < e; r++)(f = !t(n[r], r)) !== o && u.push(n[r]);
return u
},
map: function(n, t, i) {
var e, u, r = 0,
f = [];
if (hi(n))
for (e = n.length; r < e; r++) null != (u = t(n[r], r, i)) && f.push(u);
else
for (r in n) null != (u = t(n[r], r, i)) && f.push(u);
return er.apply([], f)
},
guid: 1,
support: e
});
"function" == typeof Symbol && (i.fn[Symbol.iterator] = k[Symbol.iterator]);
i.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function(n, t) {
bt["[object " + t + "]"] = t.toLowerCase()
});
b = function(n) {
function u(n, t, r, u) {
var s, p, l, a, w, d, g, y = t && t.ownerDocument,
v = t ? t.nodeType : 9;
if (r = r || [], "string" != typeof n || !n || 1 !== v && 9 !== v && 11 !== v) return r;
if (!u && ((t ? t.ownerDocument || t : c) !== i && b(t), t = t || i, h)) {
if (11 !== v && (w = cr.exec(n)))
if (s = w[1]) {
if (9 === v) {
if (!(l = t.getElementById(s))) return r;
if (l.id === s) return r.push(l), r
} else if (y && (l = y.getElementById(s)) && et(t, l) && l.id === s) return r.push(l), r
} else {
if (w[2]) return k.apply(r, t.getElementsByTagName(n)), r;
if ((s = w[3]) && e.getElementsByClassName && t.getElementsByClassName) return k.apply(r, t.getElementsByClassName(s)), r
} if (e.qsa && !lt[n + " "] && (!o || !o.test(n))) {
if (1 !== v) y = t, g = n;
else if ("object" !== t.nodeName.toLowerCase()) {
for ((a = t.getAttribute("id")) ? a = a.replace(vi, yi) : t.setAttribute("id", a = f), p = (d = ft(n)).length; p--;) d[p] = "#" + a + " " + yt(d[p]);
g = d.join(",");
y = ni.test(n) && ri(t.parentNode) || t
}
if (g) try {
return k.apply(r, y.querySelectorAll(g)), r
} catch (n) {} finally {
a === f && t.removeAttribute("id")
}
}
}
return si(n.replace(at, "$1"), t, r, u)
}

function ti() {
function n(r, u) {
return i.push(r + " ") > t.cacheLength && delete n[i.shift()], n[r + " "] = u
}
var i = [];
return n
}

function l(n) {
return n[f] = !0, n
}

function a(n) {
var t = i.createElement("fieldset");
try {
return !!n(t)
} catch (n) {
return !1
} finally {
t.parentNode && t.parentNode.removeChild(t);
t = null
}
}

function ii(n, i) {
for (var r = n.split("|"), u = r.length; u--;) t.attrHandle[r[u]] = i
}

function wi(n, t) {
var i = t && n,
r = i && 1 === n.nodeType && 1 === t.nodeType && n.sourceIndex - t.sourceIndex;
if (r) return r;
if (i)
while (i = i.nextSibling)
if (i === t) return -1;
return n ? 1 : -1
}

function ar(n) {
return function(t) {
return "input" === t.nodeName.toLowerCase() && t.type === n
}
}

function vr(n) {
return function(t) {
var i = t.nodeName.toLowerCase();
return ("input" === i || "button" === i) && t.type === n
}
}

function bi(n) {
return function(t) {
return "form" in t ? t.parentNode && !1 === t.disabled ? "label" in t ? "label" in t.parentNode ? t.parentNode.disabled === n : t.disabled === n : t.isDisabled === n || t.isDisabled !== !n && lr(t) === n : t.disabled === n : "label" in t && t.disabled === n
}
}

function it(n) {
return l(function(t) {
return t = +t, l(function(i, r) {
for (var u, f = n([], i.length, t), e = f.length; e--;) i[u = f[e]] && (i[u] = !(r[u] = i[u]))
})
})
}

function ri(n) {
return n && "undefined" != typeof n.getElementsByTagName && n
}

function ki() {}

function yt(n) {
for (var t = 0, r = n.length, i = ""; t < r; t++) i += n[t].value;
return i
}

function pt(n, t, i) {
var r = t.dir,
u = t.next,
e = u || r,
o = i && "parentNode" === e,
s = di++;
return t.first ? function(t, i, u) {
while (t = t[r])
if (1 === t.nodeType || o) return n(t, i, u);
return !1
} : function(t, i, h) {
var c, l, a, y = [v, s];
if (h) {
while (t = t[r])
if ((1 === t.nodeType || o) && n(t, i, h)) return !0
} else
while (t = t[r])
if (1 === t.nodeType || o)
if (a = t[f] || (t[f] = {}), l = a[t.uniqueID] || (a[t.uniqueID] = {}), u && u === t.nodeName.toLowerCase()) t = t[r] || t;
else {
if ((c = l[e]) && c[0] === v && c[1] === s) return y[2] = c[2];
if (l[e] = y, y[2] = n(t, i, h)) return !0
} return !1
}
}

function ui(n) {
return n.length > 1 ? function(t, i, r) {
for (var u = n.length; u--;)
if (!n[u](t, i, r)) return !1;
return !0
} : n[0]
}

function yr(n, t, i) {
for (var r = 0, f = t.length; r < f; r++) u(n, t[r], i);
return i
}

function wt(n, t, i, r, u) {
for (var e, o = [], f = 0, s = n.length, h = null != t; f < s; f++)(e = n[f]) && (i && !i(e, r, u) || (o.push(e), h && t.push(f)));
return o
}

function fi(n, t, i, r, u, e) {
return r && !r[f] && (r = fi(r)), u && !u[f] && (u = fi(u, e)), l(function(f, e, o, s) {
var l, c, a, p = [],
y = [],
w = e.length,
b = f || yr(t || "*", o.nodeType ? [o] : o, []),
v = !n || !f && t ? b : wt(b, p, n, o, s),
h = i ? u || (f ? n : w || r) ? [] : e : v;
if (i && i(v, h, o, s), r)
for (l = wt(h, y), r(l, [], o, s), c = l.length; c--;)(a = l[c]) && (h[y[c]] = !(v[y[c]] = a));
if (f) {
if (u || n) {
if (u) {
for (l = [], c = h.length; c--;)(a = h[c]) && l.push(v[c] = a);
u(null, h = [], l, s)
}
for (c = h.length; c--;)(a = h[c]) && (l = u ? nt(f, a) : p[c]) > -1 && (f[l] = !(e[l] = a))
}
} else h = wt(h === e ? h.splice(w, h.length) : h), u ? u(null, e, h, s) : k.apply(e, h)
})
}

function ei(n) {
for (var o, u, r, s = n.length, h = t.relative[n[0].type], c = h || t.relative[" "], i = h ? 1 : 0, l = pt(function(n) {
return n === o
}, c, !0), a = pt(function(n) {
return nt(o, n) > -1
}, c, !0), e = [function(n, t, i) {
var r = !h && (i || t !== ht) || ((o = t).nodeType ? l(n, t, i) : a(n, t, i));
return o = null, r
}]; i < s; i++)
if (u = t.relative[n[i].type]) e = [pt(ui(e), u)];
else {
if ((u = t.filter[n[i].type].apply(null, n[i].matches))[f]) {
for (r = ++i; r < s; r++)
if (t.relative[n[r].type]) break;
return fi(i > 1 && ui(e), i > 1 && yt(n.slice(0, i - 1).concat({
value: " " === n[i - 2].type ? "*" : ""
})).replace(at, "$1"), u, i < r && ei(n.slice(i, r)), r < s && ei(n = n.slice(r)), r < s && yt(n))
}
e.push(u)
} return ui(e)
}

function pr(n, r) {
var f = r.length > 0,
e = n.length > 0,
o = function(o, s, c, l, a) {
var y, nt, d, g = 0,
p = "0",
tt = o && [],
w = [],
it = ht,
rt = o || e && t.find.TAG("*", a),
ut = v += null == it ? 1 : Math.random() || .1,
ft = rt.length;
for (a && (ht = s === i || s || a); p !== ft && null != (y = rt[p]); p++) {
if (e && y) {
for (nt = 0, s || y.ownerDocument === i || (b(y), c = !h); d = n[nt++];)
if (d(y, s || i, c)) {
l.push(y);
break
} a && (v = ut)
}
f && ((y = !d && y) && g--, o && tt.push(y))
}
if (g += p, f && p !== g) {
for (nt = 0; d = r[nt++];) d(tt, w, s, c);
if (o) {
if (g > 0)
while (p--) tt[p] || w[p] || (w[p] = nr.call(l));
w = wt(w)
}
k.apply(l, w);
a && !o && w.length > 0 && g + r.length > 1 && u.uniqueSort(l)
}
return a && (v = ut, ht = it), tt
};
return f ? l(o) : o
}
var rt, e, t, st, oi, ft, bt, si, ht, w, ut, b, i, s, h, o, d, ct, et, f = "sizzle" + 1 * new Date,
c = n.document,
v = 0,
di = 0,
hi = ti(),
ci = ti(),
lt = ti(),
kt = function(n, t) {
return n === t && (ut = !0), 0
},
gi = {}.hasOwnProperty,
g = [],
nr = g.pop,
tr = g.push,
k = g.push,
li = g.slice,
nt = function(n, t) {
for (var i = 0, r = n.length; i < r; i++)
if (n[i] === t) return i;
return -1
},
dt = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
r = "[\\x20\\t\\r\\n\\f]",
tt = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
ai = "\\[" + r + "*(" + tt + ")(?:" + r + "*([*^$|!~]?=)" + r + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + tt + "))|)" + r + "*\\]",
gt = ":(" + tt + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + ai + ")*)|.*)\\)|)",
ir = new RegExp(r + "+", "g"),
at = new RegExp("^" + r + "+|((?:^|[^\\\\])(?:\\\\.)*)" + r + "+$", "g"),
rr = new RegExp("^" + r + "*," + r + "*"),
ur = new RegExp("^" + r + "*([>+~]|" + r + ")" + r + "*"),
fr = new RegExp("=" + r + "*([^\\]'\"]*?)" + r + "*\\]", "g"),
er = new RegExp(gt),
or = new RegExp("^" + tt + "$"),
vt = {
ID: new RegExp("^#(" + tt + ")"),
CLASS: new RegExp("^\\.(" + tt + ")"),
TAG: new RegExp("^(" + tt + "|[*])"),
ATTR: new RegExp("^" + ai),
PSEUDO: new RegExp("^" + gt),
CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + r + "*(even|odd|(([+-]|)(\\d*)n|)" + r + "*(?:([+-]|)" + r + "*(\\d+)|))" + r + "*\\)|)", "i"),
bool: new RegExp("^(?:" + dt + ")$", "i"),
needsContext: new RegExp("^" + r + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + r + "*((?:-\\d)?\\d*)" + r + "*\\)|)(?=[^-]|$)", "i")
},
sr = /^(?:input|select|textarea|button)$/i,
hr = /^h\d$/i,
ot = /^[^{]+\{\s*\[native \w/,
cr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
ni = /[+~]/,
y = new RegExp("\\\\([\\da-f]{1,6}" + r + "?|(" + r + ")|.)", "ig"),
p = function(n, t, i) {
var r = "0x" + t - 65536;
return r !== r || i ? t : r < 0 ? String.fromCharCode(r + 65536) : String.fromCharCode(r >> 10 | 55296, 1023 & r | 56320)
},
vi = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
yi = function(n, t) {
return t ? "\0" === n ? "�" : n.slice(0, -1) + "\\" + n.charCodeAt(n.length - 1).toString(16) + " " : "\\" + n
},
pi = function() {
b()
},
lr = pt(function(n) {
return !0 === n.disabled && ("form" in n || "label" in n)
}, {
dir: "parentNode",
next: "legend"
});
try {
k.apply(g = li.call(c.childNodes), c.childNodes);
g[c.childNodes.length].nodeType
} catch (n) {
k = {
apply: g.length ? function(n, t) {
tr.apply(n, li.call(t))
} : function(n, t) {
for (var i = n.length, r = 0; n[i++] = t[r++];);
n.length = i - 1
}
}
}
e = u.support = {};
oi = u.isXML = function(n) {
var t = n && (n.ownerDocument || n).documentElement;
return !!t && "HTML" !== t.nodeName
};
b = u.setDocument = function(n) {
var v, u, l = n ? n.ownerDocument || n : c;
return l !== i && 9 === l.nodeType && l.documentElement ? (i = l, s = i.documentElement, h = !oi(i), c !== i && (u = i.defaultView) && u.top !== u && (u.addEventListener ? u.addEventListener("unload", pi, !1) : u.attachEvent && u.attachEvent("onunload", pi)), e.attributes = a(function(n) {
return n.className = "i", !n.getAttribute("className")
}), e.getElementsByTagName = a(function(n) {
return n.appendChild(i.createComment("")), !n.getElementsByTagName("*").length
}), e.getElementsByClassName = ot.test(i.getElementsByClassName), e.getById = a(function(n) {
return s.appendChild(n).id = f, !i.getElementsByName || !i.getElementsByName(f).length
}), e.getById ? (t.filter.ID = function(n) {
var t = n.replace(y, p);
return function(n) {
return n.getAttribute("id") === t
}
}, t.find.ID = function(n, t) {
if ("undefined" != typeof t.getElementById && h) {
var i = t.getElementById(n);
return i ? [i] : []
}
}) : (t.filter.ID = function(n) {
var t = n.replace(y, p);
return function(n) {
var i = "undefined" != typeof n.getAttributeNode && n.getAttributeNode("id");
return i && i.value === t
}
}, t.find.ID = function(n, t) {
if ("undefined" != typeof t.getElementById && h) {
var r, u, f, i = t.getElementById(n);
if (i) {
if ((r = i.getAttributeNode("id")) && r.value === n) return [i];
for (f = t.getElementsByName(n), u = 0; i = f[u++];)
if ((r = i.getAttributeNode("id")) && r.value === n) return [i]
}
return []
}
}), t.find.TAG = e.getElementsByTagName ? function(n, t) {
return "undefined" != typeof t.getElementsByTagName ? t.getElementsByTagName(n) : e.qsa ? t.querySelectorAll(n) : void 0
} : function(n, t) {
var i, r = [],
f = 0,
u = t.getElementsByTagName(n);
if ("*" === n) {
while (i = u[f++]) 1 === i.nodeType && r.push(i);
return r
}
return u
}, t.find.CLASS = e.getElementsByClassName && function(n, t) {
if ("undefined" != typeof t.getElementsByClassName && h) return t.getElementsByClassName(n)
}, d = [], o = [], (e.qsa = ot.test(i.querySelectorAll)) && (a(function(n) {
s.appendChild(n).innerHTML = "<a id='" + f + "'><\/a><select id='" + f + "-\r\\' msallowcapture=''><option selected=''><\/option><\/select>";
n.querySelectorAll("[msallowcapture^='']").length && o.push("[*^$]=" + r + "*(?:''|\"\")");
n.querySelectorAll("[selected]").length || o.push("\\[" + r + "*(?:value|" + dt + ")");
n.querySelectorAll("[id~=" + f + "-]").length || o.push("~=");
n.querySelectorAll(":checked").length || o.push(":checked");
n.querySelectorAll("a#" + f + "+*").length || o.push(".#.+[+~]")
}), a(function(n) {
n.innerHTML = "<a href='' disabled='disabled'><\/a><select disabled='disabled'><option/><\/select>";
var t = i.createElement("input");
t.setAttribute("type", "hidden");
n.appendChild(t).setAttribute("name", "D");
n.querySelectorAll("[name=d]").length && o.push("name" + r + "*[*^$|!~]?=");
2 !== n.querySelectorAll(":enabled").length && o.push(":enabled", ":disabled");
s.appendChild(n).disabled = !0;
2 !== n.querySelectorAll(":disabled").length && o.push(":enabled", ":disabled");
n.querySelectorAll("*,:x");
o.push(",.*:")
})), (e.matchesSelector = ot.test(ct = s.matches || s.webkitMatchesSelector || s.mozMatchesSelector || s.oMatchesSelector || s.msMatchesSelector)) && a(function(n) {
e.disconnectedMatch = ct.call(n, "*");
ct.call(n, "[s!='']:x");
d.push("!=", gt)
}), o = o.length && new RegExp(o.join("|")), d = d.length && new RegExp(d.join("|")), v = ot.test(s.compareDocumentPosition), et = v || ot.test(s.contains) ? function(n, t) {
var r = 9 === n.nodeType ? n.documentElement : n,
i = t && t.parentNode;
return n === i || !(!i || 1 !== i.nodeType || !(r.contains ? r.contains(i) : n.compareDocumentPosition && 16 & n.compareDocumentPosition(i)))
} : function(n, t) {
if (t)
while (t = t.parentNode)
if (t === n) return !0;
return !1
}, kt = v ? function(n, t) {
if (n === t) return ut = !0, 0;
var r = !n.compareDocumentPosition - !t.compareDocumentPosition;
return r || (1 & (r = (n.ownerDocument || n) === (t.ownerDocument || t) ? n.compareDocumentPosition(t) : 1) || !e.sortDetached && t.compareDocumentPosition(n) === r ? n === i || n.ownerDocument === c && et(c, n) ? -1 : t === i || t.ownerDocument === c && et(c, t) ? 1 : w ? nt(w, n) - nt(w, t) : 0 : 4 & r ? -1 : 1)
} : function(n, t) {
if (n === t) return ut = !0, 0;
var r, u = 0,
o = n.parentNode,
s = t.parentNode,
f = [n],
e = [t];
if (!o || !s) return n === i ? -1 : t === i ? 1 : o ? -1 : s ? 1 : w ? nt(w, n) - nt(w, t) : 0;
if (o === s) return wi(n, t);
for (r = n; r = r.parentNode;) f.unshift(r);
for (r = t; r = r.parentNode;) e.unshift(r);
while (f[u] === e[u]) u++;
return u ? wi(f[u], e[u]) : f[u] === c ? -1 : e[u] === c ? 1 : 0
}, i) : i
};
u.matches = function(n, t) {
return u(n, null, null, t)
};
u.matchesSelector = function(n, t) {
if ((n.ownerDocument || n) !== i && b(n), t = t.replace(fr, "='$1']"), e.matchesSelector && h && !lt[t + " "] && (!d || !d.test(t)) && (!o || !o.test(t))) try {
var r = ct.call(n, t);
if (r || e.disconnectedMatch || n.document && 11 !== n.document.nodeType) return r
} catch (n) {}
return u(t, i, null, [n]).length > 0
};
u.contains = function(n, t) {
return (n.ownerDocument || n) !== i && b(n), et(n, t)
};
u.attr = function(n, r) {
(n.ownerDocument || n) !== i && b(n);
var f = t.attrHandle[r.toLowerCase()],
u = f && gi.call(t.attrHandle, r.toLowerCase()) ? f(n, r, !h) : void 0;
return void 0 !== u ? u : e.attributes || !h ? n.getAttribute(r) : (u = n.getAttributeNode(r)) && u.specified ? u.value : null
};
u.escape = function(n) {
return (n + "").replace(vi, yi)
};
u.error = function(n) {
throw new Error("Syntax error, unrecognized expression: " + n);
};
u.uniqueSort = function(n) {
var r, u = [],
t = 0,
i = 0;
if (ut = !e.detectDuplicates, w = !e.sortStable && n.slice(0), n.sort(kt), ut) {
while (r = n[i++]) r === n[i] && (t = u.push(i));
while (t--) n.splice(u[t], 1)
}
return w = null, n
};
st = u.getText = function(n) {
var r, i = "",
u = 0,
t = n.nodeType;
if (t) {
if (1 === t || 9 === t || 11 === t) {
if ("string" == typeof n.textContent) return n.textContent;
for (n = n.firstChild; n; n = n.nextSibling) i += st(n)
} else if (3 === t || 4 === t) return n.nodeValue
} else
while (r = n[u++]) i += st(r);
return i
};
(t = u.selectors = {
cacheLength: 50,
createPseudo: l,
match: vt,
attrHandle: {},
find: {},
relative: {
">": {
dir: "parentNode",
first: !0
},
" ": {
dir: "parentNode"
},
"+": {
dir: "previousSibling",
first: !0
},
"~": {
dir: "previousSibling"
}
},
preFilter: {
ATTR: function(n) {
return n[1] = n[1].replace(y, p), n[3] = (n[3] || n[4] || n[5] || "").replace(y, p), "~=" === n[2] && (n[3] = " " + n[3] + " "), n.slice(0, 4)
},
CHILD: function(n) {
return n[1] = n[1].toLowerCase(), "nth" === n[1].slice(0, 3) ? (n[3] || u.error(n[0]), n[4] = +(n[4] ? n[5] + (n[6] || 1) : 2 * ("even" === n[3] || "odd" === n[3])), n[5] = +(n[7] + n[8] || "odd" === n[3])) : n[3] && u.error(n[0]), n
},
PSEUDO: function(n) {
var i, t = !n[6] && n[2];
return vt.CHILD.test(n[0]) ? null : (n[3] ? n[2] = n[4] || n[5] || "" : t && er.test(t) && (i = ft(t, !0)) && (i = t.indexOf(")", t.length - i) - t.length) && (n[0] = n[0].slice(0, i), n[2] = t.slice(0, i)), n.slice(0, 3))
}
},
filter: {
TAG: function(n) {
var t = n.replace(y, p).toLowerCase();
return "*" === n ? function() {
return !0
} : function(n) {
return n.nodeName && n.nodeName.toLowerCase() === t
}
},
CLASS: function(n) {
var t = hi[n + " "];
return t || (t = new RegExp("(^|" + r + ")" + n + "(" + r + "|$)")) && hi(n, function(n) {
return t.test("string" == typeof n.className && n.className || "undefined" != typeof n.getAttribute && n.getAttribute("class") || "")
})
},
ATTR: function(n, t, i) {
return function(r) {
var f = u.attr(r, n);
return null == f ? "!=" === t : !t || (f += "", "=" === t ? f === i : "!=" === t ? f !== i : "^=" === t ? i && 0 === f.indexOf(i) : "*=" === t ? i && f.indexOf(i) > -1 : "$=" === t ? i && f.slice(-i.length) === i : "~=" === t ? (" " + f.replace(ir, " ") + " ").indexOf(i) > -1 : "|=" === t && (f === i || f.slice(0, i.length + 1) === i + "-"))
}
},
CHILD: function(n, t, i, r, u) {
var s = "nth" !== n.slice(0, 3),
o = "last" !== n.slice(-4),
e = "of-type" === t;
return 1 === r && 0 === u ? function(n) {
return !!n.parentNode
} : function(t, i, h) {
var p, d, y, c, a, w, b = s !== o ? "nextSibling" : "previousSibling",
k = t.parentNode,
nt = e && t.nodeName.toLowerCase(),
g = !h && !e,
l = !1;
if (k) {
if (s) {
while (b) {
for (c = t; c = c[b];)
if (e ? c.nodeName.toLowerCase() === nt : 1 === c.nodeType) return !1;
w = b = "only" === n && !w && "nextSibling"
}
return !0
}
if (w = [o ? k.firstChild : k.lastChild], o && g) {
for (l = (a = (p = (d = (y = (c = k)[f] || (c[f] = {}))[c.uniqueID] || (y[c.uniqueID] = {}))[n] || [])[0] === v && p[1]) && p[2], c = a && k.childNodes[a]; c = ++a && c && c[b] || (l = a = 0) || w.pop();)
if (1 === c.nodeType && ++l && c === t) {
d[n] = [v, a, l];
break
}
} else if (g && (l = a = (p = (d = (y = (c = t)[f] || (c[f] = {}))[c.uniqueID] || (y[c.uniqueID] = {}))[n] || [])[0] === v && p[1]), !1 === l)
while (c = ++a && c && c[b] || (l = a = 0) || w.pop())
if ((e ? c.nodeName.toLowerCase() === nt : 1 === c.nodeType) && ++l && (g && ((d = (y = c[f] || (c[f] = {}))[c.uniqueID] || (y[c.uniqueID] = {}))[n] = [v, l]), c === t)) break;
return (l -= u) === r || l % r == 0 && l / r >= 0
}
}
},
PSEUDO: function(n, i) {
var e, r = t.pseudos[n] || t.setFilters[n.toLowerCase()] || u.error("unsupported pseudo: " + n);
return r[f] ? r(i) : r.length > 1 ? (e = [n, n, "", i], t.setFilters.hasOwnProperty(n.toLowerCase()) ? l(function(n, t) {
for (var e, u = r(n, i), f = u.length; f--;) n[e = nt(n, u[f])] = !(t[e] = u[f])
}) : function(n) {
return r(n, 0, e)
}) : r
}
},
pseudos: {
not: l(function(n) {
var t = [],
r = [],
i = bt(n.replace(at, "$1"));
return i[f] ? l(function(n, t, r, u) {
for (var e, o = i(n, null, u, []), f = n.length; f--;)(e = o[f]) && (n[f] = !(t[f] = e))
}) : function(n, u, f) {
return t[0] = n, i(t, null, f, r), t[0] = null, !r.pop()
}
}),
has: l(function(n) {
return function(t) {
return u(n, t).length > 0
}
}),
contains: l(function(n) {
return n = n.replace(y, p),
function(t) {
return (t.textContent || t.innerText || st(t)).indexOf(n) > -1
}
}),
lang: l(function(n) {
return or.test(n || "") || u.error("unsupported lang: " + n), n = n.replace(y, p).toLowerCase(),
function(t) {
var i;
do
if (i = h ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang")) return (i = i.toLowerCase()) === n || 0 === i.indexOf(n + "-"); while ((t = t.parentNode) && 1 === t.nodeType);
return !1
}
}),
target: function(t) {
var i = n.location && n.location.hash;
return i && i.slice(1) === t.id
},
root: function(n) {
return n === s
},
focus: function(n) {
return n === i.activeElement && (!i.hasFocus || i.hasFocus()) && !!(n.type || n.href || ~n.tabIndex)
},
enabled: bi(!1),
disabled: bi(!0),
checked: function(n) {
var t = n.nodeName.toLowerCase();
return "input" === t && !!n.checked || "option" === t && !!n.selected
},
selected: function(n) {
return n.parentNode && n.parentNode.selectedIndex, !0 === n.selected
},
empty: function(n) {
for (n = n.firstChild; n; n = n.nextSibling)
if (n.nodeType < 6) return !1;
return !0
},
parent: function(n) {
return !t.pseudos.empty(n)
},
header: function(n) {
return hr.test(n.nodeName)
},
input: function(n) {
return sr.test(n.nodeName)
},
button: function(n) {
var t = n.nodeName.toLowerCase();
return "input" === t && "button" === n.type || "button" === t
},
text: function(n) {
var t;
return "input" === n.nodeName.toLowerCase() && "text" === n.type && (null == (t = n.getAttribute("type")) || "text" === t.toLowerCase())
},
first: it(function() {
return [0]
}),
last: it(function(n, t) {
return [t - 1]
}),
eq: it(function(n, t, i) {
return [i < 0 ? i + t : i]
}),
even: it(function(n, t) {
for (var i = 0; i < t; i += 2) n.push(i);
return n
}),
odd: it(function(n, t) {
for (var i = 1; i < t; i += 2) n.push(i);
return n
}),
lt: it(function(n, t, i) {
for (var r = i < 0 ? i + t : i; --r >= 0;) n.push(r);
return n
}),
gt: it(function(n, t, i) {
for (var r = i < 0 ? i + t : i; ++r < t;) n.push(r);
return n
})
}
}).pseudos.nth = t.pseudos.eq;
for (rt in {
radio: !0,
checkbox: !0,
file: !0,
password: !0,
image: !0
}) t.pseudos[rt] = ar(rt);
for (rt in {
submit: !0,
reset: !0
}) t.pseudos[rt] = vr(rt);
return ki.prototype = t.filters = t.pseudos, t.setFilters = new ki, ft = u.tokenize = function(n, i) {
var e, f, s, o, r, h, c, l = ci[n + " "];
if (l) return i ? 0 : l.slice(0);
for (r = n, h = [], c = t.preFilter; r;) {
(!e || (f = rr.exec(r))) && (f && (r = r.slice(f[0].length) || r), h.push(s = []));
e = !1;
(f = ur.exec(r)) && (e = f.shift(), s.push({
value: e,
type: f[0].replace(at, " ")
}), r = r.slice(e.length));
for (o in t.filter)(f = vt[o].exec(r)) && (!c[o] || (f = c[o](f))) && (e = f.shift(), s.push({
value: e,
type: o,
matches: f
}), r = r.slice(e.length));
if (!e) break
}
return i ? r.length : r ? u.error(n) : ci(n, h).slice(0)
}, bt = u.compile = function(n, t) {
var r, u = [],
e = [],
i = lt[n + " "];
if (!i) {
for (t || (t = ft(n)), r = t.length; r--;)(i = ei(t[r]))[f] ? u.push(i) : e.push(i);
(i = lt(n, pr(e, u))).selector = n
}
return i
}, si = u.select = function(n, i, r, u) {
var o, f, e, l, a, c = "function" == typeof n && n,
s = !u && ft(n = c.selector || n);
if (r = r || [], 1 === s.length) {
if ((f = s[0] = s[0].slice(0)).length > 2 && "ID" === (e = f[0]).type && 9 === i.nodeType && h && t.relative[f[1].type]) {
if (!(i = (t.find.ID(e.matches[0].replace(y, p), i) || [])[0])) return r;
c && (i = i.parentNode);
n = n.slice(f.shift().value.length)
}
for (o = vt.needsContext.test(n) ? 0 : f.length; o--;) {
if (e = f[o], t.relative[l = e.type]) break;
if ((a = t.find[l]) && (u = a(e.matches[0].replace(y, p), ni.test(f[0].type) && ri(i.parentNode) || i))) {
if (f.splice(o, 1), !(n = u.length && yt(f))) return k.apply(r, u), r;
break
}
}
}
return (c || bt(n, s))(u, i, !h, r, !i || ni.test(n) && ri(i.parentNode) || i), r
}, e.sortStable = f.split("").sort(kt).join("") === f, e.detectDuplicates = !!ut, b(), e.sortDetached = a(function(n) {
return 1 & n.compareDocumentPosition(i.createElement("fieldset"))
}), a(function(n) {
return n.innerHTML = "<a href='#'><\/a>", "#" === n.firstChild.getAttribute("href")
}) || ii("type|href|height|width", function(n, t, i) {
if (!i) return n.getAttribute(t, "type" === t.toLowerCase() ? 1 : 2)
}), e.attributes && a(function(n) {
return n.innerHTML = "<input/>", n.firstChild.setAttribute("value", ""), "" === n.firstChild.getAttribute("value")
}) || ii("value", function(n, t, i) {
if (!i && "input" === n.nodeName.toLowerCase()) return n.defaultValue
}), a(function(n) {
return null == n.getAttribute("disabled")
}) || ii(dt, function(n, t, i) {
var r;
if (!i) return !0 === n[t] ? t.toLowerCase() : (r = n.getAttributeNode(t)) && r.specified ? r.value : null
}), u
}(n);
i.find = b;
i.expr = b.selectors;
i.expr[":"] = i.expr.pseudos;
i.uniqueSort = i.unique = b.uniqueSort;
i.text = b.getText;
i.isXMLDoc = b.isXML;
i.contains = b.contains;
i.escapeSelector = b.escape;
var rt = function(n, t, r) {
for (var u = [], f = void 0 !== r;
(n = n[t]) && 9 !== n.nodeType;)
if (1 === n.nodeType) {
if (f && i(n).is(r)) break;
u.push(n)
} return u
},
cr = function(n, t) {
for (var i = []; n; n = n.nextSibling) 1 === n.nodeType && n !== t && i.push(n);
return i
},
lr = i.expr.match.needsContext;
ci = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;
i.filter = function(n, t, r) {
var u = t[0];
return r && (n = ":not(" + n + ")"), 1 === t.length && 1 === u.nodeType ? i.find.matchesSelector(u, n) ? [u] : [] : i.find.matches(n, i.grep(t, function(n) {
return 1 === n.nodeType
}))
};
i.fn.extend({
find: function(n) {
var t, r, u = this.length,
f = this;
if ("string" != typeof n) return this.pushStack(i(n).filter(function() {
for (t = 0; t < u; t++)
if (i.contains(f[t], this)) return !0
}));
for (r = this.pushStack([]), t = 0; t < u; t++) i.find(n, f[t], r);
return u > 1 ? i.uniqueSort(r) : r
},
filter: function(n) {
return this.pushStack(li(this, n || [], !1))
},
not: function(n) {
return this.pushStack(li(this, n || [], !0))
},
is: function(n) {
return !!li(this, "string" == typeof n && lr.test(n) ? i(n) : n || [], !1).length
}
});
vr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;
(i.fn.init = function(n, t, r) {
var e, o;
if (!n) return this;
if (r = r || ar, "string" == typeof n) {
if (!(e = "<" === n[0] && ">" === n[n.length - 1] && n.length >= 3 ? [null, n, null] : vr.exec(n)) || !e[1] && t) return !t || t.jquery ? (t || r).find(n) : this.constructor(t).find(n);
if (e[1]) {
if (t = t instanceof i ? t[0] : t, i.merge(this, i.parseHTML(e[1], t && t.nodeType ? t.ownerDocument || t : f, !0)), ci.test(e[1]) && i.isPlainObject(t))
for (e in t) u(this[e]) ? this[e](t[e]) : this.attr(e, t[e]);
return this
}
return (o = f.getElementById(e[2])) && (this[0] = o, this.length = 1), this
}
return n.nodeType ? (this[0] = n, this.length = 1, this) : u(n) ? void 0 !== r.ready ? r.ready(n) : n(i) : i.makeArray(n, this)
}).prototype = i.fn;
ar = i(f);
yr = /^(?:parents|prev(?:Until|All))/;
pr = {
children: !0,
contents: !0,
next: !0,
prev: !0
};
i.fn.extend({
has: function(n) {
var t = i(n, this),
r = t.length;
return this.filter(function() {
for (var n = 0; n < r; n++)
if (i.contains(this, t[n])) return !0
})
},
closest: function(n, t) {
var r, f = 0,
o = this.length,
u = [],
e = "string" != typeof n && i(n);
if (!lr.test(n))
for (; f < o; f++)
for (r = this[f]; r && r !== t; r = r.parentNode)
if (r.nodeType < 11 && (e ? e.index(r) > -1 : 1 === r.nodeType && i.find.matchesSelector(r, n))) {
u.push(r);
break
} return this.pushStack(u.length > 1 ? i.uniqueSort(u) : u)
},
index: function(n) {
return n ? "string" == typeof n ? wt.call(i(n), this[0]) : wt.call(this, n.jquery ? n[0] : n) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1
},
add: function(n, t) {
return this.pushStack(i.uniqueSort(i.merge(this.get(), i(n, t))))
},
addBack: function(n) {
return this.add(null == n ? this.prevObject : this.prevObject.filter(n))
}
});
i.each({
parent: function(n) {
var t = n.parentNode;
return t && 11 !== t.nodeType ? t : null
},
parents: function(n) {
return rt(n, "parentNode")
},
parentsUntil: function(n, t, i) {
return rt(n, "parentNode", i)
},
next: function(n) {
return wr(n, "nextSibling")
},
prev: function(n) {
return wr(n, "previousSibling")
},
nextAll: function(n) {
return rt(n, "nextSibling")
},
prevAll: function(n) {
return rt(n, "previousSibling")
},
nextUntil: function(n, t, i) {
return rt(n, "nextSibling", i)
},
prevUntil: function(n, t, i) {
return rt(n, "previousSibling", i)
},
siblings: function(n) {
return cr((n.parentNode || {}).firstChild, n)
},
children: function(n) {
return cr(n.firstChild)
},
contents: function(n) {
return v(n, "iframe") ? n.contentDocument : (v(n, "template") && (n = n.content || n), i.merge([], n.childNodes))
}
}, function(n, t) {
i.fn[n] = function(r, u) {
var f = i.map(this, t, r);
return "Until" !== n.slice(-5) && (u = r), u && "string" == typeof u && (f = i.filter(u, f)), this.length > 1 && (pr[n] || i.uniqueSort(f), yr.test(n) && f.reverse()), this.pushStack(f)
}
});
l = /[^\x20\t\r\n\f]+/g;
i.Callbacks = function(n) {
n = "string" == typeof n ? te(n) : i.extend({}, n);
var f, r, c, e, t = [],
s = [],
o = -1,
l = function() {
for (e = e || n.once, c = f = !0; s.length; o = -1)
for (r = s.shift(); ++o < t.length;) !1 === t[o].apply(r[0], r[1]) && n.stopOnFalse && (o = t.length, r = !1);
n.memory || (r = !1);
f = !1;
e && (t = r ? [] : "")
},
h = {
add: function() {
return t && (r && !f && (o = t.length - 1, s.push(r)), function f(r) {
i.each(r, function(i, r) {
u(r) ? n.unique && h.has(r) || t.push(r) : r && r.length && "string" !== it(r) && f(r)
})
}(arguments), r && !f && l()), this
},
remove: function() {
return i.each(arguments, function(n, r) {
for (var u;
(u = i.inArray(r, t, u)) > -1;) t.splice(u, 1), u <= o && o--
}), this
},
has: function(n) {
return n ? i.inArray(n, t) > -1 : t.length > 0
},
empty: function() {
return t && (t = []), this
},
disable: function() {
return e = s = [], t = r = "", this
},
disabled: function() {
return !t
},
lock: function() {
return e = s = [], r || f || (t = r = ""), this
},
locked: function() {
return !!e
},
fireWith: function(n, t) {
return e || (t = [n, (t = t || []).slice ? t.slice() : t], s.push(t), f || l()), this
},
fire: function() {
return h.fireWith(this, arguments), this
},
fired: function() {
return !!c
}
};
return h
};
i.extend({
Deferred: function(t) {
var f = [
["notify", "progress", i.Callbacks("memory"), i.Callbacks("memory"), 2],
["resolve", "done", i.Callbacks("once memory"), i.Callbacks("once memory"), 0, "resolved"],
["reject", "fail", i.Callbacks("once memory"), i.Callbacks("once memory"), 1, "rejected"]
],
o = "pending",
e = {
state: function() {
return o
},
always: function() {
return r.done(arguments).fail(arguments), this
},
"catch": function(n) {
return e.then(null, n)
},
pipe: function() {
var n = arguments;
return i.Deferred(function(t) {
i.each(f, function(i, f) {
var e = u(n[f[4]]) && n[f[4]];
r[f[1]](function() {
var n = e && e.apply(this, arguments);
n && u(n.promise) ? n.promise().progress(t.notify).done(t.resolve).fail(t.reject) : t[f[0] + "With"](this, e ? [n] : arguments)
})
});
n = null
}).promise()
},
then: function(t, r, e) {
function s(t, r, f, e) {
return function() {
var h = this,
c = arguments,
a = function() {
var n, i;
if (!(t < o)) {
if ((n = f.apply(h, c)) === r.promise()) throw new TypeError("Thenable self-resolution");
i = n && ("object" == typeof n || "function" == typeof n) && n.then;
u(i) ? e ? i.call(n, s(o, r, ut, e), s(o, r, dt, e)) : (o++, i.call(n, s(o, r, ut, e), s(o, r, dt, e), s(o, r, ut, r.notifyWith))) : (f !== ut && (h = void 0, c = [n]), (e || r.resolveWith)(h, c))
}
},
l = e ? a : function() {
try {
a()
} catch (n) {
i.Deferred.exceptionHook && i.Deferred.exceptionHook(n, l.stackTrace);
t + 1 >= o && (f !== dt && (h = void 0, c = [n]), r.rejectWith(h, c))
}
};
t ? l() : (i.Deferred.getStackHook && (l.stackTrace = i.Deferred.getStackHook()), n.setTimeout(l))
}
}
var o = 0;
return i.Deferred(function(n) {
f[0][3].add(s(0, n, u(e) ? e : ut, n.notifyWith));
f[1][3].add(s(0, n, u(t) ? t : ut));
f[2][3].add(s(0, n, u(r) ? r : dt))
}).promise()
},
promise: function(n) {
return null != n ? i.extend(n, e) : e
}
},
r = {};
return i.each(f, function(n, t) {
var i = t[2],
u = t[5];
e[t[1]] = i.add;
u && i.add(function() {
o = u
}, f[3 - n][2].disable, f[3 - n][3].disable, f[0][2].lock, f[0][3].lock);
i.add(t[3].fire);
r[t[0]] = function() {
return r[t[0] + "With"](this === r ? void 0 : this, arguments), this
};
r[t[0] + "With"] = i.fireWith
}), e.promise(r), t && t.call(r, r), r
},
when: function(n) {
var e = arguments.length,
t = e,
o = Array(t),
f = d.call(arguments),
r = i.Deferred(),
s = function(n) {
return function(t) {
o[n] = this;
f[n] = arguments.length > 1 ? d.call(arguments) : t;
--e || r.resolveWith(o, f)
}
};
if (e <= 1 && (br(n, r.done(s(t)).resolve, r.reject, !e), "pending" === r.state() || u(f[t] && f[t].then))) return r.then();
while (t--) br(f[t], s(t), r.reject);
return r.promise()
}
});
kr = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
i.Deferred.exceptionHook = function(t, i) {
n.console && n.console.warn && t && kr.test(t.name) && n.console.warn("jQuery.Deferred exception: " + t.message, t.stack, i)
};
i.readyException = function(t) {
n.setTimeout(function() {
throw t;
})
};
gt = i.Deferred();
i.fn.ready = function(n) {
return gt.then(n)["catch"](function(n) {
i.readyException(n)
}), this
};
i.extend({
isReady: !1,
readyWait: 1,
ready: function(n) {
(!0 === n ? --i.readyWait : i.isReady) || (i.isReady = !0, !0 !== n && --i.readyWait > 0 || gt.resolveWith(f, [i]))
}
});
i.ready.then = gt.then;
"complete" === f.readyState || "loading" !== f.readyState && !f.documentElement.doScroll ? n.setTimeout(i.ready) : (f.addEventListener("DOMContentLoaded", ni), n.addEventListener("load", ni));
var p = function(n, t, r, f, e, o, s) {
var h = 0,
l = n.length,
c = null == r;
if ("object" === it(r)) {
e = !0;
for (h in r) p(n, t, h, r[h], !0, o, s)
} else if (void 0 !== f && (e = !0, u(f) || (s = !0), c && (s ? (t.call(n, f), t = null) : (c = t, t = function(n, t, r) {
return c.call(i(n), r)
})), t))
for (; h < l; h++) t(n[h], r, s ? f : f.call(n[h], h, t(n[h], r)));
return e ? n : c ? t.call(n) : l ? t(n[0], r) : o
},
ie = /^-ms-/,
re = /-([a-z])/g;
lt = function(n) {
return 1 === n.nodeType || 9 === n.nodeType || !+n.nodeType
};
at.uid = 1;
at.prototype = {
cache: function(n) {
var t = n[this.expando];
return t || (t = {}, lt(n) && (n.nodeType ? n[this.expando] = t : Object.defineProperty(n, this.expando, {
value: t,
configurable: !0
}))), t
},
set: function(n, t, i) {
var r, u = this.cache(n);
if ("string" == typeof t) u[y(t)] = i;
else
for (r in t) u[y(r)] = t[r];
return u
},
get: function(n, t) {
return void 0 === t ? this.cache(n) : n[this.expando] && n[this.expando][y(t)]
},
access: function(n, t, i) {
return void 0 === t || t && "string" == typeof t && void 0 === i ? this.get(n, t) : (this.set(n, t, i), void 0 !== i ? i : t)
},
remove: function(n, t) {
var u, r = n[this.expando];
if (void 0 !== r) {
if (void 0 !== t)
for (u = (t = Array.isArray(t) ? t.map(y) : (t = y(t)) in r ? [t] : t.match(l) || []).length; u--;) delete r[t[u]];
(void 0 === t || i.isEmptyObject(r)) && (n.nodeType ? n[this.expando] = void 0 : delete n[this.expando])
}
},
hasData: function(n) {
var t = n[this.expando];
return void 0 !== t && !i.isEmptyObject(t)
}
};
var r = new at,
o = new at,
fe = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
ee = /[A-Z]/g;
i.extend({
hasData: function(n) {
return o.hasData(n) || r.hasData(n)
},
data: function(n, t, i) {
return o.access(n, t, i)
},
removeData: function(n, t) {
o.remove(n, t)
},
_data: function(n, t, i) {
return r.access(n, t, i)
},
_removeData: function(n, t) {
r.remove(n, t)
}
});
i.fn.extend({
data: function(n, t) {
var f, u, e, i = this[0],
s = i && i.attributes;
if (void 0 === n) {
if (this.length && (e = o.get(i), 1 === i.nodeType && !r.get(i, "hasDataAttrs"))) {
for (f = s.length; f--;) s[f] && 0 === (u = s[f].name).indexOf("data-") && (u = y(u.slice(5)), dr(i, u, e[u]));
r.set(i, "hasDataAttrs", !0)
}
return e
}
return "object" == typeof n ? this.each(function() {
o.set(this, n)
}) : p(this, function(t) {
var r;
if (i && void 0 === t) {
if (void 0 !== (r = o.get(i, n)) || void 0 !== (r = dr(i, n))) return r
} else this.each(function() {
o.set(this, n, t)
})
}, null, t, arguments.length > 1, null, !0)
},
removeData: function(n) {
return this.each(function() {
o.remove(this, n)
})
}
});
i.extend({
queue: function(n, t, u) {
var f;
if (n) return t = (t || "fx") + "queue", f = r.get(n, t), u && (!f || Array.isArray(u) ? f = r.access(n, t, i.makeArray(u)) : f.push(u)), f || []
},
dequeue: function(n, t) {
t = t || "fx";
var r = i.queue(n, t),
e = r.length,
u = r.shift(),
f = i._queueHooks(n, t),
o = function() {
i.dequeue(n, t)
};
"inprogress" === u && (u = r.shift(), e--);
u && ("fx" === t && r.unshift("inprogress"), delete f.stop, u.call(n, o, f));
!e && f && f.empty.fire()
},
_queueHooks: function(n, t) {
var u = t + "queueHooks";
return r.get(n, u) || r.access(n, u, {
empty: i.Callbacks("once memory").add(function() {
r.remove(n, [t + "queue", u])
})
})
}
});
i.fn.extend({
queue: function(n, t) {
var r = 2;
return "string" != typeof n && (t = n, n = "fx", r--), arguments.length < r ? i.queue(this[0], n) : void 0 === t ? this : this.each(function() {
var r = i.queue(this, n, t);
i._queueHooks(this, n);
"fx" === n && "inprogress" !== r[0] && i.dequeue(this, n)
})
},
dequeue: function(n) {
return this.each(function() {
i.dequeue(this, n)
})
},
clearQueue: function(n) {
return this.queue(n || "fx", [])
},
promise: function(n, t) {
var u, e = 1,
o = i.Deferred(),
f = this,
s = this.length,
h = function() {
--e || o.resolveWith(f, [f])
};
for ("string" != typeof n && (t = n, n = void 0), n = n || "fx"; s--;)(u = r.get(f[s], n + "queueHooks")) && u.empty && (e++, u.empty.add(h));
return h(), o.promise(t)
}
});
var gr = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
vt = new RegExp("^(?:([+-])=|)(" + gr + ")([a-z%]*)$", "i"),
w = ["Top", "Right", "Bottom", "Left"],
ti = function(n, t) {
return "none" === (n = t || n).style.display || "" === n.style.display && i.contains(n.ownerDocument, n) && "none" === i.css(n, "display")
},
nu = function(n, t, i, r) {
var f, u, e = {};
for (u in t) e[u] = n.style[u], n.style[u] = t[u];
f = i.apply(n, r || []);
for (u in t) n.style[u] = e[u];
return f
};
ai = {};
i.fn.extend({
show: function() {
return ft(this, !0)
},
hide: function() {
return ft(this)
},
toggle: function(n) {
return "boolean" == typeof n ? n ? this.show() : this.hide() : this.each(function() {
ti(this) ? i(this).show() : i(this).hide()
})
}
});
var iu = /^(?:checkbox|radio)$/i,
ru = /<([a-z][^\/\0>\x20\t\r\n\f]+)/i,
uu = /^$|^module$|\/(?:java|ecma)script/i,
c = {
option: [1, "<select multiple='multiple'>", "<\/select>"],
thead: [1, "<table>", "<\/table>"],
col: [2, "<table><colgroup>", "<\/colgroup><\/table>"],
tr: [2, "<table><tbody>", "<\/tbody><\/table>"],
td: [3, "<table><tbody><tr>", "<\/tr><\/tbody><\/table>"],
_default: [0, "", ""]
};
c.optgroup = c.option;
c.tbody = c.tfoot = c.colgroup = c.caption = c.thead;
c.th = c.td;
fu = /<|&#?\w+;/;
! function() {
var n = f.createDocumentFragment().appendChild(f.createElement("div")),
t = f.createElement("input");
t.setAttribute("type", "radio");
t.setAttribute("checked", "checked");
t.setAttribute("name", "t");
n.appendChild(t);
e.checkClone = n.cloneNode(!0).cloneNode(!0).lastChild.checked;
n.innerHTML = "<textarea>x<\/textarea>";
e.noCloneChecked = !!n.cloneNode(!0).lastChild.defaultValue
}();
var ii = f.documentElement,
he = /^key/,
ce = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
ou = /^([^.]*)(?:\.(.+)|)/;
i.event = {
global: {},
add: function(n, t, u, f, e) {
var p, v, k, y, w, h, s, c, o, b, d, a = r.get(n);
if (a)
for (u.handler && (u = (p = u).handler, e = p.selector), e && i.find.matchesSelector(ii, e), u.guid || (u.guid = i.guid++), (y = a.events) || (y = a.events = {}), (v = a.handle) || (v = a.handle = function(t) {
if ("undefined" != typeof i && i.event.triggered !== t.type) return i.event.dispatch.apply(n, arguments)
}), w = (t = (t || "").match(l) || [""]).length; w--;) o = d = (k = ou.exec(t[w]) || [])[1], b = (k[2] || "").split(".").sort(), o && (s = i.event.special[o] || {}, o = (e ? s.delegateType : s.bindType) || o, s = i.event.special[o] || {}, h = i.extend({
type: o,
origType: d,
data: f,
handler: u,
guid: u.guid,
selector: e,
needsContext: e && i.expr.match.needsContext.test(e),
namespace: b.join(".")
}, p), (c = y[o]) || ((c = y[o] = []).delegateCount = 0, s.setup && !1 !== s.setup.call(n, f, b, v) || n.addEventListener && n.addEventListener(o, v)), s.add && (s.add.call(n, h), h.handler.guid || (h.handler.guid = u.guid)), e ? c.splice(c.delegateCount++, 0, h) : c.push(h), i.event.global[o] = !0)
},
remove: function(n, t, u, f, e) {
var y, k, h, v, p, s, c, a, o, b, d, w = r.hasData(n) && r.get(n);
if (w && (v = w.events)) {
for (p = (t = (t || "").match(l) || [""]).length; p--;)
if (h = ou.exec(t[p]) || [], o = d = h[1], b = (h[2] || "").split(".").sort(), o) {
for (c = i.event.special[o] || {}, a = v[o = (f ? c.delegateType : c.bindType) || o] || [], h = h[2] && new RegExp("(^|\\.)" + b.join("\\.(?:.*\\.|)") + "(\\.|$)"), k = y = a.length; y--;) s = a[y], !e && d !== s.origType || u && u.guid !== s.guid || h && !h.test(s.namespace) || f && f !== s.selector && ("**" !== f || !s.selector) || (a.splice(y, 1), s.selector && a.delegateCount--, c.remove && c.remove.call(n, s));
k && !a.length && (c.teardown && !1 !== c.teardown.call(n, b, w.handle) || i.removeEvent(n, o, w.handle), delete v[o])
} else
for (o in v) i.event.remove(n, o + t[p], u, f, !0);
i.isEmptyObject(v) && r.remove(n, "handle events")
}
},
dispatch: function(n) {
var t = i.event.fix(n),
u, h, c, e, f, l, s = new Array(arguments.length),
a = (r.get(this, "events") || {})[t.type] || [],
o = i.event.special[t.type] || {};
for (s[0] = t, u = 1; u < arguments.length; u++) s[u] = arguments[u];
if (t.delegateTarget = this, !o.preDispatch || !1 !== o.preDispatch.call(this, t)) {
for (l = i.event.handlers.call(this, t, a), u = 0;
(e = l[u++]) && !t.isPropagationStopped();)
for (t.currentTarget = e.elem, h = 0;
(f = e.handlers[h++]) && !t.isImmediatePropagationStopped();) t.rnamespace && !t.rnamespace.test(f.namespace) || (t.handleObj = f, t.data = f.data, void 0 !== (c = ((i.event.special[f.origType] || {}).handle || f.handler).apply(e.elem, s)) && !1 === (t.result = c) && (t.preventDefault(), t.stopPropagation()));
return o.postDispatch && o.postDispatch.call(this, t), t.result
}
},
handlers: function(n, t) {
var f, h, u, e, o, c = [],
s = t.delegateCount,
r = n.target;
if (s && r.nodeType && !("click" === n.type && n.button >= 1))
for (; r !== this; r = r.parentNode || this)
if (1 === r.nodeType && ("click" !== n.type || !0 !== r.disabled)) {
for (e = [], o = {}, f = 0; f < s; f++) void 0 === o[u = (h = t[f]).selector + " "] && (o[u] = h.needsContext ? i(u, this).index(r) > -1 : i.find(u, this, null, [r]).length), o[u] && e.push(h);
e.length && c.push({
elem: r,
handlers: e
})
} return r = this, s < t.length && c.push({
elem: r,
handlers: t.slice(s)
}), c
},
addProp: function(n, t) {
Object.defineProperty(i.Event.prototype, n, {
enumerable: !0,
configurable: !0,
get: u(t) ? function() {
if (this.originalEvent) return t(this.originalEvent)
} : function() {
if (this.originalEvent) return this.originalEvent[n]
},
set: function(t) {
Object.defineProperty(this, n, {
enumerable: !0,
configurable: !0,
writable: !0,
value: t
})
}
})
},
fix: function(n) {
return n[i.expando] ? n : new i.Event(n)
},
special: {
load: {
noBubble: !0
},
focus: {
trigger: function() {
if (this !== su() && this.focus) return this.focus(), !1
},
delegateType: "focusin"
},
blur: {
trigger: function() {
if (this === su() && this.blur) return this.blur(), !1
},
delegateType: "focusout"
},
click: {
trigger: function() {
if ("checkbox" === this.type && this.click && v(this, "input")) return this.click(), !1
},
_default: function(n) {
return v(n.target, "a")
}
},
beforeunload: {
postDispatch: function(n) {
void 0 !== n.result && n.originalEvent && (n.originalEvent.returnValue = n.result)
}
}
}
};
i.removeEvent = function(n, t, i) {
n.removeEventListener && n.removeEventListener(t, i)
};
i.Event = function(n, t) {
if (!(this instanceof i.Event)) return new i.Event(n, t);
n && n.type ? (this.originalEvent = n, this.type = n.type, this.isDefaultPrevented = n.defaultPrevented || void 0 === n.defaultPrevented && !1 === n.returnValue ? ri : et, this.target = n.target && 3 === n.target.nodeType ? n.target.parentNode : n.target, this.currentTarget = n.currentTarget, this.relatedTarget = n.relatedTarget) : this.type = n;
t && i.extend(this, t);
this.timeStamp = n && n.timeStamp || Date.now();
this[i.expando] = !0
};
i.Event.prototype = {
constructor: i.Event,
isDefaultPrevented: et,
isPropagationStopped: et,
isImmediatePropagationStopped: et,
isSimulated: !1,
preventDefault: function() {
var n = this.originalEvent;
this.isDefaultPrevented = ri;
n && !this.isSimulated && n.preventDefault()
},
stopPropagation: function() {
var n = this.originalEvent;
this.isPropagationStopped = ri;
n && !this.isSimulated && n.stopPropagation()
},
stopImmediatePropagation: function() {
var n = this.originalEvent;
this.isImmediatePropagationStopped = ri;
n && !this.isSimulated && n.stopImmediatePropagation();
this.stopPropagation()
}
};
i.each({
altKey: !0,
bubbles: !0,
cancelable: !0,
changedTouches: !0,
ctrlKey: !0,
detail: !0,
eventPhase: !0,
metaKey: !0,
pageX: !0,
pageY: !0,
shiftKey: !0,
view: !0,
char: !0,
charCode: !0,
key: !0,
keyCode: !0,
button: !0,
buttons: !0,
clientX: !0,
clientY: !0,
offsetX: !0,
offsetY: !0,
pointerId: !0,
pointerType: !0,
screenX: !0,
screenY: !0,
targetTouches: !0,
toElement: !0,
touches: !0,
which: function(n) {
var t = n.button;
return null == n.which && he.test(n.type) ? null != n.charCode ? n.charCode : n.keyCode : !n.which && void 0 !== t && ce.test(n.type) ? 1 & t ? 1 : 2 & t ? 3 : 4 & t ? 2 : 0 : n.which
}
}, i.event.addProp);
i.each({
mouseenter: "mouseover",
mouseleave: "mouseout",
pointerenter: "pointerover",
pointerleave: "pointerout"
}, function(n, t) {
i.event.special[n] = {
delegateType: t,
bindType: t,
handle: function(n) {
var u, f = this,
r = n.relatedTarget,
e = n.handleObj;
return r && (r === f || i.contains(f, r)) || (n.type = e.origType, u = e.handler.apply(this, arguments), n.type = t), u
}
}
});
i.fn.extend({
on: function(n, t, i, r) {
return yi(this, n, t, i, r)
},
one: function(n, t, i, r) {
return yi(this, n, t, i, r, 1)
},
off: function(n, t, r) {
var u, f;
if (n && n.preventDefault && n.handleObj) return u = n.handleObj, i(n.delegateTarget).off(u.namespace ? u.origType + "." + u.namespace : u.origType, u.selector, u.handler), this;
if ("object" == typeof n) {
for (f in n) this.off(f, t, n[f]);
return this
}
return !1 !== t && "function" != typeof t || (r = t, t = void 0), !1 === r && (r = et), this.each(function() {
i.event.remove(this, n, r, t)
})
}
});
var le = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
ae = /<script|<style|<link/i,
ve = /checked\s*(?:[^=]|=\s*.checked.)/i,
ye = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
i.extend({
htmlPrefilter: function(n) {
return n.replace(le, "<$1><\/$2>")
},
clone: function(n, t, r) {
var u, c, o, f, h = n.cloneNode(!0),
l = i.contains(n.ownerDocument, n);
if (!(e.noCloneChecked || 1 !== n.nodeType && 11 !== n.nodeType || i.isXMLDoc(n)))
for (f = s(h), u = 0, c = (o = s(n)).length; u < c; u++) be(o[u], f[u]);
if (t)
if (r)
for (o = o || s(n), f = f || s(h), u = 0, c = o.length; u < c; u++) cu(o[u], f[u]);
else cu(n, h);
return (f = s(h, "script")).length > 0 && vi(f, !l && s(n, "script")), h
},
cleanData: function(n) {
for (var u, t, f, s = i.event.special, e = 0; void 0 !== (t = n[e]); e++)
if (lt(t)) {
if (u = t[r.expando]) {
if (u.events)
for (f in u.events) s[f] ? i.event.remove(t, f) : i.removeEvent(t, f, u.handle);
t[r.expando] = void 0
}
t[o.expando] && (t[o.expando] = void 0)
}
}
});
i.fn.extend({
detach: function(n) {
return lu(this, n, !0)
},
remove: function(n) {
return lu(this, n)
},
text: function(n) {
return p(this, function(n) {
return void 0 === n ? i.text(this) : this.empty().each(function() {
1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || (this.textContent = n)
})
}, null, n, arguments.length)
},
append: function() {
return ot(this, arguments, function(n) {
1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || hu(this, n).appendChild(n)
})
},
prepend: function() {
return ot(this, arguments, function(n) {
if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
var t = hu(this, n);
t.insertBefore(n, t.firstChild)
}
})
},
before: function() {
return ot(this, arguments, function(n) {
this.parentNode && this.parentNode.insertBefore(n, this)
})
},
after: function() {
return ot(this, arguments, function(n) {
this.parentNode && this.parentNode.insertBefore(n, this.nextSibling)
})
},
empty: function() {
for (var n, t = 0; null != (n = this[t]); t++) 1 === n.nodeType && (i.cleanData(s(n, !1)), n.textContent = "");
return this
},
clone: function(n, t) {
return n = null != n && n, t = null == t ? n : t, this.map(function() {
return i.clone(this, n, t)
})
},
html: function(n) {
return p(this, function(n) {
var t = this[0] || {},
r = 0,
u = this.length;
if (void 0 === n && 1 === t.nodeType) return t.innerHTML;
if ("string" == typeof n && !ae.test(n) && !c[(ru.exec(n) || ["", ""])[1].toLowerCase()]) {
n = i.htmlPrefilter(n);
try {
for (; r < u; r++) 1 === (t = this[r] || {}).nodeType && (i.cleanData(s(t, !1)), t.innerHTML = n);
t = 0
} catch (n) {}
}
t && this.empty().append(n)
}, null, n, arguments.length)
},
replaceWith: function() {
var n = [];
return ot(this, arguments, function(t) {
var r = this.parentNode;
i.inArray(this, n) < 0 && (i.cleanData(s(this)), r && r.replaceChild(t, this))
}, n)
}
});
i.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function(n, t) {
i.fn[n] = function(n) {
for (var u, f = [], e = i(n), o = e.length - 1, r = 0; r <= o; r++) u = r === o ? this : this.clone(!0), i(e[r])[t](u), si.apply(f, u.get());
return this.pushStack(f)
}
});
var pi = new RegExp("^(" + gr + ")(?!px)[a-z%]+$", "i"),
ui = function(t) {
var i = t.ownerDocument.defaultView;
return i && i.opener || (i = n), i.getComputedStyle(t)
},
ke = new RegExp(w.join("|"), "i");
! function() {
function r() {
if (t) {
o.style.cssText = "position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0";
t.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%";
ii.appendChild(o).appendChild(t);
var i = n.getComputedStyle(t);
s = "1%" !== i.top;
a = 12 === u(i.marginLeft);
t.style.right = "60%";
l = 36 === u(i.right);
h = 36 === u(i.width);
t.style.position = "absolute";
c = 36 === t.offsetWidth || "absolute";
ii.removeChild(o);
t = null
}
}

function u(n) {
return Math.round(parseFloat(n))
}
var s, h, c, l, a, o = f.createElement("div"),
t = f.createElement("div");
t.style && (t.style.backgroundClip = "content-box", t.cloneNode(!0).style.backgroundClip = "", e.clearCloneStyle = "content-box" === t.style.backgroundClip, i.extend(e, {
boxSizingReliable: function() {
return r(), h
},
pixelBoxStyles: function() {
return r(), l
},
pixelPosition: function() {
return r(), s
},
reliableMarginLeft: function() {
return r(), a
},
scrollboxSize: function() {
return r(), c
}
}))
}();
var de = /^(none|table(?!-c[ea]).+)/,
vu = /^--/,
ge = {
position: "absolute",
visibility: "hidden",
display: "block"
},
yu = {
letterSpacing: "0",
fontWeight: "400"
},
pu = ["Webkit", "Moz", "ms"],
wu = f.createElement("div").style;
i.extend({
cssHooks: {
opacity: {
get: function(n, t) {
if (t) {
var i = yt(n, "opacity");
return "" === i ? "1" : i
}
}
}
},
cssNumber: {
animationIterationCount: !0,
columnCount: !0,
fillOpacity: !0,
flexGrow: !0,
flexShrink: !0,
fontWeight: !0,
lineHeight: !0,
opacity: !0,
order: !0,
orphans: !0,
widows: !0,
zIndex: !0,
zoom: !0
},
cssProps: {},
style: function(n, t, r, u) {
if (n && 3 !== n.nodeType && 8 !== n.nodeType && n.style) {
var f, h, o, c = y(t),
l = vu.test(t),
s = n.style;
if (l || (t = bu(c)), o = i.cssHooks[t] || i.cssHooks[c], void 0 === r) return o && "get" in o && void 0 !== (f = o.get(n, !1, u)) ? f : s[t];
"string" == (h = typeof r) && (f = vt.exec(r)) && f[1] && (r = tu(n, t, f), h = "number");
null != r && r === r && ("number" === h && (r += f && f[3] || (i.cssNumber[c] ? "" : "px")), e.clearCloneStyle || "" !== r || 0 !== t.indexOf("background") || (s[t] = "inherit"), o && "set" in o && void 0 === (r = o.set(n, r, u)) || (l ? s.setProperty(t, r) : s[t] = r))
}
},
css: function(n, t, r, u) {
var f, e, o, s = y(t);
return vu.test(t) || (t = bu(s)), (o = i.cssHooks[t] || i.cssHooks[s]) && "get" in o && (f = o.get(n, !0, r)), void 0 === f && (f = yt(n, t, u)), "normal" === f && t in yu && (f = yu[t]), "" === r || r ? (e = parseFloat(f), !0 === r || isFinite(e) ? e || 0 : f) : f
}
});
i.each(["height", "width"], function(n, t) {
i.cssHooks[t] = {
get: function(n, r, u) {
if (r) return !de.test(i.css(n, "display")) || n.getClientRects().length && n.getBoundingClientRect().width ? du(n, t, u) : nu(n, ge, function() {
return du(n, t, u)
})
},
set: function(n, r, u) {
var s, f = ui(n),
h = "border-box" === i.css(n, "boxSizing", !1, f),
o = u && wi(n, t, u, h, f);
return h && e.scrollboxSize() === f.position && (o -= Math.ceil(n["offset" + t[0].toUpperCase() + t.slice(1)] - parseFloat(f[t]) - wi(n, t, "border", !1, f) - .5)), o && (s = vt.exec(r)) && "px" !== (s[3] || "px") && (n.style[t] = r, r = i.css(n, t)), ku(n, r, o)
}
}
});
i.cssHooks.marginLeft = au(e.reliableMarginLeft, function(n, t) {
if (t) return (parseFloat(yt(n, "marginLeft")) || n.getBoundingClientRect().left - nu(n, {
marginLeft: 0
}, function() {
return n.getBoundingClientRect().left
})) + "px"
});
i.each({
margin: "",
padding: "",
border: "Width"
}, function(n, t) {
i.cssHooks[n + t] = {
expand: function(i) {
for (var r = 0, f = {}, u = "string" == typeof i ? i.split(" ") : [i]; r < 4; r++) f[n + w[r] + t] = u[r] || u[r - 2] || u[0];
return f
}
};
"margin" !== n && (i.cssHooks[n + t].set = ku)
});
i.fn.extend({
css: function(n, t) {
return p(this, function(n, t, r) {
var f, e, o = {},
u = 0;
if (Array.isArray(t)) {
for (f = ui(n), e = t.length; u < e; u++) o[t[u]] = i.css(n, t[u], !1, f);
return o
}
return void 0 !== r ? i.style(n, t, r) : i.css(n, t)
}, n, t, arguments.length > 1)
}
});
i.Tween = h;
h.prototype = {
constructor: h,
init: function(n, t, r, u, f, e) {
this.elem = n;
this.prop = r;
this.easing = f || i.easing._default;
this.options = t;
this.start = this.now = this.cur();
this.end = u;
this.unit = e || (i.cssNumber[r] ? "" : "px")
},
cur: function() {
var n = h.propHooks[this.prop];
return n && n.get ? n.get(this) : h.propHooks._default.get(this)
},
run: function(n) {
var t, r = h.propHooks[this.prop];
return this.pos = this.options.duration ? t = i.easing[this.easing](n, this.options.duration * n, 0, 1, this.options.duration) : t = n, this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), r && r.set ? r.set(this) : h.propHooks._default.set(this), this
}
};
h.prototype.init.prototype = h.prototype;
h.propHooks = {
_default: {
get: function(n) {
var t;
return 1 !== n.elem.nodeType || null != n.elem[n.prop] && null == n.elem.style[n.prop] ? n.elem[n.prop] : (t = i.css(n.elem, n.prop, "")) && "auto" !== t ? t : 0
},
set: function(n) {
i.fx.step[n.prop] ? i.fx.step[n.prop](n) : 1 !== n.elem.nodeType || null == n.elem.style[i.cssProps[n.prop]] && !i.cssHooks[n.prop] ? n.elem[n.prop] = n.now : i.style(n.elem, n.prop, n.now + n.unit)
}
}
};
h.propHooks.scrollTop = h.propHooks.scrollLeft = {
set: function(n) {
n.elem.nodeType && n.elem.parentNode && (n.elem[n.prop] = n.now)
}
};
i.easing = {
linear: function(n) {
return n
},
swing: function(n) {
return .5 - Math.cos(n * Math.PI) / 2
},
_default: "swing"
};
i.fx = h.prototype.init;
i.fx.step = {};
gu = /^(?:toggle|show|hide)$/;
nf = /queueHooks$/;
i.Animation = i.extend(a, {
tweeners: {
"*": [function(n, t) {
var i = this.createTween(n, t);
return tu(i.elem, n, vt.exec(t), i), i
}]
},
tweener: function(n, t) {
u(n) ? (t = n, n = ["*"]) : n = n.match(l);
for (var i, r = 0, f = n.length; r < f; r++) i = n[r], a.tweeners[i] = a.tweeners[i] || [], a.tweeners[i].unshift(t)
},
prefilters: [to],
prefilter: function(n, t) {
t ? a.prefilters.unshift(n) : a.prefilters.push(n)
}
});
i.speed = function(n, t, r) {
var f = n && "object" == typeof n ? i.extend({}, n) : {
complete: r || !r && t || u(n) && n,
duration: n,
easing: r && t || t && !u(t) && t
};
return i.fx.off ? f.duration = 0 : "number" != typeof f.duration && (f.duration = f.duration in i.fx.speeds ? i.fx.speeds[f.duration] : i.fx.speeds._default), null != f.queue && !0 !== f.queue || (f.queue = "fx"), f.old = f.complete, f.complete = function() {
u(f.old) && f.old.call(this);
f.queue && i.dequeue(this, f.queue)
}, f
};
i.fn.extend({
fadeTo: function(n, t, i, r) {
return this.filter(ti).css("opacity", 0).show().end().animate({
opacity: t
}, n, i, r)
},
animate: function(n, t, u, f) {
var s = i.isEmptyObject(n),
o = i.speed(t, u, f),
e = function() {
var t = a(this, i.extend({}, n), o);
(s || r.get(this, "finish")) && t.stop(!0)
};
return e.finish = e, s || !1 === o.queue ? this.each(e) : this.queue(o.queue, e)
},
stop: function(n, t, u) {
var f = function(n) {
var t = n.stop;
delete n.stop;
t(u)
};
return "string" != typeof n && (u = t, t = n, n = void 0), t && !1 !== n && this.queue(n || "fx", []), this.each(function() {
var s = !0,
t = null != n && n + "queueHooks",
o = i.timers,
e = r.get(this);
if (t) e[t] && e[t].stop && f(e[t]);
else
for (t in e) e[t] && e[t].stop && nf.test(t) && f(e[t]);
for (t = o.length; t--;) o[t].elem !== this || null != n && o[t].queue !== n || (o[t].anim.stop(u), s = !1, o.splice(t, 1));
!s && u || i.dequeue(this, n)
})
},
finish: function(n) {
return !1 !== n && (n = n || "fx"), this.each(function() {
var t, e = r.get(this),
u = e[n + "queue"],
o = e[n + "queueHooks"],
f = i.timers,
s = u ? u.length : 0;
for (e.finish = !0, i.queue(this, n, []), o && o.stop && o.stop.call(this, !0), t = f.length; t--;) f[t].elem === this && f[t].queue === n && (f[t].anim.stop(!0), f.splice(t, 1));
for (t = 0; t < s; t++) u[t] && u[t].finish && u[t].finish.call(this);
delete e.finish
})
}
});
i.each(["toggle", "show", "hide"], function(n, t) {
var r = i.fn[t];
i.fn[t] = function(n, i, u) {
return null == n || "boolean" == typeof n ? r.apply(this, arguments) : this.animate(ei(t, !0), n, i, u)
}
});
i.each({
slideDown: ei("show"),
slideUp: ei("hide"),
slideToggle: ei("toggle"),
fadeIn: {
opacity: "show"
},
fadeOut: {
opacity: "hide"
},
fadeToggle: {
opacity: "toggle"
}
}, function(n, t) {
i.fn[n] = function(n, i, r) {
return this.animate(t, n, i, r)
}
});
i.timers = [];
i.fx.tick = function() {
var r, n = 0,
t = i.timers;
for (st = Date.now(); n < t.length; n++)(r = t[n])() || t[n] !== r || t.splice(n--, 1);
t.length || i.fx.stop();
st = void 0
};
i.fx.timer = function(n) {
i.timers.push(n);
i.fx.start()
};
i.fx.interval = 13;
i.fx.start = function() {
fi || (fi = !0, bi())
};
i.fx.stop = function() {
fi = null
};
i.fx.speeds = {
slow: 600,
fast: 200,
_default: 400
};
i.fn.delay = function(t, r) {
return t = i.fx ? i.fx.speeds[t] || t : t, r = r || "fx", this.queue(r, function(i, r) {
var u = n.setTimeout(i, t);
r.stop = function() {
n.clearTimeout(u)
}
})
},
function() {
var n = f.createElement("input"),
t = f.createElement("select").appendChild(f.createElement("option"));
n.type = "checkbox";
e.checkOn = "" !== n.value;
e.optSelected = t.selected;
(n = f.createElement("input")).value = "t";
n.type = "radio";
e.radioValue = "t" === n.value
}();
ht = i.expr.attrHandle;
i.fn.extend({
attr: function(n, t) {
return p(this, i.attr, n, t, arguments.length > 1)
},
removeAttr: function(n) {
return this.each(function() {
i.removeAttr(this, n)
})
}
});
i.extend({
attr: function(n, t, r) {
var f, u, e = n.nodeType;
if (3 !== e && 8 !== e && 2 !== e) return "undefined" == typeof n.getAttribute ? i.prop(n, t, r) : (1 === e && i.isXMLDoc(n) || (u = i.attrHooks[t.toLowerCase()] || (i.expr.match.bool.test(t) ? uf : void 0)), void 0 !== r ? null === r ? void i.removeAttr(n, t) : u && "set" in u && void 0 !== (f = u.set(n, r, t)) ? f : (n.setAttribute(t, r + ""), r) : u && "get" in u && null !== (f = u.get(n, t)) ? f : null == (f = i.find.attr(n, t)) ? void 0 : f)
},
attrHooks: {
type: {
set: function(n, t) {
if (!e.radioValue && "radio" === t && v(n, "input")) {
var i = n.value;
return n.setAttribute("type", t), i && (n.value = i), t
}
}
}
},
removeAttr: function(n, t) {
var i, u = 0,
r = t && t.match(l);
if (r && 1 === n.nodeType)
while (i = r[u++]) n.removeAttribute(i)
}
});
uf = {
set: function(n, t, r) {
return !1 === t ? i.removeAttr(n, r) : n.setAttribute(r, r), r
}
};
i.each(i.expr.match.bool.source.match(/\w+/g), function(n, t) {
var r = ht[t] || i.find.attr;
ht[t] = function(n, t, i) {
var f, e, u = t.toLowerCase();
return i || (e = ht[u], ht[u] = f, f = null != r(n, t, i) ? u : null, ht[u] = e), f
}
});
ff = /^(?:input|select|textarea|button)$/i;
ef = /^(?:a|area)$/i;
i.fn.extend({
prop: function(n, t) {
return p(this, i.prop, n, t, arguments.length > 1)
},
removeProp: function(n) {
return this.each(function() {
delete this[i.propFix[n] || n]
})
}
});
i.extend({
prop: function(n, t, r) {
var f, u, e = n.nodeType;
if (3 !== e && 8 !== e && 2 !== e) return 1 === e && i.isXMLDoc(n) || (t = i.propFix[t] || t, u = i.propHooks[t]), void 0 !== r ? u && "set" in u && void 0 !== (f = u.set(n, r, t)) ? f : n[t] = r : u && "get" in u && null !== (f = u.get(n, t)) ? f : n[t]
},
propHooks: {
tabIndex: {
get: function(n) {
var t = i.find.attr(n, "tabindex");
return t ? parseInt(t, 10) : ff.test(n.nodeName) || ef.test(n.nodeName) && n.href ? 0 : -1
}
}
},
propFix: {
"for": "htmlFor",
"class": "className"
}
});
e.optSelected || (i.propHooks.selected = {
get: function(n) {
var t = n.parentNode;
return t && t.parentNode && t.parentNode.selectedIndex, null
},
set: function(n) {
var t = n.parentNode;
t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex)
}
});
i.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() {
i.propFix[this.toLowerCase()] = this
});
i.fn.extend({
addClass: function(n) {
var o, t, r, f, e, s, h, c = 0;
if (u(n)) return this.each(function(t) {
i(this).addClass(n.call(this, t, nt(this)))
});
if ((o = ki(n)).length)
while (t = this[c++])
if (f = nt(t), r = 1 === t.nodeType && " " + g(f) + " ") {
for (s = 0; e = o[s++];) r.indexOf(" " + e + " ") < 0 && (r += e + " ");
f !== (h = g(r)) && t.setAttribute("class", h)
} return this
},
removeClass: function(n) {
var o, r, t, f, e, s, h, c = 0;
if (u(n)) return this.each(function(t) {
i(this).removeClass(n.call(this, t, nt(this)))
});
if (!arguments.length) return this.attr("class", "");
if ((o = ki(n)).length)
while (r = this[c++])
if (f = nt(r), t = 1 === r.nodeType && " " + g(f) + " ") {
for (s = 0; e = o[s++];)
while (t.indexOf(" " + e + " ") > -1) t = t.replace(" " + e + " ", " ");
f !== (h = g(t)) && r.setAttribute("class", h)
} return this
},
toggleClass: function(n, t) {
var f = typeof n,
e = "string" === f || Array.isArray(n);
return "boolean" == typeof t && e ? t ? this.addClass(n) : this.removeClass(n) : u(n) ? this.each(function(r) {
i(this).toggleClass(n.call(this, r, nt(this), t), t)
}) : this.each(function() {
var t, o, u, s;
if (e)
for (o = 0, u = i(this), s = ki(n); t = s[o++];) u.hasClass(t) ? u.removeClass(t) : u.addClass(t);
else void 0 !== n && "boolean" !== f || ((t = nt(this)) && r.set(this, "__className__", t), this.setAttribute && this.setAttribute("class", t || !1 === n ? "" : r.get(this, "__className__") || ""))
})
},
hasClass: function(n) {
for (var t, r = 0, i = " " + n + " "; t = this[r++];)
if (1 === t.nodeType && (" " + g(nt(t)) + " ").indexOf(i) > -1) return !0;
return !1
}
});
sf = /\r/g;
i.fn.extend({
val: function(n) {
var t, r, e, f = this[0];
return arguments.length ? (e = u(n), this.each(function(r) {
var u;
1 === this.nodeType && (null == (u = e ? n.call(this, r, i(this).val()) : n) ? u = "" : "number" == typeof u ? u += "" : Array.isArray(u) && (u = i.map(u, function(n) {
return null == n ? "" : n + ""
})), (t = i.valHooks[this.type] || i.valHooks[this.nodeName.toLowerCase()]) && "set" in t && void 0 !== t.set(this, u, "value") || (this.value = u))
})) : f ? (t = i.valHooks[f.type] || i.valHooks[f.nodeName.toLowerCase()]) && "get" in t && void 0 !== (r = t.get(f, "value")) ? r : "string" == typeof(r = f.value) ? r.replace(sf, "") : null == r ? "" : r : void 0
}
});
i.extend({
valHooks: {
option: {
get: function(n) {
var t = i.find.attr(n, "value");
return null != t ? t : g(i.text(n))
}
},
select: {
get: function(n) {
for (var e, t, o = n.options, u = n.selectedIndex, f = "select-one" === n.type, s = f ? null : [], h = f ? u + 1 : o.length, r = u < 0 ? h : f ? u : 0; r < h; r++)
if (((t = o[r]).selected || r === u) && !t.disabled && (!t.parentNode.disabled || !v(t.parentNode, "optgroup"))) {
if (e = i(t).val(), f) return e;
s.push(e)
} return s
},
set: function(n, t) {
for (var r, u, f = n.options, e = i.makeArray(t), o = f.length; o--;)((u = f[o]).selected = i.inArray(i.valHooks.option.get(u), e) > -1) && (r = !0);
return r || (n.selectedIndex = -1), e
}
}
}
});
i.each(["radio", "checkbox"], function() {
i.valHooks[this] = {
set: function(n, t) {
if (Array.isArray(t)) return n.checked = i.inArray(i(n).val(), t) > -1
}
};
e.checkOn || (i.valHooks[this].get = function(n) {
return null === n.getAttribute("value") ? "on" : n.value
})
});
e.focusin = "onfocusin" in n;
di = /^(?:focusinfocus|focusoutblur)$/;
gi = function(n) {
n.stopPropagation()
};
i.extend(i.event, {
trigger: function(t, e, o, s) {
var k, c, l, d, v, y, a, p, w = [o || f],
h = kt.call(t, "type") ? t.type : t,
b = kt.call(t, "namespace") ? t.namespace.split(".") : [];
if (c = p = l = o = o || f, 3 !== o.nodeType && 8 !== o.nodeType && !di.test(h + i.event.triggered) && (h.indexOf(".") > -1 && (h = (b = h.split(".")).shift(), b.sort()), v = h.indexOf(":") < 0 && "on" + h, t = t[i.expando] ? t : new i.Event(h, "object" == typeof t && t), t.isTrigger = s ? 2 : 3, t.namespace = b.join("."), t.rnamespace = t.namespace ? new RegExp("(^|\\.)" + b.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, t.result = void 0, t.target || (t.target = o), e = null == e ? [t] : i.makeArray(e, [t]), a = i.event.special[h] || {}, s || !a.trigger || !1 !== a.trigger.apply(o, e))) {
if (!s && !a.noBubble && !tt(o)) {
for (d = a.delegateType || h, di.test(d + h) || (c = c.parentNode); c; c = c.parentNode) w.push(c), l = c;
l === (o.ownerDocument || f) && w.push(l.defaultView || l.parentWindow || n)
}
for (k = 0;
(c = w[k++]) && !t.isPropagationStopped();) p = c, t.type = k > 1 ? d : a.bindType || h, (y = (r.get(c, "events") || {})[t.type] && r.get(c, "handle")) && y.apply(c, e), (y = v && c[v]) && y.apply && lt(c) && (t.result = y.apply(c, e), !1 === t.result && t.preventDefault());
return t.type = h, s || t.isDefaultPrevented() || a._default && !1 !== a._default.apply(w.pop(), e) || !lt(o) || v && u(o[h]) && !tt(o) && ((l = o[v]) && (o[v] = null), i.event.triggered = h, t.isPropagationStopped() && p.addEventListener(h, gi), o[h](), t.isPropagationStopped() && p.removeEventListener(h, gi), i.event.triggered = void 0, l && (o[v] = l)), t.result
}
},
simulate: function(n, t, r) {
var u = i.extend(new i.Event, r, {
type: n,
isSimulated: !0
});
i.event.trigger(u, null, t)
}
});
i.fn.extend({
trigger: function(n, t) {
return this.each(function() {
i.event.trigger(n, t, this)
})
},
triggerHandler: function(n, t) {
var r = this[0];
if (r) return i.event.trigger(n, t, r, !0)
}
});
e.focusin || i.each({
focus: "focusin",
blur: "focusout"
}, function(n, t) {
var u = function(n) {
i.event.simulate(t, n.target, i.event.fix(n))
};
i.event.special[t] = {
setup: function() {
var i = this.ownerDocument || this,
f = r.access(i, t);
f || i.addEventListener(n, u, !0);
r.access(i, t, (f || 0) + 1)
},
teardown: function() {
var i = this.ownerDocument || this,
f = r.access(i, t) - 1;
f ? r.access(i, t, f) : (i.removeEventListener(n, u, !0), r.remove(i, t))
}
}
});
var pt = n.location,
hf = Date.now(),
nr = /\?/;
i.parseXML = function(t) {
var r;
if (!t || "string" != typeof t) return null;
try {
r = (new n.DOMParser).parseFromString(t, "text/xml")
} catch (n) {
r = void 0
}
return r && !r.getElementsByTagName("parsererror").length || i.error("Invalid XML: " + t), r
};
var ro = /\[\]$/,
cf = /\r?\n/g,
uo = /^(?:submit|button|image|reset|file)$/i,
fo = /^(?:input|select|textarea|keygen)/i;
i.param = function(n, t) {
var r, f = [],
e = function(n, t) {
var i = u(t) ? t() : t;
f[f.length] = encodeURIComponent(n) + "=" + encodeURIComponent(null == i ? "" : i)
};
if (Array.isArray(n) || n.jquery && !i.isPlainObject(n)) i.each(n, function() {
e(this.name, this.value)
});
else
for (r in n) tr(r, n[r], t, e);
return f.join("&")
};
i.fn.extend({
serialize: function() {
return i.param(this.serializeArray())
},
serializeArray: function() {
return this.map(function() {
var n = i.prop(this, "elements");
return n ? i.makeArray(n) : this
}).filter(function() {
var n = this.type;
return this.name && !i(this).is(":disabled") && fo.test(this.nodeName) && !uo.test(n) && (this.checked || !iu.test(n))
}).map(function(n, t) {
var r = i(this).val();
return null == r ? null : Array.isArray(r) ? i.map(r, function(n) {
return {
name: t.name,
value: n.replace(cf, "\r\n")
}
}) : {
name: t.name,
value: r.replace(cf, "\r\n")
}
}).get()
}
});
var eo = /%20/g,
oo = /#.*$/,
so = /([?&])_=[^&]*/,
ho = /^(.*?):[ \t]*([^\r\n]*)$/gm,
co = /^(?:GET|HEAD)$/,
lo = /^\/\//,
lf = {},
ir = {},
af = "*/".concat("*"),
rr = f.createElement("a");
return rr.href = pt.href, i.extend({
active: 0,
lastModified: {},
etag: {},
ajaxSettings: {
url: pt.href,
type: "GET",
isLocal: /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(pt.protocol),
global: !0,
processData: !0,
"async": !0,
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
accepts: {
"*": af,
text: "text/plain",
html: "text/html",
xml: "application/xml, text/xml",
json: "application/json, text/javascript"
},
contents: {
xml: /\bxml\b/,
html: /\bhtml/,
json: /\bjson\b/
},
responseFields: {
xml: "responseXML",
text: "responseText",
json: "responseJSON"
},
converters: {
"* text": String,
"text html": !0,
"text json": JSON.parse,
"text xml": i.parseXML
},
flatOptions: {
url: !0,
context: !0
}
},
ajaxSetup: function(n, t) {
return t ? ur(ur(n, i.ajaxSettings), t) : ur(i.ajaxSettings, n)
},
ajaxPrefilter: vf(lf),
ajaxTransport: vf(ir),
ajax: function(t, r) {
function b(t, r, f, c) {
var v, rt, b, p, g, l = r;
s || (s = !0, d && n.clearTimeout(d), a = void 0, k = c || "", e.readyState = t > 0 ? 4 : 0, v = t >= 200 && t < 300 || 304 === t, f && (p = ao(u, e, f)), p = vo(u, p, e, v), v ? (u.ifModified && ((g = e.getResponseHeader("Last-Modified")) && (i.lastModified[o] = g), (g = e.getResponseHeader("etag")) && (i.etag[o] = g)), 204 === t || "HEAD" === u.type ? l = "nocontent" : 304 === t ? l = "notmodified" : (l = p.state, rt = p.data, v = !(b = p.error))) : (b = l, !t && l || (l = "error", t < 0 && (t = 0))), e.status = t, e.statusText = (r || l) + "", v ? tt.resolveWith(h, [rt, l, e]) : tt.rejectWith(h, [e, l, b]), e.statusCode(w), w = void 0, y && nt.trigger(v ? "ajaxSuccess" : "ajaxError", [e, u, v ? rt : b]), it.fireWith(h, [e, l]), y && (nt.trigger("ajaxComplete", [e, u]), --i.active || i.event.trigger("ajaxStop")))
}
"object" == typeof t && (r = t, t = void 0);
r = r || {};
var a, o, k, v, d, c, s, y, g, p, u = i.ajaxSetup({}, r),
h = u.context || u,
nt = u.context && (h.nodeType || h.jquery) ? i(h) : i.event,
tt = i.Deferred(),
it = i.Callbacks("once memory"),
w = u.statusCode || {},
rt = {},
ut = {},
ft = "canceled",
e = {
readyState: 0,
getResponseHeader: function(n) {
var t;
if (s) {
if (!v)
for (v = {}; t = ho.exec(k);) v[t[1].toLowerCase()] = t[2];
t = v[n.toLowerCase()]
}
return null == t ? null : t
},
getAllResponseHeaders: function() {
return s ? k : null
},
setRequestHeader: function(n, t) {
return null == s && (n = ut[n.toLowerCase()] = ut[n.toLowerCase()] || n, rt[n] = t), this
},
overrideMimeType: function(n) {
return null == s && (u.mimeType = n), this
},
statusCode: function(n) {
var t;
if (n)
if (s) e.always(n[e.status]);
else
for (t in n) w[t] = [w[t], n[t]];
return this
},
abort: function(n) {
var t = n || ft;
return a && a.abort(t), b(0, t), this
}
};
if (tt.promise(e), u.url = ((t || u.url || pt.href) + "").replace(lo, pt.protocol + "//"), u.type = r.method || r.type || u.method || u.type, u.dataTypes = (u.dataType || "*").toLowerCase().match(l) || [""], null == u.crossDomain) {
c = f.createElement("a");
try {
c.href = u.url;
c.href = c.href;
u.crossDomain = rr.protocol + "//" + rr.host != c.protocol + "//" + c.host
} catch (n) {
u.crossDomain = !0
}
}
if (u.data && u.processData && "string" != typeof u.data && (u.data = i.param(u.data, u.traditional)), yf(lf, u, r, e), s) return e;
(y = i.event && u.global) && 0 == i.active++ && i.event.trigger("ajaxStart");
u.type = u.type.toUpperCase();
u.hasContent = !co.test(u.type);
o = u.url.replace(oo, "");
u.hasContent ? u.data && u.processData && 0 === (u.contentType || "").indexOf("application/x-www-form-urlencoded") && (u.data = u.data.replace(eo, "+")) : (p = u.url.slice(o.length), u.data && (u.processData || "string" == typeof u.data) && (o += (nr.test(o) ? "&" : "?") + u.data, delete u.data), !1 === u.cache && (o = o.replace(so, "$1"), p = (nr.test(o) ? "&" : "?") + "_=" + hf++ + p), u.url = o + p);
u.ifModified && (i.lastModified[o] && e.setRequestHeader("If-Modified-Since", i.lastModified[o]), i.etag[o] && e.setRequestHeader("If-None-Match", i.etag[o]));
(u.data && u.hasContent && !1 !== u.contentType || r.contentType) && e.setRequestHeader("Content-Type", u.contentType);
e.setRequestHeader("Accept", u.dataTypes[0] && u.accepts[u.dataTypes[0]] ? u.accepts[u.dataTypes[0]] + ("*" !== u.dataTypes[0] ? ", " + af + "; q=0.01" : "") : u.accepts["*"]);
for (g in u.headers) e.setRequestHeader(g, u.headers[g]);
if (u.beforeSend && (!1 === u.beforeSend.call(h, e, u) || s)) return e.abort();
if (ft = "abort", it.add(u.complete), e.done(u.success), e.fail(u.error), a = yf(ir, u, r, e)) {
if (e.readyState = 1, y && nt.trigger("ajaxSend", [e, u]), s) return e;
u.async && u.timeout > 0 && (d = n.setTimeout(function() {
e.abort("timeout")
}, u.timeout));
try {
s = !1;
a.send(rt, b)
} catch (n) {
if (s) throw n;
b(-1, n)
}
} else b(-1, "No Transport");
return e
},
getJSON: function(n, t, r) {
return i.get(n, t, r, "json")
},
getScript: function(n, t) {
return i.get(n, void 0, t, "script")
}
}), i.each(["get", "post"], function(n, t) {
i[t] = function(n, r, f, e) {
return u(r) && (e = e || f, f = r, r = void 0), i.ajax(i.extend({
url: n,
type: t,
dataType: e,
data: r,
success: f
}, i.isPlainObject(n) && n))
}
}), i._evalUrl = function(n) {
return i.ajax({
url: n,
type: "GET",
dataType: "script",
cache: !0,
"async": !1,
global: !1,
throws: !0
})
}, i.fn.extend({
wrapAll: function(n) {
var t;
return this[0] && (u(n) && (n = n.call(this[0])), t = i(n, this[0].ownerDocument).eq(0).clone(!0), this[0].parentNode && t.insertBefore(this[0]), t.map(function() {
for (var n = this; n.firstElementChild;) n = n.firstElementChild;
return n
}).append(this)), this
},
wrapInner: function(n) {
return u(n) ? this.each(function(t) {
i(this).wrapInner(n.call(this, t))
}) : this.each(function() {
var t = i(this),
r = t.contents();
r.length ? r.wrapAll(n) : t.append(n)
})
},
wrap: function(n) {
var t = u(n);
return this.each(function(r) {
i(this).wrapAll(t ? n.call(this, r) : n)
})
},
unwrap: function(n) {
return this.parent(n).not("body").each(function() {
i(this).replaceWith(this.childNodes)
}), this
}
}), i.expr.pseudos.hidden = function(n) {
return !i.expr.pseudos.visible(n)
}, i.expr.pseudos.visible = function(n) {
return !!(n.offsetWidth || n.offsetHeight || n.getClientRects().length)
}, i.ajaxSettings.xhr = function() {
try {
return new n.XMLHttpRequest
} catch (n) {}
}, pf = {
0: 200,
1223: 204
}, ct = i.ajaxSettings.xhr(), e.cors = !!ct && "withCredentials" in ct, e.ajax = ct = !!ct, i.ajaxTransport(function(t) {
var i, r;
if (e.cors || ct && !t.crossDomain) return {
send: function(u, f) {
var o, e = t.xhr();
if (e.open(t.type, t.url, t.async, t.username, t.password), t.xhrFields)
for (o in t.xhrFields) e[o] = t.xhrFields[o];
t.mimeType && e.overrideMimeType && e.overrideMimeType(t.mimeType);
t.crossDomain || u["X-Requested-With"] || (u["X-Requested-With"] = "XMLHttpRequest");
for (o in u) e.setRequestHeader(o, u[o]);
i = function(n) {
return function() {
i && (i = r = e.onload = e.onerror = e.onabort = e.ontimeout = e.onreadystatechange = null, "abort" === n ? e.abort() : "error" === n ? "number" != typeof e.status ? f(0, "error") : f(e.status, e.statusText) : f(pf[e.status] || e.status, e.statusText, "text" !== (e.responseType || "text") || "string" != typeof e.responseText ? {
binary: e.response
} : {
text: e.responseText
}, e.getAllResponseHeaders()))
}
};
e.onload = i();
r = e.onerror = e.ontimeout = i("error");
void 0 !== e.onabort ? e.onabort = r : e.onreadystatechange = function() {
4 === e.readyState && n.setTimeout(function() {
i && r()
})
};
i = i("abort");
try {
e.send(t.hasContent && t.data || null)
} catch (n) {
if (i) throw n;
}
},
abort: function() {
i && i()
}
}
}), i.ajaxPrefilter(function(n) {
n.crossDomain && (n.contents.script = !1)
}), i.ajaxSetup({
accepts: {
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
},
contents: {
script: /\b(?:java|ecma)script\b/
},
converters: {
"text script": function(n) {
return i.globalEval(n), n
}
}
}), i.ajaxPrefilter("script", function(n) {
void 0 === n.cache && (n.cache = !1);
n.crossDomain && (n.type = "GET")
}), i.ajaxTransport("script", function(n) {
if (n.crossDomain) {
var r, t;
return {
send: function(u, e) {
r = i("<script>").prop({
charset: n.scriptCharset,
src: n.url
}).on("load error", t = function(n) {
r.remove();
t = null;
n && e("error" === n.type ? 404 : 200, n.type)
});
f.head.appendChild(r[0])
},
abort: function() {
t && t()
}
}
}
}), fr = [], oi = /(=)\?(?=&|$)|\?\?/, i.ajaxSetup({
jsonp: "callback",
jsonpCallback: function() {
var n = fr.pop() || i.expando + "_" + hf++;
return this[n] = !0, n
}
}), i.ajaxPrefilter("json jsonp", function(t, r, f) {
var e, o, s, h = !1 !== t.jsonp && (oi.test(t.url) ? "url" : "string" == typeof t.data && 0 === (t.contentType || "").indexOf("application/x-www-form-urlencoded") && oi.test(t.data) && "data");
if (h || "jsonp" === t.dataTypes[0]) return e = t.jsonpCallback = u(t.jsonpCallback) ? t.jsonpCallback() : t.jsonpCallback, h ? t[h] = t[h].replace(oi, "$1" + e) : !1 !== t.jsonp && (t.url += (nr.test(t.url) ? "&" : "?") + t.jsonp + "=" + e), t.converters["script json"] = function() {
return s || i.error(e + " was not called"), s[0]
}, t.dataTypes[0] = "json", o = n[e], n[e] = function() {
s = arguments
}, f.always(function() {
void 0 === o ? i(n).removeProp(e) : n[e] = o;
t[e] && (t.jsonpCallback = r.jsonpCallback, fr.push(e));
s && u(o) && o(s[0]);
s = o = void 0
}), "script"
}), e.createHTMLDocument = function() {
var n = f.implementation.createHTMLDocument("").body;
return n.innerHTML = "<form><\/form><form><\/form>", 2 === n.childNodes.length
}(), i.parseHTML = function(n, t, r) {
if ("string" != typeof n) return [];
"boolean" == typeof t && (r = t, t = !1);
var s, u, o;
return t || (e.createHTMLDocument ? ((s = (t = f.implementation.createHTMLDocument("")).createElement("base")).href = f.location.href, t.head.appendChild(s)) : t = f), u = ci.exec(n), o = !r && [], u ? [t.createElement(u[1])] : (u = eu([n], t, o), o && o.length && i(o).remove(), i.merge([], u.childNodes))
}, i.fn.load = function(n, t, r) {
var f, s, h, e = this,
o = n.indexOf(" ");
return o > -1 && (f = g(n.slice(o)), n = n.slice(0, o)), u(t) ? (r = t, t = void 0) : t && "object" == typeof t && (s = "POST"), e.length > 0 && i.ajax({
url: n,
type: s || "GET",
dataType: "html",
data: t
}).done(function(n) {
h = arguments;
e.html(f ? i("<div>").append(i.parseHTML(n)).find(f) : n)
}).always(r && function(n, t) {
e.each(function() {
r.apply(this, h || [n.responseText, t, n])
})
}), this
}, i.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(n, t) {
i.fn[t] = function(n) {
return this.on(t, n)
}
}), i.expr.pseudos.animated = function(n) {
return i.grep(i.timers, function(t) {
return n === t.elem
}).length
}, i.offset = {
setOffset: function(n, t, r) {
var v, o, s, h, f, c, y, l = i.css(n, "position"),
a = i(n),
e = {};
"static" === l && (n.style.position = "relative");
f = a.offset();
s = i.css(n, "top");
c = i.css(n, "left");
(y = ("absolute" === l || "fixed" === l) && (s + c).indexOf("auto") > -1) ? (h = (v = a.position()).top, o = v.left) : (h = parseFloat(s) || 0, o = parseFloat(c) || 0);
u(t) && (t = t.call(n, r, i.extend({}, f)));
null != t.top && (e.top = t.top - f.top + h);
null != t.left && (e.left = t.left - f.left + o);
"using" in t ? t.using.call(n, e) : a.css(e)
}
}, i.fn.extend({
offset: function(n) {
if (arguments.length) return void 0 === n ? this : this.each(function(t) {
i.offset.setOffset(this, n, t)
});
var r, u, t = this[0];
if (t) return t.getClientRects().length ? (r = t.getBoundingClientRect(), u = t.ownerDocument.defaultView, {
top: r.top + u.pageYOffset,
left: r.left + u.pageXOffset
}) : {
top: 0,
left: 0
}
},
position: function() {
if (this[0]) {
var n, r, u, t = this[0],
f = {
top: 0,
left: 0
};
if ("fixed" === i.css(t, "position")) r = t.getBoundingClientRect();
else {
for (r = this.offset(), u = t.ownerDocument, n = t.offsetParent || u.documentElement; n && (n === u.body || n === u.documentElement) && "static" === i.css(n, "position");) n = n.parentNode;
n && n !== t && 1 === n.nodeType && ((f = i(n).offset()).top += i.css(n, "borderTopWidth", !0), f.left += i.css(n, "borderLeftWidth", !0))
}
return {
top: r.top - f.top - i.css(t, "marginTop", !0),
left: r.left - f.left - i.css(t, "marginLeft", !0)
}
}
},
offsetParent: function() {
return this.map(function() {
for (var n = this.offsetParent; n && "static" === i.css(n, "position");) n = n.offsetParent;
return n || ii
})
}
}), i.each({
scrollLeft: "pageXOffset",
scrollTop: "pageYOffset"
}, function(n, t) {
var r = "pageYOffset" === t;
i.fn[n] = function(i) {
return p(this, function(n, i, u) {
var f;
if (tt(n) ? f = n : 9 === n.nodeType && (f = n.defaultView), void 0 === u) return f ? f[t] : n[i];
f ? f.scrollTo(r ? f.pageXOffset : u, r ? u : f.pageYOffset) : n[i] = u
}, n, i, arguments.length)
}
}), i.each(["top", "left"], function(n, t) {
i.cssHooks[t] = au(e.pixelPosition, function(n, r) {
if (r) return r = yt(n, t), pi.test(r) ? i(n).position()[t] + "px" : r
})
}), i.each({
Height: "height",
Width: "width"
}, function(n, t) {
i.each({
padding: "inner" + n,
content: t,
"": "outer" + n
}, function(r, u) {
i.fn[u] = function(f, e) {
var o = arguments.length && (r || "boolean" != typeof f),
s = r || (!0 === f || !0 === e ? "margin" : "border");
return p(this, function(t, r, f) {
var e;
return tt(t) ? 0 === u.indexOf("outer") ? t["inner" + n] : t.document.documentElement["client" + n] : 9 === t.nodeType ? (e = t.documentElement, Math.max(t.body["scroll" + n], e["scroll" + n], t.body["offset" + n], e["offset" + n], e["client" + n])) : void 0 === f ? i.css(t, r, s) : i.style(t, r, f, s)
}, t, o ? f : void 0, o)
}
})
}), i.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "), function(n, t) {
i.fn[t] = function(n, i) {
return arguments.length > 0 ? this.on(t, null, n, i) : this.trigger(t)
}
}), i.fn.extend({
hover: function(n, t) {
return this.mouseenter(n).mouseleave(t || n)
}
}), i.fn.extend({
bind: function(n, t, i) {
return this.on(n, null, t, i)
},
unbind: function(n, t) {
return this.off(n, null, t)
},
delegate: function(n, t, i, r) {
return this.on(t, n, i, r)
},
undelegate: function(n, t, i) {
return 1 === arguments.length ? this.off(n, "**") : this.off(t, n || "**", i)
}
}), i.proxy = function(n, t) {
var f, e, r;
if ("string" == typeof t && (f = n[t], t = n, n = f), u(n)) return e = d.call(arguments, 2), r = function() {
return n.apply(t || this, e.concat(d.call(arguments)))
}, r.guid = n.guid = n.guid || i.guid++, r
}, i.holdReady = function(n) {
n ? i.readyWait++ : i.ready(!0)
}, i.isArray = Array.isArray, i.parseJSON = JSON.parse, i.nodeName = v, i.isFunction = u, i.isWindow = tt, i.camelCase = y, i.type = it, i.now = Date.now, i.isNumeric = function(n) {
var t = i.type(n);
return ("number" === t || "string" === t) && !isNaN(n - parseFloat(n))
}, "function" == typeof define && define.amd && define("jquery", [], function() {
return i
}), wf = n.jQuery, bf = n.$, i.noConflict = function(t) {
return n.$ === i && (n.$ = bf), t && n.jQuery === i && (n.jQuery = wf), i
}, t || (n.jQuery = n.$ = i), i
}),
function(n) {
n.fn.serializeFormJSON = function(t) {
var i = {},
r = this.serializeArray();
return n.each(r, function() {
var n = this.name.replace(t, "");
i[n] ? i[n].push || (i[n] = i[n]) : i[n] = this.value || ""
}), i
}
}(jQuery);
Widget.prototype.show = function() {
return this.outer.style.display = "block", this
};
Widget.prototype.hide = function() {
return this.outer.style.display = "none", this
};
$sllrrnngWidget = new Widget;
const $$ = document.querySelector("x-sellerrunning").shadowRoot;
PU = {
L: undefined,
random: function() {
return (new Date).getTime()
},
sessionDomain: "https://app.sellerrunning.com",
apiServiceDomain: "https://app.sellerrunning.com",
serviceName: "MWS.Extension.SellerRunning",
tokenName: "SellerRunning-Token",
isServiceRunning: !1,
log: function(n) {
PU.getParameterByName("sellerrunning_debug") == 1 && console.log(this.serviceName + ": ", n)
},
manifestData: chrome.runtime.getManifest(),
orderInformationLocalStorageName: "SellerRunningOrderInformation",
panelOnOffTrigger: function(n) {
n == "on" ? (PU.autoOrdering.turnOnTheWidget(), $("#sllrrnng-holder-on").css("background-image", "url(https://static.sellerrunning.com/assets/img/extension/sllrrnng-shield-widget.png)").css("background-size", "").css("opacity", ".7")) : n == "off" && PU.autoOrdering.turnOffTheWidget()
},
goToPageWithAppOpen: function(n) {
var t = n == null || n == "" || n == undefined ? location.href : n;
t.indexOf("sellerrunning") == -1 && t.indexOf("sllrrnng-") == -1 && (t = t + "?&sellerrunning");
location.href = t
},
sButtonClicked: !1,
isInTheSellerCentral: location.href.indexOf("sellercentral.amazon") > -1 || location.href.indexOf("sellercentral-japan.amazon") > -1,
isOff: location.href.indexOf("sellerrunningoff") > -1 || location.href.indexOf("/chat/") > -1 || location.href.indexOf("/message-us") > -1 || location.hostname != "www.amazon.com" && location.hostname != "www.amazon.ca" && location.hostname != "www.amazon.com.mx" && location.hostname != "www.amazon.co.uk" && location.hostname != "www.amazon.de" && location.hostname != "www.amazon.fr" && location.hostname != "www.amazon.it" && location.hostname != "www.amazon.es" && location.hostname != "www.amazon.ae" && location.hostname != "www.amazon.com.au" && location.hostname != "www.amazon.co.jp" && location.hostname != "www.amazon.jp" && location.hostname != "www.amazon.sg" && location.hostname != "www.amazon.sa" && location.hostname != "www.amazon.eg" && location.hostname != "www.amazon.pl" && location.hostname != "www.amazon.se" && location.hostname != "www.amazon.nl" && location.href.indexOf("sellercentral.amazon.") == -1 && location.href.indexOf("sellercentral-japan.amazon.") == -1,
ifPanelOpenable: location.hostname == "www.amazon.com" || location.hostname == "www.amazon.ca" || location.hostname == "www.amazon.com.mx" || location.hostname != "www.amazon.co.uk" || location.hostname == "www.amazon.de" || location.hostname == "www.amazon.fr" || location.hostname == "www.amazon.it" || location.hostname == "www.amazon.es" || location.hostname == "www.amazon.ae" || location.hostname == "www.amazon.com.au" || location.hostname == "www.amazon.co.jp" || location.hostname == "www.amazon.jp" || location.hostname == "www.amazon.sg" || location.hostname == "www.amazon.sa" || location.hostname == "www.amazon.eg" || location.hostname == "www.amazon.pl" || location.hostname == "www.amazon.se" || location.hostname == "www.amazon.nl" || location.href.indexOf("sellercentral.amazon.") || location.href.indexOf("sellercentral-japan.amazon.") > -1,
isInSCConfirmAction: (location.href.indexOf("sellercentral.amazon.") > -1 || location.href.indexOf("sellercentral-japan.amazon") > -1) && location.href.indexOf("inventory/confirmAction") > -1,
isInSCConfirmActionPivot: (location.href.indexOf("sellercentral.amazon.") > -1 || location.href.indexOf("sellercentral-japan.amazon") > -1) && (location.href.indexOf("inventory/pivot/inactive") > -1 || location.href.indexOf("fixyourproducts") > -1),
userToken: {
IsAuthenticated: !1,
AccessToken: ""
},
simulateClick: function(n, t) {
setTimeout(function() {
var t = document.createEvent("MouseEvents");
t.initMouseEvent("click", !0, !0);
n.dispatchEvent(t)
}, t * 1e3)
},
simulateEvents: function(n, t, i) {
setTimeout(function() {
var i = document.createEvent("MouseEvents");
i.initEvent(t, !0, !0);
n.dispatchEvent(i)
}, i * 1e3)
},
simulateInput: function(n, t) {
var i = new Event("input");
t != undefined && (n.value = t);
n.dispatchEvent(i)
},
similarity: function(n, t) {
var r = n,
u = t,
i;
return (n.length < t.length && (r = t, u = n), i = r.length, i == 0) ? 1 : (i - PU.editDistance(r, u)) / parseFloat(i)
},
editDistance: function(n, t) {
var r, u, f, i, e;
for (n = n.toLowerCase(), t = t.toLowerCase(), r = [], u = 0; u <= n.length; u++) {
for (f = u, i = 0; i <= t.length; i++) u == 0 ? r[i] = i : i > 0 && (e = r[i - 1], n.charAt(u - 1) != t.charAt(i - 1) && (e = Math.min(Math.min(e, f), r[i]) + 1), r[i - 1] = f, f = e);
u > 0 && (r[t.length] = f)
}
return r[t.length]
},
errorOccurred: !1,
areArraysEqual: function(n, t) {
var r = [],
i;
if (!n[0] || !t[0] || n.length != t.length) return !1;
for (i = 0; i < n.length; i++) key = typeof n[i] + "~" + n[i], r[key] ? r[key]++ : r[key] = 1;
for (i = 0; i < t.length; i++)
if (key = typeof t[i] + "~" + t[i], r[key]) {
if (r[key] == 0) return !1;
r[key]--
} else return !1;
return !0
},
sleep: function(n) {
for (var i = (new Date).getTime(), t = 0; t < 1e7; t++)
if ((new Date).getTime() - i > n) break
},
productInsertStatusFromAPI: !0,
productInsertStatusFromSession: function() {
return $("#ProductInsertStatus", $$).val() == "True" ? !0 : !1
},
alertPopupHide: function() {
$("#sllrrnng-popup-alert-dark, #sllrrnng-popup-alert", $$).removeClass("show");
PU.errorOccurred = !1
},
alertPopup: function(n, t) {
var i, r;
PU.errorOccurred = n == "error";
i = "";
n == "error" && (n = "danger", i = PU.L.Oops);
$("#sllrrnng-popup-alert .modal-body .alert", $$).remove();
r = '<div class="alert alert-' + n + ' m-0">' + t + "<\/div>";
$("#sllrrnng-popup-alert .modal-body", $$).append(r);
$("#sllrrnng-popup-alert-title", $$).html(i);
$("#sllrrnng-popup-alert-dark, #sllrrnng-popup-alert", $$).addClass("show");
$(".modal-footer .btn", $$).html('<i class="fe fe-check-circle"><\/i> ' + PU.L.Okay)
},
confirmPopup: function(n, t, i, r) {
PU.errorOccurred = n == "error";
n == "error" && (n = "danger", t = PU.L.Oops);
$("#sllrrnng-popup-alert .modal-body .alert", $$).remove();
PU.L.Okay;
var u = '<div class="alert alert-' + n + ' m-0">' + i + "<\/div>";
$("#sllrrnng-popup-alert .modal-body", $$).append(u);
$("#sllrrnng-popup-alert-title", $$).html(t);
$("#sllrrnng-popup-alert-dark, #sllrrnng-popup-alert", $$).addClass("show");
$(".modal-footer .btn", $$).html('<i class="fe fe-check-circle"><\/i> ' + r)
},
priceFormat: function(n) {
var t = n,
i, r;
return t ? (t = n.toString().replace(/[^0-9.,]/gi, ""), i = null, t.indexOf(",") > -1 ? (r = t.split(",")[1].length, 2 === r ? i = !1 : r > 2 && (i = !0)) : i = !0, t = i ? t.replace(",", "") : t.replace(".", "").replace(",", ".")) : t = 0, t = t > 0 ? t : 0, parseFloat(t)
},
alert: function(n, t, i, r, u) {
var e, f;
PU.errorOccurred = n == "error";
n == "error" ? n = "danger" : n == "info" && (n = "primary");
(t == "" || t == null) && (t = navigator.language == "tr-TR" ? "Bilinmeyen bir hata oluştu. Lütfen sayfayı yenileyin ve işleminize devam edin. Hâlâ sorun yaşıyorsanız, lütfen destek ekibimize başvurun." : "An unknown error has occurred. Please refresh the page and continue with your process. If problem still occurs, please contact our support team.");
e = '<div class="alert alert-' + n + '"><p>' + t + "<\/p><\/div>";
i ? (f = u == "" || u == null || u == undefined ? ".scrollbox-content" : u, $(f + " *", $$).not("div#sllrrnng-topbar").remove(), $(f, $$).append("<div class='mt-3 col-12'>" + e + "<\/div>")) : (f = u == "" || u == null || u == undefined ? "#sllrrnng-extension-alert-container" : u, $(f + " *", $$).remove(), $(f, $$).html(e), $(f, $$).show(), r > 0 && setTimeout(function() {
$("#sllrrnng-extension-alert-container", $$).hide();
PU.errorOccurred = !1
}, r * 1e3))
},
currentPage: location.href,
accountHealth: {
isAccountHealthOn: function() {
return location.href.indexOf("/performance/dashboard") > -1 || location.href.indexOf("/performance/detail") > -1
},
init: function() {
function n(n) {
n ? $("body").prepend("<div id='fullPageLoader' style='margin:0!important;padding:0!important;background: url(https://static.sellerrunning.com/assets/img/extension/ajax-loader.gif) no-repeat scroll center center #fff!important;position: fixed!important;height: 100%!important;width: 100%!important;filter: alpha(opacity = 8)!important;-moz-opacity: 0.8!important;-khtml-opacity: 0.8!important;opacity: 0.8!important;z-index: 999!important;'><div class='automatepricing-stats'><\/div><\/div>") : $("#fullPageLoader").hide()
}

function t(n, t) {
var i = [],
r, u;
$.each(n.defects, function(n, t) {
var r = {
asin: t.asin,
brandName: t.brandName,
metricName: t.metricName
};
i.push(r)
});
r = PU.callUserAPI({
Action: "InsertAccountHealthProducts",
MetricList: i,
SelectedMarketplaceId: t.MarketplaceId
}, !1);
$("#fullPageLoader").hide();
r == 1 ? (PU.alert("info", PU.L.InsertAccountHealthProductsInfo, !1), $("#sllrrnng-ah-transfer", $$).prop("disabled", !1)) : (u = navigator.language == "tr-TR" ? "SellerRunning havuzuna aktarılacak policy warning bildiriminiz bulunmamaktadır." : "There are no policy warning notifications to be transferred to SellerRunning pool.", PU.alert("error", u, !0, !1, "#sllrrnng-extension-container"))
}

function i() {
var n = PU.getMarketplaceByPage();
$.get("/performance/api/product/policy/defects/", function(i) {
t(i, n)
}).fail(function() {
PU.alert("error", "", !0, !1, "#sllrrnng-extension-container")
})
}
PU.accountHealth.isAccountHealthOn() && $("#sllrrnng", $$).removeClass("off").addClass("on");
$$.querySelector("#sllrrnng-ah-transfer").addEventListener("click", function() {
$("#sllrrnng-ah-transfer", $$).prop("disabled", !0);
PU.log("sllrrnng-ah-transfer link clicked");
n(!0);
i()
})
}
},
fixYourProducts: {
isFixYourProductsOn: function() {
return location.href.indexOf("/fixyourproducts") > -1
},
init: function() {
function n(n) {
n ? $("body").prepend("<div id='fullPageLoader' style='margin:0!important;padding:0!important;background: url(https://static.sellerrunning.com/assets/img/extension/ajax-loader.gif) no-repeat scroll center center #fff!important;position: fixed!important;height: 100%!important;width: 100%!important;filter: alpha(opacity = 8)!important;-moz-opacity: 0.8!important;-khtml-opacity: 0.8!important;opacity: 0.8!important;z-index: 999!important;'><div class='automatepricing-stats'><\/div><\/div>") : $("#fullPageLoader").hide()
}

function t(n, t) {
var i = [],
r, u;
$.each(n.items, function(n, t) {
var r = {
asin: t.product.catalogProduct.asin,
sku: t.sku,
price: t.listing.offer.price,
minimumSellerAllowedPrice: t.listing.offer.minimumSellerAllowedPrice,
maximumSellerAllowedPrice: t.listing.offer.maximumSellerAllowedPrice,
productType: t.product.catalogProduct.productType
};
i.push(r)
});
r = PU.callUserAPI({
Action: "FixYourProductInsertPricingErrors",
PricingErrorList: i,
SelectedMarketplaceId: t.MarketplaceId
}, !1);
$("#fullPageLoader").hide();
r == 1 ? (PU.alert("info", PU.L.InsertPricingError, !1), $("#sllrrnng-ah-transfer", $$).prop("disabled", !1)) : (u = navigator.language == "tr-TR" ? "SellerRunning'e aktarılmak üzere fiyatlandırma hatası aldığınız ürün bulunmamaktadır." : "There are no products for which you receive a pricing error to be transferred to SellerRunning.", PU.alert("error", u, !0, !1, "#sllrrnng-extension-container"))
}

function i() {
console.log("startTransfer");
var n = PU.getMarketplaceByPage();
$.get("/fixyourproducts/skus?status=ISSUE_INACTIVE&pageSize=10000&offset=0&sortType=DATE&sortOrder=DESCENDING&searchTerm=null&searchType=null&filter=%5B%7B%22type%22%3A%22AGGREGATED_LISTING_STATUS%22%2C%22values%22%3A%5B%22INACTIVE_LOW_PRICE_WEAK_BLOCK%22%2C%22INACTIVE_HIGH_PRICE_WEAK_BLOCK%22%5D%7D%5D", function(i) {
t(i, n)
}).fail(function() {
PU.alert("error", "", !0, !1, "#sllrrnng-extension-container")
})
}
$$.querySelector("#sllrrnng-transfer-pricing-errors").addEventListener("click", function() {
$("#sllrrnng-transfer-pricing-errors", $$).prop("disabled", !0);
PU.log("sllrrnng-transfer-pricing-errors link clicked");
n(!0);
i()
})
}
},
deleteAddressOnAmazon: {
isDeleteAddressOnAmazonOn: function() {
return location.href.indexOf("/a/addresses") > -1 && location.href.indexOf("/add?") == -1
},
init: function() {
PU.deleteAddressOnAmazon.isDeleteAddressOnAmazonOn() && $("#sllrrnng", $$).removeClass("off").addClass("on");
var n = PU.callUserAPI({
Action: "AmzAddressBookNeverDelete"
}, !1);
$("form[action='/a/addresses/delete']").find("input[name='addressID']").each(function(t, i) {
var u = $(i),
r = u.attr("value");
PU.deleteAddressOnAmazon.addEditAddressItem(r, n.AmazonAddressIds.indexOf(r) == -1 ? "undoneverdeleteaddress" : "neverdeleteaddress")
});
$(document).delegate(".sllrrnng-addressdeleteitem a", "click", function() {
var n = $(this),
t = n.data("addressid"),
i = n.data("action");
PU.deleteAddressOnAmazon.addEditAddressItem(t, i);
PU.callUserAPI({
Action: "AmzAddressBookNeverDeleteAction",
AddressId: t,
ClickAction: i
}, !1)
});
$$.querySelector("#sllrrnng-deleteaddresses").addEventListener("click", function() {
$("#sllrrnng-loader", $$).show();
var i = $("input[name='csrfToken']:first()").val(),
r = PU.callUserAPI({
Action: "AmzAddressBookNeverDelete"
}, !1),
n = $("form[action='/a/addresses/delete']").find("input[name='addressID']"),
t = 0;
n.each(function(u, f) {
setTimeout(function() {
var s, e, o, u;
t++;
s = $(f);
e = s.attr("value");
r.AmazonAddressIds.indexOf(e) == -1 && (o = $(".edit-address-desktop-link").find("a[href*='addressID=" + e + "']").parents("div.address-column"), PU.scrollTop(o), u = [], u.push("csrfToken=" + i), u.push("addressID=" + e), u.push("isStoreAddress=false"), $.ajax({
type: "POST",
url: "/a/addresses/delete",
contentType: "application/x-www-form-urlencoded;charset=utf-8",
data: u.join("&"),
dataType: "html",
success: function() {}
}), o.hide());
n.length == t && (PU.log("location.reload()"), location.reload())
}, u * 250)
})
})
},
addEditAddressItem: function(n, t) {
var i = $(".edit-address-desktop-link").find("a[href*='addressID=" + n + "']").parent();
i.find(".sllrrnng-addressdeleteitem").remove();
t == "undoneverdeleteaddress" ? i.prepend("<div class='sllrrnng-addressdeleteitem'><a href='javascript:;' data-action='neverdeleteaddress' data-addressid='" + n + "' title='SellerRunning: " + PU.L.ClickHereNotToDeleteAddress + "'><span class='sllrrnng-badge-l sllrrnng-badge-warning'><img src='https://static.sellerrunning.com/assets/img/extension/sllrrnng-shield-widget-small.png' style='width: 12px;' alt='' /><\/span><span class='sllrrnng-badge-r sllrrnng-badge-danger'>" + PU.L.NeverDeleteThisAddress + "<\/span><\/a><\/div>") : t == "neverdeleteaddress" && i.prepend("<div class='sllrrnng-addressdeleteitem'><a href='javascript:;' data-action='undoneverdeleteaddress' data-addressid='" + n + "' title='SellerRunning: " + PU.L.ClickHereNotToDeleteAddressUndo + "'><span class='sllrrnng-badge-l sllrrnng-badge-warning'><img src='https://static.sellerrunning.com/assets/img/extension/sllrrnng-shield-widget-small.png' style='width: 12px;' alt='' /><\/span><span class='sllrrnng-badge-r sllrrnng-badge-success'>" + PU.L.UndoNeverDeleteThisAddress + "<\/span><\/a><\/div>")
}
},
collectTrackingInformation: {
isCollectTrackingInformationOn: function() {
return location.href.indexOf("/order-history") > -1
},
getTrackingIdFromPage: function(n) {
var t = n.find("div#tracking-events-container div.tracking-event-trackingId-text h4").text().trim();
return (t == null || t == "") && (t = n.find("#carrierRelatedInfo-container h4.carrierRelatedInfo-trackingId-text").text().trim()), (t == null || t == "") && (t = n.find("#carrierRelatedInfo-container .carrierRelatedInfo-trackingId-text").text().trim()), (t == null || t == "") && (t = n.find("#carrierRelatedInfo-container .pt-delivery-card-trackingId").text().trim()), t.replace("Tracking ID:", "").replace("Tracking ID", "").trim()
},
getShippingCarrierTextFromPage: function(n) {
var t = n.find("div#tracking-events-container div.tracking-event-carrier-header h2").text().trim();
return (t == null || t == "") && (t = n.find("#carrierRelatedInfo-container h1.widgetHeader").text().trim()), (t == null || t == "") && (t = n.find("h1.carrierRelatedInfo-mfn-carrierNameTitle").text().trim()), (t == null || t == "") && (t = n.find("#carrierRelatedInfo-container h3").text().trim()), t
},
getShippingCarrierFromPage: function(n) {
var t = PU.collectTrackingInformation.getShippingCarrierTextFromPage(n).replace("Shipped with", "").trim();
return t.replace("Delivery by", "").trim()
},
postOrderFulfillment: function(n) {
PU.callUserAPI({
Action: "SaveCollectedTrackingInformation",
OrderItemToFulfill: n
}, !0)
},
postShipmentTrackingCommon: function(n) {
PU.callUserAPI({
Action: "UpdateTrackingInformation",
OrderShipmentTracking: n
}, !0)
},
shippingPageLoginCheck: function(n) {
if (n.find(".signIn-button").length > 0 || n.find("#signInSubmit").length > 0) {
location.href = "/gp/sign-in.html?path=/gp/your-account/order-history";
return
}
},
init: function() {
PU.collectTrackingInformation.isCollectTrackingInformationOn() && $("#sllrrnng", $$).removeClass("off").addClass("on");
$$.querySelector("#sllrrnng-check-delivery-status").addEventListener("click", function() {
$("#sllrrnng-checktrackingids, #sllrrnng-check-delivery-status", $$).addClass("disabled");
var t = PU.callUserAPI({
Action: "GetOrderShipmentsToTrackByUserId"
}, !1),
n = t.OrderShipmentTrackingList.length,
i = 0,
r = 0;
console.log(n + " shipment(s) found.");
n > 0 ? $("#sllrrnng-loader", $$).show() : (PU.alert("info", PU.L.NoOrderForTrackingChecking, !1, 5), $("#sllrrnng-checktrackingids, #sllrrnng-check-delivery-status", $$).removeClass("disabled"));
$.each(t.OrderShipmentTrackingList, function(t, u) {
setTimeout(function() {
i++;
var t = u.TrackingUrl;
$.ajax({
type: "GET",
"async": !0,
url: t,
dataType: "html",
success: function(n) {
var t = $(n);
PU.collectTrackingInformation.shippingPageLoginCheck(t);
u.PrimaryStatusText = t.find("span#primaryStatus").text().trim();
t.find("div#lexicalProgressTracker-container h2").length ? u.PrimaryStatusText = u.PrimaryStatusText + " ### " + t.find("div#lexicalProgressTracker-container h2").text().trim() : t.find("h1.pt-promise-main-slot").length && (u.PrimaryStatusText = t.find("h1.pt-promise-main-slot").text().trim());
u.EstimatedArrivalText = t.find("span.milestone-primaryMessage:last()").text().trim();
PU.collectTrackingInformation.postShipmentTrackingCommon(u);
(u.PrimaryStatusText.indexOf("delivered") > -1 || u.PrimaryStatusText.indexOf("picked up") > -1 || u.PrimaryStatusText.indexOf("signed for") > -1) && (u.PrimaryStatusText.indexOf("expected to be moved or delivered") == -1 || u.PrimaryStatusText.indexOf("expected to be delivered") == -1 || u.PrimaryStatusText.indexOf("shipment is being held") == -1 || u.PrimaryStatusText.indexOf("delivered undefined") == -1 || u.PrimaryStatusText.indexOf("HalfDelivered") == -1) && r++
}
});
i >= n && setTimeout(function() {
PU.alert("info", PU.L.TheDeliveryStatusOfYourOrdersHasBeenChecked.replace("{{totalItemCount}}", n).replace("{{successCounter}}", r), !1, 5);
$("#sllrrnng-loader", $$).hide();
$("#sllrrnng-checktrackingids, #sllrrnng-check-delivery-status", $$).removeClass("disabled")
}, 5e3)
}, 1500 * t)
})
});
$$.querySelector("#sllrrnng-checktrackingids").addEventListener("click", function() {
$("#sllrrnng-checktrackingids, #sllrrnng-check-delivery-status", $$).addClass("disabled");
var t = PU.callUserAPI({
Action: "CollectTrackingInformation"
}, !1),
n = t.OrderItemToFulfillItem.length,
i = 0,
r = 0;
n > 0 ? $("#sllrrnng-loader", $$).show() : (PU.alert("info", PU.L.NoOrderForTrackingChecking, !1, 5), $("#sllrrnng-checktrackingids, #sllrrnng-check-delivery-status", $$).removeClass("disabled"));
$.each(t.OrderItemToFulfillItem, function(t, u) {
setTimeout(function() {
i++;
var t = u.TrackingUrl;
$.ajax({
type: "GET",
"async": !0,
url: t,
dataType: "html",
success: function(n) {
var t = $(n);
PU.collectTrackingInformation.shippingPageLoginCheck(t);
u.PrimaryStatusText = t.find("span#primaryStatus").text().trim();
t.find("div#lexicalProgressTracker-container h2").length && (u.PrimaryStatusText = u.PrimaryStatusText + " ### " + t.find("div#lexicalProgressTracker-container h2").text().trim());
u.ShippingCarrierText = PU.collectTrackingInformation.getShippingCarrierTextFromPage(t);
u.ShippingCarrier = PU.collectTrackingInformation.getShippingCarrierFromPage(t);
u.TrackingId = PU.collectTrackingInformation.getTrackingIdFromPage(t);
PU.collectTrackingInformation.postOrderFulfillment(u);
(u.ShippingCarrierText.indexOf("Shipped with") > -1 || u.ShippingCarrier != "" || u.TrackingId != "") && r++
}
});
i >= n && setTimeout(function() {
PU.alert("info", PU.L.PendingOrdersHaveBeenCheckedForTrackingChecking.replace("{{totalItemCount}}", n).replace("{{successCounter}}", r), !1, 5);
$("#sllrrnng-loader", $$).hide();
$("#sllrrnng-checktrackingids, #sllrrnng-check-delivery-status", $$).removeClass("disabled")
}, 5e3)
}, 1500 * t)
})
})
}
},
sellerCentralOrders: {
isSellerCentralOrdersOn: function() {
return (location.href.indexOf("sellercentral.amazon") > -1 || location.href.indexOf("sellercentral-japan.amazon.com") > -1) && location.href.indexOf("/orders-") > -1 && location.href.indexOf("/order/") == -1
},
getOrderStatusList: function(n) {
var t = PU.callUserAPI({
Action: "GetOrderStatusList",
OrderIds: n
}, !1);
$.each(t.Orders, function(n, t) {
var r = $("#orders-table tbody").find("a[href*='orderId=" + t.AmazonOrderId + "'], a[href*='/orders-v3/order/" + t.AmazonOrderId + "']").parents("div.cell-body"),
i = "";
t.Status == "Delivered" && (i = ": " + t.DeliveredAt);
r.prepend("<div class='sllrrnng-order-item'><a href='" + PU.sessionDomain + "/orders/" + t.AmazonOrderId + "' title=\"" + PU.L.ClickHereToViewThisOrderOnAmzrunning + ": " + t.AmazonOrderId + "\" target='_blank'><span class='sllrrnng-badge-l sllrrnng-badge-warning'><img src='https://static.sellerrunning.com/assets/img/extension/sllrrnng-shield-widget-small.png' style='width: 12px;' alt='' /><\/span><span class='sllrrnng-badge-r sllrrnng-badge-" + t.StatusBadge + "'>" + t.Status + i + "<\/span><\/a><\/div>")
})
},
init: function() {
setInterval(function() {
var n = [];
$("#orders-table tbody").find("tr:not(.sllrrnng-queued)").each(function(t, i) {
var u = $(i),
r;
u.addClass("sllrrnng-queued");
r = u.find(".cell-body a[href*='/hz/orders/details'], .cell-body a[href*='/orders-v3/order']").text().trim();
r != "" && r != null && r != undefined && n.push(r)
});
n.length > 0 && PU.sellerCentralOrders.getOrderStatusList(n)
}, 2e3)
}
},
orderDetailToCopyShippingAddress: {
isOrderDetailToCopyShippingAddressOn: function() {
return (location.href.indexOf("sellercentral.amazon") > -1 || location.href.indexOf("sellercentral-japan.amazon.com") > -1) && location.href.indexOf("/order/") > -1
},
init: function() {
if (location.hostname != "sellercentral.amazon.com" && location.hostname != "sellercentral.amazon.ca" && location.hostname != "sellercentral.amazon.com.mx") {
var n = "",
t = setInterval(function() {
$('span[data-test-id="shipping-section-label"]').length && (n = $('span[data-test-id="shipping-section-label"]'), n.append("<div class='sllrrnng-order-item'><a href='javascript:;' id='sllrrnng-order-address-copy' style='float:left;'><span class='sllrrnng-badge-l sllrrnng-badge-warning'><img src='https://static.sellerrunning.com/assets/img/extension/sllrrnng-shield-widget-small.png' style='width: 12px;' alt='' /><\/span><span class='sllrrnng-badge-r sllrrnng-badge-primary'>" + PU.L.CopyAddressToSellerrunning + "<\/span><\/a><\/div>"), clearInterval(t))
}, 1e3);
$(document).delegate("#sllrrnng-order-address-copy", "click", function() {
var t = $('span[data-test-id="order-id-value"]').text().trim();
$.ajax({
type: "GET",
url: "/orders-api/order/" + t,
contentType: "application/x-www-form-urlencoded;charset=utf-8",
dataType: "JSON",
success: function(i) {
$.ajax({
type: "POST",
url: "/orders/resolve",
data: JSON.stringify({
blobs: [i.order.blob]
}),
headers: {
accept: "application/json",
"content-type": "application/json"
},
dataType: "JSON",
success: function(i) {
var r = i[t].address;
PU.callUserAPI({
Action: "UpdateOrderShippingAddress",
AmazonOrderId: t,
UpdateOrderAddressModel: r
}, !1) && (n.find(".sllrrnng-order-item").remove(), n.append('<div class="sllrrnng-alert sllrrnng-alert-success" style="margin-bottom:0;"><div class="sllrrnng-alert-container-info">' + PU.L.AddressInformationHasBeenSuccessfullyCopied + "<\/div><\/div>"))
}
})
}
})
})
}
}
},
sellerCentralMessaging: {
isSellerCentralMessagingOn: function() {
return (location.href.indexOf("sellercentral.amazon") > -1 || location.href.indexOf("sellercentral-japan.amazon.com") > -1) && location.href.indexOf("/messaging/inbox") > -1
},
getOrderDetails: function(n) {
var t = PU.callUserAPI({
Action: "GetOrderDetailsByOrderId",
OrderId: n
}, !1),
r = "",
i;
t.Status == "Delivered" && (r = ": " + t.DeliveredAt);
i = $("kat-expander[label='Order'] div.kat-expander-content, .thread-context");
i.find("div.sellerrunning-property-item").remove();
t.Status && i.prepend("<div class='order-context-property-item sellerrunning-property-item'><div class='order-context-property-label'>SellerRunning Information<\/div><div><div class='sllrrnng-order-item'><a href='" + PU.sessionDomain + "/orders/" + t.AmazonOrderId + "' title=\"" + PU.L.ClickHereToViewThisOrderOnAmzrunning + ": " + t.AmazonOrderId + "\" target='_blank'><span class='sllrrnng-badge-l sllrrnng-badge-warning'><img src='https://static.sellerrunning.com/assets/img/extension/sllrrnng-shield-widget-small.png' style='width: 12px;' alt='' /><\/span><span class='sllrrnng-badge-r sllrrnng-badge-" + t.StatusBadge + "'>" + t.Status + r + "<\/span><\/a><\/div><\/div><div><strong>Order Number:<\/strong> <a href='" + PU.sessionDomain + "/orders/" + t.AmazonOrderId + "' target='_blank'>" + t.AmazonOrderId + "<\/a><\/div><div><strong>Buyer Order:<\/strong> <a href='https://www.amazon.com/gp/your-account/order-details/?orderID=" + t.ShippingOrderId + "' target='_blank'>" + t.ShippingOrderId + "<\/a><\/div><div><strong>Profit:<\/strong> " + t.Symbol + t.Profit + "<\/div><div><strong>Tracking Url:<\/strong> <a href='" + t.TrackingUrl + "' class='sllrrnng-ellipsis-2lines' target='_blank'>" + t.TrackingUrl + "<\/a><\/div><\/div>")
},
init: function() {
var n = "";
setInterval(function() {
var t = $(".thread-context kat-link").attr("label").trim();
(t == null || t == "" || t == undefined) && (t = $("a[href*='/orders-v3/order/'], div.order-context-property-item kat-link a[href*='/order'], div.order-context-property-item kat-link a[href*='/orders']").first().text().trim());
t != null && t != "" && t != undefined && n != t && (n = t, PU.sellerCentralMessaging.getOrderDetails(n))
}, 2e3)
}
},
sellerCentralFeedbackManager: {
isSellerCentralFeedbackManagerOn: function() {
return (location.href.indexOf("sellercentral.amazon") > -1 || location.href.indexOf("sellercentral-japan.amazon.com") > -1) && location.href.indexOf("/feedback-manager") > -1
},
syncOrderIds: function(n) {
PU.callUserAPI({
Action: "OrderBuyerLeftFeedback",
OrderIds: n
}, !0)
},
init: function() {
var n = setInterval(function() {
var i = $("feedback-list"),
t;
i.length && (t = [], $(i.find("kat-link a")).each(function(n, i) {
var r = $(i).text().trim();
t.push(r)
}), t.length > 0 && PU.sellerCentralFeedbackManager.syncOrderIds(t), clearInterval(n))
}, 2e3)
}
},
cartViewDeletePage: {
isCartViewDeletePageOn: function() {
return location.href.indexOf("ref=sllr-delete-cart") > -1
},
init: function() {
var n = $("#sc-active-cart input[value='Delete']");
n.each(function(n) {
var t = $(this);
setTimeout(function() {
PU.triggerClick(t)
}, n * 2e3)
});
setTimeout(function() {
window.top.close()
}, (n.length + 1) * 2e3)
}
},
loginPage: {
isLoginPageOn: function() {
return location.href.indexOf("/ap/signin") > -1
},
init: function() {
var n = PU.autoOrdering.getOrderInformation()
}
},
autoOrdering: {
amazonOrderId: "",
shoppingCart: function() {
return location.href.indexOf("/cart/add.html") > -1
},
addressSelect: function() {
return location.href.indexOf("addressselect") > -1 && !$("form[id='changeQuantityFormId']").length && location.href.indexOf("enableDeliveryPreferences") == -1
},
itemCantBeShipped: function() {
return location.href.indexOf("/handlers/") > -1 && $("form[id='changeQuantityFormId']").length
},
thankyou: function() {
return location.href.indexOf("buy/thankyou") > -1
},
cartConfirm: function() {
return location.href.indexOf("confirmPage=confirm&add") > -1
},
giftPage: function() {
return location.href.indexOf("buy/gift/handlers") > -1 || $("#giftOptions").length
},
paySelect: function() {
return location.href.indexOf("buy/payselect") > -1
},
checkoutFinal: function() {
return location.href.indexOf("buy/spc") > -1
},
basketConfirm: function() {
return location.href.indexOf("/cart/add.html?AmazonOrderId=") > -1
},
shipOptionSelect: function() {
return location.href.indexOf("shipoptionselect") > -1 && $(".order-display").length
},
cartView: function() {
return location.href.indexOf("/gp/cart/view.html") > -1
},
busPurchaseOrderPage: function() {
return location.href.indexOf("/gp/cart/desktop/go-to-checkout.html") > -1 || location.href.indexOf("buy/businessorder/handlers") > -1
},
verifyShippingAddress: function() {
return location.href.indexOf("enableDeliveryPreferences") > -1 && !$("form[id='changeQuantityFormId']").length || location.href.indexOf("addressselect") > -1 && $("div#address-ui-widgets-enterAddressFormContainer").length
},
isSellerRunningOffers: function() {
return location.href.indexOf("#sllrrnng-offers") > -1 && location.href.indexOf("/gp/offer-listing/") > -1
},
isRemovefromCart: function() {
return location.href.indexOf("#sllrrnng-removefromcart") > -1
},
primeAccount: function() {
return $("div#prime").length
},
turnOnTheWidget: function() {
$("#sllrrnng", $$).removeClass("off").addClass("on")
},
turnOffTheWidget: function() {
$("#sllrrnng", $$).removeClass("on").addClass("off")
},
isAutomationOn: function() {
var n = PU.autoOrdering.getOrderInformation();
return $("#sllrrnng-autoordering-switch", $$).is(":checked")
},
isAutoOrderingOn: function() {
var n = PU.autoOrdering.getOrderInformation();
return (this.shoppingCart() || this.addressSelect() || this.thankyou() || this.giftPage() || this.paySelect() || this.checkoutFinal() || this.cartConfirm() || this.shipOptionSelect() || this.verifyShippingAddress() || this.itemCantBeShipped() || this.isSellerRunningOffers() || this.busPurchaseOrderPage() || this.cartView()) && n || this.basketConfirm()
},
hideAutoSwitchRow: function() {
$("#sllrrnng-autoordering-switch-row", $$).hide()
},
loadOrderInformation: function(n) {
var t = PU.callUserAPI({
Action: "GetOrderInformation",
AmazonOrderId: n
}, !1);
t == undefined ? PU.alert("error", "", !0, !1, "#sllrrnng-extension-container") : localStorage.setItem(PU.orderInformationLocalStorageName, JSON.stringify(t))
},
getOrderInformation: function() {
try {
var n = localStorage.getItem(PU.orderInformationLocalStorageName);
return JSON.parse(n)
} catch (t) {
return !1
}
},
removeOrderInformation: function() {
localStorage.removeItem(PU.orderInformationLocalStorageName)
},
dontLeaveYet: function(n) {
n ? $("body").prepend("<div id='fullPageLoader' style='margin:0!important;padding:0!important;background: url(https://static.sellerrunning.com/assets/img/extension/ajax-loader.gif) no-repeat scroll center center #fff!important;position: absolute!important;height: 100%!important;width: 100%!important;filter: alpha(opacity = 8)!important;-moz-opacity: 0.8!important;-khtml-opacity: 0.8!important;opacity: 0.9!important;z-index: 999!important;font-size: 1.5em;text-align: center;'><span style='display: block;margin: 0;position: absolute;top: 56%;-ms-transform: translateY(-50%);transform: translateY(-50%);width: 100%;left: 0;'>The buyer order number is detecting... <br>Please wait. <span class='this_process_may_take_minutes'><\/span><\/span><\/div>") : $("#fullPageLoader").hide()
},
loadAutoOrderingPage: function(n, t) {
t && (this.amazonOrderId = n == "" || n == null || n == undefined ? PU.getParameterByName("AmazonOrderId") : n, this.loadOrderInformation(this.amazonOrderId));
var i = this.getOrderInformation();
i == undefined || i.Error ? PU.alert("error", "", !0) : (this.amazonOrderId = i.AmazonOrderId, $("#sllrrnng-orderdetail-orderId", $$).text(i.AmazonOrderId), $("#sllrrnng-orderdetail-name", $$).text(i.OrderShippingAddress.Name), $("#sllrrnng-orderdetail-address-1", $$).text(i.OrderShippingAddress.AddressLine1), i.OrderShippingAddress.AddressLine2 != "" && i.OrderShippingAddress.AddressLine2 != null && $("#sllrrnng-orderdetail-address-1", $$).append(", " + i.OrderShippingAddress.AddressLine2), $("#sllrrnng-orderdetail-address-2", $$).text(i.OrderShippingAddress.City + ", " + i.OrderShippingAddress.StateOrRegion + ", " + i.OrderShippingAddress.PostalCode), $("#sllrrnng-orderdetail-phone", $$).text(i.OrderShippingAddress.CountryCode + ", " + i.OrderShippingAddress.Phone), $("#sllrrnng-orderdetail-shipping-service", $$).text(i.OrderBasicInfo.ShippingService), (i.OrderBasicInfo.ShippingService == "Expedited" || i.OrderBasicInfo.ShippingService == "Scheduled") && $("#sllrrnng-orderdetail-shipping-service", $$).removeClass("badge-primary").addClass("badge-warning"), $("#sllrrnng-orderdetail-latest-delivery", $$).text(i.OrderBasicInfo.LatestDeliveryDateText), $("#sllrrnng-orderdetail-cost", $$).text(i.OrderBasicInfo.Cost), $("#sllrrnng-orderdetail-price", $$).text(i.OrderBasicInfo.Price), i.OrderBasicInfo.IsShippingAddressEmpty ? $("#sllrrnng-orderdetail-shipping-details", $$).hide() : ($("#sllrrnng-orderdetail-shipping-details", $$).show(), $("#sllrrnng-orderdetail-shipping-details-warning", $$).hide()))
},
updateLocalStore: function(n) {
localStorage.removeItem(PU.orderInformationLocalStorageName);
localStorage.setItem(PU.orderInformationLocalStorageName, JSON.stringify(n))
},
changeOrderShippingAddressSH: function(n, t) {
var i, r;
if ($("#sllrrnng-extension-warning-warehouse", $$).show(), i = PU.autoOrdering.getOrderInformation(), i.OrderShippingAddress.Name = i.SHWareHouse[n].BuyerName, i.OrderShippingAddress.Phone = i.SHWareHouse[n].Phone, i.OrderShippingAddress.AddressLine1 = i.SHWareHouse[n].AddressLine1, i.OrderShippingAddress.AddressLine2 = i.SHWareHouse[n].AddressLine2, i.OrderShippingAddress.City = i.SHWareHouse[n].City, i.OrderShippingAddress.CountryCode = i.SHWareHouse[n].CountryCode, i.OrderShippingAddress.PostalCode = i.SHWareHouse[n].PostalCode, i.OrderShippingAddress.StateOrRegion = i.SHWareHouse[n].StateOrRegion, i.SHWareHouseId = i.SHWareHouse[n].Id, PU.autoOrdering.updateLocalStore(i), PU.autoOrdering.loadAutoOrderingPage(), t) {
console.log(1);
$("#a-popover-1").length && $("#a-popover-1").attr("aria-hidden") != "true" || PU.triggerClick($("#add-new-address-popover-link").parent(), 1);
$("#address-ui-widgets-enterAddressFullName, #enterAddressFullName, input[name='address-ui-widgets-enterAddressFullName']").val(i.SHWareHouse[n].BuyerName);
$("#address-ui-widgets-enterAddressLine1, #enterAddressAddressLine1, input[name='address-ui-widgets-enterAddressLine1']").val(i.SHWareHouse[n].AddressLine1);
$("#address-ui-widgets-enterAddressLine2, #enterAddressAddressLine2, input[name='address-ui-widgets-enterAddressLine2']").val(i.SHWareHouse[n].AddressLine2);
$("#address-ui-widgets-enterAddressCity, #enterAddressCity, input[name='address-ui-widgets-enterAddressCity']").val(i.SHWareHouse[n].City);
$("#address-ui-widgets-enterAddressStateOrRegion, #enterAddressStateOrRegion, select[name='address-ui-widgets-enterAddressStateOrRegion']").val(i.SHWareHouse[n].StateOrRegion);
$("#address-ui-widgets-enterAddressPostalCode, #enterAddressPostalCode, input[name='address-ui-widgets-enterAddressPostalCode']").val(i.SHWareHouse[n].PostalCode);
try {
PU.simulateInput($("#address-ui-widgets-enterAddressPostalCode, #enterAddressPostalCode, input[name='address-ui-widgets-enterAddressPostalCode']")[0], i.OrderShippingAddress.PostalCode)
} catch (u) {}
$("#address-ui-widgets-enterAddressPhoneNumber, #enterAddressPhoneNumber, input[name='address-ui-widgets-enterAddressPhoneNumber']").val(i.SHWareHouse[n].Phone);
try {
PU.simulateInput($("#address-ui-widgets-enterAddressPhoneNumber, #enterAddressPhoneNumber, input[name='address-ui-widgets-enterAddressPhoneNumber']")[0], i.SHWareHouse[n].Phone)
} catch (u) {}
$("#address-ui-widgets-addr-details-address-instructions").val(i.OrderShippingAddress.DeliveryInstructions);
$("select#address-ui-widgets-enterAddressStateOrRegion-dropdown-nativeId option, select[name='address-ui-widgets-enterAddressStateOrRegion'] option").each(function() {
$(this).val() === i.SHWareHouse[n].StateOrRegion && $("select#address-ui-widgets-enterAddressStateOrRegion-dropdown-nativeId, select[name='address-ui-widgets-enterAddressStateOrRegion']").val($(this).val())
});
$("select#address-ui-widgets-countryCode option, select#address-ui-widgets-countryCode-dropdown-nativeId option, #enterAddressCountryCode option").each(function() {
$(this).val() === i.SHWareHouse[n].CountryCode && $("select#address-ui-widgets-countryCode, select#address-ui-widgets-countryCode-dropdown-nativeId, #address-ui-widgets-countryCode-dropdown-nativeId, #enterAddressCountryCode").val($(this).val())
});
i.OrderBasicInfo.IsShippingAddressEmpty && ($("#sllrrnng-orderdetail-shipping-details", $$).hide(), $("#sllrrnng-orderdetail-shipping-details-warning", $$).show());
r = setInterval(function() {
$("form#address-popover-suggestions-form").length && (PU.log("setInterval: address-popover-suggestions-form"), PU.alert("info", PU.L.SelectAddressGoToNextStep, !1, 5), clearInterval(r))
}, 1e3)
} else console.log("2"), $("#address-ui-widgets-enterAddressFullName, #enterAddressFullName, input[name='address-ui-widgets-enterAddressFullName']").val(i.OrderShippingAddress.Name), $("#address-ui-widgets-enterAddressLine1, #enterAddressAddressLine1, input[name='address-ui-widgets-enterAddressLine1']").val(i.OrderShippingAddress.AddressLine1), $("#address-ui-widgets-enterAddressLine2, #enterAddressAddressLine2, input[name='address-ui-widgets-enterAddressLine2']").val(i.OrderShippingAddress.AddressLine2), $("#address-ui-widgets-enterAddressCity, #enterAddressCity, input[name='address-ui-widgets-enterAddressCity']").val(i.OrderShippingAddress.City), $("#address-ui-widgets-enterAddressDistrictOrCounty, #enterAddressDistrictOrCounty").val(i.OrderShippingAddress.StateOrRegion), $("#address-ui-widgets-enterAddressStateOrRegion, #enterAddressStateOrRegion, select[name='address-ui-widgets-enterAddressStateOrRegion']").val(i.OrderShippingAddress.StateOrRegion), $("#address-ui-widgets-enterAddressPostalCode, #enterAddressPostalCode, input[name='address-ui-widgets-enterAddressPostalCode']").val(i.OrderShippingAddress.PostalCode), $("#address-ui-widgets-enterAddressPhoneNumber, #enterAddressPhoneNumber, input[name='address-ui-widgets-enterAddressPhoneNumber']").val(i.OrderShippingAddress.Phone), $("#address-ui-widgets-addr-details-address-instructions").val(i.OrderShippingAddress.DeliveryInstructions), $("textarea#AddressInstructions, textarea#address-ui-widgets-addr-details-address-instructions").val(i.OrderShippingAddress.DeliveryInstructions), $("select#address-ui-widgets-enterAddressStateOrRegion-dropdown-nativeId option, select[name='address-ui-widgets-enterAddressStateOrRegion'] option").each(function() {
$(this).val() === i.OrderShippingAddress.StateOrRegion && $("select#address-ui-widgets-enterAddressStateOrRegion-dropdown-nativeId, select[name='address-ui-widgets-enterAddressStateOrRegion']").val($(this).val())
}), $("select#address-ui-widgets-countryCode option, select#address-ui-widgets-countryCode-dropdown-nativeId option, #enterAddressCountryCode option").each(function() {
$(this).val() === i.OrderShippingAddress.CountryCode && $("select#address-ui-widgets-countryCode, select#address-ui-widgets-countryCode-dropdown-nativeId, #enterAddressCountryCode").val($(this).val())
}), $("select#address-ui-widgets-enterAddressCity-dropdown-nativeId option").each(function() {
$(this).val() === i.OrderShippingAddress.City && $("select#aaddress-ui-widgets-enterAddressCity-dropdown-nativeId").val($(this).val())
});
PU.scrollTop(".enter-address-form, #address-ui-checkout-form")
},
redirectUrl: function(n, t) {
setTimeout(function() {
document.location.href = n
}, t * 1e3)
},
runSteps: function() {
var k, tt, r, d, w, c, ft, i, n, rt, l, p, b, a, e, o;
if (!PU.errorOccurred) {
function rt() {
if ($("input[name='isToBeGiftWrapped']").length) {
var n = $("input[name='isToBeGiftWrapped']");
n.is(":checked") || PU.triggerClick("input[name='isToBeGiftWrapped']", 1)
} else PU.triggerClick("div.sc-gift-option input[type='checkbox']:not(:checked):first()", 1)
}
if (PU.autoOrdering.cartView() && PU.autoOrdering.getOrderInformation())
if (PU.autoOrdering.hideAutoSwitchRow(), PU.autoOrdering.isRemovefromCart()) {
var s = PU.getParameterByName("ASIN"),
u = PU.getParameterByName("merchantId"),
g = "/gp/offer-listing/" + s + "/?condition=new#sllrrnng-offers?ASIN=" + s + "&merchantId=" + u,
nt = $("div[data-asin='" + s + "'] span.sc-action-delete");
PU.alert("warning", PU.L.RemoveItemFromCart.replace("{{Href}}", g));
PU.highlighter(nt);
PU.triggerClick(nt.find("input"), 2);
setTimeout(function() {
location.href = g
}, 4e3);
PU.log("removefromCart")
} else r = $("#sc-buy-box-ptc-button-announce div.sc-without-fresh").text().trim(), r.length ? (PU.userToken.EnableAutoGiftSelection && rt(), PU.alert("warning", PU.L.YouHaveUncompletedOrder.replace("{{Name}}", r), !1), PU.highlighter(".sc-proceed-to-checkout"), PU.log("cartView")) : (r = $("#sc-buy-box-ptc-button-announce div.sc-without-multicart").text().trim(), r.length ? (PU.userToken.EnableAutoGiftSelection && rt(), $("#sc-active-cart .sc-clipcoupon a.sc-action-link, .sc-buy-box-ptc-button").length ? (r = $("#sc-buy-box-ptc-button-announce div.sc-without-fresh").text().trim(), PU.alert("warning", PU.L.ApplyDiscountAndProceed.replace("{{Name}}", r), !1), PU.highlighter("div[data-promoid]"), PU.simulateClick($("#sc-active-cart a.sc-action-link")[0], 1), PU.triggerClickIfAutomationOn("input[name='proceedToCheckout'], input[name='proceedToRetailCheckout']", 10)) : PU.triggerClickIfAutomationOn("input[name='proceedToCheckout'], input[name='proceedToRetailCheckout']", 2)) : (PU.alert("error", PU.L.YouHaveUncompletedOrder_BasketEmpty, !1), PU.log("cartView-basketEmpty")));
if (PU.autoOrdering.basketConfirm() && (PU.log("basketConfirm"), n = PU.autoOrdering.getOrderInformation(), $.ajax({
type: "GET",
url: "https://www.amazon.com",
success: function(t) {
var i = $(t).find("#glowValidationToken").val();
chrome.runtime.sendMessage({
name: "change-address",
url: "https://www.amazon.com",
homepagecsrftoken: i,
countryCode: n.OrderShippingAddress.CountryCode
}, function() {})
}
}), k = !1, window.localStorage && (localStorage.getItem("firstLoad") ? localStorage.removeItem("firstLoad") : (localStorage.firstLoad = !0, window.location.reload(), k = !0)), k == !1 && (tt = $("h5.a-spacing-top-base span").text().trim().indexOf("items are currently unavailable"), tt > -1 ? PU.alert("error", PU.L.TheseTtemsAreCurrentlyUnavailable, !1) : (PU.triggerClickIfAutomationOn("span.a-button span.a-button-inner input[class='a-button-input']", 2), PU.triggerClickIfAutomationOn("input[alt='Continue']", 2)))), PU.autoOrdering.shoppingCart() && !PU.autoOrdering.basketConfirm() && PU.autoOrdering.getOrderInformation() && (PU.log("shoppingCart"), n = PU.autoOrdering.getOrderInformation(), PU.userToken.EnableAutoGiftSelection && rt(), $("#sc-active-cart .sc-clipcoupon a.sc-action-link, .sc-buy-box-ptc-button").length ? (r = $("#sc-buy-box-ptc-button-announce div.sc-without-fresh").text().trim(), PU.alert("warning", PU.L.ApplyDiscountAndProceed.replace("{{Name}}", r), !1), PU.highlighter("div[data-promoid]"), PU.simulateClick($("#sc-active-cart a.sc-action-link")[0], 1), PU.triggerClickIfAutomationOn("input[name='proceedToCheckout'], input[name='proceedToRetailCheckout']", 10)) : PU.triggerClickIfAutomationOn("input[name='proceedToCheckout'], input[name='proceedToRetailCheckout']", 2)), PU.autoOrdering.thankyou() && PU.autoOrdering.getOrderInformation()) {
PU.log("thankyou page");
PU.autoOrdering.turnOffTheWidget();

function t(n, t) {
var i = PU.callUserAPI({
Action: "FinishAutoOrdering",
AmazonOrderId: t.AmazonOrderId,
PurchaseId: it,
ShippingOrderId: n,
CCID: t.UserCCModel.CCID,
EligibleForSH: t.OrderBasicInfo.EligibleForSH,
SHWareHouseId: t.SHWareHouseId,
GrandTotalPrice: t.OrderBasicInfo.GrandTotalPrice
}, !1);
i == 1 ? ((n == "" || n == undefined || n == null) && (n = "n/a"), PU.alert("success", PU.L.CongratulationsYourOrderComplete.replace("{{AmazonOrderId}}", t.AmazonOrderId).replace("{{ShippingOrderId}}", n))) : PU.alert("error", "");
PU.autoOrdering.dontLeaveYet(!1);
PU.autoOrdering.turnOnTheWidget();
PU.autoOrdering.removeOrderInformation();
PU.autoOrdering.hideAutoSwitchRow();
$("#sllrrnng-extension-cancel-ordering-button", $$).hide()
}
var n = PU.autoOrdering.getOrderInformation(),
h = PU.getParameterByName("orderId"),
it = PU.getParameterByName("purchaseId");
if (h == "" || h == undefined || h == null)
if (console.log("sr: no orderId parameter"), n.BuyerOrderSyncMethod == "ExactMatch") {
$(".this_process_may_take_minutes").text("(This process may take 1-2 minutes.)");

function i() {
chrome.runtime.sendMessage({
name: "get",
url: "https://www.amazon.com/gp/your-account/order-history/ref=ppx_yo_dt_b_search?opt=ab&search=" + it + "&disableCsd=no-js"
}, function(r) {
if (r.status == 200) {
var f = $(r.data).find("#ordersContainer .js-order-card").first(),
u = f.find(".actions.a-col-right .value").text().trim();
u == "" || u == undefined || u == null ? setTimeout(function() {
i()
}, 3e3) : (console.log("sr: currentOrderId:", u), t(u, n))
}
})
}
i()
} else n.BuyerOrderSyncMethod == "Similarity" && ($(".this_process_may_take_minutes").text("(This process may take 15-30 seconds.)"), d = !1, chrome.runtime.sendMessage({
name: "get",
url: "https://www.amazon.com/gp/your-account/order-history?ie=UTF8&ref%5F=ya%5Fd%5Fc%5Fyo&disableCsd=no-js"
}, function(i) {
var e, r, f;
if (i.status == 200) {
var o = $(i.data),
s = $(i.data).find("#ordersContainer .js-order-card, .your-orders-content-container .js-order-card"),
u = [];
$(s).each(function() {
var s, e, i, h;
try {
var r = $(this),
c = r.find(".actions.a-col-right .value, .a-fixed-right-grid-col.a-col-right .a-color-secondary").last().text().trim(),
t = r.find(".recipient .a-size-base span.a-declarative").data("a-popover"),
n = "";
if (t == undefined) {
var l = r.find("div[id^='shipToInsertionNode-shippingAddress']").first().attr("id").replace("shipToInsertionNode-shippingAddress-", ""),
a = o.find("#shipToData-shippingAddress-" + l).first().text(),
f = document.createElement("div");
f.className = "recipient";
f.innerHTML = a;
t = $(f).find("span.a-declarative").data("a-popover");
n = t != undefined && t.inlineContent ? $(t.inlineContent).text().trim() : $(f).find(".a-popover-preload").text().trim()
} else t.inlineContent ? n = $(t.inlineContent).text().trim() : (s = $(".recipient .a-size-base div.a-popover-preload"), n = s.text().trim());
n.indexOf("Phone") > -1 && (d = !0);
n = n.replaceAll("\n", " ");
n = n.replaceAll(",", " ");
n = n.replaceAll("Phone:", " ");
n = n.replace(/\s+/g, " ");
e = r.find('a[href*="/gp/product/"], a[href*="/dp/"]').attr("href");
i = e.match(new RegExp("/gp/product/(.*)/ref"));
i == null && (i = "", i = e.match(new RegExp("/dp/(.*)/?psc")));
n = n + " " + i[1].replace("?", "");
h = {
orderId: c,
recipient: n,
asin: i[1].replace("?", ""),
similarityScore: 0
};
u.push(h)
} catch (v) {
console.log(v)
}
});
e = PU.productSearch.getMarketplaceByCountryCode(n.OrderShippingAddress.CountryCode);
r = n.OrderShippingAddress.Name + " " + n.OrderShippingAddress.AddressLine1 + " ";
n.OrderShippingAddress.AddressLine2 && (r += n.OrderShippingAddress.AddressLine2 + " ");
n.OrderShippingAddress.City && (r += n.OrderShippingAddress.City + " ");
n.OrderShippingAddress.CountryCode != "AE" && n.OrderShippingAddress.CountryCode != "SG" && n.OrderShippingAddress.StateOrRegion && (r += n.OrderShippingAddress.StateOrRegion + " ");
n.OrderShippingAddress.CountryCode != "AE" && n.OrderShippingAddress.CountryCode != "SG" && n.OrderShippingAddress.PostalCode && (r += n.OrderShippingAddress.PostalCode + " ");
e.CountryName && (r += e.CountryName + " ");
d && n.OrderShippingAddress.Phone && (r += n.OrderShippingAddress.Phone + " ");
n.Products[0].ASIN && (r += n.Products[0].ASIN);
r = r.replaceAll(",", " ");
console.log("sr:", r);
u.length > 0 && ($(u).each(function(n, t) {
t.similarityScore = PU.similarity(t.recipient, r);
console.log("sr: addresses:", t.recipient, " - ", r, " - ", t.similarityScore)
}), u.sort((n, t) => parseFloat(t.similarityScore) - parseFloat(n.similarityScore)), f = u.find(function(n) {
return n.similarityScore > .95
}), f != undefined && (h = f.orderId), console.log("sr: exactMatches:", f))
} else alert("error-order-history");
t(h, n)
}));
else t(h, n)
}
if (PU.autoOrdering.isSellerRunningOffers() && PU.autoOrdering.getOrderInformation()) {
PU.log("isSellerRunningOffers");
var n = PU.autoOrdering.getOrderInformation(),
s = PU.getParameterByName("ASIN"),
u = PU.getParameterByName("merchantId"),
ut = $("div.olpOffer a[href*='" + u + "'], div.olpOfferList a[href*='" + u + "']").parents("div.a-row");
PU.blockedCss(ut, PU.L.SellerUnableToShipToCustomerAddress);
PU.alert("warning", PU.L.AddProductFromOfferList);
PU.autoOrdering.hideAutoSwitchRow()
}
if (PU.autoOrdering.busPurchaseOrderPage() && PU.autoOrdering.getOrderInformation() && (PU.log("businessPurchaseOrderPage"), $("form#business-order-info-form input[type='text']").val(PU.autoOrdering.amazonOrderId), PU.alert("info", PU.L.OptionalForBusinessAccounts, !1), n = PU.autoOrdering.getOrderInformation(), PU.triggerClickIfAutomationOn("span.continue-button input, span.ab-cof-continue input", 1)), PU.autoOrdering.primeAccount()) {
if (PU.log("I'm prime bitch!"), n = PU.autoOrdering.getOrderInformation(), PU.autoOrdering.addressSelect() && PU.autoOrdering.getOrderInformation() || n.OrderBasicInfo.EligibleForSH)
if (PU.log("enter shipping address"), n.OrderBasicInfo.EligibleForSH)
if (PU.autoOrdering.changeOrderShippingAddressSH(0, !0), n.SHWareHouse.length > 1) {
for ($("#sllrrnng-autoordering-warehouse-row", $$).show(), c = "", ft = "selected='selected'", i = 0; i < n.SHWareHouse.length; i++) c += "<option value='" + n.SHWareHouse[i].Id + "' >" + n.SHWareHouse[i].Name + "<\/option>";
$("#sllrrnng-autoordering-warehouse-choose", $$).html(c);
$("#sllrrnng-autoordering-warehouse-choose", $$).change(function() {
for (var i = $(this).val(), t = 0; t < n.SHWareHouse.length; t++) n.SHWareHouse[t].Id == i && PU.autoOrdering.changeOrderShippingAddressSH(t, !0)
})
} else PU.triggerClickIfAutomationOn("#address-ui-checkout-submit-button input, #address-ui-widgets-form-submit-button input, span[data-action='add-address-popover-submit']", 3);
else console.log(4), $("select#address-ui-widgets-countryCode option, select#address-ui-widgets-countryCode-dropdown-nativeId option, #enterAddressCountryCode option").each(function() {
$(this).val() === n.OrderShippingAddress.CountryCode && $("select#address-ui-widgets-countryCode, select#address-ui-widgets-countryCode-dropdown-nativeId, #enterAddressCountryCode").val($(this).val())
}), PU.simulateEvents($("select#address-ui-widgets-countryCode, select#address-ui-widgets-countryCode-dropdown-nativeId, #enterAddressCountryCode")[0], "change", 1), $("#a-popover-1").length && $("#a-popover-1").attr("aria-hidden") != "true" || PU.triggerClick($("#add-new-address-popover-link").parent(), 1), setTimeout(function() {
$("#address-ui-widgets-enterAddressFullName, #enterAddressFullName, input[name='address-ui-widgets-enterAddressFullName']").val(n.OrderShippingAddress.Name);
$("#address-ui-widgets-enterAddressLine1, #enterAddressAddressLine1, input[name='address-ui-widgets-enterAddressLine1']").val(n.OrderShippingAddress.AddressLine1);
$("#address-ui-widgets-enterAddressLine2, #enterAddressAddressLine2, input[name='address-ui-widgets-enterAddressLine2']").val(n.OrderShippingAddress.AddressLine2);
$("#address-ui-widgets-enterAddressCity, #enterAddressCity, input[name='address-ui-widgets-enterAddressCity']").val(n.OrderShippingAddress.City);
$("#address-ui-widgets-enterAddressDistrictOrCounty, #enterAddressDistrictOrCounty").val(n.OrderShippingAddress.StateOrRegion);
$("#address-ui-widgets-enterAddressStateOrRegion, #enterAddressStateOrRegion, select[name='address-ui-widgets-enterAddressStateOrRegion']").val(n.OrderShippingAddress.StateOrRegion);
$("#address-ui-widgets-enterAddressPhoneNumber, #enterAddressPhoneNumber, input[name='address-ui-widgets-enterAddressPhoneNumber']").val(n.OrderShippingAddress.Phone);
try {
PU.simulateInput($("#address-ui-widgets-enterAddressPhoneNumber, #enterAddressPhoneNumber, input[name='address-ui-widgets-enterAddressPhoneNumber']")[0], n.OrderShippingAddress.Phone)
} catch (t) {}
$("#address-ui-widgets-enterAddressPostalCode, #enterAddressPostalCode, input[name='address-ui-widgets-enterAddressPostalCode']").val(n.OrderShippingAddress.PostalCode);
try {
PU.simulateInput($("#address-ui-widgets-enterAddressPostalCode, #enterAddressPostalCode, input[name='address-ui-widgets-enterAddressPostalCode']")[0], n.OrderShippingAddress.PostalCode)
} catch (t) {}
$("#address-ui-widgets-addr-details-address-instructions").val(n.OrderShippingAddress.DeliveryInstructions);
$("select#address-ui-widgets-enterAddressStateOrRegion-dropdown-nativeId option, select[name='address-ui-widgets-enterAddressStateOrRegion'] option").each(function() {
$(this).val() === n.OrderShippingAddress.StateOrRegion && $("select#address-ui-widgets-enterAddressStateOrRegion-dropdown-nativeId, select[name='address-ui-widgets-enterAddressStateOrRegion']").val($(this).val())
});
PU.simulateEvents($("select#address-ui-widgets-enterAddressStateOrRegion-dropdown-nativeId, select[name='address-ui-widgets-enterAddressStateOrRegion']")[0], "change", 0);
setTimeout(function() {
n.OrderShippingAddress.CountryCode == "MX" && PU.triggerClick("input[name='address-ui-widgets-enterAddressPostalCode-submit']", 0);
setTimeout(function() {
n.OrderShippingAddress.CountryCode == "MX" && PU.triggerClick("input[name='address-ui-widgets-enterAddressPostalCode-submit']", 0);
setTimeout(function() {
$("select#address-ui-widgets-enterAddressLine2SelectNative option").each(function() {
$(this).val() === n.OrderShippingAddress.AddressLine2 && $("select#address-ui-widgets-enterAddressLine2SelectNative").val($(this).val())
});
PU.simulateEvents($("select#address-ui-widgets-enterAddressLine2SelectNative")[0], "change", 0);
$("select#address-ui-widgets-enterAddressCity-dropdown-nativeId option").each(function() {
$(this).val() === n.OrderShippingAddress.City.toUpperCase() && $("select#address-ui-widgets-enterAddressCity-dropdown-nativeId").val($(this).val().toUpperCase())
});
PU.simulateEvents($("select#address-ui-widgets-enterAddressCity-dropdown-nativeId")[0], "change", 0)
}, 300);
n.OrderBasicInfo.IsShippingAddressEmpty ? ($("#sllrrnng-orderdetail-shipping-details", $$).hide(), $("#sllrrnng-orderdetail-shipping-details-warning", $$).show()) : PU.triggerClickIfAutomationOn("#address-ui-checkout-submit-button input, #address-ui-widgets-form-submit-button input, span[data-action='add-address-popover-submit']", 2);
var t = setInterval(function() {
$("span#save-or-edit-address").length && (PU.log("setInterval: address-popover-suggestions-form"), PU.userToken.VerifyAddressAlwaysOriginal ? (PU.triggerClickIfAutomationOn("input[value='original-address-']", 1), PU.triggerClickIfAutomationOn("input[name='save-or-edit-address']", 1)) : PU.alert("info", PU.L.SelectAddressGoToNextStep, !1, 5), clearInterval(t))
}, 1e3)
}, 1e3);
var t = setInterval(function() {
$("span#save-or-edit-address").length && (PU.log("setInterval: address-popover-suggestions-form"), PU.userToken.VerifyAddressAlwaysOriginal ? (PU.triggerClickIfAutomationOn("input[value='original-address-']", 1), PU.triggerClickIfAutomationOn("input[name='save-or-edit-address']", 1)) : PU.alert("info", PU.L.SelectAddressGoToNextStep, !1, 5), clearInterval(t))
}, 1e3)
}, 1e3)
}, 3e3);
if (PU.autoOrdering.verifyShippingAddress() && (PU.log("verify shipping address"), n = PU.autoOrdering.getOrderInformation(), setTimeout(function() {
if (PU.userToken.VerifyAddressAlwaysOriginal) PU.triggerClickIfAutomationOn("input#address-ui-widgets-original-address-block_id-input", 1), PU.triggerClickIfAutomationOn("input[name='address-ui-widgets-saveOriginalOrSuggestedAddress']", 1);
else {
var n = $("input[name='useSelectedAddress']").val().trim();
PU.alert("warning", PU.L.VerifyAddressAndContinue.replace("{{Name}}", n), !1);
PU.highlighter(".a-spacing-double-large")
}
}, 6e3)), PU.autoOrdering.giftPage() && PU.autoOrdering.getOrderInformation() && ($("#sllrrnng-autoordering-warehouse-row", $$).hide(), $("#sllrrnng-extension-warning-warehouse", $$).hide(), PU.log("gift selection"), n = PU.autoOrdering.getOrderInformation(), $("textarea").val(n.OrderBasicInfo.DefaultGiftNote), $(".sender-name-text-input").val(n.OrderBasicInfo.DefaultGiftNoteSender), PU.autoOrdering.isAutomationOn() && (PU.log("click save gift options"), PU.triggerClickIfAutomationOn("span#orderSummaryPrimaryActionBtn:first()", 1))), PU.autoOrdering.itemCantBeShipped() && PU.autoOrdering.getOrderInformation()) {
PU.log("itemCantBeShipped");
$("#sllrrnng-autoordering-warehouse-row", $$).hide();
$("#sllrrnng-extension-warning-warehouse", $$).hide();
var v = $("div.lineitem-error-message:first()").parents(".item-row"),
s = v.find("input[name*='asin']").val(),
u = v.find("input[name*='merchantID']").val(),
n = PU.autoOrdering.getOrderInformation();
PU.log("itemCantBeShipped: ASIN: " + s + ", MerchantId: " + u);
PU.autoOrdering.hideAutoSwitchRow();
u != undefined && (PU.alert("warning", "<strong>" + PU.L.ThereIsAProblem + ": <\/strong>" + PU.L.CannotSendToCustomer.replace("{{Asin}}", s).replace("{{MerchantId}}", u)), PU.highlighter(v))
}
if (PU.autoOrdering.paySelect() && PU.autoOrdering.getOrderInformation() && (PU.log("payment select"), $("#sllrrnng-autoordering-warehouse-row", $$).hide(), n = PU.autoOrdering.getOrderInformation(), n.UserCCModel.IsActive ? (PU.log("user cc is active"), rt = setInterval(function() {
var t = $("span:contains('ending in " + n.UserCCModel.Last4Digits + "')").parents(".payment-row, .pmts-instrument-box").first().find("input[name='paymentMethod'], input[name='ppw-instrumentRowSelection']").first(),
i;
t.length && (PU.triggerClick(t, 1), i = $("input#addCreditCardNumber[placeholder='ending in " + n.UserCCModel.Last4Digits + "'], div.apx-add-credit-card-number input[placeholder='ending in " + n.UserCCModel.Last4Digits + "']"), i.length && (PU.alert("info", PU.L.TheCreditCardNumberIsEnteredAutomatically, !1), i.val(n.UserCCModel.CC), PU.triggerClick($("input#confirm-card, .pmts-selected .pmts-button-input button").first(), 2)), PU.autoOrdering.isAutomationOn() && !PU.userToken.AlwaysStopAtCredirCardSelection && PU.triggerClick($("input#continue-top, .pmts-credit-card-row span.pmts-button-input input").first(), 2), PU.log("user cc is active ccInterval paymentRow: " + t.length), PU.triggerClickIfAutomationOn("span#orderSummaryPrimaryActionBtn", 1))
}, 3e3)) : $(".payment-selected input#addCreditCardNumber").length ? (PU.alert("warning", PU.L.EnterCCInfoAndContinue.replace("{{Name}}", $("#continue-top").val()), !1), PU.highlighter("#existing-credit-cards-box")) : PU.autoOrdering.isAutomationOn() && !PU.userToken.AlwaysStopAtCredirCardSelection && PU.triggerClickIfAutomationOn("span#orderSummaryPrimaryActionBtn", 1)), PU.autoOrdering.checkoutFinal() && PU.autoOrdering.getOrderInformation()) {
PU.log("checkout");
$("#sllrrnng-autoordering-warehouse-row", $$).hide();
$("#sllrrnng-extension-warning-warehouse", $$).hide();
var t = PU.autoOrdering.getOrderInformation(),
y = 0,
f = "";
f = $("td[data-field='price']").length ? $("td[data-field='price']").html().trim() : $("td.grand-total-price").html().trim();
l = $("tr td span:contains('Gift')").parent().siblings().first().html();
(f.length || l.length) && (y = parseFloat(PU.priceFormat(f)) + parseFloat(PU.priceFormat(l)), t.OrderBasicInfo.GrandTotalPrice = y, PU.autoOrdering.updateLocalStore(t));
p = (t.OrderShippingAddress.AddressLine1 + " " + t.OrderShippingAddress.AddressLine2).toLowerCase().trim();
b = !0;
t.OrderBasicInfo.EligibleForSH && ($(".displayAddressAddressLine1").text() + " " + $(".displayAddressAddressLine2").text()).trim().toLowerCase() != p && (b = !1);
b && $(".displayAddressFullName").text().trim().toLowerCase() == t.OrderShippingAddress.Name.trim().toLowerCase() ? (a = !1, $("#spc-orders .a-box .a-box-inner .shipping-group .item-details-right-column .a-row .a-size-small").each(function(n, t) {
if ($(t).text().trim().toLowerCase().indexOf("used") > -1) {
a = !0;
return
}
}), e = [], $("input[name='dupOrderCheckArgs']").each(function() {
var n = $(this).val();
asinPos = n.split("|");
var t = asinPos[0],
i = asinPos[1],
r = {
ASIN: t,
Quantity: parseInt(i)
};
e.push(r)
}), o = [], $.each(t.Products, function(n, t) {
o.push({
ASIN: t.ASIN,
Quantity: t.Quantity
})
}), a ? (PU.alert("error", "<strong>" + PU.L.IsUsed + "<\/strong>", !1), PU.highlighterOn$$("#sllrrnng-extension-alert-container div", 10)) : JSON.stringify(e) == JSON.stringify(o) ? (PU.alert("info", PU.L.ReviewYourOrderDetails, !1), PU.highlighterOn$$("#sllrrnng-extension-alert-container div", 10)) : (PU.alert("error", "<strong>" + PU.L.Warning + ": <\/strong>" + PU.L.CheckYourBasket, !1), PU.highlighterOn$$("#sllrrnng-extension-alert-container div", 10))) : (t.OrderBasicInfo.EligibleForSH && $("input[name=placeYourOrder1]").val(PU.L.WareHouseWarningButton), b ? (PU.alert("error", "<strong>" + PU.L.Attention + ": <\/strong>" + PU.L.RecipientNameDoesntMatch, !1), PU.highlighterOn$$("#sllrrnng-extension-alert-container div", 10)) : (PU.alert("error", "<strong>" + PU.L.Attention + ": <\/strong>" + PU.L.RecipientAdressDoesntMatch, !1), PU.highlighterOn$$("#sllrrnng-extension-alert-container div", 10)), PU.highlighter(".displayAddressDiv"), PU.scrollTop(".displayAddressDiv", 10))
}
} else {
if (PU.autoOrdering.addressSelect() && PU.autoOrdering.getOrderInformation())
if (PU.log("enter shipping address"), n = PU.autoOrdering.getOrderInformation(), n.OrderBasicInfo.EligibleForSH)
if (PU.autoOrdering.changeOrderShippingAddressSH(0, !1), n.SHWareHouse.length > 1) {
for ($("#sllrrnng-autoordering-warehouse-row", $$).show(), c = "", i = 0; i < n.SHWareHouse.length; i++) c += "<option value='" + n.SHWareHouse[i].Id + "'>" + n.SHWareHouse[i].Name + "<\/option>";
$("#sllrrnng-autoordering-warehouse-choose", $$).html(c);
$("#sllrrnng-autoordering-warehouse-choose", $$).change(function() {
for (var i = $(this).val(), t = 0; t < n.SHWareHouse.length; t++) n.SHWareHouse[t].Id == i && PU.autoOrdering.changeOrderShippingAddressSH(t, !1)
})
} else PU.triggerClickIfAutomationOn("#address-ui-widgets-form-submit-button input[class='a-button-input']", 2);
else console.log(3), PU.scrollTop(".enter-address-form, #address-ui-checkout-form"), $("select#address-ui-widgets-countryCode option, select#address-ui-widgets-countryCode-dropdown-nativeId option, #enterAddressCountryCode option").each(function() {
$(this).val() === n.OrderShippingAddress.CountryCode && $("select#address-ui-widgets-countryCode, select#address-ui-widgets-countryCode-dropdown-nativeId, #enterAddressCountryCode").val($(this).val())
}), PU.simulateEvents($("select#address-ui-widgets-countryCode, select#address-ui-widgets-countryCode-dropdown-nativeId, #enterAddressCountryCode")[0], "change", 1), setTimeout(function() {
$("#address-ui-widgets-enterAddressFullName, #enterAddressFullName, input[name='address-ui-widgets-enterAddressFullName']").val(n.OrderShippingAddress.Name);
$("#address-ui-widgets-enterAddressLine1, #enterAddressAddressLine1, input[name='address-ui-widgets-enterAddressLine1']").val(n.OrderShippingAddress.AddressLine1);
$("#address-ui-widgets-enterAddressLine2, #enterAddressAddressLine2, input[name='address-ui-widgets-enterAddressLine2']").val(n.OrderShippingAddress.AddressLine2);
$("#address-ui-widgets-enterAddressCity, #enterAddressCity, input[name='address-ui-widgets-enterAddressCity']").val(n.OrderShippingAddress.City);
$("#address-ui-widgets-enterAddressDistrictOrCounty, #enterAddressDistrictOrCounty").val(n.OrderShippingAddress.StateOrRegion);
$("#address-ui-widgets-enterAddressStateOrRegion, #enterAddressStateOrRegion, select[name='address-ui-widgets-enterAddressStateOrRegion']").val(n.OrderShippingAddress.StateOrRegion);
$("#address-ui-widgets-enterAddressPostalCode, #enterAddressPostalCode, input[name='address-ui-widgets-enterAddressPostalCode']").val(n.OrderShippingAddress.PostalCode);
try {
PU.simulateInput($("#address-ui-widgets-enterAddressPostalCode, #enterAddressPostalCode, input[name='address-ui-widgets-enterAddressPostalCode']")[0], n.OrderShippingAddress.PostalCode)
} catch (t) {}
$("#address-ui-widgets-enterAddressPhoneNumber, #enterAddressPhoneNumber, input[name='address-ui-widgets-enterAddressPhoneNumber']").val(n.OrderShippingAddress.Phone);
try {
setTimeout(function() {
PU.simulateInput($("#address-ui-widgets-enterAddressPhoneNumber, #enterAddressPhoneNumber, input[name='address-ui-widgets-enterAddressPhoneNumber']")[0], n.OrderShippingAddress.Phone)
}, 500)
} catch (t) {}
$("#address-ui-widgets-addr-details-address-instructions").val(n.OrderShippingAddress.DeliveryInstructions);
$("textarea#AddressInstructions, textarea#address-ui-widgets-addr-details-address-instructions").val(n.OrderShippingAddress.DeliveryInstructions);
setTimeout(function() {
$("select#address-ui-widgets-enterAddressCity-dropdown-nativeId").val(n.OrderShippingAddress.City);
$("select#address-ui-widgets-enterAddressCity-dropdown-nativeId").parent().find(".a-dropdown-prompt").text(n.OrderShippingAddress.City);
PU.simulateEvents($("select#address-ui-widgets-enterAddressCity-dropdown-nativeId")[0], "change", 0);
$("select#address-ui-widgets-enterAddressLine2SelectNative option").each(function() {
$(this).val() === n.OrderShippingAddress.AddressLine2 && $("select#address-ui-widgets-enterAddressLine2SelectNative").val($(this).val())
});
PU.simulateEvents($("select#address-ui-widgets-enterAddressLine2SelectNative")[0], "change", 0)
}, 2e3);
$("select#address-ui-widgets-enterAddressStateOrRegion-dropdown-nativeId option, select[name='address-ui-widgets-enterAddressStateOrRegion'] option").each(function() {
$(this).val() === n.OrderShippingAddress.StateOrRegion && $("select#address-ui-widgets-enterAddressStateOrRegion-dropdown-nativeId, select[name='address-ui-widgets-enterAddressStateOrRegion']").val($(this).val())
});
PU.simulateEvents($("select#address-ui-widgets-enterAddressStateOrRegion-dropdown-nativeId, select[name='address-ui-widgets-enterAddressStateOrRegion']")[0], "change", 0);
setTimeout(function() {
n.OrderShippingAddress.CountryCode == "MX" && PU.triggerClick("input[name='address-ui-widgets-enterAddressPostalCode-submit']", 0)
}, 800);
setTimeout(function() {
n.OrderShippingAddress.CountryCode == "MX" && (PU.triggerClick("input[name='address-ui-widgets-enterAddressPostalCode-submit']", 0), PU.triggerClickIfAutomationOn("input[name='shipToThisAddress'], span#address-ui-widgets-form-submit-button input", 2))
}, 800);
n.OrderBasicInfo.IsShippingAddressEmpty ? ($("#sllrrnng-orderdetail-shipping-details", $$).hide(), $("#sllrrnng-orderdetail-shipping-details-warning", $$).show()) : PU.triggerClickIfAutomationOn("input[name='shipToThisAddress'], span#address-ui-widgets-form-submit-button input", 2)
}, 3e3);
if (PU.autoOrdering.verifyShippingAddress() && (PU.log("verify shipping address"), n = PU.autoOrdering.getOrderInformation(), setTimeout(function() {
if (PU.userToken.VerifyAddressAlwaysOriginal) PU.triggerClickIfAutomationOn("input#address-ui-widgets-original-address-block_id-input", 1), PU.triggerClickIfAutomationOn("input[name='address-ui-widgets-saveOriginalOrSuggestedAddress']", 1);
else {
var n = $("input[name='useSelectedAddress']").val().trim();
PU.alert("warning", PU.L.VerifyAddressAndContinue.replace("{{Name}}", n), !1);
PU.highlighter(".a-spacing-double-large")
}
}, 6e3)), PU.autoOrdering.giftPage() && PU.autoOrdering.getOrderInformation() && (PU.log("giftPage"), n = PU.autoOrdering.getOrderInformation(), $("textarea").val(n.OrderBasicInfo.DefaultGiftNote), $(".sender-name-text-input").val(n.OrderBasicInfo.DefaultGiftNoteSender), PU.autoOrdering.isAutomationOn() && (PU.log("click save gift options"), PU.triggerClickIfAutomationOn("div.save-gift-button-box input[type='submit']:first()", 1))), PU.autoOrdering.shipOptionSelect() && PU.autoOrdering.isAutomationOn() && PU.autoOrdering.getOrderInformation() && (PU.log("shipping option select"), n = PU.autoOrdering.getOrderInformation(), PU.triggerClickIfAutomationOn("span.continue-button input.a-button-text:first()", 2)), PU.autoOrdering.itemCantBeShipped() && PU.autoOrdering.getOrderInformation()) {
PU.log("itemCantBeShipped");
var v = $("span.alertMessage:first()").parent().parent().prev(),
s = v.find("input[name*='asin']").val(),
u = v.find("input[name*='merchantID']").val(),
n = PU.autoOrdering.getOrderInformation();
PU.autoOrdering.hideAutoSwitchRow();
u != undefined && PU.alert("warning", "<strong>" + PU.L.ThereIsAProblem + ": <\/strong>" + PU.L.CannotSendToCustomer.replace("{{Asin}}", s).replace("{{MerchantId}}", u))
}
if (PU.autoOrdering.paySelect() && PU.autoOrdering.getOrderInformation() && (PU.log("payment select"), n = PU.autoOrdering.getOrderInformation(), n.UserCCModel.IsActive ? (PU.log("user cc is active"), rt = setInterval(function() {
var t = $("span:contains('ending in " + n.UserCCModel.Last4Digits + "')").parents(".payment-row, .pmts-instrument-box").first().find("input[name='paymentMethod'], input[name='ppw-instrumentRowSelection']").first(),
i;
t.length && (PU.triggerClick(t, 1), i = $("input#addCreditCardNumber[placeholder='ending in " + n.UserCCModel.Last4Digits + "'], div.apx-add-credit-card-number input[placeholder='ending in " + n.UserCCModel.Last4Digits + "']"), i.length && (PU.alert("info", PU.L.TheCreditCardNumberIsEnteredAutomatically, !1), i.val(n.UserCCModel.CC), PU.triggerClick($("input#confirm-card, .pmts-selected .pmts-button-input button").first(), 2)), PU.autoOrdering.isAutomationOn() && !PU.userToken.AlwaysStopAtCredirCardSelection && PU.triggerClickIfAutomationOn($("input#continue-top, input[name='ppw-widgetEvent:SetPaymentPlanSelectContinueEvent'], .pmts-credit-card-row span.pmts-button-input input").first(), 3), PU.log("user cc is active ccInterval paymentRow: " + t.length))
}, 3e3), PU.autoOrdering.isAutomationOn() && !PU.userToken.AlwaysStopAtCredirCardSelection && PU.triggerClickIfAutomationOn("input#continue-top, input[name='']", 6)) : ($(".payment-selected input#addCreditCardNumber").length ? (PU.alert("warning", PU.L.EnterCCInfoAndContinue.replace("{{Name}}", $("#continue-top").val()), !1), PU.highlighter("#existing-payment-methods")) : $(".payment-selected input[name='paymentMethod']:checked").length || (PU.alert("warning", PU.L.EnterCCInfoAndContinue.replace("{{Name}}", $("#continue-top").val()), !1), PU.highlighter("#existing-payment-methods")), PU.autoOrdering.isAutomationOn() && !PU.userToken.AlwaysStopAtCredirCardSelection && PU.triggerClickIfAutomationOn("input#continue-top, span.pmts-button-input input", 1))), PU.autoOrdering.checkoutFinal() && PU.autoOrdering.getOrderInformation()) {
PU.log("checkout");
var t = PU.autoOrdering.getOrderInformation(),
y = 0,
f = "";
if (f = $("td[data-field='price']").length ? $("td[data-field='price']").html().trim() : $("td.grand-total-price").html().trim(), l = $("tr td span:contains('Gift')").parent().siblings().first().html(), (f.length || l.length) && (y = parseFloat(PU.priceFormat(f)) + parseFloat(PU.priceFormat(l)), t.OrderBasicInfo.GrandTotalPrice = y, PU.autoOrdering.updateLocalStore(t)), p = (t.OrderShippingAddress.AddressLine1 + " " + t.OrderShippingAddress.AddressLine2).toLowerCase().trim(), w = !0, t.OrderBasicInfo.EligibleForSH && ($("#desktop-shipping-address-div .displayAddressAddressLine1").text() + " " + $("#desktop-shipping-address-div .displayAddressAddressLine2").text()).trim().toLowerCase() != p && (w = !1), w && $("#desktop-shipping-address-div .displayAddressFullName").text().trim().toLowerCase() == t.OrderShippingAddress.Name.trim().toLowerCase()) {
a = !1;
$("#spc-orders .shipping-group div.a-size-small").each(function(n, t) {
if ($(t).text().trim().toLowerCase().indexOf("used") > -1) {
a = !0;
return
}
});
e = [];
$("input[name='dupOrderCheckArgs']").each(function() {
var n = $(this).val();
asinPos = n.split("|");
var t = asinPos[0],
i = asinPos[1],
r = {
ASIN: t,
Quantity: parseInt(i)
};
e.push(r)
});
o = [];
$.each(t.Products, function(n, t) {
o.push({
ASIN: t.ASIN,
Quantity: t.Quantity
})
});

function n(n, t) {
var i = n.ASIN.toLowerCase(),
r = t.ASIN.toLowerCase();
return i < r ? -1 : i > r ? 1 : 0
}
o.sort(n);
e.sort(n);
a ? (PU.alert("error", "<strong>" + PU.L.IsUsed + "<\/strong>", !1), PU.highlighterOn$$("#sllrrnng-extension-alert-container div", 10)) : JSON.stringify(e) == JSON.stringify(o) ? (PU.alert("info", PU.L.ReviewYourOrderDetails, !1), PU.highlighterOn$$("#sllrrnng-extension-alert-container div", 10)) : (PU.alert("error", "<strong>" + PU.L.Warning + ": <\/strong>" + PU.L.CheckYourBasket, !1), PU.highlighterOn$$("#sllrrnng-extension-alert-container div", 10))
} else t.OrderBasicInfo.EligibleForSH && $("input[name=placeYourOrder1]").val(PU.L.WareHouseWarningButton), w ? (PU.alert("error", "<strong>" + PU.L.Attention + ": <\/strong>" + PU.L.RecipientNameDoesntMatch, !1), PU.highlighter("#desktop-shipping-address-div")) : (PU.alert("error", "<strong>" + PU.L.Attention + ": <\/strong>" + PU.L.RecipientAdressDoesntMatch, !1), PU.highlighter("#desktop-shipping-address-div")), PU.highlighterOn$$("#sllrrnng-extension-alert-container div", 10)
}
}
try {
$$.querySelector("#shippingAddressDoesntMatch").addEventListener("click", function() {
PU.log("shippingAddressDoesntMatch button clicked");
PU.callUserAPI({
Action: "AutoOrderingSwitch",
IsChecked: !1
}, !0);
document.location.href = "/gp/buy/addressselect/handlers/display.html?hasWorkingJavascript=1"
})
} catch (ft) {}
}
},
init: function() {
PU.autoOrdering.isAutoOrderingOn() && PU.autoOrdering.turnOnTheWidget();
$("#sllrrnng-autoordering-switch", $$).change(function() {
var t = PU.autoOrdering.getOrderInformation(),
n;
PU.autoOrdering.updateLocalStore(t);
n = $(this).is(":checked");
PU.callUserAPI({
Action: "AutoOrderingSwitch",
IsChecked: n
}, !0);
n && setTimeout(function() {
PU.autoOrdering.runSteps()
}, 250)
});
try {
$$.querySelector("#sllrrnng-orderdetail-retrieve-address-button").addEventListener("click", function() {
PU.log("retrive address information button clicked");
var n = PU.autoOrdering.getOrderInformation();
PU.autoOrdering.loadAutoOrderingPage(n.AmazonOrderId, !0);
n = PU.autoOrdering.getOrderInformation();
n.OrderBasicInfo.IsShippingAddressEmpty ? alert(PU.L.AddressNotFoundPleaseTryAgain) : PU.autoOrdering.runSteps()
})
} catch (n) {}
try {
$$.querySelector("#sllrrnng-extension-cancel-ordering-button").addEventListener("click", function() {
PU.log("cancel button clicked");
PU.autoOrdering.removeOrderInformation();
PU.goToPageWithAppOpen("/gp/css/homepage.html")
})
} catch (n) {}
}
},
productSearch: {
productList: [],
crawlerStartPageNumber: 0,
crawlerEndPageNumber: 0,
count503Errors: 0,
count500Errors: 0,
currentPageNumber: 0,
stopCrawling: !1,
selectedMarketplaceId: 0,
marketplaces: [{
Id: 1,
CountryName: "United States",
CountryCode: "US"
}, {
Id: 2,
CountryName: "Canada",
CountryCode: "CA"
}, {
Id: 3,
CountryName: "Mexico",
CountryCode: "MX"
}, {
Id: 4,
CountryName: "England",
CountryCode: "GB"
}, {
Id: 5,
CountryName: "Germany",
CountryCode: "DE"
}, {
Id: 6,
CountryName: "France",
CountryCode: "FR"
}, {
Id: 7,
CountryName: "Italy",
CountryCode: "IT"
}, {
Id: 8,
CountryName: "Spain",
CountryCode: "ES"
}, {
Id: 9,
CountryName: "United Arab Emirates",
CountryCode: "AE"
}, {
Id: 10,
CountryName: "Australia",
CountryCode: "AU"
}, {
Id: 11,
CountryName: "Japan",
CountryCode: "JP"
}, {
Id: 12,
CountryName: "Singapore",
CountryCode: "SG"
}, {
Id: 13,
CountryName: "Saudi Arabia",
CountryCode: "SA"
}, {
Id: 14,
CountryName: "Egypt",
CountryCode: "EG"
}, {
Id: 15,
CountryName: "Poland",
CountryCode: "Poland"
}, {
Id: 16,
CountryName: "Sweden",
CountryCode: "SE"
}, {
Id: 17,
CountryName: "Netherlands",
CountryCode: "NL"
}],
getMarketplaceById: function(n) {
return this.marketplaces.find(function(t) {
return t.Id == n
})
},
getMarketplaceByCountryCode: function(n) {
return this.marketplaces.find(function(t) {
return t.CountryCode == n
})
},
getSelectedMarketplace: function() {
return this.getMarketplaceById(this.selectedMarketplaceId)
},
isProductSearchActive: location.href.indexOf(".amazon.ca/s?") > -1 || location.href.indexOf(".amazon.com.mx/s?") > -1 || location.href.indexOf(".amazon.co.uk/s?") > -1 || location.href.indexOf(".amazon.de/s?") > -1 || location.href.indexOf(".amazon.fr/s?") > -1 || location.href.indexOf(".amazon.it/s?") > -1 || location.href.indexOf(".amazon.es/s?") > -1 || location.href.indexOf(".amazon.ae/s?") > -1 || location.href.indexOf(".amazon.com.au/s?") > -1 || location.href.indexOf(".amazon.co.jp/s?") > -1 || location.href.indexOf(".amazon.jp/s?") > -1 || location.href.indexOf(".amazon.sg/s?") > -1 || location.href.indexOf(".amazon.sa/s?") > -1 || location.href.indexOf(".amazon.eg/s?") > -1 || location.href.indexOf(".amazon.pl/s?") > -1 || location.href.indexOf(".amazon.se/s?") > -1 || location.href.indexOf(".amazon.nl/s?") > -1 || location.href.indexOf("/s/") > -1 || location.href.indexOf("/s?") > -1 || location.href.indexOf("/gp/search/") > -1 || location.href.indexOf("/b/") > -1,
productSearchNotActive: function(n) {
var t = "";
n == "HasActivePackage" ? t = PU.L.DontHaveActivePackage : PU.autoOrdering.isAutoOrderingOn() || n != "ProductInQLimit" ? PU.autoOrdering.isAutoOrderingOn() || n != "InsertCountLimit" || (t = PU.L.YouHaveExceededTheDailyProductAddingLimit) : t = PU.L.TheNumberOfItemsWaitingInTheQueueIsTooMuch;
t != null && t != "" && (PU.alert("error", t), $("#sllrrnng-ps-search-button", $$).prop("disabled", !0), $("#sllrrnng-ps-search-button", $$).addClass("disabled"))
},
changeDeliverToAddressForOrdering: function(n) {
var t = this.getMarketplaceById(n),
i;
PU.log("CountryName: " + t.CountryName + ", CountryCode: " + t.CountryCode);
i = PU.post(location.origin + "/gp/delivery/ajax/address-change.html", {
locationType: "COUNTRY",
district: t.CountryName,
countryCode: t.CountryCode,
storeContext: "gateway",
deviceType: "web",
pageType: "Search",
actionSource: "glow"
}, !1);
try {
i.isValidAddress && ($("#nav-global-location-slot span.nav-line-2").text(t.CountryName), $("#nav-global-location-slot span.nav-line-1").text("Deliver to"))
} catch (r) {}
},
changeDeliverToAddress: function(n) {
var t, i;
PU.productSearch.selectedMarketplaceId = n;
t = this.getSelectedMarketplace();
PU.log("CountryName: " + t.CountryName + ", CountryCode: " + t.CountryCode);
mplaceId = PU.getParameterByName("sllrrnng-marketplaceId", location.href);
i = location.href.replace("&sllrrnng-marketplaceId=" + mplaceId, "&sllrrnng-marketplaceId=" + n);
history.pushState(null, "", i)
},
amazon503ErrorWarning: function() {
$("#sllrrnng-crawling-info-loader", $$).hide();
$("#sllrrnng-crawling-stop-button", $$).text(PU.L.Upload);
var n = PU.L.Amazon503ErrorWarning.replace("{{Quantity}}", PU.productSearch.productList.length);
PU.alert("error", n, !1, 0, "#sllrrnng-crawling-info-alert-container")
},
extractASINFromUrl: function(n) {
var t = new RegExp("/dp/(.*)/|/dp/(.*)\\?");
return results = t.exec(n), results[1] != undefined ? results[1] : results[2] != undefined ? results[2] : undefined
},
startCrawling: function() {
var i = PU.getParameterByName("page", e),
f;
i == null && (i = 1);
var s = parseInt(i),
e = PU.updateQueryStringParameter(location.href, "page", s),
r = "",
o = $("#sllrrnng-ps-page-start", $$),
u = $("#sllrrnng-ps-page-end", $$),
n = parseInt(o.val()),
t = parseInt(u.val());
if (n == t) {
PU.alert("error", PU.L.EndPageMustBeGreaterThanStartingPage, !1, 5);
return
}
if (n > t) {
PU.alert("error", PU.L.EnterEndingNumberHigherThanStartingNumber, !1, 5);
u.focus();
return
}
n <= 0 && (n = 1, o.val(n));
t > 400 && (t = 400, u.val(t));
PU.productSearch.crawlerStartPageNumber = n;
PU.productSearch.crawlerEndPageNumber = t;
r = PU.updateQueryStringParameter(e, "page", n);
PU.log("startUrlWithPageNumber: " + r);
$("#sllrrnng-product-research .sllrrnng-crawling-info", $$).addClass("show");
f = this.getSelectedMarketplace();
$("#sllrrnng-crawling-info-marketplace", $$).text(f.CountryName + " (." + f.CountryCode + ")");
this.progressBarSetValue(0);
PU.scrollTop("#navbar");
this.collectProductASINs(r)
},
collectProductASINs: function(n) {
$.get(n, function(t) {
var r, e, i, u, f;
if (PU.productSearch.count500Errors = 0, currentPageProductList = 0, PU.productSearch.stopCrawling && PU.productSearch.count503Errors > 1) {
PU.productSearch.amazon503ErrorWarning();
return
}
if (!PU.productSearch.stopCrawling) {
if (r = $(t), r.find("form[action='/errors/validateCaptcha']").length) {
PU.productSearch.amazon503ErrorWarning();
return
}
e = t.match(new RegExp('data-asin="([^"]*)"'));
r.find("#resultsCol [data-asin], div.s-main-slot [data-asin]").each(function() {
var t = $(this).find("i.a-icon-addon:not(.sx-bestseller-badge-primary)").length,
i = $(this).find(".s-sponsored-label-text").length,
n = $(this).data("asin");
t || i ? PU.log(n + " is an addon item.") : PU.productSearch.productList.indexOf(n) == -1 && (PU.productSearch.productList.push(n), currentPageProductList++)
});
PU.productSearch.currentPageNumber == 0 && (i = PU.getParameterByName("page", n), i == null && (i = 1), PU.productSearch.currentPageNumber = parseInt(i));
PU.log("currentPageNumber: " + PU.productSearch.currentPageNumber);
PU.log("currentPageNumber: " + PU.productSearch.currentPageNumber, PU.productSearch.productList.length);
PU.productSearch.showCrawlingInfo(PU.productSearch.currentPageNumber, PU.productSearch.productList.length);
PU.productSearch.currentPageNumber == PU.productSearch.crawlerEndPageNumber || currentPageProductList == 0 ? PU.productSearch.endCrawling() : (u = PU.updateQueryStringParameter(n, "page", PU.productSearch.currentPageNumber), PU.log("currentUrl", u), PU.productSearch.currentPageNumber++, f = PU.replaceUrlParam(u, "page", PU.productSearch.currentPageNumber), PU.log("nextPageUrl", f), PU.productSearch.collectProductASINs(f))
}
}).fail(function(t) {
t.status == 503 ? (PU.productSearch.count503Errors++, PU.productSearch.count503Errors > 1 && (PU.productSearch.stopCrawling = !0)) : t.status == 500 && (PU.productSearch.count500Errors++, PU.productSearch.count500Errors < 3 && PU.productSearch.collectProductASINs(n))
})
},
endCrawling: function() {
PU.productSearch.stopCrawling = !0;
PU.log("collecting asin finished: " + PU.productSearch.productList.length);
PU.productSearch.progressBarSetValue(100);
PU.productSearch.productList.length > 0 ? (this.hideProgressBar(), PU.log("product search ends"), PU.alert("success", PU.L.ProductSearchCompleted.replace("{{Count}}", PU.productSearch.productList.length), !1, !1, "#sllrrnng-crawling-info-container-start"), setTimeout(function() {
var t, n;
if (PU.log("posting data: " + PU.productSearch.productList.length), t = $(".sllrrnng-ps-filter-form", $$).find("input,select").serializeFormJSON("PSFilterInputs."), PU.callUserAPI({
Action: "UserProductResearch",
PageUrl: location.href,
Keyword: PU.getParameterByName("k", location.href),
StartPageNumber: PU.productSearch.crawlerStartPageNumber,
EndPageNumber: PU.productSearch.crawlerEndPageNumber,
SelectedMarketplaceId: PU.productSearch.selectedMarketplaceId
}, !0), n = PU.callUserAPI({
Action: "SaveProductList",
ProductList: PU.productSearch.productList,
PSFilterInputs: t,
SelectedMarketplaceId: PU.productSearch.selectedMarketplaceId,
TempSKU: $("#sllrrnng-ps-temp-sku", $$).val()
}, !1), n.Error) {
PU.log("error occured while posting");
n.AbilityToSubmitListingsTemporarilyRemoved || PU.alert("error", PU.L.AbilityToSubmitListingsTemporarilyRemoved, !1, !1, "#sllrrnng-crawling-info-container-start");
n.UnableToAccessAmazonAccount || PU.alert("error", PU.L.UnableToAccessAmazonAccount, !1, !1, "#sllrrnng-crawling-info-container-start");
n.DontHaveActivePackage || PU.alert("error", PU.L.DontHaveActivePackage, !1, !1, "#sllrrnng-crawling-info-container-start");
n.ProductInQLimit && PU.alert("error", PU.L.TheNumberOfItemsWaitingInTheQueueIsTooMuch, !1, !1, "#sllrrnng-crawling-info-container-start");
return
}
setTimeout(function() {
$("#sllrrnng-crawling-info-container-start", $$).hide();
$("#sllrrnng-crawling-info-container-end", $$).show()
}, 3e3)
}, 500)) : PU.goToPageWithAppOpen()
},
showCrawlingInfo: function(n, t) {
var i = n / this.crawlerEndPageNumber * 100;
this.progressBarSetValue(i);
$("#sllrrnng-crawling-info-products", $$).text(t);
$("#sllrrnng-crawling-info-pages", $$).text(this.crawlerStartPageNumber + "-" + this.crawlerEndPageNumber);
$("#sllrrnng-crawling-info-currentpage", $$).text(n);
PU.log("crawling %" + i + " completed.")
},
progressBarSetValue: function(n) {
var t = $("#sllrrnng-crawling-progress-bar", $$);
t.css("width", n + "%")
},
hideProgressBar: function() {
$("#sllrrnng-crawling-progress-bar", $$).hide()
},
runAmazonFilterDemo: function() {
if (PU.productSearch.isProductSearchActive) PU.scrollTop("#leftNavContainer, #s-refinements", 10), PU.highlighter("#leftNavContainer, #s-refinements", 5);
else {
var n = location.origin + "/s/?keywords=wine+stoppers&ref=?&sllrrnng-ref=search-box";
window.open(n, "_blank")
}
},
init: function() {
function i(n, t) {
var r = n.is(":checked"),
i = $("#" + n.attr("id") + "-dz", $$);
t != null && t != "" && i.val(t);
i.prop("disabled", !r)
}

function n(n, t, r) {
var u = $(n, $$);
u.prop("checked", t);
i(u, r)
}
var t;
try {
$('[data-toggle="read-confirm"]', $$).change(function() {
if ($(this).is(":checked")) {
var n = $(this).data("read-confirm-title"),
t = $(this).data("read-confirm-content"),
i = $(this).data("read-confirm-btntext");
PU.confirmPopup("warning", n, t, i)
}
})
} catch (e) {}
try {
$$.querySelector("#sllrrnng-ps-lnkamznfltrs").addEventListener("click", function() {
PU.productSearch.runAmazonFilterDemo()
})
} catch (e) {}
$("#sllrrnng-ps-temp-sku", $$).keypress(function(n) {
var t = n.which;
return t == 32 || n.key === " " || n.key === "Spacebar" ? !1 : 48 <= t && t <= 57 ? !0 : 65 <= t && t <= 90 ? !0 : 97 <= t && t <= 122 ? !0 : !1
});
try {
$$.querySelector("#sllrrnng-ps-search-button").addEventListener("click", function() {
var n, t, i;
$("#sllrrnng-ps-search-button", $$).prop("disabled", !0);
PU.log("Search button clicked");
n = $("#sllrrnng-ps-marketplace", $$).val();
t = $("#sllrrnng-ps-marketplace option:selected", $$).text();
$("#sllrrnng-marketplacename", $$).text(t);
i = PU.getParameterByName("me");
chrome.runtime.sendMessage({
name: "get-json",
"async": !1,
url: PU.sessionDomain + "/sllrrnng-extension/token/?marketplaceId=" + n + "&merchantId=" + i
}, function(t) {
if (t.status == 200)
if (PU.isServiceRunning = !0, PU.userToken = t.data, $("#sllrrnng-ps-search-button", $$).prop("disabled", !1), PU.productSearch.isProductSearchActive) PU.productInsertStatusFromAPI ? $("#sllrrnng-ps-filter-by-numberofsellers", $$).is(":checked") && $("#sllrrnng-ps-filter-by-numberofsellers-dz", $$).val() < 2 ? (PU.log("MaxOfferCountEnterWarning alert"), PU.alertPopup("error", PU.L.MaxOfferCountEnterWarning)) : $("#sllrrnng-ps-filter-by-numberofsellers-min", $$).is(":checked") && $("#sllrrnng-ps-filter-by-numberofsellers-min-dz", $$).val() < 1 ? (PU.log("MinOfferCountEnterWarning alert"), PU.alertPopup("error", PU.L.MinOfferCountEnterWarning)) : PU.userToken.AbilityToSubmitListings ? PU.userToken.AmazonAPIAccess ? PU.userToken.HasActivePackage ? PU.userToken.InsertCountLimit ? PU.alertPopup("error", PU.L.YouHaveExceededTheDailyProductAddingLimit) : PU.userToken.ProductInQLimit ? PU.alertPopup("error", PU.L.TheNumberOfItemsWaitingInTheQueueIsTooMuch) : PU.userToken.IsMerchantBelongUs ? (PU.productSearch.changeDeliverToAddress(n), PU.errorOccurred || PU.productSearch.startCrawling()) : PU.alertPopup("error", PU.L.MerchantBelongUsAlertMessage) : PU.alertPopup("error", PU.L.DontHaveActivePackage) : PU.alertPopup("error", PU.L.UnableToAccessAmazonAccount) : PU.alertPopup("error", PU.L.AbilityToSubmitListingsTemporarilyRemoved) : (PU.log("productInsertStatus: false"), PU.alertPopup("error", PU.L.UnableToInsertBOProductInsertStatus));
else {
var i = $("#sllrrnng-ps-search-keyword", $$).val();
if (i == "" || i == null) {
$("#sllrrnng-ps-search-keyword", $$).focus();
return
}
location.href = location.origin + "/s/?keywords=" + i + "&ref=?&sllrrnng-ref=search-box&sllrrnng-marketplaceId=" + n
}
else PU.alert("error", "", !0)
})
})
} catch (e) {}
try {
$$.querySelector(".sllrrnng-crawling-cancel-button").addEventListener("click", function() {
PU.log("cancel button clicked");
PU.productSearch.stopCrawling = !0;
PU.goToPageWithAppOpen()
})
} catch (e) {}
try {
$$.querySelector(".sllrrnng-crawling-cancel-button2").addEventListener("click", function() {
PU.log("cancel button clicked");
PU.productSearch.stopCrawling = !0;
PU.goToPageWithAppOpen()
})
} catch (e) {}
try {
$$.querySelector("#sllrrnng-crawling-stop-button").addEventListener("click", function() {
PU.log("stop button clicked");
PU.productSearch.stopCrawling = !0;
PU.productSearch.endCrawling()
})
} catch (e) {}
try {
$("#sllrrnng-ps-marketplace", $$).change(function() {
if (PU.productSearch.isProductSearchActive) {
var i = $(this).val(),
t = PU.callUserAPI({
Action: "SelectedMarketplaceChangeEvent",
SelectedMarketplaceId: i
}, !1);
PU.log("SelectedMarketplaceChangeEvent -> marketplaceId: " + i);
PU.log(t);
t == 0 ? PU.alert("error", "", !1) : (n("#sllrrnng-ps-trademark-switch", t.PSFilterInputs.TrademarkProtection, t.PSFilterInputs.TrademarkProtectionDeleteOrZero), n("#sllrrnng-ps-only-fba-products", t.PSFilterInputs.OnlyFBAProducts, t.PSFilterInputs.OnlyFBAProductsDeleteOrZero), n("#sllrrnng-ps-only-sh-products", t.PSFilterInputs.OnlySHProducts, t.PSFilterInputs.OnlySHProductsDeleteOrZero), n("#sllrrnng-ps-filter-discounted-products", t.PSFilterInputs.FilterDiscountedProducts, t.PSFilterInputs.FilterDiscountedProductsDeleteOrZero), n("#sllrrnng-ps-filter-wo-shipping-info", t.PSFilterInputs.FilterWOShippingInformation, t.PSFilterInputs.FilterWOShippingInformationDeleteOrZero), n("#sllrrnng-ps-filter-wo-salesrank-on-amazoncom-info", t.PSFilterInputs.FilterProductsWithoutSalesRankOnAmazonCom, t.PSFilterInputs.FilterProductsWithoutSalesRankOnAmazonComDeleteOrZero), n("#sllrrnng-ps-prime-exclusive-protection", t.PSFilterInputs.PrimeExclusiveUpsellProtection, t.PSFilterInputs.PrimeExclusiveUpsellProtectionDeleteOrZero), n("#sllrrnng-ps-filter-item-doesnt-ship", t.PSFilterInputs.FilterItemDoesNotShip, t.PSFilterInputs.FilterItemDoesNotShipDeleteOrZero), n("#sllrrnng-ps-filter-same-brand-seller-info", t.PSFilterInputs.FilterProductsWithSameBrandSeller, t.PSFilterInputs.FilterProductsWithSameBrandSellerDeleteOrZero), n("#sllrrnng-ps-filter-pw-prime-sellers", t.PSFilterInputs.FilterProductsWithPrimeSellers, t.PSFilterInputs.FilterProductsWithPrimeSellersDeleteOrZero), n("#sllrrnng-ps-filter-by-numberofsellers", t.PSFilterInputs.FilterProductsByMaxOffer, t.PSFilterInputs.FilterProductsByMaxOfferCount), n("#sllrrnng-ps-filter-by-numberofsellers-min", t.PSFilterInputs.FilterProductsByMinOffer, t.PSFilterInputs.FilterProductsByMinOfferCount), n("#sllrrnng-ps-trademark-switch-tous", t.PSFilterInputs.TrademarkProtectionToUS, ""), n("#sllrrnng-ps-trademark-switch-toca", t.PSFilterInputs.TrademarkProtectionToCA, ""), n("#sllrrnng-ps-filter-products-wo-import-fee", t.PSFilterInputs.FilterProductsWOImportFee, t.PSFilterInputs.FilterProductsWOImportFeeDeleteOrZero), n("#sllrrnng-ps-filter-unavailable-products", t.PSFilterInputs.FilterUnavailableProducts, t.PSFilterInputs.FilterUnavailableProductsDeleteOrZero), n("#sllrrnng-ps-filter-chinese-seller", t.PSFilterInputs.FilterHasChineseSeller, t.PSFilterInputs.FilterHasChineseSellerDeleteOrZero), n("#sllrrnng-ps-filter-amazon-seller", t.PSFilterInputs.FilterHasAmazonSeller, t.PSFilterInputs.FilterHasAmazonSellerDeleteOrZero), t.PSFilterInputs.TrademarkProtection ? $("#sllrrnng-ps-actioncb-border", $$).removeClass("sllrrnng-ps-actioncb-border-tall").addClass("sllrrnng-ps-actioncb-border-taller") : $("#sllrrnng-ps-actioncb-border", $$).removeClass("sllrrnng-ps-actioncb-border-taller").addClass("sllrrnng-ps-actioncb-border-tall"), PU.productInsertStatusFromAPI = t.ProductInsertStatus, i == 2 ? $("#sllrrnng-importfee-warning", $$).show() : $("#sllrrnng-importfee-warning", $$).hide(), t.EnableSRH ? $("#sllrrnng-filter-enable-srh", $$).show() : $("#sllrrnng-filter-enable-srh", $$).hide())
}
})
} catch (e) {}
try {
$("#sllrrnng-ps-trademark-switch", $$).change(function() {
var n = $(".trademark-office-selection", $$);
$(this).is(":checked") ? (n.show(), $("#sllrrnng-ps-actioncb-border", $$).removeClass("sllrrnng-ps-actioncb-border-tall").addClass("sllrrnng-ps-actioncb-border-taller")) : ($("#sllrrnng-ps-actioncb-border", $$).removeClass("sllrrnng-ps-actioncb-border-taller").addClass("sllrrnng-ps-actioncb-border-tall"), n.hide())
})
} catch (e) {}
try {
$("#sllrrnng-ps-only-fba-products, #sllrrnng-ps-trademark-switch, #sllrrnng-ps-filter-discounted-products, #sllrrnng-ps-filter-item-doesnt-ship, #sllrrnng-ps-filter-pw-prime-sellers, #sllrrnng-ps-filter-by-numberofsellers, #sllrrnng-ps-filter-by-numberofsellers-min, #sllrrnng-ps-filter-wo-shipping-info, #sllrrnng-ps-filter-wo-salesrank-on-amazoncom-info, #sllrrnng-ps-prime-exclusive-protection, #sllrrnng-ps-filter-same-brand-seller-info, #sllrrnng-ps-filter-products-wo-import-fee, #sllrrnng-ps-only-sh-products, #sllrrnng-ps-filter-unavailable-products, #sllrrnng-ps-filter-chinese-seller, #sllrrnng-ps-filter-amazon-seller", $$).change(function() {
i($(this))
})
} catch (e) {}
try {
if (location.href.indexOf("sellerrunning_____sllrps") > -1) {
t = location.href.replace(/_____/gi, "&");
t = t.replace(/%3D/gi, "=");
t = "https://www.amazon.com/" + t.substring(t.indexOf("sellerrunning"), t.lastIndexOf("&")).replace("sellerrunning", "?_=1");
var r = new URL(t),
u = r.searchParams.get("sllrps"),
f = r.searchParams.get("sllrpe");
$("#sllrrnng-ps-page-start", $$).val(u);
$("#sllrrnng-ps-page-end", $$).val(f)
}
} catch (e) {}
}
},
callUserAPI: function(n, t) {
var i;
return $.ajax({
type: "POST",
"async": t,
url: PU.apiServiceDomain + "/sllrrnng-extension/user/post",
data: JSON.stringify(n),
contentType: "application/json; charset=utf-8",
dataType: "json",
beforeSend: n => n.setRequestHeader(PU.tokenName, this.userToken.AccessToken),
success: function(n) {
i = n
},
error: function() {
PU.alert("error", "", !0)
}
}), i
},
post: function(n, t, i) {
var r;
return chrome.runtime.sendMessage({
name: "post",
url: n,
data: t,
"async": i
}, function(n) {
r = n.data
}), r
},
getMarketplaceIdByPage: function() {
var n = $("#sc-mkt-picker-switcher-select option[selected], div.sc-mkt-switcher-form span.sc-mkt-picker-switcher-txt").text().trim(),
t;
return (n == null || n == "") && (n = $("#partner-switcher").data("marketplace_selection").trim()), t = PU.getMarketplaceItemByDomain(n), t.MarketplaceId
},
getMarketplaceByPage: function() {
var n = $("#sc-mkt-picker-switcher-select option[selected], div.sc-mkt-switcher-form span.sc-mkt-picker-switcher-txt").text().trim();
return (n == null || n == "") && (n = $("#partner-switcher").data("marketplace_selection").trim()), PU.getMarketplaceItemByDomain(n)
},
getMarketplaceItemByDomain: function(n) {
var t = {
AmazonMarketplaceId: "",
MarketplaceId: 0
};
return n == "www.amazon.ca" || n == "A2EUQ1WTGCTBG2" ? (t.AmazonMarketplaceId = "A2EUQ1WTGCTBG2", t.MarketplaceId = 2) : n == "www.amazon.com.mx" || n == "A1AM78C64UM0Y8" ? (t.AmazonMarketplaceId = "A1AM78C64UM0Y8", t.MarketplaceId = 3) : n == "www.amazon.co.uk" || n == "A1F83G8C2ARO7P" ? (t.AmazonMarketplaceId = "A1F83G8C2ARO7P", t.MarketplaceId = 4) : n == "www.amazon.de" || n == "A1PA6795UKMFR9" ? (t.AmazonMarketplaceId = "A1PA6795UKMFR9", t.MarketplaceId = 5) : n == "www.amazon.fr" || n == "A13V1IB3VIYZZH" ? (t.AmazonMarketplaceId = "A13V1IB3VIYZZH", t.MarketplaceId = 6) : n == "www.amazon.it" || n == "APJ6JRA9NG5V4" ? (t.AmazonMarketplaceId = "APJ6JRA9NG5V4", t.MarketplaceId = 7) : n == "www.amazon.es" || n == "A1RKKUPIHCS9HS" ? (t.AmazonMarketplaceId = "A1RKKUPIHCS9HS", t.MarketplaceId = 8) : n == "www.amazon.ae" || n == "A2VIGQ35RCS4UG" ? (t.AmazonMarketplaceId = "A2VIGQ35RCS4UG", t.MarketplaceId = 9) : n == "www.amazon.com.au" || n == "A39IBJ37TRP1C6" ? (t.AmazonMarketplaceId = "A39IBJ37TRP1C6", t.MarketplaceId = 10) : n == "www.amazon.co.jp" || n == "www.amazon.jp" || n == "A1VC38T7YXB528" ? (t.AmazonMarketplaceId = "A1VC38T7YXB528", t.MarketplaceId = 11) : n == "www.amazon.sg" || n == "A19VAU5U5O7RUS" ? (t.AmazonMarketplaceId = "A19VAU5U5O7RUS", t.MarketplaceId = 12) : n == "www.amazon.sa" || n == "A17E79C6D8DWNP" ? (t.AmazonMarketplaceId = "A17E79C6D8DWNP", t.MarketplaceId = 13) : n == "www.amazon.eg" || n == "ARBP9OOSHTCHU" ? (t.AmazonMarketplaceId = "ARBP9OOSHTCHU", t.MarketplaceId = 14) : n == "www.amazon.pl" || n == "A1C3SOZRARQ6R3" ? (t.AmazonMarketplaceId = "A1C3SOZRARQ6R3", t.MarketplaceId = 15) : n == "www.amazon.se" || n == "A2NODRKZP88ZB9" ? (t.AmazonMarketplaceId = "A2NODRKZP88ZB9", t.MarketplaceId = 16) : (n == "www.amazon.nl" || n == "A1805IZSGTT6HS") && (t.AmazonMarketplaceId = "A1805IZSGTT6HS", t.MarketplaceId = 17), t
},
getActiveAmazonMarketplaceIds: function() {
var n = [],
t = $("#sc-mkt-picker-switcher-select option"),
i, r;
return t.length ? t.each(function(t, i) {
var r = PU.getParameterByName("mons_sel_mkid", i.value);
r != null && n.indexOf(n) == -1 && n.push(r)
}) : (i = $("div.sc-mkt-switcher-form span.sc-mkt-picker-switcher-txt").text().trim(), r = PU.getMarketplaceItemByDomain(i), n.push(r.AmazonMarketplaceId)), n
},
loadSCConfirmAction: function(n) {
function t() {
$("#deleteProductFromAmzr").click(function() {
var t = [];
n ? $("#tableBody .item-row").each(function(n, i) {
if ($(i).find("kat-checkbox").attr("checked") != undefined) {
var r = $(i).find("div.asin"),
u = $(r).contents().not($(r).children()).text().trim();
t.push(u)
}
}) : $("div[data-column='asin']").find("span").each(function(n, i) {
var r = $(i).text().trim();
t.push(r)
});
var r = PU.getMarketplaceIdByPage(),
i = "",
u = PU.callUserAPI({
Action: "DeleteProductsViaSellerCentral",
ProductList: t,
SelectedMarketplaceId: r
}, !1);
i = u == 1 ? PU.L.ItemsWereSentToTheDeletionQueue.replace("{{Count}}", t.length) : PU.L.ErrorOccurred;
$(".sllrrnng-alert-content").html(i);
$(".sllrrnng-alert-container-info").remove()
})
}
var i = '<div class="sllrrnng-alert sllrrnng-alert-danger"><div class="sllrrnng-alert-container-info">' + PU.L.BeforeProceedingPleaseRemoveProducts + '<\/div><div class=\'sllrrnng-alert-content\'><a id="deleteProductFromAmzr" href="javascript:;">' + PU.L.DeleteProductsFromAmzrunning + "<\/a><\/div><\/div>",
r;
if (n) {
function n() {
$(document).delegate("div.bulk-container div.select-options div.option, #bulk-delete-listing button, .fyp-bulk-selection-bar-button button, .fyp-bulk-selection-bar-button", "click", function() {
setTimeout(function() {
console.log("setTimeout");
var r = $("kat-modal-content .kat-row, #delete-listing-modal .kat-row").last();
r.find(".sllrrnng-alert").remove();
r.append(i);
n();
t()
}, 500)
})
}
n()
} else $("#interStitialPageMessage").text().toLowerCase().indexOf("delete product and listing") > -1 && (r = $("#interstitialPageWarningAlert .a-alert-content"), r.append(i), t())
},
loadLangFile: function() {
var n = $("x-sellerrunning-script", $$).html();
eval(n)
},
loadLoginPage: function() {
PU.log("login required");
PU.loadPage(PU.sessionDomain + "/sllrrnng-extension/login/?" + PU.random(), !0)
},
loadIndexPage: function() {
PU.log("index - isAuthenticated: " + PU.userToken.IsAuthenticated + ", token: " + PU.userToken.AccessToken);
PU.loadPage(PU.sessionDomain + "/sllrrnng-extension/index/?" + PU.random(), !0)
},
loadSetupRequiredPage: function() {
PU.log("setup-required - isAuthenticated: " + PU.userToken.IsAuthenticated + ", token: " + PU.userToken.AccessToken);
PU.loadPage(PU.sessionDomain + "/sllrrnng-extension/setup-required/?" + PU.random(), !0)
},
loadOrderingPage: function() {
PU.log("isAutoOrderingOn: " + PU.autoOrdering.isAutoOrderingOn());
PU.loadPage(PU.sessionDomain + "/sllrrnng-extension/ordering/?" + PU.random(), !0)
},
loadAccountHealthPage: function() {
PU.log("isAccountHealthOn: " + PU.accountHealth.isAccountHealthOn());
PU.loadPage(PU.sessionDomain + "/sllrrnng-extension/account-health/?" + PU.random(), !0)
},
loadDeleteAddressOnAmazonModelPage: function() {
PU.log("isDeleteAddressOnAmazonModelPage: " + PU.deleteAddressOnAmazon.isDeleteAddressOnAmazonOn());
PU.loadPage(PU.sessionDomain + "/sllrrnng-extension/delete-address-on-amazon/?" + PU.random(), !0)
},
loadCollectTrackingInformationModelPage: function() {
PU.log("isCollectTrackingInformationModelPage: " + PU.collectTrackingInformation.isCollectTrackingInformationOn());
PU.loadPage(PU.sessionDomain + "/sllrrnng-extension/collect-tracking-information/?" + PU.random(), !0)
},
loadFixYourProductsModelPage: function() {
PU.log("loadFixYourProductsModelPage: " + PU.fixYourProducts.isFixYourProductsOn());
PU.loadPage(PU.sessionDomain + "/sllrrnng-extension/fix-your-product/?" + PU.random(), !0)
},
loadPage: function(n) {
chrome.runtime.sendMessage({
name: "post-sllr",
url: n,
tokenName: PU.tokenName,
accessToken: PU.userToken.AccessToken,
"async": !1
}, function(n) {
var i, t, f, u, r, e;
if (n.status == 200) {
var o = "<link rel='stylesheet' href='" + PU.sessionDomain + "/assets/css/extension/fonts.css'>",
s = "<link rel='stylesheet' href='" + PU.sessionDomain + $(n.data).find("#cssfileForAmazon").val() + "'>",
h = "<link rel='stylesheet' href='" + PU.sessionDomain + $(n.data).find("#cssfile").val() + "'>";
$("head").prepend(o);
$("head").prepend(s);
$sllrrnngWidget.inner.innerHTML = h + n.data;
i = location.href;
i.indexOf("sellerrunning") == -1 && i.indexOf("sllrrnng-") == -1 && (i = i + "?&sellerrunning");
$("#returnUrl", $$).val(i);
PU.loadScripts();
t = !1;
PU.userToken.IsAuthenticated ? (PU.isInTheSellerCentral && (f = setInterval(function() {
var n = PU.getMarketplaceIdByPage();
PU.orderDetailToCopyShippingAddress.isOrderDetailToCopyShippingAddressOn() && n == 13 && (PU.orderDetailToCopyShippingAddress.init(), clearInterval(f))
}, 3e3)), PU.cartViewDeletePage.isCartViewDeletePageOn() ? PU.cartViewDeletePage.init() : PU.loginPage.isLoginPageOn() ? PU.loginPage.init() : PU.autoOrdering.isAutoOrderingOn() ? (t = !0, PU.autoOrdering.init(), PU.autoOrdering.loadAutoOrderingPage(null, PU.autoOrdering.basketConfirm()), PU.autoOrdering.runSteps(), u = !1, setInterval(function() {
$("#giftOptions").length && !u && (PU.autoOrdering.runSteps(), u = !0);
PU.currentPage != location.href && (PU.currentPage = location.href, PU.autoOrdering.runSteps())
}, 3e3)) : PU.accountHealth.isAccountHealthOn() ? (t = !0, PU.accountHealth.init()) : PU.fixYourProducts.isFixYourProductsOn() ? (t = !0, PU.fixYourProducts.init(), PU.loadSCConfirmAction(!0)) : PU.deleteAddressOnAmazon.isDeleteAddressOnAmazonOn() ? (t = !0, PU.deleteAddressOnAmazon.init()) : PU.collectTrackingInformation.isCollectTrackingInformationOn() ? (t = !0, PU.collectTrackingInformation.init()) : PU.sellerCentralOrders.isSellerCentralOrdersOn() ? PU.sellerCentralOrders.init() : PU.sellerCentralMessaging.isSellerCentralMessagingOn() ? PU.sellerCentralMessaging.init() : PU.sellerCentralFeedbackManager.isSellerCentralFeedbackManagerOn() ? PU.sellerCentralFeedbackManager.init() : PU.isInSCConfirmAction ? PU.loadSCConfirmAction(!1) : PU.isInSCConfirmActionPivot ? PU.loadSCConfirmAction(!0) : (PU.productSearch.init(), t = !0, PU.productSearch.isProductSearchActive ? ($("#sllrrnng-ps-keyword-row", $$).hide(), $("#sllrrnng-ps-pagerange-row", $$).show(), r = PU.getParameterByName("sllrrnng-marketplaceId"), e = PU.getParameterByName("sllrrnng-ref"), r != "" && r != null && r != undefined && r > 0 ? $("#sllrrnng-ps-marketplace", $$).val(r).change() : $("#sllrrnng-ps-marketplace", $$).change(), PU.userToken.HasActivePackage ? PU.userToken.InsertCountLimit ? PU.productSearch.productSearchNotActive("InsertCountLimit") : PU.userToken.ProductInQLimit ? PU.productSearch.productSearchNotActive("ProductInQLimit") : e == "search-box" && (PU.productSearch.runAmazonFilterDemo(), PU.alert("info", PU.L.ExpandSearchUsingFilters, !1, 5)) : PU.productSearch.productSearchNotActive("HasActivePackage")) : ($("#sllrrnng-ps-keyword-row", $$).show(), $("#sllrrnng-ps-pagerange-row", $$).hide(), $("#sllrrnng-ps-filter-row-body", $$).addClass("passive").find("input,select").prop("disabled", !0), $("#sllrrnng-ps-filter-row .filter-passive-info", $$).addClass("passive"), $("#sllrrnng-ps-search-button", $$).text(PU.L.GoToSearchPage))), (PU.orderDetailToCopyShippingAddress.isOrderDetailToCopyShippingAddressOn() || PU.autoOrdering.thankyou()) && (t = !1), t && PU.panelOnOffTrigger("on")) : PU.sButtonClicked && (PU.panelOnOffTrigger("on"), PU.sButtonClicked = !1)
} else PU.alert("error", "", !0)
})
},
loadUserData: function() {
PU.userToken.IsAuthenticated ? PU.manifestData.version != "1.4.0" ? (alert("Lütfen SellerRunning eklentisini tamamen kaldırdıktan sonra yeniden yükleyin. / Please remove your SellerRunning extension and install it again."), window.open("https://app.sellerrunning.com/settings/install-extension", "_blank")) : PU.userToken.IsSetupCompleted ? PU.autoOrdering.isAutoOrderingOn() ? PU.loadOrderingPage() : PU.accountHealth.isAccountHealthOn() ? PU.loadAccountHealthPage() : PU.deleteAddressOnAmazon.isDeleteAddressOnAmazonOn() ? PU.loadDeleteAddressOnAmazonModelPage() : PU.collectTrackingInformation.isCollectTrackingInformationOn() ? PU.loadCollectTrackingInformationModelPage() : PU.fixYourProducts.isFixYourProductsOn() ? PU.loadFixYourProductsModelPage() : PU.loadIndexPage() : PU.loadSetupRequiredPage() : PU.loadLoginPage()
},
runServicePrep: function() {
$("head").append('<style type="text/css">#sllrrnng-holder-on.active, #sllrrnng-holder-on:hover {box-shadow: 0 0 15px 2px rgba(255, 0, 0, 0.20)!important;opacity: 1!important;#holder-on.active {background-image: url(https://static.sellerrunning.com/assets/img/extension/close-icon-widget.svg)!important}#holder-on.passive {display: none;!important}<\/style>');
$("#sllrrnng-holder-on").length || $(document.body).append('<div title="SellerRunning - Amazon Seller Automation" id="sllrrnng-holder-on" style="bottom: 16px;z-index:999998;position: fixed;right: 16px;height: 50px;width: 50px;border-radius: 25px;cursor: pointer;opacity: .7;transition: opacity .2s,box-shadow .2s,background-color .2s;background-size: 55%;background: #181f7b url(https://static.sellerrunning.com/assets/img/extension/sllrrnng-shield-widget.png) no-repeat 50%;"><\/div>');
PU.autoOrdering.isAutoOrderingOn() || PU.accountHealth.isAccountHealthOn() || PU.cartViewDeletePage.isCartViewDeletePageOn() || PU.deleteAddressOnAmazon.isDeleteAddressOnAmazonOn() || PU.collectTrackingInformation.isCollectTrackingInformationOn() || PU.fixYourProducts.isFixYourProductsOn() || location.href.indexOf("sellerrunning") > -1 || location.href.indexOf("sllrrnng-") > -1 ? ($("#sllrrnng-holder-on").css("background-image", "url(https://static.sellerrunning.com/assets/img/extension/loader-white.svg)").css("background-size", "40px 40px").css("opacity", "1"), PU.sButtonClicked = !0, PU.runServices()) : (PU.sellerCentralMessaging.isSellerCentralMessagingOn() || PU.sellerCentralFeedbackManager.isSellerCentralFeedbackManagerOn() || PU.cartViewDeletePage.isCartViewDeletePageOn() || PU.loginPage.isLoginPageOn() || PU.sellerCentralOrders.isSellerCentralOrdersOn() || PU.isInSCConfirmAction || PU.orderDetailToCopyShippingAddress.isOrderDetailToCopyShippingAddressOn() || PU.isInSCConfirmActionPivot) && PU.runServices();
$("#sllrrnng-holder-on").click(function() {
PU.sButtonClicked = !0;
PU.isServiceRunning ? PU.panelOnOffTrigger("on") : ($("#sllrrnng-holder-on").css("background-image", "url(https://static.sellerrunning.com/assets/img/extension/loader-white.svg)").css("background-size", "40px 40px").css("opacity", "1"), PU.runServices())
})
},
reloadUserToken: function(n, t) {
chrome.runtime.sendMessage({
name: "get-json",
"async": !1,
url: PU.sessionDomain + "/sllrrnng-extension/token/?marketplaceId=" + n + "&merchantId=" + t
}, function(n) {
n.status == 200 ? (PU.isServiceRunning = !0, PU.userToken = n.data) : PU.alert("error", "", !0)
})
},
runServices: function() {
chrome.runtime.sendMessage({
name: "get-json",
"async": !1,
url: PU.sessionDomain + "/sllrrnng-extension/token/"
}, function(n) {
n.status == 200 ? (PU.isServiceRunning = !0, PU.userToken = n.data, PU.loadUserData()) : PU.alert("error", "", !0)
})
},
loadScripts: function() {
if (PU.loadLangFile(), $$.querySelector("#sllrrnng-holder-off").addEventListener("click", function() {
PU.panelOnOffTrigger("off")
}), $$.querySelector(".sllrrnng-popup-alert-close").addEventListener("click", function() {
PU.alertPopupHide()
}), $$.querySelector(".sllrrnng-popup-alert-close-btn").addEventListener("click", function() {
PU.alertPopupHide()
}), PU.userToken.IsAuthenticated) $$.querySelector("#sllrrnng-logout").addEventListener("click", function() {
PU.log("Logout button clicked");
PU.autoOrdering.removeOrderInformation();
$("#sllrrnng-logout-form", $$).submit()
}), $$.querySelector(".sllrrnng-lang").addEventListener("click", function() {
PU.log("Lang link clicked");
var n = $(this).data("lang");
$("#lang", $$).val(n);
$("#sllrrnng-lang-form", $$).submit()
}), PU.userToken.HasActivePackage || PU.productSearch.productSearchNotActive("HasActivePackage"), PU.userToken.ShowWidgetOnPage || $("#sllrrnng-holder-on", $$).addClass("passive");
else {
var n = PU.getParameterByName("sllrrnng-loginerror");
n == 1 && PU.alert("error", PU.L.InvalidLoginAttempt, !1)
}
},
triggerClick: function(n, t) {
setTimeout(function() {
$(n).trigger("click")
}, t * 1e3)
},
triggerProp: function(n, t) {
setTimeout(function() {
$(n).prop("checked", !0)
}, t * 1e3)
},
triggerClickIfAutomationOn: function(n, t) {
setTimeout(function() {
PU.autoOrdering.isAutomationOn() && $(n).trigger("click")
}, t * 1e3)
},
triggerClickOn$$: function(n, t) {
setTimeout(function() {
$(n, $$).trigger("click")
}, t * 1e3)
},
scrollTop: function(n, t) {
var i = t > 0 ? t : 0;
try {
$("html, body").animate({
scrollTop: $(n).offset().top - i
}, 500)
} catch (r) {}
},
highlighter: function(n, t) {
$(n).addClass("sllrrnng-border-highlighter-blue");
var i = setInterval(function() {
$(n).addClass("sllrrnng-border-highlighter-red");
$(n).removeClass("sllrrnng-border-highlighter-blue")
}, 500),
r = setInterval(function() {
$(n).removeClass("sllrrnng-border-highlighter-red");
$(n).addClass("sllrrnng-border-highlighter-blue")
}, 1e3);
t > 0 && setTimeout(function() {
$(n).removeClass("sllrrnng-border-highlighter-red");
$(n).removeClass("sllrrnng-border-highlighter-blue");
clearInterval(i);
clearInterval(r)
}, t * 1e3)
},
highlighterOn$$: function(n, t) {
$(n, $$).addClass("sllrrnng-border-highlighter-blue");
var i = setInterval(function() {
$(n, $$).addClass("sllrrnng-border-highlighter-red");
$(n, $$).removeClass("sllrrnng-border-highlighter-blue")
}, 500),
r = setInterval(function() {
$(n, $$).removeClass("sllrrnng-border-highlighter-red");
$(n, $$).addClass("sllrrnng-border-highlighter-blue")
}, 1e3);
t > 0 && setTimeout(function() {
$(n, $$).removeClass("sllrrnng-border-highlighter-red");
$(n, $$).removeClass("sllrrnng-border-highlighter-blue");
clearInterval(i);
clearInterval(r)
}, t * 1e3)
},
blockedCss: function(n, t) {
$(n).addClass("sllrrnng-blocked");
$(n).find("*").attr("disabled", "disabled");
var i = "<div class='sllrrnng-blocked-text'>" + t + "<\/div>";
$(n).append(i)
},
getParameterByName: function(n, t) {
t || (t = window.location.href);
n = n.replace(/[\[\]]/g, "\\$&");
var r = new RegExp("[?&]" + n + "(=([^&#]*)|&|#|$)"),
i = r.exec(t);
return i ? i[2] ? decodeURIComponent(i[2].replace(/\+/g, " ").replace("?", "")) : "" : null
},
replaceUrlParam: function(n, t, i) {
i == null && (i = "");
var r = new RegExp("\\b(" + t + "=).*?(&|#|$)");
return n.search(r) >= 0 ? n.replace(r, "$1" + i + "$2") : (n = n.replace(/[?#]$/, ""), n + (n.indexOf("?") > 0 ? "&" : "?") + t + "=" + i)
},
updateQueryStringParameter: function(n, t, i) {
var r = new RegExp("([?&])" + t + "=.*?(&|$)", "i"),
u = n.indexOf("?") !== -1 ? "&" : "?";
return n.match(r) ? n.replace(r, "$1" + t + "=" + i + "$2") : n + u + t + "=" + i
},
initMessagingEventListener: function() {
chrome.runtime.onMessage.addListener(function(n, t, i) {
var r = n.data || {};
r == "open-panel" && PU.ifPanelOpenable && ($("#sllrrnng-holder-on").trigger("click"), i({
data: r,
success: !0
}))
})
},
init: function() {
this.isOff || this.runServicePrep()
}
};
PU.autoOrdering.thankyou() && PU.autoOrdering.getOrderInformation() && PU.autoOrdering.dontLeaveYet(!0);
$(document).ready(function() {
PU.initMessagingEventListener();
PU.init()
});

Back to list