Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- !function(obj, forOwn) {
- if ("object" == typeof module && "object" == typeof module.exports) {
- module.exports = obj.document ? forOwn(obj, true) : function(obj) {
- if (!obj.document) {
- throw new Error("jQuery requires a window with a document");
- }
- return forOwn(obj);
- };
- } else {
- forOwn(obj);
- }
- }("undefined" != typeof window ? window : this, function(win, dataAndEvents) {
- /**
- * @param {string} arg
- * @return {?}
- */
- function isArraylike(arg) {
- var len = arg.length;
- var type = jQuery.type(arg);
- return "function" === type || jQuery.isWindow(arg) ? false : 1 === arg.nodeType && len ? true : "array" === type || (0 === len || "number" == typeof len && (len > 0 && len - 1 in arg));
- }
- /**
- * @param {string} elements
- * @param {Object} qualifier
- * @param {boolean} not
- * @return {?}
- */
- function winnow(elements, qualifier, not) {
- if (jQuery.isFunction(qualifier)) {
- return jQuery.grep(elements, function(elem, i) {
- return!!qualifier.call(elem, i, elem) !== not;
- });
- }
- if (qualifier.nodeType) {
- return jQuery.grep(elements, function(elem) {
- return elem === qualifier !== not;
- });
- }
- if ("string" == typeof qualifier) {
- if (isSimple.test(qualifier)) {
- return jQuery.filter(qualifier, elements, not);
- }
- qualifier = jQuery.filter(qualifier, elements);
- }
- return jQuery.grep(elements, function(elem) {
- return core_indexOf.call(qualifier, elem) >= 0 !== not;
- });
- }
- /**
- * @param {Object} cur
- * @param {string} dir
- * @return {?}
- */
- function sibling(cur, dir) {
- for (;(cur = cur[dir]) && 1 !== cur.nodeType;) {
- }
- return cur;
- }
- /**
- * @param {string} options
- * @return {?}
- */
- function createOptions(options) {
- var buf = optionsCache[options] = {};
- return jQuery.each(options.match(core_rnotwhite) || [], function(dataAndEvents, off) {
- /** @type {boolean} */
- buf[off] = true;
- }), buf;
- }
- /**
- * @return {undefined}
- */
- function completed() {
- doc.removeEventListener("DOMContentLoaded", completed, false);
- win.removeEventListener("load", completed, false);
- jQuery.ready();
- }
- /**
- * @return {undefined}
- */
- function Data() {
- Object.defineProperty(this.cache = {}, 0, {
- /**
- * @return {?}
- */
- get : function() {
- return{};
- }
- });
- this.expando = jQuery.expando + Math.random();
- }
- /**
- * @param {Object} elem
- * @param {string} key
- * @param {string} data
- * @return {?}
- */
- function dataAttr(elem, key, data) {
- var name;
- if (void 0 === data && 1 === elem.nodeType) {
- if (name = "data-" + key.replace(r20, "-$1").toLowerCase(), data = elem.getAttribute(name), "string" == typeof data) {
- try {
- data = "true" === data ? true : "false" === data ? false : "null" === data ? null : +data + "" === data ? +data : rbrace.test(data) ? jQuery.parseJSON(data) : data;
- } catch (f) {
- }
- data_user.set(elem, key, data);
- } else {
- data = void 0;
- }
- }
- return data;
- }
- /**
- * @return {?}
- */
- function returnTrue() {
- return true;
- }
- /**
- * @return {?}
- */
- function returnFalse() {
- return false;
- }
- /**
- * @return {?}
- */
- function safeActiveElement() {
- try {
- return doc.activeElement;
- } catch (n) {
- }
- }
- /**
- * @param {Node} elem
- * @param {Object} content
- * @return {?}
- */
- function manipulationTarget(elem, content) {
- return jQuery.nodeName(elem, "table") && jQuery.nodeName(11 !== content.nodeType ? content : content.firstChild, "tr") ? elem.getElementsByTagName("tbody")[0] || elem.appendChild(elem.ownerDocument.createElement("tbody")) : elem;
- }
- /**
- * @param {Element} elem
- * @return {?}
- */
- function restoreScript(elem) {
- return elem.type = (null !== elem.getAttribute("type")) + "/" + elem.type, elem;
- }
- /**
- * @param {Element} s
- * @return {?}
- */
- function fn(s) {
- /** @type {(Array.<string>|null)} */
- var l = re.exec(s.type);
- return l ? s.type = l[1] : s.removeAttribute("type"), s;
- }
- /**
- * @param {(Array|NodeList)} elems
- * @param {Array} refElements
- * @return {undefined}
- */
- function setGlobalEval(elems, refElements) {
- /** @type {number} */
- var i = 0;
- var l = elems.length;
- for (;l > i;i++) {
- data_priv.set(elems[i], "globalEval", !refElements || data_priv.get(refElements[i], "globalEval"));
- }
- }
- /**
- * @param {Object} src
- * @param {Object} dest
- * @return {undefined}
- */
- function cloneCopyEvent(src, dest) {
- var i;
- var ilen;
- var type;
- var pdataOld;
- var pdataCur;
- var udataOld;
- var udataCur;
- var events;
- if (1 === dest.nodeType) {
- if (data_priv.hasData(src) && (pdataOld = data_priv.access(src), pdataCur = data_priv.set(dest, pdataOld), events = pdataOld.events)) {
- delete pdataCur.handle;
- pdataCur.events = {};
- for (type in events) {
- /** @type {number} */
- i = 0;
- ilen = events[type].length;
- for (;ilen > i;i++) {
- jQuery.event.add(dest, type, events[type][i]);
- }
- }
- }
- if (data_user.hasData(src)) {
- udataOld = data_user.access(src);
- udataCur = jQuery.extend({}, udataOld);
- data_user.set(dest, udataCur);
- }
- }
- }
- /**
- * @param {Node} context
- * @param {Object} tag
- * @return {?}
- */
- function getAll(context, tag) {
- var ret = context.getElementsByTagName ? context.getElementsByTagName(tag || "*") : context.querySelectorAll ? context.querySelectorAll(tag || "*") : [];
- return void 0 === tag || tag && jQuery.nodeName(context, tag) ? jQuery.merge([context], ret) : ret;
- }
- /**
- * @param {Element} src
- * @param {Element} dest
- * @return {undefined}
- */
- function fixInput(src, dest) {
- var name = dest.nodeName.toLowerCase();
- if ("input" === name && manipulation_rcheckableType.test(src.type)) {
- dest.checked = src.checked;
- } else {
- if ("input" === name || "textarea" === name) {
- dest.defaultValue = src.defaultValue;
- }
- }
- }
- /**
- * @param {string} name
- * @param {Document} doc
- * @return {?}
- */
- function actualDisplay(name, doc) {
- var result;
- var elem = jQuery(doc.createElement(name)).appendTo(doc.body);
- var e = win.getDefaultComputedStyle && (result = win.getDefaultComputedStyle(elem[0])) ? result.display : jQuery.css(elem[0], "display");
- return elem.detach(), e;
- }
- /**
- * @param {?} nodeName
- * @return {?}
- */
- function defaultDisplay(nodeName) {
- var d = doc;
- var display = elemdisplay[nodeName];
- return display || (display = actualDisplay(nodeName, d), "none" !== display && display || (iframe = (iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>")).appendTo(d.documentElement), d = iframe[0].contentDocument, d.write(), d.close(), display = actualDisplay(nodeName, d), iframe.detach()), elemdisplay[nodeName] = display), display;
- }
- /**
- * @param {Object} node
- * @param {string} prop
- * @param {Object} styles
- * @return {?}
- */
- function css(node, prop, styles) {
- var width;
- var minWidth;
- var maxWidth;
- var val;
- var style = node.style;
- return styles = styles || getStyles(node), styles && (val = styles.getPropertyValue(prop) || styles[prop]), styles && ("" !== val || (jQuery.contains(node.ownerDocument, node) || (val = jQuery.style(node, prop))), regexp.test(val) && (rbracket.test(prop) && (width = style.width, minWidth = style.minWidth, maxWidth = style.maxWidth, style.minWidth = style.maxWidth = style.width = val, val = styles.width, style.width = width, style.minWidth = minWidth, style.maxWidth = maxWidth))), void 0 !== val ?
- val + "" : val;
- }
- /**
- * @param {?} $timeout
- * @param {Function} hookFn
- * @return {?}
- */
- function addGetHookIf($timeout, hookFn) {
- return{
- /**
- * @return {?}
- */
- get : function() {
- return $timeout() ? void delete this.get : (this.get = hookFn).apply(this, arguments);
- }
- };
- }
- /**
- * @param {Object} style
- * @param {string} name
- * @return {?}
- */
- function vendorPropName(style, name) {
- if (name in style) {
- return name;
- }
- var capName = name[0].toUpperCase() + name.slice(1);
- /** @type {string} */
- var origName = name;
- /** @type {number} */
- var i = cssPrefixes.length;
- for (;i--;) {
- if (name = cssPrefixes[i] + capName, name in style) {
- return name;
- }
- }
- return origName;
- }
- /**
- * @param {Object} elem
- * @param {string} value
- * @param {string} actual
- * @return {?}
- */
- function setPositiveNumber(elem, value, actual) {
- /** @type {(Array.<string>|null)} */
- var iterator = rrelNum.exec(value);
- return iterator ? Math.max(0, iterator[1] - (actual || 0)) + (iterator[2] || "px") : value;
- }
- /**
- * @param {Object} elem
- * @param {string} keepData
- * @param {string} extra
- * @param {boolean} isBorderBox
- * @param {?} styles
- * @return {?}
- */
- function augmentWidthOrHeight(elem, keepData, extra, isBorderBox, styles) {
- /** @type {number} */
- var i = extra === (isBorderBox ? "border" : "content") ? 4 : "width" === keepData ? 1 : 0;
- /** @type {number} */
- var val = 0;
- for (;4 > i;i += 2) {
- if ("margin" === extra) {
- val += jQuery.css(elem, extra + cssExpand[i], true, styles);
- }
- if (isBorderBox) {
- if ("content" === extra) {
- val -= jQuery.css(elem, "padding" + cssExpand[i], true, styles);
- }
- if ("margin" !== extra) {
- val -= jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
- }
- } else {
- val += jQuery.css(elem, "padding" + cssExpand[i], true, styles);
- if ("padding" !== extra) {
- val += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
- }
- }
- }
- return val;
- }
- /**
- * @param {Object} elem
- * @param {string} name
- * @param {string} extra
- * @return {?}
- */
- function getWidthOrHeight(elem, name, extra) {
- /** @type {boolean} */
- var valueIsBorderBox = true;
- var val = "width" === name ? elem.offsetWidth : elem.offsetHeight;
- var styles = getStyles(elem);
- /** @type {boolean} */
- var isBorderBox = "border-box" === jQuery.css(elem, "boxSizing", false, styles);
- if (0 >= val || null == val) {
- if (val = css(elem, name, styles), (0 > val || null == val) && (val = elem.style[name]), regexp.test(val)) {
- return val;
- }
- valueIsBorderBox = isBorderBox && (support.boxSizingReliable() || val === elem.style[name]);
- /** @type {number} */
- val = parseFloat(val) || 0;
- }
- return val + augmentWidthOrHeight(elem, name, extra || (isBorderBox ? "border" : "content"), valueIsBorderBox, styles) + "px";
- }
- /**
- * @param {Array} elements
- * @param {boolean} show
- * @return {?}
- */
- function showHide(elements, show) {
- var display;
- var elem;
- var hidden;
- /** @type {Array} */
- var values = [];
- /** @type {number} */
- var index = 0;
- var length = elements.length;
- for (;length > index;index++) {
- elem = elements[index];
- if (elem.style) {
- values[index] = data_priv.get(elem, "olddisplay");
- display = elem.style.display;
- if (show) {
- if (!values[index]) {
- if (!("none" !== display)) {
- /** @type {string} */
- elem.style.display = "";
- }
- }
- if ("" === elem.style.display) {
- if (isHidden(elem)) {
- values[index] = data_priv.access(elem, "olddisplay", defaultDisplay(elem.nodeName));
- }
- }
- } else {
- hidden = isHidden(elem);
- if (!("none" === display && hidden)) {
- data_priv.set(elem, "olddisplay", hidden ? display : jQuery.css(elem, "display"));
- }
- }
- }
- }
- /** @type {number} */
- index = 0;
- for (;length > index;index++) {
- elem = elements[index];
- if (elem.style) {
- if (!(show && ("none" !== elem.style.display && "" !== elem.style.display))) {
- elem.style.display = show ? values[index] || "" : "none";
- }
- }
- }
- return elements;
- }
- /**
- * @param {string} selector
- * @param {string} context
- * @param {string} prop
- * @param {string} end
- * @param {string} easing
- * @return {?}
- */
- function Tween(selector, context, prop, end, easing) {
- return new Tween.prototype.init(selector, context, prop, end, easing);
- }
- /**
- * @return {?}
- */
- function createFxNow() {
- return setTimeout(function() {
- fxNow = void 0;
- }), fxNow = jQuery.now();
- }
- /**
- * @param {string} type
- * @param {boolean} includeWidth
- * @return {?}
- */
- function genFx(type, includeWidth) {
- var which;
- /** @type {number} */
- var i = 0;
- var attrs = {
- height : type
- };
- /** @type {number} */
- includeWidth = includeWidth ? 1 : 0;
- for (;4 > i;i += 2 - includeWidth) {
- which = cssExpand[i];
- attrs["margin" + which] = attrs["padding" + which] = type;
- }
- return includeWidth && (attrs.opacity = attrs.width = type), attrs;
- }
- /**
- * @param {?} value
- * @param {?} prop
- * @param {?} animation
- * @return {?}
- */
- function createTween(value, prop, animation) {
- var tween;
- var q = (cache[prop] || []).concat(cache["*"]);
- /** @type {number} */
- var i = 0;
- var l = q.length;
- for (;l > i;i++) {
- if (tween = q[i].call(animation, prop, value)) {
- return tween;
- }
- }
- }
- /**
- * @param {Object} elem
- * @param {Object} props
- * @param {Object} opts
- * @return {undefined}
- */
- function defaultPrefilter(elem, props, opts) {
- var prop;
- var value;
- var thisp;
- var tween;
- var hooks;
- var oldfire;
- var oldDisplay;
- var type;
- var anim = this;
- var orig = {};
- var style = elem.style;
- var hidden = elem.nodeType && isHidden(elem);
- var dataShow = data_priv.get(elem, "fxshow");
- if (!opts.queue) {
- hooks = jQuery._queueHooks(elem, "fx");
- if (null == hooks.unqueued) {
- /** @type {number} */
- hooks.unqueued = 0;
- /** @type {function (): undefined} */
- oldfire = hooks.empty.fire;
- /**
- * @return {undefined}
- */
- hooks.empty.fire = function() {
- if (!hooks.unqueued) {
- oldfire();
- }
- };
- }
- hooks.unqueued++;
- anim.always(function() {
- anim.always(function() {
- hooks.unqueued--;
- if (!jQuery.queue(elem, "fx").length) {
- hooks.empty.fire();
- }
- });
- });
- }
- if (1 === elem.nodeType) {
- if ("height" in props || "width" in props) {
- /** @type {Array} */
- opts.overflow = [style.overflow, style.overflowX, style.overflowY];
- oldDisplay = jQuery.css(elem, "display");
- type = "none" === oldDisplay ? data_priv.get(elem, "olddisplay") || defaultDisplay(elem.nodeName) : oldDisplay;
- if ("inline" === type) {
- if ("none" === jQuery.css(elem, "float")) {
- /** @type {string} */
- style.display = "inline-block";
- }
- }
- }
- }
- if (opts.overflow) {
- /** @type {string} */
- style.overflow = "hidden";
- anim.always(function() {
- style.overflow = opts.overflow[0];
- style.overflowX = opts.overflow[1];
- style.overflowY = opts.overflow[2];
- });
- }
- for (prop in props) {
- if (value = props[prop], rplusequals.exec(value)) {
- if (delete props[prop], thisp = thisp || "toggle" === value, value === (hidden ? "hide" : "show")) {
- if ("show" !== value || (!dataShow || void 0 === dataShow[prop])) {
- continue;
- }
- /** @type {boolean} */
- hidden = true;
- }
- orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop);
- } else {
- oldDisplay = void 0;
- }
- }
- if (jQuery.isEmptyObject(orig)) {
- if ("inline" === ("none" === oldDisplay ? defaultDisplay(elem.nodeName) : oldDisplay)) {
- style.display = oldDisplay;
- }
- } else {
- if (dataShow) {
- if ("hidden" in dataShow) {
- hidden = dataShow.hidden;
- }
- } else {
- dataShow = data_priv.access(elem, "fxshow", {});
- }
- if (thisp) {
- /** @type {boolean} */
- dataShow.hidden = !hidden;
- }
- if (hidden) {
- jQuery(elem).show();
- } else {
- anim.done(function() {
- jQuery(elem).hide();
- });
- }
- anim.done(function() {
- var prop;
- data_priv.remove(elem, "fxshow");
- for (prop in orig) {
- jQuery.style(elem, prop, orig[prop]);
- }
- });
- for (prop in orig) {
- tween = createTween(hidden ? dataShow[prop] : 0, prop, anim);
- if (!(prop in dataShow)) {
- dataShow[prop] = tween.start;
- if (hidden) {
- tween.end = tween.start;
- /** @type {number} */
- tween.start = "width" === prop || "height" === prop ? 1 : 0;
- }
- }
- }
- }
- }
- /**
- * @param {Object} object
- * @param {Object} paramMap
- * @return {undefined}
- */
- function propFilter(object, paramMap) {
- var key;
- var name;
- var value;
- var data;
- var hooks;
- for (key in object) {
- if (name = jQuery.camelCase(key), value = paramMap[name], data = object[key], jQuery.isArray(data) && (value = data[1], data = object[key] = data[0]), key !== name && (object[name] = data, delete object[key]), hooks = jQuery.cssHooks[name], hooks && "expand" in hooks) {
- data = hooks.expand(data);
- delete object[name];
- for (key in data) {
- if (!(key in object)) {
- object[key] = data[key];
- paramMap[key] = value;
- }
- }
- } else {
- paramMap[name] = value;
- }
- }
- }
- /**
- * @param {string} elem
- * @param {?} properties
- * @param {Object} options
- * @return {?}
- */
- function Animation(elem, properties, options) {
- var result;
- var e;
- /** @type {number} */
- var index = 0;
- /** @type {number} */
- var length = animationPrefilters.length;
- var deferred = jQuery.Deferred().always(function() {
- delete tick.elem;
- });
- /**
- * @return {?}
- */
- var tick = function() {
- if (e) {
- return false;
- }
- var currentTime = fxNow || createFxNow();
- /** @type {number} */
- var remaining = Math.max(0, animation.startTime + animation.duration - currentTime);
- /** @type {number} */
- var temp = remaining / animation.duration || 0;
- /** @type {number} */
- var percent = 1 - temp;
- /** @type {number} */
- var index = 0;
- var startOffset = animation.tweens.length;
- for (;startOffset > index;index++) {
- animation.tweens[index].run(percent);
- }
- return deferred.notifyWith(elem, [animation, percent, remaining]), 1 > percent && startOffset ? remaining : (deferred.resolveWith(elem, [animation]), false);
- };
- var animation = deferred.promise({
- elem : elem,
- props : jQuery.extend({}, properties),
- opts : jQuery.extend(true, {
- specialEasing : {}
- }, options),
- originalProperties : properties,
- originalOptions : options,
- startTime : fxNow || createFxNow(),
- duration : options.duration,
- tweens : [],
- /**
- * @param {string} prop
- * @param {?} end
- * @return {?}
- */
- createTween : function(prop, end) {
- var tween = jQuery.Tween(elem, animation.opts, prop, end, animation.opts.specialEasing[prop] || animation.opts.easing);
- return animation.tweens.push(tween), tween;
- },
- /**
- * @param {boolean} gotoEnd
- * @return {?}
- */
- stop : function(gotoEnd) {
- /** @type {number} */
- var index = 0;
- var length = gotoEnd ? animation.tweens.length : 0;
- if (e) {
- return this;
- }
- /** @type {boolean} */
- e = true;
- for (;length > index;index++) {
- animation.tweens[index].run(1);
- }
- return gotoEnd ? deferred.resolveWith(elem, [animation, gotoEnd]) : deferred.rejectWith(elem, [animation, gotoEnd]), this;
- }
- });
- var scripts = animation.props;
- propFilter(scripts, animation.opts.specialEasing);
- for (;length > index;index++) {
- if (result = animationPrefilters[index].call(animation, elem, scripts, animation.opts)) {
- return result;
- }
- }
- return jQuery.map(scripts, createTween, animation), jQuery.isFunction(animation.opts.start) && animation.opts.start.call(elem, animation), jQuery.fx.timer(jQuery.extend(tick, {
- elem : elem,
- anim : animation,
- queue : animation.opts.queue
- })), animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always);
- }
- /**
- * @param {Array} structure
- * @return {?}
- */
- function addToPrefiltersOrTransports(structure) {
- return function(selector, fn) {
- if ("string" != typeof selector) {
- /** @type {(Function|string)} */
- fn = selector;
- /** @type {string} */
- selector = "*";
- }
- var node;
- /** @type {number} */
- var i = 0;
- var elem = selector.toLowerCase().match(core_rnotwhite) || [];
- if (jQuery.isFunction(fn)) {
- for (;node = elem[i++];) {
- if ("+" === node[0]) {
- node = node.slice(1) || "*";
- (structure[node] = structure[node] || []).unshift(fn);
- } else {
- (structure[node] = structure[node] || []).push(fn);
- }
- }
- }
- };
- }
- /**
- * @param {?} structure
- * @param {?} options
- * @param {Object} originalOptions
- * @param {?} jqXHR
- * @return {?}
- */
- function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {
- /**
- * @param {string} key
- * @return {?}
- */
- function inspect(key) {
- var oldName;
- return old[key] = true, jQuery.each(structure[key] || [], function(dataAndEvents, prefilterOrFactory) {
- var name = prefilterOrFactory(options, originalOptions, jqXHR);
- return "string" != typeof name || (seekingTransport || old[name]) ? seekingTransport ? !(oldName = name) : void 0 : (options.dataTypes.unshift(name), inspect(name), false);
- }), oldName;
- }
- var old = {};
- /** @type {boolean} */
- var seekingTransport = structure === transports;
- return inspect(options.dataTypes[0]) || !old["*"] && inspect("*");
- }
- /**
- * @param {(Object|string)} target
- * @param {Object} src
- * @return {?}
- */
- function ajaxExtend(target, src) {
- var key;
- var deep;
- var flatOptions = jQuery.ajaxSettings.flatOptions || {};
- for (key in src) {
- if (void 0 !== src[key]) {
- (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];
- }
- }
- return deep && jQuery.extend(true, target, deep), target;
- }
- /**
- * @param {Object} s
- * @param {XMLHttpRequest} jqXHR
- * @param {Object} responses
- * @return {?}
- */
- function ajaxHandleResponses(s, jqXHR, responses) {
- var ct;
- var type;
- var finalDataType;
- var firstDataType;
- var contents = s.contents;
- var dataTypes = s.dataTypes;
- for (;"*" === dataTypes[0];) {
- dataTypes.shift();
- if (void 0 === ct) {
- ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
- }
- }
- if (ct) {
- for (type in contents) {
- if (contents[type] && contents[type].test(ct)) {
- dataTypes.unshift(type);
- break;
- }
- }
- }
- if (dataTypes[0] in responses) {
- finalDataType = dataTypes[0];
- } else {
- for (type in responses) {
- if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) {
- /** @type {string} */
- finalDataType = type;
- break;
- }
- if (!firstDataType) {
- /** @type {string} */
- firstDataType = type;
- }
- }
- /** @type {(string|undefined)} */
- finalDataType = finalDataType || firstDataType;
- }
- if (finalDataType) {
- return finalDataType !== dataTypes[0] && dataTypes.unshift(finalDataType), responses[finalDataType];
- }
- }
- /**
- * @param {Object} s
- * @param {(Object|string)} response
- * @param {?} jqXHR
- * @param {Object} isSuccess
- * @return {?}
- */
- function ajaxConvert(s, response, jqXHR, isSuccess) {
- var type;
- var value;
- var conv;
- var array;
- var name;
- var types = {};
- var results = s.dataTypes.slice();
- if (results[1]) {
- for (conv in s.converters) {
- types[conv.toLowerCase()] = s.converters[conv];
- }
- }
- value = results.shift();
- for (;value;) {
- if (s.responseFields[value] && (jqXHR[s.responseFields[value]] = response), !name && (isSuccess && (s.dataFilter && (response = s.dataFilter(response, s.dataType)))), name = value, value = results.shift()) {
- if ("*" === value) {
- value = name;
- } else {
- if ("*" !== name && name !== value) {
- if (conv = types[name + " " + value] || types["* " + value], !conv) {
- for (type in types) {
- if (array = type.split(" "), array[1] === value && (conv = types[name + " " + array[0]] || types["* " + array[0]])) {
- if (conv === true) {
- conv = types[type];
- } else {
- if (types[type] !== true) {
- /** @type {string} */
- value = array[0];
- results.unshift(array[1]);
- }
- }
- break;
- }
- }
- }
- if (conv !== true) {
- if (conv && s.throws) {
- response = conv(response);
- } else {
- try {
- response = conv(response);
- } catch (e) {
- return{
- state : "parsererror",
- error : conv ? e : "No conversion from " + name + " to " + value
- };
- }
- }
- }
- }
- }
- }
- }
- return{
- state : "success",
- data : response
- };
- }
- /**
- * @param {string} prefix
- * @param {string} prop
- * @param {boolean} traditional
- * @param {Function} add
- * @return {undefined}
- */
- function buildParams(prefix, prop, traditional, add) {
- var name;
- if (jQuery.isArray(prop)) {
- jQuery.each(prop, function(i, v) {
- if (traditional || rmargin.test(prefix)) {
- add(prefix, v);
- } else {
- buildParams(prefix + "[" + ("object" == typeof v ? i : "") + "]", v, traditional, add);
- }
- });
- } else {
- if (traditional || "object" !== jQuery.type(prop)) {
- add(prefix, prop);
- } else {
- for (name in prop) {
- buildParams(prefix + "[" + name + "]", prop[name], traditional, add);
- }
- }
- }
- }
- /**
- * @param {Object} element
- * @return {?}
- */
- function getWindow(element) {
- return jQuery.isWindow(element) ? element : 9 === element.nodeType && element.defaultView;
- }
- /** @type {Array} */
- var core_deletedIds = [];
- /** @type {function (this:(Array.<T>|string|{length: number}), *=, *=): Array.<T>} */
- var core_slice = core_deletedIds.slice;
- /** @type {function (this:*, ...[*]): Array} */
- var core_concat = core_deletedIds.concat;
- /** @type {function (this:(Array.<T>|{length: number}), ...[T]): number} */
- var core_push = core_deletedIds.push;
- /** @type {function (this:(Array.<T>|string|{length: number}), T, number=): number} */
- var core_indexOf = core_deletedIds.indexOf;
- var class2type = {};
- /** @type {function (this:*): string} */
- var core_toString = class2type.toString;
- /** @type {function (this:Object, *): boolean} */
- var core_hasOwn = class2type.hasOwnProperty;
- var support = {};
- var doc = win.document;
- /** @type {string} */
- var core_version = "2.1.1";
- /**
- * @param {string} selector
- * @param {Function} context
- * @return {?}
- */
- var jQuery = function(selector, context) {
- return new jQuery.fn.init(selector, context);
- };
- /** @type {RegExp} */
- var badChars = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
- /** @type {RegExp} */
- var rmsPrefix = /^-ms-/;
- /** @type {RegExp} */
- var emptyParagraphRegexp = /-([\da-z])/gi;
- /**
- * @param {?} all
- * @param {string} letter
- * @return {?}
- */
- var fcamelCase = function(all, letter) {
- return letter.toUpperCase();
- };
- var Sizzle;
- var rootjQuery;
- var rquickExpr;
- var init;
- var rparentsprev;
- var data;
- var core_rnotwhite;
- var optionsCache;
- var readyList;
- var access;
- var memory;
- var iframe;
- var elemdisplay;
- var nodeHook;
- var boolHook;
- var values;
- var rfocusable;
- var rclass;
- var rreturn;
- var iIdCounter;
- var rquery;
- var eventPath;
- var rjsonp;
- var matcherFunction;
- var docElem;
- var $;
- var _$;
- jQuery.fn = jQuery.prototype = {
- jquery : core_version,
- /** @type {function (string, Function): ?} */
- constructor : jQuery,
- selector : "",
- length : 0,
- /**
- * @return {?}
- */
- toArray : function() {
- return core_slice.call(this);
- },
- /**
- * @param {Object} num
- * @return {?}
- */
- get : function(num) {
- return null != num ? 0 > num ? this[num + this.length] : this[num] : core_slice.call(this);
- },
- /**
- * @param {Array} elems
- * @return {?}
- */
- pushStack : function(elems) {
- var ret = jQuery.merge(this.constructor(), elems);
- return ret.prevObject = this, ret.context = this.context, ret;
- },
- /**
- * @param {Function} opt_attributes
- * @param {Function} args
- * @return {?}
- */
- each : function(opt_attributes, args) {
- return jQuery.each(this, opt_attributes, args);
- },
- /**
- * @param {Function} callback
- * @return {?}
- */
- map : function(callback) {
- return this.pushStack(jQuery.map(this, function(el, operation) {
- return callback.call(el, operation, el);
- }));
- },
- /**
- * @return {?}
- */
- slice : function() {
- return this.pushStack(core_slice.apply(this, arguments));
- },
- /**
- * @return {?}
- */
- first : function() {
- return this.eq(0);
- },
- /**
- * @return {?}
- */
- last : function() {
- return this.eq(-1);
- },
- /**
- * @param {number} b
- * @return {?}
- */
- eq : function(b) {
- var l = this.length;
- var i = +b + (0 > b ? l : 0);
- return this.pushStack(i >= 0 && l > i ? [this[i]] : []);
- },
- /**
- * @return {?}
- */
- end : function() {
- return this.prevObject || this.constructor(null);
- },
- /** @type {function (this:(Array.<T>|{length: number}), ...[T]): number} */
- push : core_push,
- /** @type {function (this:(Array.<T>|{length: number}), function (T, T): number=): ?} */
- sort : core_deletedIds.sort,
- /** @type {function (this:(Array.<T>|{length: number}), *=, *=, ...[T]): Array.<T>} */
- splice : core_deletedIds.splice
- };
- /** @type {function (): ?} */
- jQuery.extend = jQuery.fn.extend = function() {
- var options;
- var name;
- var src;
- var copy;
- var copyIsArray;
- var clone;
- var target = arguments[0] || {};
- /** @type {number} */
- var i = 1;
- /** @type {number} */
- var l = arguments.length;
- /** @type {boolean} */
- var deep = false;
- if ("boolean" == typeof target) {
- /** @type {boolean} */
- deep = target;
- target = arguments[i] || {};
- i++;
- }
- if (!("object" == typeof target)) {
- if (!jQuery.isFunction(target)) {
- target = {};
- }
- }
- if (i === l) {
- target = this;
- i--;
- }
- for (;l > i;i++) {
- if (null != (options = arguments[i])) {
- for (name in options) {
- src = target[name];
- copy = options[name];
- if (target !== copy) {
- if (deep && (copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy))))) {
- if (copyIsArray) {
- /** @type {boolean} */
- copyIsArray = false;
- clone = src && jQuery.isArray(src) ? src : [];
- } else {
- clone = src && jQuery.isPlainObject(src) ? src : {};
- }
- target[name] = jQuery.extend(deep, clone, copy);
- } else {
- if (void 0 !== copy) {
- target[name] = copy;
- }
- }
- }
- }
- }
- }
- return target;
- };
- jQuery.extend({
- expando : "jQuery" + (core_version + Math.random()).replace(/\D/g, ""),
- isReady : true,
- /**
- * @param {string} args
- * @return {?}
- */
- error : function(args) {
- throw new Error(args);
- },
- /**
- * @return {undefined}
- */
- noop : function() {
- },
- /**
- * @param {string} arg
- * @return {?}
- */
- isFunction : function(arg) {
- return "function" === jQuery.type(arg);
- },
- /** @type {function (*): boolean} */
- isArray : Array.isArray,
- /**
- * @param {Object} obj
- * @return {?}
- */
- isWindow : function(obj) {
- return null != obj && obj === obj.window;
- },
- /**
- * @param {string} val
- * @return {?}
- */
- isNumeric : function(val) {
- return!jQuery.isArray(val) && val - parseFloat(val) >= 0;
- },
- /**
- * @param {string} expr
- * @return {?}
- */
- isPlainObject : function(expr) {
- return "object" !== jQuery.type(expr) || (expr.nodeType || jQuery.isWindow(expr)) ? false : expr.constructor && !core_hasOwn.call(expr.constructor.prototype, "isPrototypeOf") ? false : true;
- },
- /**
- * @param {?} obj
- * @return {?}
- */
- isEmptyObject : function(obj) {
- var prop;
- for (prop in obj) {
- return false;
- }
- return true;
- },
- /**
- * @param {string} args
- * @return {?}
- */
- type : function(args) {
- return null == args ? args + "" : "object" == typeof args || "function" == typeof args ? class2type[core_toString.call(args)] || "object" : typeof args;
- },
- /**
- * @param {string} code
- * @return {undefined}
- */
- globalEval : function(code) {
- var script;
- /** @type {function (string): *} */
- var indirect = eval;
- code = jQuery.trim(code);
- if (code) {
- if (1 === code.indexOf("use strict")) {
- script = doc.createElement("script");
- /** @type {string} */
- script.text = code;
- doc.head.appendChild(script).parentNode.removeChild(script);
- } else {
- indirect(code);
- }
- }
- },
- /**
- * @param {string} string
- * @return {?}
- */
- camelCase : function(string) {
- return string.replace(rmsPrefix, "ms-").replace(emptyParagraphRegexp, fcamelCase);
- },
- /**
- * @param {Node} elem
- * @param {string} name
- * @return {?}
- */
- nodeName : function(elem, name) {
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
- },
- /**
- * @param {Function} obj
- * @param {Function} callback
- * @param {Object} args
- * @return {?}
- */
- each : function(obj, callback, args) {
- var value;
- /** @type {number} */
- var i = 0;
- var l = obj.length;
- var isArray = isArraylike(obj);
- if (args) {
- if (isArray) {
- for (;l > i;i++) {
- if (value = callback.apply(obj[i], args), value === false) {
- break;
- }
- }
- } else {
- for (i in obj) {
- if (value = callback.apply(obj[i], args), value === false) {
- break;
- }
- }
- }
- } else {
- if (isArray) {
- for (;l > i;i++) {
- if (value = callback.call(obj[i], i, obj[i]), value === false) {
- break;
- }
- }
- } else {
- for (i in obj) {
- if (value = callback.call(obj[i], i, obj[i]), value === false) {
- break;
- }
- }
- }
- }
- return obj;
- },
- /**
- * @param {Object} text
- * @return {?}
- */
- trim : function(text) {
- return null == text ? "" : (text + "").replace(badChars, "");
- },
- /**
- * @param {?} arr
- * @param {Array} results
- * @return {?}
- */
- makeArray : function(arr, results) {
- var ret = results || [];
- return null != arr && (isArraylike(Object(arr)) ? jQuery.merge(ret, "string" == typeof arr ? [arr] : arr) : core_push.call(ret, arr)), ret;
- },
- /**
- * @param {?} elem
- * @param {?} arr
- * @param {?} i
- * @return {?}
- */
- inArray : function(elem, arr, i) {
- return null == arr ? -1 : core_indexOf.call(arr, elem, i);
- },
- /**
- * @param {Array} first
- * @param {?} second
- * @return {?}
- */
- merge : function(first, second) {
- /** @type {number} */
- var jlen = +second.length;
- /** @type {number} */
- var j = 0;
- var i = first.length;
- for (;jlen > j;j++) {
- first[i++] = second[j];
- }
- return first.length = i, first;
- },
- /**
- * @param {Array} elems
- * @param {Function} callback
- * @param {?} inv
- * @return {?}
- */
- grep : function(elems, callback, inv) {
- var val;
- /** @type {Array} */
- var ret = [];
- /** @type {number} */
- var i = 0;
- var l = elems.length;
- /** @type {boolean} */
- var skip = !inv;
- for (;l > i;i++) {
- /** @type {boolean} */
- val = !callback(elems[i], i);
- if (val !== skip) {
- ret.push(elems[i]);
- }
- }
- return ret;
- },
- /**
- * @param {Object} elems
- * @param {Function} callback
- * @param {boolean} arg
- * @return {?}
- */
- map : function(elems, callback, arg) {
- var value;
- /** @type {number} */
- var i = 0;
- var l = elems.length;
- var isArray = isArraylike(elems);
- /** @type {Array} */
- var args = [];
- if (isArray) {
- for (;l > i;i++) {
- value = callback(elems[i], i, arg);
- if (null != value) {
- args.push(value);
- }
- }
- } else {
- for (i in elems) {
- value = callback(elems[i], i, arg);
- if (null != value) {
- args.push(value);
- }
- }
- }
- return core_concat.apply([], args);
- },
- guid : 1,
- /**
- * @param {Object} fn
- * @param {(Function|string)} context
- * @return {?}
- */
- proxy : function(fn, context) {
- var tmp;
- var args;
- var proxy;
- return "string" == typeof context && (tmp = fn[context], context = fn, fn = tmp), jQuery.isFunction(fn) ? (args = core_slice.call(arguments, 2), proxy = function() {
- return fn.apply(context || this, args.concat(core_slice.call(arguments)));
- }, proxy.guid = fn.guid = fn.guid || jQuery.guid++, proxy) : void 0;
- },
- /** @type {function (): number} */
- now : Date.now,
- support : support
- });
- jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(dataAndEvents, m3) {
- class2type["[object " + m3 + "]"] = m3.toLowerCase();
- });
- Sizzle = function(win) {
- /**
- * @param {string} selector
- * @param {Object} context
- * @param {Array} recurring
- * @param {Array} seed
- * @return {?}
- */
- function Sizzle(selector, context, recurring, seed) {
- var match;
- var elem;
- var m;
- var nodeType;
- var i;
- var groups;
- var old;
- var nid;
- var newContext;
- var newSelector;
- if ((context ? context.ownerDocument || context : preferredDoc) !== doc && setDocument(context), context = context || doc, recurring = recurring || [], !selector || "string" != typeof selector) {
- return recurring;
- }
- if (1 !== (nodeType = context.nodeType) && 9 !== nodeType) {
- return[];
- }
- if (documentIsHTML && !seed) {
- if (match = rquickExpr.exec(selector)) {
- if (m = match[1]) {
- if (9 === nodeType) {
- if (elem = context.getElementById(m), !elem || !elem.parentNode) {
- return recurring;
- }
- if (elem.id === m) {
- return recurring.push(elem), recurring;
- }
- } else {
- if (context.ownerDocument && ((elem = context.ownerDocument.getElementById(m)) && (contains(context, elem) && elem.id === m))) {
- return recurring.push(elem), recurring;
- }
- }
- } else {
- if (match[2]) {
- return push.apply(recurring, context.getElementsByTagName(selector)), recurring;
- }
- if ((m = match[3]) && (support.getElementsByClassName && context.getElementsByClassName)) {
- return push.apply(recurring, context.getElementsByClassName(m)), recurring;
- }
- }
- }
- if (support.qsa && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
- if (nid = old = expando, newContext = context, newSelector = 9 === nodeType && selector, 1 === nodeType && "object" !== context.nodeName.toLowerCase()) {
- groups = tokenize(selector);
- if (old = context.getAttribute("id")) {
- nid = old.replace(r20, "\\$&");
- } else {
- context.setAttribute("id", nid);
- }
- /** @type {string} */
- nid = "[id='" + nid + "'] ";
- i = groups.length;
- for (;i--;) {
- /** @type {string} */
- groups[i] = nid + toSelector(groups[i]);
- }
- newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
- newSelector = groups.join(",");
- }
- if (newSelector) {
- try {
- return push.apply(recurring, newContext.querySelectorAll(newSelector)), recurring;
- } catch (tt) {
- } finally {
- if (!old) {
- context.removeAttribute("id");
- }
- }
- }
- }
- }
- return select(selector.replace(rtrim, "$1"), context, recurring, seed);
- }
- /**
- * @return {?}
- */
- function createCache() {
- /**
- * @param {string} key
- * @param {?} value
- * @return {?}
- */
- function cache(key, value) {
- return buf.push(key + " ") > Expr.cacheLength && delete cache[buf.shift()], cache[key + " "] = value;
- }
- /** @type {Array} */
- var buf = [];
- return cache;
- }
- /**
- * @param {Function} fn
- * @return {?}
- */
- function markFunction(fn) {
- return fn[expando] = true, fn;
- }
- /**
- * @param {Function} fn
- * @return {?}
- */
- function assert(fn) {
- var t = doc.createElement("div");
- try {
- return!!fn(t);
- } catch (i) {
- return false;
- } finally {
- if (t.parentNode) {
- t.parentNode.removeChild(t);
- }
- /** @type {null} */
- t = null;
- }
- }
- /**
- * @param {string} attrs
- * @param {Function} handler
- * @return {undefined}
- */
- function addHandle(attrs, handler) {
- var arr = attrs.split("|");
- var i = attrs.length;
- for (;i--;) {
- /** @type {Function} */
- Expr.attrHandle[arr[i]] = handler;
- }
- }
- /**
- * @param {Object} a
- * @param {Object} b
- * @return {?}
- */
- function siblingCheck(a, b) {
- var cur = b && a;
- var diff = cur && (1 === a.nodeType && (1 === b.nodeType && (~b.sourceIndex || MAX_NEGATIVE) - (~a.sourceIndex || MAX_NEGATIVE)));
- if (diff) {
- return diff;
- }
- if (cur) {
- for (;cur = cur.nextSibling;) {
- if (cur === b) {
- return-1;
- }
- }
- }
- return a ? 1 : -1;
- }
- /**
- * @param {?} type
- * @return {?}
- */
- function createInputPseudo(type) {
- return function(elem) {
- var b = elem.nodeName.toLowerCase();
- return "input" === b && elem.type === type;
- };
- }
- /**
- * @param {?} type
- * @return {?}
- */
- function createButtonPseudo(type) {
- return function(elem) {
- var NULL = elem.nodeName.toLowerCase();
- return("input" === NULL || "button" === NULL) && elem.type === type;
- };
- }
- /**
- * @param {Function} fn
- * @return {?}
- */
- function createPositionalPseudo(fn) {
- return markFunction(function(argument) {
- return argument = +argument, markFunction(function(seed, matches) {
- var j;
- var matchIndexes = fn([], seed.length, argument);
- var i = matchIndexes.length;
- for (;i--;) {
- if (seed[j = matchIndexes[i]]) {
- /** @type {boolean} */
- seed[j] = !(matches[j] = seed[j]);
- }
- }
- });
- });
- }
- /**
- * @param {Object} context
- * @return {?}
- */
- function testContext(context) {
- return context && (typeof context.getElementsByTagName !== strundefined && context);
- }
- /**
- * @return {undefined}
- */
- function setFilters() {
- }
- /**
- * @param {Array} tokens
- * @return {?}
- */
- function toSelector(tokens) {
- /** @type {number} */
- var i = 0;
- var nTokens = tokens.length;
- /** @type {string} */
- var selector = "";
- for (;nTokens > i;i++) {
- selector += tokens[i].value;
- }
- return selector;
- }
- /**
- * @param {Function} matcher
- * @param {Object} combinator
- * @param {boolean} dataAndEvents
- * @return {?}
- */
- function addCombinator(matcher, combinator, dataAndEvents) {
- var dir = combinator.dir;
- var u = dataAndEvents && "parentNode" === dir;
- /** @type {number} */
- var doneName = done++;
- return combinator.first ? function(elem, context, xml) {
- for (;elem = elem[dir];) {
- if (1 === elem.nodeType || u) {
- return matcher(elem, context, xml);
- }
- }
- } : function(elem, context, xml) {
- var oldCache;
- var outerCache;
- /** @type {Array} */
- var newCache = [dirruns, doneName];
- if (xml) {
- for (;elem = elem[dir];) {
- if ((1 === elem.nodeType || u) && matcher(elem, context, xml)) {
- return true;
- }
- }
- } else {
- for (;elem = elem[dir];) {
- if (1 === elem.nodeType || u) {
- if (outerCache = elem[expando] || (elem[expando] = {}), (oldCache = outerCache[dir]) && (oldCache[0] === dirruns && oldCache[1] === doneName)) {
- return newCache[2] = oldCache[2];
- }
- if (outerCache[dir] = newCache, newCache[2] = matcher(elem, context, xml)) {
- return true;
- }
- }
- }
- }
- };
- }
- /**
- * @param {Array} matchers
- * @return {?}
- */
- function elementMatcher(matchers) {
- return matchers.length > 1 ? function(elem, context, xml) {
- var i = matchers.length;
- for (;i--;) {
- if (!matchers[i](elem, context, xml)) {
- return false;
- }
- }
- return true;
- } : matchers[0];
- }
- /**
- * @param {string} selector
- * @param {Array} contexts
- * @param {?} recurring
- * @return {?}
- */
- function multipleContexts(selector, contexts, recurring) {
- /** @type {number} */
- var i = 0;
- var len = contexts.length;
- for (;len > i;i++) {
- Sizzle(selector, contexts[i], recurring);
- }
- return recurring;
- }
- /**
- * @param {Array} a
- * @param {Object} str
- * @param {string} filter
- * @param {Object} context
- * @param {?} xml
- * @return {?}
- */
- function condense(a, str, filter, context, xml) {
- var value;
- /** @type {Array} */
- var bucket = [];
- /** @type {number} */
- var prefix = 0;
- var al = a.length;
- /** @type {boolean} */
- var isFile = null != str;
- for (;al > prefix;prefix++) {
- if (value = a[prefix]) {
- if (!filter || filter(value, context, xml)) {
- bucket.push(value);
- if (isFile) {
- str.push(prefix);
- }
- }
- }
- }
- return bucket;
- }
- /**
- * @param {string} preFilter
- * @param {Object} selector
- * @param {boolean} matcher
- * @param {Object} postFilter
- * @param {Object} postFinder
- * @param {Object} postSelector
- * @return {?}
- */
- function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
- return postFilter && (!postFilter[expando] && (postFilter = setMatcher(postFilter))), postFinder && (!postFinder[expando] && (postFinder = setMatcher(postFinder, postSelector))), markFunction(function(seed, results, context, xml) {
- var prop;
- var i;
- var val;
- /** @type {Array} */
- var preMap = [];
- /** @type {Array} */
- var parts = [];
- var preexisting = results.length;
- var target = seed || multipleContexts(selector || "*", context.nodeType ? [context] : context, []);
- var obj = !preFilter || !seed && selector ? target : condense(target, preMap, preFilter, context, xml);
- var matcherOut = matcher ? postFinder || (seed ? preFilter : preexisting || postFilter) ? [] : results : obj;
- if (matcher && matcher(obj, matcherOut, context, xml), postFilter) {
- prop = condense(matcherOut, parts);
- postFilter(prop, [], context, xml);
- i = prop.length;
- for (;i--;) {
- if (val = prop[i]) {
- /** @type {boolean} */
- matcherOut[parts[i]] = !(obj[parts[i]] = val);
- }
- }
- }
- if (seed) {
- if (postFinder || preFilter) {
- if (postFinder) {
- /** @type {Array} */
- prop = [];
- i = matcherOut.length;
- for (;i--;) {
- if (val = matcherOut[i]) {
- prop.push(obj[i] = val);
- }
- }
- postFinder(null, matcherOut = [], prop, xml);
- }
- i = matcherOut.length;
- for (;i--;) {
- if (val = matcherOut[i]) {
- if ((prop = postFinder ? jQuery.call(seed, val) : preMap[i]) > -1) {
- /** @type {boolean} */
- seed[prop] = !(results[prop] = val);
- }
- }
- }
- }
- } else {
- matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut);
- if (postFinder) {
- postFinder(null, results, matcherOut, xml);
- } else {
- push.apply(results, matcherOut);
- }
- }
- });
- }
- /**
- * @param {Object} tokens
- * @return {?}
- */
- function matcherFromTokens(tokens) {
- var nodes;
- var matcher;
- var j;
- var len = tokens.length;
- var leadingRelative = Expr.relative[tokens[0].type];
- var implicitRelative = leadingRelative || Expr.relative[" "];
- /** @type {number} */
- var i = leadingRelative ? 1 : 0;
- var matchContext = addCombinator(function(dataAndEvents) {
- return dataAndEvents === nodes;
- }, implicitRelative, true);
- var matchAnyContext = addCombinator(function(elements) {
- return jQuery.call(nodes, elements) > -1;
- }, implicitRelative, true);
- /** @type {Array} */
- var matchers = [function(elem, context, xml) {
- return!leadingRelative && (xml || context !== outermostContext) || ((nodes = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml));
- }];
- for (;len > i;i++) {
- if (matcher = Expr.relative[tokens[i].type]) {
- /** @type {Array} */
- matchers = [addCombinator(elementMatcher(matchers), matcher)];
- } else {
- if (matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches), matcher[expando]) {
- /** @type {number} */
- j = ++i;
- for (;len > j;j++) {
- if (Expr.relative[tokens[j].type]) {
- break;
- }
- }
- return setMatcher(i > 1 && elementMatcher(matchers), i > 1 && toSelector(tokens.slice(0, i - 1).concat({
- value : " " === tokens[i - 2].type ? "*" : ""
- })).replace(rtrim, "$1"), matcher, j > i && matcherFromTokens(tokens.slice(i, j)), len > j && matcherFromTokens(tokens = tokens.slice(j)), len > j && toSelector(tokens));
- }
- matchers.push(matcher);
- }
- }
- return elementMatcher(matchers);
- }
- /**
- * @param {Array} elementMatchers
- * @param {Array} setMatchers
- * @return {?}
- */
- function matcherFromGroupMatchers(elementMatchers, setMatchers) {
- /** @type {boolean} */
- var bySet = setMatchers.length > 0;
- /** @type {boolean} */
- var byElement = elementMatchers.length > 0;
- /**
- * @param {HTMLElement} seed
- * @param {Function} context
- * @param {?} xml
- * @param {Array} results
- * @param {Object} selFrom
- * @return {?}
- */
- var superMatcher = function(seed, context, xml, results, selFrom) {
- var elem;
- var j;
- var matcher;
- /** @type {number} */
- var matchedCount = 0;
- /** @type {string} */
- var i = "0";
- var unmatched = seed && [];
- /** @type {Array} */
- var setMatched = [];
- var contextBackup = outermostContext;
- var elems = seed || byElement && Expr.find.TAG("*", selFrom);
- var dirrunsUnique = dirruns += null == contextBackup ? 1 : Math.random() || 0.1;
- var len = elems.length;
- if (selFrom) {
- outermostContext = context !== doc && context;
- }
- for (;i !== len && null != (elem = elems[i]);i++) {
- if (byElement && elem) {
- /** @type {number} */
- j = 0;
- for (;matcher = elementMatchers[j++];) {
- if (matcher(elem, context, xml)) {
- results.push(elem);
- break;
- }
- }
- if (selFrom) {
- dirruns = dirrunsUnique;
- }
- }
- if (bySet) {
- if (elem = !matcher && elem) {
- matchedCount--;
- }
- if (seed) {
- unmatched.push(elem);
- }
- }
- }
- if (matchedCount += i, bySet && i !== matchedCount) {
- /** @type {number} */
- j = 0;
- for (;matcher = setMatchers[j++];) {
- matcher(unmatched, setMatched, context, xml);
- }
- if (seed) {
- if (matchedCount > 0) {
- for (;i--;) {
- if (!unmatched[i]) {
- if (!setMatched[i]) {
- setMatched[i] = pop.call(results);
- }
- }
- }
- }
- setMatched = condense(setMatched);
- }
- push.apply(results, setMatched);
- if (selFrom) {
- if (!seed) {
- if (setMatched.length > 0) {
- if (matchedCount + setMatchers.length > 1) {
- Sizzle.uniqueSort(results);
- }
- }
- }
- }
- }
- return selFrom && (dirruns = dirrunsUnique, outermostContext = contextBackup), unmatched;
- };
- return bySet ? markFunction(superMatcher) : superMatcher;
- }
- var i;
- var support;
- var Expr;
- var getText;
- var objectToString;
- var tokenize;
- var compile;
- var select;
- var outermostContext;
- var sortInput;
- var rt;
- var setDocument;
- var doc;
- var docElem;
- var documentIsHTML;
- var rbuggyQSA;
- var rbuggyMatches;
- var matches;
- var contains;
- /** @type {string} */
- var expando = "sizzle" + -new Date;
- var preferredDoc = win.document;
- /** @type {number} */
- var dirruns = 0;
- /** @type {number} */
- var done = 0;
- var classCache = createCache();
- var tokenCache = createCache();
- var compilerCache = createCache();
- /**
- * @param {?} a
- * @param {?} b
- * @return {?}
- */
- var sortOrder = function(a, b) {
- return a === b && (rt = true), 0;
- };
- /** @type {string} */
- var strundefined = "undefined";
- /** @type {number} */
- var MAX_NEGATIVE = -2147483648;
- /** @type {function (this:Object, *): boolean} */
- var hasOwn = {}.hasOwnProperty;
- /** @type {Array} */
- var arr = [];
- /** @type {function (this:(Array.<T>|{length: number})): T} */
- var pop = arr.pop;
- /** @type {function (this:(Array.<T>|{length: number}), ...[T]): number} */
- var f = arr.push;
- /** @type {function (this:(Array.<T>|{length: number}), ...[T]): number} */
- var push = arr.push;
- /** @type {function (this:(Array.<T>|string|{length: number}), *=, *=): Array.<T>} */
- var slice = arr.slice;
- /** @type {function (this:(Array.<T>|string|{length: number}), T, number=): number} */
- var jQuery = arr.indexOf || function(type) {
- /** @type {number} */
- var j = 0;
- var len = this.length;
- for (;len > j;j++) {
- if (this[j] === type) {
- return j;
- }
- }
- return-1;
- };
- /** @type {string} */
- var booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped";
- /** @type {string} */
- var version = "[\\x20\\t\\r\\n\\f]";
- /** @type {string} */
- var characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+";
- /** @type {string} */
- var identifier = characterEncoding.replace("w", "w#");
- /** @type {string} */
- var attributes = "\\[" + version + "*(" + characterEncoding + ")(?:" + version + "*([*^$|!~]?=)" + version + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + version + "*\\]";
- /** @type {string} */
- var pseudos = ":(" + characterEncoding + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|.*)\\)|)";
- /** @type {RegExp} */
- var rtrim = new RegExp("^" + version + "+|((?:^|[^\\\\])(?:\\\\.)*)" + version + "+$", "g");
- /** @type {RegExp} */
- var rcomma = new RegExp("^" + version + "*," + version + "*");
- /** @type {RegExp} */
- var rcombinators = new RegExp("^" + version + "*([>+~]|" + version + ")" + version + "*");
- /** @type {RegExp} */
- var rattributeQuotes = new RegExp("=" + version + "*([^\\]'\"]*?)" + version + "*\\]", "g");
- /** @type {RegExp} */
- var rpseudo = new RegExp(pseudos);
- /** @type {RegExp} */
- var ridentifier = new RegExp("^" + identifier + "$");
- var matchExpr = {
- ID : new RegExp("^#(" + characterEncoding + ")"),
- CLASS : new RegExp("^\\.(" + characterEncoding + ")"),
- TAG : new RegExp("^(" + characterEncoding.replace("w", "w*") + ")"),
- ATTR : new RegExp("^" + attributes),
- PSEUDO : new RegExp("^" + pseudos),
- CHILD : new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + version + "*(even|odd|(([+-]|)(\\d*)n|)" + version + "*(?:([+-]|)" + version + "*(\\d+)|))" + version + "*\\)|)", "i"),
- bool : new RegExp("^(?:" + booleans + ")$", "i"),
- needsContext : new RegExp("^" + version + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + version + "*((?:-\\d)?\\d*)" + version + "*\\)|)(?=[^-]|$)", "i")
- };
- /** @type {RegExp} */
- var rinputs = /^(?:input|select|textarea|button)$/i;
- /** @type {RegExp} */
- var rheader = /^h\d$/i;
- /** @type {RegExp} */
- var rnative = /^[^{]+\{\s*\[native \w/;
- /** @type {RegExp} */
- var rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/;
- /** @type {RegExp} */
- var rsibling = /[+~]/;
- /** @type {RegExp} */
- var r20 = /'|\\/g;
- /** @type {RegExp} */
- var runescape = new RegExp("\\\\([\\da-f]{1,6}" + version + "?|(" + version + ")|.)", "ig");
- /**
- * @param {?} _
- * @param {(number|string)} escaped
- * @param {boolean} escapedWhitespace
- * @return {?}
- */
- var funescape = function(_, escaped, escapedWhitespace) {
- /** @type {number} */
- var high = "0x" + escaped - 65536;
- return high !== high || escapedWhitespace ? escaped : 0 > high ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, 1023 & high | 56320);
- };
- try {
- push.apply(arr = slice.call(preferredDoc.childNodes), preferredDoc.childNodes);
- arr[preferredDoc.childNodes.length].nodeType;
- } catch (yr) {
- push = {
- /** @type {function (?, ?): undefined} */
- apply : arr.length ? function(recurring, args) {
- f.apply(recurring, slice.call(args));
- } : function(recurring, args) {
- var j = recurring.length;
- /** @type {number} */
- var i = 0;
- for (;recurring[j++] = args[i++];) {
- }
- /** @type {number} */
- recurring.length = j - 1;
- }
- };
- }
- support = Sizzle.support = {};
- /** @type {function (Object): ?} */
- objectToString = Sizzle.isXML = function(elem) {
- var node = elem && (elem.ownerDocument || elem).documentElement;
- return node ? "HTML" !== node.nodeName : false;
- };
- /** @type {function (boolean): ?} */
- setDocument = Sizzle.setDocument = function(node) {
- var hasCompare;
- var d = node ? node.ownerDocument || node : preferredDoc;
- var parent = d.defaultView;
- return d !== doc && (9 === d.nodeType && d.documentElement) ? (doc = d, docElem = d.documentElement, documentIsHTML = !objectToString(d), parent && (parent !== parent.top && (parent.addEventListener ? parent.addEventListener("unload", function() {
- setDocument();
- }, false) : parent.attachEvent && parent.attachEvent("onunload", function() {
- setDocument();
- }))), support.attributes = assert(function(div) {
- return div.className = "i", !div.getAttribute("className");
- }), support.getElementsByTagName = assert(function(div) {
- return div.appendChild(d.createComment("")), !div.getElementsByTagName("*").length;
- }), support.getElementsByClassName = rnative.test(d.getElementsByClassName) && assert(function(div) {
- return div.innerHTML = "<div class='a'></div><div class='a i'></div>", div.firstChild.className = "i", 2 === div.getElementsByClassName("i").length;
- }), support.getById = assert(function(div) {
- return docElem.appendChild(div).id = expando, !d.getElementsByName || !d.getElementsByName(expando).length;
- }), support.getById ? (Expr.find.ID = function(id, context) {
- if (typeof context.getElementById !== strundefined && documentIsHTML) {
- var m = context.getElementById(id);
- return m && m.parentNode ? [m] : [];
- }
- }, Expr.filter.ID = function(id) {
- var attrId = id.replace(runescape, funescape);
- return function(elem) {
- return elem.getAttribute("id") === attrId;
- };
- }) : (delete Expr.find.ID, Expr.filter.ID = function(id) {
- var attrId = id.replace(runescape, funescape);
- return function(elem) {
- var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
- return node && node.value === attrId;
- };
- }), Expr.find.TAG = support.getElementsByTagName ? function(tag, from) {
- if (typeof from.getElementsByTagName !== strundefined) {
- return from.getElementsByTagName(tag);
- }
- } : function(tag, from) {
- var node;
- /** @type {Array} */
- var tmp = [];
- /** @type {number} */
- var i = 0;
- var elem = from.getElementsByTagName(tag);
- if ("*" === tag) {
- for (;node = elem[i++];) {
- if (1 === node.nodeType) {
- tmp.push(node);
- }
- }
- return tmp;
- }
- return elem;
- }, Expr.find.CLASS = support.getElementsByClassName && function(className, context) {
- if (typeof context.getElementsByClassName !== strundefined && documentIsHTML) {
- return context.getElementsByClassName(className);
- }
- }, rbuggyMatches = [], rbuggyQSA = [], (support.qsa = rnative.test(d.querySelectorAll)) && (assert(function(div) {
- /** @type {string} */
- div.innerHTML = "<select msallowclip=''><option selected=''></option></select>";
- if (div.querySelectorAll("[msallowclip^='']").length) {
- rbuggyQSA.push("[*^$]=" + version + "*(?:''|\"\")");
- }
- if (!div.querySelectorAll("[selected]").length) {
- rbuggyQSA.push("\\[" + version + "*(?:value|" + booleans + ")");
- }
- if (!div.querySelectorAll(":checked").length) {
- rbuggyQSA.push(":checked");
- }
- }), assert(function(div) {
- var input = d.createElement("input");
- input.setAttribute("type", "hidden");
- div.appendChild(input).setAttribute("name", "D");
- if (div.querySelectorAll("[name=d]").length) {
- rbuggyQSA.push("name" + version + "*[*^$|!~]?=");
- }
- if (!div.querySelectorAll(":enabled").length) {
- rbuggyQSA.push(":enabled", ":disabled");
- }
- div.querySelectorAll("*,:x");
- rbuggyQSA.push(",.*:");
- })), (support.matchesSelector = rnative.test(matches = docElem.matches || (docElem.webkitMatchesSelector || (docElem.mozMatchesSelector || (docElem.oMatchesSelector || docElem.msMatchesSelector))))) && assert(function(div) {
- support.disconnectedMatch = matches.call(div, "div");
- matches.call(div, "[s!='']:x");
- rbuggyMatches.push("!=", pseudos);
- }), rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|")), rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join("|")), hasCompare = rnative.test(docElem.compareDocumentPosition), contains = hasCompare || rnative.test(docElem.contains) ? function(a, b) {
- var adown = 9 === a.nodeType ? a.documentElement : a;
- var bup = b && b.parentNode;
- return a === bup || !(!bup || (1 !== bup.nodeType || !(adown.contains ? adown.contains(bup) : a.compareDocumentPosition && 16 & a.compareDocumentPosition(bup))));
- } : function(a, b) {
- if (b) {
- for (;b = b.parentNode;) {
- if (b === a) {
- return true;
- }
- }
- }
- return false;
- }, sortOrder = hasCompare ? function(a, b) {
- if (a === b) {
- return rt = true, 0;
- }
- /** @type {number} */
- var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
- return compare ? compare : (compare = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1, 1 & compare || !support.sortDetached && b.compareDocumentPosition(a) === compare ? a === d || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ? -1 : b === d || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ? 1 : sortInput ? jQuery.call(sortInput, a) - jQuery.call(sortInput, b) : 0 : 4 & compare ? -1 : 1);
- } : function(a, b) {
- if (a === b) {
- return rt = true, 0;
- }
- var cur;
- /** @type {number} */
- var i = 0;
- var aup = a.parentNode;
- var bup = b.parentNode;
- /** @type {Array} */
- var ap = [a];
- /** @type {Array} */
- var bp = [b];
- if (!aup || !bup) {
- return a === d ? -1 : b === d ? 1 : aup ? -1 : bup ? 1 : sortInput ? jQuery.call(sortInput, a) - jQuery.call(sortInput, b) : 0;
- }
- if (aup === bup) {
- return siblingCheck(a, b);
- }
- cur = a;
- for (;cur = cur.parentNode;) {
- ap.unshift(cur);
- }
- cur = b;
- for (;cur = cur.parentNode;) {
- bp.unshift(cur);
- }
- for (;ap[i] === bp[i];) {
- i++;
- }
- return i ? siblingCheck(ap[i], bp[i]) : ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0;
- }, d) : doc;
- };
- /**
- * @param {string} expr
- * @param {Array} elements
- * @return {?}
- */
- Sizzle.matches = function(expr, elements) {
- return Sizzle(expr, null, null, elements);
- };
- /**
- * @param {Object} elem
- * @param {string} expr
- * @return {?}
- */
- Sizzle.matchesSelector = function(elem, expr) {
- if ((elem.ownerDocument || elem) !== doc && setDocument(elem), expr = expr.replace(rattributeQuotes, "='$1']"), !(!support.matchesSelector || (!documentIsHTML || (rbuggyMatches && rbuggyMatches.test(expr) || rbuggyQSA && rbuggyQSA.test(expr))))) {
- try {
- var ret = matches.call(elem, expr);
- if (ret || (support.disconnectedMatch || elem.document && 11 !== elem.document.nodeType)) {
- return ret;
- }
- } catch (f) {
- }
- }
- return Sizzle(expr, doc, null, [elem]).length > 0;
- };
- /**
- * @param {Object} context
- * @param {Object} b
- * @return {?}
- */
- Sizzle.contains = function(context, b) {
- return(context.ownerDocument || context) !== doc && setDocument(context), contains(context, b);
- };
- /**
- * @param {string} elem
- * @param {string} name
- * @return {?}
- */
- Sizzle.attr = function(elem, name) {
- if ((elem.ownerDocument || elem) !== doc) {
- setDocument(elem);
- }
- var fn = Expr.attrHandle[name.toLowerCase()];
- var val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : void 0;
- return void 0 !== val ? val : support.attributes || !documentIsHTML ? elem.getAttribute(name) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null;
- };
- /**
- * @param {string} args
- * @return {?}
- */
- Sizzle.error = function(args) {
- throw new Error("Syntax error, unrecognized expression: " + args);
- };
- /**
- * @param {Array} results
- * @return {?}
- */
- Sizzle.uniqueSort = function(results) {
- var elem;
- /** @type {Array} */
- var duplicates = [];
- /** @type {number} */
- var j = 0;
- /** @type {number} */
- var i = 0;
- if (rt = !support.detectDuplicates, sortInput = !support.sortStable && results.slice(0), results.sort(sortOrder), rt) {
- for (;elem = results[i++];) {
- if (elem === results[i]) {
- /** @type {number} */
- j = duplicates.push(i);
- }
- }
- for (;j--;) {
- results.splice(duplicates[j], 1);
- }
- }
- return sortInput = null, results;
- };
- /** @type {function (HTMLElement): ?} */
- getText = Sizzle.getText = function(elem) {
- var node;
- /** @type {string} */
- var ret = "";
- /** @type {number} */
- var i = 0;
- var nodeType = elem.nodeType;
- if (nodeType) {
- if (1 === nodeType || (9 === nodeType || 11 === nodeType)) {
- if ("string" == typeof elem.textContent) {
- return elem.textContent;
- }
- elem = elem.firstChild;
- for (;elem;elem = elem.nextSibling) {
- ret += getText(elem);
- }
- } else {
- if (3 === nodeType || 4 === nodeType) {
- return elem.nodeValue;
- }
- }
- } else {
- for (;node = elem[i++];) {
- ret += getText(node);
- }
- }
- return ret;
- };
- Expr = Sizzle.selectors = {
- cacheLength : 50,
- /** @type {function (Function): ?} */
- createPseudo : markFunction,
- match : matchExpr,
- attrHandle : {},
- find : {},
- relative : {
- ">" : {
- dir : "parentNode",
- first : true
- },
- " " : {
- dir : "parentNode"
- },
- "+" : {
- dir : "previousSibling",
- first : true
- },
- "~" : {
- dir : "previousSibling"
- }
- },
- preFilter : {
- /**
- * @param {Array} match
- * @return {?}
- */
- ATTR : function(match) {
- return match[1] = match[1].replace(runescape, funescape), match[3] = (match[3] || (match[4] || (match[5] || ""))).replace(runescape, funescape), "~=" === match[2] && (match[3] = " " + match[3] + " "), match.slice(0, 4);
- },
- /**
- * @param {Array} match
- * @return {?}
- */
- CHILD : function(match) {
- return match[1] = match[1].toLowerCase(), "nth" === match[1].slice(0, 3) ? (match[3] || Sizzle.error(match[0]), match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * ("even" === match[3] || "odd" === match[3])), match[5] = +(match[7] + match[8] || "odd" === match[3])) : match[3] && Sizzle.error(match[0]), match;
- },
- /**
- * @param {Array} match
- * @return {?}
- */
- PSEUDO : function(match) {
- var excess;
- var unquoted = !match[6] && match[2];
- return matchExpr.CHILD.test(match[0]) ? null : (match[3] ? match[2] = match[4] || (match[5] || "") : unquoted && (rpseudo.test(unquoted) && ((excess = tokenize(unquoted, true)) && ((excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length) && (match[0] = match[0].slice(0, excess), match[2] = unquoted.slice(0, excess))))), match.slice(0, 3));
- }
- },
- filter : {
- /**
- * @param {string} nodeNameSelector
- * @return {?}
- */
- TAG : function(nodeNameSelector) {
- var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
- return "*" === nodeNameSelector ? function() {
- return true;
- } : function(elem) {
- return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
- };
- },
- /**
- * @param {string} className
- * @return {?}
- */
- CLASS : function(className) {
- var pattern = classCache[className + " "];
- return pattern || (pattern = new RegExp("(^|" + version + ")" + className + "(" + version + "|$)")) && classCache(className, function(elem) {
- return pattern.test("string" == typeof elem.className && elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || ""));
- });
- },
- /**
- * @param {string} name
- * @param {string} not
- * @param {string} b
- * @return {?}
- */
- ATTR : function(name, not, b) {
- return function(elem) {
- var a = Sizzle.attr(elem, name);
- return null == a ? "!=" === not : not ? (a += "", "=" === not ? a === b : "!=" === not ? a !== b : "^=" === not ? b && 0 === a.indexOf(b) : "*=" === not ? b && a.indexOf(b) > -1 : "$=" === not ? b && a.slice(-b.length) === b : "~=" === not ? (" " + a + " ").indexOf(b) > -1 : "|=" === not ? a === b || a.slice(0, b.length + 1) === b + "-" : false) : true;
- };
- },
- /**
- * @param {string} type
- * @param {string} argument
- * @param {?} dataAndEvents
- * @param {number} first
- * @param {number} last
- * @return {?}
- */
- CHILD : function(type, argument, dataAndEvents, first, last) {
- /** @type {boolean} */
- var simple = "nth" !== type.slice(0, 3);
- /** @type {boolean} */
- var forward = "last" !== type.slice(-4);
- /** @type {boolean} */
- var value = "of-type" === argument;
- return 1 === first && 0 === last ? function(contestant) {
- return!!contestant.parentNode;
- } : function(elem, dataAndEvents, computed) {
- var cache;
- var outerCache;
- var node;
- var diff;
- var nodeIndex;
- var eventPath;
- /** @type {string} */
- var which = simple !== forward ? "nextSibling" : "previousSibling";
- var parent = elem.parentNode;
- var attrNames = value && elem.nodeName.toLowerCase();
- /** @type {boolean} */
- var useCache = !computed && !value;
- if (parent) {
- if (simple) {
- for (;which;) {
- /** @type {Object} */
- node = elem;
- for (;node = node[which];) {
- if (value ? node.nodeName.toLowerCase() === attrNames : 1 === node.nodeType) {
- return false;
- }
- }
- /** @type {(boolean|string)} */
- eventPath = which = "only" === type && (!eventPath && "nextSibling");
- }
- return true;
- }
- if (eventPath = [forward ? parent.firstChild : parent.lastChild], forward && useCache) {
- outerCache = parent[expando] || (parent[expando] = {});
- cache = outerCache[type] || [];
- nodeIndex = cache[0] === dirruns && cache[1];
- diff = cache[0] === dirruns && cache[2];
- node = nodeIndex && parent.childNodes[nodeIndex];
- for (;node = ++nodeIndex && (node && node[which]) || ((diff = nodeIndex = 0) || eventPath.pop());) {
- if (1 === node.nodeType && (++diff && node === elem)) {
- /** @type {Array} */
- outerCache[type] = [dirruns, nodeIndex, diff];
- break;
- }
- }
- } else {
- if (useCache && ((cache = (elem[expando] || (elem[expando] = {}))[type]) && cache[0] === dirruns)) {
- diff = cache[1];
- } else {
- for (;node = ++nodeIndex && (node && node[which]) || ((diff = nodeIndex = 0) || eventPath.pop());) {
- if ((value ? node.nodeName.toLowerCase() === attrNames : 1 === node.nodeType) && (++diff && (useCache && ((node[expando] || (node[expando] = {}))[type] = [dirruns, diff]), node === elem))) {
- break;
- }
- }
- }
- }
- return diff -= last, diff === first || diff % first == 0 && diff / first >= 0;
- }
- };
- },
- /**
- * @param {string} pseudo
- * @param {?} context
- * @return {?}
- */
- PSEUDO : function(pseudo, context) {
- var args;
- var fn = Expr.pseudos[pseudo] || (Expr.setFilters[pseudo.toLowerCase()] || Sizzle.error("unsupported pseudo: " + pseudo));
- return fn[expando] ? fn(context) : fn.length > 1 ? (args = [pseudo, pseudo, "", context], Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function(arg, object) {
- var index;
- var elements = fn(arg, context);
- var i = elements.length;
- for (;i--;) {
- /** @type {number} */
- index = jQuery.call(arg, elements[i]);
- /** @type {boolean} */
- arg[index] = !(object[index] = elements[i]);
- }
- }) : function(err) {
- return fn(err, 0, args);
- }) : fn;
- }
- },
- pseudos : {
- not : markFunction(function(selector) {
- /** @type {Array} */
- var elem = [];
- /** @type {Array} */
- var memory = [];
- var matcher = compile(selector.replace(rtrim, "$1"));
- return matcher[expando] ? markFunction(function(seed, qs, dataAndEvents, xml) {
- var val;
- var unmatched = matcher(seed, null, xml, []);
- var i = seed.length;
- for (;i--;) {
- if (val = unmatched[i]) {
- /** @type {boolean} */
- seed[i] = !(qs[i] = val);
- }
- }
- }) : function(value, dataAndEvents, xml) {
- return elem[0] = value, matcher(elem, null, xml, memory), !memory.pop();
- };
- }),
- has : markFunction(function(selector) {
- return function(elem) {
- return Sizzle(selector, elem).length > 0;
- };
- }),
- contains : markFunction(function(other) {
- return function(elem) {
- return(elem.textContent || (elem.innerText || getText(elem))).indexOf(other) > -1;
- };
- }),
- lang : markFunction(function(lang) {
- return ridentifier.test(lang || "") || Sizzle.error("unsupported lang: " + lang), lang = lang.replace(runescape, funescape).toLowerCase(), function(elem) {
- var elemLang;
- do {
- if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) {
- return elemLang = elemLang.toLowerCase(), elemLang === lang || 0 === elemLang.indexOf(lang + "-");
- }
- } while ((elem = elem.parentNode) && 1 === elem.nodeType);
- return false;
- };
- }),
- /**
- * @param {string} args
- * @return {?}
- */
- target : function(args) {
- var models = win.location && win.location.hash;
- return models && models.slice(1) === args.id;
- },
- /**
- * @param {undefined} elem
- * @return {?}
- */
- root : function(elem) {
- return elem === docElem;
- },
- /**
- * @param {string} args
- * @return {?}
- */
- focus : function(args) {
- return args === doc.activeElement && ((!doc.hasFocus || doc.hasFocus()) && !!(args.type || (args.href || ~args.tabIndex)));
- },
- /**
- * @param {EventTarget} a
- * @return {?}
- */
- enabled : function(a) {
- return a.disabled === false;
- },
- /**
- * @param {EventTarget} elem
- * @return {?}
- */
- disabled : function(elem) {
- return elem.disabled === true;
- },
- /**
- * @param {Node} node
- * @return {?}
- */
- checked : function(node) {
- var b = node.nodeName.toLowerCase();
- return "input" === b && !!node.checked || "option" === b && !!node.selected;
- },
- /**
- * @param {Node} elem
- * @return {?}
- */
- selected : function(elem) {
- return elem.parentNode && elem.parentNode.selectedIndex, elem.selected === true;
- },
- /**
- * @param {Object} elem
- * @return {?}
- */
- empty : function(elem) {
- elem = elem.firstChild;
- for (;elem;elem = elem.nextSibling) {
- if (elem.nodeType < 6) {
- return false;
- }
- }
- return true;
- },
- /**
- * @param {Object} elem
- * @return {?}
- */
- parent : function(elem) {
- return!Expr.pseudos.empty(elem);
- },
- /**
- * @param {Node} elem
- * @return {?}
- */
- header : function(elem) {
- return rheader.test(elem.nodeName);
- },
- /**
- * @param {Node} elem
- * @return {?}
- */
- input : function(elem) {
- return rinputs.test(elem.nodeName);
- },
- /**
- * @param {Node} elem
- * @return {?}
- */
- button : function(elem) {
- var b = elem.nodeName.toLowerCase();
- return "input" === b && "button" === elem.type || "button" === b;
- },
- /**
- * @param {Node} elem
- * @return {?}
- */
- text : function(elem) {
- var evt;
- return "input" === elem.nodeName.toLowerCase() && ("text" === elem.type && (null == (evt = elem.getAttribute("type")) || "text" === evt.toLowerCase()));
- },
- first : createPositionalPseudo(function() {
- return[0];
- }),
- last : createPositionalPseudo(function(dataAndEvents, deepDataAndEvents) {
- return[deepDataAndEvents - 1];
- }),
- eq : createPositionalPseudo(function(dataAndEvents, length, index) {
- return[0 > index ? index + length : index];
- }),
- even : createPositionalPseudo(function(assigns, dataAndEvents) {
- /** @type {number} */
- var vvar = 0;
- for (;dataAndEvents > vvar;vvar += 2) {
- assigns.push(vvar);
- }
- return assigns;
- }),
- odd : createPositionalPseudo(function(assigns, dataAndEvents) {
- /** @type {number} */
- var vvar = 1;
- for (;dataAndEvents > vvar;vvar += 2) {
- assigns.push(vvar);
- }
- return assigns;
- }),
- lt : createPositionalPseudo(function(assigns, length, index) {
- var vvar = 0 > index ? index + length : index;
- for (;--vvar >= 0;) {
- assigns.push(vvar);
- }
- return assigns;
- }),
- gt : createPositionalPseudo(function(assigns, length, index) {
- var vvar = 0 > index ? index + length : index;
- for (;++vvar < length;) {
- assigns.push(vvar);
- }
- return assigns;
- })
- }
- };
- Expr.pseudos.nth = Expr.pseudos.eq;
- for (i in{
- radio : true,
- checkbox : true,
- file : true,
- password : true,
- image : true
- }) {
- Expr.pseudos[i] = createInputPseudo(i);
- }
- for (i in{
- submit : true,
- reset : true
- }) {
- Expr.pseudos[i] = createButtonPseudo(i);
- }
- return setFilters.prototype = Expr.filters = Expr.pseudos, Expr.setFilters = new setFilters, tokenize = Sizzle.tokenize = function(ast, parseOnly) {
- var matched;
- var match;
- var tokens;
- var type;
- var soFar;
- var groups;
- var preFilters;
- var cached = tokenCache[ast + " "];
- if (cached) {
- return parseOnly ? 0 : cached.slice(0);
- }
- /** @type {string} */
- soFar = ast;
- /** @type {Array} */
- groups = [];
- preFilters = Expr.preFilter;
- for (;soFar;) {
- if (!matched || (match = rcomma.exec(soFar))) {
- if (match) {
- soFar = soFar.slice(match[0].length) || soFar;
- }
- groups.push(tokens = []);
- }
- /** @type {boolean} */
- matched = false;
- if (match = rcombinators.exec(soFar)) {
- /** @type {string} */
- matched = match.shift();
- tokens.push({
- value : matched,
- type : match[0].replace(rtrim, " ")
- });
- soFar = soFar.slice(matched.length);
- }
- for (type in Expr.filter) {
- if (match = matchExpr[type].exec(soFar)) {
- if (!preFilters[type] || (match = preFilters[type](match))) {
- matched = match.shift();
- tokens.push({
- value : matched,
- type : type,
- matches : match
- });
- soFar = soFar.slice(matched.length);
- }
- }
- }
- if (!matched) {
- break;
- }
- }
- return parseOnly ? soFar.length : soFar ? Sizzle.error(ast) : tokenCache(ast, groups).slice(0);
- }, compile = Sizzle.compile = function(selector, group) {
- var i;
- /** @type {Array} */
- var setMatchers = [];
- /** @type {Array} */
- var elementMatchers = [];
- var cached = compilerCache[selector + " "];
- if (!cached) {
- if (!group) {
- group = tokenize(selector);
- }
- i = group.length;
- for (;i--;) {
- cached = matcherFromTokens(group[i]);
- if (cached[expando]) {
- setMatchers.push(cached);
- } else {
- elementMatchers.push(cached);
- }
- }
- cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers));
- /** @type {string} */
- cached.selector = selector;
- }
- return cached;
- }, select = Sizzle.select = function(selector, context, results, ast) {
- var i;
- var tokens;
- var token;
- var type;
- var find;
- /** @type {(Function|boolean)} */
- var compiled = "function" == typeof selector && selector;
- var match = !ast && tokenize(selector = compiled.selector || selector);
- if (results = results || [], 1 === match.length) {
- if (tokens = match[0] = match[0].slice(0), tokens.length > 2 && ("ID" === (token = tokens[0]).type && (support.getById && (9 === context.nodeType && (documentIsHTML && Expr.relative[tokens[1].type]))))) {
- if (context = (Expr.find.ID(token.matches[0].replace(runescape, funescape), context) || [])[0], !context) {
- return results;
- }
- if (compiled) {
- context = context.parentNode;
- }
- selector = selector.slice(tokens.shift().value.length);
- }
- i = matchExpr.needsContext.test(selector) ? 0 : tokens.length;
- for (;i--;) {
- if (token = tokens[i], Expr.relative[type = token.type]) {
- break;
- }
- if ((find = Expr.find[type]) && (ast = find(token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && testContext(context.parentNode) || context))) {
- if (tokens.splice(i, 1), selector = ast.length && toSelector(tokens), !selector) {
- return push.apply(results, ast), results;
- }
- break;
- }
- }
- }
- return(compiled || compile(selector, match))(ast, context, !documentIsHTML, results, rsibling.test(selector) && testContext(context.parentNode) || context), results;
- }, support.sortStable = expando.split("").sort(sortOrder).join("") === expando, support.detectDuplicates = !!rt, setDocument(), support.sortDetached = assert(function(div1) {
- return 1 & div1.compareDocumentPosition(doc.createElement("div"));
- }), assert(function(div) {
- return div.innerHTML = "<a href='#'></a>", "#" === div.firstChild.getAttribute("href");
- }) || addHandle("type|href|height|width", function(elem, name, dataAndEvents) {
- if (!dataAndEvents) {
- return elem.getAttribute(name, "type" === name.toLowerCase() ? 1 : 2);
- }
- }), support.attributes && assert(function(div) {
- return div.innerHTML = "<input/>", div.firstChild.setAttribute("value", ""), "" === div.firstChild.getAttribute("value");
- }) || addHandle("value", function(target, deepDataAndEvents, dataAndEvents) {
- if (!dataAndEvents && "input" === target.nodeName.toLowerCase()) {
- return target.defaultValue;
- }
- }), assert(function(div) {
- return null == div.getAttribute("disabled");
- }) || addHandle(booleans, function(elem, name, dataAndEvents) {
- var val;
- if (!dataAndEvents) {
- return elem[name] === true ? name.toLowerCase() : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null;
- }
- }), Sizzle;
- }(win);
- jQuery.find = Sizzle;
- jQuery.expr = Sizzle.selectors;
- jQuery.expr[":"] = jQuery.expr.pseudos;
- jQuery.unique = Sizzle.uniqueSort;
- jQuery.text = Sizzle.getText;
- jQuery.isXMLDoc = Sizzle.isXML;
- jQuery.contains = Sizzle.contains;
- var rneedsContext = jQuery.expr.match.needsContext;
- /** @type {RegExp} */
- var rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/;
- /** @type {RegExp} */
- var isSimple = /^.[^:#\[\.,]*$/;
- /**
- * @param {string} expr
- * @param {string} elems
- * @param {boolean} not
- * @return {?}
- */
- jQuery.filter = function(expr, elems, not) {
- var elem = elems[0];
- return not && (expr = ":not(" + expr + ")"), 1 === elems.length && 1 === elem.nodeType ? jQuery.find.matchesSelector(elem, expr) ? [elem] : [] : jQuery.find.matches(expr, jQuery.grep(elems, function(dest) {
- return 1 === dest.nodeType;
- }));
- };
- jQuery.fn.extend({
- /**
- * @param {string} selector
- * @return {?}
- */
- find : function(selector) {
- var i;
- var len = this.length;
- /** @type {Array} */
- var ret = [];
- var self = this;
- if ("string" != typeof selector) {
- return this.pushStack(jQuery(selector).filter(function() {
- /** @type {number} */
- i = 0;
- for (;len > i;i++) {
- if (jQuery.contains(self[i], this)) {
- return true;
- }
- }
- }));
- }
- /** @type {number} */
- i = 0;
- for (;len > i;i++) {
- jQuery.find(selector, self[i], ret);
- }
- return ret = this.pushStack(len > 1 ? jQuery.unique(ret) : ret), ret.selector = this.selector ? this.selector + " " + selector : selector, ret;
- },
- /**
- * @param {Object} selector
- * @return {?}
- */
- filter : function(selector) {
- return this.pushStack(winnow(this, selector || [], false));
- },
- /**
- * @param {Array} selector
- * @return {?}
- */
- not : function(selector) {
- return this.pushStack(winnow(this, selector || [], true));
- },
- /**
- * @param {string} selector
- * @return {?}
- */
- is : function(selector) {
- return!!winnow(this, "string" == typeof selector && rneedsContext.test(selector) ? jQuery(selector) : selector || [], false).length;
- }
- });
- /** @type {RegExp} */
- rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;
- /** @type {function (string, Object): ?} */
- init = jQuery.fn.init = function(selector, context) {
- var match;
- var a;
- if (!selector) {
- return this;
- }
- if ("string" == typeof selector) {
- if (match = "<" === selector[0] && (">" === selector[selector.length - 1] && selector.length >= 3) ? [null, selector, null] : rquickExpr.exec(selector), !match || !match[1] && context) {
- return!context || context.jquery ? (context || rootjQuery).find(selector) : this.constructor(context).find(selector);
- }
- if (match[1]) {
- if (context = context instanceof jQuery ? context[0] : context, jQuery.merge(this, jQuery.parseHTML(match[1], context && context.nodeType ? context.ownerDocument || context : doc, true)), rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {
- for (match in context) {
- if (jQuery.isFunction(this[match])) {
- this[match](context[match]);
- } else {
- this.attr(match, context[match]);
- }
- }
- }
- return this;
- }
- return a = doc.getElementById(match[2]), a && (a.parentNode && (this.length = 1, this[0] = a)), this.context = doc, this.selector = selector, this;
- }
- return selector.nodeType ? (this.context = this[0] = selector, this.length = 1, this) : jQuery.isFunction(selector) ? "undefined" != typeof rootjQuery.ready ? rootjQuery.ready(selector) : selector(jQuery) : (void 0 !== selector.selector && (this.selector = selector.selector, this.context = selector.context), jQuery.makeArray(selector, this));
- };
- init.prototype = jQuery.fn;
- rootjQuery = jQuery(doc);
- /** @type {RegExp} */
- rparentsprev = /^(?:parents|prev(?:Until|All))/;
- data = {
- children : true,
- contents : true,
- next : true,
- prev : true
- };
- jQuery.extend({
- /**
- * @param {Object} elem
- * @param {string} dir
- * @param {string} until
- * @return {?}
- */
- dir : function(elem, dir, until) {
- /** @type {Array} */
- var matched = [];
- /** @type {boolean} */
- var truncate = void 0 !== until;
- for (;(elem = elem[dir]) && 9 !== elem.nodeType;) {
- if (1 === elem.nodeType) {
- if (truncate && jQuery(elem).is(until)) {
- break;
- }
- matched.push(elem);
- }
- }
- return matched;
- },
- /**
- * @param {Object} n
- * @param {Object} elem
- * @return {?}
- */
- sibling : function(n, elem) {
- /** @type {Array} */
- var r = [];
- for (;n;n = n.nextSibling) {
- if (1 === n.nodeType) {
- if (n !== elem) {
- r.push(n);
- }
- }
- }
- return r;
- }
- });
- jQuery.fn.extend({
- /**
- * @param {string} target
- * @return {?}
- */
- has : function(target) {
- var targets = jQuery(target, this);
- var l = targets.length;
- return this.filter(function() {
- /** @type {number} */
- var i = 0;
- for (;l > i;i++) {
- if (jQuery.contains(this, targets[i])) {
- return true;
- }
- }
- });
- },
- /**
- * @param {string} selectors
- * @param {number} context
- * @return {?}
- */
- closest : function(selectors, context) {
- var cur;
- /** @type {number} */
- var i = 0;
- var l = this.length;
- /** @type {Array} */
- var matched = [];
- var pos = rneedsContext.test(selectors) || "string" != typeof selectors ? jQuery(selectors, context || this.context) : 0;
- for (;l > i;i++) {
- cur = this[i];
- for (;cur && cur !== context;cur = cur.parentNode) {
- if (cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : 1 === cur.nodeType && jQuery.find.matchesSelector(cur, selectors))) {
- matched.push(cur);
- break;
- }
- }
- }
- return this.pushStack(matched.length > 1 ? jQuery.unique(matched) : matched);
- },
- /**
- * @param {boolean} elem
- * @return {?}
- */
- index : function(elem) {
- return elem ? "string" == typeof elem ? core_indexOf.call(jQuery(elem), this[0]) : core_indexOf.call(this, elem.jquery ? elem[0] : elem) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1;
- },
- /**
- * @param {number} selector
- * @param {?} context
- * @return {?}
- */
- add : function(selector, context) {
- return this.pushStack(jQuery.unique(jQuery.merge(this.get(), jQuery(selector, context))));
- },
- /**
- * @param {Object} selector
- * @return {?}
- */
- addBack : function(selector) {
- return this.add(null == selector ? this.prevObject : this.prevObject.filter(selector));
- }
- });
- jQuery.each({
- /**
- * @param {Node} elem
- * @return {?}
- */
- parent : function(elem) {
- var parent = elem.parentNode;
- return parent && 11 !== parent.nodeType ? parent : null;
- },
- /**
- * @param {string} elem
- * @return {?}
- */
- parents : function(elem) {
- return jQuery.dir(elem, "parentNode");
- },
- /**
- * @param {Object} elem
- * @param {?} i
- * @param {string} until
- * @return {?}
- */
- parentsUntil : function(elem, i, until) {
- return jQuery.dir(elem, "parentNode", until);
- },
- /**
- * @param {Object} elem
- * @return {?}
- */
- next : function(elem) {
- return sibling(elem, "nextSibling");
- },
- /**
- * @param {Object} elem
- * @return {?}
- */
- prev : function(elem) {
- return sibling(elem, "previousSibling");
- },
- /**
- * @param {Object} elem
- * @return {?}
- */
- nextAll : function(elem) {
- return jQuery.dir(elem, "nextSibling");
- },
- /**
- * @param {Object} elem
- * @return {?}
- */
- prevAll : function(elem) {
- return jQuery.dir(elem, "previousSibling");
- },
- /**
- * @param {Object} elem
- * @param {?} i
- * @param {string} until
- * @return {?}
- */
- nextUntil : function(elem, i, until) {
- return jQuery.dir(elem, "nextSibling", until);
- },
- /**
- * @param {Object} elem
- * @param {?} i
- * @param {string} until
- * @return {?}
- */
- prevUntil : function(elem, i, until) {
- return jQuery.dir(elem, "previousSibling", until);
- },
- /**
- * @param {HTMLElement} elem
- * @return {?}
- */
- siblings : function(elem) {
- return jQuery.sibling((elem.parentNode || {}).firstChild, elem);
- },
- /**
- * @param {Element} elem
- * @return {?}
- */
- children : function(elem) {
- return jQuery.sibling(elem.firstChild);
- },
- /**
- * @param {Element} elem
- * @return {?}
- */
- contents : function(elem) {
- return elem.contentDocument || jQuery.merge([], elem.childNodes);
- }
- }, function(name, fn) {
- /**
- * @param {boolean} until
- * @param {boolean} selector
- * @return {?}
- */
- jQuery.fn[name] = function(until, selector) {
- var matched = jQuery.map(this, fn, until);
- return "Until" !== name.slice(-5) && (selector = until), selector && ("string" == typeof selector && (matched = jQuery.filter(selector, matched))), this.length > 1 && (data[name] || jQuery.unique(matched), rparentsprev.test(name) && matched.reverse()), this.pushStack(matched);
- };
- });
- /** @type {RegExp} */
- core_rnotwhite = /\S+/g;
- optionsCache = {};
- /**
- * @param {Object} options
- * @return {?}
- */
- jQuery.Callbacks = function(options) {
- options = "string" == typeof options ? optionsCache[options] || createOptions(options) : jQuery.extend({}, options);
- var memory;
- var h;
- var r;
- var firingStart;
- var i;
- var firingIndex;
- /** @type {Array} */
- var list = [];
- /** @type {(Array|boolean)} */
- var stack = !options.once && [];
- /**
- * @param {Array} data
- * @return {undefined}
- */
- var fire = function(data) {
- memory = options.memory && data;
- /** @type {boolean} */
- h = true;
- firingIndex = firingStart || 0;
- /** @type {number} */
- firingStart = 0;
- i = list.length;
- /** @type {boolean} */
- r = true;
- for (;list && i > firingIndex;firingIndex++) {
- if (list[firingIndex].apply(data[0], data[1]) === false && options.stopOnFalse) {
- /** @type {boolean} */
- memory = false;
- break;
- }
- }
- /** @type {boolean} */
- r = false;
- if (list) {
- if (stack) {
- if (stack.length) {
- fire(stack.shift());
- }
- } else {
- if (memory) {
- /** @type {Array} */
- list = [];
- } else {
- self.disable();
- }
- }
- }
- };
- var self = {
- /**
- * @return {?}
- */
- add : function() {
- if (list) {
- var start = list.length;
- !function add(args) {
- jQuery.each(args, function(dataAndEvents, arg) {
- var type = jQuery.type(arg);
- if ("function" === type) {
- if (!(options.unique && self.has(arg))) {
- list.push(arg);
- }
- } else {
- if (arg) {
- if (arg.length) {
- if ("string" !== type) {
- add(arg);
- }
- }
- }
- }
- });
- }(arguments);
- if (r) {
- i = list.length;
- } else {
- if (memory) {
- firingStart = start;
- fire(memory);
- }
- }
- }
- return this;
- },
- /**
- * @return {?}
- */
- remove : function() {
- return list && jQuery.each(arguments, function(dataAndEvents, arg) {
- var index;
- for (;(index = jQuery.inArray(arg, list, index)) > -1;) {
- list.splice(index, 1);
- if (r) {
- if (i >= index) {
- i--;
- }
- if (firingIndex >= index) {
- firingIndex--;
- }
- }
- }
- }), this;
- },
- /**
- * @param {string} fn
- * @return {?}
- */
- has : function(fn) {
- return fn ? jQuery.inArray(fn, list) > -1 : !(!list || !list.length);
- },
- /**
- * @return {?}
- */
- empty : function() {
- return list = [], i = 0, this;
- },
- /**
- * @return {?}
- */
- disable : function() {
- return list = stack = memory = void 0, this;
- },
- /**
- * @return {?}
- */
- disabled : function() {
- return!list;
- },
- /**
- * @return {?}
- */
- lock : function() {
- return stack = void 0, memory || self.disable(), this;
- },
- /**
- * @return {?}
- */
- locked : function() {
- return!stack;
- },
- /**
- * @param {?} context
- * @param {Array} args
- * @return {?}
- */
- fireWith : function(context, args) {
- return!list || (h && !stack || (args = args || [], args = [context, args.slice ? args.slice() : args], r ? stack.push(args) : fire(args))), this;
- },
- /**
- * @return {?}
- */
- fire : function() {
- return self.fireWith(this, arguments), this;
- },
- /**
- * @return {?}
- */
- fired : function() {
- return!!h;
- }
- };
- return self;
- };
- jQuery.extend({
- /**
- * @param {Function} func
- * @return {?}
- */
- Deferred : function(func) {
- /** @type {Array} */
- var which = [["resolve", "done", jQuery.Callbacks("once memory"), "resolved"], ["reject", "fail", jQuery.Callbacks("once memory"), "rejected"], ["notify", "progress", jQuery.Callbacks("memory")]];
- /** @type {string} */
- var state = "pending";
- var promise = {
- /**
- * @return {?}
- */
- state : function() {
- return state;
- },
- /**
- * @return {?}
- */
- always : function() {
- return deferred.done(arguments).fail(arguments), this;
- },
- /**
- * @return {?}
- */
- then : function() {
- /** @type {Arguments} */
- var fns = arguments;
- return jQuery.Deferred(function(newDefer) {
- jQuery.each(which, function(i, tuple) {
- var fn = jQuery.isFunction(fns[i]) && fns[i];
- deferred[tuple[1]](function() {
- var returned = fn && fn.apply(this, arguments);
- if (returned && jQuery.isFunction(returned.promise)) {
- returned.promise().done(newDefer.resolve).fail(newDefer.reject).progress(newDefer.notify);
- } else {
- newDefer[tuple[0] + "With"](this === promise ? newDefer.promise() : this, fn ? [returned] : arguments);
- }
- });
- });
- /** @type {null} */
- fns = null;
- }).promise();
- },
- /**
- * @param {string} obj
- * @return {?}
- */
- promise : function(obj) {
- return null != obj ? jQuery.extend(obj, promise) : promise;
- }
- };
- var deferred = {};
- return promise.pipe = promise.then, jQuery.each(which, function(dataAndEvents, tuple) {
- var list = tuple[2];
- var stateString = tuple[3];
- promise[tuple[1]] = list.add;
- if (stateString) {
- list.add(function() {
- state = stateString;
- }, which[1 ^ dataAndEvents][2].disable, which[2][2].lock);
- }
- /**
- * @return {?}
- */
- deferred[tuple[0]] = function() {
- return deferred[tuple[0] + "With"](this === deferred ? promise : this, arguments), this;
- };
- deferred[tuple[0] + "With"] = list.fireWith;
- }), promise.promise(deferred), func && func.call(deferred, deferred), deferred;
- },
- /**
- * @param {Object} subordinate
- * @return {?}
- */
- when : function(subordinate) {
- /** @type {number} */
- var i = 0;
- /** @type {Array.<?>} */
- var resolveValues = core_slice.call(arguments);
- /** @type {number} */
- var length = resolveValues.length;
- /** @type {number} */
- var remaining = 1 !== length || subordinate && jQuery.isFunction(subordinate.promise) ? length : 0;
- var deferred = 1 === remaining ? subordinate : jQuery.Deferred();
- /**
- * @param {number} i
- * @param {(Array|NodeList)} contexts
- * @param {Array} values
- * @return {?}
- */
- var updateFunc = function(i, contexts, values) {
- return function(value) {
- contexts[i] = this;
- values[i] = arguments.length > 1 ? core_slice.call(arguments) : value;
- if (values === progressValues) {
- deferred.notifyWith(contexts, values);
- } else {
- if (!--remaining) {
- deferred.resolveWith(contexts, values);
- }
- }
- };
- };
- var progressValues;
- var progressContexts;
- var resolveContexts;
- if (length > 1) {
- /** @type {Array} */
- progressValues = new Array(length);
- /** @type {Array} */
- progressContexts = new Array(length);
- /** @type {Array} */
- resolveContexts = new Array(length);
- for (;length > i;i++) {
- if (resolveValues[i] && jQuery.isFunction(resolveValues[i].promise)) {
- resolveValues[i].promise().done(updateFunc(i, resolveContexts, resolveValues)).fail(deferred.reject).progress(updateFunc(i, progressContexts, progressValues));
- } else {
- --remaining;
- }
- }
- }
- return remaining || deferred.resolveWith(resolveContexts, resolveValues), deferred.promise();
- }
- });
- /**
- * @param {string} details
- * @return {?}
- */
- jQuery.fn.ready = function(details) {
- return jQuery.ready.promise().done(details), this;
- };
- jQuery.extend({
- isReady : false,
- readyWait : 1,
- /**
- * @param {?} hold
- * @return {undefined}
- */
- holdReady : function(hold) {
- if (hold) {
- jQuery.readyWait++;
- } else {
- jQuery.ready(true);
- }
- },
- /**
- * @param {boolean} wait
- * @return {undefined}
- */
- ready : function(wait) {
- if (!(wait === true ? --jQuery.readyWait : jQuery.isReady)) {
- /** @type {boolean} */
- jQuery.isReady = true;
- if (!(wait !== true && --jQuery.readyWait > 0)) {
- readyList.resolveWith(doc, [jQuery]);
- if (jQuery.fn.triggerHandler) {
- jQuery(doc).triggerHandler("ready");
- jQuery(doc).off("ready");
- }
- }
- }
- }
- });
- /**
- * @param {string} obj
- * @return {?}
- */
- jQuery.ready.promise = function(obj) {
- return readyList || (readyList = jQuery.Deferred(), "complete" === doc.readyState ? setTimeout(jQuery.ready) : (doc.addEventListener("DOMContentLoaded", completed, false), win.addEventListener("load", completed, false))), readyList.promise(obj);
- };
- jQuery.ready.promise();
- /** @type {function (Object, Function, string, string, boolean, string, boolean): ?} */
- access = jQuery.access = function(elems, fn, key, value, chainable, emptyGet, raw) {
- /** @type {number} */
- var i = 0;
- var length = elems.length;
- /** @type {boolean} */
- var bulk = null == key;
- if ("object" === jQuery.type(key)) {
- /** @type {boolean} */
- chainable = true;
- for (i in key) {
- jQuery.access(elems, fn, i, key[i], true, emptyGet, raw);
- }
- } else {
- if (void 0 !== value && (chainable = true, jQuery.isFunction(value) || (raw = true), bulk && (raw ? (fn.call(elems, value), fn = null) : (bulk = fn, fn = function(elem, event, value) {
- return bulk.call(jQuery(elem), value);
- })), fn)) {
- for (;length > i;i++) {
- fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key)));
- }
- }
- }
- return chainable ? elems : bulk ? fn.call(elems) : length ? fn(elems[0], key) : emptyGet;
- };
- /**
- * @param {Object} elem
- * @return {?}
- */
- jQuery.acceptData = function(elem) {
- return 1 === elem.nodeType || (9 === elem.nodeType || !+elem.nodeType);
- };
- /** @type {number} */
- Data.uid = 1;
- /** @type {function (Object): ?} */
- Data.accepts = jQuery.acceptData;
- Data.prototype = {
- /**
- * @param {Object} owner
- * @return {?}
- */
- key : function(owner) {
- if (!Data.accepts(owner)) {
- return 0;
- }
- var descriptor = {};
- var unlock = owner[this.expando];
- if (!unlock) {
- /** @type {number} */
- unlock = Data.uid++;
- try {
- descriptor[this.expando] = {
- value : unlock
- };
- Object.defineProperties(owner, descriptor);
- } catch (u) {
- /** @type {number} */
- descriptor[this.expando] = unlock;
- jQuery.extend(owner, descriptor);
- }
- }
- return this.cache[unlock] || (this.cache[unlock] = {}), unlock;
- },
- /**
- * @param {Object} owner
- * @param {string} data
- * @param {string} value
- * @return {?}
- */
- set : function(owner, data, value) {
- var prop;
- var unlock = this.key(owner);
- var cache = this.cache[unlock];
- if ("string" == typeof data) {
- /** @type {string} */
- cache[data] = value;
- } else {
- if (jQuery.isEmptyObject(cache)) {
- jQuery.extend(this.cache[unlock], data);
- } else {
- for (prop in data) {
- cache[prop] = data[prop];
- }
- }
- }
- return cache;
- },
- /**
- * @param {Object} owner
- * @param {string} value
- * @return {?}
- */
- get : function(owner, value) {
- var cache = this.cache[this.key(owner)];
- return void 0 === value ? cache : cache[value];
- },
- /**
- * @param {Object} owner
- * @param {string} key
- * @param {string} value
- * @return {?}
- */
- access : function(owner, key, value) {
- var stored;
- return void 0 === key || key && ("string" == typeof key && void 0 === value) ? (stored = this.get(owner, key), void 0 !== stored ? stored : this.get(owner, jQuery.camelCase(key))) : (this.set(owner, key, value), void 0 !== value ? value : key);
- },
- /**
- * @param {Object} owner
- * @param {?} key
- * @return {undefined}
- */
- remove : function(owner, key) {
- var i;
- var name;
- var camel;
- var unlock = this.key(owner);
- var cache = this.cache[unlock];
- if (void 0 === key) {
- this.cache[unlock] = {};
- } else {
- if (jQuery.isArray(key)) {
- name = key.concat(key.map(jQuery.camelCase));
- } else {
- camel = jQuery.camelCase(key);
- if (key in cache) {
- /** @type {Array} */
- name = [key, camel];
- } else {
- name = camel;
- name = name in cache ? [name] : name.match(core_rnotwhite) || [];
- }
- }
- i = name.length;
- for (;i--;) {
- delete cache[name[i]];
- }
- }
- },
- /**
- * @param {Object} owner
- * @return {?}
- */
- hasData : function(owner) {
- return!jQuery.isEmptyObject(this.cache[owner[this.expando]] || {});
- },
- /**
- * @param {?} owner
- * @return {undefined}
- */
- discard : function(owner) {
- if (owner[this.expando]) {
- delete this.cache[owner[this.expando]];
- }
- }
- };
- var data_priv = new Data;
- var data_user = new Data;
- /** @type {RegExp} */
- var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/;
- /** @type {RegExp} */
- var r20 = /([A-Z])/g;
- jQuery.extend({
- /**
- * @param {Object} elem
- * @return {?}
- */
- hasData : function(elem) {
- return data_user.hasData(elem) || data_priv.hasData(elem);
- },
- /**
- * @param {string} args
- * @param {?} name
- * @param {string} data
- * @return {?}
- */
- data : function(args, name, data) {
- return data_user.access(args, name, data);
- },
- /**
- * @param {Object} elem
- * @param {?} key
- * @return {undefined}
- */
- removeData : function(elem, key) {
- data_user.remove(elem, key);
- },
- /**
- * @param {Object} elem
- * @param {Object} name
- * @param {string} data
- * @return {?}
- */
- _data : function(elem, name, data) {
- return data_priv.access(elem, name, data);
- },
- /**
- * @param {Object} elem
- * @param {?} name
- * @return {undefined}
- */
- _removeData : function(elem, name) {
- data_priv.remove(elem, name);
- }
- });
- jQuery.fn.extend({
- /**
- * @param {string} key
- * @param {?} value
- * @return {?}
- */
- data : function(key, value) {
- var len;
- var name;
- var data;
- var elem = this[0];
- var attrs = elem && elem.attributes;
- if (void 0 === key) {
- if (this.length && (data = data_user.get(elem), 1 === elem.nodeType && !data_priv.get(elem, "hasDataAttrs"))) {
- len = attrs.length;
- for (;len--;) {
- if (attrs[len]) {
- name = attrs[len].name;
- if (0 === name.indexOf("data-")) {
- name = jQuery.camelCase(name.slice(5));
- dataAttr(elem, name, data[name]);
- }
- }
- }
- data_priv.set(elem, "hasDataAttrs", true);
- }
- return data;
- }
- return "object" == typeof key ? this.each(function() {
- data_user.set(this, key);
- }) : access(this, function(value) {
- var data;
- var camelKey = jQuery.camelCase(key);
- if (elem && void 0 === value) {
- if ((data = data_user.get(elem, key), void 0 !== data) || ((data = data_user.get(elem, camelKey), void 0 !== data) || (data = dataAttr(elem, camelKey, void 0), void 0 !== data))) {
- return data;
- }
- } else {
- this.each(function() {
- var data = data_user.get(this, camelKey);
- data_user.set(this, camelKey, value);
- if (-1 !== key.indexOf("-")) {
- if (void 0 !== data) {
- data_user.set(this, key, value);
- }
- }
- });
- }
- }, null, value, arguments.length > 1, null, true);
- },
- /**
- * @param {string} name
- * @return {?}
- */
- removeData : function(name) {
- return this.each(function() {
- data_user.remove(this, name);
- });
- }
- });
- jQuery.extend({
- /**
- * @param {Object} elem
- * @param {string} type
- * @param {?} data
- * @return {?}
- */
- queue : function(elem, type, data) {
- var queue;
- if (elem) {
- return type = (type || "fx") + "queue", queue = data_priv.get(elem, type), data && (!queue || jQuery.isArray(data) ? queue = data_priv.access(elem, type, jQuery.makeArray(data)) : queue.push(data)), queue || [];
- }
- },
- /**
- * @param {string} elem
- * @param {string} type
- * @return {undefined}
- */
- dequeue : function(elem, type) {
- type = type || "fx";
- var queue = jQuery.queue(elem, type);
- var ln = queue.length;
- var fn = queue.shift();
- var hooks = jQuery._queueHooks(elem, type);
- /**
- * @return {undefined}
- */
- var next = function() {
- jQuery.dequeue(elem, type);
- };
- if ("inprogress" === fn) {
- fn = queue.shift();
- ln--;
- }
- if (fn) {
- if ("fx" === type) {
- queue.unshift("inprogress");
- }
- delete hooks.stop;
- fn.call(elem, next, hooks);
- }
- if (!ln) {
- if (hooks) {
- hooks.empty.fire();
- }
- }
- },
- /**
- * @param {Object} elem
- * @param {string} type
- * @return {?}
- */
- _queueHooks : function(elem, type) {
- /** @type {string} */
- var key = type + "queueHooks";
- return data_priv.get(elem, key) || data_priv.access(elem, key, {
- empty : jQuery.Callbacks("once memory").add(function() {
- data_priv.remove(elem, [type + "queue", key]);
- })
- });
- }
- });
- jQuery.fn.extend({
- /**
- * @param {string} type
- * @param {string} data
- * @return {?}
- */
- queue : function(type, data) {
- /** @type {number} */
- var setter = 2;
- return "string" != typeof type && (data = type, type = "fx", setter--), arguments.length < setter ? jQuery.queue(this[0], type) : void 0 === data ? this : this.each(function() {
- var queue = jQuery.queue(this, type, data);
- jQuery._queueHooks(this, type);
- if ("fx" === type) {
- if ("inprogress" !== queue[0]) {
- jQuery.dequeue(this, type);
- }
- }
- });
- },
- /**
- * @param {string} type
- * @return {?}
- */
- dequeue : function(type) {
- return this.each(function() {
- jQuery.dequeue(this, type);
- });
- },
- /**
- * @param {string} type
- * @return {?}
- */
- clearQueue : function(type) {
- return this.queue(type || "fx", []);
- },
- /**
- * @param {string} type
- * @param {string} obj
- * @return {?}
- */
- promise : function(type, obj) {
- var body;
- /** @type {number} */
- var e = 1;
- var defer = jQuery.Deferred();
- var elements = this;
- var i = this.length;
- /**
- * @return {undefined}
- */
- var resolve = function() {
- if (!--e) {
- defer.resolveWith(elements, [elements]);
- }
- };
- if ("string" != typeof type) {
- /** @type {string} */
- obj = type;
- type = void 0;
- }
- type = type || "fx";
- for (;i--;) {
- body = data_priv.get(elements[i], type + "queueHooks");
- if (body) {
- if (body.empty) {
- e++;
- body.empty.add(resolve);
- }
- }
- }
- return resolve(), defer.promise(obj);
- }
- });
- /** @type {string} */
- var core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source;
- /** @type {Array} */
- var cssExpand = ["Top", "Right", "Bottom", "Left"];
- /**
- * @param {Object} node
- * @param {Function} context
- * @return {?}
- */
- var isHidden = function(node, context) {
- return node = context || node, "none" === jQuery.css(node, "display") || !jQuery.contains(node.ownerDocument, node);
- };
- /** @type {RegExp} */
- var manipulation_rcheckableType = /^(?:checkbox|radio)$/i;
- !function() {
- var fragment = doc.createDocumentFragment();
- var form = fragment.appendChild(doc.createElement("div"));
- var input = doc.createElement("input");
- input.setAttribute("type", "radio");
- input.setAttribute("checked", "checked");
- input.setAttribute("name", "t");
- form.appendChild(input);
- support.checkClone = form.cloneNode(true).cloneNode(true).lastChild.checked;
- /** @type {string} */
- form.innerHTML = "<textarea>x</textarea>";
- /** @type {boolean} */
- support.noCloneChecked = !!form.cloneNode(true).lastChild.defaultValue;
- }();
- /** @type {string} */
- memory = "undefined";
- /** @type {boolean} */
- support.focusinBubbles = "onfocusin" in win;
- /** @type {RegExp} */
- var rmouseEvent = /^key/;
- /** @type {RegExp} */
- var rkeyEvent = /^(?:mouse|pointer|contextmenu)|click/;
- /** @type {RegExp} */
- var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
- /** @type {RegExp} */
- var rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
- jQuery.event = {
- global : {},
- /**
- * @param {Object} elem
- * @param {Object} val
- * @param {Function} handler
- * @param {Object} e
- * @param {(Function|string)} selector
- * @return {undefined}
- */
- add : function(elem, val, handler, e, selector) {
- var handleObjIn;
- var eventHandle;
- var segmentMatch;
- var events;
- var n;
- var handleObj;
- var special;
- var handlers;
- var type;
- var namespaces;
- var origType;
- var elemData = data_priv.get(elem);
- if (elemData) {
- if (handler.handler) {
- /** @type {Function} */
- handleObjIn = handler;
- handler = handleObjIn.handler;
- selector = handleObjIn.selector;
- }
- if (!handler.guid) {
- /** @type {number} */
- handler.guid = jQuery.guid++;
- }
- if (!(events = elemData.events)) {
- events = elemData.events = {};
- }
- if (!(eventHandle = elemData.handle)) {
- /** @type {function (Event): ?} */
- eventHandle = elemData.handle = function(e) {
- if (typeof jQuery !== memory && jQuery.event.triggered !== e.type) {
- return jQuery.event.dispatch.apply(elem, arguments);
- }
- };
- }
- val = (val || "").match(core_rnotwhite) || [""];
- n = val.length;
- for (;n--;) {
- /** @type {Array} */
- segmentMatch = rtypenamespace.exec(val[n]) || [];
- type = origType = segmentMatch[1];
- namespaces = (segmentMatch[2] || "").split(".").sort();
- if (type) {
- special = jQuery.event.special[type] || {};
- type = (selector ? special.delegateType : special.bindType) || type;
- special = jQuery.event.special[type] || {};
- handleObj = jQuery.extend({
- type : type,
- origType : origType,
- data : e,
- /** @type {Function} */
- handler : handler,
- guid : handler.guid,
- selector : selector,
- needsContext : selector && jQuery.expr.match.needsContext.test(selector),
- namespace : namespaces.join(".")
- }, handleObjIn);
- if (!(handlers = events[type])) {
- /** @type {Array} */
- handlers = events[type] = [];
- /** @type {number} */
- handlers.delegateCount = 0;
- if (!(special.setup && special.setup.call(elem, e, namespaces, eventHandle) !== false)) {
- if (elem.addEventListener) {
- elem.addEventListener(type, eventHandle, false);
- }
- }
- }
- if (special.add) {
- special.add.call(elem, handleObj);
- if (!handleObj.handler.guid) {
- handleObj.handler.guid = handler.guid;
- }
- }
- if (selector) {
- handlers.splice(handlers.delegateCount++, 0, handleObj);
- } else {
- handlers.push(handleObj);
- }
- /** @type {boolean} */
- jQuery.event.global[type] = true;
- }
- }
- }
- },
- /**
- * @param {Object} elem
- * @param {Object} types
- * @param {Function} handler
- * @param {boolean} selector
- * @param {boolean} keepData
- * @return {undefined}
- */
- remove : function(elem, types, handler, selector, keepData) {
- var j;
- var origCount;
- var tmp;
- var events;
- var t;
- var handleObj;
- var special;
- var handlers;
- var type;
- var namespaces;
- var origType;
- var elemData = data_priv.hasData(elem) && data_priv.get(elem);
- if (elemData && (events = elemData.events)) {
- types = (types || "").match(core_rnotwhite) || [""];
- t = types.length;
- for (;t--;) {
- if (tmp = rtypenamespace.exec(types[t]) || [], type = origType = tmp[1], namespaces = (tmp[2] || "").split(".").sort(), type) {
- special = jQuery.event.special[type] || {};
- type = (selector ? special.delegateType : special.bindType) || type;
- handlers = events[type] || [];
- tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)");
- origCount = j = handlers.length;
- for (;j--;) {
- handleObj = handlers[j];
- if (!(!keepData && origType !== handleObj.origType)) {
- if (!(handler && handler.guid !== handleObj.guid)) {
- if (!(tmp && !tmp.test(handleObj.namespace))) {
- if (!(selector && (selector !== handleObj.selector && ("**" !== selector || !handleObj.selector)))) {
- handlers.splice(j, 1);
- if (handleObj.selector) {
- handlers.delegateCount--;
- }
- if (special.remove) {
- special.remove.call(elem, handleObj);
- }
- }
- }
- }
- }
- }
- if (origCount) {
- if (!handlers.length) {
- if (!(special.teardown && special.teardown.call(elem, namespaces, elemData.handle) !== false)) {
- jQuery.removeEvent(elem, type, elemData.handle);
- }
- delete events[type];
- }
- }
- } else {
- for (type in events) {
- jQuery.event.remove(elem, type + types[t], handler, selector, true);
- }
- }
- }
- if (jQuery.isEmptyObject(events)) {
- delete elemData.handle;
- data_priv.remove(elem, "events");
- }
- }
- },
- /**
- * @param {Object} event
- * @param {?} data
- * @param {Object} elem
- * @param {string} onlyHandlers
- * @return {?}
- */
- trigger : function(event, data, elem, onlyHandlers) {
- var i;
- var cur;
- var tmp;
- var bubbleType;
- var ontype;
- var handle;
- var special;
- /** @type {Array} */
- var eventPath = [elem || doc];
- var type = core_hasOwn.call(event, "type") ? event.type : event;
- var namespaces = core_hasOwn.call(event, "namespace") ? event.namespace.split(".") : [];
- if (cur = tmp = elem = elem || doc, 3 !== elem.nodeType && (8 !== elem.nodeType && (!rfocusMorph.test(type + jQuery.event.triggered) && (type.indexOf(".") >= 0 && (namespaces = type.split("."), type = namespaces.shift(), namespaces.sort()), ontype = type.indexOf(":") < 0 && "on" + type, event = event[jQuery.expando] ? event : new jQuery.Event(type, "object" == typeof event && event), event.isTrigger = onlyHandlers ? 2 : 3, event.namespace = namespaces.join("."), event.namespace_re = event.namespace ?
- new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, event.result = void 0, event.target || (event.target = elem), data = null == data ? [event] : jQuery.makeArray(data, [event]), special = jQuery.event.special[type] || {}, onlyHandlers || (!special.trigger || special.trigger.apply(elem, data) !== false))))) {
- if (!onlyHandlers && (!special.noBubble && !jQuery.isWindow(elem))) {
- bubbleType = special.delegateType || type;
- if (!rfocusMorph.test(bubbleType + type)) {
- cur = cur.parentNode;
- }
- for (;cur;cur = cur.parentNode) {
- eventPath.push(cur);
- tmp = cur;
- }
- if (tmp === (elem.ownerDocument || doc)) {
- eventPath.push(tmp.defaultView || (tmp.parentWindow || win));
- }
- }
- /** @type {number} */
- i = 0;
- for (;(cur = eventPath[i++]) && !event.isPropagationStopped();) {
- event.type = i > 1 ? bubbleType : special.bindType || type;
- handle = (data_priv.get(cur, "events") || {})[event.type] && data_priv.get(cur, "handle");
- if (handle) {
- handle.apply(cur, data);
- }
- handle = ontype && cur[ontype];
- if (handle) {
- if (handle.apply) {
- if (jQuery.acceptData(cur)) {
- event.result = handle.apply(cur, data);
- if (event.result === false) {
- event.preventDefault();
- }
- }
- }
- }
- }
- return event.type = type, onlyHandlers || (event.isDefaultPrevented() || (special._default && special._default.apply(eventPath.pop(), data) !== false || (!jQuery.acceptData(elem) || ontype && (jQuery.isFunction(elem[type]) && (!jQuery.isWindow(elem) && (tmp = elem[ontype], tmp && (elem[ontype] = null), jQuery.event.triggered = type, elem[type](), jQuery.event.triggered = void 0, tmp && (elem[ontype] = tmp))))))), event.result;
- }
- },
- /**
- * @param {Object} event
- * @return {?}
- */
- dispatch : function(event) {
- event = jQuery.event.fix(event);
- var i;
- var j;
- var ret;
- var matched;
- var handleObj;
- /** @type {Array} */
- var handlerQueue = [];
- /** @type {Array.<?>} */
- var args = core_slice.call(arguments);
- var handlers = (data_priv.get(this, "events") || {})[event.type] || [];
- var special = jQuery.event.special[event.type] || {};
- if (args[0] = event, event.delegateTarget = this, !special.preDispatch || special.preDispatch.call(this, event) !== false) {
- handlerQueue = jQuery.event.handlers.call(this, event, handlers);
- /** @type {number} */
- i = 0;
- for (;(matched = handlerQueue[i++]) && !event.isPropagationStopped();) {
- event.currentTarget = matched.elem;
- /** @type {number} */
- j = 0;
- for (;(handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped();) {
- if (!event.namespace_re || event.namespace_re.test(handleObj.namespace)) {
- event.handleObj = handleObj;
- event.data = handleObj.data;
- ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args);
- if (void 0 !== ret) {
- if ((event.result = ret) === false) {
- event.preventDefault();
- event.stopPropagation();
- }
- }
- }
- }
- }
- return special.postDispatch && special.postDispatch.call(this, event), event.result;
- }
- },
- /**
- * @param {Event} event
- * @param {Object} handlers
- * @return {?}
- */
- handlers : function(event, handlers) {
- var j;
- var matches;
- var sel;
- var handleObj;
- /** @type {Array} */
- var handlerQueue = [];
- var delegateCount = handlers.delegateCount;
- var cur = event.target;
- if (delegateCount && (cur.nodeType && (!event.button || "click" !== event.type))) {
- for (;cur !== this;cur = cur.parentNode || this) {
- if (cur.disabled !== true || "click" !== event.type) {
- /** @type {Array} */
- matches = [];
- /** @type {number} */
- j = 0;
- for (;delegateCount > j;j++) {
- handleObj = handlers[j];
- /** @type {string} */
- sel = handleObj.selector + " ";
- if (void 0 === matches[sel]) {
- matches[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) >= 0 : jQuery.find(sel, this, null, [cur]).length;
- }
- if (matches[sel]) {
- matches.push(handleObj);
- }
- }
- if (matches.length) {
- handlerQueue.push({
- elem : cur,
- handlers : matches
- });
- }
- }
- }
- }
- return delegateCount < handlers.length && handlerQueue.push({
- elem : this,
- handlers : handlers.slice(delegateCount)
- }), handlerQueue;
- },
- props : "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
- fixHooks : {},
- keyHooks : {
- props : "char charCode key keyCode".split(" "),
- /**
- * @param {Object} event
- * @param {Event} original
- * @return {?}
- */
- filter : function(event, original) {
- return null == event.which && (event.which = null != original.charCode ? original.charCode : original.keyCode), event;
- }
- },
- mouseHooks : {
- props : "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
- /**
- * @param {Object} event
- * @param {Event} original
- * @return {?}
- */
- filter : function(event, original) {
- var d;
- var de;
- var b;
- var button = original.button;
- return null == event.pageX && (null != original.clientX && (d = event.target.ownerDocument || doc, de = d.documentElement, b = d.body, event.pageX = original.clientX + (de && de.scrollLeft || (b && b.scrollLeft || 0)) - (de && de.clientLeft || (b && b.clientLeft || 0)), event.pageY = original.clientY + (de && de.scrollTop || (b && b.scrollTop || 0)) - (de && de.clientTop || (b && b.clientTop || 0)))), event.which || (void 0 === button || (event.which = 1 & button ? 1 : 2 & button ? 3 : 4 &
- button ? 2 : 0)), event;
- }
- },
- /**
- * @param {Object} event
- * @return {?}
- */
- fix : function(event) {
- if (event[jQuery.expando]) {
- return event;
- }
- var i;
- var prop;
- var copy;
- var type = event.type;
- /** @type {Object} */
- var originalEvent = event;
- var fixHook = this.fixHooks[type];
- if (!fixHook) {
- this.fixHooks[type] = fixHook = rkeyEvent.test(type) ? this.mouseHooks : rmouseEvent.test(type) ? this.keyHooks : {};
- }
- copy = fixHook.props ? this.props.concat(fixHook.props) : this.props;
- event = new jQuery.Event(originalEvent);
- i = copy.length;
- for (;i--;) {
- prop = copy[i];
- event[prop] = originalEvent[prop];
- }
- return event.target || (event.target = doc), 3 === event.target.nodeType && (event.target = event.target.parentNode), fixHook.filter ? fixHook.filter(event, originalEvent) : event;
- },
- special : {
- load : {
- noBubble : true
- },
- focus : {
- /**
- * @return {?}
- */
- trigger : function() {
- if (this !== safeActiveElement() && this.focus) {
- return this.focus(), false;
- }
- },
- delegateType : "focusin"
- },
- blur : {
- /**
- * @return {?}
- */
- trigger : function() {
- if (this === safeActiveElement() && this.blur) {
- return this.blur(), false;
- }
- },
- delegateType : "focusout"
- },
- click : {
- /**
- * @return {?}
- */
- trigger : function() {
- if ("checkbox" === this.type && (this.click && jQuery.nodeName(this, "input"))) {
- return this.click(), false;
- }
- },
- /**
- * @param {number} name
- * @return {?}
- */
- _default : function(name) {
- return jQuery.nodeName(name.target, "a");
- }
- },
- beforeunload : {
- /**
- * @param {Object} event
- * @return {undefined}
- */
- postDispatch : function(event) {
- if (void 0 !== event.result) {
- if (event.originalEvent) {
- event.originalEvent.returnValue = event.result;
- }
- }
- }
- }
- },
- /**
- * @param {string} type
- * @param {Object} elem
- * @param {?} event
- * @param {boolean} dataAndEvents
- * @return {undefined}
- */
- simulate : function(type, elem, event, dataAndEvents) {
- var e = jQuery.extend(new jQuery.Event, event, {
- type : type,
- isSimulated : true,
- originalEvent : {}
- });
- if (dataAndEvents) {
- jQuery.event.trigger(e, null, elem);
- } else {
- jQuery.event.dispatch.call(elem, e);
- }
- if (e.isDefaultPrevented()) {
- event.preventDefault();
- }
- }
- };
- /**
- * @param {Object} elem
- * @param {?} type
- * @param {?} handle
- * @return {undefined}
- */
- jQuery.removeEvent = function(elem, type, handle) {
- if (elem.removeEventListener) {
- elem.removeEventListener(type, handle, false);
- }
- };
- /**
- * @param {Object} src
- * @param {boolean} props
- * @return {?}
- */
- jQuery.Event = function(src, props) {
- return this instanceof jQuery.Event ? (src && src.type ? (this.originalEvent = src, this.type = src.type, this.isDefaultPrevented = src.defaultPrevented || void 0 === src.defaultPrevented && src.returnValue === false ? returnTrue : returnFalse) : this.type = src, props && jQuery.extend(this, props), this.timeStamp = src && src.timeStamp || jQuery.now(), void(this[jQuery.expando] = true)) : new jQuery.Event(src, props);
- };
- jQuery.Event.prototype = {
- /** @type {function (): ?} */
- isDefaultPrevented : returnFalse,
- /** @type {function (): ?} */
- isPropagationStopped : returnFalse,
- /** @type {function (): ?} */
- isImmediatePropagationStopped : returnFalse,
- /**
- * @return {undefined}
- */
- preventDefault : function() {
- var e = this.originalEvent;
- /** @type {function (): ?} */
- this.isDefaultPrevented = returnTrue;
- if (e) {
- if (e.preventDefault) {
- e.preventDefault();
- }
- }
- },
- /**
- * @return {undefined}
- */
- stopPropagation : function() {
- var e = this.originalEvent;
- /** @type {function (): ?} */
- this.isPropagationStopped = returnTrue;
- if (e) {
- if (e.stopPropagation) {
- e.stopPropagation();
- }
- }
- },
- /**
- * @return {undefined}
- */
- stopImmediatePropagation : function() {
- var e = this.originalEvent;
- /** @type {function (): ?} */
- this.isImmediatePropagationStopped = returnTrue;
- if (e) {
- if (e.stopImmediatePropagation) {
- e.stopImmediatePropagation();
- }
- }
- this.stopPropagation();
- }
- };
- jQuery.each({
- mouseenter : "mouseover",
- mouseleave : "mouseout",
- pointerenter : "pointerover",
- pointerleave : "pointerout"
- }, function(orig, fix) {
- jQuery.event.special[orig] = {
- delegateType : fix,
- bindType : fix,
- /**
- * @param {Object} event
- * @return {?}
- */
- handle : function(event) {
- var returnValue;
- var target = this;
- var related = event.relatedTarget;
- var handleObj = event.handleObj;
- return(!related || related !== target && !jQuery.contains(target, related)) && (event.type = handleObj.origType, returnValue = handleObj.handler.apply(this, arguments), event.type = fix), returnValue;
- }
- };
- });
- if (!support.focusinBubbles) {
- jQuery.each({
- focus : "focusin",
- blur : "focusout"
- }, function(event, name) {
- /**
- * @param {Object} event
- * @return {undefined}
- */
- var handler = function(event) {
- jQuery.event.simulate(name, event.target, jQuery.event.fix(event), true);
- };
- jQuery.event.special[name] = {
- /**
- * @return {undefined}
- */
- setup : function() {
- var node = this.ownerDocument || this;
- var descriptor = data_priv.access(node, name);
- if (!descriptor) {
- node.addEventListener(event, handler, true);
- }
- data_priv.access(node, name, (descriptor || 0) + 1);
- },
- /**
- * @return {undefined}
- */
- teardown : function() {
- var node = this.ownerDocument || this;
- /** @type {number} */
- var data = data_priv.access(node, name) - 1;
- if (data) {
- data_priv.access(node, name, data);
- } else {
- node.removeEventListener(event, handler, true);
- data_priv.remove(node, name);
- }
- }
- };
- });
- }
- jQuery.fn.extend({
- /**
- * @param {string} types
- * @param {Function} selector
- * @param {Function} data
- * @param {Function} fn
- * @param {(number|string)} one
- * @return {?}
- */
- on : function(types, selector, data, fn, one) {
- var origFn;
- var type;
- if ("object" == typeof types) {
- if ("string" != typeof selector) {
- data = data || selector;
- selector = void 0;
- }
- for (type in types) {
- this.on(type, selector, data, types[type], one);
- }
- return this;
- }
- if (null == data && null == fn ? (fn = selector, data = selector = void 0) : null == fn && ("string" == typeof selector ? (fn = data, data = void 0) : (fn = data, data = selector, selector = void 0)), fn === false) {
- /** @type {function (): ?} */
- fn = returnFalse;
- } else {
- if (!fn) {
- return this;
- }
- }
- return 1 === one && (origFn = fn, fn = function(event) {
- return jQuery().off(event), origFn.apply(this, arguments);
- }, fn.guid = origFn.guid || (origFn.guid = jQuery.guid++)), this.each(function() {
- jQuery.event.add(this, types, fn, data, selector);
- });
- },
- /**
- * @param {string} types
- * @param {Function} selector
- * @param {Function} data
- * @param {Function} fn
- * @return {?}
- */
- one : function(types, selector, data, fn) {
- return this.on(types, selector, data, fn, 1);
- },
- /**
- * @param {Object} types
- * @param {Object} selector
- * @param {Function} fn
- * @return {?}
- */
- off : function(types, selector, fn) {
- var handleObj;
- var type;
- if (types && (types.preventDefault && types.handleObj)) {
- return handleObj = types.handleObj, jQuery(types.delegateTarget).off(handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler), this;
- }
- if ("object" == typeof types) {
- for (type in types) {
- this.off(type, selector, types[type]);
- }
- return this;
- }
- return(selector === false || "function" == typeof selector) && (fn = selector, selector = void 0), fn === false && (fn = returnFalse), this.each(function() {
- jQuery.event.remove(this, types, fn, selector);
- });
- },
- /**
- * @param {string} type
- * @param {?} data
- * @return {?}
- */
- trigger : function(type, data) {
- return this.each(function() {
- jQuery.event.trigger(type, data, this);
- });
- },
- /**
- * @param {string} type
- * @param {?} data
- * @return {?}
- */
- triggerHandler : function(type, data) {
- var parent = this[0];
- if (parent) {
- return jQuery.event.trigger(type, data, parent, true);
- }
- }
- });
- /** @type {RegExp} */
- var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi;
- /** @type {RegExp} */
- var rtagName = /<([\w:]+)/;
- /** @type {RegExp} */
- var rhtml = /<|&#?\w+;/;
- /** @type {RegExp} */
- var rchecked = /<(?:script|style|link)/i;
- /** @type {RegExp} */
- var exclude = /checked\s*(?:[^=]|=\s*.checked.)/i;
- /** @type {RegExp} */
- var stopParent = /^$|\/(?:java|ecma)script/i;
- /** @type {RegExp} */
- var re = /^true\/(.*)/;
- /** @type {RegExp} */
- var rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
- var wrapMap = {
- 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, "", ""]
- };
- /** @type {Array} */
- wrapMap.optgroup = wrapMap.option;
- /** @type {Array} */
- wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
- /** @type {Array} */
- wrapMap.th = wrapMap.td;
- jQuery.extend({
- /**
- * @param {Object} elem
- * @param {boolean} dataAndEvents
- * @param {boolean} deepDataAndEvents
- * @return {?}
- */
- clone : function(elem, dataAndEvents, deepDataAndEvents) {
- var i;
- var l;
- var srcElements;
- var destElements;
- var clone = elem.cloneNode(true);
- var inPage = jQuery.contains(elem.ownerDocument, elem);
- if (!(support.noCloneChecked || (1 !== elem.nodeType && 11 !== elem.nodeType || jQuery.isXMLDoc(elem)))) {
- destElements = getAll(clone);
- srcElements = getAll(elem);
- /** @type {number} */
- i = 0;
- l = srcElements.length;
- for (;l > i;i++) {
- fixInput(srcElements[i], destElements[i]);
- }
- }
- if (dataAndEvents) {
- if (deepDataAndEvents) {
- srcElements = srcElements || getAll(elem);
- destElements = destElements || getAll(clone);
- /** @type {number} */
- i = 0;
- l = srcElements.length;
- for (;l > i;i++) {
- cloneCopyEvent(srcElements[i], destElements[i]);
- }
- } else {
- cloneCopyEvent(elem, clone);
- }
- }
- return destElements = getAll(clone, "script"), destElements.length > 0 && setGlobalEval(destElements, !inPage && getAll(elem, "script")), clone;
- },
- /**
- * @param {Array} elems
- * @param {Document} context
- * @param {boolean} scripts
- * @param {?} selection
- * @return {?}
- */
- buildFragment : function(elems, context, scripts, selection) {
- var elem;
- var tmp;
- var tag;
- var wrap;
- var contains;
- var j;
- var fragment = context.createDocumentFragment();
- /** @type {Array} */
- var nodes = [];
- /** @type {number} */
- var i = 0;
- var l = elems.length;
- for (;l > i;i++) {
- if (elem = elems[i], elem || 0 === elem) {
- if ("object" === jQuery.type(elem)) {
- jQuery.merge(nodes, elem.nodeType ? [elem] : elem);
- } else {
- if (rhtml.test(elem)) {
- tmp = tmp || fragment.appendChild(context.createElement("div"));
- tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase();
- wrap = wrapMap[tag] || wrapMap._default;
- tmp.innerHTML = wrap[1] + elem.replace(rxhtmlTag, "<$1></$2>") + wrap[2];
- j = wrap[0];
- for (;j--;) {
- tmp = tmp.lastChild;
- }
- jQuery.merge(nodes, tmp.childNodes);
- tmp = fragment.firstChild;
- /** @type {string} */
- tmp.textContent = "";
- } else {
- nodes.push(context.createTextNode(elem));
- }
- }
- }
- }
- /** @type {string} */
- fragment.textContent = "";
- /** @type {number} */
- i = 0;
- for (;elem = nodes[i++];) {
- if ((!selection || -1 === jQuery.inArray(elem, selection)) && (contains = jQuery.contains(elem.ownerDocument, elem), tmp = getAll(fragment.appendChild(elem), "script"), contains && setGlobalEval(tmp), scripts)) {
- /** @type {number} */
- j = 0;
- for (;elem = tmp[j++];) {
- if (stopParent.test(elem.type || "")) {
- scripts.push(elem);
- }
- }
- }
- }
- return fragment;
- },
- /**
- * @param {?} elems
- * @return {undefined}
- */
- cleanData : function(elems) {
- var data;
- var elem;
- var type;
- var key;
- var special = jQuery.event.special;
- /** @type {number} */
- var i = 0;
- for (;void 0 !== (elem = elems[i]);i++) {
- if (jQuery.acceptData(elem) && (key = elem[data_priv.expando], key && (data = data_priv.cache[key]))) {
- if (data.events) {
- for (type in data.events) {
- if (special[type]) {
- jQuery.event.remove(elem, type);
- } else {
- jQuery.removeEvent(elem, type, data.handle);
- }
- }
- }
- if (data_priv.cache[key]) {
- delete data_priv.cache[key];
- }
- }
- delete data_user.cache[elem[data_user.expando]];
- }
- }
- });
- jQuery.fn.extend({
- /**
- * @param {string} elems
- * @return {?}
- */
- text : function(elems) {
- return access(this, function(textString) {
- return void 0 === textString ? jQuery.text(this) : this.empty().each(function() {
- if (1 === this.nodeType || (11 === this.nodeType || 9 === this.nodeType)) {
- /** @type {string} */
- this.textContent = textString;
- }
- });
- }, null, elems, arguments.length);
- },
- /**
- * @return {?}
- */
- append : function() {
- return this.domManip(arguments, function(elem) {
- if (1 === this.nodeType || (11 === this.nodeType || 9 === this.nodeType)) {
- var target = manipulationTarget(this, elem);
- target.appendChild(elem);
- }
- });
- },
- /**
- * @return {?}
- */
- prepend : function() {
- return this.domManip(arguments, function(elem) {
- if (1 === this.nodeType || (11 === this.nodeType || 9 === this.nodeType)) {
- var target = manipulationTarget(this, elem);
- target.insertBefore(elem, target.firstChild);
- }
- });
- },
- /**
- * @return {?}
- */
- before : function() {
- return this.domManip(arguments, function(elem) {
- if (this.parentNode) {
- this.parentNode.insertBefore(elem, this);
- }
- });
- },
- /**
- * @return {?}
- */
- after : function() {
- return this.domManip(arguments, function(elem) {
- if (this.parentNode) {
- this.parentNode.insertBefore(elem, this.nextSibling);
- }
- });
- },
- /**
- * @param {boolean} selector
- * @param {?} keepData
- * @return {?}
- */
- remove : function(selector, keepData) {
- var elem;
- var elems = selector ? jQuery.filter(selector, this) : this;
- /** @type {number} */
- var i = 0;
- for (;null != (elem = elems[i]);i++) {
- if (!keepData) {
- if (!(1 !== elem.nodeType)) {
- jQuery.cleanData(getAll(elem));
- }
- }
- if (elem.parentNode) {
- if (keepData) {
- if (jQuery.contains(elem.ownerDocument, elem)) {
- setGlobalEval(getAll(elem, "script"));
- }
- }
- elem.parentNode.removeChild(elem);
- }
- }
- return this;
- },
- /**
- * @return {?}
- */
- empty : function() {
- var elem;
- /** @type {number} */
- var unlock = 0;
- for (;null != (elem = this[unlock]);unlock++) {
- if (1 === elem.nodeType) {
- jQuery.cleanData(getAll(elem, false));
- /** @type {string} */
- elem.textContent = "";
- }
- }
- return this;
- },
- /**
- * @param {boolean} dataAndEvents
- * @param {boolean} deepDataAndEvents
- * @return {?}
- */
- clone : function(dataAndEvents, deepDataAndEvents) {
- return dataAndEvents = null == dataAndEvents ? false : dataAndEvents, deepDataAndEvents = null == deepDataAndEvents ? dataAndEvents : deepDataAndEvents, this.map(function() {
- return jQuery.clone(this, dataAndEvents, deepDataAndEvents);
- });
- },
- /**
- * @param {Object} value
- * @return {?}
- */
- html : function(value) {
- return access(this, function(value) {
- var elem = this[0] || {};
- /** @type {number} */
- var i = 0;
- var l = this.length;
- if (void 0 === value && 1 === elem.nodeType) {
- return elem.innerHTML;
- }
- if ("string" == typeof value && (!rchecked.test(value) && !wrapMap[(rtagName.exec(value) || ["", ""])[1].toLowerCase()])) {
- /** @type {string} */
- value = value.replace(rxhtmlTag, "<$1></$2>");
- try {
- for (;l > i;i++) {
- elem = this[i] || {};
- if (1 === elem.nodeType) {
- jQuery.cleanData(getAll(elem, false));
- /** @type {string} */
- elem.innerHTML = value;
- }
- }
- /** @type {number} */
- elem = 0;
- } catch (f) {
- }
- }
- if (elem) {
- this.empty().append(value);
- }
- }, null, value, arguments.length);
- },
- /**
- * @return {?}
- */
- replaceWith : function() {
- var arg = arguments[0];
- return this.domManip(arguments, function(s) {
- arg = this.parentNode;
- jQuery.cleanData(getAll(this));
- if (arg) {
- arg.replaceChild(s, this);
- }
- }), arg && (arg.length || arg.nodeType) ? this : this.remove();
- },
- /**
- * @param {Object} selector
- * @return {?}
- */
- detach : function(selector) {
- return this.remove(selector, true);
- },
- /**
- * @param {Object} args
- * @param {Function} callback
- * @return {?}
- */
- domManip : function(args, callback) {
- /** @type {Array} */
- args = core_concat.apply([], args);
- var fragment;
- var first;
- var scripts;
- var _len;
- var node;
- var doc;
- /** @type {number} */
- var i = 0;
- var l = this.length;
- var set = this;
- /** @type {number} */
- var iNoClone = l - 1;
- var html = args[0];
- var isFunction = jQuery.isFunction(html);
- if (isFunction || l > 1 && ("string" == typeof html && (!support.checkClone && exclude.test(html)))) {
- return this.each(function(index) {
- var self = set.eq(index);
- if (isFunction) {
- args[0] = html.call(this, index, self.html());
- }
- self.domManip(args, callback);
- });
- }
- if (l && (fragment = jQuery.buildFragment(args, this[0].ownerDocument, false, this), first = fragment.firstChild, 1 === fragment.childNodes.length && (fragment = first), first)) {
- scripts = jQuery.map(getAll(fragment, "script"), restoreScript);
- _len = scripts.length;
- for (;l > i;i++) {
- node = fragment;
- if (i !== iNoClone) {
- node = jQuery.clone(node, true, true);
- if (_len) {
- jQuery.merge(scripts, getAll(node, "script"));
- }
- }
- callback.call(this[i], node, i);
- }
- if (_len) {
- doc = scripts[scripts.length - 1].ownerDocument;
- jQuery.map(scripts, fn);
- /** @type {number} */
- i = 0;
- for (;_len > i;i++) {
- node = scripts[i];
- if (stopParent.test(node.type || "")) {
- if (!data_priv.access(node, "globalEval")) {
- if (jQuery.contains(doc, node)) {
- if (node.src) {
- if (jQuery._evalUrl) {
- jQuery._evalUrl(node.src);
- }
- } else {
- jQuery.globalEval(node.textContent.replace(rcleanScript, ""));
- }
- }
- }
- }
- }
- }
- }
- return this;
- }
- });
- jQuery.each({
- appendTo : "append",
- prependTo : "prepend",
- insertBefore : "before",
- insertAfter : "after",
- replaceAll : "replaceWith"
- }, function(original, method) {
- /**
- * @param {string} scripts
- * @return {?}
- */
- jQuery.fn[original] = function(scripts) {
- var resp;
- /** @type {Array} */
- var ret = [];
- var insert = jQuery(scripts);
- /** @type {number} */
- var segments = insert.length - 1;
- /** @type {number} */
- var i = 0;
- for (;segments >= i;i++) {
- resp = i === segments ? this : this.clone(true);
- jQuery(insert[i])[method](resp);
- core_push.apply(ret, resp.get());
- }
- return this.pushStack(ret);
- };
- });
- elemdisplay = {};
- /** @type {RegExp} */
- var rbracket = /^margin/;
- /** @type {RegExp} */
- var regexp = new RegExp("^(" + core_pnum + ")(?!px)[a-z%]+$", "i");
- /**
- * @param {Object} elem
- * @return {?}
- */
- var getStyles = function(elem) {
- return elem.ownerDocument.defaultView.getComputedStyle(elem, null);
- };
- !function() {
- var s;
- var o;
- var body = doc.documentElement;
- var testElement = doc.createElement("div");
- var div = doc.createElement("div");
- if (div.style) {
- /** @type {string} */
- div.style.backgroundClip = "content-box";
- /** @type {string} */
- div.cloneNode(true).style.backgroundClip = "";
- /** @type {boolean} */
- support.clearCloneStyle = "content-box" === div.style.backgroundClip;
- /** @type {string} */
- testElement.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute";
- testElement.appendChild(div);
- /**
- * @return {undefined}
- */
- var computePixelPositionAndBoxSizingReliable = function() {
- /** @type {string} */
- div.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute";
- /** @type {string} */
- div.innerHTML = "";
- body.appendChild(testElement);
- var divStyle = win.getComputedStyle(div, null);
- /** @type {boolean} */
- s = "1%" !== divStyle.top;
- /** @type {boolean} */
- o = "4px" === divStyle.width;
- body.removeChild(testElement);
- };
- if (win.getComputedStyle) {
- jQuery.extend(support, {
- /**
- * @return {?}
- */
- pixelPosition : function() {
- return computePixelPositionAndBoxSizingReliable(), s;
- },
- /**
- * @return {?}
- */
- boxSizingReliable : function() {
- return null == o && computePixelPositionAndBoxSizingReliable(), o;
- },
- /**
- * @return {?}
- */
- reliableMarginRight : function() {
- var f;
- var marginDiv = div.appendChild(doc.createElement("div"));
- return marginDiv.style.cssText = div.style.cssText = "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0", marginDiv.style.marginRight = marginDiv.style.width = "0", div.style.width = "1px", body.appendChild(testElement), f = !parseFloat(win.getComputedStyle(marginDiv, null).marginRight), body.removeChild(testElement), f;
- }
- });
- }
- }
- }();
- /**
- * @param {Object} elem
- * @param {Object} options
- * @param {Function} callback
- * @param {Array} args
- * @return {?}
- */
- jQuery.swap = function(elem, options, callback, args) {
- var ret;
- var name;
- var old = {};
- for (name in options) {
- old[name] = elem.style[name];
- elem.style[name] = options[name];
- }
- ret = callback.apply(elem, args || []);
- for (name in options) {
- elem.style[name] = old[name];
- }
- return ret;
- };
- /** @type {RegExp} */
- var rdisplayswap = /^(none|table(?!-c[ea]).+)/;
- /** @type {RegExp} */
- var rrelNum = new RegExp("^(" + core_pnum + ")(.*)$", "i");
- /** @type {RegExp} */
- var re2 = new RegExp("^([+-])=(" + core_pnum + ")", "i");
- var props = {
- position : "absolute",
- visibility : "hidden",
- display : "block"
- };
- var object = {
- letterSpacing : "0",
- fontWeight : "400"
- };
- /** @type {Array} */
- var cssPrefixes = ["Webkit", "O", "Moz", "ms"];
- jQuery.extend({
- cssHooks : {
- opacity : {
- /**
- * @param {Object} elem
- * @param {string} value
- * @return {?}
- */
- get : function(elem, value) {
- if (value) {
- var buffer = css(elem, "opacity");
- return "" === buffer ? "1" : buffer;
- }
- }
- }
- },
- cssNumber : {
- columnCount : true,
- fillOpacity : true,
- flexGrow : true,
- flexShrink : true,
- fontWeight : true,
- lineHeight : true,
- opacity : true,
- order : true,
- orphans : true,
- widows : true,
- zIndex : true,
- zoom : true
- },
- cssProps : {
- float : "cssFloat"
- },
- /**
- * @param {Object} elem
- * @param {string} name
- * @param {string} val
- * @param {string} extra
- * @return {?}
- */
- style : function(elem, name, val, extra) {
- if (elem && (3 !== elem.nodeType && (8 !== elem.nodeType && elem.style))) {
- var ret;
- var type;
- var hooks;
- var origName = jQuery.camelCase(name);
- var style = elem.style;
- return name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(style, origName)), hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName], void 0 === val ? hooks && ("get" in hooks && void 0 !== (ret = hooks.get(elem, false, extra))) ? ret : style[name] : (type = typeof val, "string" === type && ((ret = re2.exec(val)) && (val = (ret[1] + 1) * ret[2] + parseFloat(jQuery.css(elem, name)), type = "number")), null != val && (val === val && ("number" !== type || (jQuery.cssNumber[origName] ||
- (val += "px")), support.clearCloneStyle || ("" !== val || (0 !== name.indexOf("background") || (style[name] = "inherit"))), hooks && ("set" in hooks && void 0 === (val = hooks.set(elem, val, extra))) || (style[name] = val))), void 0);
- }
- },
- /**
- * @param {Object} elem
- * @param {string} prop
- * @param {boolean} recurring
- * @param {?} key
- * @return {?}
- */
- css : function(elem, prop, recurring, key) {
- var value;
- var val;
- var hooks;
- var origName = jQuery.camelCase(prop);
- return prop = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(elem.style, origName)), hooks = jQuery.cssHooks[prop] || jQuery.cssHooks[origName], hooks && ("get" in hooks && (value = hooks.get(elem, true, recurring))), void 0 === value && (value = css(elem, prop, key)), "normal" === value && (prop in object && (value = object[prop])), "" === recurring || recurring ? (val = parseFloat(value), recurring === true || jQuery.isNumeric(val) ? val || 0 : value) : value;
- }
- });
- jQuery.each(["height", "width"], function(dataAndEvents, name) {
- jQuery.cssHooks[name] = {
- /**
- * @param {Object} elem
- * @param {string} value
- * @param {string} extra
- * @return {?}
- */
- get : function(elem, value, extra) {
- if (value) {
- return rdisplayswap.test(jQuery.css(elem, "display")) && 0 === elem.offsetWidth ? jQuery.swap(elem, props, function() {
- return getWidthOrHeight(elem, name, extra);
- }) : getWidthOrHeight(elem, name, extra);
- }
- },
- /**
- * @param {Object} elem
- * @param {string} value
- * @param {string} extra
- * @return {?}
- */
- set : function(elem, value, extra) {
- var styles = extra && getStyles(elem);
- return setPositiveNumber(elem, value, extra ? augmentWidthOrHeight(elem, name, extra, "border-box" === jQuery.css(elem, "boxSizing", false, styles), styles) : 0);
- }
- };
- });
- jQuery.cssHooks.marginRight = addGetHookIf(support.reliableMarginRight, function(body, dataAndEvents) {
- if (dataAndEvents) {
- return jQuery.swap(body, {
- display : "inline-block"
- }, css, [body, "marginRight"]);
- }
- });
- jQuery.each({
- margin : "",
- padding : "",
- border : "Width"
- }, function(prefix, suffix) {
- jQuery.cssHooks[prefix + suffix] = {
- /**
- * @param {string} line
- * @return {?}
- */
- expand : function(line) {
- /** @type {number} */
- var i = 0;
- var expanded = {};
- /** @type {Array} */
- var tokens = "string" == typeof line ? line.split(" ") : [line];
- for (;4 > i;i++) {
- expanded[prefix + cssExpand[i] + suffix] = tokens[i] || (tokens[i - 2] || tokens[0]);
- }
- return expanded;
- }
- };
- if (!rbracket.test(prefix)) {
- /** @type {function (Object, string, string): ?} */
- jQuery.cssHooks[prefix + suffix].set = setPositiveNumber;
- }
- });
- jQuery.fn.extend({
- /**
- * @param {Object} elems
- * @param {string} value
- * @return {?}
- */
- css : function(elems, value) {
- return access(this, function(elem, prop, value) {
- var styles;
- var _len;
- var map = {};
- /** @type {number} */
- var name = 0;
- if (jQuery.isArray(prop)) {
- styles = getStyles(elem);
- _len = prop.length;
- for (;_len > name;name++) {
- map[prop[name]] = jQuery.css(elem, prop[name], false, styles);
- }
- return map;
- }
- return void 0 !== value ? jQuery.style(elem, prop, value) : jQuery.css(elem, prop);
- }, elems, value, arguments.length > 1);
- },
- /**
- * @return {?}
- */
- show : function() {
- return showHide(this, true);
- },
- /**
- * @return {?}
- */
- hide : function() {
- return showHide(this);
- },
- /**
- * @param {?} state
- * @return {?}
- */
- toggle : function(state) {
- return "boolean" == typeof state ? state ? this.show() : this.hide() : this.each(function() {
- if (isHidden(this)) {
- jQuery(this).show();
- } else {
- jQuery(this).hide();
- }
- });
- }
- });
- /** @type {function (string, string, string, string, string): ?} */
- jQuery.Tween = Tween;
- Tween.prototype = {
- /** @type {function (string, string, string, string, string): ?} */
- constructor : Tween,
- /**
- * @param {?} allBindingsAccessor
- * @param {Object} options
- * @param {?} prop
- * @param {number} to
- * @param {string} easing
- * @param {string} unit
- * @return {undefined}
- */
- init : function(allBindingsAccessor, options, prop, to, easing, unit) {
- this.elem = allBindingsAccessor;
- this.prop = prop;
- this.easing = easing || "swing";
- /** @type {Object} */
- this.options = options;
- this.start = this.now = this.cur();
- /** @type {number} */
- this.end = to;
- this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px");
- },
- /**
- * @return {?}
- */
- cur : function() {
- var hooks = Tween.propHooks[this.prop];
- return hooks && hooks.get ? hooks.get(this) : Tween.propHooks._default.get(this);
- },
- /**
- * @param {number} percent
- * @return {?}
- */
- run : function(percent) {
- var eased;
- var hooks = Tween.propHooks[this.prop];
- return this.pos = eased = this.options.duration ? jQuery.easing[this.easing](percent, this.options.duration * percent, 0, 1, this.options.duration) : percent, this.now = (this.end - this.start) * eased + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), hooks && hooks.set ? hooks.set(this) : Tween.propHooks._default.set(this), this;
- }
- };
- Tween.prototype.init.prototype = Tween.prototype;
- Tween.propHooks = {
- _default : {
- /**
- * @param {Object} elem
- * @return {?}
- */
- get : function(elem) {
- var node;
- return null == elem.elem[elem.prop] || elem.elem.style && null != elem.elem.style[elem.prop] ? (node = jQuery.css(elem.elem, elem.prop, ""), node && "auto" !== node ? node : 0) : elem.elem[elem.prop];
- },
- /**
- * @param {Object} tween
- * @return {undefined}
- */
- set : function(tween) {
- if (jQuery.fx.step[tween.prop]) {
- jQuery.fx.step[tween.prop](tween);
- } else {
- if (tween.elem.style && (null != tween.elem.style[jQuery.cssProps[tween.prop]] || jQuery.cssHooks[tween.prop])) {
- jQuery.style(tween.elem, tween.prop, tween.now + tween.unit);
- } else {
- tween.elem[tween.prop] = tween.now;
- }
- }
- }
- }
- };
- Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
- /**
- * @param {Object} elem
- * @return {undefined}
- */
- set : function(elem) {
- if (elem.elem.nodeType) {
- if (elem.elem.parentNode) {
- elem.elem[elem.prop] = elem.now;
- }
- }
- }
- };
- jQuery.easing = {
- /**
- * @param {?} t
- * @return {?}
- */
- linear : function(t) {
- return t;
- },
- /**
- * @param {number} p
- * @return {?}
- */
- swing : function(p) {
- return 0.5 - Math.cos(p * Math.PI) / 2;
- }
- };
- /** @type {function (?, Object, ?, number, string, string): undefined} */
- jQuery.fx = Tween.prototype.init;
- jQuery.fx.step = {};
- var fxNow;
- var scrollIntervalId;
- /** @type {RegExp} */
- var rplusequals = /^(?:toggle|show|hide)$/;
- /** @type {RegExp} */
- var rfxnum = new RegExp("^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i");
- /** @type {RegExp} */
- var numbers = /queueHooks$/;
- /** @type {Array} */
- var animationPrefilters = [defaultPrefilter];
- var cache = {
- "*" : [function(prop, value) {
- var tween = this.createTween(prop, value);
- var l0 = tween.cur();
- /** @type {(Array.<string>|null)} */
- var parts = rfxnum.exec(value);
- /** @type {string} */
- var unit = parts && parts[3] || (jQuery.cssNumber[prop] ? "" : "px");
- var start = (jQuery.cssNumber[prop] || "px" !== unit && +l0) && rfxnum.exec(jQuery.css(tween.elem, prop));
- /** @type {number} */
- var scale = 1;
- /** @type {number} */
- var h = 20;
- if (start && start[3] !== unit) {
- unit = unit || start[3];
- /** @type {Array} */
- parts = parts || [];
- /** @type {number} */
- start = +l0 || 1;
- do {
- /** @type {(number|string)} */
- scale = scale || ".5";
- start /= scale;
- jQuery.style(tween.elem, prop, start + unit);
- } while (scale !== (scale = tween.cur() / l0) && (1 !== scale && --h));
- }
- return parts && (start = tween.start = +start || (+l0 || 0), tween.unit = unit, tween.end = parts[1] ? start + (parts[1] + 1) * parts[2] : +parts[2]), tween;
- }]
- };
- jQuery.Animation = jQuery.extend(Animation, {
- /**
- * @param {Object} html
- * @param {Function} callback
- * @return {undefined}
- */
- tweener : function(html, callback) {
- if (jQuery.isFunction(html)) {
- /** @type {Object} */
- callback = html;
- /** @type {Array} */
- html = ["*"];
- } else {
- html = html.split(" ");
- }
- var c;
- /** @type {number} */
- var x = 0;
- var w = html.length;
- for (;w > x;x++) {
- c = html[x];
- cache[c] = cache[c] || [];
- cache[c].unshift(callback);
- }
- },
- /**
- * @param {?} callback
- * @param {?} prepend
- * @return {undefined}
- */
- prefilter : function(callback, prepend) {
- if (prepend) {
- animationPrefilters.unshift(callback);
- } else {
- animationPrefilters.push(callback);
- }
- }
- });
- /**
- * @param {string} speed
- * @param {string} easing
- * @param {Object} fn
- * @return {?}
- */
- jQuery.speed = function(speed, easing, fn) {
- var opt = speed && "object" == typeof speed ? jQuery.extend({}, speed) : {
- complete : fn || (!fn && easing || jQuery.isFunction(speed) && speed),
- duration : speed,
- easing : fn && easing || easing && (!jQuery.isFunction(easing) && easing)
- };
- return opt.duration = jQuery.fx.off ? 0 : "number" == typeof opt.duration ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default, (null == opt.queue || opt.queue === true) && (opt.queue = "fx"), opt.old = opt.complete, opt.complete = function() {
- if (jQuery.isFunction(opt.old)) {
- opt.old.call(this);
- }
- if (opt.queue) {
- jQuery.dequeue(this, opt.queue);
- }
- }, opt;
- };
- jQuery.fn.extend({
- /**
- * @param {string} speed
- * @param {number} to
- * @param {string} callback
- * @param {Object} _callback
- * @return {?}
- */
- fadeTo : function(speed, to, callback, _callback) {
- return this.filter(isHidden).css("opacity", 0).show().end().animate({
- opacity : to
- }, speed, callback, _callback);
- },
- /**
- * @param {?} prop
- * @param {string} speed
- * @param {string} easing
- * @param {Object} callback
- * @return {?}
- */
- animate : function(prop, speed, easing, callback) {
- var empty = jQuery.isEmptyObject(prop);
- var optall = jQuery.speed(speed, easing, callback);
- /**
- * @return {undefined}
- */
- var doAnimation = function() {
- var anim = Animation(this, jQuery.extend({}, prop), optall);
- if (empty || data_priv.get(this, "finish")) {
- anim.stop(true);
- }
- };
- return doAnimation.finish = doAnimation, empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation);
- },
- /**
- * @param {Object} type
- * @param {Object} clearQueue
- * @param {Object} gotoEnd
- * @return {?}
- */
- stop : function(type, clearQueue, gotoEnd) {
- /**
- * @param {Object} e
- * @return {undefined}
- */
- var stop = function(e) {
- var stop = e.stop;
- delete e.stop;
- stop(gotoEnd);
- };
- return "string" != typeof type && (gotoEnd = clearQueue, clearQueue = type, type = void 0), clearQueue && (type !== false && this.queue(type || "fx", [])), this.each(function() {
- /** @type {boolean} */
- var dequeue = true;
- var i = null != type && type + "queueHooks";
- /** @type {Array} */
- var timers = jQuery.timers;
- var gradient = data_priv.get(this);
- if (i) {
- if (gradient[i]) {
- if (gradient[i].stop) {
- stop(gradient[i]);
- }
- }
- } else {
- for (i in gradient) {
- if (gradient[i]) {
- if (gradient[i].stop) {
- if (numbers.test(i)) {
- stop(gradient[i]);
- }
- }
- }
- }
- }
- /** @type {number} */
- i = timers.length;
- for (;i--;) {
- if (!(timers[i].elem !== this)) {
- if (!(null != type && timers[i].queue !== type)) {
- timers[i].anim.stop(gotoEnd);
- /** @type {boolean} */
- dequeue = false;
- timers.splice(i, 1);
- }
- }
- }
- if (dequeue || !gotoEnd) {
- jQuery.dequeue(this, type);
- }
- });
- },
- /**
- * @param {string} type
- * @return {?}
- */
- finish : function(type) {
- return type !== false && (type = type || "fx"), this.each(function() {
- var index;
- var data = data_priv.get(this);
- var array = data[type + "queue"];
- var event = data[type + "queueHooks"];
- /** @type {Array} */
- var timers = jQuery.timers;
- var length = array ? array.length : 0;
- /** @type {boolean} */
- data.finish = true;
- jQuery.queue(this, type, []);
- if (event) {
- if (event.stop) {
- event.stop.call(this, true);
- }
- }
- /** @type {number} */
- index = timers.length;
- for (;index--;) {
- if (timers[index].elem === this) {
- if (timers[index].queue === type) {
- timers[index].anim.stop(true);
- timers.splice(index, 1);
- }
- }
- }
- /** @type {number} */
- index = 0;
- for (;length > index;index++) {
- if (array[index]) {
- if (array[index].finish) {
- array[index].finish.call(this);
- }
- }
- }
- delete data.finish;
- });
- }
- });
- jQuery.each(["toggle", "show", "hide"], function(dataAndEvents, name) {
- var matcherFunction = jQuery.fn[name];
- /**
- * @param {string} speed
- * @param {string} callback
- * @param {Object} next_callback
- * @return {?}
- */
- jQuery.fn[name] = function(speed, callback, next_callback) {
- return null == speed || "boolean" == typeof speed ? matcherFunction.apply(this, arguments) : this.animate(genFx(name, true), speed, callback, next_callback);
- };
- });
- jQuery.each({
- slideDown : genFx("show"),
- slideUp : genFx("hide"),
- slideToggle : genFx("toggle"),
- fadeIn : {
- opacity : "show"
- },
- fadeOut : {
- opacity : "hide"
- },
- fadeToggle : {
- opacity : "toggle"
- }
- }, function(original, props) {
- /**
- * @param {string} speed
- * @param {string} callback
- * @param {Object} next_callback
- * @return {?}
- */
- jQuery.fn[original] = function(speed, callback, next_callback) {
- return this.animate(props, speed, callback, next_callback);
- };
- });
- /** @type {Array} */
- jQuery.timers = [];
- /**
- * @return {undefined}
- */
- jQuery.fx.tick = function() {
- var last;
- /** @type {number} */
- var i = 0;
- /** @type {Array} */
- var timers = jQuery.timers;
- fxNow = jQuery.now();
- for (;i < timers.length;i++) {
- last = timers[i];
- if (!last()) {
- if (!(timers[i] !== last)) {
- timers.splice(i--, 1);
- }
- }
- }
- if (!timers.length) {
- jQuery.fx.stop();
- }
- fxNow = void 0;
- };
- /**
- * @param {?} timer
- * @return {undefined}
- */
- jQuery.fx.timer = function(timer) {
- jQuery.timers.push(timer);
- if (timer()) {
- jQuery.fx.start();
- } else {
- jQuery.timers.pop();
- }
- };
- /** @type {number} */
- jQuery.fx.interval = 13;
- /**
- * @return {undefined}
- */
- jQuery.fx.start = function() {
- if (!scrollIntervalId) {
- /** @type {number} */
- scrollIntervalId = setInterval(jQuery.fx.tick, jQuery.fx.interval);
- }
- };
- /**
- * @return {undefined}
- */
- jQuery.fx.stop = function() {
- clearInterval(scrollIntervalId);
- /** @type {null} */
- scrollIntervalId = null;
- };
- jQuery.fx.speeds = {
- slow : 600,
- fast : 200,
- _default : 400
- };
- /**
- * @param {HTMLElement} time
- * @param {string} type
- * @return {?}
- */
- jQuery.fn.delay = function(time, type) {
- return time = jQuery.fx ? jQuery.fx.speeds[time] || time : time, type = type || "fx", this.queue(type, function(next, event) {
- /** @type {number} */
- var timeout = setTimeout(next, time);
- /**
- * @return {undefined}
- */
- event.stop = function() {
- clearTimeout(timeout);
- };
- });
- };
- (function() {
- var input = doc.createElement("input");
- var select = doc.createElement("select");
- var opt = select.appendChild(doc.createElement("option"));
- /** @type {string} */
- input.type = "checkbox";
- /** @type {boolean} */
- support.checkOn = "" !== input.value;
- support.optSelected = opt.selected;
- /** @type {boolean} */
- select.disabled = true;
- /** @type {boolean} */
- support.optDisabled = !opt.disabled;
- input = doc.createElement("input");
- /** @type {string} */
- input.value = "t";
- /** @type {string} */
- input.type = "radio";
- /** @type {boolean} */
- support.radioValue = "t" === input.value;
- })();
- values = jQuery.expr.attrHandle;
- jQuery.fn.extend({
- /**
- * @param {string} name
- * @param {string} value
- * @return {?}
- */
- attr : function(name, value) {
- return access(this, jQuery.attr, name, value, arguments.length > 1);
- },
- /**
- * @param {string} name
- * @return {?}
- */
- removeAttr : function(name) {
- return this.each(function() {
- jQuery.removeAttr(this, name);
- });
- }
- });
- jQuery.extend({
- /**
- * @param {Object} elem
- * @param {string} name
- * @param {Object} value
- * @return {?}
- */
- attr : function(elem, name, value) {
- var hooks;
- var ret;
- var nodeType = elem.nodeType;
- if (elem && (3 !== nodeType && (8 !== nodeType && 2 !== nodeType))) {
- return typeof elem.getAttribute === memory ? jQuery.prop(elem, name, value) : (1 === nodeType && jQuery.isXMLDoc(elem) || (name = name.toLowerCase(), hooks = jQuery.attrHooks[name] || (jQuery.expr.match.bool.test(name) ? boolHook : nodeHook)), void 0 === value ? hooks && ("get" in hooks && null !== (ret = hooks.get(elem, name))) ? ret : (ret = jQuery.find.attr(elem, name), null == ret ? void 0 : ret) : null !== value ? hooks && ("set" in hooks && void 0 !== (ret = hooks.set(elem, value, name))) ?
- ret : (elem.setAttribute(name, value + ""), value) : void jQuery.removeAttr(elem, name));
- }
- },
- /**
- * @param {Object} elem
- * @param {string} value
- * @return {undefined}
- */
- removeAttr : function(elem, value) {
- var name;
- var propName;
- /** @type {number} */
- var i = 0;
- var attrNames = value && value.match(core_rnotwhite);
- if (attrNames && 1 === elem.nodeType) {
- for (;name = attrNames[i++];) {
- propName = jQuery.propFix[name] || name;
- if (jQuery.expr.match.bool.test(name)) {
- /** @type {boolean} */
- elem[propName] = false;
- }
- elem.removeAttribute(name);
- }
- }
- },
- attrHooks : {
- type : {
- /**
- * @param {Object} elem
- * @param {string} value
- * @return {?}
- */
- set : function(elem, value) {
- if (!support.radioValue && ("radio" === value && jQuery.nodeName(elem, "input"))) {
- var val = elem.value;
- return elem.setAttribute("type", value), val && (elem.value = val), value;
- }
- }
- }
- }
- });
- boolHook = {
- /**
- * @param {Object} elem
- * @param {string} value
- * @param {string} name
- * @return {?}
- */
- set : function(elem, value, name) {
- return value === false ? jQuery.removeAttr(elem, name) : elem.setAttribute(name, name), name;
- }
- };
- jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function(dataAndEvents, name) {
- var callback = values[name] || jQuery.find.attr;
- /**
- * @param {string} body
- * @param {string} key
- * @param {Object} arg
- * @return {?}
- */
- values[name] = function(body, key, arg) {
- var result;
- var value;
- return arg || (value = values[key], values[key] = result, result = null != callback(body, key, arg) ? key.toLowerCase() : null, values[key] = value), result;
- };
- });
- /** @type {RegExp} */
- rfocusable = /^(?:input|select|textarea|button)$/i;
- jQuery.fn.extend({
- /**
- * @param {string} name
- * @param {string} value
- * @return {?}
- */
- prop : function(name, value) {
- return access(this, jQuery.prop, name, value, arguments.length > 1);
- },
- /**
- * @param {?} name
- * @return {?}
- */
- removeProp : function(name) {
- return this.each(function() {
- delete this[jQuery.propFix[name] || name];
- });
- }
- });
- jQuery.extend({
- propFix : {
- "for" : "htmlFor",
- "class" : "className"
- },
- /**
- * @param {Object} elem
- * @param {string} name
- * @param {string} value
- * @return {?}
- */
- prop : function(elem, name, value) {
- var ret;
- var hooks;
- var n;
- var nodeType = elem.nodeType;
- if (elem && (3 !== nodeType && (8 !== nodeType && 2 !== nodeType))) {
- return n = 1 !== nodeType || !jQuery.isXMLDoc(elem), n && (name = jQuery.propFix[name] || name, hooks = jQuery.propHooks[name]), void 0 !== value ? hooks && ("set" in hooks && void 0 !== (ret = hooks.set(elem, value, name))) ? ret : elem[name] = value : hooks && ("get" in hooks && null !== (ret = hooks.get(elem, name))) ? ret : elem[name];
- }
- },
- propHooks : {
- tabIndex : {
- /**
- * @param {Object} elem
- * @return {?}
- */
- get : function(elem) {
- return elem.hasAttribute("tabindex") || (rfocusable.test(elem.nodeName) || elem.href) ? elem.tabIndex : -1;
- }
- }
- }
- });
- if (!support.optSelected) {
- jQuery.propHooks.selected = {
- /**
- * @param {Object} elem
- * @return {?}
- */
- get : function(elem) {
- var parent = elem.parentNode;
- return parent && (parent.parentNode && parent.parentNode.selectedIndex), null;
- }
- };
- }
- jQuery.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() {
- jQuery.propFix[this.toLowerCase()] = this;
- });
- /** @type {RegExp} */
- rclass = /[\t\r\n\f]/g;
- jQuery.fn.extend({
- /**
- * @param {string} value
- * @return {?}
- */
- addClass : function(value) {
- var classes;
- var elem;
- var cur;
- var clazz;
- var j;
- var finalValue;
- /** @type {(boolean|string)} */
- var proceed = "string" == typeof value && value;
- /** @type {number} */
- var i = 0;
- var l = this.length;
- if (jQuery.isFunction(value)) {
- return this.each(function(j) {
- jQuery(this).addClass(value.call(this, j, this.className));
- });
- }
- if (proceed) {
- classes = (value || "").match(core_rnotwhite) || [];
- for (;l > i;i++) {
- if (elem = this[i], cur = 1 === elem.nodeType && (elem.className ? (" " + elem.className + " ").replace(rclass, " ") : " ")) {
- /** @type {number} */
- j = 0;
- for (;clazz = classes[j++];) {
- if (cur.indexOf(" " + clazz + " ") < 0) {
- cur += clazz + " ";
- }
- }
- finalValue = jQuery.trim(cur);
- if (elem.className !== finalValue) {
- elem.className = finalValue;
- }
- }
- }
- }
- return this;
- },
- /**
- * @param {string} value
- * @return {?}
- */
- removeClass : function(value) {
- var map;
- var elem;
- var cur;
- var val;
- var k;
- var finalValue;
- /** @type {(boolean|string)} */
- var h = 0 === arguments.length || "string" == typeof value && value;
- /** @type {number} */
- var i = 0;
- var l = this.length;
- if (jQuery.isFunction(value)) {
- return this.each(function(j) {
- jQuery(this).removeClass(value.call(this, j, this.className));
- });
- }
- if (h) {
- map = (value || "").match(core_rnotwhite) || [];
- for (;l > i;i++) {
- if (elem = this[i], cur = 1 === elem.nodeType && (elem.className ? (" " + elem.className + " ").replace(rclass, " ") : "")) {
- /** @type {number} */
- k = 0;
- for (;val = map[k++];) {
- for (;cur.indexOf(" " + val + " ") >= 0;) {
- /** @type {string} */
- cur = cur.replace(" " + val + " ", " ");
- }
- }
- finalValue = value ? jQuery.trim(cur) : "";
- if (elem.className !== finalValue) {
- elem.className = finalValue;
- }
- }
- }
- }
- return this;
- },
- /**
- * @param {string} value
- * @param {?} stateVal
- * @return {?}
- */
- toggleClass : function(value, stateVal) {
- /** @type {string} */
- var type = typeof value;
- return "boolean" == typeof stateVal && "string" === type ? stateVal ? this.addClass(value) : this.removeClass(value) : this.each(jQuery.isFunction(value) ? function(i) {
- jQuery(this).toggleClass(value.call(this, i, this.className, stateVal), stateVal);
- } : function() {
- if ("string" === type) {
- var className;
- /** @type {number} */
- var i = 0;
- var self = jQuery(this);
- var classNames = value.match(core_rnotwhite) || [];
- for (;className = classNames[i++];) {
- if (self.hasClass(className)) {
- self.removeClass(className);
- } else {
- self.addClass(className);
- }
- }
- } else {
- if (type === memory || "boolean" === type) {
- if (this.className) {
- data_priv.set(this, "__className__", this.className);
- }
- this.className = this.className || value === false ? "" : data_priv.get(this, "__className__") || "";
- }
- }
- });
- },
- /**
- * @param {string} name
- * @return {?}
- */
- hasClass : function(name) {
- /** @type {string} */
- var expectation = " " + name + " ";
- /** @type {number} */
- var i = 0;
- var l = this.length;
- for (;l > i;i++) {
- if (1 === this[i].nodeType && (" " + this[i].className + " ").replace(rclass, " ").indexOf(expectation) >= 0) {
- return true;
- }
- }
- return false;
- }
- });
- /** @type {RegExp} */
- rreturn = /\r/g;
- jQuery.fn.extend({
- /**
- * @param {Function} value
- * @return {?}
- */
- val : function(value) {
- var hooks;
- var ret;
- var isFunction;
- var elem = this[0];
- return arguments.length ? (isFunction = jQuery.isFunction(value), this.each(function(i) {
- var val;
- if (1 === this.nodeType) {
- val = isFunction ? value.call(this, i, jQuery(this).val()) : value;
- if (null == val) {
- /** @type {string} */
- val = "";
- } else {
- if ("number" == typeof val) {
- val += "";
- } else {
- if (jQuery.isArray(val)) {
- val = jQuery.map(val, function(month) {
- return null == month ? "" : month + "";
- });
- }
- }
- }
- hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()];
- if (!(hooks && ("set" in hooks && void 0 !== hooks.set(this, val, "value")))) {
- this.value = val;
- }
- }
- })) : elem ? (hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()], hooks && ("get" in hooks && void 0 !== (ret = hooks.get(elem, "value"))) ? ret : (ret = elem.value, "string" == typeof ret ? ret.replace(rreturn, "") : null == ret ? "" : ret)) : void 0;
- }
- });
- jQuery.extend({
- valHooks : {
- option : {
- /**
- * @param {Object} elem
- * @return {?}
- */
- get : function(elem) {
- var handle = jQuery.find.attr(elem, "value");
- return null != handle ? handle : jQuery.trim(jQuery.text(elem));
- }
- },
- select : {
- /**
- * @param {Object} elem
- * @return {?}
- */
- get : function(elem) {
- var copies;
- var option;
- var options = elem.options;
- var index = elem.selectedIndex;
- /** @type {boolean} */
- var one = "select-one" === elem.type || 0 > index;
- /** @type {(Array|null)} */
- var out = one ? null : [];
- var max = one ? index + 1 : options.length;
- var i = 0 > index ? max : one ? index : 0;
- for (;max > i;i++) {
- if (option = options[i], !(!option.selected && i !== index || ((support.optDisabled ? option.disabled : null !== option.getAttribute("disabled")) || option.parentNode.disabled && jQuery.nodeName(option.parentNode, "optgroup")))) {
- if (copies = jQuery(option).val(), one) {
- return copies;
- }
- out.push(copies);
- }
- }
- return out;
- },
- /**
- * @param {Object} elem
- * @param {string} value
- * @return {?}
- */
- set : function(elem, value) {
- var u;
- var option;
- var options = elem.options;
- var values = jQuery.makeArray(value);
- var i = options.length;
- for (;i--;) {
- option = options[i];
- if (option.selected = jQuery.inArray(option.value, values) >= 0) {
- /** @type {boolean} */
- u = true;
- }
- }
- return u || (elem.selectedIndex = -1), values;
- }
- }
- }
- });
- jQuery.each(["radio", "checkbox"], function() {
- jQuery.valHooks[this] = {
- /**
- * @param {Object} elem
- * @param {string} value
- * @return {?}
- */
- set : function(elem, value) {
- if (jQuery.isArray(value)) {
- return elem.checked = jQuery.inArray(jQuery(elem).val(), value) >= 0;
- }
- }
- };
- if (!support.checkOn) {
- /**
- * @param {Object} elem
- * @return {?}
- */
- jQuery.valHooks[this].get = function(elem) {
- return null === elem.getAttribute("value") ? "on" : elem.value;
- };
- }
- });
- jQuery.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function(dataAndEvents, name) {
- /**
- * @param {Function} data
- * @param {Function} fn
- * @return {?}
- */
- jQuery.fn[name] = function(data, fn) {
- return arguments.length > 0 ? this.on(name, null, data, fn) : this.trigger(name);
- };
- });
- jQuery.fn.extend({
- /**
- * @param {undefined} fnOver
- * @param {Object} fnOut
- * @return {?}
- */
- hover : function(fnOver, fnOut) {
- return this.mouseenter(fnOver).mouseleave(fnOut || fnOver);
- },
- /**
- * @param {string} types
- * @param {Function} data
- * @param {Function} fn
- * @return {?}
- */
- bind : function(types, data, fn) {
- return this.on(types, null, data, fn);
- },
- /**
- * @param {Object} types
- * @param {Function} fn
- * @return {?}
- */
- unbind : function(types, fn) {
- return this.off(types, null, fn);
- },
- /**
- * @param {Function} selector
- * @param {string} types
- * @param {Function} data
- * @param {Function} fn
- * @return {?}
- */
- delegate : function(selector, types, data, fn) {
- return this.on(types, selector, data, fn);
- },
- /**
- * @param {string} selector
- * @param {Object} types
- * @param {Function} fn
- * @return {?}
- */
- undelegate : function(selector, types, fn) {
- return 1 === arguments.length ? this.off(selector, "**") : this.off(types, selector || "**", fn);
- }
- });
- iIdCounter = jQuery.now();
- /** @type {RegExp} */
- rquery = /\?/;
- /**
- * @param {Object} str
- * @return {?}
- */
- jQuery.parseJSON = function(str) {
- return JSON.parse(str + "");
- };
- /**
- * @param {string} data
- * @return {?}
- */
- jQuery.parseXML = function(data) {
- var xml;
- var tmp;
- if (!data || "string" != typeof data) {
- return null;
- }
- try {
- /** @type {DOMParser} */
- tmp = new DOMParser;
- /** @type {(Document|null)} */
- xml = tmp.parseFromString(data, "text/xml");
- } catch (u) {
- xml = void 0;
- }
- return(!xml || xml.getElementsByTagName("parsererror").length) && jQuery.error("Invalid XML: " + data), xml;
- };
- var match;
- var ajaxLocation;
- /** @type {RegExp} */
- var currDirRegExp = /#.*$/;
- /** @type {RegExp} */
- var rts = /([?&])_=[^&]*/;
- /** @type {RegExp} */
- var r = /^(.*?):[ \t]*([^\r\n]*)$/gm;
- /** @type {RegExp} */
- var rnoContent = /^(?:GET|HEAD)$/;
- /** @type {RegExp} */
- var rprotocol = /^\/\//;
- /** @type {RegExp} */
- var quickExpr = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/;
- var prefilters = {};
- var transports = {};
- /** @type {string} */
- var yu = "*/".concat("*");
- try {
- /** @type {string} */
- ajaxLocation = location.href;
- } catch (ge) {
- ajaxLocation = doc.createElement("a");
- /** @type {string} */
- ajaxLocation.href = "";
- /** @type {string} */
- ajaxLocation = ajaxLocation.href;
- }
- /** @type {Array} */
- match = quickExpr.exec(ajaxLocation.toLowerCase()) || [];
- jQuery.extend({
- active : 0,
- lastModified : {},
- etag : {},
- ajaxSettings : {
- url : ajaxLocation,
- type : "GET",
- isLocal : /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(match[1]),
- global : true,
- processData : true,
- async : true,
- contentType : "application/x-www-form-urlencoded; charset=UTF-8",
- accepts : {
- "*" : yu,
- text : "text/plain",
- html : "text/html",
- xml : "application/xml, text/xml",
- json : "application/json, text/javascript"
- },
- contents : {
- xml : /xml/,
- html : /html/,
- json : /json/
- },
- responseFields : {
- xml : "responseXML",
- text : "responseText",
- json : "responseJSON"
- },
- converters : {
- /** @type {function (new:String, *=): string} */
- "* text" : String,
- "text html" : true,
- /** @type {function (Object): ?} */
- "text json" : jQuery.parseJSON,
- /** @type {function (string): ?} */
- "text xml" : jQuery.parseXML
- },
- flatOptions : {
- url : true,
- context : true
- }
- },
- /**
- * @param {(Object|string)} target
- * @param {Object} settings
- * @return {?}
- */
- ajaxSetup : function(target, settings) {
- return settings ? ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) : ajaxExtend(jQuery.ajaxSettings, target);
- },
- ajaxPrefilter : addToPrefiltersOrTransports(prefilters),
- ajaxTransport : addToPrefiltersOrTransports(transports),
- /**
- * @param {Object} url
- * @param {Object} options
- * @return {?}
- */
- ajax : function(url, options) {
- /**
- * @param {number} status
- * @param {(number|string)} nativeStatusText
- * @param {Object} responses
- * @param {string} total
- * @return {undefined}
- */
- function done(status, nativeStatusText, responses, total) {
- var isSuccess;
- var success;
- var error;
- var response;
- var modified;
- /** @type {(number|string)} */
- var statusText = nativeStatusText;
- if (2 !== e) {
- /** @type {number} */
- e = 2;
- if (tref) {
- clearTimeout(tref);
- }
- transport = void 0;
- ua = total || "";
- /** @type {number} */
- jqXHR.readyState = status > 0 ? 4 : 0;
- /** @type {boolean} */
- isSuccess = status >= 200 && 300 > status || 304 === status;
- if (responses) {
- response = ajaxHandleResponses(s, jqXHR, responses);
- }
- response = ajaxConvert(s, response, jqXHR, isSuccess);
- if (isSuccess) {
- if (s.ifModified) {
- modified = jqXHR.getResponseHeader("Last-Modified");
- if (modified) {
- jQuery.lastModified[cacheURL] = modified;
- }
- modified = jqXHR.getResponseHeader("etag");
- if (modified) {
- jQuery.etag[cacheURL] = modified;
- }
- }
- if (204 === status || "HEAD" === s.type) {
- /** @type {string} */
- statusText = "nocontent";
- } else {
- if (304 === status) {
- /** @type {string} */
- statusText = "notmodified";
- } else {
- statusText = response.state;
- success = response.data;
- error = response.error;
- /** @type {boolean} */
- isSuccess = !error;
- }
- }
- } else {
- error = statusText;
- if (status || !statusText) {
- /** @type {string} */
- statusText = "error";
- if (0 > status) {
- /** @type {number} */
- status = 0;
- }
- }
- }
- /** @type {number} */
- jqXHR.status = status;
- /** @type {string} */
- jqXHR.statusText = (nativeStatusText || statusText) + "";
- if (isSuccess) {
- deferred.resolveWith(callbackContext, [success, statusText, jqXHR]);
- } else {
- deferred.rejectWith(callbackContext, [jqXHR, statusText, error]);
- }
- jqXHR.statusCode(statusCode);
- statusCode = void 0;
- if (g) {
- globalEventContext.trigger(isSuccess ? "ajaxSuccess" : "ajaxError", [jqXHR, s, isSuccess ? success : error]);
- }
- completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);
- if (g) {
- globalEventContext.trigger("ajaxComplete", [jqXHR, s]);
- if (!--jQuery.active) {
- jQuery.event.trigger("ajaxStop");
- }
- }
- }
- }
- if ("object" == typeof url) {
- /** @type {Object} */
- options = url;
- url = void 0;
- }
- options = options || {};
- var transport;
- var cacheURL;
- var ua;
- var cache;
- var tref;
- var t;
- var g;
- var i;
- var s = jQuery.ajaxSetup({}, options);
- var callbackContext = s.context || s;
- var globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event;
- var deferred = jQuery.Deferred();
- var completeDeferred = jQuery.Callbacks("once memory");
- var statusCode = s.statusCode || {};
- var requestHeaders = {};
- var requestHeadersNames = {};
- /** @type {number} */
- var e = 0;
- /** @type {string} */
- var strAbort = "canceled";
- var jqXHR = {
- readyState : 0,
- /**
- * @param {string} key
- * @return {?}
- */
- getResponseHeader : function(key) {
- var data;
- if (2 === e) {
- if (!cache) {
- cache = {};
- for (;data = r.exec(ua);) {
- /** @type {string} */
- cache[data[1].toLowerCase()] = data[2];
- }
- }
- data = cache[key.toLowerCase()];
- }
- return null == data ? null : data;
- },
- /**
- * @return {?}
- */
- getAllResponseHeaders : function() {
- return 2 === e ? ua : null;
- },
- /**
- * @param {string} name
- * @param {?} value
- * @return {?}
- */
- setRequestHeader : function(name, value) {
- var lname = name.toLowerCase();
- return e || (name = requestHeadersNames[lname] = requestHeadersNames[lname] || name, requestHeaders[name] = value), this;
- },
- /**
- * @param {(Object|number)} type
- * @return {?}
- */
- overrideMimeType : function(type) {
- return e || (s.mimeType = type), this;
- },
- /**
- * @param {Object} map
- * @return {?}
- */
- statusCode : function(map) {
- var letter;
- if (map) {
- if (2 > e) {
- for (letter in map) {
- /** @type {Array} */
- statusCode[letter] = [statusCode[letter], map[letter]];
- }
- } else {
- jqXHR.always(map[jqXHR.status]);
- }
- }
- return this;
- },
- /**
- * @param {string} args
- * @return {?}
- */
- abort : function(args) {
- var typePattern = args || strAbort;
- return transport && transport.abort(typePattern), done(0, typePattern), this;
- }
- };
- if (deferred.promise(jqXHR).complete = completeDeferred.add, jqXHR.success = jqXHR.done, jqXHR.error = jqXHR.fail, s.url = ((url || (s.url || ajaxLocation)) + "").replace(currDirRegExp, "").replace(rprotocol, match[1] + "//"), s.type = options.method || (options.type || (s.method || s.type)), s.dataTypes = jQuery.trim(s.dataType || "*").toLowerCase().match(core_rnotwhite) || [""], null == s.crossDomain && (t = quickExpr.exec(s.url.toLowerCase()), s.crossDomain = !(!t || t[1] === match[1] &&
- (t[2] === match[2] && (t[3] || ("http:" === t[1] ? "80" : "443")) === (match[3] || ("http:" === match[1] ? "80" : "443"))))), s.data && (s.processData && ("string" != typeof s.data && (s.data = jQuery.param(s.data, s.traditional)))), inspectPrefiltersOrTransports(prefilters, s, options, jqXHR), 2 === e) {
- return jqXHR;
- }
- g = s.global;
- if (g) {
- if (0 == jQuery.active++) {
- jQuery.event.trigger("ajaxStart");
- }
- }
- s.type = s.type.toUpperCase();
- /** @type {boolean} */
- s.hasContent = !rnoContent.test(s.type);
- cacheURL = s.url;
- if (!s.hasContent) {
- if (s.data) {
- /** @type {string} */
- cacheURL = s.url += (rquery.test(cacheURL) ? "&" : "?") + s.data;
- delete s.data;
- }
- if (s.cache === false) {
- s.url = rts.test(cacheURL) ? cacheURL.replace(rts, "$1_=" + iIdCounter++) : cacheURL + (rquery.test(cacheURL) ? "&" : "?") + "_=" + iIdCounter++;
- }
- }
- if (s.ifModified) {
- if (jQuery.lastModified[cacheURL]) {
- jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]);
- }
- if (jQuery.etag[cacheURL]) {
- jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]);
- }
- }
- if (s.data && (s.hasContent && s.contentType !== false) || options.contentType) {
- jqXHR.setRequestHeader("Content-Type", s.contentType);
- }
- jqXHR.setRequestHeader("Accept", s.dataTypes[0] && s.accepts[s.dataTypes[0]] ? s.accepts[s.dataTypes[0]] + ("*" !== s.dataTypes[0] ? ", " + yu + "; q=0.01" : "") : s.accepts["*"]);
- for (i in s.headers) {
- jqXHR.setRequestHeader(i, s.headers[i]);
- }
- if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || 2 === e)) {
- return jqXHR.abort();
- }
- /** @type {string} */
- strAbort = "abort";
- for (i in{
- success : 1,
- error : 1,
- complete : 1
- }) {
- jqXHR[i](s[i]);
- }
- if (transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR)) {
- /** @type {number} */
- jqXHR.readyState = 1;
- if (g) {
- globalEventContext.trigger("ajaxSend", [jqXHR, s]);
- }
- if (s.async) {
- if (s.timeout > 0) {
- /** @type {number} */
- tref = setTimeout(function() {
- jqXHR.abort("timeout");
- }, s.timeout);
- }
- }
- try {
- /** @type {number} */
- e = 1;
- transport.send(requestHeaders, done);
- } catch (finalText) {
- if (!(2 > e)) {
- throw finalText;
- }
- done(-1, finalText);
- }
- } else {
- done(-1, "No Transport");
- }
- return jqXHR;
- },
- /**
- * @param {Object} cur
- * @param {string} data
- * @param {string} callback
- * @return {?}
- */
- getJSON : function(cur, data, callback) {
- return jQuery.get(cur, data, callback, "json");
- },
- /**
- * @param {Object} cur
- * @param {string} callback
- * @return {?}
- */
- getScript : function(cur, callback) {
- return jQuery.get(cur, void 0, callback, "script");
- }
- });
- jQuery.each(["get", "post"], function(dataAndEvents, method) {
- /**
- * @param {string} requestUrl
- * @param {(Function|string)} html
- * @param {(Function|string)} success
- * @param {(Object|string)} dataType
- * @return {?}
- */
- jQuery[method] = function(requestUrl, html, success, dataType) {
- return jQuery.isFunction(html) && (dataType = dataType || success, success = html, html = void 0), jQuery.ajax({
- url : requestUrl,
- type : method,
- dataType : dataType,
- data : html,
- success : success
- });
- };
- });
- jQuery.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(dataAndEvents, name) {
- /**
- * @param {Function} selector
- * @return {?}
- */
- jQuery.fn[name] = function(selector) {
- return this.on(name, selector);
- };
- });
- /**
- * @param {string} url
- * @return {?}
- */
- jQuery._evalUrl = function(url) {
- return jQuery.ajax({
- url : url,
- type : "GET",
- dataType : "script",
- async : false,
- global : false,
- throws : true
- });
- };
- jQuery.fn.extend({
- /**
- * @param {Function} html
- * @return {?}
- */
- wrapAll : function(html) {
- var wrap;
- return jQuery.isFunction(html) ? this.each(function(i) {
- jQuery(this).wrapAll(html.call(this, i));
- }) : (this[0] && (wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true), this[0].parentNode && wrap.insertBefore(this[0]), wrap.map(function() {
- var elem = this;
- for (;elem.firstElementChild;) {
- elem = elem.firstElementChild;
- }
- return elem;
- }).append(this)), this);
- },
- /**
- * @param {Function} html
- * @return {?}
- */
- wrapInner : function(html) {
- return this.each(jQuery.isFunction(html) ? function(i) {
- jQuery(this).wrapInner(html.call(this, i));
- } : function() {
- var self = jQuery(this);
- var contents = self.contents();
- if (contents.length) {
- contents.wrapAll(html);
- } else {
- self.append(html);
- }
- });
- },
- /**
- * @param {Function} html
- * @return {?}
- */
- wrap : function(html) {
- var isFunction = jQuery.isFunction(html);
- return this.each(function(i) {
- jQuery(this).wrapAll(isFunction ? html.call(this, i) : html);
- });
- },
- /**
- * @return {?}
- */
- unwrap : function() {
- return this.parent().each(function() {
- if (!jQuery.nodeName(this, "body")) {
- jQuery(this).replaceWith(this.childNodes);
- }
- }).end();
- }
- });
- /**
- * @param {string} args
- * @return {?}
- */
- jQuery.expr.filters.hidden = function(args) {
- return args.offsetWidth <= 0 && args.offsetHeight <= 0;
- };
- /**
- * @param {string} ast
- * @return {?}
- */
- jQuery.expr.filters.visible = function(ast) {
- return!jQuery.expr.filters.hidden(ast);
- };
- /** @type {RegExp} */
- var rQuot = /%20/g;
- /** @type {RegExp} */
- var rmargin = /\[\]$/;
- /** @type {RegExp} */
- var rCRLF = /\r?\n/g;
- /** @type {RegExp} */
- var mouseTypeRegex = /^(?:submit|button|image|reset|file)$/i;
- /** @type {RegExp} */
- var rsubmittable = /^(?:input|select|textarea|keygen)/i;
- /**
- * @param {Object} a
- * @param {string} traditional
- * @return {?}
- */
- jQuery.param = function(a, traditional) {
- var prefix;
- /** @type {Array} */
- var klass = [];
- /**
- * @param {?} key
- * @param {string} value
- * @return {undefined}
- */
- var add = function(key, value) {
- value = jQuery.isFunction(value) ? value() : null == value ? "" : value;
- /** @type {string} */
- klass[klass.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
- };
- if (void 0 === traditional && (traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional), jQuery.isArray(a) || a.jquery && !jQuery.isPlainObject(a)) {
- jQuery.each(a, function() {
- add(this.name, this.value);
- });
- } else {
- for (prefix in a) {
- buildParams(prefix, a[prefix], traditional, add);
- }
- }
- return klass.join("&").replace(rQuot, "+");
- };
- jQuery.fn.extend({
- /**
- * @return {?}
- */
- serialize : function() {
- return jQuery.param(this.serializeArray());
- },
- /**
- * @return {?}
- */
- serializeArray : function() {
- return this.map(function() {
- var elements = jQuery.prop(this, "elements");
- return elements ? jQuery.makeArray(elements) : this;
- }).filter(function() {
- var type = this.type;
- return this.name && (!jQuery(this).is(":disabled") && (rsubmittable.test(this.nodeName) && (!mouseTypeRegex.test(type) && (this.checked || !manipulation_rcheckableType.test(type)))));
- }).map(function(dataAndEvents, elem) {
- var val = jQuery(this).val();
- return null == val ? null : jQuery.isArray(val) ? jQuery.map(val, function(val) {
- return{
- name : elem.name,
- value : val.replace(rCRLF, "\r\n")
- };
- }) : {
- name : elem.name,
- value : val.replace(rCRLF, "\r\n")
- };
- }).get();
- }
- });
- /**
- * @return {?}
- */
- jQuery.ajaxSettings.xhr = function() {
- try {
- return new XMLHttpRequest;
- } catch (n) {
- }
- };
- /** @type {number} */
- var rightId = 0;
- var map = {};
- var xhrSuccessStatus = {
- 0 : 200,
- 1223 : 204
- };
- var xhrSupported = jQuery.ajaxSettings.xhr();
- return win.ActiveXObject && jQuery(win).on("unload", function() {
- var letter;
- for (letter in map) {
- map[letter]();
- }
- }), support.cors = !!xhrSupported && "withCredentials" in xhrSupported, support.ajax = xhrSupported = !!xhrSupported, jQuery.ajaxTransport(function(options) {
- var callback;
- if (support.cors || xhrSupported && !options.crossDomain) {
- return{
- /**
- * @param {Object} headers
- * @param {Function} complete
- * @return {undefined}
- */
- send : function(headers, complete) {
- var i;
- var xhr = options.xhr();
- /** @type {number} */
- var id = ++rightId;
- if (xhr.open(options.type, options.url, options.async, options.username, options.password), options.xhrFields) {
- for (i in options.xhrFields) {
- xhr[i] = options.xhrFields[i];
- }
- }
- if (options.mimeType) {
- if (xhr.overrideMimeType) {
- xhr.overrideMimeType(options.mimeType);
- }
- }
- if (!options.crossDomain) {
- if (!headers["X-Requested-With"]) {
- /** @type {string} */
- headers["X-Requested-With"] = "XMLHttpRequest";
- }
- }
- for (i in headers) {
- xhr.setRequestHeader(i, headers[i]);
- }
- /**
- * @param {string} status
- * @return {?}
- */
- callback = function(status) {
- return function() {
- if (callback) {
- delete map[id];
- /** @type {null} */
- callback = xhr.onload = xhr.onerror = null;
- if ("abort" === status) {
- xhr.abort();
- } else {
- if ("error" === status) {
- complete(xhr.status, xhr.statusText);
- } else {
- complete(xhrSuccessStatus[xhr.status] || xhr.status, xhr.statusText, "string" == typeof xhr.responseText ? {
- text : xhr.responseText
- } : void 0, xhr.getAllResponseHeaders());
- }
- }
- }
- };
- };
- xhr.onload = callback();
- xhr.onerror = callback("error");
- callback = map[id] = callback("abort");
- try {
- xhr.send(options.hasContent && options.data || null);
- } catch (o) {
- if (callback) {
- throw o;
- }
- }
- },
- /**
- * @return {undefined}
- */
- abort : function() {
- if (callback) {
- callback();
- }
- }
- };
- }
- }), jQuery.ajaxSetup({
- accepts : {
- script : "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
- },
- contents : {
- script : /(?:java|ecma)script/
- },
- converters : {
- /**
- * @param {string} value
- * @return {?}
- */
- "text script" : function(value) {
- return jQuery.globalEval(value), value;
- }
- }
- }), jQuery.ajaxPrefilter("script", function(s) {
- if (void 0 === s.cache) {
- /** @type {boolean} */
- s.cache = false;
- }
- if (s.crossDomain) {
- /** @type {string} */
- s.type = "GET";
- }
- }), jQuery.ajaxTransport("script", function(s) {
- if (s.crossDomain) {
- var script;
- var callback;
- return{
- /**
- * @param {?} _
- * @param {Function} complete
- * @return {undefined}
- */
- send : function(_, complete) {
- script = jQuery("<script>").prop({
- async : true,
- charset : s.scriptCharset,
- src : s.url
- }).on("load error", callback = function(evt) {
- script.remove();
- /** @type {null} */
- callback = null;
- if (evt) {
- complete("error" === evt.type ? 404 : 200, evt.type);
- }
- });
- doc.head.appendChild(script[0]);
- },
- /**
- * @return {undefined}
- */
- abort : function() {
- if (callback) {
- callback();
- }
- }
- };
- }
- }), eventPath = [], rjsonp = /(=)\?(?=&|$)|\?\?/, jQuery.ajaxSetup({
- jsonp : "callback",
- /**
- * @return {?}
- */
- jsonpCallback : function() {
- var unlock = eventPath.pop() || jQuery.expando + "_" + iIdCounter++;
- return this[unlock] = true, unlock;
- }
- }), jQuery.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) {
- var callbackName;
- var html;
- var args;
- var jsonProp = s.jsonp !== false && (rjsonp.test(s.url) ? "url" : "string" == typeof s.data && (!(s.contentType || "").indexOf("application/x-www-form-urlencoded") && (rjsonp.test(s.data) && "data")));
- if (jsonProp || "jsonp" === s.dataTypes[0]) {
- return callbackName = s.jsonpCallback = jQuery.isFunction(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback, jsonProp ? s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName) : s.jsonp !== false && (s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName), s.converters["script json"] = function() {
- return args || jQuery.error(callbackName + " was not called"), args[0];
- }, s.dataTypes[0] = "json", html = win[callbackName], win[callbackName] = function() {
- /** @type {Arguments} */
- args = arguments;
- }, jqXHR.always(function() {
- win[callbackName] = html;
- if (s[callbackName]) {
- s.jsonpCallback = originalSettings.jsonpCallback;
- eventPath.push(callbackName);
- }
- if (args) {
- if (jQuery.isFunction(html)) {
- html(args[0]);
- }
- }
- args = html = void 0;
- }), "script";
- }
- }), jQuery.parseHTML = function(data, context, keepScripts) {
- if (!data || "string" != typeof data) {
- return null;
- }
- if ("boolean" == typeof context) {
- /** @type {Object} */
- keepScripts = context;
- /** @type {boolean} */
- context = false;
- }
- context = context || doc;
- /** @type {(Array.<string>|null)} */
- var parsed = rsingleTag.exec(data);
- /** @type {(Array|boolean)} */
- var scripts = !keepScripts && [];
- return parsed ? [context.createElement(parsed[1])] : (parsed = jQuery.buildFragment([data], context, scripts), scripts && (scripts.length && jQuery(scripts).remove()), jQuery.merge([], parsed.childNodes));
- }, matcherFunction = jQuery.fn.load, jQuery.fn.load = function(args, value, options) {
- if ("string" != typeof args && matcherFunction) {
- return matcherFunction.apply(this, arguments);
- }
- var selector;
- var type;
- var response;
- var self = this;
- var start = args.indexOf(" ");
- return start >= 0 && (selector = jQuery.trim(args.slice(start)), args = args.slice(0, start)), jQuery.isFunction(value) ? (options = value, value = void 0) : value && ("object" == typeof value && (type = "POST")), self.length > 0 && jQuery.ajax({
- url : args,
- type : type,
- dataType : "html",
- data : value
- }).done(function(responseText) {
- /** @type {Arguments} */
- response = arguments;
- self.html(selector ? jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector) : responseText);
- }).complete(options && function(args, value) {
- self.each(options, response || [args.responseText, value, args]);
- }), this;
- }, jQuery.expr.filters.animated = function(elem) {
- return jQuery.grep(jQuery.timers, function(fn) {
- return elem === fn.elem;
- }).length;
- }, docElem = win.document.documentElement, jQuery.offset = {
- /**
- * @param {Object} elem
- * @param {Object} options
- * @param {?} i
- * @return {undefined}
- */
- setOffset : function(elem, options, i) {
- var curPosition;
- var curLeft;
- var curCSSTop;
- var curTop;
- var curOffset;
- var curCSSLeft;
- var v;
- var position = jQuery.css(elem, "position");
- var $elem = jQuery(elem);
- var val = {};
- if ("static" === position) {
- /** @type {string} */
- elem.style.position = "relative";
- }
- curOffset = $elem.offset();
- curCSSTop = jQuery.css(elem, "top");
- curCSSLeft = jQuery.css(elem, "left");
- /** @type {boolean} */
- v = ("absolute" === position || "fixed" === position) && (curCSSTop + curCSSLeft).indexOf("auto") > -1;
- if (v) {
- curPosition = $elem.position();
- curTop = curPosition.top;
- curLeft = curPosition.left;
- } else {
- /** @type {number} */
- curTop = parseFloat(curCSSTop) || 0;
- /** @type {number} */
- curLeft = parseFloat(curCSSLeft) || 0;
- }
- if (jQuery.isFunction(options)) {
- options = options.call(elem, i, curOffset);
- }
- if (null != options.top) {
- /** @type {number} */
- val.top = options.top - curOffset.top + curTop;
- }
- if (null != options.left) {
- /** @type {number} */
- val.left = options.left - curOffset.left + curLeft;
- }
- if ("using" in options) {
- options.using.call(elem, val);
- } else {
- $elem.css(val);
- }
- }
- }, jQuery.fn.extend({
- /**
- * @param {number} options
- * @return {?}
- */
- offset : function(options) {
- if (arguments.length) {
- return void 0 === options ? this : this.each(function(dataName) {
- jQuery.offset.setOffset(this, options, dataName);
- });
- }
- var doc;
- var win;
- var b = this[0];
- var box = {
- top : 0,
- left : 0
- };
- var element = b && b.ownerDocument;
- if (element) {
- return doc = element.documentElement, jQuery.contains(doc, b) ? (typeof b.getBoundingClientRect !== memory && (box = b.getBoundingClientRect()), win = getWindow(element), {
- top : box.top + win.pageYOffset - doc.clientTop,
- left : box.left + win.pageXOffset - doc.clientLeft
- }) : box;
- }
- },
- /**
- * @return {?}
- */
- position : function() {
- if (this[0]) {
- var offsetParent;
- var offset;
- var elem = this[0];
- var parentOffset = {
- top : 0,
- left : 0
- };
- return "fixed" === jQuery.css(elem, "position") ? offset = elem.getBoundingClientRect() : (offsetParent = this.offsetParent(), offset = this.offset(), jQuery.nodeName(offsetParent[0], "html") || (parentOffset = offsetParent.offset()), parentOffset.top += jQuery.css(offsetParent[0], "borderTopWidth", true), parentOffset.left += jQuery.css(offsetParent[0], "borderLeftWidth", true)), {
- top : offset.top - parentOffset.top - jQuery.css(elem, "marginTop", true),
- left : offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", true)
- };
- }
- },
- /**
- * @return {?}
- */
- offsetParent : function() {
- return this.map(function() {
- var offsetParent = this.offsetParent || docElem;
- for (;offsetParent && (!jQuery.nodeName(offsetParent, "html") && "static" === jQuery.css(offsetParent, "position"));) {
- offsetParent = offsetParent.offsetParent;
- }
- return offsetParent || docElem;
- });
- }
- }), jQuery.each({
- scrollLeft : "pageXOffset",
- scrollTop : "pageYOffset"
- }, function(name, prop) {
- /** @type {boolean} */
- var top = "pageYOffset" === prop;
- /**
- * @param {?} value
- * @return {?}
- */
- jQuery.fn[name] = function(value) {
- return access(this, function(node, path, val) {
- var cs = getWindow(node);
- return void 0 === val ? cs ? cs[prop] : node[path] : void(cs ? cs.scrollTo(top ? win.pageXOffset : val, top ? val : win.pageYOffset) : node[path] = val);
- }, name, value, arguments.length, null);
- };
- }), jQuery.each(["top", "left"], function(dataAndEvents, prop) {
- jQuery.cssHooks[prop] = addGetHookIf(support.pixelPosition, function(elem, val) {
- if (val) {
- return val = css(elem, prop), regexp.test(val) ? jQuery(elem).position()[prop] + "px" : val;
- }
- });
- }), jQuery.each({
- Height : "height",
- Width : "width"
- }, function(name, type) {
- jQuery.each({
- padding : "inner" + name,
- content : type,
- "" : "outer" + name
- }, function(defaultExtra, original) {
- /**
- * @param {?} margin
- * @param {boolean} value
- * @return {?}
- */
- jQuery.fn[original] = function(margin, value) {
- var chainable = arguments.length && (defaultExtra || "boolean" != typeof margin);
- var extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
- return access(this, function(elem, prop, value) {
- var doc;
- return jQuery.isWindow(elem) ? elem.document.documentElement["client" + name] : 9 === elem.nodeType ? (doc = elem.documentElement, Math.max(elem.body["scroll" + name], doc["scroll" + name], elem.body["offset" + name], doc["offset" + name], doc["client" + name])) : void 0 === value ? jQuery.css(elem, prop, extra) : jQuery.style(elem, prop, value, extra);
- }, type, chainable ? margin : void 0, chainable, null);
- };
- });
- }), jQuery.fn.size = function() {
- return this.length;
- }, jQuery.fn.andSelf = jQuery.fn.addBack, "function" == typeof define && (define.amd && define("jquery", [], function() {
- return jQuery;
- })), $ = win.jQuery, _$ = win.$, jQuery.noConflict = function(deep) {
- return win.$ === jQuery && (win.$ = _$), deep && (win.jQuery === jQuery && (win.jQuery = $)), jQuery;
- }, typeof dataAndEvents === memory && (win.jQuery = win.$ = jQuery), jQuery;
- });
- !function(factory) {
- if ("function" == typeof define && define.amd) {
- define(["jquery"], factory);
- } else {
- factory(jQuery);
- }
- }(function($) {
- $.extend($.fn, {
- /**
- * @param {?} options
- * @return {?}
- */
- validate : function(options) {
- if (!this.length) {
- return void(options && (options.debug && (window.console && console.warn("Nothing selected, can't validate, returning nothing."))));
- }
- var validator = $.data(this[0], "validator");
- return validator ? validator : (this.attr("novalidate", "novalidate"), validator = new $.validator(options, this[0]), $.data(this[0], "validator", validator), validator.settings.onsubmit && (this.on("click.validate", ":submit", function(event) {
- if (validator.settings.submitHandler) {
- validator.submitButton = event.target;
- }
- if ($(this).hasClass("cancel")) {
- /** @type {boolean} */
- validator.cancelSubmit = true;
- }
- if (void 0 !== $(this).attr("formnovalidate")) {
- /** @type {boolean} */
- validator.cancelSubmit = true;
- }
- }), this.on("submit.validate", function(types) {
- /**
- * @return {?}
- */
- function handle() {
- var selfObj;
- var factoriedDoc;
- return validator.settings.submitHandler ? (validator.submitButton && (selfObj = $("<input type='hidden'/>").attr("name", validator.submitButton.name).val($(validator.submitButton).val()).appendTo(validator.currentForm)), factoriedDoc = validator.settings.submitHandler.call(validator, validator.currentForm, types), validator.submitButton && selfObj.remove(), void 0 !== factoriedDoc ? factoriedDoc : false) : true;
- }
- return validator.settings.debug && types.preventDefault(), validator.cancelSubmit ? (validator.cancelSubmit = false, handle()) : validator.form() ? validator.pendingRequest ? (validator.formSubmitted = true, false) : handle() : (validator.focusInvalid(), false);
- })), validator);
- },
- /**
- * @return {?}
- */
- valid : function() {
- var res;
- var e;
- var r;
- return $(this[0]).is("form") ? res = this.validate().form() : (r = [], res = true, e = $(this[0].form).validate(), this.each(function() {
- res = e.element(this) && res;
- r = r.concat(e.errorList);
- }), e.errorList = r), res;
- },
- /**
- * @param {?} command
- * @param {string} argument
- * @return {?}
- */
- rules : function(command, argument) {
- var result;
- var n;
- var b;
- var settings;
- var remote;
- var old;
- var element = this[0];
- if (command) {
- switch(result = $.data(element.form, "validator").settings, n = result.rules, b = $.validator.staticRules(element), command) {
- case "add":
- $.extend(b, $.validator.normalizeRule(argument));
- delete b.messages;
- n[element.name] = b;
- if (argument.messages) {
- result.messages[element.name] = $.extend(result.messages[element.name], argument.messages);
- }
- break;
- case "remove":
- return argument ? (old = {}, $.each(argument.split(/\s/), function(dataAndEvents, name) {
- old[name] = b[name];
- delete b[name];
- if ("required" === name) {
- $(element).removeAttr("aria-required");
- }
- }), old) : (delete n[element.name], b);
- }
- }
- return settings = $.validator.normalizeRules($.extend({}, $.validator.classRules(element), $.validator.attributeRules(element), $.validator.dataRules(element), $.validator.staticRules(element)), element), settings.required && (remote = settings.required, delete settings.required, settings = $.extend({
- required : remote
- }, settings), $(element).attr("aria-required", "true")), settings.remote && (remote = settings.remote, delete settings.remote, settings = $.extend(settings, {
- remote : remote
- })), settings;
- }
- });
- $.extend($.expr[":"], {
- /**
- * @param {?} a
- * @return {?}
- */
- blank : function(a) {
- return!$.trim("" + $(a).val());
- },
- /**
- * @param {?} a
- * @return {?}
- */
- filled : function(a) {
- return!!$.trim("" + $(a).val());
- },
- /**
- * @param {?} a
- * @return {?}
- */
- unchecked : function(a) {
- return!$(a).prop("checked");
- }
- });
- /**
- * @param {?} options
- * @param {?} form
- * @return {undefined}
- */
- $.validator = function(options, form) {
- this.settings = $.extend(true, {}, $.validator.defaults, options);
- this.currentForm = form;
- this.init();
- };
- /**
- * @param {string} source
- * @param {?} params
- * @return {?}
- */
- $.validator.format = function(source, params) {
- return 1 === arguments.length ? function() {
- var args = $.makeArray(arguments);
- return args.unshift(source), $.validator.format.apply(this, args);
- } : (arguments.length > 2 && (params.constructor !== Array && (params = $.makeArray(arguments).slice(1))), params.constructor !== Array && (params = [params]), $.each(params, function(dataAndEvents, deepDataAndEvents) {
- source = source.replace(new RegExp("\\{" + dataAndEvents + "\\}", "g"), function() {
- return deepDataAndEvents;
- });
- }), source);
- };
- $.extend($.validator, {
- defaults : {
- messages : {},
- groups : {},
- rules : {},
- errorClass : "error",
- validClass : "valid",
- errorElement : "label",
- focusCleanup : false,
- focusInvalid : true,
- errorContainer : $([]),
- errorLabelContainer : $([]),
- onsubmit : true,
- ignore : ":hidden",
- ignoreTitle : false,
- /**
- * @param {(Object|string)} element
- * @return {undefined}
- */
- onfocusin : function(element) {
- /** @type {(Object|string)} */
- this.lastActive = element;
- if (this.settings.focusCleanup) {
- if (this.settings.unhighlight) {
- this.settings.unhighlight.call(this, element, this.settings.errorClass, this.settings.validClass);
- }
- this.hideThese(this.errorsFor(element));
- }
- },
- /**
- * @param {string} ast
- * @return {undefined}
- */
- onfocusout : function(ast) {
- if (!this.checkable(ast)) {
- if (ast.name in this.submitted || !this.optional(ast)) {
- this.element(ast);
- }
- }
- },
- /**
- * @param {string} ast
- * @param {Event} e
- * @return {undefined}
- */
- onkeyup : function(ast, e) {
- if (!(9 === e.which && "" === this.elementValue(ast))) {
- if (!(-1 !== $.inArray(e.keyCode, [16, 17, 18, 20, 35, 36, 37, 38, 39, 40, 45, 144, 225]))) {
- if (ast.name in this.submitted || ast === this.lastElement) {
- this.element(ast);
- }
- }
- }
- },
- /**
- * @param {string} ast
- * @return {undefined}
- */
- onclick : function(ast) {
- if (ast.name in this.submitted) {
- this.element(ast);
- } else {
- if (ast.parentNode.name in this.submitted) {
- this.element(ast.parentNode);
- }
- }
- },
- /**
- * @param {Object} elem
- * @param {string} klass
- * @param {string} className
- * @return {undefined}
- */
- highlight : function(elem, klass, className) {
- if ("radio" === elem.type) {
- this.findByName(elem.name).addClass(klass).removeClass(className);
- } else {
- $(elem).addClass(klass).removeClass(className);
- }
- },
- /**
- * @param {Object} element
- * @param {string} node
- * @param {string} validClass
- * @return {undefined}
- */
- unhighlight : function(element, node, validClass) {
- if ("radio" === element.type) {
- this.findByName(element.name).removeClass(node).addClass(validClass);
- } else {
- $(element).removeClass(node).addClass(validClass);
- }
- }
- },
- /**
- * @param {?} settings
- * @return {undefined}
- */
- setDefaults : function(settings) {
- $.extend($.validator.defaults, settings);
- },
- messages : {
- required : "This field is required.",
- remote : "Please fix this field.",
- email : "Please enter a valid email address.",
- url : "Please enter a valid URL.",
- date : "Please enter a valid date.",
- dateISO : "Please enter a valid date ( ISO ).",
- number : "Please enter a valid number.",
- digits : "Please enter only digits.",
- creditcard : "Please enter a valid credit card number.",
- equalTo : "Please enter the same value again.",
- maxlength : $.validator.format("Please enter no more than {0} characters."),
- minlength : $.validator.format("Please enter at least {0} characters."),
- rangelength : $.validator.format("Please enter a value between {0} and {1} characters long."),
- range : $.validator.format("Please enter a value between {0} and {1}."),
- max : $.validator.format("Please enter a value less than or equal to {0}."),
- min : $.validator.format("Please enter a value greater than or equal to {0}.")
- },
- autoCreateRanges : false,
- prototype : {
- /**
- * @return {undefined}
- */
- init : function() {
- /**
- * @param {Event} event
- * @return {undefined}
- */
- function start(event) {
- var _this = $.data(this.form, "validator");
- var handler = "on" + event.type.replace(/^validate/, "");
- var options = _this.settings;
- if (options[handler]) {
- if (!$(this).is(options.ignore)) {
- options[handler].call(_this, this, event);
- }
- }
- }
- this.labelContainer = $(this.settings.errorLabelContainer);
- this.errorContext = this.labelContainer.length && this.labelContainer || $(this.currentForm);
- this.containers = $(this.settings.errorContainer).add(this.settings.errorLabelContainer);
- this.submitted = {};
- this.valueCache = {};
- /** @type {number} */
- this.pendingRequest = 0;
- this.pending = {};
- this.invalid = {};
- this.reset();
- var attributes;
- var benchmarks = this.groups = {};
- $.each(this.settings.groups, function(ref, attributes) {
- if ("string" == typeof attributes) {
- /** @type {Array.<string>} */
- attributes = attributes.split(/\s/);
- }
- $.each(attributes, function(dataAndEvents, name) {
- benchmarks[name] = ref;
- });
- });
- attributes = this.settings.rules;
- $.each(attributes, function(name, value) {
- attributes[name] = $.validator.normalizeRule(value);
- });
- $(this.currentForm).on("focusin.validate focusout.validate keyup.validate", ":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox']", start).on("click.validate", "select, option, [type='radio'], [type='checkbox']", start);
- if (this.settings.invalidHandler) {
- $(this.currentForm).on("invalid-form.validate", this.settings.invalidHandler);
- }
- $(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required", "true");
- },
- /**
- * @return {?}
- */
- form : function() {
- return this.checkForm(), $.extend(this.submitted, this.errorMap), this.invalid = $.extend({}, this.errorMap), this.valid() || $(this.currentForm).triggerHandler("invalid-form", [this]), this.showErrors(), this.valid();
- },
- /**
- * @return {?}
- */
- checkForm : function() {
- this.prepareForm();
- /** @type {number} */
- var i = 0;
- var elements = this.currentElements = this.elements();
- for (;elements[i];i++) {
- this.check(elements[i]);
- }
- return this.valid();
- },
- /**
- * @param {string} args
- * @return {?}
- */
- element : function(args) {
- var scope = this.clean(args);
- var element = this.validationTargetFor(scope);
- /** @type {boolean} */
- var checked = true;
- return this.lastElement = element, void 0 === element ? delete this.invalid[scope.name] : (this.prepareElement(element), this.currentElements = $(element), checked = this.check(element) !== false, checked ? delete this.invalid[element.name] : this.invalid[element.name] = true), $(args).attr("aria-invalid", !checked), this.numberOfInvalids() || (this.toHide = this.toHide.add(this.containers)), this.showErrors(), checked;
- },
- /**
- * @param {Object} errors
- * @return {undefined}
- */
- showErrors : function(errors) {
- if (errors) {
- $.extend(this.errorMap, errors);
- /** @type {Array} */
- this.errorList = [];
- var name;
- for (name in errors) {
- this.errorList.push({
- message : errors[name],
- element : this.findByName(name)[0]
- });
- }
- this.successList = $.grep(this.successList, function(element) {
- return!(element.name in errors);
- });
- }
- if (this.settings.showErrors) {
- this.settings.showErrors.call(this, this.errorMap, this.errorList);
- } else {
- this.defaultShowErrors();
- }
- },
- /**
- * @return {undefined}
- */
- resetForm : function() {
- if ($.fn.resetForm) {
- $(this.currentForm).resetForm();
- }
- this.submitted = {};
- /** @type {null} */
- this.lastElement = null;
- this.prepareForm();
- this.hideErrors();
- var x;
- var row = this.elements().removeData("previousValue").removeAttr("aria-invalid");
- if (this.settings.unhighlight) {
- /** @type {number} */
- x = 0;
- for (;row[x];x++) {
- this.settings.unhighlight.call(this, row[x], this.settings.errorClass, "");
- }
- } else {
- row.removeClass(this.settings.errorClass);
- }
- },
- /**
- * @return {?}
- */
- numberOfInvalids : function() {
- return this.objectLength(this.invalid);
- },
- /**
- * @param {?} object
- * @return {?}
- */
- objectLength : function(object) {
- var prop;
- /** @type {number} */
- var count = 0;
- for (prop in object) {
- count++;
- }
- return count;
- },
- /**
- * @return {undefined}
- */
- hideErrors : function() {
- this.hideThese(this.toHide);
- },
- /**
- * @param {Object} el
- * @return {undefined}
- */
- hideThese : function(el) {
- el.not(this.containers).text("");
- this.addWrapper(el).hide();
- },
- /**
- * @return {?}
- */
- valid : function() {
- return 0 === this.size();
- },
- /**
- * @return {?}
- */
- size : function() {
- return this.errorList.length;
- },
- /**
- * @return {undefined}
- */
- focusInvalid : function() {
- if (this.settings.focusInvalid) {
- try {
- $(this.findLastActive() || (this.errorList.length && this.errorList[0].element || [])).filter(":visible").focus().trigger("focusin");
- } catch (t) {
- }
- }
- },
- /**
- * @return {?}
- */
- findLastActive : function() {
- var lastActive = this.lastActive;
- return lastActive && (1 === $.grep(this.errorList, function(n) {
- return n.element.name === lastActive.name;
- }).length && lastActive);
- },
- /**
- * @return {?}
- */
- elements : function() {
- var validator = this;
- var rulesCache = {};
- return $(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function() {
- return!this.name && (validator.settings.debug && (window.console && console.error("%o has no name assigned", this))), this.name in rulesCache || !validator.objectLength($(this).rules()) ? false : (rulesCache[this.name] = true, true);
- });
- },
- /**
- * @param {string} elems
- * @return {?}
- */
- clean : function(elems) {
- return $(elems)[0];
- },
- /**
- * @return {?}
- */
- errors : function() {
- var errorClass = this.settings.errorClass.split(" ").join(".");
- return $(this.settings.errorElement + "." + errorClass, this.errorContext);
- },
- /**
- * @return {undefined}
- */
- reset : function() {
- /** @type {Array} */
- this.successList = [];
- /** @type {Array} */
- this.errorList = [];
- this.errorMap = {};
- this.toShow = $([]);
- this.toHide = $([]);
- this.currentElements = $([]);
- },
- /**
- * @return {undefined}
- */
- prepareForm : function() {
- this.reset();
- this.toHide = this.errors().add(this.containers);
- },
- /**
- * @param {Object} element
- * @return {undefined}
- */
- prepareElement : function(element) {
- this.reset();
- this.toHide = this.errorsFor(element);
- },
- /**
- * @param {Object} element
- * @return {?}
- */
- elementValue : function(element) {
- var a;
- var $element = $(element);
- var type = element.type;
- return "radio" === type || "checkbox" === type ? this.findByName(element.name).filter(":checked").val() : "number" === type && "undefined" != typeof element.validity ? element.validity.badInput ? false : $element.val() : (a = $element.val(), "string" == typeof a ? a.replace(/\r/g, "") : a);
- },
- /**
- * @param {Object} element
- * @return {?}
- */
- check : function(element) {
- element = this.validationTargetFor(this.clean(element));
- var result;
- var name;
- var rule;
- var scripts = $(element).rules();
- var cnl = $.map(scripts, function(deepDataAndEvents, dataAndEvents) {
- return dataAndEvents;
- }).length;
- /** @type {boolean} */
- var o = false;
- var val = this.elementValue(element);
- for (name in scripts) {
- rule = {
- method : name,
- parameters : scripts[name]
- };
- try {
- if (result = $.validator.methods[name].call(this, val, element, rule.parameters), "dependency-mismatch" === result && 1 === cnl) {
- /** @type {boolean} */
- o = true;
- continue;
- }
- if (o = false, "pending" === result) {
- return void(this.toHide = this.toHide.not(this.errorsFor(element)));
- }
- if (!result) {
- return this.formatAndAdd(element, rule), false;
- }
- } catch (ex) {
- throw this.settings.debug && (window.console && console.log("Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", ex)), ex instanceof TypeError && (ex.message += ". Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method."), ex;
- }
- }
- if (!o) {
- return this.objectLength(scripts) && this.successList.push(element), true;
- }
- },
- /**
- * @param {Object} element
- * @param {string} method
- * @return {?}
- */
- customDataMessage : function(element, method) {
- return $(element).data("msg" + method.charAt(0).toUpperCase() + method.substring(1).toLowerCase()) || $(element).data("msg");
- },
- /**
- * @param {?} name
- * @param {string} method
- * @return {?}
- */
- customMessage : function(name, method) {
- var m = this.settings.messages[name];
- return m && (m.constructor === String ? m : m[method]);
- },
- /**
- * @return {?}
- */
- findDefined : function() {
- /** @type {number} */
- var i = 0;
- for (;i < arguments.length;i++) {
- if (void 0 !== arguments[i]) {
- return arguments[i];
- }
- }
- return void 0;
- },
- /**
- * @param {Object} element
- * @param {string} method
- * @return {?}
- */
- defaultMessage : function(element, method) {
- return this.findDefined(this.customMessage(element.name, method), this.customDataMessage(element, method), !this.settings.ignoreTitle && element.title || void 0, $.validator.messages[method], "<strong>Warning: No message defined for " + element.name + "</strong>");
- },
- /**
- * @param {Object} element
- * @param {Object} rule
- * @return {undefined}
- */
- formatAndAdd : function(element, rule) {
- var message = this.defaultMessage(element, rule.method);
- /** @type {RegExp} */
- var theregex = /\$?\{(\d+)\}/g;
- if ("function" == typeof message) {
- message = message.call(this, rule.parameters, element);
- } else {
- if (theregex.test(message)) {
- message = $.validator.format(message.replace(theregex, "{$1}"), rule.parameters);
- }
- }
- this.errorList.push({
- message : message,
- element : element,
- method : rule.method
- });
- this.errorMap[element.name] = message;
- this.submitted[element.name] = message;
- },
- /**
- * @param {Object} el
- * @return {?}
- */
- addWrapper : function(el) {
- return this.settings.wrapper && (el = el.add(el.parent(this.settings.wrapper))), el;
- },
- /**
- * @return {undefined}
- */
- defaultShowErrors : function() {
- var arr2;
- var error;
- /** @type {number} */
- var i = 0;
- for (;this.errorList[i];i++) {
- error = this.errorList[i];
- if (this.settings.highlight) {
- this.settings.highlight.call(this, error.element, this.settings.errorClass, this.settings.validClass);
- }
- this.showLabel(error.element, error.message);
- }
- if (this.errorList.length && (this.toShow = this.toShow.add(this.containers)), this.settings.success) {
- /** @type {number} */
- i = 0;
- for (;this.successList[i];i++) {
- this.showLabel(this.successList[i]);
- }
- }
- if (this.settings.unhighlight) {
- /** @type {number} */
- i = 0;
- arr2 = this.validElements();
- for (;arr2[i];i++) {
- this.settings.unhighlight.call(this, arr2[i], this.settings.errorClass, this.settings.validClass);
- }
- }
- this.toHide = this.toHide.not(this.toShow);
- this.hideErrors();
- this.addWrapper(this.toShow).show();
- },
- /**
- * @return {?}
- */
- validElements : function() {
- return this.currentElements.not(this.invalidElements());
- },
- /**
- * @return {?}
- */
- invalidElements : function() {
- return $(this.errorList).map(function() {
- return this.element;
- });
- },
- /**
- * @param {Object} element
- * @param {Object} message
- * @return {undefined}
- */
- showLabel : function(element, message) {
- var label;
- var bup;
- var arg;
- var input = this.errorsFor(element);
- var name = this.idOrName(element);
- var path = $(element).attr("aria-describedby");
- if (input.length) {
- input.removeClass(this.settings.validClass).addClass(this.settings.errorClass);
- input.html(message);
- } else {
- input = $("<" + this.settings.errorElement + ">").attr("id", name + "-error").addClass(this.settings.errorClass).html(message || "");
- label = input;
- if (this.settings.wrapper) {
- label = input.hide().show().wrap("<" + this.settings.wrapper + "/>").parent();
- }
- if (this.labelContainer.length) {
- this.labelContainer.append(label);
- } else {
- if (this.settings.errorPlacement) {
- this.settings.errorPlacement(label, $(element));
- } else {
- label.insertAfter(element);
- }
- }
- if (input.is("label")) {
- input.attr("for", name);
- } else {
- if (0 === input.parents("label[for='" + name + "']").length) {
- arg = input.attr("id").replace(/(:|\.|\[|\]|\$)/g, "\\$1");
- if (path) {
- if (!path.match(new RegExp("\\b" + arg + "\\b"))) {
- path += " " + arg;
- }
- } else {
- path = arg;
- }
- $(element).attr("aria-describedby", path);
- bup = this.groups[element.name];
- if (bup) {
- $.each(this.groups, function(dataAndEvents, a) {
- if (a === bup) {
- $("[name='" + dataAndEvents + "']", this.currentForm).attr("aria-describedby", input.attr("id"));
- }
- });
- }
- }
- }
- }
- if (!message) {
- if (this.settings.success) {
- input.text("");
- if ("string" == typeof this.settings.success) {
- input.addClass(this.settings.success);
- } else {
- this.settings.success(input, element);
- }
- }
- }
- this.toShow = this.toShow.add(input);
- },
- /**
- * @param {Object} element
- * @return {?}
- */
- errorsFor : function(element) {
- var name = this.idOrName(element);
- var sValue = $(element).attr("aria-describedby");
- /** @type {string} */
- var qualifier = "label[for='" + name + "'], label[for='" + name + "'] *";
- return sValue && (qualifier = qualifier + ", #" + sValue.replace(/\s+/g, ", #")), this.errors().filter(qualifier);
- },
- /**
- * @param {Object} element
- * @return {?}
- */
- idOrName : function(element) {
- return this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name);
- },
- /**
- * @param {Object} element
- * @return {?}
- */
- validationTargetFor : function(element) {
- return this.checkable(element) && (element = this.findByName(element.name)), $(element).not(this.settings.ignore)[0];
- },
- /**
- * @param {Object} element
- * @return {?}
- */
- checkable : function(element) {
- return/radio|checkbox/i.test(element.type);
- },
- /**
- * @param {string} name
- * @return {?}
- */
- findByName : function(name) {
- return $(this.currentForm).find("[name='" + name + "']");
- },
- /**
- * @param {string} value
- * @param {Object} element
- * @return {?}
- */
- getLength : function(value, element) {
- switch(element.nodeName.toLowerCase()) {
- case "select":
- return $("option:selected", element).length;
- case "input":
- if (this.checkable(element)) {
- return this.findByName(element.name).filter(":checked").length;
- }
- ;
- }
- return value.length;
- },
- /**
- * @param {?} param
- * @param {Object} element
- * @return {?}
- */
- depend : function(param, element) {
- return this.dependTypes[typeof param] ? this.dependTypes[typeof param](param, element) : true;
- },
- dependTypes : {
- /**
- * @param {?} param
- * @return {?}
- */
- boolean : function(param) {
- return param;
- },
- /**
- * @param {?} param
- * @param {Object} element
- * @return {?}
- */
- string : function(param, element) {
- return!!$(param, element.form).length;
- },
- /**
- * @param {?} param
- * @param {?} element
- * @return {?}
- */
- "function" : function(param, element) {
- return param(element);
- }
- },
- /**
- * @param {?} allow
- * @return {?}
- */
- optional : function(allow) {
- var val = this.elementValue(allow);
- return!$.validator.methods.required.call(this, val, allow) && "dependency-mismatch";
- },
- /**
- * @param {Function} element
- * @return {undefined}
- */
- startRequest : function(element) {
- if (!this.pending[element.name]) {
- this.pendingRequest++;
- /** @type {boolean} */
- this.pending[element.name] = true;
- }
- },
- /**
- * @param {Function} element
- * @param {boolean} valid
- * @return {undefined}
- */
- stopRequest : function(element, valid) {
- this.pendingRequest--;
- if (this.pendingRequest < 0) {
- /** @type {number} */
- this.pendingRequest = 0;
- }
- delete this.pending[element.name];
- if (valid && (0 === this.pendingRequest && (this.formSubmitted && this.form()))) {
- $(this.currentForm).submit();
- /** @type {boolean} */
- this.formSubmitted = false;
- } else {
- if (!valid) {
- if (0 === this.pendingRequest) {
- if (this.formSubmitted) {
- $(this.currentForm).triggerHandler("invalid-form", [this]);
- /** @type {boolean} */
- this.formSubmitted = false;
- }
- }
- }
- }
- },
- /**
- * @param {string} ast
- * @return {?}
- */
- previousValue : function(ast) {
- return $.data(ast, "previousValue") || $.data(ast, "previousValue", {
- old : null,
- valid : true,
- message : this.defaultMessage(ast, "remote")
- });
- },
- /**
- * @return {undefined}
- */
- destroy : function() {
- this.resetForm();
- $(this.currentForm).off(".validate").removeData("validator");
- }
- },
- classRuleSettings : {
- required : {
- required : true
- },
- email : {
- email : true
- },
- url : {
- url : true
- },
- date : {
- date : true
- },
- dateISO : {
- dateISO : true
- },
- number : {
- number : true
- },
- digits : {
- digits : true
- },
- creditcard : {
- creditcard : true
- }
- },
- /**
- * @param {?} className
- * @param {?} rules
- * @return {undefined}
- */
- addClassRules : function(className, rules) {
- if (className.constructor === String) {
- this.classRuleSettings[className] = rules;
- } else {
- $.extend(this.classRuleSettings, className);
- }
- },
- /**
- * @param {?} element
- * @return {?}
- */
- classRules : function(element) {
- var deep = {};
- var classes = $(element).attr("class");
- return classes && $.each(classes.split(" "), function() {
- if (this in $.validator.classRuleSettings) {
- $.extend(deep, $.validator.classRuleSettings[this]);
- }
- }), deep;
- },
- /**
- * @param {Object} obj
- * @param {?} value
- * @param {?} key
- * @param {Object} val
- * @return {undefined}
- */
- normalizeAttributeRule : function(obj, value, key, val) {
- if (/min|max/.test(key)) {
- if (null === value || /number|range|text/.test(value)) {
- /** @type {number} */
- val = Number(val);
- if (isNaN(val)) {
- val = void 0;
- }
- }
- }
- if (val || 0 === val) {
- /** @type {Object} */
- obj[key] = val;
- } else {
- if (value === key) {
- if ("range" !== value) {
- /** @type {boolean} */
- obj[key] = true;
- }
- }
- }
- },
- /**
- * @param {Element} element
- * @return {?}
- */
- attributeRules : function(element) {
- var key;
- var val;
- var rules = {};
- var nodes = $(element);
- var udataCur = element.getAttribute("type");
- for (key in $.validator.methods) {
- if ("required" === key) {
- val = element.getAttribute(key);
- if ("" === val) {
- /** @type {boolean} */
- val = true;
- }
- /** @type {boolean} */
- val = !!val;
- } else {
- val = nodes.attr(key);
- }
- this.normalizeAttributeRule(rules, udataCur, key, val);
- }
- return rules.maxlength && (/-1|2147483647|524288/.test(rules.maxlength) && delete rules.maxlength), rules;
- },
- /**
- * @param {Element} element
- * @return {?}
- */
- dataRules : function(element) {
- var key;
- var indents;
- var suiteView = {};
- var $element = $(element);
- var udataCur = element.getAttribute("type");
- for (key in $.validator.methods) {
- indents = $element.data("rule" + key.charAt(0).toUpperCase() + key.substring(1).toLowerCase());
- this.normalizeAttributeRule(suiteView, udataCur, key, indents);
- }
- return suiteView;
- },
- /**
- * @param {Object} element
- * @return {?}
- */
- staticRules : function(element) {
- var rules = {};
- var validator = $.data(element.form, "validator");
- return validator.settings.rules && (rules = $.validator.normalizeRule(validator.settings.rules[element.name]) || {}), rules;
- },
- /**
- * @param {Object} rules
- * @param {Object} element
- * @return {?}
- */
- normalizeRules : function(rules, element) {
- return $.each(rules, function(prop, val) {
- if (val === false) {
- return void delete rules[prop];
- }
- if (val.param || val.depends) {
- /** @type {boolean} */
- var keepRule = true;
- switch(typeof val.depends) {
- case "string":
- /** @type {boolean} */
- keepRule = !!$(val.depends, element.form).length;
- break;
- case "function":
- keepRule = val.depends.call(element, element);
- }
- if (keepRule) {
- rules[prop] = void 0 !== val.param ? val.param : true;
- } else {
- delete rules[prop];
- }
- }
- }), $.each(rules, function(rule, parameter) {
- rules[rule] = $.isFunction(parameter) ? parameter(element) : parameter;
- }), $.each(["minlength", "maxlength"], function() {
- if (rules[this]) {
- /** @type {number} */
- rules[this] = Number(rules[this]);
- }
- }), $.each(["rangelength", "range"], function() {
- var regExpResultArray;
- if (rules[this]) {
- if ($.isArray(rules[this])) {
- /** @type {Array} */
- rules[this] = [Number(rules[this][0]), Number(rules[this][1])];
- } else {
- if ("string" == typeof rules[this]) {
- regExpResultArray = rules[this].replace(/[\[\]]/g, "").split(/[\s,]+/);
- /** @type {Array} */
- rules[this] = [Number(regExpResultArray[0]), Number(regExpResultArray[1])];
- }
- }
- }
- }), $.validator.autoCreateRanges && (null != rules.min && (null != rules.max && (rules.range = [rules.min, rules.max], delete rules.min, delete rules.max)), null != rules.minlength && (null != rules.maxlength && (rules.rangelength = [rules.minlength, rules.maxlength], delete rules.minlength, delete rules.maxlength))), rules;
- },
- /**
- * @param {string} data
- * @return {?}
- */
- normalizeRule : function(data) {
- if ("string" == typeof data) {
- var tmp = {};
- $.each(data.split(/\s/), function() {
- /** @type {boolean} */
- tmp[this] = true;
- });
- data = tmp;
- }
- return data;
- },
- /**
- * @param {string} name
- * @param {Function} method
- * @param {string} message
- * @return {undefined}
- */
- addMethod : function(name, method, message) {
- /** @type {Function} */
- $.validator.methods[name] = method;
- $.validator.messages[name] = void 0 !== message ? message : $.validator.messages[name];
- if (method.length < 3) {
- $.validator.addClassRules(name, $.validator.normalizeRule(name));
- }
- },
- methods : {
- /**
- * @param {string} value
- * @param {Object} element
- * @param {?} param
- * @return {?}
- */
- required : function(value, element, param) {
- if (!this.depend(param, element)) {
- return "dependency-mismatch";
- }
- if ("select" === element.nodeName.toLowerCase()) {
- var codeSegments = $(element).val();
- return codeSegments && codeSegments.length > 0;
- }
- return this.checkable(element) ? this.getLength(value, element) > 0 : value.length > 0;
- },
- /**
- * @param {?} value
- * @param {?} element
- * @return {?}
- */
- email : function(value, element) {
- return this.optional(element) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value);
- },
- /**
- * @param {string} args
- * @param {?} element
- * @return {?}
- */
- url : function(args, element) {
- return this.optional(element) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(args);
- },
- /**
- * @param {number} input
- * @param {?} element
- * @return {?}
- */
- date : function(input, element) {
- return this.optional(element) || !/Invalid|NaN/.test((new Date(input)).toString());
- },
- /**
- * @param {?} value
- * @param {?} element
- * @return {?}
- */
- dateISO : function(value, element) {
- return this.optional(element) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value);
- },
- /**
- * @param {?} value
- * @param {?} element
- * @return {?}
- */
- number : function(value, element) {
- return this.optional(element) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value);
- },
- /**
- * @param {?} value
- * @param {?} element
- * @return {?}
- */
- digits : function(value, element) {
- return this.optional(element) || /^\d+$/.test(value);
- },
- /**
- * @param {string} value
- * @param {?} element
- * @return {?}
- */
- creditcard : function(value, element) {
- if (this.optional(element)) {
- return "dependency-mismatch";
- }
- if (/[^0-9 \-]+/.test(value)) {
- return false;
- }
- var valueIndex;
- var cDigit;
- /** @type {number} */
- var nCheck = 0;
- /** @type {number} */
- var nDigit = 0;
- /** @type {boolean} */
- var perm = false;
- if (value = value.replace(/\D/g, ""), value.length < 13 || value.length > 19) {
- return false;
- }
- /** @type {number} */
- valueIndex = value.length - 1;
- for (;valueIndex >= 0;valueIndex--) {
- cDigit = value.charAt(valueIndex);
- /** @type {number} */
- nDigit = parseInt(cDigit, 10);
- if (perm) {
- if ((nDigit *= 2) > 9) {
- nDigit -= 9;
- }
- }
- nCheck += nDigit;
- /** @type {boolean} */
- perm = !perm;
- }
- return nCheck % 10 == 0;
- },
- /**
- * @param {string} value
- * @param {Object} element
- * @param {?} param
- * @return {?}
- */
- minlength : function(value, element, param) {
- var length = $.isArray(value) ? value.length : this.getLength(value, element);
- return this.optional(element) || length >= param;
- },
- /**
- * @param {string} value
- * @param {Object} element
- * @param {number} length
- * @return {?}
- */
- maxlength : function(value, element, length) {
- var param = $.isArray(value) ? value.length : this.getLength(value, element);
- return this.optional(element) || length >= param;
- },
- /**
- * @param {string} value
- * @param {Object} element
- * @param {Array} param
- * @return {?}
- */
- rangelength : function(value, element, param) {
- var length = $.isArray(value) ? value.length : this.getLength(value, element);
- return this.optional(element) || length >= param[0] && length <= param[1];
- },
- /**
- * @param {number} value
- * @param {number} element
- * @param {number} param
- * @return {?}
- */
- min : function(value, element, param) {
- return this.optional(element) || value >= param;
- },
- /**
- * @param {number} param
- * @param {number} element
- * @param {number} value
- * @return {?}
- */
- max : function(param, element, value) {
- return this.optional(element) || value >= param;
- },
- /**
- * @param {?} value
- * @param {?} element
- * @param {Array} param
- * @return {?}
- */
- range : function(value, element, param) {
- return this.optional(element) || value >= param[0] && value <= param[1];
- },
- /**
- * @param {?} value
- * @param {?} element
- * @param {?} equalTo
- * @return {?}
- */
- equalTo : function(value, element, equalTo) {
- var el = $(equalTo);
- return this.settings.onfocusout && el.off(".validate-equalTo").on("blur.validate-equalTo", function() {
- $(element).valid();
- }), value === el.val();
- },
- /**
- * @param {string} value
- * @param {Object} element
- * @param {(Function|string)} param
- * @return {?}
- */
- remote : function(value, element, param) {
- if (this.optional(element)) {
- return "dependency-mismatch";
- }
- var validator;
- var data;
- var previous = this.previousValue(element);
- return this.settings.messages[element.name] || (this.settings.messages[element.name] = {}), previous.originalMessage = this.settings.messages[element.name].remote, this.settings.messages[element.name].remote = previous.message, param = "string" == typeof param && {
- url : param
- } || param, previous.old === value ? previous.valid : (previous.old = value, validator = this, this.startRequest(element), data = {}, data[element.name] = value, $.ajax($.extend(true, {
- mode : "abort",
- port : "validate" + element.name,
- dataType : "json",
- data : data,
- context : validator.currentForm,
- /**
- * @param {string} args
- * @return {undefined}
- */
- success : function(args) {
- var errors;
- var message;
- var submitted;
- /** @type {boolean} */
- var valid = args === true || "true" === args;
- validator.settings.messages[element.name].remote = previous.originalMessage;
- if (valid) {
- submitted = validator.formSubmitted;
- validator.prepareElement(element);
- validator.formSubmitted = submitted;
- validator.successList.push(element);
- delete validator.invalid[element.name];
- validator.showErrors();
- } else {
- errors = {};
- message = args || validator.defaultMessage(element, "remote");
- errors[element.name] = previous.message = $.isFunction(message) ? message(value) : message;
- /** @type {boolean} */
- validator.invalid[element.name] = true;
- validator.showErrors(errors);
- }
- /** @type {boolean} */
- previous.valid = valid;
- validator.stopRequest(element, valid);
- }
- }, param)), "pending");
- }
- }
- });
- var matcherFunction;
- var pendingRequests = {};
- if ($.ajaxPrefilter) {
- $.ajaxPrefilter(function(settings, dataAndEvents, xhr) {
- var port = settings.port;
- if ("abort" === settings.mode) {
- if (pendingRequests[port]) {
- pendingRequests[port].abort();
- }
- pendingRequests[port] = xhr;
- }
- });
- } else {
- /** @type {function (Object): ?} */
- matcherFunction = $.ajax;
- /**
- * @param {Object} settings
- * @return {?}
- */
- $.ajax = function(settings) {
- var mode = ("mode" in settings ? settings : $.ajaxSettings).mode;
- var port = ("port" in settings ? settings : $.ajaxSettings).port;
- return "abort" === mode ? (pendingRequests[port] && pendingRequests[port].abort(), pendingRequests[port] = matcherFunction.apply(this, arguments), pendingRequests[port]) : matcherFunction.apply(this, arguments);
- };
- }
- }), function($) {
- /**
- * @param {Object} options
- * @param {string} ruleName
- * @param {Object} value
- * @return {undefined}
- */
- function setValidationValues(options, ruleName, value) {
- /** @type {Object} */
- options.rules[ruleName] = value;
- if (options.message) {
- options.messages[ruleName] = options.message;
- }
- }
- /**
- * @param {string} value
- * @return {?}
- */
- function splitAndTrim(value) {
- return value.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g);
- }
- /**
- * @param {string} value
- * @return {?}
- */
- function escapeAttributeValue(value) {
- return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1");
- }
- /**
- * @param {string} fieldName
- * @return {?}
- */
- function getModelPrefix(fieldName) {
- return fieldName.substr(0, fieldName.lastIndexOf(".") + 1);
- }
- /**
- * @param {string} value
- * @param {?} prefix
- * @return {?}
- */
- function appendModelPrefix(value, prefix) {
- return value.indexOf("*.") === 0 && (value = value.replace("*.", prefix)), value;
- }
- /**
- * @param {Object} error
- * @param {Array} msg
- * @return {undefined}
- */
- function onError(error, msg) {
- var container = $(this).find("[data-valmsg-for='" + escapeAttributeValue(msg[0].name) + "']");
- var key = container.attr("data-valmsg-replace");
- /** @type {(boolean|null)} */
- var id = key ? $.parseJSON(key) !== false : null;
- container.removeClass("field-validation-valid").addClass("field-validation-error");
- error.data("unobtrusiveContainer", container);
- if (id) {
- container.empty();
- error.removeClass("input-validation-error").appendTo(container);
- } else {
- error.hide();
- }
- }
- /**
- * @param {?} event
- * @param {?} validator
- * @return {undefined}
- */
- function onErrors(event, validator) {
- var container = $(this).find("[data-valmsg-summary=true]");
- var list = container.find("ul");
- if (list) {
- if (list.length) {
- if (validator.errorList.length) {
- list.empty();
- container.addClass("validation-summary-errors").removeClass("validation-summary-valid");
- $.each(validator.errorList, function() {
- $("<li />").html(this.message).appendTo(list);
- });
- }
- }
- }
- }
- /**
- * @param {Object} error
- * @return {undefined}
- */
- function onSuccess(error) {
- var container = error.data("unobtrusiveContainer");
- var selector = container.attr("data-valmsg-replace");
- var elems = selector ? $.parseJSON(selector) : null;
- if (container) {
- container.addClass("field-validation-valid").removeClass("field-validation-error");
- error.removeData("unobtrusiveContainer");
- if (elems) {
- container.empty();
- }
- }
- }
- /**
- * @return {undefined}
- */
- function onReset() {
- var $form = $(this);
- $form.data("validator").resetForm();
- $form.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors");
- $form.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer");
- }
- /**
- * @param {Object} self
- * @return {?}
- */
- function validationInfo(self) {
- var that = $(self);
- var result = that.data(typePattern);
- var selector = $.proxy(onReset, self);
- var options = $jQval.unobtrusive.options || {};
- /**
- * @param {string} arg
- * @param {Object} args
- * @return {undefined}
- */
- var exec = function(arg, args) {
- var fn = options[arg];
- if (fn) {
- if ($.isFunction(fn)) {
- fn.apply(self, args);
- }
- }
- };
- return result || (result = {
- options : {
- errorClass : options.errorClass || "input-validation-error",
- errorElement : options.errorElement || "span",
- /**
- * @return {undefined}
- */
- errorPlacement : function() {
- onError.apply(self, arguments);
- exec("errorPlacement", arguments);
- },
- /**
- * @return {undefined}
- */
- invalidHandler : function() {
- onErrors.apply(self, arguments);
- exec("invalidHandler", arguments);
- },
- messages : {},
- rules : {},
- /**
- * @return {undefined}
- */
- success : function() {
- onSuccess.apply(self, arguments);
- exec("success", arguments);
- }
- },
- /**
- * @return {undefined}
- */
- attachValidation : function() {
- that.off("reset." + typePattern, selector).on("reset." + typePattern, selector).validate(this.options);
- },
- /**
- * @return {?}
- */
- validate : function() {
- return that.validate(), that.valid();
- }
- }, that.data(typePattern, result)), result;
- }
- var $jQval = $.validator;
- var adapters;
- /** @type {string} */
- var typePattern = "unobtrusiveValidation";
- $jQval.unobtrusive = {
- adapters : [],
- /**
- * @param {Object} element
- * @param {boolean} dataAndEvents
- * @return {undefined}
- */
- parseElement : function(element, dataAndEvents) {
- var $element = $(element);
- var form = $element.parents("form")[0];
- var valInfo;
- var deep;
- var messages;
- if (form) {
- valInfo = validationInfo(form);
- valInfo.options.rules[element.name] = deep = {};
- valInfo.options.messages[element.name] = messages = {};
- $.each(this.adapters, function() {
- /** @type {string} */
- var prefix = "data-val-" + this.name;
- var message = $element.attr(prefix);
- var paramValues = {};
- if (message !== undefined) {
- prefix += "-";
- $.each(this.params, function() {
- paramValues[this] = $element.attr(prefix + this);
- });
- this.adapt({
- element : element,
- form : form,
- message : message,
- params : paramValues,
- rules : deep,
- messages : messages
- });
- }
- });
- $.extend(deep, {
- __dummy__ : true
- });
- if (!dataAndEvents) {
- valInfo.attachValidation();
- }
- }
- },
- /**
- * @param {(Node|string)} target
- * @return {undefined}
- */
- parse : function(target) {
- var $target = $(target);
- var cursor = $target.parents().addBack().filter("form").add($target.find("form")).has("[data-val=true]");
- $target.find("[data-val=true]").each(function() {
- $jQval.unobtrusive.parseElement(this, true);
- });
- cursor.each(function() {
- var info = validationInfo(this);
- if (info) {
- info.attachValidation();
- }
- });
- }
- };
- /** @type {Array} */
- adapters = $jQval.unobtrusive.adapters;
- /**
- * @param {string} name
- * @param {Object} val
- * @param {Object} fn
- * @return {?}
- */
- adapters.add = function(name, val, fn) {
- return fn || (fn = val, val = []), this.push({
- name : name,
- params : val,
- adapt : fn
- }), this;
- };
- /**
- * @param {string} adapterName
- * @param {(Function|string)} ruleName
- * @return {?}
- */
- adapters.addBool = function(adapterName, ruleName) {
- return this.add(adapterName, function(options) {
- setValidationValues(options, ruleName || adapterName, true);
- });
- };
- /**
- * @param {Window} key
- * @param {string} minRuleName
- * @param {string} maxRuleName
- * @param {string} minMaxRuleName
- * @param {string} minAttribute
- * @param {string} maxAttribute
- * @return {?}
- */
- adapters.addMinMax = function(key, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute) {
- return this.add(key, [minAttribute || "min", maxAttribute || "max"], function(options) {
- var min = options.params.min;
- var max = options.params.max;
- if (min && max) {
- setValidationValues(options, minMaxRuleName, [min, max]);
- } else {
- if (min) {
- setValidationValues(options, minRuleName, min);
- } else {
- if (max) {
- setValidationValues(options, maxRuleName, max);
- }
- }
- }
- });
- };
- /**
- * @param {Window} adapterName
- * @param {string} attribute
- * @param {Window} ruleName
- * @return {?}
- */
- adapters.addSingleVal = function(adapterName, attribute, ruleName) {
- return this.add(adapterName, [attribute || "val"], function(options) {
- setValidationValues(options, ruleName || adapterName, options.params[attribute]);
- });
- };
- $jQval.addMethod("__dummy__", function() {
- return true;
- });
- $jQval.addMethod("regex", function(value, element, params) {
- var a;
- return this.optional(element) ? true : (a = (new RegExp(params)).exec(value), a && (a.index === 0 && a[0].length === value.length));
- });
- $jQval.addMethod("nonalphamin", function($2, dataAndEvents, nonalphamin) {
- var match;
- return nonalphamin && (match = $2.match(/\W/g), match = match && match.length >= nonalphamin), match;
- });
- if ($jQval.methods.extension) {
- adapters.addSingleVal("accept", "mimtype");
- adapters.addSingleVal("extension", "extension");
- } else {
- adapters.addSingleVal("extension", "extension", "accept");
- }
- adapters.addSingleVal("regex", "pattern");
- adapters.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");
- adapters.addMinMax("length", "minlength", "maxlength", "rangelength").addMinMax("range", "min", "max", "range");
- adapters.addMinMax("minlength", "minlength").addMinMax("maxlength", "minlength", "maxlength");
- adapters.add("equalto", ["other"], function(options) {
- var prefix = getModelPrefix(options.element.name);
- var other = options.params.other;
- var fullOtherName = appendModelPrefix(other, prefix);
- var udataCur = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(fullOtherName) + "']")[0];
- setValidationValues(options, "equalTo", udataCur);
- });
- adapters.add("required", function(options) {
- if (options.element.tagName.toUpperCase() !== "INPUT" || options.element.type.toUpperCase() !== "CHECKBOX") {
- setValidationValues(options, "required", true);
- }
- });
- adapters.add("remote", ["url", "type", "additionalfields"], function(options) {
- var value = {
- url : options.params.url,
- type : options.params.type || "GET",
- data : {}
- };
- var prefix = getModelPrefix(options.element.name);
- $.each(splitAndTrim(options.params.additionalfields || options.element.name), function(dataAndEvents, fieldName) {
- var paramName = appendModelPrefix(fieldName, prefix);
- /**
- * @return {?}
- */
- value.data[paramName] = function() {
- return $(options.form).find(":input").filter("[name='" + escapeAttributeValue(paramName) + "']").val();
- };
- });
- setValidationValues(options, "remote", value);
- });
- adapters.add("password", ["min", "nonalphamin", "regex"], function(options) {
- if (options.params.min) {
- setValidationValues(options, "minlength", options.params.min);
- }
- if (options.params.nonalphamin) {
- setValidationValues(options, "nonalphamin", options.params.nonalphamin);
- }
- if (options.params.regex) {
- setValidationValues(options, "regex", options.params.regex);
- }
- });
- $(function() {
- $jQval.unobtrusive.parse(document);
- });
- }(jQuery);
- window.Modernizr = function(win, doc, value) {
- /**
- * @param {string} str
- * @return {undefined}
- */
- function setCss(str) {
- /** @type {string} */
- mStyle.cssText = str;
- }
- /**
- * @param {string} str1
- * @param {string} str2
- * @return {?}
- */
- function setCssAll(str1, str2) {
- return setCss(prefixes.join(str1 + ";") + (str2 || ""));
- }
- /**
- * @param {Function} obj
- * @param {string} type
- * @return {?}
- */
- function is(obj, type) {
- return typeof obj === type;
- }
- /**
- * @param {string} str
- * @param {string} substr
- * @return {?}
- */
- function contains(str, substr) {
- return!!~("" + str).indexOf(substr);
- }
- /**
- * @param {Array} props
- * @param {string} prefixed
- * @return {?}
- */
- function testProps(props, prefixed) {
- var i;
- var prop;
- for (i in props) {
- if (prop = props[i], !contains(prop, "-") && mStyle[prop] !== value) {
- return prefixed == "pfx" ? prop : true;
- }
- }
- return false;
- }
- /**
- * @param {Array} props
- * @param {Object} obj
- * @param {boolean} elem
- * @return {?}
- */
- function testDOMProps(props, obj, elem) {
- var i;
- var item;
- for (i in props) {
- if (item = obj[props[i]], item !== value) {
- return elem === false ? props[i] : is(item, "function") ? item.bind(elem || obj) : item;
- }
- }
- return false;
- }
- /**
- * @param {string} prop
- * @param {?} prefixed
- * @param {boolean} elem
- * @return {?}
- */
- function testPropsAll(prop, prefixed, elem) {
- var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1);
- /** @type {Array.<string>} */
- var props = (prop + " " + cssomPrefixes.join(ucProp + " ") + ucProp).split(" ");
- return is(prefixed, "string") || is(prefixed, "undefined") ? testProps(props, prefixed) : (props = (prop + " " + domPrefixes.join(ucProp + " ") + ucProp).split(" "), testDOMProps(props, prefixed, elem));
- }
- /**
- * @return {undefined}
- */
- function webforms() {
- Modernizr.input = function(props) {
- /** @type {number} */
- var i = 0;
- /** @type {number} */
- var l = props.length;
- for (;i < l;i++) {
- /** @type {boolean} */
- css[props[i]] = !!(props[i] in inputElem);
- }
- return css.list && (css.list = !!(doc.createElement("datalist") && win.HTMLDataListElement)), css;
- }("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "));
- Modernizr.inputtypes = function(props) {
- /** @type {number} */
- var i = 0;
- var bool;
- var inputElemType;
- var defaultView;
- /** @type {number} */
- var l = props.length;
- for (;i < l;i++) {
- inputElem.setAttribute("type", inputElemType = props[i]);
- /** @type {boolean} */
- bool = inputElem.type !== "text";
- if (bool) {
- /** @type {string} */
- inputElem.value = smile;
- /** @type {string} */
- inputElem.style.cssText = "position:absolute;visibility:hidden;";
- if (/^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== value) {
- docElement.appendChild(inputElem);
- defaultView = doc.defaultView;
- bool = defaultView.getComputedStyle && (defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== "textfield" && inputElem.offsetHeight !== 0);
- docElement.removeChild(inputElem);
- } else {
- if (!/^(search|tel)$/.test(inputElemType)) {
- bool = /^(url|email)$/.test(inputElemType) ? inputElem.checkValidity && inputElem.checkValidity() === false : inputElem.value != smile;
- }
- }
- }
- /** @type {boolean} */
- inputs[props[i]] = !!bool;
- }
- return inputs;
- }("search tel url email datetime date month week time datetime-local number range color".split(" "));
- }
- var Modernizr = {};
- /** @type {boolean} */
- var f = true;
- /** @type {Element} */
- var docElement = doc.documentElement;
- /** @type {string} */
- var mod = "modernizr";
- /** @type {Element} */
- var modElem = doc.createElement(mod);
- /** @type {(CSSStyleDeclaration|null)} */
- var mStyle = modElem.style;
- /** @type {Element} */
- var inputElem = doc.createElement("input");
- /** @type {string} */
- var smile = ":)";
- /** @type {function (this:*): string} */
- var toString = {}.toString;
- /** @type {Array.<string>} */
- var prefixes = " -webkit- -moz- -o- -ms- ".split(" ");
- /** @type {string} */
- var uHostName = "Webkit Moz O ms";
- /** @type {Array.<string>} */
- var cssomPrefixes = uHostName.split(" ");
- /** @type {Array.<string>} */
- var domPrefixes = uHostName.toLowerCase().split(" ");
- var ns = {
- svg : "http://www.w3.org/2000/svg"
- };
- var _m = {};
- var inputs = {};
- var css = {};
- /** @type {Array} */
- var classes = [];
- /** @type {function (this:(Array.<T>|string|{length: number}), *=, *=): Array.<T>} */
- var __slice = classes.slice;
- var featureName;
- /**
- * @param {string} rule
- * @param {Function} callback
- * @param {number} nodes
- * @param {boolean} testnames
- * @return {?}
- */
- var injectElementWithStyles = function(rule, callback, nodes, testnames) {
- var style;
- var ret;
- var node;
- var docOverflow;
- /** @type {Element} */
- var div = doc.createElement("div");
- /** @type {(HTMLElement|null)} */
- var body = doc.body;
- /** @type {Element} */
- var fakeBody = body || doc.createElement("body");
- if (parseInt(nodes, 10)) {
- for (;nodes--;) {
- /** @type {Element} */
- node = doc.createElement("div");
- node.id = testnames ? testnames[nodes] : mod + (nodes + 1);
- div.appendChild(node);
- }
- }
- return style = ["­", '<style id="s', mod, '">', rule, "</style>"].join(""), div.id = mod, (body ? div : fakeBody).innerHTML += style, fakeBody.appendChild(div), body || (fakeBody.style.background = "", fakeBody.style.overflow = "hidden", docOverflow = docElement.style.overflow, docElement.style.overflow = "hidden", docElement.appendChild(fakeBody)), ret = callback(div, rule), body ? div.parentNode.removeChild(div) : (fakeBody.parentNode.removeChild(fakeBody), docElement.style.overflow =
- docOverflow), !!ret;
- };
- /**
- * @param {string} mq
- * @return {?}
- */
- var testMediaQuery = function(mq) {
- /** @type {function (this:Window, string): (MediaQueryList|null)} */
- var matchMedia = win.matchMedia || win.msMatchMedia;
- var bool;
- return matchMedia ? matchMedia(mq).matches : (injectElementWithStyles("@media " + mq + " { #" + mod + " { position: absolute; } }", function(elem) {
- /** @type {boolean} */
- bool = (win.getComputedStyle ? getComputedStyle(elem, null) : elem.currentStyle).position == "absolute";
- }), bool);
- };
- var isEventSupported = function() {
- /**
- * @param {string} eventName
- * @param {Element} el
- * @return {?}
- */
- function isEventSupported(eventName, el) {
- el = el || doc.createElement(TAGNAMES[eventName] || "div");
- /** @type {string} */
- eventName = "on" + eventName;
- /** @type {boolean} */
- var isSupported = eventName in el;
- return isSupported || (el.setAttribute || (el = doc.createElement("div")), el.setAttribute && (el.removeAttribute && (el.setAttribute(eventName, ""), isSupported = is(el[eventName], "function"), is(el[eventName], "undefined") || (el[eventName] = value), el.removeAttribute(eventName)))), el = null, isSupported;
- }
- var TAGNAMES = {
- select : "input",
- change : "input",
- submit : "form",
- reset : "form",
- error : "img",
- load : "img",
- abort : "img"
- };
- return isEventSupported;
- }();
- /** @type {function (this:Object, *): boolean} */
- var _hasOwnProperty = {}.hasOwnProperty;
- var hasOwnProp;
- var feature;
- /** @type {function (Object, string): ?} */
- hasOwnProp = is(_hasOwnProperty, "undefined") || is(_hasOwnProperty.call, "undefined") ? function(object, property) {
- return property in object && is(object.constructor.prototype[property], "undefined");
- } : function(object, property) {
- return _hasOwnProperty.call(object, property);
- };
- if (!Function.prototype.bind) {
- /**
- * @param {(Object|null|undefined)} recurring
- * @return {Function}
- */
- Function.prototype.bind = function(recurring) {
- /** @type {Function} */
- var func = this;
- var r;
- var e;
- if (typeof func != "function") {
- throw new TypeError;
- }
- return r = __slice.call(arguments, 1), e = function() {
- var noop;
- var thisBinding;
- var result;
- return this instanceof e ? (noop = function() {
- }, noop.prototype = func.prototype, thisBinding = new noop, result = func.apply(thisBinding, r.concat(__slice.call(arguments))), Object(result) === result) ? result : thisBinding : func.apply(recurring, r.concat(__slice.call(arguments)));
- }, e;
- };
- }
- /**
- * @return {?}
- */
- _m.flexbox = function() {
- return testPropsAll("flexWrap");
- };
- /**
- * @return {?}
- */
- _m.flexboxlegacy = function() {
- return testPropsAll("boxDirection");
- };
- /**
- * @return {?}
- */
- _m.canvas = function() {
- /** @type {Element} */
- var test_canvas = doc.createElement("canvas");
- return!!(test_canvas.getContext && test_canvas.getContext("2d"));
- };
- /**
- * @return {?}
- */
- _m.canvastext = function() {
- return!!(Modernizr.canvas && is(doc.createElement("canvas").getContext("2d").fillText, "function"));
- };
- /**
- * @return {?}
- */
- _m.webgl = function() {
- return!!win.WebGLRenderingContext;
- };
- /**
- * @return {?}
- */
- _m.touch = function() {
- var i;
- return "ontouchstart" in win || win.DocumentTouch && doc instanceof DocumentTouch ? i = true : injectElementWithStyles(["@media (", prefixes.join("touch-enabled),("), mod, ")", "{#modernizr{top:9px;position:absolute}}"].join(""), function(td) {
- /** @type {boolean} */
- i = td.offsetTop === 9;
- }), i;
- };
- /**
- * @return {?}
- */
- _m.geolocation = function() {
- return "geolocation" in navigator;
- };
- /**
- * @return {?}
- */
- _m.postmessage = function() {
- return!!win.postMessage;
- };
- /**
- * @return {?}
- */
- _m.websqldatabase = function() {
- return!!win.openDatabase;
- };
- /**
- * @return {?}
- */
- _m.indexedDB = function() {
- return!!testPropsAll("indexedDB", win);
- };
- /**
- * @return {?}
- */
- _m.hashchange = function() {
- return isEventSupported("hashchange", win) && (doc.documentMode === value || doc.documentMode > 7);
- };
- /**
- * @return {?}
- */
- _m.history = function() {
- return!!(win.history && history.pushState);
- };
- /**
- * @return {?}
- */
- _m.draganddrop = function() {
- /** @type {Element} */
- var div = doc.createElement("div");
- return "draggable" in div || "ondragstart" in div && "ondrop" in div;
- };
- /**
- * @return {?}
- */
- _m.websockets = function() {
- return "WebSocket" in win || "MozWebSocket" in win;
- };
- /**
- * @return {?}
- */
- _m.rgba = function() {
- return setCss("background-color:rgba(150,255,150,.5)"), contains(mStyle.backgroundColor, "rgba");
- };
- /**
- * @return {?}
- */
- _m.hsla = function() {
- return setCss("background-color:hsla(120,40%,100%,.5)"), contains(mStyle.backgroundColor, "rgba") || contains(mStyle.backgroundColor, "hsla");
- };
- /**
- * @return {?}
- */
- _m.multiplebgs = function() {
- return setCss("background:url(https://),url(https://),red url(https://)"), /(url\s*\(.*?){3}/.test(mStyle.background);
- };
- /**
- * @return {?}
- */
- _m.backgroundsize = function() {
- return testPropsAll("backgroundSize");
- };
- /**
- * @return {?}
- */
- _m.borderimage = function() {
- return testPropsAll("borderImage");
- };
- /**
- * @return {?}
- */
- _m.borderradius = function() {
- return testPropsAll("borderRadius");
- };
- /**
- * @return {?}
- */
- _m.boxshadow = function() {
- return testPropsAll("boxShadow");
- };
- /**
- * @return {?}
- */
- _m.textshadow = function() {
- return doc.createElement("div").style.textShadow === "";
- };
- /**
- * @return {?}
- */
- _m.opacity = function() {
- return setCssAll("opacity:.55"), /^0.55$/.test(mStyle.opacity);
- };
- /**
- * @return {?}
- */
- _m.cssanimations = function() {
- return testPropsAll("animationName");
- };
- /**
- * @return {?}
- */
- _m.csscolumns = function() {
- return testPropsAll("columnCount");
- };
- /**
- * @return {?}
- */
- _m.cssgradients = function() {
- /** @type {string} */
- var str1 = "background-image:";
- return setCss((str1 + "-webkit- ".split(" ").join("gradient(linear,left top,right bottom,from(#9f9),to(white));" + str1) + prefixes.join("linear-gradient(left top,#9f9, white);" + str1)).slice(0, -str1.length)), contains(mStyle.backgroundImage, "gradient");
- };
- /**
- * @return {?}
- */
- _m.cssreflections = function() {
- return testPropsAll("boxReflect");
- };
- /**
- * @return {?}
- */
- _m.csstransforms = function() {
- return!!testPropsAll("transform");
- };
- /**
- * @return {?}
- */
- _m.csstransforms3d = function() {
- /** @type {boolean} */
- var a = !!testPropsAll("perspective");
- return a && ("webkitPerspective" in docElement.style && injectElementWithStyles("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}", function(node) {
- /** @type {boolean} */
- a = node.offsetLeft === 9 && node.offsetHeight === 3;
- })), a;
- };
- /**
- * @return {?}
- */
- _m.csstransitions = function() {
- return testPropsAll("transition");
- };
- /**
- * @return {?}
- */
- _m.fontface = function() {
- var n;
- return injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function(dataAndEvents, pair) {
- /** @type {(HTMLElement|null)} */
- var style = doc.getElementById("smodernizr");
- var sheet = style.sheet || style.styleSheet;
- var cssText = sheet ? sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || "" : "";
- /** @type {boolean} */
- n = /src/i.test(cssText) && cssText.indexOf(pair.split(" ")[0]) === 0;
- }), n;
- };
- /**
- * @return {?}
- */
- _m.generatedcontent = function() {
- var n;
- return injectElementWithStyles(["#", mod, "{font:0/0 a}#", mod, ':after{content:"', smile, '";visibility:hidden;font:3px/1 a}'].join(""), function(node) {
- /** @type {boolean} */
- n = node.offsetHeight >= 3;
- }), n;
- };
- /**
- * @return {?}
- */
- _m.video = function() {
- /** @type {Element} */
- var elem = doc.createElement("video");
- /** @type {boolean} */
- var bool = false;
- try {
- if (bool = !!elem.canPlayType) {
- /** @type {Boolean} */
- bool = new Boolean(bool);
- bool.ogg = elem.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, "");
- bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, "");
- bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, "");
- }
- } catch (r) {
- }
- return bool;
- };
- /**
- * @return {?}
- */
- _m.audio = function() {
- /** @type {Element} */
- var elem = doc.createElement("audio");
- /** @type {boolean} */
- var bool = false;
- try {
- if (bool = !!elem.canPlayType) {
- /** @type {Boolean} */
- bool = new Boolean(bool);
- bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, "");
- bool.mp3 = elem.canPlayType("audio/mpeg;").replace(/^no$/, "");
- bool.wav = elem.canPlayType('audio/wav; codecs="1"').replace(/^no$/, "");
- bool.m4a = (elem.canPlayType("audio/x-m4a;") || elem.canPlayType("audio/aac;")).replace(/^no$/, "");
- }
- } catch (r) {
- }
- return bool;
- };
- /**
- * @return {?}
- */
- _m.localstorage = function() {
- try {
- return localStorage.setItem(mod, mod), localStorage.removeItem(mod), true;
- } catch (n) {
- return false;
- }
- };
- /**
- * @return {?}
- */
- _m.sessionstorage = function() {
- try {
- return sessionStorage.setItem(mod, mod), sessionStorage.removeItem(mod), true;
- } catch (n) {
- return false;
- }
- };
- /**
- * @return {?}
- */
- _m.webworkers = function() {
- return!!win.Worker;
- };
- /**
- * @return {?}
- */
- _m.applicationcache = function() {
- return!!win.applicationCache;
- };
- /**
- * @return {?}
- */
- _m.svg = function() {
- return!!doc.createElementNS && !!doc.createElementNS(ns.svg, "svg").createSVGRect;
- };
- /**
- * @return {?}
- */
- _m.inlinesvg = function() {
- /** @type {Element} */
- var div = doc.createElement("div");
- return div.innerHTML = "<svg/>", (div.firstChild && div.firstChild.namespaceURI) == ns.svg;
- };
- /**
- * @return {?}
- */
- _m.smil = function() {
- return!!doc.createElementNS && /SVGAnimate/.test(toString.call(doc.createElementNS(ns.svg, "animate")));
- };
- /**
- * @return {?}
- */
- _m.svgclippaths = function() {
- return!!doc.createElementNS && /SVGClipPath/.test(toString.call(doc.createElementNS(ns.svg, "clipPath")));
- };
- for (feature in _m) {
- if (hasOwnProp(_m, feature)) {
- /** @type {string} */
- featureName = feature.toLowerCase();
- Modernizr[featureName] = _m[feature]();
- classes.push((Modernizr[featureName] ? "" : "no-") + featureName);
- }
- }
- return Modernizr.input || webforms(), Modernizr.addTest = function(feature, test) {
- if (typeof feature == "object") {
- var key;
- for (key in feature) {
- if (hasOwnProp(feature, key)) {
- Modernizr.addTest(key, feature[key]);
- }
- }
- } else {
- if (feature = feature.toLowerCase(), Modernizr[feature] !== value) {
- return Modernizr;
- }
- test = typeof test == "function" ? test() : test;
- if (typeof f != "undefined") {
- if (f) {
- docElement.className += " " + (test ? "" : "no-") + feature;
- }
- }
- /** @type {boolean} */
- Modernizr[feature] = test;
- }
- return Modernizr;
- }, setCss(""), modElem = inputElem = null, function(dataAndEvents, doc) {
- /**
- * @param {Document} ownerDocument
- * @param {string} cssText
- * @return {?}
- */
- function addStyleSheet(ownerDocument, cssText) {
- var p = ownerDocument.createElement("p");
- var parent = ownerDocument.getElementsByTagName("head")[0] || ownerDocument.documentElement;
- return p.innerHTML = "x<style>" + cssText + "</style>", parent.insertBefore(p.lastChild, parent.firstChild);
- }
- /**
- * @return {?}
- */
- function getElements() {
- var elements = html5.elements;
- return typeof elements == "string" ? elements.split(" ") : elements;
- }
- /**
- * @param {HTMLElement} ownerDocument
- * @return {?}
- */
- function getExpandoData(ownerDocument) {
- var data = expandoData[ownerDocument[expando]];
- return data || (data = {}, expanID++, ownerDocument[expando] = expanID, expandoData[expanID] = data), data;
- }
- /**
- * @param {string} nodeName
- * @param {HTMLDocument} ownerDocument
- * @param {Object} data
- * @return {?}
- */
- function createElement(nodeName, ownerDocument, data) {
- if (ownerDocument || (ownerDocument = doc), supportsUnknownElements) {
- return ownerDocument.createElement(nodeName);
- }
- if (!data) {
- data = getExpandoData(ownerDocument);
- }
- var node;
- return node = data.cache[nodeName] ? data.cache[nodeName].cloneNode() : rchecked.test(nodeName) ? (data.cache[nodeName] = data.createElem(nodeName)).cloneNode() : data.createElem(nodeName), node.canHaveChildren && (!exclude.test(nodeName) && !node.tagUrn) ? data.frag.appendChild(node) : node;
- }
- /**
- * @param {HTMLDocument} ownerDocument
- * @param {Object} data
- * @return {?}
- */
- function createDocumentFragment(ownerDocument, data) {
- if (ownerDocument || (ownerDocument = doc), supportsUnknownElements) {
- return ownerDocument.createDocumentFragment();
- }
- data = data || getExpandoData(ownerDocument);
- var clone = data.frag.cloneNode();
- /** @type {number} */
- var i = 0;
- var elems = getElements();
- var length = elems.length;
- for (;i < length;i++) {
- clone.createElement(elems[i]);
- }
- return clone;
- }
- /**
- * @param {Document} ownerDocument
- * @param {Object} data
- * @return {undefined}
- */
- function shivMethods(ownerDocument, data) {
- if (!data.cache) {
- data.cache = {};
- /** @type {function (string): ?} */
- data.createElem = ownerDocument.createElement;
- data.createFrag = ownerDocument.createDocumentFragment;
- data.frag = data.createFrag();
- }
- /**
- * @param {string} nodeName
- * @return {?}
- */
- ownerDocument.createElement = function(nodeName) {
- return html5.shivMethods ? createElement(nodeName, ownerDocument, data) : data.createElem(nodeName);
- };
- ownerDocument.createDocumentFragment = Function("h,f", "return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&(" + getElements().join().replace(/[\w\-]+/g, function(nodeName) {
- return data.createElem(nodeName), data.frag.createElement(nodeName), 'c("' + nodeName + '")';
- }) + ");return n}")(html5, data.frag);
- }
- /**
- * @param {HTMLDocument} ownerDocument
- * @return {?}
- */
- function shivDocument(ownerDocument) {
- if (!ownerDocument) {
- /** @type {HTMLDocument} */
- ownerDocument = doc;
- }
- var data = getExpandoData(ownerDocument);
- return!html5.shivCSS || (supportsHtml5Styles || (data.hasCSS || (data.hasCSS = !!addStyleSheet(ownerDocument, "article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")))), supportsUnknownElements || shivMethods(ownerDocument, data), ownerDocument;
- }
- var options = dataAndEvents.html5 || {};
- /** @type {RegExp} */
- var exclude = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
- /** @type {RegExp} */
- var rchecked = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
- var supportsHtml5Styles;
- /** @type {string} */
- var expando = "_html5shiv";
- /** @type {number} */
- var expanID = 0;
- var expandoData = {};
- var supportsUnknownElements;
- var html5;
- (function() {
- try {
- /** @type {Element} */
- var a = doc.createElement("a");
- /** @type {string} */
- a.innerHTML = "<xyz></xyz>";
- /** @type {boolean} */
- supportsHtml5Styles = "hidden" in a;
- supportsUnknownElements = a.childNodes.length == 1 || function() {
- doc.createElement("a");
- /** @type {DocumentFragment} */
- var frag = doc.createDocumentFragment();
- return typeof frag.cloneNode == "undefined" || (typeof frag.createDocumentFragment == "undefined" || typeof frag.createElement == "undefined");
- }();
- } catch (r) {
- /** @type {boolean} */
- supportsHtml5Styles = true;
- /** @type {boolean} */
- supportsUnknownElements = true;
- }
- })();
- html5 = {
- elements : options.elements || "abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",
- version : "3.7.0",
- shivCSS : options.shivCSS !== false,
- supportsUnknownElements : supportsUnknownElements,
- shivMethods : options.shivMethods !== false,
- type : "default",
- /** @type {function (HTMLDocument): ?} */
- shivDocument : shivDocument,
- /** @type {function (string, HTMLDocument, Object): ?} */
- createElement : createElement,
- /** @type {function (HTMLDocument, Object): ?} */
- createDocumentFragment : createDocumentFragment
- };
- dataAndEvents.html5 = html5;
- shivDocument(doc);
- }(this, doc), Modernizr._version = "2.7.2", Modernizr._prefixes = prefixes, Modernizr._domPrefixes = domPrefixes, Modernizr._cssomPrefixes = cssomPrefixes, Modernizr.mq = testMediaQuery, Modernizr.hasEvent = isEventSupported, Modernizr.testProp = function(prop) {
- return testProps([prop]);
- }, Modernizr.testAllProps = testPropsAll, Modernizr.testStyles = injectElementWithStyles, Modernizr.prefixed = function(prop, obj, elem) {
- return obj ? testPropsAll(prop, obj, elem) : testPropsAll(prop, "pfx");
- }, docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, "$1$2") + (f ? " js " + classes.join(" ") : ""), Modernizr;
- }(this, this.document), function(first) {
- /**
- * @param {string} yr
- * @param {string} dataAndEvents
- * @param {string} val
- * @return {?}
- */
- function fixYear(yr, dataAndEvents, val) {
- switch(arguments.length) {
- case 2:
- return null != yr ? yr : dataAndEvents;
- case 3:
- return null != yr ? yr : null != dataAndEvents ? dataAndEvents : val;
- default:
- throw new Error("Implement me");;
- }
- }
- /**
- * @param {Object} obj
- * @param {string} key
- * @return {?}
- */
- function hasOwn(obj, key) {
- return has.call(obj, key);
- }
- /**
- * @return {?}
- */
- function validateTransport() {
- return{
- empty : false,
- unusedTokens : [],
- unusedInput : [],
- overflow : -2,
- charsLeftOver : 0,
- nullInput : false,
- invalidMonth : null,
- invalidFormat : false,
- userInvalidated : false,
- iso : false
- };
- }
- /**
- * @param {string} message
- * @return {undefined}
- */
- function log(message) {
- if (moment.suppressDeprecationWarnings === false) {
- if ("undefined" != typeof console) {
- if (console.warn) {
- console.warn("Deprecation warning: " + message);
- }
- }
- }
- }
- /**
- * @param {string} message
- * @param {Function} fn
- * @return {?}
- */
- function timeout(message, fn) {
- /** @type {boolean} */
- var i = true;
- return extend(function() {
- return i && (log(message), i = false), fn.apply(this, arguments);
- }, fn);
- }
- /**
- * @param {string} index
- * @param {string} data
- * @return {undefined}
- */
- function done(index, data) {
- if (!viewItems[index]) {
- log(data);
- /** @type {boolean} */
- viewItems[index] = true;
- }
- }
- /**
- * @param {Function} func
- * @param {number} opt_attributes
- * @return {?}
- */
- function padToken(func, opt_attributes) {
- return function(a) {
- return leftZeroFill(func.call(this, a), opt_attributes);
- };
- }
- /**
- * @param {Function} func
- * @param {?} period
- * @return {?}
- */
- function ordinalizeToken(func, period) {
- return function(a) {
- return this.localeData().ordinal(func.call(this, a), period);
- };
- }
- /**
- * @param {Object} m
- * @param {string} t
- * @return {?}
- */
- function push(m, t) {
- var t1;
- var version;
- /** @type {number} */
- var name = 12 * (t.year() - m.year()) + (t.month() - m.month());
- var t0 = m.clone().add(name, "months");
- return 0 > t - t0 ? (t1 = m.clone().add(name - 1, "months"), version = (t - t0) / (t0 - t1)) : (t1 = m.clone().add(name + 1, "months"), version = (t - t0) / (t1 - t0)), -(name + version);
- }
- /**
- * @param {?} node
- * @param {number} str
- * @param {Object} value
- * @return {?}
- */
- function isEmpty(node, str, value) {
- var isFunction;
- return null == value ? str : null != node.meridiemHour ? node.meridiemHour(str, value) : null != node.isPM ? (isFunction = node.isPM(value), isFunction && (12 > str && (str += 12)), isFunction || (12 !== str || (str = 0)), str) : str;
- }
- /**
- * @return {undefined}
- */
- function Language() {
- }
- /**
- * @param {null} mom
- * @param {boolean} isUTC
- * @return {undefined}
- */
- function Moment(mom, isUTC) {
- if (isUTC !== false) {
- checkOverflow(mom);
- }
- config(this, mom);
- /** @type {Date} */
- this._d = new Date(+mom._d);
- if (ii === false) {
- /** @type {boolean} */
- ii = true;
- moment.updateOffset(this);
- /** @type {boolean} */
- ii = false;
- }
- }
- /**
- * @param {Object} duration
- * @return {undefined}
- */
- function Duration(duration) {
- var normalizedInput = normalizeObjectUnits(duration);
- var r = normalizedInput.year || 0;
- var isAdding = normalizedInput.quarter || 0;
- var mom = normalizedInput.month || 0;
- var HOUR_MS = normalizedInput.week || 0;
- var d = normalizedInput.day || 0;
- var s = normalizedInput.hour || 0;
- var h = normalizedInput.minute || 0;
- var _oneDayInMilliseconds = normalizedInput.second || 0;
- var _now = normalizedInput.millisecond || 0;
- /** @type {number} */
- this._milliseconds = +_now + 1E3 * _oneDayInMilliseconds + 6E4 * h + 36E5 * s;
- /** @type {number} */
- this._days = +d + 7 * HOUR_MS;
- /** @type {number} */
- this._months = +mom + 3 * isAdding + 12 * r;
- this._data = {};
- this._locale = moment.localeData();
- this._bubble();
- }
- /**
- * @param {Object} a
- * @param {Object} b
- * @return {?}
- */
- function extend(a, b) {
- var key;
- for (key in b) {
- if (hasOwn(b, key)) {
- a[key] = b[key];
- }
- }
- return hasOwn(b, "toString") && (a.toString = b.toString), hasOwn(b, "valueOf") && (a.valueOf = b.valueOf), a;
- }
- /**
- * @param {Function} config
- * @param {Function} m
- * @return {?}
- */
- function config(config, m) {
- var index;
- var key;
- var current;
- if ("undefined" != typeof m._isAMomentObject && (config._isAMomentObject = m._isAMomentObject), "undefined" != typeof m._i && (config._i = m._i), "undefined" != typeof m._f && (config._f = m._f), "undefined" != typeof m._l && (config._l = m._l), "undefined" != typeof m._strict && (config._strict = m._strict), "undefined" != typeof m._tzm && (config._tzm = m._tzm), "undefined" != typeof m._isUTC && (config._isUTC = m._isUTC), "undefined" != typeof m._offset && (config._offset = m._offset), "undefined" !=
- typeof m._pf && (config._pf = m._pf), "undefined" != typeof m._locale && (config._locale = m._locale), keys.length > 0) {
- for (index in keys) {
- key = keys[index];
- current = m[key];
- if ("undefined" != typeof current) {
- config[key] = current;
- }
- }
- }
- return config;
- }
- /**
- * @param {number} number
- * @return {?}
- */
- function absRound(number) {
- return 0 > number ? Math.ceil(number) : Math.floor(number);
- }
- /**
- * @param {number} number
- * @param {number} opt_attributes
- * @param {boolean} forceSign
- * @return {?}
- */
- function leftZeroFill(number, opt_attributes, forceSign) {
- /** @type {string} */
- var n = "" + Math.abs(number);
- /** @type {boolean} */
- var sign = number >= 0;
- for (;n.length < opt_attributes;) {
- /** @type {string} */
- n = "0" + n;
- }
- return(sign ? forceSign ? "+" : "" : "-") + n;
- }
- /**
- * @param {string} obj
- * @param {string} data
- * @return {?}
- */
- function init(obj, data) {
- var d = {
- milliseconds : 0,
- months : 0
- };
- return d.months = data.month() - obj.month() + 12 * (data.year() - obj.year()), obj.clone().add(d.months, "M").isAfter(data) && --d.months, d.milliseconds = +data - +obj.clone().add(d.months, "M"), d;
- }
- /**
- * @param {string} doc
- * @param {Text} data
- * @return {?}
- */
- function addNode(doc, data) {
- var obj;
- return data = makeAs(data, doc), doc.isBefore(data) ? obj = init(doc, data) : (obj = init(data, doc), obj.milliseconds = -obj.milliseconds, obj.months = -obj.months), obj;
- }
- /**
- * @param {number} deepDataAndEvents
- * @param {string} options
- * @return {?}
- */
- function update(deepDataAndEvents, options) {
- return function(input, val) {
- var dur;
- var n;
- return null === val || (isNaN(+val) || (done(options, "moment()." + options + "(period, number) is deprecated. Please use moment()." + options + "(number, period)."), n = input, input = val, val = n)), input = "string" == typeof input ? +input : input, dur = moment.duration(input, val), addOrSubtractDurationFromMoment(this, dur, deepDataAndEvents), this;
- };
- }
- /**
- * @param {string} mom
- * @param {?} duration
- * @param {?} deepDataAndEvents
- * @param {boolean} count
- * @return {undefined}
- */
- function addOrSubtractDurationFromMoment(mom, duration, deepDataAndEvents, count) {
- var milliseconds = duration._milliseconds;
- var days = duration._days;
- var months = duration._months;
- count = null == count ? true : count;
- if (milliseconds) {
- mom._d.setTime(+mom._d + milliseconds * deepDataAndEvents);
- }
- if (days) {
- set(mom, "Date", get(mom, "Date") + days * deepDataAndEvents);
- }
- if (months) {
- fn(mom, get(mom, "Month") + months * deepDataAndEvents);
- }
- if (count) {
- moment.updateOffset(mom, days || months);
- }
- }
- /**
- * @param {Array} input
- * @return {?}
- */
- function isArray(input) {
- return "[object Array]" === Object.prototype.toString.call(input);
- }
- /**
- * @param {?} d
- * @return {?}
- */
- function isDate(d) {
- return "[object Date]" === Object.prototype.toString.call(d) || d instanceof Date;
- }
- /**
- * @param {Array} array1
- * @param {Array} array2
- * @param {boolean} dataAndEvents
- * @return {?}
- */
- function compareArrays(array1, array2, dataAndEvents) {
- /** @type {number} */
- var l = Math.min(array1.length, array2.length);
- /** @type {number} */
- var arr = Math.abs(array1.length - array2.length);
- /** @type {number} */
- var inner = 0;
- /** @type {number} */
- var i = 0;
- for (;l > i;i++) {
- if (dataAndEvents && array1[i] !== array2[i] || !dataAndEvents && toInt(array1[i]) !== toInt(array2[i])) {
- inner++;
- }
- }
- return inner + arr;
- }
- /**
- * @param {string} num
- * @return {?}
- */
- function normalizeUnits(num) {
- if (num) {
- var lowered = num.toLowerCase().replace(/(.)s$/, "$1");
- num = unitAliases[num] || (camelFunctions[lowered] || lowered);
- }
- return num;
- }
- /**
- * @param {Object} obj
- * @return {?}
- */
- function normalizeObjectUnits(obj) {
- var field;
- var key;
- var res = {};
- for (key in obj) {
- if (hasOwn(obj, key)) {
- field = normalizeUnits(key);
- if (field) {
- res[field] = obj[key];
- }
- }
- }
- return res;
- }
- /**
- * @param {string} field
- * @return {undefined}
- */
- function makeList(field) {
- var pivotElem;
- var elem;
- if (0 === field.indexOf("week")) {
- /** @type {number} */
- pivotElem = 7;
- /** @type {string} */
- elem = "day";
- } else {
- if (0 !== field.indexOf("month")) {
- return;
- }
- /** @type {number} */
- pivotElem = 12;
- /** @type {string} */
- elem = "month";
- }
- /**
- * @param {(Object|string)} fragment
- * @param {(Object|string)} node
- * @return {?}
- */
- moment[field] = function(fragment, node) {
- var elem;
- var getter;
- var method = moment._locale[field];
- /** @type {Array} */
- var nodes = [];
- if ("number" == typeof fragment && (node = fragment, fragment = first), getter = function(camelKey) {
- var data = moment().utc().set(elem, camelKey);
- return method.call(moment._locale, data, fragment || "");
- }, null != node) {
- return getter(node);
- }
- /** @type {number} */
- elem = 0;
- for (;pivotElem > elem;elem++) {
- nodes.push(getter(elem));
- }
- return nodes;
- };
- }
- /**
- * @param {(number|string)} obj
- * @return {?}
- */
- function toInt(obj) {
- /** @type {number} */
- var num = +obj;
- /** @type {number} */
- var i = 0;
- return 0 !== num && (isFinite(num) && (i = num >= 0 ? Math.floor(num) : Math.ceil(num))), i;
- }
- /**
- * @param {?} year
- * @param {number} month
- * @return {?}
- */
- function daysInMonth(year, month) {
- return(new Date(Date.UTC(year, month + 1, 0))).getUTCDate();
- }
- /**
- * @param {?} type
- * @param {number} dataAndEvents
- * @param {number} opt_attributes
- * @return {?}
- */
- function createDom(type, dataAndEvents, opt_attributes) {
- return weekOfYear(moment([type, 11, 31 + dataAndEvents - opt_attributes]), dataAndEvents, opt_attributes).week;
- }
- /**
- * @param {number} year
- * @return {?}
- */
- function daysInYear(year) {
- return isLeapYear(year) ? 366 : 365;
- }
- /**
- * @param {number} year
- * @return {?}
- */
- function isLeapYear(year) {
- return year % 4 == 0 && year % 100 != 0 || year % 400 == 0;
- }
- /**
- * @param {number} m
- * @return {undefined}
- */
- function checkOverflow(m) {
- var overflow;
- if (m._a) {
- if (-2 === m._pf.overflow) {
- /** @type {number} */
- overflow = m._a[MONTH] < 0 || m._a[MONTH] > 11 ? MONTH : m._a[HOUR] < 1 || m._a[HOUR] > daysInMonth(m._a[YEAR], m._a[MONTH]) ? HOUR : m._a[DATE] < 0 || (m._a[DATE] > 24 || 24 === m._a[DATE] && (0 !== m._a[SECOND] || (0 !== m._a[MINUTE] || 0 !== m._a[MILLISECOND]))) ? DATE : m._a[SECOND] < 0 || m._a[SECOND] > 59 ? SECOND : m._a[MINUTE] < 0 || m._a[MINUTE] > 59 ? MINUTE : m._a[MILLISECOND] < 0 || m._a[MILLISECOND] > 999 ? MILLISECOND : -1;
- if (m._pf._overflowDayOfYear) {
- if (YEAR > overflow || overflow > HOUR) {
- /** @type {number} */
- overflow = HOUR;
- }
- }
- /** @type {number} */
- m._pf.overflow = overflow;
- }
- }
- }
- /**
- * @param {?} m
- * @return {?}
- */
- function isValid(m) {
- return null == m._isValid && (m._isValid = !isNaN(m._d.getTime()) && (m._pf.overflow < 0 && (!m._pf.empty && (!m._pf.invalidMonth && (!m._pf.nullInput && (!m._pf.invalidFormat && !m._pf.userInvalidated))))), m._strict && (m._isValid = m._isValid && (0 === m._pf.charsLeftOver && (0 === m._pf.unusedTokens.length && m._pf.bigHour === first)))), m._isValid;
- }
- /**
- * @param {Object} key
- * @return {?}
- */
- function normalizeLanguage(key) {
- return key ? key.toLowerCase().replace("_", "-") : key;
- }
- /**
- * @param {Array} key
- * @return {?}
- */
- function check(key) {
- var j;
- var next;
- var result;
- var split;
- /** @type {number} */
- var i = 0;
- for (;i < key.length;) {
- split = normalizeLanguage(key[i]).split("-");
- j = split.length;
- next = normalizeLanguage(key[i + 1]);
- next = next ? next.split("-") : null;
- for (;j > 0;) {
- if (result = test(split.slice(0, j).join("-"))) {
- return result;
- }
- if (next && (next.length >= j && compareArrays(split, next, true) >= j - 1)) {
- break;
- }
- j--;
- }
- i++;
- }
- return null;
- }
- /**
- * @param {Array} name
- * @return {?}
- */
- function test(name) {
- /** @type {null} */
- var camelKey = null;
- if (!languages[name] && sr) {
- try {
- camelKey = moment.locale();
- require("./locale/" + name);
- moment.locale(camelKey);
- } catch (r) {
- }
- }
- return languages[name];
- }
- /**
- * @param {string} input
- * @param {?} model
- * @return {?}
- */
- function makeAs(input, model) {
- var mom;
- var ms;
- return model._isUTC ? (mom = model.clone(), ms = (moment.isMoment(input) || isDate(input) ? +input : +moment(input)) - +mom, mom._d.setTime(+mom._d + ms), moment.updateOffset(mom, false), mom) : moment(input).local();
- }
- /**
- * @param {string} line
- * @return {?}
- */
- function func(line) {
- return line.match(/\[[\s\S]/) ? line.replace(/^\[|\]$/g, "") : line.replace(/\\/g, "");
- }
- /**
- * @param {string} format
- * @return {?}
- */
- function makeFormatFunction(format) {
- var array = format.match(formattingTokens);
- /** @type {number} */
- var i = 0;
- var l = array.length;
- for (;l > i;i++) {
- array[i] = formatTokenFunctions[array[i]] ? formatTokenFunctions[array[i]] : func(array[i]);
- }
- return function(mom) {
- /** @type {string} */
- var output = "";
- /** @type {number} */
- i = 0;
- for (;l > i;i++) {
- output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];
- }
- return output;
- };
- }
- /**
- * @param {?} m
- * @param {string} format
- * @return {?}
- */
- function formatMoment(m, format) {
- return m.isValid() ? (format = expandFormat(format, m.localeData()), formatFunctions[format] || (formatFunctions[format] = makeFormatFunction(format)), formatFunctions[format](m)) : m.localeData().invalidDate();
- }
- /**
- * @param {string} format
- * @param {?} lang
- * @return {?}
- */
- function expandFormat(format, lang) {
- /**
- * @param {string} input
- * @return {?}
- */
- function replaceLongDateFormatTokens(input) {
- return lang.longDateFormat(input) || input;
- }
- /** @type {number} */
- var i = 5;
- /** @type {number} */
- localFormattingTokens.lastIndex = 0;
- for (;i >= 0 && localFormattingTokens.test(format);) {
- format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
- /** @type {number} */
- localFormattingTokens.lastIndex = 0;
- i -= 1;
- }
- return format;
- }
- /**
- * @param {string} token
- * @param {number} config
- * @return {?}
- */
- function getParseRegexForToken(token, config) {
- var strict = config._strict;
- switch(token) {
- case "Q":
- return parseTokenTimestampMs;
- case "DDDD":
- return parseTokenFourDigits;
- case "YYYY":
- ;
- case "GGGG":
- ;
- case "gggg":
- return strict ? parseTokenTwoDigits : parseTokenOneToSixDigits;
- case "Y":
- ;
- case "G":
- ;
- case "g":
- return parseTokenOneToThreeDigits;
- case "YYYYYY":
- ;
- case "YYYYY":
- ;
- case "GGGGG":
- ;
- case "ggggg":
- return strict ? parseTokenOneDigit : parseTokenOneToFourDigits;
- case "S":
- if (strict) {
- return parseTokenTimestampMs;
- }
- ;
- case "SS":
- if (strict) {
- return parseTokenThreeDigits;
- }
- ;
- case "SSS":
- if (strict) {
- return parseTokenFourDigits;
- }
- ;
- case "DDD":
- return parseTokenSixDigits;
- case "MMM":
- ;
- case "MMMM":
- ;
- case "dd":
- ;
- case "ddd":
- ;
- case "dddd":
- return rchecked;
- case "a":
- ;
- case "A":
- return config._locale._meridiemParse;
- case "x":
- return parseTokenWord;
- case "X":
- return parseTokenDigits;
- case "Z":
- ;
- case "ZZ":
- return parseTokenTimezone;
- case "T":
- return parseTokenT;
- case "SSSS":
- return a;
- case "MM":
- ;
- case "DD":
- ;
- case "YY":
- ;
- case "GG":
- ;
- case "gg":
- ;
- case "HH":
- ;
- case "hh":
- ;
- case "mm":
- ;
- case "ss":
- ;
- case "ww":
- ;
- case "WW":
- return strict ? parseTokenThreeDigits : parseTokenOneOrTwoDigits;
- case "M":
- ;
- case "D":
- ;
- case "d":
- ;
- case "H":
- ;
- case "h":
- ;
- case "m":
- ;
- case "s":
- ;
- case "w":
- ;
- case "W":
- ;
- case "e":
- ;
- case "E":
- return parseTokenOneOrTwoDigits;
- case "Do":
- return strict ? config._locale._ordinalParse : config._locale._ordinalParseLenient;
- default:
- return new RegExp(regexpEscape(unescapeFormat(token.replace("\\", "")), "i"));
- }
- }
- /**
- * @param {string} string
- * @return {?}
- */
- function timezoneMinutesFromString(string) {
- string = string || "";
- var codeSegments = string.match(parseTokenTimezone) || [];
- var tzchunk = codeSegments[codeSegments.length - 1] || [];
- /** @type {Array} */
- var parts = (tzchunk + "").match(parseTimezoneChunker) || ["-", 0, 0];
- var u = +(60 * parts[1]) + toInt(parts[2]);
- return "+" === parts[0] ? u : -u;
- }
- /**
- * @param {string} token
- * @param {string} input
- * @param {?} config
- * @return {undefined}
- */
- function addTimeToArrayFromToken(token, input, config) {
- var a;
- var datePartArray = config._a;
- switch(token) {
- case "Q":
- if (null != input) {
- /** @type {number} */
- datePartArray[MONTH] = 3 * (toInt(input) - 1);
- }
- break;
- case "M":
- ;
- case "MM":
- if (null != input) {
- /** @type {number} */
- datePartArray[MONTH] = toInt(input) - 1;
- }
- break;
- case "MMM":
- ;
- case "MMMM":
- a = config._locale.monthsParse(input, token, config._strict);
- if (null != a) {
- datePartArray[MONTH] = a;
- } else {
- /** @type {string} */
- config._pf.invalidMonth = input;
- }
- break;
- case "D":
- ;
- case "DD":
- if (null != input) {
- datePartArray[HOUR] = toInt(input);
- }
- break;
- case "Do":
- if (null != input) {
- datePartArray[HOUR] = toInt(parseInt(input.match(/\d{1,2}/)[0], 10));
- }
- break;
- case "DDD":
- ;
- case "DDDD":
- if (null != input) {
- config._dayOfYear = toInt(input);
- }
- break;
- case "YY":
- datePartArray[YEAR] = moment.parseTwoDigitYear(input);
- break;
- case "YYYY":
- ;
- case "YYYYY":
- ;
- case "YYYYYY":
- datePartArray[YEAR] = toInt(input);
- break;
- case "a":
- ;
- case "A":
- /** @type {string} */
- config._meridiem = input;
- break;
- case "h":
- ;
- case "hh":
- /** @type {boolean} */
- config._pf.bigHour = true;
- case "H":
- ;
- case "HH":
- datePartArray[DATE] = toInt(input);
- break;
- case "m":
- ;
- case "mm":
- datePartArray[SECOND] = toInt(input);
- break;
- case "s":
- ;
- case "ss":
- datePartArray[MINUTE] = toInt(input);
- break;
- case "S":
- ;
- case "SS":
- ;
- case "SSS":
- ;
- case "SSSS":
- datePartArray[MILLISECOND] = toInt(1E3 * ("0." + input));
- break;
- case "x":
- /** @type {Date} */
- config._d = new Date(toInt(input));
- break;
- case "X":
- /** @type {Date} */
- config._d = new Date(1E3 * parseFloat(input));
- break;
- case "Z":
- ;
- case "ZZ":
- /** @type {boolean} */
- config._useUTC = true;
- config._tzm = timezoneMinutesFromString(input);
- break;
- case "dd":
- ;
- case "ddd":
- ;
- case "dddd":
- a = config._locale.weekdaysParse(input);
- if (null != a) {
- config._w = config._w || {};
- config._w.d = a;
- } else {
- /** @type {string} */
- config._pf.invalidWeekday = input;
- }
- break;
- case "w":
- ;
- case "ww":
- ;
- case "W":
- ;
- case "WW":
- ;
- case "d":
- ;
- case "e":
- ;
- case "E":
- token = token.substr(0, 1);
- case "gggg":
- ;
- case "GGGG":
- ;
- case "GGGGG":
- token = token.substr(0, 2);
- if (input) {
- config._w = config._w || {};
- config._w[token] = toInt(input);
- }
- break;
- case "gg":
- ;
- case "GG":
- config._w = config._w || {};
- config._w[token] = moment.parseTwoDigitYear(input);
- }
- }
- /**
- * @param {?} config
- * @return {undefined}
- */
- function dateFromConfig(config) {
- var w;
- var value;
- var week;
- var d;
- var node;
- var attributes;
- var temp;
- w = config._w;
- if (null != w.GG || (null != w.W || null != w.E)) {
- /** @type {number} */
- node = 1;
- /** @type {number} */
- attributes = 4;
- value = fixYear(w.GG, config._a[YEAR], weekOfYear(moment(), 1, 4).year);
- week = fixYear(w.W, 1);
- d = fixYear(w.E, 1);
- } else {
- node = config._locale._week.dow;
- attributes = config._locale._week.doy;
- value = fixYear(w.gg, config._a[YEAR], weekOfYear(moment(), node, attributes).year);
- week = fixYear(w.w, 1);
- if (null != w.d) {
- d = w.d;
- if (node > d) {
- ++week;
- }
- } else {
- d = null != w.e ? w.e + node : node;
- }
- }
- temp = dayOfYearFromWeeks(value, week, d, attributes, node);
- config._a[YEAR] = temp.year;
- config._dayOfYear = temp.dayOfYear;
- }
- /**
- * @param {?} config
- * @return {undefined}
- */
- function dateFromArray(config) {
- var i;
- var date;
- var currentDate;
- var yearToUse;
- /** @type {Array} */
- var input = [];
- if (!config._d) {
- currentDate = currentDateArray(config);
- if (config._w) {
- if (null == config._a[HOUR]) {
- if (null == config._a[MONTH]) {
- dateFromConfig(config);
- }
- }
- }
- if (config._dayOfYear) {
- yearToUse = fixYear(config._a[YEAR], currentDate[YEAR]);
- if (config._dayOfYear > daysInYear(yearToUse)) {
- /** @type {boolean} */
- config._pf._overflowDayOfYear = true;
- }
- date = makeUTCDate(yearToUse, 0, config._dayOfYear);
- config._a[MONTH] = date.getUTCMonth();
- config._a[HOUR] = date.getUTCDate();
- }
- /** @type {number} */
- i = 0;
- for (;3 > i && null == config._a[i];++i) {
- config._a[i] = input[i] = currentDate[i];
- }
- for (;7 > i;i++) {
- config._a[i] = input[i] = null == config._a[i] ? 2 === i ? 1 : 0 : config._a[i];
- }
- if (24 === config._a[DATE]) {
- if (0 === config._a[SECOND]) {
- if (0 === config._a[MINUTE]) {
- if (0 === config._a[MILLISECOND]) {
- /** @type {boolean} */
- config._nextDay = true;
- /** @type {number} */
- config._a[DATE] = 0;
- }
- }
- }
- }
- config._d = (config._useUTC ? makeUTCDate : makeDate).apply(null, input);
- if (null != config._tzm) {
- config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
- }
- if (config._nextDay) {
- /** @type {number} */
- config._a[DATE] = 24;
- }
- }
- }
- /**
- * @param {number} config
- * @return {undefined}
- */
- function dateFromObject(config) {
- var o;
- if (!config._d) {
- o = normalizeObjectUnits(config._i);
- /** @type {Array} */
- config._a = [o.year, o.month, o.day || o.date, o.hour, o.minute, o.second, o.millisecond];
- dateFromArray(config);
- }
- }
- /**
- * @param {?} config
- * @return {?}
- */
- function currentDateArray(config) {
- /** @type {Date} */
- var today = new Date;
- return config._useUTC ? [today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate()] : [today.getFullYear(), today.getMonth(), today.getDate()];
- }
- /**
- * @param {number} config
- * @return {?}
- */
- function makeDateFromStringAndFormat(config) {
- if (config._f === moment.ISO_8601) {
- return void makeDateFromString(config);
- }
- /** @type {Array} */
- config._a = [];
- /** @type {boolean} */
- config._pf.empty = true;
- var parsedInput;
- var token;
- var copies;
- /** @type {string} */
- var string = "" + config._i;
- /** @type {number} */
- var stringLength = string.length;
- /** @type {number} */
- var totalParsedInputLength = 0;
- var codeSegments = expandFormat(config._f, config._locale).match(formattingTokens) || [];
- /** @type {number} */
- var i = 0;
- for (;i < codeSegments.length;i++) {
- token = codeSegments[i];
- parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
- if (parsedInput) {
- /** @type {string} */
- copies = string.substr(0, string.indexOf(parsedInput));
- if (copies.length > 0) {
- config._pf.unusedInput.push(copies);
- }
- /** @type {string} */
- string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
- totalParsedInputLength += parsedInput.length;
- }
- if (formatTokenFunctions[token]) {
- if (parsedInput) {
- /** @type {boolean} */
- config._pf.empty = false;
- } else {
- config._pf.unusedTokens.push(token);
- }
- addTimeToArrayFromToken(token, parsedInput, config);
- } else {
- if (config._strict) {
- if (!parsedInput) {
- config._pf.unusedTokens.push(token);
- }
- }
- }
- }
- /** @type {number} */
- config._pf.charsLeftOver = stringLength - totalParsedInputLength;
- if (string.length > 0) {
- config._pf.unusedInput.push(string);
- }
- if (config._pf.bigHour === true) {
- if (config._a[DATE] <= 12) {
- config._pf.bigHour = first;
- }
- }
- config._a[DATE] = isEmpty(config._locale, config._a[DATE], config._meridiem);
- dateFromArray(config);
- checkOverflow(config);
- }
- /**
- * @param {string} s
- * @return {?}
- */
- function unescapeFormat(s) {
- return s.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function(dataAndEvents, error, e, err, err2) {
- return error || (e || (err || err2));
- });
- }
- /**
- * @param {string} s
- * @return {?}
- */
- function regexpEscape(s) {
- return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
- }
- /**
- * @param {Object} m
- * @return {?}
- */
- function makeDateFromStringAndArray(m) {
- var tempConfig;
- var bestMoment;
- var scoreToBeat;
- var i;
- var currentScore;
- if (0 === m._f.length) {
- return m._pf.invalidFormat = true, void(m._d = new Date(NaN));
- }
- /** @type {number} */
- i = 0;
- for (;i < m._f.length;i++) {
- /** @type {number} */
- currentScore = 0;
- tempConfig = config({}, m);
- if (null != m._useUTC) {
- tempConfig._useUTC = m._useUTC;
- }
- tempConfig._pf = validateTransport();
- tempConfig._f = m._f[i];
- makeDateFromStringAndFormat(tempConfig);
- if (isValid(tempConfig)) {
- currentScore += tempConfig._pf.charsLeftOver;
- currentScore += 10 * tempConfig._pf.unusedTokens.length;
- tempConfig._pf.score = currentScore;
- if (null == scoreToBeat || scoreToBeat > currentScore) {
- scoreToBeat = currentScore;
- bestMoment = tempConfig;
- }
- }
- }
- extend(m, bestMoment || tempConfig);
- }
- /**
- * @param {number} config
- * @return {undefined}
- */
- function makeDateFromString(config) {
- var i;
- var len;
- var string = config._i;
- /** @type {(Array.<string>|null)} */
- var ast = spaceRe.exec(string);
- if (ast) {
- /** @type {boolean} */
- config._pf.iso = true;
- /** @type {number} */
- i = 0;
- /** @type {number} */
- len = codeSegments.length;
- for (;len > i;i++) {
- if (codeSegments[i][1].exec(string)) {
- config._f = codeSegments[i][0] + (ast[6] || " ");
- break;
- }
- }
- /** @type {number} */
- i = 0;
- /** @type {number} */
- len = rawParams.length;
- for (;len > i;i++) {
- if (rawParams[i][1].exec(string)) {
- config._f += rawParams[i][0];
- break;
- }
- }
- if (string.match(parseTokenTimezone)) {
- config._f += "Z";
- }
- makeDateFromStringAndFormat(config);
- } else {
- /** @type {boolean} */
- config._isValid = false;
- }
- }
- /**
- * @param {number} config
- * @return {undefined}
- */
- function prepareSandboxFromConfig(config) {
- makeDateFromString(config);
- if (config._isValid === false) {
- delete config._isValid;
- moment.createFromInputFallback(config);
- }
- }
- /**
- * @param {Array} array
- * @param {Function} fn
- * @return {?}
- */
- function clean(array, fn) {
- /** @type {Array} */
- var ret = [];
- /** @type {number} */
- var i = 0;
- for (;i < array.length;++i) {
- ret.push(fn(array[i], i));
- }
- return ret;
- }
- /**
- * @param {number} config
- * @return {undefined}
- */
- function makeDateFromInput(config) {
- var matches;
- var val = config._i;
- if (val === first) {
- /** @type {Date} */
- config._d = new Date;
- } else {
- if (isDate(val)) {
- /** @type {Date} */
- config._d = new Date(+val);
- } else {
- if (null !== (matches = regexp.exec(val))) {
- /** @type {Date} */
- config._d = new Date(+matches[1]);
- } else {
- if ("string" == typeof val) {
- prepareSandboxFromConfig(config);
- } else {
- if (isArray(val)) {
- config._a = clean(val.slice(0), function(m1) {
- return parseInt(m1, 10);
- });
- dateFromArray(config);
- } else {
- if ("object" == typeof val) {
- dateFromObject(config);
- } else {
- if ("number" == typeof val) {
- /** @type {Date} */
- config._d = new Date(val);
- } else {
- moment.createFromInputFallback(config);
- }
- }
- }
- }
- }
- }
- }
- }
- /**
- * @param {number} year
- * @param {number} month
- * @param {number} date
- * @param {number} hour
- * @param {number} mins
- * @param {number} secs
- * @param {number} ms
- * @return {?}
- */
- function makeDate(year, month, date, hour, mins, secs, ms) {
- /** @type {Date} */
- var d = new Date(year, month, date, hour, mins, secs, ms);
- return 1970 > year && d.setFullYear(year), d;
- }
- /**
- * @param {number} y
- * @return {?}
- */
- function makeUTCDate(y) {
- /** @type {Date} */
- var date = new Date(Date.UTC.apply(null, arguments));
- return 1970 > y && date.setUTCFullYear(y), date;
- }
- /**
- * @param {(number|string)} input
- * @param {?} language
- * @return {?}
- */
- function parseWeekday(input, language) {
- if ("string" == typeof input) {
- if (isNaN(input)) {
- if (input = language.weekdaysParse(input), "number" != typeof input) {
- return null;
- }
- } else {
- /** @type {number} */
- input = parseInt(input, 10);
- }
- }
- return input;
- }
- /**
- * @param {?} string
- * @param {number} number
- * @param {?} withoutSuffix
- * @param {?} isFuture
- * @param {?} lang
- * @return {?}
- */
- function substituteTimeAgo(string, number, withoutSuffix, isFuture, lang) {
- return lang.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
- }
- /**
- * @param {number} input
- * @param {boolean} _
- * @param {?} context
- * @return {?}
- */
- function preset(input, _, context) {
- var assert = moment.duration(input).abs();
- /** @type {number} */
- var seconds = parseInt(assert.as("s"));
- /** @type {number} */
- var minutes = parseInt(assert.as("m"));
- /** @type {number} */
- var hours = parseInt(assert.as("h"));
- /** @type {number} */
- var i = parseInt(assert.as("d"));
- /** @type {number} */
- var idx = parseInt(assert.as("M"));
- /** @type {number} */
- var charCodeToReplace = parseInt(assert.as("y"));
- /** @type {Array} */
- var args = seconds < data.s && ["s", seconds] || (1 === minutes && ["m"] || (minutes < data.m && ["mm", minutes] || (1 === hours && ["h"] || (hours < data.h && ["hh", hours] || (1 === i && ["d"] || (i < data.d && ["dd", i] || (1 === idx && ["M"] || (idx < data.M && ["MM", idx] || (1 === charCodeToReplace && ["y"] || ["yy", charCodeToReplace])))))))));
- return args[2] = _, args[3] = +input > 0, args[4] = context, substituteTimeAgo.apply({}, args);
- }
- /**
- * @param {Object} mom
- * @param {number} dataAndEvents
- * @param {number} opt_attributes
- * @return {?}
- */
- function weekOfYear(mom, dataAndEvents, opt_attributes) {
- var t;
- /** @type {number} */
- var max = opt_attributes - dataAndEvents;
- /** @type {number} */
- var n = opt_attributes - mom.day();
- return n > max && (n -= 7), max - 7 > n && (n += 7), t = moment(mom).add(n, "d"), {
- week : Math.ceil(t.dayOfYear() / 7),
- year : t.year()
- };
- }
- /**
- * @param {number} year
- * @param {number} week
- * @param {number} d
- * @param {?} opt_attributes
- * @param {?} a
- * @return {?}
- */
- function dayOfYearFromWeeks(year, week, d, opt_attributes, a) {
- var o;
- var dayOfYear;
- var b = makeUTCDate(year, 0, 1).getUTCDay();
- return b = 0 === b ? 7 : b, d = null != d ? d : a, o = a - b + (b > opt_attributes ? 7 : 0) - (a > b ? 7 : 0), dayOfYear = 7 * (week - 1) + (d - a) + o + 1, {
- year : dayOfYear > 0 ? year : year - 1,
- dayOfYear : dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear
- };
- }
- /**
- * @param {number} config
- * @return {?}
- */
- function makeMoment(config) {
- var Dom;
- var input = config._i;
- var format = config._f;
- return config._locale = config._locale || moment.localeData(config._l), null === input || format === first && "" === input ? moment.invalid({
- nullInput : true
- }) : ("string" == typeof input && (config._i = input = config._locale.preparse(input)), moment.isMoment(input) ? new Moment(input, true) : (format ? isArray(format) ? makeDateFromStringAndArray(config) : makeDateFromStringAndFormat(config) : makeDateFromInput(config), Dom = new Moment(config), Dom._nextDay && (Dom.add(1, "d"), Dom._nextDay = first), Dom));
- }
- /**
- * @param {string} name
- * @param {Array} val
- * @return {?}
- */
- function reduce(name, val) {
- var x;
- var j;
- if (1 === val.length && (isArray(val[0]) && (val = val[0])), !val.length) {
- return moment();
- }
- x = val[0];
- /** @type {number} */
- j = 1;
- for (;j < val.length;++j) {
- if (val[j][name](x)) {
- x = val[j];
- }
- }
- return x;
- }
- /**
- * @param {string} m
- * @param {number} value
- * @return {?}
- */
- function fn(m, value) {
- var r20;
- return "string" == typeof value && (value = m.localeData().monthsParse(value), "number" != typeof value) ? m : (r20 = Math.min(m.date(), daysInMonth(m.year(), value)), m._d["set" + (m._isUTC ? "UTC" : "") + "Month"](value, r20), m);
- }
- /**
- * @param {string} input
- * @param {string} name
- * @return {?}
- */
- function get(input, name) {
- return input._d["get" + (input._isUTC ? "UTC" : "") + name]();
- }
- /**
- * @param {string} m
- * @param {string} name
- * @param {number} key
- * @return {?}
- */
- function set(m, name, key) {
- return "Month" === name ? fn(m, key) : m._d["set" + (m._isUTC ? "UTC" : "") + name](key);
- }
- /**
- * @param {string} name
- * @param {boolean} recurring
- * @return {?}
- */
- function setTick(name, recurring) {
- return function(part) {
- return null != part ? (set(this, name, part), moment.updateOffset(this, recurring), this) : get(this, name);
- };
- }
- /**
- * @param {number} str
- * @return {?}
- */
- function isNumeric(str) {
- return 400 * str / 146097;
- }
- /**
- * @param {number} years
- * @return {?}
- */
- function randomId(years) {
- return 146097 * years / 400;
- }
- /**
- * @param {string} name
- * @return {undefined}
- */
- function makeDurationGetter(name) {
- /**
- * @return {?}
- */
- moment.duration.fn[name] = function() {
- return this._data[name];
- };
- }
- /**
- * @param {boolean} dataAndEvents
- * @return {undefined}
- */
- function clone(dataAndEvents) {
- if ("undefined" == typeof ender) {
- previous_async = root.moment;
- root.moment = dataAndEvents ? timeout("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.", moment) : moment;
- }
- }
- var moment;
- var previous_async;
- var i;
- var root = "undefined" == typeof global || "undefined" != typeof window && window !== global.window ? this : global;
- /** @type {function (*): number} */
- var parseInt = Math.round;
- /** @type {function (this:Object, *): boolean} */
- var has = Object.prototype.hasOwnProperty;
- /** @type {number} */
- var YEAR = 0;
- /** @type {number} */
- var MONTH = 1;
- /** @type {number} */
- var HOUR = 2;
- /** @type {number} */
- var DATE = 3;
- /** @type {number} */
- var SECOND = 4;
- /** @type {number} */
- var MINUTE = 5;
- /** @type {number} */
- var MILLISECOND = 6;
- var languages = {};
- /** @type {Array} */
- var keys = [];
- var sr = "undefined" != typeof module && (module && module.exports);
- /** @type {RegExp} */
- var regexp = /^\/?Date\((\-?\d+)/i;
- /** @type {RegExp} */
- var re = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/;
- /** @type {RegExp} */
- var string = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;
- /** @type {RegExp} */
- var formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g;
- /** @type {RegExp} */
- var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
- /** @type {RegExp} */
- var parseTokenOneOrTwoDigits = /\d\d?/;
- /** @type {RegExp} */
- var parseTokenSixDigits = /\d{1,3}/;
- /** @type {RegExp} */
- var parseTokenOneToSixDigits = /\d{1,4}/;
- /** @type {RegExp} */
- var parseTokenOneToFourDigits = /[+\-]?\d{1,6}/;
- /** @type {RegExp} */
- var a = /\d+/;
- /** @type {RegExp} */
- var rchecked = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i;
- /** @type {RegExp} */
- var parseTokenTimezone = /Z|[\+\-]\d\d:?\d\d/gi;
- /** @type {RegExp} */
- var parseTokenT = /T/i;
- /** @type {RegExp} */
- var parseTokenWord = /[\+\-]?\d+/;
- /** @type {RegExp} */
- var parseTokenDigits = /[\+\-]?\d+(\.\d{1,3})?/;
- /** @type {RegExp} */
- var parseTokenTimestampMs = /\d/;
- /** @type {RegExp} */
- var parseTokenThreeDigits = /\d\d/;
- /** @type {RegExp} */
- var parseTokenFourDigits = /\d{3}/;
- /** @type {RegExp} */
- var parseTokenTwoDigits = /\d{4}/;
- /** @type {RegExp} */
- var parseTokenOneDigit = /[+-]?\d{6}/;
- /** @type {RegExp} */
- var parseTokenOneToThreeDigits = /[+-]?\d+/;
- /** @type {RegExp} */
- var spaceRe = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/;
- /** @type {Array} */
- var codeSegments = [["YYYYYY-MM-DD", /[+-]\d{6}-\d{2}-\d{2}/], ["YYYY-MM-DD", /\d{4}-\d{2}-\d{2}/], ["GGGG-[W]WW-E", /\d{4}-W\d{2}-\d/], ["GGGG-[W]WW", /\d{4}-W\d{2}/], ["YYYY-DDD", /\d{4}-\d{3}/]];
- /** @type {Array} */
- var rawParams = [["HH:mm:ss.SSSS", /(T| )\d\d:\d\d:\d\d\.\d+/], ["HH:mm:ss", /(T| )\d\d:\d\d:\d\d/], ["HH:mm", /(T| )\d\d:\d\d/], ["HH", /(T| )\d\d/]];
- /** @type {RegExp} */
- var parseTimezoneChunker = /([\+\-]|\d\d)/gi;
- var obj = ("Date|Hours|Minutes|Seconds|Milliseconds".split("|"), {
- Milliseconds : 1,
- Seconds : 1E3,
- Minutes : 6E4,
- Hours : 36E5,
- Days : 864E5,
- Months : 2592E6,
- Years : 31536E6
- });
- var unitAliases = {
- ms : "millisecond",
- s : "second",
- m : "minute",
- h : "hour",
- d : "day",
- D : "date",
- w : "week",
- W : "isoWeek",
- M : "month",
- Q : "quarter",
- y : "year",
- DDD : "dayOfYear",
- e : "weekday",
- E : "isoWeekday",
- gg : "weekYear",
- GG : "isoWeekYear"
- };
- var camelFunctions = {
- dayofyear : "dayOfYear",
- isoweekday : "isoWeekday",
- isoweek : "isoWeek",
- weekyear : "weekYear",
- isoweekyear : "isoWeekYear"
- };
- var formatFunctions = {};
- var data = {
- s : 45,
- m : 45,
- h : 22,
- d : 26,
- M : 11
- };
- /** @type {Array.<string>} */
- var braceStack = "DDD w W M D d".split(" ");
- /** @type {Array.<string>} */
- var eventPath = "M D H h m s w W".split(" ");
- var formatTokenFunctions = {
- /**
- * @return {?}
- */
- M : function() {
- return this.month() + 1;
- },
- /**
- * @param {?} format
- * @return {?}
- */
- MMM : function(format) {
- return this.localeData().monthsShort(this, format);
- },
- /**
- * @param {?} classesToRemove
- * @return {?}
- */
- MMMM : function(classesToRemove) {
- return this.localeData().months(this, classesToRemove);
- },
- /**
- * @return {?}
- */
- D : function() {
- return this.date();
- },
- /**
- * @return {?}
- */
- DDD : function() {
- return this.dayOfYear();
- },
- /**
- * @return {?}
- */
- d : function() {
- return this.day();
- },
- /**
- * @param {?} format
- * @return {?}
- */
- dd : function(format) {
- return this.localeData().weekdaysMin(this, format);
- },
- /**
- * @param {?} format
- * @return {?}
- */
- ddd : function(format) {
- return this.localeData().weekdaysShort(this, format);
- },
- /**
- * @param {?} format
- * @return {?}
- */
- dddd : function(format) {
- return this.localeData().weekdays(this, format);
- },
- /**
- * @return {?}
- */
- w : function() {
- return this.week();
- },
- /**
- * @return {?}
- */
- W : function() {
- return this.isoWeek();
- },
- /**
- * @return {?}
- */
- YY : function() {
- return leftZeroFill(this.year() % 100, 2);
- },
- /**
- * @return {?}
- */
- YYYY : function() {
- return leftZeroFill(this.year(), 4);
- },
- /**
- * @return {?}
- */
- YYYYY : function() {
- return leftZeroFill(this.year(), 5);
- },
- /**
- * @return {?}
- */
- YYYYYY : function() {
- var y = this.year();
- /** @type {string} */
- var sign = y >= 0 ? "+" : "-";
- return sign + leftZeroFill(Math.abs(y), 6);
- },
- /**
- * @return {?}
- */
- gg : function() {
- return leftZeroFill(this.weekYear() % 100, 2);
- },
- /**
- * @return {?}
- */
- gggg : function() {
- return leftZeroFill(this.weekYear(), 4);
- },
- /**
- * @return {?}
- */
- ggggg : function() {
- return leftZeroFill(this.weekYear(), 5);
- },
- /**
- * @return {?}
- */
- GG : function() {
- return leftZeroFill(this.isoWeekYear() % 100, 2);
- },
- /**
- * @return {?}
- */
- GGGG : function() {
- return leftZeroFill(this.isoWeekYear(), 4);
- },
- /**
- * @return {?}
- */
- GGGGG : function() {
- return leftZeroFill(this.isoWeekYear(), 5);
- },
- /**
- * @return {?}
- */
- e : function() {
- return this.weekday();
- },
- /**
- * @return {?}
- */
- E : function() {
- return this.isoWeekday();
- },
- /**
- * @return {?}
- */
- a : function() {
- return this.localeData().meridiem(this.hours(), this.minutes(), true);
- },
- /**
- * @return {?}
- */
- A : function() {
- return this.localeData().meridiem(this.hours(), this.minutes(), false);
- },
- /**
- * @return {?}
- */
- H : function() {
- return this.hours();
- },
- /**
- * @return {?}
- */
- h : function() {
- return this.hours() % 12 || 12;
- },
- /**
- * @return {?}
- */
- m : function() {
- return this.minutes();
- },
- /**
- * @return {?}
- */
- s : function() {
- return this.seconds();
- },
- /**
- * @return {?}
- */
- S : function() {
- return toInt(this.milliseconds() / 100);
- },
- /**
- * @return {?}
- */
- SS : function() {
- return leftZeroFill(toInt(this.milliseconds() / 10), 2);
- },
- /**
- * @return {?}
- */
- SSS : function() {
- return leftZeroFill(this.milliseconds(), 3);
- },
- /**
- * @return {?}
- */
- SSSS : function() {
- return leftZeroFill(this.milliseconds(), 3);
- },
- /**
- * @return {?}
- */
- Z : function() {
- var a = this.utcOffset();
- /** @type {string} */
- var b = "+";
- return 0 > a && (a = -a, b = "-"), b + leftZeroFill(toInt(a / 60), 2) + ":" + leftZeroFill(toInt(a) % 60, 2);
- },
- /**
- * @return {?}
- */
- ZZ : function() {
- var a = this.utcOffset();
- /** @type {string} */
- var b = "+";
- return 0 > a && (a = -a, b = "-"), b + leftZeroFill(toInt(a / 60), 2) + leftZeroFill(toInt(a) % 60, 2);
- },
- /**
- * @return {?}
- */
- z : function() {
- return this.zoneAbbr();
- },
- /**
- * @return {?}
- */
- zz : function() {
- return this.zoneName();
- },
- /**
- * @return {?}
- */
- x : function() {
- return this.valueOf();
- },
- /**
- * @return {?}
- */
- X : function() {
- return this.unix();
- },
- /**
- * @return {?}
- */
- Q : function() {
- return this.quarter();
- }
- };
- var viewItems = {};
- /** @type {Array} */
- var lists = ["months", "monthsShort", "weekdays", "weekdaysShort", "weekdaysMin"];
- /** @type {boolean} */
- var ii = false;
- for (;braceStack.length;) {
- /** @type {string} */
- i = braceStack.pop();
- formatTokenFunctions[i + "o"] = ordinalizeToken(formatTokenFunctions[i], i);
- }
- for (;eventPath.length;) {
- /** @type {string} */
- i = eventPath.pop();
- formatTokenFunctions[i + i] = padToken(formatTokenFunctions[i], 2);
- }
- formatTokenFunctions.DDDD = padToken(formatTokenFunctions.DDD, 3);
- extend(Language.prototype, {
- /**
- * @param {Object} elem
- * @return {undefined}
- */
- set : function(elem) {
- var val;
- var propName;
- for (propName in elem) {
- val = elem[propName];
- if ("function" == typeof val) {
- /** @type {Function} */
- this[propName] = val;
- } else {
- this["_" + propName] = val;
- }
- }
- /** @type {RegExp} */
- this._ordinalParseLenient = new RegExp(this._ordinalParse.source + "|" + /\d{1,2}/.source);
- },
- _months : "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
- /**
- * @param {number} m
- * @return {?}
- */
- months : function(m) {
- return this._months[m.month()];
- },
- _monthsShort : "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),
- /**
- * @param {string} m
- * @return {?}
- */
- monthsShort : function(m) {
- return this._monthsShort[m.month()];
- },
- /**
- * @param {(number|string)} monthName
- * @param {string} element
- * @param {string} dataAndEvents
- * @return {?}
- */
- monthsParse : function(monthName, element, dataAndEvents) {
- var i;
- var mom;
- var requestUrl;
- if (!this._monthsParse) {
- /** @type {Array} */
- this._monthsParse = [];
- /** @type {Array} */
- this._longMonthsParse = [];
- /** @type {Array} */
- this._shortMonthsParse = [];
- }
- /** @type {number} */
- i = 0;
- for (;12 > i;i++) {
- if ((mom = moment.utc([2E3, i]), dataAndEvents && (!this._longMonthsParse[i] && (this._longMonthsParse[i] = new RegExp("^" + this.months(mom, "").replace(".", "") + "$", "i"), this._shortMonthsParse[i] = new RegExp("^" + this.monthsShort(mom, "").replace(".", "") + "$", "i"))), dataAndEvents || (this._monthsParse[i] || (requestUrl = "^" + this.months(mom, "") + "|^" + this.monthsShort(mom, ""), this._monthsParse[i] = new RegExp(requestUrl.replace(".", ""), "i"))), dataAndEvents && ("MMMM" ===
- element && this._longMonthsParse[i].test(monthName))) || (dataAndEvents && ("MMM" === element && this._shortMonthsParse[i].test(monthName)) || !dataAndEvents && this._monthsParse[i].test(monthName))) {
- return i;
- }
- }
- },
- _weekdays : "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
- /**
- * @param {Object} m
- * @return {?}
- */
- weekdays : function(m) {
- return this._weekdays[m.day()];
- },
- _weekdaysShort : "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),
- /**
- * @param {Object} m
- * @return {?}
- */
- weekdaysShort : function(m) {
- return this._weekdaysShort[m.day()];
- },
- _weekdaysMin : "Su_Mo_Tu_We_Th_Fr_Sa".split("_"),
- /**
- * @param {Object} m
- * @return {?}
- */
- weekdaysMin : function(m) {
- return this._weekdaysMin[m.day()];
- },
- /**
- * @param {string} weekdayName
- * @return {?}
- */
- weekdaysParse : function(weekdayName) {
- var i;
- var mom;
- var requestUrl;
- if (!this._weekdaysParse) {
- /** @type {Array} */
- this._weekdaysParse = [];
- }
- /** @type {number} */
- i = 0;
- for (;7 > i;i++) {
- if (this._weekdaysParse[i] || (mom = moment([2E3, 1]).day(i), requestUrl = "^" + this.weekdays(mom, "") + "|^" + this.weekdaysShort(mom, "") + "|^" + this.weekdaysMin(mom, ""), this._weekdaysParse[i] = new RegExp(requestUrl.replace(".", ""), "i")), this._weekdaysParse[i].test(weekdayName)) {
- return i;
- }
- }
- },
- _longDateFormat : {
- LTS : "h:mm:ss A",
- LT : "h:mm A",
- L : "MM/DD/YYYY",
- LL : "MMMM D, YYYY",
- LLL : "MMMM D, YYYY LT",
- LLLL : "dddd, MMMM D, YYYY LT"
- },
- /**
- * @param {string} key
- * @return {?}
- */
- longDateFormat : function(key) {
- var output = this._longDateFormat[key];
- return!output && (this._longDateFormat[key.toUpperCase()] && (output = this._longDateFormat[key.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function(models) {
- return models.slice(1);
- }), this._longDateFormat[key] = output)), output;
- },
- /**
- * @param {Object} input
- * @return {?}
- */
- isPM : function(input) {
- return "p" === (input + "").toLowerCase().charAt(0);
- },
- _meridiemParse : /[ap]\.?m?\.?/i,
- /**
- * @param {number} hour
- * @param {?} isUpper
- * @param {boolean} isLower
- * @return {?}
- */
- meridiem : function(hour, isUpper, isLower) {
- return hour > 11 ? isLower ? "pm" : "PM" : isLower ? "am" : "AM";
- },
- _calendar : {
- sameDay : "[Today at] LT",
- nextDay : "[Tomorrow at] LT",
- nextWeek : "dddd [at] LT",
- lastDay : "[Yesterday at] LT",
- lastWeek : "[Last] dddd [at] LT",
- sameElse : "L"
- },
- /**
- * @param {string} key
- * @param {?} recurring
- * @param {?} callback
- * @return {?}
- */
- calendar : function(key, recurring, callback) {
- var fn = this._calendar[key];
- return "function" == typeof fn ? fn.apply(recurring, [callback]) : fn;
- },
- _relativeTime : {
- future : "in %s",
- past : "%s ago",
- s : "a few seconds",
- m : "a minute",
- mm : "%d minutes",
- h : "an hour",
- hh : "%d hours",
- d : "a day",
- dd : "%d days",
- M : "a month",
- MM : "%d months",
- y : "a year",
- yy : "%d years"
- },
- /**
- * @param {?} number
- * @param {boolean} withoutSuffix
- * @param {?} string
- * @param {?} isFuture
- * @return {?}
- */
- relativeTime : function(number, withoutSuffix, string, isFuture) {
- var output = this._relativeTime[string];
- return "function" == typeof output ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number);
- },
- /**
- * @param {number} diff
- * @param {?} output
- * @return {?}
- */
- pastFuture : function(diff, output) {
- var format = this._relativeTime[diff > 0 ? "future" : "past"];
- return "function" == typeof format ? format(output) : format.replace(/%s/i, output);
- },
- /**
- * @param {?} number
- * @return {?}
- */
- ordinal : function(number) {
- return this._ordinal.replace("%d", number);
- },
- _ordinal : "%d",
- _ordinalParse : /\d{1,2}/,
- /**
- * @param {?} string
- * @return {?}
- */
- preparse : function(string) {
- return string;
- },
- /**
- * @param {?} string
- * @return {?}
- */
- postformat : function(string) {
- return string;
- },
- /**
- * @param {Object} mom
- * @return {?}
- */
- week : function(mom) {
- return weekOfYear(mom, this._week.dow, this._week.doy).week;
- },
- _week : {
- dow : 0,
- doy : 6
- },
- /**
- * @return {?}
- */
- firstDayOfWeek : function() {
- return this._week.dow;
- },
- /**
- * @return {?}
- */
- firstDayOfYear : function() {
- return this._week.doy;
- },
- _invalidDate : "Invalid date",
- /**
- * @return {?}
- */
- invalidDate : function() {
- return this._invalidDate;
- }
- });
- /**
- * @param {string} input
- * @param {?} res
- * @param {(Function|string)} i
- * @param {Object} item
- * @return {?}
- */
- moment = function(input, res, i, item) {
- var config;
- return "boolean" == typeof i && (item = i, i = first), config = {}, config._isAMomentObject = true, config._i = input, config._f = res, config._l = i, config._strict = item, config._isUTC = false, config._pf = validateTransport(), makeMoment(config);
- };
- /** @type {boolean} */
- moment.suppressDeprecationWarnings = false;
- moment.createFromInputFallback = timeout("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.", function(config) {
- /** @type {Date} */
- config._d = new Date(config._i + (config._useUTC ? " UTC" : ""));
- });
- /**
- * @return {?}
- */
- moment.min = function() {
- /** @type {Array.<?>} */
- var size = [].slice.call(arguments, 0);
- return reduce("isBefore", size);
- };
- /**
- * @return {?}
- */
- moment.max = function() {
- /** @type {Array.<?>} */
- var size = [].slice.call(arguments, 0);
- return reduce("isAfter", size);
- };
- /**
- * @param {string} value
- * @param {?} date
- * @param {(Function|string)} n
- * @param {(Function|string)} name
- * @return {?}
- */
- moment.utc = function(value, date, n, name) {
- var config;
- return "boolean" == typeof n && (name = n, n = first), config = {}, config._isAMomentObject = true, config._useUTC = true, config._isUTC = true, config._l = n, config._i = value, config._f = date, config._strict = name, config._pf = validateTransport(), makeMoment(config).utc();
- };
- /**
- * @param {number} timestamp
- * @return {?}
- */
- moment.unix = function(timestamp) {
- return moment(1E3 * timestamp);
- };
- /**
- * @param {number} input
- * @param {?} key
- * @return {?}
- */
- moment.duration = function(input, key) {
- var sign;
- var ret;
- var parseIso;
- var d;
- /** @type {number} */
- var duration = input;
- /** @type {null} */
- var match = null;
- return moment.isDuration(input) ? duration = {
- ms : input._milliseconds,
- d : input._days,
- M : input._months
- } : "number" == typeof input ? (duration = {}, key ? duration[key] = input : duration.milliseconds = input) : (match = re.exec(input)) ? (sign = "-" === match[1] ? -1 : 1, duration = {
- y : 0,
- d : toInt(match[HOUR]) * sign,
- h : toInt(match[DATE]) * sign,
- m : toInt(match[SECOND]) * sign,
- s : toInt(match[MINUTE]) * sign,
- ms : toInt(match[MILLISECOND]) * sign
- }) : (match = string.exec(input)) ? (sign = "-" === match[1] ? -1 : 1, parseIso = function(inp) {
- var res = inp && parseFloat(inp.replace(",", "."));
- return(isNaN(res) ? 0 : res) * sign;
- }, duration = {
- y : parseIso(match[2]),
- M : parseIso(match[3]),
- d : parseIso(match[4]),
- h : parseIso(match[5]),
- m : parseIso(match[6]),
- s : parseIso(match[7]),
- w : parseIso(match[8])
- }) : null == duration ? duration = {} : "object" == typeof duration && (("from" in duration || "to" in duration) && (d = addNode(moment(duration.from), moment(duration.to)), duration = {}, duration.ms = d.milliseconds, duration.M = d.months)), ret = new Duration(duration), moment.isDuration(input) && (hasOwn(input, "_locale") && (ret._locale = input._locale)), ret;
- };
- /** @type {string} */
- moment.version = "2.9.0";
- /** @type {string} */
- moment.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ";
- /**
- * @return {undefined}
- */
- moment.ISO_8601 = function() {
- };
- /** @type {Array} */
- moment.momentProperties = keys;
- /**
- * @return {undefined}
- */
- moment.updateOffset = function() {
- };
- /**
- * @param {?} key
- * @param {?} val
- * @return {?}
- */
- moment.relativeTimeThreshold = function(key, val) {
- return data[key] === first ? false : val === first ? data[key] : (data[key] = val, true);
- };
- moment.lang = timeout("moment.lang is deprecated. Use moment.locale instead.", function(storageKey, type) {
- return moment.locale(storageKey, type);
- });
- /**
- * @param {?} key
- * @param {?} type
- * @return {?}
- */
- moment.locale = function(key, type) {
- var VERSION;
- return key && (VERSION = "undefined" != typeof type ? moment.defineLocale(key, type) : moment.localeData(key), VERSION && (moment.duration._locale = moment._locale = VERSION)), moment._locale._abbr;
- };
- /**
- * @param {?} key
- * @param {Object} elem
- * @return {?}
- */
- moment.defineLocale = function(key, elem) {
- return null !== elem ? (elem.abbr = key, languages[key] || (languages[key] = new Language), languages[key].set(elem), moment.locale(key), languages[key]) : (delete languages[key], null);
- };
- moment.langData = timeout("moment.langData is deprecated. Use moment.localeData instead.", function(input) {
- return moment.localeData(input);
- });
- /**
- * @param {Array} key
- * @return {?}
- */
- moment.localeData = function(key) {
- var result;
- if (key && (key._locale && (key._locale._abbr && (key = key._locale._abbr))), !key) {
- return moment._locale;
- }
- if (!isArray(key)) {
- if (result = test(key)) {
- return result;
- }
- /** @type {Array} */
- key = [key];
- }
- return check(key);
- };
- /**
- * @param {?} obj
- * @return {?}
- */
- moment.isMoment = function(obj) {
- return obj instanceof Moment || null != obj && hasOwn(obj, "_isAMomentObject");
- };
- /**
- * @param {number} obj
- * @return {?}
- */
- moment.isDuration = function(obj) {
- return obj instanceof Duration;
- };
- /** @type {number} */
- i = lists.length - 1;
- for (;i >= 0;--i) {
- makeList(lists[i]);
- }
- /**
- * @param {string} units
- * @return {?}
- */
- moment.normalizeUnits = function(units) {
- return normalizeUnits(units);
- };
- /**
- * @param {Object} flags
- * @return {?}
- */
- moment.invalid = function(flags) {
- var m = moment.utc(NaN);
- return null != flags ? extend(m._pf, flags) : m._pf.userInvalidated = true, m;
- };
- /**
- * @return {?}
- */
- moment.parseZone = function() {
- return moment.apply(null, arguments).parseZone();
- };
- /**
- * @param {string} input
- * @return {?}
- */
- moment.parseTwoDigitYear = function(input) {
- return toInt(input) + (toInt(input) > 68 ? 1900 : 2E3);
- };
- /** @type {function (?): ?} */
- moment.isDate = isDate;
- extend(moment.fn = Moment.prototype, {
- /**
- * @return {?}
- */
- clone : function() {
- return moment(this);
- },
- /**
- * @return {?}
- */
- valueOf : function() {
- return+this._d - 6E4 * (this._offset || 0);
- },
- /**
- * @return {?}
- */
- unix : function() {
- return Math.floor(+this / 1E3);
- },
- /**
- * @return {?}
- */
- toString : function() {
- return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ");
- },
- /**
- * @return {?}
- */
- toDate : function() {
- return this._offset ? new Date(+this) : this._d;
- },
- /**
- * @return {?}
- */
- toISOString : function() {
- var m = moment(this).utc();
- return 0 < m.year() && m.year() <= 9999 ? "function" == typeof Date.prototype.toISOString ? this.toDate().toISOString() : formatMoment(m, "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]") : formatMoment(m, "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]");
- },
- /**
- * @return {?}
- */
- toArray : function() {
- var m = this;
- return[m.year(), m.month(), m.date(), m.hours(), m.minutes(), m.seconds(), m.milliseconds()];
- },
- /**
- * @return {?}
- */
- isValid : function() {
- return isValid(this);
- },
- /**
- * @return {?}
- */
- isDSTShifted : function() {
- return this._a ? this.isValid() && compareArrays(this._a, (this._isUTC ? moment.utc(this._a) : moment(this._a)).toArray()) > 0 : false;
- },
- /**
- * @return {?}
- */
- parsingFlags : function() {
- return extend({}, this._pf);
- },
- /**
- * @return {?}
- */
- invalidAt : function() {
- return this._pf.overflow;
- },
- /**
- * @param {Object} value
- * @return {?}
- */
- utc : function(value) {
- return this.utcOffset(0, value);
- },
- /**
- * @param {Object} isXML
- * @return {?}
- */
- local : function(isXML) {
- return this._isUTC && (this.utcOffset(0, isXML), this._isUTC = false, isXML && this.subtract(this._dateUtcOffset(), "m")), this;
- },
- /**
- * @param {string} inputString
- * @return {?}
- */
- format : function(inputString) {
- var output = formatMoment(this, inputString || moment.defaultFormat);
- return this.localeData().postformat(output);
- },
- add : update(1, "add"),
- subtract : update(-1, "subtract"),
- /**
- * @param {string} input
- * @param {string} units
- * @param {boolean} asFloat
- * @return {?}
- */
- diff : function(input, units, asFloat) {
- var right;
- var output;
- var i = makeAs(input, this);
- /** @type {number} */
- var left = 6E4 * (i.utcOffset() - this.utcOffset());
- return units = normalizeUnits(units), "year" === units || ("month" === units || "quarter" === units) ? (output = push(this, i), "quarter" === units ? output /= 3 : "year" === units && (output /= 12)) : (right = this - i, output = "second" === units ? right / 1E3 : "minute" === units ? right / 6E4 : "hour" === units ? right / 36E5 : "day" === units ? (right - left) / 864E5 : "week" === units ? (right - left) / 6048E5 : right), asFloat ? output : absRound(output);
- },
- /**
- * @param {(number|string)} currency
- * @param {?} withoutSuffix
- * @return {?}
- */
- from : function(currency, withoutSuffix) {
- return moment.duration({
- to : this,
- from : currency
- }).locale(this.locale()).humanize(!withoutSuffix);
- },
- /**
- * @param {?} withoutSuffix
- * @return {?}
- */
- fromNow : function(withoutSuffix) {
- return this.from(moment(), withoutSuffix);
- },
- /**
- * @param {(Object|boolean|number|string)} key
- * @return {?}
- */
- calendar : function(key) {
- var input = key || moment();
- var sod = makeAs(input, this).startOf("day");
- var diff = this.diff(sod, "days", true);
- /** @type {string} */
- var format = -6 > diff ? "sameElse" : -1 > diff ? "lastWeek" : 0 > diff ? "lastDay" : 1 > diff ? "sameDay" : 2 > diff ? "nextDay" : 7 > diff ? "nextWeek" : "sameElse";
- return this.format(this.localeData().calendar(format, this, moment(input)));
- },
- /**
- * @return {?}
- */
- isLeapYear : function() {
- return isLeapYear(this.year());
- },
- /**
- * @return {?}
- */
- isDST : function() {
- return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset();
- },
- /**
- * @param {number} input
- * @return {?}
- */
- day : function(input) {
- var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
- return null != input ? (input = parseWeekday(input, this.localeData()), this.add(input - day, "d")) : day;
- },
- month : setTick("Month", true),
- /**
- * @param {string} units
- * @return {?}
- */
- startOf : function(units) {
- switch(units = normalizeUnits(units)) {
- case "year":
- this.month(0);
- case "quarter":
- ;
- case "month":
- this.date(1);
- case "week":
- ;
- case "isoWeek":
- ;
- case "day":
- this.hours(0);
- case "hour":
- this.minutes(0);
- case "minute":
- this.seconds(0);
- case "second":
- this.milliseconds(0);
- }
- return "week" === units ? this.weekday(0) : "isoWeek" === units && this.isoWeekday(1), "quarter" === units && this.month(3 * Math.floor(this.month() / 3)), this;
- },
- /**
- * @param {?} units
- * @return {?}
- */
- endOf : function(units) {
- return units = normalizeUnits(units), units === first || "millisecond" === units ? this : this.startOf(units).add(1, "isoWeek" === units ? "week" : units).subtract(1, "ms");
- },
- /**
- * @param {?} input
- * @param {number} units
- * @return {?}
- */
- isAfter : function(input, units) {
- var r;
- return units = normalizeUnits("undefined" != typeof units ? units : "millisecond"), "millisecond" === units ? (input = moment.isMoment(input) ? input : moment(input), +this > +input) : (r = moment.isMoment(input) ? +input : +moment(input), r < +this.clone().startOf(units));
- },
- /**
- * @param {string} input
- * @param {number} units
- * @return {?}
- */
- isBefore : function(input, units) {
- var length;
- return units = normalizeUnits("undefined" != typeof units ? units : "millisecond"), "millisecond" === units ? (input = moment.isMoment(input) ? input : moment(input), +input > +this) : (length = moment.isMoment(input) ? +input : +moment(input), +this.clone().endOf(units) < length);
- },
- /**
- * @param {?} a
- * @param {string} b
- * @param {number} units
- * @return {?}
- */
- isBetween : function(a, b, units) {
- return this.isAfter(a, units) && this.isBefore(b, units);
- },
- /**
- * @param {(Error|string)} input
- * @param {number} units
- * @return {?}
- */
- isSame : function(input, units) {
- var numChars;
- return units = normalizeUnits(units || "millisecond"), "millisecond" === units ? (input = moment.isMoment(input) ? input : moment(input), +this == +input) : (numChars = +moment(input), +this.clone().startOf(units) <= numChars && numChars <= +this.clone().endOf(units));
- },
- min : timeout("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548", function(memo) {
- return memo = moment.apply(null, arguments), this > memo ? this : memo;
- }),
- max : timeout("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548", function(other) {
- return other = moment.apply(null, arguments), other > this ? this : other;
- }),
- zone : timeout("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779", function(v, isXML) {
- return null != v ? ("string" != typeof v && (v = -v), this.utcOffset(v, isXML), this) : -this.utcOffset();
- }),
- /**
- * @param {number} offset
- * @param {Object} value
- * @return {?}
- */
- utcOffset : function(offset, value) {
- var node;
- var input = this._offset || 0;
- return null != offset ? ("string" == typeof offset && (offset = timezoneMinutesFromString(offset)), Math.abs(offset) < 16 && (offset = 60 * offset), !this._isUTC && (value && (node = this._dateUtcOffset())), this._offset = offset, this._isUTC = true, null != node && this.add(node, "m"), input !== offset && (!value || this._changeInProgress ? addOrSubtractDurationFromMoment(this, moment.duration(offset - input, "m"), 1, false) : this._changeInProgress || (this._changeInProgress = true, moment.updateOffset(this,
- true), this._changeInProgress = null)), this) : this._isUTC ? input : this._dateUtcOffset();
- },
- /**
- * @return {?}
- */
- isLocal : function() {
- return!this._isUTC;
- },
- /**
- * @return {?}
- */
- isUtcOffset : function() {
- return this._isUTC;
- },
- /**
- * @return {?}
- */
- isUtc : function() {
- return this._isUTC && 0 === this._offset;
- },
- /**
- * @return {?}
- */
- zoneAbbr : function() {
- return this._isUTC ? "UTC" : "";
- },
- /**
- * @return {?}
- */
- zoneName : function() {
- return this._isUTC ? "Coordinated Universal Time" : "";
- },
- /**
- * @return {?}
- */
- parseZone : function() {
- return this._tzm ? this.utcOffset(this._tzm) : "string" == typeof this._i && this.utcOffset(timezoneMinutesFromString(this._i)), this;
- },
- /**
- * @param {boolean} input
- * @return {?}
- */
- hasAlignedHourOffset : function(input) {
- return input = input ? moment(input).utcOffset() : 0, (this.utcOffset() - input) % 60 == 0;
- },
- /**
- * @return {?}
- */
- daysInMonth : function() {
- return daysInMonth(this.year(), this.month());
- },
- /**
- * @param {number} d
- * @return {?}
- */
- dayOfYear : function(d) {
- /** @type {number} */
- var b = parseInt((moment(this).startOf("day") - moment(this).startOf("year")) / 864E5) + 1;
- return null == d ? b : this.add(d - b, "d");
- },
- /**
- * @param {number} dataAndEvents
- * @return {?}
- */
- quarter : function(dataAndEvents) {
- return null == dataAndEvents ? Math.ceil((this.month() + 1) / 3) : this.month(3 * (dataAndEvents - 1) + this.month() % 3);
- },
- /**
- * @param {number} max
- * @return {?}
- */
- weekYear : function(max) {
- var min = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year;
- return null == max ? min : this.add(max - min, "y");
- },
- /**
- * @param {number} max
- * @return {?}
- */
- isoWeekYear : function(max) {
- var min = weekOfYear(this, 1, 4).year;
- return null == max ? min : this.add(max - min, "y");
- },
- /**
- * @param {number} t
- * @return {?}
- */
- week : function(t) {
- var b = this.localeData().week(this);
- return null == t ? b : this.add(7 * (t - b), "d");
- },
- /**
- * @param {number} max
- * @return {?}
- */
- isoWeek : function(max) {
- var min = weekOfYear(this, 1, 4).week;
- return null == max ? min : this.add(7 * (max - min), "d");
- },
- /**
- * @param {number} max
- * @return {?}
- */
- weekday : function(max) {
- /** @type {number} */
- var min = (this.day() + 7 - this.localeData()._week.dow) % 7;
- return null == max ? min : this.add(max - min, "d");
- },
- /**
- * @param {number} dataAndEvents
- * @return {?}
- */
- isoWeekday : function(dataAndEvents) {
- return null == dataAndEvents ? this.day() || 7 : this.day(this.day() % 7 ? dataAndEvents : dataAndEvents - 7);
- },
- /**
- * @return {?}
- */
- isoWeeksInYear : function() {
- return createDom(this.year(), 1, 4);
- },
- /**
- * @return {?}
- */
- weeksInYear : function() {
- var expectation = this.localeData()._week;
- return createDom(this.year(), expectation.dow, expectation.doy);
- },
- /**
- * @param {Object} owner
- * @return {?}
- */
- get : function(owner) {
- return owner = normalizeUnits(owner), this[owner]();
- },
- /**
- * @param {Object} owner
- * @param {string} value
- * @return {?}
- */
- set : function(owner, value) {
- var src;
- if ("object" == typeof owner) {
- for (src in owner) {
- this.set(src, owner[src]);
- }
- } else {
- owner = normalizeUnits(owner);
- if ("function" == typeof this[owner]) {
- this[owner](value);
- }
- }
- return this;
- },
- /**
- * @param {?} key
- * @return {?}
- */
- locale : function(key) {
- var camel;
- return key === first ? this._locale._abbr : (camel = moment.localeData(key), null != camel && (this._locale = camel), this);
- },
- lang : timeout("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.", function(key) {
- return key === first ? this.localeData() : this.locale(key);
- }),
- /**
- * @return {?}
- */
- localeData : function() {
- return this._locale;
- },
- /**
- * @return {?}
- */
- _dateUtcOffset : function() {
- return 15 * -Math.round(this._d.getTimezoneOffset() / 15);
- }
- });
- moment.fn.millisecond = moment.fn.milliseconds = setTick("Milliseconds", false);
- moment.fn.second = moment.fn.seconds = setTick("Seconds", false);
- moment.fn.minute = moment.fn.minutes = setTick("Minutes", false);
- moment.fn.hour = moment.fn.hours = setTick("Hours", true);
- moment.fn.date = setTick("Date", true);
- moment.fn.dates = timeout("dates accessor is deprecated. Use date instead.", setTick("Date", true));
- moment.fn.year = setTick("FullYear", true);
- moment.fn.years = timeout("years accessor is deprecated. Use year instead.", setTick("FullYear", true));
- moment.fn.days = moment.fn.day;
- moment.fn.months = moment.fn.month;
- moment.fn.weeks = moment.fn.week;
- moment.fn.isoWeeks = moment.fn.isoWeek;
- moment.fn.quarters = moment.fn.quarter;
- moment.fn.toJSON = moment.fn.toISOString;
- moment.fn.isUTC = moment.fn.isUtc;
- extend(moment.duration.fn = Duration.prototype, {
- /**
- * @return {undefined}
- */
- _bubble : function() {
- var seconds;
- var minutes;
- var hours;
- var milliseconds = this._milliseconds;
- var days = this._days;
- var months = this._months;
- var data = this._data;
- /** @type {number} */
- var years = 0;
- /** @type {number} */
- data.milliseconds = milliseconds % 1E3;
- seconds = absRound(milliseconds / 1E3);
- /** @type {number} */
- data.seconds = seconds % 60;
- minutes = absRound(seconds / 60);
- /** @type {number} */
- data.minutes = minutes % 60;
- hours = absRound(minutes / 60);
- /** @type {number} */
- data.hours = hours % 24;
- days += absRound(hours / 24);
- years = absRound(isNumeric(days));
- days -= absRound(randomId(years));
- months += absRound(days / 30);
- days %= 30;
- years += absRound(months / 12);
- months %= 12;
- data.days = days;
- data.months = months;
- data.years = years;
- },
- /**
- * @return {?}
- */
- abs : function() {
- return this._milliseconds = Math.abs(this._milliseconds), this._days = Math.abs(this._days), this._months = Math.abs(this._months), this._data.milliseconds = Math.abs(this._data.milliseconds), this._data.seconds = Math.abs(this._data.seconds), this._data.minutes = Math.abs(this._data.minutes), this._data.hours = Math.abs(this._data.hours), this._data.months = Math.abs(this._data.months), this._data.years = Math.abs(this._data.years), this;
- },
- /**
- * @return {?}
- */
- weeks : function() {
- return absRound(this.days() / 7);
- },
- /**
- * @return {?}
- */
- valueOf : function() {
- return this._milliseconds + 864E5 * this._days + this._months % 12 * 2592E6 + 31536E6 * toInt(this._months / 12);
- },
- /**
- * @param {boolean} lowFirstLetter
- * @return {?}
- */
- humanize : function(lowFirstLetter) {
- var output = preset(this, !lowFirstLetter, this.localeData());
- return lowFirstLetter && (output = this.localeData().pastFuture(+this, output)), this.localeData().postformat(output);
- },
- /**
- * @param {number} name
- * @param {?} val
- * @return {?}
- */
- add : function(name, val) {
- var dur = moment.duration(name, val);
- return this._milliseconds += dur._milliseconds, this._days += dur._days, this._months += dur._months, this._bubble(), this;
- },
- /**
- * @param {number} input
- * @param {?} val
- * @return {?}
- */
- subtract : function(input, val) {
- var dur = moment.duration(input, val);
- return this._milliseconds -= dur._milliseconds, this._days -= dur._days, this._months -= dur._months, this._bubble(), this;
- },
- /**
- * @param {Object} num
- * @return {?}
- */
- get : function(num) {
- return num = normalizeUnits(num), this[num.toLowerCase() + "s"]();
- },
- /**
- * @param {string} v
- * @return {?}
- */
- as : function(v) {
- var ch;
- var defValue;
- if (v = normalizeUnits(v), "month" === v || "year" === v) {
- return ch = this._days + this._milliseconds / 864E5, defValue = this._months + 12 * isNumeric(ch), "month" === v ? defValue : defValue / 12;
- }
- switch(ch = this._days + Math.round(randomId(this._months / 12)), v) {
- case "week":
- return ch / 7 + this._milliseconds / 6048E5;
- case "day":
- return ch + this._milliseconds / 864E5;
- case "hour":
- return 24 * ch + this._milliseconds / 36E5;
- case "minute":
- return 1440 * ch + this._milliseconds / 6E4;
- case "second":
- return 86400 * ch + this._milliseconds / 1E3;
- case "millisecond":
- return Math.floor(864E5 * ch) + this._milliseconds;
- default:
- throw new Error("Unknown unit " + v);;
- }
- },
- lang : moment.fn.lang,
- locale : moment.fn.locale,
- toIsoString : timeout("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)", function() {
- return this.toISOString();
- }),
- /**
- * @return {?}
- */
- toISOString : function() {
- /** @type {number} */
- var years = Math.abs(this.years());
- /** @type {number} */
- var months = Math.abs(this.months());
- /** @type {number} */
- var days = Math.abs(this.days());
- /** @type {number} */
- var hours = Math.abs(this.hours());
- /** @type {number} */
- var minutes = Math.abs(this.minutes());
- /** @type {number} */
- var seconds = Math.abs(this.seconds() + this.milliseconds() / 1E3);
- return this.asSeconds() ? (this.asSeconds() < 0 ? "-" : "") + "P" + (years ? years + "Y" : "") + (months ? months + "M" : "") + (days ? days + "D" : "") + (hours || (minutes || seconds) ? "T" : "") + (hours ? hours + "H" : "") + (minutes ? minutes + "M" : "") + (seconds ? seconds + "S" : "") : "P0D";
- },
- /**
- * @return {?}
- */
- localeData : function() {
- return this._locale;
- },
- /**
- * @return {?}
- */
- toJSON : function() {
- return this.toISOString();
- }
- });
- moment.duration.fn.toString = moment.duration.fn.toISOString;
- for (i in obj) {
- if (hasOwn(obj, i)) {
- makeDurationGetter(i.toLowerCase());
- }
- }
- /**
- * @return {?}
- */
- moment.duration.fn.asMilliseconds = function() {
- return this.as("ms");
- };
- /**
- * @return {?}
- */
- moment.duration.fn.asSeconds = function() {
- return this.as("s");
- };
- /**
- * @return {?}
- */
- moment.duration.fn.asMinutes = function() {
- return this.as("m");
- };
- /**
- * @return {?}
- */
- moment.duration.fn.asHours = function() {
- return this.as("h");
- };
- /**
- * @return {?}
- */
- moment.duration.fn.asDays = function() {
- return this.as("d");
- };
- /**
- * @return {?}
- */
- moment.duration.fn.asWeeks = function() {
- return this.as("weeks");
- };
- /**
- * @return {?}
- */
- moment.duration.fn.asMonths = function() {
- return this.as("M");
- };
- /**
- * @return {?}
- */
- moment.duration.fn.asYears = function() {
- return this.as("y");
- };
- moment.locale("en", {
- ordinalParse : /\d{1,2}(th|st|nd|rd)/,
- /**
- * @param {number} number
- * @return {?}
- */
- ordinal : function(number) {
- /** @type {number} */
- var b = number % 10;
- /** @type {string} */
- var output = 1 === toInt(number % 100 / 10) ? "th" : 1 === b ? "st" : 2 === b ? "nd" : 3 === b ? "rd" : "th";
- return number + output;
- }
- });
- if (sr) {
- /** @type {function (string, ?, (Function|string), Object): ?} */
- module.exports = moment;
- } else {
- if ("function" == typeof define && define.amd) {
- define(function(dataAndEvents, deepDataAndEvents, module) {
- return module.config && (module.config() && (module.config().noGlobal === true && (root.moment = previous_async))), moment;
- });
- clone(true);
- } else {
- clone();
- }
- }
- }.call(this);
- if (typeof String.prototype.startsWith != "function") {
- /**
- * @param {string} pattern
- * @return {?}
- */
- String.prototype.startsWith = function(pattern) {
- return this.indexOf(pattern) == 0;
- };
- }
- if (typeof String.prototype.format != "function") {
- /**
- * @param {string} args
- * @return {?}
- */
- String.prototype.format = function(args) {
- return this.replace(/{(\d+)}/g, function(match, which) {
- return typeof args[which] != "undefined" ? args[which] : match;
- });
- };
- }
- if (typeof Number.prototype.toFixedString != "function") {
- /**
- * @param {number} i
- * @return {?}
- */
- Number.prototype.toFixedString = function(i) {
- /** @type {number} */
- var s = Math.pow(10, i);
- /** @type {string} */
- var r = (this * s).toString();
- if (r && r.indexOf(".") > 0) {
- /** @type {string} */
- r = r.substring(0, r.indexOf(".") + i);
- } else {
- return this.toFixed(i);
- }
- return(Math.round(r) / s).toFixed(i);
- };
- }
- var CryptoJS = CryptoJS || function(Math, className) {
- var C = {};
- var C_lib = C.lib = {};
- /**
- * @return {undefined}
- */
- var F = function() {
- };
- var Base = C_lib.Base = {
- /**
- * @param {?} expectedNumberOfNonCommentArgs
- * @return {?}
- */
- extend : function(expectedNumberOfNonCommentArgs) {
- F.prototype = this;
- var subtype = new F;
- return expectedNumberOfNonCommentArgs && subtype.mixIn(expectedNumberOfNonCommentArgs), subtype.hasOwnProperty("init") || (subtype.init = function() {
- subtype.$super.init.apply(this, arguments);
- }), subtype.init.prototype = subtype, subtype.$super = this, subtype;
- },
- /**
- * @return {?}
- */
- create : function() {
- var recurring = this.extend();
- return recurring.init.apply(recurring, arguments), recurring;
- },
- /**
- * @return {undefined}
- */
- init : function() {
- },
- /**
- * @param {Object} properties
- * @return {undefined}
- */
- mixIn : function(properties) {
- var entry;
- for (entry in properties) {
- if (properties.hasOwnProperty(entry)) {
- this[entry] = properties[entry];
- }
- }
- if (properties.hasOwnProperty("toString")) {
- this.toString = properties.toString;
- }
- },
- /**
- * @return {?}
- */
- clone : function() {
- return this.init.prototype.extend(this);
- }
- };
- var nodes = C_lib.WordArray = Base.extend({
- /**
- * @param {Array} words
- * @param {number} c
- * @return {undefined}
- */
- init : function(words, c) {
- words = this.words = words || [];
- this.sigBytes = c != className ? c : 4 * words.length;
- },
- /**
- * @param {number} type
- * @return {?}
- */
- toString : function(type) {
- return(type || fx).stringify(this);
- },
- /**
- * @param {number} data
- * @return {?}
- */
- concat : function(data) {
- var recurring = this.words;
- var pending = data.words;
- var inner = this.sigBytes;
- var arr;
- if (data = data.sigBytes, this.clamp(), inner % 4) {
- /** @type {number} */
- arr = 0;
- for (;arr < data;arr++) {
- recurring[inner + arr >>> 2] |= (pending[arr >>> 2] >>> 24 - 8 * (arr % 4) & 255) << 24 - 8 * ((inner + arr) % 4);
- }
- } else {
- if (65535 < pending.length) {
- /** @type {number} */
- arr = 0;
- for (;arr < data;arr += 4) {
- recurring[inner + arr >>> 2] = pending[arr >>> 2];
- }
- } else {
- recurring.push.apply(recurring, pending);
- }
- }
- return this.sigBytes += data, this;
- },
- /**
- * @return {undefined}
- */
- clamp : function() {
- var words = this.words;
- var sigBytes = this.sigBytes;
- words[sigBytes >>> 2] &= 4294967295 << 32 - 8 * (sigBytes % 4);
- /** @type {number} */
- words.length = Math.ceil(sigBytes / 4);
- },
- /**
- * @return {?}
- */
- clone : function() {
- var sentence = Base.clone.call(this);
- return sentence.words = this.words.slice(0), sentence;
- },
- /**
- * @param {number} key
- * @return {?}
- */
- random : function(key) {
- /** @type {Array} */
- var expr = [];
- /** @type {number} */
- var leftKey = 0;
- for (;leftKey < key;leftKey += 4) {
- expr.push(4294967296 * Math.random() | 0);
- }
- return new nodes.init(expr, key);
- }
- });
- var C_enc = C.enc = {};
- var fx = C_enc.Hex = {
- /**
- * @param {number} wordArray
- * @return {?}
- */
- stringify : function(wordArray) {
- var words = wordArray.words;
- var tagNameArr;
- var i;
- var bite;
- wordArray = wordArray.sigBytes;
- /** @type {Array} */
- tagNameArr = [];
- /** @type {number} */
- i = 0;
- for (;i < wordArray;i++) {
- /** @type {number} */
- bite = words[i >>> 2] >>> 24 - 8 * (i % 4) & 255;
- tagNameArr.push((bite >>> 4).toString(16));
- tagNameArr.push((bite & 15).toString(16));
- }
- return tagNameArr.join("");
- },
- /**
- * @param {string} values
- * @return {?}
- */
- parse : function(values) {
- var valuesLen = values.length;
- /** @type {Array} */
- var selector = [];
- /** @type {number} */
- var i = 0;
- for (;i < valuesLen;i += 2) {
- selector[i >>> 3] |= parseInt(values.substr(i, 2), 16) << 24 - 4 * (i % 8);
- }
- return new nodes.init(selector, valuesLen / 2);
- }
- };
- var Latin1 = C_enc.Latin1 = {
- /**
- * @param {number} wordArray
- * @return {?}
- */
- stringify : function(wordArray) {
- var words = wordArray.words;
- var tagNameArr;
- var i;
- wordArray = wordArray.sigBytes;
- /** @type {Array} */
- tagNameArr = [];
- /** @type {number} */
- i = 0;
- for (;i < wordArray;i++) {
- tagNameArr.push(String.fromCharCode(words[i >>> 2] >>> 24 - 8 * (i % 4) & 255));
- }
- return tagNameArr.join("");
- },
- /**
- * @param {string} number
- * @return {?}
- */
- parse : function(number) {
- var n = number.length;
- /** @type {Array} */
- var selector = [];
- /** @type {number} */
- var i = 0;
- for (;i < n;i++) {
- selector[i >>> 2] |= (number.charCodeAt(i) & 255) << 24 - 8 * (i % 4);
- }
- return new nodes.init(selector, n);
- }
- };
- var fmt = C_enc.Utf8 = {
- /**
- * @param {number} wordArray
- * @return {?}
- */
- stringify : function(wordArray) {
- try {
- return decodeURIComponent(escape(Latin1.stringify(wordArray)));
- } catch (t) {
- throw Error("Malformed UTF-8 data");
- }
- },
- /**
- * @param {(Node|string)} text
- * @return {?}
- */
- parse : function(text) {
- return Latin1.parse(unescape(encodeURIComponent(text)));
- }
- };
- var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
- /**
- * @return {undefined}
- */
- reset : function() {
- this._data = new nodes.init;
- /** @type {number} */
- this._nDataBytes = 0;
- },
- /**
- * @param {string} data
- * @return {undefined}
- */
- _append : function(data) {
- if ("string" == typeof data) {
- data = fmt.parse(data);
- }
- this._data.concat(data);
- this._nDataBytes += data.sigBytes;
- },
- /**
- * @param {number} index
- * @return {?}
- */
- _process : function(index) {
- var data = this._data;
- var dataWords = data.words;
- var n = data.sigBytes;
- var c = this.blockSize;
- /** @type {number} */
- var value = n / (4 * c);
- /** @type {number} */
- value = index ? Math.ceil(value) : Math.max((value | 0) - this._minBufferSize, 0);
- var selector;
- if (index = value * c, n = Math.min(4 * index, n), index) {
- /** @type {number} */
- selector = 0;
- for (;selector < index;selector += c) {
- this._doProcessBlock(dataWords, selector);
- }
- selector = dataWords.splice(0, index);
- data.sigBytes -= n;
- }
- return new nodes.init(selector, n);
- },
- /**
- * @return {?}
- */
- clone : function() {
- var e = Base.clone.call(this);
- return e._data = this._data.clone(), e;
- },
- _minBufferSize : 0
- });
- var C_algo;
- return C_lib.Hasher = BufferedBlockAlgorithm.extend({
- cfg : Base.extend(),
- /**
- * @param {?} cfg
- * @return {undefined}
- */
- init : function(cfg) {
- this.cfg = this.cfg.extend(cfg);
- this.reset();
- },
- /**
- * @return {undefined}
- */
- reset : function() {
- BufferedBlockAlgorithm.reset.call(this);
- this._doReset();
- },
- /**
- * @param {string} messageUpdate
- * @return {?}
- */
- update : function(messageUpdate) {
- return this._append(messageUpdate), this._process(), this;
- },
- /**
- * @param {(number|string)} messageUpdate
- * @return {?}
- */
- finalize : function(messageUpdate) {
- return messageUpdate && this._append(messageUpdate), this._doFinalize();
- },
- blockSize : 16,
- /**
- * @param {Object} hasher
- * @return {?}
- */
- _createHelper : function(hasher) {
- return function(messageUpdate, cfg) {
- return(new hasher.init(cfg)).finalize(messageUpdate);
- };
- },
- /**
- * @param {Array} hasher
- * @return {?}
- */
- _createHmacHelper : function(hasher) {
- return function(messageUpdate, key) {
- return(new C_algo.HMAC.init(hasher, key)).finalize(messageUpdate);
- };
- }
- }), C_algo = C.algo = {}, C;
- }(Math);
- (function(Math) {
- /**
- * @param {number} a
- * @param {?} b
- * @param {?} c
- * @param {?} d
- * @param {?} item
- * @param {number} opt_attributes
- * @param {?} s
- * @return {?}
- */
- function md5_hh(a, b, c, d, item, opt_attributes, s) {
- return a = a + (b & c | ~b & d) + item + s, (a << opt_attributes | a >>> 32 - opt_attributes) + b;
- }
- /**
- * @param {number} a
- * @param {?} b
- * @param {?} c
- * @param {?} d
- * @param {?} item
- * @param {number} opt_attributes
- * @param {?} s
- * @return {?}
- */
- function md5_gg(a, b, c, d, item, opt_attributes, s) {
- return a = a + (b & d | c & ~d) + item + s, (a << opt_attributes | a >>> 32 - opt_attributes) + b;
- }
- /**
- * @param {number} a
- * @param {?} b
- * @param {?} c
- * @param {?} d
- * @param {?} item
- * @param {number} opt_attributes
- * @param {?} s
- * @return {?}
- */
- function md5_ii(a, b, c, d, item, opt_attributes, s) {
- return a = a + (b ^ c ^ d) + item + s, (a << opt_attributes | a >>> 32 - opt_attributes) + b;
- }
- /**
- * @param {number} a
- * @param {number} b
- * @param {?} c
- * @param {?} d
- * @param {?} item
- * @param {number} opt_attributes
- * @param {?} s
- * @return {?}
- */
- function md5_ff(a, b, c, d, item, opt_attributes, s) {
- return a = a + (c ^ (b | ~d)) + item + s, (a << opt_attributes | a >>> 32 - opt_attributes) + b;
- }
- var C = CryptoJS;
- var C_lib = C.lib;
- var WordArray = C_lib.WordArray;
- var Hasher = C_lib.Hasher;
- C_lib = C.algo;
- /** @type {Array} */
- var oSpace = [];
- /** @type {number} */
- var n = 0;
- for (;64 > n;n++) {
- /** @type {number} */
- oSpace[n] = 4294967296 * Math.abs(Math.sin(n + 1)) | 0;
- }
- C_lib = C_lib.MD5 = Hasher.extend({
- /**
- * @return {undefined}
- */
- _doReset : function() {
- this._hash = new WordArray.init([1732584193, 4023233417, 2562383102, 271733878]);
- },
- /**
- * @param {?} match
- * @param {number} x
- * @return {undefined}
- */
- _doProcessBlock : function(match, x) {
- var key;
- var val;
- /** @type {number} */
- var H = 0;
- for (;16 > H;H++) {
- key = x + H;
- val = match[key];
- /** @type {number} */
- match[key] = (val << 8 | val >>> 24) & 16711935 | (val << 24 | val >>> 8) & 4278255360;
- }
- H = this._hash.words;
- key = match[x + 0];
- val = match[x + 1];
- var token = match[x + 2];
- var string = match[x + 3];
- var expr = match[x + 4];
- var datum = match[x + 5];
- var compareFn = match[x + 6];
- var relativeToItem = match[x + 7];
- var activeItem = match[x + 8];
- var args = match[x + 9];
- var propName = match[x + 10];
- var iterator = match[x + 11];
- var oldItem = match[x + 12];
- var className = match[x + 13];
- var from = match[x + 14];
- var result = match[x + 15];
- var a = H[0];
- var b = H[1];
- var c = H[2];
- var d = H[3];
- a = md5_hh(a, b, c, d, key, 7, oSpace[0]);
- d = md5_hh(d, a, b, c, val, 12, oSpace[1]);
- c = md5_hh(c, d, a, b, token, 17, oSpace[2]);
- b = md5_hh(b, c, d, a, string, 22, oSpace[3]);
- a = md5_hh(a, b, c, d, expr, 7, oSpace[4]);
- d = md5_hh(d, a, b, c, datum, 12, oSpace[5]);
- c = md5_hh(c, d, a, b, compareFn, 17, oSpace[6]);
- b = md5_hh(b, c, d, a, relativeToItem, 22, oSpace[7]);
- a = md5_hh(a, b, c, d, activeItem, 7, oSpace[8]);
- d = md5_hh(d, a, b, c, args, 12, oSpace[9]);
- c = md5_hh(c, d, a, b, propName, 17, oSpace[10]);
- b = md5_hh(b, c, d, a, iterator, 22, oSpace[11]);
- a = md5_hh(a, b, c, d, oldItem, 7, oSpace[12]);
- d = md5_hh(d, a, b, c, className, 12, oSpace[13]);
- c = md5_hh(c, d, a, b, from, 17, oSpace[14]);
- b = md5_hh(b, c, d, a, result, 22, oSpace[15]);
- a = md5_gg(a, b, c, d, val, 5, oSpace[16]);
- d = md5_gg(d, a, b, c, compareFn, 9, oSpace[17]);
- c = md5_gg(c, d, a, b, iterator, 14, oSpace[18]);
- b = md5_gg(b, c, d, a, key, 20, oSpace[19]);
- a = md5_gg(a, b, c, d, datum, 5, oSpace[20]);
- d = md5_gg(d, a, b, c, propName, 9, oSpace[21]);
- c = md5_gg(c, d, a, b, result, 14, oSpace[22]);
- b = md5_gg(b, c, d, a, expr, 20, oSpace[23]);
- a = md5_gg(a, b, c, d, args, 5, oSpace[24]);
- d = md5_gg(d, a, b, c, from, 9, oSpace[25]);
- c = md5_gg(c, d, a, b, string, 14, oSpace[26]);
- b = md5_gg(b, c, d, a, activeItem, 20, oSpace[27]);
- a = md5_gg(a, b, c, d, className, 5, oSpace[28]);
- d = md5_gg(d, a, b, c, token, 9, oSpace[29]);
- c = md5_gg(c, d, a, b, relativeToItem, 14, oSpace[30]);
- b = md5_gg(b, c, d, a, oldItem, 20, oSpace[31]);
- a = md5_ii(a, b, c, d, datum, 4, oSpace[32]);
- d = md5_ii(d, a, b, c, activeItem, 11, oSpace[33]);
- c = md5_ii(c, d, a, b, iterator, 16, oSpace[34]);
- b = md5_ii(b, c, d, a, from, 23, oSpace[35]);
- a = md5_ii(a, b, c, d, val, 4, oSpace[36]);
- d = md5_ii(d, a, b, c, expr, 11, oSpace[37]);
- c = md5_ii(c, d, a, b, relativeToItem, 16, oSpace[38]);
- b = md5_ii(b, c, d, a, propName, 23, oSpace[39]);
- a = md5_ii(a, b, c, d, className, 4, oSpace[40]);
- d = md5_ii(d, a, b, c, key, 11, oSpace[41]);
- c = md5_ii(c, d, a, b, string, 16, oSpace[42]);
- b = md5_ii(b, c, d, a, compareFn, 23, oSpace[43]);
- a = md5_ii(a, b, c, d, args, 4, oSpace[44]);
- d = md5_ii(d, a, b, c, oldItem, 11, oSpace[45]);
- c = md5_ii(c, d, a, b, result, 16, oSpace[46]);
- b = md5_ii(b, c, d, a, token, 23, oSpace[47]);
- a = md5_ff(a, b, c, d, key, 6, oSpace[48]);
- d = md5_ff(d, a, b, c, relativeToItem, 10, oSpace[49]);
- c = md5_ff(c, d, a, b, from, 15, oSpace[50]);
- b = md5_ff(b, c, d, a, datum, 21, oSpace[51]);
- a = md5_ff(a, b, c, d, oldItem, 6, oSpace[52]);
- d = md5_ff(d, a, b, c, string, 10, oSpace[53]);
- c = md5_ff(c, d, a, b, propName, 15, oSpace[54]);
- b = md5_ff(b, c, d, a, val, 21, oSpace[55]);
- a = md5_ff(a, b, c, d, activeItem, 6, oSpace[56]);
- d = md5_ff(d, a, b, c, result, 10, oSpace[57]);
- c = md5_ff(c, d, a, b, compareFn, 15, oSpace[58]);
- b = md5_ff(b, c, d, a, className, 21, oSpace[59]);
- a = md5_ff(a, b, c, d, expr, 6, oSpace[60]);
- d = md5_ff(d, a, b, c, iterator, 10, oSpace[61]);
- c = md5_ff(c, d, a, b, token, 15, oSpace[62]);
- b = md5_ff(b, c, d, a, args, 21, oSpace[63]);
- /** @type {number} */
- H[0] = H[0] + a | 0;
- /** @type {number} */
- H[1] = H[1] + b | 0;
- /** @type {number} */
- H[2] = H[2] + c | 0;
- /** @type {number} */
- H[3] = H[3] + d | 0;
- },
- /**
- * @return {?}
- */
- _doFinalize : function() {
- var data = this._data;
- var target = data.words;
- /** @type {number} */
- var t = 8 * this._nDataBytes;
- /** @type {number} */
- var src = 8 * data.sigBytes;
- var w;
- target[src >>> 5] |= 128 << 24 - src % 32;
- /** @type {number} */
- w = Math.floor(t / 4294967296);
- /** @type {number} */
- target[(src + 64 >>> 9 << 4) + 15] = (w << 8 | w >>> 24) & 16711935 | (w << 24 | w >>> 8) & 4278255360;
- /** @type {number} */
- target[(src + 64 >>> 9 << 4) + 14] = (t << 8 | t >>> 24) & 16711935 | (t << 24 | t >>> 8) & 4278255360;
- /** @type {number} */
- data.sigBytes = 4 * (target.length + 1);
- this._process();
- data = this._hash;
- target = data.words;
- /** @type {number} */
- t = 0;
- for (;4 > t;t++) {
- src = target[t];
- /** @type {number} */
- target[t] = (src << 8 | src >>> 24) & 16711935 | (src << 24 | src >>> 8) & 4278255360;
- }
- return data;
- },
- /**
- * @return {?}
- */
- clone : function() {
- var hoverKeys = Hasher.clone.call(this);
- return hoverKeys._hash = this._hash.clone(), hoverKeys;
- }
- });
- C.MD5 = Hasher._createHelper(C_lib);
- C.HmacMD5 = Hasher._createHmacHelper(C_lib);
- })(Math);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement