Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

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