webshims-rails 1.11.3.1 → 1.11.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/lib/webshims-rails/version.rb +2 -2
  3. data/vendor/assets/javascripts/webshims/extras/modernizr-custom.js +114 -104
  4. data/vendor/assets/javascripts/webshims/extras/mousepress.js +5 -5
  5. data/vendor/assets/javascripts/webshims/polyfiller.js +156 -207
  6. data/vendor/assets/javascripts/webshims/shims/$ajax.js +862 -0
  7. data/vendor/assets/javascripts/webshims/shims/FlashCanvas/flashcanvas.js +20 -0
  8. data/vendor/assets/javascripts/webshims/shims/FlashCanvasPro/flashcanvas.js +20 -0
  9. data/vendor/assets/javascripts/webshims/shims/color-picker.js +12 -12
  10. data/vendor/assets/javascripts/webshims/shims/combos/1.js +62 -32
  11. data/vendor/assets/javascripts/webshims/shims/combos/10.js +192 -509
  12. data/vendor/assets/javascripts/webshims/shims/combos/11.js +96 -415
  13. data/vendor/assets/javascripts/webshims/shims/combos/12.js +36 -26
  14. data/vendor/assets/javascripts/webshims/shims/combos/13.js +36 -26
  15. data/vendor/assets/javascripts/webshims/shims/combos/14.js +1007 -359
  16. data/vendor/assets/javascripts/webshims/shims/combos/15.js +310 -235
  17. data/vendor/assets/javascripts/webshims/shims/combos/16.js +313 -237
  18. data/vendor/assets/javascripts/webshims/shims/combos/17.js +96 -415
  19. data/vendor/assets/javascripts/webshims/shims/combos/18.js +1003 -678
  20. data/vendor/assets/javascripts/webshims/shims/combos/19.js +1085 -387
  21. data/vendor/assets/javascripts/webshims/shims/combos/2.js +161 -127
  22. data/vendor/assets/javascripts/webshims/shims/combos/20.js +1086 -388
  23. data/vendor/assets/javascripts/webshims/shims/combos/21.js +168 -96
  24. data/vendor/assets/javascripts/webshims/shims/combos/22.js +36 -27
  25. data/vendor/assets/javascripts/webshims/shims/combos/23.js +2 -1
  26. data/vendor/assets/javascripts/webshims/shims/combos/24.js +411 -172
  27. data/vendor/assets/javascripts/webshims/shims/combos/25.js +1085 -387
  28. data/vendor/assets/javascripts/webshims/shims/combos/26.js +96 -94
  29. data/vendor/assets/javascripts/webshims/shims/combos/3.js +163 -140
  30. data/vendor/assets/javascripts/webshims/shims/combos/30.js +166 -141
  31. data/vendor/assets/javascripts/webshims/shims/combos/31.js +159 -126
  32. data/vendor/assets/javascripts/webshims/shims/combos/4.js +103 -109
  33. data/vendor/assets/javascripts/webshims/shims/combos/5.js +98 -417
  34. data/vendor/assets/javascripts/webshims/shims/combos/6.js +101 -418
  35. data/vendor/assets/javascripts/webshims/shims/combos/7.js +168 -142
  36. data/vendor/assets/javascripts/webshims/shims/combos/8.js +165 -141
  37. data/vendor/assets/javascripts/webshims/shims/combos/9.js +195 -510
  38. data/vendor/assets/javascripts/webshims/shims/details.js +2 -2
  39. data/vendor/assets/javascripts/webshims/shims/dom-extend.js +96 -94
  40. data/vendor/assets/javascripts/webshims/shims/es5.js +908 -264
  41. data/vendor/assets/javascripts/webshims/shims/excanvas.js +16 -1
  42. data/vendor/assets/javascripts/webshims/shims/form-combat.js +147 -0
  43. data/vendor/assets/javascripts/webshims/shims/form-core.js +60 -31
  44. data/vendor/assets/javascripts/webshims/shims/form-datalist-lazy.js +114 -33
  45. data/vendor/assets/javascripts/webshims/shims/form-datalist.js +3 -1
  46. data/vendor/assets/javascripts/webshims/shims/form-message.js +7 -15
  47. data/vendor/assets/javascripts/webshims/shims/form-native-extend.js +2 -2
  48. data/vendor/assets/javascripts/webshims/shims/form-number-date-ui.js +88 -410
  49. data/vendor/assets/javascripts/webshims/shims/form-shim-extend.js +143 -93
  50. data/vendor/assets/javascripts/webshims/shims/form-shim-extend2.js +268 -79
  51. data/vendor/assets/javascripts/webshims/shims/form-validation.js +116 -81
  52. data/vendor/assets/javascripts/webshims/shims/form-validators.js +23 -10
  53. data/vendor/assets/javascripts/webshims/shims/forms-picker.js +605 -9
  54. data/vendor/assets/javascripts/webshims/shims/geolocation.js +51 -39
  55. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-de.js +78 -33
  56. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-en.js +24 -6
  57. data/vendor/assets/javascripts/webshims/shims/i18n/formcfg-nl.js +110 -49
  58. data/vendor/assets/javascripts/webshims/shims/json-storage.js +3 -1
  59. data/vendor/assets/javascripts/webshims/shims/mediaelement-core.js +2 -1
  60. data/vendor/assets/javascripts/webshims/shims/mediaelement-jaris.js +81 -30
  61. data/vendor/assets/javascripts/webshims/shims/mediaelement-yt.js +131 -54
  62. data/vendor/assets/javascripts/webshims/shims/plugins/jquery.ui.position.js +497 -0
  63. data/vendor/assets/javascripts/webshims/shims/range-ui.js +8 -5
  64. data/vendor/assets/javascripts/webshims/shims/sizzle.js +2026 -0
  65. data/vendor/assets/javascripts/webshims/shims/styles/forms-ext.css +401 -521
  66. data/vendor/assets/javascripts/webshims/shims/styles/scss/forms-ext.scss +1 -1
  67. data/vendor/assets/javascripts/webshims/shims/styles/scss/shim.scss +94 -82
  68. data/vendor/assets/javascripts/webshims/shims/styles/shim.css +250 -321
  69. data/vendor/assets/javascripts/webshims/shims/swf/JarisFLVPlayer.swf +0 -0
  70. data/vendor/assets/javascripts/webshims/shims/track-ui.js +1 -1
  71. data/vendor/assets/javascripts/webshims/shims/track.js +34 -25
  72. metadata +7 -3
@@ -0,0 +1,2026 @@
1
+ /*!
2
+ * Sizzle CSS Selector Engine v1.10.13
3
+ * http://sizzlejs.com/
4
+ *
5
+ * Copyright 2013 jQuery Foundation, Inc. and other contributors
6
+ * Released under the MIT license
7
+ * http://jquery.org/license
8
+ *
9
+ * Date: 2013-11-14
10
+ */
11
+ (function( window ) {
12
+
13
+ var i,
14
+ support,
15
+ cachedruns,
16
+ Expr,
17
+ getText,
18
+ isXML,
19
+ compile,
20
+ outermostContext,
21
+ sortInput,
22
+ hasDuplicate,
23
+
24
+ // Local document vars
25
+ setDocument,
26
+ document,
27
+ docElem,
28
+ documentIsHTML,
29
+ rbuggyQSA,
30
+ rbuggyMatches,
31
+ matches,
32
+ contains,
33
+
34
+ // Instance-specific data
35
+ expando = "sizzle" + -(new Date()),
36
+ preferredDoc = window.document,
37
+ dirruns = 0,
38
+ done = 0,
39
+ classCache = createCache(),
40
+ tokenCache = createCache(),
41
+ compilerCache = createCache(),
42
+ sortOrder = function( a, b ) {
43
+ if ( a === b ) {
44
+ hasDuplicate = true;
45
+ }
46
+ return 0;
47
+ },
48
+
49
+ // General-purpose constants
50
+ strundefined = typeof undefined,
51
+ MAX_NEGATIVE = 1 << 31,
52
+
53
+ // Instance methods
54
+ hasOwn = ({}).hasOwnProperty,
55
+ arr = [],
56
+ pop = arr.pop,
57
+ push_native = arr.push,
58
+ push = arr.push,
59
+ slice = arr.slice,
60
+ // Use a stripped-down indexOf if we can't use a native one
61
+ indexOf = arr.indexOf || function( elem ) {
62
+ var i = 0,
63
+ len = this.length;
64
+ for ( ; i < len; i++ ) {
65
+ if ( this[i] === elem ) {
66
+ return i;
67
+ }
68
+ }
69
+ return -1;
70
+ },
71
+
72
+ booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
73
+
74
+ // Regular expressions
75
+
76
+ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
77
+ whitespace = "[\\x20\\t\\r\\n\\f]",
78
+ // http://www.w3.org/TR/css3-syntax/#characters
79
+ characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
80
+
81
+ // Loosely modeled on CSS identifier characters
82
+ // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
83
+ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
84
+ identifier = characterEncoding.replace( "w", "w#" ),
85
+
86
+ // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
87
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
88
+ "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
89
+
90
+ // Prefer arguments quoted,
91
+ // then not containing pseudos/brackets,
92
+ // then attribute selectors/non-parenthetical expressions,
93
+ // then anything else
94
+ // These preferences are here to reduce the number of selectors
95
+ // needing tokenize in the PSEUDO preFilter
96
+ pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
97
+
98
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
99
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
100
+
101
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
102
+ rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
103
+
104
+ rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g" ),
105
+
106
+ rpseudo = new RegExp( pseudos ),
107
+ ridentifier = new RegExp( "^" + identifier + "$" ),
108
+
109
+ matchExpr = {
110
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),
111
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
112
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
113
+ "ATTR": new RegExp( "^" + attributes ),
114
+ "PSEUDO": new RegExp( "^" + pseudos ),
115
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
116
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
117
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
118
+ "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
119
+ // For use in libraries implementing .is()
120
+ // We use this for POS matching in `select`
121
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
122
+ whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
123
+ },
124
+
125
+ rinputs = /^(?:input|select|textarea|button)$/i,
126
+ rheader = /^h\d$/i,
127
+
128
+ rnative = /^[^{]+\{\s*\[native \w/,
129
+
130
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
131
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
132
+
133
+ rsibling = /[+~]/,
134
+ rescape = /'|\\/g,
135
+
136
+ // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
137
+ runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
138
+ funescape = function( _, escaped, escapedWhitespace ) {
139
+ var high = "0x" + escaped - 0x10000;
140
+ // NaN means non-codepoint
141
+ // Support: Firefox
142
+ // Workaround erroneous numeric interpretation of +"0x"
143
+ return high !== high || escapedWhitespace ?
144
+ escaped :
145
+ high < 0 ?
146
+ // BMP codepoint
147
+ String.fromCharCode( high + 0x10000 ) :
148
+ // Supplemental Plane codepoint (surrogate pair)
149
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
150
+ };
151
+
152
+ // Optimize for push.apply( _, NodeList )
153
+ try {
154
+ push.apply(
155
+ (arr = slice.call( preferredDoc.childNodes )),
156
+ preferredDoc.childNodes
157
+ );
158
+ // Support: Android<4.0
159
+ // Detect silently failing push.apply
160
+ arr[ preferredDoc.childNodes.length ].nodeType;
161
+ } catch ( e ) {
162
+ push = { apply: arr.length ?
163
+
164
+ // Leverage slice if possible
165
+ function( target, els ) {
166
+ push_native.apply( target, slice.call(els) );
167
+ } :
168
+
169
+ // Support: IE<9
170
+ // Otherwise append directly
171
+ function( target, els ) {
172
+ var j = target.length,
173
+ i = 0;
174
+ // Can't trust NodeList.length
175
+ while ( (target[j++] = els[i++]) ) {}
176
+ target.length = j - 1;
177
+ }
178
+ };
179
+ }
180
+
181
+ function Sizzle( selector, context, results, seed ) {
182
+ var match, elem, m, nodeType,
183
+ // QSA vars
184
+ i, groups, old, nid, newContext, newSelector;
185
+
186
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
187
+ setDocument( context );
188
+ }
189
+
190
+ context = context || document;
191
+ results = results || [];
192
+
193
+ if ( !selector || typeof selector !== "string" ) {
194
+ return results;
195
+ }
196
+
197
+ if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
198
+ return [];
199
+ }
200
+
201
+ if ( documentIsHTML && !seed ) {
202
+
203
+ // Shortcuts
204
+ if ( (match = rquickExpr.exec( selector )) ) {
205
+ // Speed-up: Sizzle("#ID")
206
+ if ( (m = match[1]) ) {
207
+ if ( nodeType === 9 ) {
208
+ elem = context.getElementById( m );
209
+ // Check parentNode to catch when Blackberry 4.6 returns
210
+ // nodes that are no longer in the document (jQuery #6963)
211
+ if ( elem && elem.parentNode ) {
212
+ // Handle the case where IE, Opera, and Webkit return items
213
+ // by name instead of ID
214
+ if ( elem.id === m ) {
215
+ results.push( elem );
216
+ return results;
217
+ }
218
+ } else {
219
+ return results;
220
+ }
221
+ } else {
222
+ // Context is not a document
223
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
224
+ contains( context, elem ) && elem.id === m ) {
225
+ results.push( elem );
226
+ return results;
227
+ }
228
+ }
229
+
230
+ // Speed-up: Sizzle("TAG")
231
+ } else if ( match[2] ) {
232
+ push.apply( results, context.getElementsByTagName( selector ) );
233
+ return results;
234
+
235
+ // Speed-up: Sizzle(".CLASS")
236
+ } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
237
+ push.apply( results, context.getElementsByClassName( m ) );
238
+ return results;
239
+ }
240
+ }
241
+
242
+ // QSA path
243
+ if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
244
+ nid = old = expando;
245
+ newContext = context;
246
+ newSelector = nodeType === 9 && selector;
247
+
248
+ // qSA works strangely on Element-rooted queries
249
+ // We can work around this by specifying an extra ID on the root
250
+ // and working up from there (Thanks to Andrew Dupont for the technique)
251
+ // IE 8 doesn't work on object elements
252
+ if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
253
+ groups = tokenize( selector );
254
+
255
+ if ( (old = context.getAttribute("id")) ) {
256
+ nid = old.replace( rescape, "\\$&" );
257
+ } else {
258
+ context.setAttribute( "id", nid );
259
+ }
260
+ nid = "[id='" + nid + "'] ";
261
+
262
+ i = groups.length;
263
+ while ( i-- ) {
264
+ groups[i] = nid + toSelector( groups[i] );
265
+ }
266
+ newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
267
+ newSelector = groups.join(",");
268
+ }
269
+
270
+ if ( newSelector ) {
271
+ try {
272
+ push.apply( results,
273
+ newContext.querySelectorAll( newSelector )
274
+ );
275
+ return results;
276
+ } catch(qsaError) {
277
+ } finally {
278
+ if ( !old ) {
279
+ context.removeAttribute("id");
280
+ }
281
+ }
282
+ }
283
+ }
284
+ }
285
+
286
+ // All others
287
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );
288
+ }
289
+
290
+ /**
291
+ * Create key-value caches of limited size
292
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
293
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
294
+ * deleting the oldest entry
295
+ */
296
+ function createCache() {
297
+ var keys = [];
298
+
299
+ function cache( key, value ) {
300
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
301
+ if ( keys.push( key + " " ) > Expr.cacheLength ) {
302
+ // Only keep the most recent entries
303
+ delete cache[ keys.shift() ];
304
+ }
305
+ return (cache[ key + " " ] = value);
306
+ }
307
+ return cache;
308
+ }
309
+
310
+ /**
311
+ * Mark a function for special use by Sizzle
312
+ * @param {Function} fn The function to mark
313
+ */
314
+ function markFunction( fn ) {
315
+ fn[ expando ] = true;
316
+ return fn;
317
+ }
318
+
319
+ /**
320
+ * Support testing using an element
321
+ * @param {Function} fn Passed the created div and expects a boolean result
322
+ */
323
+ function assert( fn ) {
324
+ var div = document.createElement("div");
325
+
326
+ try {
327
+ return !!fn( div );
328
+ } catch (e) {
329
+ return false;
330
+ } finally {
331
+ // Remove from its parent by default
332
+ if ( div.parentNode ) {
333
+ div.parentNode.removeChild( div );
334
+ }
335
+ // release memory in IE
336
+ div = null;
337
+ }
338
+ }
339
+
340
+ /**
341
+ * Adds the same handler for all of the specified attrs
342
+ * @param {String} attrs Pipe-separated list of attributes
343
+ * @param {Function} handler The method that will be applied
344
+ */
345
+ function addHandle( attrs, handler ) {
346
+ var arr = attrs.split("|"),
347
+ i = attrs.length;
348
+
349
+ while ( i-- ) {
350
+ Expr.attrHandle[ arr[i] ] = handler;
351
+ }
352
+ }
353
+
354
+ /**
355
+ * Checks document order of two siblings
356
+ * @param {Element} a
357
+ * @param {Element} b
358
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
359
+ */
360
+ function siblingCheck( a, b ) {
361
+ var cur = b && a,
362
+ diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
363
+ ( ~b.sourceIndex || MAX_NEGATIVE ) -
364
+ ( ~a.sourceIndex || MAX_NEGATIVE );
365
+
366
+ // Use IE sourceIndex if available on both nodes
367
+ if ( diff ) {
368
+ return diff;
369
+ }
370
+
371
+ // Check if b follows a
372
+ if ( cur ) {
373
+ while ( (cur = cur.nextSibling) ) {
374
+ if ( cur === b ) {
375
+ return -1;
376
+ }
377
+ }
378
+ }
379
+
380
+ return a ? 1 : -1;
381
+ }
382
+
383
+ /**
384
+ * Returns a function to use in pseudos for input types
385
+ * @param {String} type
386
+ */
387
+ function createInputPseudo( type ) {
388
+ return function( elem ) {
389
+ var name = elem.nodeName.toLowerCase();
390
+ return name === "input" && elem.type === type;
391
+ };
392
+ }
393
+
394
+ /**
395
+ * Returns a function to use in pseudos for buttons
396
+ * @param {String} type
397
+ */
398
+ function createButtonPseudo( type ) {
399
+ return function( elem ) {
400
+ var name = elem.nodeName.toLowerCase();
401
+ return (name === "input" || name === "button") && elem.type === type;
402
+ };
403
+ }
404
+
405
+ /**
406
+ * Returns a function to use in pseudos for positionals
407
+ * @param {Function} fn
408
+ */
409
+ function createPositionalPseudo( fn ) {
410
+ return markFunction(function( argument ) {
411
+ argument = +argument;
412
+ return markFunction(function( seed, matches ) {
413
+ var j,
414
+ matchIndexes = fn( [], seed.length, argument ),
415
+ i = matchIndexes.length;
416
+
417
+ // Match elements found at the specified indexes
418
+ while ( i-- ) {
419
+ if ( seed[ (j = matchIndexes[i]) ] ) {
420
+ seed[j] = !(matches[j] = seed[j]);
421
+ }
422
+ }
423
+ });
424
+ });
425
+ }
426
+
427
+ /**
428
+ * Checks a node for validity as a Sizzle context
429
+ * @param {Element|Object=} context
430
+ * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
431
+ */
432
+ function testContext( context ) {
433
+ return context && typeof context.getElementsByTagName !== strundefined && context;
434
+ }
435
+
436
+ // Expose support vars for convenience
437
+ support = Sizzle.support = {};
438
+
439
+ /**
440
+ * Detects XML nodes
441
+ * @param {Element|Object} elem An element or a document
442
+ * @returns {Boolean} True iff elem is a non-HTML XML node
443
+ */
444
+ isXML = Sizzle.isXML = function( elem ) {
445
+ // documentElement is verified for cases where it doesn't yet exist
446
+ // (such as loading iframes in IE - #4833)
447
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
448
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
449
+ };
450
+
451
+ /**
452
+ * Sets document-related variables once based on the current document
453
+ * @param {Element|Object} [doc] An element or document object to use to set the document
454
+ * @returns {Object} Returns the current document
455
+ */
456
+ setDocument = Sizzle.setDocument = function( node ) {
457
+ var hasCompare,
458
+ doc = node ? node.ownerDocument || node : preferredDoc,
459
+ parent = doc.defaultView;
460
+
461
+ // If no document and documentElement is available, return
462
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
463
+ return document;
464
+ }
465
+
466
+ // Set our document
467
+ document = doc;
468
+ docElem = doc.documentElement;
469
+
470
+ // Support tests
471
+ documentIsHTML = !isXML( doc );
472
+
473
+ // Support: IE>8
474
+ // If iframe document is assigned to "document" variable and if iframe has been reloaded,
475
+ // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
476
+ // IE6-8 do not support the defaultView property so parent will be undefined
477
+ if ( parent && parent !== parent.top ) {
478
+ // IE11 does not have attachEvent, so all must suffer
479
+ if ( parent.addEventListener ) {
480
+ parent.addEventListener( "unload", function() {
481
+ setDocument();
482
+ }, false );
483
+ } else if ( parent.attachEvent ) {
484
+ parent.attachEvent( "onunload", function() {
485
+ setDocument();
486
+ });
487
+ }
488
+ }
489
+
490
+ /* Attributes
491
+ ---------------------------------------------------------------------- */
492
+
493
+ // Support: IE<8
494
+ // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
495
+ support.attributes = assert(function( div ) {
496
+ div.className = "i";
497
+ return !div.getAttribute("className");
498
+ });
499
+
500
+ /* getElement(s)By*
501
+ ---------------------------------------------------------------------- */
502
+
503
+ // Check if getElementsByTagName("*") returns only elements
504
+ support.getElementsByTagName = assert(function( div ) {
505
+ div.appendChild( doc.createComment("") );
506
+ return !div.getElementsByTagName("*").length;
507
+ });
508
+
509
+ // Check if getElementsByClassName can be trusted
510
+ support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) {
511
+ div.innerHTML = "<div class='a'></div><div class='a i'></div>";
512
+
513
+ // Support: Safari<4
514
+ // Catch class over-caching
515
+ div.firstChild.className = "i";
516
+ // Support: Opera<10
517
+ // Catch gEBCN failure to find non-leading classes
518
+ return div.getElementsByClassName("i").length === 2;
519
+ });
520
+
521
+ // Support: IE<10
522
+ // Check if getElementById returns elements by name
523
+ // The broken getElementById methods don't pick up programatically-set names,
524
+ // so use a roundabout getElementsByName test
525
+ support.getById = assert(function( div ) {
526
+ docElem.appendChild( div ).id = expando;
527
+ return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
528
+ });
529
+
530
+ // ID find and filter
531
+ if ( support.getById ) {
532
+ Expr.find["ID"] = function( id, context ) {
533
+ if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
534
+ var m = context.getElementById( id );
535
+ // Check parentNode to catch when Blackberry 4.6 returns
536
+ // nodes that are no longer in the document #6963
537
+ return m && m.parentNode ? [m] : [];
538
+ }
539
+ };
540
+ Expr.filter["ID"] = function( id ) {
541
+ var attrId = id.replace( runescape, funescape );
542
+ return function( elem ) {
543
+ return elem.getAttribute("id") === attrId;
544
+ };
545
+ };
546
+ } else {
547
+ // Support: IE6/7
548
+ // getElementById is not reliable as a find shortcut
549
+ delete Expr.find["ID"];
550
+
551
+ Expr.filter["ID"] = function( id ) {
552
+ var attrId = id.replace( runescape, funescape );
553
+ return function( elem ) {
554
+ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
555
+ return node && node.value === attrId;
556
+ };
557
+ };
558
+ }
559
+
560
+ // Tag
561
+ Expr.find["TAG"] = support.getElementsByTagName ?
562
+ function( tag, context ) {
563
+ if ( typeof context.getElementsByTagName !== strundefined ) {
564
+ return context.getElementsByTagName( tag );
565
+ }
566
+ } :
567
+ function( tag, context ) {
568
+ var elem,
569
+ tmp = [],
570
+ i = 0,
571
+ results = context.getElementsByTagName( tag );
572
+
573
+ // Filter out possible comments
574
+ if ( tag === "*" ) {
575
+ while ( (elem = results[i++]) ) {
576
+ if ( elem.nodeType === 1 ) {
577
+ tmp.push( elem );
578
+ }
579
+ }
580
+
581
+ return tmp;
582
+ }
583
+ return results;
584
+ };
585
+
586
+ // Class
587
+ Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
588
+ if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
589
+ return context.getElementsByClassName( className );
590
+ }
591
+ };
592
+
593
+ /* QSA/matchesSelector
594
+ ---------------------------------------------------------------------- */
595
+
596
+ // QSA and matchesSelector support
597
+
598
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
599
+ rbuggyMatches = [];
600
+
601
+ // qSa(:focus) reports false when true (Chrome 21)
602
+ // We allow this because of a bug in IE8/9 that throws an error
603
+ // whenever `document.activeElement` is accessed on an iframe
604
+ // So, we allow :focus to pass through QSA all the time to avoid the IE error
605
+ // See http://bugs.jquery.com/ticket/13378
606
+ rbuggyQSA = [];
607
+
608
+ if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
609
+ // Build QSA regex
610
+ // Regex strategy adopted from Diego Perini
611
+ assert(function( div ) {
612
+ // Select is set to empty string on purpose
613
+ // This is to test IE's treatment of not explicitly
614
+ // setting a boolean content attribute,
615
+ // since its presence should be enough
616
+ // http://bugs.jquery.com/ticket/12359
617
+ div.innerHTML = "<select><option selected=''></option></select>";
618
+
619
+ // Support: IE8
620
+ // Boolean attributes and "value" are not treated correctly
621
+ if ( !div.querySelectorAll("[selected]").length ) {
622
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
623
+ }
624
+
625
+ // Webkit/Opera - :checked should return selected option elements
626
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
627
+ // IE8 throws error here and will not see later tests
628
+ if ( !div.querySelectorAll(":checked").length ) {
629
+ rbuggyQSA.push(":checked");
630
+ }
631
+ });
632
+
633
+ assert(function( div ) {
634
+
635
+ // Support: Opera 10-12/IE8
636
+ // ^= $= *= and empty values
637
+ // Should not select anything
638
+ // Support: Windows 8 Native Apps
639
+ // The type attribute is restricted during .innerHTML assignment
640
+ var input = doc.createElement("input");
641
+ input.setAttribute( "type", "hidden" );
642
+ div.appendChild( input ).setAttribute( "t", "" );
643
+
644
+ if ( div.querySelectorAll("[t^='']").length ) {
645
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
646
+ }
647
+
648
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
649
+ // IE8 throws error here and will not see later tests
650
+ if ( !div.querySelectorAll(":enabled").length ) {
651
+ rbuggyQSA.push( ":enabled", ":disabled" );
652
+ }
653
+
654
+ // Opera 10-11 does not throw on post-comma invalid pseudos
655
+ div.querySelectorAll("*,:x");
656
+ rbuggyQSA.push(",.*:");
657
+ });
658
+ }
659
+
660
+ if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector ||
661
+ docElem.mozMatchesSelector ||
662
+ docElem.oMatchesSelector ||
663
+ docElem.msMatchesSelector) )) ) {
664
+
665
+ assert(function( div ) {
666
+ // Check to see if it's possible to do matchesSelector
667
+ // on a disconnected node (IE 9)
668
+ support.disconnectedMatch = matches.call( div, "div" );
669
+
670
+ // This should fail with an exception
671
+ // Gecko does not error, returns false instead
672
+ matches.call( div, "[s!='']:x" );
673
+ rbuggyMatches.push( "!=", pseudos );
674
+ });
675
+ }
676
+
677
+ rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
678
+ rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
679
+
680
+ /* Contains
681
+ ---------------------------------------------------------------------- */
682
+ hasCompare = rnative.test( docElem.compareDocumentPosition );
683
+
684
+ // Element contains another
685
+ // Purposefully does not implement inclusive descendent
686
+ // As in, an element does not contain itself
687
+ contains = hasCompare || rnative.test( docElem.contains ) ?
688
+ function( a, b ) {
689
+ var adown = a.nodeType === 9 ? a.documentElement : a,
690
+ bup = b && b.parentNode;
691
+ return a === bup || !!( bup && bup.nodeType === 1 && (
692
+ adown.contains ?
693
+ adown.contains( bup ) :
694
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
695
+ ));
696
+ } :
697
+ function( a, b ) {
698
+ if ( b ) {
699
+ while ( (b = b.parentNode) ) {
700
+ if ( b === a ) {
701
+ return true;
702
+ }
703
+ }
704
+ }
705
+ return false;
706
+ };
707
+
708
+ /* Sorting
709
+ ---------------------------------------------------------------------- */
710
+
711
+ // Document order sorting
712
+ sortOrder = hasCompare ?
713
+ function( a, b ) {
714
+
715
+ // Flag for duplicate removal
716
+ if ( a === b ) {
717
+ hasDuplicate = true;
718
+ return 0;
719
+ }
720
+
721
+ // Sort on method existence if only one input has compareDocumentPosition
722
+ var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
723
+ if ( compare ) {
724
+ return compare;
725
+ }
726
+
727
+ // Calculate position if both inputs belong to the same document
728
+ compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
729
+ a.compareDocumentPosition( b ) :
730
+
731
+ // Otherwise we know they are disconnected
732
+ 1;
733
+
734
+ // Disconnected nodes
735
+ if ( compare & 1 ||
736
+ (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
737
+
738
+ // Choose the first element that is related to our preferred document
739
+ if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
740
+ return -1;
741
+ }
742
+ if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
743
+ return 1;
744
+ }
745
+
746
+ // Maintain original order
747
+ return sortInput ?
748
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
749
+ 0;
750
+ }
751
+
752
+ return compare & 4 ? -1 : 1;
753
+ } :
754
+ function( a, b ) {
755
+ // Exit early if the nodes are identical
756
+ if ( a === b ) {
757
+ hasDuplicate = true;
758
+ return 0;
759
+ }
760
+
761
+ var cur,
762
+ i = 0,
763
+ aup = a.parentNode,
764
+ bup = b.parentNode,
765
+ ap = [ a ],
766
+ bp = [ b ];
767
+
768
+ // Parentless nodes are either documents or disconnected
769
+ if ( !aup || !bup ) {
770
+ return a === doc ? -1 :
771
+ b === doc ? 1 :
772
+ aup ? -1 :
773
+ bup ? 1 :
774
+ sortInput ?
775
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
776
+ 0;
777
+
778
+ // If the nodes are siblings, we can do a quick check
779
+ } else if ( aup === bup ) {
780
+ return siblingCheck( a, b );
781
+ }
782
+
783
+ // Otherwise we need full lists of their ancestors for comparison
784
+ cur = a;
785
+ while ( (cur = cur.parentNode) ) {
786
+ ap.unshift( cur );
787
+ }
788
+ cur = b;
789
+ while ( (cur = cur.parentNode) ) {
790
+ bp.unshift( cur );
791
+ }
792
+
793
+ // Walk down the tree looking for a discrepancy
794
+ while ( ap[i] === bp[i] ) {
795
+ i++;
796
+ }
797
+
798
+ return i ?
799
+ // Do a sibling check if the nodes have a common ancestor
800
+ siblingCheck( ap[i], bp[i] ) :
801
+
802
+ // Otherwise nodes in our document sort first
803
+ ap[i] === preferredDoc ? -1 :
804
+ bp[i] === preferredDoc ? 1 :
805
+ 0;
806
+ };
807
+
808
+ return doc;
809
+ };
810
+
811
+ Sizzle.matches = function( expr, elements ) {
812
+ return Sizzle( expr, null, null, elements );
813
+ };
814
+
815
+ Sizzle.matchesSelector = function( elem, expr ) {
816
+ // Set document vars if needed
817
+ if ( ( elem.ownerDocument || elem ) !== document ) {
818
+ setDocument( elem );
819
+ }
820
+
821
+ // Make sure that attribute selectors are quoted
822
+ expr = expr.replace( rattributeQuotes, "='$1']" );
823
+
824
+ if ( support.matchesSelector && documentIsHTML &&
825
+ ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
826
+ ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
827
+
828
+ try {
829
+ var ret = matches.call( elem, expr );
830
+
831
+ // IE 9's matchesSelector returns false on disconnected nodes
832
+ if ( ret || support.disconnectedMatch ||
833
+ // As well, disconnected nodes are said to be in a document
834
+ // fragment in IE 9
835
+ elem.document && elem.document.nodeType !== 11 ) {
836
+ return ret;
837
+ }
838
+ } catch(e) {}
839
+ }
840
+
841
+ return Sizzle( expr, document, null, [elem] ).length > 0;
842
+ };
843
+
844
+ Sizzle.contains = function( context, elem ) {
845
+ // Set document vars if needed
846
+ if ( ( context.ownerDocument || context ) !== document ) {
847
+ setDocument( context );
848
+ }
849
+ return contains( context, elem );
850
+ };
851
+
852
+ Sizzle.attr = function( elem, name ) {
853
+ // Set document vars if needed
854
+ if ( ( elem.ownerDocument || elem ) !== document ) {
855
+ setDocument( elem );
856
+ }
857
+
858
+ var fn = Expr.attrHandle[ name.toLowerCase() ],
859
+ // Don't get fooled by Object.prototype properties (jQuery #13807)
860
+ val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
861
+ fn( elem, name, !documentIsHTML ) :
862
+ undefined;
863
+
864
+ return val !== undefined ?
865
+ val :
866
+ support.attributes || !documentIsHTML ?
867
+ elem.getAttribute( name ) :
868
+ (val = elem.getAttributeNode(name)) && val.specified ?
869
+ val.value :
870
+ null;
871
+ };
872
+
873
+ Sizzle.error = function( msg ) {
874
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
875
+ };
876
+
877
+ /**
878
+ * Document sorting and removing duplicates
879
+ * @param {ArrayLike} results
880
+ */
881
+ Sizzle.uniqueSort = function( results ) {
882
+ var elem,
883
+ duplicates = [],
884
+ j = 0,
885
+ i = 0;
886
+
887
+ // Unless we *know* we can detect duplicates, assume their presence
888
+ hasDuplicate = !support.detectDuplicates;
889
+ sortInput = !support.sortStable && results.slice( 0 );
890
+ results.sort( sortOrder );
891
+
892
+ if ( hasDuplicate ) {
893
+ while ( (elem = results[i++]) ) {
894
+ if ( elem === results[ i ] ) {
895
+ j = duplicates.push( i );
896
+ }
897
+ }
898
+ while ( j-- ) {
899
+ results.splice( duplicates[ j ], 1 );
900
+ }
901
+ }
902
+
903
+ // Clear input after sorting to release objects
904
+ // See https://github.com/jquery/sizzle/pull/225
905
+ sortInput = null;
906
+
907
+ return results;
908
+ };
909
+
910
+ /**
911
+ * Utility function for retrieving the text value of an array of DOM nodes
912
+ * @param {Array|Element} elem
913
+ */
914
+ getText = Sizzle.getText = function( elem ) {
915
+ var node,
916
+ ret = "",
917
+ i = 0,
918
+ nodeType = elem.nodeType;
919
+
920
+ if ( !nodeType ) {
921
+ // If no nodeType, this is expected to be an array
922
+ while ( (node = elem[i++]) ) {
923
+ // Do not traverse comment nodes
924
+ ret += getText( node );
925
+ }
926
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
927
+ // Use textContent for elements
928
+ // innerText usage removed for consistency of new lines (jQuery #11153)
929
+ if ( typeof elem.textContent === "string" ) {
930
+ return elem.textContent;
931
+ } else {
932
+ // Traverse its children
933
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
934
+ ret += getText( elem );
935
+ }
936
+ }
937
+ } else if ( nodeType === 3 || nodeType === 4 ) {
938
+ return elem.nodeValue;
939
+ }
940
+ // Do not include comment or processing instruction nodes
941
+
942
+ return ret;
943
+ };
944
+
945
+ Expr = Sizzle.selectors = {
946
+
947
+ // Can be adjusted by the user
948
+ cacheLength: 50,
949
+
950
+ createPseudo: markFunction,
951
+
952
+ match: matchExpr,
953
+
954
+ attrHandle: {},
955
+
956
+ find: {},
957
+
958
+ relative: {
959
+ ">": { dir: "parentNode", first: true },
960
+ " ": { dir: "parentNode" },
961
+ "+": { dir: "previousSibling", first: true },
962
+ "~": { dir: "previousSibling" }
963
+ },
964
+
965
+ preFilter: {
966
+ "ATTR": function( match ) {
967
+ match[1] = match[1].replace( runescape, funescape );
968
+
969
+ // Move the given value to match[3] whether quoted or unquoted
970
+ match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
971
+
972
+ if ( match[2] === "~=" ) {
973
+ match[3] = " " + match[3] + " ";
974
+ }
975
+
976
+ return match.slice( 0, 4 );
977
+ },
978
+
979
+ "CHILD": function( match ) {
980
+ /* matches from matchExpr["CHILD"]
981
+ 1 type (only|nth|...)
982
+ 2 what (child|of-type)
983
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
984
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
985
+ 5 sign of xn-component
986
+ 6 x of xn-component
987
+ 7 sign of y-component
988
+ 8 y of y-component
989
+ */
990
+ match[1] = match[1].toLowerCase();
991
+
992
+ if ( match[1].slice( 0, 3 ) === "nth" ) {
993
+ // nth-* requires argument
994
+ if ( !match[3] ) {
995
+ Sizzle.error( match[0] );
996
+ }
997
+
998
+ // numeric x and y parameters for Expr.filter.CHILD
999
+ // remember that false/true cast respectively to 0/1
1000
+ match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
1001
+ match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
1002
+
1003
+ // other types prohibit arguments
1004
+ } else if ( match[3] ) {
1005
+ Sizzle.error( match[0] );
1006
+ }
1007
+
1008
+ return match;
1009
+ },
1010
+
1011
+ "PSEUDO": function( match ) {
1012
+ var excess,
1013
+ unquoted = !match[5] && match[2];
1014
+
1015
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
1016
+ return null;
1017
+ }
1018
+
1019
+ // Accept quoted arguments as-is
1020
+ if ( match[3] && match[4] !== undefined ) {
1021
+ match[2] = match[4];
1022
+
1023
+ // Strip excess characters from unquoted arguments
1024
+ } else if ( unquoted && rpseudo.test( unquoted ) &&
1025
+ // Get excess from tokenize (recursively)
1026
+ (excess = tokenize( unquoted, true )) &&
1027
+ // advance to the next closing parenthesis
1028
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
1029
+
1030
+ // excess is a negative index
1031
+ match[0] = match[0].slice( 0, excess );
1032
+ match[2] = unquoted.slice( 0, excess );
1033
+ }
1034
+
1035
+ // Return only captures needed by the pseudo filter method (type and argument)
1036
+ return match.slice( 0, 3 );
1037
+ }
1038
+ },
1039
+
1040
+ filter: {
1041
+
1042
+ "TAG": function( nodeNameSelector ) {
1043
+ var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
1044
+ return nodeNameSelector === "*" ?
1045
+ function() { return true; } :
1046
+ function( elem ) {
1047
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
1048
+ };
1049
+ },
1050
+
1051
+ "CLASS": function( className ) {
1052
+ var pattern = classCache[ className + " " ];
1053
+
1054
+ return pattern ||
1055
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
1056
+ classCache( className, function( elem ) {
1057
+ return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
1058
+ });
1059
+ },
1060
+
1061
+ "ATTR": function( name, operator, check ) {
1062
+ return function( elem ) {
1063
+ var result = Sizzle.attr( elem, name );
1064
+
1065
+ if ( result == null ) {
1066
+ return operator === "!=";
1067
+ }
1068
+ if ( !operator ) {
1069
+ return true;
1070
+ }
1071
+
1072
+ result += "";
1073
+
1074
+ return operator === "=" ? result === check :
1075
+ operator === "!=" ? result !== check :
1076
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
1077
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
1078
+ operator === "$=" ? check && result.slice( -check.length ) === check :
1079
+ operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
1080
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
1081
+ false;
1082
+ };
1083
+ },
1084
+
1085
+ "CHILD": function( type, what, argument, first, last ) {
1086
+ var simple = type.slice( 0, 3 ) !== "nth",
1087
+ forward = type.slice( -4 ) !== "last",
1088
+ ofType = what === "of-type";
1089
+
1090
+ return first === 1 && last === 0 ?
1091
+
1092
+ // Shortcut for :nth-*(n)
1093
+ function( elem ) {
1094
+ return !!elem.parentNode;
1095
+ } :
1096
+
1097
+ function( elem, context, xml ) {
1098
+ var cache, outerCache, node, diff, nodeIndex, start,
1099
+ dir = simple !== forward ? "nextSibling" : "previousSibling",
1100
+ parent = elem.parentNode,
1101
+ name = ofType && elem.nodeName.toLowerCase(),
1102
+ useCache = !xml && !ofType;
1103
+
1104
+ if ( parent ) {
1105
+
1106
+ // :(first|last|only)-(child|of-type)
1107
+ if ( simple ) {
1108
+ while ( dir ) {
1109
+ node = elem;
1110
+ while ( (node = node[ dir ]) ) {
1111
+ if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
1112
+ return false;
1113
+ }
1114
+ }
1115
+ // Reverse direction for :only-* (if we haven't yet done so)
1116
+ start = dir = type === "only" && !start && "nextSibling";
1117
+ }
1118
+ return true;
1119
+ }
1120
+
1121
+ start = [ forward ? parent.firstChild : parent.lastChild ];
1122
+
1123
+ // non-xml :nth-child(...) stores cache data on `parent`
1124
+ if ( forward && useCache ) {
1125
+ // Seek `elem` from a previously-cached index
1126
+ outerCache = parent[ expando ] || (parent[ expando ] = {});
1127
+ cache = outerCache[ type ] || [];
1128
+ nodeIndex = cache[0] === dirruns && cache[1];
1129
+ diff = cache[0] === dirruns && cache[2];
1130
+ node = nodeIndex && parent.childNodes[ nodeIndex ];
1131
+
1132
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
1133
+
1134
+ // Fallback to seeking `elem` from the start
1135
+ (diff = nodeIndex = 0) || start.pop()) ) {
1136
+
1137
+ // When found, cache indexes on `parent` and break
1138
+ if ( node.nodeType === 1 && ++diff && node === elem ) {
1139
+ outerCache[ type ] = [ dirruns, nodeIndex, diff ];
1140
+ break;
1141
+ }
1142
+ }
1143
+
1144
+ // Use previously-cached element index if available
1145
+ } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
1146
+ diff = cache[1];
1147
+
1148
+ // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
1149
+ } else {
1150
+ // Use the same loop as above to seek `elem` from the start
1151
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
1152
+ (diff = nodeIndex = 0) || start.pop()) ) {
1153
+
1154
+ if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
1155
+ // Cache the index of each encountered element
1156
+ if ( useCache ) {
1157
+ (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
1158
+ }
1159
+
1160
+ if ( node === elem ) {
1161
+ break;
1162
+ }
1163
+ }
1164
+ }
1165
+ }
1166
+
1167
+ // Incorporate the offset, then check against cycle size
1168
+ diff -= last;
1169
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
1170
+ }
1171
+ };
1172
+ },
1173
+
1174
+ "PSEUDO": function( pseudo, argument ) {
1175
+ // pseudo-class names are case-insensitive
1176
+ // http://www.w3.org/TR/selectors/#pseudo-classes
1177
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
1178
+ // Remember that setFilters inherits from pseudos
1179
+ var args,
1180
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
1181
+ Sizzle.error( "unsupported pseudo: " + pseudo );
1182
+
1183
+ // The user may use createPseudo to indicate that
1184
+ // arguments are needed to create the filter function
1185
+ // just as Sizzle does
1186
+ if ( fn[ expando ] ) {
1187
+ return fn( argument );
1188
+ }
1189
+
1190
+ // But maintain support for old signatures
1191
+ if ( fn.length > 1 ) {
1192
+ args = [ pseudo, pseudo, "", argument ];
1193
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
1194
+ markFunction(function( seed, matches ) {
1195
+ var idx,
1196
+ matched = fn( seed, argument ),
1197
+ i = matched.length;
1198
+ while ( i-- ) {
1199
+ idx = indexOf.call( seed, matched[i] );
1200
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
1201
+ }
1202
+ }) :
1203
+ function( elem ) {
1204
+ return fn( elem, 0, args );
1205
+ };
1206
+ }
1207
+
1208
+ return fn;
1209
+ }
1210
+ },
1211
+
1212
+ pseudos: {
1213
+ // Potentially complex pseudos
1214
+ "not": markFunction(function( selector ) {
1215
+ // Trim the selector passed to compile
1216
+ // to avoid treating leading and trailing
1217
+ // spaces as combinators
1218
+ var input = [],
1219
+ results = [],
1220
+ matcher = compile( selector.replace( rtrim, "$1" ) );
1221
+
1222
+ return matcher[ expando ] ?
1223
+ markFunction(function( seed, matches, context, xml ) {
1224
+ var elem,
1225
+ unmatched = matcher( seed, null, xml, [] ),
1226
+ i = seed.length;
1227
+
1228
+ // Match elements unmatched by `matcher`
1229
+ while ( i-- ) {
1230
+ if ( (elem = unmatched[i]) ) {
1231
+ seed[i] = !(matches[i] = elem);
1232
+ }
1233
+ }
1234
+ }) :
1235
+ function( elem, context, xml ) {
1236
+ input[0] = elem;
1237
+ matcher( input, null, xml, results );
1238
+ return !results.pop();
1239
+ };
1240
+ }),
1241
+
1242
+ "has": markFunction(function( selector ) {
1243
+ return function( elem ) {
1244
+ return Sizzle( selector, elem ).length > 0;
1245
+ };
1246
+ }),
1247
+
1248
+ "contains": markFunction(function( text ) {
1249
+ return function( elem ) {
1250
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
1251
+ };
1252
+ }),
1253
+
1254
+ // "Whether an element is represented by a :lang() selector
1255
+ // is based solely on the element's language value
1256
+ // being equal to the identifier C,
1257
+ // or beginning with the identifier C immediately followed by "-".
1258
+ // The matching of C against the element's language value is performed case-insensitively.
1259
+ // The identifier C does not have to be a valid language name."
1260
+ // http://www.w3.org/TR/selectors/#lang-pseudo
1261
+ "lang": markFunction( function( lang ) {
1262
+ // lang value must be a valid identifier
1263
+ if ( !ridentifier.test(lang || "") ) {
1264
+ Sizzle.error( "unsupported lang: " + lang );
1265
+ }
1266
+ lang = lang.replace( runescape, funescape ).toLowerCase();
1267
+ return function( elem ) {
1268
+ var elemLang;
1269
+ do {
1270
+ if ( (elemLang = documentIsHTML ?
1271
+ elem.lang :
1272
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
1273
+
1274
+ elemLang = elemLang.toLowerCase();
1275
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
1276
+ }
1277
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
1278
+ return false;
1279
+ };
1280
+ }),
1281
+
1282
+ // Miscellaneous
1283
+ "target": function( elem ) {
1284
+ var hash = window.location && window.location.hash;
1285
+ return hash && hash.slice( 1 ) === elem.id;
1286
+ },
1287
+
1288
+ "root": function( elem ) {
1289
+ return elem === docElem;
1290
+ },
1291
+
1292
+ "focus": function( elem ) {
1293
+ return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
1294
+ },
1295
+
1296
+ // Boolean properties
1297
+ "enabled": function( elem ) {
1298
+ return elem.disabled === false;
1299
+ },
1300
+
1301
+ "disabled": function( elem ) {
1302
+ return elem.disabled === true;
1303
+ },
1304
+
1305
+ "checked": function( elem ) {
1306
+ // In CSS3, :checked should return both checked and selected elements
1307
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1308
+ var nodeName = elem.nodeName.toLowerCase();
1309
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
1310
+ },
1311
+
1312
+ "selected": function( elem ) {
1313
+ // Accessing this property makes selected-by-default
1314
+ // options in Safari work properly
1315
+ if ( elem.parentNode ) {
1316
+ elem.parentNode.selectedIndex;
1317
+ }
1318
+
1319
+ return elem.selected === true;
1320
+ },
1321
+
1322
+ // Contents
1323
+ "empty": function( elem ) {
1324
+ // http://www.w3.org/TR/selectors/#empty-pseudo
1325
+ // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
1326
+ // but not by others (comment: 8; processing instruction: 7; etc.)
1327
+ // nodeType < 6 works because attributes (2) do not appear as children
1328
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1329
+ if ( elem.nodeType < 6 ) {
1330
+ return false;
1331
+ }
1332
+ }
1333
+ return true;
1334
+ },
1335
+
1336
+ "parent": function( elem ) {
1337
+ return !Expr.pseudos["empty"]( elem );
1338
+ },
1339
+
1340
+ // Element/input types
1341
+ "header": function( elem ) {
1342
+ return rheader.test( elem.nodeName );
1343
+ },
1344
+
1345
+ "input": function( elem ) {
1346
+ return rinputs.test( elem.nodeName );
1347
+ },
1348
+
1349
+ "button": function( elem ) {
1350
+ var name = elem.nodeName.toLowerCase();
1351
+ return name === "input" && elem.type === "button" || name === "button";
1352
+ },
1353
+
1354
+ "text": function( elem ) {
1355
+ var attr;
1356
+ return elem.nodeName.toLowerCase() === "input" &&
1357
+ elem.type === "text" &&
1358
+
1359
+ // Support: IE<8
1360
+ // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
1361
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
1362
+ },
1363
+
1364
+ // Position-in-collection
1365
+ "first": createPositionalPseudo(function() {
1366
+ return [ 0 ];
1367
+ }),
1368
+
1369
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
1370
+ return [ length - 1 ];
1371
+ }),
1372
+
1373
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
1374
+ return [ argument < 0 ? argument + length : argument ];
1375
+ }),
1376
+
1377
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
1378
+ var i = 0;
1379
+ for ( ; i < length; i += 2 ) {
1380
+ matchIndexes.push( i );
1381
+ }
1382
+ return matchIndexes;
1383
+ }),
1384
+
1385
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
1386
+ var i = 1;
1387
+ for ( ; i < length; i += 2 ) {
1388
+ matchIndexes.push( i );
1389
+ }
1390
+ return matchIndexes;
1391
+ }),
1392
+
1393
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
1394
+ var i = argument < 0 ? argument + length : argument;
1395
+ for ( ; --i >= 0; ) {
1396
+ matchIndexes.push( i );
1397
+ }
1398
+ return matchIndexes;
1399
+ }),
1400
+
1401
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
1402
+ var i = argument < 0 ? argument + length : argument;
1403
+ for ( ; ++i < length; ) {
1404
+ matchIndexes.push( i );
1405
+ }
1406
+ return matchIndexes;
1407
+ })
1408
+ }
1409
+ };
1410
+
1411
+ Expr.pseudos["nth"] = Expr.pseudos["eq"];
1412
+
1413
+ // Add button/input type pseudos
1414
+ for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
1415
+ Expr.pseudos[ i ] = createInputPseudo( i );
1416
+ }
1417
+ for ( i in { submit: true, reset: true } ) {
1418
+ Expr.pseudos[ i ] = createButtonPseudo( i );
1419
+ }
1420
+
1421
+ // Easy API for creating new setFilters
1422
+ function setFilters() {}
1423
+ setFilters.prototype = Expr.filters = Expr.pseudos;
1424
+ Expr.setFilters = new setFilters();
1425
+
1426
+ function tokenize( selector, parseOnly ) {
1427
+ var matched, match, tokens, type,
1428
+ soFar, groups, preFilters,
1429
+ cached = tokenCache[ selector + " " ];
1430
+
1431
+ if ( cached ) {
1432
+ return parseOnly ? 0 : cached.slice( 0 );
1433
+ }
1434
+
1435
+ soFar = selector;
1436
+ groups = [];
1437
+ preFilters = Expr.preFilter;
1438
+
1439
+ while ( soFar ) {
1440
+
1441
+ // Comma and first run
1442
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
1443
+ if ( match ) {
1444
+ // Don't consume trailing commas as valid
1445
+ soFar = soFar.slice( match[0].length ) || soFar;
1446
+ }
1447
+ groups.push( (tokens = []) );
1448
+ }
1449
+
1450
+ matched = false;
1451
+
1452
+ // Combinators
1453
+ if ( (match = rcombinators.exec( soFar )) ) {
1454
+ matched = match.shift();
1455
+ tokens.push({
1456
+ value: matched,
1457
+ // Cast descendant combinators to space
1458
+ type: match[0].replace( rtrim, " " )
1459
+ });
1460
+ soFar = soFar.slice( matched.length );
1461
+ }
1462
+
1463
+ // Filters
1464
+ for ( type in Expr.filter ) {
1465
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
1466
+ (match = preFilters[ type ]( match ))) ) {
1467
+ matched = match.shift();
1468
+ tokens.push({
1469
+ value: matched,
1470
+ type: type,
1471
+ matches: match
1472
+ });
1473
+ soFar = soFar.slice( matched.length );
1474
+ }
1475
+ }
1476
+
1477
+ if ( !matched ) {
1478
+ break;
1479
+ }
1480
+ }
1481
+
1482
+ // Return the length of the invalid excess
1483
+ // if we're just parsing
1484
+ // Otherwise, throw an error or return tokens
1485
+ return parseOnly ?
1486
+ soFar.length :
1487
+ soFar ?
1488
+ Sizzle.error( selector ) :
1489
+ // Cache the tokens
1490
+ tokenCache( selector, groups ).slice( 0 );
1491
+ }
1492
+
1493
+ function toSelector( tokens ) {
1494
+ var i = 0,
1495
+ len = tokens.length,
1496
+ selector = "";
1497
+ for ( ; i < len; i++ ) {
1498
+ selector += tokens[i].value;
1499
+ }
1500
+ return selector;
1501
+ }
1502
+
1503
+ function addCombinator( matcher, combinator, base ) {
1504
+ var dir = combinator.dir,
1505
+ checkNonElements = base && dir === "parentNode",
1506
+ doneName = done++;
1507
+
1508
+ return combinator.first ?
1509
+ // Check against closest ancestor/preceding element
1510
+ function( elem, context, xml ) {
1511
+ while ( (elem = elem[ dir ]) ) {
1512
+ if ( elem.nodeType === 1 || checkNonElements ) {
1513
+ return matcher( elem, context, xml );
1514
+ }
1515
+ }
1516
+ } :
1517
+
1518
+ // Check against all ancestor/preceding elements
1519
+ function( elem, context, xml ) {
1520
+ var data, cache, outerCache,
1521
+ dirkey = dirruns + " " + doneName;
1522
+
1523
+ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
1524
+ if ( xml ) {
1525
+ while ( (elem = elem[ dir ]) ) {
1526
+ if ( elem.nodeType === 1 || checkNonElements ) {
1527
+ if ( matcher( elem, context, xml ) ) {
1528
+ return true;
1529
+ }
1530
+ }
1531
+ }
1532
+ } else {
1533
+ while ( (elem = elem[ dir ]) ) {
1534
+ if ( elem.nodeType === 1 || checkNonElements ) {
1535
+ outerCache = elem[ expando ] || (elem[ expando ] = {});
1536
+ if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
1537
+ if ( (data = cache[1]) === true || data === cachedruns ) {
1538
+ return data === true;
1539
+ }
1540
+ } else {
1541
+ cache = outerCache[ dir ] = [ dirkey ];
1542
+ cache[1] = matcher( elem, context, xml ) || cachedruns;
1543
+ if ( cache[1] === true ) {
1544
+ return true;
1545
+ }
1546
+ }
1547
+ }
1548
+ }
1549
+ }
1550
+ };
1551
+ }
1552
+
1553
+ function elementMatcher( matchers ) {
1554
+ return matchers.length > 1 ?
1555
+ function( elem, context, xml ) {
1556
+ var i = matchers.length;
1557
+ while ( i-- ) {
1558
+ if ( !matchers[i]( elem, context, xml ) ) {
1559
+ return false;
1560
+ }
1561
+ }
1562
+ return true;
1563
+ } :
1564
+ matchers[0];
1565
+ }
1566
+
1567
+ function condense( unmatched, map, filter, context, xml ) {
1568
+ var elem,
1569
+ newUnmatched = [],
1570
+ i = 0,
1571
+ len = unmatched.length,
1572
+ mapped = map != null;
1573
+
1574
+ for ( ; i < len; i++ ) {
1575
+ if ( (elem = unmatched[i]) ) {
1576
+ if ( !filter || filter( elem, context, xml ) ) {
1577
+ newUnmatched.push( elem );
1578
+ if ( mapped ) {
1579
+ map.push( i );
1580
+ }
1581
+ }
1582
+ }
1583
+ }
1584
+
1585
+ return newUnmatched;
1586
+ }
1587
+
1588
+ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
1589
+ if ( postFilter && !postFilter[ expando ] ) {
1590
+ postFilter = setMatcher( postFilter );
1591
+ }
1592
+ if ( postFinder && !postFinder[ expando ] ) {
1593
+ postFinder = setMatcher( postFinder, postSelector );
1594
+ }
1595
+ return markFunction(function( seed, results, context, xml ) {
1596
+ var temp, i, elem,
1597
+ preMap = [],
1598
+ postMap = [],
1599
+ preexisting = results.length,
1600
+
1601
+ // Get initial elements from seed or context
1602
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
1603
+
1604
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
1605
+ matcherIn = preFilter && ( seed || !selector ) ?
1606
+ condense( elems, preMap, preFilter, context, xml ) :
1607
+ elems,
1608
+
1609
+ matcherOut = matcher ?
1610
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
1611
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
1612
+
1613
+ // ...intermediate processing is necessary
1614
+ [] :
1615
+
1616
+ // ...otherwise use results directly
1617
+ results :
1618
+ matcherIn;
1619
+
1620
+ // Find primary matches
1621
+ if ( matcher ) {
1622
+ matcher( matcherIn, matcherOut, context, xml );
1623
+ }
1624
+
1625
+ // Apply postFilter
1626
+ if ( postFilter ) {
1627
+ temp = condense( matcherOut, postMap );
1628
+ postFilter( temp, [], context, xml );
1629
+
1630
+ // Un-match failing elements by moving them back to matcherIn
1631
+ i = temp.length;
1632
+ while ( i-- ) {
1633
+ if ( (elem = temp[i]) ) {
1634
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
1635
+ }
1636
+ }
1637
+ }
1638
+
1639
+ if ( seed ) {
1640
+ if ( postFinder || preFilter ) {
1641
+ if ( postFinder ) {
1642
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
1643
+ temp = [];
1644
+ i = matcherOut.length;
1645
+ while ( i-- ) {
1646
+ if ( (elem = matcherOut[i]) ) {
1647
+ // Restore matcherIn since elem is not yet a final match
1648
+ temp.push( (matcherIn[i] = elem) );
1649
+ }
1650
+ }
1651
+ postFinder( null, (matcherOut = []), temp, xml );
1652
+ }
1653
+
1654
+ // Move matched elements from seed to results to keep them synchronized
1655
+ i = matcherOut.length;
1656
+ while ( i-- ) {
1657
+ if ( (elem = matcherOut[i]) &&
1658
+ (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
1659
+
1660
+ seed[temp] = !(results[temp] = elem);
1661
+ }
1662
+ }
1663
+ }
1664
+
1665
+ // Add elements to results, through postFinder if defined
1666
+ } else {
1667
+ matcherOut = condense(
1668
+ matcherOut === results ?
1669
+ matcherOut.splice( preexisting, matcherOut.length ) :
1670
+ matcherOut
1671
+ );
1672
+ if ( postFinder ) {
1673
+ postFinder( null, results, matcherOut, xml );
1674
+ } else {
1675
+ push.apply( results, matcherOut );
1676
+ }
1677
+ }
1678
+ });
1679
+ }
1680
+
1681
+ function matcherFromTokens( tokens ) {
1682
+ var checkContext, matcher, j,
1683
+ len = tokens.length,
1684
+ leadingRelative = Expr.relative[ tokens[0].type ],
1685
+ implicitRelative = leadingRelative || Expr.relative[" "],
1686
+ i = leadingRelative ? 1 : 0,
1687
+
1688
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
1689
+ matchContext = addCombinator( function( elem ) {
1690
+ return elem === checkContext;
1691
+ }, implicitRelative, true ),
1692
+ matchAnyContext = addCombinator( function( elem ) {
1693
+ return indexOf.call( checkContext, elem ) > -1;
1694
+ }, implicitRelative, true ),
1695
+ matchers = [ function( elem, context, xml ) {
1696
+ return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
1697
+ (checkContext = context).nodeType ?
1698
+ matchContext( elem, context, xml ) :
1699
+ matchAnyContext( elem, context, xml ) );
1700
+ } ];
1701
+
1702
+ for ( ; i < len; i++ ) {
1703
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
1704
+ matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
1705
+ } else {
1706
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
1707
+
1708
+ // Return special upon seeing a positional matcher
1709
+ if ( matcher[ expando ] ) {
1710
+ // Find the next relative operator (if any) for proper handling
1711
+ j = ++i;
1712
+ for ( ; j < len; j++ ) {
1713
+ if ( Expr.relative[ tokens[j].type ] ) {
1714
+ break;
1715
+ }
1716
+ }
1717
+ return setMatcher(
1718
+ i > 1 && elementMatcher( matchers ),
1719
+ i > 1 && toSelector(
1720
+ // If the preceding token was a descendant combinator, insert an implicit any-element `*`
1721
+ tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
1722
+ ).replace( rtrim, "$1" ),
1723
+ matcher,
1724
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
1725
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
1726
+ j < len && toSelector( tokens )
1727
+ );
1728
+ }
1729
+ matchers.push( matcher );
1730
+ }
1731
+ }
1732
+
1733
+ return elementMatcher( matchers );
1734
+ }
1735
+
1736
+ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
1737
+ // A counter to specify which element is currently being matched
1738
+ var matcherCachedRuns = 0,
1739
+ bySet = setMatchers.length > 0,
1740
+ byElement = elementMatchers.length > 0,
1741
+ superMatcher = function( seed, context, xml, results, outermost ) {
1742
+ var elem, j, matcher,
1743
+ matchedCount = 0,
1744
+ i = "0",
1745
+ unmatched = seed && [],
1746
+ setMatched = [],
1747
+ contextBackup = outermostContext,
1748
+ // We must always have either seed elements or outermost context
1749
+ elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
1750
+ // Use integer dirruns iff this is the outermost matcher
1751
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
1752
+ len = elems.length;
1753
+
1754
+ if ( outermost ) {
1755
+ outermostContext = context !== document && context;
1756
+ cachedruns = matcherCachedRuns;
1757
+ }
1758
+
1759
+ // Add elements passing elementMatchers directly to results
1760
+ // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
1761
+ // Support: IE<9, Safari
1762
+ // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
1763
+ for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
1764
+ if ( byElement && elem ) {
1765
+ j = 0;
1766
+ while ( (matcher = elementMatchers[j++]) ) {
1767
+ if ( matcher( elem, context, xml ) ) {
1768
+ results.push( elem );
1769
+ break;
1770
+ }
1771
+ }
1772
+ if ( outermost ) {
1773
+ dirruns = dirrunsUnique;
1774
+ cachedruns = ++matcherCachedRuns;
1775
+ }
1776
+ }
1777
+
1778
+ // Track unmatched elements for set filters
1779
+ if ( bySet ) {
1780
+ // They will have gone through all possible matchers
1781
+ if ( (elem = !matcher && elem) ) {
1782
+ matchedCount--;
1783
+ }
1784
+
1785
+ // Lengthen the array for every element, matched or not
1786
+ if ( seed ) {
1787
+ unmatched.push( elem );
1788
+ }
1789
+ }
1790
+ }
1791
+
1792
+ // Apply set filters to unmatched elements
1793
+ matchedCount += i;
1794
+ if ( bySet && i !== matchedCount ) {
1795
+ j = 0;
1796
+ while ( (matcher = setMatchers[j++]) ) {
1797
+ matcher( unmatched, setMatched, context, xml );
1798
+ }
1799
+
1800
+ if ( seed ) {
1801
+ // Reintegrate element matches to eliminate the need for sorting
1802
+ if ( matchedCount > 0 ) {
1803
+ while ( i-- ) {
1804
+ if ( !(unmatched[i] || setMatched[i]) ) {
1805
+ setMatched[i] = pop.call( results );
1806
+ }
1807
+ }
1808
+ }
1809
+
1810
+ // Discard index placeholder values to get only actual matches
1811
+ setMatched = condense( setMatched );
1812
+ }
1813
+
1814
+ // Add matches to results
1815
+ push.apply( results, setMatched );
1816
+
1817
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
1818
+ if ( outermost && !seed && setMatched.length > 0 &&
1819
+ ( matchedCount + setMatchers.length ) > 1 ) {
1820
+
1821
+ Sizzle.uniqueSort( results );
1822
+ }
1823
+ }
1824
+
1825
+ // Override manipulation of globals by nested matchers
1826
+ if ( outermost ) {
1827
+ dirruns = dirrunsUnique;
1828
+ outermostContext = contextBackup;
1829
+ }
1830
+
1831
+ return unmatched;
1832
+ };
1833
+
1834
+ return bySet ?
1835
+ markFunction( superMatcher ) :
1836
+ superMatcher;
1837
+ }
1838
+
1839
+ compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
1840
+ var i,
1841
+ setMatchers = [],
1842
+ elementMatchers = [],
1843
+ cached = compilerCache[ selector + " " ];
1844
+
1845
+ if ( !cached ) {
1846
+ // Generate a function of recursive functions that can be used to check each element
1847
+ if ( !group ) {
1848
+ group = tokenize( selector );
1849
+ }
1850
+ i = group.length;
1851
+ while ( i-- ) {
1852
+ cached = matcherFromTokens( group[i] );
1853
+ if ( cached[ expando ] ) {
1854
+ setMatchers.push( cached );
1855
+ } else {
1856
+ elementMatchers.push( cached );
1857
+ }
1858
+ }
1859
+
1860
+ // Cache the compiled function
1861
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
1862
+ }
1863
+ return cached;
1864
+ };
1865
+
1866
+ function multipleContexts( selector, contexts, results ) {
1867
+ var i = 0,
1868
+ len = contexts.length;
1869
+ for ( ; i < len; i++ ) {
1870
+ Sizzle( selector, contexts[i], results );
1871
+ }
1872
+ return results;
1873
+ }
1874
+
1875
+ function select( selector, context, results, seed ) {
1876
+ var i, tokens, token, type, find,
1877
+ match = tokenize( selector );
1878
+
1879
+ if ( !seed ) {
1880
+ // Try to minimize operations if there is only one group
1881
+ if ( match.length === 1 ) {
1882
+
1883
+ // Take a shortcut and set the context if the root selector is an ID
1884
+ tokens = match[0] = match[0].slice( 0 );
1885
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
1886
+ support.getById && context.nodeType === 9 && documentIsHTML &&
1887
+ Expr.relative[ tokens[1].type ] ) {
1888
+
1889
+ context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
1890
+ if ( !context ) {
1891
+ return results;
1892
+ }
1893
+ selector = selector.slice( tokens.shift().value.length );
1894
+ }
1895
+
1896
+ // Fetch a seed set for right-to-left matching
1897
+ i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
1898
+ while ( i-- ) {
1899
+ token = tokens[i];
1900
+
1901
+ // Abort if we hit a combinator
1902
+ if ( Expr.relative[ (type = token.type) ] ) {
1903
+ break;
1904
+ }
1905
+ if ( (find = Expr.find[ type ]) ) {
1906
+ // Search, expanding context for leading sibling combinators
1907
+ if ( (seed = find(
1908
+ token.matches[0].replace( runescape, funescape ),
1909
+ rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
1910
+ )) ) {
1911
+
1912
+ // If seed is empty or no tokens remain, we can return early
1913
+ tokens.splice( i, 1 );
1914
+ selector = seed.length && toSelector( tokens );
1915
+ if ( !selector ) {
1916
+ push.apply( results, seed );
1917
+ return results;
1918
+ }
1919
+
1920
+ break;
1921
+ }
1922
+ }
1923
+ }
1924
+ }
1925
+ }
1926
+
1927
+ // Compile and execute a filtering function
1928
+ // Provide `match` to avoid retokenization if we modified the selector above
1929
+ compile( selector, match )(
1930
+ seed,
1931
+ context,
1932
+ !documentIsHTML,
1933
+ results,
1934
+ rsibling.test( selector ) && testContext( context.parentNode ) || context
1935
+ );
1936
+ return results;
1937
+ }
1938
+
1939
+ // One-time assignments
1940
+
1941
+ // Sort stability
1942
+ support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
1943
+
1944
+ // Support: Chrome<14
1945
+ // Always assume duplicates if they aren't passed to the comparison function
1946
+ support.detectDuplicates = !!hasDuplicate;
1947
+
1948
+ // Initialize against the default document
1949
+ setDocument();
1950
+
1951
+ // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
1952
+ // Detached nodes confoundingly follow *each other*
1953
+ support.sortDetached = assert(function( div1 ) {
1954
+ // Should return 1, but returns 4 (following)
1955
+ return div1.compareDocumentPosition( document.createElement("div") ) & 1;
1956
+ });
1957
+
1958
+ // Support: IE<8
1959
+ // Prevent attribute/property "interpolation"
1960
+ // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
1961
+ if ( !assert(function( div ) {
1962
+ div.innerHTML = "<a href='#'></a>";
1963
+ return div.firstChild.getAttribute("href") === "#" ;
1964
+ }) ) {
1965
+ addHandle( "type|href|height|width", function( elem, name, isXML ) {
1966
+ if ( !isXML ) {
1967
+ return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
1968
+ }
1969
+ });
1970
+ }
1971
+
1972
+ // Support: IE<9
1973
+ // Use defaultValue in place of getAttribute("value")
1974
+ if ( !support.attributes || !assert(function( div ) {
1975
+ div.innerHTML = "<input/>";
1976
+ div.firstChild.setAttribute( "value", "" );
1977
+ return div.firstChild.getAttribute( "value" ) === "";
1978
+ }) ) {
1979
+ addHandle( "value", function( elem, name, isXML ) {
1980
+ if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
1981
+ return elem.defaultValue;
1982
+ }
1983
+ });
1984
+ }
1985
+
1986
+ // Support: IE<9
1987
+ // Use getAttributeNode to fetch booleans when getAttribute lies
1988
+ if ( !assert(function( div ) {
1989
+ return div.getAttribute("disabled") == null;
1990
+ }) ) {
1991
+ addHandle( booleans, function( elem, name, isXML ) {
1992
+ var val;
1993
+ if ( !isXML ) {
1994
+ return elem[ name ] === true ? name.toLowerCase() :
1995
+ (val = elem.getAttributeNode( name )) && val.specified ?
1996
+ val.value :
1997
+ null;
1998
+ }
1999
+ });
2000
+ }
2001
+
2002
+ // EXPOSE
2003
+ if ( typeof define === "function" && define.amd ) {
2004
+ define(function() { return Sizzle; });
2005
+ // Sizzle requires that there be a global window in Common-JS like environments
2006
+ } else if ( typeof module !== "undefined" && module.exports ) {
2007
+ module.exports = Sizzle;
2008
+ } else {
2009
+ window.Sizzle = Sizzle;
2010
+ }
2011
+
2012
+ // EXPOSE
2013
+
2014
+
2015
+
2016
+ (function(jQuery){
2017
+ jQuery.find = Sizzle;
2018
+ jQuery.expr = Sizzle.selectors;
2019
+ jQuery.expr[":"] = jQuery.expr.pseudos;
2020
+ jQuery.unique = Sizzle.uniqueSort;
2021
+ jQuery.text = Sizzle.getText;
2022
+ jQuery.isXMLDoc = Sizzle.isXML;
2023
+ jQuery.contains = Sizzle.contains;
2024
+ })(window.webshims && window.webshims.$ || window.jQuery, window.Sizzle);
2025
+ })( window );
2026
+