· 6 years ago · Sep 01, 2019, 08:20 PM
1/******/ (function(modules) { // webpackBootstrap
2/******/ // The module cache
3/******/ var installedModules = {};
4/******/
5/******/ // The require function
6/******/ function __webpack_require__(moduleId) {
7/******/
8/******/ // Check if module is in cache
9/******/ if(installedModules[moduleId]) {
10/******/ return installedModules[moduleId].exports;
11/******/ }
12/******/ // Create a new module (and put it into the cache)
13/******/ var module = installedModules[moduleId] = {
14/******/ i: moduleId,
15/******/ l: false,
16/******/ exports: {}
17/******/ };
18/******/
19/******/ // Execute the module function
20/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21/******/
22/******/ // Flag the module as loaded
23/******/ module.l = true;
24/******/
25/******/ // Return the exports of the module
26/******/ return module.exports;
27/******/ }
28/******/
29/******/
30/******/ // expose the modules object (__webpack_modules__)
31/******/ __webpack_require__.m = modules;
32/******/
33/******/ // expose the module cache
34/******/ __webpack_require__.c = installedModules;
35/******/
36/******/ // define getter function for harmony exports
37/******/ __webpack_require__.d = function(exports, name, getter) {
38/******/ if(!__webpack_require__.o(exports, name)) {
39/******/ Object.defineProperty(exports, name, {
40/******/ configurable: false,
41/******/ enumerable: true,
42/******/ get: getter
43/******/ });
44/******/ }
45/******/ };
46/******/
47/******/ // getDefaultExport function for compatibility with non-harmony modules
48/******/ __webpack_require__.n = function(module) {
49/******/ var getter = module && module.__esModule ?
50/******/ function getDefault() { return module['default']; } :
51/******/ function getModuleExports() { return module; };
52/******/ __webpack_require__.d(getter, 'a', getter);
53/******/ return getter;
54/******/ };
55/******/
56/******/ // Object.prototype.hasOwnProperty.call
57/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
58/******/
59/******/ // __webpack_public_path__
60/******/ __webpack_require__.p = "";
61/******/
62/******/ // Load entry module and return exports
63/******/ return __webpack_require__(__webpack_require__.s = 43);
64/******/ })
65/************************************************************************/
66/******/ ({
67
68/***/ 0:
69/***/ (function(module, exports) {
70
71/***
72 * @param {string} text - sequences the text according to SBL Hebrew Font manual
73 * @returns {string}
74 */
75
76module.exports = text => {
77 let splits = /(?=[\u05D0-\u05F2, \uFB20-\uFB4F])/;
78 let consonants = /[\u05D0-\u05F2, \uFB20-\uFB4F]/;
79 let ligature = /[\u05C1-\u05C2]/;
80 let dagesh = /[\u05BC, \u05BF]/; // includes rafe
81 let vowels = /[\u05B0-\u05BB, \u05C7]/;
82 let accents = /[\u0590-\u05AF, \u05BD-\u05BE, \u05C0, \u05C3]/;
83 return text.split(splits).map(e => {
84 return e.split('').sort((a,b) => {
85 // since the str is split at consonants, the first a is always const, thus never flip
86 if(consonants.test(a) ) {return 0}
87 // if a is anything except a consonant and b is a ligature, then flip
88 if(!consonants.test(a) && ligature.test(b)){return 1}
89 if(vowels.test(a) && dagesh.test(b)) {return 1}
90 if(accents.test(a) && dagesh.test(b)) {return 1}
91 }).join('')
92 }).join('')
93}
94
95/***/ }),
96
97/***/ 1:
98/***/ (function(module, exports, __webpack_require__) {
99
100var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
101 * jQuery JavaScript Library v3.4.1
102 * https://jquery.com/
103 *
104 * Includes Sizzle.js
105 * https://sizzlejs.com/
106 *
107 * Copyright JS Foundation and other contributors
108 * Released under the MIT license
109 * https://jquery.org/license
110 *
111 * Date: 2019-05-01T21:04Z
112 */
113( function( global, factory ) {
114
115 "use strict";
116
117 if ( typeof module === "object" && typeof module.exports === "object" ) {
118
119 // For CommonJS and CommonJS-like environments where a proper `window`
120 // is present, execute the factory and get jQuery.
121 // For environments that do not have a `window` with a `document`
122 // (such as Node.js), expose a factory as module.exports.
123 // This accentuates the need for the creation of a real `window`.
124 // e.g. var jQuery = require("jquery")(window);
125 // See ticket #14549 for more info.
126 module.exports = global.document ?
127 factory( global, true ) :
128 function( w ) {
129 if ( !w.document ) {
130 throw new Error( "jQuery requires a window with a document" );
131 }
132 return factory( w );
133 };
134 } else {
135 factory( global );
136 }
137
138// Pass this if window is not defined yet
139} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
140
141// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
142// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
143// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
144// enough that all such attempts are guarded in a try block.
145"use strict";
146
147var arr = [];
148
149var document = window.document;
150
151var getProto = Object.getPrototypeOf;
152
153var slice = arr.slice;
154
155var concat = arr.concat;
156
157var push = arr.push;
158
159var indexOf = arr.indexOf;
160
161var class2type = {};
162
163var toString = class2type.toString;
164
165var hasOwn = class2type.hasOwnProperty;
166
167var fnToString = hasOwn.toString;
168
169var ObjectFunctionString = fnToString.call( Object );
170
171var support = {};
172
173var isFunction = function isFunction( obj ) {
174
175 // Support: Chrome <=57, Firefox <=52
176 // In some browsers, typeof returns "function" for HTML <object> elements
177 // (i.e., `typeof document.createElement( "object" ) === "function"`).
178 // We don't want to classify *any* DOM node as a function.
179 return typeof obj === "function" && typeof obj.nodeType !== "number";
180 };
181
182
183var isWindow = function isWindow( obj ) {
184 return obj != null && obj === obj.window;
185 };
186
187
188
189
190 var preservedScriptAttributes = {
191 type: true,
192 src: true,
193 nonce: true,
194 noModule: true
195 };
196
197 function DOMEval( code, node, doc ) {
198 doc = doc || document;
199
200 var i, val,
201 script = doc.createElement( "script" );
202
203 script.text = code;
204 if ( node ) {
205 for ( i in preservedScriptAttributes ) {
206
207 // Support: Firefox 64+, Edge 18+
208 // Some browsers don't support the "nonce" property on scripts.
209 // On the other hand, just using `getAttribute` is not enough as
210 // the `nonce` attribute is reset to an empty string whenever it
211 // becomes browsing-context connected.
212 // See https://github.com/whatwg/html/issues/2369
213 // See https://html.spec.whatwg.org/#nonce-attributes
214 // The `node.getAttribute` check was added for the sake of
215 // `jQuery.globalEval` so that it can fake a nonce-containing node
216 // via an object.
217 val = node[ i ] || node.getAttribute && node.getAttribute( i );
218 if ( val ) {
219 script.setAttribute( i, val );
220 }
221 }
222 }
223 doc.head.appendChild( script ).parentNode.removeChild( script );
224 }
225
226
227function toType( obj ) {
228 if ( obj == null ) {
229 return obj + "";
230 }
231
232 // Support: Android <=2.3 only (functionish RegExp)
233 return typeof obj === "object" || typeof obj === "function" ?
234 class2type[ toString.call( obj ) ] || "object" :
235 typeof obj;
236}
237/* global Symbol */
238// Defining this global in .eslintrc.json would create a danger of using the global
239// unguarded in another place, it seems safer to define global only for this module
240
241
242
243var
244 version = "3.4.1",
245
246 // Define a local copy of jQuery
247 jQuery = function( selector, context ) {
248
249 // The jQuery object is actually just the init constructor 'enhanced'
250 // Need init if jQuery is called (just allow error to be thrown if not included)
251 return new jQuery.fn.init( selector, context );
252 },
253
254 // Support: Android <=4.0 only
255 // Make sure we trim BOM and NBSP
256 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
257
258jQuery.fn = jQuery.prototype = {
259
260 // The current version of jQuery being used
261 jquery: version,
262
263 constructor: jQuery,
264
265 // The default length of a jQuery object is 0
266 length: 0,
267
268 toArray: function() {
269 return slice.call( this );
270 },
271
272 // Get the Nth element in the matched element set OR
273 // Get the whole matched element set as a clean array
274 get: function( num ) {
275
276 // Return all the elements in a clean array
277 if ( num == null ) {
278 return slice.call( this );
279 }
280
281 // Return just the one element from the set
282 return num < 0 ? this[ num + this.length ] : this[ num ];
283 },
284
285 // Take an array of elements and push it onto the stack
286 // (returning the new matched element set)
287 pushStack: function( elems ) {
288
289 // Build a new jQuery matched element set
290 var ret = jQuery.merge( this.constructor(), elems );
291
292 // Add the old object onto the stack (as a reference)
293 ret.prevObject = this;
294
295 // Return the newly-formed element set
296 return ret;
297 },
298
299 // Execute a callback for every element in the matched set.
300 each: function( callback ) {
301 return jQuery.each( this, callback );
302 },
303
304 map: function( callback ) {
305 return this.pushStack( jQuery.map( this, function( elem, i ) {
306 return callback.call( elem, i, elem );
307 } ) );
308 },
309
310 slice: function() {
311 return this.pushStack( slice.apply( this, arguments ) );
312 },
313
314 first: function() {
315 return this.eq( 0 );
316 },
317
318 last: function() {
319 return this.eq( -1 );
320 },
321
322 eq: function( i ) {
323 var len = this.length,
324 j = +i + ( i < 0 ? len : 0 );
325 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
326 },
327
328 end: function() {
329 return this.prevObject || this.constructor();
330 },
331
332 // For internal use only.
333 // Behaves like an Array's method, not like a jQuery method.
334 push: push,
335 sort: arr.sort,
336 splice: arr.splice
337};
338
339jQuery.extend = jQuery.fn.extend = function() {
340 var options, name, src, copy, copyIsArray, clone,
341 target = arguments[ 0 ] || {},
342 i = 1,
343 length = arguments.length,
344 deep = false;
345
346 // Handle a deep copy situation
347 if ( typeof target === "boolean" ) {
348 deep = target;
349
350 // Skip the boolean and the target
351 target = arguments[ i ] || {};
352 i++;
353 }
354
355 // Handle case when target is a string or something (possible in deep copy)
356 if ( typeof target !== "object" && !isFunction( target ) ) {
357 target = {};
358 }
359
360 // Extend jQuery itself if only one argument is passed
361 if ( i === length ) {
362 target = this;
363 i--;
364 }
365
366 for ( ; i < length; i++ ) {
367
368 // Only deal with non-null/undefined values
369 if ( ( options = arguments[ i ] ) != null ) {
370
371 // Extend the base object
372 for ( name in options ) {
373 copy = options[ name ];
374
375 // Prevent Object.prototype pollution
376 // Prevent never-ending loop
377 if ( name === "__proto__" || target === copy ) {
378 continue;
379 }
380
381 // Recurse if we're merging plain objects or arrays
382 if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
383 ( copyIsArray = Array.isArray( copy ) ) ) ) {
384 src = target[ name ];
385
386 // Ensure proper type for the source value
387 if ( copyIsArray && !Array.isArray( src ) ) {
388 clone = [];
389 } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
390 clone = {};
391 } else {
392 clone = src;
393 }
394 copyIsArray = false;
395
396 // Never move original objects, clone them
397 target[ name ] = jQuery.extend( deep, clone, copy );
398
399 // Don't bring in undefined values
400 } else if ( copy !== undefined ) {
401 target[ name ] = copy;
402 }
403 }
404 }
405 }
406
407 // Return the modified object
408 return target;
409};
410
411jQuery.extend( {
412
413 // Unique for each copy of jQuery on the page
414 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
415
416 // Assume jQuery is ready without the ready module
417 isReady: true,
418
419 error: function( msg ) {
420 throw new Error( msg );
421 },
422
423 noop: function() {},
424
425 isPlainObject: function( obj ) {
426 var proto, Ctor;
427
428 // Detect obvious negatives
429 // Use toString instead of jQuery.type to catch host objects
430 if ( !obj || toString.call( obj ) !== "[object Object]" ) {
431 return false;
432 }
433
434 proto = getProto( obj );
435
436 // Objects with no prototype (e.g., `Object.create( null )`) are plain
437 if ( !proto ) {
438 return true;
439 }
440
441 // Objects with prototype are plain iff they were constructed by a global Object function
442 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
443 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
444 },
445
446 isEmptyObject: function( obj ) {
447 var name;
448
449 for ( name in obj ) {
450 return false;
451 }
452 return true;
453 },
454
455 // Evaluates a script in a global context
456 globalEval: function( code, options ) {
457 DOMEval( code, { nonce: options && options.nonce } );
458 },
459
460 each: function( obj, callback ) {
461 var length, i = 0;
462
463 if ( isArrayLike( obj ) ) {
464 length = obj.length;
465 for ( ; i < length; i++ ) {
466 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
467 break;
468 }
469 }
470 } else {
471 for ( i in obj ) {
472 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
473 break;
474 }
475 }
476 }
477
478 return obj;
479 },
480
481 // Support: Android <=4.0 only
482 trim: function( text ) {
483 return text == null ?
484 "" :
485 ( text + "" ).replace( rtrim, "" );
486 },
487
488 // results is for internal usage only
489 makeArray: function( arr, results ) {
490 var ret = results || [];
491
492 if ( arr != null ) {
493 if ( isArrayLike( Object( arr ) ) ) {
494 jQuery.merge( ret,
495 typeof arr === "string" ?
496 [ arr ] : arr
497 );
498 } else {
499 push.call( ret, arr );
500 }
501 }
502
503 return ret;
504 },
505
506 inArray: function( elem, arr, i ) {
507 return arr == null ? -1 : indexOf.call( arr, elem, i );
508 },
509
510 // Support: Android <=4.0 only, PhantomJS 1 only
511 // push.apply(_, arraylike) throws on ancient WebKit
512 merge: function( first, second ) {
513 var len = +second.length,
514 j = 0,
515 i = first.length;
516
517 for ( ; j < len; j++ ) {
518 first[ i++ ] = second[ j ];
519 }
520
521 first.length = i;
522
523 return first;
524 },
525
526 grep: function( elems, callback, invert ) {
527 var callbackInverse,
528 matches = [],
529 i = 0,
530 length = elems.length,
531 callbackExpect = !invert;
532
533 // Go through the array, only saving the items
534 // that pass the validator function
535 for ( ; i < length; i++ ) {
536 callbackInverse = !callback( elems[ i ], i );
537 if ( callbackInverse !== callbackExpect ) {
538 matches.push( elems[ i ] );
539 }
540 }
541
542 return matches;
543 },
544
545 // arg is for internal usage only
546 map: function( elems, callback, arg ) {
547 var length, value,
548 i = 0,
549 ret = [];
550
551 // Go through the array, translating each of the items to their new values
552 if ( isArrayLike( elems ) ) {
553 length = elems.length;
554 for ( ; i < length; i++ ) {
555 value = callback( elems[ i ], i, arg );
556
557 if ( value != null ) {
558 ret.push( value );
559 }
560 }
561
562 // Go through every key on the object,
563 } else {
564 for ( i in elems ) {
565 value = callback( elems[ i ], i, arg );
566
567 if ( value != null ) {
568 ret.push( value );
569 }
570 }
571 }
572
573 // Flatten any nested arrays
574 return concat.apply( [], ret );
575 },
576
577 // A global GUID counter for objects
578 guid: 1,
579
580 // jQuery.support is not used in Core but other projects attach their
581 // properties to it so it needs to exist.
582 support: support
583} );
584
585if ( typeof Symbol === "function" ) {
586 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
587}
588
589// Populate the class2type map
590jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
591function( i, name ) {
592 class2type[ "[object " + name + "]" ] = name.toLowerCase();
593} );
594
595function isArrayLike( obj ) {
596
597 // Support: real iOS 8.2 only (not reproducible in simulator)
598 // `in` check used to prevent JIT error (gh-2145)
599 // hasOwn isn't used here due to false negatives
600 // regarding Nodelist length in IE
601 var length = !!obj && "length" in obj && obj.length,
602 type = toType( obj );
603
604 if ( isFunction( obj ) || isWindow( obj ) ) {
605 return false;
606 }
607
608 return type === "array" || length === 0 ||
609 typeof length === "number" && length > 0 && ( length - 1 ) in obj;
610}
611var Sizzle =
612/*!
613 * Sizzle CSS Selector Engine v2.3.4
614 * https://sizzlejs.com/
615 *
616 * Copyright JS Foundation and other contributors
617 * Released under the MIT license
618 * https://js.foundation/
619 *
620 * Date: 2019-04-08
621 */
622(function( window ) {
623
624var i,
625 support,
626 Expr,
627 getText,
628 isXML,
629 tokenize,
630 compile,
631 select,
632 outermostContext,
633 sortInput,
634 hasDuplicate,
635
636 // Local document vars
637 setDocument,
638 document,
639 docElem,
640 documentIsHTML,
641 rbuggyQSA,
642 rbuggyMatches,
643 matches,
644 contains,
645
646 // Instance-specific data
647 expando = "sizzle" + 1 * new Date(),
648 preferredDoc = window.document,
649 dirruns = 0,
650 done = 0,
651 classCache = createCache(),
652 tokenCache = createCache(),
653 compilerCache = createCache(),
654 nonnativeSelectorCache = createCache(),
655 sortOrder = function( a, b ) {
656 if ( a === b ) {
657 hasDuplicate = true;
658 }
659 return 0;
660 },
661
662 // Instance methods
663 hasOwn = ({}).hasOwnProperty,
664 arr = [],
665 pop = arr.pop,
666 push_native = arr.push,
667 push = arr.push,
668 slice = arr.slice,
669 // Use a stripped-down indexOf as it's faster than native
670 // https://jsperf.com/thor-indexof-vs-for/5
671 indexOf = function( list, elem ) {
672 var i = 0,
673 len = list.length;
674 for ( ; i < len; i++ ) {
675 if ( list[i] === elem ) {
676 return i;
677 }
678 }
679 return -1;
680 },
681
682 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
683
684 // Regular expressions
685
686 // http://www.w3.org/TR/css3-selectors/#whitespace
687 whitespace = "[\\x20\\t\\r\\n\\f]",
688
689 // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
690 identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+",
691
692 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
693 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
694 // Operator (capture 2)
695 "*([*^$|!~]?=)" + whitespace +
696 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
697 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
698 "*\\]",
699
700 pseudos = ":(" + identifier + ")(?:\\((" +
701 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
702 // 1. quoted (capture 3; capture 4 or capture 5)
703 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
704 // 2. simple (capture 6)
705 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
706 // 3. anything else (capture 2)
707 ".*" +
708 ")\\)|)",
709
710 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
711 rwhitespace = new RegExp( whitespace + "+", "g" ),
712 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
713
714 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
715 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
716 rdescend = new RegExp( whitespace + "|>" ),
717
718 rpseudo = new RegExp( pseudos ),
719 ridentifier = new RegExp( "^" + identifier + "$" ),
720
721 matchExpr = {
722 "ID": new RegExp( "^#(" + identifier + ")" ),
723 "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
724 "TAG": new RegExp( "^(" + identifier + "|[*])" ),
725 "ATTR": new RegExp( "^" + attributes ),
726 "PSEUDO": new RegExp( "^" + pseudos ),
727 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
728 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
729 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
730 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
731 // For use in libraries implementing .is()
732 // We use this for POS matching in `select`
733 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
734 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
735 },
736
737 rhtml = /HTML$/i,
738 rinputs = /^(?:input|select|textarea|button)$/i,
739 rheader = /^h\d$/i,
740
741 rnative = /^[^{]+\{\s*\[native \w/,
742
743 // Easily-parseable/retrievable ID or TAG or CLASS selectors
744 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
745
746 rsibling = /[+~]/,
747
748 // CSS escapes
749 // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
750 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
751 funescape = function( _, escaped, escapedWhitespace ) {
752 var high = "0x" + escaped - 0x10000;
753 // NaN means non-codepoint
754 // Support: Firefox<24
755 // Workaround erroneous numeric interpretation of +"0x"
756 return high !== high || escapedWhitespace ?
757 escaped :
758 high < 0 ?
759 // BMP codepoint
760 String.fromCharCode( high + 0x10000 ) :
761 // Supplemental Plane codepoint (surrogate pair)
762 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
763 },
764
765 // CSS string/identifier serialization
766 // https://drafts.csswg.org/cssom/#common-serializing-idioms
767 rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
768 fcssescape = function( ch, asCodePoint ) {
769 if ( asCodePoint ) {
770
771 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
772 if ( ch === "\0" ) {
773 return "\uFFFD";
774 }
775
776 // Control characters and (dependent upon position) numbers get escaped as code points
777 return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
778 }
779
780 // Other potentially-special ASCII characters get backslash-escaped
781 return "\\" + ch;
782 },
783
784 // Used for iframes
785 // See setDocument()
786 // Removing the function wrapper causes a "Permission Denied"
787 // error in IE
788 unloadHandler = function() {
789 setDocument();
790 },
791
792 inDisabledFieldset = addCombinator(
793 function( elem ) {
794 return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
795 },
796 { dir: "parentNode", next: "legend" }
797 );
798
799// Optimize for push.apply( _, NodeList )
800try {
801 push.apply(
802 (arr = slice.call( preferredDoc.childNodes )),
803 preferredDoc.childNodes
804 );
805 // Support: Android<4.0
806 // Detect silently failing push.apply
807 arr[ preferredDoc.childNodes.length ].nodeType;
808} catch ( e ) {
809 push = { apply: arr.length ?
810
811 // Leverage slice if possible
812 function( target, els ) {
813 push_native.apply( target, slice.call(els) );
814 } :
815
816 // Support: IE<9
817 // Otherwise append directly
818 function( target, els ) {
819 var j = target.length,
820 i = 0;
821 // Can't trust NodeList.length
822 while ( (target[j++] = els[i++]) ) {}
823 target.length = j - 1;
824 }
825 };
826}
827
828function Sizzle( selector, context, results, seed ) {
829 var m, i, elem, nid, match, groups, newSelector,
830 newContext = context && context.ownerDocument,
831
832 // nodeType defaults to 9, since context defaults to document
833 nodeType = context ? context.nodeType : 9;
834
835 results = results || [];
836
837 // Return early from calls with invalid selector or context
838 if ( typeof selector !== "string" || !selector ||
839 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
840
841 return results;
842 }
843
844 // Try to shortcut find operations (as opposed to filters) in HTML documents
845 if ( !seed ) {
846
847 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
848 setDocument( context );
849 }
850 context = context || document;
851
852 if ( documentIsHTML ) {
853
854 // If the selector is sufficiently simple, try using a "get*By*" DOM method
855 // (excepting DocumentFragment context, where the methods don't exist)
856 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
857
858 // ID selector
859 if ( (m = match[1]) ) {
860
861 // Document context
862 if ( nodeType === 9 ) {
863 if ( (elem = context.getElementById( m )) ) {
864
865 // Support: IE, Opera, Webkit
866 // TODO: identify versions
867 // getElementById can match elements by name instead of ID
868 if ( elem.id === m ) {
869 results.push( elem );
870 return results;
871 }
872 } else {
873 return results;
874 }
875
876 // Element context
877 } else {
878
879 // Support: IE, Opera, Webkit
880 // TODO: identify versions
881 // getElementById can match elements by name instead of ID
882 if ( newContext && (elem = newContext.getElementById( m )) &&
883 contains( context, elem ) &&
884 elem.id === m ) {
885
886 results.push( elem );
887 return results;
888 }
889 }
890
891 // Type selector
892 } else if ( match[2] ) {
893 push.apply( results, context.getElementsByTagName( selector ) );
894 return results;
895
896 // Class selector
897 } else if ( (m = match[3]) && support.getElementsByClassName &&
898 context.getElementsByClassName ) {
899
900 push.apply( results, context.getElementsByClassName( m ) );
901 return results;
902 }
903 }
904
905 // Take advantage of querySelectorAll
906 if ( support.qsa &&
907 !nonnativeSelectorCache[ selector + " " ] &&
908 (!rbuggyQSA || !rbuggyQSA.test( selector )) &&
909
910 // Support: IE 8 only
911 // Exclude object elements
912 (nodeType !== 1 || context.nodeName.toLowerCase() !== "object") ) {
913
914 newSelector = selector;
915 newContext = context;
916
917 // qSA considers elements outside a scoping root when evaluating child or
918 // descendant combinators, which is not what we want.
919 // In such cases, we work around the behavior by prefixing every selector in the
920 // list with an ID selector referencing the scope context.
921 // Thanks to Andrew Dupont for this technique.
922 if ( nodeType === 1 && rdescend.test( selector ) ) {
923
924 // Capture the context ID, setting it first if necessary
925 if ( (nid = context.getAttribute( "id" )) ) {
926 nid = nid.replace( rcssescape, fcssescape );
927 } else {
928 context.setAttribute( "id", (nid = expando) );
929 }
930
931 // Prefix every selector in the list
932 groups = tokenize( selector );
933 i = groups.length;
934 while ( i-- ) {
935 groups[i] = "#" + nid + " " + toSelector( groups[i] );
936 }
937 newSelector = groups.join( "," );
938
939 // Expand context for sibling selectors
940 newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
941 context;
942 }
943
944 try {
945 push.apply( results,
946 newContext.querySelectorAll( newSelector )
947 );
948 return results;
949 } catch ( qsaError ) {
950 nonnativeSelectorCache( selector, true );
951 } finally {
952 if ( nid === expando ) {
953 context.removeAttribute( "id" );
954 }
955 }
956 }
957 }
958 }
959
960 // All others
961 return select( selector.replace( rtrim, "$1" ), context, results, seed );
962}
963
964/**
965 * Create key-value caches of limited size
966 * @returns {function(string, object)} Returns the Object data after storing it on itself with
967 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
968 * deleting the oldest entry
969 */
970function createCache() {
971 var keys = [];
972
973 function cache( key, value ) {
974 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
975 if ( keys.push( key + " " ) > Expr.cacheLength ) {
976 // Only keep the most recent entries
977 delete cache[ keys.shift() ];
978 }
979 return (cache[ key + " " ] = value);
980 }
981 return cache;
982}
983
984/**
985 * Mark a function for special use by Sizzle
986 * @param {Function} fn The function to mark
987 */
988function markFunction( fn ) {
989 fn[ expando ] = true;
990 return fn;
991}
992
993/**
994 * Support testing using an element
995 * @param {Function} fn Passed the created element and returns a boolean result
996 */
997function assert( fn ) {
998 var el = document.createElement("fieldset");
999
1000 try {
1001 return !!fn( el );
1002 } catch (e) {
1003 return false;
1004 } finally {
1005 // Remove from its parent by default
1006 if ( el.parentNode ) {
1007 el.parentNode.removeChild( el );
1008 }
1009 // release memory in IE
1010 el = null;
1011 }
1012}
1013
1014/**
1015 * Adds the same handler for all of the specified attrs
1016 * @param {String} attrs Pipe-separated list of attributes
1017 * @param {Function} handler The method that will be applied
1018 */
1019function addHandle( attrs, handler ) {
1020 var arr = attrs.split("|"),
1021 i = arr.length;
1022
1023 while ( i-- ) {
1024 Expr.attrHandle[ arr[i] ] = handler;
1025 }
1026}
1027
1028/**
1029 * Checks document order of two siblings
1030 * @param {Element} a
1031 * @param {Element} b
1032 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
1033 */
1034function siblingCheck( a, b ) {
1035 var cur = b && a,
1036 diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
1037 a.sourceIndex - b.sourceIndex;
1038
1039 // Use IE sourceIndex if available on both nodes
1040 if ( diff ) {
1041 return diff;
1042 }
1043
1044 // Check if b follows a
1045 if ( cur ) {
1046 while ( (cur = cur.nextSibling) ) {
1047 if ( cur === b ) {
1048 return -1;
1049 }
1050 }
1051 }
1052
1053 return a ? 1 : -1;
1054}
1055
1056/**
1057 * Returns a function to use in pseudos for input types
1058 * @param {String} type
1059 */
1060function createInputPseudo( type ) {
1061 return function( elem ) {
1062 var name = elem.nodeName.toLowerCase();
1063 return name === "input" && elem.type === type;
1064 };
1065}
1066
1067/**
1068 * Returns a function to use in pseudos for buttons
1069 * @param {String} type
1070 */
1071function createButtonPseudo( type ) {
1072 return function( elem ) {
1073 var name = elem.nodeName.toLowerCase();
1074 return (name === "input" || name === "button") && elem.type === type;
1075 };
1076}
1077
1078/**
1079 * Returns a function to use in pseudos for :enabled/:disabled
1080 * @param {Boolean} disabled true for :disabled; false for :enabled
1081 */
1082function createDisabledPseudo( disabled ) {
1083
1084 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
1085 return function( elem ) {
1086
1087 // Only certain elements can match :enabled or :disabled
1088 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
1089 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
1090 if ( "form" in elem ) {
1091
1092 // Check for inherited disabledness on relevant non-disabled elements:
1093 // * listed form-associated elements in a disabled fieldset
1094 // https://html.spec.whatwg.org/multipage/forms.html#category-listed
1095 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
1096 // * option elements in a disabled optgroup
1097 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
1098 // All such elements have a "form" property.
1099 if ( elem.parentNode && elem.disabled === false ) {
1100
1101 // Option elements defer to a parent optgroup if present
1102 if ( "label" in elem ) {
1103 if ( "label" in elem.parentNode ) {
1104 return elem.parentNode.disabled === disabled;
1105 } else {
1106 return elem.disabled === disabled;
1107 }
1108 }
1109
1110 // Support: IE 6 - 11
1111 // Use the isDisabled shortcut property to check for disabled fieldset ancestors
1112 return elem.isDisabled === disabled ||
1113
1114 // Where there is no isDisabled, check manually
1115 /* jshint -W018 */
1116 elem.isDisabled !== !disabled &&
1117 inDisabledFieldset( elem ) === disabled;
1118 }
1119
1120 return elem.disabled === disabled;
1121
1122 // Try to winnow out elements that can't be disabled before trusting the disabled property.
1123 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
1124 // even exist on them, let alone have a boolean value.
1125 } else if ( "label" in elem ) {
1126 return elem.disabled === disabled;
1127 }
1128
1129 // Remaining elements are neither :enabled nor :disabled
1130 return false;
1131 };
1132}
1133
1134/**
1135 * Returns a function to use in pseudos for positionals
1136 * @param {Function} fn
1137 */
1138function createPositionalPseudo( fn ) {
1139 return markFunction(function( argument ) {
1140 argument = +argument;
1141 return markFunction(function( seed, matches ) {
1142 var j,
1143 matchIndexes = fn( [], seed.length, argument ),
1144 i = matchIndexes.length;
1145
1146 // Match elements found at the specified indexes
1147 while ( i-- ) {
1148 if ( seed[ (j = matchIndexes[i]) ] ) {
1149 seed[j] = !(matches[j] = seed[j]);
1150 }
1151 }
1152 });
1153 });
1154}
1155
1156/**
1157 * Checks a node for validity as a Sizzle context
1158 * @param {Element|Object=} context
1159 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
1160 */
1161function testContext( context ) {
1162 return context && typeof context.getElementsByTagName !== "undefined" && context;
1163}
1164
1165// Expose support vars for convenience
1166support = Sizzle.support = {};
1167
1168/**
1169 * Detects XML nodes
1170 * @param {Element|Object} elem An element or a document
1171 * @returns {Boolean} True iff elem is a non-HTML XML node
1172 */
1173isXML = Sizzle.isXML = function( elem ) {
1174 var namespace = elem.namespaceURI,
1175 docElem = (elem.ownerDocument || elem).documentElement;
1176
1177 // Support: IE <=8
1178 // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
1179 // https://bugs.jquery.com/ticket/4833
1180 return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
1181};
1182
1183/**
1184 * Sets document-related variables once based on the current document
1185 * @param {Element|Object} [doc] An element or document object to use to set the document
1186 * @returns {Object} Returns the current document
1187 */
1188setDocument = Sizzle.setDocument = function( node ) {
1189 var hasCompare, subWindow,
1190 doc = node ? node.ownerDocument || node : preferredDoc;
1191
1192 // Return early if doc is invalid or already selected
1193 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
1194 return document;
1195 }
1196
1197 // Update global variables
1198 document = doc;
1199 docElem = document.documentElement;
1200 documentIsHTML = !isXML( document );
1201
1202 // Support: IE 9-11, Edge
1203 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
1204 if ( preferredDoc !== document &&
1205 (subWindow = document.defaultView) && subWindow.top !== subWindow ) {
1206
1207 // Support: IE 11, Edge
1208 if ( subWindow.addEventListener ) {
1209 subWindow.addEventListener( "unload", unloadHandler, false );
1210
1211 // Support: IE 9 - 10 only
1212 } else if ( subWindow.attachEvent ) {
1213 subWindow.attachEvent( "onunload", unloadHandler );
1214 }
1215 }
1216
1217 /* Attributes
1218 ---------------------------------------------------------------------- */
1219
1220 // Support: IE<8
1221 // Verify that getAttribute really returns attributes and not properties
1222 // (excepting IE8 booleans)
1223 support.attributes = assert(function( el ) {
1224 el.className = "i";
1225 return !el.getAttribute("className");
1226 });
1227
1228 /* getElement(s)By*
1229 ---------------------------------------------------------------------- */
1230
1231 // Check if getElementsByTagName("*") returns only elements
1232 support.getElementsByTagName = assert(function( el ) {
1233 el.appendChild( document.createComment("") );
1234 return !el.getElementsByTagName("*").length;
1235 });
1236
1237 // Support: IE<9
1238 support.getElementsByClassName = rnative.test( document.getElementsByClassName );
1239
1240 // Support: IE<10
1241 // Check if getElementById returns elements by name
1242 // The broken getElementById methods don't pick up programmatically-set names,
1243 // so use a roundabout getElementsByName test
1244 support.getById = assert(function( el ) {
1245 docElem.appendChild( el ).id = expando;
1246 return !document.getElementsByName || !document.getElementsByName( expando ).length;
1247 });
1248
1249 // ID filter and find
1250 if ( support.getById ) {
1251 Expr.filter["ID"] = function( id ) {
1252 var attrId = id.replace( runescape, funescape );
1253 return function( elem ) {
1254 return elem.getAttribute("id") === attrId;
1255 };
1256 };
1257 Expr.find["ID"] = function( id, context ) {
1258 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
1259 var elem = context.getElementById( id );
1260 return elem ? [ elem ] : [];
1261 }
1262 };
1263 } else {
1264 Expr.filter["ID"] = function( id ) {
1265 var attrId = id.replace( runescape, funescape );
1266 return function( elem ) {
1267 var node = typeof elem.getAttributeNode !== "undefined" &&
1268 elem.getAttributeNode("id");
1269 return node && node.value === attrId;
1270 };
1271 };
1272
1273 // Support: IE 6 - 7 only
1274 // getElementById is not reliable as a find shortcut
1275 Expr.find["ID"] = function( id, context ) {
1276 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
1277 var node, i, elems,
1278 elem = context.getElementById( id );
1279
1280 if ( elem ) {
1281
1282 // Verify the id attribute
1283 node = elem.getAttributeNode("id");
1284 if ( node && node.value === id ) {
1285 return [ elem ];
1286 }
1287
1288 // Fall back on getElementsByName
1289 elems = context.getElementsByName( id );
1290 i = 0;
1291 while ( (elem = elems[i++]) ) {
1292 node = elem.getAttributeNode("id");
1293 if ( node && node.value === id ) {
1294 return [ elem ];
1295 }
1296 }
1297 }
1298
1299 return [];
1300 }
1301 };
1302 }
1303
1304 // Tag
1305 Expr.find["TAG"] = support.getElementsByTagName ?
1306 function( tag, context ) {
1307 if ( typeof context.getElementsByTagName !== "undefined" ) {
1308 return context.getElementsByTagName( tag );
1309
1310 // DocumentFragment nodes don't have gEBTN
1311 } else if ( support.qsa ) {
1312 return context.querySelectorAll( tag );
1313 }
1314 } :
1315
1316 function( tag, context ) {
1317 var elem,
1318 tmp = [],
1319 i = 0,
1320 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
1321 results = context.getElementsByTagName( tag );
1322
1323 // Filter out possible comments
1324 if ( tag === "*" ) {
1325 while ( (elem = results[i++]) ) {
1326 if ( elem.nodeType === 1 ) {
1327 tmp.push( elem );
1328 }
1329 }
1330
1331 return tmp;
1332 }
1333 return results;
1334 };
1335
1336 // Class
1337 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
1338 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
1339 return context.getElementsByClassName( className );
1340 }
1341 };
1342
1343 /* QSA/matchesSelector
1344 ---------------------------------------------------------------------- */
1345
1346 // QSA and matchesSelector support
1347
1348 // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
1349 rbuggyMatches = [];
1350
1351 // qSa(:focus) reports false when true (Chrome 21)
1352 // We allow this because of a bug in IE8/9 that throws an error
1353 // whenever `document.activeElement` is accessed on an iframe
1354 // So, we allow :focus to pass through QSA all the time to avoid the IE error
1355 // See https://bugs.jquery.com/ticket/13378
1356 rbuggyQSA = [];
1357
1358 if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
1359 // Build QSA regex
1360 // Regex strategy adopted from Diego Perini
1361 assert(function( el ) {
1362 // Select is set to empty string on purpose
1363 // This is to test IE's treatment of not explicitly
1364 // setting a boolean content attribute,
1365 // since its presence should be enough
1366 // https://bugs.jquery.com/ticket/12359
1367 docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
1368 "<select id='" + expando + "-\r\\' msallowcapture=''>" +
1369 "<option selected=''></option></select>";
1370
1371 // Support: IE8, Opera 11-12.16
1372 // Nothing should be selected when empty strings follow ^= or $= or *=
1373 // The test attribute must be unknown in Opera but "safe" for WinRT
1374 // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
1375 if ( el.querySelectorAll("[msallowcapture^='']").length ) {
1376 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
1377 }
1378
1379 // Support: IE8
1380 // Boolean attributes and "value" are not treated correctly
1381 if ( !el.querySelectorAll("[selected]").length ) {
1382 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
1383 }
1384
1385 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
1386 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
1387 rbuggyQSA.push("~=");
1388 }
1389
1390 // Webkit/Opera - :checked should return selected option elements
1391 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1392 // IE8 throws error here and will not see later tests
1393 if ( !el.querySelectorAll(":checked").length ) {
1394 rbuggyQSA.push(":checked");
1395 }
1396
1397 // Support: Safari 8+, iOS 8+
1398 // https://bugs.webkit.org/show_bug.cgi?id=136851
1399 // In-page `selector#id sibling-combinator selector` fails
1400 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
1401 rbuggyQSA.push(".#.+[+~]");
1402 }
1403 });
1404
1405 assert(function( el ) {
1406 el.innerHTML = "<a href='' disabled='disabled'></a>" +
1407 "<select disabled='disabled'><option/></select>";
1408
1409 // Support: Windows 8 Native Apps
1410 // The type and name attributes are restricted during .innerHTML assignment
1411 var input = document.createElement("input");
1412 input.setAttribute( "type", "hidden" );
1413 el.appendChild( input ).setAttribute( "name", "D" );
1414
1415 // Support: IE8
1416 // Enforce case-sensitivity of name attribute
1417 if ( el.querySelectorAll("[name=d]").length ) {
1418 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
1419 }
1420
1421 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
1422 // IE8 throws error here and will not see later tests
1423 if ( el.querySelectorAll(":enabled").length !== 2 ) {
1424 rbuggyQSA.push( ":enabled", ":disabled" );
1425 }
1426
1427 // Support: IE9-11+
1428 // IE's :disabled selector does not pick up the children of disabled fieldsets
1429 docElem.appendChild( el ).disabled = true;
1430 if ( el.querySelectorAll(":disabled").length !== 2 ) {
1431 rbuggyQSA.push( ":enabled", ":disabled" );
1432 }
1433
1434 // Opera 10-11 does not throw on post-comma invalid pseudos
1435 el.querySelectorAll("*,:x");
1436 rbuggyQSA.push(",.*:");
1437 });
1438 }
1439
1440 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
1441 docElem.webkitMatchesSelector ||
1442 docElem.mozMatchesSelector ||
1443 docElem.oMatchesSelector ||
1444 docElem.msMatchesSelector) )) ) {
1445
1446 assert(function( el ) {
1447 // Check to see if it's possible to do matchesSelector
1448 // on a disconnected node (IE 9)
1449 support.disconnectedMatch = matches.call( el, "*" );
1450
1451 // This should fail with an exception
1452 // Gecko does not error, returns false instead
1453 matches.call( el, "[s!='']:x" );
1454 rbuggyMatches.push( "!=", pseudos );
1455 });
1456 }
1457
1458 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
1459 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
1460
1461 /* Contains
1462 ---------------------------------------------------------------------- */
1463 hasCompare = rnative.test( docElem.compareDocumentPosition );
1464
1465 // Element contains another
1466 // Purposefully self-exclusive
1467 // As in, an element does not contain itself
1468 contains = hasCompare || rnative.test( docElem.contains ) ?
1469 function( a, b ) {
1470 var adown = a.nodeType === 9 ? a.documentElement : a,
1471 bup = b && b.parentNode;
1472 return a === bup || !!( bup && bup.nodeType === 1 && (
1473 adown.contains ?
1474 adown.contains( bup ) :
1475 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
1476 ));
1477 } :
1478 function( a, b ) {
1479 if ( b ) {
1480 while ( (b = b.parentNode) ) {
1481 if ( b === a ) {
1482 return true;
1483 }
1484 }
1485 }
1486 return false;
1487 };
1488
1489 /* Sorting
1490 ---------------------------------------------------------------------- */
1491
1492 // Document order sorting
1493 sortOrder = hasCompare ?
1494 function( a, b ) {
1495
1496 // Flag for duplicate removal
1497 if ( a === b ) {
1498 hasDuplicate = true;
1499 return 0;
1500 }
1501
1502 // Sort on method existence if only one input has compareDocumentPosition
1503 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
1504 if ( compare ) {
1505 return compare;
1506 }
1507
1508 // Calculate position if both inputs belong to the same document
1509 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
1510 a.compareDocumentPosition( b ) :
1511
1512 // Otherwise we know they are disconnected
1513 1;
1514
1515 // Disconnected nodes
1516 if ( compare & 1 ||
1517 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
1518
1519 // Choose the first element that is related to our preferred document
1520 if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
1521 return -1;
1522 }
1523 if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
1524 return 1;
1525 }
1526
1527 // Maintain original order
1528 return sortInput ?
1529 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1530 0;
1531 }
1532
1533 return compare & 4 ? -1 : 1;
1534 } :
1535 function( a, b ) {
1536 // Exit early if the nodes are identical
1537 if ( a === b ) {
1538 hasDuplicate = true;
1539 return 0;
1540 }
1541
1542 var cur,
1543 i = 0,
1544 aup = a.parentNode,
1545 bup = b.parentNode,
1546 ap = [ a ],
1547 bp = [ b ];
1548
1549 // Parentless nodes are either documents or disconnected
1550 if ( !aup || !bup ) {
1551 return a === document ? -1 :
1552 b === document ? 1 :
1553 aup ? -1 :
1554 bup ? 1 :
1555 sortInput ?
1556 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
1557 0;
1558
1559 // If the nodes are siblings, we can do a quick check
1560 } else if ( aup === bup ) {
1561 return siblingCheck( a, b );
1562 }
1563
1564 // Otherwise we need full lists of their ancestors for comparison
1565 cur = a;
1566 while ( (cur = cur.parentNode) ) {
1567 ap.unshift( cur );
1568 }
1569 cur = b;
1570 while ( (cur = cur.parentNode) ) {
1571 bp.unshift( cur );
1572 }
1573
1574 // Walk down the tree looking for a discrepancy
1575 while ( ap[i] === bp[i] ) {
1576 i++;
1577 }
1578
1579 return i ?
1580 // Do a sibling check if the nodes have a common ancestor
1581 siblingCheck( ap[i], bp[i] ) :
1582
1583 // Otherwise nodes in our document sort first
1584 ap[i] === preferredDoc ? -1 :
1585 bp[i] === preferredDoc ? 1 :
1586 0;
1587 };
1588
1589 return document;
1590};
1591
1592Sizzle.matches = function( expr, elements ) {
1593 return Sizzle( expr, null, null, elements );
1594};
1595
1596Sizzle.matchesSelector = function( elem, expr ) {
1597 // Set document vars if needed
1598 if ( ( elem.ownerDocument || elem ) !== document ) {
1599 setDocument( elem );
1600 }
1601
1602 if ( support.matchesSelector && documentIsHTML &&
1603 !nonnativeSelectorCache[ expr + " " ] &&
1604 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
1605 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
1606
1607 try {
1608 var ret = matches.call( elem, expr );
1609
1610 // IE 9's matchesSelector returns false on disconnected nodes
1611 if ( ret || support.disconnectedMatch ||
1612 // As well, disconnected nodes are said to be in a document
1613 // fragment in IE 9
1614 elem.document && elem.document.nodeType !== 11 ) {
1615 return ret;
1616 }
1617 } catch (e) {
1618 nonnativeSelectorCache( expr, true );
1619 }
1620 }
1621
1622 return Sizzle( expr, document, null, [ elem ] ).length > 0;
1623};
1624
1625Sizzle.contains = function( context, elem ) {
1626 // Set document vars if needed
1627 if ( ( context.ownerDocument || context ) !== document ) {
1628 setDocument( context );
1629 }
1630 return contains( context, elem );
1631};
1632
1633Sizzle.attr = function( elem, name ) {
1634 // Set document vars if needed
1635 if ( ( elem.ownerDocument || elem ) !== document ) {
1636 setDocument( elem );
1637 }
1638
1639 var fn = Expr.attrHandle[ name.toLowerCase() ],
1640 // Don't get fooled by Object.prototype properties (jQuery #13807)
1641 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
1642 fn( elem, name, !documentIsHTML ) :
1643 undefined;
1644
1645 return val !== undefined ?
1646 val :
1647 support.attributes || !documentIsHTML ?
1648 elem.getAttribute( name ) :
1649 (val = elem.getAttributeNode(name)) && val.specified ?
1650 val.value :
1651 null;
1652};
1653
1654Sizzle.escape = function( sel ) {
1655 return (sel + "").replace( rcssescape, fcssescape );
1656};
1657
1658Sizzle.error = function( msg ) {
1659 throw new Error( "Syntax error, unrecognized expression: " + msg );
1660};
1661
1662/**
1663 * Document sorting and removing duplicates
1664 * @param {ArrayLike} results
1665 */
1666Sizzle.uniqueSort = function( results ) {
1667 var elem,
1668 duplicates = [],
1669 j = 0,
1670 i = 0;
1671
1672 // Unless we *know* we can detect duplicates, assume their presence
1673 hasDuplicate = !support.detectDuplicates;
1674 sortInput = !support.sortStable && results.slice( 0 );
1675 results.sort( sortOrder );
1676
1677 if ( hasDuplicate ) {
1678 while ( (elem = results[i++]) ) {
1679 if ( elem === results[ i ] ) {
1680 j = duplicates.push( i );
1681 }
1682 }
1683 while ( j-- ) {
1684 results.splice( duplicates[ j ], 1 );
1685 }
1686 }
1687
1688 // Clear input after sorting to release objects
1689 // See https://github.com/jquery/sizzle/pull/225
1690 sortInput = null;
1691
1692 return results;
1693};
1694
1695/**
1696 * Utility function for retrieving the text value of an array of DOM nodes
1697 * @param {Array|Element} elem
1698 */
1699getText = Sizzle.getText = function( elem ) {
1700 var node,
1701 ret = "",
1702 i = 0,
1703 nodeType = elem.nodeType;
1704
1705 if ( !nodeType ) {
1706 // If no nodeType, this is expected to be an array
1707 while ( (node = elem[i++]) ) {
1708 // Do not traverse comment nodes
1709 ret += getText( node );
1710 }
1711 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
1712 // Use textContent for elements
1713 // innerText usage removed for consistency of new lines (jQuery #11153)
1714 if ( typeof elem.textContent === "string" ) {
1715 return elem.textContent;
1716 } else {
1717 // Traverse its children
1718 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1719 ret += getText( elem );
1720 }
1721 }
1722 } else if ( nodeType === 3 || nodeType === 4 ) {
1723 return elem.nodeValue;
1724 }
1725 // Do not include comment or processing instruction nodes
1726
1727 return ret;
1728};
1729
1730Expr = Sizzle.selectors = {
1731
1732 // Can be adjusted by the user
1733 cacheLength: 50,
1734
1735 createPseudo: markFunction,
1736
1737 match: matchExpr,
1738
1739 attrHandle: {},
1740
1741 find: {},
1742
1743 relative: {
1744 ">": { dir: "parentNode", first: true },
1745 " ": { dir: "parentNode" },
1746 "+": { dir: "previousSibling", first: true },
1747 "~": { dir: "previousSibling" }
1748 },
1749
1750 preFilter: {
1751 "ATTR": function( match ) {
1752 match[1] = match[1].replace( runescape, funescape );
1753
1754 // Move the given value to match[3] whether quoted or unquoted
1755 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
1756
1757 if ( match[2] === "~=" ) {
1758 match[3] = " " + match[3] + " ";
1759 }
1760
1761 return match.slice( 0, 4 );
1762 },
1763
1764 "CHILD": function( match ) {
1765 /* matches from matchExpr["CHILD"]
1766 1 type (only|nth|...)
1767 2 what (child|of-type)
1768 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
1769 4 xn-component of xn+y argument ([+-]?\d*n|)
1770 5 sign of xn-component
1771 6 x of xn-component
1772 7 sign of y-component
1773 8 y of y-component
1774 */
1775 match[1] = match[1].toLowerCase();
1776
1777 if ( match[1].slice( 0, 3 ) === "nth" ) {
1778 // nth-* requires argument
1779 if ( !match[3] ) {
1780 Sizzle.error( match[0] );
1781 }
1782
1783 // numeric x and y parameters for Expr.filter.CHILD
1784 // remember that false/true cast respectively to 0/1
1785 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
1786 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
1787
1788 // other types prohibit arguments
1789 } else if ( match[3] ) {
1790 Sizzle.error( match[0] );
1791 }
1792
1793 return match;
1794 },
1795
1796 "PSEUDO": function( match ) {
1797 var excess,
1798 unquoted = !match[6] && match[2];
1799
1800 if ( matchExpr["CHILD"].test( match[0] ) ) {
1801 return null;
1802 }
1803
1804 // Accept quoted arguments as-is
1805 if ( match[3] ) {
1806 match[2] = match[4] || match[5] || "";
1807
1808 // Strip excess characters from unquoted arguments
1809 } else if ( unquoted && rpseudo.test( unquoted ) &&
1810 // Get excess from tokenize (recursively)
1811 (excess = tokenize( unquoted, true )) &&
1812 // advance to the next closing parenthesis
1813 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
1814
1815 // excess is a negative index
1816 match[0] = match[0].slice( 0, excess );
1817 match[2] = unquoted.slice( 0, excess );
1818 }
1819
1820 // Return only captures needed by the pseudo filter method (type and argument)
1821 return match.slice( 0, 3 );
1822 }
1823 },
1824
1825 filter: {
1826
1827 "TAG": function( nodeNameSelector ) {
1828 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
1829 return nodeNameSelector === "*" ?
1830 function() { return true; } :
1831 function( elem ) {
1832 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
1833 };
1834 },
1835
1836 "CLASS": function( className ) {
1837 var pattern = classCache[ className + " " ];
1838
1839 return pattern ||
1840 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
1841 classCache( className, function( elem ) {
1842 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
1843 });
1844 },
1845
1846 "ATTR": function( name, operator, check ) {
1847 return function( elem ) {
1848 var result = Sizzle.attr( elem, name );
1849
1850 if ( result == null ) {
1851 return operator === "!=";
1852 }
1853 if ( !operator ) {
1854 return true;
1855 }
1856
1857 result += "";
1858
1859 return operator === "=" ? result === check :
1860 operator === "!=" ? result !== check :
1861 operator === "^=" ? check && result.indexOf( check ) === 0 :
1862 operator === "*=" ? check && result.indexOf( check ) > -1 :
1863 operator === "$=" ? check && result.slice( -check.length ) === check :
1864 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
1865 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
1866 false;
1867 };
1868 },
1869
1870 "CHILD": function( type, what, argument, first, last ) {
1871 var simple = type.slice( 0, 3 ) !== "nth",
1872 forward = type.slice( -4 ) !== "last",
1873 ofType = what === "of-type";
1874
1875 return first === 1 && last === 0 ?
1876
1877 // Shortcut for :nth-*(n)
1878 function( elem ) {
1879 return !!elem.parentNode;
1880 } :
1881
1882 function( elem, context, xml ) {
1883 var cache, uniqueCache, outerCache, node, nodeIndex, start,
1884 dir = simple !== forward ? "nextSibling" : "previousSibling",
1885 parent = elem.parentNode,
1886 name = ofType && elem.nodeName.toLowerCase(),
1887 useCache = !xml && !ofType,
1888 diff = false;
1889
1890 if ( parent ) {
1891
1892 // :(first|last|only)-(child|of-type)
1893 if ( simple ) {
1894 while ( dir ) {
1895 node = elem;
1896 while ( (node = node[ dir ]) ) {
1897 if ( ofType ?
1898 node.nodeName.toLowerCase() === name :
1899 node.nodeType === 1 ) {
1900
1901 return false;
1902 }
1903 }
1904 // Reverse direction for :only-* (if we haven't yet done so)
1905 start = dir = type === "only" && !start && "nextSibling";
1906 }
1907 return true;
1908 }
1909
1910 start = [ forward ? parent.firstChild : parent.lastChild ];
1911
1912 // non-xml :nth-child(...) stores cache data on `parent`
1913 if ( forward && useCache ) {
1914
1915 // Seek `elem` from a previously-cached index
1916
1917 // ...in a gzip-friendly way
1918 node = parent;
1919 outerCache = node[ expando ] || (node[ expando ] = {});
1920
1921 // Support: IE <9 only
1922 // Defend against cloned attroperties (jQuery gh-1709)
1923 uniqueCache = outerCache[ node.uniqueID ] ||
1924 (outerCache[ node.uniqueID ] = {});
1925
1926 cache = uniqueCache[ type ] || [];
1927 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
1928 diff = nodeIndex && cache[ 2 ];
1929 node = nodeIndex && parent.childNodes[ nodeIndex ];
1930
1931 while ( (node = ++nodeIndex && node && node[ dir ] ||
1932
1933 // Fallback to seeking `elem` from the start
1934 (diff = nodeIndex = 0) || start.pop()) ) {
1935
1936 // When found, cache indexes on `parent` and break
1937 if ( node.nodeType === 1 && ++diff && node === elem ) {
1938 uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
1939 break;
1940 }
1941 }
1942
1943 } else {
1944 // Use previously-cached element index if available
1945 if ( useCache ) {
1946 // ...in a gzip-friendly way
1947 node = elem;
1948 outerCache = node[ expando ] || (node[ expando ] = {});
1949
1950 // Support: IE <9 only
1951 // Defend against cloned attroperties (jQuery gh-1709)
1952 uniqueCache = outerCache[ node.uniqueID ] ||
1953 (outerCache[ node.uniqueID ] = {});
1954
1955 cache = uniqueCache[ type ] || [];
1956 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
1957 diff = nodeIndex;
1958 }
1959
1960 // xml :nth-child(...)
1961 // or :nth-last-child(...) or :nth(-last)?-of-type(...)
1962 if ( diff === false ) {
1963 // Use the same loop as above to seek `elem` from the start
1964 while ( (node = ++nodeIndex && node && node[ dir ] ||
1965 (diff = nodeIndex = 0) || start.pop()) ) {
1966
1967 if ( ( ofType ?
1968 node.nodeName.toLowerCase() === name :
1969 node.nodeType === 1 ) &&
1970 ++diff ) {
1971
1972 // Cache the index of each encountered element
1973 if ( useCache ) {
1974 outerCache = node[ expando ] || (node[ expando ] = {});
1975
1976 // Support: IE <9 only
1977 // Defend against cloned attroperties (jQuery gh-1709)
1978 uniqueCache = outerCache[ node.uniqueID ] ||
1979 (outerCache[ node.uniqueID ] = {});
1980
1981 uniqueCache[ type ] = [ dirruns, diff ];
1982 }
1983
1984 if ( node === elem ) {
1985 break;
1986 }
1987 }
1988 }
1989 }
1990 }
1991
1992 // Incorporate the offset, then check against cycle size
1993 diff -= last;
1994 return diff === first || ( diff % first === 0 && diff / first >= 0 );
1995 }
1996 };
1997 },
1998
1999 "PSEUDO": function( pseudo, argument ) {
2000 // pseudo-class names are case-insensitive
2001 // http://www.w3.org/TR/selectors/#pseudo-classes
2002 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
2003 // Remember that setFilters inherits from pseudos
2004 var args,
2005 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
2006 Sizzle.error( "unsupported pseudo: " + pseudo );
2007
2008 // The user may use createPseudo to indicate that
2009 // arguments are needed to create the filter function
2010 // just as Sizzle does
2011 if ( fn[ expando ] ) {
2012 return fn( argument );
2013 }
2014
2015 // But maintain support for old signatures
2016 if ( fn.length > 1 ) {
2017 args = [ pseudo, pseudo, "", argument ];
2018 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
2019 markFunction(function( seed, matches ) {
2020 var idx,
2021 matched = fn( seed, argument ),
2022 i = matched.length;
2023 while ( i-- ) {
2024 idx = indexOf( seed, matched[i] );
2025 seed[ idx ] = !( matches[ idx ] = matched[i] );
2026 }
2027 }) :
2028 function( elem ) {
2029 return fn( elem, 0, args );
2030 };
2031 }
2032
2033 return fn;
2034 }
2035 },
2036
2037 pseudos: {
2038 // Potentially complex pseudos
2039 "not": markFunction(function( selector ) {
2040 // Trim the selector passed to compile
2041 // to avoid treating leading and trailing
2042 // spaces as combinators
2043 var input = [],
2044 results = [],
2045 matcher = compile( selector.replace( rtrim, "$1" ) );
2046
2047 return matcher[ expando ] ?
2048 markFunction(function( seed, matches, context, xml ) {
2049 var elem,
2050 unmatched = matcher( seed, null, xml, [] ),
2051 i = seed.length;
2052
2053 // Match elements unmatched by `matcher`
2054 while ( i-- ) {
2055 if ( (elem = unmatched[i]) ) {
2056 seed[i] = !(matches[i] = elem);
2057 }
2058 }
2059 }) :
2060 function( elem, context, xml ) {
2061 input[0] = elem;
2062 matcher( input, null, xml, results );
2063 // Don't keep the element (issue #299)
2064 input[0] = null;
2065 return !results.pop();
2066 };
2067 }),
2068
2069 "has": markFunction(function( selector ) {
2070 return function( elem ) {
2071 return Sizzle( selector, elem ).length > 0;
2072 };
2073 }),
2074
2075 "contains": markFunction(function( text ) {
2076 text = text.replace( runescape, funescape );
2077 return function( elem ) {
2078 return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
2079 };
2080 }),
2081
2082 // "Whether an element is represented by a :lang() selector
2083 // is based solely on the element's language value
2084 // being equal to the identifier C,
2085 // or beginning with the identifier C immediately followed by "-".
2086 // The matching of C against the element's language value is performed case-insensitively.
2087 // The identifier C does not have to be a valid language name."
2088 // http://www.w3.org/TR/selectors/#lang-pseudo
2089 "lang": markFunction( function( lang ) {
2090 // lang value must be a valid identifier
2091 if ( !ridentifier.test(lang || "") ) {
2092 Sizzle.error( "unsupported lang: " + lang );
2093 }
2094 lang = lang.replace( runescape, funescape ).toLowerCase();
2095 return function( elem ) {
2096 var elemLang;
2097 do {
2098 if ( (elemLang = documentIsHTML ?
2099 elem.lang :
2100 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
2101
2102 elemLang = elemLang.toLowerCase();
2103 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
2104 }
2105 } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
2106 return false;
2107 };
2108 }),
2109
2110 // Miscellaneous
2111 "target": function( elem ) {
2112 var hash = window.location && window.location.hash;
2113 return hash && hash.slice( 1 ) === elem.id;
2114 },
2115
2116 "root": function( elem ) {
2117 return elem === docElem;
2118 },
2119
2120 "focus": function( elem ) {
2121 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
2122 },
2123
2124 // Boolean properties
2125 "enabled": createDisabledPseudo( false ),
2126 "disabled": createDisabledPseudo( true ),
2127
2128 "checked": function( elem ) {
2129 // In CSS3, :checked should return both checked and selected elements
2130 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
2131 var nodeName = elem.nodeName.toLowerCase();
2132 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
2133 },
2134
2135 "selected": function( elem ) {
2136 // Accessing this property makes selected-by-default
2137 // options in Safari work properly
2138 if ( elem.parentNode ) {
2139 elem.parentNode.selectedIndex;
2140 }
2141
2142 return elem.selected === true;
2143 },
2144
2145 // Contents
2146 "empty": function( elem ) {
2147 // http://www.w3.org/TR/selectors/#empty-pseudo
2148 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
2149 // but not by others (comment: 8; processing instruction: 7; etc.)
2150 // nodeType < 6 works because attributes (2) do not appear as children
2151 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
2152 if ( elem.nodeType < 6 ) {
2153 return false;
2154 }
2155 }
2156 return true;
2157 },
2158
2159 "parent": function( elem ) {
2160 return !Expr.pseudos["empty"]( elem );
2161 },
2162
2163 // Element/input types
2164 "header": function( elem ) {
2165 return rheader.test( elem.nodeName );
2166 },
2167
2168 "input": function( elem ) {
2169 return rinputs.test( elem.nodeName );
2170 },
2171
2172 "button": function( elem ) {
2173 var name = elem.nodeName.toLowerCase();
2174 return name === "input" && elem.type === "button" || name === "button";
2175 },
2176
2177 "text": function( elem ) {
2178 var attr;
2179 return elem.nodeName.toLowerCase() === "input" &&
2180 elem.type === "text" &&
2181
2182 // Support: IE<8
2183 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
2184 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
2185 },
2186
2187 // Position-in-collection
2188 "first": createPositionalPseudo(function() {
2189 return [ 0 ];
2190 }),
2191
2192 "last": createPositionalPseudo(function( matchIndexes, length ) {
2193 return [ length - 1 ];
2194 }),
2195
2196 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
2197 return [ argument < 0 ? argument + length : argument ];
2198 }),
2199
2200 "even": createPositionalPseudo(function( matchIndexes, length ) {
2201 var i = 0;
2202 for ( ; i < length; i += 2 ) {
2203 matchIndexes.push( i );
2204 }
2205 return matchIndexes;
2206 }),
2207
2208 "odd": createPositionalPseudo(function( matchIndexes, length ) {
2209 var i = 1;
2210 for ( ; i < length; i += 2 ) {
2211 matchIndexes.push( i );
2212 }
2213 return matchIndexes;
2214 }),
2215
2216 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2217 var i = argument < 0 ?
2218 argument + length :
2219 argument > length ?
2220 length :
2221 argument;
2222 for ( ; --i >= 0; ) {
2223 matchIndexes.push( i );
2224 }
2225 return matchIndexes;
2226 }),
2227
2228 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2229 var i = argument < 0 ? argument + length : argument;
2230 for ( ; ++i < length; ) {
2231 matchIndexes.push( i );
2232 }
2233 return matchIndexes;
2234 })
2235 }
2236};
2237
2238Expr.pseudos["nth"] = Expr.pseudos["eq"];
2239
2240// Add button/input type pseudos
2241for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
2242 Expr.pseudos[ i ] = createInputPseudo( i );
2243}
2244for ( i in { submit: true, reset: true } ) {
2245 Expr.pseudos[ i ] = createButtonPseudo( i );
2246}
2247
2248// Easy API for creating new setFilters
2249function setFilters() {}
2250setFilters.prototype = Expr.filters = Expr.pseudos;
2251Expr.setFilters = new setFilters();
2252
2253tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
2254 var matched, match, tokens, type,
2255 soFar, groups, preFilters,
2256 cached = tokenCache[ selector + " " ];
2257
2258 if ( cached ) {
2259 return parseOnly ? 0 : cached.slice( 0 );
2260 }
2261
2262 soFar = selector;
2263 groups = [];
2264 preFilters = Expr.preFilter;
2265
2266 while ( soFar ) {
2267
2268 // Comma and first run
2269 if ( !matched || (match = rcomma.exec( soFar )) ) {
2270 if ( match ) {
2271 // Don't consume trailing commas as valid
2272 soFar = soFar.slice( match[0].length ) || soFar;
2273 }
2274 groups.push( (tokens = []) );
2275 }
2276
2277 matched = false;
2278
2279 // Combinators
2280 if ( (match = rcombinators.exec( soFar )) ) {
2281 matched = match.shift();
2282 tokens.push({
2283 value: matched,
2284 // Cast descendant combinators to space
2285 type: match[0].replace( rtrim, " " )
2286 });
2287 soFar = soFar.slice( matched.length );
2288 }
2289
2290 // Filters
2291 for ( type in Expr.filter ) {
2292 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
2293 (match = preFilters[ type ]( match ))) ) {
2294 matched = match.shift();
2295 tokens.push({
2296 value: matched,
2297 type: type,
2298 matches: match
2299 });
2300 soFar = soFar.slice( matched.length );
2301 }
2302 }
2303
2304 if ( !matched ) {
2305 break;
2306 }
2307 }
2308
2309 // Return the length of the invalid excess
2310 // if we're just parsing
2311 // Otherwise, throw an error or return tokens
2312 return parseOnly ?
2313 soFar.length :
2314 soFar ?
2315 Sizzle.error( selector ) :
2316 // Cache the tokens
2317 tokenCache( selector, groups ).slice( 0 );
2318};
2319
2320function toSelector( tokens ) {
2321 var i = 0,
2322 len = tokens.length,
2323 selector = "";
2324 for ( ; i < len; i++ ) {
2325 selector += tokens[i].value;
2326 }
2327 return selector;
2328}
2329
2330function addCombinator( matcher, combinator, base ) {
2331 var dir = combinator.dir,
2332 skip = combinator.next,
2333 key = skip || dir,
2334 checkNonElements = base && key === "parentNode",
2335 doneName = done++;
2336
2337 return combinator.first ?
2338 // Check against closest ancestor/preceding element
2339 function( elem, context, xml ) {
2340 while ( (elem = elem[ dir ]) ) {
2341 if ( elem.nodeType === 1 || checkNonElements ) {
2342 return matcher( elem, context, xml );
2343 }
2344 }
2345 return false;
2346 } :
2347
2348 // Check against all ancestor/preceding elements
2349 function( elem, context, xml ) {
2350 var oldCache, uniqueCache, outerCache,
2351 newCache = [ dirruns, doneName ];
2352
2353 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
2354 if ( xml ) {
2355 while ( (elem = elem[ dir ]) ) {
2356 if ( elem.nodeType === 1 || checkNonElements ) {
2357 if ( matcher( elem, context, xml ) ) {
2358 return true;
2359 }
2360 }
2361 }
2362 } else {
2363 while ( (elem = elem[ dir ]) ) {
2364 if ( elem.nodeType === 1 || checkNonElements ) {
2365 outerCache = elem[ expando ] || (elem[ expando ] = {});
2366
2367 // Support: IE <9 only
2368 // Defend against cloned attroperties (jQuery gh-1709)
2369 uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
2370
2371 if ( skip && skip === elem.nodeName.toLowerCase() ) {
2372 elem = elem[ dir ] || elem;
2373 } else if ( (oldCache = uniqueCache[ key ]) &&
2374 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
2375
2376 // Assign to newCache so results back-propagate to previous elements
2377 return (newCache[ 2 ] = oldCache[ 2 ]);
2378 } else {
2379 // Reuse newcache so results back-propagate to previous elements
2380 uniqueCache[ key ] = newCache;
2381
2382 // A match means we're done; a fail means we have to keep checking
2383 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
2384 return true;
2385 }
2386 }
2387 }
2388 }
2389 }
2390 return false;
2391 };
2392}
2393
2394function elementMatcher( matchers ) {
2395 return matchers.length > 1 ?
2396 function( elem, context, xml ) {
2397 var i = matchers.length;
2398 while ( i-- ) {
2399 if ( !matchers[i]( elem, context, xml ) ) {
2400 return false;
2401 }
2402 }
2403 return true;
2404 } :
2405 matchers[0];
2406}
2407
2408function multipleContexts( selector, contexts, results ) {
2409 var i = 0,
2410 len = contexts.length;
2411 for ( ; i < len; i++ ) {
2412 Sizzle( selector, contexts[i], results );
2413 }
2414 return results;
2415}
2416
2417function condense( unmatched, map, filter, context, xml ) {
2418 var elem,
2419 newUnmatched = [],
2420 i = 0,
2421 len = unmatched.length,
2422 mapped = map != null;
2423
2424 for ( ; i < len; i++ ) {
2425 if ( (elem = unmatched[i]) ) {
2426 if ( !filter || filter( elem, context, xml ) ) {
2427 newUnmatched.push( elem );
2428 if ( mapped ) {
2429 map.push( i );
2430 }
2431 }
2432 }
2433 }
2434
2435 return newUnmatched;
2436}
2437
2438function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
2439 if ( postFilter && !postFilter[ expando ] ) {
2440 postFilter = setMatcher( postFilter );
2441 }
2442 if ( postFinder && !postFinder[ expando ] ) {
2443 postFinder = setMatcher( postFinder, postSelector );
2444 }
2445 return markFunction(function( seed, results, context, xml ) {
2446 var temp, i, elem,
2447 preMap = [],
2448 postMap = [],
2449 preexisting = results.length,
2450
2451 // Get initial elements from seed or context
2452 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
2453
2454 // Prefilter to get matcher input, preserving a map for seed-results synchronization
2455 matcherIn = preFilter && ( seed || !selector ) ?
2456 condense( elems, preMap, preFilter, context, xml ) :
2457 elems,
2458
2459 matcherOut = matcher ?
2460 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
2461 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
2462
2463 // ...intermediate processing is necessary
2464 [] :
2465
2466 // ...otherwise use results directly
2467 results :
2468 matcherIn;
2469
2470 // Find primary matches
2471 if ( matcher ) {
2472 matcher( matcherIn, matcherOut, context, xml );
2473 }
2474
2475 // Apply postFilter
2476 if ( postFilter ) {
2477 temp = condense( matcherOut, postMap );
2478 postFilter( temp, [], context, xml );
2479
2480 // Un-match failing elements by moving them back to matcherIn
2481 i = temp.length;
2482 while ( i-- ) {
2483 if ( (elem = temp[i]) ) {
2484 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
2485 }
2486 }
2487 }
2488
2489 if ( seed ) {
2490 if ( postFinder || preFilter ) {
2491 if ( postFinder ) {
2492 // Get the final matcherOut by condensing this intermediate into postFinder contexts
2493 temp = [];
2494 i = matcherOut.length;
2495 while ( i-- ) {
2496 if ( (elem = matcherOut[i]) ) {
2497 // Restore matcherIn since elem is not yet a final match
2498 temp.push( (matcherIn[i] = elem) );
2499 }
2500 }
2501 postFinder( null, (matcherOut = []), temp, xml );
2502 }
2503
2504 // Move matched elements from seed to results to keep them synchronized
2505 i = matcherOut.length;
2506 while ( i-- ) {
2507 if ( (elem = matcherOut[i]) &&
2508 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
2509
2510 seed[temp] = !(results[temp] = elem);
2511 }
2512 }
2513 }
2514
2515 // Add elements to results, through postFinder if defined
2516 } else {
2517 matcherOut = condense(
2518 matcherOut === results ?
2519 matcherOut.splice( preexisting, matcherOut.length ) :
2520 matcherOut
2521 );
2522 if ( postFinder ) {
2523 postFinder( null, results, matcherOut, xml );
2524 } else {
2525 push.apply( results, matcherOut );
2526 }
2527 }
2528 });
2529}
2530
2531function matcherFromTokens( tokens ) {
2532 var checkContext, matcher, j,
2533 len = tokens.length,
2534 leadingRelative = Expr.relative[ tokens[0].type ],
2535 implicitRelative = leadingRelative || Expr.relative[" "],
2536 i = leadingRelative ? 1 : 0,
2537
2538 // The foundational matcher ensures that elements are reachable from top-level context(s)
2539 matchContext = addCombinator( function( elem ) {
2540 return elem === checkContext;
2541 }, implicitRelative, true ),
2542 matchAnyContext = addCombinator( function( elem ) {
2543 return indexOf( checkContext, elem ) > -1;
2544 }, implicitRelative, true ),
2545 matchers = [ function( elem, context, xml ) {
2546 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
2547 (checkContext = context).nodeType ?
2548 matchContext( elem, context, xml ) :
2549 matchAnyContext( elem, context, xml ) );
2550 // Avoid hanging onto element (issue #299)
2551 checkContext = null;
2552 return ret;
2553 } ];
2554
2555 for ( ; i < len; i++ ) {
2556 if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
2557 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
2558 } else {
2559 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
2560
2561 // Return special upon seeing a positional matcher
2562 if ( matcher[ expando ] ) {
2563 // Find the next relative operator (if any) for proper handling
2564 j = ++i;
2565 for ( ; j < len; j++ ) {
2566 if ( Expr.relative[ tokens[j].type ] ) {
2567 break;
2568 }
2569 }
2570 return setMatcher(
2571 i > 1 && elementMatcher( matchers ),
2572 i > 1 && toSelector(
2573 // If the preceding token was a descendant combinator, insert an implicit any-element `*`
2574 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
2575 ).replace( rtrim, "$1" ),
2576 matcher,
2577 i < j && matcherFromTokens( tokens.slice( i, j ) ),
2578 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
2579 j < len && toSelector( tokens )
2580 );
2581 }
2582 matchers.push( matcher );
2583 }
2584 }
2585
2586 return elementMatcher( matchers );
2587}
2588
2589function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
2590 var bySet = setMatchers.length > 0,
2591 byElement = elementMatchers.length > 0,
2592 superMatcher = function( seed, context, xml, results, outermost ) {
2593 var elem, j, matcher,
2594 matchedCount = 0,
2595 i = "0",
2596 unmatched = seed && [],
2597 setMatched = [],
2598 contextBackup = outermostContext,
2599 // We must always have either seed elements or outermost context
2600 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
2601 // Use integer dirruns iff this is the outermost matcher
2602 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
2603 len = elems.length;
2604
2605 if ( outermost ) {
2606 outermostContext = context === document || context || outermost;
2607 }
2608
2609 // Add elements passing elementMatchers directly to results
2610 // Support: IE<9, Safari
2611 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
2612 for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
2613 if ( byElement && elem ) {
2614 j = 0;
2615 if ( !context && elem.ownerDocument !== document ) {
2616 setDocument( elem );
2617 xml = !documentIsHTML;
2618 }
2619 while ( (matcher = elementMatchers[j++]) ) {
2620 if ( matcher( elem, context || document, xml) ) {
2621 results.push( elem );
2622 break;
2623 }
2624 }
2625 if ( outermost ) {
2626 dirruns = dirrunsUnique;
2627 }
2628 }
2629
2630 // Track unmatched elements for set filters
2631 if ( bySet ) {
2632 // They will have gone through all possible matchers
2633 if ( (elem = !matcher && elem) ) {
2634 matchedCount--;
2635 }
2636
2637 // Lengthen the array for every element, matched or not
2638 if ( seed ) {
2639 unmatched.push( elem );
2640 }
2641 }
2642 }
2643
2644 // `i` is now the count of elements visited above, and adding it to `matchedCount`
2645 // makes the latter nonnegative.
2646 matchedCount += i;
2647
2648 // Apply set filters to unmatched elements
2649 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
2650 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
2651 // no element matchers and no seed.
2652 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
2653 // case, which will result in a "00" `matchedCount` that differs from `i` but is also
2654 // numerically zero.
2655 if ( bySet && i !== matchedCount ) {
2656 j = 0;
2657 while ( (matcher = setMatchers[j++]) ) {
2658 matcher( unmatched, setMatched, context, xml );
2659 }
2660
2661 if ( seed ) {
2662 // Reintegrate element matches to eliminate the need for sorting
2663 if ( matchedCount > 0 ) {
2664 while ( i-- ) {
2665 if ( !(unmatched[i] || setMatched[i]) ) {
2666 setMatched[i] = pop.call( results );
2667 }
2668 }
2669 }
2670
2671 // Discard index placeholder values to get only actual matches
2672 setMatched = condense( setMatched );
2673 }
2674
2675 // Add matches to results
2676 push.apply( results, setMatched );
2677
2678 // Seedless set matches succeeding multiple successful matchers stipulate sorting
2679 if ( outermost && !seed && setMatched.length > 0 &&
2680 ( matchedCount + setMatchers.length ) > 1 ) {
2681
2682 Sizzle.uniqueSort( results );
2683 }
2684 }
2685
2686 // Override manipulation of globals by nested matchers
2687 if ( outermost ) {
2688 dirruns = dirrunsUnique;
2689 outermostContext = contextBackup;
2690 }
2691
2692 return unmatched;
2693 };
2694
2695 return bySet ?
2696 markFunction( superMatcher ) :
2697 superMatcher;
2698}
2699
2700compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
2701 var i,
2702 setMatchers = [],
2703 elementMatchers = [],
2704 cached = compilerCache[ selector + " " ];
2705
2706 if ( !cached ) {
2707 // Generate a function of recursive functions that can be used to check each element
2708 if ( !match ) {
2709 match = tokenize( selector );
2710 }
2711 i = match.length;
2712 while ( i-- ) {
2713 cached = matcherFromTokens( match[i] );
2714 if ( cached[ expando ] ) {
2715 setMatchers.push( cached );
2716 } else {
2717 elementMatchers.push( cached );
2718 }
2719 }
2720
2721 // Cache the compiled function
2722 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
2723
2724 // Save selector and tokenization
2725 cached.selector = selector;
2726 }
2727 return cached;
2728};
2729
2730/**
2731 * A low-level selection function that works with Sizzle's compiled
2732 * selector functions
2733 * @param {String|Function} selector A selector or a pre-compiled
2734 * selector function built with Sizzle.compile
2735 * @param {Element} context
2736 * @param {Array} [results]
2737 * @param {Array} [seed] A set of elements to match against
2738 */
2739select = Sizzle.select = function( selector, context, results, seed ) {
2740 var i, tokens, token, type, find,
2741 compiled = typeof selector === "function" && selector,
2742 match = !seed && tokenize( (selector = compiled.selector || selector) );
2743
2744 results = results || [];
2745
2746 // Try to minimize operations if there is only one selector in the list and no seed
2747 // (the latter of which guarantees us context)
2748 if ( match.length === 1 ) {
2749
2750 // Reduce context if the leading compound selector is an ID
2751 tokens = match[0] = match[0].slice( 0 );
2752 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
2753 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
2754
2755 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
2756 if ( !context ) {
2757 return results;
2758
2759 // Precompiled matchers will still verify ancestry, so step up a level
2760 } else if ( compiled ) {
2761 context = context.parentNode;
2762 }
2763
2764 selector = selector.slice( tokens.shift().value.length );
2765 }
2766
2767 // Fetch a seed set for right-to-left matching
2768 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
2769 while ( i-- ) {
2770 token = tokens[i];
2771
2772 // Abort if we hit a combinator
2773 if ( Expr.relative[ (type = token.type) ] ) {
2774 break;
2775 }
2776 if ( (find = Expr.find[ type ]) ) {
2777 // Search, expanding context for leading sibling combinators
2778 if ( (seed = find(
2779 token.matches[0].replace( runescape, funescape ),
2780 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
2781 )) ) {
2782
2783 // If seed is empty or no tokens remain, we can return early
2784 tokens.splice( i, 1 );
2785 selector = seed.length && toSelector( tokens );
2786 if ( !selector ) {
2787 push.apply( results, seed );
2788 return results;
2789 }
2790
2791 break;
2792 }
2793 }
2794 }
2795 }
2796
2797 // Compile and execute a filtering function if one is not provided
2798 // Provide `match` to avoid retokenization if we modified the selector above
2799 ( compiled || compile( selector, match ) )(
2800 seed,
2801 context,
2802 !documentIsHTML,
2803 results,
2804 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
2805 );
2806 return results;
2807};
2808
2809// One-time assignments
2810
2811// Sort stability
2812support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
2813
2814// Support: Chrome 14-35+
2815// Always assume duplicates if they aren't passed to the comparison function
2816support.detectDuplicates = !!hasDuplicate;
2817
2818// Initialize against the default document
2819setDocument();
2820
2821// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
2822// Detached nodes confoundingly follow *each other*
2823support.sortDetached = assert(function( el ) {
2824 // Should return 1, but returns 4 (following)
2825 return el.compareDocumentPosition( document.createElement("fieldset") ) & 1;
2826});
2827
2828// Support: IE<8
2829// Prevent attribute/property "interpolation"
2830// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
2831if ( !assert(function( el ) {
2832 el.innerHTML = "<a href='#'></a>";
2833 return el.firstChild.getAttribute("href") === "#" ;
2834}) ) {
2835 addHandle( "type|href|height|width", function( elem, name, isXML ) {
2836 if ( !isXML ) {
2837 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
2838 }
2839 });
2840}
2841
2842// Support: IE<9
2843// Use defaultValue in place of getAttribute("value")
2844if ( !support.attributes || !assert(function( el ) {
2845 el.innerHTML = "<input/>";
2846 el.firstChild.setAttribute( "value", "" );
2847 return el.firstChild.getAttribute( "value" ) === "";
2848}) ) {
2849 addHandle( "value", function( elem, name, isXML ) {
2850 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
2851 return elem.defaultValue;
2852 }
2853 });
2854}
2855
2856// Support: IE<9
2857// Use getAttributeNode to fetch booleans when getAttribute lies
2858if ( !assert(function( el ) {
2859 return el.getAttribute("disabled") == null;
2860}) ) {
2861 addHandle( booleans, function( elem, name, isXML ) {
2862 var val;
2863 if ( !isXML ) {
2864 return elem[ name ] === true ? name.toLowerCase() :
2865 (val = elem.getAttributeNode( name )) && val.specified ?
2866 val.value :
2867 null;
2868 }
2869 });
2870}
2871
2872return Sizzle;
2873
2874})( window );
2875
2876
2877
2878jQuery.find = Sizzle;
2879jQuery.expr = Sizzle.selectors;
2880
2881// Deprecated
2882jQuery.expr[ ":" ] = jQuery.expr.pseudos;
2883jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
2884jQuery.text = Sizzle.getText;
2885jQuery.isXMLDoc = Sizzle.isXML;
2886jQuery.contains = Sizzle.contains;
2887jQuery.escapeSelector = Sizzle.escape;
2888
2889
2890
2891
2892var dir = function( elem, dir, until ) {
2893 var matched = [],
2894 truncate = until !== undefined;
2895
2896 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
2897 if ( elem.nodeType === 1 ) {
2898 if ( truncate && jQuery( elem ).is( until ) ) {
2899 break;
2900 }
2901 matched.push( elem );
2902 }
2903 }
2904 return matched;
2905};
2906
2907
2908var siblings = function( n, elem ) {
2909 var matched = [];
2910
2911 for ( ; n; n = n.nextSibling ) {
2912 if ( n.nodeType === 1 && n !== elem ) {
2913 matched.push( n );
2914 }
2915 }
2916
2917 return matched;
2918};
2919
2920
2921var rneedsContext = jQuery.expr.match.needsContext;
2922
2923
2924
2925function nodeName( elem, name ) {
2926
2927 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
2928
2929};
2930var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
2931
2932
2933
2934// Implement the identical functionality for filter and not
2935function winnow( elements, qualifier, not ) {
2936 if ( isFunction( qualifier ) ) {
2937 return jQuery.grep( elements, function( elem, i ) {
2938 return !!qualifier.call( elem, i, elem ) !== not;
2939 } );
2940 }
2941
2942 // Single element
2943 if ( qualifier.nodeType ) {
2944 return jQuery.grep( elements, function( elem ) {
2945 return ( elem === qualifier ) !== not;
2946 } );
2947 }
2948
2949 // Arraylike of elements (jQuery, arguments, Array)
2950 if ( typeof qualifier !== "string" ) {
2951 return jQuery.grep( elements, function( elem ) {
2952 return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
2953 } );
2954 }
2955
2956 // Filtered directly for both simple and complex selectors
2957 return jQuery.filter( qualifier, elements, not );
2958}
2959
2960jQuery.filter = function( expr, elems, not ) {
2961 var elem = elems[ 0 ];
2962
2963 if ( not ) {
2964 expr = ":not(" + expr + ")";
2965 }
2966
2967 if ( elems.length === 1 && elem.nodeType === 1 ) {
2968 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
2969 }
2970
2971 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
2972 return elem.nodeType === 1;
2973 } ) );
2974};
2975
2976jQuery.fn.extend( {
2977 find: function( selector ) {
2978 var i, ret,
2979 len = this.length,
2980 self = this;
2981
2982 if ( typeof selector !== "string" ) {
2983 return this.pushStack( jQuery( selector ).filter( function() {
2984 for ( i = 0; i < len; i++ ) {
2985 if ( jQuery.contains( self[ i ], this ) ) {
2986 return true;
2987 }
2988 }
2989 } ) );
2990 }
2991
2992 ret = this.pushStack( [] );
2993
2994 for ( i = 0; i < len; i++ ) {
2995 jQuery.find( selector, self[ i ], ret );
2996 }
2997
2998 return len > 1 ? jQuery.uniqueSort( ret ) : ret;
2999 },
3000 filter: function( selector ) {
3001 return this.pushStack( winnow( this, selector || [], false ) );
3002 },
3003 not: function( selector ) {
3004 return this.pushStack( winnow( this, selector || [], true ) );
3005 },
3006 is: function( selector ) {
3007 return !!winnow(
3008 this,
3009
3010 // If this is a positional/relative selector, check membership in the returned set
3011 // so $("p:first").is("p:last") won't return true for a doc with two "p".
3012 typeof selector === "string" && rneedsContext.test( selector ) ?
3013 jQuery( selector ) :
3014 selector || [],
3015 false
3016 ).length;
3017 }
3018} );
3019
3020
3021// Initialize a jQuery object
3022
3023
3024// A central reference to the root jQuery(document)
3025var rootjQuery,
3026
3027 // A simple way to check for HTML strings
3028 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
3029 // Strict HTML recognition (#11290: must start with <)
3030 // Shortcut simple #id case for speed
3031 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
3032
3033 init = jQuery.fn.init = function( selector, context, root ) {
3034 var match, elem;
3035
3036 // HANDLE: $(""), $(null), $(undefined), $(false)
3037 if ( !selector ) {
3038 return this;
3039 }
3040
3041 // Method init() accepts an alternate rootjQuery
3042 // so migrate can support jQuery.sub (gh-2101)
3043 root = root || rootjQuery;
3044
3045 // Handle HTML strings
3046 if ( typeof selector === "string" ) {
3047 if ( selector[ 0 ] === "<" &&
3048 selector[ selector.length - 1 ] === ">" &&
3049 selector.length >= 3 ) {
3050
3051 // Assume that strings that start and end with <> are HTML and skip the regex check
3052 match = [ null, selector, null ];
3053
3054 } else {
3055 match = rquickExpr.exec( selector );
3056 }
3057
3058 // Match html or make sure no context is specified for #id
3059 if ( match && ( match[ 1 ] || !context ) ) {
3060
3061 // HANDLE: $(html) -> $(array)
3062 if ( match[ 1 ] ) {
3063 context = context instanceof jQuery ? context[ 0 ] : context;
3064
3065 // Option to run scripts is true for back-compat
3066 // Intentionally let the error be thrown if parseHTML is not present
3067 jQuery.merge( this, jQuery.parseHTML(
3068 match[ 1 ],
3069 context && context.nodeType ? context.ownerDocument || context : document,
3070 true
3071 ) );
3072
3073 // HANDLE: $(html, props)
3074 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
3075 for ( match in context ) {
3076
3077 // Properties of context are called as methods if possible
3078 if ( isFunction( this[ match ] ) ) {
3079 this[ match ]( context[ match ] );
3080
3081 // ...and otherwise set as attributes
3082 } else {
3083 this.attr( match, context[ match ] );
3084 }
3085 }
3086 }
3087
3088 return this;
3089
3090 // HANDLE: $(#id)
3091 } else {
3092 elem = document.getElementById( match[ 2 ] );
3093
3094 if ( elem ) {
3095
3096 // Inject the element directly into the jQuery object
3097 this[ 0 ] = elem;
3098 this.length = 1;
3099 }
3100 return this;
3101 }
3102
3103 // HANDLE: $(expr, $(...))
3104 } else if ( !context || context.jquery ) {
3105 return ( context || root ).find( selector );
3106
3107 // HANDLE: $(expr, context)
3108 // (which is just equivalent to: $(context).find(expr)
3109 } else {
3110 return this.constructor( context ).find( selector );
3111 }
3112
3113 // HANDLE: $(DOMElement)
3114 } else if ( selector.nodeType ) {
3115 this[ 0 ] = selector;
3116 this.length = 1;
3117 return this;
3118
3119 // HANDLE: $(function)
3120 // Shortcut for document ready
3121 } else if ( isFunction( selector ) ) {
3122 return root.ready !== undefined ?
3123 root.ready( selector ) :
3124
3125 // Execute immediately if ready is not present
3126 selector( jQuery );
3127 }
3128
3129 return jQuery.makeArray( selector, this );
3130 };
3131
3132// Give the init function the jQuery prototype for later instantiation
3133init.prototype = jQuery.fn;
3134
3135// Initialize central reference
3136rootjQuery = jQuery( document );
3137
3138
3139var rparentsprev = /^(?:parents|prev(?:Until|All))/,
3140
3141 // Methods guaranteed to produce a unique set when starting from a unique set
3142 guaranteedUnique = {
3143 children: true,
3144 contents: true,
3145 next: true,
3146 prev: true
3147 };
3148
3149jQuery.fn.extend( {
3150 has: function( target ) {
3151 var targets = jQuery( target, this ),
3152 l = targets.length;
3153
3154 return this.filter( function() {
3155 var i = 0;
3156 for ( ; i < l; i++ ) {
3157 if ( jQuery.contains( this, targets[ i ] ) ) {
3158 return true;
3159 }
3160 }
3161 } );
3162 },
3163
3164 closest: function( selectors, context ) {
3165 var cur,
3166 i = 0,
3167 l = this.length,
3168 matched = [],
3169 targets = typeof selectors !== "string" && jQuery( selectors );
3170
3171 // Positional selectors never match, since there's no _selection_ context
3172 if ( !rneedsContext.test( selectors ) ) {
3173 for ( ; i < l; i++ ) {
3174 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
3175
3176 // Always skip document fragments
3177 if ( cur.nodeType < 11 && ( targets ?
3178 targets.index( cur ) > -1 :
3179
3180 // Don't pass non-elements to Sizzle
3181 cur.nodeType === 1 &&
3182 jQuery.find.matchesSelector( cur, selectors ) ) ) {
3183
3184 matched.push( cur );
3185 break;
3186 }
3187 }
3188 }
3189 }
3190
3191 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
3192 },
3193
3194 // Determine the position of an element within the set
3195 index: function( elem ) {
3196
3197 // No argument, return index in parent
3198 if ( !elem ) {
3199 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
3200 }
3201
3202 // Index in selector
3203 if ( typeof elem === "string" ) {
3204 return indexOf.call( jQuery( elem ), this[ 0 ] );
3205 }
3206
3207 // Locate the position of the desired element
3208 return indexOf.call( this,
3209
3210 // If it receives a jQuery object, the first element is used
3211 elem.jquery ? elem[ 0 ] : elem
3212 );
3213 },
3214
3215 add: function( selector, context ) {
3216 return this.pushStack(
3217 jQuery.uniqueSort(
3218 jQuery.merge( this.get(), jQuery( selector, context ) )
3219 )
3220 );
3221 },
3222
3223 addBack: function( selector ) {
3224 return this.add( selector == null ?
3225 this.prevObject : this.prevObject.filter( selector )
3226 );
3227 }
3228} );
3229
3230function sibling( cur, dir ) {
3231 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
3232 return cur;
3233}
3234
3235jQuery.each( {
3236 parent: function( elem ) {
3237 var parent = elem.parentNode;
3238 return parent && parent.nodeType !== 11 ? parent : null;
3239 },
3240 parents: function( elem ) {
3241 return dir( elem, "parentNode" );
3242 },
3243 parentsUntil: function( elem, i, until ) {
3244 return dir( elem, "parentNode", until );
3245 },
3246 next: function( elem ) {
3247 return sibling( elem, "nextSibling" );
3248 },
3249 prev: function( elem ) {
3250 return sibling( elem, "previousSibling" );
3251 },
3252 nextAll: function( elem ) {
3253 return dir( elem, "nextSibling" );
3254 },
3255 prevAll: function( elem ) {
3256 return dir( elem, "previousSibling" );
3257 },
3258 nextUntil: function( elem, i, until ) {
3259 return dir( elem, "nextSibling", until );
3260 },
3261 prevUntil: function( elem, i, until ) {
3262 return dir( elem, "previousSibling", until );
3263 },
3264 siblings: function( elem ) {
3265 return siblings( ( elem.parentNode || {} ).firstChild, elem );
3266 },
3267 children: function( elem ) {
3268 return siblings( elem.firstChild );
3269 },
3270 contents: function( elem ) {
3271 if ( typeof elem.contentDocument !== "undefined" ) {
3272 return elem.contentDocument;
3273 }
3274
3275 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
3276 // Treat the template element as a regular one in browsers that
3277 // don't support it.
3278 if ( nodeName( elem, "template" ) ) {
3279 elem = elem.content || elem;
3280 }
3281
3282 return jQuery.merge( [], elem.childNodes );
3283 }
3284}, function( name, fn ) {
3285 jQuery.fn[ name ] = function( until, selector ) {
3286 var matched = jQuery.map( this, fn, until );
3287
3288 if ( name.slice( -5 ) !== "Until" ) {
3289 selector = until;
3290 }
3291
3292 if ( selector && typeof selector === "string" ) {
3293 matched = jQuery.filter( selector, matched );
3294 }
3295
3296 if ( this.length > 1 ) {
3297
3298 // Remove duplicates
3299 if ( !guaranteedUnique[ name ] ) {
3300 jQuery.uniqueSort( matched );
3301 }
3302
3303 // Reverse order for parents* and prev-derivatives
3304 if ( rparentsprev.test( name ) ) {
3305 matched.reverse();
3306 }
3307 }
3308
3309 return this.pushStack( matched );
3310 };
3311} );
3312var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
3313
3314
3315
3316// Convert String-formatted options into Object-formatted ones
3317function createOptions( options ) {
3318 var object = {};
3319 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
3320 object[ flag ] = true;
3321 } );
3322 return object;
3323}
3324
3325/*
3326 * Create a callback list using the following parameters:
3327 *
3328 * options: an optional list of space-separated options that will change how
3329 * the callback list behaves or a more traditional option object
3330 *
3331 * By default a callback list will act like an event callback list and can be
3332 * "fired" multiple times.
3333 *
3334 * Possible options:
3335 *
3336 * once: will ensure the callback list can only be fired once (like a Deferred)
3337 *
3338 * memory: will keep track of previous values and will call any callback added
3339 * after the list has been fired right away with the latest "memorized"
3340 * values (like a Deferred)
3341 *
3342 * unique: will ensure a callback can only be added once (no duplicate in the list)
3343 *
3344 * stopOnFalse: interrupt callings when a callback returns false
3345 *
3346 */
3347jQuery.Callbacks = function( options ) {
3348
3349 // Convert options from String-formatted to Object-formatted if needed
3350 // (we check in cache first)
3351 options = typeof options === "string" ?
3352 createOptions( options ) :
3353 jQuery.extend( {}, options );
3354
3355 var // Flag to know if list is currently firing
3356 firing,
3357
3358 // Last fire value for non-forgettable lists
3359 memory,
3360
3361 // Flag to know if list was already fired
3362 fired,
3363
3364 // Flag to prevent firing
3365 locked,
3366
3367 // Actual callback list
3368 list = [],
3369
3370 // Queue of execution data for repeatable lists
3371 queue = [],
3372
3373 // Index of currently firing callback (modified by add/remove as needed)
3374 firingIndex = -1,
3375
3376 // Fire callbacks
3377 fire = function() {
3378
3379 // Enforce single-firing
3380 locked = locked || options.once;
3381
3382 // Execute callbacks for all pending executions,
3383 // respecting firingIndex overrides and runtime changes
3384 fired = firing = true;
3385 for ( ; queue.length; firingIndex = -1 ) {
3386 memory = queue.shift();
3387 while ( ++firingIndex < list.length ) {
3388
3389 // Run callback and check for early termination
3390 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
3391 options.stopOnFalse ) {
3392
3393 // Jump to end and forget the data so .add doesn't re-fire
3394 firingIndex = list.length;
3395 memory = false;
3396 }
3397 }
3398 }
3399
3400 // Forget the data if we're done with it
3401 if ( !options.memory ) {
3402 memory = false;
3403 }
3404
3405 firing = false;
3406
3407 // Clean up if we're done firing for good
3408 if ( locked ) {
3409
3410 // Keep an empty list if we have data for future add calls
3411 if ( memory ) {
3412 list = [];
3413
3414 // Otherwise, this object is spent
3415 } else {
3416 list = "";
3417 }
3418 }
3419 },
3420
3421 // Actual Callbacks object
3422 self = {
3423
3424 // Add a callback or a collection of callbacks to the list
3425 add: function() {
3426 if ( list ) {
3427
3428 // If we have memory from a past run, we should fire after adding
3429 if ( memory && !firing ) {
3430 firingIndex = list.length - 1;
3431 queue.push( memory );
3432 }
3433
3434 ( function add( args ) {
3435 jQuery.each( args, function( _, arg ) {
3436 if ( isFunction( arg ) ) {
3437 if ( !options.unique || !self.has( arg ) ) {
3438 list.push( arg );
3439 }
3440 } else if ( arg && arg.length && toType( arg ) !== "string" ) {
3441
3442 // Inspect recursively
3443 add( arg );
3444 }
3445 } );
3446 } )( arguments );
3447
3448 if ( memory && !firing ) {
3449 fire();
3450 }
3451 }
3452 return this;
3453 },
3454
3455 // Remove a callback from the list
3456 remove: function() {
3457 jQuery.each( arguments, function( _, arg ) {
3458 var index;
3459 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
3460 list.splice( index, 1 );
3461
3462 // Handle firing indexes
3463 if ( index <= firingIndex ) {
3464 firingIndex--;
3465 }
3466 }
3467 } );
3468 return this;
3469 },
3470
3471 // Check if a given callback is in the list.
3472 // If no argument is given, return whether or not list has callbacks attached.
3473 has: function( fn ) {
3474 return fn ?
3475 jQuery.inArray( fn, list ) > -1 :
3476 list.length > 0;
3477 },
3478
3479 // Remove all callbacks from the list
3480 empty: function() {
3481 if ( list ) {
3482 list = [];
3483 }
3484 return this;
3485 },
3486
3487 // Disable .fire and .add
3488 // Abort any current/pending executions
3489 // Clear all callbacks and values
3490 disable: function() {
3491 locked = queue = [];
3492 list = memory = "";
3493 return this;
3494 },
3495 disabled: function() {
3496 return !list;
3497 },
3498
3499 // Disable .fire
3500 // Also disable .add unless we have memory (since it would have no effect)
3501 // Abort any pending executions
3502 lock: function() {
3503 locked = queue = [];
3504 if ( !memory && !firing ) {
3505 list = memory = "";
3506 }
3507 return this;
3508 },
3509 locked: function() {
3510 return !!locked;
3511 },
3512
3513 // Call all callbacks with the given context and arguments
3514 fireWith: function( context, args ) {
3515 if ( !locked ) {
3516 args = args || [];
3517 args = [ context, args.slice ? args.slice() : args ];
3518 queue.push( args );
3519 if ( !firing ) {
3520 fire();
3521 }
3522 }
3523 return this;
3524 },
3525
3526 // Call all the callbacks with the given arguments
3527 fire: function() {
3528 self.fireWith( this, arguments );
3529 return this;
3530 },
3531
3532 // To know if the callbacks have already been called at least once
3533 fired: function() {
3534 return !!fired;
3535 }
3536 };
3537
3538 return self;
3539};
3540
3541
3542function Identity( v ) {
3543 return v;
3544}
3545function Thrower( ex ) {
3546 throw ex;
3547}
3548
3549function adoptValue( value, resolve, reject, noValue ) {
3550 var method;
3551
3552 try {
3553
3554 // Check for promise aspect first to privilege synchronous behavior
3555 if ( value && isFunction( ( method = value.promise ) ) ) {
3556 method.call( value ).done( resolve ).fail( reject );
3557
3558 // Other thenables
3559 } else if ( value && isFunction( ( method = value.then ) ) ) {
3560 method.call( value, resolve, reject );
3561
3562 // Other non-thenables
3563 } else {
3564
3565 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
3566 // * false: [ value ].slice( 0 ) => resolve( value )
3567 // * true: [ value ].slice( 1 ) => resolve()
3568 resolve.apply( undefined, [ value ].slice( noValue ) );
3569 }
3570
3571 // For Promises/A+, convert exceptions into rejections
3572 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
3573 // Deferred#then to conditionally suppress rejection.
3574 } catch ( value ) {
3575
3576 // Support: Android 4.0 only
3577 // Strict mode functions invoked without .call/.apply get global-object context
3578 reject.apply( undefined, [ value ] );
3579 }
3580}
3581
3582jQuery.extend( {
3583
3584 Deferred: function( func ) {
3585 var tuples = [
3586
3587 // action, add listener, callbacks,
3588 // ... .then handlers, argument index, [final state]
3589 [ "notify", "progress", jQuery.Callbacks( "memory" ),
3590 jQuery.Callbacks( "memory" ), 2 ],
3591 [ "resolve", "done", jQuery.Callbacks( "once memory" ),
3592 jQuery.Callbacks( "once memory" ), 0, "resolved" ],
3593 [ "reject", "fail", jQuery.Callbacks( "once memory" ),
3594 jQuery.Callbacks( "once memory" ), 1, "rejected" ]
3595 ],
3596 state = "pending",
3597 promise = {
3598 state: function() {
3599 return state;
3600 },
3601 always: function() {
3602 deferred.done( arguments ).fail( arguments );
3603 return this;
3604 },
3605 "catch": function( fn ) {
3606 return promise.then( null, fn );
3607 },
3608
3609 // Keep pipe for back-compat
3610 pipe: function( /* fnDone, fnFail, fnProgress */ ) {
3611 var fns = arguments;
3612
3613 return jQuery.Deferred( function( newDefer ) {
3614 jQuery.each( tuples, function( i, tuple ) {
3615
3616 // Map tuples (progress, done, fail) to arguments (done, fail, progress)
3617 var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
3618
3619 // deferred.progress(function() { bind to newDefer or newDefer.notify })
3620 // deferred.done(function() { bind to newDefer or newDefer.resolve })
3621 // deferred.fail(function() { bind to newDefer or newDefer.reject })
3622 deferred[ tuple[ 1 ] ]( function() {
3623 var returned = fn && fn.apply( this, arguments );
3624 if ( returned && isFunction( returned.promise ) ) {
3625 returned.promise()
3626 .progress( newDefer.notify )
3627 .done( newDefer.resolve )
3628 .fail( newDefer.reject );
3629 } else {
3630 newDefer[ tuple[ 0 ] + "With" ](
3631 this,
3632 fn ? [ returned ] : arguments
3633 );
3634 }
3635 } );
3636 } );
3637 fns = null;
3638 } ).promise();
3639 },
3640 then: function( onFulfilled, onRejected, onProgress ) {
3641 var maxDepth = 0;
3642 function resolve( depth, deferred, handler, special ) {
3643 return function() {
3644 var that = this,
3645 args = arguments,
3646 mightThrow = function() {
3647 var returned, then;
3648
3649 // Support: Promises/A+ section 2.3.3.3.3
3650 // https://promisesaplus.com/#point-59
3651 // Ignore double-resolution attempts
3652 if ( depth < maxDepth ) {
3653 return;
3654 }
3655
3656 returned = handler.apply( that, args );
3657
3658 // Support: Promises/A+ section 2.3.1
3659 // https://promisesaplus.com/#point-48
3660 if ( returned === deferred.promise() ) {
3661 throw new TypeError( "Thenable self-resolution" );
3662 }
3663
3664 // Support: Promises/A+ sections 2.3.3.1, 3.5
3665 // https://promisesaplus.com/#point-54
3666 // https://promisesaplus.com/#point-75
3667 // Retrieve `then` only once
3668 then = returned &&
3669
3670 // Support: Promises/A+ section 2.3.4
3671 // https://promisesaplus.com/#point-64
3672 // Only check objects and functions for thenability
3673 ( typeof returned === "object" ||
3674 typeof returned === "function" ) &&
3675 returned.then;
3676
3677 // Handle a returned thenable
3678 if ( isFunction( then ) ) {
3679
3680 // Special processors (notify) just wait for resolution
3681 if ( special ) {
3682 then.call(
3683 returned,
3684 resolve( maxDepth, deferred, Identity, special ),
3685 resolve( maxDepth, deferred, Thrower, special )
3686 );
3687
3688 // Normal processors (resolve) also hook into progress
3689 } else {
3690
3691 // ...and disregard older resolution values
3692 maxDepth++;
3693
3694 then.call(
3695 returned,
3696 resolve( maxDepth, deferred, Identity, special ),
3697 resolve( maxDepth, deferred, Thrower, special ),
3698 resolve( maxDepth, deferred, Identity,
3699 deferred.notifyWith )
3700 );
3701 }
3702
3703 // Handle all other returned values
3704 } else {
3705
3706 // Only substitute handlers pass on context
3707 // and multiple values (non-spec behavior)
3708 if ( handler !== Identity ) {
3709 that = undefined;
3710 args = [ returned ];
3711 }
3712
3713 // Process the value(s)
3714 // Default process is resolve
3715 ( special || deferred.resolveWith )( that, args );
3716 }
3717 },
3718
3719 // Only normal processors (resolve) catch and reject exceptions
3720 process = special ?
3721 mightThrow :
3722 function() {
3723 try {
3724 mightThrow();
3725 } catch ( e ) {
3726
3727 if ( jQuery.Deferred.exceptionHook ) {
3728 jQuery.Deferred.exceptionHook( e,
3729 process.stackTrace );
3730 }
3731
3732 // Support: Promises/A+ section 2.3.3.3.4.1
3733 // https://promisesaplus.com/#point-61
3734 // Ignore post-resolution exceptions
3735 if ( depth + 1 >= maxDepth ) {
3736
3737 // Only substitute handlers pass on context
3738 // and multiple values (non-spec behavior)
3739 if ( handler !== Thrower ) {
3740 that = undefined;
3741 args = [ e ];
3742 }
3743
3744 deferred.rejectWith( that, args );
3745 }
3746 }
3747 };
3748
3749 // Support: Promises/A+ section 2.3.3.3.1
3750 // https://promisesaplus.com/#point-57
3751 // Re-resolve promises immediately to dodge false rejection from
3752 // subsequent errors
3753 if ( depth ) {
3754 process();
3755 } else {
3756
3757 // Call an optional hook to record the stack, in case of exception
3758 // since it's otherwise lost when execution goes async
3759 if ( jQuery.Deferred.getStackHook ) {
3760 process.stackTrace = jQuery.Deferred.getStackHook();
3761 }
3762 window.setTimeout( process );
3763 }
3764 };
3765 }
3766
3767 return jQuery.Deferred( function( newDefer ) {
3768
3769 // progress_handlers.add( ... )
3770 tuples[ 0 ][ 3 ].add(
3771 resolve(
3772 0,
3773 newDefer,
3774 isFunction( onProgress ) ?
3775 onProgress :
3776 Identity,
3777 newDefer.notifyWith
3778 )
3779 );
3780
3781 // fulfilled_handlers.add( ... )
3782 tuples[ 1 ][ 3 ].add(
3783 resolve(
3784 0,
3785 newDefer,
3786 isFunction( onFulfilled ) ?
3787 onFulfilled :
3788 Identity
3789 )
3790 );
3791
3792 // rejected_handlers.add( ... )
3793 tuples[ 2 ][ 3 ].add(
3794 resolve(
3795 0,
3796 newDefer,
3797 isFunction( onRejected ) ?
3798 onRejected :
3799 Thrower
3800 )
3801 );
3802 } ).promise();
3803 },
3804
3805 // Get a promise for this deferred
3806 // If obj is provided, the promise aspect is added to the object
3807 promise: function( obj ) {
3808 return obj != null ? jQuery.extend( obj, promise ) : promise;
3809 }
3810 },
3811 deferred = {};
3812
3813 // Add list-specific methods
3814 jQuery.each( tuples, function( i, tuple ) {
3815 var list = tuple[ 2 ],
3816 stateString = tuple[ 5 ];
3817
3818 // promise.progress = list.add
3819 // promise.done = list.add
3820 // promise.fail = list.add
3821 promise[ tuple[ 1 ] ] = list.add;
3822
3823 // Handle state
3824 if ( stateString ) {
3825 list.add(
3826 function() {
3827
3828 // state = "resolved" (i.e., fulfilled)
3829 // state = "rejected"
3830 state = stateString;
3831 },
3832
3833 // rejected_callbacks.disable
3834 // fulfilled_callbacks.disable
3835 tuples[ 3 - i ][ 2 ].disable,
3836
3837 // rejected_handlers.disable
3838 // fulfilled_handlers.disable
3839 tuples[ 3 - i ][ 3 ].disable,
3840
3841 // progress_callbacks.lock
3842 tuples[ 0 ][ 2 ].lock,
3843
3844 // progress_handlers.lock
3845 tuples[ 0 ][ 3 ].lock
3846 );
3847 }
3848
3849 // progress_handlers.fire
3850 // fulfilled_handlers.fire
3851 // rejected_handlers.fire
3852 list.add( tuple[ 3 ].fire );
3853
3854 // deferred.notify = function() { deferred.notifyWith(...) }
3855 // deferred.resolve = function() { deferred.resolveWith(...) }
3856 // deferred.reject = function() { deferred.rejectWith(...) }
3857 deferred[ tuple[ 0 ] ] = function() {
3858 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
3859 return this;
3860 };
3861
3862 // deferred.notifyWith = list.fireWith
3863 // deferred.resolveWith = list.fireWith
3864 // deferred.rejectWith = list.fireWith
3865 deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
3866 } );
3867
3868 // Make the deferred a promise
3869 promise.promise( deferred );
3870
3871 // Call given func if any
3872 if ( func ) {
3873 func.call( deferred, deferred );
3874 }
3875
3876 // All done!
3877 return deferred;
3878 },
3879
3880 // Deferred helper
3881 when: function( singleValue ) {
3882 var
3883
3884 // count of uncompleted subordinates
3885 remaining = arguments.length,
3886
3887 // count of unprocessed arguments
3888 i = remaining,
3889
3890 // subordinate fulfillment data
3891 resolveContexts = Array( i ),
3892 resolveValues = slice.call( arguments ),
3893
3894 // the master Deferred
3895 master = jQuery.Deferred(),
3896
3897 // subordinate callback factory
3898 updateFunc = function( i ) {
3899 return function( value ) {
3900 resolveContexts[ i ] = this;
3901 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
3902 if ( !( --remaining ) ) {
3903 master.resolveWith( resolveContexts, resolveValues );
3904 }
3905 };
3906 };
3907
3908 // Single- and empty arguments are adopted like Promise.resolve
3909 if ( remaining <= 1 ) {
3910 adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
3911 !remaining );
3912
3913 // Use .then() to unwrap secondary thenables (cf. gh-3000)
3914 if ( master.state() === "pending" ||
3915 isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
3916
3917 return master.then();
3918 }
3919 }
3920
3921 // Multiple arguments are aggregated like Promise.all array elements
3922 while ( i-- ) {
3923 adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
3924 }
3925
3926 return master.promise();
3927 }
3928} );
3929
3930
3931// These usually indicate a programmer mistake during development,
3932// warn about them ASAP rather than swallowing them by default.
3933var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
3934
3935jQuery.Deferred.exceptionHook = function( error, stack ) {
3936
3937 // Support: IE 8 - 9 only
3938 // Console exists when dev tools are open, which can happen at any time
3939 if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
3940 window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
3941 }
3942};
3943
3944
3945
3946
3947jQuery.readyException = function( error ) {
3948 window.setTimeout( function() {
3949 throw error;
3950 } );
3951};
3952
3953
3954
3955
3956// The deferred used on DOM ready
3957var readyList = jQuery.Deferred();
3958
3959jQuery.fn.ready = function( fn ) {
3960
3961 readyList
3962 .then( fn )
3963
3964 // Wrap jQuery.readyException in a function so that the lookup
3965 // happens at the time of error handling instead of callback
3966 // registration.
3967 .catch( function( error ) {
3968 jQuery.readyException( error );
3969 } );
3970
3971 return this;
3972};
3973
3974jQuery.extend( {
3975
3976 // Is the DOM ready to be used? Set to true once it occurs.
3977 isReady: false,
3978
3979 // A counter to track how many items to wait for before
3980 // the ready event fires. See #6781
3981 readyWait: 1,
3982
3983 // Handle when the DOM is ready
3984 ready: function( wait ) {
3985
3986 // Abort if there are pending holds or we're already ready
3987 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
3988 return;
3989 }
3990
3991 // Remember that the DOM is ready
3992 jQuery.isReady = true;
3993
3994 // If a normal DOM Ready event fired, decrement, and wait if need be
3995 if ( wait !== true && --jQuery.readyWait > 0 ) {
3996 return;
3997 }
3998
3999 // If there are functions bound, to execute
4000 readyList.resolveWith( document, [ jQuery ] );
4001 }
4002} );
4003
4004jQuery.ready.then = readyList.then;
4005
4006// The ready event handler and self cleanup method
4007function completed() {
4008 document.removeEventListener( "DOMContentLoaded", completed );
4009 window.removeEventListener( "load", completed );
4010 jQuery.ready();
4011}
4012
4013// Catch cases where $(document).ready() is called
4014// after the browser event has already occurred.
4015// Support: IE <=9 - 10 only
4016// Older IE sometimes signals "interactive" too soon
4017if ( document.readyState === "complete" ||
4018 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
4019
4020 // Handle it asynchronously to allow scripts the opportunity to delay ready
4021 window.setTimeout( jQuery.ready );
4022
4023} else {
4024
4025 // Use the handy event callback
4026 document.addEventListener( "DOMContentLoaded", completed );
4027
4028 // A fallback to window.onload, that will always work
4029 window.addEventListener( "load", completed );
4030}
4031
4032
4033
4034
4035// Multifunctional method to get and set values of a collection
4036// The value/s can optionally be executed if it's a function
4037var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
4038 var i = 0,
4039 len = elems.length,
4040 bulk = key == null;
4041
4042 // Sets many values
4043 if ( toType( key ) === "object" ) {
4044 chainable = true;
4045 for ( i in key ) {
4046 access( elems, fn, i, key[ i ], true, emptyGet, raw );
4047 }
4048
4049 // Sets one value
4050 } else if ( value !== undefined ) {
4051 chainable = true;
4052
4053 if ( !isFunction( value ) ) {
4054 raw = true;
4055 }
4056
4057 if ( bulk ) {
4058
4059 // Bulk operations run against the entire set
4060 if ( raw ) {
4061 fn.call( elems, value );
4062 fn = null;
4063
4064 // ...except when executing function values
4065 } else {
4066 bulk = fn;
4067 fn = function( elem, key, value ) {
4068 return bulk.call( jQuery( elem ), value );
4069 };
4070 }
4071 }
4072
4073 if ( fn ) {
4074 for ( ; i < len; i++ ) {
4075 fn(
4076 elems[ i ], key, raw ?
4077 value :
4078 value.call( elems[ i ], i, fn( elems[ i ], key ) )
4079 );
4080 }
4081 }
4082 }
4083
4084 if ( chainable ) {
4085 return elems;
4086 }
4087
4088 // Gets
4089 if ( bulk ) {
4090 return fn.call( elems );
4091 }
4092
4093 return len ? fn( elems[ 0 ], key ) : emptyGet;
4094};
4095
4096
4097// Matches dashed string for camelizing
4098var rmsPrefix = /^-ms-/,
4099 rdashAlpha = /-([a-z])/g;
4100
4101// Used by camelCase as callback to replace()
4102function fcamelCase( all, letter ) {
4103 return letter.toUpperCase();
4104}
4105
4106// Convert dashed to camelCase; used by the css and data modules
4107// Support: IE <=9 - 11, Edge 12 - 15
4108// Microsoft forgot to hump their vendor prefix (#9572)
4109function camelCase( string ) {
4110 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
4111}
4112var acceptData = function( owner ) {
4113
4114 // Accepts only:
4115 // - Node
4116 // - Node.ELEMENT_NODE
4117 // - Node.DOCUMENT_NODE
4118 // - Object
4119 // - Any
4120 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
4121};
4122
4123
4124
4125
4126function Data() {
4127 this.expando = jQuery.expando + Data.uid++;
4128}
4129
4130Data.uid = 1;
4131
4132Data.prototype = {
4133
4134 cache: function( owner ) {
4135
4136 // Check if the owner object already has a cache
4137 var value = owner[ this.expando ];
4138
4139 // If not, create one
4140 if ( !value ) {
4141 value = {};
4142
4143 // We can accept data for non-element nodes in modern browsers,
4144 // but we should not, see #8335.
4145 // Always return an empty object.
4146 if ( acceptData( owner ) ) {
4147
4148 // If it is a node unlikely to be stringify-ed or looped over
4149 // use plain assignment
4150 if ( owner.nodeType ) {
4151 owner[ this.expando ] = value;
4152
4153 // Otherwise secure it in a non-enumerable property
4154 // configurable must be true to allow the property to be
4155 // deleted when data is removed
4156 } else {
4157 Object.defineProperty( owner, this.expando, {
4158 value: value,
4159 configurable: true
4160 } );
4161 }
4162 }
4163 }
4164
4165 return value;
4166 },
4167 set: function( owner, data, value ) {
4168 var prop,
4169 cache = this.cache( owner );
4170
4171 // Handle: [ owner, key, value ] args
4172 // Always use camelCase key (gh-2257)
4173 if ( typeof data === "string" ) {
4174 cache[ camelCase( data ) ] = value;
4175
4176 // Handle: [ owner, { properties } ] args
4177 } else {
4178
4179 // Copy the properties one-by-one to the cache object
4180 for ( prop in data ) {
4181 cache[ camelCase( prop ) ] = data[ prop ];
4182 }
4183 }
4184 return cache;
4185 },
4186 get: function( owner, key ) {
4187 return key === undefined ?
4188 this.cache( owner ) :
4189
4190 // Always use camelCase key (gh-2257)
4191 owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
4192 },
4193 access: function( owner, key, value ) {
4194
4195 // In cases where either:
4196 //
4197 // 1. No key was specified
4198 // 2. A string key was specified, but no value provided
4199 //
4200 // Take the "read" path and allow the get method to determine
4201 // which value to return, respectively either:
4202 //
4203 // 1. The entire cache object
4204 // 2. The data stored at the key
4205 //
4206 if ( key === undefined ||
4207 ( ( key && typeof key === "string" ) && value === undefined ) ) {
4208
4209 return this.get( owner, key );
4210 }
4211
4212 // When the key is not a string, or both a key and value
4213 // are specified, set or extend (existing objects) with either:
4214 //
4215 // 1. An object of properties
4216 // 2. A key and value
4217 //
4218 this.set( owner, key, value );
4219
4220 // Since the "set" path can have two possible entry points
4221 // return the expected data based on which path was taken[*]
4222 return value !== undefined ? value : key;
4223 },
4224 remove: function( owner, key ) {
4225 var i,
4226 cache = owner[ this.expando ];
4227
4228 if ( cache === undefined ) {
4229 return;
4230 }
4231
4232 if ( key !== undefined ) {
4233
4234 // Support array or space separated string of keys
4235 if ( Array.isArray( key ) ) {
4236
4237 // If key is an array of keys...
4238 // We always set camelCase keys, so remove that.
4239 key = key.map( camelCase );
4240 } else {
4241 key = camelCase( key );
4242
4243 // If a key with the spaces exists, use it.
4244 // Otherwise, create an array by matching non-whitespace
4245 key = key in cache ?
4246 [ key ] :
4247 ( key.match( rnothtmlwhite ) || [] );
4248 }
4249
4250 i = key.length;
4251
4252 while ( i-- ) {
4253 delete cache[ key[ i ] ];
4254 }
4255 }
4256
4257 // Remove the expando if there's no more data
4258 if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
4259
4260 // Support: Chrome <=35 - 45
4261 // Webkit & Blink performance suffers when deleting properties
4262 // from DOM nodes, so set to undefined instead
4263 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
4264 if ( owner.nodeType ) {
4265 owner[ this.expando ] = undefined;
4266 } else {
4267 delete owner[ this.expando ];
4268 }
4269 }
4270 },
4271 hasData: function( owner ) {
4272 var cache = owner[ this.expando ];
4273 return cache !== undefined && !jQuery.isEmptyObject( cache );
4274 }
4275};
4276var dataPriv = new Data();
4277
4278var dataUser = new Data();
4279
4280
4281
4282// Implementation Summary
4283//
4284// 1. Enforce API surface and semantic compatibility with 1.9.x branch
4285// 2. Improve the module's maintainability by reducing the storage
4286// paths to a single mechanism.
4287// 3. Use the same single mechanism to support "private" and "user" data.
4288// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
4289// 5. Avoid exposing implementation details on user objects (eg. expando properties)
4290// 6. Provide a clear path for implementation upgrade to WeakMap in 2014
4291
4292var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
4293 rmultiDash = /[A-Z]/g;
4294
4295function getData( data ) {
4296 if ( data === "true" ) {
4297 return true;
4298 }
4299
4300 if ( data === "false" ) {
4301 return false;
4302 }
4303
4304 if ( data === "null" ) {
4305 return null;
4306 }
4307
4308 // Only convert to a number if it doesn't change the string
4309 if ( data === +data + "" ) {
4310 return +data;
4311 }
4312
4313 if ( rbrace.test( data ) ) {
4314 return JSON.parse( data );
4315 }
4316
4317 return data;
4318}
4319
4320function dataAttr( elem, key, data ) {
4321 var name;
4322
4323 // If nothing was found internally, try to fetch any
4324 // data from the HTML5 data-* attribute
4325 if ( data === undefined && elem.nodeType === 1 ) {
4326 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
4327 data = elem.getAttribute( name );
4328
4329 if ( typeof data === "string" ) {
4330 try {
4331 data = getData( data );
4332 } catch ( e ) {}
4333
4334 // Make sure we set the data so it isn't changed later
4335 dataUser.set( elem, key, data );
4336 } else {
4337 data = undefined;
4338 }
4339 }
4340 return data;
4341}
4342
4343jQuery.extend( {
4344 hasData: function( elem ) {
4345 return dataUser.hasData( elem ) || dataPriv.hasData( elem );
4346 },
4347
4348 data: function( elem, name, data ) {
4349 return dataUser.access( elem, name, data );
4350 },
4351
4352 removeData: function( elem, name ) {
4353 dataUser.remove( elem, name );
4354 },
4355
4356 // TODO: Now that all calls to _data and _removeData have been replaced
4357 // with direct calls to dataPriv methods, these can be deprecated.
4358 _data: function( elem, name, data ) {
4359 return dataPriv.access( elem, name, data );
4360 },
4361
4362 _removeData: function( elem, name ) {
4363 dataPriv.remove( elem, name );
4364 }
4365} );
4366
4367jQuery.fn.extend( {
4368 data: function( key, value ) {
4369 var i, name, data,
4370 elem = this[ 0 ],
4371 attrs = elem && elem.attributes;
4372
4373 // Gets all values
4374 if ( key === undefined ) {
4375 if ( this.length ) {
4376 data = dataUser.get( elem );
4377
4378 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
4379 i = attrs.length;
4380 while ( i-- ) {
4381
4382 // Support: IE 11 only
4383 // The attrs elements can be null (#14894)
4384 if ( attrs[ i ] ) {
4385 name = attrs[ i ].name;
4386 if ( name.indexOf( "data-" ) === 0 ) {
4387 name = camelCase( name.slice( 5 ) );
4388 dataAttr( elem, name, data[ name ] );
4389 }
4390 }
4391 }
4392 dataPriv.set( elem, "hasDataAttrs", true );
4393 }
4394 }
4395
4396 return data;
4397 }
4398
4399 // Sets multiple values
4400 if ( typeof key === "object" ) {
4401 return this.each( function() {
4402 dataUser.set( this, key );
4403 } );
4404 }
4405
4406 return access( this, function( value ) {
4407 var data;
4408
4409 // The calling jQuery object (element matches) is not empty
4410 // (and therefore has an element appears at this[ 0 ]) and the
4411 // `value` parameter was not undefined. An empty jQuery object
4412 // will result in `undefined` for elem = this[ 0 ] which will
4413 // throw an exception if an attempt to read a data cache is made.
4414 if ( elem && value === undefined ) {
4415
4416 // Attempt to get data from the cache
4417 // The key will always be camelCased in Data
4418 data = dataUser.get( elem, key );
4419 if ( data !== undefined ) {
4420 return data;
4421 }
4422
4423 // Attempt to "discover" the data in
4424 // HTML5 custom data-* attrs
4425 data = dataAttr( elem, key );
4426 if ( data !== undefined ) {
4427 return data;
4428 }
4429
4430 // We tried really hard, but the data doesn't exist.
4431 return;
4432 }
4433
4434 // Set the data...
4435 this.each( function() {
4436
4437 // We always store the camelCased key
4438 dataUser.set( this, key, value );
4439 } );
4440 }, null, value, arguments.length > 1, null, true );
4441 },
4442
4443 removeData: function( key ) {
4444 return this.each( function() {
4445 dataUser.remove( this, key );
4446 } );
4447 }
4448} );
4449
4450
4451jQuery.extend( {
4452 queue: function( elem, type, data ) {
4453 var queue;
4454
4455 if ( elem ) {
4456 type = ( type || "fx" ) + "queue";
4457 queue = dataPriv.get( elem, type );
4458
4459 // Speed up dequeue by getting out quickly if this is just a lookup
4460 if ( data ) {
4461 if ( !queue || Array.isArray( data ) ) {
4462 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
4463 } else {
4464 queue.push( data );
4465 }
4466 }
4467 return queue || [];
4468 }
4469 },
4470
4471 dequeue: function( elem, type ) {
4472 type = type || "fx";
4473
4474 var queue = jQuery.queue( elem, type ),
4475 startLength = queue.length,
4476 fn = queue.shift(),
4477 hooks = jQuery._queueHooks( elem, type ),
4478 next = function() {
4479 jQuery.dequeue( elem, type );
4480 };
4481
4482 // If the fx queue is dequeued, always remove the progress sentinel
4483 if ( fn === "inprogress" ) {
4484 fn = queue.shift();
4485 startLength--;
4486 }
4487
4488 if ( fn ) {
4489
4490 // Add a progress sentinel to prevent the fx queue from being
4491 // automatically dequeued
4492 if ( type === "fx" ) {
4493 queue.unshift( "inprogress" );
4494 }
4495
4496 // Clear up the last queue stop function
4497 delete hooks.stop;
4498 fn.call( elem, next, hooks );
4499 }
4500
4501 if ( !startLength && hooks ) {
4502 hooks.empty.fire();
4503 }
4504 },
4505
4506 // Not public - generate a queueHooks object, or return the current one
4507 _queueHooks: function( elem, type ) {
4508 var key = type + "queueHooks";
4509 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
4510 empty: jQuery.Callbacks( "once memory" ).add( function() {
4511 dataPriv.remove( elem, [ type + "queue", key ] );
4512 } )
4513 } );
4514 }
4515} );
4516
4517jQuery.fn.extend( {
4518 queue: function( type, data ) {
4519 var setter = 2;
4520
4521 if ( typeof type !== "string" ) {
4522 data = type;
4523 type = "fx";
4524 setter--;
4525 }
4526
4527 if ( arguments.length < setter ) {
4528 return jQuery.queue( this[ 0 ], type );
4529 }
4530
4531 return data === undefined ?
4532 this :
4533 this.each( function() {
4534 var queue = jQuery.queue( this, type, data );
4535
4536 // Ensure a hooks for this queue
4537 jQuery._queueHooks( this, type );
4538
4539 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
4540 jQuery.dequeue( this, type );
4541 }
4542 } );
4543 },
4544 dequeue: function( type ) {
4545 return this.each( function() {
4546 jQuery.dequeue( this, type );
4547 } );
4548 },
4549 clearQueue: function( type ) {
4550 return this.queue( type || "fx", [] );
4551 },
4552
4553 // Get a promise resolved when queues of a certain type
4554 // are emptied (fx is the type by default)
4555 promise: function( type, obj ) {
4556 var tmp,
4557 count = 1,
4558 defer = jQuery.Deferred(),
4559 elements = this,
4560 i = this.length,
4561 resolve = function() {
4562 if ( !( --count ) ) {
4563 defer.resolveWith( elements, [ elements ] );
4564 }
4565 };
4566
4567 if ( typeof type !== "string" ) {
4568 obj = type;
4569 type = undefined;
4570 }
4571 type = type || "fx";
4572
4573 while ( i-- ) {
4574 tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
4575 if ( tmp && tmp.empty ) {
4576 count++;
4577 tmp.empty.add( resolve );
4578 }
4579 }
4580 resolve();
4581 return defer.promise( obj );
4582 }
4583} );
4584var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
4585
4586var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
4587
4588
4589var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
4590
4591var documentElement = document.documentElement;
4592
4593
4594
4595 var isAttached = function( elem ) {
4596 return jQuery.contains( elem.ownerDocument, elem );
4597 },
4598 composed = { composed: true };
4599
4600 // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
4601 // Check attachment across shadow DOM boundaries when possible (gh-3504)
4602 // Support: iOS 10.0-10.2 only
4603 // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
4604 // leading to errors. We need to check for `getRootNode`.
4605 if ( documentElement.getRootNode ) {
4606 isAttached = function( elem ) {
4607 return jQuery.contains( elem.ownerDocument, elem ) ||
4608 elem.getRootNode( composed ) === elem.ownerDocument;
4609 };
4610 }
4611var isHiddenWithinTree = function( elem, el ) {
4612
4613 // isHiddenWithinTree might be called from jQuery#filter function;
4614 // in that case, element will be second argument
4615 elem = el || elem;
4616
4617 // Inline style trumps all
4618 return elem.style.display === "none" ||
4619 elem.style.display === "" &&
4620
4621 // Otherwise, check computed style
4622 // Support: Firefox <=43 - 45
4623 // Disconnected elements can have computed display: none, so first confirm that elem is
4624 // in the document.
4625 isAttached( elem ) &&
4626
4627 jQuery.css( elem, "display" ) === "none";
4628 };
4629
4630var swap = function( elem, options, callback, args ) {
4631 var ret, name,
4632 old = {};
4633
4634 // Remember the old values, and insert the new ones
4635 for ( name in options ) {
4636 old[ name ] = elem.style[ name ];
4637 elem.style[ name ] = options[ name ];
4638 }
4639
4640 ret = callback.apply( elem, args || [] );
4641
4642 // Revert the old values
4643 for ( name in options ) {
4644 elem.style[ name ] = old[ name ];
4645 }
4646
4647 return ret;
4648};
4649
4650
4651
4652
4653function adjustCSS( elem, prop, valueParts, tween ) {
4654 var adjusted, scale,
4655 maxIterations = 20,
4656 currentValue = tween ?
4657 function() {
4658 return tween.cur();
4659 } :
4660 function() {
4661 return jQuery.css( elem, prop, "" );
4662 },
4663 initial = currentValue(),
4664 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
4665
4666 // Starting value computation is required for potential unit mismatches
4667 initialInUnit = elem.nodeType &&
4668 ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
4669 rcssNum.exec( jQuery.css( elem, prop ) );
4670
4671 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
4672
4673 // Support: Firefox <=54
4674 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
4675 initial = initial / 2;
4676
4677 // Trust units reported by jQuery.css
4678 unit = unit || initialInUnit[ 3 ];
4679
4680 // Iteratively approximate from a nonzero starting point
4681 initialInUnit = +initial || 1;
4682
4683 while ( maxIterations-- ) {
4684
4685 // Evaluate and update our best guess (doubling guesses that zero out).
4686 // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
4687 jQuery.style( elem, prop, initialInUnit + unit );
4688 if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
4689 maxIterations = 0;
4690 }
4691 initialInUnit = initialInUnit / scale;
4692
4693 }
4694
4695 initialInUnit = initialInUnit * 2;
4696 jQuery.style( elem, prop, initialInUnit + unit );
4697
4698 // Make sure we update the tween properties later on
4699 valueParts = valueParts || [];
4700 }
4701
4702 if ( valueParts ) {
4703 initialInUnit = +initialInUnit || +initial || 0;
4704
4705 // Apply relative offset (+=/-=) if specified
4706 adjusted = valueParts[ 1 ] ?
4707 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
4708 +valueParts[ 2 ];
4709 if ( tween ) {
4710 tween.unit = unit;
4711 tween.start = initialInUnit;
4712 tween.end = adjusted;
4713 }
4714 }
4715 return adjusted;
4716}
4717
4718
4719var defaultDisplayMap = {};
4720
4721function getDefaultDisplay( elem ) {
4722 var temp,
4723 doc = elem.ownerDocument,
4724 nodeName = elem.nodeName,
4725 display = defaultDisplayMap[ nodeName ];
4726
4727 if ( display ) {
4728 return display;
4729 }
4730
4731 temp = doc.body.appendChild( doc.createElement( nodeName ) );
4732 display = jQuery.css( temp, "display" );
4733
4734 temp.parentNode.removeChild( temp );
4735
4736 if ( display === "none" ) {
4737 display = "block";
4738 }
4739 defaultDisplayMap[ nodeName ] = display;
4740
4741 return display;
4742}
4743
4744function showHide( elements, show ) {
4745 var display, elem,
4746 values = [],
4747 index = 0,
4748 length = elements.length;
4749
4750 // Determine new display value for elements that need to change
4751 for ( ; index < length; index++ ) {
4752 elem = elements[ index ];
4753 if ( !elem.style ) {
4754 continue;
4755 }
4756
4757 display = elem.style.display;
4758 if ( show ) {
4759
4760 // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
4761 // check is required in this first loop unless we have a nonempty display value (either
4762 // inline or about-to-be-restored)
4763 if ( display === "none" ) {
4764 values[ index ] = dataPriv.get( elem, "display" ) || null;
4765 if ( !values[ index ] ) {
4766 elem.style.display = "";
4767 }
4768 }
4769 if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
4770 values[ index ] = getDefaultDisplay( elem );
4771 }
4772 } else {
4773 if ( display !== "none" ) {
4774 values[ index ] = "none";
4775
4776 // Remember what we're overwriting
4777 dataPriv.set( elem, "display", display );
4778 }
4779 }
4780 }
4781
4782 // Set the display of the elements in a second loop to avoid constant reflow
4783 for ( index = 0; index < length; index++ ) {
4784 if ( values[ index ] != null ) {
4785 elements[ index ].style.display = values[ index ];
4786 }
4787 }
4788
4789 return elements;
4790}
4791
4792jQuery.fn.extend( {
4793 show: function() {
4794 return showHide( this, true );
4795 },
4796 hide: function() {
4797 return showHide( this );
4798 },
4799 toggle: function( state ) {
4800 if ( typeof state === "boolean" ) {
4801 return state ? this.show() : this.hide();
4802 }
4803
4804 return this.each( function() {
4805 if ( isHiddenWithinTree( this ) ) {
4806 jQuery( this ).show();
4807 } else {
4808 jQuery( this ).hide();
4809 }
4810 } );
4811 }
4812} );
4813var rcheckableType = ( /^(?:checkbox|radio)$/i );
4814
4815var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
4816
4817var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
4818
4819
4820
4821// We have to close these tags to support XHTML (#13200)
4822var wrapMap = {
4823
4824 // Support: IE <=9 only
4825 option: [ 1, "<select multiple='multiple'>", "</select>" ],
4826
4827 // XHTML parsers do not magically insert elements in the
4828 // same way that tag soup parsers do. So we cannot shorten
4829 // this by omitting <tbody> or other required elements.
4830 thead: [ 1, "<table>", "</table>" ],
4831 col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
4832 tr: [ 2, "<table><tbody>", "</tbody></table>" ],
4833 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
4834
4835 _default: [ 0, "", "" ]
4836};
4837
4838// Support: IE <=9 only
4839wrapMap.optgroup = wrapMap.option;
4840
4841wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
4842wrapMap.th = wrapMap.td;
4843
4844
4845function getAll( context, tag ) {
4846
4847 // Support: IE <=9 - 11 only
4848 // Use typeof to avoid zero-argument method invocation on host objects (#15151)
4849 var ret;
4850
4851 if ( typeof context.getElementsByTagName !== "undefined" ) {
4852 ret = context.getElementsByTagName( tag || "*" );
4853
4854 } else if ( typeof context.querySelectorAll !== "undefined" ) {
4855 ret = context.querySelectorAll( tag || "*" );
4856
4857 } else {
4858 ret = [];
4859 }
4860
4861 if ( tag === undefined || tag && nodeName( context, tag ) ) {
4862 return jQuery.merge( [ context ], ret );
4863 }
4864
4865 return ret;
4866}
4867
4868
4869// Mark scripts as having already been evaluated
4870function setGlobalEval( elems, refElements ) {
4871 var i = 0,
4872 l = elems.length;
4873
4874 for ( ; i < l; i++ ) {
4875 dataPriv.set(
4876 elems[ i ],
4877 "globalEval",
4878 !refElements || dataPriv.get( refElements[ i ], "globalEval" )
4879 );
4880 }
4881}
4882
4883
4884var rhtml = /<|&#?\w+;/;
4885
4886function buildFragment( elems, context, scripts, selection, ignored ) {
4887 var elem, tmp, tag, wrap, attached, j,
4888 fragment = context.createDocumentFragment(),
4889 nodes = [],
4890 i = 0,
4891 l = elems.length;
4892
4893 for ( ; i < l; i++ ) {
4894 elem = elems[ i ];
4895
4896 if ( elem || elem === 0 ) {
4897
4898 // Add nodes directly
4899 if ( toType( elem ) === "object" ) {
4900
4901 // Support: Android <=4.0 only, PhantomJS 1 only
4902 // push.apply(_, arraylike) throws on ancient WebKit
4903 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
4904
4905 // Convert non-html into a text node
4906 } else if ( !rhtml.test( elem ) ) {
4907 nodes.push( context.createTextNode( elem ) );
4908
4909 // Convert html into DOM nodes
4910 } else {
4911 tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
4912
4913 // Deserialize a standard representation
4914 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
4915 wrap = wrapMap[ tag ] || wrapMap._default;
4916 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
4917
4918 // Descend through wrappers to the right content
4919 j = wrap[ 0 ];
4920 while ( j-- ) {
4921 tmp = tmp.lastChild;
4922 }
4923
4924 // Support: Android <=4.0 only, PhantomJS 1 only
4925 // push.apply(_, arraylike) throws on ancient WebKit
4926 jQuery.merge( nodes, tmp.childNodes );
4927
4928 // Remember the top-level container
4929 tmp = fragment.firstChild;
4930
4931 // Ensure the created nodes are orphaned (#12392)
4932 tmp.textContent = "";
4933 }
4934 }
4935 }
4936
4937 // Remove wrapper from fragment
4938 fragment.textContent = "";
4939
4940 i = 0;
4941 while ( ( elem = nodes[ i++ ] ) ) {
4942
4943 // Skip elements already in the context collection (trac-4087)
4944 if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
4945 if ( ignored ) {
4946 ignored.push( elem );
4947 }
4948 continue;
4949 }
4950
4951 attached = isAttached( elem );
4952
4953 // Append to fragment
4954 tmp = getAll( fragment.appendChild( elem ), "script" );
4955
4956 // Preserve script evaluation history
4957 if ( attached ) {
4958 setGlobalEval( tmp );
4959 }
4960
4961 // Capture executables
4962 if ( scripts ) {
4963 j = 0;
4964 while ( ( elem = tmp[ j++ ] ) ) {
4965 if ( rscriptType.test( elem.type || "" ) ) {
4966 scripts.push( elem );
4967 }
4968 }
4969 }
4970 }
4971
4972 return fragment;
4973}
4974
4975
4976( function() {
4977 var fragment = document.createDocumentFragment(),
4978 div = fragment.appendChild( document.createElement( "div" ) ),
4979 input = document.createElement( "input" );
4980
4981 // Support: Android 4.0 - 4.3 only
4982 // Check state lost if the name is set (#11217)
4983 // Support: Windows Web Apps (WWA)
4984 // `name` and `type` must use .setAttribute for WWA (#14901)
4985 input.setAttribute( "type", "radio" );
4986 input.setAttribute( "checked", "checked" );
4987 input.setAttribute( "name", "t" );
4988
4989 div.appendChild( input );
4990
4991 // Support: Android <=4.1 only
4992 // Older WebKit doesn't clone checked state correctly in fragments
4993 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
4994
4995 // Support: IE <=11 only
4996 // Make sure textarea (and checkbox) defaultValue is properly cloned
4997 div.innerHTML = "<textarea>x</textarea>";
4998 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
4999} )();
5000
5001
5002var
5003 rkeyEvent = /^key/,
5004 rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
5005 rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
5006
5007function returnTrue() {
5008 return true;
5009}
5010
5011function returnFalse() {
5012 return false;
5013}
5014
5015// Support: IE <=9 - 11+
5016// focus() and blur() are asynchronous, except when they are no-op.
5017// So expect focus to be synchronous when the element is already active,
5018// and blur to be synchronous when the element is not already active.
5019// (focus and blur are always synchronous in other supported browsers,
5020// this just defines when we can count on it).
5021function expectSync( elem, type ) {
5022 return ( elem === safeActiveElement() ) === ( type === "focus" );
5023}
5024
5025// Support: IE <=9 only
5026// Accessing document.activeElement can throw unexpectedly
5027// https://bugs.jquery.com/ticket/13393
5028function safeActiveElement() {
5029 try {
5030 return document.activeElement;
5031 } catch ( err ) { }
5032}
5033
5034function on( elem, types, selector, data, fn, one ) {
5035 var origFn, type;
5036
5037 // Types can be a map of types/handlers
5038 if ( typeof types === "object" ) {
5039
5040 // ( types-Object, selector, data )
5041 if ( typeof selector !== "string" ) {
5042
5043 // ( types-Object, data )
5044 data = data || selector;
5045 selector = undefined;
5046 }
5047 for ( type in types ) {
5048 on( elem, type, selector, data, types[ type ], one );
5049 }
5050 return elem;
5051 }
5052
5053 if ( data == null && fn == null ) {
5054
5055 // ( types, fn )
5056 fn = selector;
5057 data = selector = undefined;
5058 } else if ( fn == null ) {
5059 if ( typeof selector === "string" ) {
5060
5061 // ( types, selector, fn )
5062 fn = data;
5063 data = undefined;
5064 } else {
5065
5066 // ( types, data, fn )
5067 fn = data;
5068 data = selector;
5069 selector = undefined;
5070 }
5071 }
5072 if ( fn === false ) {
5073 fn = returnFalse;
5074 } else if ( !fn ) {
5075 return elem;
5076 }
5077
5078 if ( one === 1 ) {
5079 origFn = fn;
5080 fn = function( event ) {
5081
5082 // Can use an empty set, since event contains the info
5083 jQuery().off( event );
5084 return origFn.apply( this, arguments );
5085 };
5086
5087 // Use same guid so caller can remove using origFn
5088 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
5089 }
5090 return elem.each( function() {
5091 jQuery.event.add( this, types, fn, data, selector );
5092 } );
5093}
5094
5095/*
5096 * Helper functions for managing events -- not part of the public interface.
5097 * Props to Dean Edwards' addEvent library for many of the ideas.
5098 */
5099jQuery.event = {
5100
5101 global: {},
5102
5103 add: function( elem, types, handler, data, selector ) {
5104
5105 var handleObjIn, eventHandle, tmp,
5106 events, t, handleObj,
5107 special, handlers, type, namespaces, origType,
5108 elemData = dataPriv.get( elem );
5109
5110 // Don't attach events to noData or text/comment nodes (but allow plain objects)
5111 if ( !elemData ) {
5112 return;
5113 }
5114
5115 // Caller can pass in an object of custom data in lieu of the handler
5116 if ( handler.handler ) {
5117 handleObjIn = handler;
5118 handler = handleObjIn.handler;
5119 selector = handleObjIn.selector;
5120 }
5121
5122 // Ensure that invalid selectors throw exceptions at attach time
5123 // Evaluate against documentElement in case elem is a non-element node (e.g., document)
5124 if ( selector ) {
5125 jQuery.find.matchesSelector( documentElement, selector );
5126 }
5127
5128 // Make sure that the handler has a unique ID, used to find/remove it later
5129 if ( !handler.guid ) {
5130 handler.guid = jQuery.guid++;
5131 }
5132
5133 // Init the element's event structure and main handler, if this is the first
5134 if ( !( events = elemData.events ) ) {
5135 events = elemData.events = {};
5136 }
5137 if ( !( eventHandle = elemData.handle ) ) {
5138 eventHandle = elemData.handle = function( e ) {
5139
5140 // Discard the second event of a jQuery.event.trigger() and
5141 // when an event is called after a page has unloaded
5142 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
5143 jQuery.event.dispatch.apply( elem, arguments ) : undefined;
5144 };
5145 }
5146
5147 // Handle multiple events separated by a space
5148 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
5149 t = types.length;
5150 while ( t-- ) {
5151 tmp = rtypenamespace.exec( types[ t ] ) || [];
5152 type = origType = tmp[ 1 ];
5153 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
5154
5155 // There *must* be a type, no attaching namespace-only handlers
5156 if ( !type ) {
5157 continue;
5158 }
5159
5160 // If event changes its type, use the special event handlers for the changed type
5161 special = jQuery.event.special[ type ] || {};
5162
5163 // If selector defined, determine special event api type, otherwise given type
5164 type = ( selector ? special.delegateType : special.bindType ) || type;
5165
5166 // Update special based on newly reset type
5167 special = jQuery.event.special[ type ] || {};
5168
5169 // handleObj is passed to all event handlers
5170 handleObj = jQuery.extend( {
5171 type: type,
5172 origType: origType,
5173 data: data,
5174 handler: handler,
5175 guid: handler.guid,
5176 selector: selector,
5177 needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
5178 namespace: namespaces.join( "." )
5179 }, handleObjIn );
5180
5181 // Init the event handler queue if we're the first
5182 if ( !( handlers = events[ type ] ) ) {
5183 handlers = events[ type ] = [];
5184 handlers.delegateCount = 0;
5185
5186 // Only use addEventListener if the special events handler returns false
5187 if ( !special.setup ||
5188 special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
5189
5190 if ( elem.addEventListener ) {
5191 elem.addEventListener( type, eventHandle );
5192 }
5193 }
5194 }
5195
5196 if ( special.add ) {
5197 special.add.call( elem, handleObj );
5198
5199 if ( !handleObj.handler.guid ) {
5200 handleObj.handler.guid = handler.guid;
5201 }
5202 }
5203
5204 // Add to the element's handler list, delegates in front
5205 if ( selector ) {
5206 handlers.splice( handlers.delegateCount++, 0, handleObj );
5207 } else {
5208 handlers.push( handleObj );
5209 }
5210
5211 // Keep track of which events have ever been used, for event optimization
5212 jQuery.event.global[ type ] = true;
5213 }
5214
5215 },
5216
5217 // Detach an event or set of events from an element
5218 remove: function( elem, types, handler, selector, mappedTypes ) {
5219
5220 var j, origCount, tmp,
5221 events, t, handleObj,
5222 special, handlers, type, namespaces, origType,
5223 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
5224
5225 if ( !elemData || !( events = elemData.events ) ) {
5226 return;
5227 }
5228
5229 // Once for each type.namespace in types; type may be omitted
5230 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
5231 t = types.length;
5232 while ( t-- ) {
5233 tmp = rtypenamespace.exec( types[ t ] ) || [];
5234 type = origType = tmp[ 1 ];
5235 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
5236
5237 // Unbind all events (on this namespace, if provided) for the element
5238 if ( !type ) {
5239 for ( type in events ) {
5240 jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
5241 }
5242 continue;
5243 }
5244
5245 special = jQuery.event.special[ type ] || {};
5246 type = ( selector ? special.delegateType : special.bindType ) || type;
5247 handlers = events[ type ] || [];
5248 tmp = tmp[ 2 ] &&
5249 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
5250
5251 // Remove matching events
5252 origCount = j = handlers.length;
5253 while ( j-- ) {
5254 handleObj = handlers[ j ];
5255
5256 if ( ( mappedTypes || origType === handleObj.origType ) &&
5257 ( !handler || handler.guid === handleObj.guid ) &&
5258 ( !tmp || tmp.test( handleObj.namespace ) ) &&
5259 ( !selector || selector === handleObj.selector ||
5260 selector === "**" && handleObj.selector ) ) {
5261 handlers.splice( j, 1 );
5262
5263 if ( handleObj.selector ) {
5264 handlers.delegateCount--;
5265 }
5266 if ( special.remove ) {
5267 special.remove.call( elem, handleObj );
5268 }
5269 }
5270 }
5271
5272 // Remove generic event handler if we removed something and no more handlers exist
5273 // (avoids potential for endless recursion during removal of special event handlers)
5274 if ( origCount && !handlers.length ) {
5275 if ( !special.teardown ||
5276 special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
5277
5278 jQuery.removeEvent( elem, type, elemData.handle );
5279 }
5280
5281 delete events[ type ];
5282 }
5283 }
5284
5285 // Remove data and the expando if it's no longer used
5286 if ( jQuery.isEmptyObject( events ) ) {
5287 dataPriv.remove( elem, "handle events" );
5288 }
5289 },
5290
5291 dispatch: function( nativeEvent ) {
5292
5293 // Make a writable jQuery.Event from the native event object
5294 var event = jQuery.event.fix( nativeEvent );
5295
5296 var i, j, ret, matched, handleObj, handlerQueue,
5297 args = new Array( arguments.length ),
5298 handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
5299 special = jQuery.event.special[ event.type ] || {};
5300
5301 // Use the fix-ed jQuery.Event rather than the (read-only) native event
5302 args[ 0 ] = event;
5303
5304 for ( i = 1; i < arguments.length; i++ ) {
5305 args[ i ] = arguments[ i ];
5306 }
5307
5308 event.delegateTarget = this;
5309
5310 // Call the preDispatch hook for the mapped type, and let it bail if desired
5311 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
5312 return;
5313 }
5314
5315 // Determine handlers
5316 handlerQueue = jQuery.event.handlers.call( this, event, handlers );
5317
5318 // Run delegates first; they may want to stop propagation beneath us
5319 i = 0;
5320 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
5321 event.currentTarget = matched.elem;
5322
5323 j = 0;
5324 while ( ( handleObj = matched.handlers[ j++ ] ) &&
5325 !event.isImmediatePropagationStopped() ) {
5326
5327 // If the event is namespaced, then each handler is only invoked if it is
5328 // specially universal or its namespaces are a superset of the event's.
5329 if ( !event.rnamespace || handleObj.namespace === false ||
5330 event.rnamespace.test( handleObj.namespace ) ) {
5331
5332 event.handleObj = handleObj;
5333 event.data = handleObj.data;
5334
5335 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
5336 handleObj.handler ).apply( matched.elem, args );
5337
5338 if ( ret !== undefined ) {
5339 if ( ( event.result = ret ) === false ) {
5340 event.preventDefault();
5341 event.stopPropagation();
5342 }
5343 }
5344 }
5345 }
5346 }
5347
5348 // Call the postDispatch hook for the mapped type
5349 if ( special.postDispatch ) {
5350 special.postDispatch.call( this, event );
5351 }
5352
5353 return event.result;
5354 },
5355
5356 handlers: function( event, handlers ) {
5357 var i, handleObj, sel, matchedHandlers, matchedSelectors,
5358 handlerQueue = [],
5359 delegateCount = handlers.delegateCount,
5360 cur = event.target;
5361
5362 // Find delegate handlers
5363 if ( delegateCount &&
5364
5365 // Support: IE <=9
5366 // Black-hole SVG <use> instance trees (trac-13180)
5367 cur.nodeType &&
5368
5369 // Support: Firefox <=42
5370 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
5371 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
5372 // Support: IE 11 only
5373 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
5374 !( event.type === "click" && event.button >= 1 ) ) {
5375
5376 for ( ; cur !== this; cur = cur.parentNode || this ) {
5377
5378 // Don't check non-elements (#13208)
5379 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
5380 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
5381 matchedHandlers = [];
5382 matchedSelectors = {};
5383 for ( i = 0; i < delegateCount; i++ ) {
5384 handleObj = handlers[ i ];
5385
5386 // Don't conflict with Object.prototype properties (#13203)
5387 sel = handleObj.selector + " ";
5388
5389 if ( matchedSelectors[ sel ] === undefined ) {
5390 matchedSelectors[ sel ] = handleObj.needsContext ?
5391 jQuery( sel, this ).index( cur ) > -1 :
5392 jQuery.find( sel, this, null, [ cur ] ).length;
5393 }
5394 if ( matchedSelectors[ sel ] ) {
5395 matchedHandlers.push( handleObj );
5396 }
5397 }
5398 if ( matchedHandlers.length ) {
5399 handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
5400 }
5401 }
5402 }
5403 }
5404
5405 // Add the remaining (directly-bound) handlers
5406 cur = this;
5407 if ( delegateCount < handlers.length ) {
5408 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
5409 }
5410
5411 return handlerQueue;
5412 },
5413
5414 addProp: function( name, hook ) {
5415 Object.defineProperty( jQuery.Event.prototype, name, {
5416 enumerable: true,
5417 configurable: true,
5418
5419 get: isFunction( hook ) ?
5420 function() {
5421 if ( this.originalEvent ) {
5422 return hook( this.originalEvent );
5423 }
5424 } :
5425 function() {
5426 if ( this.originalEvent ) {
5427 return this.originalEvent[ name ];
5428 }
5429 },
5430
5431 set: function( value ) {
5432 Object.defineProperty( this, name, {
5433 enumerable: true,
5434 configurable: true,
5435 writable: true,
5436 value: value
5437 } );
5438 }
5439 } );
5440 },
5441
5442 fix: function( originalEvent ) {
5443 return originalEvent[ jQuery.expando ] ?
5444 originalEvent :
5445 new jQuery.Event( originalEvent );
5446 },
5447
5448 special: {
5449 load: {
5450
5451 // Prevent triggered image.load events from bubbling to window.load
5452 noBubble: true
5453 },
5454 click: {
5455
5456 // Utilize native event to ensure correct state for checkable inputs
5457 setup: function( data ) {
5458
5459 // For mutual compressibility with _default, replace `this` access with a local var.
5460 // `|| data` is dead code meant only to preserve the variable through minification.
5461 var el = this || data;
5462
5463 // Claim the first handler
5464 if ( rcheckableType.test( el.type ) &&
5465 el.click && nodeName( el, "input" ) ) {
5466
5467 // dataPriv.set( el, "click", ... )
5468 leverageNative( el, "click", returnTrue );
5469 }
5470
5471 // Return false to allow normal processing in the caller
5472 return false;
5473 },
5474 trigger: function( data ) {
5475
5476 // For mutual compressibility with _default, replace `this` access with a local var.
5477 // `|| data` is dead code meant only to preserve the variable through minification.
5478 var el = this || data;
5479
5480 // Force setup before triggering a click
5481 if ( rcheckableType.test( el.type ) &&
5482 el.click && nodeName( el, "input" ) ) {
5483
5484 leverageNative( el, "click" );
5485 }
5486
5487 // Return non-false to allow normal event-path propagation
5488 return true;
5489 },
5490
5491 // For cross-browser consistency, suppress native .click() on links
5492 // Also prevent it if we're currently inside a leveraged native-event stack
5493 _default: function( event ) {
5494 var target = event.target;
5495 return rcheckableType.test( target.type ) &&
5496 target.click && nodeName( target, "input" ) &&
5497 dataPriv.get( target, "click" ) ||
5498 nodeName( target, "a" );
5499 }
5500 },
5501
5502 beforeunload: {
5503 postDispatch: function( event ) {
5504
5505 // Support: Firefox 20+
5506 // Firefox doesn't alert if the returnValue field is not set.
5507 if ( event.result !== undefined && event.originalEvent ) {
5508 event.originalEvent.returnValue = event.result;
5509 }
5510 }
5511 }
5512 }
5513};
5514
5515// Ensure the presence of an event listener that handles manually-triggered
5516// synthetic events by interrupting progress until reinvoked in response to
5517// *native* events that it fires directly, ensuring that state changes have
5518// already occurred before other listeners are invoked.
5519function leverageNative( el, type, expectSync ) {
5520
5521 // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
5522 if ( !expectSync ) {
5523 if ( dataPriv.get( el, type ) === undefined ) {
5524 jQuery.event.add( el, type, returnTrue );
5525 }
5526 return;
5527 }
5528
5529 // Register the controller as a special universal handler for all event namespaces
5530 dataPriv.set( el, type, false );
5531 jQuery.event.add( el, type, {
5532 namespace: false,
5533 handler: function( event ) {
5534 var notAsync, result,
5535 saved = dataPriv.get( this, type );
5536
5537 if ( ( event.isTrigger & 1 ) && this[ type ] ) {
5538
5539 // Interrupt processing of the outer synthetic .trigger()ed event
5540 // Saved data should be false in such cases, but might be a leftover capture object
5541 // from an async native handler (gh-4350)
5542 if ( !saved.length ) {
5543
5544 // Store arguments for use when handling the inner native event
5545 // There will always be at least one argument (an event object), so this array
5546 // will not be confused with a leftover capture object.
5547 saved = slice.call( arguments );
5548 dataPriv.set( this, type, saved );
5549
5550 // Trigger the native event and capture its result
5551 // Support: IE <=9 - 11+
5552 // focus() and blur() are asynchronous
5553 notAsync = expectSync( this, type );
5554 this[ type ]();
5555 result = dataPriv.get( this, type );
5556 if ( saved !== result || notAsync ) {
5557 dataPriv.set( this, type, false );
5558 } else {
5559 result = {};
5560 }
5561 if ( saved !== result ) {
5562
5563 // Cancel the outer synthetic event
5564 event.stopImmediatePropagation();
5565 event.preventDefault();
5566 return result.value;
5567 }
5568
5569 // If this is an inner synthetic event for an event with a bubbling surrogate
5570 // (focus or blur), assume that the surrogate already propagated from triggering the
5571 // native event and prevent that from happening again here.
5572 // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
5573 // bubbling surrogate propagates *after* the non-bubbling base), but that seems
5574 // less bad than duplication.
5575 } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
5576 event.stopPropagation();
5577 }
5578
5579 // If this is a native event triggered above, everything is now in order
5580 // Fire an inner synthetic event with the original arguments
5581 } else if ( saved.length ) {
5582
5583 // ...and capture the result
5584 dataPriv.set( this, type, {
5585 value: jQuery.event.trigger(
5586
5587 // Support: IE <=9 - 11+
5588 // Extend with the prototype to reset the above stopImmediatePropagation()
5589 jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
5590 saved.slice( 1 ),
5591 this
5592 )
5593 } );
5594
5595 // Abort handling of the native event
5596 event.stopImmediatePropagation();
5597 }
5598 }
5599 } );
5600}
5601
5602jQuery.removeEvent = function( elem, type, handle ) {
5603
5604 // This "if" is needed for plain objects
5605 if ( elem.removeEventListener ) {
5606 elem.removeEventListener( type, handle );
5607 }
5608};
5609
5610jQuery.Event = function( src, props ) {
5611
5612 // Allow instantiation without the 'new' keyword
5613 if ( !( this instanceof jQuery.Event ) ) {
5614 return new jQuery.Event( src, props );
5615 }
5616
5617 // Event object
5618 if ( src && src.type ) {
5619 this.originalEvent = src;
5620 this.type = src.type;
5621
5622 // Events bubbling up the document may have been marked as prevented
5623 // by a handler lower down the tree; reflect the correct value.
5624 this.isDefaultPrevented = src.defaultPrevented ||
5625 src.defaultPrevented === undefined &&
5626
5627 // Support: Android <=2.3 only
5628 src.returnValue === false ?
5629 returnTrue :
5630 returnFalse;
5631
5632 // Create target properties
5633 // Support: Safari <=6 - 7 only
5634 // Target should not be a text node (#504, #13143)
5635 this.target = ( src.target && src.target.nodeType === 3 ) ?
5636 src.target.parentNode :
5637 src.target;
5638
5639 this.currentTarget = src.currentTarget;
5640 this.relatedTarget = src.relatedTarget;
5641
5642 // Event type
5643 } else {
5644 this.type = src;
5645 }
5646
5647 // Put explicitly provided properties onto the event object
5648 if ( props ) {
5649 jQuery.extend( this, props );
5650 }
5651
5652 // Create a timestamp if incoming event doesn't have one
5653 this.timeStamp = src && src.timeStamp || Date.now();
5654
5655 // Mark it as fixed
5656 this[ jQuery.expando ] = true;
5657};
5658
5659// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
5660// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
5661jQuery.Event.prototype = {
5662 constructor: jQuery.Event,
5663 isDefaultPrevented: returnFalse,
5664 isPropagationStopped: returnFalse,
5665 isImmediatePropagationStopped: returnFalse,
5666 isSimulated: false,
5667
5668 preventDefault: function() {
5669 var e = this.originalEvent;
5670
5671 this.isDefaultPrevented = returnTrue;
5672
5673 if ( e && !this.isSimulated ) {
5674 e.preventDefault();
5675 }
5676 },
5677 stopPropagation: function() {
5678 var e = this.originalEvent;
5679
5680 this.isPropagationStopped = returnTrue;
5681
5682 if ( e && !this.isSimulated ) {
5683 e.stopPropagation();
5684 }
5685 },
5686 stopImmediatePropagation: function() {
5687 var e = this.originalEvent;
5688
5689 this.isImmediatePropagationStopped = returnTrue;
5690
5691 if ( e && !this.isSimulated ) {
5692 e.stopImmediatePropagation();
5693 }
5694
5695 this.stopPropagation();
5696 }
5697};
5698
5699// Includes all common event props including KeyEvent and MouseEvent specific props
5700jQuery.each( {
5701 altKey: true,
5702 bubbles: true,
5703 cancelable: true,
5704 changedTouches: true,
5705 ctrlKey: true,
5706 detail: true,
5707 eventPhase: true,
5708 metaKey: true,
5709 pageX: true,
5710 pageY: true,
5711 shiftKey: true,
5712 view: true,
5713 "char": true,
5714 code: true,
5715 charCode: true,
5716 key: true,
5717 keyCode: true,
5718 button: true,
5719 buttons: true,
5720 clientX: true,
5721 clientY: true,
5722 offsetX: true,
5723 offsetY: true,
5724 pointerId: true,
5725 pointerType: true,
5726 screenX: true,
5727 screenY: true,
5728 targetTouches: true,
5729 toElement: true,
5730 touches: true,
5731
5732 which: function( event ) {
5733 var button = event.button;
5734
5735 // Add which for key events
5736 if ( event.which == null && rkeyEvent.test( event.type ) ) {
5737 return event.charCode != null ? event.charCode : event.keyCode;
5738 }
5739
5740 // Add which for click: 1 === left; 2 === middle; 3 === right
5741 if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
5742 if ( button & 1 ) {
5743 return 1;
5744 }
5745
5746 if ( button & 2 ) {
5747 return 3;
5748 }
5749
5750 if ( button & 4 ) {
5751 return 2;
5752 }
5753
5754 return 0;
5755 }
5756
5757 return event.which;
5758 }
5759}, jQuery.event.addProp );
5760
5761jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
5762 jQuery.event.special[ type ] = {
5763
5764 // Utilize native event if possible so blur/focus sequence is correct
5765 setup: function() {
5766
5767 // Claim the first handler
5768 // dataPriv.set( this, "focus", ... )
5769 // dataPriv.set( this, "blur", ... )
5770 leverageNative( this, type, expectSync );
5771
5772 // Return false to allow normal processing in the caller
5773 return false;
5774 },
5775 trigger: function() {
5776
5777 // Force setup before trigger
5778 leverageNative( this, type );
5779
5780 // Return non-false to allow normal event-path propagation
5781 return true;
5782 },
5783
5784 delegateType: delegateType
5785 };
5786} );
5787
5788// Create mouseenter/leave events using mouseover/out and event-time checks
5789// so that event delegation works in jQuery.
5790// Do the same for pointerenter/pointerleave and pointerover/pointerout
5791//
5792// Support: Safari 7 only
5793// Safari sends mouseenter too often; see:
5794// https://bugs.chromium.org/p/chromium/issues/detail?id=470258
5795// for the description of the bug (it existed in older Chrome versions as well).
5796jQuery.each( {
5797 mouseenter: "mouseover",
5798 mouseleave: "mouseout",
5799 pointerenter: "pointerover",
5800 pointerleave: "pointerout"
5801}, function( orig, fix ) {
5802 jQuery.event.special[ orig ] = {
5803 delegateType: fix,
5804 bindType: fix,
5805
5806 handle: function( event ) {
5807 var ret,
5808 target = this,
5809 related = event.relatedTarget,
5810 handleObj = event.handleObj;
5811
5812 // For mouseenter/leave call the handler if related is outside the target.
5813 // NB: No relatedTarget if the mouse left/entered the browser window
5814 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
5815 event.type = handleObj.origType;
5816 ret = handleObj.handler.apply( this, arguments );
5817 event.type = fix;
5818 }
5819 return ret;
5820 }
5821 };
5822} );
5823
5824jQuery.fn.extend( {
5825
5826 on: function( types, selector, data, fn ) {
5827 return on( this, types, selector, data, fn );
5828 },
5829 one: function( types, selector, data, fn ) {
5830 return on( this, types, selector, data, fn, 1 );
5831 },
5832 off: function( types, selector, fn ) {
5833 var handleObj, type;
5834 if ( types && types.preventDefault && types.handleObj ) {
5835
5836 // ( event ) dispatched jQuery.Event
5837 handleObj = types.handleObj;
5838 jQuery( types.delegateTarget ).off(
5839 handleObj.namespace ?
5840 handleObj.origType + "." + handleObj.namespace :
5841 handleObj.origType,
5842 handleObj.selector,
5843 handleObj.handler
5844 );
5845 return this;
5846 }
5847 if ( typeof types === "object" ) {
5848
5849 // ( types-object [, selector] )
5850 for ( type in types ) {
5851 this.off( type, selector, types[ type ] );
5852 }
5853 return this;
5854 }
5855 if ( selector === false || typeof selector === "function" ) {
5856
5857 // ( types [, fn] )
5858 fn = selector;
5859 selector = undefined;
5860 }
5861 if ( fn === false ) {
5862 fn = returnFalse;
5863 }
5864 return this.each( function() {
5865 jQuery.event.remove( this, types, fn, selector );
5866 } );
5867 }
5868} );
5869
5870
5871var
5872
5873 /* eslint-disable max-len */
5874
5875 // See https://github.com/eslint/eslint/issues/3229
5876 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
5877
5878 /* eslint-enable */
5879
5880 // Support: IE <=10 - 11, Edge 12 - 13 only
5881 // In IE/Edge using regex groups here causes severe slowdowns.
5882 // See https://connect.microsoft.com/IE/feedback/details/1736512/
5883 rnoInnerhtml = /<script|<style|<link/i,
5884
5885 // checked="checked" or checked
5886 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5887 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
5888
5889// Prefer a tbody over its parent table for containing new rows
5890function manipulationTarget( elem, content ) {
5891 if ( nodeName( elem, "table" ) &&
5892 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
5893
5894 return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
5895 }
5896
5897 return elem;
5898}
5899
5900// Replace/restore the type attribute of script elements for safe DOM manipulation
5901function disableScript( elem ) {
5902 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
5903 return elem;
5904}
5905function restoreScript( elem ) {
5906 if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
5907 elem.type = elem.type.slice( 5 );
5908 } else {
5909 elem.removeAttribute( "type" );
5910 }
5911
5912 return elem;
5913}
5914
5915function cloneCopyEvent( src, dest ) {
5916 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
5917
5918 if ( dest.nodeType !== 1 ) {
5919 return;
5920 }
5921
5922 // 1. Copy private data: events, handlers, etc.
5923 if ( dataPriv.hasData( src ) ) {
5924 pdataOld = dataPriv.access( src );
5925 pdataCur = dataPriv.set( dest, pdataOld );
5926 events = pdataOld.events;
5927
5928 if ( events ) {
5929 delete pdataCur.handle;
5930 pdataCur.events = {};
5931
5932 for ( type in events ) {
5933 for ( i = 0, l = events[ type ].length; i < l; i++ ) {
5934 jQuery.event.add( dest, type, events[ type ][ i ] );
5935 }
5936 }
5937 }
5938 }
5939
5940 // 2. Copy user data
5941 if ( dataUser.hasData( src ) ) {
5942 udataOld = dataUser.access( src );
5943 udataCur = jQuery.extend( {}, udataOld );
5944
5945 dataUser.set( dest, udataCur );
5946 }
5947}
5948
5949// Fix IE bugs, see support tests
5950function fixInput( src, dest ) {
5951 var nodeName = dest.nodeName.toLowerCase();
5952
5953 // Fails to persist the checked state of a cloned checkbox or radio button.
5954 if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
5955 dest.checked = src.checked;
5956
5957 // Fails to return the selected option to the default selected state when cloning options
5958 } else if ( nodeName === "input" || nodeName === "textarea" ) {
5959 dest.defaultValue = src.defaultValue;
5960 }
5961}
5962
5963function domManip( collection, args, callback, ignored ) {
5964
5965 // Flatten any nested arrays
5966 args = concat.apply( [], args );
5967
5968 var fragment, first, scripts, hasScripts, node, doc,
5969 i = 0,
5970 l = collection.length,
5971 iNoClone = l - 1,
5972 value = args[ 0 ],
5973 valueIsFunction = isFunction( value );
5974
5975 // We can't cloneNode fragments that contain checked, in WebKit
5976 if ( valueIsFunction ||
5977 ( l > 1 && typeof value === "string" &&
5978 !support.checkClone && rchecked.test( value ) ) ) {
5979 return collection.each( function( index ) {
5980 var self = collection.eq( index );
5981 if ( valueIsFunction ) {
5982 args[ 0 ] = value.call( this, index, self.html() );
5983 }
5984 domManip( self, args, callback, ignored );
5985 } );
5986 }
5987
5988 if ( l ) {
5989 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
5990 first = fragment.firstChild;
5991
5992 if ( fragment.childNodes.length === 1 ) {
5993 fragment = first;
5994 }
5995
5996 // Require either new content or an interest in ignored elements to invoke the callback
5997 if ( first || ignored ) {
5998 scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
5999 hasScripts = scripts.length;
6000
6001 // Use the original fragment for the last item
6002 // instead of the first because it can end up
6003 // being emptied incorrectly in certain situations (#8070).
6004 for ( ; i < l; i++ ) {
6005 node = fragment;
6006
6007 if ( i !== iNoClone ) {
6008 node = jQuery.clone( node, true, true );
6009
6010 // Keep references to cloned scripts for later restoration
6011 if ( hasScripts ) {
6012
6013 // Support: Android <=4.0 only, PhantomJS 1 only
6014 // push.apply(_, arraylike) throws on ancient WebKit
6015 jQuery.merge( scripts, getAll( node, "script" ) );
6016 }
6017 }
6018
6019 callback.call( collection[ i ], node, i );
6020 }
6021
6022 if ( hasScripts ) {
6023 doc = scripts[ scripts.length - 1 ].ownerDocument;
6024
6025 // Reenable scripts
6026 jQuery.map( scripts, restoreScript );
6027
6028 // Evaluate executable scripts on first document insertion
6029 for ( i = 0; i < hasScripts; i++ ) {
6030 node = scripts[ i ];
6031 if ( rscriptType.test( node.type || "" ) &&
6032 !dataPriv.access( node, "globalEval" ) &&
6033 jQuery.contains( doc, node ) ) {
6034
6035 if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
6036
6037 // Optional AJAX dependency, but won't run scripts if not present
6038 if ( jQuery._evalUrl && !node.noModule ) {
6039 jQuery._evalUrl( node.src, {
6040 nonce: node.nonce || node.getAttribute( "nonce" )
6041 } );
6042 }
6043 } else {
6044 DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
6045 }
6046 }
6047 }
6048 }
6049 }
6050 }
6051
6052 return collection;
6053}
6054
6055function remove( elem, selector, keepData ) {
6056 var node,
6057 nodes = selector ? jQuery.filter( selector, elem ) : elem,
6058 i = 0;
6059
6060 for ( ; ( node = nodes[ i ] ) != null; i++ ) {
6061 if ( !keepData && node.nodeType === 1 ) {
6062 jQuery.cleanData( getAll( node ) );
6063 }
6064
6065 if ( node.parentNode ) {
6066 if ( keepData && isAttached( node ) ) {
6067 setGlobalEval( getAll( node, "script" ) );
6068 }
6069 node.parentNode.removeChild( node );
6070 }
6071 }
6072
6073 return elem;
6074}
6075
6076jQuery.extend( {
6077 htmlPrefilter: function( html ) {
6078 return html.replace( rxhtmlTag, "<$1></$2>" );
6079 },
6080
6081 clone: function( elem, dataAndEvents, deepDataAndEvents ) {
6082 var i, l, srcElements, destElements,
6083 clone = elem.cloneNode( true ),
6084 inPage = isAttached( elem );
6085
6086 // Fix IE cloning issues
6087 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
6088 !jQuery.isXMLDoc( elem ) ) {
6089
6090 // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
6091 destElements = getAll( clone );
6092 srcElements = getAll( elem );
6093
6094 for ( i = 0, l = srcElements.length; i < l; i++ ) {
6095 fixInput( srcElements[ i ], destElements[ i ] );
6096 }
6097 }
6098
6099 // Copy the events from the original to the clone
6100 if ( dataAndEvents ) {
6101 if ( deepDataAndEvents ) {
6102 srcElements = srcElements || getAll( elem );
6103 destElements = destElements || getAll( clone );
6104
6105 for ( i = 0, l = srcElements.length; i < l; i++ ) {
6106 cloneCopyEvent( srcElements[ i ], destElements[ i ] );
6107 }
6108 } else {
6109 cloneCopyEvent( elem, clone );
6110 }
6111 }
6112
6113 // Preserve script evaluation history
6114 destElements = getAll( clone, "script" );
6115 if ( destElements.length > 0 ) {
6116 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
6117 }
6118
6119 // Return the cloned set
6120 return clone;
6121 },
6122
6123 cleanData: function( elems ) {
6124 var data, elem, type,
6125 special = jQuery.event.special,
6126 i = 0;
6127
6128 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
6129 if ( acceptData( elem ) ) {
6130 if ( ( data = elem[ dataPriv.expando ] ) ) {
6131 if ( data.events ) {
6132 for ( type in data.events ) {
6133 if ( special[ type ] ) {
6134 jQuery.event.remove( elem, type );
6135
6136 // This is a shortcut to avoid jQuery.event.remove's overhead
6137 } else {
6138 jQuery.removeEvent( elem, type, data.handle );
6139 }
6140 }
6141 }
6142
6143 // Support: Chrome <=35 - 45+
6144 // Assign undefined instead of using delete, see Data#remove
6145 elem[ dataPriv.expando ] = undefined;
6146 }
6147 if ( elem[ dataUser.expando ] ) {
6148
6149 // Support: Chrome <=35 - 45+
6150 // Assign undefined instead of using delete, see Data#remove
6151 elem[ dataUser.expando ] = undefined;
6152 }
6153 }
6154 }
6155 }
6156} );
6157
6158jQuery.fn.extend( {
6159 detach: function( selector ) {
6160 return remove( this, selector, true );
6161 },
6162
6163 remove: function( selector ) {
6164 return remove( this, selector );
6165 },
6166
6167 text: function( value ) {
6168 return access( this, function( value ) {
6169 return value === undefined ?
6170 jQuery.text( this ) :
6171 this.empty().each( function() {
6172 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
6173 this.textContent = value;
6174 }
6175 } );
6176 }, null, value, arguments.length );
6177 },
6178
6179 append: function() {
6180 return domManip( this, arguments, function( elem ) {
6181 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
6182 var target = manipulationTarget( this, elem );
6183 target.appendChild( elem );
6184 }
6185 } );
6186 },
6187
6188 prepend: function() {
6189 return domManip( this, arguments, function( elem ) {
6190 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
6191 var target = manipulationTarget( this, elem );
6192 target.insertBefore( elem, target.firstChild );
6193 }
6194 } );
6195 },
6196
6197 before: function() {
6198 return domManip( this, arguments, function( elem ) {
6199 if ( this.parentNode ) {
6200 this.parentNode.insertBefore( elem, this );
6201 }
6202 } );
6203 },
6204
6205 after: function() {
6206 return domManip( this, arguments, function( elem ) {
6207 if ( this.parentNode ) {
6208 this.parentNode.insertBefore( elem, this.nextSibling );
6209 }
6210 } );
6211 },
6212
6213 empty: function() {
6214 var elem,
6215 i = 0;
6216
6217 for ( ; ( elem = this[ i ] ) != null; i++ ) {
6218 if ( elem.nodeType === 1 ) {
6219
6220 // Prevent memory leaks
6221 jQuery.cleanData( getAll( elem, false ) );
6222
6223 // Remove any remaining nodes
6224 elem.textContent = "";
6225 }
6226 }
6227
6228 return this;
6229 },
6230
6231 clone: function( dataAndEvents, deepDataAndEvents ) {
6232 dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
6233 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
6234
6235 return this.map( function() {
6236 return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
6237 } );
6238 },
6239
6240 html: function( value ) {
6241 return access( this, function( value ) {
6242 var elem = this[ 0 ] || {},
6243 i = 0,
6244 l = this.length;
6245
6246 if ( value === undefined && elem.nodeType === 1 ) {
6247 return elem.innerHTML;
6248 }
6249
6250 // See if we can take a shortcut and just use innerHTML
6251 if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
6252 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
6253
6254 value = jQuery.htmlPrefilter( value );
6255
6256 try {
6257 for ( ; i < l; i++ ) {
6258 elem = this[ i ] || {};
6259
6260 // Remove element nodes and prevent memory leaks
6261 if ( elem.nodeType === 1 ) {
6262 jQuery.cleanData( getAll( elem, false ) );
6263 elem.innerHTML = value;
6264 }
6265 }
6266
6267 elem = 0;
6268
6269 // If using innerHTML throws an exception, use the fallback method
6270 } catch ( e ) {}
6271 }
6272
6273 if ( elem ) {
6274 this.empty().append( value );
6275 }
6276 }, null, value, arguments.length );
6277 },
6278
6279 replaceWith: function() {
6280 var ignored = [];
6281
6282 // Make the changes, replacing each non-ignored context element with the new content
6283 return domManip( this, arguments, function( elem ) {
6284 var parent = this.parentNode;
6285
6286 if ( jQuery.inArray( this, ignored ) < 0 ) {
6287 jQuery.cleanData( getAll( this ) );
6288 if ( parent ) {
6289 parent.replaceChild( elem, this );
6290 }
6291 }
6292
6293 // Force callback invocation
6294 }, ignored );
6295 }
6296} );
6297
6298jQuery.each( {
6299 appendTo: "append",
6300 prependTo: "prepend",
6301 insertBefore: "before",
6302 insertAfter: "after",
6303 replaceAll: "replaceWith"
6304}, function( name, original ) {
6305 jQuery.fn[ name ] = function( selector ) {
6306 var elems,
6307 ret = [],
6308 insert = jQuery( selector ),
6309 last = insert.length - 1,
6310 i = 0;
6311
6312 for ( ; i <= last; i++ ) {
6313 elems = i === last ? this : this.clone( true );
6314 jQuery( insert[ i ] )[ original ]( elems );
6315
6316 // Support: Android <=4.0 only, PhantomJS 1 only
6317 // .get() because push.apply(_, arraylike) throws on ancient WebKit
6318 push.apply( ret, elems.get() );
6319 }
6320
6321 return this.pushStack( ret );
6322 };
6323} );
6324var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
6325
6326var getStyles = function( elem ) {
6327
6328 // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
6329 // IE throws on elements created in popups
6330 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
6331 var view = elem.ownerDocument.defaultView;
6332
6333 if ( !view || !view.opener ) {
6334 view = window;
6335 }
6336
6337 return view.getComputedStyle( elem );
6338 };
6339
6340var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
6341
6342
6343
6344( function() {
6345
6346 // Executing both pixelPosition & boxSizingReliable tests require only one layout
6347 // so they're executed at the same time to save the second computation.
6348 function computeStyleTests() {
6349
6350 // This is a singleton, we need to execute it only once
6351 if ( !div ) {
6352 return;
6353 }
6354
6355 container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
6356 "margin-top:1px;padding:0;border:0";
6357 div.style.cssText =
6358 "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
6359 "margin:auto;border:1px;padding:1px;" +
6360 "width:60%;top:1%";
6361 documentElement.appendChild( container ).appendChild( div );
6362
6363 var divStyle = window.getComputedStyle( div );
6364 pixelPositionVal = divStyle.top !== "1%";
6365
6366 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
6367 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
6368
6369 // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
6370 // Some styles come back with percentage values, even though they shouldn't
6371 div.style.right = "60%";
6372 pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
6373
6374 // Support: IE 9 - 11 only
6375 // Detect misreporting of content dimensions for box-sizing:border-box elements
6376 boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
6377
6378 // Support: IE 9 only
6379 // Detect overflow:scroll screwiness (gh-3699)
6380 // Support: Chrome <=64
6381 // Don't get tricked when zoom affects offsetWidth (gh-4029)
6382 div.style.position = "absolute";
6383 scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
6384
6385 documentElement.removeChild( container );
6386
6387 // Nullify the div so it wouldn't be stored in the memory and
6388 // it will also be a sign that checks already performed
6389 div = null;
6390 }
6391
6392 function roundPixelMeasures( measure ) {
6393 return Math.round( parseFloat( measure ) );
6394 }
6395
6396 var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
6397 reliableMarginLeftVal,
6398 container = document.createElement( "div" ),
6399 div = document.createElement( "div" );
6400
6401 // Finish early in limited (non-browser) environments
6402 if ( !div.style ) {
6403 return;
6404 }
6405
6406 // Support: IE <=9 - 11 only
6407 // Style of cloned element affects source element cloned (#8908)
6408 div.style.backgroundClip = "content-box";
6409 div.cloneNode( true ).style.backgroundClip = "";
6410 support.clearCloneStyle = div.style.backgroundClip === "content-box";
6411
6412 jQuery.extend( support, {
6413 boxSizingReliable: function() {
6414 computeStyleTests();
6415 return boxSizingReliableVal;
6416 },
6417 pixelBoxStyles: function() {
6418 computeStyleTests();
6419 return pixelBoxStylesVal;
6420 },
6421 pixelPosition: function() {
6422 computeStyleTests();
6423 return pixelPositionVal;
6424 },
6425 reliableMarginLeft: function() {
6426 computeStyleTests();
6427 return reliableMarginLeftVal;
6428 },
6429 scrollboxSize: function() {
6430 computeStyleTests();
6431 return scrollboxSizeVal;
6432 }
6433 } );
6434} )();
6435
6436
6437function curCSS( elem, name, computed ) {
6438 var width, minWidth, maxWidth, ret,
6439
6440 // Support: Firefox 51+
6441 // Retrieving style before computed somehow
6442 // fixes an issue with getting wrong values
6443 // on detached elements
6444 style = elem.style;
6445
6446 computed = computed || getStyles( elem );
6447
6448 // getPropertyValue is needed for:
6449 // .css('filter') (IE 9 only, #12537)
6450 // .css('--customProperty) (#3144)
6451 if ( computed ) {
6452 ret = computed.getPropertyValue( name ) || computed[ name ];
6453
6454 if ( ret === "" && !isAttached( elem ) ) {
6455 ret = jQuery.style( elem, name );
6456 }
6457
6458 // A tribute to the "awesome hack by Dean Edwards"
6459 // Android Browser returns percentage for some values,
6460 // but width seems to be reliably pixels.
6461 // This is against the CSSOM draft spec:
6462 // https://drafts.csswg.org/cssom/#resolved-values
6463 if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
6464
6465 // Remember the original values
6466 width = style.width;
6467 minWidth = style.minWidth;
6468 maxWidth = style.maxWidth;
6469
6470 // Put in the new values to get a computed value out
6471 style.minWidth = style.maxWidth = style.width = ret;
6472 ret = computed.width;
6473
6474 // Revert the changed values
6475 style.width = width;
6476 style.minWidth = minWidth;
6477 style.maxWidth = maxWidth;
6478 }
6479 }
6480
6481 return ret !== undefined ?
6482
6483 // Support: IE <=9 - 11 only
6484 // IE returns zIndex value as an integer.
6485 ret + "" :
6486 ret;
6487}
6488
6489
6490function addGetHookIf( conditionFn, hookFn ) {
6491
6492 // Define the hook, we'll check on the first run if it's really needed.
6493 return {
6494 get: function() {
6495 if ( conditionFn() ) {
6496
6497 // Hook not needed (or it's not possible to use it due
6498 // to missing dependency), remove it.
6499 delete this.get;
6500 return;
6501 }
6502
6503 // Hook needed; redefine it so that the support test is not executed again.
6504 return ( this.get = hookFn ).apply( this, arguments );
6505 }
6506 };
6507}
6508
6509
6510var cssPrefixes = [ "Webkit", "Moz", "ms" ],
6511 emptyStyle = document.createElement( "div" ).style,
6512 vendorProps = {};
6513
6514// Return a vendor-prefixed property or undefined
6515function vendorPropName( name ) {
6516
6517 // Check for vendor prefixed names
6518 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
6519 i = cssPrefixes.length;
6520
6521 while ( i-- ) {
6522 name = cssPrefixes[ i ] + capName;
6523 if ( name in emptyStyle ) {
6524 return name;
6525 }
6526 }
6527}
6528
6529// Return a potentially-mapped jQuery.cssProps or vendor prefixed property
6530function finalPropName( name ) {
6531 var final = jQuery.cssProps[ name ] || vendorProps[ name ];
6532
6533 if ( final ) {
6534 return final;
6535 }
6536 if ( name in emptyStyle ) {
6537 return name;
6538 }
6539 return vendorProps[ name ] = vendorPropName( name ) || name;
6540}
6541
6542
6543var
6544
6545 // Swappable if display is none or starts with table
6546 // except "table", "table-cell", or "table-caption"
6547 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
6548 rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6549 rcustomProp = /^--/,
6550 cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6551 cssNormalTransform = {
6552 letterSpacing: "0",
6553 fontWeight: "400"
6554 };
6555
6556function setPositiveNumber( elem, value, subtract ) {
6557
6558 // Any relative (+/-) values have already been
6559 // normalized at this point
6560 var matches = rcssNum.exec( value );
6561 return matches ?
6562
6563 // Guard against undefined "subtract", e.g., when used as in cssHooks
6564 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
6565 value;
6566}
6567
6568function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
6569 var i = dimension === "width" ? 1 : 0,
6570 extra = 0,
6571 delta = 0;
6572
6573 // Adjustment may not be necessary
6574 if ( box === ( isBorderBox ? "border" : "content" ) ) {
6575 return 0;
6576 }
6577
6578 for ( ; i < 4; i += 2 ) {
6579
6580 // Both box models exclude margin
6581 if ( box === "margin" ) {
6582 delta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
6583 }
6584
6585 // If we get here with a content-box, we're seeking "padding" or "border" or "margin"
6586 if ( !isBorderBox ) {
6587
6588 // Add padding
6589 delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6590
6591 // For "border" or "margin", add border
6592 if ( box !== "padding" ) {
6593 delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6594
6595 // But still keep track of it otherwise
6596 } else {
6597 extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6598 }
6599
6600 // If we get here with a border-box (content + padding + border), we're seeking "content" or
6601 // "padding" or "margin"
6602 } else {
6603
6604 // For "content", subtract padding
6605 if ( box === "content" ) {
6606 delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6607 }
6608
6609 // For "content" or "padding", subtract border
6610 if ( box !== "margin" ) {
6611 delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6612 }
6613 }
6614 }
6615
6616 // Account for positive content-box scroll gutter when requested by providing computedVal
6617 if ( !isBorderBox && computedVal >= 0 ) {
6618
6619 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
6620 // Assuming integer scroll gutter, subtract the rest and round down
6621 delta += Math.max( 0, Math.ceil(
6622 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
6623 computedVal -
6624 delta -
6625 extra -
6626 0.5
6627
6628 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
6629 // Use an explicit zero to avoid NaN (gh-3964)
6630 ) ) || 0;
6631 }
6632
6633 return delta;
6634}
6635
6636function getWidthOrHeight( elem, dimension, extra ) {
6637
6638 // Start with computed style
6639 var styles = getStyles( elem ),
6640
6641 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
6642 // Fake content-box until we know it's needed to know the true value.
6643 boxSizingNeeded = !support.boxSizingReliable() || extra,
6644 isBorderBox = boxSizingNeeded &&
6645 jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
6646 valueIsBorderBox = isBorderBox,
6647
6648 val = curCSS( elem, dimension, styles ),
6649 offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
6650
6651 // Support: Firefox <=54
6652 // Return a confounding non-pixel value or feign ignorance, as appropriate.
6653 if ( rnumnonpx.test( val ) ) {
6654 if ( !extra ) {
6655 return val;
6656 }
6657 val = "auto";
6658 }
6659
6660
6661 // Fall back to offsetWidth/offsetHeight when value is "auto"
6662 // This happens for inline elements with no explicit setting (gh-3571)
6663 // Support: Android <=4.1 - 4.3 only
6664 // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
6665 // Support: IE 9-11 only
6666 // Also use offsetWidth/offsetHeight for when box sizing is unreliable
6667 // We use getClientRects() to check for hidden/disconnected.
6668 // In those cases, the computed value can be trusted to be border-box
6669 if ( ( !support.boxSizingReliable() && isBorderBox ||
6670 val === "auto" ||
6671 !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
6672 elem.getClientRects().length ) {
6673
6674 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
6675
6676 // Where available, offsetWidth/offsetHeight approximate border box dimensions.
6677 // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
6678 // retrieved value as a content box dimension.
6679 valueIsBorderBox = offsetProp in elem;
6680 if ( valueIsBorderBox ) {
6681 val = elem[ offsetProp ];
6682 }
6683 }
6684
6685 // Normalize "" and auto
6686 val = parseFloat( val ) || 0;
6687
6688 // Adjust for the element's box model
6689 return ( val +
6690 boxModelAdjustment(
6691 elem,
6692 dimension,
6693 extra || ( isBorderBox ? "border" : "content" ),
6694 valueIsBorderBox,
6695 styles,
6696
6697 // Provide the current computed size to request scroll gutter calculation (gh-3589)
6698 val
6699 )
6700 ) + "px";
6701}
6702
6703jQuery.extend( {
6704
6705 // Add in style property hooks for overriding the default
6706 // behavior of getting and setting a style property
6707 cssHooks: {
6708 opacity: {
6709 get: function( elem, computed ) {
6710 if ( computed ) {
6711
6712 // We should always get a number back from opacity
6713 var ret = curCSS( elem, "opacity" );
6714 return ret === "" ? "1" : ret;
6715 }
6716 }
6717 }
6718 },
6719
6720 // Don't automatically add "px" to these possibly-unitless properties
6721 cssNumber: {
6722 "animationIterationCount": true,
6723 "columnCount": true,
6724 "fillOpacity": true,
6725 "flexGrow": true,
6726 "flexShrink": true,
6727 "fontWeight": true,
6728 "gridArea": true,
6729 "gridColumn": true,
6730 "gridColumnEnd": true,
6731 "gridColumnStart": true,
6732 "gridRow": true,
6733 "gridRowEnd": true,
6734 "gridRowStart": true,
6735 "lineHeight": true,
6736 "opacity": true,
6737 "order": true,
6738 "orphans": true,
6739 "widows": true,
6740 "zIndex": true,
6741 "zoom": true
6742 },
6743
6744 // Add in properties whose names you wish to fix before
6745 // setting or getting the value
6746 cssProps: {},
6747
6748 // Get and set the style property on a DOM Node
6749 style: function( elem, name, value, extra ) {
6750
6751 // Don't set styles on text and comment nodes
6752 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
6753 return;
6754 }
6755
6756 // Make sure that we're working with the right name
6757 var ret, type, hooks,
6758 origName = camelCase( name ),
6759 isCustomProp = rcustomProp.test( name ),
6760 style = elem.style;
6761
6762 // Make sure that we're working with the right name. We don't
6763 // want to query the value if it is a CSS custom property
6764 // since they are user-defined.
6765 if ( !isCustomProp ) {
6766 name = finalPropName( origName );
6767 }
6768
6769 // Gets hook for the prefixed version, then unprefixed version
6770 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6771
6772 // Check if we're setting a value
6773 if ( value !== undefined ) {
6774 type = typeof value;
6775
6776 // Convert "+=" or "-=" to relative numbers (#7345)
6777 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
6778 value = adjustCSS( elem, name, ret );
6779
6780 // Fixes bug #9237
6781 type = "number";
6782 }
6783
6784 // Make sure that null and NaN values aren't set (#7116)
6785 if ( value == null || value !== value ) {
6786 return;
6787 }
6788
6789 // If a number was passed in, add the unit (except for certain CSS properties)
6790 // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
6791 // "px" to a few hardcoded values.
6792 if ( type === "number" && !isCustomProp ) {
6793 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
6794 }
6795
6796 // background-* props affect original clone's values
6797 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
6798 style[ name ] = "inherit";
6799 }
6800
6801 // If a hook was provided, use that value, otherwise just set the specified value
6802 if ( !hooks || !( "set" in hooks ) ||
6803 ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
6804
6805 if ( isCustomProp ) {
6806 style.setProperty( name, value );
6807 } else {
6808 style[ name ] = value;
6809 }
6810 }
6811
6812 } else {
6813
6814 // If a hook was provided get the non-computed value from there
6815 if ( hooks && "get" in hooks &&
6816 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
6817
6818 return ret;
6819 }
6820
6821 // Otherwise just get the value from the style object
6822 return style[ name ];
6823 }
6824 },
6825
6826 css: function( elem, name, extra, styles ) {
6827 var val, num, hooks,
6828 origName = camelCase( name ),
6829 isCustomProp = rcustomProp.test( name );
6830
6831 // Make sure that we're working with the right name. We don't
6832 // want to modify the value if it is a CSS custom property
6833 // since they are user-defined.
6834 if ( !isCustomProp ) {
6835 name = finalPropName( origName );
6836 }
6837
6838 // Try prefixed name followed by the unprefixed name
6839 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6840
6841 // If a hook was provided get the computed value from there
6842 if ( hooks && "get" in hooks ) {
6843 val = hooks.get( elem, true, extra );
6844 }
6845
6846 // Otherwise, if a way to get the computed value exists, use that
6847 if ( val === undefined ) {
6848 val = curCSS( elem, name, styles );
6849 }
6850
6851 // Convert "normal" to computed value
6852 if ( val === "normal" && name in cssNormalTransform ) {
6853 val = cssNormalTransform[ name ];
6854 }
6855
6856 // Make numeric if forced or a qualifier was provided and val looks numeric
6857 if ( extra === "" || extra ) {
6858 num = parseFloat( val );
6859 return extra === true || isFinite( num ) ? num || 0 : val;
6860 }
6861
6862 return val;
6863 }
6864} );
6865
6866jQuery.each( [ "height", "width" ], function( i, dimension ) {
6867 jQuery.cssHooks[ dimension ] = {
6868 get: function( elem, computed, extra ) {
6869 if ( computed ) {
6870
6871 // Certain elements can have dimension info if we invisibly show them
6872 // but it must have a current display style that would benefit
6873 return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
6874
6875 // Support: Safari 8+
6876 // Table columns in Safari have non-zero offsetWidth & zero
6877 // getBoundingClientRect().width unless display is changed.
6878 // Support: IE <=11 only
6879 // Running getBoundingClientRect on a disconnected node
6880 // in IE throws an error.
6881 ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
6882 swap( elem, cssShow, function() {
6883 return getWidthOrHeight( elem, dimension, extra );
6884 } ) :
6885 getWidthOrHeight( elem, dimension, extra );
6886 }
6887 },
6888
6889 set: function( elem, value, extra ) {
6890 var matches,
6891 styles = getStyles( elem ),
6892
6893 // Only read styles.position if the test has a chance to fail
6894 // to avoid forcing a reflow.
6895 scrollboxSizeBuggy = !support.scrollboxSize() &&
6896 styles.position === "absolute",
6897
6898 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
6899 boxSizingNeeded = scrollboxSizeBuggy || extra,
6900 isBorderBox = boxSizingNeeded &&
6901 jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
6902 subtract = extra ?
6903 boxModelAdjustment(
6904 elem,
6905 dimension,
6906 extra,
6907 isBorderBox,
6908 styles
6909 ) :
6910 0;
6911
6912 // Account for unreliable border-box dimensions by comparing offset* to computed and
6913 // faking a content-box to get border and padding (gh-3699)
6914 if ( isBorderBox && scrollboxSizeBuggy ) {
6915 subtract -= Math.ceil(
6916 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
6917 parseFloat( styles[ dimension ] ) -
6918 boxModelAdjustment( elem, dimension, "border", false, styles ) -
6919 0.5
6920 );
6921 }
6922
6923 // Convert to pixels if value adjustment is needed
6924 if ( subtract && ( matches = rcssNum.exec( value ) ) &&
6925 ( matches[ 3 ] || "px" ) !== "px" ) {
6926
6927 elem.style[ dimension ] = value;
6928 value = jQuery.css( elem, dimension );
6929 }
6930
6931 return setPositiveNumber( elem, value, subtract );
6932 }
6933 };
6934} );
6935
6936jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
6937 function( elem, computed ) {
6938 if ( computed ) {
6939 return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
6940 elem.getBoundingClientRect().left -
6941 swap( elem, { marginLeft: 0 }, function() {
6942 return elem.getBoundingClientRect().left;
6943 } )
6944 ) + "px";
6945 }
6946 }
6947);
6948
6949// These hooks are used by animate to expand properties
6950jQuery.each( {
6951 margin: "",
6952 padding: "",
6953 border: "Width"
6954}, function( prefix, suffix ) {
6955 jQuery.cssHooks[ prefix + suffix ] = {
6956 expand: function( value ) {
6957 var i = 0,
6958 expanded = {},
6959
6960 // Assumes a single number if not a string
6961 parts = typeof value === "string" ? value.split( " " ) : [ value ];
6962
6963 for ( ; i < 4; i++ ) {
6964 expanded[ prefix + cssExpand[ i ] + suffix ] =
6965 parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
6966 }
6967
6968 return expanded;
6969 }
6970 };
6971
6972 if ( prefix !== "margin" ) {
6973 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
6974 }
6975} );
6976
6977jQuery.fn.extend( {
6978 css: function( name, value ) {
6979 return access( this, function( elem, name, value ) {
6980 var styles, len,
6981 map = {},
6982 i = 0;
6983
6984 if ( Array.isArray( name ) ) {
6985 styles = getStyles( elem );
6986 len = name.length;
6987
6988 for ( ; i < len; i++ ) {
6989 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
6990 }
6991
6992 return map;
6993 }
6994
6995 return value !== undefined ?
6996 jQuery.style( elem, name, value ) :
6997 jQuery.css( elem, name );
6998 }, name, value, arguments.length > 1 );
6999 }
7000} );
7001
7002
7003function Tween( elem, options, prop, end, easing ) {
7004 return new Tween.prototype.init( elem, options, prop, end, easing );
7005}
7006jQuery.Tween = Tween;
7007
7008Tween.prototype = {
7009 constructor: Tween,
7010 init: function( elem, options, prop, end, easing, unit ) {
7011 this.elem = elem;
7012 this.prop = prop;
7013 this.easing = easing || jQuery.easing._default;
7014 this.options = options;
7015 this.start = this.now = this.cur();
7016 this.end = end;
7017 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
7018 },
7019 cur: function() {
7020 var hooks = Tween.propHooks[ this.prop ];
7021
7022 return hooks && hooks.get ?
7023 hooks.get( this ) :
7024 Tween.propHooks._default.get( this );
7025 },
7026 run: function( percent ) {
7027 var eased,
7028 hooks = Tween.propHooks[ this.prop ];
7029
7030 if ( this.options.duration ) {
7031 this.pos = eased = jQuery.easing[ this.easing ](
7032 percent, this.options.duration * percent, 0, 1, this.options.duration
7033 );
7034 } else {
7035 this.pos = eased = percent;
7036 }
7037 this.now = ( this.end - this.start ) * eased + this.start;
7038
7039 if ( this.options.step ) {
7040 this.options.step.call( this.elem, this.now, this );
7041 }
7042
7043 if ( hooks && hooks.set ) {
7044 hooks.set( this );
7045 } else {
7046 Tween.propHooks._default.set( this );
7047 }
7048 return this;
7049 }
7050};
7051
7052Tween.prototype.init.prototype = Tween.prototype;
7053
7054Tween.propHooks = {
7055 _default: {
7056 get: function( tween ) {
7057 var result;
7058
7059 // Use a property on the element directly when it is not a DOM element,
7060 // or when there is no matching style property that exists.
7061 if ( tween.elem.nodeType !== 1 ||
7062 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
7063 return tween.elem[ tween.prop ];
7064 }
7065
7066 // Passing an empty string as a 3rd parameter to .css will automatically
7067 // attempt a parseFloat and fallback to a string if the parse fails.
7068 // Simple values such as "10px" are parsed to Float;
7069 // complex values such as "rotate(1rad)" are returned as-is.
7070 result = jQuery.css( tween.elem, tween.prop, "" );
7071
7072 // Empty strings, null, undefined and "auto" are converted to 0.
7073 return !result || result === "auto" ? 0 : result;
7074 },
7075 set: function( tween ) {
7076
7077 // Use step hook for back compat.
7078 // Use cssHook if its there.
7079 // Use .style if available and use plain properties where available.
7080 if ( jQuery.fx.step[ tween.prop ] ) {
7081 jQuery.fx.step[ tween.prop ]( tween );
7082 } else if ( tween.elem.nodeType === 1 && (
7083 jQuery.cssHooks[ tween.prop ] ||
7084 tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
7085 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
7086 } else {
7087 tween.elem[ tween.prop ] = tween.now;
7088 }
7089 }
7090 }
7091};
7092
7093// Support: IE <=9 only
7094// Panic based approach to setting things on disconnected nodes
7095Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
7096 set: function( tween ) {
7097 if ( tween.elem.nodeType && tween.elem.parentNode ) {
7098 tween.elem[ tween.prop ] = tween.now;
7099 }
7100 }
7101};
7102
7103jQuery.easing = {
7104 linear: function( p ) {
7105 return p;
7106 },
7107 swing: function( p ) {
7108 return 0.5 - Math.cos( p * Math.PI ) / 2;
7109 },
7110 _default: "swing"
7111};
7112
7113jQuery.fx = Tween.prototype.init;
7114
7115// Back compat <1.8 extension point
7116jQuery.fx.step = {};
7117
7118
7119
7120
7121var
7122 fxNow, inProgress,
7123 rfxtypes = /^(?:toggle|show|hide)$/,
7124 rrun = /queueHooks$/;
7125
7126function schedule() {
7127 if ( inProgress ) {
7128 if ( document.hidden === false && window.requestAnimationFrame ) {
7129 window.requestAnimationFrame( schedule );
7130 } else {
7131 window.setTimeout( schedule, jQuery.fx.interval );
7132 }
7133
7134 jQuery.fx.tick();
7135 }
7136}
7137
7138// Animations created synchronously will run synchronously
7139function createFxNow() {
7140 window.setTimeout( function() {
7141 fxNow = undefined;
7142 } );
7143 return ( fxNow = Date.now() );
7144}
7145
7146// Generate parameters to create a standard animation
7147function genFx( type, includeWidth ) {
7148 var which,
7149 i = 0,
7150 attrs = { height: type };
7151
7152 // If we include width, step value is 1 to do all cssExpand values,
7153 // otherwise step value is 2 to skip over Left and Right
7154 includeWidth = includeWidth ? 1 : 0;
7155 for ( ; i < 4; i += 2 - includeWidth ) {
7156 which = cssExpand[ i ];
7157 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
7158 }
7159
7160 if ( includeWidth ) {
7161 attrs.opacity = attrs.width = type;
7162 }
7163
7164 return attrs;
7165}
7166
7167function createTween( value, prop, animation ) {
7168 var tween,
7169 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
7170 index = 0,
7171 length = collection.length;
7172 for ( ; index < length; index++ ) {
7173 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
7174
7175 // We're done with this property
7176 return tween;
7177 }
7178 }
7179}
7180
7181function defaultPrefilter( elem, props, opts ) {
7182 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
7183 isBox = "width" in props || "height" in props,
7184 anim = this,
7185 orig = {},
7186 style = elem.style,
7187 hidden = elem.nodeType && isHiddenWithinTree( elem ),
7188 dataShow = dataPriv.get( elem, "fxshow" );
7189
7190 // Queue-skipping animations hijack the fx hooks
7191 if ( !opts.queue ) {
7192 hooks = jQuery._queueHooks( elem, "fx" );
7193 if ( hooks.unqueued == null ) {
7194 hooks.unqueued = 0;
7195 oldfire = hooks.empty.fire;
7196 hooks.empty.fire = function() {
7197 if ( !hooks.unqueued ) {
7198 oldfire();
7199 }
7200 };
7201 }
7202 hooks.unqueued++;
7203
7204 anim.always( function() {
7205
7206 // Ensure the complete handler is called before this completes
7207 anim.always( function() {
7208 hooks.unqueued--;
7209 if ( !jQuery.queue( elem, "fx" ).length ) {
7210 hooks.empty.fire();
7211 }
7212 } );
7213 } );
7214 }
7215
7216 // Detect show/hide animations
7217 for ( prop in props ) {
7218 value = props[ prop ];
7219 if ( rfxtypes.test( value ) ) {
7220 delete props[ prop ];
7221 toggle = toggle || value === "toggle";
7222 if ( value === ( hidden ? "hide" : "show" ) ) {
7223
7224 // Pretend to be hidden if this is a "show" and
7225 // there is still data from a stopped show/hide
7226 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
7227 hidden = true;
7228
7229 // Ignore all other no-op show/hide data
7230 } else {
7231 continue;
7232 }
7233 }
7234 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
7235 }
7236 }
7237
7238 // Bail out if this is a no-op like .hide().hide()
7239 propTween = !jQuery.isEmptyObject( props );
7240 if ( !propTween && jQuery.isEmptyObject( orig ) ) {
7241 return;
7242 }
7243
7244 // Restrict "overflow" and "display" styles during box animations
7245 if ( isBox && elem.nodeType === 1 ) {
7246
7247 // Support: IE <=9 - 11, Edge 12 - 15
7248 // Record all 3 overflow attributes because IE does not infer the shorthand
7249 // from identically-valued overflowX and overflowY and Edge just mirrors
7250 // the overflowX value there.
7251 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
7252
7253 // Identify a display type, preferring old show/hide data over the CSS cascade
7254 restoreDisplay = dataShow && dataShow.display;
7255 if ( restoreDisplay == null ) {
7256 restoreDisplay = dataPriv.get( elem, "display" );
7257 }
7258 display = jQuery.css( elem, "display" );
7259 if ( display === "none" ) {
7260 if ( restoreDisplay ) {
7261 display = restoreDisplay;
7262 } else {
7263
7264 // Get nonempty value(s) by temporarily forcing visibility
7265 showHide( [ elem ], true );
7266 restoreDisplay = elem.style.display || restoreDisplay;
7267 display = jQuery.css( elem, "display" );
7268 showHide( [ elem ] );
7269 }
7270 }
7271
7272 // Animate inline elements as inline-block
7273 if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
7274 if ( jQuery.css( elem, "float" ) === "none" ) {
7275
7276 // Restore the original display value at the end of pure show/hide animations
7277 if ( !propTween ) {
7278 anim.done( function() {
7279 style.display = restoreDisplay;
7280 } );
7281 if ( restoreDisplay == null ) {
7282 display = style.display;
7283 restoreDisplay = display === "none" ? "" : display;
7284 }
7285 }
7286 style.display = "inline-block";
7287 }
7288 }
7289 }
7290
7291 if ( opts.overflow ) {
7292 style.overflow = "hidden";
7293 anim.always( function() {
7294 style.overflow = opts.overflow[ 0 ];
7295 style.overflowX = opts.overflow[ 1 ];
7296 style.overflowY = opts.overflow[ 2 ];
7297 } );
7298 }
7299
7300 // Implement show/hide animations
7301 propTween = false;
7302 for ( prop in orig ) {
7303
7304 // General show/hide setup for this element animation
7305 if ( !propTween ) {
7306 if ( dataShow ) {
7307 if ( "hidden" in dataShow ) {
7308 hidden = dataShow.hidden;
7309 }
7310 } else {
7311 dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
7312 }
7313
7314 // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
7315 if ( toggle ) {
7316 dataShow.hidden = !hidden;
7317 }
7318
7319 // Show elements before animating them
7320 if ( hidden ) {
7321 showHide( [ elem ], true );
7322 }
7323
7324 /* eslint-disable no-loop-func */
7325
7326 anim.done( function() {
7327
7328 /* eslint-enable no-loop-func */
7329
7330 // The final step of a "hide" animation is actually hiding the element
7331 if ( !hidden ) {
7332 showHide( [ elem ] );
7333 }
7334 dataPriv.remove( elem, "fxshow" );
7335 for ( prop in orig ) {
7336 jQuery.style( elem, prop, orig[ prop ] );
7337 }
7338 } );
7339 }
7340
7341 // Per-property setup
7342 propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
7343 if ( !( prop in dataShow ) ) {
7344 dataShow[ prop ] = propTween.start;
7345 if ( hidden ) {
7346 propTween.end = propTween.start;
7347 propTween.start = 0;
7348 }
7349 }
7350 }
7351}
7352
7353function propFilter( props, specialEasing ) {
7354 var index, name, easing, value, hooks;
7355
7356 // camelCase, specialEasing and expand cssHook pass
7357 for ( index in props ) {
7358 name = camelCase( index );
7359 easing = specialEasing[ name ];
7360 value = props[ index ];
7361 if ( Array.isArray( value ) ) {
7362 easing = value[ 1 ];
7363 value = props[ index ] = value[ 0 ];
7364 }
7365
7366 if ( index !== name ) {
7367 props[ name ] = value;
7368 delete props[ index ];
7369 }
7370
7371 hooks = jQuery.cssHooks[ name ];
7372 if ( hooks && "expand" in hooks ) {
7373 value = hooks.expand( value );
7374 delete props[ name ];
7375
7376 // Not quite $.extend, this won't overwrite existing keys.
7377 // Reusing 'index' because we have the correct "name"
7378 for ( index in value ) {
7379 if ( !( index in props ) ) {
7380 props[ index ] = value[ index ];
7381 specialEasing[ index ] = easing;
7382 }
7383 }
7384 } else {
7385 specialEasing[ name ] = easing;
7386 }
7387 }
7388}
7389
7390function Animation( elem, properties, options ) {
7391 var result,
7392 stopped,
7393 index = 0,
7394 length = Animation.prefilters.length,
7395 deferred = jQuery.Deferred().always( function() {
7396
7397 // Don't match elem in the :animated selector
7398 delete tick.elem;
7399 } ),
7400 tick = function() {
7401 if ( stopped ) {
7402 return false;
7403 }
7404 var currentTime = fxNow || createFxNow(),
7405 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
7406
7407 // Support: Android 2.3 only
7408 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
7409 temp = remaining / animation.duration || 0,
7410 percent = 1 - temp,
7411 index = 0,
7412 length = animation.tweens.length;
7413
7414 for ( ; index < length; index++ ) {
7415 animation.tweens[ index ].run( percent );
7416 }
7417
7418 deferred.notifyWith( elem, [ animation, percent, remaining ] );
7419
7420 // If there's more to do, yield
7421 if ( percent < 1 && length ) {
7422 return remaining;
7423 }
7424
7425 // If this was an empty animation, synthesize a final progress notification
7426 if ( !length ) {
7427 deferred.notifyWith( elem, [ animation, 1, 0 ] );
7428 }
7429
7430 // Resolve the animation and report its conclusion
7431 deferred.resolveWith( elem, [ animation ] );
7432 return false;
7433 },
7434 animation = deferred.promise( {
7435 elem: elem,
7436 props: jQuery.extend( {}, properties ),
7437 opts: jQuery.extend( true, {
7438 specialEasing: {},
7439 easing: jQuery.easing._default
7440 }, options ),
7441 originalProperties: properties,
7442 originalOptions: options,
7443 startTime: fxNow || createFxNow(),
7444 duration: options.duration,
7445 tweens: [],
7446 createTween: function( prop, end ) {
7447 var tween = jQuery.Tween( elem, animation.opts, prop, end,
7448 animation.opts.specialEasing[ prop ] || animation.opts.easing );
7449 animation.tweens.push( tween );
7450 return tween;
7451 },
7452 stop: function( gotoEnd ) {
7453 var index = 0,
7454
7455 // If we are going to the end, we want to run all the tweens
7456 // otherwise we skip this part
7457 length = gotoEnd ? animation.tweens.length : 0;
7458 if ( stopped ) {
7459 return this;
7460 }
7461 stopped = true;
7462 for ( ; index < length; index++ ) {
7463 animation.tweens[ index ].run( 1 );
7464 }
7465
7466 // Resolve when we played the last frame; otherwise, reject
7467 if ( gotoEnd ) {
7468 deferred.notifyWith( elem, [ animation, 1, 0 ] );
7469 deferred.resolveWith( elem, [ animation, gotoEnd ] );
7470 } else {
7471 deferred.rejectWith( elem, [ animation, gotoEnd ] );
7472 }
7473 return this;
7474 }
7475 } ),
7476 props = animation.props;
7477
7478 propFilter( props, animation.opts.specialEasing );
7479
7480 for ( ; index < length; index++ ) {
7481 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
7482 if ( result ) {
7483 if ( isFunction( result.stop ) ) {
7484 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
7485 result.stop.bind( result );
7486 }
7487 return result;
7488 }
7489 }
7490
7491 jQuery.map( props, createTween, animation );
7492
7493 if ( isFunction( animation.opts.start ) ) {
7494 animation.opts.start.call( elem, animation );
7495 }
7496
7497 // Attach callbacks from options
7498 animation
7499 .progress( animation.opts.progress )
7500 .done( animation.opts.done, animation.opts.complete )
7501 .fail( animation.opts.fail )
7502 .always( animation.opts.always );
7503
7504 jQuery.fx.timer(
7505 jQuery.extend( tick, {
7506 elem: elem,
7507 anim: animation,
7508 queue: animation.opts.queue
7509 } )
7510 );
7511
7512 return animation;
7513}
7514
7515jQuery.Animation = jQuery.extend( Animation, {
7516
7517 tweeners: {
7518 "*": [ function( prop, value ) {
7519 var tween = this.createTween( prop, value );
7520 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
7521 return tween;
7522 } ]
7523 },
7524
7525 tweener: function( props, callback ) {
7526 if ( isFunction( props ) ) {
7527 callback = props;
7528 props = [ "*" ];
7529 } else {
7530 props = props.match( rnothtmlwhite );
7531 }
7532
7533 var prop,
7534 index = 0,
7535 length = props.length;
7536
7537 for ( ; index < length; index++ ) {
7538 prop = props[ index ];
7539 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
7540 Animation.tweeners[ prop ].unshift( callback );
7541 }
7542 },
7543
7544 prefilters: [ defaultPrefilter ],
7545
7546 prefilter: function( callback, prepend ) {
7547 if ( prepend ) {
7548 Animation.prefilters.unshift( callback );
7549 } else {
7550 Animation.prefilters.push( callback );
7551 }
7552 }
7553} );
7554
7555jQuery.speed = function( speed, easing, fn ) {
7556 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
7557 complete: fn || !fn && easing ||
7558 isFunction( speed ) && speed,
7559 duration: speed,
7560 easing: fn && easing || easing && !isFunction( easing ) && easing
7561 };
7562
7563 // Go to the end state if fx are off
7564 if ( jQuery.fx.off ) {
7565 opt.duration = 0;
7566
7567 } else {
7568 if ( typeof opt.duration !== "number" ) {
7569 if ( opt.duration in jQuery.fx.speeds ) {
7570 opt.duration = jQuery.fx.speeds[ opt.duration ];
7571
7572 } else {
7573 opt.duration = jQuery.fx.speeds._default;
7574 }
7575 }
7576 }
7577
7578 // Normalize opt.queue - true/undefined/null -> "fx"
7579 if ( opt.queue == null || opt.queue === true ) {
7580 opt.queue = "fx";
7581 }
7582
7583 // Queueing
7584 opt.old = opt.complete;
7585
7586 opt.complete = function() {
7587 if ( isFunction( opt.old ) ) {
7588 opt.old.call( this );
7589 }
7590
7591 if ( opt.queue ) {
7592 jQuery.dequeue( this, opt.queue );
7593 }
7594 };
7595
7596 return opt;
7597};
7598
7599jQuery.fn.extend( {
7600 fadeTo: function( speed, to, easing, callback ) {
7601
7602 // Show any hidden elements after setting opacity to 0
7603 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
7604
7605 // Animate to the value specified
7606 .end().animate( { opacity: to }, speed, easing, callback );
7607 },
7608 animate: function( prop, speed, easing, callback ) {
7609 var empty = jQuery.isEmptyObject( prop ),
7610 optall = jQuery.speed( speed, easing, callback ),
7611 doAnimation = function() {
7612
7613 // Operate on a copy of prop so per-property easing won't be lost
7614 var anim = Animation( this, jQuery.extend( {}, prop ), optall );
7615
7616 // Empty animations, or finishing resolves immediately
7617 if ( empty || dataPriv.get( this, "finish" ) ) {
7618 anim.stop( true );
7619 }
7620 };
7621 doAnimation.finish = doAnimation;
7622
7623 return empty || optall.queue === false ?
7624 this.each( doAnimation ) :
7625 this.queue( optall.queue, doAnimation );
7626 },
7627 stop: function( type, clearQueue, gotoEnd ) {
7628 var stopQueue = function( hooks ) {
7629 var stop = hooks.stop;
7630 delete hooks.stop;
7631 stop( gotoEnd );
7632 };
7633
7634 if ( typeof type !== "string" ) {
7635 gotoEnd = clearQueue;
7636 clearQueue = type;
7637 type = undefined;
7638 }
7639 if ( clearQueue && type !== false ) {
7640 this.queue( type || "fx", [] );
7641 }
7642
7643 return this.each( function() {
7644 var dequeue = true,
7645 index = type != null && type + "queueHooks",
7646 timers = jQuery.timers,
7647 data = dataPriv.get( this );
7648
7649 if ( index ) {
7650 if ( data[ index ] && data[ index ].stop ) {
7651 stopQueue( data[ index ] );
7652 }
7653 } else {
7654 for ( index in data ) {
7655 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
7656 stopQueue( data[ index ] );
7657 }
7658 }
7659 }
7660
7661 for ( index = timers.length; index--; ) {
7662 if ( timers[ index ].elem === this &&
7663 ( type == null || timers[ index ].queue === type ) ) {
7664
7665 timers[ index ].anim.stop( gotoEnd );
7666 dequeue = false;
7667 timers.splice( index, 1 );
7668 }
7669 }
7670
7671 // Start the next in the queue if the last step wasn't forced.
7672 // Timers currently will call their complete callbacks, which
7673 // will dequeue but only if they were gotoEnd.
7674 if ( dequeue || !gotoEnd ) {
7675 jQuery.dequeue( this, type );
7676 }
7677 } );
7678 },
7679 finish: function( type ) {
7680 if ( type !== false ) {
7681 type = type || "fx";
7682 }
7683 return this.each( function() {
7684 var index,
7685 data = dataPriv.get( this ),
7686 queue = data[ type + "queue" ],
7687 hooks = data[ type + "queueHooks" ],
7688 timers = jQuery.timers,
7689 length = queue ? queue.length : 0;
7690
7691 // Enable finishing flag on private data
7692 data.finish = true;
7693
7694 // Empty the queue first
7695 jQuery.queue( this, type, [] );
7696
7697 if ( hooks && hooks.stop ) {
7698 hooks.stop.call( this, true );
7699 }
7700
7701 // Look for any active animations, and finish them
7702 for ( index = timers.length; index--; ) {
7703 if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
7704 timers[ index ].anim.stop( true );
7705 timers.splice( index, 1 );
7706 }
7707 }
7708
7709 // Look for any animations in the old queue and finish them
7710 for ( index = 0; index < length; index++ ) {
7711 if ( queue[ index ] && queue[ index ].finish ) {
7712 queue[ index ].finish.call( this );
7713 }
7714 }
7715
7716 // Turn off finishing flag
7717 delete data.finish;
7718 } );
7719 }
7720} );
7721
7722jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
7723 var cssFn = jQuery.fn[ name ];
7724 jQuery.fn[ name ] = function( speed, easing, callback ) {
7725 return speed == null || typeof speed === "boolean" ?
7726 cssFn.apply( this, arguments ) :
7727 this.animate( genFx( name, true ), speed, easing, callback );
7728 };
7729} );
7730
7731// Generate shortcuts for custom animations
7732jQuery.each( {
7733 slideDown: genFx( "show" ),
7734 slideUp: genFx( "hide" ),
7735 slideToggle: genFx( "toggle" ),
7736 fadeIn: { opacity: "show" },
7737 fadeOut: { opacity: "hide" },
7738 fadeToggle: { opacity: "toggle" }
7739}, function( name, props ) {
7740 jQuery.fn[ name ] = function( speed, easing, callback ) {
7741 return this.animate( props, speed, easing, callback );
7742 };
7743} );
7744
7745jQuery.timers = [];
7746jQuery.fx.tick = function() {
7747 var timer,
7748 i = 0,
7749 timers = jQuery.timers;
7750
7751 fxNow = Date.now();
7752
7753 for ( ; i < timers.length; i++ ) {
7754 timer = timers[ i ];
7755
7756 // Run the timer and safely remove it when done (allowing for external removal)
7757 if ( !timer() && timers[ i ] === timer ) {
7758 timers.splice( i--, 1 );
7759 }
7760 }
7761
7762 if ( !timers.length ) {
7763 jQuery.fx.stop();
7764 }
7765 fxNow = undefined;
7766};
7767
7768jQuery.fx.timer = function( timer ) {
7769 jQuery.timers.push( timer );
7770 jQuery.fx.start();
7771};
7772
7773jQuery.fx.interval = 13;
7774jQuery.fx.start = function() {
7775 if ( inProgress ) {
7776 return;
7777 }
7778
7779 inProgress = true;
7780 schedule();
7781};
7782
7783jQuery.fx.stop = function() {
7784 inProgress = null;
7785};
7786
7787jQuery.fx.speeds = {
7788 slow: 600,
7789 fast: 200,
7790
7791 // Default speed
7792 _default: 400
7793};
7794
7795
7796// Based off of the plugin by Clint Helfers, with permission.
7797// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
7798jQuery.fn.delay = function( time, type ) {
7799 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
7800 type = type || "fx";
7801
7802 return this.queue( type, function( next, hooks ) {
7803 var timeout = window.setTimeout( next, time );
7804 hooks.stop = function() {
7805 window.clearTimeout( timeout );
7806 };
7807 } );
7808};
7809
7810
7811( function() {
7812 var input = document.createElement( "input" ),
7813 select = document.createElement( "select" ),
7814 opt = select.appendChild( document.createElement( "option" ) );
7815
7816 input.type = "checkbox";
7817
7818 // Support: Android <=4.3 only
7819 // Default value for a checkbox should be "on"
7820 support.checkOn = input.value !== "";
7821
7822 // Support: IE <=11 only
7823 // Must access selectedIndex to make default options select
7824 support.optSelected = opt.selected;
7825
7826 // Support: IE <=11 only
7827 // An input loses its value after becoming a radio
7828 input = document.createElement( "input" );
7829 input.value = "t";
7830 input.type = "radio";
7831 support.radioValue = input.value === "t";
7832} )();
7833
7834
7835var boolHook,
7836 attrHandle = jQuery.expr.attrHandle;
7837
7838jQuery.fn.extend( {
7839 attr: function( name, value ) {
7840 return access( this, jQuery.attr, name, value, arguments.length > 1 );
7841 },
7842
7843 removeAttr: function( name ) {
7844 return this.each( function() {
7845 jQuery.removeAttr( this, name );
7846 } );
7847 }
7848} );
7849
7850jQuery.extend( {
7851 attr: function( elem, name, value ) {
7852 var ret, hooks,
7853 nType = elem.nodeType;
7854
7855 // Don't get/set attributes on text, comment and attribute nodes
7856 if ( nType === 3 || nType === 8 || nType === 2 ) {
7857 return;
7858 }
7859
7860 // Fallback to prop when attributes are not supported
7861 if ( typeof elem.getAttribute === "undefined" ) {
7862 return jQuery.prop( elem, name, value );
7863 }
7864
7865 // Attribute hooks are determined by the lowercase version
7866 // Grab necessary hook if one is defined
7867 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
7868 hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
7869 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
7870 }
7871
7872 if ( value !== undefined ) {
7873 if ( value === null ) {
7874 jQuery.removeAttr( elem, name );
7875 return;
7876 }
7877
7878 if ( hooks && "set" in hooks &&
7879 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
7880 return ret;
7881 }
7882
7883 elem.setAttribute( name, value + "" );
7884 return value;
7885 }
7886
7887 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
7888 return ret;
7889 }
7890
7891 ret = jQuery.find.attr( elem, name );
7892
7893 // Non-existent attributes return null, we normalize to undefined
7894 return ret == null ? undefined : ret;
7895 },
7896
7897 attrHooks: {
7898 type: {
7899 set: function( elem, value ) {
7900 if ( !support.radioValue && value === "radio" &&
7901 nodeName( elem, "input" ) ) {
7902 var val = elem.value;
7903 elem.setAttribute( "type", value );
7904 if ( val ) {
7905 elem.value = val;
7906 }
7907 return value;
7908 }
7909 }
7910 }
7911 },
7912
7913 removeAttr: function( elem, value ) {
7914 var name,
7915 i = 0,
7916
7917 // Attribute names can contain non-HTML whitespace characters
7918 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
7919 attrNames = value && value.match( rnothtmlwhite );
7920
7921 if ( attrNames && elem.nodeType === 1 ) {
7922 while ( ( name = attrNames[ i++ ] ) ) {
7923 elem.removeAttribute( name );
7924 }
7925 }
7926 }
7927} );
7928
7929// Hooks for boolean attributes
7930boolHook = {
7931 set: function( elem, value, name ) {
7932 if ( value === false ) {
7933
7934 // Remove boolean attributes when set to false
7935 jQuery.removeAttr( elem, name );
7936 } else {
7937 elem.setAttribute( name, name );
7938 }
7939 return name;
7940 }
7941};
7942
7943jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
7944 var getter = attrHandle[ name ] || jQuery.find.attr;
7945
7946 attrHandle[ name ] = function( elem, name, isXML ) {
7947 var ret, handle,
7948 lowercaseName = name.toLowerCase();
7949
7950 if ( !isXML ) {
7951
7952 // Avoid an infinite loop by temporarily removing this function from the getter
7953 handle = attrHandle[ lowercaseName ];
7954 attrHandle[ lowercaseName ] = ret;
7955 ret = getter( elem, name, isXML ) != null ?
7956 lowercaseName :
7957 null;
7958 attrHandle[ lowercaseName ] = handle;
7959 }
7960 return ret;
7961 };
7962} );
7963
7964
7965
7966
7967var rfocusable = /^(?:input|select|textarea|button)$/i,
7968 rclickable = /^(?:a|area)$/i;
7969
7970jQuery.fn.extend( {
7971 prop: function( name, value ) {
7972 return access( this, jQuery.prop, name, value, arguments.length > 1 );
7973 },
7974
7975 removeProp: function( name ) {
7976 return this.each( function() {
7977 delete this[ jQuery.propFix[ name ] || name ];
7978 } );
7979 }
7980} );
7981
7982jQuery.extend( {
7983 prop: function( elem, name, value ) {
7984 var ret, hooks,
7985 nType = elem.nodeType;
7986
7987 // Don't get/set properties on text, comment and attribute nodes
7988 if ( nType === 3 || nType === 8 || nType === 2 ) {
7989 return;
7990 }
7991
7992 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
7993
7994 // Fix name and attach hooks
7995 name = jQuery.propFix[ name ] || name;
7996 hooks = jQuery.propHooks[ name ];
7997 }
7998
7999 if ( value !== undefined ) {
8000 if ( hooks && "set" in hooks &&
8001 ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
8002 return ret;
8003 }
8004
8005 return ( elem[ name ] = value );
8006 }
8007
8008 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
8009 return ret;
8010 }
8011
8012 return elem[ name ];
8013 },
8014
8015 propHooks: {
8016 tabIndex: {
8017 get: function( elem ) {
8018
8019 // Support: IE <=9 - 11 only
8020 // elem.tabIndex doesn't always return the
8021 // correct value when it hasn't been explicitly set
8022 // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
8023 // Use proper attribute retrieval(#12072)
8024 var tabindex = jQuery.find.attr( elem, "tabindex" );
8025
8026 if ( tabindex ) {
8027 return parseInt( tabindex, 10 );
8028 }
8029
8030 if (
8031 rfocusable.test( elem.nodeName ) ||
8032 rclickable.test( elem.nodeName ) &&
8033 elem.href
8034 ) {
8035 return 0;
8036 }
8037
8038 return -1;
8039 }
8040 }
8041 },
8042
8043 propFix: {
8044 "for": "htmlFor",
8045 "class": "className"
8046 }
8047} );
8048
8049// Support: IE <=11 only
8050// Accessing the selectedIndex property
8051// forces the browser to respect setting selected
8052// on the option
8053// The getter ensures a default option is selected
8054// when in an optgroup
8055// eslint rule "no-unused-expressions" is disabled for this code
8056// since it considers such accessions noop
8057if ( !support.optSelected ) {
8058 jQuery.propHooks.selected = {
8059 get: function( elem ) {
8060
8061 /* eslint no-unused-expressions: "off" */
8062
8063 var parent = elem.parentNode;
8064 if ( parent && parent.parentNode ) {
8065 parent.parentNode.selectedIndex;
8066 }
8067 return null;
8068 },
8069 set: function( elem ) {
8070
8071 /* eslint no-unused-expressions: "off" */
8072
8073 var parent = elem.parentNode;
8074 if ( parent ) {
8075 parent.selectedIndex;
8076
8077 if ( parent.parentNode ) {
8078 parent.parentNode.selectedIndex;
8079 }
8080 }
8081 }
8082 };
8083}
8084
8085jQuery.each( [
8086 "tabIndex",
8087 "readOnly",
8088 "maxLength",
8089 "cellSpacing",
8090 "cellPadding",
8091 "rowSpan",
8092 "colSpan",
8093 "useMap",
8094 "frameBorder",
8095 "contentEditable"
8096], function() {
8097 jQuery.propFix[ this.toLowerCase() ] = this;
8098} );
8099
8100
8101
8102
8103 // Strip and collapse whitespace according to HTML spec
8104 // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
8105 function stripAndCollapse( value ) {
8106 var tokens = value.match( rnothtmlwhite ) || [];
8107 return tokens.join( " " );
8108 }
8109
8110
8111function getClass( elem ) {
8112 return elem.getAttribute && elem.getAttribute( "class" ) || "";
8113}
8114
8115function classesToArray( value ) {
8116 if ( Array.isArray( value ) ) {
8117 return value;
8118 }
8119 if ( typeof value === "string" ) {
8120 return value.match( rnothtmlwhite ) || [];
8121 }
8122 return [];
8123}
8124
8125jQuery.fn.extend( {
8126 addClass: function( value ) {
8127 var classes, elem, cur, curValue, clazz, j, finalValue,
8128 i = 0;
8129
8130 if ( isFunction( value ) ) {
8131 return this.each( function( j ) {
8132 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
8133 } );
8134 }
8135
8136 classes = classesToArray( value );
8137
8138 if ( classes.length ) {
8139 while ( ( elem = this[ i++ ] ) ) {
8140 curValue = getClass( elem );
8141 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
8142
8143 if ( cur ) {
8144 j = 0;
8145 while ( ( clazz = classes[ j++ ] ) ) {
8146 if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
8147 cur += clazz + " ";
8148 }
8149 }
8150
8151 // Only assign if different to avoid unneeded rendering.
8152 finalValue = stripAndCollapse( cur );
8153 if ( curValue !== finalValue ) {
8154 elem.setAttribute( "class", finalValue );
8155 }
8156 }
8157 }
8158 }
8159
8160 return this;
8161 },
8162
8163 removeClass: function( value ) {
8164 var classes, elem, cur, curValue, clazz, j, finalValue,
8165 i = 0;
8166
8167 if ( isFunction( value ) ) {
8168 return this.each( function( j ) {
8169 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
8170 } );
8171 }
8172
8173 if ( !arguments.length ) {
8174 return this.attr( "class", "" );
8175 }
8176
8177 classes = classesToArray( value );
8178
8179 if ( classes.length ) {
8180 while ( ( elem = this[ i++ ] ) ) {
8181 curValue = getClass( elem );
8182
8183 // This expression is here for better compressibility (see addClass)
8184 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
8185
8186 if ( cur ) {
8187 j = 0;
8188 while ( ( clazz = classes[ j++ ] ) ) {
8189
8190 // Remove *all* instances
8191 while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
8192 cur = cur.replace( " " + clazz + " ", " " );
8193 }
8194 }
8195
8196 // Only assign if different to avoid unneeded rendering.
8197 finalValue = stripAndCollapse( cur );
8198 if ( curValue !== finalValue ) {
8199 elem.setAttribute( "class", finalValue );
8200 }
8201 }
8202 }
8203 }
8204
8205 return this;
8206 },
8207
8208 toggleClass: function( value, stateVal ) {
8209 var type = typeof value,
8210 isValidValue = type === "string" || Array.isArray( value );
8211
8212 if ( typeof stateVal === "boolean" && isValidValue ) {
8213 return stateVal ? this.addClass( value ) : this.removeClass( value );
8214 }
8215
8216 if ( isFunction( value ) ) {
8217 return this.each( function( i ) {
8218 jQuery( this ).toggleClass(
8219 value.call( this, i, getClass( this ), stateVal ),
8220 stateVal
8221 );
8222 } );
8223 }
8224
8225 return this.each( function() {
8226 var className, i, self, classNames;
8227
8228 if ( isValidValue ) {
8229
8230 // Toggle individual class names
8231 i = 0;
8232 self = jQuery( this );
8233 classNames = classesToArray( value );
8234
8235 while ( ( className = classNames[ i++ ] ) ) {
8236
8237 // Check each className given, space separated list
8238 if ( self.hasClass( className ) ) {
8239 self.removeClass( className );
8240 } else {
8241 self.addClass( className );
8242 }
8243 }
8244
8245 // Toggle whole class name
8246 } else if ( value === undefined || type === "boolean" ) {
8247 className = getClass( this );
8248 if ( className ) {
8249
8250 // Store className if set
8251 dataPriv.set( this, "__className__", className );
8252 }
8253
8254 // If the element has a class name or if we're passed `false`,
8255 // then remove the whole classname (if there was one, the above saved it).
8256 // Otherwise bring back whatever was previously saved (if anything),
8257 // falling back to the empty string if nothing was stored.
8258 if ( this.setAttribute ) {
8259 this.setAttribute( "class",
8260 className || value === false ?
8261 "" :
8262 dataPriv.get( this, "__className__" ) || ""
8263 );
8264 }
8265 }
8266 } );
8267 },
8268
8269 hasClass: function( selector ) {
8270 var className, elem,
8271 i = 0;
8272
8273 className = " " + selector + " ";
8274 while ( ( elem = this[ i++ ] ) ) {
8275 if ( elem.nodeType === 1 &&
8276 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
8277 return true;
8278 }
8279 }
8280
8281 return false;
8282 }
8283} );
8284
8285
8286
8287
8288var rreturn = /\r/g;
8289
8290jQuery.fn.extend( {
8291 val: function( value ) {
8292 var hooks, ret, valueIsFunction,
8293 elem = this[ 0 ];
8294
8295 if ( !arguments.length ) {
8296 if ( elem ) {
8297 hooks = jQuery.valHooks[ elem.type ] ||
8298 jQuery.valHooks[ elem.nodeName.toLowerCase() ];
8299
8300 if ( hooks &&
8301 "get" in hooks &&
8302 ( ret = hooks.get( elem, "value" ) ) !== undefined
8303 ) {
8304 return ret;
8305 }
8306
8307 ret = elem.value;
8308
8309 // Handle most common string cases
8310 if ( typeof ret === "string" ) {
8311 return ret.replace( rreturn, "" );
8312 }
8313
8314 // Handle cases where value is null/undef or number
8315 return ret == null ? "" : ret;
8316 }
8317
8318 return;
8319 }
8320
8321 valueIsFunction = isFunction( value );
8322
8323 return this.each( function( i ) {
8324 var val;
8325
8326 if ( this.nodeType !== 1 ) {
8327 return;
8328 }
8329
8330 if ( valueIsFunction ) {
8331 val = value.call( this, i, jQuery( this ).val() );
8332 } else {
8333 val = value;
8334 }
8335
8336 // Treat null/undefined as ""; convert numbers to string
8337 if ( val == null ) {
8338 val = "";
8339
8340 } else if ( typeof val === "number" ) {
8341 val += "";
8342
8343 } else if ( Array.isArray( val ) ) {
8344 val = jQuery.map( val, function( value ) {
8345 return value == null ? "" : value + "";
8346 } );
8347 }
8348
8349 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
8350
8351 // If set returns undefined, fall back to normal setting
8352 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
8353 this.value = val;
8354 }
8355 } );
8356 }
8357} );
8358
8359jQuery.extend( {
8360 valHooks: {
8361 option: {
8362 get: function( elem ) {
8363
8364 var val = jQuery.find.attr( elem, "value" );
8365 return val != null ?
8366 val :
8367
8368 // Support: IE <=10 - 11 only
8369 // option.text throws exceptions (#14686, #14858)
8370 // Strip and collapse whitespace
8371 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
8372 stripAndCollapse( jQuery.text( elem ) );
8373 }
8374 },
8375 select: {
8376 get: function( elem ) {
8377 var value, option, i,
8378 options = elem.options,
8379 index = elem.selectedIndex,
8380 one = elem.type === "select-one",
8381 values = one ? null : [],
8382 max = one ? index + 1 : options.length;
8383
8384 if ( index < 0 ) {
8385 i = max;
8386
8387 } else {
8388 i = one ? index : 0;
8389 }
8390
8391 // Loop through all the selected options
8392 for ( ; i < max; i++ ) {
8393 option = options[ i ];
8394
8395 // Support: IE <=9 only
8396 // IE8-9 doesn't update selected after form reset (#2551)
8397 if ( ( option.selected || i === index ) &&
8398
8399 // Don't return options that are disabled or in a disabled optgroup
8400 !option.disabled &&
8401 ( !option.parentNode.disabled ||
8402 !nodeName( option.parentNode, "optgroup" ) ) ) {
8403
8404 // Get the specific value for the option
8405 value = jQuery( option ).val();
8406
8407 // We don't need an array for one selects
8408 if ( one ) {
8409 return value;
8410 }
8411
8412 // Multi-Selects return an array
8413 values.push( value );
8414 }
8415 }
8416
8417 return values;
8418 },
8419
8420 set: function( elem, value ) {
8421 var optionSet, option,
8422 options = elem.options,
8423 values = jQuery.makeArray( value ),
8424 i = options.length;
8425
8426 while ( i-- ) {
8427 option = options[ i ];
8428
8429 /* eslint-disable no-cond-assign */
8430
8431 if ( option.selected =
8432 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
8433 ) {
8434 optionSet = true;
8435 }
8436
8437 /* eslint-enable no-cond-assign */
8438 }
8439
8440 // Force browsers to behave consistently when non-matching value is set
8441 if ( !optionSet ) {
8442 elem.selectedIndex = -1;
8443 }
8444 return values;
8445 }
8446 }
8447 }
8448} );
8449
8450// Radios and checkboxes getter/setter
8451jQuery.each( [ "radio", "checkbox" ], function() {
8452 jQuery.valHooks[ this ] = {
8453 set: function( elem, value ) {
8454 if ( Array.isArray( value ) ) {
8455 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
8456 }
8457 }
8458 };
8459 if ( !support.checkOn ) {
8460 jQuery.valHooks[ this ].get = function( elem ) {
8461 return elem.getAttribute( "value" ) === null ? "on" : elem.value;
8462 };
8463 }
8464} );
8465
8466
8467
8468
8469// Return jQuery for attributes-only inclusion
8470
8471
8472support.focusin = "onfocusin" in window;
8473
8474
8475var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
8476 stopPropagationCallback = function( e ) {
8477 e.stopPropagation();
8478 };
8479
8480jQuery.extend( jQuery.event, {
8481
8482 trigger: function( event, data, elem, onlyHandlers ) {
8483
8484 var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
8485 eventPath = [ elem || document ],
8486 type = hasOwn.call( event, "type" ) ? event.type : event,
8487 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
8488
8489 cur = lastElement = tmp = elem = elem || document;
8490
8491 // Don't do events on text and comment nodes
8492 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
8493 return;
8494 }
8495
8496 // focus/blur morphs to focusin/out; ensure we're not firing them right now
8497 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
8498 return;
8499 }
8500
8501 if ( type.indexOf( "." ) > -1 ) {
8502
8503 // Namespaced trigger; create a regexp to match event type in handle()
8504 namespaces = type.split( "." );
8505 type = namespaces.shift();
8506 namespaces.sort();
8507 }
8508 ontype = type.indexOf( ":" ) < 0 && "on" + type;
8509
8510 // Caller can pass in a jQuery.Event object, Object, or just an event type string
8511 event = event[ jQuery.expando ] ?
8512 event :
8513 new jQuery.Event( type, typeof event === "object" && event );
8514
8515 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
8516 event.isTrigger = onlyHandlers ? 2 : 3;
8517 event.namespace = namespaces.join( "." );
8518 event.rnamespace = event.namespace ?
8519 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
8520 null;
8521
8522 // Clean up the event in case it is being reused
8523 event.result = undefined;
8524 if ( !event.target ) {
8525 event.target = elem;
8526 }
8527
8528 // Clone any incoming data and prepend the event, creating the handler arg list
8529 data = data == null ?
8530 [ event ] :
8531 jQuery.makeArray( data, [ event ] );
8532
8533 // Allow special events to draw outside the lines
8534 special = jQuery.event.special[ type ] || {};
8535 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
8536 return;
8537 }
8538
8539 // Determine event propagation path in advance, per W3C events spec (#9951)
8540 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
8541 if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
8542
8543 bubbleType = special.delegateType || type;
8544 if ( !rfocusMorph.test( bubbleType + type ) ) {
8545 cur = cur.parentNode;
8546 }
8547 for ( ; cur; cur = cur.parentNode ) {
8548 eventPath.push( cur );
8549 tmp = cur;
8550 }
8551
8552 // Only add window if we got to document (e.g., not plain obj or detached DOM)
8553 if ( tmp === ( elem.ownerDocument || document ) ) {
8554 eventPath.push( tmp.defaultView || tmp.parentWindow || window );
8555 }
8556 }
8557
8558 // Fire handlers on the event path
8559 i = 0;
8560 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
8561 lastElement = cur;
8562 event.type = i > 1 ?
8563 bubbleType :
8564 special.bindType || type;
8565
8566 // jQuery handler
8567 handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
8568 dataPriv.get( cur, "handle" );
8569 if ( handle ) {
8570 handle.apply( cur, data );
8571 }
8572
8573 // Native handler
8574 handle = ontype && cur[ ontype ];
8575 if ( handle && handle.apply && acceptData( cur ) ) {
8576 event.result = handle.apply( cur, data );
8577 if ( event.result === false ) {
8578 event.preventDefault();
8579 }
8580 }
8581 }
8582 event.type = type;
8583
8584 // If nobody prevented the default action, do it now
8585 if ( !onlyHandlers && !event.isDefaultPrevented() ) {
8586
8587 if ( ( !special._default ||
8588 special._default.apply( eventPath.pop(), data ) === false ) &&
8589 acceptData( elem ) ) {
8590
8591 // Call a native DOM method on the target with the same name as the event.
8592 // Don't do default actions on window, that's where global variables be (#6170)
8593 if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
8594
8595 // Don't re-trigger an onFOO event when we call its FOO() method
8596 tmp = elem[ ontype ];
8597
8598 if ( tmp ) {
8599 elem[ ontype ] = null;
8600 }
8601
8602 // Prevent re-triggering of the same event, since we already bubbled it above
8603 jQuery.event.triggered = type;
8604
8605 if ( event.isPropagationStopped() ) {
8606 lastElement.addEventListener( type, stopPropagationCallback );
8607 }
8608
8609 elem[ type ]();
8610
8611 if ( event.isPropagationStopped() ) {
8612 lastElement.removeEventListener( type, stopPropagationCallback );
8613 }
8614
8615 jQuery.event.triggered = undefined;
8616
8617 if ( tmp ) {
8618 elem[ ontype ] = tmp;
8619 }
8620 }
8621 }
8622 }
8623
8624 return event.result;
8625 },
8626
8627 // Piggyback on a donor event to simulate a different one
8628 // Used only for `focus(in | out)` events
8629 simulate: function( type, elem, event ) {
8630 var e = jQuery.extend(
8631 new jQuery.Event(),
8632 event,
8633 {
8634 type: type,
8635 isSimulated: true
8636 }
8637 );
8638
8639 jQuery.event.trigger( e, null, elem );
8640 }
8641
8642} );
8643
8644jQuery.fn.extend( {
8645
8646 trigger: function( type, data ) {
8647 return this.each( function() {
8648 jQuery.event.trigger( type, data, this );
8649 } );
8650 },
8651 triggerHandler: function( type, data ) {
8652 var elem = this[ 0 ];
8653 if ( elem ) {
8654 return jQuery.event.trigger( type, data, elem, true );
8655 }
8656 }
8657} );
8658
8659
8660// Support: Firefox <=44
8661// Firefox doesn't have focus(in | out) events
8662// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
8663//
8664// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
8665// focus(in | out) events fire after focus & blur events,
8666// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
8667// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
8668if ( !support.focusin ) {
8669 jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
8670
8671 // Attach a single capturing handler on the document while someone wants focusin/focusout
8672 var handler = function( event ) {
8673 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
8674 };
8675
8676 jQuery.event.special[ fix ] = {
8677 setup: function() {
8678 var doc = this.ownerDocument || this,
8679 attaches = dataPriv.access( doc, fix );
8680
8681 if ( !attaches ) {
8682 doc.addEventListener( orig, handler, true );
8683 }
8684 dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
8685 },
8686 teardown: function() {
8687 var doc = this.ownerDocument || this,
8688 attaches = dataPriv.access( doc, fix ) - 1;
8689
8690 if ( !attaches ) {
8691 doc.removeEventListener( orig, handler, true );
8692 dataPriv.remove( doc, fix );
8693
8694 } else {
8695 dataPriv.access( doc, fix, attaches );
8696 }
8697 }
8698 };
8699 } );
8700}
8701var location = window.location;
8702
8703var nonce = Date.now();
8704
8705var rquery = ( /\?/ );
8706
8707
8708
8709// Cross-browser xml parsing
8710jQuery.parseXML = function( data ) {
8711 var xml;
8712 if ( !data || typeof data !== "string" ) {
8713 return null;
8714 }
8715
8716 // Support: IE 9 - 11 only
8717 // IE throws on parseFromString with invalid input.
8718 try {
8719 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
8720 } catch ( e ) {
8721 xml = undefined;
8722 }
8723
8724 if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
8725 jQuery.error( "Invalid XML: " + data );
8726 }
8727 return xml;
8728};
8729
8730
8731var
8732 rbracket = /\[\]$/,
8733 rCRLF = /\r?\n/g,
8734 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
8735 rsubmittable = /^(?:input|select|textarea|keygen)/i;
8736
8737function buildParams( prefix, obj, traditional, add ) {
8738 var name;
8739
8740 if ( Array.isArray( obj ) ) {
8741
8742 // Serialize array item.
8743 jQuery.each( obj, function( i, v ) {
8744 if ( traditional || rbracket.test( prefix ) ) {
8745
8746 // Treat each array item as a scalar.
8747 add( prefix, v );
8748
8749 } else {
8750
8751 // Item is non-scalar (array or object), encode its numeric index.
8752 buildParams(
8753 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
8754 v,
8755 traditional,
8756 add
8757 );
8758 }
8759 } );
8760
8761 } else if ( !traditional && toType( obj ) === "object" ) {
8762
8763 // Serialize object item.
8764 for ( name in obj ) {
8765 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
8766 }
8767
8768 } else {
8769
8770 // Serialize scalar item.
8771 add( prefix, obj );
8772 }
8773}
8774
8775// Serialize an array of form elements or a set of
8776// key/values into a query string
8777jQuery.param = function( a, traditional ) {
8778 var prefix,
8779 s = [],
8780 add = function( key, valueOrFunction ) {
8781
8782 // If value is a function, invoke it and use its return value
8783 var value = isFunction( valueOrFunction ) ?
8784 valueOrFunction() :
8785 valueOrFunction;
8786
8787 s[ s.length ] = encodeURIComponent( key ) + "=" +
8788 encodeURIComponent( value == null ? "" : value );
8789 };
8790
8791 if ( a == null ) {
8792 return "";
8793 }
8794
8795 // If an array was passed in, assume that it is an array of form elements.
8796 if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
8797
8798 // Serialize the form elements
8799 jQuery.each( a, function() {
8800 add( this.name, this.value );
8801 } );
8802
8803 } else {
8804
8805 // If traditional, encode the "old" way (the way 1.3.2 or older
8806 // did it), otherwise encode params recursively.
8807 for ( prefix in a ) {
8808 buildParams( prefix, a[ prefix ], traditional, add );
8809 }
8810 }
8811
8812 // Return the resulting serialization
8813 return s.join( "&" );
8814};
8815
8816jQuery.fn.extend( {
8817 serialize: function() {
8818 return jQuery.param( this.serializeArray() );
8819 },
8820 serializeArray: function() {
8821 return this.map( function() {
8822
8823 // Can add propHook for "elements" to filter or add form elements
8824 var elements = jQuery.prop( this, "elements" );
8825 return elements ? jQuery.makeArray( elements ) : this;
8826 } )
8827 .filter( function() {
8828 var type = this.type;
8829
8830 // Use .is( ":disabled" ) so that fieldset[disabled] works
8831 return this.name && !jQuery( this ).is( ":disabled" ) &&
8832 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
8833 ( this.checked || !rcheckableType.test( type ) );
8834 } )
8835 .map( function( i, elem ) {
8836 var val = jQuery( this ).val();
8837
8838 if ( val == null ) {
8839 return null;
8840 }
8841
8842 if ( Array.isArray( val ) ) {
8843 return jQuery.map( val, function( val ) {
8844 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
8845 } );
8846 }
8847
8848 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
8849 } ).get();
8850 }
8851} );
8852
8853
8854var
8855 r20 = /%20/g,
8856 rhash = /#.*$/,
8857 rantiCache = /([?&])_=[^&]*/,
8858 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
8859
8860 // #7653, #8125, #8152: local protocol detection
8861 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
8862 rnoContent = /^(?:GET|HEAD)$/,
8863 rprotocol = /^\/\//,
8864
8865 /* Prefilters
8866 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
8867 * 2) These are called:
8868 * - BEFORE asking for a transport
8869 * - AFTER param serialization (s.data is a string if s.processData is true)
8870 * 3) key is the dataType
8871 * 4) the catchall symbol "*" can be used
8872 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
8873 */
8874 prefilters = {},
8875
8876 /* Transports bindings
8877 * 1) key is the dataType
8878 * 2) the catchall symbol "*" can be used
8879 * 3) selection will start with transport dataType and THEN go to "*" if needed
8880 */
8881 transports = {},
8882
8883 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
8884 allTypes = "*/".concat( "*" ),
8885
8886 // Anchor tag for parsing the document origin
8887 originAnchor = document.createElement( "a" );
8888 originAnchor.href = location.href;
8889
8890// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
8891function addToPrefiltersOrTransports( structure ) {
8892
8893 // dataTypeExpression is optional and defaults to "*"
8894 return function( dataTypeExpression, func ) {
8895
8896 if ( typeof dataTypeExpression !== "string" ) {
8897 func = dataTypeExpression;
8898 dataTypeExpression = "*";
8899 }
8900
8901 var dataType,
8902 i = 0,
8903 dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
8904
8905 if ( isFunction( func ) ) {
8906
8907 // For each dataType in the dataTypeExpression
8908 while ( ( dataType = dataTypes[ i++ ] ) ) {
8909
8910 // Prepend if requested
8911 if ( dataType[ 0 ] === "+" ) {
8912 dataType = dataType.slice( 1 ) || "*";
8913 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
8914
8915 // Otherwise append
8916 } else {
8917 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
8918 }
8919 }
8920 }
8921 };
8922}
8923
8924// Base inspection function for prefilters and transports
8925function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
8926
8927 var inspected = {},
8928 seekingTransport = ( structure === transports );
8929
8930 function inspect( dataType ) {
8931 var selected;
8932 inspected[ dataType ] = true;
8933 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
8934 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
8935 if ( typeof dataTypeOrTransport === "string" &&
8936 !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
8937
8938 options.dataTypes.unshift( dataTypeOrTransport );
8939 inspect( dataTypeOrTransport );
8940 return false;
8941 } else if ( seekingTransport ) {
8942 return !( selected = dataTypeOrTransport );
8943 }
8944 } );
8945 return selected;
8946 }
8947
8948 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
8949}
8950
8951// A special extend for ajax options
8952// that takes "flat" options (not to be deep extended)
8953// Fixes #9887
8954function ajaxExtend( target, src ) {
8955 var key, deep,
8956 flatOptions = jQuery.ajaxSettings.flatOptions || {};
8957
8958 for ( key in src ) {
8959 if ( src[ key ] !== undefined ) {
8960 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
8961 }
8962 }
8963 if ( deep ) {
8964 jQuery.extend( true, target, deep );
8965 }
8966
8967 return target;
8968}
8969
8970/* Handles responses to an ajax request:
8971 * - finds the right dataType (mediates between content-type and expected dataType)
8972 * - returns the corresponding response
8973 */
8974function ajaxHandleResponses( s, jqXHR, responses ) {
8975
8976 var ct, type, finalDataType, firstDataType,
8977 contents = s.contents,
8978 dataTypes = s.dataTypes;
8979
8980 // Remove auto dataType and get content-type in the process
8981 while ( dataTypes[ 0 ] === "*" ) {
8982 dataTypes.shift();
8983 if ( ct === undefined ) {
8984 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
8985 }
8986 }
8987
8988 // Check if we're dealing with a known content-type
8989 if ( ct ) {
8990 for ( type in contents ) {
8991 if ( contents[ type ] && contents[ type ].test( ct ) ) {
8992 dataTypes.unshift( type );
8993 break;
8994 }
8995 }
8996 }
8997
8998 // Check to see if we have a response for the expected dataType
8999 if ( dataTypes[ 0 ] in responses ) {
9000 finalDataType = dataTypes[ 0 ];
9001 } else {
9002
9003 // Try convertible dataTypes
9004 for ( type in responses ) {
9005 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
9006 finalDataType = type;
9007 break;
9008 }
9009 if ( !firstDataType ) {
9010 firstDataType = type;
9011 }
9012 }
9013
9014 // Or just use first one
9015 finalDataType = finalDataType || firstDataType;
9016 }
9017
9018 // If we found a dataType
9019 // We add the dataType to the list if needed
9020 // and return the corresponding response
9021 if ( finalDataType ) {
9022 if ( finalDataType !== dataTypes[ 0 ] ) {
9023 dataTypes.unshift( finalDataType );
9024 }
9025 return responses[ finalDataType ];
9026 }
9027}
9028
9029/* Chain conversions given the request and the original response
9030 * Also sets the responseXXX fields on the jqXHR instance
9031 */
9032function ajaxConvert( s, response, jqXHR, isSuccess ) {
9033 var conv2, current, conv, tmp, prev,
9034 converters = {},
9035
9036 // Work with a copy of dataTypes in case we need to modify it for conversion
9037 dataTypes = s.dataTypes.slice();
9038
9039 // Create converters map with lowercased keys
9040 if ( dataTypes[ 1 ] ) {
9041 for ( conv in s.converters ) {
9042 converters[ conv.toLowerCase() ] = s.converters[ conv ];
9043 }
9044 }
9045
9046 current = dataTypes.shift();
9047
9048 // Convert to each sequential dataType
9049 while ( current ) {
9050
9051 if ( s.responseFields[ current ] ) {
9052 jqXHR[ s.responseFields[ current ] ] = response;
9053 }
9054
9055 // Apply the dataFilter if provided
9056 if ( !prev && isSuccess && s.dataFilter ) {
9057 response = s.dataFilter( response, s.dataType );
9058 }
9059
9060 prev = current;
9061 current = dataTypes.shift();
9062
9063 if ( current ) {
9064
9065 // There's only work to do if current dataType is non-auto
9066 if ( current === "*" ) {
9067
9068 current = prev;
9069
9070 // Convert response if prev dataType is non-auto and differs from current
9071 } else if ( prev !== "*" && prev !== current ) {
9072
9073 // Seek a direct converter
9074 conv = converters[ prev + " " + current ] || converters[ "* " + current ];
9075
9076 // If none found, seek a pair
9077 if ( !conv ) {
9078 for ( conv2 in converters ) {
9079
9080 // If conv2 outputs current
9081 tmp = conv2.split( " " );
9082 if ( tmp[ 1 ] === current ) {
9083
9084 // If prev can be converted to accepted input
9085 conv = converters[ prev + " " + tmp[ 0 ] ] ||
9086 converters[ "* " + tmp[ 0 ] ];
9087 if ( conv ) {
9088
9089 // Condense equivalence converters
9090 if ( conv === true ) {
9091 conv = converters[ conv2 ];
9092
9093 // Otherwise, insert the intermediate dataType
9094 } else if ( converters[ conv2 ] !== true ) {
9095 current = tmp[ 0 ];
9096 dataTypes.unshift( tmp[ 1 ] );
9097 }
9098 break;
9099 }
9100 }
9101 }
9102 }
9103
9104 // Apply converter (if not an equivalence)
9105 if ( conv !== true ) {
9106
9107 // Unless errors are allowed to bubble, catch and return them
9108 if ( conv && s.throws ) {
9109 response = conv( response );
9110 } else {
9111 try {
9112 response = conv( response );
9113 } catch ( e ) {
9114 return {
9115 state: "parsererror",
9116 error: conv ? e : "No conversion from " + prev + " to " + current
9117 };
9118 }
9119 }
9120 }
9121 }
9122 }
9123 }
9124
9125 return { state: "success", data: response };
9126}
9127
9128jQuery.extend( {
9129
9130 // Counter for holding the number of active queries
9131 active: 0,
9132
9133 // Last-Modified header cache for next request
9134 lastModified: {},
9135 etag: {},
9136
9137 ajaxSettings: {
9138 url: location.href,
9139 type: "GET",
9140 isLocal: rlocalProtocol.test( location.protocol ),
9141 global: true,
9142 processData: true,
9143 async: true,
9144 contentType: "application/x-www-form-urlencoded; charset=UTF-8",
9145
9146 /*
9147 timeout: 0,
9148 data: null,
9149 dataType: null,
9150 username: null,
9151 password: null,
9152 cache: null,
9153 throws: false,
9154 traditional: false,
9155 headers: {},
9156 */
9157
9158 accepts: {
9159 "*": allTypes,
9160 text: "text/plain",
9161 html: "text/html",
9162 xml: "application/xml, text/xml",
9163 json: "application/json, text/javascript"
9164 },
9165
9166 contents: {
9167 xml: /\bxml\b/,
9168 html: /\bhtml/,
9169 json: /\bjson\b/
9170 },
9171
9172 responseFields: {
9173 xml: "responseXML",
9174 text: "responseText",
9175 json: "responseJSON"
9176 },
9177
9178 // Data converters
9179 // Keys separate source (or catchall "*") and destination types with a single space
9180 converters: {
9181
9182 // Convert anything to text
9183 "* text": String,
9184
9185 // Text to html (true = no transformation)
9186 "text html": true,
9187
9188 // Evaluate text as a json expression
9189 "text json": JSON.parse,
9190
9191 // Parse text as xml
9192 "text xml": jQuery.parseXML
9193 },
9194
9195 // For options that shouldn't be deep extended:
9196 // you can add your own custom options here if
9197 // and when you create one that shouldn't be
9198 // deep extended (see ajaxExtend)
9199 flatOptions: {
9200 url: true,
9201 context: true
9202 }
9203 },
9204
9205 // Creates a full fledged settings object into target
9206 // with both ajaxSettings and settings fields.
9207 // If target is omitted, writes into ajaxSettings.
9208 ajaxSetup: function( target, settings ) {
9209 return settings ?
9210
9211 // Building a settings object
9212 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
9213
9214 // Extending ajaxSettings
9215 ajaxExtend( jQuery.ajaxSettings, target );
9216 },
9217
9218 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
9219 ajaxTransport: addToPrefiltersOrTransports( transports ),
9220
9221 // Main method
9222 ajax: function( url, options ) {
9223
9224 // If url is an object, simulate pre-1.5 signature
9225 if ( typeof url === "object" ) {
9226 options = url;
9227 url = undefined;
9228 }
9229
9230 // Force options to be an object
9231 options = options || {};
9232
9233 var transport,
9234
9235 // URL without anti-cache param
9236 cacheURL,
9237
9238 // Response headers
9239 responseHeadersString,
9240 responseHeaders,
9241
9242 // timeout handle
9243 timeoutTimer,
9244
9245 // Url cleanup var
9246 urlAnchor,
9247
9248 // Request state (becomes false upon send and true upon completion)
9249 completed,
9250
9251 // To know if global events are to be dispatched
9252 fireGlobals,
9253
9254 // Loop variable
9255 i,
9256
9257 // uncached part of the url
9258 uncached,
9259
9260 // Create the final options object
9261 s = jQuery.ajaxSetup( {}, options ),
9262
9263 // Callbacks context
9264 callbackContext = s.context || s,
9265
9266 // Context for global events is callbackContext if it is a DOM node or jQuery collection
9267 globalEventContext = s.context &&
9268 ( callbackContext.nodeType || callbackContext.jquery ) ?
9269 jQuery( callbackContext ) :
9270 jQuery.event,
9271
9272 // Deferreds
9273 deferred = jQuery.Deferred(),
9274 completeDeferred = jQuery.Callbacks( "once memory" ),
9275
9276 // Status-dependent callbacks
9277 statusCode = s.statusCode || {},
9278
9279 // Headers (they are sent all at once)
9280 requestHeaders = {},
9281 requestHeadersNames = {},
9282
9283 // Default abort message
9284 strAbort = "canceled",
9285
9286 // Fake xhr
9287 jqXHR = {
9288 readyState: 0,
9289
9290 // Builds headers hashtable if needed
9291 getResponseHeader: function( key ) {
9292 var match;
9293 if ( completed ) {
9294 if ( !responseHeaders ) {
9295 responseHeaders = {};
9296 while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
9297 responseHeaders[ match[ 1 ].toLowerCase() + " " ] =
9298 ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )
9299 .concat( match[ 2 ] );
9300 }
9301 }
9302 match = responseHeaders[ key.toLowerCase() + " " ];
9303 }
9304 return match == null ? null : match.join( ", " );
9305 },
9306
9307 // Raw string
9308 getAllResponseHeaders: function() {
9309 return completed ? responseHeadersString : null;
9310 },
9311
9312 // Caches the header
9313 setRequestHeader: function( name, value ) {
9314 if ( completed == null ) {
9315 name = requestHeadersNames[ name.toLowerCase() ] =
9316 requestHeadersNames[ name.toLowerCase() ] || name;
9317 requestHeaders[ name ] = value;
9318 }
9319 return this;
9320 },
9321
9322 // Overrides response content-type header
9323 overrideMimeType: function( type ) {
9324 if ( completed == null ) {
9325 s.mimeType = type;
9326 }
9327 return this;
9328 },
9329
9330 // Status-dependent callbacks
9331 statusCode: function( map ) {
9332 var code;
9333 if ( map ) {
9334 if ( completed ) {
9335
9336 // Execute the appropriate callbacks
9337 jqXHR.always( map[ jqXHR.status ] );
9338 } else {
9339
9340 // Lazy-add the new callbacks in a way that preserves old ones
9341 for ( code in map ) {
9342 statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
9343 }
9344 }
9345 }
9346 return this;
9347 },
9348
9349 // Cancel the request
9350 abort: function( statusText ) {
9351 var finalText = statusText || strAbort;
9352 if ( transport ) {
9353 transport.abort( finalText );
9354 }
9355 done( 0, finalText );
9356 return this;
9357 }
9358 };
9359
9360 // Attach deferreds
9361 deferred.promise( jqXHR );
9362
9363 // Add protocol if not provided (prefilters might expect it)
9364 // Handle falsy url in the settings object (#10093: consistency with old signature)
9365 // We also use the url parameter if available
9366 s.url = ( ( url || s.url || location.href ) + "" )
9367 .replace( rprotocol, location.protocol + "//" );
9368
9369 // Alias method option to type as per ticket #12004
9370 s.type = options.method || options.type || s.method || s.type;
9371
9372 // Extract dataTypes list
9373 s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
9374
9375 // A cross-domain request is in order when the origin doesn't match the current origin.
9376 if ( s.crossDomain == null ) {
9377 urlAnchor = document.createElement( "a" );
9378
9379 // Support: IE <=8 - 11, Edge 12 - 15
9380 // IE throws exception on accessing the href property if url is malformed,
9381 // e.g. http://example.com:80x/
9382 try {
9383 urlAnchor.href = s.url;
9384
9385 // Support: IE <=8 - 11 only
9386 // Anchor's host property isn't correctly set when s.url is relative
9387 urlAnchor.href = urlAnchor.href;
9388 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
9389 urlAnchor.protocol + "//" + urlAnchor.host;
9390 } catch ( e ) {
9391
9392 // If there is an error parsing the URL, assume it is crossDomain,
9393 // it can be rejected by the transport if it is invalid
9394 s.crossDomain = true;
9395 }
9396 }
9397
9398 // Convert data if not already a string
9399 if ( s.data && s.processData && typeof s.data !== "string" ) {
9400 s.data = jQuery.param( s.data, s.traditional );
9401 }
9402
9403 // Apply prefilters
9404 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
9405
9406 // If request was aborted inside a prefilter, stop there
9407 if ( completed ) {
9408 return jqXHR;
9409 }
9410
9411 // We can fire global events as of now if asked to
9412 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
9413 fireGlobals = jQuery.event && s.global;
9414
9415 // Watch for a new set of requests
9416 if ( fireGlobals && jQuery.active++ === 0 ) {
9417 jQuery.event.trigger( "ajaxStart" );
9418 }
9419
9420 // Uppercase the type
9421 s.type = s.type.toUpperCase();
9422
9423 // Determine if request has content
9424 s.hasContent = !rnoContent.test( s.type );
9425
9426 // Save the URL in case we're toying with the If-Modified-Since
9427 // and/or If-None-Match header later on
9428 // Remove hash to simplify url manipulation
9429 cacheURL = s.url.replace( rhash, "" );
9430
9431 // More options handling for requests with no content
9432 if ( !s.hasContent ) {
9433
9434 // Remember the hash so we can put it back
9435 uncached = s.url.slice( cacheURL.length );
9436
9437 // If data is available and should be processed, append data to url
9438 if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
9439 cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
9440
9441 // #9682: remove data so that it's not used in an eventual retry
9442 delete s.data;
9443 }
9444
9445 // Add or update anti-cache param if needed
9446 if ( s.cache === false ) {
9447 cacheURL = cacheURL.replace( rantiCache, "$1" );
9448 uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
9449 }
9450
9451 // Put hash and anti-cache on the URL that will be requested (gh-1732)
9452 s.url = cacheURL + uncached;
9453
9454 // Change '%20' to '+' if this is encoded form body content (gh-2658)
9455 } else if ( s.data && s.processData &&
9456 ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
9457 s.data = s.data.replace( r20, "+" );
9458 }
9459
9460 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
9461 if ( s.ifModified ) {
9462 if ( jQuery.lastModified[ cacheURL ] ) {
9463 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
9464 }
9465 if ( jQuery.etag[ cacheURL ] ) {
9466 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
9467 }
9468 }
9469
9470 // Set the correct header, if data is being sent
9471 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
9472 jqXHR.setRequestHeader( "Content-Type", s.contentType );
9473 }
9474
9475 // Set the Accepts header for the server, depending on the dataType
9476 jqXHR.setRequestHeader(
9477 "Accept",
9478 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
9479 s.accepts[ s.dataTypes[ 0 ] ] +
9480 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
9481 s.accepts[ "*" ]
9482 );
9483
9484 // Check for headers option
9485 for ( i in s.headers ) {
9486 jqXHR.setRequestHeader( i, s.headers[ i ] );
9487 }
9488
9489 // Allow custom headers/mimetypes and early abort
9490 if ( s.beforeSend &&
9491 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
9492
9493 // Abort if not done already and return
9494 return jqXHR.abort();
9495 }
9496
9497 // Aborting is no longer a cancellation
9498 strAbort = "abort";
9499
9500 // Install callbacks on deferreds
9501 completeDeferred.add( s.complete );
9502 jqXHR.done( s.success );
9503 jqXHR.fail( s.error );
9504
9505 // Get transport
9506 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
9507
9508 // If no transport, we auto-abort
9509 if ( !transport ) {
9510 done( -1, "No Transport" );
9511 } else {
9512 jqXHR.readyState = 1;
9513
9514 // Send global event
9515 if ( fireGlobals ) {
9516 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
9517 }
9518
9519 // If request was aborted inside ajaxSend, stop there
9520 if ( completed ) {
9521 return jqXHR;
9522 }
9523
9524 // Timeout
9525 if ( s.async && s.timeout > 0 ) {
9526 timeoutTimer = window.setTimeout( function() {
9527 jqXHR.abort( "timeout" );
9528 }, s.timeout );
9529 }
9530
9531 try {
9532 completed = false;
9533 transport.send( requestHeaders, done );
9534 } catch ( e ) {
9535
9536 // Rethrow post-completion exceptions
9537 if ( completed ) {
9538 throw e;
9539 }
9540
9541 // Propagate others as results
9542 done( -1, e );
9543 }
9544 }
9545
9546 // Callback for when everything is done
9547 function done( status, nativeStatusText, responses, headers ) {
9548 var isSuccess, success, error, response, modified,
9549 statusText = nativeStatusText;
9550
9551 // Ignore repeat invocations
9552 if ( completed ) {
9553 return;
9554 }
9555
9556 completed = true;
9557
9558 // Clear timeout if it exists
9559 if ( timeoutTimer ) {
9560 window.clearTimeout( timeoutTimer );
9561 }
9562
9563 // Dereference transport for early garbage collection
9564 // (no matter how long the jqXHR object will be used)
9565 transport = undefined;
9566
9567 // Cache response headers
9568 responseHeadersString = headers || "";
9569
9570 // Set readyState
9571 jqXHR.readyState = status > 0 ? 4 : 0;
9572
9573 // Determine if successful
9574 isSuccess = status >= 200 && status < 300 || status === 304;
9575
9576 // Get response data
9577 if ( responses ) {
9578 response = ajaxHandleResponses( s, jqXHR, responses );
9579 }
9580
9581 // Convert no matter what (that way responseXXX fields are always set)
9582 response = ajaxConvert( s, response, jqXHR, isSuccess );
9583
9584 // If successful, handle type chaining
9585 if ( isSuccess ) {
9586
9587 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
9588 if ( s.ifModified ) {
9589 modified = jqXHR.getResponseHeader( "Last-Modified" );
9590 if ( modified ) {
9591 jQuery.lastModified[ cacheURL ] = modified;
9592 }
9593 modified = jqXHR.getResponseHeader( "etag" );
9594 if ( modified ) {
9595 jQuery.etag[ cacheURL ] = modified;
9596 }
9597 }
9598
9599 // if no content
9600 if ( status === 204 || s.type === "HEAD" ) {
9601 statusText = "nocontent";
9602
9603 // if not modified
9604 } else if ( status === 304 ) {
9605 statusText = "notmodified";
9606
9607 // If we have data, let's convert it
9608 } else {
9609 statusText = response.state;
9610 success = response.data;
9611 error = response.error;
9612 isSuccess = !error;
9613 }
9614 } else {
9615
9616 // Extract error from statusText and normalize for non-aborts
9617 error = statusText;
9618 if ( status || !statusText ) {
9619 statusText = "error";
9620 if ( status < 0 ) {
9621 status = 0;
9622 }
9623 }
9624 }
9625
9626 // Set data for the fake xhr object
9627 jqXHR.status = status;
9628 jqXHR.statusText = ( nativeStatusText || statusText ) + "";
9629
9630 // Success/Error
9631 if ( isSuccess ) {
9632 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
9633 } else {
9634 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
9635 }
9636
9637 // Status-dependent callbacks
9638 jqXHR.statusCode( statusCode );
9639 statusCode = undefined;
9640
9641 if ( fireGlobals ) {
9642 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
9643 [ jqXHR, s, isSuccess ? success : error ] );
9644 }
9645
9646 // Complete
9647 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
9648
9649 if ( fireGlobals ) {
9650 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
9651
9652 // Handle the global AJAX counter
9653 if ( !( --jQuery.active ) ) {
9654 jQuery.event.trigger( "ajaxStop" );
9655 }
9656 }
9657 }
9658
9659 return jqXHR;
9660 },
9661
9662 getJSON: function( url, data, callback ) {
9663 return jQuery.get( url, data, callback, "json" );
9664 },
9665
9666 getScript: function( url, callback ) {
9667 return jQuery.get( url, undefined, callback, "script" );
9668 }
9669} );
9670
9671jQuery.each( [ "get", "post" ], function( i, method ) {
9672 jQuery[ method ] = function( url, data, callback, type ) {
9673
9674 // Shift arguments if data argument was omitted
9675 if ( isFunction( data ) ) {
9676 type = type || callback;
9677 callback = data;
9678 data = undefined;
9679 }
9680
9681 // The url can be an options object (which then must have .url)
9682 return jQuery.ajax( jQuery.extend( {
9683 url: url,
9684 type: method,
9685 dataType: type,
9686 data: data,
9687 success: callback
9688 }, jQuery.isPlainObject( url ) && url ) );
9689 };
9690} );
9691
9692
9693jQuery._evalUrl = function( url, options ) {
9694 return jQuery.ajax( {
9695 url: url,
9696
9697 // Make this explicit, since user can override this through ajaxSetup (#11264)
9698 type: "GET",
9699 dataType: "script",
9700 cache: true,
9701 async: false,
9702 global: false,
9703
9704 // Only evaluate the response if it is successful (gh-4126)
9705 // dataFilter is not invoked for failure responses, so using it instead
9706 // of the default converter is kludgy but it works.
9707 converters: {
9708 "text script": function() {}
9709 },
9710 dataFilter: function( response ) {
9711 jQuery.globalEval( response, options );
9712 }
9713 } );
9714};
9715
9716
9717jQuery.fn.extend( {
9718 wrapAll: function( html ) {
9719 var wrap;
9720
9721 if ( this[ 0 ] ) {
9722 if ( isFunction( html ) ) {
9723 html = html.call( this[ 0 ] );
9724 }
9725
9726 // The elements to wrap the target around
9727 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
9728
9729 if ( this[ 0 ].parentNode ) {
9730 wrap.insertBefore( this[ 0 ] );
9731 }
9732
9733 wrap.map( function() {
9734 var elem = this;
9735
9736 while ( elem.firstElementChild ) {
9737 elem = elem.firstElementChild;
9738 }
9739
9740 return elem;
9741 } ).append( this );
9742 }
9743
9744 return this;
9745 },
9746
9747 wrapInner: function( html ) {
9748 if ( isFunction( html ) ) {
9749 return this.each( function( i ) {
9750 jQuery( this ).wrapInner( html.call( this, i ) );
9751 } );
9752 }
9753
9754 return this.each( function() {
9755 var self = jQuery( this ),
9756 contents = self.contents();
9757
9758 if ( contents.length ) {
9759 contents.wrapAll( html );
9760
9761 } else {
9762 self.append( html );
9763 }
9764 } );
9765 },
9766
9767 wrap: function( html ) {
9768 var htmlIsFunction = isFunction( html );
9769
9770 return this.each( function( i ) {
9771 jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
9772 } );
9773 },
9774
9775 unwrap: function( selector ) {
9776 this.parent( selector ).not( "body" ).each( function() {
9777 jQuery( this ).replaceWith( this.childNodes );
9778 } );
9779 return this;
9780 }
9781} );
9782
9783
9784jQuery.expr.pseudos.hidden = function( elem ) {
9785 return !jQuery.expr.pseudos.visible( elem );
9786};
9787jQuery.expr.pseudos.visible = function( elem ) {
9788 return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
9789};
9790
9791
9792
9793
9794jQuery.ajaxSettings.xhr = function() {
9795 try {
9796 return new window.XMLHttpRequest();
9797 } catch ( e ) {}
9798};
9799
9800var xhrSuccessStatus = {
9801
9802 // File protocol always yields status code 0, assume 200
9803 0: 200,
9804
9805 // Support: IE <=9 only
9806 // #1450: sometimes IE returns 1223 when it should be 204
9807 1223: 204
9808 },
9809 xhrSupported = jQuery.ajaxSettings.xhr();
9810
9811support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
9812support.ajax = xhrSupported = !!xhrSupported;
9813
9814jQuery.ajaxTransport( function( options ) {
9815 var callback, errorCallback;
9816
9817 // Cross domain only allowed if supported through XMLHttpRequest
9818 if ( support.cors || xhrSupported && !options.crossDomain ) {
9819 return {
9820 send: function( headers, complete ) {
9821 var i,
9822 xhr = options.xhr();
9823
9824 xhr.open(
9825 options.type,
9826 options.url,
9827 options.async,
9828 options.username,
9829 options.password
9830 );
9831
9832 // Apply custom fields if provided
9833 if ( options.xhrFields ) {
9834 for ( i in options.xhrFields ) {
9835 xhr[ i ] = options.xhrFields[ i ];
9836 }
9837 }
9838
9839 // Override mime type if needed
9840 if ( options.mimeType && xhr.overrideMimeType ) {
9841 xhr.overrideMimeType( options.mimeType );
9842 }
9843
9844 // X-Requested-With header
9845 // For cross-domain requests, seeing as conditions for a preflight are
9846 // akin to a jigsaw puzzle, we simply never set it to be sure.
9847 // (it can always be set on a per-request basis or even using ajaxSetup)
9848 // For same-domain requests, won't change header if already provided.
9849 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
9850 headers[ "X-Requested-With" ] = "XMLHttpRequest";
9851 }
9852
9853 // Set headers
9854 for ( i in headers ) {
9855 xhr.setRequestHeader( i, headers[ i ] );
9856 }
9857
9858 // Callback
9859 callback = function( type ) {
9860 return function() {
9861 if ( callback ) {
9862 callback = errorCallback = xhr.onload =
9863 xhr.onerror = xhr.onabort = xhr.ontimeout =
9864 xhr.onreadystatechange = null;
9865
9866 if ( type === "abort" ) {
9867 xhr.abort();
9868 } else if ( type === "error" ) {
9869
9870 // Support: IE <=9 only
9871 // On a manual native abort, IE9 throws
9872 // errors on any property access that is not readyState
9873 if ( typeof xhr.status !== "number" ) {
9874 complete( 0, "error" );
9875 } else {
9876 complete(
9877
9878 // File: protocol always yields status 0; see #8605, #14207
9879 xhr.status,
9880 xhr.statusText
9881 );
9882 }
9883 } else {
9884 complete(
9885 xhrSuccessStatus[ xhr.status ] || xhr.status,
9886 xhr.statusText,
9887
9888 // Support: IE <=9 only
9889 // IE9 has no XHR2 but throws on binary (trac-11426)
9890 // For XHR2 non-text, let the caller handle it (gh-2498)
9891 ( xhr.responseType || "text" ) !== "text" ||
9892 typeof xhr.responseText !== "string" ?
9893 { binary: xhr.response } :
9894 { text: xhr.responseText },
9895 xhr.getAllResponseHeaders()
9896 );
9897 }
9898 }
9899 };
9900 };
9901
9902 // Listen to events
9903 xhr.onload = callback();
9904 errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
9905
9906 // Support: IE 9 only
9907 // Use onreadystatechange to replace onabort
9908 // to handle uncaught aborts
9909 if ( xhr.onabort !== undefined ) {
9910 xhr.onabort = errorCallback;
9911 } else {
9912 xhr.onreadystatechange = function() {
9913
9914 // Check readyState before timeout as it changes
9915 if ( xhr.readyState === 4 ) {
9916
9917 // Allow onerror to be called first,
9918 // but that will not handle a native abort
9919 // Also, save errorCallback to a variable
9920 // as xhr.onerror cannot be accessed
9921 window.setTimeout( function() {
9922 if ( callback ) {
9923 errorCallback();
9924 }
9925 } );
9926 }
9927 };
9928 }
9929
9930 // Create the abort callback
9931 callback = callback( "abort" );
9932
9933 try {
9934
9935 // Do send the request (this may raise an exception)
9936 xhr.send( options.hasContent && options.data || null );
9937 } catch ( e ) {
9938
9939 // #14683: Only rethrow if this hasn't been notified as an error yet
9940 if ( callback ) {
9941 throw e;
9942 }
9943 }
9944 },
9945
9946 abort: function() {
9947 if ( callback ) {
9948 callback();
9949 }
9950 }
9951 };
9952 }
9953} );
9954
9955
9956
9957
9958// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
9959jQuery.ajaxPrefilter( function( s ) {
9960 if ( s.crossDomain ) {
9961 s.contents.script = false;
9962 }
9963} );
9964
9965// Install script dataType
9966jQuery.ajaxSetup( {
9967 accepts: {
9968 script: "text/javascript, application/javascript, " +
9969 "application/ecmascript, application/x-ecmascript"
9970 },
9971 contents: {
9972 script: /\b(?:java|ecma)script\b/
9973 },
9974 converters: {
9975 "text script": function( text ) {
9976 jQuery.globalEval( text );
9977 return text;
9978 }
9979 }
9980} );
9981
9982// Handle cache's special case and crossDomain
9983jQuery.ajaxPrefilter( "script", function( s ) {
9984 if ( s.cache === undefined ) {
9985 s.cache = false;
9986 }
9987 if ( s.crossDomain ) {
9988 s.type = "GET";
9989 }
9990} );
9991
9992// Bind script tag hack transport
9993jQuery.ajaxTransport( "script", function( s ) {
9994
9995 // This transport only deals with cross domain or forced-by-attrs requests
9996 if ( s.crossDomain || s.scriptAttrs ) {
9997 var script, callback;
9998 return {
9999 send: function( _, complete ) {
10000 script = jQuery( "<script>" )
10001 .attr( s.scriptAttrs || {} )
10002 .prop( { charset: s.scriptCharset, src: s.url } )
10003 .on( "load error", callback = function( evt ) {
10004 script.remove();
10005 callback = null;
10006 if ( evt ) {
10007 complete( evt.type === "error" ? 404 : 200, evt.type );
10008 }
10009 } );
10010
10011 // Use native DOM manipulation to avoid our domManip AJAX trickery
10012 document.head.appendChild( script[ 0 ] );
10013 },
10014 abort: function() {
10015 if ( callback ) {
10016 callback();
10017 }
10018 }
10019 };
10020 }
10021} );
10022
10023
10024
10025
10026var oldCallbacks = [],
10027 rjsonp = /(=)\?(?=&|$)|\?\?/;
10028
10029// Default jsonp settings
10030jQuery.ajaxSetup( {
10031 jsonp: "callback",
10032 jsonpCallback: function() {
10033 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
10034 this[ callback ] = true;
10035 return callback;
10036 }
10037} );
10038
10039// Detect, normalize options and install callbacks for jsonp requests
10040jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
10041
10042 var callbackName, overwritten, responseContainer,
10043 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
10044 "url" :
10045 typeof s.data === "string" &&
10046 ( s.contentType || "" )
10047 .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
10048 rjsonp.test( s.data ) && "data"
10049 );
10050
10051 // Handle iff the expected data type is "jsonp" or we have a parameter to set
10052 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
10053
10054 // Get callback name, remembering preexisting value associated with it
10055 callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
10056 s.jsonpCallback() :
10057 s.jsonpCallback;
10058
10059 // Insert callback into url or form data
10060 if ( jsonProp ) {
10061 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
10062 } else if ( s.jsonp !== false ) {
10063 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
10064 }
10065
10066 // Use data converter to retrieve json after script execution
10067 s.converters[ "script json" ] = function() {
10068 if ( !responseContainer ) {
10069 jQuery.error( callbackName + " was not called" );
10070 }
10071 return responseContainer[ 0 ];
10072 };
10073
10074 // Force json dataType
10075 s.dataTypes[ 0 ] = "json";
10076
10077 // Install callback
10078 overwritten = window[ callbackName ];
10079 window[ callbackName ] = function() {
10080 responseContainer = arguments;
10081 };
10082
10083 // Clean-up function (fires after converters)
10084 jqXHR.always( function() {
10085
10086 // If previous value didn't exist - remove it
10087 if ( overwritten === undefined ) {
10088 jQuery( window ).removeProp( callbackName );
10089
10090 // Otherwise restore preexisting value
10091 } else {
10092 window[ callbackName ] = overwritten;
10093 }
10094
10095 // Save back as free
10096 if ( s[ callbackName ] ) {
10097
10098 // Make sure that re-using the options doesn't screw things around
10099 s.jsonpCallback = originalSettings.jsonpCallback;
10100
10101 // Save the callback name for future use
10102 oldCallbacks.push( callbackName );
10103 }
10104
10105 // Call if it was a function and we have a response
10106 if ( responseContainer && isFunction( overwritten ) ) {
10107 overwritten( responseContainer[ 0 ] );
10108 }
10109
10110 responseContainer = overwritten = undefined;
10111 } );
10112
10113 // Delegate to script
10114 return "script";
10115 }
10116} );
10117
10118
10119
10120
10121// Support: Safari 8 only
10122// In Safari 8 documents created via document.implementation.createHTMLDocument
10123// collapse sibling forms: the second one becomes a child of the first one.
10124// Because of that, this security measure has to be disabled in Safari 8.
10125// https://bugs.webkit.org/show_bug.cgi?id=137337
10126support.createHTMLDocument = ( function() {
10127 var body = document.implementation.createHTMLDocument( "" ).body;
10128 body.innerHTML = "<form></form><form></form>";
10129 return body.childNodes.length === 2;
10130} )();
10131
10132
10133// Argument "data" should be string of html
10134// context (optional): If specified, the fragment will be created in this context,
10135// defaults to document
10136// keepScripts (optional): If true, will include scripts passed in the html string
10137jQuery.parseHTML = function( data, context, keepScripts ) {
10138 if ( typeof data !== "string" ) {
10139 return [];
10140 }
10141 if ( typeof context === "boolean" ) {
10142 keepScripts = context;
10143 context = false;
10144 }
10145
10146 var base, parsed, scripts;
10147
10148 if ( !context ) {
10149
10150 // Stop scripts or inline event handlers from being executed immediately
10151 // by using document.implementation
10152 if ( support.createHTMLDocument ) {
10153 context = document.implementation.createHTMLDocument( "" );
10154
10155 // Set the base href for the created document
10156 // so any parsed elements with URLs
10157 // are based on the document's URL (gh-2965)
10158 base = context.createElement( "base" );
10159 base.href = document.location.href;
10160 context.head.appendChild( base );
10161 } else {
10162 context = document;
10163 }
10164 }
10165
10166 parsed = rsingleTag.exec( data );
10167 scripts = !keepScripts && [];
10168
10169 // Single tag
10170 if ( parsed ) {
10171 return [ context.createElement( parsed[ 1 ] ) ];
10172 }
10173
10174 parsed = buildFragment( [ data ], context, scripts );
10175
10176 if ( scripts && scripts.length ) {
10177 jQuery( scripts ).remove();
10178 }
10179
10180 return jQuery.merge( [], parsed.childNodes );
10181};
10182
10183
10184/**
10185 * Load a url into a page
10186 */
10187jQuery.fn.load = function( url, params, callback ) {
10188 var selector, type, response,
10189 self = this,
10190 off = url.indexOf( " " );
10191
10192 if ( off > -1 ) {
10193 selector = stripAndCollapse( url.slice( off ) );
10194 url = url.slice( 0, off );
10195 }
10196
10197 // If it's a function
10198 if ( isFunction( params ) ) {
10199
10200 // We assume that it's the callback
10201 callback = params;
10202 params = undefined;
10203
10204 // Otherwise, build a param string
10205 } else if ( params && typeof params === "object" ) {
10206 type = "POST";
10207 }
10208
10209 // If we have elements to modify, make the request
10210 if ( self.length > 0 ) {
10211 jQuery.ajax( {
10212 url: url,
10213
10214 // If "type" variable is undefined, then "GET" method will be used.
10215 // Make value of this field explicit since
10216 // user can override it through ajaxSetup method
10217 type: type || "GET",
10218 dataType: "html",
10219 data: params
10220 } ).done( function( responseText ) {
10221
10222 // Save response for use in complete callback
10223 response = arguments;
10224
10225 self.html( selector ?
10226
10227 // If a selector was specified, locate the right elements in a dummy div
10228 // Exclude scripts to avoid IE 'Permission Denied' errors
10229 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
10230
10231 // Otherwise use the full result
10232 responseText );
10233
10234 // If the request succeeds, this function gets "data", "status", "jqXHR"
10235 // but they are ignored because response was set above.
10236 // If it fails, this function gets "jqXHR", "status", "error"
10237 } ).always( callback && function( jqXHR, status ) {
10238 self.each( function() {
10239 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
10240 } );
10241 } );
10242 }
10243
10244 return this;
10245};
10246
10247
10248
10249
10250// Attach a bunch of functions for handling common AJAX events
10251jQuery.each( [
10252 "ajaxStart",
10253 "ajaxStop",
10254 "ajaxComplete",
10255 "ajaxError",
10256 "ajaxSuccess",
10257 "ajaxSend"
10258], function( i, type ) {
10259 jQuery.fn[ type ] = function( fn ) {
10260 return this.on( type, fn );
10261 };
10262} );
10263
10264
10265
10266
10267jQuery.expr.pseudos.animated = function( elem ) {
10268 return jQuery.grep( jQuery.timers, function( fn ) {
10269 return elem === fn.elem;
10270 } ).length;
10271};
10272
10273
10274
10275
10276jQuery.offset = {
10277 setOffset: function( elem, options, i ) {
10278 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
10279 position = jQuery.css( elem, "position" ),
10280 curElem = jQuery( elem ),
10281 props = {};
10282
10283 // Set position first, in-case top/left are set even on static elem
10284 if ( position === "static" ) {
10285 elem.style.position = "relative";
10286 }
10287
10288 curOffset = curElem.offset();
10289 curCSSTop = jQuery.css( elem, "top" );
10290 curCSSLeft = jQuery.css( elem, "left" );
10291 calculatePosition = ( position === "absolute" || position === "fixed" ) &&
10292 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
10293
10294 // Need to be able to calculate position if either
10295 // top or left is auto and position is either absolute or fixed
10296 if ( calculatePosition ) {
10297 curPosition = curElem.position();
10298 curTop = curPosition.top;
10299 curLeft = curPosition.left;
10300
10301 } else {
10302 curTop = parseFloat( curCSSTop ) || 0;
10303 curLeft = parseFloat( curCSSLeft ) || 0;
10304 }
10305
10306 if ( isFunction( options ) ) {
10307
10308 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
10309 options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
10310 }
10311
10312 if ( options.top != null ) {
10313 props.top = ( options.top - curOffset.top ) + curTop;
10314 }
10315 if ( options.left != null ) {
10316 props.left = ( options.left - curOffset.left ) + curLeft;
10317 }
10318
10319 if ( "using" in options ) {
10320 options.using.call( elem, props );
10321
10322 } else {
10323 curElem.css( props );
10324 }
10325 }
10326};
10327
10328jQuery.fn.extend( {
10329
10330 // offset() relates an element's border box to the document origin
10331 offset: function( options ) {
10332
10333 // Preserve chaining for setter
10334 if ( arguments.length ) {
10335 return options === undefined ?
10336 this :
10337 this.each( function( i ) {
10338 jQuery.offset.setOffset( this, options, i );
10339 } );
10340 }
10341
10342 var rect, win,
10343 elem = this[ 0 ];
10344
10345 if ( !elem ) {
10346 return;
10347 }
10348
10349 // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
10350 // Support: IE <=11 only
10351 // Running getBoundingClientRect on a
10352 // disconnected node in IE throws an error
10353 if ( !elem.getClientRects().length ) {
10354 return { top: 0, left: 0 };
10355 }
10356
10357 // Get document-relative position by adding viewport scroll to viewport-relative gBCR
10358 rect = elem.getBoundingClientRect();
10359 win = elem.ownerDocument.defaultView;
10360 return {
10361 top: rect.top + win.pageYOffset,
10362 left: rect.left + win.pageXOffset
10363 };
10364 },
10365
10366 // position() relates an element's margin box to its offset parent's padding box
10367 // This corresponds to the behavior of CSS absolute positioning
10368 position: function() {
10369 if ( !this[ 0 ] ) {
10370 return;
10371 }
10372
10373 var offsetParent, offset, doc,
10374 elem = this[ 0 ],
10375 parentOffset = { top: 0, left: 0 };
10376
10377 // position:fixed elements are offset from the viewport, which itself always has zero offset
10378 if ( jQuery.css( elem, "position" ) === "fixed" ) {
10379
10380 // Assume position:fixed implies availability of getBoundingClientRect
10381 offset = elem.getBoundingClientRect();
10382
10383 } else {
10384 offset = this.offset();
10385
10386 // Account for the *real* offset parent, which can be the document or its root element
10387 // when a statically positioned element is identified
10388 doc = elem.ownerDocument;
10389 offsetParent = elem.offsetParent || doc.documentElement;
10390 while ( offsetParent &&
10391 ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
10392 jQuery.css( offsetParent, "position" ) === "static" ) {
10393
10394 offsetParent = offsetParent.parentNode;
10395 }
10396 if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
10397
10398 // Incorporate borders into its offset, since they are outside its content origin
10399 parentOffset = jQuery( offsetParent ).offset();
10400 parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
10401 parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
10402 }
10403 }
10404
10405 // Subtract parent offsets and element margins
10406 return {
10407 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
10408 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
10409 };
10410 },
10411
10412 // This method will return documentElement in the following cases:
10413 // 1) For the element inside the iframe without offsetParent, this method will return
10414 // documentElement of the parent window
10415 // 2) For the hidden or detached element
10416 // 3) For body or html element, i.e. in case of the html node - it will return itself
10417 //
10418 // but those exceptions were never presented as a real life use-cases
10419 // and might be considered as more preferable results.
10420 //
10421 // This logic, however, is not guaranteed and can change at any point in the future
10422 offsetParent: function() {
10423 return this.map( function() {
10424 var offsetParent = this.offsetParent;
10425
10426 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
10427 offsetParent = offsetParent.offsetParent;
10428 }
10429
10430 return offsetParent || documentElement;
10431 } );
10432 }
10433} );
10434
10435// Create scrollLeft and scrollTop methods
10436jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
10437 var top = "pageYOffset" === prop;
10438
10439 jQuery.fn[ method ] = function( val ) {
10440 return access( this, function( elem, method, val ) {
10441
10442 // Coalesce documents and windows
10443 var win;
10444 if ( isWindow( elem ) ) {
10445 win = elem;
10446 } else if ( elem.nodeType === 9 ) {
10447 win = elem.defaultView;
10448 }
10449
10450 if ( val === undefined ) {
10451 return win ? win[ prop ] : elem[ method ];
10452 }
10453
10454 if ( win ) {
10455 win.scrollTo(
10456 !top ? val : win.pageXOffset,
10457 top ? val : win.pageYOffset
10458 );
10459
10460 } else {
10461 elem[ method ] = val;
10462 }
10463 }, method, val, arguments.length );
10464 };
10465} );
10466
10467// Support: Safari <=7 - 9.1, Chrome <=37 - 49
10468// Add the top/left cssHooks using jQuery.fn.position
10469// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
10470// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
10471// getComputedStyle returns percent when specified for top/left/bottom/right;
10472// rather than make the css module depend on the offset module, just check for it here
10473jQuery.each( [ "top", "left" ], function( i, prop ) {
10474 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
10475 function( elem, computed ) {
10476 if ( computed ) {
10477 computed = curCSS( elem, prop );
10478
10479 // If curCSS returns percentage, fallback to offset
10480 return rnumnonpx.test( computed ) ?
10481 jQuery( elem ).position()[ prop ] + "px" :
10482 computed;
10483 }
10484 }
10485 );
10486} );
10487
10488
10489// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
10490jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
10491 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
10492 function( defaultExtra, funcName ) {
10493
10494 // Margin is only for outerHeight, outerWidth
10495 jQuery.fn[ funcName ] = function( margin, value ) {
10496 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
10497 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
10498
10499 return access( this, function( elem, type, value ) {
10500 var doc;
10501
10502 if ( isWindow( elem ) ) {
10503
10504 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
10505 return funcName.indexOf( "outer" ) === 0 ?
10506 elem[ "inner" + name ] :
10507 elem.document.documentElement[ "client" + name ];
10508 }
10509
10510 // Get document width or height
10511 if ( elem.nodeType === 9 ) {
10512 doc = elem.documentElement;
10513
10514 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
10515 // whichever is greatest
10516 return Math.max(
10517 elem.body[ "scroll" + name ], doc[ "scroll" + name ],
10518 elem.body[ "offset" + name ], doc[ "offset" + name ],
10519 doc[ "client" + name ]
10520 );
10521 }
10522
10523 return value === undefined ?
10524
10525 // Get width or height on the element, requesting but not forcing parseFloat
10526 jQuery.css( elem, type, extra ) :
10527
10528 // Set width or height on the element
10529 jQuery.style( elem, type, value, extra );
10530 }, type, chainable ? margin : undefined, chainable );
10531 };
10532 } );
10533} );
10534
10535
10536jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
10537 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
10538 "change select submit keydown keypress keyup contextmenu" ).split( " " ),
10539 function( i, name ) {
10540
10541 // Handle event binding
10542 jQuery.fn[ name ] = function( data, fn ) {
10543 return arguments.length > 0 ?
10544 this.on( name, null, data, fn ) :
10545 this.trigger( name );
10546 };
10547} );
10548
10549jQuery.fn.extend( {
10550 hover: function( fnOver, fnOut ) {
10551 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
10552 }
10553} );
10554
10555
10556
10557
10558jQuery.fn.extend( {
10559
10560 bind: function( types, data, fn ) {
10561 return this.on( types, null, data, fn );
10562 },
10563 unbind: function( types, fn ) {
10564 return this.off( types, null, fn );
10565 },
10566
10567 delegate: function( selector, types, data, fn ) {
10568 return this.on( types, selector, data, fn );
10569 },
10570 undelegate: function( selector, types, fn ) {
10571
10572 // ( namespace ) or ( selector, types [, fn] )
10573 return arguments.length === 1 ?
10574 this.off( selector, "**" ) :
10575 this.off( types, selector || "**", fn );
10576 }
10577} );
10578
10579// Bind a function to a context, optionally partially applying any
10580// arguments.
10581// jQuery.proxy is deprecated to promote standards (specifically Function#bind)
10582// However, it is not slated for removal any time soon
10583jQuery.proxy = function( fn, context ) {
10584 var tmp, args, proxy;
10585
10586 if ( typeof context === "string" ) {
10587 tmp = fn[ context ];
10588 context = fn;
10589 fn = tmp;
10590 }
10591
10592 // Quick check to determine if target is callable, in the spec
10593 // this throws a TypeError, but we will just return undefined.
10594 if ( !isFunction( fn ) ) {
10595 return undefined;
10596 }
10597
10598 // Simulated bind
10599 args = slice.call( arguments, 2 );
10600 proxy = function() {
10601 return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
10602 };
10603
10604 // Set the guid of unique handler to the same of original handler, so it can be removed
10605 proxy.guid = fn.guid = fn.guid || jQuery.guid++;
10606
10607 return proxy;
10608};
10609
10610jQuery.holdReady = function( hold ) {
10611 if ( hold ) {
10612 jQuery.readyWait++;
10613 } else {
10614 jQuery.ready( true );
10615 }
10616};
10617jQuery.isArray = Array.isArray;
10618jQuery.parseJSON = JSON.parse;
10619jQuery.nodeName = nodeName;
10620jQuery.isFunction = isFunction;
10621jQuery.isWindow = isWindow;
10622jQuery.camelCase = camelCase;
10623jQuery.type = toType;
10624
10625jQuery.now = Date.now;
10626
10627jQuery.isNumeric = function( obj ) {
10628
10629 // As of jQuery 3.0, isNumeric is limited to
10630 // strings and numbers (primitives or objects)
10631 // that can be coerced to finite numbers (gh-2662)
10632 var type = jQuery.type( obj );
10633 return ( type === "number" || type === "string" ) &&
10634
10635 // parseFloat NaNs numeric-cast false positives ("")
10636 // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
10637 // subtraction forces infinities to NaN
10638 !isNaN( obj - parseFloat( obj ) );
10639};
10640
10641
10642
10643
10644// Register as a named AMD module, since jQuery can be concatenated with other
10645// files that may use define, but not via a proper concatenation script that
10646// understands anonymous AMD modules. A named AMD is safest and most robust
10647// way to register. Lowercase jquery is used because AMD module names are
10648// derived from file names, and jQuery is normally delivered in a lowercase
10649// file name. Do this after creating the global so that if an AMD module wants
10650// to call noConflict to hide this version of jQuery, it will work.
10651
10652// Note that for maximum portability, libraries that are not jQuery should
10653// declare themselves as anonymous modules, and avoid setting a global if an
10654// AMD loader is present. jQuery is a special case. For more information, see
10655// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
10656
10657if ( true ) {
10658 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {
10659 return jQuery;
10660 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
10661 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
10662}
10663
10664
10665
10666
10667var
10668
10669 // Map over jQuery in case of overwrite
10670 _jQuery = window.jQuery,
10671
10672 // Map over the $ in case of overwrite
10673 _$ = window.$;
10674
10675jQuery.noConflict = function( deep ) {
10676 if ( window.$ === jQuery ) {
10677 window.$ = _$;
10678 }
10679
10680 if ( deep && window.jQuery === jQuery ) {
10681 window.jQuery = _jQuery;
10682 }
10683
10684 return jQuery;
10685};
10686
10687// Expose jQuery and $ identifiers, even in AMD
10688// (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
10689// and CommonJS for browser emulators (#13566)
10690if ( !noGlobal ) {
10691 window.jQuery = window.$ = jQuery;
10692}
10693
10694
10695
10696
10697return jQuery;
10698} );
10699
10700
10701/***/ }),
10702
10703/***/ 10:
10704/***/ (function(module, exports) {
10705
10706// obj for removing vowels AND cantillation
10707
10708module.exports = {
10709 // preserves white space
10710 ' ':' ',
10711 // consonants
10712 '×':'×',
10713 '\uFB2E':'×',
10714 '\uFB2F':'×',
10715 '\uFB30':'×',
10716 'ב':'ב',
10717 '\uFB31':'ב',
10718 '\uFB4C':'ב',
10719 '×’':'×’',
10720 '\uFB32':'×’',
10721 'ד':'ד',
10722 '\uFB33':'ד',
10723 '×”':'×”',
10724 '\uFB34':'×”',
10725 'ו':'ו',
10726 '\uFB35':'ו',
10727 '\uFB4B':'ו',
10728 '×–':'×–',
10729 '\uFB36':'×–',
10730 '×—':'×—',
10731 '×':'×',
10732 '\uFB38':'×',
10733 '×™':'×™',
10734 '\uFB39':'×™',
10735 '×›':'×›',
10736 '\uFB3B':'×›',
10737 '\uFB4D':'×›',
10738 'ך':'ך',
10739 '\uFB3A':'ך',
10740 'ל':'ל',
10741 '\uFB3C':'ל',
10742 'מ':'מ',
10743 '\uFB3E':'מ',
10744 'ם':'ם',
10745 '× ':'× ',
10746 '\uFB40':'× ',
10747 'ן':'ן',
10748 'ס':'ס',
10749 '\uFB41':'ס',
10750 'ע':'ע',
10751 'פ':'פ',
10752 '\uFB44':'פ',
10753 '\uFB4E':'פ',
10754 'ף':'ף',
10755 '\uFB43':'ף',
10756 'צ':'צ',
10757 '\uFB46':'\uFB46',
10758 'ץ':'ץ',
10759 '×§':'×§',
10760 '\uFB47':'×§',
10761 'ר':'ר',
10762 '\uFB48':'ר',
10763 'ש':'ש',
10764 '\u05C1':'',
10765 '\u05C2':'',
10766 '\uFB2A':'ש', // ligature for שׁ
10767 '\uFB2C':'ש',
10768 '\uFB2B':'ש', // ligature for שׂ
10769 '\uFB2D':'ש',
10770 'ת':'ת',
10771 '\uFB4A':'ת',
10772 // vowels
10773 '\u05B0':'', // shewa
10774 '\u05B1':'', // hataf segol
10775 '\u05B2':'', // hataf patach
10776 '\u05B3':'', // hataf qamats
10777 '\u05B4':'', // hiriq
10778 '\u05B5':'', // tsere
10779 '\u05B6':'', // segol
10780 '\u05B7':'', // patach
10781 '\u05B8':'', // qamats
10782 '\u05B9':'', // holam
10783 '\u05BA':'', // this is the codepoint for a holam on a const waw, but it is rarely used
10784 '\u05BB':'', // qibbuts
10785 '\u05BC':'',
10786 '\u05BD':'',
10787 '\u05BE':'\u05BE', // maqqef
10788 '\u05BF':'', // rafe
10789 '\u05C7':'', // qamets hatuf/qatan. Not used often, most use a qamats instead
10790 // extra marks and cantillations
10791 '\u0591':'', // athna
10792 '\u0592':'',
10793 '\u0593':'',
10794 '\u0594':'',
10795 '\u0595':'',
10796 '\u0596':'',
10797 '\u0597':'',
10798 '\u0598':'',
10799 '\u0599':'',
10800 '\u059A':'',
10801 '\u059B':'',
10802 '\u059C':'',
10803 '\u059D':'',
10804 '\u059E':'',
10805 '\u059F':'',
10806 '\u05A0':'',
10807 '\u05A1':'',
10808 '\u05A2':'',
10809 '\u05A3':'',
10810 '\u05A4':'',
10811 '\u05A5':'',
10812 '\u05A6':'',
10813 '\u05A7':'',
10814 '\u05A8':'',
10815 '\u05A9':'',
10816 '\u05AA':'',
10817 '\u05AB':'',
10818 '\u05AC':'',
10819 '\u05AD':'',
10820 '\u05AE':'',
10821 '\u05AF':'',
10822 '\u05C3':''
10823}
10824
10825/***/ }),
10826
10827/***/ 2:
10828/***/ (function(module, exports, __webpack_require__) {
10829
10830const transliterate = __webpack_require__(3);
10831const sequence = __webpack_require__(0);
10832const remove = __webpack_require__(8)
10833
10834module.exports = {
10835 transliterate,
10836 sequence,
10837 remove
10838}
10839
10840/***/ }),
10841
10842/***/ 3:
10843/***/ (function(module, exports, __webpack_require__) {
10844
10845const sequence = __webpack_require__(0);
10846const titForTat = __webpack_require__(4);
10847const testEach = __webpack_require__(6);
10848
10849/***
10850 * @param {string} text
10851 * @param {Object} [options]
10852 * @param {boolean} [options.isSeqeunced=true] - sequences text according to SBL Hebrew Font manual
10853 * @param {boolean} [options.qametsQatan=false] - checks for Qamets Qatan
10854 * @returns {string}
10855 */
10856
10857module.exports = (text, options = {'isSeqeunced': true, 'qametsQatan': false}) => {
10858 let newSeq = '';
10859 if(options.isSeqeunced) {
10860 newSeq = sequence(text);
10861 } else {
10862 newSeq = text;
10863 }
10864 let titTat = titForTat(newSeq);
10865 let array = titTat.split(' ');
10866 let modArray = testEach(array, {'qametsQatan': options.qametsQatan});
10867 let transliteration = modArray.join(' ');
10868 return transliteration;
10869}
10870
10871/***/ }),
10872
10873/***/ 4:
10874/***/ (function(module, exports, __webpack_require__) {
10875
10876const hebChars = __webpack_require__(5);
10877
10878/***
10879 * @param {string} text - replaces Heb chars with Latin chars in a tit-for-tat manner
10880 * @return {string}
10881 */
10882
10883module.exports = text => text.replace(/[\u0591-\u05F4, \uFB1D-\uFB4F]/gu, i => hebChars[i]);
10884
10885/***/ }),
10886
10887/***/ 43:
10888/***/ (function(module, exports, __webpack_require__) {
10889
10890module.exports = __webpack_require__(44);
10891
10892
10893/***/ }),
10894
10895/***/ 44:
10896/***/ (function(module, exports, __webpack_require__) {
10897
10898var $ = __webpack_require__(1);
10899var heb = __webpack_require__(2);
10900var transliterate = heb.transliterate;
10901
10902$('#input_button').click(function () {
10903 var qametsQatan = $('input[type=checkbox]').prop('checked');
10904 var hebText = $('#input').val();
10905 var transText = transliterate(hebText, { 'isSeqeunced': true, 'qametsQatan': qametsQatan });
10906 $('#output').val(transText);
10907});
10908
10909/***/ }),
10910
10911/***/ 5:
10912/***/ (function(module, exports) {
10913
10914module.exports = {
10915 // preserves white space
10916 ' ':' ',
10917 // # consonants
10918 // ## BMP
10919 '×':'', // alef sign Ęľ
10920 'ב':'b',
10921 '×’':'g',
10922 'ד':'d',
10923 '×”':'h',
10924 'ו':'w',
10925 '×–':'z',
10926 'ח':'ch', // ḥ
10927 '×':'áą',
10928 '×™':'y',
10929 '×›':'kh',
10930 'ך':'k',
10931 'ל':'l',
10932 'מ':'m',
10933 'ם':'m',
10934 '× ':'n',
10935 'ן':'n',
10936 'ס':'s',
10937 'ע':'', // ajin sign ʿ1
10938 'פ':'p',
10939 'ף':'p',
10940 'צ':'tc', // /ts/tc: ṣ
10941 'ץ':'tc',
10942 '×§':'q',
10943 'ר':'r',
10944 'ש':'s', // s: š
10945 'ת':'t',
10946 // ## Alphabetic Presentation Block
10947 '\uFB2E':'Ęľa',
10948 '\uFB2F':'ĘľÄ',
10949 '\uFB30':'Ęľ9',
10950 '\uFB31':'b9',
10951 '\uFB4C':'b',
10952 '\uFB32':'g9',
10953 '\uFB33':'d9',
10954 '\uFB34':'h9',
10955 '\uFB35':'w9',
10956 '\uFB4B':'Ă´',
10957 '\uFB36':'z9',
10958 '\uFB38':'áą9',
10959 '\uFB39':'y9',
10960 '\uFB3B':'k9',
10961 '\uFB4D':'k',
10962 '\uFB3A':'k9',
10963 '\uFB3C':'l9',
10964 '\uFB3E':'m9',
10965 '\uFB40':'n9',
10966 '\uFB41':'s9',
10967 '\uFB44':'p9',
10968 '\uFB4E':'p',
10969 '\uFB43':'p9',
10970 '\uFB46':'ṣ9',
10971 '\uFB47':'q9',
10972 '\uFB48':'r9',
10973 '\u05C1':'8',
10974 '\u05C2':'7',
10975 '\uFB2A':'š', //ligature for שׁ
10976 '\uFB2C':'š9',
10977 '\uFB2B':'ś', //ligature for שׂ
10978 '\uFB2D':'š9',
10979 '\uFB4A':'t9',
10980 // # vowels
10981 '\u05B0':'~', //~ shewa: Çť
10982 '\u05B1':'Ä•', //hataf segol
10983 '\u05B2':'a', //a: hataf patach: Ä ... EDITOR: the string was included in regular expression tests, but I have removed it because I change this for "a"
10984 '\u05B3':'ĹŹ', //hataf qamats
10985 '\u05B4':'i', //hiriq - yod musí být odstraněno
10986 '\u05B5':'\u00E9', //tsere Ä“
10987 '\u05B6':'e', //segol
10988 '\u05B7':'a', //patach
10989 '\u05B8':'\u00E1', //qamats Ä
10990 '\u05B9':'\u00F3', //holam ĹŤ
10991 '\u05BA':'\u00F3', // ĹŤ this is the codepoint for a holam on a const waw, but it is rarely used
10992 '\u05BB':'u', //qibbuts
10993 '\u05BC': '9', // dagesh
10994 '\u05BD': '', // metheg
10995 '\u05BE':'-', // maqqef
10996 '\u05BF':'', // rafe
10997 '\u05C7':'o', //qamets hatuf/qatan. Not used often, most use a qamats instead
10998 // # extra marks and cantillations
10999 '\u0591':'', //athna
11000 '\u0592':'',
11001 '\u0593':'',
11002 '\u0594':'',
11003 '\u0595':'',
11004 '\u0596':'',
11005 '\u0597':'',
11006 '\u0598':'',
11007 '\u0599':'',
11008 '\u059A':'',
11009 '\u059B':'',
11010 '\u059C':'',
11011 '\u059D':'',
11012 '\u059E':'',
11013 '\u059F':'',
11014 '\u05A0':'',
11015 '\u05A1':'',
11016 '\u05A2':'',
11017 '\u05A3':'',
11018 '\u05A4':'',
11019 '\u05A5':'',
11020 '\u05A6':'',
11021 '\u05A7':'',
11022 '\u05A8':'',
11023 '\u05A9':'',
11024 '\u05AA':'',
11025 '\u05AB':'',
11026 '\u05AC':'',
11027 '\u05AD':'',
11028 '\u05AE':'',
11029 '\u05AF':'',
11030 '\u05C3':'',
11031}
11032
11033/***/ }),
11034
11035/***/ 6:
11036/***/ (function(module, exports, __webpack_require__) {
11037
11038const {changeElementSplit, changeElementSubstr} = __webpack_require__(7);
11039
11040/***
11041 * @param {array} array - an array of strings
11042 * @param {Object} [options]
11043 * @param {boolean} [options.qametsQatan=false] - checks for Qamets Qatan
11044 */
11045
11046module.exports = (array, options = {'qametsQatan': false}) => {
11047 let qametsQatan = options.qametsQatan;
11048 array.forEach( (element, index) => {
11049
11050 // Tests for shin non-ligatures
11051 if (element.includes('8')) {
11052 // 8 is the shin-dot = \u05C1
11053 element = changeElementSplit(element, '8', '');
11054 }
11055
11056 // Tests for sin non-ligatures
11057 if (element.includes('7')) {
11058 // 7 is the sin-dot = \u05C2
11059 element = changeElementSplit(element, 'š7', 'ś');
11060 }
11061 // change i to Ă® if followed by yod
11062 // Tests for hiriq-yod mater
11063 if (/iy(?!~|Ä•|ĹŹ|i|\u00E9|e|a|\u00E1|\u00F3|u|9)/.test(element)) {
11064 element = changeElementSplit(element, /iy(?!~|Ä•|ĹŹ|i|\u00E9|e|a|\u00E1|\u00F3|u|9)/, '\u00ED');
11065 }
11066 // change e: to ĂŞ if followed by yod
11067 // Tests for tsere-yod mater
11068 if (/\u00E9y(?!~|Ä•|ĹŹ|i|\u00E9|e|a|\u00E1|\u00F3|u|9)/.test(element)) {
11069 element = changeElementSplit(element, /\u00E9y(?!~|Ä•|ĹŹ|i|\u00E9|e|a|\u00E1|\u00F3|u|9)/, '\u00E9');
11070 }
11071 // change e: to ĂŞ if followed by yod
11072 // Tests for seghol-yod mater
11073 if (/ey(?!~|Ä•|ĹŹ|i|\u00E9|e|a|\u00E1|\u00F3|u|9)/.test(element)) {
11074 element = changeElementSplit(element, /ey(?!~|Ä•|ĹŹ|i|\u00E9|e|a|\u00E1|\u00F3|u|9)/, '\u00E9');
11075 }
11076 // change o: to Ă´
11077 // Tests for waw as a holem-mater
11078 if (/w\u00F3(?!~|Ä•|ĹŹ|i|\u00E9|e|a|\u00E1|u|9)/.test(element)) {
11079 element = changeElementSplit(element, /w\u00F3(?!~|Ä•|ĹŹ|i|\u00E9|e|a|\u00E1|u|9)/, '\u00F4');
11080 }
11081 // change o: to Ă´
11082 // Tests for waw as a holem-mater
11083 if (/\u00F3w(?!~|Ä•|ĹŹ|i|\u00E9|e|a|\u00E1|u|9)/.test(element)) {
11084 element = changeElementSplit(element, /\u00F3w(?!~|Ä•|ĹŹ|i|\u00E9|e|a|\u00E1|u|9)/, '\u00F4');
11085 }
11086 // change u: for Ă»
11087 // Tests for waw as a shureq-mater
11088 if (/w9(?!~|ĕ|ŏ|i|\u00E9|e|a|\u00E1|â|o|ô|u|û)/.test(element)) {
11089 element = changeElementSplit(element, /w9(?!~|ĕ|ŏ|i|\u00E9|e|a|\u00E1|â|o|ô|u|û)/, '\u00FA'); //
11090 }
11091
11092 // Tests for He as a final mater or with mappiq or tests for furtive patach
11093 if (/\u00E1h$/.test(element) ) { // a: to â
11094 element = changeElementSplit(element, /\u00E1h$/, '\u00E1');
11095 } else if (/\u00E9h$/.test(element)) { // e: to ĂŞ
11096 element = changeElementSplit(element, /\u00E9h$/, '\u00E9');
11097 } else if (/eh$/.test(element)) { // e: to ĂŞ
11098 element = changeElementSplit(element, /eh$/, '\u00E9');
11099 } else if (/h9$/.test(element)) {
11100 element = changeElementSplit(element, /h9$/, 'h');
11101 } else if (/h9a$/.test(element)) {
11102 element = changeElementSplit(element, /h9a$/, 'ah');
11103 } else if (/cha$/.test(element)) {
11104 element = changeElementSplit(element, /cha$/, 'ach');
11105 } else if (/Ęża$/.test(element)) {
11106 element = changeElementSplit(element, /Ęża$/, 'aĘż');
11107 }
11108
11109 // Tests if a shewa exists in the element
11110 if (element.includes('~')) {
11111 let pos = element.indexOf('~');
11112 while (pos !== -1) {
11113 // shewa at the end of a word
11114 if (element.charAt(element.length-1) === '~' ) {
11115 element = changeElementSubstr(element, element.length-1, '');
11116 }
11117 // if the shewa is preceded by a short vowel
11118 if (/~|a|e|i|u|o/.test(element.charAt(pos-2)) ) {
11119 // if it SQeNeM LeVY letters in wayyiqtol forms
11120 if (/s|tc|š|ś|q|n|m|l|w|y/.test(element.charAt(pos-1)) && /w/.test(element.charAt(pos-3)) ) {
11121 element;
11122 } else {
11123 element = changeElementSubstr(element, pos, '');
11124 }
11125 }
11126 pos = element.indexOf('~', pos +1);
11127 }
11128 element = element;
11129 }
11130
11131 // tests for Qamets qatan vs gadol
11132 if (qametsQatan) {
11133 if (/k9\u00E1l-/.test(element) ) {
11134 element = changeElementSplit(element, 'k9\u00E1l-', 'k9ol-');
11135 } else if (/k\u00E1l-/.test(element)) {
11136 element = changeElementSplit(element, 'k\u00E1l-', 'kol-');
11137 }
11138 else if (/ch\u00E1q-/.test(element)) {
11139 element = changeElementSplit(element, 'ch\u00E1q-', 'choq-');
11140 }
11141 }
11142
11143 // tests for a doubling dagesh
11144 if (element.includes('9')) {
11145 const elArray = element.split("");
11146 elArray.forEach( (e, i) => {
11147 if (e === '9' && /a|\u00E1|e|\u00E9|i|Ă®|u|Ă»|o|\u00F3|Ă´/.test(elArray[i-2]) && Boolean(elArray[i-2]) ) {
11148 elArray[i] = elArray[i-1];
11149 }
11150 })
11151 element = elArray.join("");
11152 }
11153
11154 // tests for yhwh
11155 if (element === "y~hwâ") {
11156 element = "yhwh";
11157 } else if (element.includes('y~hwâ')){
11158 element = changeElementSplit(element, 'y~hwâ', 'yhwh');
11159 } else if (element.includes('yhwâ')) {
11160 element = changeElementSplit(element, 'yhwâ', 'yhwh');
11161 }
11162
11163 // removes any remaining digits
11164 if (/\d/.test(element)) {
11165 element = changeElementSplit(element, /\d/, '')
11166 }
11167
11168 array[index] = element;
11169 });  // forEach
11170 return array;
11171}
11172
11173/***/ }),
11174
11175/***/ 7:
11176/***/ (function(module, exports) {
11177
11178module.exports = {
11179 /***
11180 * @param {string} input
11181 * @param {string} split
11182 * @param {string} join
11183 */
11184 changeElementSplit: (input, split, join) => input.split(split).join(join),
11185 /***
11186 * @param {string} input
11187 * @param {number} index
11188 * @param {string} join
11189 */
11190 changeElementSubstr: (input, index, join) => input.substr(0, index) + join + input.substr(index+1, index)
11191}
11192
11193/***/ }),
11194
11195/***/ 8:
11196/***/ (function(module, exports, __webpack_require__) {
11197
11198const hebCharsRC = __webpack_require__(9);
11199const hebCharsRV = __webpack_require__(10);
11200
11201/***
11202 * @param {string} text
11203 * @param {Object} [options]
11204 * @param {boolean} [options.removeVowels=false] - removes vowels in addition to cantillation marks
11205 * @returns {string}
11206 */
11207
11208module.exports = (text, options = {'removeVowels':false}) => {
11209 if (!options.removeVowels) {
11210 return text.replace(/[\u0591-\u05F4, \uFB1D-\uFB4F]/gu, i => hebCharsRC[i]);
11211 } else {
11212 return text.replace(/[\u0591-\u05F4, \uFB1D-\uFB4F]/gu, i => hebCharsRV[i]);
11213 }
11214
11215}
11216
11217/***/ }),
11218
11219/***/ 9:
11220/***/ (function(module, exports) {
11221
11222// obj for removing ONLY cantillation
11223
11224module.exports = {
11225 // preserves white space
11226 ' ':' ',
11227 // consonants
11228 '×':'×',
11229 '\uFB2E':'×',
11230 '\uFB2F':'×',
11231 '\uFB30':'×',
11232 'ב':'ב',
11233 '\uFB31':'ב',
11234 '\uFB4C':'ב',
11235 '×’':'×’',
11236 '\uFB32':'×’',
11237 'ד':'ד',
11238 '\uFB33':'ד',
11239 '×”':'×”',
11240 '\uFB34':'×”',
11241 'ו':'ו',
11242 '\uFB35':'ו',
11243 '\uFB4B':'ו',
11244 '×–':'×–',
11245 '\uFB36':'×–',
11246 '×—':'×—',
11247 '×':'×',
11248 '\uFB38':'×',
11249 '×™':'×™',
11250 '\uFB39':'×™',
11251 '×›':'×›',
11252 '\uFB3B':'×›',
11253 '\uFB4D':'×›',
11254 'ך':'ך',
11255 '\uFB3A':'ך',
11256 'ל':'ל',
11257 '\uFB3C':'ל',
11258 'מ':'מ',
11259 '\uFB3E':'מ',
11260 'ם':'ם',
11261 '× ':'× ',
11262 '\uFB40':'× ',
11263 'ן':'ן',
11264 'ס':'ס',
11265 '\uFB41':'ס',
11266 'ע':'ע',
11267 'פ':'פ',
11268 '\uFB44':'פ',
11269 '\uFB4E':'פ',
11270 'ף':'ף',
11271 '\uFB43':'ף',
11272 'צ':'צ',
11273 '\uFB46':'\uFB46',
11274 'ץ':'ץ',
11275 '×§':'×§',
11276 '\uFB47':'×§',
11277 'ר':'ר',
11278 '\uFB48':'ר',
11279 'ש':'ש',
11280 '\u05C1':'\u05C1',
11281 '\u05C2':'\u05C2',
11282 '\uFB2A':'uFB2A', // ligature for שׁ
11283 '\uFB2C':'uFB2C',
11284 '\uFB2B':'uFB2B', // ligature for שׂ
11285 '\uFB2D':'uFB2D',
11286 'ת':'ת',
11287 '\uFB4A':'ת',
11288 // vowels
11289 '\u05B0':'\u05B0', // shewa
11290 '\u05B1':'\u05B1', // hataf segol
11291 '\u05B2':'\u05B2', // hataf patach
11292 '\u05B3':'\u05B3', // hataf qamats
11293 '\u05B4':'\u05B4', // hiriq
11294 '\u05B5':'\u05B5', // tsere
11295 '\u05B6':'\u05B6', // segol
11296 '\u05B7':'\u05B7', // patach
11297 '\u05B8':'\u05B8', // qamats
11298 '\u05B9':'\u05B9', // holam
11299 '\u05BA':'\u05BA', // this is the codepoint for a holam on a const waw, but it is rarely used
11300 '\u05BB':'\u05BB', // qibbuts
11301 '\u05BC':'\u05BC',
11302 '\u05BD':'',
11303 '\u05BE':'\u05BE', // maqqef
11304 '\u05BF':'', // rafe
11305 '\u05C7':'', // qamets hatuf/qatan. Not used often, most use a qamats instead
11306 // extra marks and cantillations
11307 '\u0591':'', // athna
11308 '\u0592':'',
11309 '\u0593':'',
11310 '\u0594':'',
11311 '\u0595':'',
11312 '\u0596':'',
11313 '\u0597':'',
11314 '\u0598':'',
11315 '\u0599':'',
11316 '\u059A':'',
11317 '\u059B':'',
11318 '\u059C':'',
11319 '\u059D':'',
11320 '\u059E':'',
11321 '\u059F':'',
11322 '\u05A0':'',
11323 '\u05A1':'',
11324 '\u05A2':'',
11325 '\u05A3':'',
11326 '\u05A4':'',
11327 '\u05A5':'',
11328 '\u05A6':'',
11329 '\u05A7':'',
11330 '\u05A8':'',
11331 '\u05A9':'',
11332 '\u05AA':'',
11333 '\u05AB':'',
11334 '\u05AC':'',
11335 '\u05AD':'',
11336 '\u05AE':'',
11337 '\u05AF':'',
11338 '\u05C3':''
11339}
11340
11341/***/ })
11342
11343/******/ });
11344//# sourceMappingURL=transliterate.js.map