--- /dev/null
+/*!\r
+ * jQuery JavaScript Library v3.6.0\r
+ * https://jquery.com/\r
+ *\r
+ * Includes Sizzle.js\r
+ * https://sizzlejs.com/\r
+ *\r
+ * Copyright OpenJS Foundation and other contributors\r
+ * Released under the MIT license\r
+ * https://jquery.org/license\r
+ *\r
+ * Date: 2021-03-02T17:08Z\r
+ */\r
+( function( global, factory ) {\r
+\r
+ "use strict";\r
+\r
+ if ( typeof module === "object" && typeof module.exports === "object" ) {\r
+\r
+ // For CommonJS and CommonJS-like environments where a proper `window`\r
+ // is present, execute the factory and get jQuery.\r
+ // For environments that do not have a `window` with a `document`\r
+ // (such as Node.js), expose a factory as module.exports.\r
+ // This accentuates the need for the creation of a real `window`.\r
+ // e.g. var jQuery = require("jquery")(window);\r
+ // See ticket #14549 for more info.\r
+ module.exports = global.document ?\r
+ factory( global, true ) :\r
+ function( w ) {\r
+ if ( !w.document ) {\r
+ throw new Error( "jQuery requires a window with a document" );\r
+ }\r
+ return factory( w );\r
+ };\r
+ } else {\r
+ factory( global );\r
+ }\r
+\r
+// Pass this if window is not defined yet\r
+} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {\r
+\r
+// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1\r
+// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode\r
+// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common\r
+// enough that all such attempts are guarded in a try block.\r
+"use strict";\r
+\r
+var arr = [];\r
+\r
+var getProto = Object.getPrototypeOf;\r
+\r
+var slice = arr.slice;\r
+\r
+var flat = arr.flat ? function( array ) {\r
+ return arr.flat.call( array );\r
+} : function( array ) {\r
+ return arr.concat.apply( [], array );\r
+};\r
+\r
+\r
+var push = arr.push;\r
+\r
+var indexOf = arr.indexOf;\r
+\r
+var class2type = {};\r
+\r
+var toString = class2type.toString;\r
+\r
+var hasOwn = class2type.hasOwnProperty;\r
+\r
+var fnToString = hasOwn.toString;\r
+\r
+var ObjectFunctionString = fnToString.call( Object );\r
+\r
+var support = {};\r
+\r
+var isFunction = function isFunction( obj ) {\r
+\r
+ // Support: Chrome <=57, Firefox <=52\r
+ // In some browsers, typeof returns "function" for HTML <object> elements\r
+ // (i.e., `typeof document.createElement( "object" ) === "function"`).\r
+ // We don't want to classify *any* DOM node as a function.\r
+ // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5\r
+ // Plus for old WebKit, typeof returns "function" for HTML collections\r
+ // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756)\r
+ return typeof obj === "function" && typeof obj.nodeType !== "number" &&\r
+ typeof obj.item !== "function";\r
+ };\r
+\r
+\r
+var isWindow = function isWindow( obj ) {\r
+ return obj != null && obj === obj.window;\r
+ };\r
+\r
+\r
+var document = window.document;\r
+\r
+\r
+\r
+ var preservedScriptAttributes = {\r
+ type: true,\r
+ src: true,\r
+ nonce: true,\r
+ noModule: true\r
+ };\r
+\r
+ function DOMEval( code, node, doc ) {\r
+ doc = doc || document;\r
+\r
+ var i, val,\r
+ script = doc.createElement( "script" );\r
+\r
+ script.text = code;\r
+ if ( node ) {\r
+ for ( i in preservedScriptAttributes ) {\r
+\r
+ // Support: Firefox 64+, Edge 18+\r
+ // Some browsers don't support the "nonce" property on scripts.\r
+ // On the other hand, just using `getAttribute` is not enough as\r
+ // the `nonce` attribute is reset to an empty string whenever it\r
+ // becomes browsing-context connected.\r
+ // See https://github.com/whatwg/html/issues/2369\r
+ // See https://html.spec.whatwg.org/#nonce-attributes\r
+ // The `node.getAttribute` check was added for the sake of\r
+ // `jQuery.globalEval` so that it can fake a nonce-containing node\r
+ // via an object.\r
+ val = node[ i ] || node.getAttribute && node.getAttribute( i );\r
+ if ( val ) {\r
+ script.setAttribute( i, val );\r
+ }\r
+ }\r
+ }\r
+ doc.head.appendChild( script ).parentNode.removeChild( script );\r
+ }\r
+\r
+\r
+function toType( obj ) {\r
+ if ( obj == null ) {\r
+ return obj + "";\r
+ }\r
+\r
+ // Support: Android <=2.3 only (functionish RegExp)\r
+ return typeof obj === "object" || typeof obj === "function" ?\r
+ class2type[ toString.call( obj ) ] || "object" :\r
+ typeof obj;\r
+}\r
+/* global Symbol */\r
+// Defining this global in .eslintrc.json would create a danger of using the global\r
+// unguarded in another place, it seems safer to define global only for this module\r
+\r
+\r
+\r
+var\r
+ version = "3.6.0",\r
+\r
+ // Define a local copy of jQuery\r
+ jQuery = function( selector, context ) {\r
+\r
+ // The jQuery object is actually just the init constructor 'enhanced'\r
+ // Need init if jQuery is called (just allow error to be thrown if not included)\r
+ return new jQuery.fn.init( selector, context );\r
+ };\r
+\r
+jQuery.fn = jQuery.prototype = {\r
+\r
+ // The current version of jQuery being used\r
+ jquery: version,\r
+\r
+ constructor: jQuery,\r
+\r
+ // The default length of a jQuery object is 0\r
+ length: 0,\r
+\r
+ toArray: function() {\r
+ return slice.call( this );\r
+ },\r
+\r
+ // Get the Nth element in the matched element set OR\r
+ // Get the whole matched element set as a clean array\r
+ get: function( num ) {\r
+\r
+ // Return all the elements in a clean array\r
+ if ( num == null ) {\r
+ return slice.call( this );\r
+ }\r
+\r
+ // Return just the one element from the set\r
+ return num < 0 ? this[ num + this.length ] : this[ num ];\r
+ },\r
+\r
+ // Take an array of elements and push it onto the stack\r
+ // (returning the new matched element set)\r
+ pushStack: function( elems ) {\r
+\r
+ // Build a new jQuery matched element set\r
+ var ret = jQuery.merge( this.constructor(), elems );\r
+\r
+ // Add the old object onto the stack (as a reference)\r
+ ret.prevObject = this;\r
+\r
+ // Return the newly-formed element set\r
+ return ret;\r
+ },\r
+\r
+ // Execute a callback for every element in the matched set.\r
+ each: function( callback ) {\r
+ return jQuery.each( this, callback );\r
+ },\r
+\r
+ map: function( callback ) {\r
+ return this.pushStack( jQuery.map( this, function( elem, i ) {\r
+ return callback.call( elem, i, elem );\r
+ } ) );\r
+ },\r
+\r
+ slice: function() {\r
+ return this.pushStack( slice.apply( this, arguments ) );\r
+ },\r
+\r
+ first: function() {\r
+ return this.eq( 0 );\r
+ },\r
+\r
+ last: function() {\r
+ return this.eq( -1 );\r
+ },\r
+\r
+ even: function() {\r
+ return this.pushStack( jQuery.grep( this, function( _elem, i ) {\r
+ return ( i + 1 ) % 2;\r
+ } ) );\r
+ },\r
+\r
+ odd: function() {\r
+ return this.pushStack( jQuery.grep( this, function( _elem, i ) {\r
+ return i % 2;\r
+ } ) );\r
+ },\r
+\r
+ eq: function( i ) {\r
+ var len = this.length,\r
+ j = +i + ( i < 0 ? len : 0 );\r
+ return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );\r
+ },\r
+\r
+ end: function() {\r
+ return this.prevObject || this.constructor();\r
+ },\r
+\r
+ // For internal use only.\r
+ // Behaves like an Array's method, not like a jQuery method.\r
+ push: push,\r
+ sort: arr.sort,\r
+ splice: arr.splice\r
+};\r
+\r
+jQuery.extend = jQuery.fn.extend = function() {\r
+ var options, name, src, copy, copyIsArray, clone,\r
+ target = arguments[ 0 ] || {},\r
+ i = 1,\r
+ length = arguments.length,\r
+ deep = false;\r
+\r
+ // Handle a deep copy situation\r
+ if ( typeof target === "boolean" ) {\r
+ deep = target;\r
+\r
+ // Skip the boolean and the target\r
+ target = arguments[ i ] || {};\r
+ i++;\r
+ }\r
+\r
+ // Handle case when target is a string or something (possible in deep copy)\r
+ if ( typeof target !== "object" && !isFunction( target ) ) {\r
+ target = {};\r
+ }\r
+\r
+ // Extend jQuery itself if only one argument is passed\r
+ if ( i === length ) {\r
+ target = this;\r
+ i--;\r
+ }\r
+\r
+ for ( ; i < length; i++ ) {\r
+\r
+ // Only deal with non-null/undefined values\r
+ if ( ( options = arguments[ i ] ) != null ) {\r
+\r
+ // Extend the base object\r
+ for ( name in options ) {\r
+ copy = options[ name ];\r
+\r
+ // Prevent Object.prototype pollution\r
+ // Prevent never-ending loop\r
+ if ( name === "__proto__" || target === copy ) {\r
+ continue;\r
+ }\r
+\r
+ // Recurse if we're merging plain objects or arrays\r
+ if ( deep && copy && ( jQuery.isPlainObject( copy ) ||\r
+ ( copyIsArray = Array.isArray( copy ) ) ) ) {\r
+ src = target[ name ];\r
+\r
+ // Ensure proper type for the source value\r
+ if ( copyIsArray && !Array.isArray( src ) ) {\r
+ clone = [];\r
+ } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {\r
+ clone = {};\r
+ } else {\r
+ clone = src;\r
+ }\r
+ copyIsArray = false;\r
+\r
+ // Never move original objects, clone them\r
+ target[ name ] = jQuery.extend( deep, clone, copy );\r
+\r
+ // Don't bring in undefined values\r
+ } else if ( copy !== undefined ) {\r
+ target[ name ] = copy;\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ // Return the modified object\r
+ return target;\r
+};\r
+\r
+jQuery.extend( {\r
+\r
+ // Unique for each copy of jQuery on the page\r
+ expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),\r
+\r
+ // Assume jQuery is ready without the ready module\r
+ isReady: true,\r
+\r
+ error: function( msg ) {\r
+ throw new Error( msg );\r
+ },\r
+\r
+ noop: function() {},\r
+\r
+ isPlainObject: function( obj ) {\r
+ var proto, Ctor;\r
+\r
+ // Detect obvious negatives\r
+ // Use toString instead of jQuery.type to catch host objects\r
+ if ( !obj || toString.call( obj ) !== "[object Object]" ) {\r
+ return false;\r
+ }\r
+\r
+ proto = getProto( obj );\r
+\r
+ // Objects with no prototype (e.g., `Object.create( null )`) are plain\r
+ if ( !proto ) {\r
+ return true;\r
+ }\r
+\r
+ // Objects with prototype are plain iff they were constructed by a global Object function\r
+ Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;\r
+ return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;\r
+ },\r
+\r
+ isEmptyObject: function( obj ) {\r
+ var name;\r
+\r
+ for ( name in obj ) {\r
+ return false;\r
+ }\r
+ return true;\r
+ },\r
+\r
+ // Evaluates a script in a provided context; falls back to the global one\r
+ // if not specified.\r
+ globalEval: function( code, options, doc ) {\r
+ DOMEval( code, { nonce: options && options.nonce }, doc );\r
+ },\r
+\r
+ each: function( obj, callback ) {\r
+ var length, i = 0;\r
+\r
+ if ( isArrayLike( obj ) ) {\r
+ length = obj.length;\r
+ for ( ; i < length; i++ ) {\r
+ if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\r
+ break;\r
+ }\r
+ }\r
+ } else {\r
+ for ( i in obj ) {\r
+ if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ return obj;\r
+ },\r
+\r
+ // results is for internal usage only\r
+ makeArray: function( arr, results ) {\r
+ var ret = results || [];\r
+\r
+ if ( arr != null ) {\r
+ if ( isArrayLike( Object( arr ) ) ) {\r
+ jQuery.merge( ret,\r
+ typeof arr === "string" ?\r
+ [ arr ] : arr\r
+ );\r
+ } else {\r
+ push.call( ret, arr );\r
+ }\r
+ }\r
+\r
+ return ret;\r
+ },\r
+\r
+ inArray: function( elem, arr, i ) {\r
+ return arr == null ? -1 : indexOf.call( arr, elem, i );\r
+ },\r
+\r
+ // Support: Android <=4.0 only, PhantomJS 1 only\r
+ // push.apply(_, arraylike) throws on ancient WebKit\r
+ merge: function( first, second ) {\r
+ var len = +second.length,\r
+ j = 0,\r
+ i = first.length;\r
+\r
+ for ( ; j < len; j++ ) {\r
+ first[ i++ ] = second[ j ];\r
+ }\r
+\r
+ first.length = i;\r
+\r
+ return first;\r
+ },\r
+\r
+ grep: function( elems, callback, invert ) {\r
+ var callbackInverse,\r
+ matches = [],\r
+ i = 0,\r
+ length = elems.length,\r
+ callbackExpect = !invert;\r
+\r
+ // Go through the array, only saving the items\r
+ // that pass the validator function\r
+ for ( ; i < length; i++ ) {\r
+ callbackInverse = !callback( elems[ i ], i );\r
+ if ( callbackInverse !== callbackExpect ) {\r
+ matches.push( elems[ i ] );\r
+ }\r
+ }\r
+\r
+ return matches;\r
+ },\r
+\r
+ // arg is for internal usage only\r
+ map: function( elems, callback, arg ) {\r
+ var length, value,\r
+ i = 0,\r
+ ret = [];\r
+\r
+ // Go through the array, translating each of the items to their new values\r
+ if ( isArrayLike( elems ) ) {\r
+ length = elems.length;\r
+ for ( ; i < length; i++ ) {\r
+ value = callback( elems[ i ], i, arg );\r
+\r
+ if ( value != null ) {\r
+ ret.push( value );\r
+ }\r
+ }\r
+\r
+ // Go through every key on the object,\r
+ } else {\r
+ for ( i in elems ) {\r
+ value = callback( elems[ i ], i, arg );\r
+\r
+ if ( value != null ) {\r
+ ret.push( value );\r
+ }\r
+ }\r
+ }\r
+\r
+ // Flatten any nested arrays\r
+ return flat( ret );\r
+ },\r
+\r
+ // A global GUID counter for objects\r
+ guid: 1,\r
+\r
+ // jQuery.support is not used in Core but other projects attach their\r
+ // properties to it so it needs to exist.\r
+ support: support\r
+} );\r
+\r
+if ( typeof Symbol === "function" ) {\r
+ jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];\r
+}\r
+\r
+// Populate the class2type map\r
+jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),\r
+ function( _i, name ) {\r
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();\r
+ } );\r
+\r
+function isArrayLike( obj ) {\r
+\r
+ // Support: real iOS 8.2 only (not reproducible in simulator)\r
+ // `in` check used to prevent JIT error (gh-2145)\r
+ // hasOwn isn't used here due to false negatives\r
+ // regarding Nodelist length in IE\r
+ var length = !!obj && "length" in obj && obj.length,\r
+ type = toType( obj );\r
+\r
+ if ( isFunction( obj ) || isWindow( obj ) ) {\r
+ return false;\r
+ }\r
+\r
+ return type === "array" || length === 0 ||\r
+ typeof length === "number" && length > 0 && ( length - 1 ) in obj;\r
+}\r
+var Sizzle =\r
+/*!\r
+ * Sizzle CSS Selector Engine v2.3.6\r
+ * https://sizzlejs.com/\r
+ *\r
+ * Copyright JS Foundation and other contributors\r
+ * Released under the MIT license\r
+ * https://js.foundation/\r
+ *\r
+ * Date: 2021-02-16\r
+ */\r
+( function( window ) {\r
+var i,\r
+ support,\r
+ Expr,\r
+ getText,\r
+ isXML,\r
+ tokenize,\r
+ compile,\r
+ select,\r
+ outermostContext,\r
+ sortInput,\r
+ hasDuplicate,\r
+\r
+ // Local document vars\r
+ setDocument,\r
+ document,\r
+ docElem,\r
+ documentIsHTML,\r
+ rbuggyQSA,\r
+ rbuggyMatches,\r
+ matches,\r
+ contains,\r
+\r
+ // Instance-specific data\r
+ expando = "sizzle" + 1 * new Date(),\r
+ preferredDoc = window.document,\r
+ dirruns = 0,\r
+ done = 0,\r
+ classCache = createCache(),\r
+ tokenCache = createCache(),\r
+ compilerCache = createCache(),\r
+ nonnativeSelectorCache = createCache(),\r
+ sortOrder = function( a, b ) {\r
+ if ( a === b ) {\r
+ hasDuplicate = true;\r
+ }\r
+ return 0;\r
+ },\r
+\r
+ // Instance methods\r
+ hasOwn = ( {} ).hasOwnProperty,\r
+ arr = [],\r
+ pop = arr.pop,\r
+ pushNative = arr.push,\r
+ push = arr.push,\r
+ slice = arr.slice,\r
+\r
+ // Use a stripped-down indexOf as it's faster than native\r
+ // https://jsperf.com/thor-indexof-vs-for/5\r
+ indexOf = function( list, elem ) {\r
+ var i = 0,\r
+ len = list.length;\r
+ for ( ; i < len; i++ ) {\r
+ if ( list[ i ] === elem ) {\r
+ return i;\r
+ }\r
+ }\r
+ return -1;\r
+ },\r
+\r
+ booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" +\r
+ "ismap|loop|multiple|open|readonly|required|scoped",\r
+\r
+ // Regular expressions\r
+\r
+ // http://www.w3.org/TR/css3-selectors/#whitespace\r
+ whitespace = "[\\x20\\t\\r\\n\\f]",\r
+\r
+ // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram\r
+ identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +\r
+ "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",\r
+\r
+ // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors\r
+ attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +\r
+\r
+ // Operator (capture 2)\r
+ "*([*^$|!~]?=)" + whitespace +\r
+\r
+ // "Attribute values must be CSS identifiers [capture 5]\r
+ // or strings [capture 3 or capture 4]"\r
+ "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +\r
+ whitespace + "*\\]",\r
+\r
+ pseudos = ":(" + identifier + ")(?:\\((" +\r
+\r
+ // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:\r
+ // 1. quoted (capture 3; capture 4 or capture 5)\r
+ "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +\r
+\r
+ // 2. simple (capture 6)\r
+ "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +\r
+\r
+ // 3. anything else (capture 2)\r
+ ".*" +\r
+ ")\\)|)",\r
+\r
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter\r
+ rwhitespace = new RegExp( whitespace + "+", "g" ),\r
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" +\r
+ whitespace + "+$", "g" ),\r
+\r
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),\r
+ rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +\r
+ "*" ),\r
+ rdescend = new RegExp( whitespace + "|>" ),\r
+\r
+ rpseudo = new RegExp( pseudos ),\r
+ ridentifier = new RegExp( "^" + identifier + "$" ),\r
+\r
+ matchExpr = {\r
+ "ID": new RegExp( "^#(" + identifier + ")" ),\r
+ "CLASS": new RegExp( "^\\.(" + identifier + ")" ),\r
+ "TAG": new RegExp( "^(" + identifier + "|[*])" ),\r
+ "ATTR": new RegExp( "^" + attributes ),\r
+ "PSEUDO": new RegExp( "^" + pseudos ),\r
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +\r
+ whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +\r
+ whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),\r
+ "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),\r
+\r
+ // For use in libraries implementing .is()\r
+ // We use this for POS matching in `select`\r
+ "needsContext": new RegExp( "^" + whitespace +\r
+ "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +\r
+ "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )\r
+ },\r
+\r
+ rhtml = /HTML$/i,\r
+ rinputs = /^(?:input|select|textarea|button)$/i,\r
+ rheader = /^h\d$/i,\r
+\r
+ rnative = /^[^{]+\{\s*\[native \w/,\r
+\r
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors\r
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,\r
+\r
+ rsibling = /[+~]/,\r
+\r
+ // CSS escapes\r
+ // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters\r
+ runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ),\r
+ funescape = function( escape, nonHex ) {\r
+ var high = "0x" + escape.slice( 1 ) - 0x10000;\r
+\r
+ return nonHex ?\r
+\r
+ // Strip the backslash prefix from a non-hex escape sequence\r
+ nonHex :\r
+\r
+ // Replace a hexadecimal escape sequence with the encoded Unicode code point\r
+ // Support: IE <=11+\r
+ // For values outside the Basic Multilingual Plane (BMP), manually construct a\r
+ // surrogate pair\r
+ high < 0 ?\r
+ String.fromCharCode( high + 0x10000 ) :\r
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );\r
+ },\r
+\r
+ // CSS string/identifier serialization\r
+ // https://drafts.csswg.org/cssom/#common-serializing-idioms\r
+ rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,\r
+ fcssescape = function( ch, asCodePoint ) {\r
+ if ( asCodePoint ) {\r
+\r
+ // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER\r
+ if ( ch === "\0" ) {\r
+ return "\uFFFD";\r
+ }\r
+\r
+ // Control characters and (dependent upon position) numbers get escaped as code points\r
+ return ch.slice( 0, -1 ) + "\\" +\r
+ ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";\r
+ }\r
+\r
+ // Other potentially-special ASCII characters get backslash-escaped\r
+ return "\\" + ch;\r
+ },\r
+\r
+ // Used for iframes\r
+ // See setDocument()\r
+ // Removing the function wrapper causes a "Permission Denied"\r
+ // error in IE\r
+ unloadHandler = function() {\r
+ setDocument();\r
+ },\r
+\r
+ inDisabledFieldset = addCombinator(\r
+ function( elem ) {\r
+ return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";\r
+ },\r
+ { dir: "parentNode", next: "legend" }\r
+ );\r
+\r
+// Optimize for push.apply( _, NodeList )\r
+try {\r
+ push.apply(\r
+ ( arr = slice.call( preferredDoc.childNodes ) ),\r
+ preferredDoc.childNodes\r
+ );\r
+\r
+ // Support: Android<4.0\r
+ // Detect silently failing push.apply\r
+ // eslint-disable-next-line no-unused-expressions\r
+ arr[ preferredDoc.childNodes.length ].nodeType;\r
+} catch ( e ) {\r
+ push = { apply: arr.length ?\r
+\r
+ // Leverage slice if possible\r
+ function( target, els ) {\r
+ pushNative.apply( target, slice.call( els ) );\r
+ } :\r
+\r
+ // Support: IE<9\r
+ // Otherwise append directly\r
+ function( target, els ) {\r
+ var j = target.length,\r
+ i = 0;\r
+\r
+ // Can't trust NodeList.length\r
+ while ( ( target[ j++ ] = els[ i++ ] ) ) {}\r
+ target.length = j - 1;\r
+ }\r
+ };\r
+}\r
+\r
+function Sizzle( selector, context, results, seed ) {\r
+ var m, i, elem, nid, match, groups, newSelector,\r
+ newContext = context && context.ownerDocument,\r
+\r
+ // nodeType defaults to 9, since context defaults to document\r
+ nodeType = context ? context.nodeType : 9;\r
+\r
+ results = results || [];\r
+\r
+ // Return early from calls with invalid selector or context\r
+ if ( typeof selector !== "string" || !selector ||\r
+ nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {\r
+\r
+ return results;\r
+ }\r
+\r
+ // Try to shortcut find operations (as opposed to filters) in HTML documents\r
+ if ( !seed ) {\r
+ setDocument( context );\r
+ context = context || document;\r
+\r
+ if ( documentIsHTML ) {\r
+\r
+ // If the selector is sufficiently simple, try using a "get*By*" DOM method\r
+ // (excepting DocumentFragment context, where the methods don't exist)\r
+ if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {\r
+\r
+ // ID selector\r
+ if ( ( m = match[ 1 ] ) ) {\r
+\r
+ // Document context\r
+ if ( nodeType === 9 ) {\r
+ if ( ( elem = context.getElementById( m ) ) ) {\r
+\r
+ // Support: IE, Opera, Webkit\r
+ // TODO: identify versions\r
+ // getElementById can match elements by name instead of ID\r
+ if ( elem.id === m ) {\r
+ results.push( elem );\r
+ return results;\r
+ }\r
+ } else {\r
+ return results;\r
+ }\r
+\r
+ // Element context\r
+ } else {\r
+\r
+ // Support: IE, Opera, Webkit\r
+ // TODO: identify versions\r
+ // getElementById can match elements by name instead of ID\r
+ if ( newContext && ( elem = newContext.getElementById( m ) ) &&\r
+ contains( context, elem ) &&\r
+ elem.id === m ) {\r
+\r
+ results.push( elem );\r
+ return results;\r
+ }\r
+ }\r
+\r
+ // Type selector\r
+ } else if ( match[ 2 ] ) {\r
+ push.apply( results, context.getElementsByTagName( selector ) );\r
+ return results;\r
+\r
+ // Class selector\r
+ } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&\r
+ context.getElementsByClassName ) {\r
+\r
+ push.apply( results, context.getElementsByClassName( m ) );\r
+ return results;\r
+ }\r
+ }\r
+\r
+ // Take advantage of querySelectorAll\r
+ if ( support.qsa &&\r
+ !nonnativeSelectorCache[ selector + " " ] &&\r
+ ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&\r
+\r
+ // Support: IE 8 only\r
+ // Exclude object elements\r
+ ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) {\r
+\r
+ newSelector = selector;\r
+ newContext = context;\r
+\r
+ // qSA considers elements outside a scoping root when evaluating child or\r
+ // descendant combinators, which is not what we want.\r
+ // In such cases, we work around the behavior by prefixing every selector in the\r
+ // list with an ID selector referencing the scope context.\r
+ // The technique has to be used as well when a leading combinator is used\r
+ // as such selectors are not recognized by querySelectorAll.\r
+ // Thanks to Andrew Dupont for this technique.\r
+ if ( nodeType === 1 &&\r
+ ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {\r
+\r
+ // Expand context for sibling selectors\r
+ newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||\r
+ context;\r
+\r
+ // We can use :scope instead of the ID hack if the browser\r
+ // supports it & if we're not changing the context.\r
+ if ( newContext !== context || !support.scope ) {\r
+\r
+ // Capture the context ID, setting it first if necessary\r
+ if ( ( nid = context.getAttribute( "id" ) ) ) {\r
+ nid = nid.replace( rcssescape, fcssescape );\r
+ } else {\r
+ context.setAttribute( "id", ( nid = expando ) );\r
+ }\r
+ }\r
+\r
+ // Prefix every selector in the list\r
+ groups = tokenize( selector );\r
+ i = groups.length;\r
+ while ( i-- ) {\r
+ groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +\r
+ toSelector( groups[ i ] );\r
+ }\r
+ newSelector = groups.join( "," );\r
+ }\r
+\r
+ try {\r
+ push.apply( results,\r
+ newContext.querySelectorAll( newSelector )\r
+ );\r
+ return results;\r
+ } catch ( qsaError ) {\r
+ nonnativeSelectorCache( selector, true );\r
+ } finally {\r
+ if ( nid === expando ) {\r
+ context.removeAttribute( "id" );\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ // All others\r
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );\r
+}\r
+\r
+/**\r
+ * Create key-value caches of limited size\r
+ * @returns {function(string, object)} Returns the Object data after storing it on itself with\r
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)\r
+ * deleting the oldest entry\r
+ */\r
+function createCache() {\r
+ var keys = [];\r
+\r
+ function cache( key, value ) {\r
+\r
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)\r
+ if ( keys.push( key + " " ) > Expr.cacheLength ) {\r
+\r
+ // Only keep the most recent entries\r
+ delete cache[ keys.shift() ];\r
+ }\r
+ return ( cache[ key + " " ] = value );\r
+ }\r
+ return cache;\r
+}\r
+\r
+/**\r
+ * Mark a function for special use by Sizzle\r
+ * @param {Function} fn The function to mark\r
+ */\r
+function markFunction( fn ) {\r
+ fn[ expando ] = true;\r
+ return fn;\r
+}\r
+\r
+/**\r
+ * Support testing using an element\r
+ * @param {Function} fn Passed the created element and returns a boolean result\r
+ */\r
+function assert( fn ) {\r
+ var el = document.createElement( "fieldset" );\r
+\r
+ try {\r
+ return !!fn( el );\r
+ } catch ( e ) {\r
+ return false;\r
+ } finally {\r
+\r
+ // Remove from its parent by default\r
+ if ( el.parentNode ) {\r
+ el.parentNode.removeChild( el );\r
+ }\r
+\r
+ // release memory in IE\r
+ el = null;\r
+ }\r
+}\r
+\r
+/**\r
+ * Adds the same handler for all of the specified attrs\r
+ * @param {String} attrs Pipe-separated list of attributes\r
+ * @param {Function} handler The method that will be applied\r
+ */\r
+function addHandle( attrs, handler ) {\r
+ var arr = attrs.split( "|" ),\r
+ i = arr.length;\r
+\r
+ while ( i-- ) {\r
+ Expr.attrHandle[ arr[ i ] ] = handler;\r
+ }\r
+}\r
+\r
+/**\r
+ * Checks document order of two siblings\r
+ * @param {Element} a\r
+ * @param {Element} b\r
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b\r
+ */\r
+function siblingCheck( a, b ) {\r
+ var cur = b && a,\r
+ diff = cur && a.nodeType === 1 && b.nodeType === 1 &&\r
+ a.sourceIndex - b.sourceIndex;\r
+\r
+ // Use IE sourceIndex if available on both nodes\r
+ if ( diff ) {\r
+ return diff;\r
+ }\r
+\r
+ // Check if b follows a\r
+ if ( cur ) {\r
+ while ( ( cur = cur.nextSibling ) ) {\r
+ if ( cur === b ) {\r
+ return -1;\r
+ }\r
+ }\r
+ }\r
+\r
+ return a ? 1 : -1;\r
+}\r
+\r
+/**\r
+ * Returns a function to use in pseudos for input types\r
+ * @param {String} type\r
+ */\r
+function createInputPseudo( type ) {\r
+ return function( elem ) {\r
+ var name = elem.nodeName.toLowerCase();\r
+ return name === "input" && elem.type === type;\r
+ };\r
+}\r
+\r
+/**\r
+ * Returns a function to use in pseudos for buttons\r
+ * @param {String} type\r
+ */\r
+function createButtonPseudo( type ) {\r
+ return function( elem ) {\r
+ var name = elem.nodeName.toLowerCase();\r
+ return ( name === "input" || name === "button" ) && elem.type === type;\r
+ };\r
+}\r
+\r
+/**\r
+ * Returns a function to use in pseudos for :enabled/:disabled\r
+ * @param {Boolean} disabled true for :disabled; false for :enabled\r
+ */\r
+function createDisabledPseudo( disabled ) {\r
+\r
+ // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable\r
+ return function( elem ) {\r
+\r
+ // Only certain elements can match :enabled or :disabled\r
+ // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled\r
+ // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled\r
+ if ( "form" in elem ) {\r
+\r
+ // Check for inherited disabledness on relevant non-disabled elements:\r
+ // * listed form-associated elements in a disabled fieldset\r
+ // https://html.spec.whatwg.org/multipage/forms.html#category-listed\r
+ // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled\r
+ // * option elements in a disabled optgroup\r
+ // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled\r
+ // All such elements have a "form" property.\r
+ if ( elem.parentNode && elem.disabled === false ) {\r
+\r
+ // Option elements defer to a parent optgroup if present\r
+ if ( "label" in elem ) {\r
+ if ( "label" in elem.parentNode ) {\r
+ return elem.parentNode.disabled === disabled;\r
+ } else {\r
+ return elem.disabled === disabled;\r
+ }\r
+ }\r
+\r
+ // Support: IE 6 - 11\r
+ // Use the isDisabled shortcut property to check for disabled fieldset ancestors\r
+ return elem.isDisabled === disabled ||\r
+\r
+ // Where there is no isDisabled, check manually\r
+ /* jshint -W018 */\r
+ elem.isDisabled !== !disabled &&\r
+ inDisabledFieldset( elem ) === disabled;\r
+ }\r
+\r
+ return elem.disabled === disabled;\r
+\r
+ // Try to winnow out elements that can't be disabled before trusting the disabled property.\r
+ // Some victims get caught in our net (label, legend, menu, track), but it shouldn't\r
+ // even exist on them, let alone have a boolean value.\r
+ } else if ( "label" in elem ) {\r
+ return elem.disabled === disabled;\r
+ }\r
+\r
+ // Remaining elements are neither :enabled nor :disabled\r
+ return false;\r
+ };\r
+}\r
+\r
+/**\r
+ * Returns a function to use in pseudos for positionals\r
+ * @param {Function} fn\r
+ */\r
+function createPositionalPseudo( fn ) {\r
+ return markFunction( function( argument ) {\r
+ argument = +argument;\r
+ return markFunction( function( seed, matches ) {\r
+ var j,\r
+ matchIndexes = fn( [], seed.length, argument ),\r
+ i = matchIndexes.length;\r
+\r
+ // Match elements found at the specified indexes\r
+ while ( i-- ) {\r
+ if ( seed[ ( j = matchIndexes[ i ] ) ] ) {\r
+ seed[ j ] = !( matches[ j ] = seed[ j ] );\r
+ }\r
+ }\r
+ } );\r
+ } );\r
+}\r
+\r
+/**\r
+ * Checks a node for validity as a Sizzle context\r
+ * @param {Element|Object=} context\r
+ * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value\r
+ */\r
+function testContext( context ) {\r
+ return context && typeof context.getElementsByTagName !== "undefined" && context;\r
+}\r
+\r
+// Expose support vars for convenience\r
+support = Sizzle.support = {};\r
+\r
+/**\r
+ * Detects XML nodes\r
+ * @param {Element|Object} elem An element or a document\r
+ * @returns {Boolean} True iff elem is a non-HTML XML node\r
+ */\r
+isXML = Sizzle.isXML = function( elem ) {\r
+ var namespace = elem && elem.namespaceURI,\r
+ docElem = elem && ( elem.ownerDocument || elem ).documentElement;\r
+\r
+ // Support: IE <=8\r
+ // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes\r
+ // https://bugs.jquery.com/ticket/4833\r
+ return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );\r
+};\r
+\r
+/**\r
+ * Sets document-related variables once based on the current document\r
+ * @param {Element|Object} [doc] An element or document object to use to set the document\r
+ * @returns {Object} Returns the current document\r
+ */\r
+setDocument = Sizzle.setDocument = function( node ) {\r
+ var hasCompare, subWindow,\r
+ doc = node ? node.ownerDocument || node : preferredDoc;\r
+\r
+ // Return early if doc is invalid or already selected\r
+ // Support: IE 11+, Edge 17 - 18+\r
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing\r
+ // two documents; shallow comparisons work.\r
+ // eslint-disable-next-line eqeqeq\r
+ if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {\r
+ return document;\r
+ }\r
+\r
+ // Update global variables\r
+ document = doc;\r
+ docElem = document.documentElement;\r
+ documentIsHTML = !isXML( document );\r
+\r
+ // Support: IE 9 - 11+, Edge 12 - 18+\r
+ // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)\r
+ // Support: IE 11+, Edge 17 - 18+\r
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing\r
+ // two documents; shallow comparisons work.\r
+ // eslint-disable-next-line eqeqeq\r
+ if ( preferredDoc != document &&\r
+ ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {\r
+\r
+ // Support: IE 11, Edge\r
+ if ( subWindow.addEventListener ) {\r
+ subWindow.addEventListener( "unload", unloadHandler, false );\r
+\r
+ // Support: IE 9 - 10 only\r
+ } else if ( subWindow.attachEvent ) {\r
+ subWindow.attachEvent( "onunload", unloadHandler );\r
+ }\r
+ }\r
+\r
+ // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,\r
+ // Safari 4 - 5 only, Opera <=11.6 - 12.x only\r
+ // IE/Edge & older browsers don't support the :scope pseudo-class.\r
+ // Support: Safari 6.0 only\r
+ // Safari 6.0 supports :scope but it's an alias of :root there.\r
+ support.scope = assert( function( el ) {\r
+ docElem.appendChild( el ).appendChild( document.createElement( "div" ) );\r
+ return typeof el.querySelectorAll !== "undefined" &&\r
+ !el.querySelectorAll( ":scope fieldset div" ).length;\r
+ } );\r
+\r
+ /* Attributes\r
+ ---------------------------------------------------------------------- */\r
+\r
+ // Support: IE<8\r
+ // Verify that getAttribute really returns attributes and not properties\r
+ // (excepting IE8 booleans)\r
+ support.attributes = assert( function( el ) {\r
+ el.className = "i";\r
+ return !el.getAttribute( "className" );\r
+ } );\r
+\r
+ /* getElement(s)By*\r
+ ---------------------------------------------------------------------- */\r
+\r
+ // Check if getElementsByTagName("*") returns only elements\r
+ support.getElementsByTagName = assert( function( el ) {\r
+ el.appendChild( document.createComment( "" ) );\r
+ return !el.getElementsByTagName( "*" ).length;\r
+ } );\r
+\r
+ // Support: IE<9\r
+ support.getElementsByClassName = rnative.test( document.getElementsByClassName );\r
+\r
+ // Support: IE<10\r
+ // Check if getElementById returns elements by name\r
+ // The broken getElementById methods don't pick up programmatically-set names,\r
+ // so use a roundabout getElementsByName test\r
+ support.getById = assert( function( el ) {\r
+ docElem.appendChild( el ).id = expando;\r
+ return !document.getElementsByName || !document.getElementsByName( expando ).length;\r
+ } );\r
+\r
+ // ID filter and find\r
+ if ( support.getById ) {\r
+ Expr.filter[ "ID" ] = function( id ) {\r
+ var attrId = id.replace( runescape, funescape );\r
+ return function( elem ) {\r
+ return elem.getAttribute( "id" ) === attrId;\r
+ };\r
+ };\r
+ Expr.find[ "ID" ] = function( id, context ) {\r
+ if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {\r
+ var elem = context.getElementById( id );\r
+ return elem ? [ elem ] : [];\r
+ }\r
+ };\r
+ } else {\r
+ Expr.filter[ "ID" ] = function( id ) {\r
+ var attrId = id.replace( runescape, funescape );\r
+ return function( elem ) {\r
+ var node = typeof elem.getAttributeNode !== "undefined" &&\r
+ elem.getAttributeNode( "id" );\r
+ return node && node.value === attrId;\r
+ };\r
+ };\r
+\r
+ // Support: IE 6 - 7 only\r
+ // getElementById is not reliable as a find shortcut\r
+ Expr.find[ "ID" ] = function( id, context ) {\r
+ if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {\r
+ var node, i, elems,\r
+ elem = context.getElementById( id );\r
+\r
+ if ( elem ) {\r
+\r
+ // Verify the id attribute\r
+ node = elem.getAttributeNode( "id" );\r
+ if ( node && node.value === id ) {\r
+ return [ elem ];\r
+ }\r
+\r
+ // Fall back on getElementsByName\r
+ elems = context.getElementsByName( id );\r
+ i = 0;\r
+ while ( ( elem = elems[ i++ ] ) ) {\r
+ node = elem.getAttributeNode( "id" );\r
+ if ( node && node.value === id ) {\r
+ return [ elem ];\r
+ }\r
+ }\r
+ }\r
+\r
+ return [];\r
+ }\r
+ };\r
+ }\r
+\r
+ // Tag\r
+ Expr.find[ "TAG" ] = support.getElementsByTagName ?\r
+ function( tag, context ) {\r
+ if ( typeof context.getElementsByTagName !== "undefined" ) {\r
+ return context.getElementsByTagName( tag );\r
+\r
+ // DocumentFragment nodes don't have gEBTN\r
+ } else if ( support.qsa ) {\r
+ return context.querySelectorAll( tag );\r
+ }\r
+ } :\r
+\r
+ function( tag, context ) {\r
+ var elem,\r
+ tmp = [],\r
+ i = 0,\r
+\r
+ // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too\r
+ results = context.getElementsByTagName( tag );\r
+\r
+ // Filter out possible comments\r
+ if ( tag === "*" ) {\r
+ while ( ( elem = results[ i++ ] ) ) {\r
+ if ( elem.nodeType === 1 ) {\r
+ tmp.push( elem );\r
+ }\r
+ }\r
+\r
+ return tmp;\r
+ }\r
+ return results;\r
+ };\r
+\r
+ // Class\r
+ Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) {\r
+ if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {\r
+ return context.getElementsByClassName( className );\r
+ }\r
+ };\r
+\r
+ /* QSA/matchesSelector\r
+ ---------------------------------------------------------------------- */\r
+\r
+ // QSA and matchesSelector support\r
+\r
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)\r
+ rbuggyMatches = [];\r
+\r
+ // qSa(:focus) reports false when true (Chrome 21)\r
+ // We allow this because of a bug in IE8/9 that throws an error\r
+ // whenever `document.activeElement` is accessed on an iframe\r
+ // So, we allow :focus to pass through QSA all the time to avoid the IE error\r
+ // See https://bugs.jquery.com/ticket/13378\r
+ rbuggyQSA = [];\r
+\r
+ if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {\r
+\r
+ // Build QSA regex\r
+ // Regex strategy adopted from Diego Perini\r
+ assert( function( el ) {\r
+\r
+ var input;\r
+\r
+ // Select is set to empty string on purpose\r
+ // This is to test IE's treatment of not explicitly\r
+ // setting a boolean content attribute,\r
+ // since its presence should be enough\r
+ // https://bugs.jquery.com/ticket/12359\r
+ docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +\r
+ "<select id='" + expando + "-\r\\' msallowcapture=''>" +\r
+ "<option selected=''></option></select>";\r
+\r
+ // Support: IE8, Opera 11-12.16\r
+ // Nothing should be selected when empty strings follow ^= or $= or *=\r
+ // The test attribute must be unknown in Opera but "safe" for WinRT\r
+ // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section\r
+ if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) {\r
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );\r
+ }\r
+\r
+ // Support: IE8\r
+ // Boolean attributes and "value" are not treated correctly\r
+ if ( !el.querySelectorAll( "[selected]" ).length ) {\r
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );\r
+ }\r
+\r
+ // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+\r
+ if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {\r
+ rbuggyQSA.push( "~=" );\r
+ }\r
+\r
+ // Support: IE 11+, Edge 15 - 18+\r
+ // IE 11/Edge don't find elements on a `[name='']` query in some cases.\r
+ // Adding a temporary attribute to the document before the selection works\r
+ // around the issue.\r
+ // Interestingly, IE 10 & older don't seem to have the issue.\r
+ input = document.createElement( "input" );\r
+ input.setAttribute( "name", "" );\r
+ el.appendChild( input );\r
+ if ( !el.querySelectorAll( "[name='']" ).length ) {\r
+ rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +\r
+ whitespace + "*(?:''|\"\")" );\r
+ }\r
+\r
+ // Webkit/Opera - :checked should return selected option elements\r
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\r
+ // IE8 throws error here and will not see later tests\r
+ if ( !el.querySelectorAll( ":checked" ).length ) {\r
+ rbuggyQSA.push( ":checked" );\r
+ }\r
+\r
+ // Support: Safari 8+, iOS 8+\r
+ // https://bugs.webkit.org/show_bug.cgi?id=136851\r
+ // In-page `selector#id sibling-combinator selector` fails\r
+ if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {\r
+ rbuggyQSA.push( ".#.+[+~]" );\r
+ }\r
+\r
+ // Support: Firefox <=3.6 - 5 only\r
+ // Old Firefox doesn't throw on a badly-escaped identifier.\r
+ el.querySelectorAll( "\\\f" );\r
+ rbuggyQSA.push( "[\\r\\n\\f]" );\r
+ } );\r
+\r
+ assert( function( el ) {\r
+ el.innerHTML = "<a href='' disabled='disabled'></a>" +\r
+ "<select disabled='disabled'><option/></select>";\r
+\r
+ // Support: Windows 8 Native Apps\r
+ // The type and name attributes are restricted during .innerHTML assignment\r
+ var input = document.createElement( "input" );\r
+ input.setAttribute( "type", "hidden" );\r
+ el.appendChild( input ).setAttribute( "name", "D" );\r
+\r
+ // Support: IE8\r
+ // Enforce case-sensitivity of name attribute\r
+ if ( el.querySelectorAll( "[name=d]" ).length ) {\r
+ rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );\r
+ }\r
+\r
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)\r
+ // IE8 throws error here and will not see later tests\r
+ if ( el.querySelectorAll( ":enabled" ).length !== 2 ) {\r
+ rbuggyQSA.push( ":enabled", ":disabled" );\r
+ }\r
+\r
+ // Support: IE9-11+\r
+ // IE's :disabled selector does not pick up the children of disabled fieldsets\r
+ docElem.appendChild( el ).disabled = true;\r
+ if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {\r
+ rbuggyQSA.push( ":enabled", ":disabled" );\r
+ }\r
+\r
+ // Support: Opera 10 - 11 only\r
+ // Opera 10-11 does not throw on post-comma invalid pseudos\r
+ el.querySelectorAll( "*,:x" );\r
+ rbuggyQSA.push( ",.*:" );\r
+ } );\r
+ }\r
+\r
+ if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||\r
+ docElem.webkitMatchesSelector ||\r
+ docElem.mozMatchesSelector ||\r
+ docElem.oMatchesSelector ||\r
+ docElem.msMatchesSelector ) ) ) ) {\r
+\r
+ assert( function( el ) {\r
+\r
+ // Check to see if it's possible to do matchesSelector\r
+ // on a disconnected node (IE 9)\r
+ support.disconnectedMatch = matches.call( el, "*" );\r
+\r
+ // This should fail with an exception\r
+ // Gecko does not error, returns false instead\r
+ matches.call( el, "[s!='']:x" );\r
+ rbuggyMatches.push( "!=", pseudos );\r
+ } );\r
+ }\r
+\r
+ rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );\r
+ rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );\r
+\r
+ /* Contains\r
+ ---------------------------------------------------------------------- */\r
+ hasCompare = rnative.test( docElem.compareDocumentPosition );\r
+\r
+ // Element contains another\r
+ // Purposefully self-exclusive\r
+ // As in, an element does not contain itself\r
+ contains = hasCompare || rnative.test( docElem.contains ) ?\r
+ function( a, b ) {\r
+ var adown = a.nodeType === 9 ? a.documentElement : a,\r
+ bup = b && b.parentNode;\r
+ return a === bup || !!( bup && bup.nodeType === 1 && (\r
+ adown.contains ?\r
+ adown.contains( bup ) :\r
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16\r
+ ) );\r
+ } :\r
+ function( a, b ) {\r
+ if ( b ) {\r
+ while ( ( b = b.parentNode ) ) {\r
+ if ( b === a ) {\r
+ return true;\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ };\r
+\r
+ /* Sorting\r
+ ---------------------------------------------------------------------- */\r
+\r
+ // Document order sorting\r
+ sortOrder = hasCompare ?\r
+ function( a, b ) {\r
+\r
+ // Flag for duplicate removal\r
+ if ( a === b ) {\r
+ hasDuplicate = true;\r
+ return 0;\r
+ }\r
+\r
+ // Sort on method existence if only one input has compareDocumentPosition\r
+ var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;\r
+ if ( compare ) {\r
+ return compare;\r
+ }\r
+\r
+ // Calculate position if both inputs belong to the same document\r
+ // Support: IE 11+, Edge 17 - 18+\r
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing\r
+ // two documents; shallow comparisons work.\r
+ // eslint-disable-next-line eqeqeq\r
+ compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?\r
+ a.compareDocumentPosition( b ) :\r
+\r
+ // Otherwise we know they are disconnected\r
+ 1;\r
+\r
+ // Disconnected nodes\r
+ if ( compare & 1 ||\r
+ ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {\r
+\r
+ // Choose the first element that is related to our preferred document\r
+ // Support: IE 11+, Edge 17 - 18+\r
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing\r
+ // two documents; shallow comparisons work.\r
+ // eslint-disable-next-line eqeqeq\r
+ if ( a == document || a.ownerDocument == preferredDoc &&\r
+ contains( preferredDoc, a ) ) {\r
+ return -1;\r
+ }\r
+\r
+ // Support: IE 11+, Edge 17 - 18+\r
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing\r
+ // two documents; shallow comparisons work.\r
+ // eslint-disable-next-line eqeqeq\r
+ if ( b == document || b.ownerDocument == preferredDoc &&\r
+ contains( preferredDoc, b ) ) {\r
+ return 1;\r
+ }\r
+\r
+ // Maintain original order\r
+ return sortInput ?\r
+ ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\r
+ 0;\r
+ }\r
+\r
+ return compare & 4 ? -1 : 1;\r
+ } :\r
+ function( a, b ) {\r
+\r
+ // Exit early if the nodes are identical\r
+ if ( a === b ) {\r
+ hasDuplicate = true;\r
+ return 0;\r
+ }\r
+\r
+ var cur,\r
+ i = 0,\r
+ aup = a.parentNode,\r
+ bup = b.parentNode,\r
+ ap = [ a ],\r
+ bp = [ b ];\r
+\r
+ // Parentless nodes are either documents or disconnected\r
+ if ( !aup || !bup ) {\r
+\r
+ // Support: IE 11+, Edge 17 - 18+\r
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing\r
+ // two documents; shallow comparisons work.\r
+ /* eslint-disable eqeqeq */\r
+ return a == document ? -1 :\r
+ b == document ? 1 :\r
+ /* eslint-enable eqeqeq */\r
+ aup ? -1 :\r
+ bup ? 1 :\r
+ sortInput ?\r
+ ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :\r
+ 0;\r
+\r
+ // If the nodes are siblings, we can do a quick check\r
+ } else if ( aup === bup ) {\r
+ return siblingCheck( a, b );\r
+ }\r
+\r
+ // Otherwise we need full lists of their ancestors for comparison\r
+ cur = a;\r
+ while ( ( cur = cur.parentNode ) ) {\r
+ ap.unshift( cur );\r
+ }\r
+ cur = b;\r
+ while ( ( cur = cur.parentNode ) ) {\r
+ bp.unshift( cur );\r
+ }\r
+\r
+ // Walk down the tree looking for a discrepancy\r
+ while ( ap[ i ] === bp[ i ] ) {\r
+ i++;\r
+ }\r
+\r
+ return i ?\r
+\r
+ // Do a sibling check if the nodes have a common ancestor\r
+ siblingCheck( ap[ i ], bp[ i ] ) :\r
+\r
+ // Otherwise nodes in our document sort first\r
+ // Support: IE 11+, Edge 17 - 18+\r
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing\r
+ // two documents; shallow comparisons work.\r
+ /* eslint-disable eqeqeq */\r
+ ap[ i ] == preferredDoc ? -1 :\r
+ bp[ i ] == preferredDoc ? 1 :\r
+ /* eslint-enable eqeqeq */\r
+ 0;\r
+ };\r
+\r
+ return document;\r
+};\r
+\r
+Sizzle.matches = function( expr, elements ) {\r
+ return Sizzle( expr, null, null, elements );\r
+};\r
+\r
+Sizzle.matchesSelector = function( elem, expr ) {\r
+ setDocument( elem );\r
+\r
+ if ( support.matchesSelector && documentIsHTML &&\r
+ !nonnativeSelectorCache[ expr + " " ] &&\r
+ ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&\r
+ ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {\r
+\r
+ try {\r
+ var ret = matches.call( elem, expr );\r
+\r
+ // IE 9's matchesSelector returns false on disconnected nodes\r
+ if ( ret || support.disconnectedMatch ||\r
+\r
+ // As well, disconnected nodes are said to be in a document\r
+ // fragment in IE 9\r
+ elem.document && elem.document.nodeType !== 11 ) {\r
+ return ret;\r
+ }\r
+ } catch ( e ) {\r
+ nonnativeSelectorCache( expr, true );\r
+ }\r
+ }\r
+\r
+ return Sizzle( expr, document, null, [ elem ] ).length > 0;\r
+};\r
+\r
+Sizzle.contains = function( context, elem ) {\r
+\r
+ // Set document vars if needed\r
+ // Support: IE 11+, Edge 17 - 18+\r
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing\r
+ // two documents; shallow comparisons work.\r
+ // eslint-disable-next-line eqeqeq\r
+ if ( ( context.ownerDocument || context ) != document ) {\r
+ setDocument( context );\r
+ }\r
+ return contains( context, elem );\r
+};\r
+\r
+Sizzle.attr = function( elem, name ) {\r
+\r
+ // Set document vars if needed\r
+ // Support: IE 11+, Edge 17 - 18+\r
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing\r
+ // two documents; shallow comparisons work.\r
+ // eslint-disable-next-line eqeqeq\r
+ if ( ( elem.ownerDocument || elem ) != document ) {\r
+ setDocument( elem );\r
+ }\r
+\r
+ var fn = Expr.attrHandle[ name.toLowerCase() ],\r
+\r
+ // Don't get fooled by Object.prototype properties (jQuery #13807)\r
+ val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?\r
+ fn( elem, name, !documentIsHTML ) :\r
+ undefined;\r
+\r
+ return val !== undefined ?\r
+ val :\r
+ support.attributes || !documentIsHTML ?\r
+ elem.getAttribute( name ) :\r
+ ( val = elem.getAttributeNode( name ) ) && val.specified ?\r
+ val.value :\r
+ null;\r
+};\r
+\r
+Sizzle.escape = function( sel ) {\r
+ return ( sel + "" ).replace( rcssescape, fcssescape );\r
+};\r
+\r
+Sizzle.error = function( msg ) {\r
+ throw new Error( "Syntax error, unrecognized expression: " + msg );\r
+};\r
+\r
+/**\r
+ * Document sorting and removing duplicates\r
+ * @param {ArrayLike} results\r
+ */\r
+Sizzle.uniqueSort = function( results ) {\r
+ var elem,\r
+ duplicates = [],\r
+ j = 0,\r
+ i = 0;\r
+\r
+ // Unless we *know* we can detect duplicates, assume their presence\r
+ hasDuplicate = !support.detectDuplicates;\r
+ sortInput = !support.sortStable && results.slice( 0 );\r
+ results.sort( sortOrder );\r
+\r
+ if ( hasDuplicate ) {\r
+ while ( ( elem = results[ i++ ] ) ) {\r
+ if ( elem === results[ i ] ) {\r
+ j = duplicates.push( i );\r
+ }\r
+ }\r
+ while ( j-- ) {\r
+ results.splice( duplicates[ j ], 1 );\r
+ }\r
+ }\r
+\r
+ // Clear input after sorting to release objects\r
+ // See https://github.com/jquery/sizzle/pull/225\r
+ sortInput = null;\r
+\r
+ return results;\r
+};\r
+\r
+/**\r
+ * Utility function for retrieving the text value of an array of DOM nodes\r
+ * @param {Array|Element} elem\r
+ */\r
+getText = Sizzle.getText = function( elem ) {\r
+ var node,\r
+ ret = "",\r
+ i = 0,\r
+ nodeType = elem.nodeType;\r
+\r
+ if ( !nodeType ) {\r
+\r
+ // If no nodeType, this is expected to be an array\r
+ while ( ( node = elem[ i++ ] ) ) {\r
+\r
+ // Do not traverse comment nodes\r
+ ret += getText( node );\r
+ }\r
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {\r
+\r
+ // Use textContent for elements\r
+ // innerText usage removed for consistency of new lines (jQuery #11153)\r
+ if ( typeof elem.textContent === "string" ) {\r
+ return elem.textContent;\r
+ } else {\r
+\r
+ // Traverse its children\r
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\r
+ ret += getText( elem );\r
+ }\r
+ }\r
+ } else if ( nodeType === 3 || nodeType === 4 ) {\r
+ return elem.nodeValue;\r
+ }\r
+\r
+ // Do not include comment or processing instruction nodes\r
+\r
+ return ret;\r
+};\r
+\r
+Expr = Sizzle.selectors = {\r
+\r
+ // Can be adjusted by the user\r
+ cacheLength: 50,\r
+\r
+ createPseudo: markFunction,\r
+\r
+ match: matchExpr,\r
+\r
+ attrHandle: {},\r
+\r
+ find: {},\r
+\r
+ relative: {\r
+ ">": { dir: "parentNode", first: true },\r
+ " ": { dir: "parentNode" },\r
+ "+": { dir: "previousSibling", first: true },\r
+ "~": { dir: "previousSibling" }\r
+ },\r
+\r
+ preFilter: {\r
+ "ATTR": function( match ) {\r
+ match[ 1 ] = match[ 1 ].replace( runescape, funescape );\r
+\r
+ // Move the given value to match[3] whether quoted or unquoted\r
+ match[ 3 ] = ( match[ 3 ] || match[ 4 ] ||\r
+ match[ 5 ] || "" ).replace( runescape, funescape );\r
+\r
+ if ( match[ 2 ] === "~=" ) {\r
+ match[ 3 ] = " " + match[ 3 ] + " ";\r
+ }\r
+\r
+ return match.slice( 0, 4 );\r
+ },\r
+\r
+ "CHILD": function( match ) {\r
+\r
+ /* matches from matchExpr["CHILD"]\r
+ 1 type (only|nth|...)\r
+ 2 what (child|of-type)\r
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)\r
+ 4 xn-component of xn+y argument ([+-]?\d*n|)\r
+ 5 sign of xn-component\r
+ 6 x of xn-component\r
+ 7 sign of y-component\r
+ 8 y of y-component\r
+ */\r
+ match[ 1 ] = match[ 1 ].toLowerCase();\r
+\r
+ if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {\r
+\r
+ // nth-* requires argument\r
+ if ( !match[ 3 ] ) {\r
+ Sizzle.error( match[ 0 ] );\r
+ }\r
+\r
+ // numeric x and y parameters for Expr.filter.CHILD\r
+ // remember that false/true cast respectively to 0/1\r
+ match[ 4 ] = +( match[ 4 ] ?\r
+ match[ 5 ] + ( match[ 6 ] || 1 ) :\r
+ 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) );\r
+ match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );\r
+\r
+ // other types prohibit arguments\r
+ } else if ( match[ 3 ] ) {\r
+ Sizzle.error( match[ 0 ] );\r
+ }\r
+\r
+ return match;\r
+ },\r
+\r
+ "PSEUDO": function( match ) {\r
+ var excess,\r
+ unquoted = !match[ 6 ] && match[ 2 ];\r
+\r
+ if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) {\r
+ return null;\r
+ }\r
+\r
+ // Accept quoted arguments as-is\r
+ if ( match[ 3 ] ) {\r
+ match[ 2 ] = match[ 4 ] || match[ 5 ] || "";\r
+\r
+ // Strip excess characters from unquoted arguments\r
+ } else if ( unquoted && rpseudo.test( unquoted ) &&\r
+\r
+ // Get excess from tokenize (recursively)\r
+ ( excess = tokenize( unquoted, true ) ) &&\r
+\r
+ // advance to the next closing parenthesis\r
+ ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {\r
+\r
+ // excess is a negative index\r
+ match[ 0 ] = match[ 0 ].slice( 0, excess );\r
+ match[ 2 ] = unquoted.slice( 0, excess );\r
+ }\r
+\r
+ // Return only captures needed by the pseudo filter method (type and argument)\r
+ return match.slice( 0, 3 );\r
+ }\r
+ },\r
+\r
+ filter: {\r
+\r
+ "TAG": function( nodeNameSelector ) {\r
+ var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();\r
+ return nodeNameSelector === "*" ?\r
+ function() {\r
+ return true;\r
+ } :\r
+ function( elem ) {\r
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;\r
+ };\r
+ },\r
+\r
+ "CLASS": function( className ) {\r
+ var pattern = classCache[ className + " " ];\r
+\r
+ return pattern ||\r
+ ( pattern = new RegExp( "(^|" + whitespace +\r
+ ")" + className + "(" + whitespace + "|$)" ) ) && classCache(\r
+ className, function( elem ) {\r
+ return pattern.test(\r
+ typeof elem.className === "string" && elem.className ||\r
+ typeof elem.getAttribute !== "undefined" &&\r
+ elem.getAttribute( "class" ) ||\r
+ ""\r
+ );\r
+ } );\r
+ },\r
+\r
+ "ATTR": function( name, operator, check ) {\r
+ return function( elem ) {\r
+ var result = Sizzle.attr( elem, name );\r
+\r
+ if ( result == null ) {\r
+ return operator === "!=";\r
+ }\r
+ if ( !operator ) {\r
+ return true;\r
+ }\r
+\r
+ result += "";\r
+\r
+ /* eslint-disable max-len */\r
+\r
+ return operator === "=" ? result === check :\r
+ operator === "!=" ? result !== check :\r
+ operator === "^=" ? check && result.indexOf( check ) === 0 :\r
+ operator === "*=" ? check && result.indexOf( check ) > -1 :\r
+ operator === "$=" ? check && result.slice( -check.length ) === check :\r
+ operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :\r
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :\r
+ false;\r
+ /* eslint-enable max-len */\r
+\r
+ };\r
+ },\r
+\r
+ "CHILD": function( type, what, _argument, first, last ) {\r
+ var simple = type.slice( 0, 3 ) !== "nth",\r
+ forward = type.slice( -4 ) !== "last",\r
+ ofType = what === "of-type";\r
+\r
+ return first === 1 && last === 0 ?\r
+\r
+ // Shortcut for :nth-*(n)\r
+ function( elem ) {\r
+ return !!elem.parentNode;\r
+ } :\r
+\r
+ function( elem, _context, xml ) {\r
+ var cache, uniqueCache, outerCache, node, nodeIndex, start,\r
+ dir = simple !== forward ? "nextSibling" : "previousSibling",\r
+ parent = elem.parentNode,\r
+ name = ofType && elem.nodeName.toLowerCase(),\r
+ useCache = !xml && !ofType,\r
+ diff = false;\r
+\r
+ if ( parent ) {\r
+\r
+ // :(first|last|only)-(child|of-type)\r
+ if ( simple ) {\r
+ while ( dir ) {\r
+ node = elem;\r
+ while ( ( node = node[ dir ] ) ) {\r
+ if ( ofType ?\r
+ node.nodeName.toLowerCase() === name :\r
+ node.nodeType === 1 ) {\r
+\r
+ return false;\r
+ }\r
+ }\r
+\r
+ // Reverse direction for :only-* (if we haven't yet done so)\r
+ start = dir = type === "only" && !start && "nextSibling";\r
+ }\r
+ return true;\r
+ }\r
+\r
+ start = [ forward ? parent.firstChild : parent.lastChild ];\r
+\r
+ // non-xml :nth-child(...) stores cache data on `parent`\r
+ if ( forward && useCache ) {\r
+\r
+ // Seek `elem` from a previously-cached index\r
+\r
+ // ...in a gzip-friendly way\r
+ node = parent;\r
+ outerCache = node[ expando ] || ( node[ expando ] = {} );\r
+\r
+ // Support: IE <9 only\r
+ // Defend against cloned attroperties (jQuery gh-1709)\r
+ uniqueCache = outerCache[ node.uniqueID ] ||\r
+ ( outerCache[ node.uniqueID ] = {} );\r
+\r
+ cache = uniqueCache[ type ] || [];\r
+ nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\r
+ diff = nodeIndex && cache[ 2 ];\r
+ node = nodeIndex && parent.childNodes[ nodeIndex ];\r
+\r
+ while ( ( node = ++nodeIndex && node && node[ dir ] ||\r
+\r
+ // Fallback to seeking `elem` from the start\r
+ ( diff = nodeIndex = 0 ) || start.pop() ) ) {\r
+\r
+ // When found, cache indexes on `parent` and break\r
+ if ( node.nodeType === 1 && ++diff && node === elem ) {\r
+ uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];\r
+ break;\r
+ }\r
+ }\r
+\r
+ } else {\r
+\r
+ // Use previously-cached element index if available\r
+ if ( useCache ) {\r
+\r
+ // ...in a gzip-friendly way\r
+ node = elem;\r
+ outerCache = node[ expando ] || ( node[ expando ] = {} );\r
+\r
+ // Support: IE <9 only\r
+ // Defend against cloned attroperties (jQuery gh-1709)\r
+ uniqueCache = outerCache[ node.uniqueID ] ||\r
+ ( outerCache[ node.uniqueID ] = {} );\r
+\r
+ cache = uniqueCache[ type ] || [];\r
+ nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];\r
+ diff = nodeIndex;\r
+ }\r
+\r
+ // xml :nth-child(...)\r
+ // or :nth-last-child(...) or :nth(-last)?-of-type(...)\r
+ if ( diff === false ) {\r
+\r
+ // Use the same loop as above to seek `elem` from the start\r
+ while ( ( node = ++nodeIndex && node && node[ dir ] ||\r
+ ( diff = nodeIndex = 0 ) || start.pop() ) ) {\r
+\r
+ if ( ( ofType ?\r
+ node.nodeName.toLowerCase() === name :\r
+ node.nodeType === 1 ) &&\r
+ ++diff ) {\r
+\r
+ // Cache the index of each encountered element\r
+ if ( useCache ) {\r
+ outerCache = node[ expando ] ||\r
+ ( node[ expando ] = {} );\r
+\r
+ // Support: IE <9 only\r
+ // Defend against cloned attroperties (jQuery gh-1709)\r
+ uniqueCache = outerCache[ node.uniqueID ] ||\r
+ ( outerCache[ node.uniqueID ] = {} );\r
+\r
+ uniqueCache[ type ] = [ dirruns, diff ];\r
+ }\r
+\r
+ if ( node === elem ) {\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ // Incorporate the offset, then check against cycle size\r
+ diff -= last;\r
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );\r
+ }\r
+ };\r
+ },\r
+\r
+ "PSEUDO": function( pseudo, argument ) {\r
+\r
+ // pseudo-class names are case-insensitive\r
+ // http://www.w3.org/TR/selectors/#pseudo-classes\r
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters\r
+ // Remember that setFilters inherits from pseudos\r
+ var args,\r
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||\r
+ Sizzle.error( "unsupported pseudo: " + pseudo );\r
+\r
+ // The user may use createPseudo to indicate that\r
+ // arguments are needed to create the filter function\r
+ // just as Sizzle does\r
+ if ( fn[ expando ] ) {\r
+ return fn( argument );\r
+ }\r
+\r
+ // But maintain support for old signatures\r
+ if ( fn.length > 1 ) {\r
+ args = [ pseudo, pseudo, "", argument ];\r
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?\r
+ markFunction( function( seed, matches ) {\r
+ var idx,\r
+ matched = fn( seed, argument ),\r
+ i = matched.length;\r
+ while ( i-- ) {\r
+ idx = indexOf( seed, matched[ i ] );\r
+ seed[ idx ] = !( matches[ idx ] = matched[ i ] );\r
+ }\r
+ } ) :\r
+ function( elem ) {\r
+ return fn( elem, 0, args );\r
+ };\r
+ }\r
+\r
+ return fn;\r
+ }\r
+ },\r
+\r
+ pseudos: {\r
+\r
+ // Potentially complex pseudos\r
+ "not": markFunction( function( selector ) {\r
+\r
+ // Trim the selector passed to compile\r
+ // to avoid treating leading and trailing\r
+ // spaces as combinators\r
+ var input = [],\r
+ results = [],\r
+ matcher = compile( selector.replace( rtrim, "$1" ) );\r
+\r
+ return matcher[ expando ] ?\r
+ markFunction( function( seed, matches, _context, xml ) {\r
+ var elem,\r
+ unmatched = matcher( seed, null, xml, [] ),\r
+ i = seed.length;\r
+\r
+ // Match elements unmatched by `matcher`\r
+ while ( i-- ) {\r
+ if ( ( elem = unmatched[ i ] ) ) {\r
+ seed[ i ] = !( matches[ i ] = elem );\r
+ }\r
+ }\r
+ } ) :\r
+ function( elem, _context, xml ) {\r
+ input[ 0 ] = elem;\r
+ matcher( input, null, xml, results );\r
+\r
+ // Don't keep the element (issue #299)\r
+ input[ 0 ] = null;\r
+ return !results.pop();\r
+ };\r
+ } ),\r
+\r
+ "has": markFunction( function( selector ) {\r
+ return function( elem ) {\r
+ return Sizzle( selector, elem ).length > 0;\r
+ };\r
+ } ),\r
+\r
+ "contains": markFunction( function( text ) {\r
+ text = text.replace( runescape, funescape );\r
+ return function( elem ) {\r
+ return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;\r
+ };\r
+ } ),\r
+\r
+ // "Whether an element is represented by a :lang() selector\r
+ // is based solely on the element's language value\r
+ // being equal to the identifier C,\r
+ // or beginning with the identifier C immediately followed by "-".\r
+ // The matching of C against the element's language value is performed case-insensitively.\r
+ // The identifier C does not have to be a valid language name."\r
+ // http://www.w3.org/TR/selectors/#lang-pseudo\r
+ "lang": markFunction( function( lang ) {\r
+\r
+ // lang value must be a valid identifier\r
+ if ( !ridentifier.test( lang || "" ) ) {\r
+ Sizzle.error( "unsupported lang: " + lang );\r
+ }\r
+ lang = lang.replace( runescape, funescape ).toLowerCase();\r
+ return function( elem ) {\r
+ var elemLang;\r
+ do {\r
+ if ( ( elemLang = documentIsHTML ?\r
+ elem.lang :\r
+ elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {\r
+\r
+ elemLang = elemLang.toLowerCase();\r
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;\r
+ }\r
+ } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );\r
+ return false;\r
+ };\r
+ } ),\r
+\r
+ // Miscellaneous\r
+ "target": function( elem ) {\r
+ var hash = window.location && window.location.hash;\r
+ return hash && hash.slice( 1 ) === elem.id;\r
+ },\r
+\r
+ "root": function( elem ) {\r
+ return elem === docElem;\r
+ },\r
+\r
+ "focus": function( elem ) {\r
+ return elem === document.activeElement &&\r
+ ( !document.hasFocus || document.hasFocus() ) &&\r
+ !!( elem.type || elem.href || ~elem.tabIndex );\r
+ },\r
+\r
+ // Boolean properties\r
+ "enabled": createDisabledPseudo( false ),\r
+ "disabled": createDisabledPseudo( true ),\r
+\r
+ "checked": function( elem ) {\r
+\r
+ // In CSS3, :checked should return both checked and selected elements\r
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked\r
+ var nodeName = elem.nodeName.toLowerCase();\r
+ return ( nodeName === "input" && !!elem.checked ) ||\r
+ ( nodeName === "option" && !!elem.selected );\r
+ },\r
+\r
+ "selected": function( elem ) {\r
+\r
+ // Accessing this property makes selected-by-default\r
+ // options in Safari work properly\r
+ if ( elem.parentNode ) {\r
+ // eslint-disable-next-line no-unused-expressions\r
+ elem.parentNode.selectedIndex;\r
+ }\r
+\r
+ return elem.selected === true;\r
+ },\r
+\r
+ // Contents\r
+ "empty": function( elem ) {\r
+\r
+ // http://www.w3.org/TR/selectors/#empty-pseudo\r
+ // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),\r
+ // but not by others (comment: 8; processing instruction: 7; etc.)\r
+ // nodeType < 6 works because attributes (2) do not appear as children\r
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {\r
+ if ( elem.nodeType < 6 ) {\r
+ return false;\r
+ }\r
+ }\r
+ return true;\r
+ },\r
+\r
+ "parent": function( elem ) {\r
+ return !Expr.pseudos[ "empty" ]( elem );\r
+ },\r
+\r
+ // Element/input types\r
+ "header": function( elem ) {\r
+ return rheader.test( elem.nodeName );\r
+ },\r
+\r
+ "input": function( elem ) {\r
+ return rinputs.test( elem.nodeName );\r
+ },\r
+\r
+ "button": function( elem ) {\r
+ var name = elem.nodeName.toLowerCase();\r
+ return name === "input" && elem.type === "button" || name === "button";\r
+ },\r
+\r
+ "text": function( elem ) {\r
+ var attr;\r
+ return elem.nodeName.toLowerCase() === "input" &&\r
+ elem.type === "text" &&\r
+\r
+ // Support: IE<8\r
+ // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"\r
+ ( ( attr = elem.getAttribute( "type" ) ) == null ||\r
+ attr.toLowerCase() === "text" );\r
+ },\r
+\r
+ // Position-in-collection\r
+ "first": createPositionalPseudo( function() {\r
+ return [ 0 ];\r
+ } ),\r
+\r
+ "last": createPositionalPseudo( function( _matchIndexes, length ) {\r
+ return [ length - 1 ];\r
+ } ),\r
+\r
+ "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) {\r
+ return [ argument < 0 ? argument + length : argument ];\r
+ } ),\r
+\r
+ "even": createPositionalPseudo( function( matchIndexes, length ) {\r
+ var i = 0;\r
+ for ( ; i < length; i += 2 ) {\r
+ matchIndexes.push( i );\r
+ }\r
+ return matchIndexes;\r
+ } ),\r
+\r
+ "odd": createPositionalPseudo( function( matchIndexes, length ) {\r
+ var i = 1;\r
+ for ( ; i < length; i += 2 ) {\r
+ matchIndexes.push( i );\r
+ }\r
+ return matchIndexes;\r
+ } ),\r
+\r
+ "lt": createPositionalPseudo( function( matchIndexes, length, argument ) {\r
+ var i = argument < 0 ?\r
+ argument + length :\r
+ argument > length ?\r
+ length :\r
+ argument;\r
+ for ( ; --i >= 0; ) {\r
+ matchIndexes.push( i );\r
+ }\r
+ return matchIndexes;\r
+ } ),\r
+\r
+ "gt": createPositionalPseudo( function( matchIndexes, length, argument ) {\r
+ var i = argument < 0 ? argument + length : argument;\r
+ for ( ; ++i < length; ) {\r
+ matchIndexes.push( i );\r
+ }\r
+ return matchIndexes;\r
+ } )\r
+ }\r
+};\r
+\r
+Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ];\r
+\r
+// Add button/input type pseudos\r
+for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {\r
+ Expr.pseudos[ i ] = createInputPseudo( i );\r
+}\r
+for ( i in { submit: true, reset: true } ) {\r
+ Expr.pseudos[ i ] = createButtonPseudo( i );\r
+}\r
+\r
+// Easy API for creating new setFilters\r
+function setFilters() {}\r
+setFilters.prototype = Expr.filters = Expr.pseudos;\r
+Expr.setFilters = new setFilters();\r
+\r
+tokenize = Sizzle.tokenize = function( selector, parseOnly ) {\r
+ var matched, match, tokens, type,\r
+ soFar, groups, preFilters,\r
+ cached = tokenCache[ selector + " " ];\r
+\r
+ if ( cached ) {\r
+ return parseOnly ? 0 : cached.slice( 0 );\r
+ }\r
+\r
+ soFar = selector;\r
+ groups = [];\r
+ preFilters = Expr.preFilter;\r
+\r
+ while ( soFar ) {\r
+\r
+ // Comma and first run\r
+ if ( !matched || ( match = rcomma.exec( soFar ) ) ) {\r
+ if ( match ) {\r
+\r
+ // Don't consume trailing commas as valid\r
+ soFar = soFar.slice( match[ 0 ].length ) || soFar;\r
+ }\r
+ groups.push( ( tokens = [] ) );\r
+ }\r
+\r
+ matched = false;\r
+\r
+ // Combinators\r
+ if ( ( match = rcombinators.exec( soFar ) ) ) {\r
+ matched = match.shift();\r
+ tokens.push( {\r
+ value: matched,\r
+\r
+ // Cast descendant combinators to space\r
+ type: match[ 0 ].replace( rtrim, " " )\r
+ } );\r
+ soFar = soFar.slice( matched.length );\r
+ }\r
+\r
+ // Filters\r
+ for ( type in Expr.filter ) {\r
+ if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||\r
+ ( match = preFilters[ type ]( match ) ) ) ) {\r
+ matched = match.shift();\r
+ tokens.push( {\r
+ value: matched,\r
+ type: type,\r
+ matches: match\r
+ } );\r
+ soFar = soFar.slice( matched.length );\r
+ }\r
+ }\r
+\r
+ if ( !matched ) {\r
+ break;\r
+ }\r
+ }\r
+\r
+ // Return the length of the invalid excess\r
+ // if we're just parsing\r
+ // Otherwise, throw an error or return tokens\r
+ return parseOnly ?\r
+ soFar.length :\r
+ soFar ?\r
+ Sizzle.error( selector ) :\r
+\r
+ // Cache the tokens\r
+ tokenCache( selector, groups ).slice( 0 );\r
+};\r
+\r
+function toSelector( tokens ) {\r
+ var i = 0,\r
+ len = tokens.length,\r
+ selector = "";\r
+ for ( ; i < len; i++ ) {\r
+ selector += tokens[ i ].value;\r
+ }\r
+ return selector;\r
+}\r
+\r
+function addCombinator( matcher, combinator, base ) {\r
+ var dir = combinator.dir,\r
+ skip = combinator.next,\r
+ key = skip || dir,\r
+ checkNonElements = base && key === "parentNode",\r
+ doneName = done++;\r
+\r
+ return combinator.first ?\r
+\r
+ // Check against closest ancestor/preceding element\r
+ function( elem, context, xml ) {\r
+ while ( ( elem = elem[ dir ] ) ) {\r
+ if ( elem.nodeType === 1 || checkNonElements ) {\r
+ return matcher( elem, context, xml );\r
+ }\r
+ }\r
+ return false;\r
+ } :\r
+\r
+ // Check against all ancestor/preceding elements\r
+ function( elem, context, xml ) {\r
+ var oldCache, uniqueCache, outerCache,\r
+ newCache = [ dirruns, doneName ];\r
+\r
+ // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching\r
+ if ( xml ) {\r
+ while ( ( elem = elem[ dir ] ) ) {\r
+ if ( elem.nodeType === 1 || checkNonElements ) {\r
+ if ( matcher( elem, context, xml ) ) {\r
+ return true;\r
+ }\r
+ }\r
+ }\r
+ } else {\r
+ while ( ( elem = elem[ dir ] ) ) {\r
+ if ( elem.nodeType === 1 || checkNonElements ) {\r
+ outerCache = elem[ expando ] || ( elem[ expando ] = {} );\r
+\r
+ // Support: IE <9 only\r
+ // Defend against cloned attroperties (jQuery gh-1709)\r
+ uniqueCache = outerCache[ elem.uniqueID ] ||\r
+ ( outerCache[ elem.uniqueID ] = {} );\r
+\r
+ if ( skip && skip === elem.nodeName.toLowerCase() ) {\r
+ elem = elem[ dir ] || elem;\r
+ } else if ( ( oldCache = uniqueCache[ key ] ) &&\r
+ oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {\r
+\r
+ // Assign to newCache so results back-propagate to previous elements\r
+ return ( newCache[ 2 ] = oldCache[ 2 ] );\r
+ } else {\r
+\r
+ // Reuse newcache so results back-propagate to previous elements\r
+ uniqueCache[ key ] = newCache;\r
+\r
+ // A match means we're done; a fail means we have to keep checking\r
+ if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {\r
+ return true;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ return false;\r
+ };\r
+}\r
+\r
+function elementMatcher( matchers ) {\r
+ return matchers.length > 1 ?\r
+ function( elem, context, xml ) {\r
+ var i = matchers.length;\r
+ while ( i-- ) {\r
+ if ( !matchers[ i ]( elem, context, xml ) ) {\r
+ return false;\r
+ }\r
+ }\r
+ return true;\r
+ } :\r
+ matchers[ 0 ];\r
+}\r
+\r
+function multipleContexts( selector, contexts, results ) {\r
+ var i = 0,\r
+ len = contexts.length;\r
+ for ( ; i < len; i++ ) {\r
+ Sizzle( selector, contexts[ i ], results );\r
+ }\r
+ return results;\r
+}\r
+\r
+function condense( unmatched, map, filter, context, xml ) {\r
+ var elem,\r
+ newUnmatched = [],\r
+ i = 0,\r
+ len = unmatched.length,\r
+ mapped = map != null;\r
+\r
+ for ( ; i < len; i++ ) {\r
+ if ( ( elem = unmatched[ i ] ) ) {\r
+ if ( !filter || filter( elem, context, xml ) ) {\r
+ newUnmatched.push( elem );\r
+ if ( mapped ) {\r
+ map.push( i );\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ return newUnmatched;\r
+}\r
+\r
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {\r
+ if ( postFilter && !postFilter[ expando ] ) {\r
+ postFilter = setMatcher( postFilter );\r
+ }\r
+ if ( postFinder && !postFinder[ expando ] ) {\r
+ postFinder = setMatcher( postFinder, postSelector );\r
+ }\r
+ return markFunction( function( seed, results, context, xml ) {\r
+ var temp, i, elem,\r
+ preMap = [],\r
+ postMap = [],\r
+ preexisting = results.length,\r
+\r
+ // Get initial elements from seed or context\r
+ elems = seed || multipleContexts(\r
+ selector || "*",\r
+ context.nodeType ? [ context ] : context,\r
+ []\r
+ ),\r
+\r
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization\r
+ matcherIn = preFilter && ( seed || !selector ) ?\r
+ condense( elems, preMap, preFilter, context, xml ) :\r
+ elems,\r
+\r
+ matcherOut = matcher ?\r
+\r
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,\r
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?\r
+\r
+ // ...intermediate processing is necessary\r
+ [] :\r
+\r
+ // ...otherwise use results directly\r
+ results :\r
+ matcherIn;\r
+\r
+ // Find primary matches\r
+ if ( matcher ) {\r
+ matcher( matcherIn, matcherOut, context, xml );\r
+ }\r
+\r
+ // Apply postFilter\r
+ if ( postFilter ) {\r
+ temp = condense( matcherOut, postMap );\r
+ postFilter( temp, [], context, xml );\r
+\r
+ // Un-match failing elements by moving them back to matcherIn\r
+ i = temp.length;\r
+ while ( i-- ) {\r
+ if ( ( elem = temp[ i ] ) ) {\r
+ matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );\r
+ }\r
+ }\r
+ }\r
+\r
+ if ( seed ) {\r
+ if ( postFinder || preFilter ) {\r
+ if ( postFinder ) {\r
+\r
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts\r
+ temp = [];\r
+ i = matcherOut.length;\r
+ while ( i-- ) {\r
+ if ( ( elem = matcherOut[ i ] ) ) {\r
+\r
+ // Restore matcherIn since elem is not yet a final match\r
+ temp.push( ( matcherIn[ i ] = elem ) );\r
+ }\r
+ }\r
+ postFinder( null, ( matcherOut = [] ), temp, xml );\r
+ }\r
+\r
+ // Move matched elements from seed to results to keep them synchronized\r
+ i = matcherOut.length;\r
+ while ( i-- ) {\r
+ if ( ( elem = matcherOut[ i ] ) &&\r
+ ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {\r
+\r
+ seed[ temp ] = !( results[ temp ] = elem );\r
+ }\r
+ }\r
+ }\r
+\r
+ // Add elements to results, through postFinder if defined\r
+ } else {\r
+ matcherOut = condense(\r
+ matcherOut === results ?\r
+ matcherOut.splice( preexisting, matcherOut.length ) :\r
+ matcherOut\r
+ );\r
+ if ( postFinder ) {\r
+ postFinder( null, results, matcherOut, xml );\r
+ } else {\r
+ push.apply( results, matcherOut );\r
+ }\r
+ }\r
+ } );\r
+}\r
+\r
+function matcherFromTokens( tokens ) {\r
+ var checkContext, matcher, j,\r
+ len = tokens.length,\r
+ leadingRelative = Expr.relative[ tokens[ 0 ].type ],\r
+ implicitRelative = leadingRelative || Expr.relative[ " " ],\r
+ i = leadingRelative ? 1 : 0,\r
+\r
+ // The foundational matcher ensures that elements are reachable from top-level context(s)\r
+ matchContext = addCombinator( function( elem ) {\r
+ return elem === checkContext;\r
+ }, implicitRelative, true ),\r
+ matchAnyContext = addCombinator( function( elem ) {\r
+ return indexOf( checkContext, elem ) > -1;\r
+ }, implicitRelative, true ),\r
+ matchers = [ function( elem, context, xml ) {\r
+ var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (\r
+ ( checkContext = context ).nodeType ?\r
+ matchContext( elem, context, xml ) :\r
+ matchAnyContext( elem, context, xml ) );\r
+\r
+ // Avoid hanging onto element (issue #299)\r
+ checkContext = null;\r
+ return ret;\r
+ } ];\r
+\r
+ for ( ; i < len; i++ ) {\r
+ if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {\r
+ matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];\r
+ } else {\r
+ matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );\r
+\r
+ // Return special upon seeing a positional matcher\r
+ if ( matcher[ expando ] ) {\r
+\r
+ // Find the next relative operator (if any) for proper handling\r
+ j = ++i;\r
+ for ( ; j < len; j++ ) {\r
+ if ( Expr.relative[ tokens[ j ].type ] ) {\r
+ break;\r
+ }\r
+ }\r
+ return setMatcher(\r
+ i > 1 && elementMatcher( matchers ),\r
+ i > 1 && toSelector(\r
+\r
+ // If the preceding token was a descendant combinator, insert an implicit any-element `*`\r
+ tokens\r
+ .slice( 0, i - 1 )\r
+ .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )\r
+ ).replace( rtrim, "$1" ),\r
+ matcher,\r
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),\r
+ j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),\r
+ j < len && toSelector( tokens )\r
+ );\r
+ }\r
+ matchers.push( matcher );\r
+ }\r
+ }\r
+\r
+ return elementMatcher( matchers );\r
+}\r
+\r
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {\r
+ var bySet = setMatchers.length > 0,\r
+ byElement = elementMatchers.length > 0,\r
+ superMatcher = function( seed, context, xml, results, outermost ) {\r
+ var elem, j, matcher,\r
+ matchedCount = 0,\r
+ i = "0",\r
+ unmatched = seed && [],\r
+ setMatched = [],\r
+ contextBackup = outermostContext,\r
+\r
+ // We must always have either seed elements or outermost context\r
+ elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ),\r
+\r
+ // Use integer dirruns iff this is the outermost matcher\r
+ dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),\r
+ len = elems.length;\r
+\r
+ if ( outermost ) {\r
+\r
+ // Support: IE 11+, Edge 17 - 18+\r
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing\r
+ // two documents; shallow comparisons work.\r
+ // eslint-disable-next-line eqeqeq\r
+ outermostContext = context == document || context || outermost;\r
+ }\r
+\r
+ // Add elements passing elementMatchers directly to results\r
+ // Support: IE<9, Safari\r
+ // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id\r
+ for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {\r
+ if ( byElement && elem ) {\r
+ j = 0;\r
+\r
+ // Support: IE 11+, Edge 17 - 18+\r
+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing\r
+ // two documents; shallow comparisons work.\r
+ // eslint-disable-next-line eqeqeq\r
+ if ( !context && elem.ownerDocument != document ) {\r
+ setDocument( elem );\r
+ xml = !documentIsHTML;\r
+ }\r
+ while ( ( matcher = elementMatchers[ j++ ] ) ) {\r
+ if ( matcher( elem, context || document, xml ) ) {\r
+ results.push( elem );\r
+ break;\r
+ }\r
+ }\r
+ if ( outermost ) {\r
+ dirruns = dirrunsUnique;\r
+ }\r
+ }\r
+\r
+ // Track unmatched elements for set filters\r
+ if ( bySet ) {\r
+\r
+ // They will have gone through all possible matchers\r
+ if ( ( elem = !matcher && elem ) ) {\r
+ matchedCount--;\r
+ }\r
+\r
+ // Lengthen the array for every element, matched or not\r
+ if ( seed ) {\r
+ unmatched.push( elem );\r
+ }\r
+ }\r
+ }\r
+\r
+ // `i` is now the count of elements visited above, and adding it to `matchedCount`\r
+ // makes the latter nonnegative.\r
+ matchedCount += i;\r
+\r
+ // Apply set filters to unmatched elements\r
+ // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`\r
+ // equals `i`), unless we didn't visit _any_ elements in the above loop because we have\r
+ // no element matchers and no seed.\r
+ // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that\r
+ // case, which will result in a "00" `matchedCount` that differs from `i` but is also\r
+ // numerically zero.\r
+ if ( bySet && i !== matchedCount ) {\r
+ j = 0;\r
+ while ( ( matcher = setMatchers[ j++ ] ) ) {\r
+ matcher( unmatched, setMatched, context, xml );\r
+ }\r
+\r
+ if ( seed ) {\r
+\r
+ // Reintegrate element matches to eliminate the need for sorting\r
+ if ( matchedCount > 0 ) {\r
+ while ( i-- ) {\r
+ if ( !( unmatched[ i ] || setMatched[ i ] ) ) {\r
+ setMatched[ i ] = pop.call( results );\r
+ }\r
+ }\r
+ }\r
+\r
+ // Discard index placeholder values to get only actual matches\r
+ setMatched = condense( setMatched );\r
+ }\r
+\r
+ // Add matches to results\r
+ push.apply( results, setMatched );\r
+\r
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting\r
+ if ( outermost && !seed && setMatched.length > 0 &&\r
+ ( matchedCount + setMatchers.length ) > 1 ) {\r
+\r
+ Sizzle.uniqueSort( results );\r
+ }\r
+ }\r
+\r
+ // Override manipulation of globals by nested matchers\r
+ if ( outermost ) {\r
+ dirruns = dirrunsUnique;\r
+ outermostContext = contextBackup;\r
+ }\r
+\r
+ return unmatched;\r
+ };\r
+\r
+ return bySet ?\r
+ markFunction( superMatcher ) :\r
+ superMatcher;\r
+}\r
+\r
+compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {\r
+ var i,\r
+ setMatchers = [],\r
+ elementMatchers = [],\r
+ cached = compilerCache[ selector + " " ];\r
+\r
+ if ( !cached ) {\r
+\r
+ // Generate a function of recursive functions that can be used to check each element\r
+ if ( !match ) {\r
+ match = tokenize( selector );\r
+ }\r
+ i = match.length;\r
+ while ( i-- ) {\r
+ cached = matcherFromTokens( match[ i ] );\r
+ if ( cached[ expando ] ) {\r
+ setMatchers.push( cached );\r
+ } else {\r
+ elementMatchers.push( cached );\r
+ }\r
+ }\r
+\r
+ // Cache the compiled function\r
+ cached = compilerCache(\r
+ selector,\r
+ matcherFromGroupMatchers( elementMatchers, setMatchers )\r
+ );\r
+\r
+ // Save selector and tokenization\r
+ cached.selector = selector;\r
+ }\r
+ return cached;\r
+};\r
+\r
+/**\r
+ * A low-level selection function that works with Sizzle's compiled\r
+ * selector functions\r
+ * @param {String|Function} selector A selector or a pre-compiled\r
+ * selector function built with Sizzle.compile\r
+ * @param {Element} context\r
+ * @param {Array} [results]\r
+ * @param {Array} [seed] A set of elements to match against\r
+ */\r
+select = Sizzle.select = function( selector, context, results, seed ) {\r
+ var i, tokens, token, type, find,\r
+ compiled = typeof selector === "function" && selector,\r
+ match = !seed && tokenize( ( selector = compiled.selector || selector ) );\r
+\r
+ results = results || [];\r
+\r
+ // Try to minimize operations if there is only one selector in the list and no seed\r
+ // (the latter of which guarantees us context)\r
+ if ( match.length === 1 ) {\r
+\r
+ // Reduce context if the leading compound selector is an ID\r
+ tokens = match[ 0 ] = match[ 0 ].slice( 0 );\r
+ if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&\r
+ context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {\r
+\r
+ context = ( Expr.find[ "ID" ]( token.matches[ 0 ]\r
+ .replace( runescape, funescape ), context ) || [] )[ 0 ];\r
+ if ( !context ) {\r
+ return results;\r
+\r
+ // Precompiled matchers will still verify ancestry, so step up a level\r
+ } else if ( compiled ) {\r
+ context = context.parentNode;\r
+ }\r
+\r
+ selector = selector.slice( tokens.shift().value.length );\r
+ }\r
+\r
+ // Fetch a seed set for right-to-left matching\r
+ i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length;\r
+ while ( i-- ) {\r
+ token = tokens[ i ];\r
+\r
+ // Abort if we hit a combinator\r
+ if ( Expr.relative[ ( type = token.type ) ] ) {\r
+ break;\r
+ }\r
+ if ( ( find = Expr.find[ type ] ) ) {\r
+\r
+ // Search, expanding context for leading sibling combinators\r
+ if ( ( seed = find(\r
+ token.matches[ 0 ].replace( runescape, funescape ),\r
+ rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||\r
+ context\r
+ ) ) ) {\r
+\r
+ // If seed is empty or no tokens remain, we can return early\r
+ tokens.splice( i, 1 );\r
+ selector = seed.length && toSelector( tokens );\r
+ if ( !selector ) {\r
+ push.apply( results, seed );\r
+ return results;\r
+ }\r
+\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ // Compile and execute a filtering function if one is not provided\r
+ // Provide `match` to avoid retokenization if we modified the selector above\r
+ ( compiled || compile( selector, match ) )(\r
+ seed,\r
+ context,\r
+ !documentIsHTML,\r
+ results,\r
+ !context || rsibling.test( selector ) && testContext( context.parentNode ) || context\r
+ );\r
+ return results;\r
+};\r
+\r
+// One-time assignments\r
+\r
+// Sort stability\r
+support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;\r
+\r
+// Support: Chrome 14-35+\r
+// Always assume duplicates if they aren't passed to the comparison function\r
+support.detectDuplicates = !!hasDuplicate;\r
+\r
+// Initialize against the default document\r
+setDocument();\r
+\r
+// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)\r
+// Detached nodes confoundingly follow *each other*\r
+support.sortDetached = assert( function( el ) {\r
+\r
+ // Should return 1, but returns 4 (following)\r
+ return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;\r
+} );\r
+\r
+// Support: IE<8\r
+// Prevent attribute/property "interpolation"\r
+// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx\r
+if ( !assert( function( el ) {\r
+ el.innerHTML = "<a href='#'></a>";\r
+ return el.firstChild.getAttribute( "href" ) === "#";\r
+} ) ) {\r
+ addHandle( "type|href|height|width", function( elem, name, isXML ) {\r
+ if ( !isXML ) {\r
+ return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );\r
+ }\r
+ } );\r
+}\r
+\r
+// Support: IE<9\r
+// Use defaultValue in place of getAttribute("value")\r
+if ( !support.attributes || !assert( function( el ) {\r
+ el.innerHTML = "<input/>";\r
+ el.firstChild.setAttribute( "value", "" );\r
+ return el.firstChild.getAttribute( "value" ) === "";\r
+} ) ) {\r
+ addHandle( "value", function( elem, _name, isXML ) {\r
+ if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {\r
+ return elem.defaultValue;\r
+ }\r
+ } );\r
+}\r
+\r
+// Support: IE<9\r
+// Use getAttributeNode to fetch booleans when getAttribute lies\r
+if ( !assert( function( el ) {\r
+ return el.getAttribute( "disabled" ) == null;\r
+} ) ) {\r
+ addHandle( booleans, function( elem, name, isXML ) {\r
+ var val;\r
+ if ( !isXML ) {\r
+ return elem[ name ] === true ? name.toLowerCase() :\r
+ ( val = elem.getAttributeNode( name ) ) && val.specified ?\r
+ val.value :\r
+ null;\r
+ }\r
+ } );\r
+}\r
+\r
+return Sizzle;\r
+\r
+} )( window );\r
+\r
+\r
+\r
+jQuery.find = Sizzle;\r
+jQuery.expr = Sizzle.selectors;\r
+\r
+// Deprecated\r
+jQuery.expr[ ":" ] = jQuery.expr.pseudos;\r
+jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;\r
+jQuery.text = Sizzle.getText;\r
+jQuery.isXMLDoc = Sizzle.isXML;\r
+jQuery.contains = Sizzle.contains;\r
+jQuery.escapeSelector = Sizzle.escape;\r
+\r
+\r
+\r
+\r
+var dir = function( elem, dir, until ) {\r
+ var matched = [],\r
+ truncate = until !== undefined;\r
+\r
+ while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {\r
+ if ( elem.nodeType === 1 ) {\r
+ if ( truncate && jQuery( elem ).is( until ) ) {\r
+ break;\r
+ }\r
+ matched.push( elem );\r
+ }\r
+ }\r
+ return matched;\r
+};\r
+\r
+\r
+var siblings = function( n, elem ) {\r
+ var matched = [];\r
+\r
+ for ( ; n; n = n.nextSibling ) {\r
+ if ( n.nodeType === 1 && n !== elem ) {\r
+ matched.push( n );\r
+ }\r
+ }\r
+\r
+ return matched;\r
+};\r
+\r
+\r
+var rneedsContext = jQuery.expr.match.needsContext;\r
+\r
+\r
+\r
+function nodeName( elem, name ) {\r
+\r
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\r
+\r
+}\r
+var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );\r
+\r
+\r
+\r
+// Implement the identical functionality for filter and not\r
+function winnow( elements, qualifier, not ) {\r
+ if ( isFunction( qualifier ) ) {\r
+ return jQuery.grep( elements, function( elem, i ) {\r
+ return !!qualifier.call( elem, i, elem ) !== not;\r
+ } );\r
+ }\r
+\r
+ // Single element\r
+ if ( qualifier.nodeType ) {\r
+ return jQuery.grep( elements, function( elem ) {\r
+ return ( elem === qualifier ) !== not;\r
+ } );\r
+ }\r
+\r
+ // Arraylike of elements (jQuery, arguments, Array)\r
+ if ( typeof qualifier !== "string" ) {\r
+ return jQuery.grep( elements, function( elem ) {\r
+ return ( indexOf.call( qualifier, elem ) > -1 ) !== not;\r
+ } );\r
+ }\r
+\r
+ // Filtered directly for both simple and complex selectors\r
+ return jQuery.filter( qualifier, elements, not );\r
+}\r
+\r
+jQuery.filter = function( expr, elems, not ) {\r
+ var elem = elems[ 0 ];\r
+\r
+ if ( not ) {\r
+ expr = ":not(" + expr + ")";\r
+ }\r
+\r
+ if ( elems.length === 1 && elem.nodeType === 1 ) {\r
+ return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];\r
+ }\r
+\r
+ return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {\r
+ return elem.nodeType === 1;\r
+ } ) );\r
+};\r
+\r
+jQuery.fn.extend( {\r
+ find: function( selector ) {\r
+ var i, ret,\r
+ len = this.length,\r
+ self = this;\r
+\r
+ if ( typeof selector !== "string" ) {\r
+ return this.pushStack( jQuery( selector ).filter( function() {\r
+ for ( i = 0; i < len; i++ ) {\r
+ if ( jQuery.contains( self[ i ], this ) ) {\r
+ return true;\r
+ }\r
+ }\r
+ } ) );\r
+ }\r
+\r
+ ret = this.pushStack( [] );\r
+\r
+ for ( i = 0; i < len; i++ ) {\r
+ jQuery.find( selector, self[ i ], ret );\r
+ }\r
+\r
+ return len > 1 ? jQuery.uniqueSort( ret ) : ret;\r
+ },\r
+ filter: function( selector ) {\r
+ return this.pushStack( winnow( this, selector || [], false ) );\r
+ },\r
+ not: function( selector ) {\r
+ return this.pushStack( winnow( this, selector || [], true ) );\r
+ },\r
+ is: function( selector ) {\r
+ return !!winnow(\r
+ this,\r
+\r
+ // If this is a positional/relative selector, check membership in the returned set\r
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".\r
+ typeof selector === "string" && rneedsContext.test( selector ) ?\r
+ jQuery( selector ) :\r
+ selector || [],\r
+ false\r
+ ).length;\r
+ }\r
+} );\r
+\r
+\r
+// Initialize a jQuery object\r
+\r
+\r
+// A central reference to the root jQuery(document)\r
+var rootjQuery,\r
+\r
+ // A simple way to check for HTML strings\r
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)\r
+ // Strict HTML recognition (#11290: must start with <)\r
+ // Shortcut simple #id case for speed\r
+ rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,\r
+\r
+ init = jQuery.fn.init = function( selector, context, root ) {\r
+ var match, elem;\r
+\r
+ // HANDLE: $(""), $(null), $(undefined), $(false)\r
+ if ( !selector ) {\r
+ return this;\r
+ }\r
+\r
+ // Method init() accepts an alternate rootjQuery\r
+ // so migrate can support jQuery.sub (gh-2101)\r
+ root = root || rootjQuery;\r
+\r
+ // Handle HTML strings\r
+ if ( typeof selector === "string" ) {\r
+ if ( selector[ 0 ] === "<" &&\r
+ selector[ selector.length - 1 ] === ">" &&\r
+ selector.length >= 3 ) {\r
+\r
+ // Assume that strings that start and end with <> are HTML and skip the regex check\r
+ match = [ null, selector, null ];\r
+\r
+ } else {\r
+ match = rquickExpr.exec( selector );\r
+ }\r
+\r
+ // Match html or make sure no context is specified for #id\r
+ if ( match && ( match[ 1 ] || !context ) ) {\r
+\r
+ // HANDLE: $(html) -> $(array)\r
+ if ( match[ 1 ] ) {\r
+ context = context instanceof jQuery ? context[ 0 ] : context;\r
+\r
+ // Option to run scripts is true for back-compat\r
+ // Intentionally let the error be thrown if parseHTML is not present\r
+ jQuery.merge( this, jQuery.parseHTML(\r
+ match[ 1 ],\r
+ context && context.nodeType ? context.ownerDocument || context : document,\r
+ true\r
+ ) );\r
+\r
+ // HANDLE: $(html, props)\r
+ if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {\r
+ for ( match in context ) {\r
+\r
+ // Properties of context are called as methods if possible\r
+ if ( isFunction( this[ match ] ) ) {\r
+ this[ match ]( context[ match ] );\r
+\r
+ // ...and otherwise set as attributes\r
+ } else {\r
+ this.attr( match, context[ match ] );\r
+ }\r
+ }\r
+ }\r
+\r
+ return this;\r
+\r
+ // HANDLE: $(#id)\r
+ } else {\r
+ elem = document.getElementById( match[ 2 ] );\r
+\r
+ if ( elem ) {\r
+\r
+ // Inject the element directly into the jQuery object\r
+ this[ 0 ] = elem;\r
+ this.length = 1;\r
+ }\r
+ return this;\r
+ }\r
+\r
+ // HANDLE: $(expr, $(...))\r
+ } else if ( !context || context.jquery ) {\r
+ return ( context || root ).find( selector );\r
+\r
+ // HANDLE: $(expr, context)\r
+ // (which is just equivalent to: $(context).find(expr)\r
+ } else {\r
+ return this.constructor( context ).find( selector );\r
+ }\r
+\r
+ // HANDLE: $(DOMElement)\r
+ } else if ( selector.nodeType ) {\r
+ this[ 0 ] = selector;\r
+ this.length = 1;\r
+ return this;\r
+\r
+ // HANDLE: $(function)\r
+ // Shortcut for document ready\r
+ } else if ( isFunction( selector ) ) {\r
+ return root.ready !== undefined ?\r
+ root.ready( selector ) :\r
+\r
+ // Execute immediately if ready is not present\r
+ selector( jQuery );\r
+ }\r
+\r
+ return jQuery.makeArray( selector, this );\r
+ };\r
+\r
+// Give the init function the jQuery prototype for later instantiation\r
+init.prototype = jQuery.fn;\r
+\r
+// Initialize central reference\r
+rootjQuery = jQuery( document );\r
+\r
+\r
+var rparentsprev = /^(?:parents|prev(?:Until|All))/,\r
+\r
+ // Methods guaranteed to produce a unique set when starting from a unique set\r
+ guaranteedUnique = {\r
+ children: true,\r
+ contents: true,\r
+ next: true,\r
+ prev: true\r
+ };\r
+\r
+jQuery.fn.extend( {\r
+ has: function( target ) {\r
+ var targets = jQuery( target, this ),\r
+ l = targets.length;\r
+\r
+ return this.filter( function() {\r
+ var i = 0;\r
+ for ( ; i < l; i++ ) {\r
+ if ( jQuery.contains( this, targets[ i ] ) ) {\r
+ return true;\r
+ }\r
+ }\r
+ } );\r
+ },\r
+\r
+ closest: function( selectors, context ) {\r
+ var cur,\r
+ i = 0,\r
+ l = this.length,\r
+ matched = [],\r
+ targets = typeof selectors !== "string" && jQuery( selectors );\r
+\r
+ // Positional selectors never match, since there's no _selection_ context\r
+ if ( !rneedsContext.test( selectors ) ) {\r
+ for ( ; i < l; i++ ) {\r
+ for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {\r
+\r
+ // Always skip document fragments\r
+ if ( cur.nodeType < 11 && ( targets ?\r
+ targets.index( cur ) > -1 :\r
+\r
+ // Don't pass non-elements to Sizzle\r
+ cur.nodeType === 1 &&\r
+ jQuery.find.matchesSelector( cur, selectors ) ) ) {\r
+\r
+ matched.push( cur );\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );\r
+ },\r
+\r
+ // Determine the position of an element within the set\r
+ index: function( elem ) {\r
+\r
+ // No argument, return index in parent\r
+ if ( !elem ) {\r
+ return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;\r
+ }\r
+\r
+ // Index in selector\r
+ if ( typeof elem === "string" ) {\r
+ return indexOf.call( jQuery( elem ), this[ 0 ] );\r
+ }\r
+\r
+ // Locate the position of the desired element\r
+ return indexOf.call( this,\r
+\r
+ // If it receives a jQuery object, the first element is used\r
+ elem.jquery ? elem[ 0 ] : elem\r
+ );\r
+ },\r
+\r
+ add: function( selector, context ) {\r
+ return this.pushStack(\r
+ jQuery.uniqueSort(\r
+ jQuery.merge( this.get(), jQuery( selector, context ) )\r
+ )\r
+ );\r
+ },\r
+\r
+ addBack: function( selector ) {\r
+ return this.add( selector == null ?\r
+ this.prevObject : this.prevObject.filter( selector )\r
+ );\r
+ }\r
+} );\r
+\r
+function sibling( cur, dir ) {\r
+ while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}\r
+ return cur;\r
+}\r
+\r
+jQuery.each( {\r
+ parent: function( elem ) {\r
+ var parent = elem.parentNode;\r
+ return parent && parent.nodeType !== 11 ? parent : null;\r
+ },\r
+ parents: function( elem ) {\r
+ return dir( elem, "parentNode" );\r
+ },\r
+ parentsUntil: function( elem, _i, until ) {\r
+ return dir( elem, "parentNode", until );\r
+ },\r
+ next: function( elem ) {\r
+ return sibling( elem, "nextSibling" );\r
+ },\r
+ prev: function( elem ) {\r
+ return sibling( elem, "previousSibling" );\r
+ },\r
+ nextAll: function( elem ) {\r
+ return dir( elem, "nextSibling" );\r
+ },\r
+ prevAll: function( elem ) {\r
+ return dir( elem, "previousSibling" );\r
+ },\r
+ nextUntil: function( elem, _i, until ) {\r
+ return dir( elem, "nextSibling", until );\r
+ },\r
+ prevUntil: function( elem, _i, until ) {\r
+ return dir( elem, "previousSibling", until );\r
+ },\r
+ siblings: function( elem ) {\r
+ return siblings( ( elem.parentNode || {} ).firstChild, elem );\r
+ },\r
+ children: function( elem ) {\r
+ return siblings( elem.firstChild );\r
+ },\r
+ contents: function( elem ) {\r
+ if ( elem.contentDocument != null &&\r
+\r
+ // Support: IE 11+\r
+ // <object> elements with no `data` attribute has an object\r
+ // `contentDocument` with a `null` prototype.\r
+ getProto( elem.contentDocument ) ) {\r
+\r
+ return elem.contentDocument;\r
+ }\r
+\r
+ // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only\r
+ // Treat the template element as a regular one in browsers that\r
+ // don't support it.\r
+ if ( nodeName( elem, "template" ) ) {\r
+ elem = elem.content || elem;\r
+ }\r
+\r
+ return jQuery.merge( [], elem.childNodes );\r
+ }\r
+}, function( name, fn ) {\r
+ jQuery.fn[ name ] = function( until, selector ) {\r
+ var matched = jQuery.map( this, fn, until );\r
+\r
+ if ( name.slice( -5 ) !== "Until" ) {\r
+ selector = until;\r
+ }\r
+\r
+ if ( selector && typeof selector === "string" ) {\r
+ matched = jQuery.filter( selector, matched );\r
+ }\r
+\r
+ if ( this.length > 1 ) {\r
+\r
+ // Remove duplicates\r
+ if ( !guaranteedUnique[ name ] ) {\r
+ jQuery.uniqueSort( matched );\r
+ }\r
+\r
+ // Reverse order for parents* and prev-derivatives\r
+ if ( rparentsprev.test( name ) ) {\r
+ matched.reverse();\r
+ }\r
+ }\r
+\r
+ return this.pushStack( matched );\r
+ };\r
+} );\r
+var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );\r
+\r
+\r
+\r
+// Convert String-formatted options into Object-formatted ones\r
+function createOptions( options ) {\r
+ var object = {};\r
+ jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {\r
+ object[ flag ] = true;\r
+ } );\r
+ return object;\r
+}\r
+\r
+/*\r
+ * Create a callback list using the following parameters:\r
+ *\r
+ * options: an optional list of space-separated options that will change how\r
+ * the callback list behaves or a more traditional option object\r
+ *\r
+ * By default a callback list will act like an event callback list and can be\r
+ * "fired" multiple times.\r
+ *\r
+ * Possible options:\r
+ *\r
+ * once: will ensure the callback list can only be fired once (like a Deferred)\r
+ *\r
+ * memory: will keep track of previous values and will call any callback added\r
+ * after the list has been fired right away with the latest "memorized"\r
+ * values (like a Deferred)\r
+ *\r
+ * unique: will ensure a callback can only be added once (no duplicate in the list)\r
+ *\r
+ * stopOnFalse: interrupt callings when a callback returns false\r
+ *\r
+ */\r
+jQuery.Callbacks = function( options ) {\r
+\r
+ // Convert options from String-formatted to Object-formatted if needed\r
+ // (we check in cache first)\r
+ options = typeof options === "string" ?\r
+ createOptions( options ) :\r
+ jQuery.extend( {}, options );\r
+\r
+ var // Flag to know if list is currently firing\r
+ firing,\r
+\r
+ // Last fire value for non-forgettable lists\r
+ memory,\r
+\r
+ // Flag to know if list was already fired\r
+ fired,\r
+\r
+ // Flag to prevent firing\r
+ locked,\r
+\r
+ // Actual callback list\r
+ list = [],\r
+\r
+ // Queue of execution data for repeatable lists\r
+ queue = [],\r
+\r
+ // Index of currently firing callback (modified by add/remove as needed)\r
+ firingIndex = -1,\r
+\r
+ // Fire callbacks\r
+ fire = function() {\r
+\r
+ // Enforce single-firing\r
+ locked = locked || options.once;\r
+\r
+ // Execute callbacks for all pending executions,\r
+ // respecting firingIndex overrides and runtime changes\r
+ fired = firing = true;\r
+ for ( ; queue.length; firingIndex = -1 ) {\r
+ memory = queue.shift();\r
+ while ( ++firingIndex < list.length ) {\r
+\r
+ // Run callback and check for early termination\r
+ if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&\r
+ options.stopOnFalse ) {\r
+\r
+ // Jump to end and forget the data so .add doesn't re-fire\r
+ firingIndex = list.length;\r
+ memory = false;\r
+ }\r
+ }\r
+ }\r
+\r
+ // Forget the data if we're done with it\r
+ if ( !options.memory ) {\r
+ memory = false;\r
+ }\r
+\r
+ firing = false;\r
+\r
+ // Clean up if we're done firing for good\r
+ if ( locked ) {\r
+\r
+ // Keep an empty list if we have data for future add calls\r
+ if ( memory ) {\r
+ list = [];\r
+\r
+ // Otherwise, this object is spent\r
+ } else {\r
+ list = "";\r
+ }\r
+ }\r
+ },\r
+\r
+ // Actual Callbacks object\r
+ self = {\r
+\r
+ // Add a callback or a collection of callbacks to the list\r
+ add: function() {\r
+ if ( list ) {\r
+\r
+ // If we have memory from a past run, we should fire after adding\r
+ if ( memory && !firing ) {\r
+ firingIndex = list.length - 1;\r
+ queue.push( memory );\r
+ }\r
+\r
+ ( function add( args ) {\r
+ jQuery.each( args, function( _, arg ) {\r
+ if ( isFunction( arg ) ) {\r
+ if ( !options.unique || !self.has( arg ) ) {\r
+ list.push( arg );\r
+ }\r
+ } else if ( arg && arg.length && toType( arg ) !== "string" ) {\r
+\r
+ // Inspect recursively\r
+ add( arg );\r
+ }\r
+ } );\r
+ } )( arguments );\r
+\r
+ if ( memory && !firing ) {\r
+ fire();\r
+ }\r
+ }\r
+ return this;\r
+ },\r
+\r
+ // Remove a callback from the list\r
+ remove: function() {\r
+ jQuery.each( arguments, function( _, arg ) {\r
+ var index;\r
+ while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {\r
+ list.splice( index, 1 );\r
+\r
+ // Handle firing indexes\r
+ if ( index <= firingIndex ) {\r
+ firingIndex--;\r
+ }\r
+ }\r
+ } );\r
+ return this;\r
+ },\r
+\r
+ // Check if a given callback is in the list.\r
+ // If no argument is given, return whether or not list has callbacks attached.\r
+ has: function( fn ) {\r
+ return fn ?\r
+ jQuery.inArray( fn, list ) > -1 :\r
+ list.length > 0;\r
+ },\r
+\r
+ // Remove all callbacks from the list\r
+ empty: function() {\r
+ if ( list ) {\r
+ list = [];\r
+ }\r
+ return this;\r
+ },\r
+\r
+ // Disable .fire and .add\r
+ // Abort any current/pending executions\r
+ // Clear all callbacks and values\r
+ disable: function() {\r
+ locked = queue = [];\r
+ list = memory = "";\r
+ return this;\r
+ },\r
+ disabled: function() {\r
+ return !list;\r
+ },\r
+\r
+ // Disable .fire\r
+ // Also disable .add unless we have memory (since it would have no effect)\r
+ // Abort any pending executions\r
+ lock: function() {\r
+ locked = queue = [];\r
+ if ( !memory && !firing ) {\r
+ list = memory = "";\r
+ }\r
+ return this;\r
+ },\r
+ locked: function() {\r
+ return !!locked;\r
+ },\r
+\r
+ // Call all callbacks with the given context and arguments\r
+ fireWith: function( context, args ) {\r
+ if ( !locked ) {\r
+ args = args || [];\r
+ args = [ context, args.slice ? args.slice() : args ];\r
+ queue.push( args );\r
+ if ( !firing ) {\r
+ fire();\r
+ }\r
+ }\r
+ return this;\r
+ },\r
+\r
+ // Call all the callbacks with the given arguments\r
+ fire: function() {\r
+ self.fireWith( this, arguments );\r
+ return this;\r
+ },\r
+\r
+ // To know if the callbacks have already been called at least once\r
+ fired: function() {\r
+ return !!fired;\r
+ }\r
+ };\r
+\r
+ return self;\r
+};\r
+\r
+\r
+function Identity( v ) {\r
+ return v;\r
+}\r
+function Thrower( ex ) {\r
+ throw ex;\r
+}\r
+\r
+function adoptValue( value, resolve, reject, noValue ) {\r
+ var method;\r
+\r
+ try {\r
+\r
+ // Check for promise aspect first to privilege synchronous behavior\r
+ if ( value && isFunction( ( method = value.promise ) ) ) {\r
+ method.call( value ).done( resolve ).fail( reject );\r
+\r
+ // Other thenables\r
+ } else if ( value && isFunction( ( method = value.then ) ) ) {\r
+ method.call( value, resolve, reject );\r
+\r
+ // Other non-thenables\r
+ } else {\r
+\r
+ // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:\r
+ // * false: [ value ].slice( 0 ) => resolve( value )\r
+ // * true: [ value ].slice( 1 ) => resolve()\r
+ resolve.apply( undefined, [ value ].slice( noValue ) );\r
+ }\r
+\r
+ // For Promises/A+, convert exceptions into rejections\r
+ // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in\r
+ // Deferred#then to conditionally suppress rejection.\r
+ } catch ( value ) {\r
+\r
+ // Support: Android 4.0 only\r
+ // Strict mode functions invoked without .call/.apply get global-object context\r
+ reject.apply( undefined, [ value ] );\r
+ }\r
+}\r
+\r
+jQuery.extend( {\r
+\r
+ Deferred: function( func ) {\r
+ var tuples = [\r
+\r
+ // action, add listener, callbacks,\r
+ // ... .then handlers, argument index, [final state]\r
+ [ "notify", "progress", jQuery.Callbacks( "memory" ),\r
+ jQuery.Callbacks( "memory" ), 2 ],\r
+ [ "resolve", "done", jQuery.Callbacks( "once memory" ),\r
+ jQuery.Callbacks( "once memory" ), 0, "resolved" ],\r
+ [ "reject", "fail", jQuery.Callbacks( "once memory" ),\r
+ jQuery.Callbacks( "once memory" ), 1, "rejected" ]\r
+ ],\r
+ state = "pending",\r
+ promise = {\r
+ state: function() {\r
+ return state;\r
+ },\r
+ always: function() {\r
+ deferred.done( arguments ).fail( arguments );\r
+ return this;\r
+ },\r
+ "catch": function( fn ) {\r
+ return promise.then( null, fn );\r
+ },\r
+\r
+ // Keep pipe for back-compat\r
+ pipe: function( /* fnDone, fnFail, fnProgress */ ) {\r
+ var fns = arguments;\r
+\r
+ return jQuery.Deferred( function( newDefer ) {\r
+ jQuery.each( tuples, function( _i, tuple ) {\r
+\r
+ // Map tuples (progress, done, fail) to arguments (done, fail, progress)\r
+ var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];\r
+\r
+ // deferred.progress(function() { bind to newDefer or newDefer.notify })\r
+ // deferred.done(function() { bind to newDefer or newDefer.resolve })\r
+ // deferred.fail(function() { bind to newDefer or newDefer.reject })\r
+ deferred[ tuple[ 1 ] ]( function() {\r
+ var returned = fn && fn.apply( this, arguments );\r
+ if ( returned && isFunction( returned.promise ) ) {\r
+ returned.promise()\r
+ .progress( newDefer.notify )\r
+ .done( newDefer.resolve )\r
+ .fail( newDefer.reject );\r
+ } else {\r
+ newDefer[ tuple[ 0 ] + "With" ](\r
+ this,\r
+ fn ? [ returned ] : arguments\r
+ );\r
+ }\r
+ } );\r
+ } );\r
+ fns = null;\r
+ } ).promise();\r
+ },\r
+ then: function( onFulfilled, onRejected, onProgress ) {\r
+ var maxDepth = 0;\r
+ function resolve( depth, deferred, handler, special ) {\r
+ return function() {\r
+ var that = this,\r
+ args = arguments,\r
+ mightThrow = function() {\r
+ var returned, then;\r
+\r
+ // Support: Promises/A+ section 2.3.3.3.3\r
+ // https://promisesaplus.com/#point-59\r
+ // Ignore double-resolution attempts\r
+ if ( depth < maxDepth ) {\r
+ return;\r
+ }\r
+\r
+ returned = handler.apply( that, args );\r
+\r
+ // Support: Promises/A+ section 2.3.1\r
+ // https://promisesaplus.com/#point-48\r
+ if ( returned === deferred.promise() ) {\r
+ throw new TypeError( "Thenable self-resolution" );\r
+ }\r
+\r
+ // Support: Promises/A+ sections 2.3.3.1, 3.5\r
+ // https://promisesaplus.com/#point-54\r
+ // https://promisesaplus.com/#point-75\r
+ // Retrieve `then` only once\r
+ then = returned &&\r
+\r
+ // Support: Promises/A+ section 2.3.4\r
+ // https://promisesaplus.com/#point-64\r
+ // Only check objects and functions for thenability\r
+ ( typeof returned === "object" ||\r
+ typeof returned === "function" ) &&\r
+ returned.then;\r
+\r
+ // Handle a returned thenable\r
+ if ( isFunction( then ) ) {\r
+\r
+ // Special processors (notify) just wait for resolution\r
+ if ( special ) {\r
+ then.call(\r
+ returned,\r
+ resolve( maxDepth, deferred, Identity, special ),\r
+ resolve( maxDepth, deferred, Thrower, special )\r
+ );\r
+\r
+ // Normal processors (resolve) also hook into progress\r
+ } else {\r
+\r
+ // ...and disregard older resolution values\r
+ maxDepth++;\r
+\r
+ then.call(\r
+ returned,\r
+ resolve( maxDepth, deferred, Identity, special ),\r
+ resolve( maxDepth, deferred, Thrower, special ),\r
+ resolve( maxDepth, deferred, Identity,\r
+ deferred.notifyWith )\r
+ );\r
+ }\r
+\r
+ // Handle all other returned values\r
+ } else {\r
+\r
+ // Only substitute handlers pass on context\r
+ // and multiple values (non-spec behavior)\r
+ if ( handler !== Identity ) {\r
+ that = undefined;\r
+ args = [ returned ];\r
+ }\r
+\r
+ // Process the value(s)\r
+ // Default process is resolve\r
+ ( special || deferred.resolveWith )( that, args );\r
+ }\r
+ },\r
+\r
+ // Only normal processors (resolve) catch and reject exceptions\r
+ process = special ?\r
+ mightThrow :\r
+ function() {\r
+ try {\r
+ mightThrow();\r
+ } catch ( e ) {\r
+\r
+ if ( jQuery.Deferred.exceptionHook ) {\r
+ jQuery.Deferred.exceptionHook( e,\r
+ process.stackTrace );\r
+ }\r
+\r
+ // Support: Promises/A+ section 2.3.3.3.4.1\r
+ // https://promisesaplus.com/#point-61\r
+ // Ignore post-resolution exceptions\r
+ if ( depth + 1 >= maxDepth ) {\r
+\r
+ // Only substitute handlers pass on context\r
+ // and multiple values (non-spec behavior)\r
+ if ( handler !== Thrower ) {\r
+ that = undefined;\r
+ args = [ e ];\r
+ }\r
+\r
+ deferred.rejectWith( that, args );\r
+ }\r
+ }\r
+ };\r
+\r
+ // Support: Promises/A+ section 2.3.3.3.1\r
+ // https://promisesaplus.com/#point-57\r
+ // Re-resolve promises immediately to dodge false rejection from\r
+ // subsequent errors\r
+ if ( depth ) {\r
+ process();\r
+ } else {\r
+\r
+ // Call an optional hook to record the stack, in case of exception\r
+ // since it's otherwise lost when execution goes async\r
+ if ( jQuery.Deferred.getStackHook ) {\r
+ process.stackTrace = jQuery.Deferred.getStackHook();\r
+ }\r
+ window.setTimeout( process );\r
+ }\r
+ };\r
+ }\r
+\r
+ return jQuery.Deferred( function( newDefer ) {\r
+\r
+ // progress_handlers.add( ... )\r
+ tuples[ 0 ][ 3 ].add(\r
+ resolve(\r
+ 0,\r
+ newDefer,\r
+ isFunction( onProgress ) ?\r
+ onProgress :\r
+ Identity,\r
+ newDefer.notifyWith\r
+ )\r
+ );\r
+\r
+ // fulfilled_handlers.add( ... )\r
+ tuples[ 1 ][ 3 ].add(\r
+ resolve(\r
+ 0,\r
+ newDefer,\r
+ isFunction( onFulfilled ) ?\r
+ onFulfilled :\r
+ Identity\r
+ )\r
+ );\r
+\r
+ // rejected_handlers.add( ... )\r
+ tuples[ 2 ][ 3 ].add(\r
+ resolve(\r
+ 0,\r
+ newDefer,\r
+ isFunction( onRejected ) ?\r
+ onRejected :\r
+ Thrower\r
+ )\r
+ );\r
+ } ).promise();\r
+ },\r
+\r
+ // Get a promise for this deferred\r
+ // If obj is provided, the promise aspect is added to the object\r
+ promise: function( obj ) {\r
+ return obj != null ? jQuery.extend( obj, promise ) : promise;\r
+ }\r
+ },\r
+ deferred = {};\r
+\r
+ // Add list-specific methods\r
+ jQuery.each( tuples, function( i, tuple ) {\r
+ var list = tuple[ 2 ],\r
+ stateString = tuple[ 5 ];\r
+\r
+ // promise.progress = list.add\r
+ // promise.done = list.add\r
+ // promise.fail = list.add\r
+ promise[ tuple[ 1 ] ] = list.add;\r
+\r
+ // Handle state\r
+ if ( stateString ) {\r
+ list.add(\r
+ function() {\r
+\r
+ // state = "resolved" (i.e., fulfilled)\r
+ // state = "rejected"\r
+ state = stateString;\r
+ },\r
+\r
+ // rejected_callbacks.disable\r
+ // fulfilled_callbacks.disable\r
+ tuples[ 3 - i ][ 2 ].disable,\r
+\r
+ // rejected_handlers.disable\r
+ // fulfilled_handlers.disable\r
+ tuples[ 3 - i ][ 3 ].disable,\r
+\r
+ // progress_callbacks.lock\r
+ tuples[ 0 ][ 2 ].lock,\r
+\r
+ // progress_handlers.lock\r
+ tuples[ 0 ][ 3 ].lock\r
+ );\r
+ }\r
+\r
+ // progress_handlers.fire\r
+ // fulfilled_handlers.fire\r
+ // rejected_handlers.fire\r
+ list.add( tuple[ 3 ].fire );\r
+\r
+ // deferred.notify = function() { deferred.notifyWith(...) }\r
+ // deferred.resolve = function() { deferred.resolveWith(...) }\r
+ // deferred.reject = function() { deferred.rejectWith(...) }\r
+ deferred[ tuple[ 0 ] ] = function() {\r
+ deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );\r
+ return this;\r
+ };\r
+\r
+ // deferred.notifyWith = list.fireWith\r
+ // deferred.resolveWith = list.fireWith\r
+ // deferred.rejectWith = list.fireWith\r
+ deferred[ tuple[ 0 ] + "With" ] = list.fireWith;\r
+ } );\r
+\r
+ // Make the deferred a promise\r
+ promise.promise( deferred );\r
+\r
+ // Call given func if any\r
+ if ( func ) {\r
+ func.call( deferred, deferred );\r
+ }\r
+\r
+ // All done!\r
+ return deferred;\r
+ },\r
+\r
+ // Deferred helper\r
+ when: function( singleValue ) {\r
+ var\r
+\r
+ // count of uncompleted subordinates\r
+ remaining = arguments.length,\r
+\r
+ // count of unprocessed arguments\r
+ i = remaining,\r
+\r
+ // subordinate fulfillment data\r
+ resolveContexts = Array( i ),\r
+ resolveValues = slice.call( arguments ),\r
+\r
+ // the primary Deferred\r
+ primary = jQuery.Deferred(),\r
+\r
+ // subordinate callback factory\r
+ updateFunc = function( i ) {\r
+ return function( value ) {\r
+ resolveContexts[ i ] = this;\r
+ resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;\r
+ if ( !( --remaining ) ) {\r
+ primary.resolveWith( resolveContexts, resolveValues );\r
+ }\r
+ };\r
+ };\r
+\r
+ // Single- and empty arguments are adopted like Promise.resolve\r
+ if ( remaining <= 1 ) {\r
+ adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject,\r
+ !remaining );\r
+\r
+ // Use .then() to unwrap secondary thenables (cf. gh-3000)\r
+ if ( primary.state() === "pending" ||\r
+ isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {\r
+\r
+ return primary.then();\r
+ }\r
+ }\r
+\r
+ // Multiple arguments are aggregated like Promise.all array elements\r
+ while ( i-- ) {\r
+ adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject );\r
+ }\r
+\r
+ return primary.promise();\r
+ }\r
+} );\r
+\r
+\r
+// These usually indicate a programmer mistake during development,\r
+// warn about them ASAP rather than swallowing them by default.\r
+var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;\r
+\r
+jQuery.Deferred.exceptionHook = function( error, stack ) {\r
+\r
+ // Support: IE 8 - 9 only\r
+ // Console exists when dev tools are open, which can happen at any time\r
+ if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {\r
+ window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );\r
+ }\r
+};\r
+\r
+\r
+\r
+\r
+jQuery.readyException = function( error ) {\r
+ window.setTimeout( function() {\r
+ throw error;\r
+ } );\r
+};\r
+\r
+\r
+\r
+\r
+// The deferred used on DOM ready\r
+var readyList = jQuery.Deferred();\r
+\r
+jQuery.fn.ready = function( fn ) {\r
+\r
+ readyList\r
+ .then( fn )\r
+\r
+ // Wrap jQuery.readyException in a function so that the lookup\r
+ // happens at the time of error handling instead of callback\r
+ // registration.\r
+ .catch( function( error ) {\r
+ jQuery.readyException( error );\r
+ } );\r
+\r
+ return this;\r
+};\r
+\r
+jQuery.extend( {\r
+\r
+ // Is the DOM ready to be used? Set to true once it occurs.\r
+ isReady: false,\r
+\r
+ // A counter to track how many items to wait for before\r
+ // the ready event fires. See #6781\r
+ readyWait: 1,\r
+\r
+ // Handle when the DOM is ready\r
+ ready: function( wait ) {\r
+\r
+ // Abort if there are pending holds or we're already ready\r
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {\r
+ return;\r
+ }\r
+\r
+ // Remember that the DOM is ready\r
+ jQuery.isReady = true;\r
+\r
+ // If a normal DOM Ready event fired, decrement, and wait if need be\r
+ if ( wait !== true && --jQuery.readyWait > 0 ) {\r
+ return;\r
+ }\r
+\r
+ // If there are functions bound, to execute\r
+ readyList.resolveWith( document, [ jQuery ] );\r
+ }\r
+} );\r
+\r
+jQuery.ready.then = readyList.then;\r
+\r
+// The ready event handler and self cleanup method\r
+function completed() {\r
+ document.removeEventListener( "DOMContentLoaded", completed );\r
+ window.removeEventListener( "load", completed );\r
+ jQuery.ready();\r
+}\r
+\r
+// Catch cases where $(document).ready() is called\r
+// after the browser event has already occurred.\r
+// Support: IE <=9 - 10 only\r
+// Older IE sometimes signals "interactive" too soon\r
+if ( document.readyState === "complete" ||\r
+ ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {\r
+\r
+ // Handle it asynchronously to allow scripts the opportunity to delay ready\r
+ window.setTimeout( jQuery.ready );\r
+\r
+} else {\r
+\r
+ // Use the handy event callback\r
+ document.addEventListener( "DOMContentLoaded", completed );\r
+\r
+ // A fallback to window.onload, that will always work\r
+ window.addEventListener( "load", completed );\r
+}\r
+\r
+\r
+\r
+\r
+// Multifunctional method to get and set values of a collection\r
+// The value/s can optionally be executed if it's a function\r
+var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {\r
+ var i = 0,\r
+ len = elems.length,\r
+ bulk = key == null;\r
+\r
+ // Sets many values\r
+ if ( toType( key ) === "object" ) {\r
+ chainable = true;\r
+ for ( i in key ) {\r
+ access( elems, fn, i, key[ i ], true, emptyGet, raw );\r
+ }\r
+\r
+ // Sets one value\r
+ } else if ( value !== undefined ) {\r
+ chainable = true;\r
+\r
+ if ( !isFunction( value ) ) {\r
+ raw = true;\r
+ }\r
+\r
+ if ( bulk ) {\r
+\r
+ // Bulk operations run against the entire set\r
+ if ( raw ) {\r
+ fn.call( elems, value );\r
+ fn = null;\r
+\r
+ // ...except when executing function values\r
+ } else {\r
+ bulk = fn;\r
+ fn = function( elem, _key, value ) {\r
+ return bulk.call( jQuery( elem ), value );\r
+ };\r
+ }\r
+ }\r
+\r
+ if ( fn ) {\r
+ for ( ; i < len; i++ ) {\r
+ fn(\r
+ elems[ i ], key, raw ?\r
+ value :\r
+ value.call( elems[ i ], i, fn( elems[ i ], key ) )\r
+ );\r
+ }\r
+ }\r
+ }\r
+\r
+ if ( chainable ) {\r
+ return elems;\r
+ }\r
+\r
+ // Gets\r
+ if ( bulk ) {\r
+ return fn.call( elems );\r
+ }\r
+\r
+ return len ? fn( elems[ 0 ], key ) : emptyGet;\r
+};\r
+\r
+\r
+// Matches dashed string for camelizing\r
+var rmsPrefix = /^-ms-/,\r
+ rdashAlpha = /-([a-z])/g;\r
+\r
+// Used by camelCase as callback to replace()\r
+function fcamelCase( _all, letter ) {\r
+ return letter.toUpperCase();\r
+}\r
+\r
+// Convert dashed to camelCase; used by the css and data modules\r
+// Support: IE <=9 - 11, Edge 12 - 15\r
+// Microsoft forgot to hump their vendor prefix (#9572)\r
+function camelCase( string ) {\r
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );\r
+}\r
+var acceptData = function( owner ) {\r
+\r
+ // Accepts only:\r
+ // - Node\r
+ // - Node.ELEMENT_NODE\r
+ // - Node.DOCUMENT_NODE\r
+ // - Object\r
+ // - Any\r
+ return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );\r
+};\r
+\r
+\r
+\r
+\r
+function Data() {\r
+ this.expando = jQuery.expando + Data.uid++;\r
+}\r
+\r
+Data.uid = 1;\r
+\r
+Data.prototype = {\r
+\r
+ cache: function( owner ) {\r
+\r
+ // Check if the owner object already has a cache\r
+ var value = owner[ this.expando ];\r
+\r
+ // If not, create one\r
+ if ( !value ) {\r
+ value = {};\r
+\r
+ // We can accept data for non-element nodes in modern browsers,\r
+ // but we should not, see #8335.\r
+ // Always return an empty object.\r
+ if ( acceptData( owner ) ) {\r
+\r
+ // If it is a node unlikely to be stringify-ed or looped over\r
+ // use plain assignment\r
+ if ( owner.nodeType ) {\r
+ owner[ this.expando ] = value;\r
+\r
+ // Otherwise secure it in a non-enumerable property\r
+ // configurable must be true to allow the property to be\r
+ // deleted when data is removed\r
+ } else {\r
+ Object.defineProperty( owner, this.expando, {\r
+ value: value,\r
+ configurable: true\r
+ } );\r
+ }\r
+ }\r
+ }\r
+\r
+ return value;\r
+ },\r
+ set: function( owner, data, value ) {\r
+ var prop,\r
+ cache = this.cache( owner );\r
+\r
+ // Handle: [ owner, key, value ] args\r
+ // Always use camelCase key (gh-2257)\r
+ if ( typeof data === "string" ) {\r
+ cache[ camelCase( data ) ] = value;\r
+\r
+ // Handle: [ owner, { properties } ] args\r
+ } else {\r
+\r
+ // Copy the properties one-by-one to the cache object\r
+ for ( prop in data ) {\r
+ cache[ camelCase( prop ) ] = data[ prop ];\r
+ }\r
+ }\r
+ return cache;\r
+ },\r
+ get: function( owner, key ) {\r
+ return key === undefined ?\r
+ this.cache( owner ) :\r
+\r
+ // Always use camelCase key (gh-2257)\r
+ owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];\r
+ },\r
+ access: function( owner, key, value ) {\r
+\r
+ // In cases where either:\r
+ //\r
+ // 1. No key was specified\r
+ // 2. A string key was specified, but no value provided\r
+ //\r
+ // Take the "read" path and allow the get method to determine\r
+ // which value to return, respectively either:\r
+ //\r
+ // 1. The entire cache object\r
+ // 2. The data stored at the key\r
+ //\r
+ if ( key === undefined ||\r
+ ( ( key && typeof key === "string" ) && value === undefined ) ) {\r
+\r
+ return this.get( owner, key );\r
+ }\r
+\r
+ // When the key is not a string, or both a key and value\r
+ // are specified, set or extend (existing objects) with either:\r
+ //\r
+ // 1. An object of properties\r
+ // 2. A key and value\r
+ //\r
+ this.set( owner, key, value );\r
+\r
+ // Since the "set" path can have two possible entry points\r
+ // return the expected data based on which path was taken[*]\r
+ return value !== undefined ? value : key;\r
+ },\r
+ remove: function( owner, key ) {\r
+ var i,\r
+ cache = owner[ this.expando ];\r
+\r
+ if ( cache === undefined ) {\r
+ return;\r
+ }\r
+\r
+ if ( key !== undefined ) {\r
+\r
+ // Support array or space separated string of keys\r
+ if ( Array.isArray( key ) ) {\r
+\r
+ // If key is an array of keys...\r
+ // We always set camelCase keys, so remove that.\r
+ key = key.map( camelCase );\r
+ } else {\r
+ key = camelCase( key );\r
+\r
+ // If a key with the spaces exists, use it.\r
+ // Otherwise, create an array by matching non-whitespace\r
+ key = key in cache ?\r
+ [ key ] :\r
+ ( key.match( rnothtmlwhite ) || [] );\r
+ }\r
+\r
+ i = key.length;\r
+\r
+ while ( i-- ) {\r
+ delete cache[ key[ i ] ];\r
+ }\r
+ }\r
+\r
+ // Remove the expando if there's no more data\r
+ if ( key === undefined || jQuery.isEmptyObject( cache ) ) {\r
+\r
+ // Support: Chrome <=35 - 45\r
+ // Webkit & Blink performance suffers when deleting properties\r
+ // from DOM nodes, so set to undefined instead\r
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)\r
+ if ( owner.nodeType ) {\r
+ owner[ this.expando ] = undefined;\r
+ } else {\r
+ delete owner[ this.expando ];\r
+ }\r
+ }\r
+ },\r
+ hasData: function( owner ) {\r
+ var cache = owner[ this.expando ];\r
+ return cache !== undefined && !jQuery.isEmptyObject( cache );\r
+ }\r
+};\r
+var dataPriv = new Data();\r
+\r
+var dataUser = new Data();\r
+\r
+\r
+\r
+// Implementation Summary\r
+//\r
+// 1. Enforce API surface and semantic compatibility with 1.9.x branch\r
+// 2. Improve the module's maintainability by reducing the storage\r
+// paths to a single mechanism.\r
+// 3. Use the same single mechanism to support "private" and "user" data.\r
+// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)\r
+// 5. Avoid exposing implementation details on user objects (eg. expando properties)\r
+// 6. Provide a clear path for implementation upgrade to WeakMap in 2014\r
+\r
+var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,\r
+ rmultiDash = /[A-Z]/g;\r
+\r
+function getData( data ) {\r
+ if ( data === "true" ) {\r
+ return true;\r
+ }\r
+\r
+ if ( data === "false" ) {\r
+ return false;\r
+ }\r
+\r
+ if ( data === "null" ) {\r
+ return null;\r
+ }\r
+\r
+ // Only convert to a number if it doesn't change the string\r
+ if ( data === +data + "" ) {\r
+ return +data;\r
+ }\r
+\r
+ if ( rbrace.test( data ) ) {\r
+ return JSON.parse( data );\r
+ }\r
+\r
+ return data;\r
+}\r
+\r
+function dataAttr( elem, key, data ) {\r
+ var name;\r
+\r
+ // If nothing was found internally, try to fetch any\r
+ // data from the HTML5 data-* attribute\r
+ if ( data === undefined && elem.nodeType === 1 ) {\r
+ name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();\r
+ data = elem.getAttribute( name );\r
+\r
+ if ( typeof data === "string" ) {\r
+ try {\r
+ data = getData( data );\r
+ } catch ( e ) {}\r
+\r
+ // Make sure we set the data so it isn't changed later\r
+ dataUser.set( elem, key, data );\r
+ } else {\r
+ data = undefined;\r
+ }\r
+ }\r
+ return data;\r
+}\r
+\r
+jQuery.extend( {\r
+ hasData: function( elem ) {\r
+ return dataUser.hasData( elem ) || dataPriv.hasData( elem );\r
+ },\r
+\r
+ data: function( elem, name, data ) {\r
+ return dataUser.access( elem, name, data );\r
+ },\r
+\r
+ removeData: function( elem, name ) {\r
+ dataUser.remove( elem, name );\r
+ },\r
+\r
+ // TODO: Now that all calls to _data and _removeData have been replaced\r
+ // with direct calls to dataPriv methods, these can be deprecated.\r
+ _data: function( elem, name, data ) {\r
+ return dataPriv.access( elem, name, data );\r
+ },\r
+\r
+ _removeData: function( elem, name ) {\r
+ dataPriv.remove( elem, name );\r
+ }\r
+} );\r
+\r
+jQuery.fn.extend( {\r
+ data: function( key, value ) {\r
+ var i, name, data,\r
+ elem = this[ 0 ],\r
+ attrs = elem && elem.attributes;\r
+\r
+ // Gets all values\r
+ if ( key === undefined ) {\r
+ if ( this.length ) {\r
+ data = dataUser.get( elem );\r
+\r
+ if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {\r
+ i = attrs.length;\r
+ while ( i-- ) {\r
+\r
+ // Support: IE 11 only\r
+ // The attrs elements can be null (#14894)\r
+ if ( attrs[ i ] ) {\r
+ name = attrs[ i ].name;\r
+ if ( name.indexOf( "data-" ) === 0 ) {\r
+ name = camelCase( name.slice( 5 ) );\r
+ dataAttr( elem, name, data[ name ] );\r
+ }\r
+ }\r
+ }\r
+ dataPriv.set( elem, "hasDataAttrs", true );\r
+ }\r
+ }\r
+\r
+ return data;\r
+ }\r
+\r
+ // Sets multiple values\r
+ if ( typeof key === "object" ) {\r
+ return this.each( function() {\r
+ dataUser.set( this, key );\r
+ } );\r
+ }\r
+\r
+ return access( this, function( value ) {\r
+ var data;\r
+\r
+ // The calling jQuery object (element matches) is not empty\r
+ // (and therefore has an element appears at this[ 0 ]) and the\r
+ // `value` parameter was not undefined. An empty jQuery object\r
+ // will result in `undefined` for elem = this[ 0 ] which will\r
+ // throw an exception if an attempt to read a data cache is made.\r
+ if ( elem && value === undefined ) {\r
+\r
+ // Attempt to get data from the cache\r
+ // The key will always be camelCased in Data\r
+ data = dataUser.get( elem, key );\r
+ if ( data !== undefined ) {\r
+ return data;\r
+ }\r
+\r
+ // Attempt to "discover" the data in\r
+ // HTML5 custom data-* attrs\r
+ data = dataAttr( elem, key );\r
+ if ( data !== undefined ) {\r
+ return data;\r
+ }\r
+\r
+ // We tried really hard, but the data doesn't exist.\r
+ return;\r
+ }\r
+\r
+ // Set the data...\r
+ this.each( function() {\r
+\r
+ // We always store the camelCased key\r
+ dataUser.set( this, key, value );\r
+ } );\r
+ }, null, value, arguments.length > 1, null, true );\r
+ },\r
+\r
+ removeData: function( key ) {\r
+ return this.each( function() {\r
+ dataUser.remove( this, key );\r
+ } );\r
+ }\r
+} );\r
+\r
+\r
+jQuery.extend( {\r
+ queue: function( elem, type, data ) {\r
+ var queue;\r
+\r
+ if ( elem ) {\r
+ type = ( type || "fx" ) + "queue";\r
+ queue = dataPriv.get( elem, type );\r
+\r
+ // Speed up dequeue by getting out quickly if this is just a lookup\r
+ if ( data ) {\r
+ if ( !queue || Array.isArray( data ) ) {\r
+ queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );\r
+ } else {\r
+ queue.push( data );\r
+ }\r
+ }\r
+ return queue || [];\r
+ }\r
+ },\r
+\r
+ dequeue: function( elem, type ) {\r
+ type = type || "fx";\r
+\r
+ var queue = jQuery.queue( elem, type ),\r
+ startLength = queue.length,\r
+ fn = queue.shift(),\r
+ hooks = jQuery._queueHooks( elem, type ),\r
+ next = function() {\r
+ jQuery.dequeue( elem, type );\r
+ };\r
+\r
+ // If the fx queue is dequeued, always remove the progress sentinel\r
+ if ( fn === "inprogress" ) {\r
+ fn = queue.shift();\r
+ startLength--;\r
+ }\r
+\r
+ if ( fn ) {\r
+\r
+ // Add a progress sentinel to prevent the fx queue from being\r
+ // automatically dequeued\r
+ if ( type === "fx" ) {\r
+ queue.unshift( "inprogress" );\r
+ }\r
+\r
+ // Clear up the last queue stop function\r
+ delete hooks.stop;\r
+ fn.call( elem, next, hooks );\r
+ }\r
+\r
+ if ( !startLength && hooks ) {\r
+ hooks.empty.fire();\r
+ }\r
+ },\r
+\r
+ // Not public - generate a queueHooks object, or return the current one\r
+ _queueHooks: function( elem, type ) {\r
+ var key = type + "queueHooks";\r
+ return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {\r
+ empty: jQuery.Callbacks( "once memory" ).add( function() {\r
+ dataPriv.remove( elem, [ type + "queue", key ] );\r
+ } )\r
+ } );\r
+ }\r
+} );\r
+\r
+jQuery.fn.extend( {\r
+ queue: function( type, data ) {\r
+ var setter = 2;\r
+\r
+ if ( typeof type !== "string" ) {\r
+ data = type;\r
+ type = "fx";\r
+ setter--;\r
+ }\r
+\r
+ if ( arguments.length < setter ) {\r
+ return jQuery.queue( this[ 0 ], type );\r
+ }\r
+\r
+ return data === undefined ?\r
+ this :\r
+ this.each( function() {\r
+ var queue = jQuery.queue( this, type, data );\r
+\r
+ // Ensure a hooks for this queue\r
+ jQuery._queueHooks( this, type );\r
+\r
+ if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {\r
+ jQuery.dequeue( this, type );\r
+ }\r
+ } );\r
+ },\r
+ dequeue: function( type ) {\r
+ return this.each( function() {\r
+ jQuery.dequeue( this, type );\r
+ } );\r
+ },\r
+ clearQueue: function( type ) {\r
+ return this.queue( type || "fx", [] );\r
+ },\r
+\r
+ // Get a promise resolved when queues of a certain type\r
+ // are emptied (fx is the type by default)\r
+ promise: function( type, obj ) {\r
+ var tmp,\r
+ count = 1,\r
+ defer = jQuery.Deferred(),\r
+ elements = this,\r
+ i = this.length,\r
+ resolve = function() {\r
+ if ( !( --count ) ) {\r
+ defer.resolveWith( elements, [ elements ] );\r
+ }\r
+ };\r
+\r
+ if ( typeof type !== "string" ) {\r
+ obj = type;\r
+ type = undefined;\r
+ }\r
+ type = type || "fx";\r
+\r
+ while ( i-- ) {\r
+ tmp = dataPriv.get( elements[ i ], type + "queueHooks" );\r
+ if ( tmp && tmp.empty ) {\r
+ count++;\r
+ tmp.empty.add( resolve );\r
+ }\r
+ }\r
+ resolve();\r
+ return defer.promise( obj );\r
+ }\r
+} );\r
+var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;\r
+\r
+var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );\r
+\r
+\r
+var cssExpand = [ "Top", "Right", "Bottom", "Left" ];\r
+\r
+var documentElement = document.documentElement;\r
+\r
+\r
+\r
+ var isAttached = function( elem ) {\r
+ return jQuery.contains( elem.ownerDocument, elem );\r
+ },\r
+ composed = { composed: true };\r
+\r
+ // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only\r
+ // Check attachment across shadow DOM boundaries when possible (gh-3504)\r
+ // Support: iOS 10.0-10.2 only\r
+ // Early iOS 10 versions support `attachShadow` but not `getRootNode`,\r
+ // leading to errors. We need to check for `getRootNode`.\r
+ if ( documentElement.getRootNode ) {\r
+ isAttached = function( elem ) {\r
+ return jQuery.contains( elem.ownerDocument, elem ) ||\r
+ elem.getRootNode( composed ) === elem.ownerDocument;\r
+ };\r
+ }\r
+var isHiddenWithinTree = function( elem, el ) {\r
+\r
+ // isHiddenWithinTree might be called from jQuery#filter function;\r
+ // in that case, element will be second argument\r
+ elem = el || elem;\r
+\r
+ // Inline style trumps all\r
+ return elem.style.display === "none" ||\r
+ elem.style.display === "" &&\r
+\r
+ // Otherwise, check computed style\r
+ // Support: Firefox <=43 - 45\r
+ // Disconnected elements can have computed display: none, so first confirm that elem is\r
+ // in the document.\r
+ isAttached( elem ) &&\r
+\r
+ jQuery.css( elem, "display" ) === "none";\r
+ };\r
+\r
+\r
+\r
+function adjustCSS( elem, prop, valueParts, tween ) {\r
+ var adjusted, scale,\r
+ maxIterations = 20,\r
+ currentValue = tween ?\r
+ function() {\r
+ return tween.cur();\r
+ } :\r
+ function() {\r
+ return jQuery.css( elem, prop, "" );\r
+ },\r
+ initial = currentValue(),\r
+ unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),\r
+\r
+ // Starting value computation is required for potential unit mismatches\r
+ initialInUnit = elem.nodeType &&\r
+ ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&\r
+ rcssNum.exec( jQuery.css( elem, prop ) );\r
+\r
+ if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {\r
+\r
+ // Support: Firefox <=54\r
+ // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)\r
+ initial = initial / 2;\r
+\r
+ // Trust units reported by jQuery.css\r
+ unit = unit || initialInUnit[ 3 ];\r
+\r
+ // Iteratively approximate from a nonzero starting point\r
+ initialInUnit = +initial || 1;\r
+\r
+ while ( maxIterations-- ) {\r
+\r
+ // Evaluate and update our best guess (doubling guesses that zero out).\r
+ // Finish if the scale equals or crosses 1 (making the old*new product non-positive).\r
+ jQuery.style( elem, prop, initialInUnit + unit );\r
+ if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {\r
+ maxIterations = 0;\r
+ }\r
+ initialInUnit = initialInUnit / scale;\r
+\r
+ }\r
+\r
+ initialInUnit = initialInUnit * 2;\r
+ jQuery.style( elem, prop, initialInUnit + unit );\r
+\r
+ // Make sure we update the tween properties later on\r
+ valueParts = valueParts || [];\r
+ }\r
+\r
+ if ( valueParts ) {\r
+ initialInUnit = +initialInUnit || +initial || 0;\r
+\r
+ // Apply relative offset (+=/-=) if specified\r
+ adjusted = valueParts[ 1 ] ?\r
+ initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :\r
+ +valueParts[ 2 ];\r
+ if ( tween ) {\r
+ tween.unit = unit;\r
+ tween.start = initialInUnit;\r
+ tween.end = adjusted;\r
+ }\r
+ }\r
+ return adjusted;\r
+}\r
+\r
+\r
+var defaultDisplayMap = {};\r
+\r
+function getDefaultDisplay( elem ) {\r
+ var temp,\r
+ doc = elem.ownerDocument,\r
+ nodeName = elem.nodeName,\r
+ display = defaultDisplayMap[ nodeName ];\r
+\r
+ if ( display ) {\r
+ return display;\r
+ }\r
+\r
+ temp = doc.body.appendChild( doc.createElement( nodeName ) );\r
+ display = jQuery.css( temp, "display" );\r
+\r
+ temp.parentNode.removeChild( temp );\r
+\r
+ if ( display === "none" ) {\r
+ display = "block";\r
+ }\r
+ defaultDisplayMap[ nodeName ] = display;\r
+\r
+ return display;\r
+}\r
+\r
+function showHide( elements, show ) {\r
+ var display, elem,\r
+ values = [],\r
+ index = 0,\r
+ length = elements.length;\r
+\r
+ // Determine new display value for elements that need to change\r
+ for ( ; index < length; index++ ) {\r
+ elem = elements[ index ];\r
+ if ( !elem.style ) {\r
+ continue;\r
+ }\r
+\r
+ display = elem.style.display;\r
+ if ( show ) {\r
+\r
+ // Since we force visibility upon cascade-hidden elements, an immediate (and slow)\r
+ // check is required in this first loop unless we have a nonempty display value (either\r
+ // inline or about-to-be-restored)\r
+ if ( display === "none" ) {\r
+ values[ index ] = dataPriv.get( elem, "display" ) || null;\r
+ if ( !values[ index ] ) {\r
+ elem.style.display = "";\r
+ }\r
+ }\r
+ if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {\r
+ values[ index ] = getDefaultDisplay( elem );\r
+ }\r
+ } else {\r
+ if ( display !== "none" ) {\r
+ values[ index ] = "none";\r
+\r
+ // Remember what we're overwriting\r
+ dataPriv.set( elem, "display", display );\r
+ }\r
+ }\r
+ }\r
+\r
+ // Set the display of the elements in a second loop to avoid constant reflow\r
+ for ( index = 0; index < length; index++ ) {\r
+ if ( values[ index ] != null ) {\r
+ elements[ index ].style.display = values[ index ];\r
+ }\r
+ }\r
+\r
+ return elements;\r
+}\r
+\r
+jQuery.fn.extend( {\r
+ show: function() {\r
+ return showHide( this, true );\r
+ },\r
+ hide: function() {\r
+ return showHide( this );\r
+ },\r
+ toggle: function( state ) {\r
+ if ( typeof state === "boolean" ) {\r
+ return state ? this.show() : this.hide();\r
+ }\r
+\r
+ return this.each( function() {\r
+ if ( isHiddenWithinTree( this ) ) {\r
+ jQuery( this ).show();\r
+ } else {\r
+ jQuery( this ).hide();\r
+ }\r
+ } );\r
+ }\r
+} );\r
+var rcheckableType = ( /^(?:checkbox|radio)$/i );\r
+\r
+var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );\r
+\r
+var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );\r
+\r
+\r
+\r
+( function() {\r
+ var fragment = document.createDocumentFragment(),\r
+ div = fragment.appendChild( document.createElement( "div" ) ),\r
+ input = document.createElement( "input" );\r
+\r
+ // Support: Android 4.0 - 4.3 only\r
+ // Check state lost if the name is set (#11217)\r
+ // Support: Windows Web Apps (WWA)\r
+ // `name` and `type` must use .setAttribute for WWA (#14901)\r
+ input.setAttribute( "type", "radio" );\r
+ input.setAttribute( "checked", "checked" );\r
+ input.setAttribute( "name", "t" );\r
+\r
+ div.appendChild( input );\r
+\r
+ // Support: Android <=4.1 only\r
+ // Older WebKit doesn't clone checked state correctly in fragments\r
+ support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;\r
+\r
+ // Support: IE <=11 only\r
+ // Make sure textarea (and checkbox) defaultValue is properly cloned\r
+ div.innerHTML = "<textarea>x</textarea>";\r
+ support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;\r
+\r
+ // Support: IE <=9 only\r
+ // IE <=9 replaces <option> tags with their contents when inserted outside of\r
+ // the select element.\r
+ div.innerHTML = "<option></option>";\r
+ support.option = !!div.lastChild;\r
+} )();\r
+\r
+\r
+// We have to close these tags to support XHTML (#13200)\r
+var wrapMap = {\r
+\r
+ // XHTML parsers do not magically insert elements in the\r
+ // same way that tag soup parsers do. So we cannot shorten\r
+ // this by omitting <tbody> or other required elements.\r
+ thead: [ 1, "<table>", "</table>" ],\r
+ col: [ 2, "<table><colgroup>", "</colgroup></table>" ],\r
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],\r
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],\r
+\r
+ _default: [ 0, "", "" ]\r
+};\r
+\r
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;\r
+wrapMap.th = wrapMap.td;\r
+\r
+// Support: IE <=9 only\r
+if ( !support.option ) {\r
+ wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];\r
+}\r
+\r
+\r
+function getAll( context, tag ) {\r
+\r
+ // Support: IE <=9 - 11 only\r
+ // Use typeof to avoid zero-argument method invocation on host objects (#15151)\r
+ var ret;\r
+\r
+ if ( typeof context.getElementsByTagName !== "undefined" ) {\r
+ ret = context.getElementsByTagName( tag || "*" );\r
+\r
+ } else if ( typeof context.querySelectorAll !== "undefined" ) {\r
+ ret = context.querySelectorAll( tag || "*" );\r
+\r
+ } else {\r
+ ret = [];\r
+ }\r
+\r
+ if ( tag === undefined || tag && nodeName( context, tag ) ) {\r
+ return jQuery.merge( [ context ], ret );\r
+ }\r
+\r
+ return ret;\r
+}\r
+\r
+\r
+// Mark scripts as having already been evaluated\r
+function setGlobalEval( elems, refElements ) {\r
+ var i = 0,\r
+ l = elems.length;\r
+\r
+ for ( ; i < l; i++ ) {\r
+ dataPriv.set(\r
+ elems[ i ],\r
+ "globalEval",\r
+ !refElements || dataPriv.get( refElements[ i ], "globalEval" )\r
+ );\r
+ }\r
+}\r
+\r
+\r
+var rhtml = /<|&#?\w+;/;\r
+\r
+function buildFragment( elems, context, scripts, selection, ignored ) {\r
+ var elem, tmp, tag, wrap, attached, j,\r
+ fragment = context.createDocumentFragment(),\r
+ nodes = [],\r
+ i = 0,\r
+ l = elems.length;\r
+\r
+ for ( ; i < l; i++ ) {\r
+ elem = elems[ i ];\r
+\r
+ if ( elem || elem === 0 ) {\r
+\r
+ // Add nodes directly\r
+ if ( toType( elem ) === "object" ) {\r
+\r
+ // Support: Android <=4.0 only, PhantomJS 1 only\r
+ // push.apply(_, arraylike) throws on ancient WebKit\r
+ jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );\r
+\r
+ // Convert non-html into a text node\r
+ } else if ( !rhtml.test( elem ) ) {\r
+ nodes.push( context.createTextNode( elem ) );\r
+\r
+ // Convert html into DOM nodes\r
+ } else {\r
+ tmp = tmp || fragment.appendChild( context.createElement( "div" ) );\r
+\r
+ // Deserialize a standard representation\r
+ tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();\r
+ wrap = wrapMap[ tag ] || wrapMap._default;\r
+ tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];\r
+\r
+ // Descend through wrappers to the right content\r
+ j = wrap[ 0 ];\r
+ while ( j-- ) {\r
+ tmp = tmp.lastChild;\r
+ }\r
+\r
+ // Support: Android <=4.0 only, PhantomJS 1 only\r
+ // push.apply(_, arraylike) throws on ancient WebKit\r
+ jQuery.merge( nodes, tmp.childNodes );\r
+\r
+ // Remember the top-level container\r
+ tmp = fragment.firstChild;\r
+\r
+ // Ensure the created nodes are orphaned (#12392)\r
+ tmp.textContent = "";\r
+ }\r
+ }\r
+ }\r
+\r
+ // Remove wrapper from fragment\r
+ fragment.textContent = "";\r
+\r
+ i = 0;\r
+ while ( ( elem = nodes[ i++ ] ) ) {\r
+\r
+ // Skip elements already in the context collection (trac-4087)\r
+ if ( selection && jQuery.inArray( elem, selection ) > -1 ) {\r
+ if ( ignored ) {\r
+ ignored.push( elem );\r
+ }\r
+ continue;\r
+ }\r
+\r
+ attached = isAttached( elem );\r
+\r
+ // Append to fragment\r
+ tmp = getAll( fragment.appendChild( elem ), "script" );\r
+\r
+ // Preserve script evaluation history\r
+ if ( attached ) {\r
+ setGlobalEval( tmp );\r
+ }\r
+\r
+ // Capture executables\r
+ if ( scripts ) {\r
+ j = 0;\r
+ while ( ( elem = tmp[ j++ ] ) ) {\r
+ if ( rscriptType.test( elem.type || "" ) ) {\r
+ scripts.push( elem );\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ return fragment;\r
+}\r
+\r
+\r
+var rtypenamespace = /^([^.]*)(?:\.(.+)|)/;\r
+\r
+function returnTrue() {\r
+ return true;\r
+}\r
+\r
+function returnFalse() {\r
+ return false;\r
+}\r
+\r
+// Support: IE <=9 - 11+\r
+// focus() and blur() are asynchronous, except when they are no-op.\r
+// So expect focus to be synchronous when the element is already active,\r
+// and blur to be synchronous when the element is not already active.\r
+// (focus and blur are always synchronous in other supported browsers,\r
+// this just defines when we can count on it).\r
+function expectSync( elem, type ) {\r
+ return ( elem === safeActiveElement() ) === ( type === "focus" );\r
+}\r
+\r
+// Support: IE <=9 only\r
+// Accessing document.activeElement can throw unexpectedly\r
+// https://bugs.jquery.com/ticket/13393\r
+function safeActiveElement() {\r
+ try {\r
+ return document.activeElement;\r
+ } catch ( err ) { }\r
+}\r
+\r
+function on( elem, types, selector, data, fn, one ) {\r
+ var origFn, type;\r
+\r
+ // Types can be a map of types/handlers\r
+ if ( typeof types === "object" ) {\r
+\r
+ // ( types-Object, selector, data )\r
+ if ( typeof selector !== "string" ) {\r
+\r
+ // ( types-Object, data )\r
+ data = data || selector;\r
+ selector = undefined;\r
+ }\r
+ for ( type in types ) {\r
+ on( elem, type, selector, data, types[ type ], one );\r
+ }\r
+ return elem;\r
+ }\r
+\r
+ if ( data == null && fn == null ) {\r
+\r
+ // ( types, fn )\r
+ fn = selector;\r
+ data = selector = undefined;\r
+ } else if ( fn == null ) {\r
+ if ( typeof selector === "string" ) {\r
+\r
+ // ( types, selector, fn )\r
+ fn = data;\r
+ data = undefined;\r
+ } else {\r
+\r
+ // ( types, data, fn )\r
+ fn = data;\r
+ data = selector;\r
+ selector = undefined;\r
+ }\r
+ }\r
+ if ( fn === false ) {\r
+ fn = returnFalse;\r
+ } else if ( !fn ) {\r
+ return elem;\r
+ }\r
+\r
+ if ( one === 1 ) {\r
+ origFn = fn;\r
+ fn = function( event ) {\r
+\r
+ // Can use an empty set, since event contains the info\r
+ jQuery().off( event );\r
+ return origFn.apply( this, arguments );\r
+ };\r
+\r
+ // Use same guid so caller can remove using origFn\r
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\r
+ }\r
+ return elem.each( function() {\r
+ jQuery.event.add( this, types, fn, data, selector );\r
+ } );\r
+}\r
+\r
+/*\r
+ * Helper functions for managing events -- not part of the public interface.\r
+ * Props to Dean Edwards' addEvent library for many of the ideas.\r
+ */\r
+jQuery.event = {\r
+\r
+ global: {},\r
+\r
+ add: function( elem, types, handler, data, selector ) {\r
+\r
+ var handleObjIn, eventHandle, tmp,\r
+ events, t, handleObj,\r
+ special, handlers, type, namespaces, origType,\r
+ elemData = dataPriv.get( elem );\r
+\r
+ // Only attach events to objects that accept data\r
+ if ( !acceptData( elem ) ) {\r
+ return;\r
+ }\r
+\r
+ // Caller can pass in an object of custom data in lieu of the handler\r
+ if ( handler.handler ) {\r
+ handleObjIn = handler;\r
+ handler = handleObjIn.handler;\r
+ selector = handleObjIn.selector;\r
+ }\r
+\r
+ // Ensure that invalid selectors throw exceptions at attach time\r
+ // Evaluate against documentElement in case elem is a non-element node (e.g., document)\r
+ if ( selector ) {\r
+ jQuery.find.matchesSelector( documentElement, selector );\r
+ }\r
+\r
+ // Make sure that the handler has a unique ID, used to find/remove it later\r
+ if ( !handler.guid ) {\r
+ handler.guid = jQuery.guid++;\r
+ }\r
+\r
+ // Init the element's event structure and main handler, if this is the first\r
+ if ( !( events = elemData.events ) ) {\r
+ events = elemData.events = Object.create( null );\r
+ }\r
+ if ( !( eventHandle = elemData.handle ) ) {\r
+ eventHandle = elemData.handle = function( e ) {\r
+\r
+ // Discard the second event of a jQuery.event.trigger() and\r
+ // when an event is called after a page has unloaded\r
+ return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?\r
+ jQuery.event.dispatch.apply( elem, arguments ) : undefined;\r
+ };\r
+ }\r
+\r
+ // Handle multiple events separated by a space\r
+ types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];\r
+ t = types.length;\r
+ while ( t-- ) {\r
+ tmp = rtypenamespace.exec( types[ t ] ) || [];\r
+ type = origType = tmp[ 1 ];\r
+ namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();\r
+\r
+ // There *must* be a type, no attaching namespace-only handlers\r
+ if ( !type ) {\r
+ continue;\r
+ }\r
+\r
+ // If event changes its type, use the special event handlers for the changed type\r
+ special = jQuery.event.special[ type ] || {};\r
+\r
+ // If selector defined, determine special event api type, otherwise given type\r
+ type = ( selector ? special.delegateType : special.bindType ) || type;\r
+\r
+ // Update special based on newly reset type\r
+ special = jQuery.event.special[ type ] || {};\r
+\r
+ // handleObj is passed to all event handlers\r
+ handleObj = jQuery.extend( {\r
+ type: type,\r
+ origType: origType,\r
+ data: data,\r
+ handler: handler,\r
+ guid: handler.guid,\r
+ selector: selector,\r
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),\r
+ namespace: namespaces.join( "." )\r
+ }, handleObjIn );\r
+\r
+ // Init the event handler queue if we're the first\r
+ if ( !( handlers = events[ type ] ) ) {\r
+ handlers = events[ type ] = [];\r
+ handlers.delegateCount = 0;\r
+\r
+ // Only use addEventListener if the special events handler returns false\r
+ if ( !special.setup ||\r
+ special.setup.call( elem, data, namespaces, eventHandle ) === false ) {\r
+\r
+ if ( elem.addEventListener ) {\r
+ elem.addEventListener( type, eventHandle );\r
+ }\r
+ }\r
+ }\r
+\r
+ if ( special.add ) {\r
+ special.add.call( elem, handleObj );\r
+\r
+ if ( !handleObj.handler.guid ) {\r
+ handleObj.handler.guid = handler.guid;\r
+ }\r
+ }\r
+\r
+ // Add to the element's handler list, delegates in front\r
+ if ( selector ) {\r
+ handlers.splice( handlers.delegateCount++, 0, handleObj );\r
+ } else {\r
+ handlers.push( handleObj );\r
+ }\r
+\r
+ // Keep track of which events have ever been used, for event optimization\r
+ jQuery.event.global[ type ] = true;\r
+ }\r
+\r
+ },\r
+\r
+ // Detach an event or set of events from an element\r
+ remove: function( elem, types, handler, selector, mappedTypes ) {\r
+\r
+ var j, origCount, tmp,\r
+ events, t, handleObj,\r
+ special, handlers, type, namespaces, origType,\r
+ elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );\r
+\r
+ if ( !elemData || !( events = elemData.events ) ) {\r
+ return;\r
+ }\r
+\r
+ // Once for each type.namespace in types; type may be omitted\r
+ types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];\r
+ t = types.length;\r
+ while ( t-- ) {\r
+ tmp = rtypenamespace.exec( types[ t ] ) || [];\r
+ type = origType = tmp[ 1 ];\r
+ namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();\r
+\r
+ // Unbind all events (on this namespace, if provided) for the element\r
+ if ( !type ) {\r
+ for ( type in events ) {\r
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );\r
+ }\r
+ continue;\r
+ }\r
+\r
+ special = jQuery.event.special[ type ] || {};\r
+ type = ( selector ? special.delegateType : special.bindType ) || type;\r
+ handlers = events[ type ] || [];\r
+ tmp = tmp[ 2 ] &&\r
+ new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );\r
+\r
+ // Remove matching events\r
+ origCount = j = handlers.length;\r
+ while ( j-- ) {\r
+ handleObj = handlers[ j ];\r
+\r
+ if ( ( mappedTypes || origType === handleObj.origType ) &&\r
+ ( !handler || handler.guid === handleObj.guid ) &&\r
+ ( !tmp || tmp.test( handleObj.namespace ) ) &&\r
+ ( !selector || selector === handleObj.selector ||\r
+ selector === "**" && handleObj.selector ) ) {\r
+ handlers.splice( j, 1 );\r
+\r
+ if ( handleObj.selector ) {\r
+ handlers.delegateCount--;\r
+ }\r
+ if ( special.remove ) {\r
+ special.remove.call( elem, handleObj );\r
+ }\r
+ }\r
+ }\r
+\r
+ // Remove generic event handler if we removed something and no more handlers exist\r
+ // (avoids potential for endless recursion during removal of special event handlers)\r
+ if ( origCount && !handlers.length ) {\r
+ if ( !special.teardown ||\r
+ special.teardown.call( elem, namespaces, elemData.handle ) === false ) {\r
+\r
+ jQuery.removeEvent( elem, type, elemData.handle );\r
+ }\r
+\r
+ delete events[ type ];\r
+ }\r
+ }\r
+\r
+ // Remove data and the expando if it's no longer used\r
+ if ( jQuery.isEmptyObject( events ) ) {\r
+ dataPriv.remove( elem, "handle events" );\r
+ }\r
+ },\r
+\r
+ dispatch: function( nativeEvent ) {\r
+\r
+ var i, j, ret, matched, handleObj, handlerQueue,\r
+ args = new Array( arguments.length ),\r
+\r
+ // Make a writable jQuery.Event from the native event object\r
+ event = jQuery.event.fix( nativeEvent ),\r
+\r
+ handlers = (\r
+ dataPriv.get( this, "events" ) || Object.create( null )\r
+ )[ event.type ] || [],\r
+ special = jQuery.event.special[ event.type ] || {};\r
+\r
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event\r
+ args[ 0 ] = event;\r
+\r
+ for ( i = 1; i < arguments.length; i++ ) {\r
+ args[ i ] = arguments[ i ];\r
+ }\r
+\r
+ event.delegateTarget = this;\r
+\r
+ // Call the preDispatch hook for the mapped type, and let it bail if desired\r
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {\r
+ return;\r
+ }\r
+\r
+ // Determine handlers\r
+ handlerQueue = jQuery.event.handlers.call( this, event, handlers );\r
+\r
+ // Run delegates first; they may want to stop propagation beneath us\r
+ i = 0;\r
+ while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {\r
+ event.currentTarget = matched.elem;\r
+\r
+ j = 0;\r
+ while ( ( handleObj = matched.handlers[ j++ ] ) &&\r
+ !event.isImmediatePropagationStopped() ) {\r
+\r
+ // If the event is namespaced, then each handler is only invoked if it is\r
+ // specially universal or its namespaces are a superset of the event's.\r
+ if ( !event.rnamespace || handleObj.namespace === false ||\r
+ event.rnamespace.test( handleObj.namespace ) ) {\r
+\r
+ event.handleObj = handleObj;\r
+ event.data = handleObj.data;\r
+\r
+ ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||\r
+ handleObj.handler ).apply( matched.elem, args );\r
+\r
+ if ( ret !== undefined ) {\r
+ if ( ( event.result = ret ) === false ) {\r
+ event.preventDefault();\r
+ event.stopPropagation();\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ // Call the postDispatch hook for the mapped type\r
+ if ( special.postDispatch ) {\r
+ special.postDispatch.call( this, event );\r
+ }\r
+\r
+ return event.result;\r
+ },\r
+\r
+ handlers: function( event, handlers ) {\r
+ var i, handleObj, sel, matchedHandlers, matchedSelectors,\r
+ handlerQueue = [],\r
+ delegateCount = handlers.delegateCount,\r
+ cur = event.target;\r
+\r
+ // Find delegate handlers\r
+ if ( delegateCount &&\r
+\r
+ // Support: IE <=9\r
+ // Black-hole SVG <use> instance trees (trac-13180)\r
+ cur.nodeType &&\r
+\r
+ // Support: Firefox <=42\r
+ // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)\r
+ // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click\r
+ // Support: IE 11 only\r
+ // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)\r
+ !( event.type === "click" && event.button >= 1 ) ) {\r
+\r
+ for ( ; cur !== this; cur = cur.parentNode || this ) {\r
+\r
+ // Don't check non-elements (#13208)\r
+ // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\r
+ if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {\r
+ matchedHandlers = [];\r
+ matchedSelectors = {};\r
+ for ( i = 0; i < delegateCount; i++ ) {\r
+ handleObj = handlers[ i ];\r
+\r
+ // Don't conflict with Object.prototype properties (#13203)\r
+ sel = handleObj.selector + " ";\r
+\r
+ if ( matchedSelectors[ sel ] === undefined ) {\r
+ matchedSelectors[ sel ] = handleObj.needsContext ?\r
+ jQuery( sel, this ).index( cur ) > -1 :\r
+ jQuery.find( sel, this, null, [ cur ] ).length;\r
+ }\r
+ if ( matchedSelectors[ sel ] ) {\r
+ matchedHandlers.push( handleObj );\r
+ }\r
+ }\r
+ if ( matchedHandlers.length ) {\r
+ handlerQueue.push( { elem: cur, handlers: matchedHandlers } );\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ // Add the remaining (directly-bound) handlers\r
+ cur = this;\r
+ if ( delegateCount < handlers.length ) {\r
+ handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );\r
+ }\r
+\r
+ return handlerQueue;\r
+ },\r
+\r
+ addProp: function( name, hook ) {\r
+ Object.defineProperty( jQuery.Event.prototype, name, {\r
+ enumerable: true,\r
+ configurable: true,\r
+\r
+ get: isFunction( hook ) ?\r
+ function() {\r
+ if ( this.originalEvent ) {\r
+ return hook( this.originalEvent );\r
+ }\r
+ } :\r
+ function() {\r
+ if ( this.originalEvent ) {\r
+ return this.originalEvent[ name ];\r
+ }\r
+ },\r
+\r
+ set: function( value ) {\r
+ Object.defineProperty( this, name, {\r
+ enumerable: true,\r
+ configurable: true,\r
+ writable: true,\r
+ value: value\r
+ } );\r
+ }\r
+ } );\r
+ },\r
+\r
+ fix: function( originalEvent ) {\r
+ return originalEvent[ jQuery.expando ] ?\r
+ originalEvent :\r
+ new jQuery.Event( originalEvent );\r
+ },\r
+\r
+ special: {\r
+ load: {\r
+\r
+ // Prevent triggered image.load events from bubbling to window.load\r
+ noBubble: true\r
+ },\r
+ click: {\r
+\r
+ // Utilize native event to ensure correct state for checkable inputs\r
+ setup: function( data ) {\r
+\r
+ // For mutual compressibility with _default, replace `this` access with a local var.\r
+ // `|| data` is dead code meant only to preserve the variable through minification.\r
+ var el = this || data;\r
+\r
+ // Claim the first handler\r
+ if ( rcheckableType.test( el.type ) &&\r
+ el.click && nodeName( el, "input" ) ) {\r
+\r
+ // dataPriv.set( el, "click", ... )\r
+ leverageNative( el, "click", returnTrue );\r
+ }\r
+\r
+ // Return false to allow normal processing in the caller\r
+ return false;\r
+ },\r
+ trigger: function( data ) {\r
+\r
+ // For mutual compressibility with _default, replace `this` access with a local var.\r
+ // `|| data` is dead code meant only to preserve the variable through minification.\r
+ var el = this || data;\r
+\r
+ // Force setup before triggering a click\r
+ if ( rcheckableType.test( el.type ) &&\r
+ el.click && nodeName( el, "input" ) ) {\r
+\r
+ leverageNative( el, "click" );\r
+ }\r
+\r
+ // Return non-false to allow normal event-path propagation\r
+ return true;\r
+ },\r
+\r
+ // For cross-browser consistency, suppress native .click() on links\r
+ // Also prevent it if we're currently inside a leveraged native-event stack\r
+ _default: function( event ) {\r
+ var target = event.target;\r
+ return rcheckableType.test( target.type ) &&\r
+ target.click && nodeName( target, "input" ) &&\r
+ dataPriv.get( target, "click" ) ||\r
+ nodeName( target, "a" );\r
+ }\r
+ },\r
+\r
+ beforeunload: {\r
+ postDispatch: function( event ) {\r
+\r
+ // Support: Firefox 20+\r
+ // Firefox doesn't alert if the returnValue field is not set.\r
+ if ( event.result !== undefined && event.originalEvent ) {\r
+ event.originalEvent.returnValue = event.result;\r
+ }\r
+ }\r
+ }\r
+ }\r
+};\r
+\r
+// Ensure the presence of an event listener that handles manually-triggered\r
+// synthetic events by interrupting progress until reinvoked in response to\r
+// *native* events that it fires directly, ensuring that state changes have\r
+// already occurred before other listeners are invoked.\r
+function leverageNative( el, type, expectSync ) {\r
+\r
+ // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add\r
+ if ( !expectSync ) {\r
+ if ( dataPriv.get( el, type ) === undefined ) {\r
+ jQuery.event.add( el, type, returnTrue );\r
+ }\r
+ return;\r
+ }\r
+\r
+ // Register the controller as a special universal handler for all event namespaces\r
+ dataPriv.set( el, type, false );\r
+ jQuery.event.add( el, type, {\r
+ namespace: false,\r
+ handler: function( event ) {\r
+ var notAsync, result,\r
+ saved = dataPriv.get( this, type );\r
+\r
+ if ( ( event.isTrigger & 1 ) && this[ type ] ) {\r
+\r
+ // Interrupt processing of the outer synthetic .trigger()ed event\r
+ // Saved data should be false in such cases, but might be a leftover capture object\r
+ // from an async native handler (gh-4350)\r
+ if ( !saved.length ) {\r
+\r
+ // Store arguments for use when handling the inner native event\r
+ // There will always be at least one argument (an event object), so this array\r
+ // will not be confused with a leftover capture object.\r
+ saved = slice.call( arguments );\r
+ dataPriv.set( this, type, saved );\r
+\r
+ // Trigger the native event and capture its result\r
+ // Support: IE <=9 - 11+\r
+ // focus() and blur() are asynchronous\r
+ notAsync = expectSync( this, type );\r
+ this[ type ]();\r
+ result = dataPriv.get( this, type );\r
+ if ( saved !== result || notAsync ) {\r
+ dataPriv.set( this, type, false );\r
+ } else {\r
+ result = {};\r
+ }\r
+ if ( saved !== result ) {\r
+\r
+ // Cancel the outer synthetic event\r
+ event.stopImmediatePropagation();\r
+ event.preventDefault();\r
+\r
+ // Support: Chrome 86+\r
+ // In Chrome, if an element having a focusout handler is blurred by\r
+ // clicking outside of it, it invokes the handler synchronously. If\r
+ // that handler calls `.remove()` on the element, the data is cleared,\r
+ // leaving `result` undefined. We need to guard against this.\r
+ return result && result.value;\r
+ }\r
+\r
+ // If this is an inner synthetic event for an event with a bubbling surrogate\r
+ // (focus or blur), assume that the surrogate already propagated from triggering the\r
+ // native event and prevent that from happening again here.\r
+ // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the\r
+ // bubbling surrogate propagates *after* the non-bubbling base), but that seems\r
+ // less bad than duplication.\r
+ } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {\r
+ event.stopPropagation();\r
+ }\r
+\r
+ // If this is a native event triggered above, everything is now in order\r
+ // Fire an inner synthetic event with the original arguments\r
+ } else if ( saved.length ) {\r
+\r
+ // ...and capture the result\r
+ dataPriv.set( this, type, {\r
+ value: jQuery.event.trigger(\r
+\r
+ // Support: IE <=9 - 11+\r
+ // Extend with the prototype to reset the above stopImmediatePropagation()\r
+ jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),\r
+ saved.slice( 1 ),\r
+ this\r
+ )\r
+ } );\r
+\r
+ // Abort handling of the native event\r
+ event.stopImmediatePropagation();\r
+ }\r
+ }\r
+ } );\r
+}\r
+\r
+jQuery.removeEvent = function( elem, type, handle ) {\r
+\r
+ // This "if" is needed for plain objects\r
+ if ( elem.removeEventListener ) {\r
+ elem.removeEventListener( type, handle );\r
+ }\r
+};\r
+\r
+jQuery.Event = function( src, props ) {\r
+\r
+ // Allow instantiation without the 'new' keyword\r
+ if ( !( this instanceof jQuery.Event ) ) {\r
+ return new jQuery.Event( src, props );\r
+ }\r
+\r
+ // Event object\r
+ if ( src && src.type ) {\r
+ this.originalEvent = src;\r
+ this.type = src.type;\r
+\r
+ // Events bubbling up the document may have been marked as prevented\r
+ // by a handler lower down the tree; reflect the correct value.\r
+ this.isDefaultPrevented = src.defaultPrevented ||\r
+ src.defaultPrevented === undefined &&\r
+\r
+ // Support: Android <=2.3 only\r
+ src.returnValue === false ?\r
+ returnTrue :\r
+ returnFalse;\r
+\r
+ // Create target properties\r
+ // Support: Safari <=6 - 7 only\r
+ // Target should not be a text node (#504, #13143)\r
+ this.target = ( src.target && src.target.nodeType === 3 ) ?\r
+ src.target.parentNode :\r
+ src.target;\r
+\r
+ this.currentTarget = src.currentTarget;\r
+ this.relatedTarget = src.relatedTarget;\r
+\r
+ // Event type\r
+ } else {\r
+ this.type = src;\r
+ }\r
+\r
+ // Put explicitly provided properties onto the event object\r
+ if ( props ) {\r
+ jQuery.extend( this, props );\r
+ }\r
+\r
+ // Create a timestamp if incoming event doesn't have one\r
+ this.timeStamp = src && src.timeStamp || Date.now();\r
+\r
+ // Mark it as fixed\r
+ this[ jQuery.expando ] = true;\r
+};\r
+\r
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\r
+// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\r
+jQuery.Event.prototype = {\r
+ constructor: jQuery.Event,\r
+ isDefaultPrevented: returnFalse,\r
+ isPropagationStopped: returnFalse,\r
+ isImmediatePropagationStopped: returnFalse,\r
+ isSimulated: false,\r
+\r
+ preventDefault: function() {\r
+ var e = this.originalEvent;\r
+\r
+ this.isDefaultPrevented = returnTrue;\r
+\r
+ if ( e && !this.isSimulated ) {\r
+ e.preventDefault();\r
+ }\r
+ },\r
+ stopPropagation: function() {\r
+ var e = this.originalEvent;\r
+\r
+ this.isPropagationStopped = returnTrue;\r
+\r
+ if ( e && !this.isSimulated ) {\r
+ e.stopPropagation();\r
+ }\r
+ },\r
+ stopImmediatePropagation: function() {\r
+ var e = this.originalEvent;\r
+\r
+ this.isImmediatePropagationStopped = returnTrue;\r
+\r
+ if ( e && !this.isSimulated ) {\r
+ e.stopImmediatePropagation();\r
+ }\r
+\r
+ this.stopPropagation();\r
+ }\r
+};\r
+\r
+// Includes all common event props including KeyEvent and MouseEvent specific props\r
+jQuery.each( {\r
+ altKey: true,\r
+ bubbles: true,\r
+ cancelable: true,\r
+ changedTouches: true,\r
+ ctrlKey: true,\r
+ detail: true,\r
+ eventPhase: true,\r
+ metaKey: true,\r
+ pageX: true,\r
+ pageY: true,\r
+ shiftKey: true,\r
+ view: true,\r
+ "char": true,\r
+ code: true,\r
+ charCode: true,\r
+ key: true,\r
+ keyCode: true,\r
+ button: true,\r
+ buttons: true,\r
+ clientX: true,\r
+ clientY: true,\r
+ offsetX: true,\r
+ offsetY: true,\r
+ pointerId: true,\r
+ pointerType: true,\r
+ screenX: true,\r
+ screenY: true,\r
+ targetTouches: true,\r
+ toElement: true,\r
+ touches: true,\r
+ which: true\r
+}, jQuery.event.addProp );\r
+\r
+jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {\r
+ jQuery.event.special[ type ] = {\r
+\r
+ // Utilize native event if possible so blur/focus sequence is correct\r
+ setup: function() {\r
+\r
+ // Claim the first handler\r
+ // dataPriv.set( this, "focus", ... )\r
+ // dataPriv.set( this, "blur", ... )\r
+ leverageNative( this, type, expectSync );\r
+\r
+ // Return false to allow normal processing in the caller\r
+ return false;\r
+ },\r
+ trigger: function() {\r
+\r
+ // Force setup before trigger\r
+ leverageNative( this, type );\r
+\r
+ // Return non-false to allow normal event-path propagation\r
+ return true;\r
+ },\r
+\r
+ // Suppress native focus or blur as it's already being fired\r
+ // in leverageNative.\r
+ _default: function() {\r
+ return true;\r
+ },\r
+\r
+ delegateType: delegateType\r
+ };\r
+} );\r
+\r
+// Create mouseenter/leave events using mouseover/out and event-time checks\r
+// so that event delegation works in jQuery.\r
+// Do the same for pointerenter/pointerleave and pointerover/pointerout\r
+//\r
+// Support: Safari 7 only\r
+// Safari sends mouseenter too often; see:\r
+// https://bugs.chromium.org/p/chromium/issues/detail?id=470258\r
+// for the description of the bug (it existed in older Chrome versions as well).\r
+jQuery.each( {\r
+ mouseenter: "mouseover",\r
+ mouseleave: "mouseout",\r
+ pointerenter: "pointerover",\r
+ pointerleave: "pointerout"\r
+}, function( orig, fix ) {\r
+ jQuery.event.special[ orig ] = {\r
+ delegateType: fix,\r
+ bindType: fix,\r
+\r
+ handle: function( event ) {\r
+ var ret,\r
+ target = this,\r
+ related = event.relatedTarget,\r
+ handleObj = event.handleObj;\r
+\r
+ // For mouseenter/leave call the handler if related is outside the target.\r
+ // NB: No relatedTarget if the mouse left/entered the browser window\r
+ if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {\r
+ event.type = handleObj.origType;\r
+ ret = handleObj.handler.apply( this, arguments );\r
+ event.type = fix;\r
+ }\r
+ return ret;\r
+ }\r
+ };\r
+} );\r
+\r
+jQuery.fn.extend( {\r
+\r
+ on: function( types, selector, data, fn ) {\r
+ return on( this, types, selector, data, fn );\r
+ },\r
+ one: function( types, selector, data, fn ) {\r
+ return on( this, types, selector, data, fn, 1 );\r
+ },\r
+ off: function( types, selector, fn ) {\r
+ var handleObj, type;\r
+ if ( types && types.preventDefault && types.handleObj ) {\r
+\r
+ // ( event ) dispatched jQuery.Event\r
+ handleObj = types.handleObj;\r
+ jQuery( types.delegateTarget ).off(\r
+ handleObj.namespace ?\r
+ handleObj.origType + "." + handleObj.namespace :\r
+ handleObj.origType,\r
+ handleObj.selector,\r
+ handleObj.handler\r
+ );\r
+ return this;\r
+ }\r
+ if ( typeof types === "object" ) {\r
+\r
+ // ( types-object [, selector] )\r
+ for ( type in types ) {\r
+ this.off( type, selector, types[ type ] );\r
+ }\r
+ return this;\r
+ }\r
+ if ( selector === false || typeof selector === "function" ) {\r
+\r
+ // ( types [, fn] )\r
+ fn = selector;\r
+ selector = undefined;\r
+ }\r
+ if ( fn === false ) {\r
+ fn = returnFalse;\r
+ }\r
+ return this.each( function() {\r
+ jQuery.event.remove( this, types, fn, selector );\r
+ } );\r
+ }\r
+} );\r
+\r
+\r
+var\r
+\r
+ // Support: IE <=10 - 11, Edge 12 - 13 only\r
+ // In IE/Edge using regex groups here causes severe slowdowns.\r
+ // See https://connect.microsoft.com/IE/feedback/details/1736512/\r
+ rnoInnerhtml = /<script|<style|<link/i,\r
+\r
+ // checked="checked" or checked\r
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,\r
+ rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;\r
+\r
+// Prefer a tbody over its parent table for containing new rows\r
+function manipulationTarget( elem, content ) {\r
+ if ( nodeName( elem, "table" ) &&\r
+ nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {\r
+\r
+ return jQuery( elem ).children( "tbody" )[ 0 ] || elem;\r
+ }\r
+\r
+ return elem;\r
+}\r
+\r
+// Replace/restore the type attribute of script elements for safe DOM manipulation\r
+function disableScript( elem ) {\r
+ elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;\r
+ return elem;\r
+}\r
+function restoreScript( elem ) {\r
+ if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {\r
+ elem.type = elem.type.slice( 5 );\r
+ } else {\r
+ elem.removeAttribute( "type" );\r
+ }\r
+\r
+ return elem;\r
+}\r
+\r
+function cloneCopyEvent( src, dest ) {\r
+ var i, l, type, pdataOld, udataOld, udataCur, events;\r
+\r
+ if ( dest.nodeType !== 1 ) {\r
+ return;\r
+ }\r
+\r
+ // 1. Copy private data: events, handlers, etc.\r
+ if ( dataPriv.hasData( src ) ) {\r
+ pdataOld = dataPriv.get( src );\r
+ events = pdataOld.events;\r
+\r
+ if ( events ) {\r
+ dataPriv.remove( dest, "handle events" );\r
+\r
+ for ( type in events ) {\r
+ for ( i = 0, l = events[ type ].length; i < l; i++ ) {\r
+ jQuery.event.add( dest, type, events[ type ][ i ] );\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ // 2. Copy user data\r
+ if ( dataUser.hasData( src ) ) {\r
+ udataOld = dataUser.access( src );\r
+ udataCur = jQuery.extend( {}, udataOld );\r
+\r
+ dataUser.set( dest, udataCur );\r
+ }\r
+}\r
+\r
+// Fix IE bugs, see support tests\r
+function fixInput( src, dest ) {\r
+ var nodeName = dest.nodeName.toLowerCase();\r
+\r
+ // Fails to persist the checked state of a cloned checkbox or radio button.\r
+ if ( nodeName === "input" && rcheckableType.test( src.type ) ) {\r
+ dest.checked = src.checked;\r
+\r
+ // Fails to return the selected option to the default selected state when cloning options\r
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {\r
+ dest.defaultValue = src.defaultValue;\r
+ }\r
+}\r
+\r
+function domManip( collection, args, callback, ignored ) {\r
+\r
+ // Flatten any nested arrays\r
+ args = flat( args );\r
+\r
+ var fragment, first, scripts, hasScripts, node, doc,\r
+ i = 0,\r
+ l = collection.length,\r
+ iNoClone = l - 1,\r
+ value = args[ 0 ],\r
+ valueIsFunction = isFunction( value );\r
+\r
+ // We can't cloneNode fragments that contain checked, in WebKit\r
+ if ( valueIsFunction ||\r
+ ( l > 1 && typeof value === "string" &&\r
+ !support.checkClone && rchecked.test( value ) ) ) {\r
+ return collection.each( function( index ) {\r
+ var self = collection.eq( index );\r
+ if ( valueIsFunction ) {\r
+ args[ 0 ] = value.call( this, index, self.html() );\r
+ }\r
+ domManip( self, args, callback, ignored );\r
+ } );\r
+ }\r
+\r
+ if ( l ) {\r
+ fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );\r
+ first = fragment.firstChild;\r
+\r
+ if ( fragment.childNodes.length === 1 ) {\r
+ fragment = first;\r
+ }\r
+\r
+ // Require either new content or an interest in ignored elements to invoke the callback\r
+ if ( first || ignored ) {\r
+ scripts = jQuery.map( getAll( fragment, "script" ), disableScript );\r
+ hasScripts = scripts.length;\r
+\r
+ // Use the original fragment for the last item\r
+ // instead of the first because it can end up\r
+ // being emptied incorrectly in certain situations (#8070).\r
+ for ( ; i < l; i++ ) {\r
+ node = fragment;\r
+\r
+ if ( i !== iNoClone ) {\r
+ node = jQuery.clone( node, true, true );\r
+\r
+ // Keep references to cloned scripts for later restoration\r
+ if ( hasScripts ) {\r
+\r
+ // Support: Android <=4.0 only, PhantomJS 1 only\r
+ // push.apply(_, arraylike) throws on ancient WebKit\r
+ jQuery.merge( scripts, getAll( node, "script" ) );\r
+ }\r
+ }\r
+\r
+ callback.call( collection[ i ], node, i );\r
+ }\r
+\r
+ if ( hasScripts ) {\r
+ doc = scripts[ scripts.length - 1 ].ownerDocument;\r
+\r
+ // Reenable scripts\r
+ jQuery.map( scripts, restoreScript );\r
+\r
+ // Evaluate executable scripts on first document insertion\r
+ for ( i = 0; i < hasScripts; i++ ) {\r
+ node = scripts[ i ];\r
+ if ( rscriptType.test( node.type || "" ) &&\r
+ !dataPriv.access( node, "globalEval" ) &&\r
+ jQuery.contains( doc, node ) ) {\r
+\r
+ if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {\r
+\r
+ // Optional AJAX dependency, but won't run scripts if not present\r
+ if ( jQuery._evalUrl && !node.noModule ) {\r
+ jQuery._evalUrl( node.src, {\r
+ nonce: node.nonce || node.getAttribute( "nonce" )\r
+ }, doc );\r
+ }\r
+ } else {\r
+ DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ return collection;\r
+}\r
+\r
+function remove( elem, selector, keepData ) {\r
+ var node,\r
+ nodes = selector ? jQuery.filter( selector, elem ) : elem,\r
+ i = 0;\r
+\r
+ for ( ; ( node = nodes[ i ] ) != null; i++ ) {\r
+ if ( !keepData && node.nodeType === 1 ) {\r
+ jQuery.cleanData( getAll( node ) );\r
+ }\r
+\r
+ if ( node.parentNode ) {\r
+ if ( keepData && isAttached( node ) ) {\r
+ setGlobalEval( getAll( node, "script" ) );\r
+ }\r
+ node.parentNode.removeChild( node );\r
+ }\r
+ }\r
+\r
+ return elem;\r
+}\r
+\r
+jQuery.extend( {\r
+ htmlPrefilter: function( html ) {\r
+ return html;\r
+ },\r
+\r
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {\r
+ var i, l, srcElements, destElements,\r
+ clone = elem.cloneNode( true ),\r
+ inPage = isAttached( elem );\r
+\r
+ // Fix IE cloning issues\r
+ if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&\r
+ !jQuery.isXMLDoc( elem ) ) {\r
+\r
+ // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2\r
+ destElements = getAll( clone );\r
+ srcElements = getAll( elem );\r
+\r
+ for ( i = 0, l = srcElements.length; i < l; i++ ) {\r
+ fixInput( srcElements[ i ], destElements[ i ] );\r
+ }\r
+ }\r
+\r
+ // Copy the events from the original to the clone\r
+ if ( dataAndEvents ) {\r
+ if ( deepDataAndEvents ) {\r
+ srcElements = srcElements || getAll( elem );\r
+ destElements = destElements || getAll( clone );\r
+\r
+ for ( i = 0, l = srcElements.length; i < l; i++ ) {\r
+ cloneCopyEvent( srcElements[ i ], destElements[ i ] );\r
+ }\r
+ } else {\r
+ cloneCopyEvent( elem, clone );\r
+ }\r
+ }\r
+\r
+ // Preserve script evaluation history\r
+ destElements = getAll( clone, "script" );\r
+ if ( destElements.length > 0 ) {\r
+ setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );\r
+ }\r
+\r
+ // Return the cloned set\r
+ return clone;\r
+ },\r
+\r
+ cleanData: function( elems ) {\r
+ var data, elem, type,\r
+ special = jQuery.event.special,\r
+ i = 0;\r
+\r
+ for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {\r
+ if ( acceptData( elem ) ) {\r
+ if ( ( data = elem[ dataPriv.expando ] ) ) {\r
+ if ( data.events ) {\r
+ for ( type in data.events ) {\r
+ if ( special[ type ] ) {\r
+ jQuery.event.remove( elem, type );\r
+\r
+ // This is a shortcut to avoid jQuery.event.remove's overhead\r
+ } else {\r
+ jQuery.removeEvent( elem, type, data.handle );\r
+ }\r
+ }\r
+ }\r
+\r
+ // Support: Chrome <=35 - 45+\r
+ // Assign undefined instead of using delete, see Data#remove\r
+ elem[ dataPriv.expando ] = undefined;\r
+ }\r
+ if ( elem[ dataUser.expando ] ) {\r
+\r
+ // Support: Chrome <=35 - 45+\r
+ // Assign undefined instead of using delete, see Data#remove\r
+ elem[ dataUser.expando ] = undefined;\r
+ }\r
+ }\r
+ }\r
+ }\r
+} );\r
+\r
+jQuery.fn.extend( {\r
+ detach: function( selector ) {\r
+ return remove( this, selector, true );\r
+ },\r
+\r
+ remove: function( selector ) {\r
+ return remove( this, selector );\r
+ },\r
+\r
+ text: function( value ) {\r
+ return access( this, function( value ) {\r
+ return value === undefined ?\r
+ jQuery.text( this ) :\r
+ this.empty().each( function() {\r
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\r
+ this.textContent = value;\r
+ }\r
+ } );\r
+ }, null, value, arguments.length );\r
+ },\r
+\r
+ append: function() {\r
+ return domManip( this, arguments, function( elem ) {\r
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\r
+ var target = manipulationTarget( this, elem );\r
+ target.appendChild( elem );\r
+ }\r
+ } );\r
+ },\r
+\r
+ prepend: function() {\r
+ return domManip( this, arguments, function( elem ) {\r
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {\r
+ var target = manipulationTarget( this, elem );\r
+ target.insertBefore( elem, target.firstChild );\r
+ }\r
+ } );\r
+ },\r
+\r
+ before: function() {\r
+ return domManip( this, arguments, function( elem ) {\r
+ if ( this.parentNode ) {\r
+ this.parentNode.insertBefore( elem, this );\r
+ }\r
+ } );\r
+ },\r
+\r
+ after: function() {\r
+ return domManip( this, arguments, function( elem ) {\r
+ if ( this.parentNode ) {\r
+ this.parentNode.insertBefore( elem, this.nextSibling );\r
+ }\r
+ } );\r
+ },\r
+\r
+ empty: function() {\r
+ var elem,\r
+ i = 0;\r
+\r
+ for ( ; ( elem = this[ i ] ) != null; i++ ) {\r
+ if ( elem.nodeType === 1 ) {\r
+\r
+ // Prevent memory leaks\r
+ jQuery.cleanData( getAll( elem, false ) );\r
+\r
+ // Remove any remaining nodes\r
+ elem.textContent = "";\r
+ }\r
+ }\r
+\r
+ return this;\r
+ },\r
+\r
+ clone: function( dataAndEvents, deepDataAndEvents ) {\r
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;\r
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;\r
+\r
+ return this.map( function() {\r
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );\r
+ } );\r
+ },\r
+\r
+ html: function( value ) {\r
+ return access( this, function( value ) {\r
+ var elem = this[ 0 ] || {},\r
+ i = 0,\r
+ l = this.length;\r
+\r
+ if ( value === undefined && elem.nodeType === 1 ) {\r
+ return elem.innerHTML;\r
+ }\r
+\r
+ // See if we can take a shortcut and just use innerHTML\r
+ if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&\r
+ !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {\r
+\r
+ value = jQuery.htmlPrefilter( value );\r
+\r
+ try {\r
+ for ( ; i < l; i++ ) {\r
+ elem = this[ i ] || {};\r
+\r
+ // Remove element nodes and prevent memory leaks\r
+ if ( elem.nodeType === 1 ) {\r
+ jQuery.cleanData( getAll( elem, false ) );\r
+ elem.innerHTML = value;\r
+ }\r
+ }\r
+\r
+ elem = 0;\r
+\r
+ // If using innerHTML throws an exception, use the fallback method\r
+ } catch ( e ) {}\r
+ }\r
+\r
+ if ( elem ) {\r
+ this.empty().append( value );\r
+ }\r
+ }, null, value, arguments.length );\r
+ },\r
+\r
+ replaceWith: function() {\r
+ var ignored = [];\r
+\r
+ // Make the changes, replacing each non-ignored context element with the new content\r
+ return domManip( this, arguments, function( elem ) {\r
+ var parent = this.parentNode;\r
+\r
+ if ( jQuery.inArray( this, ignored ) < 0 ) {\r
+ jQuery.cleanData( getAll( this ) );\r
+ if ( parent ) {\r
+ parent.replaceChild( elem, this );\r
+ }\r
+ }\r
+\r
+ // Force callback invocation\r
+ }, ignored );\r
+ }\r
+} );\r
+\r
+jQuery.each( {\r
+ appendTo: "append",\r
+ prependTo: "prepend",\r
+ insertBefore: "before",\r
+ insertAfter: "after",\r
+ replaceAll: "replaceWith"\r
+}, function( name, original ) {\r
+ jQuery.fn[ name ] = function( selector ) {\r
+ var elems,\r
+ ret = [],\r
+ insert = jQuery( selector ),\r
+ last = insert.length - 1,\r
+ i = 0;\r
+\r
+ for ( ; i <= last; i++ ) {\r
+ elems = i === last ? this : this.clone( true );\r
+ jQuery( insert[ i ] )[ original ]( elems );\r
+\r
+ // Support: Android <=4.0 only, PhantomJS 1 only\r
+ // .get() because push.apply(_, arraylike) throws on ancient WebKit\r
+ push.apply( ret, elems.get() );\r
+ }\r
+\r
+ return this.pushStack( ret );\r
+ };\r
+} );\r
+var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );\r
+\r
+var getStyles = function( elem ) {\r
+\r
+ // Support: IE <=11 only, Firefox <=30 (#15098, #14150)\r
+ // IE throws on elements created in popups\r
+ // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"\r
+ var view = elem.ownerDocument.defaultView;\r
+\r
+ if ( !view || !view.opener ) {\r
+ view = window;\r
+ }\r
+\r
+ return view.getComputedStyle( elem );\r
+ };\r
+\r
+var swap = function( elem, options, callback ) {\r
+ var ret, name,\r
+ old = {};\r
+\r
+ // Remember the old values, and insert the new ones\r
+ for ( name in options ) {\r
+ old[ name ] = elem.style[ name ];\r
+ elem.style[ name ] = options[ name ];\r
+ }\r
+\r
+ ret = callback.call( elem );\r
+\r
+ // Revert the old values\r
+ for ( name in options ) {\r
+ elem.style[ name ] = old[ name ];\r
+ }\r
+\r
+ return ret;\r
+};\r
+\r
+\r
+var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );\r
+\r
+\r
+\r
+( function() {\r
+\r
+ // Executing both pixelPosition & boxSizingReliable tests require only one layout\r
+ // so they're executed at the same time to save the second computation.\r
+ function computeStyleTests() {\r
+\r
+ // This is a singleton, we need to execute it only once\r
+ if ( !div ) {\r
+ return;\r
+ }\r
+\r
+ container.style.cssText = "position:absolute;left:-11111px;width:60px;" +\r
+ "margin-top:1px;padding:0;border:0";\r
+ div.style.cssText =\r
+ "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +\r
+ "margin:auto;border:1px;padding:1px;" +\r
+ "width:60%;top:1%";\r
+ documentElement.appendChild( container ).appendChild( div );\r
+\r
+ var divStyle = window.getComputedStyle( div );\r
+ pixelPositionVal = divStyle.top !== "1%";\r
+\r
+ // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44\r
+ reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;\r
+\r
+ // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3\r
+ // Some styles come back with percentage values, even though they shouldn't\r
+ div.style.right = "60%";\r
+ pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;\r
+\r
+ // Support: IE 9 - 11 only\r
+ // Detect misreporting of content dimensions for box-sizing:border-box elements\r
+ boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;\r
+\r
+ // Support: IE 9 only\r
+ // Detect overflow:scroll screwiness (gh-3699)\r
+ // Support: Chrome <=64\r
+ // Don't get tricked when zoom affects offsetWidth (gh-4029)\r
+ div.style.position = "absolute";\r
+ scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;\r
+\r
+ documentElement.removeChild( container );\r
+\r
+ // Nullify the div so it wouldn't be stored in the memory and\r
+ // it will also be a sign that checks already performed\r
+ div = null;\r
+ }\r
+\r
+ function roundPixelMeasures( measure ) {\r
+ return Math.round( parseFloat( measure ) );\r
+ }\r
+\r
+ var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,\r
+ reliableTrDimensionsVal, reliableMarginLeftVal,\r
+ container = document.createElement( "div" ),\r
+ div = document.createElement( "div" );\r
+\r
+ // Finish early in limited (non-browser) environments\r
+ if ( !div.style ) {\r
+ return;\r
+ }\r
+\r
+ // Support: IE <=9 - 11 only\r
+ // Style of cloned element affects source element cloned (#8908)\r
+ div.style.backgroundClip = "content-box";\r
+ div.cloneNode( true ).style.backgroundClip = "";\r
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";\r
+\r
+ jQuery.extend( support, {\r
+ boxSizingReliable: function() {\r
+ computeStyleTests();\r
+ return boxSizingReliableVal;\r
+ },\r
+ pixelBoxStyles: function() {\r
+ computeStyleTests();\r
+ return pixelBoxStylesVal;\r
+ },\r
+ pixelPosition: function() {\r
+ computeStyleTests();\r
+ return pixelPositionVal;\r
+ },\r
+ reliableMarginLeft: function() {\r
+ computeStyleTests();\r
+ return reliableMarginLeftVal;\r
+ },\r
+ scrollboxSize: function() {\r
+ computeStyleTests();\r
+ return scrollboxSizeVal;\r
+ },\r
+\r
+ // Support: IE 9 - 11+, Edge 15 - 18+\r
+ // IE/Edge misreport `getComputedStyle` of table rows with width/height\r
+ // set in CSS while `offset*` properties report correct values.\r
+ // Behavior in IE 9 is more subtle than in newer versions & it passes\r
+ // some versions of this test; make sure not to make it pass there!\r
+ //\r
+ // Support: Firefox 70+\r
+ // Only Firefox includes border widths\r
+ // in computed dimensions. (gh-4529)\r
+ reliableTrDimensions: function() {\r
+ var table, tr, trChild, trStyle;\r
+ if ( reliableTrDimensionsVal == null ) {\r
+ table = document.createElement( "table" );\r
+ tr = document.createElement( "tr" );\r
+ trChild = document.createElement( "div" );\r
+\r
+ table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";\r
+ tr.style.cssText = "border:1px solid";\r
+\r
+ // Support: Chrome 86+\r
+ // Height set through cssText does not get applied.\r
+ // Computed height then comes back as 0.\r
+ tr.style.height = "1px";\r
+ trChild.style.height = "9px";\r
+\r
+ // Support: Android 8 Chrome 86+\r
+ // In our bodyBackground.html iframe,\r
+ // display for all div elements is set to "inline",\r
+ // which causes a problem only in Android 8 Chrome 86.\r
+ // Ensuring the div is display: block\r
+ // gets around this issue.\r
+ trChild.style.display = "block";\r
+\r
+ documentElement\r
+ .appendChild( table )\r
+ .appendChild( tr )\r
+ .appendChild( trChild );\r
+\r
+ trStyle = window.getComputedStyle( tr );\r
+ reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) +\r
+ parseInt( trStyle.borderTopWidth, 10 ) +\r
+ parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight;\r
+\r
+ documentElement.removeChild( table );\r
+ }\r
+ return reliableTrDimensionsVal;\r
+ }\r
+ } );\r
+} )();\r
+\r
+\r
+function curCSS( elem, name, computed ) {\r
+ var width, minWidth, maxWidth, ret,\r
+\r
+ // Support: Firefox 51+\r
+ // Retrieving style before computed somehow\r
+ // fixes an issue with getting wrong values\r
+ // on detached elements\r
+ style = elem.style;\r
+\r
+ computed = computed || getStyles( elem );\r
+\r
+ // getPropertyValue is needed for:\r
+ // .css('filter') (IE 9 only, #12537)\r
+ // .css('--customProperty) (#3144)\r
+ if ( computed ) {\r
+ ret = computed.getPropertyValue( name ) || computed[ name ];\r
+\r
+ if ( ret === "" && !isAttached( elem ) ) {\r
+ ret = jQuery.style( elem, name );\r
+ }\r
+\r
+ // A tribute to the "awesome hack by Dean Edwards"\r
+ // Android Browser returns percentage for some values,\r
+ // but width seems to be reliably pixels.\r
+ // This is against the CSSOM draft spec:\r
+ // https://drafts.csswg.org/cssom/#resolved-values\r
+ if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {\r
+\r
+ // Remember the original values\r
+ width = style.width;\r
+ minWidth = style.minWidth;\r
+ maxWidth = style.maxWidth;\r
+\r
+ // Put in the new values to get a computed value out\r
+ style.minWidth = style.maxWidth = style.width = ret;\r
+ ret = computed.width;\r
+\r
+ // Revert the changed values\r
+ style.width = width;\r
+ style.minWidth = minWidth;\r
+ style.maxWidth = maxWidth;\r
+ }\r
+ }\r
+\r
+ return ret !== undefined ?\r
+\r
+ // Support: IE <=9 - 11 only\r
+ // IE returns zIndex value as an integer.\r
+ ret + "" :\r
+ ret;\r
+}\r
+\r
+\r
+function addGetHookIf( conditionFn, hookFn ) {\r
+\r
+ // Define the hook, we'll check on the first run if it's really needed.\r
+ return {\r
+ get: function() {\r
+ if ( conditionFn() ) {\r
+\r
+ // Hook not needed (or it's not possible to use it due\r
+ // to missing dependency), remove it.\r
+ delete this.get;\r
+ return;\r
+ }\r
+\r
+ // Hook needed; redefine it so that the support test is not executed again.\r
+ return ( this.get = hookFn ).apply( this, arguments );\r
+ }\r
+ };\r
+}\r
+\r
+\r
+var cssPrefixes = [ "Webkit", "Moz", "ms" ],\r
+ emptyStyle = document.createElement( "div" ).style,\r
+ vendorProps = {};\r
+\r
+// Return a vendor-prefixed property or undefined\r
+function vendorPropName( name ) {\r
+\r
+ // Check for vendor prefixed names\r
+ var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),\r
+ i = cssPrefixes.length;\r
+\r
+ while ( i-- ) {\r
+ name = cssPrefixes[ i ] + capName;\r
+ if ( name in emptyStyle ) {\r
+ return name;\r
+ }\r
+ }\r
+}\r
+\r
+// Return a potentially-mapped jQuery.cssProps or vendor prefixed property\r
+function finalPropName( name ) {\r
+ var final = jQuery.cssProps[ name ] || vendorProps[ name ];\r
+\r
+ if ( final ) {\r
+ return final;\r
+ }\r
+ if ( name in emptyStyle ) {\r
+ return name;\r
+ }\r
+ return vendorProps[ name ] = vendorPropName( name ) || name;\r
+}\r
+\r
+\r
+var\r
+\r
+ // Swappable if display is none or starts with table\r
+ // except "table", "table-cell", or "table-caption"\r
+ // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display\r
+ rdisplayswap = /^(none|table(?!-c[ea]).+)/,\r
+ rcustomProp = /^--/,\r
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },\r
+ cssNormalTransform = {\r
+ letterSpacing: "0",\r
+ fontWeight: "400"\r
+ };\r
+\r
+function setPositiveNumber( _elem, value, subtract ) {\r
+\r
+ // Any relative (+/-) values have already been\r
+ // normalized at this point\r
+ var matches = rcssNum.exec( value );\r
+ return matches ?\r
+\r
+ // Guard against undefined "subtract", e.g., when used as in cssHooks\r
+ Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :\r
+ value;\r
+}\r
+\r
+function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {\r
+ var i = dimension === "width" ? 1 : 0,\r
+ extra = 0,\r
+ delta = 0;\r
+\r
+ // Adjustment may not be necessary\r
+ if ( box === ( isBorderBox ? "border" : "content" ) ) {\r
+ return 0;\r
+ }\r
+\r
+ for ( ; i < 4; i += 2 ) {\r
+\r
+ // Both box models exclude margin\r
+ if ( box === "margin" ) {\r
+ delta += jQuery.css( elem, box + cssExpand[ i ], true, styles );\r
+ }\r
+\r
+ // If we get here with a content-box, we're seeking "padding" or "border" or "margin"\r
+ if ( !isBorderBox ) {\r
+\r
+ // Add padding\r
+ delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );\r
+\r
+ // For "border" or "margin", add border\r
+ if ( box !== "padding" ) {\r
+ delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );\r
+\r
+ // But still keep track of it otherwise\r
+ } else {\r
+ extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );\r
+ }\r
+\r
+ // If we get here with a border-box (content + padding + border), we're seeking "content" or\r
+ // "padding" or "margin"\r
+ } else {\r
+\r
+ // For "content", subtract padding\r
+ if ( box === "content" ) {\r
+ delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );\r
+ }\r
+\r
+ // For "content" or "padding", subtract border\r
+ if ( box !== "margin" ) {\r
+ delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );\r
+ }\r
+ }\r
+ }\r
+\r
+ // Account for positive content-box scroll gutter when requested by providing computedVal\r
+ if ( !isBorderBox && computedVal >= 0 ) {\r
+\r
+ // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border\r
+ // Assuming integer scroll gutter, subtract the rest and round down\r
+ delta += Math.max( 0, Math.ceil(\r
+ elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\r
+ computedVal -\r
+ delta -\r
+ extra -\r
+ 0.5\r
+\r
+ // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter\r
+ // Use an explicit zero to avoid NaN (gh-3964)\r
+ ) ) || 0;\r
+ }\r
+\r
+ return delta;\r
+}\r
+\r
+function getWidthOrHeight( elem, dimension, extra ) {\r
+\r
+ // Start with computed style\r
+ var styles = getStyles( elem ),\r
+\r
+ // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).\r
+ // Fake content-box until we know it's needed to know the true value.\r
+ boxSizingNeeded = !support.boxSizingReliable() || extra,\r
+ isBorderBox = boxSizingNeeded &&\r
+ jQuery.css( elem, "boxSizing", false, styles ) === "border-box",\r
+ valueIsBorderBox = isBorderBox,\r
+\r
+ val = curCSS( elem, dimension, styles ),\r
+ offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );\r
+\r
+ // Support: Firefox <=54\r
+ // Return a confounding non-pixel value or feign ignorance, as appropriate.\r
+ if ( rnumnonpx.test( val ) ) {\r
+ if ( !extra ) {\r
+ return val;\r
+ }\r
+ val = "auto";\r
+ }\r
+\r
+\r
+ // Support: IE 9 - 11 only\r
+ // Use offsetWidth/offsetHeight for when box sizing is unreliable.\r
+ // In those cases, the computed value can be trusted to be border-box.\r
+ if ( ( !support.boxSizingReliable() && isBorderBox ||\r
+\r
+ // Support: IE 10 - 11+, Edge 15 - 18+\r
+ // IE/Edge misreport `getComputedStyle` of table rows with width/height\r
+ // set in CSS while `offset*` properties report correct values.\r
+ // Interestingly, in some cases IE 9 doesn't suffer from this issue.\r
+ !support.reliableTrDimensions() && nodeName( elem, "tr" ) ||\r
+\r
+ // Fall back to offsetWidth/offsetHeight when value is "auto"\r
+ // This happens for inline elements with no explicit setting (gh-3571)\r
+ val === "auto" ||\r
+\r
+ // Support: Android <=4.1 - 4.3 only\r
+ // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)\r
+ !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&\r
+\r
+ // Make sure the element is visible & connected\r
+ elem.getClientRects().length ) {\r
+\r
+ isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";\r
+\r
+ // Where available, offsetWidth/offsetHeight approximate border box dimensions.\r
+ // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the\r
+ // retrieved value as a content box dimension.\r
+ valueIsBorderBox = offsetProp in elem;\r
+ if ( valueIsBorderBox ) {\r
+ val = elem[ offsetProp ];\r
+ }\r
+ }\r
+\r
+ // Normalize "" and auto\r
+ val = parseFloat( val ) || 0;\r
+\r
+ // Adjust for the element's box model\r
+ return ( val +\r
+ boxModelAdjustment(\r
+ elem,\r
+ dimension,\r
+ extra || ( isBorderBox ? "border" : "content" ),\r
+ valueIsBorderBox,\r
+ styles,\r
+\r
+ // Provide the current computed size to request scroll gutter calculation (gh-3589)\r
+ val\r
+ )\r
+ ) + "px";\r
+}\r
+\r
+jQuery.extend( {\r
+\r
+ // Add in style property hooks for overriding the default\r
+ // behavior of getting and setting a style property\r
+ cssHooks: {\r
+ opacity: {\r
+ get: function( elem, computed ) {\r
+ if ( computed ) {\r
+\r
+ // We should always get a number back from opacity\r
+ var ret = curCSS( elem, "opacity" );\r
+ return ret === "" ? "1" : ret;\r
+ }\r
+ }\r
+ }\r
+ },\r
+\r
+ // Don't automatically add "px" to these possibly-unitless properties\r
+ cssNumber: {\r
+ "animationIterationCount": true,\r
+ "columnCount": true,\r
+ "fillOpacity": true,\r
+ "flexGrow": true,\r
+ "flexShrink": true,\r
+ "fontWeight": true,\r
+ "gridArea": true,\r
+ "gridColumn": true,\r
+ "gridColumnEnd": true,\r
+ "gridColumnStart": true,\r
+ "gridRow": true,\r
+ "gridRowEnd": true,\r
+ "gridRowStart": true,\r
+ "lineHeight": true,\r
+ "opacity": true,\r
+ "order": true,\r
+ "orphans": true,\r
+ "widows": true,\r
+ "zIndex": true,\r
+ "zoom": true\r
+ },\r
+\r
+ // Add in properties whose names you wish to fix before\r
+ // setting or getting the value\r
+ cssProps: {},\r
+\r
+ // Get and set the style property on a DOM Node\r
+ style: function( elem, name, value, extra ) {\r
+\r
+ // Don't set styles on text and comment nodes\r
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {\r
+ return;\r
+ }\r
+\r
+ // Make sure that we're working with the right name\r
+ var ret, type, hooks,\r
+ origName = camelCase( name ),\r
+ isCustomProp = rcustomProp.test( name ),\r
+ style = elem.style;\r
+\r
+ // Make sure that we're working with the right name. We don't\r
+ // want to query the value if it is a CSS custom property\r
+ // since they are user-defined.\r
+ if ( !isCustomProp ) {\r
+ name = finalPropName( origName );\r
+ }\r
+\r
+ // Gets hook for the prefixed version, then unprefixed version\r
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\r
+\r
+ // Check if we're setting a value\r
+ if ( value !== undefined ) {\r
+ type = typeof value;\r
+\r
+ // Convert "+=" or "-=" to relative numbers (#7345)\r
+ if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {\r
+ value = adjustCSS( elem, name, ret );\r
+\r
+ // Fixes bug #9237\r
+ type = "number";\r
+ }\r
+\r
+ // Make sure that null and NaN values aren't set (#7116)\r
+ if ( value == null || value !== value ) {\r
+ return;\r
+ }\r
+\r
+ // If a number was passed in, add the unit (except for certain CSS properties)\r
+ // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append\r
+ // "px" to a few hardcoded values.\r
+ if ( type === "number" && !isCustomProp ) {\r
+ value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );\r
+ }\r
+\r
+ // background-* props affect original clone's values\r
+ if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {\r
+ style[ name ] = "inherit";\r
+ }\r
+\r
+ // If a hook was provided, use that value, otherwise just set the specified value\r
+ if ( !hooks || !( "set" in hooks ) ||\r
+ ( value = hooks.set( elem, value, extra ) ) !== undefined ) {\r
+\r
+ if ( isCustomProp ) {\r
+ style.setProperty( name, value );\r
+ } else {\r
+ style[ name ] = value;\r
+ }\r
+ }\r
+\r
+ } else {\r
+\r
+ // If a hook was provided get the non-computed value from there\r
+ if ( hooks && "get" in hooks &&\r
+ ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {\r
+\r
+ return ret;\r
+ }\r
+\r
+ // Otherwise just get the value from the style object\r
+ return style[ name ];\r
+ }\r
+ },\r
+\r
+ css: function( elem, name, extra, styles ) {\r
+ var val, num, hooks,\r
+ origName = camelCase( name ),\r
+ isCustomProp = rcustomProp.test( name );\r
+\r
+ // Make sure that we're working with the right name. We don't\r
+ // want to modify the value if it is a CSS custom property\r
+ // since they are user-defined.\r
+ if ( !isCustomProp ) {\r
+ name = finalPropName( origName );\r
+ }\r
+\r
+ // Try prefixed name followed by the unprefixed name\r
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];\r
+\r
+ // If a hook was provided get the computed value from there\r
+ if ( hooks && "get" in hooks ) {\r
+ val = hooks.get( elem, true, extra );\r
+ }\r
+\r
+ // Otherwise, if a way to get the computed value exists, use that\r
+ if ( val === undefined ) {\r
+ val = curCSS( elem, name, styles );\r
+ }\r
+\r
+ // Convert "normal" to computed value\r
+ if ( val === "normal" && name in cssNormalTransform ) {\r
+ val = cssNormalTransform[ name ];\r
+ }\r
+\r
+ // Make numeric if forced or a qualifier was provided and val looks numeric\r
+ if ( extra === "" || extra ) {\r
+ num = parseFloat( val );\r
+ return extra === true || isFinite( num ) ? num || 0 : val;\r
+ }\r
+\r
+ return val;\r
+ }\r
+} );\r
+\r
+jQuery.each( [ "height", "width" ], function( _i, dimension ) {\r
+ jQuery.cssHooks[ dimension ] = {\r
+ get: function( elem, computed, extra ) {\r
+ if ( computed ) {\r
+\r
+ // Certain elements can have dimension info if we invisibly show them\r
+ // but it must have a current display style that would benefit\r
+ return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&\r
+\r
+ // Support: Safari 8+\r
+ // Table columns in Safari have non-zero offsetWidth & zero\r
+ // getBoundingClientRect().width unless display is changed.\r
+ // Support: IE <=11 only\r
+ // Running getBoundingClientRect on a disconnected node\r
+ // in IE throws an error.\r
+ ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?\r
+ swap( elem, cssShow, function() {\r
+ return getWidthOrHeight( elem, dimension, extra );\r
+ } ) :\r
+ getWidthOrHeight( elem, dimension, extra );\r
+ }\r
+ },\r
+\r
+ set: function( elem, value, extra ) {\r
+ var matches,\r
+ styles = getStyles( elem ),\r
+\r
+ // Only read styles.position if the test has a chance to fail\r
+ // to avoid forcing a reflow.\r
+ scrollboxSizeBuggy = !support.scrollboxSize() &&\r
+ styles.position === "absolute",\r
+\r
+ // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)\r
+ boxSizingNeeded = scrollboxSizeBuggy || extra,\r
+ isBorderBox = boxSizingNeeded &&\r
+ jQuery.css( elem, "boxSizing", false, styles ) === "border-box",\r
+ subtract = extra ?\r
+ boxModelAdjustment(\r
+ elem,\r
+ dimension,\r
+ extra,\r
+ isBorderBox,\r
+ styles\r
+ ) :\r
+ 0;\r
+\r
+ // Account for unreliable border-box dimensions by comparing offset* to computed and\r
+ // faking a content-box to get border and padding (gh-3699)\r
+ if ( isBorderBox && scrollboxSizeBuggy ) {\r
+ subtract -= Math.ceil(\r
+ elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -\r
+ parseFloat( styles[ dimension ] ) -\r
+ boxModelAdjustment( elem, dimension, "border", false, styles ) -\r
+ 0.5\r
+ );\r
+ }\r
+\r
+ // Convert to pixels if value adjustment is needed\r
+ if ( subtract && ( matches = rcssNum.exec( value ) ) &&\r
+ ( matches[ 3 ] || "px" ) !== "px" ) {\r
+\r
+ elem.style[ dimension ] = value;\r
+ value = jQuery.css( elem, dimension );\r
+ }\r
+\r
+ return setPositiveNumber( elem, value, subtract );\r
+ }\r
+ };\r
+} );\r
+\r
+jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,\r
+ function( elem, computed ) {\r
+ if ( computed ) {\r
+ return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||\r
+ elem.getBoundingClientRect().left -\r
+ swap( elem, { marginLeft: 0 }, function() {\r
+ return elem.getBoundingClientRect().left;\r
+ } )\r
+ ) + "px";\r
+ }\r
+ }\r
+);\r
+\r
+// These hooks are used by animate to expand properties\r
+jQuery.each( {\r
+ margin: "",\r
+ padding: "",\r
+ border: "Width"\r
+}, function( prefix, suffix ) {\r
+ jQuery.cssHooks[ prefix + suffix ] = {\r
+ expand: function( value ) {\r
+ var i = 0,\r
+ expanded = {},\r
+\r
+ // Assumes a single number if not a string\r
+ parts = typeof value === "string" ? value.split( " " ) : [ value ];\r
+\r
+ for ( ; i < 4; i++ ) {\r
+ expanded[ prefix + cssExpand[ i ] + suffix ] =\r
+ parts[ i ] || parts[ i - 2 ] || parts[ 0 ];\r
+ }\r
+\r
+ return expanded;\r
+ }\r
+ };\r
+\r
+ if ( prefix !== "margin" ) {\r
+ jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;\r
+ }\r
+} );\r
+\r
+jQuery.fn.extend( {\r
+ css: function( name, value ) {\r
+ return access( this, function( elem, name, value ) {\r
+ var styles, len,\r
+ map = {},\r
+ i = 0;\r
+\r
+ if ( Array.isArray( name ) ) {\r
+ styles = getStyles( elem );\r
+ len = name.length;\r
+\r
+ for ( ; i < len; i++ ) {\r
+ map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );\r
+ }\r
+\r
+ return map;\r
+ }\r
+\r
+ return value !== undefined ?\r
+ jQuery.style( elem, name, value ) :\r
+ jQuery.css( elem, name );\r
+ }, name, value, arguments.length > 1 );\r
+ }\r
+} );\r
+\r
+\r
+function Tween( elem, options, prop, end, easing ) {\r
+ return new Tween.prototype.init( elem, options, prop, end, easing );\r
+}\r
+jQuery.Tween = Tween;\r
+\r
+Tween.prototype = {\r
+ constructor: Tween,\r
+ init: function( elem, options, prop, end, easing, unit ) {\r
+ this.elem = elem;\r
+ this.prop = prop;\r
+ this.easing = easing || jQuery.easing._default;\r
+ this.options = options;\r
+ this.start = this.now = this.cur();\r
+ this.end = end;\r
+ this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );\r
+ },\r
+ cur: function() {\r
+ var hooks = Tween.propHooks[ this.prop ];\r
+\r
+ return hooks && hooks.get ?\r
+ hooks.get( this ) :\r
+ Tween.propHooks._default.get( this );\r
+ },\r
+ run: function( percent ) {\r
+ var eased,\r
+ hooks = Tween.propHooks[ this.prop ];\r
+\r
+ if ( this.options.duration ) {\r
+ this.pos = eased = jQuery.easing[ this.easing ](\r
+ percent, this.options.duration * percent, 0, 1, this.options.duration\r
+ );\r
+ } else {\r
+ this.pos = eased = percent;\r
+ }\r
+ this.now = ( this.end - this.start ) * eased + this.start;\r
+\r
+ if ( this.options.step ) {\r
+ this.options.step.call( this.elem, this.now, this );\r
+ }\r
+\r
+ if ( hooks && hooks.set ) {\r
+ hooks.set( this );\r
+ } else {\r
+ Tween.propHooks._default.set( this );\r
+ }\r
+ return this;\r
+ }\r
+};\r
+\r
+Tween.prototype.init.prototype = Tween.prototype;\r
+\r
+Tween.propHooks = {\r
+ _default: {\r
+ get: function( tween ) {\r
+ var result;\r
+\r
+ // Use a property on the element directly when it is not a DOM element,\r
+ // or when there is no matching style property that exists.\r
+ if ( tween.elem.nodeType !== 1 ||\r
+ tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {\r
+ return tween.elem[ tween.prop ];\r
+ }\r
+\r
+ // Passing an empty string as a 3rd parameter to .css will automatically\r
+ // attempt a parseFloat and fallback to a string if the parse fails.\r
+ // Simple values such as "10px" are parsed to Float;\r
+ // complex values such as "rotate(1rad)" are returned as-is.\r
+ result = jQuery.css( tween.elem, tween.prop, "" );\r
+\r
+ // Empty strings, null, undefined and "auto" are converted to 0.\r
+ return !result || result === "auto" ? 0 : result;\r
+ },\r
+ set: function( tween ) {\r
+\r
+ // Use step hook for back compat.\r
+ // Use cssHook if its there.\r
+ // Use .style if available and use plain properties where available.\r
+ if ( jQuery.fx.step[ tween.prop ] ) {\r
+ jQuery.fx.step[ tween.prop ]( tween );\r
+ } else if ( tween.elem.nodeType === 1 && (\r
+ jQuery.cssHooks[ tween.prop ] ||\r
+ tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {\r
+ jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );\r
+ } else {\r
+ tween.elem[ tween.prop ] = tween.now;\r
+ }\r
+ }\r
+ }\r
+};\r
+\r
+// Support: IE <=9 only\r
+// Panic based approach to setting things on disconnected nodes\r
+Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {\r
+ set: function( tween ) {\r
+ if ( tween.elem.nodeType && tween.elem.parentNode ) {\r
+ tween.elem[ tween.prop ] = tween.now;\r
+ }\r
+ }\r
+};\r
+\r
+jQuery.easing = {\r
+ linear: function( p ) {\r
+ return p;\r
+ },\r
+ swing: function( p ) {\r
+ return 0.5 - Math.cos( p * Math.PI ) / 2;\r
+ },\r
+ _default: "swing"\r
+};\r
+\r
+jQuery.fx = Tween.prototype.init;\r
+\r
+// Back compat <1.8 extension point\r
+jQuery.fx.step = {};\r
+\r
+\r
+\r
+\r
+var\r
+ fxNow, inProgress,\r
+ rfxtypes = /^(?:toggle|show|hide)$/,\r
+ rrun = /queueHooks$/;\r
+\r
+function schedule() {\r
+ if ( inProgress ) {\r
+ if ( document.hidden === false && window.requestAnimationFrame ) {\r
+ window.requestAnimationFrame( schedule );\r
+ } else {\r
+ window.setTimeout( schedule, jQuery.fx.interval );\r
+ }\r
+\r
+ jQuery.fx.tick();\r
+ }\r
+}\r
+\r
+// Animations created synchronously will run synchronously\r
+function createFxNow() {\r
+ window.setTimeout( function() {\r
+ fxNow = undefined;\r
+ } );\r
+ return ( fxNow = Date.now() );\r
+}\r
+\r
+// Generate parameters to create a standard animation\r
+function genFx( type, includeWidth ) {\r
+ var which,\r
+ i = 0,\r
+ attrs = { height: type };\r
+\r
+ // If we include width, step value is 1 to do all cssExpand values,\r
+ // otherwise step value is 2 to skip over Left and Right\r
+ includeWidth = includeWidth ? 1 : 0;\r
+ for ( ; i < 4; i += 2 - includeWidth ) {\r
+ which = cssExpand[ i ];\r
+ attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;\r
+ }\r
+\r
+ if ( includeWidth ) {\r
+ attrs.opacity = attrs.width = type;\r
+ }\r
+\r
+ return attrs;\r
+}\r
+\r
+function createTween( value, prop, animation ) {\r
+ var tween,\r
+ collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),\r
+ index = 0,\r
+ length = collection.length;\r
+ for ( ; index < length; index++ ) {\r
+ if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {\r
+\r
+ // We're done with this property\r
+ return tween;\r
+ }\r
+ }\r
+}\r
+\r
+function defaultPrefilter( elem, props, opts ) {\r
+ var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,\r
+ isBox = "width" in props || "height" in props,\r
+ anim = this,\r
+ orig = {},\r
+ style = elem.style,\r
+ hidden = elem.nodeType && isHiddenWithinTree( elem ),\r
+ dataShow = dataPriv.get( elem, "fxshow" );\r
+\r
+ // Queue-skipping animations hijack the fx hooks\r
+ if ( !opts.queue ) {\r
+ hooks = jQuery._queueHooks( elem, "fx" );\r
+ if ( hooks.unqueued == null ) {\r
+ hooks.unqueued = 0;\r
+ oldfire = hooks.empty.fire;\r
+ hooks.empty.fire = function() {\r
+ if ( !hooks.unqueued ) {\r
+ oldfire();\r
+ }\r
+ };\r
+ }\r
+ hooks.unqueued++;\r
+\r
+ anim.always( function() {\r
+\r
+ // Ensure the complete handler is called before this completes\r
+ anim.always( function() {\r
+ hooks.unqueued--;\r
+ if ( !jQuery.queue( elem, "fx" ).length ) {\r
+ hooks.empty.fire();\r
+ }\r
+ } );\r
+ } );\r
+ }\r
+\r
+ // Detect show/hide animations\r
+ for ( prop in props ) {\r
+ value = props[ prop ];\r
+ if ( rfxtypes.test( value ) ) {\r
+ delete props[ prop ];\r
+ toggle = toggle || value === "toggle";\r
+ if ( value === ( hidden ? "hide" : "show" ) ) {\r
+\r
+ // Pretend to be hidden if this is a "show" and\r
+ // there is still data from a stopped show/hide\r
+ if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {\r
+ hidden = true;\r
+\r
+ // Ignore all other no-op show/hide data\r
+ } else {\r
+ continue;\r
+ }\r
+ }\r
+ orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );\r
+ }\r
+ }\r
+\r
+ // Bail out if this is a no-op like .hide().hide()\r
+ propTween = !jQuery.isEmptyObject( props );\r
+ if ( !propTween && jQuery.isEmptyObject( orig ) ) {\r
+ return;\r
+ }\r
+\r
+ // Restrict "overflow" and "display" styles during box animations\r
+ if ( isBox && elem.nodeType === 1 ) {\r
+\r
+ // Support: IE <=9 - 11, Edge 12 - 15\r
+ // Record all 3 overflow attributes because IE does not infer the shorthand\r
+ // from identically-valued overflowX and overflowY and Edge just mirrors\r
+ // the overflowX value there.\r
+ opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];\r
+\r
+ // Identify a display type, preferring old show/hide data over the CSS cascade\r
+ restoreDisplay = dataShow && dataShow.display;\r
+ if ( restoreDisplay == null ) {\r
+ restoreDisplay = dataPriv.get( elem, "display" );\r
+ }\r
+ display = jQuery.css( elem, "display" );\r
+ if ( display === "none" ) {\r
+ if ( restoreDisplay ) {\r
+ display = restoreDisplay;\r
+ } else {\r
+\r
+ // Get nonempty value(s) by temporarily forcing visibility\r
+ showHide( [ elem ], true );\r
+ restoreDisplay = elem.style.display || restoreDisplay;\r
+ display = jQuery.css( elem, "display" );\r
+ showHide( [ elem ] );\r
+ }\r
+ }\r
+\r
+ // Animate inline elements as inline-block\r
+ if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {\r
+ if ( jQuery.css( elem, "float" ) === "none" ) {\r
+\r
+ // Restore the original display value at the end of pure show/hide animations\r
+ if ( !propTween ) {\r
+ anim.done( function() {\r
+ style.display = restoreDisplay;\r
+ } );\r
+ if ( restoreDisplay == null ) {\r
+ display = style.display;\r
+ restoreDisplay = display === "none" ? "" : display;\r
+ }\r
+ }\r
+ style.display = "inline-block";\r
+ }\r
+ }\r
+ }\r
+\r
+ if ( opts.overflow ) {\r
+ style.overflow = "hidden";\r
+ anim.always( function() {\r
+ style.overflow = opts.overflow[ 0 ];\r
+ style.overflowX = opts.overflow[ 1 ];\r
+ style.overflowY = opts.overflow[ 2 ];\r
+ } );\r
+ }\r
+\r
+ // Implement show/hide animations\r
+ propTween = false;\r
+ for ( prop in orig ) {\r
+\r
+ // General show/hide setup for this element animation\r
+ if ( !propTween ) {\r
+ if ( dataShow ) {\r
+ if ( "hidden" in dataShow ) {\r
+ hidden = dataShow.hidden;\r
+ }\r
+ } else {\r
+ dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );\r
+ }\r
+\r
+ // Store hidden/visible for toggle so `.stop().toggle()` "reverses"\r
+ if ( toggle ) {\r
+ dataShow.hidden = !hidden;\r
+ }\r
+\r
+ // Show elements before animating them\r
+ if ( hidden ) {\r
+ showHide( [ elem ], true );\r
+ }\r
+\r
+ /* eslint-disable no-loop-func */\r
+\r
+ anim.done( function() {\r
+\r
+ /* eslint-enable no-loop-func */\r
+\r
+ // The final step of a "hide" animation is actually hiding the element\r
+ if ( !hidden ) {\r
+ showHide( [ elem ] );\r
+ }\r
+ dataPriv.remove( elem, "fxshow" );\r
+ for ( prop in orig ) {\r
+ jQuery.style( elem, prop, orig[ prop ] );\r
+ }\r
+ } );\r
+ }\r
+\r
+ // Per-property setup\r
+ propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );\r
+ if ( !( prop in dataShow ) ) {\r
+ dataShow[ prop ] = propTween.start;\r
+ if ( hidden ) {\r
+ propTween.end = propTween.start;\r
+ propTween.start = 0;\r
+ }\r
+ }\r
+ }\r
+}\r
+\r
+function propFilter( props, specialEasing ) {\r
+ var index, name, easing, value, hooks;\r
+\r
+ // camelCase, specialEasing and expand cssHook pass\r
+ for ( index in props ) {\r
+ name = camelCase( index );\r
+ easing = specialEasing[ name ];\r
+ value = props[ index ];\r
+ if ( Array.isArray( value ) ) {\r
+ easing = value[ 1 ];\r
+ value = props[ index ] = value[ 0 ];\r
+ }\r
+\r
+ if ( index !== name ) {\r
+ props[ name ] = value;\r
+ delete props[ index ];\r
+ }\r
+\r
+ hooks = jQuery.cssHooks[ name ];\r
+ if ( hooks && "expand" in hooks ) {\r
+ value = hooks.expand( value );\r
+ delete props[ name ];\r
+\r
+ // Not quite $.extend, this won't overwrite existing keys.\r
+ // Reusing 'index' because we have the correct "name"\r
+ for ( index in value ) {\r
+ if ( !( index in props ) ) {\r
+ props[ index ] = value[ index ];\r
+ specialEasing[ index ] = easing;\r
+ }\r
+ }\r
+ } else {\r
+ specialEasing[ name ] = easing;\r
+ }\r
+ }\r
+}\r
+\r
+function Animation( elem, properties, options ) {\r
+ var result,\r
+ stopped,\r
+ index = 0,\r
+ length = Animation.prefilters.length,\r
+ deferred = jQuery.Deferred().always( function() {\r
+\r
+ // Don't match elem in the :animated selector\r
+ delete tick.elem;\r
+ } ),\r
+ tick = function() {\r
+ if ( stopped ) {\r
+ return false;\r
+ }\r
+ var currentTime = fxNow || createFxNow(),\r
+ remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),\r
+\r
+ // Support: Android 2.3 only\r
+ // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)\r
+ temp = remaining / animation.duration || 0,\r
+ percent = 1 - temp,\r
+ index = 0,\r
+ length = animation.tweens.length;\r
+\r
+ for ( ; index < length; index++ ) {\r
+ animation.tweens[ index ].run( percent );\r
+ }\r
+\r
+ deferred.notifyWith( elem, [ animation, percent, remaining ] );\r
+\r
+ // If there's more to do, yield\r
+ if ( percent < 1 && length ) {\r
+ return remaining;\r
+ }\r
+\r
+ // If this was an empty animation, synthesize a final progress notification\r
+ if ( !length ) {\r
+ deferred.notifyWith( elem, [ animation, 1, 0 ] );\r
+ }\r
+\r
+ // Resolve the animation and report its conclusion\r
+ deferred.resolveWith( elem, [ animation ] );\r
+ return false;\r
+ },\r
+ animation = deferred.promise( {\r
+ elem: elem,\r
+ props: jQuery.extend( {}, properties ),\r
+ opts: jQuery.extend( true, {\r
+ specialEasing: {},\r
+ easing: jQuery.easing._default\r
+ }, options ),\r
+ originalProperties: properties,\r
+ originalOptions: options,\r
+ startTime: fxNow || createFxNow(),\r
+ duration: options.duration,\r
+ tweens: [],\r
+ createTween: function( prop, end ) {\r
+ var tween = jQuery.Tween( elem, animation.opts, prop, end,\r
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );\r
+ animation.tweens.push( tween );\r
+ return tween;\r
+ },\r
+ stop: function( gotoEnd ) {\r
+ var index = 0,\r
+\r
+ // If we are going to the end, we want to run all the tweens\r
+ // otherwise we skip this part\r
+ length = gotoEnd ? animation.tweens.length : 0;\r
+ if ( stopped ) {\r
+ return this;\r
+ }\r
+ stopped = true;\r
+ for ( ; index < length; index++ ) {\r
+ animation.tweens[ index ].run( 1 );\r
+ }\r
+\r
+ // Resolve when we played the last frame; otherwise, reject\r
+ if ( gotoEnd ) {\r
+ deferred.notifyWith( elem, [ animation, 1, 0 ] );\r
+ deferred.resolveWith( elem, [ animation, gotoEnd ] );\r
+ } else {\r
+ deferred.rejectWith( elem, [ animation, gotoEnd ] );\r
+ }\r
+ return this;\r
+ }\r
+ } ),\r
+ props = animation.props;\r
+\r
+ propFilter( props, animation.opts.specialEasing );\r
+\r
+ for ( ; index < length; index++ ) {\r
+ result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );\r
+ if ( result ) {\r
+ if ( isFunction( result.stop ) ) {\r
+ jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =\r
+ result.stop.bind( result );\r
+ }\r
+ return result;\r
+ }\r
+ }\r
+\r
+ jQuery.map( props, createTween, animation );\r
+\r
+ if ( isFunction( animation.opts.start ) ) {\r
+ animation.opts.start.call( elem, animation );\r
+ }\r
+\r
+ // Attach callbacks from options\r
+ animation\r
+ .progress( animation.opts.progress )\r
+ .done( animation.opts.done, animation.opts.complete )\r
+ .fail( animation.opts.fail )\r
+ .always( animation.opts.always );\r
+\r
+ jQuery.fx.timer(\r
+ jQuery.extend( tick, {\r
+ elem: elem,\r
+ anim: animation,\r
+ queue: animation.opts.queue\r
+ } )\r
+ );\r
+\r
+ return animation;\r
+}\r
+\r
+jQuery.Animation = jQuery.extend( Animation, {\r
+\r
+ tweeners: {\r
+ "*": [ function( prop, value ) {\r
+ var tween = this.createTween( prop, value );\r
+ adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );\r
+ return tween;\r
+ } ]\r
+ },\r
+\r
+ tweener: function( props, callback ) {\r
+ if ( isFunction( props ) ) {\r
+ callback = props;\r
+ props = [ "*" ];\r
+ } else {\r
+ props = props.match( rnothtmlwhite );\r
+ }\r
+\r
+ var prop,\r
+ index = 0,\r
+ length = props.length;\r
+\r
+ for ( ; index < length; index++ ) {\r
+ prop = props[ index ];\r
+ Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];\r
+ Animation.tweeners[ prop ].unshift( callback );\r
+ }\r
+ },\r
+\r
+ prefilters: [ defaultPrefilter ],\r
+\r
+ prefilter: function( callback, prepend ) {\r
+ if ( prepend ) {\r
+ Animation.prefilters.unshift( callback );\r
+ } else {\r
+ Animation.prefilters.push( callback );\r
+ }\r
+ }\r
+} );\r
+\r
+jQuery.speed = function( speed, easing, fn ) {\r
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {\r
+ complete: fn || !fn && easing ||\r
+ isFunction( speed ) && speed,\r
+ duration: speed,\r
+ easing: fn && easing || easing && !isFunction( easing ) && easing\r
+ };\r
+\r
+ // Go to the end state if fx are off\r
+ if ( jQuery.fx.off ) {\r
+ opt.duration = 0;\r
+\r
+ } else {\r
+ if ( typeof opt.duration !== "number" ) {\r
+ if ( opt.duration in jQuery.fx.speeds ) {\r
+ opt.duration = jQuery.fx.speeds[ opt.duration ];\r
+\r
+ } else {\r
+ opt.duration = jQuery.fx.speeds._default;\r
+ }\r
+ }\r
+ }\r
+\r
+ // Normalize opt.queue - true/undefined/null -> "fx"\r
+ if ( opt.queue == null || opt.queue === true ) {\r
+ opt.queue = "fx";\r
+ }\r
+\r
+ // Queueing\r
+ opt.old = opt.complete;\r
+\r
+ opt.complete = function() {\r
+ if ( isFunction( opt.old ) ) {\r
+ opt.old.call( this );\r
+ }\r
+\r
+ if ( opt.queue ) {\r
+ jQuery.dequeue( this, opt.queue );\r
+ }\r
+ };\r
+\r
+ return opt;\r
+};\r
+\r
+jQuery.fn.extend( {\r
+ fadeTo: function( speed, to, easing, callback ) {\r
+\r
+ // Show any hidden elements after setting opacity to 0\r
+ return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()\r
+\r
+ // Animate to the value specified\r
+ .end().animate( { opacity: to }, speed, easing, callback );\r
+ },\r
+ animate: function( prop, speed, easing, callback ) {\r
+ var empty = jQuery.isEmptyObject( prop ),\r
+ optall = jQuery.speed( speed, easing, callback ),\r
+ doAnimation = function() {\r
+\r
+ // Operate on a copy of prop so per-property easing won't be lost\r
+ var anim = Animation( this, jQuery.extend( {}, prop ), optall );\r
+\r
+ // Empty animations, or finishing resolves immediately\r
+ if ( empty || dataPriv.get( this, "finish" ) ) {\r
+ anim.stop( true );\r
+ }\r
+ };\r
+\r
+ doAnimation.finish = doAnimation;\r
+\r
+ return empty || optall.queue === false ?\r
+ this.each( doAnimation ) :\r
+ this.queue( optall.queue, doAnimation );\r
+ },\r
+ stop: function( type, clearQueue, gotoEnd ) {\r
+ var stopQueue = function( hooks ) {\r
+ var stop = hooks.stop;\r
+ delete hooks.stop;\r
+ stop( gotoEnd );\r
+ };\r
+\r
+ if ( typeof type !== "string" ) {\r
+ gotoEnd = clearQueue;\r
+ clearQueue = type;\r
+ type = undefined;\r
+ }\r
+ if ( clearQueue ) {\r
+ this.queue( type || "fx", [] );\r
+ }\r
+\r
+ return this.each( function() {\r
+ var dequeue = true,\r
+ index = type != null && type + "queueHooks",\r
+ timers = jQuery.timers,\r
+ data = dataPriv.get( this );\r
+\r
+ if ( index ) {\r
+ if ( data[ index ] && data[ index ].stop ) {\r
+ stopQueue( data[ index ] );\r
+ }\r
+ } else {\r
+ for ( index in data ) {\r
+ if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {\r
+ stopQueue( data[ index ] );\r
+ }\r
+ }\r
+ }\r
+\r
+ for ( index = timers.length; index--; ) {\r
+ if ( timers[ index ].elem === this &&\r
+ ( type == null || timers[ index ].queue === type ) ) {\r
+\r
+ timers[ index ].anim.stop( gotoEnd );\r
+ dequeue = false;\r
+ timers.splice( index, 1 );\r
+ }\r
+ }\r
+\r
+ // Start the next in the queue if the last step wasn't forced.\r
+ // Timers currently will call their complete callbacks, which\r
+ // will dequeue but only if they were gotoEnd.\r
+ if ( dequeue || !gotoEnd ) {\r
+ jQuery.dequeue( this, type );\r
+ }\r
+ } );\r
+ },\r
+ finish: function( type ) {\r
+ if ( type !== false ) {\r
+ type = type || "fx";\r
+ }\r
+ return this.each( function() {\r
+ var index,\r
+ data = dataPriv.get( this ),\r
+ queue = data[ type + "queue" ],\r
+ hooks = data[ type + "queueHooks" ],\r
+ timers = jQuery.timers,\r
+ length = queue ? queue.length : 0;\r
+\r
+ // Enable finishing flag on private data\r
+ data.finish = true;\r
+\r
+ // Empty the queue first\r
+ jQuery.queue( this, type, [] );\r
+\r
+ if ( hooks && hooks.stop ) {\r
+ hooks.stop.call( this, true );\r
+ }\r
+\r
+ // Look for any active animations, and finish them\r
+ for ( index = timers.length; index--; ) {\r
+ if ( timers[ index ].elem === this && timers[ index ].queue === type ) {\r
+ timers[ index ].anim.stop( true );\r
+ timers.splice( index, 1 );\r
+ }\r
+ }\r
+\r
+ // Look for any animations in the old queue and finish them\r
+ for ( index = 0; index < length; index++ ) {\r
+ if ( queue[ index ] && queue[ index ].finish ) {\r
+ queue[ index ].finish.call( this );\r
+ }\r
+ }\r
+\r
+ // Turn off finishing flag\r
+ delete data.finish;\r
+ } );\r
+ }\r
+} );\r
+\r
+jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) {\r
+ var cssFn = jQuery.fn[ name ];\r
+ jQuery.fn[ name ] = function( speed, easing, callback ) {\r
+ return speed == null || typeof speed === "boolean" ?\r
+ cssFn.apply( this, arguments ) :\r
+ this.animate( genFx( name, true ), speed, easing, callback );\r
+ };\r
+} );\r
+\r
+// Generate shortcuts for custom animations\r
+jQuery.each( {\r
+ slideDown: genFx( "show" ),\r
+ slideUp: genFx( "hide" ),\r
+ slideToggle: genFx( "toggle" ),\r
+ fadeIn: { opacity: "show" },\r
+ fadeOut: { opacity: "hide" },\r
+ fadeToggle: { opacity: "toggle" }\r
+}, function( name, props ) {\r
+ jQuery.fn[ name ] = function( speed, easing, callback ) {\r
+ return this.animate( props, speed, easing, callback );\r
+ };\r
+} );\r
+\r
+jQuery.timers = [];\r
+jQuery.fx.tick = function() {\r
+ var timer,\r
+ i = 0,\r
+ timers = jQuery.timers;\r
+\r
+ fxNow = Date.now();\r
+\r
+ for ( ; i < timers.length; i++ ) {\r
+ timer = timers[ i ];\r
+\r
+ // Run the timer and safely remove it when done (allowing for external removal)\r
+ if ( !timer() && timers[ i ] === timer ) {\r
+ timers.splice( i--, 1 );\r
+ }\r
+ }\r
+\r
+ if ( !timers.length ) {\r
+ jQuery.fx.stop();\r
+ }\r
+ fxNow = undefined;\r
+};\r
+\r
+jQuery.fx.timer = function( timer ) {\r
+ jQuery.timers.push( timer );\r
+ jQuery.fx.start();\r
+};\r
+\r
+jQuery.fx.interval = 13;\r
+jQuery.fx.start = function() {\r
+ if ( inProgress ) {\r
+ return;\r
+ }\r
+\r
+ inProgress = true;\r
+ schedule();\r
+};\r
+\r
+jQuery.fx.stop = function() {\r
+ inProgress = null;\r
+};\r
+\r
+jQuery.fx.speeds = {\r
+ slow: 600,\r
+ fast: 200,\r
+\r
+ // Default speed\r
+ _default: 400\r
+};\r
+\r
+\r
+// Based off of the plugin by Clint Helfers, with permission.\r
+// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/\r
+jQuery.fn.delay = function( time, type ) {\r
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;\r
+ type = type || "fx";\r
+\r
+ return this.queue( type, function( next, hooks ) {\r
+ var timeout = window.setTimeout( next, time );\r
+ hooks.stop = function() {\r
+ window.clearTimeout( timeout );\r
+ };\r
+ } );\r
+};\r
+\r
+\r
+( function() {\r
+ var input = document.createElement( "input" ),\r
+ select = document.createElement( "select" ),\r
+ opt = select.appendChild( document.createElement( "option" ) );\r
+\r
+ input.type = "checkbox";\r
+\r
+ // Support: Android <=4.3 only\r
+ // Default value for a checkbox should be "on"\r
+ support.checkOn = input.value !== "";\r
+\r
+ // Support: IE <=11 only\r
+ // Must access selectedIndex to make default options select\r
+ support.optSelected = opt.selected;\r
+\r
+ // Support: IE <=11 only\r
+ // An input loses its value after becoming a radio\r
+ input = document.createElement( "input" );\r
+ input.value = "t";\r
+ input.type = "radio";\r
+ support.radioValue = input.value === "t";\r
+} )();\r
+\r
+\r
+var boolHook,\r
+ attrHandle = jQuery.expr.attrHandle;\r
+\r
+jQuery.fn.extend( {\r
+ attr: function( name, value ) {\r
+ return access( this, jQuery.attr, name, value, arguments.length > 1 );\r
+ },\r
+\r
+ removeAttr: function( name ) {\r
+ return this.each( function() {\r
+ jQuery.removeAttr( this, name );\r
+ } );\r
+ }\r
+} );\r
+\r
+jQuery.extend( {\r
+ attr: function( elem, name, value ) {\r
+ var ret, hooks,\r
+ nType = elem.nodeType;\r
+\r
+ // Don't get/set attributes on text, comment and attribute nodes\r
+ if ( nType === 3 || nType === 8 || nType === 2 ) {\r
+ return;\r
+ }\r
+\r
+ // Fallback to prop when attributes are not supported\r
+ if ( typeof elem.getAttribute === "undefined" ) {\r
+ return jQuery.prop( elem, name, value );\r
+ }\r
+\r
+ // Attribute hooks are determined by the lowercase version\r
+ // Grab necessary hook if one is defined\r
+ if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\r
+ hooks = jQuery.attrHooks[ name.toLowerCase() ] ||\r
+ ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );\r
+ }\r
+\r
+ if ( value !== undefined ) {\r
+ if ( value === null ) {\r
+ jQuery.removeAttr( elem, name );\r
+ return;\r
+ }\r
+\r
+ if ( hooks && "set" in hooks &&\r
+ ( ret = hooks.set( elem, value, name ) ) !== undefined ) {\r
+ return ret;\r
+ }\r
+\r
+ elem.setAttribute( name, value + "" );\r
+ return value;\r
+ }\r
+\r
+ if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\r
+ return ret;\r
+ }\r
+\r
+ ret = jQuery.find.attr( elem, name );\r
+\r
+ // Non-existent attributes return null, we normalize to undefined\r
+ return ret == null ? undefined : ret;\r
+ },\r
+\r
+ attrHooks: {\r
+ type: {\r
+ set: function( elem, value ) {\r
+ if ( !support.radioValue && value === "radio" &&\r
+ nodeName( elem, "input" ) ) {\r
+ var val = elem.value;\r
+ elem.setAttribute( "type", value );\r
+ if ( val ) {\r
+ elem.value = val;\r
+ }\r
+ return value;\r
+ }\r
+ }\r
+ }\r
+ },\r
+\r
+ removeAttr: function( elem, value ) {\r
+ var name,\r
+ i = 0,\r
+\r
+ // Attribute names can contain non-HTML whitespace characters\r
+ // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\r
+ attrNames = value && value.match( rnothtmlwhite );\r
+\r
+ if ( attrNames && elem.nodeType === 1 ) {\r
+ while ( ( name = attrNames[ i++ ] ) ) {\r
+ elem.removeAttribute( name );\r
+ }\r
+ }\r
+ }\r
+} );\r
+\r
+// Hooks for boolean attributes\r
+boolHook = {\r
+ set: function( elem, value, name ) {\r
+ if ( value === false ) {\r
+\r
+ // Remove boolean attributes when set to false\r
+ jQuery.removeAttr( elem, name );\r
+ } else {\r
+ elem.setAttribute( name, name );\r
+ }\r
+ return name;\r
+ }\r
+};\r
+\r
+jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {\r
+ var getter = attrHandle[ name ] || jQuery.find.attr;\r
+\r
+ attrHandle[ name ] = function( elem, name, isXML ) {\r
+ var ret, handle,\r
+ lowercaseName = name.toLowerCase();\r
+\r
+ if ( !isXML ) {\r
+\r
+ // Avoid an infinite loop by temporarily removing this function from the getter\r
+ handle = attrHandle[ lowercaseName ];\r
+ attrHandle[ lowercaseName ] = ret;\r
+ ret = getter( elem, name, isXML ) != null ?\r
+ lowercaseName :\r
+ null;\r
+ attrHandle[ lowercaseName ] = handle;\r
+ }\r
+ return ret;\r
+ };\r
+} );\r
+\r
+\r
+\r
+\r
+var rfocusable = /^(?:input|select|textarea|button)$/i,\r
+ rclickable = /^(?:a|area)$/i;\r
+\r
+jQuery.fn.extend( {\r
+ prop: function( name, value ) {\r
+ return access( this, jQuery.prop, name, value, arguments.length > 1 );\r
+ },\r
+\r
+ removeProp: function( name ) {\r
+ return this.each( function() {\r
+ delete this[ jQuery.propFix[ name ] || name ];\r
+ } );\r
+ }\r
+} );\r
+\r
+jQuery.extend( {\r
+ prop: function( elem, name, value ) {\r
+ var ret, hooks,\r
+ nType = elem.nodeType;\r
+\r
+ // Don't get/set properties on text, comment and attribute nodes\r
+ if ( nType === 3 || nType === 8 || nType === 2 ) {\r
+ return;\r
+ }\r
+\r
+ if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {\r
+\r
+ // Fix name and attach hooks\r
+ name = jQuery.propFix[ name ] || name;\r
+ hooks = jQuery.propHooks[ name ];\r
+ }\r
+\r
+ if ( value !== undefined ) {\r
+ if ( hooks && "set" in hooks &&\r
+ ( ret = hooks.set( elem, value, name ) ) !== undefined ) {\r
+ return ret;\r
+ }\r
+\r
+ return ( elem[ name ] = value );\r
+ }\r
+\r
+ if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {\r
+ return ret;\r
+ }\r
+\r
+ return elem[ name ];\r
+ },\r
+\r
+ propHooks: {\r
+ tabIndex: {\r
+ get: function( elem ) {\r
+\r
+ // Support: IE <=9 - 11 only\r
+ // elem.tabIndex doesn't always return the\r
+ // correct value when it hasn't been explicitly set\r
+ // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/\r
+ // Use proper attribute retrieval(#12072)\r
+ var tabindex = jQuery.find.attr( elem, "tabindex" );\r
+\r
+ if ( tabindex ) {\r
+ return parseInt( tabindex, 10 );\r
+ }\r
+\r
+ if (\r
+ rfocusable.test( elem.nodeName ) ||\r
+ rclickable.test( elem.nodeName ) &&\r
+ elem.href\r
+ ) {\r
+ return 0;\r
+ }\r
+\r
+ return -1;\r
+ }\r
+ }\r
+ },\r
+\r
+ propFix: {\r
+ "for": "htmlFor",\r
+ "class": "className"\r
+ }\r
+} );\r
+\r
+// Support: IE <=11 only\r
+// Accessing the selectedIndex property\r
+// forces the browser to respect setting selected\r
+// on the option\r
+// The getter ensures a default option is selected\r
+// when in an optgroup\r
+// eslint rule "no-unused-expressions" is disabled for this code\r
+// since it considers such accessions noop\r
+if ( !support.optSelected ) {\r
+ jQuery.propHooks.selected = {\r
+ get: function( elem ) {\r
+\r
+ /* eslint no-unused-expressions: "off" */\r
+\r
+ var parent = elem.parentNode;\r
+ if ( parent && parent.parentNode ) {\r
+ parent.parentNode.selectedIndex;\r
+ }\r
+ return null;\r
+ },\r
+ set: function( elem ) {\r
+\r
+ /* eslint no-unused-expressions: "off" */\r
+\r
+ var parent = elem.parentNode;\r
+ if ( parent ) {\r
+ parent.selectedIndex;\r
+\r
+ if ( parent.parentNode ) {\r
+ parent.parentNode.selectedIndex;\r
+ }\r
+ }\r
+ }\r
+ };\r
+}\r
+\r
+jQuery.each( [\r
+ "tabIndex",\r
+ "readOnly",\r
+ "maxLength",\r
+ "cellSpacing",\r
+ "cellPadding",\r
+ "rowSpan",\r
+ "colSpan",\r
+ "useMap",\r
+ "frameBorder",\r
+ "contentEditable"\r
+], function() {\r
+ jQuery.propFix[ this.toLowerCase() ] = this;\r
+} );\r
+\r
+\r
+\r
+\r
+ // Strip and collapse whitespace according to HTML spec\r
+ // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace\r
+ function stripAndCollapse( value ) {\r
+ var tokens = value.match( rnothtmlwhite ) || [];\r
+ return tokens.join( " " );\r
+ }\r
+\r
+\r
+function getClass( elem ) {\r
+ return elem.getAttribute && elem.getAttribute( "class" ) || "";\r
+}\r
+\r
+function classesToArray( value ) {\r
+ if ( Array.isArray( value ) ) {\r
+ return value;\r
+ }\r
+ if ( typeof value === "string" ) {\r
+ return value.match( rnothtmlwhite ) || [];\r
+ }\r
+ return [];\r
+}\r
+\r
+jQuery.fn.extend( {\r
+ addClass: function( value ) {\r
+ var classes, elem, cur, curValue, clazz, j, finalValue,\r
+ i = 0;\r
+\r
+ if ( isFunction( value ) ) {\r
+ return this.each( function( j ) {\r
+ jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );\r
+ } );\r
+ }\r
+\r
+ classes = classesToArray( value );\r
+\r
+ if ( classes.length ) {\r
+ while ( ( elem = this[ i++ ] ) ) {\r
+ curValue = getClass( elem );\r
+ cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );\r
+\r
+ if ( cur ) {\r
+ j = 0;\r
+ while ( ( clazz = classes[ j++ ] ) ) {\r
+ if ( cur.indexOf( " " + clazz + " " ) < 0 ) {\r
+ cur += clazz + " ";\r
+ }\r
+ }\r
+\r
+ // Only assign if different to avoid unneeded rendering.\r
+ finalValue = stripAndCollapse( cur );\r
+ if ( curValue !== finalValue ) {\r
+ elem.setAttribute( "class", finalValue );\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ return this;\r
+ },\r
+\r
+ removeClass: function( value ) {\r
+ var classes, elem, cur, curValue, clazz, j, finalValue,\r
+ i = 0;\r
+\r
+ if ( isFunction( value ) ) {\r
+ return this.each( function( j ) {\r
+ jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );\r
+ } );\r
+ }\r
+\r
+ if ( !arguments.length ) {\r
+ return this.attr( "class", "" );\r
+ }\r
+\r
+ classes = classesToArray( value );\r
+\r
+ if ( classes.length ) {\r
+ while ( ( elem = this[ i++ ] ) ) {\r
+ curValue = getClass( elem );\r
+\r
+ // This expression is here for better compressibility (see addClass)\r
+ cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );\r
+\r
+ if ( cur ) {\r
+ j = 0;\r
+ while ( ( clazz = classes[ j++ ] ) ) {\r
+\r
+ // Remove *all* instances\r
+ while ( cur.indexOf( " " + clazz + " " ) > -1 ) {\r
+ cur = cur.replace( " " + clazz + " ", " " );\r
+ }\r
+ }\r
+\r
+ // Only assign if different to avoid unneeded rendering.\r
+ finalValue = stripAndCollapse( cur );\r
+ if ( curValue !== finalValue ) {\r
+ elem.setAttribute( "class", finalValue );\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ return this;\r
+ },\r
+\r
+ toggleClass: function( value, stateVal ) {\r
+ var type = typeof value,\r
+ isValidValue = type === "string" || Array.isArray( value );\r
+\r
+ if ( typeof stateVal === "boolean" && isValidValue ) {\r
+ return stateVal ? this.addClass( value ) : this.removeClass( value );\r
+ }\r
+\r
+ if ( isFunction( value ) ) {\r
+ return this.each( function( i ) {\r
+ jQuery( this ).toggleClass(\r
+ value.call( this, i, getClass( this ), stateVal ),\r
+ stateVal\r
+ );\r
+ } );\r
+ }\r
+\r
+ return this.each( function() {\r
+ var className, i, self, classNames;\r
+\r
+ if ( isValidValue ) {\r
+\r
+ // Toggle individual class names\r
+ i = 0;\r
+ self = jQuery( this );\r
+ classNames = classesToArray( value );\r
+\r
+ while ( ( className = classNames[ i++ ] ) ) {\r
+\r
+ // Check each className given, space separated list\r
+ if ( self.hasClass( className ) ) {\r
+ self.removeClass( className );\r
+ } else {\r
+ self.addClass( className );\r
+ }\r
+ }\r
+\r
+ // Toggle whole class name\r
+ } else if ( value === undefined || type === "boolean" ) {\r
+ className = getClass( this );\r
+ if ( className ) {\r
+\r
+ // Store className if set\r
+ dataPriv.set( this, "__className__", className );\r
+ }\r
+\r
+ // If the element has a class name or if we're passed `false`,\r
+ // then remove the whole classname (if there was one, the above saved it).\r
+ // Otherwise bring back whatever was previously saved (if anything),\r
+ // falling back to the empty string if nothing was stored.\r
+ if ( this.setAttribute ) {\r
+ this.setAttribute( "class",\r
+ className || value === false ?\r
+ "" :\r
+ dataPriv.get( this, "__className__" ) || ""\r
+ );\r
+ }\r
+ }\r
+ } );\r
+ },\r
+\r
+ hasClass: function( selector ) {\r
+ var className, elem,\r
+ i = 0;\r
+\r
+ className = " " + selector + " ";\r
+ while ( ( elem = this[ i++ ] ) ) {\r
+ if ( elem.nodeType === 1 &&\r
+ ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {\r
+ return true;\r
+ }\r
+ }\r
+\r
+ return false;\r
+ }\r
+} );\r
+\r
+\r
+\r
+\r
+var rreturn = /\r/g;\r
+\r
+jQuery.fn.extend( {\r
+ val: function( value ) {\r
+ var hooks, ret, valueIsFunction,\r
+ elem = this[ 0 ];\r
+\r
+ if ( !arguments.length ) {\r
+ if ( elem ) {\r
+ hooks = jQuery.valHooks[ elem.type ] ||\r
+ jQuery.valHooks[ elem.nodeName.toLowerCase() ];\r
+\r
+ if ( hooks &&\r
+ "get" in hooks &&\r
+ ( ret = hooks.get( elem, "value" ) ) !== undefined\r
+ ) {\r
+ return ret;\r
+ }\r
+\r
+ ret = elem.value;\r
+\r
+ // Handle most common string cases\r
+ if ( typeof ret === "string" ) {\r
+ return ret.replace( rreturn, "" );\r
+ }\r
+\r
+ // Handle cases where value is null/undef or number\r
+ return ret == null ? "" : ret;\r
+ }\r
+\r
+ return;\r
+ }\r
+\r
+ valueIsFunction = isFunction( value );\r
+\r
+ return this.each( function( i ) {\r
+ var val;\r
+\r
+ if ( this.nodeType !== 1 ) {\r
+ return;\r
+ }\r
+\r
+ if ( valueIsFunction ) {\r
+ val = value.call( this, i, jQuery( this ).val() );\r
+ } else {\r
+ val = value;\r
+ }\r
+\r
+ // Treat null/undefined as ""; convert numbers to string\r
+ if ( val == null ) {\r
+ val = "";\r
+\r
+ } else if ( typeof val === "number" ) {\r
+ val += "";\r
+\r
+ } else if ( Array.isArray( val ) ) {\r
+ val = jQuery.map( val, function( value ) {\r
+ return value == null ? "" : value + "";\r
+ } );\r
+ }\r
+\r
+ hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];\r
+\r
+ // If set returns undefined, fall back to normal setting\r
+ if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {\r
+ this.value = val;\r
+ }\r
+ } );\r
+ }\r
+} );\r
+\r
+jQuery.extend( {\r
+ valHooks: {\r
+ option: {\r
+ get: function( elem ) {\r
+\r
+ var val = jQuery.find.attr( elem, "value" );\r
+ return val != null ?\r
+ val :\r
+\r
+ // Support: IE <=10 - 11 only\r
+ // option.text throws exceptions (#14686, #14858)\r
+ // Strip and collapse whitespace\r
+ // https://html.spec.whatwg.org/#strip-and-collapse-whitespace\r
+ stripAndCollapse( jQuery.text( elem ) );\r
+ }\r
+ },\r
+ select: {\r
+ get: function( elem ) {\r
+ var value, option, i,\r
+ options = elem.options,\r
+ index = elem.selectedIndex,\r
+ one = elem.type === "select-one",\r
+ values = one ? null : [],\r
+ max = one ? index + 1 : options.length;\r
+\r
+ if ( index < 0 ) {\r
+ i = max;\r
+\r
+ } else {\r
+ i = one ? index : 0;\r
+ }\r
+\r
+ // Loop through all the selected options\r
+ for ( ; i < max; i++ ) {\r
+ option = options[ i ];\r
+\r
+ // Support: IE <=9 only\r
+ // IE8-9 doesn't update selected after form reset (#2551)\r
+ if ( ( option.selected || i === index ) &&\r
+\r
+ // Don't return options that are disabled or in a disabled optgroup\r
+ !option.disabled &&\r
+ ( !option.parentNode.disabled ||\r
+ !nodeName( option.parentNode, "optgroup" ) ) ) {\r
+\r
+ // Get the specific value for the option\r
+ value = jQuery( option ).val();\r
+\r
+ // We don't need an array for one selects\r
+ if ( one ) {\r
+ return value;\r
+ }\r
+\r
+ // Multi-Selects return an array\r
+ values.push( value );\r
+ }\r
+ }\r
+\r
+ return values;\r
+ },\r
+\r
+ set: function( elem, value ) {\r
+ var optionSet, option,\r
+ options = elem.options,\r
+ values = jQuery.makeArray( value ),\r
+ i = options.length;\r
+\r
+ while ( i-- ) {\r
+ option = options[ i ];\r
+\r
+ /* eslint-disable no-cond-assign */\r
+\r
+ if ( option.selected =\r
+ jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1\r
+ ) {\r
+ optionSet = true;\r
+ }\r
+\r
+ /* eslint-enable no-cond-assign */\r
+ }\r
+\r
+ // Force browsers to behave consistently when non-matching value is set\r
+ if ( !optionSet ) {\r
+ elem.selectedIndex = -1;\r
+ }\r
+ return values;\r
+ }\r
+ }\r
+ }\r
+} );\r
+\r
+// Radios and checkboxes getter/setter\r
+jQuery.each( [ "radio", "checkbox" ], function() {\r
+ jQuery.valHooks[ this ] = {\r
+ set: function( elem, value ) {\r
+ if ( Array.isArray( value ) ) {\r
+ return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );\r
+ }\r
+ }\r
+ };\r
+ if ( !support.checkOn ) {\r
+ jQuery.valHooks[ this ].get = function( elem ) {\r
+ return elem.getAttribute( "value" ) === null ? "on" : elem.value;\r
+ };\r
+ }\r
+} );\r
+\r
+\r
+\r
+\r
+// Return jQuery for attributes-only inclusion\r
+\r
+\r
+support.focusin = "onfocusin" in window;\r
+\r
+\r
+var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\r
+ stopPropagationCallback = function( e ) {\r
+ e.stopPropagation();\r
+ };\r
+\r
+jQuery.extend( jQuery.event, {\r
+\r
+ trigger: function( event, data, elem, onlyHandlers ) {\r
+\r
+ var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,\r
+ eventPath = [ elem || document ],\r
+ type = hasOwn.call( event, "type" ) ? event.type : event,\r
+ namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];\r
+\r
+ cur = lastElement = tmp = elem = elem || document;\r
+\r
+ // Don't do events on text and comment nodes\r
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {\r
+ return;\r
+ }\r
+\r
+ // focus/blur morphs to focusin/out; ensure we're not firing them right now\r
+ if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {\r
+ return;\r
+ }\r
+\r
+ if ( type.indexOf( "." ) > -1 ) {\r
+\r
+ // Namespaced trigger; create a regexp to match event type in handle()\r
+ namespaces = type.split( "." );\r
+ type = namespaces.shift();\r
+ namespaces.sort();\r
+ }\r
+ ontype = type.indexOf( ":" ) < 0 && "on" + type;\r
+\r
+ // Caller can pass in a jQuery.Event object, Object, or just an event type string\r
+ event = event[ jQuery.expando ] ?\r
+ event :\r
+ new jQuery.Event( type, typeof event === "object" && event );\r
+\r
+ // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\r
+ event.isTrigger = onlyHandlers ? 2 : 3;\r
+ event.namespace = namespaces.join( "." );\r
+ event.rnamespace = event.namespace ?\r
+ new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :\r
+ null;\r
+\r
+ // Clean up the event in case it is being reused\r
+ event.result = undefined;\r
+ if ( !event.target ) {\r
+ event.target = elem;\r
+ }\r
+\r
+ // Clone any incoming data and prepend the event, creating the handler arg list\r
+ data = data == null ?\r
+ [ event ] :\r
+ jQuery.makeArray( data, [ event ] );\r
+\r
+ // Allow special events to draw outside the lines\r
+ special = jQuery.event.special[ type ] || {};\r
+ if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {\r
+ return;\r
+ }\r
+\r
+ // Determine event propagation path in advance, per W3C events spec (#9951)\r
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)\r
+ if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {\r
+\r
+ bubbleType = special.delegateType || type;\r
+ if ( !rfocusMorph.test( bubbleType + type ) ) {\r
+ cur = cur.parentNode;\r
+ }\r
+ for ( ; cur; cur = cur.parentNode ) {\r
+ eventPath.push( cur );\r
+ tmp = cur;\r
+ }\r
+\r
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)\r
+ if ( tmp === ( elem.ownerDocument || document ) ) {\r
+ eventPath.push( tmp.defaultView || tmp.parentWindow || window );\r
+ }\r
+ }\r
+\r
+ // Fire handlers on the event path\r
+ i = 0;\r
+ while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {\r
+ lastElement = cur;\r
+ event.type = i > 1 ?\r
+ bubbleType :\r
+ special.bindType || type;\r
+\r
+ // jQuery handler\r
+ handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] &&\r
+ dataPriv.get( cur, "handle" );\r
+ if ( handle ) {\r
+ handle.apply( cur, data );\r
+ }\r
+\r
+ // Native handler\r
+ handle = ontype && cur[ ontype ];\r
+ if ( handle && handle.apply && acceptData( cur ) ) {\r
+ event.result = handle.apply( cur, data );\r
+ if ( event.result === false ) {\r
+ event.preventDefault();\r
+ }\r
+ }\r
+ }\r
+ event.type = type;\r
+\r
+ // If nobody prevented the default action, do it now\r
+ if ( !onlyHandlers && !event.isDefaultPrevented() ) {\r
+\r
+ if ( ( !special._default ||\r
+ special._default.apply( eventPath.pop(), data ) === false ) &&\r
+ acceptData( elem ) ) {\r
+\r
+ // Call a native DOM method on the target with the same name as the event.\r
+ // Don't do default actions on window, that's where global variables be (#6170)\r
+ if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {\r
+\r
+ // Don't re-trigger an onFOO event when we call its FOO() method\r
+ tmp = elem[ ontype ];\r
+\r
+ if ( tmp ) {\r
+ elem[ ontype ] = null;\r
+ }\r
+\r
+ // Prevent re-triggering of the same event, since we already bubbled it above\r
+ jQuery.event.triggered = type;\r
+\r
+ if ( event.isPropagationStopped() ) {\r
+ lastElement.addEventListener( type, stopPropagationCallback );\r
+ }\r
+\r
+ elem[ type ]();\r
+\r
+ if ( event.isPropagationStopped() ) {\r
+ lastElement.removeEventListener( type, stopPropagationCallback );\r
+ }\r
+\r
+ jQuery.event.triggered = undefined;\r
+\r
+ if ( tmp ) {\r
+ elem[ ontype ] = tmp;\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ return event.result;\r
+ },\r
+\r
+ // Piggyback on a donor event to simulate a different one\r
+ // Used only for `focus(in | out)` events\r
+ simulate: function( type, elem, event ) {\r
+ var e = jQuery.extend(\r
+ new jQuery.Event(),\r
+ event,\r
+ {\r
+ type: type,\r
+ isSimulated: true\r
+ }\r
+ );\r
+\r
+ jQuery.event.trigger( e, null, elem );\r
+ }\r
+\r
+} );\r
+\r
+jQuery.fn.extend( {\r
+\r
+ trigger: function( type, data ) {\r
+ return this.each( function() {\r
+ jQuery.event.trigger( type, data, this );\r
+ } );\r
+ },\r
+ triggerHandler: function( type, data ) {\r
+ var elem = this[ 0 ];\r
+ if ( elem ) {\r
+ return jQuery.event.trigger( type, data, elem, true );\r
+ }\r
+ }\r
+} );\r
+\r
+\r
+// Support: Firefox <=44\r
+// Firefox doesn't have focus(in | out) events\r
+// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787\r
+//\r
+// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1\r
+// focus(in | out) events fire after focus & blur events,\r
+// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order\r
+// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857\r
+if ( !support.focusin ) {\r
+ jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {\r
+\r
+ // Attach a single capturing handler on the document while someone wants focusin/focusout\r
+ var handler = function( event ) {\r
+ jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );\r
+ };\r
+\r
+ jQuery.event.special[ fix ] = {\r
+ setup: function() {\r
+\r
+ // Handle: regular nodes (via `this.ownerDocument`), window\r
+ // (via `this.document`) & document (via `this`).\r
+ var doc = this.ownerDocument || this.document || this,\r
+ attaches = dataPriv.access( doc, fix );\r
+\r
+ if ( !attaches ) {\r
+ doc.addEventListener( orig, handler, true );\r
+ }\r
+ dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );\r
+ },\r
+ teardown: function() {\r
+ var doc = this.ownerDocument || this.document || this,\r
+ attaches = dataPriv.access( doc, fix ) - 1;\r
+\r
+ if ( !attaches ) {\r
+ doc.removeEventListener( orig, handler, true );\r
+ dataPriv.remove( doc, fix );\r
+\r
+ } else {\r
+ dataPriv.access( doc, fix, attaches );\r
+ }\r
+ }\r
+ };\r
+ } );\r
+}\r
+var location = window.location;\r
+\r
+var nonce = { guid: Date.now() };\r
+\r
+var rquery = ( /\?/ );\r
+\r
+\r
+\r
+// Cross-browser xml parsing\r
+jQuery.parseXML = function( data ) {\r
+ var xml, parserErrorElem;\r
+ if ( !data || typeof data !== "string" ) {\r
+ return null;\r
+ }\r
+\r
+ // Support: IE 9 - 11 only\r
+ // IE throws on parseFromString with invalid input.\r
+ try {\r
+ xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );\r
+ } catch ( e ) {}\r
+\r
+ parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ];\r
+ if ( !xml || parserErrorElem ) {\r
+ jQuery.error( "Invalid XML: " + (\r
+ parserErrorElem ?\r
+ jQuery.map( parserErrorElem.childNodes, function( el ) {\r
+ return el.textContent;\r
+ } ).join( "\n" ) :\r
+ data\r
+ ) );\r
+ }\r
+ return xml;\r
+};\r
+\r
+\r
+var\r
+ rbracket = /\[\]$/,\r
+ rCRLF = /\r?\n/g,\r
+ rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\r
+ rsubmittable = /^(?:input|select|textarea|keygen)/i;\r
+\r
+function buildParams( prefix, obj, traditional, add ) {\r
+ var name;\r
+\r
+ if ( Array.isArray( obj ) ) {\r
+\r
+ // Serialize array item.\r
+ jQuery.each( obj, function( i, v ) {\r
+ if ( traditional || rbracket.test( prefix ) ) {\r
+\r
+ // Treat each array item as a scalar.\r
+ add( prefix, v );\r
+\r
+ } else {\r
+\r
+ // Item is non-scalar (array or object), encode its numeric index.\r
+ buildParams(\r
+ prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",\r
+ v,\r
+ traditional,\r
+ add\r
+ );\r
+ }\r
+ } );\r
+\r
+ } else if ( !traditional && toType( obj ) === "object" ) {\r
+\r
+ // Serialize object item.\r
+ for ( name in obj ) {\r
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );\r
+ }\r
+\r
+ } else {\r
+\r
+ // Serialize scalar item.\r
+ add( prefix, obj );\r
+ }\r
+}\r
+\r
+// Serialize an array of form elements or a set of\r
+// key/values into a query string\r
+jQuery.param = function( a, traditional ) {\r
+ var prefix,\r
+ s = [],\r
+ add = function( key, valueOrFunction ) {\r
+\r
+ // If value is a function, invoke it and use its return value\r
+ var value = isFunction( valueOrFunction ) ?\r
+ valueOrFunction() :\r
+ valueOrFunction;\r
+\r
+ s[ s.length ] = encodeURIComponent( key ) + "=" +\r
+ encodeURIComponent( value == null ? "" : value );\r
+ };\r
+\r
+ if ( a == null ) {\r
+ return "";\r
+ }\r
+\r
+ // If an array was passed in, assume that it is an array of form elements.\r
+ if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {\r
+\r
+ // Serialize the form elements\r
+ jQuery.each( a, function() {\r
+ add( this.name, this.value );\r
+ } );\r
+\r
+ } else {\r
+\r
+ // If traditional, encode the "old" way (the way 1.3.2 or older\r
+ // did it), otherwise encode params recursively.\r
+ for ( prefix in a ) {\r
+ buildParams( prefix, a[ prefix ], traditional, add );\r
+ }\r
+ }\r
+\r
+ // Return the resulting serialization\r
+ return s.join( "&" );\r
+};\r
+\r
+jQuery.fn.extend( {\r
+ serialize: function() {\r
+ return jQuery.param( this.serializeArray() );\r
+ },\r
+ serializeArray: function() {\r
+ return this.map( function() {\r
+\r
+ // Can add propHook for "elements" to filter or add form elements\r
+ var elements = jQuery.prop( this, "elements" );\r
+ return elements ? jQuery.makeArray( elements ) : this;\r
+ } ).filter( function() {\r
+ var type = this.type;\r
+\r
+ // Use .is( ":disabled" ) so that fieldset[disabled] works\r
+ return this.name && !jQuery( this ).is( ":disabled" ) &&\r
+ rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&\r
+ ( this.checked || !rcheckableType.test( type ) );\r
+ } ).map( function( _i, elem ) {\r
+ var val = jQuery( this ).val();\r
+\r
+ if ( val == null ) {\r
+ return null;\r
+ }\r
+\r
+ if ( Array.isArray( val ) ) {\r
+ return jQuery.map( val, function( val ) {\r
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };\r
+ } );\r
+ }\r
+\r
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };\r
+ } ).get();\r
+ }\r
+} );\r
+\r
+\r
+var\r
+ r20 = /%20/g,\r
+ rhash = /#.*$/,\r
+ rantiCache = /([?&])_=[^&]*/,\r
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,\r
+\r
+ // #7653, #8125, #8152: local protocol detection\r
+ rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\r
+ rnoContent = /^(?:GET|HEAD)$/,\r
+ rprotocol = /^\/\//,\r
+\r
+ /* Prefilters\r
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\r
+ * 2) These are called:\r
+ * - BEFORE asking for a transport\r
+ * - AFTER param serialization (s.data is a string if s.processData is true)\r
+ * 3) key is the dataType\r
+ * 4) the catchall symbol "*" can be used\r
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed\r
+ */\r
+ prefilters = {},\r
+\r
+ /* Transports bindings\r
+ * 1) key is the dataType\r
+ * 2) the catchall symbol "*" can be used\r
+ * 3) selection will start with transport dataType and THEN go to "*" if needed\r
+ */\r
+ transports = {},\r
+\r
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression\r
+ allTypes = "*/".concat( "*" ),\r
+\r
+ // Anchor tag for parsing the document origin\r
+ originAnchor = document.createElement( "a" );\r
+\r
+originAnchor.href = location.href;\r
+\r
+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\r
+function addToPrefiltersOrTransports( structure ) {\r
+\r
+ // dataTypeExpression is optional and defaults to "*"\r
+ return function( dataTypeExpression, func ) {\r
+\r
+ if ( typeof dataTypeExpression !== "string" ) {\r
+ func = dataTypeExpression;\r
+ dataTypeExpression = "*";\r
+ }\r
+\r
+ var dataType,\r
+ i = 0,\r
+ dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];\r
+\r
+ if ( isFunction( func ) ) {\r
+\r
+ // For each dataType in the dataTypeExpression\r
+ while ( ( dataType = dataTypes[ i++ ] ) ) {\r
+\r
+ // Prepend if requested\r
+ if ( dataType[ 0 ] === "+" ) {\r
+ dataType = dataType.slice( 1 ) || "*";\r
+ ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );\r
+\r
+ // Otherwise append\r
+ } else {\r
+ ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );\r
+ }\r
+ }\r
+ }\r
+ };\r
+}\r
+\r
+// Base inspection function for prefilters and transports\r
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {\r
+\r
+ var inspected = {},\r
+ seekingTransport = ( structure === transports );\r
+\r
+ function inspect( dataType ) {\r
+ var selected;\r
+ inspected[ dataType ] = true;\r
+ jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {\r
+ var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );\r
+ if ( typeof dataTypeOrTransport === "string" &&\r
+ !seekingTransport && !inspected[ dataTypeOrTransport ] ) {\r
+\r
+ options.dataTypes.unshift( dataTypeOrTransport );\r
+ inspect( dataTypeOrTransport );\r
+ return false;\r
+ } else if ( seekingTransport ) {\r
+ return !( selected = dataTypeOrTransport );\r
+ }\r
+ } );\r
+ return selected;\r
+ }\r
+\r
+ return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );\r
+}\r
+\r
+// A special extend for ajax options\r
+// that takes "flat" options (not to be deep extended)\r
+// Fixes #9887\r
+function ajaxExtend( target, src ) {\r
+ var key, deep,\r
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};\r
+\r
+ for ( key in src ) {\r
+ if ( src[ key ] !== undefined ) {\r
+ ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];\r
+ }\r
+ }\r
+ if ( deep ) {\r
+ jQuery.extend( true, target, deep );\r
+ }\r
+\r
+ return target;\r
+}\r
+\r
+/* Handles responses to an ajax request:\r
+ * - finds the right dataType (mediates between content-type and expected dataType)\r
+ * - returns the corresponding response\r
+ */\r
+function ajaxHandleResponses( s, jqXHR, responses ) {\r
+\r
+ var ct, type, finalDataType, firstDataType,\r
+ contents = s.contents,\r
+ dataTypes = s.dataTypes;\r
+\r
+ // Remove auto dataType and get content-type in the process\r
+ while ( dataTypes[ 0 ] === "*" ) {\r
+ dataTypes.shift();\r
+ if ( ct === undefined ) {\r
+ ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );\r
+ }\r
+ }\r
+\r
+ // Check if we're dealing with a known content-type\r
+ if ( ct ) {\r
+ for ( type in contents ) {\r
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {\r
+ dataTypes.unshift( type );\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
+ // Check to see if we have a response for the expected dataType\r
+ if ( dataTypes[ 0 ] in responses ) {\r
+ finalDataType = dataTypes[ 0 ];\r
+ } else {\r
+\r
+ // Try convertible dataTypes\r
+ for ( type in responses ) {\r
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {\r
+ finalDataType = type;\r
+ break;\r
+ }\r
+ if ( !firstDataType ) {\r
+ firstDataType = type;\r
+ }\r
+ }\r
+\r
+ // Or just use first one\r
+ finalDataType = finalDataType || firstDataType;\r
+ }\r
+\r
+ // If we found a dataType\r
+ // We add the dataType to the list if needed\r
+ // and return the corresponding response\r
+ if ( finalDataType ) {\r
+ if ( finalDataType !== dataTypes[ 0 ] ) {\r
+ dataTypes.unshift( finalDataType );\r
+ }\r
+ return responses[ finalDataType ];\r
+ }\r
+}\r
+\r
+/* Chain conversions given the request and the original response\r
+ * Also sets the responseXXX fields on the jqXHR instance\r
+ */\r
+function ajaxConvert( s, response, jqXHR, isSuccess ) {\r
+ var conv2, current, conv, tmp, prev,\r
+ converters = {},\r
+\r
+ // Work with a copy of dataTypes in case we need to modify it for conversion\r
+ dataTypes = s.dataTypes.slice();\r
+\r
+ // Create converters map with lowercased keys\r
+ if ( dataTypes[ 1 ] ) {\r
+ for ( conv in s.converters ) {\r
+ converters[ conv.toLowerCase() ] = s.converters[ conv ];\r
+ }\r
+ }\r
+\r
+ current = dataTypes.shift();\r
+\r
+ // Convert to each sequential dataType\r
+ while ( current ) {\r
+\r
+ if ( s.responseFields[ current ] ) {\r
+ jqXHR[ s.responseFields[ current ] ] = response;\r
+ }\r
+\r
+ // Apply the dataFilter if provided\r
+ if ( !prev && isSuccess && s.dataFilter ) {\r
+ response = s.dataFilter( response, s.dataType );\r
+ }\r
+\r
+ prev = current;\r
+ current = dataTypes.shift();\r
+\r
+ if ( current ) {\r
+\r
+ // There's only work to do if current dataType is non-auto\r
+ if ( current === "*" ) {\r
+\r
+ current = prev;\r
+\r
+ // Convert response if prev dataType is non-auto and differs from current\r
+ } else if ( prev !== "*" && prev !== current ) {\r
+\r
+ // Seek a direct converter\r
+ conv = converters[ prev + " " + current ] || converters[ "* " + current ];\r
+\r
+ // If none found, seek a pair\r
+ if ( !conv ) {\r
+ for ( conv2 in converters ) {\r
+\r
+ // If conv2 outputs current\r
+ tmp = conv2.split( " " );\r
+ if ( tmp[ 1 ] === current ) {\r
+\r
+ // If prev can be converted to accepted input\r
+ conv = converters[ prev + " " + tmp[ 0 ] ] ||\r
+ converters[ "* " + tmp[ 0 ] ];\r
+ if ( conv ) {\r
+\r
+ // Condense equivalence converters\r
+ if ( conv === true ) {\r
+ conv = converters[ conv2 ];\r
+\r
+ // Otherwise, insert the intermediate dataType\r
+ } else if ( converters[ conv2 ] !== true ) {\r
+ current = tmp[ 0 ];\r
+ dataTypes.unshift( tmp[ 1 ] );\r
+ }\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ // Apply converter (if not an equivalence)\r
+ if ( conv !== true ) {\r
+\r
+ // Unless errors are allowed to bubble, catch and return them\r
+ if ( conv && s.throws ) {\r
+ response = conv( response );\r
+ } else {\r
+ try {\r
+ response = conv( response );\r
+ } catch ( e ) {\r
+ return {\r
+ state: "parsererror",\r
+ error: conv ? e : "No conversion from " + prev + " to " + current\r
+ };\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ return { state: "success", data: response };\r
+}\r
+\r
+jQuery.extend( {\r
+\r
+ // Counter for holding the number of active queries\r
+ active: 0,\r
+\r
+ // Last-Modified header cache for next request\r
+ lastModified: {},\r
+ etag: {},\r
+\r
+ ajaxSettings: {\r
+ url: location.href,\r
+ type: "GET",\r
+ isLocal: rlocalProtocol.test( location.protocol ),\r
+ global: true,\r
+ processData: true,\r
+ async: true,\r
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",\r
+\r
+ /*\r
+ timeout: 0,\r
+ data: null,\r
+ dataType: null,\r
+ username: null,\r
+ password: null,\r
+ cache: null,\r
+ throws: false,\r
+ traditional: false,\r
+ headers: {},\r
+ */\r
+\r
+ accepts: {\r
+ "*": allTypes,\r
+ text: "text/plain",\r
+ html: "text/html",\r
+ xml: "application/xml, text/xml",\r
+ json: "application/json, text/javascript"\r
+ },\r
+\r
+ contents: {\r
+ xml: /\bxml\b/,\r
+ html: /\bhtml/,\r
+ json: /\bjson\b/\r
+ },\r
+\r
+ responseFields: {\r
+ xml: "responseXML",\r
+ text: "responseText",\r
+ json: "responseJSON"\r
+ },\r
+\r
+ // Data converters\r
+ // Keys separate source (or catchall "*") and destination types with a single space\r
+ converters: {\r
+\r
+ // Convert anything to text\r
+ "* text": String,\r
+\r
+ // Text to html (true = no transformation)\r
+ "text html": true,\r
+\r
+ // Evaluate text as a json expression\r
+ "text json": JSON.parse,\r
+\r
+ // Parse text as xml\r
+ "text xml": jQuery.parseXML\r
+ },\r
+\r
+ // For options that shouldn't be deep extended:\r
+ // you can add your own custom options here if\r
+ // and when you create one that shouldn't be\r
+ // deep extended (see ajaxExtend)\r
+ flatOptions: {\r
+ url: true,\r
+ context: true\r
+ }\r
+ },\r
+\r
+ // Creates a full fledged settings object into target\r
+ // with both ajaxSettings and settings fields.\r
+ // If target is omitted, writes into ajaxSettings.\r
+ ajaxSetup: function( target, settings ) {\r
+ return settings ?\r
+\r
+ // Building a settings object\r
+ ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :\r
+\r
+ // Extending ajaxSettings\r
+ ajaxExtend( jQuery.ajaxSettings, target );\r
+ },\r
+\r
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),\r
+ ajaxTransport: addToPrefiltersOrTransports( transports ),\r
+\r
+ // Main method\r
+ ajax: function( url, options ) {\r
+\r
+ // If url is an object, simulate pre-1.5 signature\r
+ if ( typeof url === "object" ) {\r
+ options = url;\r
+ url = undefined;\r
+ }\r
+\r
+ // Force options to be an object\r
+ options = options || {};\r
+\r
+ var transport,\r
+\r
+ // URL without anti-cache param\r
+ cacheURL,\r
+\r
+ // Response headers\r
+ responseHeadersString,\r
+ responseHeaders,\r
+\r
+ // timeout handle\r
+ timeoutTimer,\r
+\r
+ // Url cleanup var\r
+ urlAnchor,\r
+\r
+ // Request state (becomes false upon send and true upon completion)\r
+ completed,\r
+\r
+ // To know if global events are to be dispatched\r
+ fireGlobals,\r
+\r
+ // Loop variable\r
+ i,\r
+\r
+ // uncached part of the url\r
+ uncached,\r
+\r
+ // Create the final options object\r
+ s = jQuery.ajaxSetup( {}, options ),\r
+\r
+ // Callbacks context\r
+ callbackContext = s.context || s,\r
+\r
+ // Context for global events is callbackContext if it is a DOM node or jQuery collection\r
+ globalEventContext = s.context &&\r
+ ( callbackContext.nodeType || callbackContext.jquery ) ?\r
+ jQuery( callbackContext ) :\r
+ jQuery.event,\r
+\r
+ // Deferreds\r
+ deferred = jQuery.Deferred(),\r
+ completeDeferred = jQuery.Callbacks( "once memory" ),\r
+\r
+ // Status-dependent callbacks\r
+ statusCode = s.statusCode || {},\r
+\r
+ // Headers (they are sent all at once)\r
+ requestHeaders = {},\r
+ requestHeadersNames = {},\r
+\r
+ // Default abort message\r
+ strAbort = "canceled",\r
+\r
+ // Fake xhr\r
+ jqXHR = {\r
+ readyState: 0,\r
+\r
+ // Builds headers hashtable if needed\r
+ getResponseHeader: function( key ) {\r
+ var match;\r
+ if ( completed ) {\r
+ if ( !responseHeaders ) {\r
+ responseHeaders = {};\r
+ while ( ( match = rheaders.exec( responseHeadersString ) ) ) {\r
+ responseHeaders[ match[ 1 ].toLowerCase() + " " ] =\r
+ ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )\r
+ .concat( match[ 2 ] );\r
+ }\r
+ }\r
+ match = responseHeaders[ key.toLowerCase() + " " ];\r
+ }\r
+ return match == null ? null : match.join( ", " );\r
+ },\r
+\r
+ // Raw string\r
+ getAllResponseHeaders: function() {\r
+ return completed ? responseHeadersString : null;\r
+ },\r
+\r
+ // Caches the header\r
+ setRequestHeader: function( name, value ) {\r
+ if ( completed == null ) {\r
+ name = requestHeadersNames[ name.toLowerCase() ] =\r
+ requestHeadersNames[ name.toLowerCase() ] || name;\r
+ requestHeaders[ name ] = value;\r
+ }\r
+ return this;\r
+ },\r
+\r
+ // Overrides response content-type header\r
+ overrideMimeType: function( type ) {\r
+ if ( completed == null ) {\r
+ s.mimeType = type;\r
+ }\r
+ return this;\r
+ },\r
+\r
+ // Status-dependent callbacks\r
+ statusCode: function( map ) {\r
+ var code;\r
+ if ( map ) {\r
+ if ( completed ) {\r
+\r
+ // Execute the appropriate callbacks\r
+ jqXHR.always( map[ jqXHR.status ] );\r
+ } else {\r
+\r
+ // Lazy-add the new callbacks in a way that preserves old ones\r
+ for ( code in map ) {\r
+ statusCode[ code ] = [ statusCode[ code ], map[ code ] ];\r
+ }\r
+ }\r
+ }\r
+ return this;\r
+ },\r
+\r
+ // Cancel the request\r
+ abort: function( statusText ) {\r
+ var finalText = statusText || strAbort;\r
+ if ( transport ) {\r
+ transport.abort( finalText );\r
+ }\r
+ done( 0, finalText );\r
+ return this;\r
+ }\r
+ };\r
+\r
+ // Attach deferreds\r
+ deferred.promise( jqXHR );\r
+\r
+ // Add protocol if not provided (prefilters might expect it)\r
+ // Handle falsy url in the settings object (#10093: consistency with old signature)\r
+ // We also use the url parameter if available\r
+ s.url = ( ( url || s.url || location.href ) + "" )\r
+ .replace( rprotocol, location.protocol + "//" );\r
+\r
+ // Alias method option to type as per ticket #12004\r
+ s.type = options.method || options.type || s.method || s.type;\r
+\r
+ // Extract dataTypes list\r
+ s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];\r
+\r
+ // A cross-domain request is in order when the origin doesn't match the current origin.\r
+ if ( s.crossDomain == null ) {\r
+ urlAnchor = document.createElement( "a" );\r
+\r
+ // Support: IE <=8 - 11, Edge 12 - 15\r
+ // IE throws exception on accessing the href property if url is malformed,\r
+ // e.g. http://example.com:80x/\r
+ try {\r
+ urlAnchor.href = s.url;\r
+\r
+ // Support: IE <=8 - 11 only\r
+ // Anchor's host property isn't correctly set when s.url is relative\r
+ urlAnchor.href = urlAnchor.href;\r
+ s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==\r
+ urlAnchor.protocol + "//" + urlAnchor.host;\r
+ } catch ( e ) {\r
+\r
+ // If there is an error parsing the URL, assume it is crossDomain,\r
+ // it can be rejected by the transport if it is invalid\r
+ s.crossDomain = true;\r
+ }\r
+ }\r
+\r
+ // Convert data if not already a string\r
+ if ( s.data && s.processData && typeof s.data !== "string" ) {\r
+ s.data = jQuery.param( s.data, s.traditional );\r
+ }\r
+\r
+ // Apply prefilters\r
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );\r
+\r
+ // If request was aborted inside a prefilter, stop there\r
+ if ( completed ) {\r
+ return jqXHR;\r
+ }\r
+\r
+ // We can fire global events as of now if asked to\r
+ // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)\r
+ fireGlobals = jQuery.event && s.global;\r
+\r
+ // Watch for a new set of requests\r
+ if ( fireGlobals && jQuery.active++ === 0 ) {\r
+ jQuery.event.trigger( "ajaxStart" );\r
+ }\r
+\r
+ // Uppercase the type\r
+ s.type = s.type.toUpperCase();\r
+\r
+ // Determine if request has content\r
+ s.hasContent = !rnoContent.test( s.type );\r
+\r
+ // Save the URL in case we're toying with the If-Modified-Since\r
+ // and/or If-None-Match header later on\r
+ // Remove hash to simplify url manipulation\r
+ cacheURL = s.url.replace( rhash, "" );\r
+\r
+ // More options handling for requests with no content\r
+ if ( !s.hasContent ) {\r
+\r
+ // Remember the hash so we can put it back\r
+ uncached = s.url.slice( cacheURL.length );\r
+\r
+ // If data is available and should be processed, append data to url\r
+ if ( s.data && ( s.processData || typeof s.data === "string" ) ) {\r
+ cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;\r
+\r
+ // #9682: remove data so that it's not used in an eventual retry\r
+ delete s.data;\r
+ }\r
+\r
+ // Add or update anti-cache param if needed\r
+ if ( s.cache === false ) {\r
+ cacheURL = cacheURL.replace( rantiCache, "$1" );\r
+ uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) +\r
+ uncached;\r
+ }\r
+\r
+ // Put hash and anti-cache on the URL that will be requested (gh-1732)\r
+ s.url = cacheURL + uncached;\r
+\r
+ // Change '%20' to '+' if this is encoded form body content (gh-2658)\r
+ } else if ( s.data && s.processData &&\r
+ ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {\r
+ s.data = s.data.replace( r20, "+" );\r
+ }\r
+\r
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\r
+ if ( s.ifModified ) {\r
+ if ( jQuery.lastModified[ cacheURL ] ) {\r
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );\r
+ }\r
+ if ( jQuery.etag[ cacheURL ] ) {\r
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );\r
+ }\r
+ }\r
+\r
+ // Set the correct header, if data is being sent\r
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {\r
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );\r
+ }\r
+\r
+ // Set the Accepts header for the server, depending on the dataType\r
+ jqXHR.setRequestHeader(\r
+ "Accept",\r
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?\r
+ s.accepts[ s.dataTypes[ 0 ] ] +\r
+ ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :\r
+ s.accepts[ "*" ]\r
+ );\r
+\r
+ // Check for headers option\r
+ for ( i in s.headers ) {\r
+ jqXHR.setRequestHeader( i, s.headers[ i ] );\r
+ }\r
+\r
+ // Allow custom headers/mimetypes and early abort\r
+ if ( s.beforeSend &&\r
+ ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {\r
+\r
+ // Abort if not done already and return\r
+ return jqXHR.abort();\r
+ }\r
+\r
+ // Aborting is no longer a cancellation\r
+ strAbort = "abort";\r
+\r
+ // Install callbacks on deferreds\r
+ completeDeferred.add( s.complete );\r
+ jqXHR.done( s.success );\r
+ jqXHR.fail( s.error );\r
+\r
+ // Get transport\r
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );\r
+\r
+ // If no transport, we auto-abort\r
+ if ( !transport ) {\r
+ done( -1, "No Transport" );\r
+ } else {\r
+ jqXHR.readyState = 1;\r
+\r
+ // Send global event\r
+ if ( fireGlobals ) {\r
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );\r
+ }\r
+\r
+ // If request was aborted inside ajaxSend, stop there\r
+ if ( completed ) {\r
+ return jqXHR;\r
+ }\r
+\r
+ // Timeout\r
+ if ( s.async && s.timeout > 0 ) {\r
+ timeoutTimer = window.setTimeout( function() {\r
+ jqXHR.abort( "timeout" );\r
+ }, s.timeout );\r
+ }\r
+\r
+ try {\r
+ completed = false;\r
+ transport.send( requestHeaders, done );\r
+ } catch ( e ) {\r
+\r
+ // Rethrow post-completion exceptions\r
+ if ( completed ) {\r
+ throw e;\r
+ }\r
+\r
+ // Propagate others as results\r
+ done( -1, e );\r
+ }\r
+ }\r
+\r
+ // Callback for when everything is done\r
+ function done( status, nativeStatusText, responses, headers ) {\r
+ var isSuccess, success, error, response, modified,\r
+ statusText = nativeStatusText;\r
+\r
+ // Ignore repeat invocations\r
+ if ( completed ) {\r
+ return;\r
+ }\r
+\r
+ completed = true;\r
+\r
+ // Clear timeout if it exists\r
+ if ( timeoutTimer ) {\r
+ window.clearTimeout( timeoutTimer );\r
+ }\r
+\r
+ // Dereference transport for early garbage collection\r
+ // (no matter how long the jqXHR object will be used)\r
+ transport = undefined;\r
+\r
+ // Cache response headers\r
+ responseHeadersString = headers || "";\r
+\r
+ // Set readyState\r
+ jqXHR.readyState = status > 0 ? 4 : 0;\r
+\r
+ // Determine if successful\r
+ isSuccess = status >= 200 && status < 300 || status === 304;\r
+\r
+ // Get response data\r
+ if ( responses ) {\r
+ response = ajaxHandleResponses( s, jqXHR, responses );\r
+ }\r
+\r
+ // Use a noop converter for missing script but not if jsonp\r
+ if ( !isSuccess &&\r
+ jQuery.inArray( "script", s.dataTypes ) > -1 &&\r
+ jQuery.inArray( "json", s.dataTypes ) < 0 ) {\r
+ s.converters[ "text script" ] = function() {};\r
+ }\r
+\r
+ // Convert no matter what (that way responseXXX fields are always set)\r
+ response = ajaxConvert( s, response, jqXHR, isSuccess );\r
+\r
+ // If successful, handle type chaining\r
+ if ( isSuccess ) {\r
+\r
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\r
+ if ( s.ifModified ) {\r
+ modified = jqXHR.getResponseHeader( "Last-Modified" );\r
+ if ( modified ) {\r
+ jQuery.lastModified[ cacheURL ] = modified;\r
+ }\r
+ modified = jqXHR.getResponseHeader( "etag" );\r
+ if ( modified ) {\r
+ jQuery.etag[ cacheURL ] = modified;\r
+ }\r
+ }\r
+\r
+ // if no content\r
+ if ( status === 204 || s.type === "HEAD" ) {\r
+ statusText = "nocontent";\r
+\r
+ // if not modified\r
+ } else if ( status === 304 ) {\r
+ statusText = "notmodified";\r
+\r
+ // If we have data, let's convert it\r
+ } else {\r
+ statusText = response.state;\r
+ success = response.data;\r
+ error = response.error;\r
+ isSuccess = !error;\r
+ }\r
+ } else {\r
+\r
+ // Extract error from statusText and normalize for non-aborts\r
+ error = statusText;\r
+ if ( status || !statusText ) {\r
+ statusText = "error";\r
+ if ( status < 0 ) {\r
+ status = 0;\r
+ }\r
+ }\r
+ }\r
+\r
+ // Set data for the fake xhr object\r
+ jqXHR.status = status;\r
+ jqXHR.statusText = ( nativeStatusText || statusText ) + "";\r
+\r
+ // Success/Error\r
+ if ( isSuccess ) {\r
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );\r
+ } else {\r
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );\r
+ }\r
+\r
+ // Status-dependent callbacks\r
+ jqXHR.statusCode( statusCode );\r
+ statusCode = undefined;\r
+\r
+ if ( fireGlobals ) {\r
+ globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",\r
+ [ jqXHR, s, isSuccess ? success : error ] );\r
+ }\r
+\r
+ // Complete\r
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );\r
+\r
+ if ( fireGlobals ) {\r
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );\r
+\r
+ // Handle the global AJAX counter\r
+ if ( !( --jQuery.active ) ) {\r
+ jQuery.event.trigger( "ajaxStop" );\r
+ }\r
+ }\r
+ }\r
+\r
+ return jqXHR;\r
+ },\r
+\r
+ getJSON: function( url, data, callback ) {\r
+ return jQuery.get( url, data, callback, "json" );\r
+ },\r
+\r
+ getScript: function( url, callback ) {\r
+ return jQuery.get( url, undefined, callback, "script" );\r
+ }\r
+} );\r
+\r
+jQuery.each( [ "get", "post" ], function( _i, method ) {\r
+ jQuery[ method ] = function( url, data, callback, type ) {\r
+\r
+ // Shift arguments if data argument was omitted\r
+ if ( isFunction( data ) ) {\r
+ type = type || callback;\r
+ callback = data;\r
+ data = undefined;\r
+ }\r
+\r
+ // The url can be an options object (which then must have .url)\r
+ return jQuery.ajax( jQuery.extend( {\r
+ url: url,\r
+ type: method,\r
+ dataType: type,\r
+ data: data,\r
+ success: callback\r
+ }, jQuery.isPlainObject( url ) && url ) );\r
+ };\r
+} );\r
+\r
+jQuery.ajaxPrefilter( function( s ) {\r
+ var i;\r
+ for ( i in s.headers ) {\r
+ if ( i.toLowerCase() === "content-type" ) {\r
+ s.contentType = s.headers[ i ] || "";\r
+ }\r
+ }\r
+} );\r
+\r
+\r
+jQuery._evalUrl = function( url, options, doc ) {\r
+ return jQuery.ajax( {\r
+ url: url,\r
+\r
+ // Make this explicit, since user can override this through ajaxSetup (#11264)\r
+ type: "GET",\r
+ dataType: "script",\r
+ cache: true,\r
+ async: false,\r
+ global: false,\r
+\r
+ // Only evaluate the response if it is successful (gh-4126)\r
+ // dataFilter is not invoked for failure responses, so using it instead\r
+ // of the default converter is kludgy but it works.\r
+ converters: {\r
+ "text script": function() {}\r
+ },\r
+ dataFilter: function( response ) {\r
+ jQuery.globalEval( response, options, doc );\r
+ }\r
+ } );\r
+};\r
+\r
+\r
+jQuery.fn.extend( {\r
+ wrapAll: function( html ) {\r
+ var wrap;\r
+\r
+ if ( this[ 0 ] ) {\r
+ if ( isFunction( html ) ) {\r
+ html = html.call( this[ 0 ] );\r
+ }\r
+\r
+ // The elements to wrap the target around\r
+ wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );\r
+\r
+ if ( this[ 0 ].parentNode ) {\r
+ wrap.insertBefore( this[ 0 ] );\r
+ }\r
+\r
+ wrap.map( function() {\r
+ var elem = this;\r
+\r
+ while ( elem.firstElementChild ) {\r
+ elem = elem.firstElementChild;\r
+ }\r
+\r
+ return elem;\r
+ } ).append( this );\r
+ }\r
+\r
+ return this;\r
+ },\r
+\r
+ wrapInner: function( html ) {\r
+ if ( isFunction( html ) ) {\r
+ return this.each( function( i ) {\r
+ jQuery( this ).wrapInner( html.call( this, i ) );\r
+ } );\r
+ }\r
+\r
+ return this.each( function() {\r
+ var self = jQuery( this ),\r
+ contents = self.contents();\r
+\r
+ if ( contents.length ) {\r
+ contents.wrapAll( html );\r
+\r
+ } else {\r
+ self.append( html );\r
+ }\r
+ } );\r
+ },\r
+\r
+ wrap: function( html ) {\r
+ var htmlIsFunction = isFunction( html );\r
+\r
+ return this.each( function( i ) {\r
+ jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );\r
+ } );\r
+ },\r
+\r
+ unwrap: function( selector ) {\r
+ this.parent( selector ).not( "body" ).each( function() {\r
+ jQuery( this ).replaceWith( this.childNodes );\r
+ } );\r
+ return this;\r
+ }\r
+} );\r
+\r
+\r
+jQuery.expr.pseudos.hidden = function( elem ) {\r
+ return !jQuery.expr.pseudos.visible( elem );\r
+};\r
+jQuery.expr.pseudos.visible = function( elem ) {\r
+ return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );\r
+};\r
+\r
+\r
+\r
+\r
+jQuery.ajaxSettings.xhr = function() {\r
+ try {\r
+ return new window.XMLHttpRequest();\r
+ } catch ( e ) {}\r
+};\r
+\r
+var xhrSuccessStatus = {\r
+\r
+ // File protocol always yields status code 0, assume 200\r
+ 0: 200,\r
+\r
+ // Support: IE <=9 only\r
+ // #1450: sometimes IE returns 1223 when it should be 204\r
+ 1223: 204\r
+ },\r
+ xhrSupported = jQuery.ajaxSettings.xhr();\r
+\r
+support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );\r
+support.ajax = xhrSupported = !!xhrSupported;\r
+\r
+jQuery.ajaxTransport( function( options ) {\r
+ var callback, errorCallback;\r
+\r
+ // Cross domain only allowed if supported through XMLHttpRequest\r
+ if ( support.cors || xhrSupported && !options.crossDomain ) {\r
+ return {\r
+ send: function( headers, complete ) {\r
+ var i,\r
+ xhr = options.xhr();\r
+\r
+ xhr.open(\r
+ options.type,\r
+ options.url,\r
+ options.async,\r
+ options.username,\r
+ options.password\r
+ );\r
+\r
+ // Apply custom fields if provided\r
+ if ( options.xhrFields ) {\r
+ for ( i in options.xhrFields ) {\r
+ xhr[ i ] = options.xhrFields[ i ];\r
+ }\r
+ }\r
+\r
+ // Override mime type if needed\r
+ if ( options.mimeType && xhr.overrideMimeType ) {\r
+ xhr.overrideMimeType( options.mimeType );\r
+ }\r
+\r
+ // X-Requested-With header\r
+ // For cross-domain requests, seeing as conditions for a preflight are\r
+ // akin to a jigsaw puzzle, we simply never set it to be sure.\r
+ // (it can always be set on a per-request basis or even using ajaxSetup)\r
+ // For same-domain requests, won't change header if already provided.\r
+ if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {\r
+ headers[ "X-Requested-With" ] = "XMLHttpRequest";\r
+ }\r
+\r
+ // Set headers\r
+ for ( i in headers ) {\r
+ xhr.setRequestHeader( i, headers[ i ] );\r
+ }\r
+\r
+ // Callback\r
+ callback = function( type ) {\r
+ return function() {\r
+ if ( callback ) {\r
+ callback = errorCallback = xhr.onload =\r
+ xhr.onerror = xhr.onabort = xhr.ontimeout =\r
+ xhr.onreadystatechange = null;\r
+\r
+ if ( type === "abort" ) {\r
+ xhr.abort();\r
+ } else if ( type === "error" ) {\r
+\r
+ // Support: IE <=9 only\r
+ // On a manual native abort, IE9 throws\r
+ // errors on any property access that is not readyState\r
+ if ( typeof xhr.status !== "number" ) {\r
+ complete( 0, "error" );\r
+ } else {\r
+ complete(\r
+\r
+ // File: protocol always yields status 0; see #8605, #14207\r
+ xhr.status,\r
+ xhr.statusText\r
+ );\r
+ }\r
+ } else {\r
+ complete(\r
+ xhrSuccessStatus[ xhr.status ] || xhr.status,\r
+ xhr.statusText,\r
+\r
+ // Support: IE <=9 only\r
+ // IE9 has no XHR2 but throws on binary (trac-11426)\r
+ // For XHR2 non-text, let the caller handle it (gh-2498)\r
+ ( xhr.responseType || "text" ) !== "text" ||\r
+ typeof xhr.responseText !== "string" ?\r
+ { binary: xhr.response } :\r
+ { text: xhr.responseText },\r
+ xhr.getAllResponseHeaders()\r
+ );\r
+ }\r
+ }\r
+ };\r
+ };\r
+\r
+ // Listen to events\r
+ xhr.onload = callback();\r
+ errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );\r
+\r
+ // Support: IE 9 only\r
+ // Use onreadystatechange to replace onabort\r
+ // to handle uncaught aborts\r
+ if ( xhr.onabort !== undefined ) {\r
+ xhr.onabort = errorCallback;\r
+ } else {\r
+ xhr.onreadystatechange = function() {\r
+\r
+ // Check readyState before timeout as it changes\r
+ if ( xhr.readyState === 4 ) {\r
+\r
+ // Allow onerror to be called first,\r
+ // but that will not handle a native abort\r
+ // Also, save errorCallback to a variable\r
+ // as xhr.onerror cannot be accessed\r
+ window.setTimeout( function() {\r
+ if ( callback ) {\r
+ errorCallback();\r
+ }\r
+ } );\r
+ }\r
+ };\r
+ }\r
+\r
+ // Create the abort callback\r
+ callback = callback( "abort" );\r
+\r
+ try {\r
+\r
+ // Do send the request (this may raise an exception)\r
+ xhr.send( options.hasContent && options.data || null );\r
+ } catch ( e ) {\r
+\r
+ // #14683: Only rethrow if this hasn't been notified as an error yet\r
+ if ( callback ) {\r
+ throw e;\r
+ }\r
+ }\r
+ },\r
+\r
+ abort: function() {\r
+ if ( callback ) {\r
+ callback();\r
+ }\r
+ }\r
+ };\r
+ }\r
+} );\r
+\r
+\r
+\r
+\r
+// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)\r
+jQuery.ajaxPrefilter( function( s ) {\r
+ if ( s.crossDomain ) {\r
+ s.contents.script = false;\r
+ }\r
+} );\r
+\r
+// Install script dataType\r
+jQuery.ajaxSetup( {\r
+ accepts: {\r
+ script: "text/javascript, application/javascript, " +\r
+ "application/ecmascript, application/x-ecmascript"\r
+ },\r
+ contents: {\r
+ script: /\b(?:java|ecma)script\b/\r
+ },\r
+ converters: {\r
+ "text script": function( text ) {\r
+ jQuery.globalEval( text );\r
+ return text;\r
+ }\r
+ }\r
+} );\r
+\r
+// Handle cache's special case and crossDomain\r
+jQuery.ajaxPrefilter( "script", function( s ) {\r
+ if ( s.cache === undefined ) {\r
+ s.cache = false;\r
+ }\r
+ if ( s.crossDomain ) {\r
+ s.type = "GET";\r
+ }\r
+} );\r
+\r
+// Bind script tag hack transport\r
+jQuery.ajaxTransport( "script", function( s ) {\r
+\r
+ // This transport only deals with cross domain or forced-by-attrs requests\r
+ if ( s.crossDomain || s.scriptAttrs ) {\r
+ var script, callback;\r
+ return {\r
+ send: function( _, complete ) {\r
+ script = jQuery( "<script>" )\r
+ .attr( s.scriptAttrs || {} )\r
+ .prop( { charset: s.scriptCharset, src: s.url } )\r
+ .on( "load error", callback = function( evt ) {\r
+ script.remove();\r
+ callback = null;\r
+ if ( evt ) {\r
+ complete( evt.type === "error" ? 404 : 200, evt.type );\r
+ }\r
+ } );\r
+\r
+ // Use native DOM manipulation to avoid our domManip AJAX trickery\r
+ document.head.appendChild( script[ 0 ] );\r
+ },\r
+ abort: function() {\r
+ if ( callback ) {\r
+ callback();\r
+ }\r
+ }\r
+ };\r
+ }\r
+} );\r
+\r
+\r
+\r
+\r
+var oldCallbacks = [],\r
+ rjsonp = /(=)\?(?=&|$)|\?\?/;\r
+\r
+// Default jsonp settings\r
+jQuery.ajaxSetup( {\r
+ jsonp: "callback",\r
+ jsonpCallback: function() {\r
+ var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );\r
+ this[ callback ] = true;\r
+ return callback;\r
+ }\r
+} );\r
+\r
+// Detect, normalize options and install callbacks for jsonp requests\r
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {\r
+\r
+ var callbackName, overwritten, responseContainer,\r
+ jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?\r
+ "url" :\r
+ typeof s.data === "string" &&\r
+ ( s.contentType || "" )\r
+ .indexOf( "application/x-www-form-urlencoded" ) === 0 &&\r
+ rjsonp.test( s.data ) && "data"\r
+ );\r
+\r
+ // Handle iff the expected data type is "jsonp" or we have a parameter to set\r
+ if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {\r
+\r
+ // Get callback name, remembering preexisting value associated with it\r
+ callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?\r
+ s.jsonpCallback() :\r
+ s.jsonpCallback;\r
+\r
+ // Insert callback into url or form data\r
+ if ( jsonProp ) {\r
+ s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );\r
+ } else if ( s.jsonp !== false ) {\r
+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;\r
+ }\r
+\r
+ // Use data converter to retrieve json after script execution\r
+ s.converters[ "script json" ] = function() {\r
+ if ( !responseContainer ) {\r
+ jQuery.error( callbackName + " was not called" );\r
+ }\r
+ return responseContainer[ 0 ];\r
+ };\r
+\r
+ // Force json dataType\r
+ s.dataTypes[ 0 ] = "json";\r
+\r
+ // Install callback\r
+ overwritten = window[ callbackName ];\r
+ window[ callbackName ] = function() {\r
+ responseContainer = arguments;\r
+ };\r
+\r
+ // Clean-up function (fires after converters)\r
+ jqXHR.always( function() {\r
+\r
+ // If previous value didn't exist - remove it\r
+ if ( overwritten === undefined ) {\r
+ jQuery( window ).removeProp( callbackName );\r
+\r
+ // Otherwise restore preexisting value\r
+ } else {\r
+ window[ callbackName ] = overwritten;\r
+ }\r
+\r
+ // Save back as free\r
+ if ( s[ callbackName ] ) {\r
+\r
+ // Make sure that re-using the options doesn't screw things around\r
+ s.jsonpCallback = originalSettings.jsonpCallback;\r
+\r
+ // Save the callback name for future use\r
+ oldCallbacks.push( callbackName );\r
+ }\r
+\r
+ // Call if it was a function and we have a response\r
+ if ( responseContainer && isFunction( overwritten ) ) {\r
+ overwritten( responseContainer[ 0 ] );\r
+ }\r
+\r
+ responseContainer = overwritten = undefined;\r
+ } );\r
+\r
+ // Delegate to script\r
+ return "script";\r
+ }\r
+} );\r
+\r
+\r
+\r
+\r
+// Support: Safari 8 only\r
+// In Safari 8 documents created via document.implementation.createHTMLDocument\r
+// collapse sibling forms: the second one becomes a child of the first one.\r
+// Because of that, this security measure has to be disabled in Safari 8.\r
+// https://bugs.webkit.org/show_bug.cgi?id=137337\r
+support.createHTMLDocument = ( function() {\r
+ var body = document.implementation.createHTMLDocument( "" ).body;\r
+ body.innerHTML = "<form></form><form></form>";\r
+ return body.childNodes.length === 2;\r
+} )();\r
+\r
+\r
+// Argument "data" should be string of html\r
+// context (optional): If specified, the fragment will be created in this context,\r
+// defaults to document\r
+// keepScripts (optional): If true, will include scripts passed in the html string\r
+jQuery.parseHTML = function( data, context, keepScripts ) {\r
+ if ( typeof data !== "string" ) {\r
+ return [];\r
+ }\r
+ if ( typeof context === "boolean" ) {\r
+ keepScripts = context;\r
+ context = false;\r
+ }\r
+\r
+ var base, parsed, scripts;\r
+\r
+ if ( !context ) {\r
+\r
+ // Stop scripts or inline event handlers from being executed immediately\r
+ // by using document.implementation\r
+ if ( support.createHTMLDocument ) {\r
+ context = document.implementation.createHTMLDocument( "" );\r
+\r
+ // Set the base href for the created document\r
+ // so any parsed elements with URLs\r
+ // are based on the document's URL (gh-2965)\r
+ base = context.createElement( "base" );\r
+ base.href = document.location.href;\r
+ context.head.appendChild( base );\r
+ } else {\r
+ context = document;\r
+ }\r
+ }\r
+\r
+ parsed = rsingleTag.exec( data );\r
+ scripts = !keepScripts && [];\r
+\r
+ // Single tag\r
+ if ( parsed ) {\r
+ return [ context.createElement( parsed[ 1 ] ) ];\r
+ }\r
+\r
+ parsed = buildFragment( [ data ], context, scripts );\r
+\r
+ if ( scripts && scripts.length ) {\r
+ jQuery( scripts ).remove();\r
+ }\r
+\r
+ return jQuery.merge( [], parsed.childNodes );\r
+};\r
+\r
+\r
+/**\r
+ * Load a url into a page\r
+ */\r
+jQuery.fn.load = function( url, params, callback ) {\r
+ var selector, type, response,\r
+ self = this,\r
+ off = url.indexOf( " " );\r
+\r
+ if ( off > -1 ) {\r
+ selector = stripAndCollapse( url.slice( off ) );\r
+ url = url.slice( 0, off );\r
+ }\r
+\r
+ // If it's a function\r
+ if ( isFunction( params ) ) {\r
+\r
+ // We assume that it's the callback\r
+ callback = params;\r
+ params = undefined;\r
+\r
+ // Otherwise, build a param string\r
+ } else if ( params && typeof params === "object" ) {\r
+ type = "POST";\r
+ }\r
+\r
+ // If we have elements to modify, make the request\r
+ if ( self.length > 0 ) {\r
+ jQuery.ajax( {\r
+ url: url,\r
+\r
+ // If "type" variable is undefined, then "GET" method will be used.\r
+ // Make value of this field explicit since\r
+ // user can override it through ajaxSetup method\r
+ type: type || "GET",\r
+ dataType: "html",\r
+ data: params\r
+ } ).done( function( responseText ) {\r
+\r
+ // Save response for use in complete callback\r
+ response = arguments;\r
+\r
+ self.html( selector ?\r
+\r
+ // If a selector was specified, locate the right elements in a dummy div\r
+ // Exclude scripts to avoid IE 'Permission Denied' errors\r
+ jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :\r
+\r
+ // Otherwise use the full result\r
+ responseText );\r
+\r
+ // If the request succeeds, this function gets "data", "status", "jqXHR"\r
+ // but they are ignored because response was set above.\r
+ // If it fails, this function gets "jqXHR", "status", "error"\r
+ } ).always( callback && function( jqXHR, status ) {\r
+ self.each( function() {\r
+ callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );\r
+ } );\r
+ } );\r
+ }\r
+\r
+ return this;\r
+};\r
+\r
+\r
+\r
+\r
+jQuery.expr.pseudos.animated = function( elem ) {\r
+ return jQuery.grep( jQuery.timers, function( fn ) {\r
+ return elem === fn.elem;\r
+ } ).length;\r
+};\r
+\r
+\r
+\r
+\r
+jQuery.offset = {\r
+ setOffset: function( elem, options, i ) {\r
+ var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,\r
+ position = jQuery.css( elem, "position" ),\r
+ curElem = jQuery( elem ),\r
+ props = {};\r
+\r
+ // Set position first, in-case top/left are set even on static elem\r
+ if ( position === "static" ) {\r
+ elem.style.position = "relative";\r
+ }\r
+\r
+ curOffset = curElem.offset();\r
+ curCSSTop = jQuery.css( elem, "top" );\r
+ curCSSLeft = jQuery.css( elem, "left" );\r
+ calculatePosition = ( position === "absolute" || position === "fixed" ) &&\r
+ ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;\r
+\r
+ // Need to be able to calculate position if either\r
+ // top or left is auto and position is either absolute or fixed\r
+ if ( calculatePosition ) {\r
+ curPosition = curElem.position();\r
+ curTop = curPosition.top;\r
+ curLeft = curPosition.left;\r
+\r
+ } else {\r
+ curTop = parseFloat( curCSSTop ) || 0;\r
+ curLeft = parseFloat( curCSSLeft ) || 0;\r
+ }\r
+\r
+ if ( isFunction( options ) ) {\r
+\r
+ // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)\r
+ options = options.call( elem, i, jQuery.extend( {}, curOffset ) );\r
+ }\r
+\r
+ if ( options.top != null ) {\r
+ props.top = ( options.top - curOffset.top ) + curTop;\r
+ }\r
+ if ( options.left != null ) {\r
+ props.left = ( options.left - curOffset.left ) + curLeft;\r
+ }\r
+\r
+ if ( "using" in options ) {\r
+ options.using.call( elem, props );\r
+\r
+ } else {\r
+ curElem.css( props );\r
+ }\r
+ }\r
+};\r
+\r
+jQuery.fn.extend( {\r
+\r
+ // offset() relates an element's border box to the document origin\r
+ offset: function( options ) {\r
+\r
+ // Preserve chaining for setter\r
+ if ( arguments.length ) {\r
+ return options === undefined ?\r
+ this :\r
+ this.each( function( i ) {\r
+ jQuery.offset.setOffset( this, options, i );\r
+ } );\r
+ }\r
+\r
+ var rect, win,\r
+ elem = this[ 0 ];\r
+\r
+ if ( !elem ) {\r
+ return;\r
+ }\r
+\r
+ // Return zeros for disconnected and hidden (display: none) elements (gh-2310)\r
+ // Support: IE <=11 only\r
+ // Running getBoundingClientRect on a\r
+ // disconnected node in IE throws an error\r
+ if ( !elem.getClientRects().length ) {\r
+ return { top: 0, left: 0 };\r
+ }\r
+\r
+ // Get document-relative position by adding viewport scroll to viewport-relative gBCR\r
+ rect = elem.getBoundingClientRect();\r
+ win = elem.ownerDocument.defaultView;\r
+ return {\r
+ top: rect.top + win.pageYOffset,\r
+ left: rect.left + win.pageXOffset\r
+ };\r
+ },\r
+\r
+ // position() relates an element's margin box to its offset parent's padding box\r
+ // This corresponds to the behavior of CSS absolute positioning\r
+ position: function() {\r
+ if ( !this[ 0 ] ) {\r
+ return;\r
+ }\r
+\r
+ var offsetParent, offset, doc,\r
+ elem = this[ 0 ],\r
+ parentOffset = { top: 0, left: 0 };\r
+\r
+ // position:fixed elements are offset from the viewport, which itself always has zero offset\r
+ if ( jQuery.css( elem, "position" ) === "fixed" ) {\r
+\r
+ // Assume position:fixed implies availability of getBoundingClientRect\r
+ offset = elem.getBoundingClientRect();\r
+\r
+ } else {\r
+ offset = this.offset();\r
+\r
+ // Account for the *real* offset parent, which can be the document or its root element\r
+ // when a statically positioned element is identified\r
+ doc = elem.ownerDocument;\r
+ offsetParent = elem.offsetParent || doc.documentElement;\r
+ while ( offsetParent &&\r
+ ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&\r
+ jQuery.css( offsetParent, "position" ) === "static" ) {\r
+\r
+ offsetParent = offsetParent.parentNode;\r
+ }\r
+ if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {\r
+\r
+ // Incorporate borders into its offset, since they are outside its content origin\r
+ parentOffset = jQuery( offsetParent ).offset();\r
+ parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );\r
+ parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );\r
+ }\r
+ }\r
+\r
+ // Subtract parent offsets and element margins\r
+ return {\r
+ top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),\r
+ left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )\r
+ };\r
+ },\r
+\r
+ // This method will return documentElement in the following cases:\r
+ // 1) For the element inside the iframe without offsetParent, this method will return\r
+ // documentElement of the parent window\r
+ // 2) For the hidden or detached element\r
+ // 3) For body or html element, i.e. in case of the html node - it will return itself\r
+ //\r
+ // but those exceptions were never presented as a real life use-cases\r
+ // and might be considered as more preferable results.\r
+ //\r
+ // This logic, however, is not guaranteed and can change at any point in the future\r
+ offsetParent: function() {\r
+ return this.map( function() {\r
+ var offsetParent = this.offsetParent;\r
+\r
+ while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {\r
+ offsetParent = offsetParent.offsetParent;\r
+ }\r
+\r
+ return offsetParent || documentElement;\r
+ } );\r
+ }\r
+} );\r
+\r
+// Create scrollLeft and scrollTop methods\r
+jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {\r
+ var top = "pageYOffset" === prop;\r
+\r
+ jQuery.fn[ method ] = function( val ) {\r
+ return access( this, function( elem, method, val ) {\r
+\r
+ // Coalesce documents and windows\r
+ var win;\r
+ if ( isWindow( elem ) ) {\r
+ win = elem;\r
+ } else if ( elem.nodeType === 9 ) {\r
+ win = elem.defaultView;\r
+ }\r
+\r
+ if ( val === undefined ) {\r
+ return win ? win[ prop ] : elem[ method ];\r
+ }\r
+\r
+ if ( win ) {\r
+ win.scrollTo(\r
+ !top ? val : win.pageXOffset,\r
+ top ? val : win.pageYOffset\r
+ );\r
+\r
+ } else {\r
+ elem[ method ] = val;\r
+ }\r
+ }, method, val, arguments.length );\r
+ };\r
+} );\r
+\r
+// Support: Safari <=7 - 9.1, Chrome <=37 - 49\r
+// Add the top/left cssHooks using jQuery.fn.position\r
+// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\r
+// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347\r
+// getComputedStyle returns percent when specified for top/left/bottom/right;\r
+// rather than make the css module depend on the offset module, just check for it here\r
+jQuery.each( [ "top", "left" ], function( _i, prop ) {\r
+ jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,\r
+ function( elem, computed ) {\r
+ if ( computed ) {\r
+ computed = curCSS( elem, prop );\r
+\r
+ // If curCSS returns percentage, fallback to offset\r
+ return rnumnonpx.test( computed ) ?\r
+ jQuery( elem ).position()[ prop ] + "px" :\r
+ computed;\r
+ }\r
+ }\r
+ );\r
+} );\r
+\r
+\r
+// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\r
+jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {\r
+ jQuery.each( {\r
+ padding: "inner" + name,\r
+ content: type,\r
+ "": "outer" + name\r
+ }, function( defaultExtra, funcName ) {\r
+\r
+ // Margin is only for outerHeight, outerWidth\r
+ jQuery.fn[ funcName ] = function( margin, value ) {\r
+ var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),\r
+ extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );\r
+\r
+ return access( this, function( elem, type, value ) {\r
+ var doc;\r
+\r
+ if ( isWindow( elem ) ) {\r
+\r
+ // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)\r
+ return funcName.indexOf( "outer" ) === 0 ?\r
+ elem[ "inner" + name ] :\r
+ elem.document.documentElement[ "client" + name ];\r
+ }\r
+\r
+ // Get document width or height\r
+ if ( elem.nodeType === 9 ) {\r
+ doc = elem.documentElement;\r
+\r
+ // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],\r
+ // whichever is greatest\r
+ return Math.max(\r
+ elem.body[ "scroll" + name ], doc[ "scroll" + name ],\r
+ elem.body[ "offset" + name ], doc[ "offset" + name ],\r
+ doc[ "client" + name ]\r
+ );\r
+ }\r
+\r
+ return value === undefined ?\r
+\r
+ // Get width or height on the element, requesting but not forcing parseFloat\r
+ jQuery.css( elem, type, extra ) :\r
+\r
+ // Set width or height on the element\r
+ jQuery.style( elem, type, value, extra );\r
+ }, type, chainable ? margin : undefined, chainable );\r
+ };\r
+ } );\r
+} );\r
+\r
+\r
+jQuery.each( [\r
+ "ajaxStart",\r
+ "ajaxStop",\r
+ "ajaxComplete",\r
+ "ajaxError",\r
+ "ajaxSuccess",\r
+ "ajaxSend"\r
+], function( _i, type ) {\r
+ jQuery.fn[ type ] = function( fn ) {\r
+ return this.on( type, fn );\r
+ };\r
+} );\r
+\r
+\r
+\r
+\r
+jQuery.fn.extend( {\r
+\r
+ bind: function( types, data, fn ) {\r
+ return this.on( types, null, data, fn );\r
+ },\r
+ unbind: function( types, fn ) {\r
+ return this.off( types, null, fn );\r
+ },\r
+\r
+ delegate: function( selector, types, data, fn ) {\r
+ return this.on( types, selector, data, fn );\r
+ },\r
+ undelegate: function( selector, types, fn ) {\r
+\r
+ // ( namespace ) or ( selector, types [, fn] )\r
+ return arguments.length === 1 ?\r
+ this.off( selector, "**" ) :\r
+ this.off( types, selector || "**", fn );\r
+ },\r
+\r
+ hover: function( fnOver, fnOut ) {\r
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );\r
+ }\r
+} );\r
+\r
+jQuery.each(\r
+ ( "blur focus focusin focusout resize scroll click dblclick " +\r
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +\r
+ "change select submit keydown keypress keyup contextmenu" ).split( " " ),\r
+ function( _i, name ) {\r
+\r
+ // Handle event binding\r
+ jQuery.fn[ name ] = function( data, fn ) {\r
+ return arguments.length > 0 ?\r
+ this.on( name, null, data, fn ) :\r
+ this.trigger( name );\r
+ };\r
+ }\r
+);\r
+\r
+\r
+\r
+\r
+// Support: Android <=4.0 only\r
+// Make sure we trim BOM and NBSP\r
+var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;\r
+\r
+// Bind a function to a context, optionally partially applying any\r
+// arguments.\r
+// jQuery.proxy is deprecated to promote standards (specifically Function#bind)\r
+// However, it is not slated for removal any time soon\r
+jQuery.proxy = function( fn, context ) {\r
+ var tmp, args, proxy;\r
+\r
+ if ( typeof context === "string" ) {\r
+ tmp = fn[ context ];\r
+ context = fn;\r
+ fn = tmp;\r
+ }\r
+\r
+ // Quick check to determine if target is callable, in the spec\r
+ // this throws a TypeError, but we will just return undefined.\r
+ if ( !isFunction( fn ) ) {\r
+ return undefined;\r
+ }\r
+\r
+ // Simulated bind\r
+ args = slice.call( arguments, 2 );\r
+ proxy = function() {\r
+ return fn.apply( context || this, args.concat( slice.call( arguments ) ) );\r
+ };\r
+\r
+ // Set the guid of unique handler to the same of original handler, so it can be removed\r
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;\r
+\r
+ return proxy;\r
+};\r
+\r
+jQuery.holdReady = function( hold ) {\r
+ if ( hold ) {\r
+ jQuery.readyWait++;\r
+ } else {\r
+ jQuery.ready( true );\r
+ }\r
+};\r
+jQuery.isArray = Array.isArray;\r
+jQuery.parseJSON = JSON.parse;\r
+jQuery.nodeName = nodeName;\r
+jQuery.isFunction = isFunction;\r
+jQuery.isWindow = isWindow;\r
+jQuery.camelCase = camelCase;\r
+jQuery.type = toType;\r
+\r
+jQuery.now = Date.now;\r
+\r
+jQuery.isNumeric = function( obj ) {\r
+\r
+ // As of jQuery 3.0, isNumeric is limited to\r
+ // strings and numbers (primitives or objects)\r
+ // that can be coerced to finite numbers (gh-2662)\r
+ var type = jQuery.type( obj );\r
+ return ( type === "number" || type === "string" ) &&\r
+\r
+ // parseFloat NaNs numeric-cast false positives ("")\r
+ // ...but misinterprets leading-number strings, particularly hex literals ("0x...")\r
+ // subtraction forces infinities to NaN\r
+ !isNaN( obj - parseFloat( obj ) );\r
+};\r
+\r
+jQuery.trim = function( text ) {\r
+ return text == null ?\r
+ "" :\r
+ ( text + "" ).replace( rtrim, "" );\r
+};\r
+\r
+\r
+\r
+// Register as a named AMD module, since jQuery can be concatenated with other\r
+// files that may use define, but not via a proper concatenation script that\r
+// understands anonymous AMD modules. A named AMD is safest and most robust\r
+// way to register. Lowercase jquery is used because AMD module names are\r
+// derived from file names, and jQuery is normally delivered in a lowercase\r
+// file name. Do this after creating the global so that if an AMD module wants\r
+// to call noConflict to hide this version of jQuery, it will work.\r
+\r
+// Note that for maximum portability, libraries that are not jQuery should\r
+// declare themselves as anonymous modules, and avoid setting a global if an\r
+// AMD loader is present. jQuery is a special case. For more information, see\r
+// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon\r
+\r
+if ( typeof define === "function" && define.amd ) {\r
+ define( "jquery", [], function() {\r
+ return jQuery;\r
+ } );\r
+}\r
+\r
+\r
+\r
+\r
+var\r
+\r
+ // Map over jQuery in case of overwrite\r
+ _jQuery = window.jQuery,\r
+\r
+ // Map over the $ in case of overwrite\r
+ _$ = window.$;\r
+\r
+jQuery.noConflict = function( deep ) {\r
+ if ( window.$ === jQuery ) {\r
+ window.$ = _$;\r
+ }\r
+\r
+ if ( deep && window.jQuery === jQuery ) {\r
+ window.jQuery = _jQuery;\r
+ }\r
+\r
+ return jQuery;\r
+};\r
+\r
+// Expose jQuery and $ identifiers, even in AMD\r
+// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)\r
+// and CommonJS for browser emulators (#13566)\r
+if ( typeof noGlobal === "undefined" ) {\r
+ window.jQuery = window.$ = jQuery;\r
+}\r
+\r
+\r
+\r
+\r
+return jQuery;\r
+} );\r