////////////////////////////////////////////////////////////////////////// // // // This is a generated file. You can view the original // // source in your browser if your browser supports source maps. // // // // If you are using Chrome, open the Developer Tools and click the gear // // icon in its lower right corner. In the General Settings panel, turn // // on 'Enable source maps'. // // // // If you are using Firefox 23, go to `about:config` and set the // // `devtools.debugger.source-maps-enabled` preference to true. // // (The preference should be on by default in Firefox 24; versions // // older than 23 do not support source maps.) // // // ////////////////////////////////////////////////////////////////////////// (function () { /* Imports */ var Meteor = Package.meteor.Meteor; /* Package-scope variables */ var $, jQuery; (function () { /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // // packages/jquery/jquery.js // // // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // /*! // 1 * jQuery JavaScript Library v1.11.2 // 2 * http://jquery.com/ // 3 * // 4 * Includes Sizzle.js // 5 * http://sizzlejs.com/ // 6 * // 7 * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors // 8 * Released under the MIT license // 9 * http://jquery.org/license // 10 * // 11 * Date: 2014-12-17T15:27Z // 12 */ // 13 // 14 (function( global, factory ) { // 15 // 16 if ( typeof module === "object" && typeof module.exports === "object" ) { // 17 // For CommonJS and CommonJS-like environments where a proper window is present, // 18 // execute the factory and get jQuery // 19 // For environments that do not inherently posses a window with a document // 20 // (such as Node.js), expose a jQuery-making factory as module.exports // 21 // This accentuates the need for the creation of a real window // 22 // e.g. var jQuery = require("jquery")(window); // 23 // See ticket #14549 for more info // 24 module.exports = global.document ? // 25 factory( global, true ) : // 26 function( w ) { // 27 if ( !w.document ) { // 28 throw new Error( "jQuery requires a window with a document" ); // 29 } // 30 return factory( w ); // 31 }; // 32 } else { // 33 factory( global ); // 34 } // 35 // 36 // Pass this if window is not defined yet // 37 }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { // 38 // 39 // Can't do this because several apps including ASP.NET trace // 40 // the stack via arguments.caller.callee and Firefox dies if // 41 // you try to trace through "use strict" call chains. (#13335) // 42 // Support: Firefox 18+ // 43 // // 44 // 45 var deletedIds = []; // 46 // 47 var slice = deletedIds.slice; // 48 // 49 var concat = deletedIds.concat; // 50 // 51 var push = deletedIds.push; // 52 // 53 var indexOf = deletedIds.indexOf; // 54 // 55 var class2type = {}; // 56 // 57 var toString = class2type.toString; // 58 // 59 var hasOwn = class2type.hasOwnProperty; // 60 // 61 var support = {}; // 62 // 63 // 64 // 65 var // 66 version = "1.11.2", // 67 // 68 // Define a local copy of jQuery // 69 jQuery = function( selector, context ) { // 70 // The jQuery object is actually just the init constructor 'enhanced' // 71 // Need init if jQuery is called (just allow error to be thrown if not included) // 72 return new jQuery.fn.init( selector, context ); // 73 }, // 74 // 75 // Support: Android<4.1, IE<9 // 76 // Make sure we trim BOM and NBSP // 77 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // 78 // 79 // Matches dashed string for camelizing // 80 rmsPrefix = /^-ms-/, // 81 rdashAlpha = /-([\da-z])/gi, // 82 // 83 // Used by jQuery.camelCase as callback to replace() // 84 fcamelCase = function( all, letter ) { // 85 return letter.toUpperCase(); // 86 }; // 87 // 88 jQuery.fn = jQuery.prototype = { // 89 // The current version of jQuery being used // 90 jquery: version, // 91 // 92 constructor: jQuery, // 93 // 94 // Start with an empty selector // 95 selector: "", // 96 // 97 // The default length of a jQuery object is 0 // 98 length: 0, // 99 // 100 toArray: function() { // 101 return slice.call( this ); // 102 }, // 103 // 104 // Get the Nth element in the matched element set OR // 105 // Get the whole matched element set as a clean array // 106 get: function( num ) { // 107 return num != null ? // 108 // 109 // Return just the one element from the set // 110 ( num < 0 ? this[ num + this.length ] : this[ num ] ) : // 111 // 112 // Return all the elements in a clean array // 113 slice.call( this ); // 114 }, // 115 // 116 // Take an array of elements and push it onto the stack // 117 // (returning the new matched element set) // 118 pushStack: function( elems ) { // 119 // 120 // Build a new jQuery matched element set // 121 var ret = jQuery.merge( this.constructor(), elems ); // 122 // 123 // Add the old object onto the stack (as a reference) // 124 ret.prevObject = this; // 125 ret.context = this.context; // 126 // 127 // Return the newly-formed element set // 128 return ret; // 129 }, // 130 // 131 // Execute a callback for every element in the matched set. // 132 // (You can seed the arguments with an array of args, but this is // 133 // only used internally.) // 134 each: function( callback, args ) { // 135 return jQuery.each( this, callback, args ); // 136 }, // 137 // 138 map: function( callback ) { // 139 return this.pushStack( jQuery.map(this, function( elem, i ) { // 140 return callback.call( elem, i, elem ); // 141 })); // 142 }, // 143 // 144 slice: function() { // 145 return this.pushStack( slice.apply( this, arguments ) ); // 146 }, // 147 // 148 first: function() { // 149 return this.eq( 0 ); // 150 }, // 151 // 152 last: function() { // 153 return this.eq( -1 ); // 154 }, // 155 // 156 eq: function( i ) { // 157 var len = this.length, // 158 j = +i + ( i < 0 ? len : 0 ); // 159 return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); // 160 }, // 161 // 162 end: function() { // 163 return this.prevObject || this.constructor(null); // 164 }, // 165 // 166 // For internal use only. // 167 // Behaves like an Array's method, not like a jQuery method. // 168 push: push, // 169 sort: deletedIds.sort, // 170 splice: deletedIds.splice // 171 }; // 172 // 173 jQuery.extend = jQuery.fn.extend = function() { // 174 var src, copyIsArray, copy, name, options, clone, // 175 target = arguments[0] || {}, // 176 i = 1, // 177 length = arguments.length, // 178 deep = false; // 179 // 180 // Handle a deep copy situation // 181 if ( typeof target === "boolean" ) { // 182 deep = target; // 183 // 184 // skip the boolean and the target // 185 target = arguments[ i ] || {}; // 186 i++; // 187 } // 188 // 189 // Handle case when target is a string or something (possible in deep copy) // 190 if ( typeof target !== "object" && !jQuery.isFunction(target) ) { // 191 target = {}; // 192 } // 193 // 194 // extend jQuery itself if only one argument is passed // 195 if ( i === length ) { // 196 target = this; // 197 i--; // 198 } // 199 // 200 for ( ; i < length; i++ ) { // 201 // Only deal with non-null/undefined values // 202 if ( (options = arguments[ i ]) != null ) { // 203 // Extend the base object // 204 for ( name in options ) { // 205 src = target[ name ]; // 206 copy = options[ name ]; // 207 // 208 // Prevent never-ending loop // 209 if ( target === copy ) { // 210 continue; // 211 } // 212 // 213 // Recurse if we're merging plain objects or arrays // 214 if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { // 215 if ( copyIsArray ) { // 216 copyIsArray = false; // 217 clone = src && jQuery.isArray(src) ? src : []; // 218 // 219 } else { // 220 clone = src && jQuery.isPlainObject(src) ? src : {}; // 221 } // 222 // 223 // Never move original objects, clone them // 224 target[ name ] = jQuery.extend( deep, clone, copy ); // 225 // 226 // Don't bring in undefined values // 227 } else if ( copy !== undefined ) { // 228 target[ name ] = copy; // 229 } // 230 } // 231 } // 232 } // 233 // 234 // Return the modified object // 235 return target; // 236 }; // 237 // 238 jQuery.extend({ // 239 // Unique for each copy of jQuery on the page // 240 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), // 241 // 242 // Assume jQuery is ready without the ready module // 243 isReady: true, // 244 // 245 error: function( msg ) { // 246 throw new Error( msg ); // 247 }, // 248 // 249 noop: function() {}, // 250 // 251 // See test/unit/core.js for details concerning isFunction. // 252 // Since version 1.3, DOM methods and functions like alert // 253 // aren't supported. They return false on IE (#2968). // 254 isFunction: function( obj ) { // 255 return jQuery.type(obj) === "function"; // 256 }, // 257 // 258 isArray: Array.isArray || function( obj ) { // 259 return jQuery.type(obj) === "array"; // 260 }, // 261 // 262 isWindow: function( obj ) { // 263 /* jshint eqeqeq: false */ // 264 return obj != null && obj == obj.window; // 265 }, // 266 // 267 isNumeric: function( obj ) { // 268 // parseFloat NaNs numeric-cast false positives (null|true|false|"") // 269 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") // 270 // subtraction forces infinities to NaN // 271 // adding 1 corrects loss of precision from parseFloat (#15100) // 272 return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0; // 273 }, // 274 // 275 isEmptyObject: function( obj ) { // 276 var name; // 277 for ( name in obj ) { // 278 return false; // 279 } // 280 return true; // 281 }, // 282 // 283 isPlainObject: function( obj ) { // 284 var key; // 285 // 286 // Must be an Object. // 287 // Because of IE, we also have to check the presence of the constructor property. // 288 // Make sure that DOM nodes and window objects don't pass through, as well // 289 if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { // 290 return false; // 291 } // 292 // 293 try { // 294 // Not own constructor property must be Object // 295 if ( obj.constructor && // 296 !hasOwn.call(obj, "constructor") && // 297 !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { // 298 return false; // 299 } // 300 } catch ( e ) { // 301 // IE8,9 Will throw exceptions on certain host objects #9897 // 302 return false; // 303 } // 304 // 305 // Support: IE<9 // 306 // Handle iteration over inherited properties before own properties. // 307 if ( support.ownLast ) { // 308 for ( key in obj ) { // 309 return hasOwn.call( obj, key ); // 310 } // 311 } // 312 // 313 // Own properties are enumerated firstly, so to speed up, // 314 // if last one is own, then all properties are own. // 315 for ( key in obj ) {} // 316 // 317 return key === undefined || hasOwn.call( obj, key ); // 318 }, // 319 // 320 type: function( obj ) { // 321 if ( obj == null ) { // 322 return obj + ""; // 323 } // 324 return typeof obj === "object" || typeof obj === "function" ? // 325 class2type[ toString.call(obj) ] || "object" : // 326 typeof obj; // 327 }, // 328 // 329 // Evaluates a script in a global context // 330 // Workarounds based on findings by Jim Driscoll // 331 // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context // 332 globalEval: function( data ) { // 333 if ( data && jQuery.trim( data ) ) { // 334 // We use execScript on Internet Explorer // 335 // We use an anonymous function so that context is window // 336 // rather than jQuery in Firefox // 337 ( window.execScript || function( data ) { // 338 window[ "eval" ].call( window, data ); // 339 } )( data ); // 340 } // 341 }, // 342 // 343 // Convert dashed to camelCase; used by the css and data modules // 344 // Microsoft forgot to hump their vendor prefix (#9572) // 345 camelCase: function( string ) { // 346 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); // 347 }, // 348 // 349 nodeName: function( elem, name ) { // 350 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); // 351 }, // 352 // 353 // args is for internal usage only // 354 each: function( obj, callback, args ) { // 355 var value, // 356 i = 0, // 357 length = obj.length, // 358 isArray = isArraylike( obj ); // 359 // 360 if ( args ) { // 361 if ( isArray ) { // 362 for ( ; i < length; i++ ) { // 363 value = callback.apply( obj[ i ], args ); // 364 // 365 if ( value === false ) { // 366 break; // 367 } // 368 } // 369 } else { // 370 for ( i in obj ) { // 371 value = callback.apply( obj[ i ], args ); // 372 // 373 if ( value === false ) { // 374 break; // 375 } // 376 } // 377 } // 378 // 379 // A special, fast, case for the most common use of each // 380 } else { // 381 if ( isArray ) { // 382 for ( ; i < length; i++ ) { // 383 value = callback.call( obj[ i ], i, obj[ i ] ); // 384 // 385 if ( value === false ) { // 386 break; // 387 } // 388 } // 389 } else { // 390 for ( i in obj ) { // 391 value = callback.call( obj[ i ], i, obj[ i ] ); // 392 // 393 if ( value === false ) { // 394 break; // 395 } // 396 } // 397 } // 398 } // 399 // 400 return obj; // 401 }, // 402 // 403 // Support: Android<4.1, IE<9 // 404 trim: function( text ) { // 405 return text == null ? // 406 "" : // 407 ( text + "" ).replace( rtrim, "" ); // 408 }, // 409 // 410 // results is for internal usage only // 411 makeArray: function( arr, results ) { // 412 var ret = results || []; // 413 // 414 if ( arr != null ) { // 415 if ( isArraylike( Object(arr) ) ) { // 416 jQuery.merge( ret, // 417 typeof arr === "string" ? // 418 [ arr ] : arr // 419 ); // 420 } else { // 421 push.call( ret, arr ); // 422 } // 423 } // 424 // 425 return ret; // 426 }, // 427 // 428 inArray: function( elem, arr, i ) { // 429 var len; // 430 // 431 if ( arr ) { // 432 if ( indexOf ) { // 433 return indexOf.call( arr, elem, i ); // 434 } // 435 // 436 len = arr.length; // 437 i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; // 438 // 439 for ( ; i < len; i++ ) { // 440 // Skip accessing in sparse arrays // 441 if ( i in arr && arr[ i ] === elem ) { // 442 return i; // 443 } // 444 } // 445 } // 446 // 447 return -1; // 448 }, // 449 // 450 merge: function( first, second ) { // 451 var len = +second.length, // 452 j = 0, // 453 i = first.length; // 454 // 455 while ( j < len ) { // 456 first[ i++ ] = second[ j++ ]; // 457 } // 458 // 459 // Support: IE<9 // 460 // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) // 461 if ( len !== len ) { // 462 while ( second[j] !== undefined ) { // 463 first[ i++ ] = second[ j++ ]; // 464 } // 465 } // 466 // 467 first.length = i; // 468 // 469 return first; // 470 }, // 471 // 472 grep: function( elems, callback, invert ) { // 473 var callbackInverse, // 474 matches = [], // 475 i = 0, // 476 length = elems.length, // 477 callbackExpect = !invert; // 478 // 479 // Go through the array, only saving the items // 480 // that pass the validator function // 481 for ( ; i < length; i++ ) { // 482 callbackInverse = !callback( elems[ i ], i ); // 483 if ( callbackInverse !== callbackExpect ) { // 484 matches.push( elems[ i ] ); // 485 } // 486 } // 487 // 488 return matches; // 489 }, // 490 // 491 // arg is for internal usage only // 492 map: function( elems, callback, arg ) { // 493 var value, // 494 i = 0, // 495 length = elems.length, // 496 isArray = isArraylike( elems ), // 497 ret = []; // 498 // 499 // Go through the array, translating each of the items to their new values // 500 if ( isArray ) { // 501 for ( ; i < length; i++ ) { // 502 value = callback( elems[ i ], i, arg ); // 503 // 504 if ( value != null ) { // 505 ret.push( value ); // 506 } // 507 } // 508 // 509 // Go through every key on the object, // 510 } else { // 511 for ( i in elems ) { // 512 value = callback( elems[ i ], i, arg ); // 513 // 514 if ( value != null ) { // 515 ret.push( value ); // 516 } // 517 } // 518 } // 519 // 520 // Flatten any nested arrays // 521 return concat.apply( [], ret ); // 522 }, // 523 // 524 // A global GUID counter for objects // 525 guid: 1, // 526 // 527 // Bind a function to a context, optionally partially applying any // 528 // arguments. // 529 proxy: function( fn, context ) { // 530 var args, proxy, tmp; // 531 // 532 if ( typeof context === "string" ) { // 533 tmp = fn[ context ]; // 534 context = fn; // 535 fn = tmp; // 536 } // 537 // 538 // Quick check to determine if target is callable, in the spec // 539 // this throws a TypeError, but we will just return undefined. // 540 if ( !jQuery.isFunction( fn ) ) { // 541 return undefined; // 542 } // 543 // 544 // Simulated bind // 545 args = slice.call( arguments, 2 ); // 546 proxy = function() { // 547 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); // 548 }; // 549 // 550 // Set the guid of unique handler to the same of original handler, so it can be removed // 551 proxy.guid = fn.guid = fn.guid || jQuery.guid++; // 552 // 553 return proxy; // 554 }, // 555 // 556 now: function() { // 557 return +( new Date() ); // 558 }, // 559 // 560 // jQuery.support is not used in Core but other projects attach their // 561 // properties to it so it needs to exist. // 562 support: support // 563 }); // 564 // 565 // Populate the class2type map // 566 jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { // 567 class2type[ "[object " + name + "]" ] = name.toLowerCase(); // 568 }); // 569 // 570 function isArraylike( obj ) { // 571 var length = obj.length, // 572 type = jQuery.type( obj ); // 573 // 574 if ( type === "function" || jQuery.isWindow( obj ) ) { // 575 return false; // 576 } // 577 // 578 if ( obj.nodeType === 1 && length ) { // 579 return true; // 580 } // 581 // 582 return type === "array" || length === 0 || // 583 typeof length === "number" && length > 0 && ( length - 1 ) in obj; // 584 } // 585 var Sizzle = // 586 /*! // 587 * Sizzle CSS Selector Engine v2.2.0-pre // 588 * http://sizzlejs.com/ // 589 * // 590 * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors // 591 * Released under the MIT license // 592 * http://jquery.org/license // 593 * // 594 * Date: 2014-12-16 // 595 */ // 596 (function( window ) { // 597 // 598 var i, // 599 support, // 600 Expr, // 601 getText, // 602 isXML, // 603 tokenize, // 604 compile, // 605 select, // 606 outermostContext, // 607 sortInput, // 608 hasDuplicate, // 609 // 610 // Local document vars // 611 setDocument, // 612 document, // 613 docElem, // 614 documentIsHTML, // 615 rbuggyQSA, // 616 rbuggyMatches, // 617 matches, // 618 contains, // 619 // 620 // Instance-specific data // 621 expando = "sizzle" + 1 * new Date(), // 622 preferredDoc = window.document, // 623 dirruns = 0, // 624 done = 0, // 625 classCache = createCache(), // 626 tokenCache = createCache(), // 627 compilerCache = createCache(), // 628 sortOrder = function( a, b ) { // 629 if ( a === b ) { // 630 hasDuplicate = true; // 631 } // 632 return 0; // 633 }, // 634 // 635 // General-purpose constants // 636 MAX_NEGATIVE = 1 << 31, // 637 // 638 // Instance methods // 639 hasOwn = ({}).hasOwnProperty, // 640 arr = [], // 641 pop = arr.pop, // 642 push_native = arr.push, // 643 push = arr.push, // 644 slice = arr.slice, // 645 // Use a stripped-down indexOf as it's faster than native // 646 // http://jsperf.com/thor-indexof-vs-for/5 // 647 indexOf = function( list, elem ) { // 648 var i = 0, // 649 len = list.length; // 650 for ( ; i < len; i++ ) { // 651 if ( list[i] === elem ) { // 652 return i; // 653 } // 654 } // 655 return -1; // 656 }, // 657 // 658 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", // 660 // Regular expressions // 661 // 662 // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace // 663 whitespace = "[\\x20\\t\\r\\n\\f]", // 664 // http://www.w3.org/TR/css3-syntax/#characters // 665 characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // 666 // 667 // Loosely modeled on CSS identifier characters // 668 // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors // 669 // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier // 670 identifier = characterEncoding.replace( "w", "w#" ), // 671 // 672 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors // 673 attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + // 674 // Operator (capture 2) // 675 "*([*^$|!~]?=)" + whitespace + // 676 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" // 677 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + // 678 "*\\]", // 679 // 680 pseudos = ":(" + characterEncoding + ")(?:\\((" + // 681 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: // 682 // 1. quoted (capture 3; capture 4 or capture 5) // 683 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + // 684 // 2. simple (capture 6) // 685 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + // 686 // 3. anything else (capture 2) // 687 ".*" + // 688 ")\\)|)", // 689 // 690 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter // 691 rwhitespace = new RegExp( whitespace + "+", "g" ), // 692 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), // 693 // 694 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), // 695 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), // 696 // 697 rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), // 698 // 699 rpseudo = new RegExp( pseudos ), // 700 ridentifier = new RegExp( "^" + identifier + "$" ), // 701 // 702 matchExpr = { // 703 "ID": new RegExp( "^#(" + characterEncoding + ")" ), // 704 "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), // 705 "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), // 706 "ATTR": new RegExp( "^" + attributes ), // 707 "PSEUDO": new RegExp( "^" + pseudos ), // 708 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + // 709 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + // 710 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), // 711 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), // 712 // For use in libraries implementing .is() // 713 // We use this for POS matching in `select` // 714 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + // 715 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) // 716 }, // 717 // 718 rinputs = /^(?:input|select|textarea|button)$/i, // 719 rheader = /^h\d$/i, // 720 // 721 rnative = /^[^{]+\{\s*\[native \w/, // 722 // 723 // Easily-parseable/retrievable ID or TAG or CLASS selectors // 724 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, // 725 // 726 rsibling = /[+~]/, // 727 rescape = /'|\\/g, // 728 // 729 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters // 730 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), // 731 funescape = function( _, escaped, escapedWhitespace ) { // 732 var high = "0x" + escaped - 0x10000; // 733 // NaN means non-codepoint // 734 // Support: Firefox<24 // 735 // Workaround erroneous numeric interpretation of +"0x" // 736 return high !== high || escapedWhitespace ? // 737 escaped : // 738 high < 0 ? // 739 // BMP codepoint // 740 String.fromCharCode( high + 0x10000 ) : // 741 // Supplemental Plane codepoint (surrogate pair) // 742 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); // 743 }, // 744 // 745 // Used for iframes // 746 // See setDocument() // 747 // Removing the function wrapper causes a "Permission Denied" // 748 // error in IE // 749 unloadHandler = function() { // 750 setDocument(); // 751 }; // 752 // 753 // Optimize for push.apply( _, NodeList ) // 754 try { // 755 push.apply( // 756 (arr = slice.call( preferredDoc.childNodes )), // 757 preferredDoc.childNodes // 758 ); // 759 // Support: Android<4.0 // 760 // Detect silently failing push.apply // 761 arr[ preferredDoc.childNodes.length ].nodeType; // 762 } catch ( e ) { // 763 push = { apply: arr.length ? // 764 // 765 // Leverage slice if possible // 766 function( target, els ) { // 767 push_native.apply( target, slice.call(els) ); // 768 } : // 769 // 770 // Support: IE<9 // 771 // Otherwise append directly // 772 function( target, els ) { // 773 var j = target.length, // 774 i = 0; // 775 // Can't trust NodeList.length // 776 while ( (target[j++] = els[i++]) ) {} // 777 target.length = j - 1; // 778 } // 779 }; // 780 } // 781 // 782 function Sizzle( selector, context, results, seed ) { // 783 var match, elem, m, nodeType, // 784 // QSA vars // 785 i, groups, old, nid, newContext, newSelector; // 786 // 787 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { // 788 setDocument( context ); // 789 } // 790 // 791 context = context || document; // 792 results = results || []; // 793 nodeType = context.nodeType; // 794 // 795 if ( typeof selector !== "string" || !selector || // 796 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { // 797 // 798 return results; // 799 } // 800 // 801 if ( !seed && documentIsHTML ) { // 802 // 803 // Try to shortcut find operations when possible (e.g., not under DocumentFragment) // 804 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { // 805 // Speed-up: Sizzle("#ID") // 806 if ( (m = match[1]) ) { // 807 if ( nodeType === 9 ) { // 808 elem = context.getElementById( m ); // 809 // Check parentNode to catch when Blackberry 4.6 returns // 810 // nodes that are no longer in the document (jQuery #6963) // 811 if ( elem && elem.parentNode ) { // 812 // Handle the case where IE, Opera, and Webkit return items // 813 // by name instead of ID // 814 if ( elem.id === m ) { // 815 results.push( elem ); // 816 return results; // 817 } // 818 } else { // 819 return results; // 820 } // 821 } else { // 822 // Context is not a document // 823 if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && // 824 contains( context, elem ) && elem.id === m ) { // 825 results.push( elem ); // 826 return results; // 827 } // 828 } // 829 // 830 // Speed-up: Sizzle("TAG") // 831 } else if ( match[2] ) { // 832 push.apply( results, context.getElementsByTagName( selector ) ); // 833 return results; // 834 // 835 // Speed-up: Sizzle(".CLASS") // 836 } else if ( (m = match[3]) && support.getElementsByClassName ) { // 837 push.apply( results, context.getElementsByClassName( m ) ); // 838 return results; // 839 } // 840 } // 841 // 842 // QSA path // 843 if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { // 844 nid = old = expando; // 845 newContext = context; // 846 newSelector = nodeType !== 1 && selector; // 847 // 848 // qSA works strangely on Element-rooted queries // 849 // We can work around this by specifying an extra ID on the root // 850 // and working up from there (Thanks to Andrew Dupont for the technique) // 851 // IE 8 doesn't work on object elements // 852 if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { // 853 groups = tokenize( selector ); // 854 // 855 if ( (old = context.getAttribute("id")) ) { // 856 nid = old.replace( rescape, "\\$&" ); // 857 } else { // 858 context.setAttribute( "id", nid ); // 859 } // 860 nid = "[id='" + nid + "'] "; // 861 // 862 i = groups.length; // 863 while ( i-- ) { // 864 groups[i] = nid + toSelector( groups[i] ); // 865 } // 866 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; // 867 newSelector = groups.join(","); // 868 } // 869 // 870 if ( newSelector ) { // 871 try { // 872 push.apply( results, // 873 newContext.querySelectorAll( newSelector ) // 874 ); // 875 return results; // 876 } catch(qsaError) { // 877 } finally { // 878 if ( !old ) { // 879 context.removeAttribute("id"); // 880 } // 881 } // 882 } // 883 } // 884 } // 885 // 886 // All others // 887 return select( selector.replace( rtrim, "$1" ), context, results, seed ); // 888 } // 889 // 890 /** // 891 * Create key-value caches of limited size // 892 * @returns {Function(string, Object)} Returns the Object data after storing it on itself with // 893 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) // 894 * deleting the oldest entry // 895 */ // 896 function createCache() { // 897 var keys = []; // 898 // 899 function cache( key, value ) { // 900 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) // 901 if ( keys.push( key + " " ) > Expr.cacheLength ) { // 902 // Only keep the most recent entries // 903 delete cache[ keys.shift() ]; // 904 } // 905 return (cache[ key + " " ] = value); // 906 } // 907 return cache; // 908 } // 909 // 910 /** // 911 * Mark a function for special use by Sizzle // 912 * @param {Function} fn The function to mark // 913 */ // 914 function markFunction( fn ) { // 915 fn[ expando ] = true; // 916 return fn; // 917 } // 918 // 919 /** // 920 * Support testing using an element // 921 * @param {Function} fn Passed the created div and expects a boolean result // 922 */ // 923 function assert( fn ) { // 924 var div = document.createElement("div"); // 925 // 926 try { // 927 return !!fn( div ); // 928 } catch (e) { // 929 return false; // 930 } finally { // 931 // Remove from its parent by default // 932 if ( div.parentNode ) { // 933 div.parentNode.removeChild( div ); // 934 } // 935 // release memory in IE // 936 div = null; // 937 } // 938 } // 939 // 940 /** // 941 * Adds the same handler for all of the specified attrs // 942 * @param {String} attrs Pipe-separated list of attributes // 943 * @param {Function} handler The method that will be applied // 944 */ // 945 function addHandle( attrs, handler ) { // 946 var arr = attrs.split("|"), // 947 i = attrs.length; // 948 // 949 while ( i-- ) { // 950 Expr.attrHandle[ arr[i] ] = handler; // 951 } // 952 } // 953 // 954 /** // 955 * Checks document order of two siblings // 956 * @param {Element} a // 957 * @param {Element} b // 958 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b // 959 */ // 960 function siblingCheck( a, b ) { // 961 var cur = b && a, // 962 diff = cur && a.nodeType === 1 && b.nodeType === 1 && // 963 ( ~b.sourceIndex || MAX_NEGATIVE ) - // 964 ( ~a.sourceIndex || MAX_NEGATIVE ); // 965 // 966 // Use IE sourceIndex if available on both nodes // 967 if ( diff ) { // 968 return diff; // 969 } // 970 // 971 // Check if b follows a // 972 if ( cur ) { // 973 while ( (cur = cur.nextSibling) ) { // 974 if ( cur === b ) { // 975 return -1; // 976 } // 977 } // 978 } // 979 // 980 return a ? 1 : -1; // 981 } // 982 // 983 /** // 984 * Returns a function to use in pseudos for input types // 985 * @param {String} type // 986 */ // 987 function createInputPseudo( type ) { // 988 return function( elem ) { // 989 var name = elem.nodeName.toLowerCase(); // 990 return name === "input" && elem.type === type; // 991 }; // 992 } // 993 // 994 /** // 995 * Returns a function to use in pseudos for buttons // 996 * @param {String} type // 997 */ // 998 function createButtonPseudo( type ) { // 999 return function( elem ) { // 1000 var name = elem.nodeName.toLowerCase(); // 1001 return (name === "input" || name === "button") && elem.type === type; // 1002 }; // 1003 } // 1004 // 1005 /** // 1006 * Returns a function to use in pseudos for positionals // 1007 * @param {Function} fn // 1008 */ // 1009 function createPositionalPseudo( fn ) { // 1010 return markFunction(function( argument ) { // 1011 argument = +argument; // 1012 return markFunction(function( seed, matches ) { // 1013 var j, // 1014 matchIndexes = fn( [], seed.length, argument ), // 1015 i = matchIndexes.length; // 1016 // 1017 // Match elements found at the specified indexes // 1018 while ( i-- ) { // 1019 if ( seed[ (j = matchIndexes[i]) ] ) { // 1020 seed[j] = !(matches[j] = seed[j]); // 1021 } // 1022 } // 1023 }); // 1024 }); // 1025 } // 1026 // 1027 /** // 1028 * Checks a node for validity as a Sizzle context // 1029 * @param {Element|Object=} context // 1030 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value // 1031 */ // 1032 function testContext( context ) { // 1033 return context && typeof context.getElementsByTagName !== "undefined" && context; // 1034 } // 1035 // 1036 // Expose support vars for convenience // 1037 support = Sizzle.support = {}; // 1038 // 1039 /** // 1040 * Detects XML nodes // 1041 * @param {Element|Object} elem An element or a document // 1042 * @returns {Boolean} True iff elem is a non-HTML XML node // 1043 */ // 1044 isXML = Sizzle.isXML = function( elem ) { // 1045 // documentElement is verified for cases where it doesn't yet exist // 1046 // (such as loading iframes in IE - #4833) // 1047 var documentElement = elem && (elem.ownerDocument || elem).documentElement; // 1048 return documentElement ? documentElement.nodeName !== "HTML" : false; // 1049 }; // 1050 // 1051 /** // 1052 * Sets document-related variables once based on the current document // 1053 * @param {Element|Object} [doc] An element or document object to use to set the document // 1054 * @returns {Object} Returns the current document // 1055 */ // 1056 setDocument = Sizzle.setDocument = function( node ) { // 1057 var hasCompare, parent, // 1058 doc = node ? node.ownerDocument || node : preferredDoc; // 1059 // 1060 // If no document and documentElement is available, return // 1061 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { // 1062 return document; // 1063 } // 1064 // 1065 // Set our document // 1066 document = doc; // 1067 docElem = doc.documentElement; // 1068 parent = doc.defaultView; // 1069 // 1070 // Support: IE>8 // 1071 // If iframe document is assigned to "document" variable and if iframe has been reloaded, // 1072 // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 // 1073 // IE6-8 do not support the defaultView property so parent will be undefined // 1074 if ( parent && parent !== parent.top ) { // 1075 // IE11 does not have attachEvent, so all must suffer // 1076 if ( parent.addEventListener ) { // 1077 parent.addEventListener( "unload", unloadHandler, false ); // 1078 } else if ( parent.attachEvent ) { // 1079 parent.attachEvent( "onunload", unloadHandler ); // 1080 } // 1081 } // 1082 // 1083 /* Support tests // 1084 ---------------------------------------------------------------------- */ // 1085 documentIsHTML = !isXML( doc ); // 1086 // 1087 /* Attributes // 1088 ---------------------------------------------------------------------- */ // 1089 // 1090 // Support: IE<8 // 1091 // Verify that getAttribute really returns attributes and not properties // 1092 // (excepting IE8 booleans) // 1093 support.attributes = assert(function( div ) { // 1094 div.className = "i"; // 1095 return !div.getAttribute("className"); // 1096 }); // 1097 // 1098 /* getElement(s)By* // 1099 ---------------------------------------------------------------------- */ // 1100 // 1101 // Check if getElementsByTagName("*") returns only elements // 1102 support.getElementsByTagName = assert(function( div ) { // 1103 div.appendChild( doc.createComment("") ); // 1104 return !div.getElementsByTagName("*").length; // 1105 }); // 1106 // 1107 // Support: IE<9 // 1108 support.getElementsByClassName = rnative.test( doc.getElementsByClassName ); // 1109 // 1110 // Support: IE<10 // 1111 // Check if getElementById returns elements by name // 1112 // The broken getElementById methods don't pick up programatically-set names, // 1113 // so use a roundabout getElementsByName test // 1114 support.getById = assert(function( div ) { // 1115 docElem.appendChild( div ).id = expando; // 1116 return !doc.getElementsByName || !doc.getElementsByName( expando ).length; // 1117 }); // 1118 // 1119 // ID find and filter // 1120 if ( support.getById ) { // 1121 Expr.find["ID"] = function( id, context ) { // 1122 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { // 1123 var m = context.getElementById( id ); // 1124 // Check parentNode to catch when Blackberry 4.6 returns // 1125 // nodes that are no longer in the document #6963 // 1126 return m && m.parentNode ? [ m ] : []; // 1127 } // 1128 }; // 1129 Expr.filter["ID"] = function( id ) { // 1130 var attrId = id.replace( runescape, funescape ); // 1131 return function( elem ) { // 1132 return elem.getAttribute("id") === attrId; // 1133 }; // 1134 }; // 1135 } else { // 1136 // Support: IE6/7 // 1137 // getElementById is not reliable as a find shortcut // 1138 delete Expr.find["ID"]; // 1139 // 1140 Expr.filter["ID"] = function( id ) { // 1141 var attrId = id.replace( runescape, funescape ); // 1142 return function( elem ) { // 1143 var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); // 1144 return node && node.value === attrId; // 1145 }; // 1146 }; // 1147 } // 1148 // 1149 // Tag // 1150 Expr.find["TAG"] = support.getElementsByTagName ? // 1151 function( tag, context ) { // 1152 if ( typeof context.getElementsByTagName !== "undefined" ) { // 1153 return context.getElementsByTagName( tag ); // 1154 // 1155 // DocumentFragment nodes don't have gEBTN // 1156 } else if ( support.qsa ) { // 1157 return context.querySelectorAll( tag ); // 1158 } // 1159 } : // 1160 // 1161 function( tag, context ) { // 1162 var elem, // 1163 tmp = [], // 1164 i = 0, // 1165 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too // 1166 results = context.getElementsByTagName( tag ); // 1167 // 1168 // Filter out possible comments // 1169 if ( tag === "*" ) { // 1170 while ( (elem = results[i++]) ) { // 1171 if ( elem.nodeType === 1 ) { // 1172 tmp.push( elem ); // 1173 } // 1174 } // 1175 // 1176 return tmp; // 1177 } // 1178 return results; // 1179 }; // 1180 // 1181 // Class // 1182 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { // 1183 if ( documentIsHTML ) { // 1184 return context.getElementsByClassName( className ); // 1185 } // 1186 }; // 1187 // 1188 /* QSA/matchesSelector // 1189 ---------------------------------------------------------------------- */ // 1190 // 1191 // QSA and matchesSelector support // 1192 // 1193 // matchesSelector(:active) reports false when true (IE9/Opera 11.5) // 1194 rbuggyMatches = []; // 1195 // 1196 // qSa(:focus) reports false when true (Chrome 21) // 1197 // We allow this because of a bug in IE8/9 that throws an error // 1198 // whenever `document.activeElement` is accessed on an iframe // 1199 // So, we allow :focus to pass through QSA all the time to avoid the IE error // 1200 // See http://bugs.jquery.com/ticket/13378 // 1201 rbuggyQSA = []; // 1202 // 1203 if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { // 1204 // Build QSA regex // 1205 // Regex strategy adopted from Diego Perini // 1206 assert(function( div ) { // 1207 // Select is set to empty string on purpose // 1208 // This is to test IE's treatment of not explicitly // 1209 // setting a boolean content attribute, // 1210 // since its presence should be enough // 1211 // http://bugs.jquery.com/ticket/12359 // 1212 docElem.appendChild( div ).innerHTML = "" + // 1213 ""; // 1215 // 1216 // Support: IE8, Opera 11-12.16 // 1217 // Nothing should be selected when empty strings follow ^= or $= or *= // 1218 // The test attribute must be unknown in Opera but "safe" for WinRT // 1219 // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section // 1220 if ( div.querySelectorAll("[msallowcapture^='']").length ) { // 1221 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); // 1222 } // 1223 // 1224 // Support: IE8 // 1225 // Boolean attributes and "value" are not treated correctly // 1226 if ( !div.querySelectorAll("[selected]").length ) { // 1227 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); // 1228 } // 1229 // 1230 // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+ // 1231 if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { // 1232 rbuggyQSA.push("~="); // 1233 } // 1234 // 1235 // Webkit/Opera - :checked should return selected option elements // 1236 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // 1237 // IE8 throws error here and will not see later tests // 1238 if ( !div.querySelectorAll(":checked").length ) { // 1239 rbuggyQSA.push(":checked"); // 1240 } // 1241 // 1242 // Support: Safari 8+, iOS 8+ // 1243 // https://bugs.webkit.org/show_bug.cgi?id=136851 // 1244 // In-page `selector#id sibing-combinator selector` fails // 1245 if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { // 1246 rbuggyQSA.push(".#.+[+~]"); // 1247 } // 1248 }); // 1249 // 1250 assert(function( div ) { // 1251 // Support: Windows 8 Native Apps // 1252 // The type and name attributes are restricted during .innerHTML assignment // 1253 var input = doc.createElement("input"); // 1254 input.setAttribute( "type", "hidden" ); // 1255 div.appendChild( input ).setAttribute( "name", "D" ); // 1256 // 1257 // Support: IE8 // 1258 // Enforce case-sensitivity of name attribute // 1259 if ( div.querySelectorAll("[name=d]").length ) { // 1260 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); // 1261 } // 1262 // 1263 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // 1264 // IE8 throws error here and will not see later tests // 1265 if ( !div.querySelectorAll(":enabled").length ) { // 1266 rbuggyQSA.push( ":enabled", ":disabled" ); // 1267 } // 1268 // 1269 // Opera 10-11 does not throw on post-comma invalid pseudos // 1270 div.querySelectorAll("*,:x"); // 1271 rbuggyQSA.push(",.*:"); // 1272 }); // 1273 } // 1274 // 1275 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || // 1276 docElem.webkitMatchesSelector || // 1277 docElem.mozMatchesSelector || // 1278 docElem.oMatchesSelector || // 1279 docElem.msMatchesSelector) )) ) { // 1280 // 1281 assert(function( div ) { // 1282 // Check to see if it's possible to do matchesSelector // 1283 // on a disconnected node (IE 9) // 1284 support.disconnectedMatch = matches.call( div, "div" ); // 1285 // 1286 // This should fail with an exception // 1287 // Gecko does not error, returns false instead // 1288 matches.call( div, "[s!='']:x" ); // 1289 rbuggyMatches.push( "!=", pseudos ); // 1290 }); // 1291 } // 1292 // 1293 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); // 1294 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); // 1295 // 1296 /* Contains // 1297 ---------------------------------------------------------------------- */ // 1298 hasCompare = rnative.test( docElem.compareDocumentPosition ); // 1299 // 1300 // Element contains another // 1301 // Purposefully does not implement inclusive descendent // 1302 // As in, an element does not contain itself // 1303 contains = hasCompare || rnative.test( docElem.contains ) ? // 1304 function( a, b ) { // 1305 var adown = a.nodeType === 9 ? a.documentElement : a, // 1306 bup = b && b.parentNode; // 1307 return a === bup || !!( bup && bup.nodeType === 1 && ( // 1308 adown.contains ? // 1309 adown.contains( bup ) : // 1310 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 // 1311 )); // 1312 } : // 1313 function( a, b ) { // 1314 if ( b ) { // 1315 while ( (b = b.parentNode) ) { // 1316 if ( b === a ) { // 1317 return true; // 1318 } // 1319 } // 1320 } // 1321 return false; // 1322 }; // 1323 // 1324 /* Sorting // 1325 ---------------------------------------------------------------------- */ // 1326 // 1327 // Document order sorting // 1328 sortOrder = hasCompare ? // 1329 function( a, b ) { // 1330 // 1331 // Flag for duplicate removal // 1332 if ( a === b ) { // 1333 hasDuplicate = true; // 1334 return 0; // 1335 } // 1336 // 1337 // Sort on method existence if only one input has compareDocumentPosition // 1338 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; // 1339 if ( compare ) { // 1340 return compare; // 1341 } // 1342 // 1343 // Calculate position if both inputs belong to the same document // 1344 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? // 1345 a.compareDocumentPosition( b ) : // 1346 // 1347 // Otherwise we know they are disconnected // 1348 1; // 1349 // 1350 // Disconnected nodes // 1351 if ( compare & 1 || // 1352 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { // 1353 // 1354 // Choose the first element that is related to our preferred document // 1355 if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { // 1356 return -1; // 1357 } // 1358 if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { // 1359 return 1; // 1360 } // 1361 // 1362 // Maintain original order // 1363 return sortInput ? // 1364 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : // 1365 0; // 1366 } // 1367 // 1368 return compare & 4 ? -1 : 1; // 1369 } : // 1370 function( a, b ) { // 1371 // Exit early if the nodes are identical // 1372 if ( a === b ) { // 1373 hasDuplicate = true; // 1374 return 0; // 1375 } // 1376 // 1377 var cur, // 1378 i = 0, // 1379 aup = a.parentNode, // 1380 bup = b.parentNode, // 1381 ap = [ a ], // 1382 bp = [ b ]; // 1383 // 1384 // Parentless nodes are either documents or disconnected // 1385 if ( !aup || !bup ) { // 1386 return a === doc ? -1 : // 1387 b === doc ? 1 : // 1388 aup ? -1 : // 1389 bup ? 1 : // 1390 sortInput ? // 1391 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : // 1392 0; // 1393 // 1394 // If the nodes are siblings, we can do a quick check // 1395 } else if ( aup === bup ) { // 1396 return siblingCheck( a, b ); // 1397 } // 1398 // 1399 // Otherwise we need full lists of their ancestors for comparison // 1400 cur = a; // 1401 while ( (cur = cur.parentNode) ) { // 1402 ap.unshift( cur ); // 1403 } // 1404 cur = b; // 1405 while ( (cur = cur.parentNode) ) { // 1406 bp.unshift( cur ); // 1407 } // 1408 // 1409 // Walk down the tree looking for a discrepancy // 1410 while ( ap[i] === bp[i] ) { // 1411 i++; // 1412 } // 1413 // 1414 return i ? // 1415 // Do a sibling check if the nodes have a common ancestor // 1416 siblingCheck( ap[i], bp[i] ) : // 1417 // 1418 // Otherwise nodes in our document sort first // 1419 ap[i] === preferredDoc ? -1 : // 1420 bp[i] === preferredDoc ? 1 : // 1421 0; // 1422 }; // 1423 // 1424 return doc; // 1425 }; // 1426 // 1427 Sizzle.matches = function( expr, elements ) { // 1428 return Sizzle( expr, null, null, elements ); // 1429 }; // 1430 // 1431 Sizzle.matchesSelector = function( elem, expr ) { // 1432 // Set document vars if needed // 1433 if ( ( elem.ownerDocument || elem ) !== document ) { // 1434 setDocument( elem ); // 1435 } // 1436 // 1437 // Make sure that attribute selectors are quoted // 1438 expr = expr.replace( rattributeQuotes, "='$1']" ); // 1439 // 1440 if ( support.matchesSelector && documentIsHTML && // 1441 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && // 1442 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { // 1443 // 1444 try { // 1445 var ret = matches.call( elem, expr ); // 1446 // 1447 // IE 9's matchesSelector returns false on disconnected nodes // 1448 if ( ret || support.disconnectedMatch || // 1449 // As well, disconnected nodes are said to be in a document // 1450 // fragment in IE 9 // 1451 elem.document && elem.document.nodeType !== 11 ) { // 1452 return ret; // 1453 } // 1454 } catch (e) {} // 1455 } // 1456 // 1457 return Sizzle( expr, document, null, [ elem ] ).length > 0; // 1458 }; // 1459 // 1460 Sizzle.contains = function( context, elem ) { // 1461 // Set document vars if needed // 1462 if ( ( context.ownerDocument || context ) !== document ) { // 1463 setDocument( context ); // 1464 } // 1465 return contains( context, elem ); // 1466 }; // 1467 // 1468 Sizzle.attr = function( elem, name ) { // 1469 // Set document vars if needed // 1470 if ( ( elem.ownerDocument || elem ) !== document ) { // 1471 setDocument( elem ); // 1472 } // 1473 // 1474 var fn = Expr.attrHandle[ name.toLowerCase() ], // 1475 // Don't get fooled by Object.prototype properties (jQuery #13807) // 1476 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? // 1477 fn( elem, name, !documentIsHTML ) : // 1478 undefined; // 1479 // 1480 return val !== undefined ? // 1481 val : // 1482 support.attributes || !documentIsHTML ? // 1483 elem.getAttribute( name ) : // 1484 (val = elem.getAttributeNode(name)) && val.specified ? // 1485 val.value : // 1486 null; // 1487 }; // 1488 // 1489 Sizzle.error = function( msg ) { // 1490 throw new Error( "Syntax error, unrecognized expression: " + msg ); // 1491 }; // 1492 // 1493 /** // 1494 * Document sorting and removing duplicates // 1495 * @param {ArrayLike} results // 1496 */ // 1497 Sizzle.uniqueSort = function( results ) { // 1498 var elem, // 1499 duplicates = [], // 1500 j = 0, // 1501 i = 0; // 1502 // 1503 // Unless we *know* we can detect duplicates, assume their presence // 1504 hasDuplicate = !support.detectDuplicates; // 1505 sortInput = !support.sortStable && results.slice( 0 ); // 1506 results.sort( sortOrder ); // 1507 // 1508 if ( hasDuplicate ) { // 1509 while ( (elem = results[i++]) ) { // 1510 if ( elem === results[ i ] ) { // 1511 j = duplicates.push( i ); // 1512 } // 1513 } // 1514 while ( j-- ) { // 1515 results.splice( duplicates[ j ], 1 ); // 1516 } // 1517 } // 1518 // 1519 // Clear input after sorting to release objects // 1520 // See https://github.com/jquery/sizzle/pull/225 // 1521 sortInput = null; // 1522 // 1523 return results; // 1524 }; // 1525 // 1526 /** // 1527 * Utility function for retrieving the text value of an array of DOM nodes // 1528 * @param {Array|Element} elem // 1529 */ // 1530 getText = Sizzle.getText = function( elem ) { // 1531 var node, // 1532 ret = "", // 1533 i = 0, // 1534 nodeType = elem.nodeType; // 1535 // 1536 if ( !nodeType ) { // 1537 // If no nodeType, this is expected to be an array // 1538 while ( (node = elem[i++]) ) { // 1539 // Do not traverse comment nodes // 1540 ret += getText( node ); // 1541 } // 1542 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // 1543 // Use textContent for elements // 1544 // innerText usage removed for consistency of new lines (jQuery #11153) // 1545 if ( typeof elem.textContent === "string" ) { // 1546 return elem.textContent; // 1547 } else { // 1548 // Traverse its children // 1549 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { // 1550 ret += getText( elem ); // 1551 } // 1552 } // 1553 } else if ( nodeType === 3 || nodeType === 4 ) { // 1554 return elem.nodeValue; // 1555 } // 1556 // Do not include comment or processing instruction nodes // 1557 // 1558 return ret; // 1559 }; // 1560 // 1561 Expr = Sizzle.selectors = { // 1562 // 1563 // Can be adjusted by the user // 1564 cacheLength: 50, // 1565 // 1566 createPseudo: markFunction, // 1567 // 1568 match: matchExpr, // 1569 // 1570 attrHandle: {}, // 1571 // 1572 find: {}, // 1573 // 1574 relative: { // 1575 ">": { dir: "parentNode", first: true }, // 1576 " ": { dir: "parentNode" }, // 1577 "+": { dir: "previousSibling", first: true }, // 1578 "~": { dir: "previousSibling" } // 1579 }, // 1580 // 1581 preFilter: { // 1582 "ATTR": function( match ) { // 1583 match[1] = match[1].replace( runescape, funescape ); // 1584 // 1585 // Move the given value to match[3] whether quoted or unquoted // 1586 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); // 1587 // 1588 if ( match[2] === "~=" ) { // 1589 match[3] = " " + match[3] + " "; // 1590 } // 1591 // 1592 return match.slice( 0, 4 ); // 1593 }, // 1594 // 1595 "CHILD": function( match ) { // 1596 /* matches from matchExpr["CHILD"] // 1597 1 type (only|nth|...) // 1598 2 what (child|of-type) // 1599 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) // 1600 4 xn-component of xn+y argument ([+-]?\d*n|) // 1601 5 sign of xn-component // 1602 6 x of xn-component // 1603 7 sign of y-component // 1604 8 y of y-component // 1605 */ // 1606 match[1] = match[1].toLowerCase(); // 1607 // 1608 if ( match[1].slice( 0, 3 ) === "nth" ) { // 1609 // nth-* requires argument // 1610 if ( !match[3] ) { // 1611 Sizzle.error( match[0] ); // 1612 } // 1613 // 1614 // numeric x and y parameters for Expr.filter.CHILD // 1615 // remember that false/true cast respectively to 0/1 // 1616 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); // 1617 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); // 1618 // 1619 // other types prohibit arguments // 1620 } else if ( match[3] ) { // 1621 Sizzle.error( match[0] ); // 1622 } // 1623 // 1624 return match; // 1625 }, // 1626 // 1627 "PSEUDO": function( match ) { // 1628 var excess, // 1629 unquoted = !match[6] && match[2]; // 1630 // 1631 if ( matchExpr["CHILD"].test( match[0] ) ) { // 1632 return null; // 1633 } // 1634 // 1635 // Accept quoted arguments as-is // 1636 if ( match[3] ) { // 1637 match[2] = match[4] || match[5] || ""; // 1638 // 1639 // Strip excess characters from unquoted arguments // 1640 } else if ( unquoted && rpseudo.test( unquoted ) && // 1641 // Get excess from tokenize (recursively) // 1642 (excess = tokenize( unquoted, true )) && // 1643 // advance to the next closing parenthesis // 1644 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { // 1645 // 1646 // excess is a negative index // 1647 match[0] = match[0].slice( 0, excess ); // 1648 match[2] = unquoted.slice( 0, excess ); // 1649 } // 1650 // 1651 // Return only captures needed by the pseudo filter method (type and argument) // 1652 return match.slice( 0, 3 ); // 1653 } // 1654 }, // 1655 // 1656 filter: { // 1657 // 1658 "TAG": function( nodeNameSelector ) { // 1659 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); // 1660 return nodeNameSelector === "*" ? // 1661 function() { return true; } : // 1662 function( elem ) { // 1663 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; // 1664 }; // 1665 }, // 1666 // 1667 "CLASS": function( className ) { // 1668 var pattern = classCache[ className + " " ]; // 1669 // 1670 return pattern || // 1671 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && // 1672 classCache( className, function( elem ) { // 1673 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); }); // 1675 }, // 1676 // 1677 "ATTR": function( name, operator, check ) { // 1678 return function( elem ) { // 1679 var result = Sizzle.attr( elem, name ); // 1680 // 1681 if ( result == null ) { // 1682 return operator === "!="; // 1683 } // 1684 if ( !operator ) { // 1685 return true; // 1686 } // 1687 // 1688 result += ""; // 1689 // 1690 return operator === "=" ? result === check : // 1691 operator === "!=" ? result !== check : // 1692 operator === "^=" ? check && result.indexOf( check ) === 0 : // 1693 operator === "*=" ? check && result.indexOf( check ) > -1 : // 1694 operator === "$=" ? check && result.slice( -check.length ) === check : // 1695 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : // 1696 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : // 1697 false; // 1698 }; // 1699 }, // 1700 // 1701 "CHILD": function( type, what, argument, first, last ) { // 1702 var simple = type.slice( 0, 3 ) !== "nth", // 1703 forward = type.slice( -4 ) !== "last", // 1704 ofType = what === "of-type"; // 1705 // 1706 return first === 1 && last === 0 ? // 1707 // 1708 // Shortcut for :nth-*(n) // 1709 function( elem ) { // 1710 return !!elem.parentNode; // 1711 } : // 1712 // 1713 function( elem, context, xml ) { // 1714 var cache, outerCache, node, diff, nodeIndex, start, // 1715 dir = simple !== forward ? "nextSibling" : "previousSibling", // 1716 parent = elem.parentNode, // 1717 name = ofType && elem.nodeName.toLowerCase(), // 1718 useCache = !xml && !ofType; // 1719 // 1720 if ( parent ) { // 1721 // 1722 // :(first|last|only)-(child|of-type) // 1723 if ( simple ) { // 1724 while ( dir ) { // 1725 node = elem; // 1726 while ( (node = node[ dir ]) ) { // 1727 if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { // 1728 return false; // 1729 } // 1730 } // 1731 // Reverse direction for :only-* (if we haven't yet done so) // 1732 start = dir = type === "only" && !start && "nextSibling"; // 1733 } // 1734 return true; // 1735 } // 1736 // 1737 start = [ forward ? parent.firstChild : parent.lastChild ]; // 1738 // 1739 // non-xml :nth-child(...) stores cache data on `parent` // 1740 if ( forward && useCache ) { // 1741 // Seek `elem` from a previously-cached index // 1742 outerCache = parent[ expando ] || (parent[ expando ] = {}); // 1743 cache = outerCache[ type ] || []; // 1744 nodeIndex = cache[0] === dirruns && cache[1]; // 1745 diff = cache[0] === dirruns && cache[2]; // 1746 node = nodeIndex && parent.childNodes[ nodeIndex ]; // 1747 // 1748 while ( (node = ++nodeIndex && node && node[ dir ] || // 1749 // 1750 // Fallback to seeking `elem` from the start // 1751 (diff = nodeIndex = 0) || start.pop()) ) { // 1752 // 1753 // When found, cache indexes on `parent` and break // 1754 if ( node.nodeType === 1 && ++diff && node === elem ) { // 1755 outerCache[ type ] = [ dirruns, nodeIndex, diff ]; // 1756 break; // 1757 } // 1758 } // 1759 // 1760 // Use previously-cached element index if available // 1761 } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { diff = cache[1]; // 1763 // 1764 // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) // 1765 } else { // 1766 // Use the same loop as above to seek `elem` from the start // 1767 while ( (node = ++nodeIndex && node && node[ dir ] || // 1768 (diff = nodeIndex = 0) || start.pop()) ) { // 1769 // 1770 if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // 1771 // Cache the index of each encountered element // 1772 if ( useCache ) { // 1773 (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; // 1774 } // 1775 // 1776 if ( node === elem ) { // 1777 break; // 1778 } // 1779 } // 1780 } // 1781 } // 1782 // 1783 // Incorporate the offset, then check against cycle size // 1784 diff -= last; // 1785 return diff === first || ( diff % first === 0 && diff / first >= 0 ); // 1786 } // 1787 }; // 1788 }, // 1789 // 1790 "PSEUDO": function( pseudo, argument ) { // 1791 // pseudo-class names are case-insensitive // 1792 // http://www.w3.org/TR/selectors/#pseudo-classes // 1793 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // 1794 // Remember that setFilters inherits from pseudos // 1795 var args, // 1796 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || // 1797 Sizzle.error( "unsupported pseudo: " + pseudo ); // 1798 // 1799 // The user may use createPseudo to indicate that // 1800 // arguments are needed to create the filter function // 1801 // just as Sizzle does // 1802 if ( fn[ expando ] ) { // 1803 return fn( argument ); // 1804 } // 1805 // 1806 // But maintain support for old signatures // 1807 if ( fn.length > 1 ) { // 1808 args = [ pseudo, pseudo, "", argument ]; // 1809 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? // 1810 markFunction(function( seed, matches ) { // 1811 var idx, // 1812 matched = fn( seed, argument ), // 1813 i = matched.length; // 1814 while ( i-- ) { // 1815 idx = indexOf( seed, matched[i] ); // 1816 seed[ idx ] = !( matches[ idx ] = matched[i] ); // 1817 } // 1818 }) : // 1819 function( elem ) { // 1820 return fn( elem, 0, args ); // 1821 }; // 1822 } // 1823 // 1824 return fn; // 1825 } // 1826 }, // 1827 // 1828 pseudos: { // 1829 // Potentially complex pseudos // 1830 "not": markFunction(function( selector ) { // 1831 // Trim the selector passed to compile // 1832 // to avoid treating leading and trailing // 1833 // spaces as combinators // 1834 var input = [], // 1835 results = [], // 1836 matcher = compile( selector.replace( rtrim, "$1" ) ); // 1837 // 1838 return matcher[ expando ] ? // 1839 markFunction(function( seed, matches, context, xml ) { // 1840 var elem, // 1841 unmatched = matcher( seed, null, xml, [] ), // 1842 i = seed.length; // 1843 // 1844 // Match elements unmatched by `matcher` // 1845 while ( i-- ) { // 1846 if ( (elem = unmatched[i]) ) { // 1847 seed[i] = !(matches[i] = elem); // 1848 } // 1849 } // 1850 }) : // 1851 function( elem, context, xml ) { // 1852 input[0] = elem; // 1853 matcher( input, null, xml, results ); // 1854 // Don't keep the element (issue #299) // 1855 input[0] = null; // 1856 return !results.pop(); // 1857 }; // 1858 }), // 1859 // 1860 "has": markFunction(function( selector ) { // 1861 return function( elem ) { // 1862 return Sizzle( selector, elem ).length > 0; // 1863 }; // 1864 }), // 1865 // 1866 "contains": markFunction(function( text ) { // 1867 text = text.replace( runescape, funescape ); // 1868 return function( elem ) { // 1869 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; // 1870 }; // 1871 }), // 1872 // 1873 // "Whether an element is represented by a :lang() selector // 1874 // is based solely on the element's language value // 1875 // being equal to the identifier C, // 1876 // or beginning with the identifier C immediately followed by "-". // 1877 // The matching of C against the element's language value is performed case-insensitively. // 1878 // The identifier C does not have to be a valid language name." // 1879 // http://www.w3.org/TR/selectors/#lang-pseudo // 1880 "lang": markFunction( function( lang ) { // 1881 // lang value must be a valid identifier // 1882 if ( !ridentifier.test(lang || "") ) { // 1883 Sizzle.error( "unsupported lang: " + lang ); // 1884 } // 1885 lang = lang.replace( runescape, funescape ).toLowerCase(); // 1886 return function( elem ) { // 1887 var elemLang; // 1888 do { // 1889 if ( (elemLang = documentIsHTML ? // 1890 elem.lang : // 1891 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { // 1892 // 1893 elemLang = elemLang.toLowerCase(); // 1894 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; // 1895 } // 1896 } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); // 1897 return false; // 1898 }; // 1899 }), // 1900 // 1901 // Miscellaneous // 1902 "target": function( elem ) { // 1903 var hash = window.location && window.location.hash; // 1904 return hash && hash.slice( 1 ) === elem.id; // 1905 }, // 1906 // 1907 "root": function( elem ) { // 1908 return elem === docElem; // 1909 }, // 1910 // 1911 "focus": function( elem ) { // 1912 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); }, // 1914 // 1915 // Boolean properties // 1916 "enabled": function( elem ) { // 1917 return elem.disabled === false; // 1918 }, // 1919 // 1920 "disabled": function( elem ) { // 1921 return elem.disabled === true; // 1922 }, // 1923 // 1924 "checked": function( elem ) { // 1925 // In CSS3, :checked should return both checked and selected elements // 1926 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // 1927 var nodeName = elem.nodeName.toLowerCase(); // 1928 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); // 1929 }, // 1930 // 1931 "selected": function( elem ) { // 1932 // Accessing this property makes selected-by-default // 1933 // options in Safari work properly // 1934 if ( elem.parentNode ) { // 1935 elem.parentNode.selectedIndex; // 1936 } // 1937 // 1938 return elem.selected === true; // 1939 }, // 1940 // 1941 // Contents // 1942 "empty": function( elem ) { // 1943 // http://www.w3.org/TR/selectors/#empty-pseudo // 1944 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), // 1945 // but not by others (comment: 8; processing instruction: 7; etc.) // 1946 // nodeType < 6 works because attributes (2) do not appear as children // 1947 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { // 1948 if ( elem.nodeType < 6 ) { // 1949 return false; // 1950 } // 1951 } // 1952 return true; // 1953 }, // 1954 // 1955 "parent": function( elem ) { // 1956 return !Expr.pseudos["empty"]( elem ); // 1957 }, // 1958 // 1959 // Element/input types // 1960 "header": function( elem ) { // 1961 return rheader.test( elem.nodeName ); // 1962 }, // 1963 // 1964 "input": function( elem ) { // 1965 return rinputs.test( elem.nodeName ); // 1966 }, // 1967 // 1968 "button": function( elem ) { // 1969 var name = elem.nodeName.toLowerCase(); // 1970 return name === "input" && elem.type === "button" || name === "button"; // 1971 }, // 1972 // 1973 "text": function( elem ) { // 1974 var attr; // 1975 return elem.nodeName.toLowerCase() === "input" && // 1976 elem.type === "text" && // 1977 // 1978 // Support: IE<8 // 1979 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" // 1980 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); // 1981 }, // 1982 // 1983 // Position-in-collection // 1984 "first": createPositionalPseudo(function() { // 1985 return [ 0 ]; // 1986 }), // 1987 // 1988 "last": createPositionalPseudo(function( matchIndexes, length ) { // 1989 return [ length - 1 ]; // 1990 }), // 1991 // 1992 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { // 1993 return [ argument < 0 ? argument + length : argument ]; // 1994 }), // 1995 // 1996 "even": createPositionalPseudo(function( matchIndexes, length ) { // 1997 var i = 0; // 1998 for ( ; i < length; i += 2 ) { // 1999 matchIndexes.push( i ); // 2000 } // 2001 return matchIndexes; // 2002 }), // 2003 // 2004 "odd": createPositionalPseudo(function( matchIndexes, length ) { // 2005 var i = 1; // 2006 for ( ; i < length; i += 2 ) { // 2007 matchIndexes.push( i ); // 2008 } // 2009 return matchIndexes; // 2010 }), // 2011 // 2012 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { // 2013 var i = argument < 0 ? argument + length : argument; // 2014 for ( ; --i >= 0; ) { // 2015 matchIndexes.push( i ); // 2016 } // 2017 return matchIndexes; // 2018 }), // 2019 // 2020 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { // 2021 var i = argument < 0 ? argument + length : argument; // 2022 for ( ; ++i < length; ) { // 2023 matchIndexes.push( i ); // 2024 } // 2025 return matchIndexes; // 2026 }) // 2027 } // 2028 }; // 2029 // 2030 Expr.pseudos["nth"] = Expr.pseudos["eq"]; // 2031 // 2032 // Add button/input type pseudos // 2033 for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { // 2034 Expr.pseudos[ i ] = createInputPseudo( i ); // 2035 } // 2036 for ( i in { submit: true, reset: true } ) { // 2037 Expr.pseudos[ i ] = createButtonPseudo( i ); // 2038 } // 2039 // 2040 // Easy API for creating new setFilters // 2041 function setFilters() {} // 2042 setFilters.prototype = Expr.filters = Expr.pseudos; // 2043 Expr.setFilters = new setFilters(); // 2044 // 2045 tokenize = Sizzle.tokenize = function( selector, parseOnly ) { // 2046 var matched, match, tokens, type, // 2047 soFar, groups, preFilters, // 2048 cached = tokenCache[ selector + " " ]; // 2049 // 2050 if ( cached ) { // 2051 return parseOnly ? 0 : cached.slice( 0 ); // 2052 } // 2053 // 2054 soFar = selector; // 2055 groups = []; // 2056 preFilters = Expr.preFilter; // 2057 // 2058 while ( soFar ) { // 2059 // 2060 // Comma and first run // 2061 if ( !matched || (match = rcomma.exec( soFar )) ) { // 2062 if ( match ) { // 2063 // Don't consume trailing commas as valid // 2064 soFar = soFar.slice( match[0].length ) || soFar; // 2065 } // 2066 groups.push( (tokens = []) ); // 2067 } // 2068 // 2069 matched = false; // 2070 // 2071 // Combinators // 2072 if ( (match = rcombinators.exec( soFar )) ) { // 2073 matched = match.shift(); // 2074 tokens.push({ // 2075 value: matched, // 2076 // Cast descendant combinators to space // 2077 type: match[0].replace( rtrim, " " ) // 2078 }); // 2079 soFar = soFar.slice( matched.length ); // 2080 } // 2081 // 2082 // Filters // 2083 for ( type in Expr.filter ) { // 2084 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || // 2085 (match = preFilters[ type ]( match ))) ) { // 2086 matched = match.shift(); // 2087 tokens.push({ // 2088 value: matched, // 2089 type: type, // 2090 matches: match // 2091 }); // 2092 soFar = soFar.slice( matched.length ); // 2093 } // 2094 } // 2095 // 2096 if ( !matched ) { // 2097 break; // 2098 } // 2099 } // 2100 // 2101 // Return the length of the invalid excess // 2102 // if we're just parsing // 2103 // Otherwise, throw an error or return tokens // 2104 return parseOnly ? // 2105 soFar.length : // 2106 soFar ? // 2107 Sizzle.error( selector ) : // 2108 // Cache the tokens // 2109 tokenCache( selector, groups ).slice( 0 ); // 2110 }; // 2111 // 2112 function toSelector( tokens ) { // 2113 var i = 0, // 2114 len = tokens.length, // 2115 selector = ""; // 2116 for ( ; i < len; i++ ) { // 2117 selector += tokens[i].value; // 2118 } // 2119 return selector; // 2120 } // 2121 // 2122 function addCombinator( matcher, combinator, base ) { // 2123 var dir = combinator.dir, // 2124 checkNonElements = base && dir === "parentNode", // 2125 doneName = done++; // 2126 // 2127 return combinator.first ? // 2128 // Check against closest ancestor/preceding element // 2129 function( elem, context, xml ) { // 2130 while ( (elem = elem[ dir ]) ) { // 2131 if ( elem.nodeType === 1 || checkNonElements ) { // 2132 return matcher( elem, context, xml ); // 2133 } // 2134 } // 2135 } : // 2136 // 2137 // Check against all ancestor/preceding elements // 2138 function( elem, context, xml ) { // 2139 var oldCache, outerCache, // 2140 newCache = [ dirruns, doneName ]; // 2141 // 2142 // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching // 2143 if ( xml ) { // 2144 while ( (elem = elem[ dir ]) ) { // 2145 if ( elem.nodeType === 1 || checkNonElements ) { // 2146 if ( matcher( elem, context, xml ) ) { // 2147 return true; // 2148 } // 2149 } // 2150 } // 2151 } else { // 2152 while ( (elem = elem[ dir ]) ) { // 2153 if ( elem.nodeType === 1 || checkNonElements ) { // 2154 outerCache = elem[ expando ] || (elem[ expando ] = {}); // 2155 if ( (oldCache = outerCache[ dir ]) && // 2156 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { // 2157 // 2158 // Assign to newCache so results back-propagate to previous elements // 2159 return (newCache[ 2 ] = oldCache[ 2 ]); // 2160 } else { // 2161 // Reuse newcache so results back-propagate to previous elements // 2162 outerCache[ dir ] = newCache; // 2163 // 2164 // A match means we're done; a fail means we have to keep checking // 2165 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { // 2166 return true; // 2167 } // 2168 } // 2169 } // 2170 } // 2171 } // 2172 }; // 2173 } // 2174 // 2175 function elementMatcher( matchers ) { // 2176 return matchers.length > 1 ? // 2177 function( elem, context, xml ) { // 2178 var i = matchers.length; // 2179 while ( i-- ) { // 2180 if ( !matchers[i]( elem, context, xml ) ) { // 2181 return false; // 2182 } // 2183 } // 2184 return true; // 2185 } : // 2186 matchers[0]; // 2187 } // 2188 // 2189 function multipleContexts( selector, contexts, results ) { // 2190 var i = 0, // 2191 len = contexts.length; // 2192 for ( ; i < len; i++ ) { // 2193 Sizzle( selector, contexts[i], results ); // 2194 } // 2195 return results; // 2196 } // 2197 // 2198 function condense( unmatched, map, filter, context, xml ) { // 2199 var elem, // 2200 newUnmatched = [], // 2201 i = 0, // 2202 len = unmatched.length, // 2203 mapped = map != null; // 2204 // 2205 for ( ; i < len; i++ ) { // 2206 if ( (elem = unmatched[i]) ) { // 2207 if ( !filter || filter( elem, context, xml ) ) { // 2208 newUnmatched.push( elem ); // 2209 if ( mapped ) { // 2210 map.push( i ); // 2211 } // 2212 } // 2213 } // 2214 } // 2215 // 2216 return newUnmatched; // 2217 } // 2218 // 2219 function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { // 2220 if ( postFilter && !postFilter[ expando ] ) { // 2221 postFilter = setMatcher( postFilter ); // 2222 } // 2223 if ( postFinder && !postFinder[ expando ] ) { // 2224 postFinder = setMatcher( postFinder, postSelector ); // 2225 } // 2226 return markFunction(function( seed, results, context, xml ) { // 2227 var temp, i, elem, // 2228 preMap = [], // 2229 postMap = [], // 2230 preexisting = results.length, // 2231 // 2232 // Get initial elements from seed or context // 2233 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // 2234 // 2235 // Prefilter to get matcher input, preserving a map for seed-results synchronization // 2236 matcherIn = preFilter && ( seed || !selector ) ? // 2237 condense( elems, preMap, preFilter, context, xml ) : // 2238 elems, // 2239 // 2240 matcherOut = matcher ? // 2241 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, // 2242 postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // 2243 // 2244 // ...intermediate processing is necessary // 2245 [] : // 2246 // 2247 // ...otherwise use results directly // 2248 results : // 2249 matcherIn; // 2250 // 2251 // Find primary matches // 2252 if ( matcher ) { // 2253 matcher( matcherIn, matcherOut, context, xml ); // 2254 } // 2255 // 2256 // Apply postFilter // 2257 if ( postFilter ) { // 2258 temp = condense( matcherOut, postMap ); // 2259 postFilter( temp, [], context, xml ); // 2260 // 2261 // Un-match failing elements by moving them back to matcherIn // 2262 i = temp.length; // 2263 while ( i-- ) { // 2264 if ( (elem = temp[i]) ) { // 2265 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); // 2266 } // 2267 } // 2268 } // 2269 // 2270 if ( seed ) { // 2271 if ( postFinder || preFilter ) { // 2272 if ( postFinder ) { // 2273 // Get the final matcherOut by condensing this intermediate into postFinder contexts // 2274 temp = []; // 2275 i = matcherOut.length; // 2276 while ( i-- ) { // 2277 if ( (elem = matcherOut[i]) ) { // 2278 // Restore matcherIn since elem is not yet a final match // 2279 temp.push( (matcherIn[i] = elem) ); // 2280 } // 2281 } // 2282 postFinder( null, (matcherOut = []), temp, xml ); // 2283 } // 2284 // 2285 // Move matched elements from seed to results to keep them synchronized // 2286 i = matcherOut.length; // 2287 while ( i-- ) { // 2288 if ( (elem = matcherOut[i]) && // 2289 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { // 2290 // 2291 seed[temp] = !(results[temp] = elem); // 2292 } // 2293 } // 2294 } // 2295 // 2296 // Add elements to results, through postFinder if defined // 2297 } else { // 2298 matcherOut = condense( // 2299 matcherOut === results ? // 2300 matcherOut.splice( preexisting, matcherOut.length ) : // 2301 matcherOut // 2302 ); // 2303 if ( postFinder ) { // 2304 postFinder( null, results, matcherOut, xml ); // 2305 } else { // 2306 push.apply( results, matcherOut ); // 2307 } // 2308 } // 2309 }); // 2310 } // 2311 // 2312 function matcherFromTokens( tokens ) { // 2313 var checkContext, matcher, j, // 2314 len = tokens.length, // 2315 leadingRelative = Expr.relative[ tokens[0].type ], // 2316 implicitRelative = leadingRelative || Expr.relative[" "], // 2317 i = leadingRelative ? 1 : 0, // 2318 // 2319 // The foundational matcher ensures that elements are reachable from top-level context(s) // 2320 matchContext = addCombinator( function( elem ) { // 2321 return elem === checkContext; // 2322 }, implicitRelative, true ), // 2323 matchAnyContext = addCombinator( function( elem ) { // 2324 return indexOf( checkContext, elem ) > -1; // 2325 }, implicitRelative, true ), // 2326 matchers = [ function( elem, context, xml ) { // 2327 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( // 2328 (checkContext = context).nodeType ? // 2329 matchContext( elem, context, xml ) : // 2330 matchAnyContext( elem, context, xml ) ); // 2331 // Avoid hanging onto element (issue #299) // 2332 checkContext = null; // 2333 return ret; // 2334 } ]; // 2335 // 2336 for ( ; i < len; i++ ) { // 2337 if ( (matcher = Expr.relative[ tokens[i].type ]) ) { // 2338 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; // 2339 } else { // 2340 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); // 2341 // 2342 // Return special upon seeing a positional matcher // 2343 if ( matcher[ expando ] ) { // 2344 // Find the next relative operator (if any) for proper handling // 2345 j = ++i; // 2346 for ( ; j < len; j++ ) { // 2347 if ( Expr.relative[ tokens[j].type ] ) { // 2348 break; // 2349 } // 2350 } // 2351 return setMatcher( // 2352 i > 1 && elementMatcher( matchers ), // 2353 i > 1 && toSelector( // 2354 // If the preceding token was a descendant combinator, insert an implicit any-element `*` // 2355 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) // 2356 ).replace( rtrim, "$1" ), // 2357 matcher, // 2358 i < j && matcherFromTokens( tokens.slice( i, j ) ), // 2359 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), // 2360 j < len && toSelector( tokens ) // 2361 ); // 2362 } // 2363 matchers.push( matcher ); // 2364 } // 2365 } // 2366 // 2367 return elementMatcher( matchers ); // 2368 } // 2369 // 2370 function matcherFromGroupMatchers( elementMatchers, setMatchers ) { // 2371 var bySet = setMatchers.length > 0, // 2372 byElement = elementMatchers.length > 0, // 2373 superMatcher = function( seed, context, xml, results, outermost ) { // 2374 var elem, j, matcher, // 2375 matchedCount = 0, // 2376 i = "0", // 2377 unmatched = seed && [], // 2378 setMatched = [], // 2379 contextBackup = outermostContext, // 2380 // We must always have either seed elements or outermost context // 2381 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), // 2382 // Use integer dirruns iff this is the outermost matcher // 2383 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), // 2384 len = elems.length; // 2385 // 2386 if ( outermost ) { // 2387 outermostContext = context !== document && context; // 2388 } // 2389 // 2390 // Add elements passing elementMatchers directly to results // 2391 // Keep `i` a string if there are no elements so `matchedCount` will be "00" below // 2392 // Support: IE<9, Safari // 2393 // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id // 2394 for ( ; i !== len && (elem = elems[i]) != null; i++ ) { // 2395 if ( byElement && elem ) { // 2396 j = 0; // 2397 while ( (matcher = elementMatchers[j++]) ) { // 2398 if ( matcher( elem, context, xml ) ) { // 2399 results.push( elem ); // 2400 break; // 2401 } // 2402 } // 2403 if ( outermost ) { // 2404 dirruns = dirrunsUnique; // 2405 } // 2406 } // 2407 // 2408 // Track unmatched elements for set filters // 2409 if ( bySet ) { // 2410 // They will have gone through all possible matchers // 2411 if ( (elem = !matcher && elem) ) { // 2412 matchedCount--; // 2413 } // 2414 // 2415 // Lengthen the array for every element, matched or not // 2416 if ( seed ) { // 2417 unmatched.push( elem ); // 2418 } // 2419 } // 2420 } // 2421 // 2422 // Apply set filters to unmatched elements // 2423 matchedCount += i; // 2424 if ( bySet && i !== matchedCount ) { // 2425 j = 0; // 2426 while ( (matcher = setMatchers[j++]) ) { // 2427 matcher( unmatched, setMatched, context, xml ); // 2428 } // 2429 // 2430 if ( seed ) { // 2431 // Reintegrate element matches to eliminate the need for sorting // 2432 if ( matchedCount > 0 ) { // 2433 while ( i-- ) { // 2434 if ( !(unmatched[i] || setMatched[i]) ) { // 2435 setMatched[i] = pop.call( results ); // 2436 } // 2437 } // 2438 } // 2439 // 2440 // Discard index placeholder values to get only actual matches // 2441 setMatched = condense( setMatched ); // 2442 } // 2443 // 2444 // Add matches to results // 2445 push.apply( results, setMatched ); // 2446 // 2447 // Seedless set matches succeeding multiple successful matchers stipulate sorting // 2448 if ( outermost && !seed && setMatched.length > 0 && // 2449 ( matchedCount + setMatchers.length ) > 1 ) { // 2450 // 2451 Sizzle.uniqueSort( results ); // 2452 } // 2453 } // 2454 // 2455 // Override manipulation of globals by nested matchers // 2456 if ( outermost ) { // 2457 dirruns = dirrunsUnique; // 2458 outermostContext = contextBackup; // 2459 } // 2460 // 2461 return unmatched; // 2462 }; // 2463 // 2464 return bySet ? // 2465 markFunction( superMatcher ) : // 2466 superMatcher; // 2467 } // 2468 // 2469 compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { // 2470 var i, // 2471 setMatchers = [], // 2472 elementMatchers = [], // 2473 cached = compilerCache[ selector + " " ]; // 2474 // 2475 if ( !cached ) { // 2476 // Generate a function of recursive functions that can be used to check each element // 2477 if ( !match ) { // 2478 match = tokenize( selector ); // 2479 } // 2480 i = match.length; // 2481 while ( i-- ) { // 2482 cached = matcherFromTokens( match[i] ); // 2483 if ( cached[ expando ] ) { // 2484 setMatchers.push( cached ); // 2485 } else { // 2486 elementMatchers.push( cached ); // 2487 } // 2488 } // 2489 // 2490 // Cache the compiled function // 2491 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); // 2492 // 2493 // Save selector and tokenization // 2494 cached.selector = selector; // 2495 } // 2496 return cached; // 2497 }; // 2498 // 2499 /** // 2500 * A low-level selection function that works with Sizzle's compiled // 2501 * selector functions // 2502 * @param {String|Function} selector A selector or a pre-compiled // 2503 * selector function built with Sizzle.compile // 2504 * @param {Element} context // 2505 * @param {Array} [results] // 2506 * @param {Array} [seed] A set of elements to match against // 2507 */ // 2508 select = Sizzle.select = function( selector, context, results, seed ) { // 2509 var i, tokens, token, type, find, // 2510 compiled = typeof selector === "function" && selector, // 2511 match = !seed && tokenize( (selector = compiled.selector || selector) ); // 2512 // 2513 results = results || []; // 2514 // 2515 // Try to minimize operations if there is no seed and only one group // 2516 if ( match.length === 1 ) { // 2517 // 2518 // Take a shortcut and set the context if the root selector is an ID // 2519 tokens = match[0] = match[0].slice( 0 ); // 2520 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && // 2521 support.getById && context.nodeType === 9 && documentIsHTML && // 2522 Expr.relative[ tokens[1].type ] ) { // 2523 // 2524 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; // 2525 if ( !context ) { // 2526 return results; // 2527 // 2528 // Precompiled matchers will still verify ancestry, so step up a level // 2529 } else if ( compiled ) { // 2530 context = context.parentNode; // 2531 } // 2532 // 2533 selector = selector.slice( tokens.shift().value.length ); // 2534 } // 2535 // 2536 // Fetch a seed set for right-to-left matching // 2537 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; // 2538 while ( i-- ) { // 2539 token = tokens[i]; // 2540 // 2541 // Abort if we hit a combinator // 2542 if ( Expr.relative[ (type = token.type) ] ) { // 2543 break; // 2544 } // 2545 if ( (find = Expr.find[ type ]) ) { // 2546 // Search, expanding context for leading sibling combinators // 2547 if ( (seed = find( // 2548 token.matches[0].replace( runescape, funescape ), // 2549 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context // 2550 )) ) { // 2551 // 2552 // If seed is empty or no tokens remain, we can return early // 2553 tokens.splice( i, 1 ); // 2554 selector = seed.length && toSelector( tokens ); // 2555 if ( !selector ) { // 2556 push.apply( results, seed ); // 2557 return results; // 2558 } // 2559 // 2560 break; // 2561 } // 2562 } // 2563 } // 2564 } // 2565 // 2566 // Compile and execute a filtering function if one is not provided // 2567 // Provide `match` to avoid retokenization if we modified the selector above // 2568 ( compiled || compile( selector, match ) )( // 2569 seed, // 2570 context, // 2571 !documentIsHTML, // 2572 results, // 2573 rsibling.test( selector ) && testContext( context.parentNode ) || context // 2574 ); // 2575 return results; // 2576 }; // 2577 // 2578 // One-time assignments // 2579 // 2580 // Sort stability // 2581 support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; // 2582 // 2583 // Support: Chrome 14-35+ // 2584 // Always assume duplicates if they aren't passed to the comparison function // 2585 support.detectDuplicates = !!hasDuplicate; // 2586 // 2587 // Initialize against the default document // 2588 setDocument(); // 2589 // 2590 // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // 2591 // Detached nodes confoundingly follow *each other* // 2592 support.sortDetached = assert(function( div1 ) { // 2593 // Should return 1, but returns 4 (following) // 2594 return div1.compareDocumentPosition( document.createElement("div") ) & 1; // 2595 }); // 2596 // 2597 // Support: IE<8 // 2598 // Prevent attribute/property "interpolation" // 2599 // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx // 2600 if ( !assert(function( div ) { // 2601 div.innerHTML = ""; // 2602 return div.firstChild.getAttribute("href") === "#" ; // 2603 }) ) { // 2604 addHandle( "type|href|height|width", function( elem, name, isXML ) { // 2605 if ( !isXML ) { // 2606 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); // 2607 } // 2608 }); // 2609 } // 2610 // 2611 // Support: IE<9 // 2612 // Use defaultValue in place of getAttribute("value") // 2613 if ( !support.attributes || !assert(function( div ) { // 2614 div.innerHTML = ""; // 2615 div.firstChild.setAttribute( "value", "" ); // 2616 return div.firstChild.getAttribute( "value" ) === ""; // 2617 }) ) { // 2618 addHandle( "value", function( elem, name, isXML ) { // 2619 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { // 2620 return elem.defaultValue; // 2621 } // 2622 }); // 2623 } // 2624 // 2625 // Support: IE<9 // 2626 // Use getAttributeNode to fetch booleans when getAttribute lies // 2627 if ( !assert(function( div ) { // 2628 return div.getAttribute("disabled") == null; // 2629 }) ) { // 2630 addHandle( booleans, function( elem, name, isXML ) { // 2631 var val; // 2632 if ( !isXML ) { // 2633 return elem[ name ] === true ? name.toLowerCase() : // 2634 (val = elem.getAttributeNode( name )) && val.specified ? // 2635 val.value : // 2636 null; // 2637 } // 2638 }); // 2639 } // 2640 // 2641 return Sizzle; // 2642 // 2643 })( window ); // 2644 // 2645 // 2646 // 2647 jQuery.find = Sizzle; // 2648 jQuery.expr = Sizzle.selectors; // 2649 jQuery.expr[":"] = jQuery.expr.pseudos; // 2650 jQuery.unique = Sizzle.uniqueSort; // 2651 jQuery.text = Sizzle.getText; // 2652 jQuery.isXMLDoc = Sizzle.isXML; // 2653 jQuery.contains = Sizzle.contains; // 2654 // 2655 // 2656 // 2657 var rneedsContext = jQuery.expr.match.needsContext; // 2658 // 2659 var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); // 2660 // 2661 // 2662 // 2663 var risSimple = /^.[^:#\[\.,]*$/; // 2664 // 2665 // Implement the identical functionality for filter and not // 2666 function winnow( elements, qualifier, not ) { // 2667 if ( jQuery.isFunction( qualifier ) ) { // 2668 return jQuery.grep( elements, function( elem, i ) { // 2669 /* jshint -W018 */ // 2670 return !!qualifier.call( elem, i, elem ) !== not; // 2671 }); // 2672 // 2673 } // 2674 // 2675 if ( qualifier.nodeType ) { // 2676 return jQuery.grep( elements, function( elem ) { // 2677 return ( elem === qualifier ) !== not; // 2678 }); // 2679 // 2680 } // 2681 // 2682 if ( typeof qualifier === "string" ) { // 2683 if ( risSimple.test( qualifier ) ) { // 2684 return jQuery.filter( qualifier, elements, not ); // 2685 } // 2686 // 2687 qualifier = jQuery.filter( qualifier, elements ); // 2688 } // 2689 // 2690 return jQuery.grep( elements, function( elem ) { // 2691 return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; // 2692 }); // 2693 } // 2694 // 2695 jQuery.filter = function( expr, elems, not ) { // 2696 var elem = elems[ 0 ]; // 2697 // 2698 if ( not ) { // 2699 expr = ":not(" + expr + ")"; // 2700 } // 2701 // 2702 return elems.length === 1 && elem.nodeType === 1 ? // 2703 jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : // 2704 jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { // 2705 return elem.nodeType === 1; // 2706 })); // 2707 }; // 2708 // 2709 jQuery.fn.extend({ // 2710 find: function( selector ) { // 2711 var i, // 2712 ret = [], // 2713 self = this, // 2714 len = self.length; // 2715 // 2716 if ( typeof selector !== "string" ) { // 2717 return this.pushStack( jQuery( selector ).filter(function() { // 2718 for ( i = 0; i < len; i++ ) { // 2719 if ( jQuery.contains( self[ i ], this ) ) { // 2720 return true; // 2721 } // 2722 } // 2723 }) ); // 2724 } // 2725 // 2726 for ( i = 0; i < len; i++ ) { // 2727 jQuery.find( selector, self[ i ], ret ); // 2728 } // 2729 // 2730 // Needed because $( selector, context ) becomes $( context ).find( selector ) // 2731 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); // 2732 ret.selector = this.selector ? this.selector + " " + selector : selector; // 2733 return ret; // 2734 }, // 2735 filter: function( selector ) { // 2736 return this.pushStack( winnow(this, selector || [], false) ); // 2737 }, // 2738 not: function( selector ) { // 2739 return this.pushStack( winnow(this, selector || [], true) ); // 2740 }, // 2741 is: function( selector ) { // 2742 return !!winnow( // 2743 this, // 2744 // 2745 // If this is a positional/relative selector, check membership in the returned set // 2746 // so $("p:first").is("p:last") won't return true for a doc with two "p". // 2747 typeof selector === "string" && rneedsContext.test( selector ) ? // 2748 jQuery( selector ) : // 2749 selector || [], // 2750 false // 2751 ).length; // 2752 } // 2753 }); // 2754 // 2755 // 2756 // Initialize a jQuery object // 2757 // 2758 // 2759 // A central reference to the root jQuery(document) // 2760 var rootjQuery, // 2761 // 2762 // Use the correct document accordingly with window argument (sandbox) // 2763 document = window.document, // 2764 // 2765 // A simple way to check for HTML strings // 2766 // Prioritize #id over to avoid XSS via location.hash (#9521) // 2767 // Strict HTML recognition (#11290: must start with <) // 2768 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, // 2769 // 2770 init = jQuery.fn.init = function( selector, context ) { // 2771 var match, elem; // 2772 // 2773 // HANDLE: $(""), $(null), $(undefined), $(false) // 2774 if ( !selector ) { // 2775 return this; // 2776 } // 2777 // 2778 // Handle HTML strings // 2779 if ( typeof selector === "string" ) { // 2780 if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { // 2781 // Assume that strings that start and end with <> are HTML and skip the regex check // 2782 match = [ null, selector, null ]; // 2783 // 2784 } else { // 2785 match = rquickExpr.exec( selector ); // 2786 } // 2787 // 2788 // Match html or make sure no context is specified for #id // 2789 if ( match && (match[1] || !context) ) { // 2790 // 2791 // HANDLE: $(html) -> $(array) // 2792 if ( match[1] ) { // 2793 context = context instanceof jQuery ? context[0] : context; // 2794 // 2795 // scripts is true for back-compat // 2796 // Intentionally let the error be thrown if parseHTML is not present // 2797 jQuery.merge( this, jQuery.parseHTML( // 2798 match[1], // 2799 context && context.nodeType ? context.ownerDocument || context : document, // 2800 true // 2801 ) ); // 2802 // 2803 // HANDLE: $(html, props) // 2804 if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { // 2805 for ( match in context ) { // 2806 // Properties of context are called as methods if possible // 2807 if ( jQuery.isFunction( this[ match ] ) ) { // 2808 this[ match ]( context[ match ] ); // 2809 // 2810 // ...and otherwise set as attributes // 2811 } else { // 2812 this.attr( match, context[ match ] ); // 2813 } // 2814 } // 2815 } // 2816 // 2817 return this; // 2818 // 2819 // HANDLE: $(#id) // 2820 } else { // 2821 elem = document.getElementById( match[2] ); // 2822 // 2823 // Check parentNode to catch when Blackberry 4.6 returns // 2824 // nodes that are no longer in the document #6963 // 2825 if ( elem && elem.parentNode ) { // 2826 // Handle the case where IE and Opera return items // 2827 // by name instead of ID // 2828 if ( elem.id !== match[2] ) { // 2829 return rootjQuery.find( selector ); // 2830 } // 2831 // 2832 // Otherwise, we inject the element directly into the jQuery object // 2833 this.length = 1; // 2834 this[0] = elem; // 2835 } // 2836 // 2837 this.context = document; // 2838 this.selector = selector; // 2839 return this; // 2840 } // 2841 // 2842 // HANDLE: $(expr, $(...)) // 2843 } else if ( !context || context.jquery ) { // 2844 return ( context || rootjQuery ).find( selector ); // 2845 // 2846 // HANDLE: $(expr, context) // 2847 // (which is just equivalent to: $(context).find(expr) // 2848 } else { // 2849 return this.constructor( context ).find( selector ); // 2850 } // 2851 // 2852 // HANDLE: $(DOMElement) // 2853 } else if ( selector.nodeType ) { // 2854 this.context = this[0] = selector; // 2855 this.length = 1; // 2856 return this; // 2857 // 2858 // HANDLE: $(function) // 2859 // Shortcut for document ready // 2860 } else if ( jQuery.isFunction( selector ) ) { // 2861 return typeof rootjQuery.ready !== "undefined" ? // 2862 rootjQuery.ready( selector ) : // 2863 // Execute immediately if ready is not present // 2864 selector( jQuery ); // 2865 } // 2866 // 2867 if ( selector.selector !== undefined ) { // 2868 this.selector = selector.selector; // 2869 this.context = selector.context; // 2870 } // 2871 // 2872 return jQuery.makeArray( selector, this ); // 2873 }; // 2874 // 2875 // Give the init function the jQuery prototype for later instantiation // 2876 init.prototype = jQuery.fn; // 2877 // 2878 // Initialize central reference // 2879 rootjQuery = jQuery( document ); // 2880 // 2881 // 2882 var rparentsprev = /^(?:parents|prev(?:Until|All))/, // 2883 // methods guaranteed to produce a unique set when starting from a unique set // 2884 guaranteedUnique = { // 2885 children: true, // 2886 contents: true, // 2887 next: true, // 2888 prev: true // 2889 }; // 2890 // 2891 jQuery.extend({ // 2892 dir: function( elem, dir, until ) { // 2893 var matched = [], // 2894 cur = elem[ dir ]; // 2895 // 2896 while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { // 2897 if ( cur.nodeType === 1 ) { // 2898 matched.push( cur ); // 2899 } // 2900 cur = cur[dir]; // 2901 } // 2902 return matched; // 2903 }, // 2904 // 2905 sibling: function( n, elem ) { // 2906 var r = []; // 2907 // 2908 for ( ; n; n = n.nextSibling ) { // 2909 if ( n.nodeType === 1 && n !== elem ) { // 2910 r.push( n ); // 2911 } // 2912 } // 2913 // 2914 return r; // 2915 } // 2916 }); // 2917 // 2918 jQuery.fn.extend({ // 2919 has: function( target ) { // 2920 var i, // 2921 targets = jQuery( target, this ), // 2922 len = targets.length; // 2923 // 2924 return this.filter(function() { // 2925 for ( i = 0; i < len; i++ ) { // 2926 if ( jQuery.contains( this, targets[i] ) ) { // 2927 return true; // 2928 } // 2929 } // 2930 }); // 2931 }, // 2932 // 2933 closest: function( selectors, context ) { // 2934 var cur, // 2935 i = 0, // 2936 l = this.length, // 2937 matched = [], // 2938 pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? // 2939 jQuery( selectors, context || this.context ) : // 2940 0; // 2941 // 2942 for ( ; i < l; i++ ) { // 2943 for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { // 2944 // Always skip document fragments // 2945 if ( cur.nodeType < 11 && (pos ? // 2946 pos.index(cur) > -1 : // 2947 // 2948 // Don't pass non-elements to Sizzle // 2949 cur.nodeType === 1 && // 2950 jQuery.find.matchesSelector(cur, selectors)) ) { // 2951 // 2952 matched.push( cur ); // 2953 break; // 2954 } // 2955 } // 2956 } // 2957 // 2958 return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); // 2959 }, // 2960 // 2961 // Determine the position of an element within // 2962 // the matched set of elements // 2963 index: function( elem ) { // 2964 // 2965 // No argument, return index in parent // 2966 if ( !elem ) { // 2967 return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; // 2968 } // 2969 // 2970 // index in selector // 2971 if ( typeof elem === "string" ) { // 2972 return jQuery.inArray( this[0], jQuery( elem ) ); // 2973 } // 2974 // 2975 // Locate the position of the desired element // 2976 return jQuery.inArray( // 2977 // If it receives a jQuery object, the first element is used // 2978 elem.jquery ? elem[0] : elem, this ); // 2979 }, // 2980 // 2981 add: function( selector, context ) { // 2982 return this.pushStack( // 2983 jQuery.unique( // 2984 jQuery.merge( this.get(), jQuery( selector, context ) ) // 2985 ) // 2986 ); // 2987 }, // 2988 // 2989 addBack: function( selector ) { // 2990 return this.add( selector == null ? // 2991 this.prevObject : this.prevObject.filter(selector) // 2992 ); // 2993 } // 2994 }); // 2995 // 2996 function sibling( cur, dir ) { // 2997 do { // 2998 cur = cur[ dir ]; // 2999 } while ( cur && cur.nodeType !== 1 ); // 3000 // 3001 return cur; // 3002 } // 3003 // 3004 jQuery.each({ // 3005 parent: function( elem ) { // 3006 var parent = elem.parentNode; // 3007 return parent && parent.nodeType !== 11 ? parent : null; // 3008 }, // 3009 parents: function( elem ) { // 3010 return jQuery.dir( elem, "parentNode" ); // 3011 }, // 3012 parentsUntil: function( elem, i, until ) { // 3013 return jQuery.dir( elem, "parentNode", until ); // 3014 }, // 3015 next: function( elem ) { // 3016 return sibling( elem, "nextSibling" ); // 3017 }, // 3018 prev: function( elem ) { // 3019 return sibling( elem, "previousSibling" ); // 3020 }, // 3021 nextAll: function( elem ) { // 3022 return jQuery.dir( elem, "nextSibling" ); // 3023 }, // 3024 prevAll: function( elem ) { // 3025 return jQuery.dir( elem, "previousSibling" ); // 3026 }, // 3027 nextUntil: function( elem, i, until ) { // 3028 return jQuery.dir( elem, "nextSibling", until ); // 3029 }, // 3030 prevUntil: function( elem, i, until ) { // 3031 return jQuery.dir( elem, "previousSibling", until ); // 3032 }, // 3033 siblings: function( elem ) { // 3034 return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); // 3035 }, // 3036 children: function( elem ) { // 3037 return jQuery.sibling( elem.firstChild ); // 3038 }, // 3039 contents: function( elem ) { // 3040 return jQuery.nodeName( elem, "iframe" ) ? // 3041 elem.contentDocument || elem.contentWindow.document : // 3042 jQuery.merge( [], elem.childNodes ); // 3043 } // 3044 }, function( name, fn ) { // 3045 jQuery.fn[ name ] = function( until, selector ) { // 3046 var ret = jQuery.map( this, fn, until ); // 3047 // 3048 if ( name.slice( -5 ) !== "Until" ) { // 3049 selector = until; // 3050 } // 3051 // 3052 if ( selector && typeof selector === "string" ) { // 3053 ret = jQuery.filter( selector, ret ); // 3054 } // 3055 // 3056 if ( this.length > 1 ) { // 3057 // Remove duplicates // 3058 if ( !guaranteedUnique[ name ] ) { // 3059 ret = jQuery.unique( ret ); // 3060 } // 3061 // 3062 // Reverse order for parents* and prev-derivatives // 3063 if ( rparentsprev.test( name ) ) { // 3064 ret = ret.reverse(); // 3065 } // 3066 } // 3067 // 3068 return this.pushStack( ret ); // 3069 }; // 3070 }); // 3071 var rnotwhite = (/\S+/g); // 3072 // 3073 // 3074 // 3075 // String to Object options format cache // 3076 var optionsCache = {}; // 3077 // 3078 // Convert String-formatted options into Object-formatted ones and store in cache // 3079 function createOptions( options ) { // 3080 var object = optionsCache[ options ] = {}; // 3081 jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { // 3082 object[ flag ] = true; // 3083 }); // 3084 return object; // 3085 } // 3086 // 3087 /* // 3088 * Create a callback list using the following parameters: // 3089 * // 3090 * options: an optional list of space-separated options that will change how // 3091 * the callback list behaves or a more traditional option object // 3092 * // 3093 * By default a callback list will act like an event callback list and can be // 3094 * "fired" multiple times. // 3095 * // 3096 * Possible options: // 3097 * // 3098 * once: will ensure the callback list can only be fired once (like a Deferred) // 3099 * // 3100 * memory: will keep track of previous values and will call any callback added // 3101 * after the list has been fired right away with the latest "memorized" // 3102 * values (like a Deferred) // 3103 * // 3104 * unique: will ensure a callback can only be added once (no duplicate in the list) // 3105 * // 3106 * stopOnFalse: interrupt callings when a callback returns false // 3107 * // 3108 */ // 3109 jQuery.Callbacks = function( options ) { // 3110 // 3111 // Convert options from String-formatted to Object-formatted if needed // 3112 // (we check in cache first) // 3113 options = typeof options === "string" ? // 3114 ( optionsCache[ options ] || createOptions( options ) ) : // 3115 jQuery.extend( {}, options ); // 3116 // 3117 var // Flag to know if list is currently firing // 3118 firing, // 3119 // Last fire value (for non-forgettable lists) // 3120 memory, // 3121 // Flag to know if list was already fired // 3122 fired, // 3123 // End of the loop when firing // 3124 firingLength, // 3125 // Index of currently firing callback (modified by remove if needed) // 3126 firingIndex, // 3127 // First callback to fire (used internally by add and fireWith) // 3128 firingStart, // 3129 // Actual callback list // 3130 list = [], // 3131 // Stack of fire calls for repeatable lists // 3132 stack = !options.once && [], // 3133 // Fire callbacks // 3134 fire = function( data ) { // 3135 memory = options.memory && data; // 3136 fired = true; // 3137 firingIndex = firingStart || 0; // 3138 firingStart = 0; // 3139 firingLength = list.length; // 3140 firing = true; // 3141 for ( ; list && firingIndex < firingLength; firingIndex++ ) { // 3142 if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { // 3143 memory = false; // To prevent further calls using add // 3144 break; // 3145 } // 3146 } // 3147 firing = false; // 3148 if ( list ) { // 3149 if ( stack ) { // 3150 if ( stack.length ) { // 3151 fire( stack.shift() ); // 3152 } // 3153 } else if ( memory ) { // 3154 list = []; // 3155 } else { // 3156 self.disable(); // 3157 } // 3158 } // 3159 }, // 3160 // Actual Callbacks object // 3161 self = { // 3162 // Add a callback or a collection of callbacks to the list // 3163 add: function() { // 3164 if ( list ) { // 3165 // First, we save the current length // 3166 var start = list.length; // 3167 (function add( args ) { // 3168 jQuery.each( args, function( _, arg ) { // 3169 var type = jQuery.type( arg ); // 3170 if ( type === "function" ) { // 3171 if ( !options.unique || !self.has( arg ) ) { // 3172 list.push( arg ); // 3173 } // 3174 } else if ( arg && arg.length && type !== "string" ) { // 3175 // Inspect recursively // 3176 add( arg ); // 3177 } // 3178 }); // 3179 })( arguments ); // 3180 // Do we need to add the callbacks to the // 3181 // current firing batch? // 3182 if ( firing ) { // 3183 firingLength = list.length; // 3184 // With memory, if we're not firing then // 3185 // we should call right away // 3186 } else if ( memory ) { // 3187 firingStart = start; // 3188 fire( memory ); // 3189 } // 3190 } // 3191 return this; // 3192 }, // 3193 // Remove a callback from the list // 3194 remove: function() { // 3195 if ( list ) { // 3196 jQuery.each( arguments, function( _, arg ) { // 3197 var index; // 3198 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { // 3199 list.splice( index, 1 ); // 3200 // Handle firing indexes // 3201 if ( firing ) { // 3202 if ( index <= firingLength ) { // 3203 firingLength--; // 3204 } // 3205 if ( index <= firingIndex ) { // 3206 firingIndex--; // 3207 } // 3208 } // 3209 } // 3210 }); // 3211 } // 3212 return this; // 3213 }, // 3214 // Check if a given callback is in the list. // 3215 // If no argument is given, return whether or not list has callbacks attached. // 3216 has: function( fn ) { // 3217 return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); // 3218 }, // 3219 // Remove all callbacks from the list // 3220 empty: function() { // 3221 list = []; // 3222 firingLength = 0; // 3223 return this; // 3224 }, // 3225 // Have the list do nothing anymore // 3226 disable: function() { // 3227 list = stack = memory = undefined; // 3228 return this; // 3229 }, // 3230 // Is it disabled? // 3231 disabled: function() { // 3232 return !list; // 3233 }, // 3234 // Lock the list in its current state // 3235 lock: function() { // 3236 stack = undefined; // 3237 if ( !memory ) { // 3238 self.disable(); // 3239 } // 3240 return this; // 3241 }, // 3242 // Is it locked? // 3243 locked: function() { // 3244 return !stack; // 3245 }, // 3246 // Call all callbacks with the given context and arguments // 3247 fireWith: function( context, args ) { // 3248 if ( list && ( !fired || stack ) ) { // 3249 args = args || []; // 3250 args = [ context, args.slice ? args.slice() : args ]; // 3251 if ( firing ) { // 3252 stack.push( args ); // 3253 } else { // 3254 fire( args ); // 3255 } // 3256 } // 3257 return this; // 3258 }, // 3259 // Call all the callbacks with the given arguments // 3260 fire: function() { // 3261 self.fireWith( this, arguments ); // 3262 return this; // 3263 }, // 3264 // To know if the callbacks have already been called at least once // 3265 fired: function() { // 3266 return !!fired; // 3267 } // 3268 }; // 3269 // 3270 return self; // 3271 }; // 3272 // 3273 // 3274 jQuery.extend({ // 3275 // 3276 Deferred: function( func ) { // 3277 var tuples = [ // 3278 // action, add listener, listener list, final state // 3279 [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], // 3280 [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], // 3281 [ "notify", "progress", jQuery.Callbacks("memory") ] // 3282 ], // 3283 state = "pending", // 3284 promise = { // 3285 state: function() { // 3286 return state; // 3287 }, // 3288 always: function() { // 3289 deferred.done( arguments ).fail( arguments ); // 3290 return this; // 3291 }, // 3292 then: function( /* fnDone, fnFail, fnProgress */ ) { // 3293 var fns = arguments; // 3294 return jQuery.Deferred(function( newDefer ) { // 3295 jQuery.each( tuples, function( i, tuple ) { // 3296 var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; // 3297 // deferred[ done | fail | progress ] for forwarding actions to newDefer // 3298 deferred[ tuple[1] ](function() { // 3299 var returned = fn && fn.apply( this, arguments ); // 3300 if ( returned && jQuery.isFunction( returned.promise ) ) { // 3301 returned.promise() // 3302 .done( newDefer.resolve ) // 3303 .fail( newDefer.reject ) // 3304 .progress( newDefer.notify ); // 3305 } else { // 3306 newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } // 3308 }); // 3309 }); // 3310 fns = null; // 3311 }).promise(); // 3312 }, // 3313 // Get a promise for this deferred // 3314 // If obj is provided, the promise aspect is added to the object // 3315 promise: function( obj ) { // 3316 return obj != null ? jQuery.extend( obj, promise ) : promise; // 3317 } // 3318 }, // 3319 deferred = {}; // 3320 // 3321 // Keep pipe for back-compat // 3322 promise.pipe = promise.then; // 3323 // 3324 // Add list-specific methods // 3325 jQuery.each( tuples, function( i, tuple ) { // 3326 var list = tuple[ 2 ], // 3327 stateString = tuple[ 3 ]; // 3328 // 3329 // promise[ done | fail | progress ] = list.add // 3330 promise[ tuple[1] ] = list.add; // 3331 // 3332 // Handle state // 3333 if ( stateString ) { // 3334 list.add(function() { // 3335 // state = [ resolved | rejected ] // 3336 state = stateString; // 3337 // 3338 // [ reject_list | resolve_list ].disable; progress_list.lock // 3339 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); // 3340 } // 3341 // 3342 // deferred[ resolve | reject | notify ] // 3343 deferred[ tuple[0] ] = function() { // 3344 deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); // 3345 return this; // 3346 }; // 3347 deferred[ tuple[0] + "With" ] = list.fireWith; // 3348 }); // 3349 // 3350 // Make the deferred a promise // 3351 promise.promise( deferred ); // 3352 // 3353 // Call given func if any // 3354 if ( func ) { // 3355 func.call( deferred, deferred ); // 3356 } // 3357 // 3358 // All done! // 3359 return deferred; // 3360 }, // 3361 // 3362 // Deferred helper // 3363 when: function( subordinate /* , ..., subordinateN */ ) { // 3364 var i = 0, // 3365 resolveValues = slice.call( arguments ), // 3366 length = resolveValues.length, // 3367 // 3368 // the count of uncompleted subordinates // 3369 remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, // 3370 // 3371 // the master Deferred. If resolveValues consist of only a single Deferred, just use that. // 3372 deferred = remaining === 1 ? subordinate : jQuery.Deferred(), // 3373 // 3374 // Update function for both resolve and progress values // 3375 updateFunc = function( i, contexts, values ) { // 3376 return function( value ) { // 3377 contexts[ i ] = this; // 3378 values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; // 3379 if ( values === progressValues ) { // 3380 deferred.notifyWith( contexts, values ); // 3381 // 3382 } else if ( !(--remaining) ) { // 3383 deferred.resolveWith( contexts, values ); // 3384 } // 3385 }; // 3386 }, // 3387 // 3388 progressValues, progressContexts, resolveContexts; // 3389 // 3390 // add listeners to Deferred subordinates; treat others as resolved // 3391 if ( length > 1 ) { // 3392 progressValues = new Array( length ); // 3393 progressContexts = new Array( length ); // 3394 resolveContexts = new Array( length ); // 3395 for ( ; i < length; i++ ) { // 3396 if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { // 3397 resolveValues[ i ].promise() // 3398 .done( updateFunc( i, resolveContexts, resolveValues ) ) // 3399 .fail( deferred.reject ) // 3400 .progress( updateFunc( i, progressContexts, progressValues ) ); // 3401 } else { // 3402 --remaining; // 3403 } // 3404 } // 3405 } // 3406 // 3407 // if we're not waiting on anything, resolve the master // 3408 if ( !remaining ) { // 3409 deferred.resolveWith( resolveContexts, resolveValues ); // 3410 } // 3411 // 3412 return deferred.promise(); // 3413 } // 3414 }); // 3415 // 3416 // 3417 // The deferred used on DOM ready // 3418 var readyList; // 3419 // 3420 jQuery.fn.ready = function( fn ) { // 3421 // Add the callback // 3422 jQuery.ready.promise().done( fn ); // 3423 // 3424 return this; // 3425 }; // 3426 // 3427 jQuery.extend({ // 3428 // Is the DOM ready to be used? Set to true once it occurs. // 3429 isReady: false, // 3430 // 3431 // A counter to track how many items to wait for before // 3432 // the ready event fires. See #6781 // 3433 readyWait: 1, // 3434 // 3435 // Hold (or release) the ready event // 3436 holdReady: function( hold ) { // 3437 if ( hold ) { // 3438 jQuery.readyWait++; // 3439 } else { // 3440 jQuery.ready( true ); // 3441 } // 3442 }, // 3443 // 3444 // Handle when the DOM is ready // 3445 ready: function( wait ) { // 3446 // 3447 // Abort if there are pending holds or we're already ready // 3448 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { // 3449 return; // 3450 } // 3451 // 3452 // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). // 3453 if ( !document.body ) { // 3454 return setTimeout( jQuery.ready ); // 3455 } // 3456 // 3457 // Remember that the DOM is ready // 3458 jQuery.isReady = true; // 3459 // 3460 // If a normal DOM Ready event fired, decrement, and wait if need be // 3461 if ( wait !== true && --jQuery.readyWait > 0 ) { // 3462 return; // 3463 } // 3464 // 3465 // If there are functions bound, to execute // 3466 readyList.resolveWith( document, [ jQuery ] ); // 3467 // 3468 // Trigger any bound ready events // 3469 if ( jQuery.fn.triggerHandler ) { // 3470 jQuery( document ).triggerHandler( "ready" ); // 3471 jQuery( document ).off( "ready" ); // 3472 } // 3473 } // 3474 }); // 3475 // 3476 /** // 3477 * Clean-up method for dom ready events // 3478 */ // 3479 function detach() { // 3480 if ( document.addEventListener ) { // 3481 document.removeEventListener( "DOMContentLoaded", completed, false ); // 3482 window.removeEventListener( "load", completed, false ); // 3483 // 3484 } else { // 3485 document.detachEvent( "onreadystatechange", completed ); // 3486 window.detachEvent( "onload", completed ); // 3487 } // 3488 } // 3489 // 3490 /** // 3491 * The ready event handler and self cleanup method // 3492 */ // 3493 function completed() { // 3494 // readyState === "complete" is good enough for us to call the dom ready in oldIE // 3495 if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { // 3496 detach(); // 3497 jQuery.ready(); // 3498 } // 3499 } // 3500 // 3501 jQuery.ready.promise = function( obj ) { // 3502 if ( !readyList ) { // 3503 // 3504 readyList = jQuery.Deferred(); // 3505 // 3506 // Catch cases where $(document).ready() is called after the browser event has already occurred. // 3507 // we once tried to use readyState "interactive" here, but it caused issues like the one // 3508 // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 // 3509 if ( document.readyState === "complete" ) { // 3510 // Handle it asynchronously to allow scripts the opportunity to delay ready // 3511 setTimeout( jQuery.ready ); // 3512 // 3513 // Standards-based browsers support DOMContentLoaded // 3514 } else if ( document.addEventListener ) { // 3515 // Use the handy event callback // 3516 document.addEventListener( "DOMContentLoaded", completed, false ); // 3517 // 3518 // A fallback to window.onload, that will always work // 3519 window.addEventListener( "load", completed, false ); // 3520 // 3521 // If IE event model is used // 3522 } else { // 3523 // Ensure firing before onload, maybe late but safe also for iframes // 3524 document.attachEvent( "onreadystatechange", completed ); // 3525 // 3526 // A fallback to window.onload, that will always work // 3527 window.attachEvent( "onload", completed ); // 3528 // 3529 // If IE and not a frame // 3530 // continually check to see if the document is ready // 3531 var top = false; // 3532 // 3533 try { // 3534 top = window.frameElement == null && document.documentElement; // 3535 } catch(e) {} // 3536 // 3537 if ( top && top.doScroll ) { // 3538 (function doScrollCheck() { // 3539 if ( !jQuery.isReady ) { // 3540 // 3541 try { // 3542 // Use the trick by Diego Perini // 3543 // http://javascript.nwbox.com/IEContentLoaded/ // 3544 top.doScroll("left"); // 3545 } catch(e) { // 3546 return setTimeout( doScrollCheck, 50 ); // 3547 } // 3548 // 3549 // detach all dom ready events // 3550 detach(); // 3551 // 3552 // and execute any waiting functions // 3553 jQuery.ready(); // 3554 } // 3555 })(); // 3556 } // 3557 } // 3558 } // 3559 return readyList.promise( obj ); // 3560 }; // 3561 // 3562 // 3563 var strundefined = typeof undefined; // 3564 // 3565 // 3566 // 3567 // Support: IE<9 // 3568 // Iteration over object's inherited properties before its own // 3569 var i; // 3570 for ( i in jQuery( support ) ) { // 3571 break; // 3572 } // 3573 support.ownLast = i !== "0"; // 3574 // 3575 // Note: most support tests are defined in their respective modules. // 3576 // false until the test is run // 3577 support.inlineBlockNeedsLayout = false; // 3578 // 3579 // Execute ASAP in case we need to set body.style.zoom // 3580 jQuery(function() { // 3581 // Minified: var a,b,c,d // 3582 var val, div, body, container; // 3583 // 3584 body = document.getElementsByTagName( "body" )[ 0 ]; // 3585 if ( !body || !body.style ) { // 3586 // Return for frameset docs that don't have a body // 3587 return; // 3588 } // 3589 // 3590 // Setup // 3591 div = document.createElement( "div" ); // 3592 container = document.createElement( "div" ); // 3593 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; // 3594 body.appendChild( container ).appendChild( div ); // 3595 // 3596 if ( typeof div.style.zoom !== strundefined ) { // 3597 // Support: IE<8 // 3598 // Check if natively block-level elements act like inline-block // 3599 // elements when setting their display to 'inline' and giving // 3600 // them layout // 3601 div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; // 3602 // 3603 support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; // 3604 if ( val ) { // 3605 // Prevent IE 6 from affecting layout for positioned elements #11048 // 3606 // Prevent IE from shrinking the body in IE 7 mode #12869 // 3607 // Support: IE<8 // 3608 body.style.zoom = 1; // 3609 } // 3610 } // 3611 // 3612 body.removeChild( container ); // 3613 }); // 3614 // 3615 // 3616 // 3617 // 3618 (function() { // 3619 var div = document.createElement( "div" ); // 3620 // 3621 // Execute the test only if not already executed in another module. // 3622 if (support.deleteExpando == null) { // 3623 // Support: IE<9 // 3624 support.deleteExpando = true; // 3625 try { // 3626 delete div.test; // 3627 } catch( e ) { // 3628 support.deleteExpando = false; // 3629 } // 3630 } // 3631 // 3632 // Null elements to avoid leaks in IE. // 3633 div = null; // 3634 })(); // 3635 // 3636 // 3637 /** // 3638 * Determines whether an object can have data // 3639 */ // 3640 jQuery.acceptData = function( elem ) { // 3641 var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ], // 3642 nodeType = +elem.nodeType || 1; // 3643 // 3644 // Do not set data on non-element DOM nodes because it will not be cleared (#8335). // 3645 return nodeType !== 1 && nodeType !== 9 ? // 3646 false : // 3647 // 3648 // Nodes accept data unless otherwise specified; rejection can be conditional // 3649 !noData || noData !== true && elem.getAttribute("classid") === noData; // 3650 }; // 3651 // 3652 // 3653 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, // 3654 rmultiDash = /([A-Z])/g; // 3655 // 3656 function dataAttr( elem, key, data ) { // 3657 // If nothing was found internally, try to fetch any // 3658 // data from the HTML5 data-* attribute // 3659 if ( data === undefined && elem.nodeType === 1 ) { // 3660 // 3661 var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); // 3662 // 3663 data = elem.getAttribute( name ); // 3664 // 3665 if ( typeof data === "string" ) { // 3666 try { // 3667 data = data === "true" ? true : // 3668 data === "false" ? false : // 3669 data === "null" ? null : // 3670 // Only convert to a number if it doesn't change the string // 3671 +data + "" === data ? +data : // 3672 rbrace.test( data ) ? jQuery.parseJSON( data ) : // 3673 data; // 3674 } catch( e ) {} // 3675 // 3676 // Make sure we set the data so it isn't changed later // 3677 jQuery.data( elem, key, data ); // 3678 // 3679 } else { // 3680 data = undefined; // 3681 } // 3682 } // 3683 // 3684 return data; // 3685 } // 3686 // 3687 // checks a cache object for emptiness // 3688 function isEmptyDataObject( obj ) { // 3689 var name; // 3690 for ( name in obj ) { // 3691 // 3692 // if the public data object is empty, the private is still empty // 3693 if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { // 3694 continue; // 3695 } // 3696 if ( name !== "toJSON" ) { // 3697 return false; // 3698 } // 3699 } // 3700 // 3701 return true; // 3702 } // 3703 // 3704 function internalData( elem, name, data, pvt /* Internal Use Only */ ) { // 3705 if ( !jQuery.acceptData( elem ) ) { // 3706 return; // 3707 } // 3708 // 3709 var ret, thisCache, // 3710 internalKey = jQuery.expando, // 3711 // 3712 // We have to handle DOM nodes and JS objects differently because IE6-7 // 3713 // can't GC object references properly across the DOM-JS boundary // 3714 isNode = elem.nodeType, // 3715 // 3716 // Only DOM nodes need the global jQuery cache; JS object data is // 3717 // attached directly to the object so GC can occur automatically // 3718 cache = isNode ? jQuery.cache : elem, // 3719 // 3720 // Only defining an ID for JS objects if its cache already exists allows // 3721 // the code to shortcut on the same path as a DOM node with no cache // 3722 id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; // 3723 // 3724 // Avoid doing any more work than we need to when trying to get data on an // 3725 // object that has no data at all // 3726 if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { // 3727 return; // 3728 } // 3729 // 3730 if ( !id ) { // 3731 // Only DOM nodes need a new unique ID for each element since their data // 3732 // ends up in the global cache // 3733 if ( isNode ) { // 3734 id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; // 3735 } else { // 3736 id = internalKey; // 3737 } // 3738 } // 3739 // 3740 if ( !cache[ id ] ) { // 3741 // Avoid exposing jQuery metadata on plain JS objects when the object // 3742 // is serialized using JSON.stringify // 3743 cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; // 3744 } // 3745 // 3746 // An object can be passed to jQuery.data instead of a key/value pair; this gets // 3747 // shallow copied over onto the existing cache // 3748 if ( typeof name === "object" || typeof name === "function" ) { // 3749 if ( pvt ) { // 3750 cache[ id ] = jQuery.extend( cache[ id ], name ); // 3751 } else { // 3752 cache[ id ].data = jQuery.extend( cache[ id ].data, name ); // 3753 } // 3754 } // 3755 // 3756 thisCache = cache[ id ]; // 3757 // 3758 // jQuery data() is stored in a separate object inside the object's internal data // 3759 // cache in order to avoid key collisions between internal data and user-defined // 3760 // data. // 3761 if ( !pvt ) { // 3762 if ( !thisCache.data ) { // 3763 thisCache.data = {}; // 3764 } // 3765 // 3766 thisCache = thisCache.data; // 3767 } // 3768 // 3769 if ( data !== undefined ) { // 3770 thisCache[ jQuery.camelCase( name ) ] = data; // 3771 } // 3772 // 3773 // Check for both converted-to-camel and non-converted data property names // 3774 // If a data property was specified // 3775 if ( typeof name === "string" ) { // 3776 // 3777 // First Try to find as-is property data // 3778 ret = thisCache[ name ]; // 3779 // 3780 // Test for null|undefined property data // 3781 if ( ret == null ) { // 3782 // 3783 // Try to find the camelCased property // 3784 ret = thisCache[ jQuery.camelCase( name ) ]; // 3785 } // 3786 } else { // 3787 ret = thisCache; // 3788 } // 3789 // 3790 return ret; // 3791 } // 3792 // 3793 function internalRemoveData( elem, name, pvt ) { // 3794 if ( !jQuery.acceptData( elem ) ) { // 3795 return; // 3796 } // 3797 // 3798 var thisCache, i, // 3799 isNode = elem.nodeType, // 3800 // 3801 // See jQuery.data for more information // 3802 cache = isNode ? jQuery.cache : elem, // 3803 id = isNode ? elem[ jQuery.expando ] : jQuery.expando; // 3804 // 3805 // If there is already no cache entry for this object, there is no // 3806 // purpose in continuing // 3807 if ( !cache[ id ] ) { // 3808 return; // 3809 } // 3810 // 3811 if ( name ) { // 3812 // 3813 thisCache = pvt ? cache[ id ] : cache[ id ].data; // 3814 // 3815 if ( thisCache ) { // 3816 // 3817 // Support array or space separated string names for data keys // 3818 if ( !jQuery.isArray( name ) ) { // 3819 // 3820 // try the string as a key before any manipulation // 3821 if ( name in thisCache ) { // 3822 name = [ name ]; // 3823 } else { // 3824 // 3825 // split the camel cased version by spaces unless a key with the spaces exists // 3826 name = jQuery.camelCase( name ); // 3827 if ( name in thisCache ) { // 3828 name = [ name ]; // 3829 } else { // 3830 name = name.split(" "); // 3831 } // 3832 } // 3833 } else { // 3834 // If "name" is an array of keys... // 3835 // When data is initially created, via ("key", "val") signature, // 3836 // keys will be converted to camelCase. // 3837 // Since there is no way to tell _how_ a key was added, remove // 3838 // both plain key and camelCase key. #12786 // 3839 // This will only penalize the array argument path. // 3840 name = name.concat( jQuery.map( name, jQuery.camelCase ) ); // 3841 } // 3842 // 3843 i = name.length; // 3844 while ( i-- ) { // 3845 delete thisCache[ name[i] ]; // 3846 } // 3847 // 3848 // If there is no data left in the cache, we want to continue // 3849 // and let the cache object itself get destroyed // 3850 if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { // 3851 return; // 3852 } // 3853 } // 3854 } // 3855 // 3856 // See jQuery.data for more information // 3857 if ( !pvt ) { // 3858 delete cache[ id ].data; // 3859 // 3860 // Don't destroy the parent cache unless the internal data object // 3861 // had been the only thing left in it // 3862 if ( !isEmptyDataObject( cache[ id ] ) ) { // 3863 return; // 3864 } // 3865 } // 3866 // 3867 // Destroy the cache // 3868 if ( isNode ) { // 3869 jQuery.cleanData( [ elem ], true ); // 3870 // 3871 // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) // 3872 /* jshint eqeqeq: false */ // 3873 } else if ( support.deleteExpando || cache != cache.window ) { // 3874 /* jshint eqeqeq: true */ // 3875 delete cache[ id ]; // 3876 // 3877 // When all else fails, null // 3878 } else { // 3879 cache[ id ] = null; // 3880 } // 3881 } // 3882 // 3883 jQuery.extend({ // 3884 cache: {}, // 3885 // 3886 // The following elements (space-suffixed to avoid Object.prototype collisions) // 3887 // throw uncatchable exceptions if you attempt to set expando properties // 3888 noData: { // 3889 "applet ": true, // 3890 "embed ": true, // 3891 // ...but Flash objects (which have this classid) *can* handle expandos // 3892 "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" // 3893 }, // 3894 // 3895 hasData: function( elem ) { // 3896 elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; // 3897 return !!elem && !isEmptyDataObject( elem ); // 3898 }, // 3899 // 3900 data: function( elem, name, data ) { // 3901 return internalData( elem, name, data ); // 3902 }, // 3903 // 3904 removeData: function( elem, name ) { // 3905 return internalRemoveData( elem, name ); // 3906 }, // 3907 // 3908 // For internal use only. // 3909 _data: function( elem, name, data ) { // 3910 return internalData( elem, name, data, true ); // 3911 }, // 3912 // 3913 _removeData: function( elem, name ) { // 3914 return internalRemoveData( elem, name, true ); // 3915 } // 3916 }); // 3917 // 3918 jQuery.fn.extend({ // 3919 data: function( key, value ) { // 3920 var i, name, data, // 3921 elem = this[0], // 3922 attrs = elem && elem.attributes; // 3923 // 3924 // Special expections of .data basically thwart jQuery.access, // 3925 // so implement the relevant behavior ourselves // 3926 // 3927 // Gets all values // 3928 if ( key === undefined ) { // 3929 if ( this.length ) { // 3930 data = jQuery.data( elem ); // 3931 // 3932 if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { // 3933 i = attrs.length; // 3934 while ( i-- ) { // 3935 // 3936 // Support: IE11+ // 3937 // The attrs elements can be null (#14894) // 3938 if ( attrs[ i ] ) { // 3939 name = attrs[ i ].name; // 3940 if ( name.indexOf( "data-" ) === 0 ) { // 3941 name = jQuery.camelCase( name.slice(5) ); // 3942 dataAttr( elem, name, data[ name ] ); // 3943 } // 3944 } // 3945 } // 3946 jQuery._data( elem, "parsedAttrs", true ); // 3947 } // 3948 } // 3949 // 3950 return data; // 3951 } // 3952 // 3953 // Sets multiple values // 3954 if ( typeof key === "object" ) { // 3955 return this.each(function() { // 3956 jQuery.data( this, key ); // 3957 }); // 3958 } // 3959 // 3960 return arguments.length > 1 ? // 3961 // 3962 // Sets one value // 3963 this.each(function() { // 3964 jQuery.data( this, key, value ); // 3965 }) : // 3966 // 3967 // Gets one value // 3968 // Try to fetch any internally stored data first // 3969 elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; // 3970 }, // 3971 // 3972 removeData: function( key ) { // 3973 return this.each(function() { // 3974 jQuery.removeData( this, key ); // 3975 }); // 3976 } // 3977 }); // 3978 // 3979 // 3980 jQuery.extend({ // 3981 queue: function( elem, type, data ) { // 3982 var queue; // 3983 // 3984 if ( elem ) { // 3985 type = ( type || "fx" ) + "queue"; // 3986 queue = jQuery._data( elem, type ); // 3987 // 3988 // Speed up dequeue by getting out quickly if this is just a lookup // 3989 if ( data ) { // 3990 if ( !queue || jQuery.isArray(data) ) { // 3991 queue = jQuery._data( elem, type, jQuery.makeArray(data) ); // 3992 } else { // 3993 queue.push( data ); // 3994 } // 3995 } // 3996 return queue || []; // 3997 } // 3998 }, // 3999 // 4000 dequeue: function( elem, type ) { // 4001 type = type || "fx"; // 4002 // 4003 var queue = jQuery.queue( elem, type ), // 4004 startLength = queue.length, // 4005 fn = queue.shift(), // 4006 hooks = jQuery._queueHooks( elem, type ), // 4007 next = function() { // 4008 jQuery.dequeue( elem, type ); // 4009 }; // 4010 // 4011 // If the fx queue is dequeued, always remove the progress sentinel // 4012 if ( fn === "inprogress" ) { // 4013 fn = queue.shift(); // 4014 startLength--; // 4015 } // 4016 // 4017 if ( fn ) { // 4018 // 4019 // Add a progress sentinel to prevent the fx queue from being // 4020 // automatically dequeued // 4021 if ( type === "fx" ) { // 4022 queue.unshift( "inprogress" ); // 4023 } // 4024 // 4025 // clear up the last queue stop function // 4026 delete hooks.stop; // 4027 fn.call( elem, next, hooks ); // 4028 } // 4029 // 4030 if ( !startLength && hooks ) { // 4031 hooks.empty.fire(); // 4032 } // 4033 }, // 4034 // 4035 // not intended for public consumption - generates a queueHooks object, or returns the current one // 4036 _queueHooks: function( elem, type ) { // 4037 var key = type + "queueHooks"; // 4038 return jQuery._data( elem, key ) || jQuery._data( elem, key, { // 4039 empty: jQuery.Callbacks("once memory").add(function() { // 4040 jQuery._removeData( elem, type + "queue" ); // 4041 jQuery._removeData( elem, key ); // 4042 }) // 4043 }); // 4044 } // 4045 }); // 4046 // 4047 jQuery.fn.extend({ // 4048 queue: function( type, data ) { // 4049 var setter = 2; // 4050 // 4051 if ( typeof type !== "string" ) { // 4052 data = type; // 4053 type = "fx"; // 4054 setter--; // 4055 } // 4056 // 4057 if ( arguments.length < setter ) { // 4058 return jQuery.queue( this[0], type ); // 4059 } // 4060 // 4061 return data === undefined ? // 4062 this : // 4063 this.each(function() { // 4064 var queue = jQuery.queue( this, type, data ); // 4065 // 4066 // ensure a hooks for this queue // 4067 jQuery._queueHooks( this, type ); // 4068 // 4069 if ( type === "fx" && queue[0] !== "inprogress" ) { // 4070 jQuery.dequeue( this, type ); // 4071 } // 4072 }); // 4073 }, // 4074 dequeue: function( type ) { // 4075 return this.each(function() { // 4076 jQuery.dequeue( this, type ); // 4077 }); // 4078 }, // 4079 clearQueue: function( type ) { // 4080 return this.queue( type || "fx", [] ); // 4081 }, // 4082 // Get a promise resolved when queues of a certain type // 4083 // are emptied (fx is the type by default) // 4084 promise: function( type, obj ) { // 4085 var tmp, // 4086 count = 1, // 4087 defer = jQuery.Deferred(), // 4088 elements = this, // 4089 i = this.length, // 4090 resolve = function() { // 4091 if ( !( --count ) ) { // 4092 defer.resolveWith( elements, [ elements ] ); // 4093 } // 4094 }; // 4095 // 4096 if ( typeof type !== "string" ) { // 4097 obj = type; // 4098 type = undefined; // 4099 } // 4100 type = type || "fx"; // 4101 // 4102 while ( i-- ) { // 4103 tmp = jQuery._data( elements[ i ], type + "queueHooks" ); // 4104 if ( tmp && tmp.empty ) { // 4105 count++; // 4106 tmp.empty.add( resolve ); // 4107 } // 4108 } // 4109 resolve(); // 4110 return defer.promise( obj ); // 4111 } // 4112 }); // 4113 var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; // 4114 // 4115 var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; // 4116 // 4117 var isHidden = function( elem, el ) { // 4118 // isHidden might be called from jQuery#filter function; // 4119 // in that case, element will be second argument // 4120 elem = el || elem; // 4121 return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); // 4122 }; // 4123 // 4124 // 4125 // 4126 // Multifunctional method to get and set values of a collection // 4127 // The value/s can optionally be executed if it's a function // 4128 var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { // 4129 var i = 0, // 4130 length = elems.length, // 4131 bulk = key == null; // 4132 // 4133 // Sets many values // 4134 if ( jQuery.type( key ) === "object" ) { // 4135 chainable = true; // 4136 for ( i in key ) { // 4137 jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); // 4138 } // 4139 // 4140 // Sets one value // 4141 } else if ( value !== undefined ) { // 4142 chainable = true; // 4143 // 4144 if ( !jQuery.isFunction( value ) ) { // 4145 raw = true; // 4146 } // 4147 // 4148 if ( bulk ) { // 4149 // Bulk operations run against the entire set // 4150 if ( raw ) { // 4151 fn.call( elems, value ); // 4152 fn = null; // 4153 // 4154 // ...except when executing function values // 4155 } else { // 4156 bulk = fn; // 4157 fn = function( elem, key, value ) { // 4158 return bulk.call( jQuery( elem ), value ); // 4159 }; // 4160 } // 4161 } // 4162 // 4163 if ( fn ) { // 4164 for ( ; i < length; i++ ) { // 4165 fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); // 4166 } // 4167 } // 4168 } // 4169 // 4170 return chainable ? // 4171 elems : // 4172 // 4173 // Gets // 4174 bulk ? // 4175 fn.call( elems ) : // 4176 length ? fn( elems[0], key ) : emptyGet; // 4177 }; // 4178 var rcheckableType = (/^(?:checkbox|radio)$/i); // 4179 // 4180 // 4181 // 4182 (function() { // 4183 // Minified: var a,b,c // 4184 var input = document.createElement( "input" ), // 4185 div = document.createElement( "div" ), // 4186 fragment = document.createDocumentFragment(); // 4187 // 4188 // Setup // 4189 div.innerHTML = "
a"; // 4190 // 4191 // IE strips leading whitespace when .innerHTML is used // 4192 support.leadingWhitespace = div.firstChild.nodeType === 3; // 4193 // 4194 // Make sure that tbody elements aren't automatically inserted // 4195 // IE will insert them into empty tables // 4196 support.tbody = !div.getElementsByTagName( "tbody" ).length; // 4197 // 4198 // Make sure that link elements get serialized correctly by innerHTML // 4199 // This requires a wrapper element in IE // 4200 support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; // 4201 // 4202 // Makes sure cloning an html5 element does not cause problems // 4203 // Where outerHTML is undefined, this still works // 4204 support.html5Clone = // 4205 document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav>"; // 4206 // 4207 // Check if a disconnected checkbox will retain its checked // 4208 // value of true after appended to the DOM (IE6/7) // 4209 input.type = "checkbox"; // 4210 input.checked = true; // 4211 fragment.appendChild( input ); // 4212 support.appendChecked = input.checked; // 4213 // 4214 // Make sure textarea (and checkbox) defaultValue is properly cloned // 4215 // Support: IE6-IE11+ // 4216 div.innerHTML = ""; // 4217 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; // 4218 // 4219 // #11217 - WebKit loses check when the name is after the checked attribute // 4220 fragment.appendChild( div ); // 4221 div.innerHTML = ""; // 4222 // 4223 // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 // 4224 // old WebKit doesn't clone checked state correctly in fragments // 4225 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; // 4226 // 4227 // Support: IE<9 // 4228 // Opera does not clone events (and typeof div.attachEvent === undefined). // 4229 // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() // 4230 support.noCloneEvent = true; // 4231 if ( div.attachEvent ) { // 4232 div.attachEvent( "onclick", function() { // 4233 support.noCloneEvent = false; // 4234 }); // 4235 // 4236 div.cloneNode( true ).click(); // 4237 } // 4238 // 4239 // Execute the test only if not already executed in another module. // 4240 if (support.deleteExpando == null) { // 4241 // Support: IE<9 // 4242 support.deleteExpando = true; // 4243 try { // 4244 delete div.test; // 4245 } catch( e ) { // 4246 support.deleteExpando = false; // 4247 } // 4248 } // 4249 })(); // 4250 // 4251 // 4252 (function() { // 4253 var i, eventName, // 4254 div = document.createElement( "div" ); // 4255 // 4256 // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event) // 4257 for ( i in { submit: true, change: true, focusin: true }) { // 4258 eventName = "on" + i; // 4259 // 4260 if ( !(support[ i + "Bubbles" ] = eventName in window) ) { // 4261 // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) // 4262 div.setAttribute( eventName, "t" ); // 4263 support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false; // 4264 } // 4265 } // 4266 // 4267 // Null elements to avoid leaks in IE. // 4268 div = null; // 4269 })(); // 4270 // 4271 // 4272 var rformElems = /^(?:input|select|textarea)$/i, // 4273 rkeyEvent = /^key/, // 4274 rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, // 4275 rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, // 4276 rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; // 4277 // 4278 function returnTrue() { // 4279 return true; // 4280 } // 4281 // 4282 function returnFalse() { // 4283 return false; // 4284 } // 4285 // 4286 function safeActiveElement() { // 4287 try { // 4288 return document.activeElement; // 4289 } catch ( err ) { } // 4290 } // 4291 // 4292 /* // 4293 * Helper functions for managing events -- not part of the public interface. // 4294 * Props to Dean Edwards' addEvent library for many of the ideas. // 4295 */ // 4296 jQuery.event = { // 4297 // 4298 global: {}, // 4299 // 4300 add: function( elem, types, handler, data, selector ) { // 4301 var tmp, events, t, handleObjIn, // 4302 special, eventHandle, handleObj, // 4303 handlers, type, namespaces, origType, // 4304 elemData = jQuery._data( elem ); // 4305 // 4306 // Don't attach events to noData or text/comment nodes (but allow plain objects) // 4307 if ( !elemData ) { // 4308 return; // 4309 } // 4310 // 4311 // Caller can pass in an object of custom data in lieu of the handler // 4312 if ( handler.handler ) { // 4313 handleObjIn = handler; // 4314 handler = handleObjIn.handler; // 4315 selector = handleObjIn.selector; // 4316 } // 4317 // 4318 // Make sure that the handler has a unique ID, used to find/remove it later // 4319 if ( !handler.guid ) { // 4320 handler.guid = jQuery.guid++; // 4321 } // 4322 // 4323 // Init the element's event structure and main handler, if this is the first // 4324 if ( !(events = elemData.events) ) { // 4325 events = elemData.events = {}; // 4326 } // 4327 if ( !(eventHandle = elemData.handle) ) { // 4328 eventHandle = elemData.handle = function( e ) { // 4329 // Discard the second event of a jQuery.event.trigger() and // 4330 // when an event is called after a page has unloaded // 4331 return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ? // 4332 jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : // 4333 undefined; // 4334 }; // 4335 // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events // 4336 eventHandle.elem = elem; // 4337 } // 4338 // 4339 // Handle multiple events separated by a space // 4340 types = ( types || "" ).match( rnotwhite ) || [ "" ]; // 4341 t = types.length; // 4342 while ( t-- ) { // 4343 tmp = rtypenamespace.exec( types[t] ) || []; // 4344 type = origType = tmp[1]; // 4345 namespaces = ( tmp[2] || "" ).split( "." ).sort(); // 4346 // 4347 // There *must* be a type, no attaching namespace-only handlers // 4348 if ( !type ) { // 4349 continue; // 4350 } // 4351 // 4352 // If event changes its type, use the special event handlers for the changed type // 4353 special = jQuery.event.special[ type ] || {}; // 4354 // 4355 // If selector defined, determine special event api type, otherwise given type // 4356 type = ( selector ? special.delegateType : special.bindType ) || type; // 4357 // 4358 // Update special based on newly reset type // 4359 special = jQuery.event.special[ type ] || {}; // 4360 // 4361 // handleObj is passed to all event handlers // 4362 handleObj = jQuery.extend({ // 4363 type: type, // 4364 origType: origType, // 4365 data: data, // 4366 handler: handler, // 4367 guid: handler.guid, // 4368 selector: selector, // 4369 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), // 4370 namespace: namespaces.join(".") // 4371 }, handleObjIn ); // 4372 // 4373 // Init the event handler queue if we're the first // 4374 if ( !(handlers = events[ type ]) ) { // 4375 handlers = events[ type ] = []; // 4376 handlers.delegateCount = 0; // 4377 // 4378 // Only use addEventListener/attachEvent if the special events handler returns false // 4379 if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { // 4380 // Bind the global event handler to the element // 4381 if ( elem.addEventListener ) { // 4382 elem.addEventListener( type, eventHandle, false ); // 4383 // 4384 } else if ( elem.attachEvent ) { // 4385 elem.attachEvent( "on" + type, eventHandle ); // 4386 } // 4387 } // 4388 } // 4389 // 4390 if ( special.add ) { // 4391 special.add.call( elem, handleObj ); // 4392 // 4393 if ( !handleObj.handler.guid ) { // 4394 handleObj.handler.guid = handler.guid; // 4395 } // 4396 } // 4397 // 4398 // Add to the element's handler list, delegates in front // 4399 if ( selector ) { // 4400 handlers.splice( handlers.delegateCount++, 0, handleObj ); // 4401 } else { // 4402 handlers.push( handleObj ); // 4403 } // 4404 // 4405 // Keep track of which events have ever been used, for event optimization // 4406 jQuery.event.global[ type ] = true; // 4407 } // 4408 // 4409 // Nullify elem to prevent memory leaks in IE // 4410 elem = null; // 4411 }, // 4412 // 4413 // Detach an event or set of events from an element // 4414 remove: function( elem, types, handler, selector, mappedTypes ) { // 4415 var j, handleObj, tmp, // 4416 origCount, t, events, // 4417 special, handlers, type, // 4418 namespaces, origType, // 4419 elemData = jQuery.hasData( elem ) && jQuery._data( elem ); // 4420 // 4421 if ( !elemData || !(events = elemData.events) ) { // 4422 return; // 4423 } // 4424 // 4425 // Once for each type.namespace in types; type may be omitted // 4426 types = ( types || "" ).match( rnotwhite ) || [ "" ]; // 4427 t = types.length; // 4428 while ( t-- ) { // 4429 tmp = rtypenamespace.exec( types[t] ) || []; // 4430 type = origType = tmp[1]; // 4431 namespaces = ( tmp[2] || "" ).split( "." ).sort(); // 4432 // 4433 // Unbind all events (on this namespace, if provided) for the element // 4434 if ( !type ) { // 4435 for ( type in events ) { // 4436 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); // 4437 } // 4438 continue; // 4439 } // 4440 // 4441 special = jQuery.event.special[ type ] || {}; // 4442 type = ( selector ? special.delegateType : special.bindType ) || type; // 4443 handlers = events[ type ] || []; // 4444 tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); // 4445 // 4446 // Remove matching events // 4447 origCount = j = handlers.length; // 4448 while ( j-- ) { // 4449 handleObj = handlers[ j ]; // 4450 // 4451 if ( ( mappedTypes || origType === handleObj.origType ) && // 4452 ( !handler || handler.guid === handleObj.guid ) && // 4453 ( !tmp || tmp.test( handleObj.namespace ) ) && // 4454 ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { // 4455 handlers.splice( j, 1 ); // 4456 // 4457 if ( handleObj.selector ) { // 4458 handlers.delegateCount--; // 4459 } // 4460 if ( special.remove ) { // 4461 special.remove.call( elem, handleObj ); // 4462 } // 4463 } // 4464 } // 4465 // 4466 // Remove generic event handler if we removed something and no more handlers exist // 4467 // (avoids potential for endless recursion during removal of special event handlers) // 4468 if ( origCount && !handlers.length ) { // 4469 if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { // 4470 jQuery.removeEvent( elem, type, elemData.handle ); // 4471 } // 4472 // 4473 delete events[ type ]; // 4474 } // 4475 } // 4476 // 4477 // Remove the expando if it's no longer used // 4478 if ( jQuery.isEmptyObject( events ) ) { // 4479 delete elemData.handle; // 4480 // 4481 // removeData also checks for emptiness and clears the expando if empty // 4482 // so use it instead of delete // 4483 jQuery._removeData( elem, "events" ); // 4484 } // 4485 }, // 4486 // 4487 trigger: function( event, data, elem, onlyHandlers ) { // 4488 var handle, ontype, cur, // 4489 bubbleType, special, tmp, i, // 4490 eventPath = [ elem || document ], // 4491 type = hasOwn.call( event, "type" ) ? event.type : event, // 4492 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; // 4493 // 4494 cur = tmp = elem = elem || document; // 4495 // 4496 // Don't do events on text and comment nodes // 4497 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { // 4498 return; // 4499 } // 4500 // 4501 // focus/blur morphs to focusin/out; ensure we're not firing them right now // 4502 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { // 4503 return; // 4504 } // 4505 // 4506 if ( type.indexOf(".") >= 0 ) { // 4507 // Namespaced trigger; create a regexp to match event type in handle() // 4508 namespaces = type.split("."); // 4509 type = namespaces.shift(); // 4510 namespaces.sort(); // 4511 } // 4512 ontype = type.indexOf(":") < 0 && "on" + type; // 4513 // 4514 // Caller can pass in a jQuery.Event object, Object, or just an event type string // 4515 event = event[ jQuery.expando ] ? // 4516 event : // 4517 new jQuery.Event( type, typeof event === "object" && event ); // 4518 // 4519 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) // 4520 event.isTrigger = onlyHandlers ? 2 : 3; // 4521 event.namespace = namespaces.join("."); // 4522 event.namespace_re = event.namespace ? // 4523 new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : // 4524 null; // 4525 // 4526 // Clean up the event in case it is being reused // 4527 event.result = undefined; // 4528 if ( !event.target ) { // 4529 event.target = elem; // 4530 } // 4531 // 4532 // Clone any incoming data and prepend the event, creating the handler arg list // 4533 data = data == null ? // 4534 [ event ] : // 4535 jQuery.makeArray( data, [ event ] ); // 4536 // 4537 // Allow special events to draw outside the lines // 4538 special = jQuery.event.special[ type ] || {}; // 4539 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { // 4540 return; // 4541 } // 4542 // 4543 // Determine event propagation path in advance, per W3C events spec (#9951) // 4544 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) // 4545 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { // 4546 // 4547 bubbleType = special.delegateType || type; // 4548 if ( !rfocusMorph.test( bubbleType + type ) ) { // 4549 cur = cur.parentNode; // 4550 } // 4551 for ( ; cur; cur = cur.parentNode ) { // 4552 eventPath.push( cur ); // 4553 tmp = cur; // 4554 } // 4555 // 4556 // Only add window if we got to document (e.g., not plain obj or detached DOM) // 4557 if ( tmp === (elem.ownerDocument || document) ) { // 4558 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); // 4559 } // 4560 } // 4561 // 4562 // Fire handlers on the event path // 4563 i = 0; // 4564 while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { // 4565 // 4566 event.type = i > 1 ? // 4567 bubbleType : // 4568 special.bindType || type; // 4569 // 4570 // jQuery handler // 4571 handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); // 4572 if ( handle ) { // 4573 handle.apply( cur, data ); // 4574 } // 4575 // 4576 // Native handler // 4577 handle = ontype && cur[ ontype ]; // 4578 if ( handle && handle.apply && jQuery.acceptData( cur ) ) { // 4579 event.result = handle.apply( cur, data ); // 4580 if ( event.result === false ) { // 4581 event.preventDefault(); // 4582 } // 4583 } // 4584 } // 4585 event.type = type; // 4586 // 4587 // If nobody prevented the default action, do it now // 4588 if ( !onlyHandlers && !event.isDefaultPrevented() ) { // 4589 // 4590 if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && // 4591 jQuery.acceptData( elem ) ) { // 4592 // 4593 // Call a native DOM method on the target with the same name name as the event. // 4594 // Can't use an .isFunction() check here because IE6/7 fails that test. // 4595 // Don't do default actions on window, that's where global variables be (#6170) // 4596 if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { // 4597 // 4598 // Don't re-trigger an onFOO event when we call its FOO() method // 4599 tmp = elem[ ontype ]; // 4600 // 4601 if ( tmp ) { // 4602 elem[ ontype ] = null; // 4603 } // 4604 // 4605 // Prevent re-triggering of the same event, since we already bubbled it above // 4606 jQuery.event.triggered = type; // 4607 try { // 4608 elem[ type ](); // 4609 } catch ( e ) { // 4610 // IE<9 dies on focus/blur to hidden element (#1486,#12518) // 4611 // only reproducible on winXP IE8 native, not IE9 in IE8 mode // 4612 } // 4613 jQuery.event.triggered = undefined; // 4614 // 4615 if ( tmp ) { // 4616 elem[ ontype ] = tmp; // 4617 } // 4618 } // 4619 } // 4620 } // 4621 // 4622 return event.result; // 4623 }, // 4624 // 4625 dispatch: function( event ) { // 4626 // 4627 // Make a writable jQuery.Event from the native event object // 4628 event = jQuery.event.fix( event ); // 4629 // 4630 var i, ret, handleObj, matched, j, // 4631 handlerQueue = [], // 4632 args = slice.call( arguments ), // 4633 handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], // 4634 special = jQuery.event.special[ event.type ] || {}; // 4635 // 4636 // Use the fix-ed jQuery.Event rather than the (read-only) native event // 4637 args[0] = event; // 4638 event.delegateTarget = this; // 4639 // 4640 // Call the preDispatch hook for the mapped type, and let it bail if desired // 4641 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { // 4642 return; // 4643 } // 4644 // 4645 // Determine handlers // 4646 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // 4647 // 4648 // Run delegates first; they may want to stop propagation beneath us // 4649 i = 0; // 4650 while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { // 4651 event.currentTarget = matched.elem; // 4652 // 4653 j = 0; // 4654 while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { // 4655 // 4656 // Triggered event must either 1) have no namespace, or // 4657 // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). // 4658 if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { // 4659 // 4660 event.handleObj = handleObj; // 4661 event.data = handleObj.data; // 4662 // 4663 ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) // 4664 .apply( matched.elem, args ); // 4665 // 4666 if ( ret !== undefined ) { // 4667 if ( (event.result = ret) === false ) { // 4668 event.preventDefault(); // 4669 event.stopPropagation(); // 4670 } // 4671 } // 4672 } // 4673 } // 4674 } // 4675 // 4676 // Call the postDispatch hook for the mapped type // 4677 if ( special.postDispatch ) { // 4678 special.postDispatch.call( this, event ); // 4679 } // 4680 // 4681 return event.result; // 4682 }, // 4683 // 4684 handlers: function( event, handlers ) { // 4685 var sel, handleObj, matches, i, // 4686 handlerQueue = [], // 4687 delegateCount = handlers.delegateCount, // 4688 cur = event.target; // 4689 // 4690 // Find delegate handlers // 4691 // Black-hole SVG instance trees (#13180) // 4692 // Avoid non-left-click bubbling in Firefox (#3861) // 4693 if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { // 4694 // 4695 /* jshint eqeqeq: false */ // 4696 for ( ; cur != this; cur = cur.parentNode || this ) { // 4697 /* jshint eqeqeq: true */ // 4698 // 4699 // Don't check non-elements (#13208) // 4700 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) // 4701 if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { // 4702 matches = []; // 4703 for ( i = 0; i < delegateCount; i++ ) { // 4704 handleObj = handlers[ i ]; // 4705 // 4706 // Don't conflict with Object.prototype properties (#13203) // 4707 sel = handleObj.selector + " "; // 4708 // 4709 if ( matches[ sel ] === undefined ) { // 4710 matches[ sel ] = handleObj.needsContext ? // 4711 jQuery( sel, this ).index( cur ) >= 0 : // 4712 jQuery.find( sel, this, null, [ cur ] ).length; // 4713 } // 4714 if ( matches[ sel ] ) { // 4715 matches.push( handleObj ); // 4716 } // 4717 } // 4718 if ( matches.length ) { // 4719 handlerQueue.push({ elem: cur, handlers: matches }); // 4720 } // 4721 } // 4722 } // 4723 } // 4724 // 4725 // Add the remaining (directly-bound) handlers // 4726 if ( delegateCount < handlers.length ) { // 4727 handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); // 4728 } // 4729 // 4730 return handlerQueue; // 4731 }, // 4732 // 4733 fix: function( event ) { // 4734 if ( event[ jQuery.expando ] ) { // 4735 return event; // 4736 } // 4737 // 4738 // Create a writable copy of the event object and normalize some properties // 4739 var i, prop, copy, // 4740 type = event.type, // 4741 originalEvent = event, // 4742 fixHook = this.fixHooks[ type ]; // 4743 // 4744 if ( !fixHook ) { // 4745 this.fixHooks[ type ] = fixHook = // 4746 rmouseEvent.test( type ) ? this.mouseHooks : // 4747 rkeyEvent.test( type ) ? this.keyHooks : // 4748 {}; // 4749 } // 4750 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; // 4751 // 4752 event = new jQuery.Event( originalEvent ); // 4753 // 4754 i = copy.length; // 4755 while ( i-- ) { // 4756 prop = copy[ i ]; // 4757 event[ prop ] = originalEvent[ prop ]; // 4758 } // 4759 // 4760 // Support: IE<9 // 4761 // Fix target property (#1925) // 4762 if ( !event.target ) { // 4763 event.target = originalEvent.srcElement || document; // 4764 } // 4765 // 4766 // Support: Chrome 23+, Safari? // 4767 // Target should not be a text node (#504, #13143) // 4768 if ( event.target.nodeType === 3 ) { // 4769 event.target = event.target.parentNode; // 4770 } // 4771 // 4772 // Support: IE<9 // 4773 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) // 4774 event.metaKey = !!event.metaKey; // 4775 // 4776 return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; // 4777 }, // 4778 // 4779 // Includes some event props shared by KeyEvent and MouseEvent // 4780 props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), // 4782 fixHooks: {}, // 4783 // 4784 keyHooks: { // 4785 props: "char charCode key keyCode".split(" "), // 4786 filter: function( event, original ) { // 4787 // 4788 // Add which for key events // 4789 if ( event.which == null ) { // 4790 event.which = original.charCode != null ? original.charCode : original.keyCode; // 4791 } // 4792 // 4793 return event; // 4794 } // 4795 }, // 4796 // 4797 mouseHooks: { // 4798 props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function( event, original ) { // 4800 var body, eventDoc, doc, // 4801 button = original.button, // 4802 fromElement = original.fromElement; // 4803 // 4804 // Calculate pageX/Y if missing and clientX/Y available // 4805 if ( event.pageX == null && original.clientX != null ) { // 4806 eventDoc = event.target.ownerDocument || document; // 4807 doc = eventDoc.documentElement; // 4808 body = eventDoc.body; // 4809 // 4810 event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); } // 4813 // 4814 // Add relatedTarget, if necessary // 4815 if ( !event.relatedTarget && fromElement ) { // 4816 event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; // 4817 } // 4818 // 4819 // Add which for click: 1 === left; 2 === middle; 3 === right // 4820 // Note: button is not normalized, so don't use it // 4821 if ( !event.which && button !== undefined ) { // 4822 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); // 4823 } // 4824 // 4825 return event; // 4826 } // 4827 }, // 4828 // 4829 special: { // 4830 load: { // 4831 // Prevent triggered image.load events from bubbling to window.load // 4832 noBubble: true // 4833 }, // 4834 focus: { // 4835 // Fire native event if possible so blur/focus sequence is correct // 4836 trigger: function() { // 4837 if ( this !== safeActiveElement() && this.focus ) { // 4838 try { // 4839 this.focus(); // 4840 return false; // 4841 } catch ( e ) { // 4842 // Support: IE<9 // 4843 // If we error on focus to hidden element (#1486, #12518), // 4844 // let .trigger() run the handlers // 4845 } // 4846 } // 4847 }, // 4848 delegateType: "focusin" // 4849 }, // 4850 blur: { // 4851 trigger: function() { // 4852 if ( this === safeActiveElement() && this.blur ) { // 4853 this.blur(); // 4854 return false; // 4855 } // 4856 }, // 4857 delegateType: "focusout" // 4858 }, // 4859 click: { // 4860 // For checkbox, fire native event so checked state will be right // 4861 trigger: function() { // 4862 if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { // 4863 this.click(); // 4864 return false; // 4865 } // 4866 }, // 4867 // 4868 // For cross-browser consistency, don't fire native .click() on links // 4869 _default: function( event ) { // 4870 return jQuery.nodeName( event.target, "a" ); // 4871 } // 4872 }, // 4873 // 4874 beforeunload: { // 4875 postDispatch: function( event ) { // 4876 // 4877 // Support: Firefox 20+ // 4878 // Firefox doesn't alert if the returnValue field is not set. // 4879 if ( event.result !== undefined && event.originalEvent ) { // 4880 event.originalEvent.returnValue = event.result; // 4881 } // 4882 } // 4883 } // 4884 }, // 4885 // 4886 simulate: function( type, elem, event, bubble ) { // 4887 // Piggyback on a donor event to simulate a different one. // 4888 // Fake originalEvent to avoid donor's stopPropagation, but if the // 4889 // simulated event prevents default then we do the same on the donor. // 4890 var e = jQuery.extend( // 4891 new jQuery.Event(), // 4892 event, // 4893 { // 4894 type: type, // 4895 isSimulated: true, // 4896 originalEvent: {} // 4897 } // 4898 ); // 4899 if ( bubble ) { // 4900 jQuery.event.trigger( e, null, elem ); // 4901 } else { // 4902 jQuery.event.dispatch.call( elem, e ); // 4903 } // 4904 if ( e.isDefaultPrevented() ) { // 4905 event.preventDefault(); // 4906 } // 4907 } // 4908 }; // 4909 // 4910 jQuery.removeEvent = document.removeEventListener ? // 4911 function( elem, type, handle ) { // 4912 if ( elem.removeEventListener ) { // 4913 elem.removeEventListener( type, handle, false ); // 4914 } // 4915 } : // 4916 function( elem, type, handle ) { // 4917 var name = "on" + type; // 4918 // 4919 if ( elem.detachEvent ) { // 4920 // 4921 // #8545, #7054, preventing memory leaks for custom events in IE6-8 // 4922 // detachEvent needed property on element, by name of that event, to properly expose it to GC // 4923 if ( typeof elem[ name ] === strundefined ) { // 4924 elem[ name ] = null; // 4925 } // 4926 // 4927 elem.detachEvent( name, handle ); // 4928 } // 4929 }; // 4930 // 4931 jQuery.Event = function( src, props ) { // 4932 // Allow instantiation without the 'new' keyword // 4933 if ( !(this instanceof jQuery.Event) ) { // 4934 return new jQuery.Event( src, props ); // 4935 } // 4936 // 4937 // Event object // 4938 if ( src && src.type ) { // 4939 this.originalEvent = src; // 4940 this.type = src.type; // 4941 // 4942 // Events bubbling up the document may have been marked as prevented // 4943 // by a handler lower down the tree; reflect the correct value. // 4944 this.isDefaultPrevented = src.defaultPrevented || // 4945 src.defaultPrevented === undefined && // 4946 // Support: IE < 9, Android < 4.0 // 4947 src.returnValue === false ? // 4948 returnTrue : // 4949 returnFalse; // 4950 // 4951 // Event type // 4952 } else { // 4953 this.type = src; // 4954 } // 4955 // 4956 // Put explicitly provided properties onto the event object // 4957 if ( props ) { // 4958 jQuery.extend( this, props ); // 4959 } // 4960 // 4961 // Create a timestamp if incoming event doesn't have one // 4962 this.timeStamp = src && src.timeStamp || jQuery.now(); // 4963 // 4964 // Mark it as fixed // 4965 this[ jQuery.expando ] = true; // 4966 }; // 4967 // 4968 // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // 4969 // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html // 4970 jQuery.Event.prototype = { // 4971 isDefaultPrevented: returnFalse, // 4972 isPropagationStopped: returnFalse, // 4973 isImmediatePropagationStopped: returnFalse, // 4974 // 4975 preventDefault: function() { // 4976 var e = this.originalEvent; // 4977 // 4978 this.isDefaultPrevented = returnTrue; // 4979 if ( !e ) { // 4980 return; // 4981 } // 4982 // 4983 // If preventDefault exists, run it on the original event // 4984 if ( e.preventDefault ) { // 4985 e.preventDefault(); // 4986 // 4987 // Support: IE // 4988 // Otherwise set the returnValue property of the original event to false // 4989 } else { // 4990 e.returnValue = false; // 4991 } // 4992 }, // 4993 stopPropagation: function() { // 4994 var e = this.originalEvent; // 4995 // 4996 this.isPropagationStopped = returnTrue; // 4997 if ( !e ) { // 4998 return; // 4999 } // 5000 // If stopPropagation exists, run it on the original event // 5001 if ( e.stopPropagation ) { // 5002 e.stopPropagation(); // 5003 } // 5004 // 5005 // Support: IE // 5006 // Set the cancelBubble property of the original event to true // 5007 e.cancelBubble = true; // 5008 }, // 5009 stopImmediatePropagation: function() { // 5010 var e = this.originalEvent; // 5011 // 5012 this.isImmediatePropagationStopped = returnTrue; // 5013 // 5014 if ( e && e.stopImmediatePropagation ) { // 5015 e.stopImmediatePropagation(); // 5016 } // 5017 // 5018 this.stopPropagation(); // 5019 } // 5020 }; // 5021 // 5022 // Create mouseenter/leave events using mouseover/out and event-time checks // 5023 jQuery.each({ // 5024 mouseenter: "mouseover", // 5025 mouseleave: "mouseout", // 5026 pointerenter: "pointerover", // 5027 pointerleave: "pointerout" // 5028 }, function( orig, fix ) { // 5029 jQuery.event.special[ orig ] = { // 5030 delegateType: fix, // 5031 bindType: fix, // 5032 // 5033 handle: function( event ) { // 5034 var ret, // 5035 target = this, // 5036 related = event.relatedTarget, // 5037 handleObj = event.handleObj; // 5038 // 5039 // For mousenter/leave call the handler if related is outside the target. // 5040 // NB: No relatedTarget if the mouse left/entered the browser window // 5041 if ( !related || (related !== target && !jQuery.contains( target, related )) ) { // 5042 event.type = handleObj.origType; // 5043 ret = handleObj.handler.apply( this, arguments ); // 5044 event.type = fix; // 5045 } // 5046 return ret; // 5047 } // 5048 }; // 5049 }); // 5050 // 5051 // IE submit delegation // 5052 if ( !support.submitBubbles ) { // 5053 // 5054 jQuery.event.special.submit = { // 5055 setup: function() { // 5056 // Only need this for delegated form submit events // 5057 if ( jQuery.nodeName( this, "form" ) ) { // 5058 return false; // 5059 } // 5060 // 5061 // Lazy-add a submit handler when a descendant form may potentially be submitted // 5062 jQuery.event.add( this, "click._submit keypress._submit", function( e ) { // 5063 // Node name check avoids a VML-related crash in IE (#9807) // 5064 var elem = e.target, // 5065 form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; // 5066 if ( form && !jQuery._data( form, "submitBubbles" ) ) { // 5067 jQuery.event.add( form, "submit._submit", function( event ) { // 5068 event._submit_bubble = true; // 5069 }); // 5070 jQuery._data( form, "submitBubbles", true ); // 5071 } // 5072 }); // 5073 // return undefined since we don't need an event listener // 5074 }, // 5075 // 5076 postDispatch: function( event ) { // 5077 // If form was submitted by the user, bubble the event up the tree // 5078 if ( event._submit_bubble ) { // 5079 delete event._submit_bubble; // 5080 if ( this.parentNode && !event.isTrigger ) { // 5081 jQuery.event.simulate( "submit", this.parentNode, event, true ); // 5082 } // 5083 } // 5084 }, // 5085 // 5086 teardown: function() { // 5087 // Only need this for delegated form submit events // 5088 if ( jQuery.nodeName( this, "form" ) ) { // 5089 return false; // 5090 } // 5091 // 5092 // Remove delegated handlers; cleanData eventually reaps submit handlers attached above // 5093 jQuery.event.remove( this, "._submit" ); // 5094 } // 5095 }; // 5096 } // 5097 // 5098 // IE change delegation and checkbox/radio fix // 5099 if ( !support.changeBubbles ) { // 5100 // 5101 jQuery.event.special.change = { // 5102 // 5103 setup: function() { // 5104 // 5105 if ( rformElems.test( this.nodeName ) ) { // 5106 // IE doesn't fire change on a check/radio until blur; trigger it on click // 5107 // after a propertychange. Eat the blur-change in special.change.handle. // 5108 // This still fires onchange a second time for check/radio after blur. // 5109 if ( this.type === "checkbox" || this.type === "radio" ) { // 5110 jQuery.event.add( this, "propertychange._change", function( event ) { // 5111 if ( event.originalEvent.propertyName === "checked" ) { // 5112 this._just_changed = true; // 5113 } // 5114 }); // 5115 jQuery.event.add( this, "click._change", function( event ) { // 5116 if ( this._just_changed && !event.isTrigger ) { // 5117 this._just_changed = false; // 5118 } // 5119 // Allow triggered, simulated change events (#11500) // 5120 jQuery.event.simulate( "change", this, event, true ); // 5121 }); // 5122 } // 5123 return false; // 5124 } // 5125 // Delegated event; lazy-add a change handler on descendant inputs // 5126 jQuery.event.add( this, "beforeactivate._change", function( e ) { // 5127 var elem = e.target; // 5128 // 5129 if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { // 5130 jQuery.event.add( elem, "change._change", function( event ) { // 5131 if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { // 5132 jQuery.event.simulate( "change", this.parentNode, event, true ); // 5133 } // 5134 }); // 5135 jQuery._data( elem, "changeBubbles", true ); // 5136 } // 5137 }); // 5138 }, // 5139 // 5140 handle: function( event ) { // 5141 var elem = event.target; // 5142 // 5143 // Swallow native change events from checkbox/radio, we already triggered them above // 5144 if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { return event.handleObj.handler.apply( this, arguments ); // 5146 } // 5147 }, // 5148 // 5149 teardown: function() { // 5150 jQuery.event.remove( this, "._change" ); // 5151 // 5152 return !rformElems.test( this.nodeName ); // 5153 } // 5154 }; // 5155 } // 5156 // 5157 // Create "bubbling" focus and blur events // 5158 if ( !support.focusinBubbles ) { // 5159 jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { // 5160 // 5161 // Attach a single capturing handler on the document while someone wants focusin/focusout // 5162 var handler = function( event ) { // 5163 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); // 5164 }; // 5165 // 5166 jQuery.event.special[ fix ] = { // 5167 setup: function() { // 5168 var doc = this.ownerDocument || this, // 5169 attaches = jQuery._data( doc, fix ); // 5170 // 5171 if ( !attaches ) { // 5172 doc.addEventListener( orig, handler, true ); // 5173 } // 5174 jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); // 5175 }, // 5176 teardown: function() { // 5177 var doc = this.ownerDocument || this, // 5178 attaches = jQuery._data( doc, fix ) - 1; // 5179 // 5180 if ( !attaches ) { // 5181 doc.removeEventListener( orig, handler, true ); // 5182 jQuery._removeData( doc, fix ); // 5183 } else { // 5184 jQuery._data( doc, fix, attaches ); // 5185 } // 5186 } // 5187 }; // 5188 }); // 5189 } // 5190 // 5191 jQuery.fn.extend({ // 5192 // 5193 on: function( types, selector, data, fn, /*INTERNAL*/ one ) { // 5194 var type, origFn; // 5195 // 5196 // Types can be a map of types/handlers // 5197 if ( typeof types === "object" ) { // 5198 // ( types-Object, selector, data ) // 5199 if ( typeof selector !== "string" ) { // 5200 // ( types-Object, data ) // 5201 data = data || selector; // 5202 selector = undefined; // 5203 } // 5204 for ( type in types ) { // 5205 this.on( type, selector, data, types[ type ], one ); // 5206 } // 5207 return this; // 5208 } // 5209 // 5210 if ( data == null && fn == null ) { // 5211 // ( types, fn ) // 5212 fn = selector; // 5213 data = selector = undefined; // 5214 } else if ( fn == null ) { // 5215 if ( typeof selector === "string" ) { // 5216 // ( types, selector, fn ) // 5217 fn = data; // 5218 data = undefined; // 5219 } else { // 5220 // ( types, data, fn ) // 5221 fn = data; // 5222 data = selector; // 5223 selector = undefined; // 5224 } // 5225 } // 5226 if ( fn === false ) { // 5227 fn = returnFalse; // 5228 } else if ( !fn ) { // 5229 return this; // 5230 } // 5231 // 5232 if ( one === 1 ) { // 5233 origFn = fn; // 5234 fn = function( event ) { // 5235 // Can use an empty set, since event contains the info // 5236 jQuery().off( event ); // 5237 return origFn.apply( this, arguments ); // 5238 }; // 5239 // Use same guid so caller can remove using origFn // 5240 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); // 5241 } // 5242 return this.each( function() { // 5243 jQuery.event.add( this, types, fn, data, selector ); // 5244 }); // 5245 }, // 5246 one: function( types, selector, data, fn ) { // 5247 return this.on( types, selector, data, fn, 1 ); // 5248 }, // 5249 off: function( types, selector, fn ) { // 5250 var handleObj, type; // 5251 if ( types && types.preventDefault && types.handleObj ) { // 5252 // ( event ) dispatched jQuery.Event // 5253 handleObj = types.handleObj; // 5254 jQuery( types.delegateTarget ).off( // 5255 handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, // 5256 handleObj.selector, // 5257 handleObj.handler // 5258 ); // 5259 return this; // 5260 } // 5261 if ( typeof types === "object" ) { // 5262 // ( types-object [, selector] ) // 5263 for ( type in types ) { // 5264 this.off( type, selector, types[ type ] ); // 5265 } // 5266 return this; // 5267 } // 5268 if ( selector === false || typeof selector === "function" ) { // 5269 // ( types [, fn] ) // 5270 fn = selector; // 5271 selector = undefined; // 5272 } // 5273 if ( fn === false ) { // 5274 fn = returnFalse; // 5275 } // 5276 return this.each(function() { // 5277 jQuery.event.remove( this, types, fn, selector ); // 5278 }); // 5279 }, // 5280 // 5281 trigger: function( type, data ) { // 5282 return this.each(function() { // 5283 jQuery.event.trigger( type, data, this ); // 5284 }); // 5285 }, // 5286 triggerHandler: function( type, data ) { // 5287 var elem = this[0]; // 5288 if ( elem ) { // 5289 return jQuery.event.trigger( type, data, elem, true ); // 5290 } // 5291 } // 5292 }); // 5293 // 5294 // 5295 function createSafeFragment( document ) { // 5296 var list = nodeNames.split( "|" ), // 5297 safeFrag = document.createDocumentFragment(); // 5298 // 5299 if ( safeFrag.createElement ) { // 5300 while ( list.length ) { // 5301 safeFrag.createElement( // 5302 list.pop() // 5303 ); // 5304 } // 5305 } // 5306 return safeFrag; // 5307 } // 5308 // 5309 var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + // 5310 "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", // 5311 rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, // 5312 rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), // 5313 rleadingWhitespace = /^\s+/, // 5314 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, // 5315 rtagName = /<([\w:]+)/, // 5316 rtbody = /\s*$/g, // 5324 // 5325 // We have to close these tags to support XHTML (#13200) // 5326 wrapMap = { // 5327 option: [ 1, "" ], // 5328 legend: [ 1, "
", "
" ], // 5329 area: [ 1, "", "" ], // 5330 param: [ 1, "", "" ], // 5331 thead: [ 1, "", "
" ], // 5332 tr: [ 2, "", "
" ], // 5333 col: [ 2, "", "
" ], // 5334 td: [ 3, "", "
" ], // 5335 // 5336 // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, // 5337 // unless wrapped in a div with non-breaking characters in front of it. // 5338 _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
", "
" ] // 5339 }, // 5340 safeFragment = createSafeFragment( document ), // 5341 fragmentDiv = safeFragment.appendChild( document.createElement("div") ); // 5342 // 5343 wrapMap.optgroup = wrapMap.option; // 5344 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; // 5345 wrapMap.th = wrapMap.td; // 5346 // 5347 function getAll( context, tag ) { // 5348 var elems, elem, // 5349 i = 0, // 5350 found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) : // 5351 typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) : // 5352 undefined; // 5353 // 5354 if ( !found ) { // 5355 for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { // 5356 if ( !tag || jQuery.nodeName( elem, tag ) ) { // 5357 found.push( elem ); // 5358 } else { // 5359 jQuery.merge( found, getAll( elem, tag ) ); // 5360 } // 5361 } // 5362 } // 5363 // 5364 return tag === undefined || tag && jQuery.nodeName( context, tag ) ? // 5365 jQuery.merge( [ context ], found ) : // 5366 found; // 5367 } // 5368 // 5369 // Used in buildFragment, fixes the defaultChecked property // 5370 function fixDefaultChecked( elem ) { // 5371 if ( rcheckableType.test( elem.type ) ) { // 5372 elem.defaultChecked = elem.checked; // 5373 } // 5374 } // 5375 // 5376 // Support: IE<8 // 5377 // Manipulating tables requires a tbody // 5378 function manipulationTarget( elem, content ) { // 5379 return jQuery.nodeName( elem, "table" ) && // 5380 jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? // 5381 // 5382 elem.getElementsByTagName("tbody")[0] || // 5383 elem.appendChild( elem.ownerDocument.createElement("tbody") ) : // 5384 elem; // 5385 } // 5386 // 5387 // Replace/restore the type attribute of script elements for safe DOM manipulation // 5388 function disableScript( elem ) { // 5389 elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; // 5390 return elem; // 5391 } // 5392 function restoreScript( elem ) { // 5393 var match = rscriptTypeMasked.exec( elem.type ); // 5394 if ( match ) { // 5395 elem.type = match[1]; // 5396 } else { // 5397 elem.removeAttribute("type"); // 5398 } // 5399 return elem; // 5400 } // 5401 // 5402 // Mark scripts as having already been evaluated // 5403 function setGlobalEval( elems, refElements ) { // 5404 var elem, // 5405 i = 0; // 5406 for ( ; (elem = elems[i]) != null; i++ ) { // 5407 jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); // 5408 } // 5409 } // 5410 // 5411 function cloneCopyEvent( src, dest ) { // 5412 // 5413 if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { // 5414 return; // 5415 } // 5416 // 5417 var type, i, l, // 5418 oldData = jQuery._data( src ), // 5419 curData = jQuery._data( dest, oldData ), // 5420 events = oldData.events; // 5421 // 5422 if ( events ) { // 5423 delete curData.handle; // 5424 curData.events = {}; // 5425 // 5426 for ( type in events ) { // 5427 for ( i = 0, l = events[ type ].length; i < l; i++ ) { // 5428 jQuery.event.add( dest, type, events[ type ][ i ] ); // 5429 } // 5430 } // 5431 } // 5432 // 5433 // make the cloned public data object a copy from the original // 5434 if ( curData.data ) { // 5435 curData.data = jQuery.extend( {}, curData.data ); // 5436 } // 5437 } // 5438 // 5439 function fixCloneNodeIssues( src, dest ) { // 5440 var nodeName, e, data; // 5441 // 5442 // We do not need to do anything for non-Elements // 5443 if ( dest.nodeType !== 1 ) { // 5444 return; // 5445 } // 5446 // 5447 nodeName = dest.nodeName.toLowerCase(); // 5448 // 5449 // IE6-8 copies events bound via attachEvent when using cloneNode. // 5450 if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { // 5451 data = jQuery._data( dest ); // 5452 // 5453 for ( e in data.events ) { // 5454 jQuery.removeEvent( dest, e, data.handle ); // 5455 } // 5456 // 5457 // Event data gets referenced instead of copied if the expando gets copied too // 5458 dest.removeAttribute( jQuery.expando ); // 5459 } // 5460 // 5461 // IE blanks contents when cloning scripts, and tries to evaluate newly-set text // 5462 if ( nodeName === "script" && dest.text !== src.text ) { // 5463 disableScript( dest ).text = src.text; // 5464 restoreScript( dest ); // 5465 // 5466 // IE6-10 improperly clones children of object elements using classid. // 5467 // IE10 throws NoModificationAllowedError if parent is null, #12132. // 5468 } else if ( nodeName === "object" ) { // 5469 if ( dest.parentNode ) { // 5470 dest.outerHTML = src.outerHTML; // 5471 } // 5472 // 5473 // This path appears unavoidable for IE9. When cloning an object // 5474 // element in IE9, the outerHTML strategy above is not sufficient. // 5475 // If the src has innerHTML and the destination does not, // 5476 // copy the src.innerHTML into the dest.innerHTML. #10324 // 5477 if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { // 5478 dest.innerHTML = src.innerHTML; // 5479 } // 5480 // 5481 } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { // 5482 // IE6-8 fails to persist the checked state of a cloned checkbox // 5483 // or radio button. Worse, IE6-7 fail to give the cloned element // 5484 // a checked appearance if the defaultChecked value isn't also set // 5485 // 5486 dest.defaultChecked = dest.checked = src.checked; // 5487 // 5488 // IE6-7 get confused and end up setting the value of a cloned // 5489 // checkbox/radio button to an empty string instead of "on" // 5490 if ( dest.value !== src.value ) { // 5491 dest.value = src.value; // 5492 } // 5493 // 5494 // IE6-8 fails to return the selected option to the default selected // 5495 // state when cloning options // 5496 } else if ( nodeName === "option" ) { // 5497 dest.defaultSelected = dest.selected = src.defaultSelected; // 5498 // 5499 // IE6-8 fails to set the defaultValue to the correct value when // 5500 // cloning other types of input fields // 5501 } else if ( nodeName === "input" || nodeName === "textarea" ) { // 5502 dest.defaultValue = src.defaultValue; // 5503 } // 5504 } // 5505 // 5506 jQuery.extend({ // 5507 clone: function( elem, dataAndEvents, deepDataAndEvents ) { // 5508 var destElements, node, clone, i, srcElements, // 5509 inPage = jQuery.contains( elem.ownerDocument, elem ); // 5510 // 5511 if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { // 5512 clone = elem.cloneNode( true ); // 5513 // 5514 // IE<=8 does not properly clone detached, unknown element nodes // 5515 } else { // 5516 fragmentDiv.innerHTML = elem.outerHTML; // 5517 fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); // 5518 } // 5519 // 5520 if ( (!support.noCloneEvent || !support.noCloneChecked) && // 5521 (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { // 5522 // 5523 // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 // 5524 destElements = getAll( clone ); // 5525 srcElements = getAll( elem ); // 5526 // 5527 // Fix all IE cloning issues // 5528 for ( i = 0; (node = srcElements[i]) != null; ++i ) { // 5529 // Ensure that the destination node is not null; Fixes #9587 // 5530 if ( destElements[i] ) { // 5531 fixCloneNodeIssues( node, destElements[i] ); // 5532 } // 5533 } // 5534 } // 5535 // 5536 // Copy the events from the original to the clone // 5537 if ( dataAndEvents ) { // 5538 if ( deepDataAndEvents ) { // 5539 srcElements = srcElements || getAll( elem ); // 5540 destElements = destElements || getAll( clone ); // 5541 // 5542 for ( i = 0; (node = srcElements[i]) != null; i++ ) { // 5543 cloneCopyEvent( node, destElements[i] ); // 5544 } // 5545 } else { // 5546 cloneCopyEvent( elem, clone ); // 5547 } // 5548 } // 5549 // 5550 // Preserve script evaluation history // 5551 destElements = getAll( clone, "script" ); // 5552 if ( destElements.length > 0 ) { // 5553 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); // 5554 } // 5555 // 5556 destElements = srcElements = node = null; // 5557 // 5558 // Return the cloned set // 5559 return clone; // 5560 }, // 5561 // 5562 buildFragment: function( elems, context, scripts, selection ) { // 5563 var j, elem, contains, // 5564 tmp, tag, tbody, wrap, // 5565 l = elems.length, // 5566 // 5567 // Ensure a safe fragment // 5568 safe = createSafeFragment( context ), // 5569 // 5570 nodes = [], // 5571 i = 0; // 5572 // 5573 for ( ; i < l; i++ ) { // 5574 elem = elems[ i ]; // 5575 // 5576 if ( elem || elem === 0 ) { // 5577 // 5578 // Add nodes directly // 5579 if ( jQuery.type( elem ) === "object" ) { // 5580 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // 5581 // 5582 // Convert non-html into a text node // 5583 } else if ( !rhtml.test( elem ) ) { // 5584 nodes.push( context.createTextNode( elem ) ); // 5585 // 5586 // Convert html into DOM nodes // 5587 } else { // 5588 tmp = tmp || safe.appendChild( context.createElement("div") ); // 5589 // 5590 // Deserialize a standard representation // 5591 tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase(); // 5592 wrap = wrapMap[ tag ] || wrapMap._default; // 5593 // 5594 tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[2]; // 5595 // 5596 // Descend through wrappers to the right content // 5597 j = wrap[0]; // 5598 while ( j-- ) { // 5599 tmp = tmp.lastChild; // 5600 } // 5601 // 5602 // Manually add leading whitespace removed by IE // 5603 if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { // 5604 nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); // 5605 } // 5606 // 5607 // Remove IE's autoinserted from table fragments // 5608 if ( !support.tbody ) { // 5609 // 5610 // String was a , *may* have spurious // 5611 elem = tag === "table" && !rtbody.test( elem ) ? // 5612 tmp.firstChild : // 5613 // 5614 // String was a bare or // 5615 wrap[1] === "
" && !rtbody.test( elem ) ? // 5616 tmp : // 5617 0; // 5618 // 5619 j = elem && elem.childNodes.length; // 5620 while ( j-- ) { // 5621 if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { // 5622 elem.removeChild( tbody ); // 5623 } // 5624 } // 5625 } // 5626 // 5627 jQuery.merge( nodes, tmp.childNodes ); // 5628 // 5629 // Fix #12392 for WebKit and IE > 9 // 5630 tmp.textContent = ""; // 5631 // 5632 // Fix #12392 for oldIE // 5633 while ( tmp.firstChild ) { // 5634 tmp.removeChild( tmp.firstChild ); // 5635 } // 5636 // 5637 // Remember the top-level container for proper cleanup // 5638 tmp = safe.lastChild; // 5639 } // 5640 } // 5641 } // 5642 // 5643 // Fix #11356: Clear elements from fragment // 5644 if ( tmp ) { // 5645 safe.removeChild( tmp ); // 5646 } // 5647 // 5648 // Reset defaultChecked for any radios and checkboxes // 5649 // about to be appended to the DOM in IE 6/7 (#8060) // 5650 if ( !support.appendChecked ) { // 5651 jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); // 5652 } // 5653 // 5654 i = 0; // 5655 while ( (elem = nodes[ i++ ]) ) { // 5656 // 5657 // #4087 - If origin and destination elements are the same, and this is // 5658 // that element, do not do anything // 5659 if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { // 5660 continue; // 5661 } // 5662 // 5663 contains = jQuery.contains( elem.ownerDocument, elem ); // 5664 // 5665 // Append to fragment // 5666 tmp = getAll( safe.appendChild( elem ), "script" ); // 5667 // 5668 // Preserve script evaluation history // 5669 if ( contains ) { // 5670 setGlobalEval( tmp ); // 5671 } // 5672 // 5673 // Capture executables // 5674 if ( scripts ) { // 5675 j = 0; // 5676 while ( (elem = tmp[ j++ ]) ) { // 5677 if ( rscriptType.test( elem.type || "" ) ) { // 5678 scripts.push( elem ); // 5679 } // 5680 } // 5681 } // 5682 } // 5683 // 5684 tmp = null; // 5685 // 5686 return safe; // 5687 }, // 5688 // 5689 cleanData: function( elems, /* internal */ acceptData ) { // 5690 var elem, type, id, data, // 5691 i = 0, // 5692 internalKey = jQuery.expando, // 5693 cache = jQuery.cache, // 5694 deleteExpando = support.deleteExpando, // 5695 special = jQuery.event.special; // 5696 // 5697 for ( ; (elem = elems[i]) != null; i++ ) { // 5698 if ( acceptData || jQuery.acceptData( elem ) ) { // 5699 // 5700 id = elem[ internalKey ]; // 5701 data = id && cache[ id ]; // 5702 // 5703 if ( data ) { // 5704 if ( data.events ) { // 5705 for ( type in data.events ) { // 5706 if ( special[ type ] ) { // 5707 jQuery.event.remove( elem, type ); // 5708 // 5709 // This is a shortcut to avoid jQuery.event.remove's overhead // 5710 } else { // 5711 jQuery.removeEvent( elem, type, data.handle ); // 5712 } // 5713 } // 5714 } // 5715 // 5716 // Remove cache only if it was not already removed by jQuery.event.remove // 5717 if ( cache[ id ] ) { // 5718 // 5719 delete cache[ id ]; // 5720 // 5721 // IE does not allow us to delete expando properties from nodes, // 5722 // nor does it have a removeAttribute function on Document nodes; // 5723 // we must handle all of these cases // 5724 if ( deleteExpando ) { // 5725 delete elem[ internalKey ]; // 5726 // 5727 } else if ( typeof elem.removeAttribute !== strundefined ) { // 5728 elem.removeAttribute( internalKey ); // 5729 // 5730 } else { // 5731 elem[ internalKey ] = null; // 5732 } // 5733 // 5734 deletedIds.push( id ); // 5735 } // 5736 } // 5737 } // 5738 } // 5739 } // 5740 }); // 5741 // 5742 jQuery.fn.extend({ // 5743 text: function( value ) { // 5744 return access( this, function( value ) { // 5745 return value === undefined ? // 5746 jQuery.text( this ) : // 5747 this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); // 5748 }, null, value, arguments.length ); // 5749 }, // 5750 // 5751 append: function() { // 5752 return this.domManip( arguments, function( elem ) { // 5753 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { // 5754 var target = manipulationTarget( this, elem ); // 5755 target.appendChild( elem ); // 5756 } // 5757 }); // 5758 }, // 5759 // 5760 prepend: function() { // 5761 return this.domManip( arguments, function( elem ) { // 5762 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { // 5763 var target = manipulationTarget( this, elem ); // 5764 target.insertBefore( elem, target.firstChild ); // 5765 } // 5766 }); // 5767 }, // 5768 // 5769 before: function() { // 5770 return this.domManip( arguments, function( elem ) { // 5771 if ( this.parentNode ) { // 5772 this.parentNode.insertBefore( elem, this ); // 5773 } // 5774 }); // 5775 }, // 5776 // 5777 after: function() { // 5778 return this.domManip( arguments, function( elem ) { // 5779 if ( this.parentNode ) { // 5780 this.parentNode.insertBefore( elem, this.nextSibling ); // 5781 } // 5782 }); // 5783 }, // 5784 // 5785 remove: function( selector, keepData /* Internal Use Only */ ) { // 5786 var elem, // 5787 elems = selector ? jQuery.filter( selector, this ) : this, // 5788 i = 0; // 5789 // 5790 for ( ; (elem = elems[i]) != null; i++ ) { // 5791 // 5792 if ( !keepData && elem.nodeType === 1 ) { // 5793 jQuery.cleanData( getAll( elem ) ); // 5794 } // 5795 // 5796 if ( elem.parentNode ) { // 5797 if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { // 5798 setGlobalEval( getAll( elem, "script" ) ); // 5799 } // 5800 elem.parentNode.removeChild( elem ); // 5801 } // 5802 } // 5803 // 5804 return this; // 5805 }, // 5806 // 5807 empty: function() { // 5808 var elem, // 5809 i = 0; // 5810 // 5811 for ( ; (elem = this[i]) != null; i++ ) { // 5812 // Remove element nodes and prevent memory leaks // 5813 if ( elem.nodeType === 1 ) { // 5814 jQuery.cleanData( getAll( elem, false ) ); // 5815 } // 5816 // 5817 // Remove any remaining nodes // 5818 while ( elem.firstChild ) { // 5819 elem.removeChild( elem.firstChild ); // 5820 } // 5821 // 5822 // If this is a select, ensure that it displays empty (#12336) // 5823 // Support: IE<9 // 5824 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { // 5825 elem.options.length = 0; // 5826 } // 5827 } // 5828 // 5829 return this; // 5830 }, // 5831 // 5832 clone: function( dataAndEvents, deepDataAndEvents ) { // 5833 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; // 5834 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; // 5835 // 5836 return this.map(function() { // 5837 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); // 5838 }); // 5839 }, // 5840 // 5841 html: function( value ) { // 5842 return access( this, function( value ) { // 5843 var elem = this[ 0 ] || {}, // 5844 i = 0, // 5845 l = this.length; // 5846 // 5847 if ( value === undefined ) { // 5848 return elem.nodeType === 1 ? // 5849 elem.innerHTML.replace( rinlinejQuery, "" ) : // 5850 undefined; // 5851 } // 5852 // 5853 // See if we can take a shortcut and just use innerHTML // 5854 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && // 5855 ( support.htmlSerialize || !rnoshimcache.test( value ) ) && // 5856 ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && // 5857 !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) { // 5858 // 5859 value = value.replace( rxhtmlTag, "<$1>" ); // 5860 // 5861 try { // 5862 for (; i < l; i++ ) { // 5863 // Remove element nodes and prevent memory leaks // 5864 elem = this[i] || {}; // 5865 if ( elem.nodeType === 1 ) { // 5866 jQuery.cleanData( getAll( elem, false ) ); // 5867 elem.innerHTML = value; // 5868 } // 5869 } // 5870 // 5871 elem = 0; // 5872 // 5873 // If using innerHTML throws an exception, use the fallback method // 5874 } catch(e) {} // 5875 } // 5876 // 5877 if ( elem ) { // 5878 this.empty().append( value ); // 5879 } // 5880 }, null, value, arguments.length ); // 5881 }, // 5882 // 5883 replaceWith: function() { // 5884 var arg = arguments[ 0 ]; // 5885 // 5886 // Make the changes, replacing each context element with the new content // 5887 this.domManip( arguments, function( elem ) { // 5888 arg = this.parentNode; // 5889 // 5890 jQuery.cleanData( getAll( this ) ); // 5891 // 5892 if ( arg ) { // 5893 arg.replaceChild( elem, this ); // 5894 } // 5895 }); // 5896 // 5897 // Force removal if there was no new content (e.g., from empty arguments) // 5898 return arg && (arg.length || arg.nodeType) ? this : this.remove(); // 5899 }, // 5900 // 5901 detach: function( selector ) { // 5902 return this.remove( selector, true ); // 5903 }, // 5904 // 5905 domManip: function( args, callback ) { // 5906 // 5907 // Flatten any nested arrays // 5908 args = concat.apply( [], args ); // 5909 // 5910 var first, node, hasScripts, // 5911 scripts, doc, fragment, // 5912 i = 0, // 5913 l = this.length, // 5914 set = this, // 5915 iNoClone = l - 1, // 5916 value = args[0], // 5917 isFunction = jQuery.isFunction( value ); // 5918 // 5919 // We can't cloneNode fragments that contain checked, in WebKit // 5920 if ( isFunction || // 5921 ( l > 1 && typeof value === "string" && // 5922 !support.checkClone && rchecked.test( value ) ) ) { // 5923 return this.each(function( index ) { // 5924 var self = set.eq( index ); // 5925 if ( isFunction ) { // 5926 args[0] = value.call( this, index, self.html() ); // 5927 } // 5928 self.domManip( args, callback ); // 5929 }); // 5930 } // 5931 // 5932 if ( l ) { // 5933 fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); // 5934 first = fragment.firstChild; // 5935 // 5936 if ( fragment.childNodes.length === 1 ) { // 5937 fragment = first; // 5938 } // 5939 // 5940 if ( first ) { // 5941 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); // 5942 hasScripts = scripts.length; // 5943 // 5944 // Use the original fragment for the last item instead of the first because it can end up // 5945 // being emptied incorrectly in certain situations (#8070). // 5946 for ( ; i < l; i++ ) { // 5947 node = fragment; // 5948 // 5949 if ( i !== iNoClone ) { // 5950 node = jQuery.clone( node, true, true ); // 5951 // 5952 // Keep references to cloned scripts for later restoration // 5953 if ( hasScripts ) { // 5954 jQuery.merge( scripts, getAll( node, "script" ) ); // 5955 } // 5956 } // 5957 // 5958 callback.call( this[i], node, i ); // 5959 } // 5960 // 5961 if ( hasScripts ) { // 5962 doc = scripts[ scripts.length - 1 ].ownerDocument; // 5963 // 5964 // Reenable scripts // 5965 jQuery.map( scripts, restoreScript ); // 5966 // 5967 // Evaluate executable scripts on first document insertion // 5968 for ( i = 0; i < hasScripts; i++ ) { // 5969 node = scripts[ i ]; // 5970 if ( rscriptType.test( node.type || "" ) && // 5971 !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { // 5972 // 5973 if ( node.src ) { // 5974 // Optional AJAX dependency, but won't run scripts if not present // 5975 if ( jQuery._evalUrl ) { // 5976 jQuery._evalUrl( node.src ); // 5977 } // 5978 } else { // 5979 jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); // 5980 } // 5981 } // 5982 } // 5983 } // 5984 // 5985 // Fix #11809: Avoid leaking memory // 5986 fragment = first = null; // 5987 } // 5988 } // 5989 // 5990 return this; // 5991 } // 5992 }); // 5993 // 5994 jQuery.each({ // 5995 appendTo: "append", // 5996 prependTo: "prepend", // 5997 insertBefore: "before", // 5998 insertAfter: "after", // 5999 replaceAll: "replaceWith" // 6000 }, function( name, original ) { // 6001 jQuery.fn[ name ] = function( selector ) { // 6002 var elems, // 6003 i = 0, // 6004 ret = [], // 6005 insert = jQuery( selector ), // 6006 last = insert.length - 1; // 6007 // 6008 for ( ; i <= last; i++ ) { // 6009 elems = i === last ? this : this.clone(true); // 6010 jQuery( insert[i] )[ original ]( elems ); // 6011 // 6012 // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() // 6013 push.apply( ret, elems.get() ); // 6014 } // 6015 // 6016 return this.pushStack( ret ); // 6017 }; // 6018 }); // 6019 // 6020 // 6021 var iframe, // 6022 elemdisplay = {}; // 6023 // 6024 /** // 6025 * Retrieve the actual display of a element // 6026 * @param {String} name nodeName of the element // 6027 * @param {Object} doc Document object // 6028 */ // 6029 // Called only from within defaultDisplay // 6030 function actualDisplay( name, doc ) { // 6031 var style, // 6032 elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), // 6033 // 6034 // getDefaultComputedStyle might be reliably used only on attached element // 6035 display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? // 6036 // 6037 // Use of this method is a temporary fix (more like optmization) until something better comes along, // 6038 // since it was removed from specification and supported only in FF // 6039 style.display : jQuery.css( elem[ 0 ], "display" ); // 6040 // 6041 // We don't have any data stored on the element, // 6042 // so use "detach" method as fast way to get rid of the element // 6043 elem.detach(); // 6044 // 6045 return display; // 6046 } // 6047 // 6048 /** // 6049 * Try to determine the default display value of an element // 6050 * @param {String} nodeName // 6051 */ // 6052 function defaultDisplay( nodeName ) { // 6053 var doc = document, // 6054 display = elemdisplay[ nodeName ]; // 6055 // 6056 if ( !display ) { // 6057 display = actualDisplay( nodeName, doc ); // 6058 // 6059 // If the simple way fails, read from inside an iframe // 6060 if ( display === "none" || !display ) { // 6061 // 6062 // Use the already-created iframe if possible // 6063 iframe = (iframe || jQuery( "